@carbon/charts-react 1.11.17 → 1.11.18
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 +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +242 -240
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(X,re){typeof exports=="object"&&typeof module<"u"?re(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],re):(X=typeof globalThis<"u"?globalThis:X||self,re(X.ChartsReact={},X.React))})(this,function(X,re){"use strict";var nV=Object.defineProperty;var rV=(X,re,Tn)=>re in X?nV(X,re,{enumerable:!0,configurable:!0,writable:!0,value:Tn}):X[re]=Tn;var du=(X,re,Tn)=>(rV(X,typeof re!="symbol"?re+"":re,Tn),Tn);var Tn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Tn||{}),fu=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(fu||{}),pu=(e=>(e.UPDATE="model-update",e))(pu||{}),gu=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(gu||{}),mu=(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))(mu||{}),vu=(e=>(e.CHANGE="zoom-domain-change",e))(vu||{}),yu=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(yu||{}),bu=(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))(bu||{}),xu=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(xu||{}),wu=(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))(wu||{}),_u=(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))(_u||{}),Eu=(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))(Eu||{}),Su=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Su||{}),Ou=(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))(Ou||{}),Tu=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Tu||{}),Mu=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Mu||{}),Cu=(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))(Cu||{}),$u=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))($u||{}),Au=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Au||{}),Jr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Jr||{}),Lu=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Lu||{}),ku=(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))(ku||{}),Du=(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))(Du||{}),Ru=(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))(Ru||{}),Iu=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Iu||{}),Nu=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Nu||{}),dr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(dr||{});const Hv=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Ru,Area:xu,Axis:bu,Bar:Su,Boxplot:Ou,CanvasZoom:yu,Chart:Tn,Choropleth:dr,CirclePack:Du,Gauge:Eu,Heatmap:Nu,Legend:ku,Line:Mu,Meter:Iu,Modal:fu,Model:pu,Pie:_u,Radar:Cu,Scatter:Tu,Threshold:Lu,Toolbar:gu,Tooltip:Jr,Tree:$u,Treemap:Au,WordCloud:wu,ZoomBar:mu,ZoomDomain:vu},Symbol.toStringTag,{value:"Module"})),O=Hv;var Q=(e=>(e.HTML="html",e.SVG="svg",e))(Q||{}),Pu=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Pu||{}),tt=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(tt||{}),H=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(H||{}),je=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(je||{}),De=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(De||{}),Qt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Qt||{}),Z=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(Z||{}),ti=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(ti||{}),qt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(qt||{}),ei=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(ei||{}),lo=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(lo||{}),$t=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))($t||{}),at=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(at||{}),fr=(e=>(e.CENTER="center",e))(fr||{}),ls=(e=>(e.LEFT="left",e.RIGHT="right",e))(ls||{}),Yt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Yt||{}),nn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(nn||{}),rn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(rn||{}),pr=(e=>(e.SEMI="semi",e.FULL="full",e))(pr||{}),co=(e=>(e.UP="up",e.DOWN="down",e))(co||{}),cs=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(cs||{}),us=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(us||{}),Te=(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))(Te||{}),Bt=(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))(Bt||{}),uo=(e=>(e.LEFT="left",e.RIGHT="right",e))(uo||{}),Xt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Xt||{}),hs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(hs||{}),ni=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(ni||{}),ds=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(ds||{}),sn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(sn||{});function Bn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Fv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ho(e){let t,n,r;e.length!==2?(t=Bn,n=(o,l)=>Bn(e(o),l),r=(o,l)=>e(o)-l):(t=e===Bn||e===Fv?e:Gv,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 h=c+u>>>1;n(o[h],l)<0?c=h+1:u=h}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 h=c+u>>>1;n(o[h],l)<=0?c=h+1:u=h}while(c<u)}return c}function a(o,l,c=0,u=o.length){const h=i(o,l,c,u-1);return h>c&&r(o[h-1],l)>-r(o[h],l)?h-1:h}return{left:i,center:a,right:s}}function Gv(){return 0}function zv(e){return e===null?NaN:+e}function*jv(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 Wv=ho(Bn).right;ho(zv).center;const fo=Wv;function qv(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 Re(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 Vn{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 Uu extends Map{constructor(t,n=Zv){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(Bu(this,t))}has(t){return super.has(Bu(this,t))}set(t,n){return super.set(Yv(this,t),n)}delete(t){return super.delete(Xv(this,t))}}function Bu({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Yv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Xv({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Zv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Kv(e){return e}function Qv(e=Bn){if(e===Bn)return Vu;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 Vu(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Jv=Array.prototype,t0=Jv.slice;function po(e){return()=>e}const e0=Math.sqrt(50),n0=Math.sqrt(10),r0=Math.sqrt(2);function fs(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>=e0?10:s>=n0?5:s>=r0?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?fs(e,t,n*2):[o,l,c]}function ps(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?fs(t,e,n):fs(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 gr(e,t,n){return t=+t,e=+e,n=+n,fs(e,t,n)[2]}function go(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?gr(t,e,n):gr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function i0(e,t,n){let r;for(;;){const i=gr(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 s0(e){return Math.max(1,Math.ceil(Math.log(qv(e))/Math.LN2)+1)}function a0(){var e=Kv,t=Re,n=s0;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),h=u[0],d=u[1],f=n(c,h,d);if(!Array.isArray(f)){const b=d,S=+f;if(t===Re&&([h,d]=i0(h,d,S)),f=ps(h,d,S),f[0]<=h&&(l=gr(h,d,S)),f[f.length-1]>=d)if(b>=d&&t===Re){const _=gr(h,d,S);isFinite(_)&&(_>0?d=(Math.floor(d/_)+1)*_:_<0&&(d=(Math.ceil(d*-_)+1)/-_))}else f.pop()}for(var p=f.length,m=0,g=p;f[m]<=h;)++m;for(;f[g-1]>d;)--g;(m||g<p)&&(f=f.slice(m,g),p=g-m);var v=new Array(p+1),y;for(s=0;s<=p;++s)y=v[s]=[],y.x0=s>0?f[s-1]:h,y.x1=s<p?f[s]:d;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[Math.min(p,Math.floor((o-h)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&h<=o&&o<=d){const b=Math.floor((h-o)*l);v[Math.min(p,b+(f[b]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[fo(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:po(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:po([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:po(Array.isArray(i)?t0.call(i):i),r):n},r}function Hn(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 Mn(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 Hu(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?Vu:Qv(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*h/l+d)),p=Math.min(r,Math.floor(t+(l-c)*h/l+d));Hu(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(ri(e,n,t),i(e[r],s)>0&&ri(e,n,r);a<o;){for(ri(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?ri(e,n,o):(++o,ri(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function ri(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function mo(e,t,n){if(e=Float64Array.from(jv(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Mn(e);if(t>=1)return Hn(e);var r,i=(r-1)*t,s=Math.floor(i),a=Hn(Hu(e,s).subarray(0,s+1)),o=Mn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*o0(e){for(const t of e)yield*t}function Fu(e){return Array.from(o0(e))}function l0(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 c0(e){return e}var gs=1,ms=2,vo=3,ii=4,Gu=1e-6;function u0(e){return"translate("+e+",0)"}function h0(e){return"translate(0,"+e+")"}function d0(e){return t=>+e(t)}function f0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function p0(){return!this.__axis}function vs(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===gs||e===ii?-1:1,u=e===ii||e===ms?"x":"y",h=e===gs||e===vo?u0:h0;function d(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):c0),g=Math.max(s,0)+o,v=t.range(),y=+v[0]+l,b=+v[v.length-1]+l,S=(t.bandwidth?f0:d0)(t.copy(),l),_=f.selection?f.selection():f,E=_.selectAll(".domain").data([null]),T=_.selectAll(".tick").data(p,t).order(),D=T.exit(),N=T.enter().append("g").attr("class","tick"),A=T.select("line"),C=T.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(N),A=A.merge(N.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),C=C.merge(N.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",e===gs?"0em":e===vo?"0.71em":"0.32em")),f!==_&&(E=E.transition(f),T=T.transition(f),A=A.transition(f),C=C.transition(f),D=D.transition(f).attr("opacity",Gu).attr("transform",function(V){return isFinite(V=S(V))?h(V+l):this.getAttribute("transform")}),N.attr("opacity",Gu).attr("transform",function(V){var M=this.parentNode.__axis;return h((M&&isFinite(M=M(V))?M:S(V))+l)})),D.remove(),E.attr("d",e===ii||e===ms?a?"M"+c*a+","+y+"H"+l+"V"+b+"H"+c*a:"M"+l+","+y+"V"+b:a?"M"+y+","+c*a+"V"+l+"H"+b+"V"+c*a:"M"+y+","+l+"H"+b),T.attr("opacity",1).attr("transform",function(V){return h(S(V)+l)}),A.attr(u+"2",c*s),C.attr(u,c*g).text(m),_.filter(p0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ms?"start":e===ii?"end":"middle"),_.each(function(){this.__axis=S})}return d.scale=function(f){return arguments.length?(t=f,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),d):n.slice()},d.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),d):r&&r.slice()},d.tickFormat=function(f){return arguments.length?(i=f,d):i},d.tickSize=function(f){return arguments.length?(s=a=+f,d):s},d.tickSizeInner=function(f){return arguments.length?(s=+f,d):s},d.tickSizeOuter=function(f){return arguments.length?(a=+f,d):a},d.tickPadding=function(f){return arguments.length?(o=+f,d):o},d.offset=function(f){return arguments.length?(l=+f,d):l},d}function g0(e){return vs(gs,e)}function m0(e){return vs(ms,e)}function yo(e){return vs(vo,e)}function zu(e){return vs(ii,e)}var v0={value:()=>{}};function bo(){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 ys(n)}function ys(e){this._=e}function y0(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}})}ys.prototype=bo.prototype={constructor:ys,on:function(e,t){var n=this._,r=y0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=b0(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]=ju(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ju(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 ys(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 b0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ju(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=v0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var xo="http://www.w3.org/1999/xhtml";const Wu={svg:"http://www.w3.org/2000/svg",xhtml:xo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Wu.hasOwnProperty(t)?{space:Wu[t],local:e}:e}function x0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===xo&&t.documentElement.namespaceURI===xo?t.createElement(e):t.createElementNS(n,e)}}function w0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function qu(e){var t=bs(e);return(t.local?w0:x0)(t)}function _0(){}function wo(e){return e==null?_0:function(){return this.querySelector(e)}}function E0(e){typeof e!="function"&&(e=wo(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 be(r,this._parents)}function S0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function O0(){return[]}function Yu(e){return e==null?O0:function(){return this.querySelectorAll(e)}}function T0(e){return function(){return S0(e.apply(this,arguments))}}function M0(e){typeof e=="function"?e=T0(e):e=Yu(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 be(r,i)}function Xu(e){return function(){return this.matches(e)}}function Zu(e){return function(t){return t.matches(e)}}var C0=Array.prototype.find;function $0(e){return function(){return C0.call(this.children,e)}}function A0(){return this.firstElementChild}function L0(e){return this.select(e==null?A0:$0(typeof e=="function"?e:Zu(e)))}var k0=Array.prototype.filter;function D0(){return Array.from(this.children)}function R0(e){return function(){return k0.call(this.children,e)}}function I0(e){return this.selectAll(e==null?D0:R0(typeof e=="function"?e:Zu(e)))}function N0(e){typeof e!="function"&&(e=Xu(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 be(r,this._parents)}function Ku(e){return new Array(e.length)}function P0(){return new be(this._enter||this._groups.map(Ku),this._parents)}function xs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}xs.prototype={constructor:xs,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 U0(e){return function(){return e}}function B0(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 xs(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function V0(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,h=s.length,d=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(d[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<h;++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 xs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(d[o])===l&&(i[o]=l)}function H0(e){return e.__data__}function F0(e,t){if(!arguments.length)return Array.from(this,H0);var n=t?V0:B0,r=this._parents,i=this._groups;typeof e!="function"&&(e=U0(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],h=i[c],d=h.length,f=G0(e.call(u,u&&u.__data__,c,r)),p=f.length,m=o[c]=new Array(p),g=a[c]=new Array(p),v=l[c]=new Array(d);n(u,h,m,g,v,f,t);for(var y=0,b=0,S,_;y<p;++y)if(S=m[y]){for(y>=b&&(b=y+1);!(_=g[b])&&++b<p;);S._next=_||null}}return a=new be(a,r),a._enter=o,a._exit=l,a}function G0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function z0(){return new be(this._exit||this._groups.map(Ku),this._parents)}function j0(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 W0(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],h=c.length,d=o[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||u[p])&&(d[p]=f);for(;l<i;++l)o[l]=n[l];return new be(o,this._parents)}function q0(){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 Y0(e){e||(e=X0);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}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 be(i,this._parents).order()}function X0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Z0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function K0(){return Array.from(this)}function Q0(){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 J0(){let e=0;for(const t of this)++e;return e}function ty(){return!this.node()}function ey(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 ny(e){return function(){this.removeAttribute(e)}}function ry(e){return function(){this.removeAttributeNS(e.space,e.local)}}function iy(e,t){return function(){this.setAttribute(e,t)}}function sy(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ay(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function oy(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 ly(e,t){var n=bs(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?ry:ny:typeof t=="function"?n.local?oy:ay:n.local?sy:iy)(n,t))}function Qu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function cy(e){return function(){this.style.removeProperty(e)}}function uy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function hy(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function dy(e,t,n){return arguments.length>1?this.each((t==null?cy:typeof t=="function"?hy:uy)(e,t,n??"")):mr(this.node(),e)}function mr(e,t){return e.style.getPropertyValue(t)||Qu(e).getComputedStyle(e,null).getPropertyValue(t)}function fy(e){return function(){delete this[e]}}function py(e,t){return function(){this[e]=t}}function gy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function my(e,t){return arguments.length>1?this.each((t==null?fy:typeof t=="function"?gy:py)(e,t)):this.node()[e]}function Ju(e){return e.trim().split(/^|\s+/)}function _o(e){return e.classList||new th(e)}function th(e){this._node=e,this._names=Ju(e.getAttribute("class")||"")}th.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 eh(e,t){for(var n=_o(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function nh(e,t){for(var n=_o(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function vy(e){return function(){eh(this,e)}}function yy(e){return function(){nh(this,e)}}function by(e,t){return function(){(t.apply(this,arguments)?eh:nh)(this,e)}}function xy(e,t){var n=Ju(e+"");if(arguments.length<2){for(var r=_o(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?by:t?vy:yy)(n,t))}function wy(){this.textContent=""}function _y(e){return function(){this.textContent=e}}function Ey(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Sy(e){return arguments.length?this.each(e==null?wy:(typeof e=="function"?Ey:_y)(e)):this.node().textContent}function Oy(){this.innerHTML=""}function Ty(e){return function(){this.innerHTML=e}}function My(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Cy(e){return arguments.length?this.each(e==null?Oy:(typeof e=="function"?My:Ty)(e)):this.node().innerHTML}function $y(){this.nextSibling&&this.parentNode.appendChild(this)}function Ay(){return this.each($y)}function Ly(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ky(){return this.each(Ly)}function Dy(e){var t=typeof e=="function"?e:qu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ry(){return null}function Iy(e,t){var n=typeof e=="function"?e:qu(e),r=t==null?Ry:typeof t=="function"?t:wo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ny(){var e=this.parentNode;e&&e.removeChild(this)}function Py(){return this.each(Ny)}function Uy(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function By(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vy(e){return this.select(e?By:Uy)}function Hy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Fy(e){return function(t){e.call(this,t,this.__data__)}}function Gy(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 zy(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 jy(e,t,n){return function(){var r=this.__on,i,s=Fy(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 Wy(e,t,n){var r=Gy(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?jy:zy,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function rh(e,t,n){var r=Qu(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 qy(e,t){return function(){return rh(this,e,t)}}function Yy(e,t){return function(){return rh(this,e,t.apply(this,arguments))}}function Xy(e,t){return this.each((typeof t=="function"?Yy:qy)(e,t))}function*Zy(){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 ih=[null];function be(e,t){this._groups=e,this._parents=t}function si(){return new be([[document.documentElement]],ih)}function Ky(){return this}be.prototype=si.prototype={constructor:be,select:E0,selectAll:M0,selectChild:L0,selectChildren:I0,filter:N0,data:F0,enter:P0,exit:z0,join:j0,merge:W0,selection:Ky,order:q0,sort:Y0,call:Z0,nodes:K0,node:Q0,size:J0,empty:ty,each:ey,attr:ly,style:dy,property:my,classed:xy,text:Sy,html:Cy,raise:Ay,lower:ky,append:Dy,insert:Iy,remove:Py,clone:Vy,datum:Hy,on:Wy,dispatch:Xy,[Symbol.iterator]:Zy};function R(e){return typeof e=="string"?new be([[document.querySelector(e)]],[document.documentElement]):new be([[e]],ih)}function Qy(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Fn(e,t){if(e=Qy(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 Eo={capture:!0,passive:!1};function So(e){e.preventDefault(),e.stopImmediatePropagation()}function Jy(e){var t=e.document.documentElement,n=R(e).on("dragstart.drag",So,Eo);"onselectstart"in t?n.on("selectstart.drag",So,Eo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function t1(e,t){var n=e.document.documentElement,r=R(e).on("dragstart.drag",null);t&&(r.on("click.drag",So,Eo),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 Oo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sh(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ai(){}var oi=.7,ws=1/oi,vr="\\s*([+-]?\\d+)\\s*",li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",e1=/^#([0-9a-f]{3,8})$/,n1=new RegExp(`^rgb\\(${vr},${vr},${vr}\\)$`),r1=new RegExp(`^rgb\\(${We},${We},${We}\\)$`),i1=new RegExp(`^rgba\\(${vr},${vr},${vr},${li}\\)$`),s1=new RegExp(`^rgba\\(${We},${We},${We},${li}\\)$`),a1=new RegExp(`^hsl\\(${li},${We},${We}\\)$`),o1=new RegExp(`^hsla\\(${li},${We},${We},${li}\\)$`),ah={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};Oo(ai,an,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oh,formatHex:oh,formatHex8:l1,formatHsl:c1,formatRgb:lh,toString:lh});function oh(){return this.rgb().formatHex()}function l1(){return this.rgb().formatHex8()}function c1(){return fh(this).formatHsl()}function lh(){return this.rgb().formatRgb()}function an(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=e1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ch(t):n===3?new fe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_s(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_s(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=n1.exec(e))?new fe(t[1],t[2],t[3],1):(t=r1.exec(e))?new fe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=i1.exec(e))?_s(t[1],t[2],t[3],t[4]):(t=s1.exec(e))?_s(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=a1.exec(e))?dh(t[1],t[2]/100,t[3]/100,1):(t=o1.exec(e))?dh(t[1],t[2]/100,t[3]/100,t[4]):ah.hasOwnProperty(e)?ch(ah[e]):e==="transparent"?new fe(NaN,NaN,NaN,0):null}function ch(e){return new fe(e>>16&255,e>>8&255,e&255,1)}function _s(e,t,n,r){return r<=0&&(e=t=n=NaN),new fe(e,t,n,r)}function u1(e){return e instanceof ai||(e=an(e)),e?(e=e.rgb(),new fe(e.r,e.g,e.b,e.opacity)):new fe}function To(e,t,n,r){return arguments.length===1?u1(e):new fe(e,t,n,r??1)}function fe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Oo(fe,To,sh(ai,{brighter(e){return e=e==null?ws:Math.pow(ws,e),new fe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?oi:Math.pow(oi,e),new fe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fe(Gn(this.r),Gn(this.g),Gn(this.b),Es(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:uh,formatHex:uh,formatHex8:h1,formatRgb:hh,toString:hh}));function uh(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}`}function h1(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}${zn((isNaN(this.opacity)?1:this.opacity)*255)}`}function hh(){const e=Es(this.opacity);return`${e===1?"rgb(":"rgba("}${Gn(this.r)}, ${Gn(this.g)}, ${Gn(this.b)}${e===1?")":`, ${e})`}`}function Es(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zn(e){return e=Gn(e),(e<16?"0":"")+e.toString(16)}function dh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ie(e,t,n,r)}function fh(e){if(e instanceof Ie)return new Ie(e.h,e.s,e.l,e.opacity);if(e instanceof ai||(e=an(e)),!e)return new Ie;if(e instanceof Ie)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 Ie(a,o,l,e.opacity)}function Mo(e,t,n,r){return arguments.length===1?fh(e):new Ie(e,t,n,r??1)}function Ie(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Oo(Ie,Mo,sh(ai,{brighter(e){return e=e==null?ws:Math.pow(ws,e),new Ie(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?oi:Math.pow(oi,e),new Ie(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 fe(Co(e>=240?e-240:e+120,i,r),Co(e,i,r),Co(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ie(ph(this.h),Ss(this.s),Ss(this.l),Es(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=Es(this.opacity);return`${e===1?"hsl(":"hsla("}${ph(this.h)}, ${Ss(this.s)*100}%, ${Ss(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ph(e){return e=(e||0)%360,e<0?e+360:e}function Ss(e){return Math.max(0,Math.min(1,e||0))}function Co(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 $o=e=>()=>e;function d1(e,t){return function(n){return e+n*t}}function f1(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 p1(e){return(e=+e)==1?gh:function(t,n){return n-t?f1(t,n,e):$o(isNaN(t)?n:t)}}function gh(e,t){var n=t-e;return n?d1(e,n):$o(isNaN(e)?t:e)}const Os=function e(t){var n=p1(t);function r(i,s){var a=n((i=To(i)).r,(s=To(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=gh(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 g1(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 m1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function v1(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]=ci(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 y1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function b1(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]=ci(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Ao=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Lo=new RegExp(Ao.source,"g");function x1(e){return function(){return e}}function w1(e){return function(t){return e(t)+""}}function mh(e,t){var n=Ao.lastIndex=Lo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Ao.exec(e))&&(i=Lo.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:xe(r,i)})),n=Lo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?w1(l[0].x):x1(t):(t=l.length,function(c){for(var u=0,h;u<t;++u)o[(h=l[u]).i]=h.x(c);return o.join("")})}function ci(e,t){var n=typeof t,r;return t==null||n==="boolean"?$o(t):(n==="number"?xe:n==="string"?(r=an(t))?(t=r,Os):mh:t instanceof an?Os:t instanceof Date?y1:m1(t)?g1:Array.isArray(t)?v1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?b1:xe)(e,t)}function vh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var yh=180/Math.PI,ko={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function bh(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)*yh,skewX:Math.atan(l)*yh,scaleX:a,scaleY:o}}var Ts;function _1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ko:bh(t.a,t.b,t.c,t.d,t.e,t.f)}function E1(e){return e==null||(Ts||(Ts=document.createElementNS("http://www.w3.org/2000/svg","g")),Ts.setAttribute("transform",e),!(e=Ts.transform.baseVal.consolidate()))?ko:(e=e.matrix,bh(e.a,e.b,e.c,e.d,e.e,e.f))}function xh(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push("translate(",null,t,null,n);p.push({i:m-4,x:xe(c,h)},{i:m-2,x:xe(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function a(c,u,h,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:h.push(i(h)+"rotate(",null,r)-2,x:xe(c,u)})):u&&h.push(i(h)+"rotate("+u+r)}function o(c,u,h,d){c!==u?d.push({i:h.push(i(h)+"skewX(",null,r)-2,x:xe(c,u)}):u&&h.push(i(h)+"skewX("+u+r)}function l(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push(i(f)+"scale(",null,",",null,")");p.push({i:m-4,x:xe(c,h)},{i:m-2,x:xe(u,d)})}else(h!==1||d!==1)&&f.push(i(f)+"scale("+h+","+d+")")}return function(c,u){var h=[],d=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,d),a(c.rotate,u.rotate,h,d),o(c.skewX,u.skewX,h,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,d),c=u=null,function(f){for(var p=-1,m=d.length,g;++p<m;)h[(g=d[p]).i]=g.x(f);return h.join("")}}}var S1=xh(_1,"px, ","px)","deg)"),O1=xh(E1,", ",")",")");function T1(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var yr=0,ui=0,hi=0,wh=1e3,Ms,di,Cs=0,jn=0,$s=0,fi=typeof performance=="object"&&performance.now?performance:Date,_h=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Do(){return jn||(_h(M1),jn=fi.now()+$s)}function M1(){jn=0}function As(){this._call=this._time=this._next=null}As.prototype=Eh.prototype={constructor:As,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Do():+n)+(t==null?0:+t),!this._next&&di!==this&&(di?di._next=this:Ms=this,di=this),this._call=e,this._time=n,Ro()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ro())}};function Eh(e,t,n){var r=new As;return r.restart(e,t,n),r}function C1(){Do(),++yr;for(var e=Ms,t;e;)(t=jn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yr}function Sh(){jn=(Cs=fi.now())+$s,yr=ui=0;try{C1()}finally{yr=0,A1(),jn=0}}function $1(){var e=fi.now(),t=e-Cs;t>wh&&($s-=t,Cs=e)}function A1(){for(var e,t=Ms,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:Ms=n);di=e,Ro(r)}function Ro(e){if(!yr){ui&&(ui=clearTimeout(ui));var t=e-jn;t>24?(e<1/0&&(ui=setTimeout(Sh,e-fi.now()-$s)),hi&&(hi=clearInterval(hi))):(hi||(Cs=fi.now(),hi=setInterval($1,wh)),yr=1,_h(Sh))}}function Oh(e,t,n){var r=new As;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var L1=bo("start","end","cancel","interrupt"),k1=[],Th=0,Mh=1,Io=2,Ls=3,Ch=4,No=5,ks=6;function Ds(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;D1(e,n,{name:t,index:r,group:i,on:L1,tween:k1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Th})}function Po(e,t){var n=Ne(e,t);if(n.state>Th)throw new Error("too late; already scheduled");return n}function qe(e,t){var n=Ne(e,t);if(n.state>Ls)throw new Error("too late; already running");return n}function Ne(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function D1(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Eh(s,0,n.time);function s(c){n.state=Mh,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,h,d,f;if(n.state!==Mh)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Ls)return Oh(a);f.state===Ch?(f.state=ks,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=ks,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Oh(function(){n.state===Ls&&(n.state=Ch,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Io,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Io){for(n.state=Ls,i=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=f);i.length=h+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=No,1),h=-1,d=i.length;++h<d;)i[h].call(e,u);n.state===No&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ks,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Uo(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>Io&&r.state<No,r.state=ks,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function R1(e){return this.each(function(){Uo(this,e)})}function I1(e,t){var n,r;return function(){var i=qe(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 N1(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=qe(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 P1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ne(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?I1:N1)(n,e,t))}function Bo(e,t,n){var r=e._id;return e.each(function(){var i=qe(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ne(i,r).value[t]}}function $h(e,t){var n;return(typeof t=="number"?xe:t instanceof an?Os:(n=an(t))?(t=n,Os):mh)(e,t)}function U1(e){return function(){this.removeAttribute(e)}}function B1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function V1(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 H1(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 F1(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 G1(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 z1(e,t){var n=bs(e),r=n==="transform"?O1:$h;return this.attrTween(e,typeof t=="function"?(n.local?G1:F1)(n,r,Bo(this,"attr."+e,t)):t==null?(n.local?B1:U1)(n):(n.local?H1:V1)(n,r,t))}function j1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function W1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function q1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&W1(e,s)),n}return i._value=t,i}function Y1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&j1(e,s)),n}return i._value=t,i}function X1(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=bs(e);return this.tween(n,(r.local?q1:Y1)(r,t))}function Z1(e,t){return function(){Po(this,e).delay=+t.apply(this,arguments)}}function K1(e,t){return t=+t,function(){Po(this,e).delay=t}}function Q1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Z1:K1)(t,e)):Ne(this.node(),t).delay}function J1(e,t){return function(){qe(this,e).duration=+t.apply(this,arguments)}}function tb(e,t){return t=+t,function(){qe(this,e).duration=t}}function eb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?J1:tb)(t,e)):Ne(this.node(),t).duration}function nb(e,t){if(typeof t!="function")throw new Error;return function(){qe(this,e).ease=t}}function rb(e){var t=this._id;return arguments.length?this.each(nb(t,e)):Ne(this.node(),t).ease}function ib(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qe(this,e).ease=n}}function sb(e){if(typeof e!="function")throw new Error;return this.each(ib(this._id,e))}function ab(e){typeof e!="function"&&(e=Xu(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 on(r,this._parents,this._name,this._id)}function ob(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,h=a[o]=new Array(u),d,f=0;f<u;++f)(d=l[f]||c[f])&&(h[f]=d);for(;o<r;++o)a[o]=t[o];return new on(a,this._parents,this._name,this._id)}function lb(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 cb(e,t,n){var r,i,s=lb(t)?Po:qe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function ub(e,t){var n=this._id;return arguments.length<2?Ne(this.node(),n).on.on(e):this.each(cb(n,e,t))}function hb(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function db(){return this.on("end.remove",hb(this._id))}function fb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wo(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,h,d=0;d<l;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),c[d]=h,Ds(c[d],t,n,d,c,Ne(u,n)));return new on(s,this._parents,t,n)}function pb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yu(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,h=0;h<c;++h)if(u=l[h]){for(var d=e.call(u,u.__data__,h,l),f,p=Ne(u,n),m=0,g=d.length;m<g;++m)(f=d[m])&&Ds(f,t,n,m,d,p);s.push(d),a.push(u)}return new on(s,a,t,n)}var gb=si.prototype.constructor;function mb(){return new gb(this._groups,this._parents)}function vb(e,t){var n,r,i;return function(){var s=mr(this,e),a=(this.style.removeProperty(e),mr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Ah(e){return function(){this.style.removeProperty(e)}}function yb(e,t,n){var r,i=n+"",s;return function(){var a=mr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function bb(e,t,n){var r,i,s;return function(){var a=mr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),mr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function xb(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=qe(this,e),c=l.on,u=l.value[s]==null?o||(o=Ah(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function wb(e,t,n){var r=(e+="")=="transform"?S1:$h;return t==null?this.styleTween(e,vb(e,r)).on("end.style."+e,Ah(e)):typeof t=="function"?this.styleTween(e,bb(e,r,Bo(this,"style."+e,t))).each(xb(this._id,e)):this.styleTween(e,yb(e,r,t),n).on("end.style."+e,null)}function _b(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Eb(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&_b(e,a,n)),r}return s._value=t,s}function Sb(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,Eb(e,t,n??""))}function Ob(e){return function(){this.textContent=e}}function Tb(e){return function(){var t=e(this);this.textContent=t??""}}function Mb(e){return this.tween("text",typeof e=="function"?Tb(Bo(this,"text",e)):Ob(e==null?"":e+""))}function Cb(e){return function(t){this.textContent=e.call(this,t)}}function $b(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Cb(i)),t}return r._value=e,r}function Ab(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,$b(e))}function Lb(){for(var e=this._name,t=this._id,n=Lh(),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=Ne(l,t);Ds(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new on(r,this._parents,e,n)}function kb(){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=qe(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 Db=0;function on(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Lh(){return++Db}var ln=si.prototype;on.prototype={constructor:on,select:fb,selectAll:pb,selectChild:ln.selectChild,selectChildren:ln.selectChildren,filter:ab,merge:ob,selection:mb,transition:Lb,call:ln.call,nodes:ln.nodes,node:ln.node,size:ln.size,empty:ln.empty,each:ln.each,on:ub,attr:z1,attrTween:X1,style:wb,styleTween:Sb,text:Mb,textTween:Ab,remove:db,tween:P1,delay:Q1,duration:eb,ease:rb,easeVarying:sb,end:kb,[Symbol.iterator]:ln[Symbol.iterator]};const Rb=e=>+e;function kh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ib={time:null,delay:0,duration:250,ease:kh};function Nb(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 Pb(e){var t,n;e instanceof on?(t=e._id,e=e._name):(t=Lh(),(n=Ib).time=Do(),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])&&Ds(l,e,t,c,a,n||Nb(l,t));return new on(r,this._parents,e,t)}si.prototype.interrupt=R1,si.prototype.transition=Pb;const Vo=e=>()=>e;function Ub(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 Bb(e){e.stopImmediatePropagation()}function Ho(e){e.preventDefault(),e.stopImmediatePropagation()}var Dh={name:"drag"},Fo={name:"space"},br={name:"handle"},xr={name:"center"};const{abs:Rh,max:ie,min:se}=Math;function Ih(e){return[+e[0],+e[1]]}function Nh(e){return[Ih(e[0]),Ih(e[1])]}var Rs={name:"x",handles:["w","e"].map(Is),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]]}},Go={name:"y",handles:["n","s"].map(Is),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]]}},cn={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"},Ph={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Uh={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Vb={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Hb={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Is(e){return{type:e}}function Fb(e){return!e.ctrlKey&&!e.button}function Gb(){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 zb(){return navigator.maxTouchPoints||"ontouchstart"in this}function zo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function jb(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Bh(){return Wb(Rs)}function Wb(e){var t=Gb,n=Fb,r=zb,i=!0,s=bo("start","brush","end"),a=6,o;function l(g){var v=g.property("__brush",m).selectAll(".overlay").data([Is("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",cn.overlay).merge(v).each(function(){var b=zo(this).extent;R(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),g.selectAll(".selection").data([Is("selection")]).enter().append("rect").attr("class","selection").attr("cursor",cn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=g.selectAll(".handle").data(e.handles,function(b){return b.type});y.exit().remove(),y.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return cn[b.type]}),g.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).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(g,v,y){g.tween?g.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,S=b.__brush,_=u(b,arguments),E=S.selection,T=e.input(typeof v=="function"?v.apply(this,arguments):v,S.extent),D=ci(E,T);function N(A){S.selection=A===1&&T===null?null:D(A),c.call(b),_.brush()}return E!==null&&T!==null?N:N(1)}):g.each(function(){var b=this,S=arguments,_=b.__brush,E=e.input(typeof v=="function"?v.apply(b,S):v,_.extent),T=u(b,S).beforestart();Uo(b),_.selection=E===null?null:E,c.call(b),T.start(y).brush(y).end(y)})},l.clear=function(g,v){l.move(g,null,v)};function c(){var g=R(this),v=zo(this).selection;v?(g.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.type==="w"?v[1][1]-v[0][1]+a:a})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(g,v,y){var b=g.__brush.emitter;return b&&(!y||!b.clean)?b:new h(g,v,y)}function h(g,v,y){this.that=g,this.args=v,this.state=g.__brush,this.active=0,this.clean=y}h.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,v){return this.starting?(this.starting=!1,this.emit("start",g,v)):this.emit("brush",g),this},brush:function(g,v){return this.emit("brush",g,v),this},end:function(g,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,v)),this},emit:function(g,v,y){var b=R(this.that).datum();s.call(g,this.that,new Ub(g,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),b)}};function d(g){if(o&&!g.touches||!n.apply(this,arguments))return;var v=this,y=g.target.__data__.type,b=(i&&g.metaKey?y="overlay":y)==="selection"?Dh:i&&g.altKey?xr:br,S=e===Go?null:Vb[y],_=e===Rs?null:Hb[y],E=zo(v),T=E.extent,D=E.selection,N=T[0][0],A,C,V=T[0][1],M,L,w=T[1][0],P,U,I=T[1][1],B,j,Y=0,et=0,pt,z=S&&_&&i&&g.shiftKey,K,ht,it=Array.from(g.touches||[g],nt=>{const It=nt.identifier;return nt=Fn(nt,v),nt.point0=nt.slice(),nt.identifier=It,nt});Uo(v);var Mt=u(v,arguments,!0).beforestart();if(y==="overlay"){D&&(pt=!0);const nt=[it[0],it[1]||it[0]];E.selection=D=[[A=e===Go?N:se(nt[0][0],nt[1][0]),M=e===Rs?V:se(nt[0][1],nt[1][1])],[P=e===Go?w:ie(nt[0][0],nt[1][0]),B=e===Rs?I:ie(nt[0][1],nt[1][1])]],it.length>1&&Ut(g)}else A=D[0][0],M=D[0][1],P=D[1][0],B=D[1][1];C=A,L=M,U=P,j=B;var W=R(v).attr("pointer-events","none"),J=W.selectAll(".overlay").attr("cursor",cn[y]);if(g.touches)Mt.moved=F,Mt.ended=bt;else{var ct=R(g.view).on("mousemove.brush",F,!0).on("mouseup.brush",bt,!0);i&&ct.on("keydown.brush",zt,!0).on("keyup.brush",jt,!0),Jy(g.view)}c.call(v),Mt.start(g,b.name);function F(nt){for(const It of nt.changedTouches||[nt])for(const tn of it)tn.identifier===It.identifier&&(tn.cur=Fn(It,v));if(z&&!K&&!ht&&it.length===1){const It=it[0];Rh(It.cur[0]-It[0])>Rh(It.cur[1]-It[1])?ht=!0:K=!0}for(const It of it)It.cur&&(It[0]=It.cur[0],It[1]=It.cur[1]);pt=!0,Ho(nt),Ut(nt)}function Ut(nt){const It=it[0],tn=It.point0;var en;switch(Y=It[0]-tn[0],et=It[1]-tn[1],b){case Fo:case Dh:{S&&(Y=ie(N-A,se(w-P,Y)),C=A+Y,U=P+Y),_&&(et=ie(V-M,se(I-B,et)),L=M+et,j=B+et);break}case br:{it[1]?(S&&(C=ie(N,se(w,it[0][0])),U=ie(N,se(w,it[1][0])),S=1),_&&(L=ie(V,se(I,it[0][1])),j=ie(V,se(I,it[1][1])),_=1)):(S<0?(Y=ie(N-A,se(w-A,Y)),C=A+Y,U=P):S>0&&(Y=ie(N-P,se(w-P,Y)),C=A,U=P+Y),_<0?(et=ie(V-M,se(I-M,et)),L=M+et,j=B):_>0&&(et=ie(V-B,se(I-B,et)),L=M,j=B+et));break}case xr:{S&&(C=ie(N,se(w,A-Y*S)),U=ie(N,se(w,P+Y*S))),_&&(L=ie(V,se(I,M-et*_)),j=ie(V,se(I,B+et*_)));break}}U<C&&(S*=-1,en=A,A=P,P=en,en=C,C=U,U=en,y in Ph&&J.attr("cursor",cn[y=Ph[y]])),j<L&&(_*=-1,en=M,M=B,B=en,en=L,L=j,j=en,y in Uh&&J.attr("cursor",cn[y=Uh[y]])),E.selection&&(D=E.selection),K&&(C=D[0][0],U=D[1][0]),ht&&(L=D[0][1],j=D[1][1]),(D[0][0]!==C||D[0][1]!==L||D[1][0]!==U||D[1][1]!==j)&&(E.selection=[[C,L],[U,j]],c.call(v),Mt.brush(nt,b.name))}function bt(nt){if(Bb(nt),nt.touches){if(nt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else t1(nt.view,pt),ct.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);W.attr("pointer-events","all"),J.attr("cursor",cn.overlay),E.selection&&(D=E.selection),jb(D)&&(E.selection=null,c.call(v)),Mt.end(nt,b.name)}function zt(nt){switch(nt.keyCode){case 16:{z=S&&_;break}case 18:{b===br&&(S&&(P=U-Y*S,A=C+Y*S),_&&(B=j-et*_,M=L+et*_),b=xr,Ut(nt));break}case 32:{(b===br||b===xr)&&(S<0?P=U-Y:S>0&&(A=C-Y),_<0?B=j-et:_>0&&(M=L-et),b=Fo,J.attr("cursor",cn.selection),Ut(nt));break}default:return}Ho(nt)}function jt(nt){switch(nt.keyCode){case 16:{z&&(K=ht=z=!1,Ut(nt));break}case 18:{b===xr&&(S<0?P=U:S>0&&(A=C),_<0?B=j:_>0&&(M=L),b=br,Ut(nt));break}case 32:{b===Fo&&(nt.altKey?(S&&(P=U-Y*S,A=C+Y*S),_&&(B=j-et*_,M=L+et*_),b=xr):(S<0?P=U:S>0&&(A=C),_<0?B=j:_>0&&(M=L),b=br),J.attr("cursor",cn[y]),Ut(nt));break}default:return}Ho(nt)}}function f(g){u(this,arguments).moved(g)}function p(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=Nh(t.apply(this,arguments)),g.dim=e,g}return l.extent=function(g){return arguments.length?(t=typeof g=="function"?g:Vo(Nh(g)),l):t},l.filter=function(g){return arguments.length?(n=typeof g=="function"?g:Vo(!!g),l):n},l.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:Vo(!!g),l):r},l.handleSize=function(g){return arguments.length?(a=+g,l):a},l.keyModifiers=function(g){return arguments.length?(i=!!g,l):i},l.on=function(){var g=s.on.apply(s,arguments);return g===s?l:g},l}const jo=Math.PI,Wo=2*jo,Wn=1e-6,qb=Wo-Wn;function Vh(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Yb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Vh;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 qo=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Vh:Yb(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,h=o-n,d=u*u+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>Wn)if(!(Math.abs(h*l-c*u)>Wn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,m=l*l+c*c,g=f*f+p*p,v=Math.sqrt(m),y=Math.sqrt(d),b=s*Math.tan((jo-Math.acos((m+d-g)/(2*v*y)))/2),S=b/y,_=b/v;Math.abs(S-1)>Wn&&this._append`L${t+S*u},${n+S*h}`,this._append`A${s},${s},0,0,${+(h*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,h=1^a,d=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Wn||Math.abs(this._y1-u)>Wn)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%Wo+Wo),d>qb?this._append`A${r},${r},0,1,${h},${t-o},${n-l}A${r},${r},0,1,${h},${this._x1=c},${this._y1=u}`:d>Wn&&this._append`A${r},${r},0,${+(d>=jo)},${h},${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 Hh(){return new qo}Hh.prototype=qo.prototype;function Xb(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ns(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 wr(e){return e=Ns(Math.abs(e)),e?e[1]:NaN}function Zb(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 Kb(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Qb=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pi(e){if(!(t=Qb.exec(e)))throw new Error("invalid format: "+e);var t;return new Yo({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}pi.prototype=Yo.prototype;function Yo(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+""}Yo.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 Jb(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 Fh;function tx(e,t){var n=Ns(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Fh=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")+Ns(e,Math.max(0,t+s-1))[0]}function Gh(e,t){var n=Ns(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 zh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Xb,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)=>Gh(e*100,t),r:Gh,s:tx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function jh(e){return e}var Wh=Array.prototype.map,qh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ex(e){var t=e.grouping===void 0||e.thousands===void 0?jh:Zb(Wh.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?jh:Kb(Wh.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(h){h=pi(h);var d=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,v=h.width,y=h.comma,b=h.precision,S=h.trim,_=h.type;_==="n"?(y=!0,_="g"):zh[_]||(b===void 0&&(b=12),S=!0,_="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",T=m==="$"?r:/[%p]/.test(_)?a:"",D=zh[_],N=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function A(C){var V=E,M=T,L,w,P;if(_==="c")M=D(C)+M,C="";else{C=+C;var U=C<0||1/C<0;if(C=isNaN(C)?l:D(Math.abs(C),b),S&&(C=Jb(C)),U&&+C==0&&p!=="+"&&(U=!1),V=(U?p==="("?p:o:p==="-"||p==="("?"":p)+V,M=(_==="s"?qh[8+Fh/3]:"")+M+(U&&p==="("?")":""),N){for(L=-1,w=C.length;++L<w;)if(P=C.charCodeAt(L),48>P||P>57){M=(P===46?i+C.slice(L+1):C.slice(L))+M,C=C.slice(0,L);break}}}y&&!g&&(C=t(C,1/0));var I=V.length+C.length+M.length,B=I<v?new Array(v-I+1).join(d):"";switch(y&&g&&(C=t(B+C,B.length?v-M.length:1/0),B=""),f){case"<":C=V+C+M+B;break;case"=":C=V+B+C+M;break;case"^":C=B.slice(0,I=B.length>>1)+V+C+M+B.slice(I);break;default:C=B+V+C+M;break}return s(C)}return A.toString=function(){return h+""},A}function u(h,d){var f=c((h=pi(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(wr(d)/3)))*3,m=Math.pow(10,-p),g=qh[8+p/3];return function(v){return f(m*v)+g}}return{format:c,formatPrefix:u}}var Ps,Xo,Yh;nx({thousands:",",grouping:[3],currency:["$",""]});function nx(e){return Ps=ex(e),Xo=Ps.format,Yh=Ps.formatPrefix,Ps}function rx(e){return Math.max(0,-wr(Math.abs(e)))}function ix(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(wr(t)/3)))*3-wr(Math.abs(e)))}function sx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,wr(t)-wr(e))+1}var _t=1e-6,Xh=1e-12,dt=Math.PI,pe=dt/2,Zh=dt/4,we=dt*2,ce=180/dt,Ht=dt/180,Et=Math.abs,Kh=Math.atan,qn=Math.atan2,Ot=Math.cos,ax=Math.exp,ox=Math.log,wt=Math.sin,Cn=Math.sign||function(e){return e>0?1:e<0?-1:0},Pe=Math.sqrt,lx=Math.tan;function cx(e){return e>1?0:e<-1?dt:Math.acos(e)}function un(e){return e>1?pe:e<-1?-pe:Math.asin(e)}function Me(){}function Us(e,t){e&&Jh.hasOwnProperty(e.type)&&Jh[e.type](e,t)}var Qh={Feature:function(e,t){Us(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Us(n[r].geometry,t)}},Jh={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){Zo(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Zo(n[r],t,0)},Polygon:function(e,t){td(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)td(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Us(n[r],t)}};function Zo(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 td(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Zo(e[n],t,1);t.polygonEnd()}function _r(e,t){e&&Qh.hasOwnProperty(e.type)?Qh[e.type](e,t):Us(e,t)}function Ko(e){return[qn(e[1],e[0]),un(e[2])]}function Er(e){var t=e[0],n=e[1],r=Ot(n);return[r*Ot(t),r*wt(t),wt(n)]}function Bs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Vs(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 Qo(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Hs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Jo(e){var t=Pe(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function tl(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 el(e,t){return Et(e)>dt&&(e-=Math.round(e/we)*we),[e,t]}el.invert=el;function ed(e,t,n){return(e%=we)?t||n?tl(rd(e),id(t,n)):rd(e):t||n?id(t,n):el}function nd(e){return function(t,n){return t+=e,Et(t)>dt&&(t-=Math.round(t/we)*we),[t,n]}}function rd(e){var t=nd(e);return t.invert=nd(-e),t}function id(e,t){var n=Ot(e),r=wt(e),i=Ot(t),s=wt(t);function a(o,l){var c=Ot(l),u=Ot(o)*c,h=wt(o)*c,d=wt(l),f=d*n+u*r;return[qn(h*i-f*s,u*n-d*r),un(f*i+h*s)]}return a.invert=function(o,l){var c=Ot(l),u=Ot(o)*c,h=wt(o)*c,d=wt(l),f=d*i-h*s;return[qn(h*i+d*s,u*n+f*r),un(f*n-u*r)]},a}function ux(e){e=ed(e[0]*Ht,e[1]*Ht,e.length>2?e[2]*Ht:0);function t(n){return n=e(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n}return t.invert=function(n){return n=e.invert(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n},t}function hx(e,t,n,r,i,s){if(n){var a=Ot(t),o=wt(t),l=r*n;i==null?(i=t+r*we,s=t-l/2):(i=sd(a,i),s=sd(a,s),(r>0?i<s:i>s)&&(i+=r*we));for(var c,u=i;r>0?u>s:u<s;u-=l)c=Ko([a,-o*Ot(u),-o*wt(u)]),e.point(c[0],c[1])}}function sd(e,t){t=Er(t),t[0]-=e,Jo(t);var n=cx(-t[1]);return((-t[2]<0?-n:n)+we-_t)%we}function ad(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Me,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Fs(e,t){return Et(e[0]-t[0])<_t&&Et(e[1]-t[1])<_t}function Gs(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 od(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],v=p[m],y;if(Fs(g,v)){if(!g[2]&&!v[2]){for(i.lineStart(),o=0;o<m;++o)i.point((g=p[o])[0],g[1]);i.lineEnd();return}v[0]+=2*_t}s.push(y=new Gs(g,p,null,!0)),a.push(y.o=new Gs(g,null,y,!1)),s.push(y=new Gs(v,p,null,!1)),a.push(y.o=new Gs(v,null,y,!0))}}),!!s.length){for(a.sort(t),ld(s),ld(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,h;;){for(var d=c,f=!0;d.v;)if((d=d.n)===c)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((h=u[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(f)for(u=d.p.z,o=u.length-1;o>=0;--o)i.point((h=u[o])[0],h[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,f=!f}while(!d.v);i.lineEnd()}}}function ld(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 nl(e){return Et(e[0])<=dt?e[0]:Cn(e[0])*((Et(e[0])+dt)%we-dt)}function dx(e,t){var n=nl(t),r=t[1],i=wt(r),s=[wt(n),-Ot(n),0],a=0,o=0,l=new Vn;i===1?r=pe+_t:i===-1&&(r=-pe-_t);for(var c=0,u=e.length;c<u;++c)if(d=(h=e[c]).length)for(var h,d,f=h[d-1],p=nl(f),m=f[1]/2+Zh,g=wt(m),v=Ot(m),y=0;y<d;++y,p=S,g=E,v=T,f=b){var b=h[y],S=nl(b),_=b[1]/2+Zh,E=wt(_),T=Ot(_),D=S-p,N=D>=0?1:-1,A=N*D,C=A>dt,V=g*E;if(l.add(qn(V*N*wt(A),v*T+V*Ot(A))),a+=C?D+N*we:D,C^p>=n^S>=n){var M=Vs(Er(f),Er(b));Jo(M);var L=Vs(s,M);Jo(L);var w=(C^D>=0?-1:1)*un(L[2]);(r>w||r===w&&(M[0]||M[1]))&&(o+=C^D>=0?1:-1)}}return(a<-_t||a<_t&&l<-Xh)^o&1}function cd(e,t,n,r){return function(i){var s=t(i),a=ad(),o=t(a),l=!1,c,u,h,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=b,u=[],c=[]},polygonEnd:function(){d.point=f,d.lineStart=m,d.lineEnd=g,u=Fu(u);var S=dx(c,r);u.length?(l||(i.polygonStart(),l=!0),od(u,px,S,n,i)):S&&(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(S,_){e(S,_)&&i.point(S,_)}function p(S,_){s.point(S,_)}function m(){d.point=p,s.lineStart()}function g(){d.point=f,s.lineEnd()}function v(S,_){h.push([S,_]),o.point(S,_)}function y(){o.lineStart(),h=[]}function b(){v(h[0][0],h[0][1]),o.lineEnd();var S=o.clean(),_=a.result(),E,T=_.length,D,N,A;if(h.pop(),c.push(h),h=null,!!T){if(S&1){if(N=_[0],(D=N.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),E=0;E<D;++E)i.point((A=N[E])[0],A[1]);i.lineEnd()}return}T>1&&S&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(fx))}}return d}}function fx(e){return e.length>1}function px(e,t){return((e=e.x)[0]<0?e[1]-pe-_t:pe-e[1])-((t=t.x)[0]<0?t[1]-pe-_t:pe-t[1])}const ud=cd(function(){return!0},gx,vx,[-dt,-pe]);function gx(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?dt:-dt,l=Et(s-t);Et(l-dt)<_t?(e.point(t,n=(n+a)/2>0?pe:-pe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=dt&&(Et(t-r)<_t&&(t-=r*_t),Et(s-o)<_t&&(s-=o*_t),n=mx(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 mx(e,t,n,r){var i,s,a=wt(e-n);return Et(a)>_t?Kh((wt(t)*(s=Ot(r))*wt(n)-wt(r)*(i=Ot(t))*wt(e))/(i*s*a)):(t+r)/2}function vx(e,t,n,r){var i;if(e==null)i=n*pe,r.point(-dt,i),r.point(0,i),r.point(dt,i),r.point(dt,0),r.point(dt,-i),r.point(0,-i),r.point(-dt,-i),r.point(-dt,0),r.point(-dt,i);else if(Et(e[0]-t[0])>_t){var s=e[0]<t[0]?dt:-dt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function yx(e){var t=Ot(e),n=6*Ht,r=t>0,i=Et(t)>_t;function s(u,h,d,f){hx(f,e,n,d,u,h)}function a(u,h){return Ot(u)*Ot(h)>t}function o(u){var h,d,f,p,m;return{lineStart:function(){p=f=!1,m=1},point:function(g,v){var y=[g,v],b,S=a(g,v),_=r?S?0:c(g,v):S?c(g+(g<0?dt:-dt),v):0;if(!h&&(p=f=S)&&u.lineStart(),S!==f&&(b=l(h,y),(!b||Fs(h,b)||Fs(y,b))&&(y[2]=1)),S!==f)m=0,S?(u.lineStart(),b=l(y,h),u.point(b[0],b[1])):(b=l(h,y),u.point(b[0],b[1],2),u.lineEnd()),h=b;else if(i&&h&&r^S){var E;!(_&d)&&(E=l(y,h,!0))&&(m=0,r?(u.lineStart(),u.point(E[0][0],E[0][1]),u.point(E[1][0],E[1][1]),u.lineEnd()):(u.point(E[1][0],E[1][1]),u.lineEnd(),u.lineStart(),u.point(E[0][0],E[0][1],3)))}S&&(!h||!Fs(h,y))&&u.point(y[0],y[1]),h=y,f=S,d=_},lineEnd:function(){f&&u.lineEnd(),h=null},clean:function(){return m|(p&&f)<<1}}}function l(u,h,d){var f=Er(u),p=Er(h),m=[1,0,0],g=Vs(f,p),v=Bs(g,g),y=g[0],b=v-y*y;if(!b)return!d&&u;var S=t*v/b,_=-t*y/b,E=Vs(m,g),T=Hs(m,S),D=Hs(g,_);Qo(T,D);var N=E,A=Bs(T,N),C=Bs(N,N),V=A*A-C*(Bs(T,T)-1);if(!(V<0)){var M=Pe(V),L=Hs(N,(-A-M)/C);if(Qo(L,T),L=Ko(L),!d)return L;var w=u[0],P=h[0],U=u[1],I=h[1],B;P<w&&(B=w,w=P,P=B);var j=P-w,Y=Et(j-dt)<_t,et=Y||j<_t;if(!Y&&I<U&&(B=U,U=I,I=B),et?Y?U+I>0^L[1]<(Et(L[0]-w)<_t?U:I):U<=L[1]&&L[1]<=I:j>dt^(w<=L[0]&&L[0]<=P)){var pt=Hs(N,(-A+M)/C);return Qo(pt,T),[L,Ko(pt)]}}}function c(u,h){var d=r?e:dt-e,f=0;return u<-d?f|=1:u>d&&(f|=2),h<-d?f|=4:h>d&&(f|=8),f}return cd(a,o,s,r?[0,-e]:[-dt,e-dt])}function bx(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,h=1,d=l-a,f=c-o,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<h&&(h=p)}else if(d>0){if(p>h)return;p>u&&(u=p)}if(p=i-a,!(!d&&p<0)){if(p/=d,d<0){if(p>h)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<h&&(h=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<h&&(h=p)}else if(f>0){if(p>h)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>h)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<h&&(h=p)}return u>0&&(e[0]=a+u*d,e[1]=o+u*f),h<1&&(t[0]=a+h*d,t[1]=o+h*f),!0}}}}}var gi=1e9,zs=-gi;function xx(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,h,d){var f=0,p=0;if(c==null||(f=a(c,h))!==(p=a(u,h))||l(c,u)<0^h>0)do d.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+h+4)%4)!==p);else d.point(u[0],u[1])}function a(c,u){return Et(c[0]-e)<_t?u>0?0:3:Et(c[0]-n)<_t?u>0?2:1:Et(c[1]-t)<_t?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var h=a(c,1),d=a(u,1);return h!==d?h-d:h===0?u[1]-c[1]:h===1?c[0]-u[0]:h===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,h=ad(),d,f,p,m,g,v,y,b,S,_,E,T={point:D,lineStart:V,lineEnd:M,polygonStart:A,polygonEnd:C};function D(w,P){i(w,P)&&u.point(w,P)}function N(){for(var w=0,P=0,U=f.length;P<U;++P)for(var I=f[P],B=1,j=I.length,Y=I[0],et,pt,z=Y[0],K=Y[1];B<j;++B)et=z,pt=K,Y=I[B],z=Y[0],K=Y[1],pt<=r?K>r&&(z-et)*(r-pt)>(K-pt)*(e-et)&&++w:K<=r&&(z-et)*(r-pt)<(K-pt)*(e-et)&&--w;return w}function A(){u=h,d=[],f=[],E=!0}function C(){var w=N(),P=E&&w,U=(d=Fu(d)).length;(P||U)&&(c.polygonStart(),P&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),U&&od(d,o,w,s,c),c.polygonEnd()),u=c,d=f=p=null}function V(){T.point=L,f&&f.push(p=[]),_=!0,S=!1,y=b=NaN}function M(){d&&(L(m,g),v&&S&&h.rejoin(),d.push(h.result())),T.point=D,S&&u.lineEnd()}function L(w,P){var U=i(w,P);if(f&&p.push([w,P]),_)m=w,g=P,v=U,_=!1,U&&(u.lineStart(),u.point(w,P));else if(U&&S)u.point(w,P);else{var I=[y=Math.max(zs,Math.min(gi,y)),b=Math.max(zs,Math.min(gi,b))],B=[w=Math.max(zs,Math.min(gi,w)),P=Math.max(zs,Math.min(gi,P))];bx(I,B,e,t,n,r)?(S||(u.lineStart(),u.point(I[0],I[1])),u.point(B[0],B[1]),U||u.lineEnd(),E=!1):U&&(u.lineStart(),u.point(w,P),E=!1)}y=w,b=P,S=U}return T}}const rl=e=>e;var il=new Vn,sl=new Vn,hd,dd,al,ol,$n={point:Me,lineStart:Me,lineEnd:Me,polygonStart:function(){$n.lineStart=wx,$n.lineEnd=Ex},polygonEnd:function(){$n.lineStart=$n.lineEnd=$n.point=Me,il.add(Et(sl)),sl=new Vn},result:function(){var e=il/2;return il=new Vn,e}};function wx(){$n.point=_x}function _x(e,t){$n.point=fd,hd=al=e,dd=ol=t}function fd(e,t){sl.add(ol*e-al*t),al=e,ol=t}function Ex(){fd(hd,dd)}const pd=$n;var Sr=1/0,js=Sr,mi=-Sr,Ws=mi,Sx={point:Ox,lineStart:Me,lineEnd:Me,polygonStart:Me,polygonEnd:Me,result:function(){var e=[[Sr,js],[mi,Ws]];return mi=Ws=-(js=Sr=1/0),e}};function Ox(e,t){e<Sr&&(Sr=e),e>mi&&(mi=e),t<js&&(js=t),t>Ws&&(Ws=t)}const qs=Sx;var ll=0,cl=0,vi=0,Ys=0,Xs=0,Or=0,ul=0,hl=0,yi=0,gd,md,Ye,Xe,Ue={point:Yn,lineStart:vd,lineEnd:yd,polygonStart:function(){Ue.lineStart=Cx,Ue.lineEnd=$x},polygonEnd:function(){Ue.point=Yn,Ue.lineStart=vd,Ue.lineEnd=yd},result:function(){var e=yi?[ul/yi,hl/yi]:Or?[Ys/Or,Xs/Or]:vi?[ll/vi,cl/vi]:[NaN,NaN];return ll=cl=vi=Ys=Xs=Or=ul=hl=yi=0,e}};function Yn(e,t){ll+=e,cl+=t,++vi}function vd(){Ue.point=Tx}function Tx(e,t){Ue.point=Mx,Yn(Ye=e,Xe=t)}function Mx(e,t){var n=e-Ye,r=t-Xe,i=Pe(n*n+r*r);Ys+=i*(Ye+e)/2,Xs+=i*(Xe+t)/2,Or+=i,Yn(Ye=e,Xe=t)}function yd(){Ue.point=Yn}function Cx(){Ue.point=Ax}function $x(){bd(gd,md)}function Ax(e,t){Ue.point=bd,Yn(gd=Ye=e,md=Xe=t)}function bd(e,t){var n=e-Ye,r=t-Xe,i=Pe(n*n+r*r);Ys+=i*(Ye+e)/2,Xs+=i*(Xe+t)/2,Or+=i,i=Xe*e-Ye*t,ul+=i*(Ye+e),hl+=i*(Xe+t),yi+=i*3,Yn(Ye=e,Xe=t)}const xd=Ue;function wd(e){this._context=e}wd.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,we);break}}},result:Me};var dl=new Vn,fl,_d,Ed,bi,xi,Zs={point:Me,lineStart:function(){Zs.point=Lx},lineEnd:function(){fl&&Sd(_d,Ed),Zs.point=Me},polygonStart:function(){fl=!0},polygonEnd:function(){fl=null},result:function(){var e=+dl;return dl=new Vn,e}};function Lx(e,t){Zs.point=Sd,_d=bi=e,Ed=xi=t}function Sd(e,t){bi-=e,xi-=t,dl.add(Pe(bi*bi+xi*xi)),bi=e,xi=t}const Od=Zs;let Td,Ks,Md,Cd;class $d{constructor(t){this._append=t==null?Ad:kx(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!==Md||this._append!==Ks){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`,Md=r,Ks=this._append,Cd=this._,this._=i}this._+=Cd;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Ad(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function kx(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Ad;if(t!==Td){const n=10**t;Td=t,Ks=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 Ks}function Dx(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),_r(o,i(s))),s.result()}return a.area=function(o){return _r(o,i(pd)),pd.result()},a.measure=function(o){return _r(o,i(Od)),Od.result()},a.bounds=function(o){return _r(o,i(qs)),qs.result()},a.centroid=function(o){return _r(o,i(xd)),xd.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,rl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new $d(n)):new wd(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 $d(n)),a},a.projection(e).digits(n).context(t)}function pl(e){return function(t){var n=new gl;for(var r in e)n[r]=e[r];return n.stream=t,n}}function gl(){}gl.prototype={constructor:gl,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 ml(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),_r(n,e.stream(qs)),t(qs.result()),r!=null&&e.clipExtent(r),e}function Ld(e,t,n){return ml(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 Rx(e,t,n){return Ld(e,[[0,0],t],n)}function Ix(e,t,n){return ml(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 Nx(e,t,n){return ml(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 kd=16,Px=Ot(30*Ht);function Dd(e,t){return+t?Bx(e,t):Ux(e)}function Ux(e){return pl({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Bx(e,t){function n(r,i,s,a,o,l,c,u,h,d,f,p,m,g){var v=c-r,y=u-i,b=v*v+y*y;if(b>4*t&&m--){var S=a+d,_=o+f,E=l+p,T=Pe(S*S+_*_+E*E),D=un(E/=T),N=Et(Et(E)-1)<_t||Et(s-h)<_t?(s+h)/2:qn(_,S),A=e(N,D),C=A[0],V=A[1],M=C-r,L=V-i,w=y*M-v*L;(w*w/b>t||Et((v*M+y*L)/b-.5)>.3||a*d+o*f+l*p<Px)&&(n(r,i,s,a,o,l,C,V,N,S/=T,_/=T,E,m,g),g.point(C,V),n(C,V,N,S,_,E,c,u,h,d,f,p,m,g))}}return function(r){var i,s,a,o,l,c,u,h,d,f,p,m,g={point:v,lineStart:y,lineEnd:S,polygonStart:function(){r.polygonStart(),g.lineStart=_},polygonEnd:function(){r.polygonEnd(),g.lineStart=y}};function v(D,N){D=e(D,N),r.point(D[0],D[1])}function y(){h=NaN,g.point=b,r.lineStart()}function b(D,N){var A=Er([D,N]),C=e(D,N);n(h,d,u,f,p,m,h=C[0],d=C[1],u=D,f=A[0],p=A[1],m=A[2],kd,r),r.point(h,d)}function S(){g.point=v,r.lineEnd()}function _(){y(),g.point=E,g.lineEnd=T}function E(D,N){b(i=D,N),s=h,a=d,o=f,l=p,c=m,g.point=b}function T(){n(h,d,u,f,p,m,s,a,i,o,l,c,kd,r),g.lineEnd=S,S()}return g}}var Vx=pl({point:function(e,t){this.stream.point(e*Ht,t*Ht)}});function Hx(e){return pl({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Fx(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 Rd(e,t,n,r,i,s){if(!s)return Fx(e,t,n,r,i);var a=Ot(s),o=wt(s),l=a*e,c=o*e,u=a/e,h=o/e,d=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(m,g){return m*=r,g*=i,[l*m-c*g+t,n-c*m-l*g]}return p.invert=function(m,g){return[r*(u*m-h*g+d),i*(f-h*m-u*g)]},p}function Qs(e){return Id(function(){return e})()}function Id(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,h=0,d=1,f=1,p=null,m=ud,g=null,v,y,b,S=rl,_=.5,E,T,D,N,A;function C(w){return D(w[0]*Ht,w[1]*Ht)}function V(w){return w=D.invert(w[0],w[1]),w&&[w[0]*ce,w[1]*ce]}C.stream=function(w){return N&&A===w?N:N=Vx(Hx(u)(m(E(S(A=w)))))},C.preclip=function(w){return arguments.length?(m=w,p=void 0,L()):m},C.postclip=function(w){return arguments.length?(S=w,g=v=y=b=null,L()):S},C.clipAngle=function(w){return arguments.length?(m=+w?yx(p=w*Ht):(p=null,ud),L()):p*ce},C.clipExtent=function(w){return arguments.length?(S=w==null?(g=v=y=b=null,rl):xx(g=+w[0][0],v=+w[0][1],y=+w[1][0],b=+w[1][1]),L()):g==null?null:[[g,v],[y,b]]},C.scale=function(w){return arguments.length?(n=+w,M()):n},C.translate=function(w){return arguments.length?(r=+w[0],i=+w[1],M()):[r,i]},C.center=function(w){return arguments.length?(s=w[0]%360*Ht,a=w[1]%360*Ht,M()):[s*ce,a*ce]},C.rotate=function(w){return arguments.length?(o=w[0]%360*Ht,l=w[1]%360*Ht,c=w.length>2?w[2]%360*Ht:0,M()):[o*ce,l*ce,c*ce]},C.angle=function(w){return arguments.length?(h=w%360*Ht,M()):h*ce},C.reflectX=function(w){return arguments.length?(d=w?-1:1,M()):d<0},C.reflectY=function(w){return arguments.length?(f=w?-1:1,M()):f<0},C.precision=function(w){return arguments.length?(E=Dd(T,_=w*w),L()):Pe(_)},C.fitExtent=function(w,P){return Ld(C,w,P)},C.fitSize=function(w,P){return Rx(C,w,P)},C.fitWidth=function(w,P){return Ix(C,w,P)},C.fitHeight=function(w,P){return Nx(C,w,P)};function M(){var w=Rd(n,0,0,d,f,h).apply(null,t(s,a)),P=Rd(n,r-w[0],i-w[1],d,f,h);return u=ed(o,l,c),T=tl(t,P),D=tl(u,T),E=Dd(T,_),L()}function L(){return N=A=null,C}return function(){return t=e.apply(this,arguments),C.invert=t.invert&&V,M()}}function Nd(e){var t=0,n=dt/3,r=Id(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Ht,n=s[1]*Ht):[t*ce,n*ce]},i}function Gx(e){var t=Ot(e);function n(r,i){return[r*t,wt(i)/t]}return n.invert=function(r,i){return[r/t,un(i*t)]},n}function zx(e,t){var n=wt(e),r=(n+wt(t))/2;if(Et(r)<_t)return Gx(e);var i=1+n*(2*r-n),s=Pe(i)/r;function a(o,l){var c=Pe(i-2*r*wt(l))/r;return[c*wt(o*=r),s-c*Ot(o)]}return a.invert=function(o,l){var c=s-l,u=qn(o,Et(c))*Cn(c);return c*r<0&&(u-=dt*Cn(o)*Cn(c)),[u/r,un((i-(o*o+c*c)*r*r)/(2*r))]},a}function Pd(){return Nd(zx).scale(155.424).center([0,33.6442])}function jx(){return Pd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function vl(e,t){return[e,ox(lx((pe+t)/2))]}vl.invert=function(e,t){return[e,2*Kh(ax(t))-pe]};function Wx(){return qx(vl).scale(961/we)}function qx(e){var t=Qs(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(h){return arguments.length?(r(h),u()):r()},t.translate=function(h){return arguments.length?(i(h),u()):i()},t.center=function(h){return arguments.length?(n(h),u()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=o=l=c=null:(a=+h[0][0],o=+h[0][1],l=+h[1][0],c=+h[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var h=dt*r(),d=t(ux(t.rotate()).invert([0,0]));return s(a==null?[[d[0]-h,d[1]-h],[d[0]+h,d[1]+h]]:e===vl?[[Math.max(d[0]-h,a),o],[Math.min(d[0]+h,l),c]]:[[a,Math.max(d[1]-h,o)],[l,Math.min(d[1]+h,c)]])}return u()}function Js(e,t){return[e,t]}Js.invert=Js;function Yx(){return Qs(Js).scale(152.63)}function Xx(e,t){var n=Ot(e),r=e===t?wt(e):(n-Ot(t))/(t-e),i=n/r+e;if(Et(r)<_t)return Js;function s(a,o){var l=i-o,c=r*a;return[l*wt(c),i-l*Ot(c)]}return s.invert=function(a,o){var l=i-o,c=qn(a,Et(l))*Cn(l);return l*r<0&&(c-=dt*Cn(a)*Cn(l)),[c/r,i-Cn(r)*Pe(a*a+l*l)]},s}function Zx(){return Nd(Xx).scale(131.154).center([0,13.9389])}var wi=1.340264,_i=-.081106,Ei=893e-6,Si=.003796,ta=Pe(3)/2,Kx=12;function Ud(e,t){var n=un(ta*wt(t)),r=n*n,i=r*r*r;return[e*Ot(n)/(ta*(wi+3*_i*r+i*(7*Ei+9*Si*r))),n*(wi+_i*r+i*(Ei+Si*r))]}Ud.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<Kx&&(o=n*(wi+_i*r+i*(Ei+Si*r))-t,l=wi+3*_i*r+i*(7*Ei+9*Si*r),n-=a=o/l,r=n*n,i=r*r*r,!(Et(a)<Xh));++s);return[ta*e*(wi+3*_i*r+i*(7*Ei+9*Si*r))/Ot(n),un(wt(n)/ta)]};function Qx(){return Qs(Ud).scale(177.158)}function Bd(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)))]}Bd.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(Et(i)>_t&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Jx(){return Qs(Bd).scale(175.295)}function tw(e,t){return e.parent===t.parent?1:2}function ew(e){return e.reduce(nw,0)/e.length}function nw(e,t){return e+t.x}function rw(e){return 1+e.reduce(iw,0)}function iw(e,t){return Math.max(e,t.y)}function sw(e){for(var t;t=e.children;)e=t[0];return e}function aw(e){for(var t;t=e.children;)e=t[t.length-1];return e}function ow(){var e=tw,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(d){var f=d.children;f?(d.x=ew(f),d.y=rw(f)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var l=sw(s),c=aw(s),u=l.x-e(l,c)/2,h=c.x+e(c,l)/2;return s.eachAfter(r?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-u)/(h-u)*t,d.y=(1-(s.y?d.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 lw(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 cw(){return this.eachAfter(lw)}function uw(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function hw(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 dw(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 fw(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function pw(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 gw(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function mw(e){for(var t=this,n=vw(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 vw(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 yw(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function bw(){return Array.from(this)}function xw(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function ww(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*_w(){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 Oi(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ow)):t===void 0&&(t=Sw);for(var n=new Ti(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 Ti(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Mw)}function Ew(){return Oi(this).eachBefore(Tw)}function Sw(e){return e.children}function Ow(e){return Array.isArray(e)?e[1]:null}function Tw(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Mw(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ti(e){this.data=e,this.depth=this.height=0,this.parent=null}Ti.prototype=Oi.prototype={constructor:Ti,count:cw,each:uw,eachAfter:dw,eachBefore:hw,find:fw,sum:pw,sort:gw,path:mw,ancestors:yw,descendants:bw,leaves:xw,links:ww,copy:Ew,[Symbol.iterator]:_w};function Cw(e){return e==null?null:Vd(e)}function Vd(e){if(typeof e!="function")throw new Error;return e}function Xn(){return 0}function Tr(e){return function(){return e}}const $w=1664525,Aw=1013904223,Hd=4294967296;function Lw(){let e=1;return()=>(e=($w*e+Aw)%Hd)/Hd}function kw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Dw(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 Rw(e,t){for(var n=0,r=(e=Dw(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Fd(a,s)?++n:(a=Nw(i=Iw(i,s)),n=0);return a}function Iw(e,t){var n,r;if(yl(t,e))return[t];for(n=0;n<e.length;++n)if(ea(t,e[n])&&yl(Mi(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(ea(Mi(e[n],e[r]),t)&&ea(Mi(e[n],t),e[r])&&ea(Mi(e[r],t),e[n])&&yl(Gd(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function ea(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 Fd(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 yl(e,t){for(var n=0;n<t.length;++n)if(!Fd(e,t[n]))return!1;return!0}function Nw(e){switch(e.length){case 1:return Pw(e[0]);case 2:return Mi(e[0],e[1]);case 3:return Gd(e[0],e[1],e[2])}}function Pw(e){return{x:e.x,y:e.y,r:e.r}}function Mi(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,h=Math.sqrt(l*l+c*c);return{x:(n+s+l/h*u)/2,y:(r+a+c/h*u)/2,r:(h+i+o)/2}}function Gd(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,h=n.r,d=r-a,f=r-c,p=i-o,m=i-u,g=l-s,v=h-s,y=r*r+i*i-s*s,b=y-a*a-o*o+l*l,S=y-c*c-u*u+h*h,_=f*p-d*m,E=(p*S-m*b)/(_*2)-r,T=(m*g-p*v)/_,D=(f*b-d*S)/(_*2)-i,N=(d*v-f*g)/_,A=T*T+N*N-1,C=2*(s+E*T+D*N),V=E*E+D*D-s*s,M=-(Math.abs(A)>1e-6?(C+Math.sqrt(C*C-4*A*V))/(2*A):V/C);return{x:r+E+T*M,y:i+D+N*M,r:M}}function zd(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 jd(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 Wd(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 Uw(e,t){if(!(s=(e=kw(e)).length))return 0;var n,r,i,s,a,o,l,c,u,h,d;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;zd(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){zd(n._,r._,i=e[l]),i=new na(i),c=r.next,u=n.previous,h=r._.r,d=n._.r;do if(h<=d){if(jd(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}h+=c._.r,c=c.next}else{if(jd(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}d+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Wd(n);(i=i.next)!==r;)(o=Wd(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Rw(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function Bw(e){return Math.sqrt(e.value)}function Vw(){var e=null,t=1,n=1,r=Xn;function i(s){const a=Lw();return s.x=t/2,s.y=n/2,e?s.eachBefore(qd(e)).eachAfter(bl(r,.5,a)).eachBefore(Yd(1)):s.eachBefore(qd(Bw)).eachAfter(bl(Xn,1,a)).eachAfter(bl(r,s.r/Math.min(t,n),a)).eachBefore(Yd(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=Cw(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:Tr(+s),i):r},i}function qd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function bl(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=Uw(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function Yd(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 Hw(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 Fw(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 Gw(e,t){return e.parent===t.parent?1:2}function xl(e){var t=e.children;return t?t[0]:e.t}function wl(e){var t=e.children;return t?t[t.length-1]:e.t}function zw(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 jw(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 Ww(e,t,n){return e.a.parent===t.parent?e.a:n}function ra(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}ra.prototype=Object.create(Ti.prototype);function qw(e){for(var t=new ra(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 ra(s[a],a)),i.parent=n;return(t.parent=new ra(null,0)).children=[t],t}function Yw(){var e=Gw,t=1,n=1,r=null;function i(c){var u=qw(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var h=c,d=c,f=c;c.eachBefore(function(y){y.x<h.x&&(h=y),y.x>d.x&&(d=y),y.depth>f.depth&&(f=y)});var p=h===d?1:e(h,d)/2,m=p-h.x,g=t/(d.x+p+m),v=n/(f.depth||1);c.eachBefore(function(y){y.x=(y.x+m)*g,y.y=y.depth*v})}return c}function s(c){var u=c.children,h=c.parent.children,d=c.i?h[c.i-1]:null;if(u){jw(c);var f=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-f):c.z=f}else d&&(c.z=d.z+e(c._,d._));c.parent.A=o(c,d,c.parent.A||h[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,h){if(u){for(var d=c,f=c,p=u,m=d.parent.children[0],g=d.m,v=f.m,y=p.m,b=m.m,S;p=wl(p),d=xl(d),p&&d;)m=xl(m),f=wl(f),f.a=c,S=p.z+y-d.z-g+e(p._,d._),S>0&&(zw(Ww(p,c,h),c,S),g+=S,v+=S),y+=p.m,g+=d.m,b+=m.m,v+=f.m;p&&!wl(f)&&(f.t=p,f.m+=y-v),d&&!xl(m)&&(m.t=d,m.m+=g-b,h=c)}return h}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 Xw(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 Zw=(1+Math.sqrt(5))/2;function Kw(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,h=0,d=o.length,f,p,m=t.value,g,v,y,b,S,_,E;u<d;){f=i-n,p=s-r;do g=o[h++].value;while(!g&&h<d);for(v=y=g,_=Math.max(p/f,f/p)/(m*e),E=g*g*_,S=Math.max(y/E,E/v);h<d;++h){if(g+=c=o[h].value,c<v&&(v=c),c>y&&(y=c),E=g*g*_,b=Math.max(y/E,E/v),b>S){g-=c;break}S=b}a.push(l={value:g,dice:f<p,children:o.slice(u,h)}),l.dice?Fw(l,n,r,i,m?r+=p*g/m:s):Xw(l,n,r,m?n+=f*g/m:i,s),m-=g,u=h}return a}const Qw=function e(t){function n(r,i,s,a,o){Kw(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(Zw);function Jw(){var e=Qw,t=!1,n=1,r=1,i=[0],s=Xn,a=Xn,o=Xn,l=Xn,c=Xn;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(h),i=[0],t&&d.eachBefore(Hw),d}function h(d){var f=i[d.depth],p=d.x0+f,m=d.y0+f,g=d.x1-f,v=d.y1-f;g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),d.x0=p,d.y0=m,d.x1=g,d.y1=v,d.children&&(f=i[d.depth+1]=s(d)/2,p+=c(d)-f,m+=a(d)-f,g-=o(d)-f,v-=l(d)-f,g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),e(d,p,m,g,v))}return u.round=function(d){return arguments.length?(t=!!d,u):t},u.size=function(d){return arguments.length?(n=+d[0],r=+d[1],u):[n,r]},u.tile=function(d){return arguments.length?(e=Vd(d),u):e},u.padding=function(d){return arguments.length?u.paddingInner(d).paddingOuter(d):u.paddingInner()},u.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:Tr(+d),u):s},u.paddingOuter=function(d){return arguments.length?u.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):u.paddingTop()},u.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:Tr(+d),u):a},u.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:Tr(+d),u):o},u.paddingBottom=function(d){return arguments.length?(l=typeof d=="function"?d:Tr(+d),u):l},u.paddingLeft=function(d){return arguments.length?(c=typeof d=="function"?d:Tr(+d),u):c},u}function Mr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Xd=Symbol("implicit");function ia(){var e=new Uu,t=[],n=[],r=Xd;function i(s){let a=e.get(s);if(a===void 0){if(r!==Xd)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 Uu;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 ia(t,n).unknown(r)},Mr.apply(i,arguments),i}function Ci(){var e=ia().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 h(){var d=t().length,f=i<r,p=f?i:r,m=f?r:i;s=(m-p)/Math.max(1,d-l+c*2),o&&(s=Math.floor(s)),p+=(m-p-s*(d-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var g=l0(d).map(function(v){return p+s*v});return n(f?g.reverse():g)}return e.domain=function(d){return arguments.length?(t(d),h()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(d){return arguments.length?(o=!!d,h()):o},e.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),h()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),h()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,h()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),h()):u},e.copy=function(){return Ci(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Mr.apply(h(),arguments)}function t_(e){return function(){return e}}function e_(e){return+e}var Zd=[0,1];function Cr(e){return e}function _l(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:t_(isNaN(t)?NaN:.5)}function n_(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function r_(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=_l(i,r),s=n(a,s)):(r=_l(r,i),s=n(s,a)),function(o){return s(r(o))}}function i_(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]=_l(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=fo(e,o,1,r)-1;return s[l](i[l](o))}}function El(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Kd(){var e=Zd,t=Zd,n=ci,r,i,s,a=Cr,o,l,c;function u(){var d=Math.min(e.length,t.length);return a!==Cr&&(a=n_(e[0],e[d-1])),o=d>2?i_:r_,l=c=null,h}function h(d){return d==null||isNaN(d=+d)?s:(l||(l=o(e.map(r),t,n)))(r(a(d)))}return h.invert=function(d){return a(i((c||(c=o(t,e.map(r),xe)))(d)))},h.domain=function(d){return arguments.length?(e=Array.from(d,e_),u()):e.slice()},h.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},h.rangeRound=function(d){return t=Array.from(d),n=vh,u()},h.clamp=function(d){return arguments.length?(a=d?!0:Cr,u()):a!==Cr},h.interpolate=function(d){return arguments.length?(n=d,u()):n},h.unknown=function(d){return arguments.length?(s=d,h):s},function(d,f){return r=d,i=f,u()}}function Qd(){return Kd()(Cr,Cr)}function s_(e,t,n,r){var i=go(e,t,n),s;switch(r=pi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=ix(i,a))&&(r.precision=s),Yh(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=sx(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=rx(i))&&(r.precision=s-(r.type==="%")*2);break}}return Xo(r)}function Jd(e){var t=e.domain;return e.ticks=function(n){var r=t();return ps(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return s_(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=gr(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 Be(){var e=Qd();return e.copy=function(){return El(e,Be())},Mr.apply(e,arguments),Jd(e)}function tf(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 ef(e){return Math.log(e)}function nf(e){return Math.exp(e)}function a_(e){return-Math.log(-e)}function o_(e){return-Math.exp(-e)}function l_(e){return isFinite(e)?+("1e"+e):e<0?0:e}function c_(e){return e===10?l_:e===Math.E?Math.exp:t=>Math.pow(e,t)}function u_(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 rf(e){return(t,n)=>-e(-t,n)}function h_(e){const t=e(ef,nf),n=t.domain;let r=10,i,s;function a(){return i=u_(r),s=c_(r),n()[0]<0?(i=rf(i),s=rf(s),e(a_,o_)):e(ef,nf),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 h=u<c;h&&([c,u]=[u,c]);let d=i(c),f=i(u),p,m;const g=o==null?10:+o;let v=[];if(!(r%1)&&f-d<g){if(d=Math.floor(d),f=Math.ceil(f),c>0){for(;d<=f;++d)for(p=1;p<r;++p)if(m=d<0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}}else for(;d<=f;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}v.length*2<g&&(v=ps(c,u,g))}else v=ps(d,f,Math.min(f-d,g)).map(s);return h?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=pi(l)).precision==null&&(l.trim=!0),l=Xo(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let h=u/s(Math.round(i(u)));return h*r<r-.5&&(h*=r),h<=c?l(u):""}},t.nice=()=>n(tf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function sf(){const e=h_(Kd()).domain([1,10]);return e.copy=()=>El(e,sf()).base(e.base()),Mr.apply(e,arguments),e}function Sl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[fo(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 Sl().domain([e,t]).range(i).unknown(s)},Mr.apply(Jd(a),arguments)}const Ol=new Date,Tl=new Date;function Zt(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=>Zt(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)=>(Ol.setTime(+s),Tl.setTime(+a),e(Ol),e(Tl),Math.floor(n(Ol,Tl))),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 sa=Zt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);sa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Zt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):sa),sa.range;const hn=1e3,Ce=hn*60,dn=Ce*60,fn=dn*24,Ml=fn*7,af=fn*30,Cl=fn*365,$r=Zt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*hn)},(e,t)=>(t-e)/hn,e=>e.getUTCSeconds());$r.range;const $l=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getMinutes());$l.range,Zt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getUTCMinutes()).range;const Al=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn-e.getMinutes()*Ce)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getHours());Al.range,Zt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getUTCHours()).range;const $i=Zt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ce)/fn,e=>e.getDate()-1);$i.range;const Ll=Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fn,e=>e.getUTCDate()-1);Ll.range,Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fn,e=>Math.floor(e/fn)).range;function Zn(e){return Zt(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())*Ce)/Ml)}const aa=Zn(0),oa=Zn(1),d_=Zn(2),f_=Zn(3),Ar=Zn(4),p_=Zn(5),g_=Zn(6);aa.range,oa.range,d_.range,f_.range,Ar.range,p_.range,g_.range;function Kn(e){return Zt(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)/Ml)}const of=Kn(0),la=Kn(1),m_=Kn(2),v_=Kn(3),Lr=Kn(4),y_=Kn(5),b_=Kn(6);of.range,la.range,m_.range,v_.range,Lr.range,y_.range,b_.range;const kl=Zt(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());kl.range,Zt(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 pn=Zt(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());pn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(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)}),pn.range;const Qn=Zt(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());Qn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(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)}),Qn.range;function x_(e,t,n,r,i,s){const a=[[$r,1,hn],[$r,5,5*hn],[$r,15,15*hn],[$r,30,30*hn],[s,1,Ce],[s,5,5*Ce],[s,15,15*Ce],[s,30,30*Ce],[i,1,dn],[i,3,3*dn],[i,6,6*dn],[i,12,12*dn],[r,1,fn],[r,2,2*fn],[n,1,Ml],[t,1,af],[t,3,3*af],[e,1,Cl]];function o(c,u,h){const d=u<c;d&&([c,u]=[u,c]);const f=h&&typeof h.range=="function"?h:l(c,u,h),p=f?f.range(c,+u+1):[];return d?p.reverse():p}function l(c,u,h){const d=Math.abs(u-c)/h,f=ho(([,,g])=>g).right(a,d);if(f===a.length)return e.every(go(c/Cl,u/Cl,h));if(f===0)return sa.every(Math.max(go(c,u,h),1));const[p,m]=a[d/a[f-1][2]<a[f][2]/d?f-1:f];return p.every(m)}return[o,l]}const[w_,__]=x_(pn,kl,aa,$i,Al,$l);function Dl(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 Rl(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 Ai(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function E_(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=Li(i),u=ki(i),h=Li(s),d=ki(s),f=Li(a),p=ki(a),m=Li(o),g=ki(o),v=Li(l),y=ki(l),b={a:U,A:I,b:B,B:j,c:null,d:ff,e:ff,f:W_,g:nE,G:iE,H:G_,I:z_,j:j_,L:pf,m:q_,M:Y_,p:Y,q:et,Q:xf,s:wf,S:X_,u:Z_,U:K_,V:Q_,w:J_,W:tE,x:null,X:null,y:eE,Y:rE,Z:sE,"%":bf},S={a:pt,A:z,b:K,B:ht,c:null,d:mf,e:mf,f:cE,g:bE,G:wE,H:aE,I:oE,j:lE,L:vf,m:uE,M:hE,p:it,q:Mt,Q:xf,s:wf,S:dE,u:fE,U:pE,V:gE,w:mE,W:vE,x:null,X:null,y:yE,Y:xE,Z:_E,"%":bf},_={a:A,A:C,b:V,B:M,c:L,d:hf,e:hf,f:B_,g:uf,G:cf,H:df,I:df,j:I_,L:U_,m:R_,M:N_,p:N,q:D_,Q:H_,s:F_,S:P_,u:C_,U:$_,V:A_,w:M_,W:L_,x:w,X:P,y:uf,Y:cf,Z:k_,"%":V_};b.x=E(n,b),b.X=E(r,b),b.c=E(t,b),S.x=E(n,S),S.X=E(r,S),S.c=E(t,S);function E(W,J){return function(ct){var F=[],Ut=-1,bt=0,zt=W.length,jt,nt,It;for(ct instanceof Date||(ct=new Date(+ct));++Ut<zt;)W.charCodeAt(Ut)===37&&(F.push(W.slice(bt,Ut)),(nt=lf[jt=W.charAt(++Ut)])!=null?jt=W.charAt(++Ut):nt=jt==="e"?" ":"0",(It=J[jt])&&(jt=It(ct,nt)),F.push(jt),bt=Ut+1);return F.push(W.slice(bt,Ut)),F.join("")}}function T(W,J){return function(ct){var F=Ai(1900,void 0,1),Ut=D(F,W,ct+="",0),bt,zt;if(Ut!=ct.length)return null;if("Q"in F)return new Date(F.Q);if("s"in F)return new Date(F.s*1e3+("L"in F?F.L:0));if(J&&!("Z"in F)&&(F.Z=0),"p"in F&&(F.H=F.H%12+F.p*12),F.m===void 0&&(F.m="q"in F?F.q:0),"V"in F){if(F.V<1||F.V>53)return null;"w"in F||(F.w=1),"Z"in F?(bt=Rl(Ai(F.y,0,1)),zt=bt.getUTCDay(),bt=zt>4||zt===0?la.ceil(bt):la(bt),bt=Ll.offset(bt,(F.V-1)*7),F.y=bt.getUTCFullYear(),F.m=bt.getUTCMonth(),F.d=bt.getUTCDate()+(F.w+6)%7):(bt=Dl(Ai(F.y,0,1)),zt=bt.getDay(),bt=zt>4||zt===0?oa.ceil(bt):oa(bt),bt=$i.offset(bt,(F.V-1)*7),F.y=bt.getFullYear(),F.m=bt.getMonth(),F.d=bt.getDate()+(F.w+6)%7)}else("W"in F||"U"in F)&&("w"in F||(F.w="u"in F?F.u%7:"W"in F?1:0),zt="Z"in F?Rl(Ai(F.y,0,1)).getUTCDay():Dl(Ai(F.y,0,1)).getDay(),F.m=0,F.d="W"in F?(F.w+6)%7+F.W*7-(zt+5)%7:F.w+F.U*7-(zt+6)%7);return"Z"in F?(F.H+=F.Z/100|0,F.M+=F.Z%100,Rl(F)):Dl(F)}}function D(W,J,ct,F){for(var Ut=0,bt=J.length,zt=ct.length,jt,nt;Ut<bt;){if(F>=zt)return-1;if(jt=J.charCodeAt(Ut++),jt===37){if(jt=J.charAt(Ut++),nt=_[jt in lf?J.charAt(Ut++):jt],!nt||(F=nt(W,ct,F))<0)return-1}else if(jt!=ct.charCodeAt(F++))return-1}return F}function N(W,J,ct){var F=c.exec(J.slice(ct));return F?(W.p=u.get(F[0].toLowerCase()),ct+F[0].length):-1}function A(W,J,ct){var F=f.exec(J.slice(ct));return F?(W.w=p.get(F[0].toLowerCase()),ct+F[0].length):-1}function C(W,J,ct){var F=h.exec(J.slice(ct));return F?(W.w=d.get(F[0].toLowerCase()),ct+F[0].length):-1}function V(W,J,ct){var F=v.exec(J.slice(ct));return F?(W.m=y.get(F[0].toLowerCase()),ct+F[0].length):-1}function M(W,J,ct){var F=m.exec(J.slice(ct));return F?(W.m=g.get(F[0].toLowerCase()),ct+F[0].length):-1}function L(W,J,ct){return D(W,t,J,ct)}function w(W,J,ct){return D(W,n,J,ct)}function P(W,J,ct){return D(W,r,J,ct)}function U(W){return a[W.getDay()]}function I(W){return s[W.getDay()]}function B(W){return l[W.getMonth()]}function j(W){return o[W.getMonth()]}function Y(W){return i[+(W.getHours()>=12)]}function et(W){return 1+~~(W.getMonth()/3)}function pt(W){return a[W.getUTCDay()]}function z(W){return s[W.getUTCDay()]}function K(W){return l[W.getUTCMonth()]}function ht(W){return o[W.getUTCMonth()]}function it(W){return i[+(W.getUTCHours()>=12)]}function Mt(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var J=E(W+="",b);return J.toString=function(){return W},J},parse:function(W){var J=T(W+="",!1);return J.toString=function(){return W},J},utcFormat:function(W){var J=E(W+="",S);return J.toString=function(){return W},J},utcParse:function(W){var J=T(W+="",!0);return J.toString=function(){return W},J}}}var lf={"-":"",_:" ",0:"0"},Jt=/^\s*\d+/,S_=/^%/,O_=/[\\^$*+?|[\]().{}]/g;function vt(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 T_(e){return e.replace(O_,"\\$&")}function Li(e){return new RegExp("^(?:"+e.map(T_).join("|")+")","i")}function ki(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function M_(e,t,n){var r=Jt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function C_(e,t,n){var r=Jt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function $_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function A_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function L_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function cf(e,t,n){var r=Jt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function uf(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function k_(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 D_(e,t,n){var r=Jt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function R_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function hf(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function I_(e,t,n){var r=Jt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function df(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function N_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function P_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function U_(e,t,n){var r=Jt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function B_(e,t,n){var r=Jt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function V_(e,t,n){var r=S_.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function H_(e,t,n){var r=Jt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function F_(e,t,n){var r=Jt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ff(e,t){return vt(e.getDate(),t,2)}function G_(e,t){return vt(e.getHours(),t,2)}function z_(e,t){return vt(e.getHours()%12||12,t,2)}function j_(e,t){return vt(1+$i.count(pn(e),e),t,3)}function pf(e,t){return vt(e.getMilliseconds(),t,3)}function W_(e,t){return pf(e,t)+"000"}function q_(e,t){return vt(e.getMonth()+1,t,2)}function Y_(e,t){return vt(e.getMinutes(),t,2)}function X_(e,t){return vt(e.getSeconds(),t,2)}function Z_(e){var t=e.getDay();return t===0?7:t}function K_(e,t){return vt(aa.count(pn(e)-1,e),t,2)}function gf(e){var t=e.getDay();return t>=4||t===0?Ar(e):Ar.ceil(e)}function Q_(e,t){return e=gf(e),vt(Ar.count(pn(e),e)+(pn(e).getDay()===4),t,2)}function J_(e){return e.getDay()}function tE(e,t){return vt(oa.count(pn(e)-1,e),t,2)}function eE(e,t){return vt(e.getFullYear()%100,t,2)}function nE(e,t){return e=gf(e),vt(e.getFullYear()%100,t,2)}function rE(e,t){return vt(e.getFullYear()%1e4,t,4)}function iE(e,t){var n=e.getDay();return e=n>=4||n===0?Ar(e):Ar.ceil(e),vt(e.getFullYear()%1e4,t,4)}function sE(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function mf(e,t){return vt(e.getUTCDate(),t,2)}function aE(e,t){return vt(e.getUTCHours(),t,2)}function oE(e,t){return vt(e.getUTCHours()%12||12,t,2)}function lE(e,t){return vt(1+Ll.count(Qn(e),e),t,3)}function vf(e,t){return vt(e.getUTCMilliseconds(),t,3)}function cE(e,t){return vf(e,t)+"000"}function uE(e,t){return vt(e.getUTCMonth()+1,t,2)}function hE(e,t){return vt(e.getUTCMinutes(),t,2)}function dE(e,t){return vt(e.getUTCSeconds(),t,2)}function fE(e){var t=e.getUTCDay();return t===0?7:t}function pE(e,t){return vt(of.count(Qn(e)-1,e),t,2)}function yf(e){var t=e.getUTCDay();return t>=4||t===0?Lr(e):Lr.ceil(e)}function gE(e,t){return e=yf(e),vt(Lr.count(Qn(e),e)+(Qn(e).getUTCDay()===4),t,2)}function mE(e){return e.getUTCDay()}function vE(e,t){return vt(la.count(Qn(e)-1,e),t,2)}function yE(e,t){return vt(e.getUTCFullYear()%100,t,2)}function bE(e,t){return e=yf(e),vt(e.getUTCFullYear()%100,t,2)}function xE(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function wE(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Lr(e):Lr.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function _E(){return"+0000"}function bf(){return"%"}function xf(e){return+e}function wf(e){return Math.floor(+e/1e3)}var kr,_f;EE({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 EE(e){return kr=E_(e),_f=kr.format,kr.parse,kr.utcFormat,kr.utcParse,kr}function SE(e){return new Date(e)}function OE(e){return e instanceof Date?+e:+new Date(+e)}function Ef(e,t,n,r,i,s,a,o,l,c){var u=Qd(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),S=c("%Y");function _(E){return(l(E)<E?f:o(E)<E?p:a(E)<E?m:s(E)<E?g:r(E)<E?i(E)<E?v:y:n(E)<E?b:S)(E)}return u.invert=function(E){return new Date(h(E))},u.domain=function(E){return arguments.length?d(Array.from(E,OE)):d().map(SE)},u.ticks=function(E){var T=d();return e(T[0],T[T.length-1],E??10)},u.tickFormat=function(E,T){return T==null?_:c(T)},u.nice=function(E){var T=d();return(!E||typeof E.range!="function")&&(E=t(T[0],T[T.length-1],E??10)),E?d(tf(T,E)):u},u.copy=function(){return El(u,Ef(e,t,n,r,i,s,a,o,l,c))},u}function Sf(){return Mr.apply(Ef(w_,__,pn,kl,aa,$i,Al,$l,$r,_f).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ut(e){return function(){return e}}const Of=Math.abs,ae=Math.atan2,Jn=Math.cos,TE=Math.max,Il=Math.min,Ze=Math.sin,Dr=Math.sqrt,oe=1e-12,Di=Math.PI,ca=Di/2,ua=2*Di;function ME(e){return e>1?0:e<-1?Di:Math.acos(e)}function Tf(e){return e>=1?ca:e<=-1?-ca:Math.asin(e)}function ha(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 qo(t)}function CE(e){return e.innerRadius}function $E(e){return e.outerRadius}function AE(e){return e.startAngle}function LE(e){return e.endAngle}function kE(e){return e&&e.padAngle}function DE(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,h=o-s,d=h*l-u*c;if(!(d*d<oe))return d=(u*(t-s)-h*(e-i))/d,[e+d*l,t+d*c]}function da(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Dr(o*o+l*l),u=c*l,h=-c*o,d=e+u,f=t+h,p=n+u,m=r+h,g=(d+p)/2,v=(f+m)/2,y=p-d,b=m-f,S=y*y+b*b,_=i-s,E=d*m-p*f,T=(b<0?-1:1)*Dr(TE(0,_*_*S-E*E)),D=(E*b-y*T)/S,N=(-E*y-b*T)/S,A=(E*b+y*T)/S,C=(-E*y+b*T)/S,V=D-g,M=N-v,L=A-g,w=C-v;return V*V+M*M>L*L+w*w&&(D=A,N=C),{cx:D,cy:N,x01:-u,y01:-h,x11:D*(i/_-1),y11:N*(i/_-1)}}function Ri(){var e=CE,t=$E,n=ut(0),r=null,i=AE,s=LE,a=kE,o=null,l=ha(c);function c(){var u,h,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-ca,m=s.apply(this,arguments)-ca,g=Of(m-p),v=m>p;if(o||(o=u=l()),f<d&&(h=f,f=d,d=h),!(f>oe))o.moveTo(0,0);else if(g>ua-oe)o.moveTo(f*Jn(p),f*Ze(p)),o.arc(0,0,f,p,m,!v),d>oe&&(o.moveTo(d*Jn(m),d*Ze(m)),o.arc(0,0,d,m,p,v));else{var y=p,b=m,S=p,_=m,E=g,T=g,D=a.apply(this,arguments)/2,N=D>oe&&(r?+r.apply(this,arguments):Dr(d*d+f*f)),A=Il(Of(f-d)/2,+n.apply(this,arguments)),C=A,V=A,M,L;if(N>oe){var w=Tf(N/d*Ze(D)),P=Tf(N/f*Ze(D));(E-=w*2)>oe?(w*=v?1:-1,S+=w,_-=w):(E=0,S=_=(p+m)/2),(T-=P*2)>oe?(P*=v?1:-1,y+=P,b-=P):(T=0,y=b=(p+m)/2)}var U=f*Jn(y),I=f*Ze(y),B=d*Jn(_),j=d*Ze(_);if(A>oe){var Y=f*Jn(b),et=f*Ze(b),pt=d*Jn(S),z=d*Ze(S),K;if(g<Di)if(K=DE(U,I,pt,z,Y,et,B,j)){var ht=U-K[0],it=I-K[1],Mt=Y-K[0],W=et-K[1],J=1/Ze(ME((ht*Mt+it*W)/(Dr(ht*ht+it*it)*Dr(Mt*Mt+W*W)))/2),ct=Dr(K[0]*K[0]+K[1]*K[1]);C=Il(A,(d-ct)/(J-1)),V=Il(A,(f-ct)/(J+1))}else C=V=0}T>oe?V>oe?(M=da(pt,z,U,I,f,V,v),L=da(Y,et,B,j,f,V,v),o.moveTo(M.cx+M.x01,M.cy+M.y01),V<A?o.arc(M.cx,M.cy,V,ae(M.y01,M.x01),ae(L.y01,L.x01),!v):(o.arc(M.cx,M.cy,V,ae(M.y01,M.x01),ae(M.y11,M.x11),!v),o.arc(0,0,f,ae(M.cy+M.y11,M.cx+M.x11),ae(L.cy+L.y11,L.cx+L.x11),!v),o.arc(L.cx,L.cy,V,ae(L.y11,L.x11),ae(L.y01,L.x01),!v))):(o.moveTo(U,I),o.arc(0,0,f,y,b,!v)):o.moveTo(U,I),!(d>oe)||!(E>oe)?o.lineTo(B,j):C>oe?(M=da(B,j,Y,et,d,-C,v),L=da(U,I,pt,z,d,-C,v),o.lineTo(M.cx+M.x01,M.cy+M.y01),C<A?o.arc(M.cx,M.cy,C,ae(M.y01,M.x01),ae(L.y01,L.x01),!v):(o.arc(M.cx,M.cy,C,ae(M.y01,M.x01),ae(M.y11,M.x11),!v),o.arc(0,0,d,ae(M.cy+M.y11,M.cx+M.x11),ae(L.cy+L.y11,L.cx+L.x11),v),o.arc(L.cx,L.cy,C,ae(L.y11,L.x11),ae(L.y01,L.x01),!v))):o.arc(0,0,d,_,S,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Di/2;return[Jn(h)*u,Ze(h)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ut(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ut(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ut(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ut(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ut(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ut(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ut(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var RE=Array.prototype.slice;function fa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Mf(e){this._context=e}Mf.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 pa(e){return new Mf(e)}function Nl(e){return e[0]}function Pl(e){return e[1]}function Ii(e,t){var n=ut(!0),r=null,i=pa,s=null,a=ha(o);e=typeof e=="function"?e:e===void 0?Nl:ut(e),t=typeof t=="function"?t:t===void 0?Pl:ut(t);function o(l){var c,u=(l=fa(l)).length,h,d=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(h=l[c],c,l))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,c,l),+t(h,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:ut(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ut(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ut(!!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 Ul(e,t,n){var r=null,i=ut(!0),s=null,a=pa,o=null,l=ha(c);e=typeof e=="function"?e:e===void 0?Nl:ut(+e),t=typeof t=="function"?t:ut(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Pl:ut(+n);function c(h){var d,f,p,m=(h=fa(h)).length,g,v=!1,y,b=new Array(m),S=new Array(m);for(s==null&&(o=a(y=l())),d=0;d<=m;++d){if(!(d<m&&i(g=h[d],d,h))===v)if(v=!v)f=d,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=d-1;p>=f;--p)o.point(b[p],S[p]);o.lineEnd(),o.areaEnd()}v&&(b[d]=+e(g,d,h),S[d]=+t(g,d,h),o.point(r?+r(g,d,h):b[d],n?+n(g,d,h):S[d]))}if(y)return o=null,y+""||null}function u(){return Ii().defined(i).curve(a).context(s)}return c.x=function(h){return arguments.length?(e=typeof h=="function"?h:ut(+h),r=null,c):e},c.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ut(+h),c):e},c.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ut(+h),c):r},c.y=function(h){return arguments.length?(t=typeof h=="function"?h:ut(+h),n=null,c):t},c.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ut(+h),c):t},c.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ut(+h),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(h){return arguments.length?(i=typeof h=="function"?h:ut(!!h),c):i},c.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),c):a},c.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),c):s},c}function IE(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function NE(e){return e}function PE(){var e=NE,t=IE,n=null,r=ut(0),i=ut(ua),s=ut(0);function a(o){var l,c=(o=fa(o)).length,u,h,d=0,f=new Array(c),p=new Array(c),m=+r.apply(this,arguments),g=Math.min(ua,Math.max(-ua,i.apply(this,arguments)-m)),v,y=Math.min(Math.abs(g)/c,s.apply(this,arguments)),b=y*(g<0?-1:1),S;for(l=0;l<c;++l)(S=p[f[l]=l]=+e(o[l],l,o))>0&&(d+=S);for(t!=null?f.sort(function(_,E){return t(p[_],p[E])}):n!=null&&f.sort(function(_,E){return n(o[_],o[E])}),l=0,h=d?(g-c*b)/d:0;l<c;++l,m=v)u=f[l],S=p[u],v=m+(S>0?S*h:0)+b,p[u]={data:o[u],index:l,value:S,startAngle:m,endAngle:v,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ut(+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:ut(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ut(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ut(+o),a):s},a}var UE=$f(pa);function Cf(e){this._curve=e}Cf.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 $f(e){function t(n){return new Cf(e(n))}return t._curve=e,t}function BE(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($f(n)):t()._curve},e}function VE(){return BE(Ii().curve(UE))}class HE{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 FE(e){return new HE(e,!0)}function GE(e){return e.source}function zE(e){return e.target}function jE(e){let t=GE,n=zE,r=Nl,i=Pl,s=null,a=null,o=ha(l);function l(){let c;const u=RE.call(arguments),h=t.apply(this,u),d=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=d,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:ut(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ut(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function WE(){return jE(FE)}function An(){}function ga(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 ma(e){this._context=e}ma.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:ga(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:ga(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qE(e){return new ma(e)}function Af(e){this._context=e}Af.prototype={areaStart:An,areaEnd:An,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:ga(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YE(e){return new Af(e)}function Lf(e){this._context=e}Lf.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:ga(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XE(e){return new Lf(e)}function kf(e,t){this._basis=new ma(e),this._beta=t}kf.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 ZE=function e(t){function n(r){return t===1?new ma(r):new kf(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function va(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 Bl(e,t){this._context=e,this._k=(1-t)/6}Bl.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:va(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:va(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 KE=function e(t){function n(r){return new Bl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Vl(e,t){this._context=e,this._k=(1-t)/6}Vl.prototype={areaStart:An,areaEnd:An,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:va(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 QE=function e(t){function n(r){return new Vl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Hl(e,t){this._context=e,this._k=(1-t)/6}Hl.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:va(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 JE=function e(t){function n(r){return new Hl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Fl(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>oe){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>oe){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 Df(e,t){this._context=e,this._alpha=t}Df.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:Fl(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 tS=function e(t){function n(r){return t?new Df(r,t):new Bl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Rf(e,t){this._context=e,this._alpha=t}Rf.prototype={areaStart:An,areaEnd:An,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:Fl(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 eS=function e(t){function n(r){return t?new Rf(r,t):new Vl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function If(e,t){this._context=e,this._alpha=t}If.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:Fl(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 nS=function e(t){function n(r){return t?new If(r,t):new Hl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Nf(e){this._context=e}Nf.prototype={areaStart:An,areaEnd:An,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 Pf(e){return new Nf(e)}function Uf(e){return e<0?-1:1}function Bf(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(Uf(s)+Uf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Vf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gl(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 ya(e){this._context=e}ya.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:Gl(this,this._t0,Vf(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,Gl(this,Vf(this,n=Bf(this,e,t)),n);break;default:Gl(this,this._t0,n=Bf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Hf(e){this._context=new Ff(e)}(Hf.prototype=Object.create(ya.prototype)).point=function(e,t){ya.prototype.point.call(this,t,e)};function Ff(e){this._context=e}Ff.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 rS(e){return new ya(e)}function iS(e){return new Hf(e)}function Gf(e){this._context=e}Gf.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=zf(e),i=zf(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 zf(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 sS(e){return new Gf(e)}function ba(e,t){this._context=e,this._t=t}ba.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 aS(e){return new ba(e,.5)}function oS(e){return new ba(e,0)}function lS(e){return new ba(e,1)}function jf(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 Wf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function cS(e,t){return e[t]}function uS(e){const t=[];return t.key=e,t}function zl(){var e=ut([]),t=Wf,n=jf,r=cS;function i(s){var a=Array.from(e.apply(this,arguments),uS),o,l=a.length,c=-1,u;for(const h of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(h,a[o].key,c,s)]).data=h;for(o=0,u=fa(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:ut(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ut(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Wf:typeof s=="function"?s:ut(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??jf,i):n},i}function hS(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 Ni(e,t,n){this.k=e,this.x=t,this.y=n}Ni.prototype={constructor:Ni,scale:function(e){return e===1?this:new Ni(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ni(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+")"}},Ni.prototype;function jl(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}function Pi(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&e.formattingValues){var s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{var o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[o]}var c=e.argumentCallback?e.argumentCallback(t):t;return i[c]}}function Ui(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;var a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?fS(o,function(h){return h.test(a)}):dS(o,function(h){return h.test(a)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(a.length);return{value:c,rest:u}}}function dS(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function fS(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function pS(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],s=t.match(e.parsePattern);if(!s)return null;var a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;var o=t.slice(i.length);return{value:a,rest:o}}}function xa(e){"@babel/helpers - typeof";return xa=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},xa(e)}function Kt(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ot(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function yt(e){ot(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||xa(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wa(e,t){ot(2,arguments);var n=yt(e).getTime(),r=Kt(t);return new Date(n+r)}var gS={};function _a(){return gS}function Wl(e){var 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 mS(e){return ot(1,arguments),e instanceof Date||xa(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function vS(e){if(ot(1,arguments),!mS(e)&&typeof e!="number")return!1;var t=yt(e);return!isNaN(Number(t))}function yS(e,t){ot(2,arguments);var n=Kt(t);return wa(e,-n)}var bS=864e5;function xS(e){ot(1,arguments);var t=yt(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=n-r;return Math.floor(i/bS)+1}function Ea(e){ot(1,arguments);var t=1,n=yt(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function qf(e){ot(1,arguments);var t=yt(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=Ea(r),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=Ea(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function wS(e){ot(1,arguments);var t=qf(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Ea(n);return r}var _S=6048e5;function ES(e){ot(1,arguments);var t=yt(e),n=Ea(t).getTime()-wS(t).getTime();return Math.round(n/_S)+1}function Sa(e,t){var n,r,i,s,a,o,l,c;ot(1,arguments);var u=_a(),h=Kt((n=(r=(i=(s=t==null?void 0:t.weekStartsOn)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=yt(e),f=d.getUTCDay(),p=(f<h?7:0)+f-h;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}function Yf(e,t){var n,r,i,s,a,o,l,c;ot(1,arguments);var u=yt(e),h=u.getUTCFullYear(),d=_a(),f=Kt((n=(r=(i=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(h+1,0,f),p.setUTCHours(0,0,0,0);var m=Sa(p,t),g=new Date(0);g.setUTCFullYear(h,0,f),g.setUTCHours(0,0,0,0);var v=Sa(g,t);return u.getTime()>=m.getTime()?h+1:u.getTime()>=v.getTime()?h:h-1}function SS(e,t){var n,r,i,s,a,o,l,c;ot(1,arguments);var u=_a(),h=Kt((n=(r=(i=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=Yf(e,t),f=new Date(0);f.setUTCFullYear(d,0,h),f.setUTCHours(0,0,0,0);var p=Sa(f,t);return p}var OS=6048e5;function TS(e,t){ot(1,arguments);var n=yt(e),r=Sa(n,t).getTime()-SS(n,t).getTime();return Math.round(r/OS)+1}function St(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var MS={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return St(t==="yy"?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):St(n+1,2)},d:function(e,t){return St(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/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:function(e,t){return St(e.getUTCHours()%12||12,t.length)},H:function(e,t){return St(e.getUTCHours(),t.length)},m:function(e,t){return St(e.getUTCMinutes(),t.length)},s:function(e,t){return St(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,n-3));return St(i,t.length)}};const Ln=MS;var Rr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},CS={G:function(e,t,n){var r=e.getUTCFullYear()>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"){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Ln.y(e,t)},Y:function(e,t,n,r){var i=Yf(e,r),s=i>0?i:1-i;if(t==="YY"){var a=s%100;return St(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):St(s,t.length)},R:function(e,t){var n=qf(e);return St(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return St(n,t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return St(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){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return St(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){var r=e.getUTCMonth();switch(t){case"M":case"MM":return Ln.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){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return St(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){var i=TS(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):St(i,t.length)},I:function(e,t,n){var r=ES(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):St(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Ln.d(e,t)},D:function(e,t,n){var r=xS(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):St(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();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){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return St(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){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return St(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){var r=e.getUTCDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return St(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){var r=e.getUTCHours(),i=r/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r=e.getUTCHours(),i;switch(r===12?i=Rr.noon:r===0?i=Rr.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){var r=e.getUTCHours(),i;switch(r>=17?i=Rr.evening:r>=12?i=Rr.afternoon:r>=4?i=Rr.morning:i=Rr.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"){var r=e.getUTCHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ln.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Ln.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Ln.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Ln.s(e,t)},S:function(e,t){return Ln.S(e,t)},X:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Zf(s);case"XXXX":case"XX":return tr(s);case"XXXXX":case"XXX":default:return tr(s,":")}},x:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"x":return Zf(s);case"xxxx":case"xx":return tr(s);case"xxxxx":case"xxx":default:return tr(s,":")}},O:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xf(s,":");case"OOOO":default:return"GMT"+tr(s,":")}},z:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xf(s,":");case"zzzz":default:return"GMT"+tr(s,":")}},t:function(e,t,n,r){var i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return St(s,t.length)},T:function(e,t,n,r){var i=r._originalDate||e,s=i.getTime();return St(s,t.length)}};function Xf(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;if(s===0)return n+String(i);var a=t||"";return n+String(i)+a+St(s,2)}function Zf(e,t){if(e%60===0){var n=e>0?"-":"+";return n+St(Math.abs(e)/60,2)}return tr(e,t)}function tr(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e),s=St(Math.floor(i/60),2),a=St(i%60,2);return r+s+n+a}const $S=CS;var Kf=function(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"})}},Qf=function(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"})}},AS=function(e,t){var n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Kf(e,t);var 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}}",Kf(r,t)).replace("{{time}}",Qf(i,t))},LS={p:Qf,P:AS};const kS=LS;var DS=["D","DD"],RS=["YY","YYYY"];function IS(e){return DS.indexOf(e)!==-1}function NS(e){return RS.indexOf(e)!==-1}function Jf(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(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 `".concat(t,"`) for formatting years to the input `").concat(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 `".concat(t,"`) for formatting days of the month to the input `").concat(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 `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var PS={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"}},US=function(e,t,n){var r,i=PS[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};const BS=US;var VS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},HS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GS={date:jl({formats:VS,defaultWidth:"full"}),time:jl({formats:HS,defaultWidth:"full"}),dateTime:jl({formats:FS,defaultWidth:"full"})};const zS=GS;var jS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WS=function(e,t,n,r){return jS[e]};const qS=WS;var YS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},XS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ZS={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"]},KS={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"]},QS={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"}},JS={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"}},tO=function(e,t){var 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"},eO={ordinalNumber:tO,era:Pi({values:YS,defaultWidth:"wide"}),quarter:Pi({values:XS,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Pi({values:ZS,defaultWidth:"wide"}),day:Pi({values:KS,defaultWidth:"wide"}),dayPeriod:Pi({values:QS,defaultWidth:"wide",formattingValues:JS,defaultFormattingWidth:"wide"})};const nO=eO;var rO=/^(\d+)(th|st|nd|rd)?/i,iO=/\d+/i,sO={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},aO={any:[/^b/i,/^(a|c)/i]},oO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lO={any:[/1/i,/2/i,/3/i,/4/i]},cO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},uO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},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},dO={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},pO={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}},gO={ordinalNumber:pS({matchPattern:rO,parsePattern:iO,valueCallback:function(e){return parseInt(e,10)}}),era:Ui({matchPatterns:sO,defaultMatchWidth:"wide",parsePatterns:aO,defaultParseWidth:"any"}),quarter:Ui({matchPatterns:oO,defaultMatchWidth:"wide",parsePatterns:lO,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Ui({matchPatterns:cO,defaultMatchWidth:"wide",parsePatterns:uO,defaultParseWidth:"any"}),day:Ui({matchPatterns:hO,defaultMatchWidth:"wide",parsePatterns:dO,defaultParseWidth:"any"}),dayPeriod:Ui({matchPatterns:fO,defaultMatchWidth:"any",parsePatterns:pO,defaultParseWidth:"any"})},mO={code:"en-US",formatDistance:BS,formatLong:zS,formatRelative:qS,localize:nO,match:gO,options:{weekStartsOn:0,firstWeekContainsDate:1}};const tp=mO;var vO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bO=/^'([^]*?)'?$/,xO=/''/g,wO=/[a-zA-Z]/;function Ir(e,t,n){var r,i,s,a,o,l,c,u,h,d,f,p,m,g,v,y,b,S;ot(2,arguments);var _=String(t),E=_a(),T=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:E.locale)!==null&&r!==void 0?r:tp,D=Kt((s=(a=(o=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:E.firstWeekContainsDate)!==null&&a!==void 0?a:(h=E.locale)===null||h===void 0||(d=h.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(D>=1&&D<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=Kt((f=(p=(m=(g=n==null?void 0:n.weekStartsOn)!==null&&g!==void 0?g:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&m!==void 0?m:E.weekStartsOn)!==null&&p!==void 0?p:(b=E.locale)===null||b===void 0||(S=b.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&f!==void 0?f:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var A=yt(e);if(!vS(A))throw new RangeError("Invalid time value");var C=Wl(A),V=yS(A,C),M={firstWeekContainsDate:D,weekStartsOn:N,locale:T,_originalDate:A},L=_.match(yO).map(function(w){var P=w[0];if(P==="p"||P==="P"){var U=kS[P];return U(w,T.formatLong)}return w}).join("").match(vO).map(function(w){if(w==="''")return"'";var P=w[0];if(P==="'")return _O(w);var U=$S[P];if(U)return!(n!=null&&n.useAdditionalWeekYearTokens)&&NS(w)&&Jf(w,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&IS(w)&&Jf(w,t,String(e)),U(V,w,T.localize,M);if(P.match(wO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+P+"`");return w}).join("");return L}function _O(e){var t=e.match(bO);return t?t[1].replace(xO,"'"):e}var EO=typeof global=="object"&&global&&global.Object===Object&&global;const ep=EO;var SO=typeof self=="object"&&self&&self.Object===Object&&self,OO=ep||SO||Function("return this")();const Ve=OO;var TO=Ve.Symbol;const $e=TO;var np=Object.prototype,MO=np.hasOwnProperty,CO=np.toString,Bi=$e?$e.toStringTag:void 0;function $O(e){var t=MO.call(e,Bi),n=e[Bi];try{e[Bi]=void 0;var r=!0}catch{}var i=CO.call(e);return r&&(t?e[Bi]=n:delete e[Bi]),i}var AO=Object.prototype,LO=AO.toString;function kO(e){return LO.call(e)}var DO="[object Null]",RO="[object Undefined]",rp=$e?$e.toStringTag:void 0;function er(e){return e==null?e===void 0?RO:DO:rp&&rp in Object(e)?$O(e):kO(e)}function Ke(e){return e!=null&&typeof e=="object"}var IO="[object Symbol]";function Oa(e){return typeof e=="symbol"||Ke(e)&&er(e)==IO}function ip(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 NO=Array.isArray;const te=NO;var PO=1/0,sp=$e?$e.prototype:void 0,ap=sp?sp.toString:void 0;function op(e){if(typeof e=="string")return e;if(te(e))return ip(e,op)+"";if(Oa(e))return ap?ap.call(e):"";var t=e+"";return t=="0"&&1/e==-PO?"-0":t}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function ql(e){return e}var UO="[object AsyncFunction]",BO="[object Function]",VO="[object GeneratorFunction]",HO="[object Proxy]";function Yl(e){if(!Ae(e))return!1;var t=er(e);return t==BO||t==VO||t==UO||t==HO}var FO=Ve["__core-js_shared__"];const Xl=FO;var lp=function(){var e=/[^.]+$/.exec(Xl&&Xl.keys&&Xl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function GO(e){return!!lp&&lp in e}var zO=Function.prototype,jO=zO.toString;function nr(e){if(e!=null){try{return jO.call(e)}catch{}try{return e+""}catch{}}return""}var WO=/[\\^$.*+?()[\]{}|]/g,qO=/^\[object .+?Constructor\]$/,YO=Function.prototype,XO=Object.prototype,ZO=YO.toString,KO=XO.hasOwnProperty,QO=RegExp("^"+ZO.call(KO).replace(WO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function JO(e){if(!Ae(e)||GO(e))return!1;var t=Yl(e)?QO:qO;return t.test(nr(e))}function tT(e,t){return e==null?void 0:e[t]}function rr(e,t){var n=tT(e,t);return JO(n)?n:void 0}var eT=rr(Ve,"WeakMap");const Zl=eT;var cp=Object.create,nT=function(){function e(){}return function(t){if(!Ae(t))return{};if(cp)return cp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const rT=nT;function iT(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 sT(){}function up(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var aT=800,oT=16,lT=Date.now;function cT(e){var t=0,n=0;return function(){var r=lT(),i=oT-(r-n);if(n=r,i>0){if(++t>=aT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function uT(e){return function(){return e}}var hT=function(){try{var e=rr(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Ta=hT;var dT=Ta?function(e,t){return Ta(e,"toString",{configurable:!0,enumerable:!1,value:uT(t),writable:!0})}:ql,fT=cT(dT);const pT=fT;function gT(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function mT(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 vT(e){return e!==e}function yT(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function bT(e,t,n){return t===t?yT(e,t,n):mT(e,vT,n)}function xT(e,t){var n=e==null?0:e.length;return!!n&&bT(e,t,0)>-1}var wT=9007199254740991,_T=/^(?:0|[1-9]\d*)$/;function Kl(e,t){var n=typeof e;return t=t??wT,!!t&&(n=="number"||n!="symbol"&&_T.test(e))&&e>-1&&e%1==0&&e<t}function Ma(e,t,n){t=="__proto__"&&Ta?Ta(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Vi(e,t){return e===t||e!==e&&t!==t}var ET=Object.prototype,ST=ET.hasOwnProperty;function hp(e,t,n){var r=e[t];(!(ST.call(e,t)&&Vi(r,n))||n===void 0&&!(t in e))&&Ma(e,t,n)}function Hi(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?Ma(n,o,l):hp(n,o,l)}return n}var dp=Math.max;function OT(e,t,n){return t=dp(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=dp(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),iT(e,this,o)}}function fp(e,t){return pT(OT(e,t,ql),e+"")}var TT=9007199254740991;function Ql(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=TT}function ir(e){return e!=null&&Ql(e.length)&&!Yl(e)}function pp(e,t,n){if(!Ae(n))return!1;var r=typeof t;return(r=="number"?ir(n)&&Kl(t,n.length):r=="string"&&t in n)?Vi(n[t],e):!1}function MT(e){return fp(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&&pp(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 CT=Object.prototype;function Ca(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||CT;return e===n}function $T(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var AT="[object Arguments]";function gp(e){return Ke(e)&&er(e)==AT}var mp=Object.prototype,LT=mp.hasOwnProperty,kT=mp.propertyIsEnumerable,DT=gp(function(){return arguments}())?gp:function(e){return Ke(e)&<.call(e,"callee")&&!kT.call(e,"callee")};const Nr=DT;function RT(){return!1}var vp=typeof X=="object"&&X&&!X.nodeType&&X,yp=vp&&typeof module=="object"&&module&&!module.nodeType&&module,IT=yp&&yp.exports===vp,bp=IT?Ve.Buffer:void 0,NT=bp?bp.isBuffer:void 0,PT=NT||RT;const Pr=PT;var UT="[object Arguments]",BT="[object Array]",VT="[object Boolean]",HT="[object Date]",FT="[object Error]",GT="[object Function]",zT="[object Map]",jT="[object Number]",WT="[object Object]",qT="[object RegExp]",YT="[object Set]",XT="[object String]",ZT="[object WeakMap]",KT="[object ArrayBuffer]",QT="[object DataView]",JT="[object Float32Array]",tM="[object Float64Array]",eM="[object Int8Array]",nM="[object Int16Array]",rM="[object Int32Array]",iM="[object Uint8Array]",sM="[object Uint8ClampedArray]",aM="[object Uint16Array]",oM="[object Uint32Array]",Dt={};Dt[JT]=Dt[tM]=Dt[eM]=Dt[nM]=Dt[rM]=Dt[iM]=Dt[sM]=Dt[aM]=Dt[oM]=!0,Dt[UT]=Dt[BT]=Dt[KT]=Dt[VT]=Dt[QT]=Dt[HT]=Dt[FT]=Dt[GT]=Dt[zT]=Dt[jT]=Dt[WT]=Dt[qT]=Dt[YT]=Dt[XT]=Dt[ZT]=!1;function lM(e){return Ke(e)&&Ql(e.length)&&!!Dt[er(e)]}function Jl(e){return function(t){return e(t)}}var xp=typeof X=="object"&&X&&!X.nodeType&&X,Fi=xp&&typeof module=="object"&&module&&!module.nodeType&&module,cM=Fi&&Fi.exports===xp,tc=cM&&ep.process,uM=function(){try{var e=Fi&&Fi.require&&Fi.require("util").types;return e||tc&&tc.binding&&tc.binding("util")}catch{}}();const Ur=uM;var wp=Ur&&Ur.isTypedArray,hM=wp?Jl(wp):lM;const $a=hM;var dM=Object.prototype,fM=dM.hasOwnProperty;function _p(e,t){var n=te(e),r=!n&&Nr(e),i=!n&&!r&&Pr(e),s=!n&&!r&&!i&&$a(e),a=n||r||i||s,o=a?$T(e.length,String):[],l=o.length;for(var c in e)(t||fM.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Kl(c,l)))&&o.push(c);return o}function Ep(e,t){return function(n){return e(t(n))}}var pM=Ep(Object.keys,Object);const gM=pM;var mM=Object.prototype,vM=mM.hasOwnProperty;function Sp(e){if(!Ca(e))return gM(e);var t=[];for(var n in Object(e))vM.call(e,n)&&n!="constructor"&&t.push(n);return t}function Gi(e){return ir(e)?_p(e):Sp(e)}function yM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var bM=Object.prototype,xM=bM.hasOwnProperty;function wM(e){if(!Ae(e))return yM(e);var t=Ca(e),n=[];for(var r in e)r=="constructor"&&(t||!xM.call(e,r))||n.push(r);return n}function zi(e){return ir(e)?_p(e,!0):wM(e)}var _M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,EM=/^\w*$/;function ec(e,t){if(te(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Oa(e)?!0:EM.test(e)||!_M.test(e)||t!=null&&e in Object(t)}var SM=rr(Object,"create");const ji=SM;function OM(){this.__data__=ji?ji(null):{},this.size=0}function TM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var MM="__lodash_hash_undefined__",CM=Object.prototype,$M=CM.hasOwnProperty;function AM(e){var t=this.__data__;if(ji){var n=t[e];return n===MM?void 0:n}return $M.call(t,e)?t[e]:void 0}var LM=Object.prototype,kM=LM.hasOwnProperty;function DM(e){var t=this.__data__;return ji?t[e]!==void 0:kM.call(t,e)}var RM="__lodash_hash_undefined__";function IM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ji&&t===void 0?RM:t,this}function sr(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])}}sr.prototype.clear=OM,sr.prototype.delete=TM,sr.prototype.get=AM,sr.prototype.has=DM,sr.prototype.set=IM;function NM(){this.__data__=[],this.size=0}function Aa(e,t){for(var n=e.length;n--;)if(Vi(e[n][0],t))return n;return-1}var PM=Array.prototype,UM=PM.splice;function BM(e){var t=this.__data__,n=Aa(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():UM.call(t,n,1),--this.size,!0}function VM(e){var t=this.__data__,n=Aa(t,e);return n<0?void 0:t[n][1]}function HM(e){return Aa(this.__data__,e)>-1}function FM(e,t){var n=this.__data__,r=Aa(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function gn(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])}}gn.prototype.clear=NM,gn.prototype.delete=BM,gn.prototype.get=VM,gn.prototype.has=HM,gn.prototype.set=FM;var GM=rr(Ve,"Map");const Wi=GM;function zM(){this.size=0,this.__data__={hash:new sr,map:new(Wi||gn),string:new sr}}function jM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function La(e,t){var n=e.__data__;return jM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function WM(e){var t=La(this,e).delete(e);return this.size-=t?1:0,t}function qM(e){return La(this,e).get(e)}function YM(e){return La(this,e).has(e)}function XM(e,t){var n=La(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,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=zM,mn.prototype.delete=WM,mn.prototype.get=qM,mn.prototype.has=YM,mn.prototype.set=XM;var ZM="Expected a function";function nc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ZM);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(nc.Cache||mn),n}nc.Cache=mn;var KM=500;function QM(e){var t=nc(e,function(r){return n.size===KM&&n.clear(),r}),n=t.cache;return t}var JM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tC=/\\(\\)?/g,eC=QM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(JM,function(n,r,i,s){t.push(i?s.replace(tC,"$1"):r||n)}),t});const nC=eC;function qi(e){return e==null?"":op(e)}function Op(e,t){return te(e)?e:ec(e,t)?[e]:nC(qi(e))}var rC=1/0;function ka(e){if(typeof e=="string"||Oa(e))return e;var t=e+"";return t=="0"&&1/e==-rC?"-0":t}function Tp(e,t){t=Op(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ka(t[n++])];return n&&n==r?e:void 0}function At(e,t,n){var r=e==null?void 0:Tp(e,t);return r===void 0?n:r}function rc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Mp=$e?$e.isConcatSpreadable:void 0;function iC(e){return te(e)||Nr(e)||!!(Mp&&e&&e[Mp])}function Da(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=iC),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Da(o,t-1,n,r,i):rc(i,o):r||(i[i.length]=o)}return i}var sC=Ep(Object.getPrototypeOf,Object);const ic=sC;var aC="[object Object]",oC=Function.prototype,lC=Object.prototype,Cp=oC.toString,cC=lC.hasOwnProperty,uC=Cp.call(Object);function hC(e){if(!Ke(e)||er(e)!=aC)return!1;var t=ic(e);if(t===null)return!0;var n=cC.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Cp.call(n)==uC}function dC(){this.__data__=new gn,this.size=0}function fC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function pC(e){return this.__data__.get(e)}function gC(e){return this.__data__.has(e)}var mC=200;function vC(e,t){var n=this.__data__;if(n instanceof gn){var r=n.__data__;if(!Wi||r.length<mC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mn(r)}return n.set(e,t),this.size=n.size,this}function He(e){var t=this.__data__=new gn(e);this.size=t.size}He.prototype.clear=dC,He.prototype.delete=fC,He.prototype.get=pC,He.prototype.has=gC,He.prototype.set=vC;function yC(e,t){return e&&Hi(t,Gi(t),e)}function bC(e,t){return e&&Hi(t,zi(t),e)}var $p=typeof X=="object"&&X&&!X.nodeType&&X,Ap=$p&&typeof module=="object"&&module&&!module.nodeType&&module,xC=Ap&&Ap.exports===$p,Lp=xC?Ve.Buffer:void 0,kp=Lp?Lp.allocUnsafe:void 0;function Dp(e,t){if(t)return e.slice();var n=e.length,r=kp?kp(n):new e.constructor(n);return e.copy(r),r}function wC(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 Rp(){return[]}var _C=Object.prototype,EC=_C.propertyIsEnumerable,Ip=Object.getOwnPropertySymbols,SC=Ip?function(e){return e==null?[]:(e=Object(e),wC(Ip(e),function(t){return EC.call(e,t)}))}:Rp;const sc=SC;function OC(e,t){return Hi(e,sc(e),t)}var TC=Object.getOwnPropertySymbols,MC=TC?function(e){for(var t=[];e;)rc(t,sc(e)),e=ic(e);return t}:Rp;const Np=MC;function CC(e,t){return Hi(e,Np(e),t)}function Pp(e,t,n){var r=t(e);return te(e)?r:rc(r,n(e))}function ac(e){return Pp(e,Gi,sc)}function $C(e){return Pp(e,zi,Np)}var AC=rr(Ve,"DataView");const oc=AC;var LC=rr(Ve,"Promise");const lc=LC;var kC=rr(Ve,"Set");const Br=kC;var Up="[object Map]",DC="[object Object]",Bp="[object Promise]",Vp="[object Set]",Hp="[object WeakMap]",Fp="[object DataView]",RC=nr(oc),IC=nr(Wi),NC=nr(lc),PC=nr(Br),UC=nr(Zl),ar=er;(oc&&ar(new oc(new ArrayBuffer(1)))!=Fp||Wi&&ar(new Wi)!=Up||lc&&ar(lc.resolve())!=Bp||Br&&ar(new Br)!=Vp||Zl&&ar(new Zl)!=Hp)&&(ar=function(e){var t=er(e),n=t==DC?e.constructor:void 0,r=n?nr(n):"";if(r)switch(r){case RC:return Fp;case IC:return Up;case NC:return Bp;case PC:return Vp;case UC:return Hp}return t});const Vr=ar;var BC=Object.prototype,VC=BC.hasOwnProperty;function HC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&VC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var FC=Ve.Uint8Array;const Ra=FC;function cc(e){var t=new e.constructor(e.byteLength);return new Ra(t).set(new Ra(e)),t}function GC(e,t){var n=t?cc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var zC=/\w*$/;function jC(e){var t=new e.constructor(e.source,zC.exec(e));return t.lastIndex=e.lastIndex,t}var Gp=$e?$e.prototype:void 0,zp=Gp?Gp.valueOf:void 0;function WC(e){return zp?Object(zp.call(e)):{}}function jp(e,t){var n=t?cc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var qC="[object Boolean]",YC="[object Date]",XC="[object Map]",ZC="[object Number]",KC="[object RegExp]",QC="[object Set]",JC="[object String]",t$="[object Symbol]",e$="[object ArrayBuffer]",n$="[object DataView]",r$="[object Float32Array]",i$="[object Float64Array]",s$="[object Int8Array]",a$="[object Int16Array]",o$="[object Int32Array]",l$="[object Uint8Array]",c$="[object Uint8ClampedArray]",u$="[object Uint16Array]",h$="[object Uint32Array]";function d$(e,t,n){var r=e.constructor;switch(t){case e$:return cc(e);case qC:case YC:return new r(+e);case n$:return GC(e,n);case r$:case i$:case s$:case a$:case o$:case l$:case c$:case u$:case h$:return jp(e,n);case XC:return new r;case ZC:case JC:return new r(e);case KC:return jC(e);case QC:return new r;case t$:return WC(e)}}function Wp(e){return typeof e.constructor=="function"&&!Ca(e)?rT(ic(e)):{}}var f$="[object Map]";function p$(e){return Ke(e)&&Vr(e)==f$}var qp=Ur&&Ur.isMap,g$=qp?Jl(qp):p$;const m$=g$;var v$="[object Set]";function y$(e){return Ke(e)&&Vr(e)==v$}var Yp=Ur&&Ur.isSet,b$=Yp?Jl(Yp):y$;const x$=b$;var w$=1,_$=2,E$=4,Xp="[object Arguments]",S$="[object Array]",O$="[object Boolean]",T$="[object Date]",M$="[object Error]",Zp="[object Function]",C$="[object GeneratorFunction]",$$="[object Map]",A$="[object Number]",Kp="[object Object]",L$="[object RegExp]",k$="[object Set]",D$="[object String]",R$="[object Symbol]",I$="[object WeakMap]",N$="[object ArrayBuffer]",P$="[object DataView]",U$="[object Float32Array]",B$="[object Float64Array]",V$="[object Int8Array]",H$="[object Int16Array]",F$="[object Int32Array]",G$="[object Uint8Array]",z$="[object Uint8ClampedArray]",j$="[object Uint16Array]",W$="[object Uint32Array]",Lt={};Lt[Xp]=Lt[S$]=Lt[N$]=Lt[P$]=Lt[O$]=Lt[T$]=Lt[U$]=Lt[B$]=Lt[V$]=Lt[H$]=Lt[F$]=Lt[$$]=Lt[A$]=Lt[Kp]=Lt[L$]=Lt[k$]=Lt[D$]=Lt[R$]=Lt[G$]=Lt[z$]=Lt[j$]=Lt[W$]=!0,Lt[M$]=Lt[Zp]=Lt[I$]=!1;function Ia(e,t,n,r,i,s){var a,o=t&w$,l=t&_$,c=t&E$;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ae(e))return e;var u=te(e);if(u){if(a=HC(e),!o)return up(e,a)}else{var h=Vr(e),d=h==Zp||h==C$;if(Pr(e))return Dp(e,o);if(h==Kp||h==Xp||d&&!i){if(a=l||d?{}:Wp(e),!o)return l?CC(e,bC(a,e)):OC(e,yC(a,e))}else{if(!Lt[h])return i?e:{};a=d$(e,h,o)}}s||(s=new He);var f=s.get(e);if(f)return f;s.set(e,a),x$(e)?e.forEach(function(g){a.add(Ia(g,t,n,g,e,s))}):m$(e)&&e.forEach(function(g,v){a.set(v,Ia(g,t,n,v,e,s))});var p=c?l?$C:ac:l?zi:Gi,m=u?void 0:p(e);return gT(m||e,function(g,v){m&&(v=g,g=e[v]),hp(a,v,Ia(g,t,n,v,e,s))}),a}var q$=1,Y$=4;function vn(e){return Ia(e,q$|Y$)}var X$="__lodash_hash_undefined__";function Z$(e){return this.__data__.set(e,X$),this}function K$(e){return this.__data__.has(e)}function Yi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new mn;++t<n;)this.add(e[t])}Yi.prototype.add=Yi.prototype.push=Z$,Yi.prototype.has=K$;function Qp(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 Jp(e,t){return e.has(t)}var Q$=1,J$=2;function tg(e,t,n,r,i,s){var a=n&Q$,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 h=-1,d=!0,f=n&J$?new Yi:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(r)var g=a?r(m,p,h,t,e,s):r(p,m,h,e,t,s);if(g!==void 0){if(g)continue;d=!1;break}if(f){if(!Qp(t,function(v,y){if(!Jp(f,y)&&(p===v||i(p,v,n,r,s)))return f.push(y)})){d=!1;break}}else if(!(p===m||i(p,m,n,r,s))){d=!1;break}}return s.delete(e),s.delete(t),d}function t2(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function uc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var e2=1,n2=2,r2="[object Boolean]",i2="[object Date]",s2="[object Error]",a2="[object Map]",o2="[object Number]",l2="[object RegExp]",c2="[object Set]",u2="[object String]",h2="[object Symbol]",d2="[object ArrayBuffer]",f2="[object DataView]",eg=$e?$e.prototype:void 0,hc=eg?eg.valueOf:void 0;function p2(e,t,n,r,i,s,a){switch(n){case f2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case d2:return!(e.byteLength!=t.byteLength||!s(new Ra(e),new Ra(t)));case r2:case i2:case o2:return Vi(+e,+t);case s2:return e.name==t.name&&e.message==t.message;case l2:case u2:return e==t+"";case a2:var o=t2;case c2:var l=r&e2;if(o||(o=uc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=n2,a.set(e,t);var u=tg(o(e),o(t),r,i,s,a);return a.delete(e),u;case h2:if(hc)return hc.call(e)==hc.call(t)}return!1}var g2=1,m2=Object.prototype,v2=m2.hasOwnProperty;function y2(e,t,n,r,i,s){var a=n&g2,o=ac(e),l=o.length,c=ac(t),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var d=o[h];if(!(a?d in t:v2.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<l;){d=o[h];var v=e[d],y=t[d];if(r)var b=a?r(y,v,d,t,e,s):r(v,y,d,e,t,s);if(!(b===void 0?v===y||i(v,y,n,r,s):b)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var S=e.constructor,_=t.constructor;S!=_&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return s.delete(e),s.delete(t),m}var b2=1,ng="[object Arguments]",rg="[object Array]",Na="[object Object]",x2=Object.prototype,ig=x2.hasOwnProperty;function w2(e,t,n,r,i,s){var a=te(e),o=te(t),l=a?rg:Vr(e),c=o?rg:Vr(t);l=l==ng?Na:l,c=c==ng?Na:c;var u=l==Na,h=c==Na,d=l==c;if(d&&Pr(e)){if(!Pr(t))return!1;a=!0,u=!1}if(d&&!u)return s||(s=new He),a||$a(e)?tg(e,t,n,r,i,s):p2(e,t,l,n,r,i,s);if(!(n&b2)){var f=u&&ig.call(e,"__wrapped__"),p=h&&ig.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new He),i(m,g,n,r,s)}}return d?(s||(s=new He),y2(e,t,n,r,i,s)):!1}function Pa(e,t,n,r,i){return e===t?!0:e==null||t==null||!Ke(e)&&!Ke(t)?e!==e&&t!==t:w2(e,t,n,r,Pa,i)}var _2=1,E2=2;function S2(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 h=new He;if(r)var d=r(c,u,l,e,t,h);if(!(d===void 0?Pa(u,c,_2|E2,r,h):d))return!1}}return!0}function sg(e){return e===e&&!Ae(e)}function O2(e){for(var t=Gi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,sg(i)]}return t}function ag(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function T2(e){var t=O2(e);return t.length==1&&t[0][2]?ag(t[0][0],t[0][1]):function(n){return n===e||S2(n,e,t)}}function M2(e,t){return e!=null&&t in Object(e)}function C2(e,t,n){t=Op(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=ka(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&&Ql(i)&&Kl(a,i)&&(te(e)||Nr(e)))}function $2(e,t){return e!=null&&C2(e,t,M2)}var A2=1,L2=2;function k2(e,t){return ec(e)&&sg(t)?ag(ka(e),t):function(n){var r=At(n,e);return r===void 0&&r===t?$2(n,e):Pa(t,r,A2|L2)}}function D2(e){return function(t){return t==null?void 0:t[e]}}function R2(e){return function(t){return Tp(t,e)}}function I2(e){return ec(e)?D2(ka(e)):R2(e)}function Ua(e){return typeof e=="function"?e:e==null?ql:typeof e=="object"?te(e)?k2(e[0],e[1]):T2(e):I2(e)}function N2(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 P2=N2();const og=P2;function dc(e,t,n){(n!==void 0&&!Vi(e[t],n)||n===void 0&&!(t in e))&&Ma(e,t,n)}function fc(e){return Ke(e)&&ir(e)}function pc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function U2(e){return Hi(e,zi(e))}function B2(e,t,n,r,i,s,a){var o=pc(e,n),l=pc(t,n),c=a.get(l);if(c){dc(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,h=u===void 0;if(h){var d=te(l),f=!d&&Pr(l),p=!d&&!f&&$a(l);u=l,d||f||p?te(o)?u=o:fc(o)?u=up(o):f?(h=!1,u=Dp(l,!0)):p?(h=!1,u=jp(l,!0)):u=[]:hC(l)||Nr(l)?(u=o,Nr(o)?u=U2(o):(!Ae(o)||Yl(o))&&(u=Wp(l))):h=!1}h&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),dc(e,n,u)}function lg(e,t,n,r,i){e!==t&&og(t,function(s,a){if(i||(i=new He),Ae(s))B2(e,t,a,n,lg,r,i);else{var o=r?r(pc(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),dc(e,a,o)}},zi)}function V2(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 H2(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var F2="[object Map]",G2="[object Set]",z2=Object.prototype,j2=z2.hasOwnProperty;function Fe(e){if(e==null)return!0;if(ir(e)&&(te(e)||typeof e=="string"||typeof e.splice=="function"||Pr(e)||$a(e)||Nr(e)))return!e.length;var t=Vr(e);if(t==F2||t==G2)return!e.size;if(Ca(e))return!Sp(e).length;for(var n in e)if(j2.call(e,n))return!1;return!0}var W2=MT(function(e,t,n){lg(e,t,n)});const rt=W2;var q2=1/0,Y2=Br&&1/uc(new Br([,-0]))[1]==q2?function(e){return new Br(e)}:sT;const X2=Y2;var Z2=200;function cg(e,t,n){var r=-1,i=xT,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=V2;else if(s>=Z2){var c=t?null:X2(e);if(c)return uc(c);a=!1,i=Jp,l=new Yi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],h=t?t(u):u;if(u=n||u!==0?u:0,a&&h===h){for(var d=l.length;d--;)if(l[d]===h)continue t;t&&l.push(h),o.push(u)}else i(l,h,n)||(l!==o&&l.push(h),o.push(u))}return o}var K2=fp(function(e){var t=H2(e);return fc(t)&&(t=void 0),cg(Da(e,1,fc,!0),Ua(t))});const Q2=K2;function Xi(e){return e&&e.length?cg(e):[]}const ge="cds",yn={opacity:{unselected:.05,selected:.4}},kn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Hr={duration:1e3,ease:kh,zoomLevel:3},Fr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},ug={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Le={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},J2={defaultBins:10},Vt={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}},bn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},ee={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},kt={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},or={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Ge={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},hg={minCellDividerDimension:16,chartPadding:.5},dg={default:{size:24}},tA={horizontalOffset:10},fg={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}},_e={height:{[je.GRAPH_VIEW]:32,[je.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},eA=[{type:Xt.RADIUS,name:"Radius"},{type:Xt.AREA,name:"Poor area"},{type:Xt.AREA,name:"Satisfactory area"},{type:Xt.AREA,name:"Great area"},{type:Xt.QUARTILE,name:"Quartiles"}],Gr={type:De.END_LINE,threshold:16,numCharacter:14},nA={enabled:!0,position:ti.BOTTOM,clickable:!0,truncation:Gr,alignment:qt.LEFT,order:null,additionalItems:[]},rA={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},iA={enabled:!0},pg={enabled:!0,showTotal:!0,truncation:Gr,groupLabel:"Group"},gg={top:{visible:!0,includeZero:!0,truncation:Gr},bottom:{visible:!0,includeZero:!0,truncation:Gr},left:{visible:!0,includeZero:!0,truncation:Gr},right:{visible:!0,includeZero:!0,truncation:Gr}},Ba={addSpaceOnEdges:1,showDayName:!1,localeObject:tp,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"}}},sA=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),le={width:null,height:null,resizable:!0,theme:Pu.WHITE,tooltip:pg,legend:nA,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:Bt.SHOW_AS_DATATABLE},...sA?[{type:Bt.MAKE_FULLSCREEN}]:[],{type:Bt.EXPORT_CSV},{type:Bt.EXPORT_PNG},{type:Bt.EXPORT_JPG}]}},mg=rt({},le,{thematic:{projection:sn.geoNaturalEarth1}}),Zi=rt({},le,{axes:gg,timeScale:Ba,grid:rA,ruler:iA,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:je.GRAPH_VIEW}}}),lr=rt({},Zi,{bars:{maxWidth:16,spacingFactor:.25},timeScale:rt(Ba,{addSpaceOnEdges:1})}),aA=rt({},lr,{}),oA=rt({},lr,{}),lA=rt({},lr,{bars:rt({},lr.bars,{dividerSize:1.5})}),cA=rt({},lr,{}),gc=rt({},Zi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),uA=gc,vg=rt({},gc,{points:{radius:3,filled:!1,enabled:!0}}),yg=rt({},vg,{timeScale:rt(Ba,{addSpaceOnEdges:0})}),hA=yg,dA=rt({},Zi,{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:Xt.RADIUS,name:"Radius"}]}}),fA=rt({},Zi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Xt.AREA,name:"Poor area"},{type:Xt.AREA,name:"Satisfactory area"},{type:Xt.AREA,name:"Great area"},{type:Xt.QUARTILE,name:"Quartiles"}]}}),pA=rt({},lr,{bars:{dividerSize:1.5},timeScale:rt(Ba,{addSpaceOnEdges:0})}),gA=rt({},le,{tooltip:rt({},pg,{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"}}),bg=rt({},le,{pie:{labels:{formatter:null,enabled:!0},alignment:qt.LEFT,sortFunction:null,valueMapsTo:"value"}}),mA=rt({},le,{legend:{enabled:!1},gauge:{type:pr.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,numberFormatter:e=>Number(e.toFixed(2))%1!==0?e.toFixed(2).toLocaleString():e.toFixed().toLocaleString(),alignment:qt.LEFT}}),vA=rt({},bg,{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:qt.LEFT}}),xg=rt({},le,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),yA=rt({},xg,{legend:{enabled:!0}}),bA=rt({},le,{radar:{axes:{angle:"key",value:"value"},alignment:qt.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),xA=rt({},lr,{comboChartTypes:[]}),wA=rt({tree:{type:lo.TREE}},le,{}),_A=rt({},le,{data:rt(le.data,{groupMapsTo:"name"})}),EA=rt({},le,Fr,{data:rt(le.data,{groupMapsTo:"name"})}),SA=rt({},le,{alluvial:{data:rt(le.data,{groupMapsTo:"source"}),nodeAlignment:qt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),OA=rt({},le,{axes:gg,heatmap:{divider:{state:ni.AUTO},colorLegend:{type:"linear"}}}),TA=rt({},mg,{choropleth:{colorLegend:{type:"linear"}}}),Tt={alluvialChart:SA,areaChart:yg,axisChart:Zi,boxplotChart:cA,bubbleChart:dA,bulletChart:fA,chart:le,circlePackChart:EA,choroplethChart:TA,comboChart:xA,donutChart:vA,gaugeChart:mA,groupedBarChart:oA,heatmapChart:OA,histogramChart:pA,lineChart:vg,lollipopChart:uA,meterChart:xg,pieChart:bg,proportionalMeterChart:yA,radarChart:bA,scatterChart:gc,simpleBarChart:aA,stackedAreaChart:hA,stackedBarChart:lA,thematicChart:mg,treeChart:wA,treemapChart:_A,wordCloudChart:gA};function MA(e,t,n){let r=null;return(...i)=>{const s=this;s.mousePosition=Fn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Nt(e,t){var n;const r=vn(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://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===Z.TIME?a.mapsTo="date":l===Z.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return mc(r,t),rt(r,t)}function xn(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 Ki(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 wg(e,t,n="value"){const r=e/t.reduce((i,s)=>i+s[n],0)*100;return r%1!==0?parseFloat(r.toFixed(1)):r}function Qi(e,t,n){if(n>e.length)return e;if(t===De.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===De.FRONT_LINE)return"..."+e.substr(-n);if(t===De.END_LINE)return e.substr(0,n)+"..."}function mc(e,t){const n=x(e,"legend","additionalItems"),r=x(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=eA.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=Q2(a,r,"name")}}const x=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},_g=(e,t)=>t===Qt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ue=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=_g(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function wn(e,t,n){return n===Qt.VERTICAL?[e,t]:[t,e]}var Eg=(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))(Eg||{});const vc=[["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 Sg(e,t,n,r,i){const s=t===0,a=Number(Ir(new Date(e),"c"))===2,o=Number(Ir(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ha(e)||Ji(e,l)||Dn(e);case"minute":return s||Ha(e)||Ji(e,l)||Dn(e);case"30minutes":return s||Ha(e)||Ji(e,l)||Dn(e);case"hourly":return s||Ha(e)||Ji(e,l)||Dn(e);case"daily":return i?s||a||Dn(e):s||Ji(e,l)||Dn(e);case"weekly":return s||a||Dn(e);case"monthly":return s||Dn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function yc(e,t,n,r,i){const s=i.showDayName,a=r==="daily"&&s?"weekly":r,o=new Date(e),l=x(i,"timeIntervalFormats")[a],c=x(l,"primary"),u=x(l,"secondary");let h=Sg(e,t,n,r,s)?c:u;r==="15seconds"&&o.getMilliseconds()!==0&&(h=h.replace("pp","h:mm:ss.SSS a"));const d=i.localeObject;return Ir(o,h,{locale:d})}function Va(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function CA(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function $A(e){const t=vc.reduce((n,[,r],i)=>{const s=vc[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return vc[t][0]}function bc(e,t){if(Eg[t])return t;if(e.length===1)return"15seconds";const n=CA(e),r=Mn(n);return $A(r)}function Ha(e){const{s:t,m:n,H:r}=Va(e);return r===0&&n===0&&t===0}function Ji(e,t){const n=Va(e).M,r=Va(t).M;return n!==r}function Dn(e){const{M:t,d:n,s:r,m:i,H:s}=Va(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Og(e){return e===void 0?"":e.toISOString()}function Tg(e){const t=Re(e,r=>r.value),n=Be().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 Mg(e,t){const n=x(t,"gradient","colors"),r=!Fe(n);let i=x(t,"pairing","option");const s=Tg(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 Sl().domain(s).range(o)}var lt=(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))(lt||{});function AA(e,t){return e&&og(e,t,Gi)}function LA(e,t){return function(n,r){if(n==null)return n;if(!ir(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 kA=LA(AA);const xc=kA;function DA(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 RA(e,t,n,r){return xc(e,function(i,s,a){t(r,i,n(i),a)}),r}function IA(e,t){return function(n,r){var i=te(n)?DA:RA,s=t?t():{};return i(n,e,Ua(r),s)}}function NA(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 PA=Object.prototype,UA=PA.hasOwnProperty,BA=IA(function(e,t,n){UA.call(e,n)?e[n].push(t):Ma(e,n,[t])});const VA=BA;class Qe{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}=x(n,"data"),a=x(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===Z.LINEAR||c===Z.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===Z.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,h]=a[o].domain;r=r.filter(d=>!(l in d)||d[l]>=u&&d[l]<=h)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Vt.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(vn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return x(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Vt.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 VA(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=J2.defaultBins}=s,l=Array.isArray(o),c=a0().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],h=Array.from(new Set(t.map(f=>f[a]))),d=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,m=this.aggregateBinDataByGroup(f);h.forEach(g=>{d.push({group:g,key:p,value:m[g]||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 zl().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=Xi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Og(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===Z.TIME?s.sort((l,c)=>{const u=new Date(l),h=new Date(c);return u-h}):(o===Z.LOG||o===Z.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("-"),h={x0:c,x1:u},d=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{h[f]=d.filter(p=>p[i]===f).length}),h}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const h=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Og(f[p])===l:f[p].toString()===l)}),d=this.services.cartesianScales.getRangeIdentifier(c);c[u]=h?h[d]: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=NA(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const h=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/h*100:c[u]=0})})}return(r?zl().offset(hS):zl()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const h=l[u];return h[s]=a[c],h}))}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();mc(n,t),this.set({options:rt(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}=Vt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(O.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=x(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=x(s,"label");if(c===null){const h=x(i,o);h?l=h: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(i=>i.map(s=>`"${s==="–"?"–":s}"`));let n="",r="";t.forEach(function(i,s){r=i.join(","),n+=s<t.length?r+`
|
|
1
|
+
(function(X,re){typeof exports=="object"&&typeof module<"u"?re(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],re):(X=typeof globalThis<"u"?globalThis:X||self,re(X.ChartsReact={},X.React))})(this,function(X,re){"use strict";var nV=Object.defineProperty;var rV=(X,re,Tn)=>re in X?nV(X,re,{enumerable:!0,configurable:!0,writable:!0,value:Tn}):X[re]=Tn;var du=(X,re,Tn)=>(rV(X,typeof re!="symbol"?re+"":re,Tn),Tn);var Tn=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Tn||{}),fu=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(fu||{}),pu=(e=>(e.UPDATE="model-update",e))(pu||{}),gu=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(gu||{}),mu=(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))(mu||{}),vu=(e=>(e.CHANGE="zoom-domain-change",e))(vu||{}),yu=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(yu||{}),bu=(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))(bu||{}),xu=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(xu||{}),wu=(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))(wu||{}),_u=(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))(_u||{}),Eu=(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))(Eu||{}),Su=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Su||{}),Ou=(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))(Ou||{}),Tu=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Tu||{}),Mu=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Mu||{}),Cu=(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))(Cu||{}),$u=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))($u||{}),Au=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Au||{}),Jr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Jr||{}),Lu=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Lu||{}),ku=(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))(ku||{}),Du=(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))(Du||{}),Ru=(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))(Ru||{}),Iu=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Iu||{}),Nu=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Nu||{}),dr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(dr||{});const Hv=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Ru,Area:xu,Axis:bu,Bar:Su,Boxplot:Ou,CanvasZoom:yu,Chart:Tn,Choropleth:dr,CirclePack:Du,Gauge:Eu,Heatmap:Nu,Legend:ku,Line:Mu,Meter:Iu,Modal:fu,Model:pu,Pie:_u,Radar:Cu,Scatter:Tu,Threshold:Lu,Toolbar:gu,Tooltip:Jr,Tree:$u,Treemap:Au,WordCloud:wu,ZoomBar:mu,ZoomDomain:vu},Symbol.toStringTag,{value:"Module"})),O=Hv;var Q=(e=>(e.HTML="html",e.SVG="svg",e))(Q||{}),Pu=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Pu||{}),tt=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(tt||{}),H=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(H||{}),je=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(je||{}),De=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(De||{}),Qt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Qt||{}),Z=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(Z||{}),ti=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(ti||{}),qt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(qt||{}),ei=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(ei||{}),lo=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(lo||{}),$t=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))($t||{}),at=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(at||{}),fr=(e=>(e.CENTER="center",e))(fr||{}),ls=(e=>(e.LEFT="left",e.RIGHT="right",e))(ls||{}),Yt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Yt||{}),nn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(nn||{}),rn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(rn||{}),pr=(e=>(e.SEMI="semi",e.FULL="full",e))(pr||{}),co=(e=>(e.UP="up",e.DOWN="down",e))(co||{}),cs=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(cs||{}),us=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(us||{}),Te=(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))(Te||{}),Bt=(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))(Bt||{}),uo=(e=>(e.LEFT="left",e.RIGHT="right",e))(uo||{}),Xt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Xt||{}),hs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(hs||{}),ni=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(ni||{}),ds=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(ds||{}),sn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(sn||{});function Bn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Fv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ho(e){let t,n,r;e.length!==2?(t=Bn,n=(o,l)=>Bn(e(o),l),r=(o,l)=>e(o)-l):(t=e===Bn||e===Fv?e:Gv,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 h=c+u>>>1;n(o[h],l)<0?c=h+1:u=h}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 h=c+u>>>1;n(o[h],l)<=0?c=h+1:u=h}while(c<u)}return c}function a(o,l,c=0,u=o.length){const h=i(o,l,c,u-1);return h>c&&r(o[h-1],l)>-r(o[h],l)?h-1:h}return{left:i,center:a,right:s}}function Gv(){return 0}function zv(e){return e===null?NaN:+e}function*jv(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 Wv=ho(Bn).right;ho(zv).center;const fo=Wv;function qv(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 Re(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 Vn{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 Uu extends Map{constructor(t,n=Zv){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(Bu(this,t))}has(t){return super.has(Bu(this,t))}set(t,n){return super.set(Yv(this,t),n)}delete(t){return super.delete(Xv(this,t))}}function Bu({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Yv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Xv({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Zv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Kv(e){return e}function Qv(e=Bn){if(e===Bn)return Vu;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 Vu(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Jv=Array.prototype,t0=Jv.slice;function po(e){return()=>e}const e0=Math.sqrt(50),n0=Math.sqrt(10),r0=Math.sqrt(2);function fs(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>=e0?10:s>=n0?5:s>=r0?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?fs(e,t,n*2):[o,l,c]}function ps(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?fs(t,e,n):fs(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 gr(e,t,n){return t=+t,e=+e,n=+n,fs(e,t,n)[2]}function go(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?gr(t,e,n):gr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function i0(e,t,n){let r;for(;;){const i=gr(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 s0(e){return Math.max(1,Math.ceil(Math.log(qv(e))/Math.LN2)+1)}function a0(){var e=Kv,t=Re,n=s0;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),h=u[0],d=u[1],f=n(c,h,d);if(!Array.isArray(f)){const b=d,S=+f;if(t===Re&&([h,d]=i0(h,d,S)),f=ps(h,d,S),f[0]<=h&&(l=gr(h,d,S)),f[f.length-1]>=d)if(b>=d&&t===Re){const _=gr(h,d,S);isFinite(_)&&(_>0?d=(Math.floor(d/_)+1)*_:_<0&&(d=(Math.ceil(d*-_)+1)/-_))}else f.pop()}for(var p=f.length,m=0,g=p;f[m]<=h;)++m;for(;f[g-1]>d;)--g;(m||g<p)&&(f=f.slice(m,g),p=g-m);var v=new Array(p+1),y;for(s=0;s<=p;++s)y=v[s]=[],y.x0=s>0?f[s-1]:h,y.x1=s<p?f[s]:d;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[Math.min(p,Math.floor((o-h)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&h<=o&&o<=d){const b=Math.floor((h-o)*l);v[Math.min(p,b+(f[b]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[fo(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:po(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:po([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:po(Array.isArray(i)?t0.call(i):i),r):n},r}function Hn(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 Mn(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 Hu(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?Vu:Qv(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*h/l+d)),p=Math.min(r,Math.floor(t+(l-c)*h/l+d));Hu(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(ri(e,n,t),i(e[r],s)>0&&ri(e,n,r);a<o;){for(ri(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?ri(e,n,o):(++o,ri(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function ri(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function mo(e,t,n){if(e=Float64Array.from(jv(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Mn(e);if(t>=1)return Hn(e);var r,i=(r-1)*t,s=Math.floor(i),a=Hn(Hu(e,s).subarray(0,s+1)),o=Mn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*o0(e){for(const t of e)yield*t}function Fu(e){return Array.from(o0(e))}function l0(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 c0(e){return e}var gs=1,ms=2,vo=3,ii=4,Gu=1e-6;function u0(e){return"translate("+e+",0)"}function h0(e){return"translate(0,"+e+")"}function d0(e){return t=>+e(t)}function f0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function p0(){return!this.__axis}function vs(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===gs||e===ii?-1:1,u=e===ii||e===ms?"x":"y",h=e===gs||e===vo?u0:h0;function d(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):c0),g=Math.max(s,0)+o,v=t.range(),y=+v[0]+l,b=+v[v.length-1]+l,S=(t.bandwidth?f0:d0)(t.copy(),l),_=f.selection?f.selection():f,E=_.selectAll(".domain").data([null]),T=_.selectAll(".tick").data(p,t).order(),D=T.exit(),N=T.enter().append("g").attr("class","tick"),L=T.select("line"),C=T.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(N),L=L.merge(N.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),C=C.merge(N.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",e===gs?"0em":e===vo?"0.71em":"0.32em")),f!==_&&(E=E.transition(f),T=T.transition(f),L=L.transition(f),C=C.transition(f),D=D.transition(f).attr("opacity",Gu).attr("transform",function(V){return isFinite(V=S(V))?h(V+l):this.getAttribute("transform")}),N.attr("opacity",Gu).attr("transform",function(V){var M=this.parentNode.__axis;return h((M&&isFinite(M=M(V))?M:S(V))+l)})),D.remove(),E.attr("d",e===ii||e===ms?a?"M"+c*a+","+y+"H"+l+"V"+b+"H"+c*a:"M"+l+","+y+"V"+b:a?"M"+y+","+c*a+"V"+l+"H"+b+"V"+c*a:"M"+y+","+l+"H"+b),T.attr("opacity",1).attr("transform",function(V){return h(S(V)+l)}),L.attr(u+"2",c*s),C.attr(u,c*g).text(m),_.filter(p0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ms?"start":e===ii?"end":"middle"),_.each(function(){this.__axis=S})}return d.scale=function(f){return arguments.length?(t=f,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),d):n.slice()},d.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),d):r&&r.slice()},d.tickFormat=function(f){return arguments.length?(i=f,d):i},d.tickSize=function(f){return arguments.length?(s=a=+f,d):s},d.tickSizeInner=function(f){return arguments.length?(s=+f,d):s},d.tickSizeOuter=function(f){return arguments.length?(a=+f,d):a},d.tickPadding=function(f){return arguments.length?(o=+f,d):o},d.offset=function(f){return arguments.length?(l=+f,d):l},d}function g0(e){return vs(gs,e)}function m0(e){return vs(ms,e)}function yo(e){return vs(vo,e)}function zu(e){return vs(ii,e)}var v0={value:()=>{}};function bo(){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 ys(n)}function ys(e){this._=e}function y0(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}})}ys.prototype=bo.prototype={constructor:ys,on:function(e,t){var n=this._,r=y0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=b0(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]=ju(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ju(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 ys(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 b0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ju(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=v0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var xo="http://www.w3.org/1999/xhtml";const Wu={svg:"http://www.w3.org/2000/svg",xhtml:xo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Wu.hasOwnProperty(t)?{space:Wu[t],local:e}:e}function x0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===xo&&t.documentElement.namespaceURI===xo?t.createElement(e):t.createElementNS(n,e)}}function w0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function qu(e){var t=bs(e);return(t.local?w0:x0)(t)}function _0(){}function wo(e){return e==null?_0:function(){return this.querySelector(e)}}function E0(e){typeof e!="function"&&(e=wo(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 be(r,this._parents)}function S0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function O0(){return[]}function Yu(e){return e==null?O0:function(){return this.querySelectorAll(e)}}function T0(e){return function(){return S0(e.apply(this,arguments))}}function M0(e){typeof e=="function"?e=T0(e):e=Yu(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 be(r,i)}function Xu(e){return function(){return this.matches(e)}}function Zu(e){return function(t){return t.matches(e)}}var C0=Array.prototype.find;function $0(e){return function(){return C0.call(this.children,e)}}function A0(){return this.firstElementChild}function L0(e){return this.select(e==null?A0:$0(typeof e=="function"?e:Zu(e)))}var k0=Array.prototype.filter;function D0(){return Array.from(this.children)}function R0(e){return function(){return k0.call(this.children,e)}}function I0(e){return this.selectAll(e==null?D0:R0(typeof e=="function"?e:Zu(e)))}function N0(e){typeof e!="function"&&(e=Xu(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 be(r,this._parents)}function Ku(e){return new Array(e.length)}function P0(){return new be(this._enter||this._groups.map(Ku),this._parents)}function xs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}xs.prototype={constructor:xs,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 U0(e){return function(){return e}}function B0(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 xs(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function V0(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,h=s.length,d=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(d[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<h;++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 xs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(d[o])===l&&(i[o]=l)}function H0(e){return e.__data__}function F0(e,t){if(!arguments.length)return Array.from(this,H0);var n=t?V0:B0,r=this._parents,i=this._groups;typeof e!="function"&&(e=U0(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],h=i[c],d=h.length,f=G0(e.call(u,u&&u.__data__,c,r)),p=f.length,m=o[c]=new Array(p),g=a[c]=new Array(p),v=l[c]=new Array(d);n(u,h,m,g,v,f,t);for(var y=0,b=0,S,_;y<p;++y)if(S=m[y]){for(y>=b&&(b=y+1);!(_=g[b])&&++b<p;);S._next=_||null}}return a=new be(a,r),a._enter=o,a._exit=l,a}function G0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function z0(){return new be(this._exit||this._groups.map(Ku),this._parents)}function j0(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 W0(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],h=c.length,d=o[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||u[p])&&(d[p]=f);for(;l<i;++l)o[l]=n[l];return new be(o,this._parents)}function q0(){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 Y0(e){e||(e=X0);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}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 be(i,this._parents).order()}function X0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Z0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function K0(){return Array.from(this)}function Q0(){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 J0(){let e=0;for(const t of this)++e;return e}function ty(){return!this.node()}function ey(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 ny(e){return function(){this.removeAttribute(e)}}function ry(e){return function(){this.removeAttributeNS(e.space,e.local)}}function iy(e,t){return function(){this.setAttribute(e,t)}}function sy(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ay(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function oy(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 ly(e,t){var n=bs(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?ry:ny:typeof t=="function"?n.local?oy:ay:n.local?sy:iy)(n,t))}function Qu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function cy(e){return function(){this.style.removeProperty(e)}}function uy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function hy(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function dy(e,t,n){return arguments.length>1?this.each((t==null?cy:typeof t=="function"?hy:uy)(e,t,n??"")):mr(this.node(),e)}function mr(e,t){return e.style.getPropertyValue(t)||Qu(e).getComputedStyle(e,null).getPropertyValue(t)}function fy(e){return function(){delete this[e]}}function py(e,t){return function(){this[e]=t}}function gy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function my(e,t){return arguments.length>1?this.each((t==null?fy:typeof t=="function"?gy:py)(e,t)):this.node()[e]}function Ju(e){return e.trim().split(/^|\s+/)}function _o(e){return e.classList||new th(e)}function th(e){this._node=e,this._names=Ju(e.getAttribute("class")||"")}th.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 eh(e,t){for(var n=_o(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function nh(e,t){for(var n=_o(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function vy(e){return function(){eh(this,e)}}function yy(e){return function(){nh(this,e)}}function by(e,t){return function(){(t.apply(this,arguments)?eh:nh)(this,e)}}function xy(e,t){var n=Ju(e+"");if(arguments.length<2){for(var r=_o(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?by:t?vy:yy)(n,t))}function wy(){this.textContent=""}function _y(e){return function(){this.textContent=e}}function Ey(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Sy(e){return arguments.length?this.each(e==null?wy:(typeof e=="function"?Ey:_y)(e)):this.node().textContent}function Oy(){this.innerHTML=""}function Ty(e){return function(){this.innerHTML=e}}function My(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Cy(e){return arguments.length?this.each(e==null?Oy:(typeof e=="function"?My:Ty)(e)):this.node().innerHTML}function $y(){this.nextSibling&&this.parentNode.appendChild(this)}function Ay(){return this.each($y)}function Ly(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ky(){return this.each(Ly)}function Dy(e){var t=typeof e=="function"?e:qu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ry(){return null}function Iy(e,t){var n=typeof e=="function"?e:qu(e),r=t==null?Ry:typeof t=="function"?t:wo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ny(){var e=this.parentNode;e&&e.removeChild(this)}function Py(){return this.each(Ny)}function Uy(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function By(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vy(e){return this.select(e?By:Uy)}function Hy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Fy(e){return function(t){e.call(this,t,this.__data__)}}function Gy(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 zy(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 jy(e,t,n){return function(){var r=this.__on,i,s=Fy(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 Wy(e,t,n){var r=Gy(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?jy:zy,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function rh(e,t,n){var r=Qu(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 qy(e,t){return function(){return rh(this,e,t)}}function Yy(e,t){return function(){return rh(this,e,t.apply(this,arguments))}}function Xy(e,t){return this.each((typeof t=="function"?Yy:qy)(e,t))}function*Zy(){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 ih=[null];function be(e,t){this._groups=e,this._parents=t}function si(){return new be([[document.documentElement]],ih)}function Ky(){return this}be.prototype=si.prototype={constructor:be,select:E0,selectAll:M0,selectChild:L0,selectChildren:I0,filter:N0,data:F0,enter:P0,exit:z0,join:j0,merge:W0,selection:Ky,order:q0,sort:Y0,call:Z0,nodes:K0,node:Q0,size:J0,empty:ty,each:ey,attr:ly,style:dy,property:my,classed:xy,text:Sy,html:Cy,raise:Ay,lower:ky,append:Dy,insert:Iy,remove:Py,clone:Vy,datum:Hy,on:Wy,dispatch:Xy,[Symbol.iterator]:Zy};function R(e){return typeof e=="string"?new be([[document.querySelector(e)]],[document.documentElement]):new be([[e]],ih)}function Qy(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Fn(e,t){if(e=Qy(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 Eo={capture:!0,passive:!1};function So(e){e.preventDefault(),e.stopImmediatePropagation()}function Jy(e){var t=e.document.documentElement,n=R(e).on("dragstart.drag",So,Eo);"onselectstart"in t?n.on("selectstart.drag",So,Eo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function t1(e,t){var n=e.document.documentElement,r=R(e).on("dragstart.drag",null);t&&(r.on("click.drag",So,Eo),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 Oo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sh(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ai(){}var oi=.7,ws=1/oi,vr="\\s*([+-]?\\d+)\\s*",li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",e1=/^#([0-9a-f]{3,8})$/,n1=new RegExp(`^rgb\\(${vr},${vr},${vr}\\)$`),r1=new RegExp(`^rgb\\(${We},${We},${We}\\)$`),i1=new RegExp(`^rgba\\(${vr},${vr},${vr},${li}\\)$`),s1=new RegExp(`^rgba\\(${We},${We},${We},${li}\\)$`),a1=new RegExp(`^hsl\\(${li},${We},${We}\\)$`),o1=new RegExp(`^hsla\\(${li},${We},${We},${li}\\)$`),ah={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};Oo(ai,an,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oh,formatHex:oh,formatHex8:l1,formatHsl:c1,formatRgb:lh,toString:lh});function oh(){return this.rgb().formatHex()}function l1(){return this.rgb().formatHex8()}function c1(){return fh(this).formatHsl()}function lh(){return this.rgb().formatRgb()}function an(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=e1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ch(t):n===3?new fe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_s(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_s(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=n1.exec(e))?new fe(t[1],t[2],t[3],1):(t=r1.exec(e))?new fe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=i1.exec(e))?_s(t[1],t[2],t[3],t[4]):(t=s1.exec(e))?_s(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=a1.exec(e))?dh(t[1],t[2]/100,t[3]/100,1):(t=o1.exec(e))?dh(t[1],t[2]/100,t[3]/100,t[4]):ah.hasOwnProperty(e)?ch(ah[e]):e==="transparent"?new fe(NaN,NaN,NaN,0):null}function ch(e){return new fe(e>>16&255,e>>8&255,e&255,1)}function _s(e,t,n,r){return r<=0&&(e=t=n=NaN),new fe(e,t,n,r)}function u1(e){return e instanceof ai||(e=an(e)),e?(e=e.rgb(),new fe(e.r,e.g,e.b,e.opacity)):new fe}function To(e,t,n,r){return arguments.length===1?u1(e):new fe(e,t,n,r??1)}function fe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Oo(fe,To,sh(ai,{brighter(e){return e=e==null?ws:Math.pow(ws,e),new fe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?oi:Math.pow(oi,e),new fe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fe(Gn(this.r),Gn(this.g),Gn(this.b),Es(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:uh,formatHex:uh,formatHex8:h1,formatRgb:hh,toString:hh}));function uh(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}`}function h1(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}${zn((isNaN(this.opacity)?1:this.opacity)*255)}`}function hh(){const e=Es(this.opacity);return`${e===1?"rgb(":"rgba("}${Gn(this.r)}, ${Gn(this.g)}, ${Gn(this.b)}${e===1?")":`, ${e})`}`}function Es(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zn(e){return e=Gn(e),(e<16?"0":"")+e.toString(16)}function dh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ie(e,t,n,r)}function fh(e){if(e instanceof Ie)return new Ie(e.h,e.s,e.l,e.opacity);if(e instanceof ai||(e=an(e)),!e)return new Ie;if(e instanceof Ie)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 Ie(a,o,l,e.opacity)}function Mo(e,t,n,r){return arguments.length===1?fh(e):new Ie(e,t,n,r??1)}function Ie(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Oo(Ie,Mo,sh(ai,{brighter(e){return e=e==null?ws:Math.pow(ws,e),new Ie(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?oi:Math.pow(oi,e),new Ie(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 fe(Co(e>=240?e-240:e+120,i,r),Co(e,i,r),Co(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ie(ph(this.h),Ss(this.s),Ss(this.l),Es(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=Es(this.opacity);return`${e===1?"hsl(":"hsla("}${ph(this.h)}, ${Ss(this.s)*100}%, ${Ss(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ph(e){return e=(e||0)%360,e<0?e+360:e}function Ss(e){return Math.max(0,Math.min(1,e||0))}function Co(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 $o=e=>()=>e;function d1(e,t){return function(n){return e+n*t}}function f1(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 p1(e){return(e=+e)==1?gh:function(t,n){return n-t?f1(t,n,e):$o(isNaN(t)?n:t)}}function gh(e,t){var n=t-e;return n?d1(e,n):$o(isNaN(e)?t:e)}const Os=function e(t){var n=p1(t);function r(i,s){var a=n((i=To(i)).r,(s=To(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=gh(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 g1(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 m1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function v1(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]=ci(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 y1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function b1(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]=ci(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Ao=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Lo=new RegExp(Ao.source,"g");function x1(e){return function(){return e}}function w1(e){return function(t){return e(t)+""}}function mh(e,t){var n=Ao.lastIndex=Lo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Ao.exec(e))&&(i=Lo.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:xe(r,i)})),n=Lo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?w1(l[0].x):x1(t):(t=l.length,function(c){for(var u=0,h;u<t;++u)o[(h=l[u]).i]=h.x(c);return o.join("")})}function ci(e,t){var n=typeof t,r;return t==null||n==="boolean"?$o(t):(n==="number"?xe:n==="string"?(r=an(t))?(t=r,Os):mh:t instanceof an?Os:t instanceof Date?y1:m1(t)?g1:Array.isArray(t)?v1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?b1:xe)(e,t)}function vh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var yh=180/Math.PI,ko={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function bh(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)*yh,skewX:Math.atan(l)*yh,scaleX:a,scaleY:o}}var Ts;function _1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ko:bh(t.a,t.b,t.c,t.d,t.e,t.f)}function E1(e){return e==null||(Ts||(Ts=document.createElementNS("http://www.w3.org/2000/svg","g")),Ts.setAttribute("transform",e),!(e=Ts.transform.baseVal.consolidate()))?ko:(e=e.matrix,bh(e.a,e.b,e.c,e.d,e.e,e.f))}function xh(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push("translate(",null,t,null,n);p.push({i:m-4,x:xe(c,h)},{i:m-2,x:xe(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function a(c,u,h,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:h.push(i(h)+"rotate(",null,r)-2,x:xe(c,u)})):u&&h.push(i(h)+"rotate("+u+r)}function o(c,u,h,d){c!==u?d.push({i:h.push(i(h)+"skewX(",null,r)-2,x:xe(c,u)}):u&&h.push(i(h)+"skewX("+u+r)}function l(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push(i(f)+"scale(",null,",",null,")");p.push({i:m-4,x:xe(c,h)},{i:m-2,x:xe(u,d)})}else(h!==1||d!==1)&&f.push(i(f)+"scale("+h+","+d+")")}return function(c,u){var h=[],d=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,d),a(c.rotate,u.rotate,h,d),o(c.skewX,u.skewX,h,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,d),c=u=null,function(f){for(var p=-1,m=d.length,g;++p<m;)h[(g=d[p]).i]=g.x(f);return h.join("")}}}var S1=xh(_1,"px, ","px)","deg)"),O1=xh(E1,", ",")",")");function T1(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var yr=0,ui=0,hi=0,wh=1e3,Ms,di,Cs=0,jn=0,$s=0,fi=typeof performance=="object"&&performance.now?performance:Date,_h=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Do(){return jn||(_h(M1),jn=fi.now()+$s)}function M1(){jn=0}function As(){this._call=this._time=this._next=null}As.prototype=Eh.prototype={constructor:As,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Do():+n)+(t==null?0:+t),!this._next&&di!==this&&(di?di._next=this:Ms=this,di=this),this._call=e,this._time=n,Ro()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ro())}};function Eh(e,t,n){var r=new As;return r.restart(e,t,n),r}function C1(){Do(),++yr;for(var e=Ms,t;e;)(t=jn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yr}function Sh(){jn=(Cs=fi.now())+$s,yr=ui=0;try{C1()}finally{yr=0,A1(),jn=0}}function $1(){var e=fi.now(),t=e-Cs;t>wh&&($s-=t,Cs=e)}function A1(){for(var e,t=Ms,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:Ms=n);di=e,Ro(r)}function Ro(e){if(!yr){ui&&(ui=clearTimeout(ui));var t=e-jn;t>24?(e<1/0&&(ui=setTimeout(Sh,e-fi.now()-$s)),hi&&(hi=clearInterval(hi))):(hi||(Cs=fi.now(),hi=setInterval($1,wh)),yr=1,_h(Sh))}}function Oh(e,t,n){var r=new As;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var L1=bo("start","end","cancel","interrupt"),k1=[],Th=0,Mh=1,Io=2,Ls=3,Ch=4,No=5,ks=6;function Ds(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;D1(e,n,{name:t,index:r,group:i,on:L1,tween:k1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Th})}function Po(e,t){var n=Ne(e,t);if(n.state>Th)throw new Error("too late; already scheduled");return n}function qe(e,t){var n=Ne(e,t);if(n.state>Ls)throw new Error("too late; already running");return n}function Ne(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function D1(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Eh(s,0,n.time);function s(c){n.state=Mh,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,h,d,f;if(n.state!==Mh)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Ls)return Oh(a);f.state===Ch?(f.state=ks,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=ks,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Oh(function(){n.state===Ls&&(n.state=Ch,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Io,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Io){for(n.state=Ls,i=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=f);i.length=h+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=No,1),h=-1,d=i.length;++h<d;)i[h].call(e,u);n.state===No&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ks,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Uo(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>Io&&r.state<No,r.state=ks,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function R1(e){return this.each(function(){Uo(this,e)})}function I1(e,t){var n,r;return function(){var i=qe(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 N1(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=qe(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 P1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ne(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?I1:N1)(n,e,t))}function Bo(e,t,n){var r=e._id;return e.each(function(){var i=qe(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ne(i,r).value[t]}}function $h(e,t){var n;return(typeof t=="number"?xe:t instanceof an?Os:(n=an(t))?(t=n,Os):mh)(e,t)}function U1(e){return function(){this.removeAttribute(e)}}function B1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function V1(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 H1(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 F1(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 G1(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 z1(e,t){var n=bs(e),r=n==="transform"?O1:$h;return this.attrTween(e,typeof t=="function"?(n.local?G1:F1)(n,r,Bo(this,"attr."+e,t)):t==null?(n.local?B1:U1)(n):(n.local?H1:V1)(n,r,t))}function j1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function W1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function q1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&W1(e,s)),n}return i._value=t,i}function Y1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&j1(e,s)),n}return i._value=t,i}function X1(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=bs(e);return this.tween(n,(r.local?q1:Y1)(r,t))}function Z1(e,t){return function(){Po(this,e).delay=+t.apply(this,arguments)}}function K1(e,t){return t=+t,function(){Po(this,e).delay=t}}function Q1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Z1:K1)(t,e)):Ne(this.node(),t).delay}function J1(e,t){return function(){qe(this,e).duration=+t.apply(this,arguments)}}function tb(e,t){return t=+t,function(){qe(this,e).duration=t}}function eb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?J1:tb)(t,e)):Ne(this.node(),t).duration}function nb(e,t){if(typeof t!="function")throw new Error;return function(){qe(this,e).ease=t}}function rb(e){var t=this._id;return arguments.length?this.each(nb(t,e)):Ne(this.node(),t).ease}function ib(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qe(this,e).ease=n}}function sb(e){if(typeof e!="function")throw new Error;return this.each(ib(this._id,e))}function ab(e){typeof e!="function"&&(e=Xu(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 on(r,this._parents,this._name,this._id)}function ob(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,h=a[o]=new Array(u),d,f=0;f<u;++f)(d=l[f]||c[f])&&(h[f]=d);for(;o<r;++o)a[o]=t[o];return new on(a,this._parents,this._name,this._id)}function lb(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 cb(e,t,n){var r,i,s=lb(t)?Po:qe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function ub(e,t){var n=this._id;return arguments.length<2?Ne(this.node(),n).on.on(e):this.each(cb(n,e,t))}function hb(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function db(){return this.on("end.remove",hb(this._id))}function fb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wo(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,h,d=0;d<l;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),c[d]=h,Ds(c[d],t,n,d,c,Ne(u,n)));return new on(s,this._parents,t,n)}function pb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yu(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,h=0;h<c;++h)if(u=l[h]){for(var d=e.call(u,u.__data__,h,l),f,p=Ne(u,n),m=0,g=d.length;m<g;++m)(f=d[m])&&Ds(f,t,n,m,d,p);s.push(d),a.push(u)}return new on(s,a,t,n)}var gb=si.prototype.constructor;function mb(){return new gb(this._groups,this._parents)}function vb(e,t){var n,r,i;return function(){var s=mr(this,e),a=(this.style.removeProperty(e),mr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Ah(e){return function(){this.style.removeProperty(e)}}function yb(e,t,n){var r,i=n+"",s;return function(){var a=mr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function bb(e,t,n){var r,i,s;return function(){var a=mr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),mr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function xb(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=qe(this,e),c=l.on,u=l.value[s]==null?o||(o=Ah(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function wb(e,t,n){var r=(e+="")=="transform"?S1:$h;return t==null?this.styleTween(e,vb(e,r)).on("end.style."+e,Ah(e)):typeof t=="function"?this.styleTween(e,bb(e,r,Bo(this,"style."+e,t))).each(xb(this._id,e)):this.styleTween(e,yb(e,r,t),n).on("end.style."+e,null)}function _b(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Eb(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&_b(e,a,n)),r}return s._value=t,s}function Sb(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,Eb(e,t,n??""))}function Ob(e){return function(){this.textContent=e}}function Tb(e){return function(){var t=e(this);this.textContent=t??""}}function Mb(e){return this.tween("text",typeof e=="function"?Tb(Bo(this,"text",e)):Ob(e==null?"":e+""))}function Cb(e){return function(t){this.textContent=e.call(this,t)}}function $b(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Cb(i)),t}return r._value=e,r}function Ab(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,$b(e))}function Lb(){for(var e=this._name,t=this._id,n=Lh(),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=Ne(l,t);Ds(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new on(r,this._parents,e,n)}function kb(){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=qe(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 Db=0;function on(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Lh(){return++Db}var ln=si.prototype;on.prototype={constructor:on,select:fb,selectAll:pb,selectChild:ln.selectChild,selectChildren:ln.selectChildren,filter:ab,merge:ob,selection:mb,transition:Lb,call:ln.call,nodes:ln.nodes,node:ln.node,size:ln.size,empty:ln.empty,each:ln.each,on:ub,attr:z1,attrTween:X1,style:wb,styleTween:Sb,text:Mb,textTween:Ab,remove:db,tween:P1,delay:Q1,duration:eb,ease:rb,easeVarying:sb,end:kb,[Symbol.iterator]:ln[Symbol.iterator]};const Rb=e=>+e;function kh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ib={time:null,delay:0,duration:250,ease:kh};function Nb(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 Pb(e){var t,n;e instanceof on?(t=e._id,e=e._name):(t=Lh(),(n=Ib).time=Do(),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])&&Ds(l,e,t,c,a,n||Nb(l,t));return new on(r,this._parents,e,t)}si.prototype.interrupt=R1,si.prototype.transition=Pb;const Vo=e=>()=>e;function Ub(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 Bb(e){e.stopImmediatePropagation()}function Ho(e){e.preventDefault(),e.stopImmediatePropagation()}var Dh={name:"drag"},Fo={name:"space"},br={name:"handle"},xr={name:"center"};const{abs:Rh,max:ie,min:se}=Math;function Ih(e){return[+e[0],+e[1]]}function Nh(e){return[Ih(e[0]),Ih(e[1])]}var Rs={name:"x",handles:["w","e"].map(Is),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]]}},Go={name:"y",handles:["n","s"].map(Is),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]]}},cn={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"},Ph={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Uh={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Vb={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Hb={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Is(e){return{type:e}}function Fb(e){return!e.ctrlKey&&!e.button}function Gb(){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 zb(){return navigator.maxTouchPoints||"ontouchstart"in this}function zo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function jb(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Bh(){return Wb(Rs)}function Wb(e){var t=Gb,n=Fb,r=zb,i=!0,s=bo("start","brush","end"),a=6,o;function l(g){var v=g.property("__brush",m).selectAll(".overlay").data([Is("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",cn.overlay).merge(v).each(function(){var b=zo(this).extent;R(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),g.selectAll(".selection").data([Is("selection")]).enter().append("rect").attr("class","selection").attr("cursor",cn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=g.selectAll(".handle").data(e.handles,function(b){return b.type});y.exit().remove(),y.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return cn[b.type]}),g.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).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(g,v,y){g.tween?g.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,S=b.__brush,_=u(b,arguments),E=S.selection,T=e.input(typeof v=="function"?v.apply(this,arguments):v,S.extent),D=ci(E,T);function N(L){S.selection=L===1&&T===null?null:D(L),c.call(b),_.brush()}return E!==null&&T!==null?N:N(1)}):g.each(function(){var b=this,S=arguments,_=b.__brush,E=e.input(typeof v=="function"?v.apply(b,S):v,_.extent),T=u(b,S).beforestart();Uo(b),_.selection=E===null?null:E,c.call(b),T.start(y).brush(y).end(y)})},l.clear=function(g,v){l.move(g,null,v)};function c(){var g=R(this),v=zo(this).selection;v?(g.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.type==="w"?v[1][1]-v[0][1]+a:a})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(g,v,y){var b=g.__brush.emitter;return b&&(!y||!b.clean)?b:new h(g,v,y)}function h(g,v,y){this.that=g,this.args=v,this.state=g.__brush,this.active=0,this.clean=y}h.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,v){return this.starting?(this.starting=!1,this.emit("start",g,v)):this.emit("brush",g),this},brush:function(g,v){return this.emit("brush",g,v),this},end:function(g,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,v)),this},emit:function(g,v,y){var b=R(this.that).datum();s.call(g,this.that,new Ub(g,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),b)}};function d(g){if(o&&!g.touches||!n.apply(this,arguments))return;var v=this,y=g.target.__data__.type,b=(i&&g.metaKey?y="overlay":y)==="selection"?Dh:i&&g.altKey?xr:br,S=e===Go?null:Vb[y],_=e===Rs?null:Hb[y],E=zo(v),T=E.extent,D=E.selection,N=T[0][0],L,C,V=T[0][1],M,A,w=T[1][0],P,U,I=T[1][1],B,j,Y=0,et=0,pt,z=S&&_&&i&&g.shiftKey,K,ht,it=Array.from(g.touches||[g],nt=>{const It=nt.identifier;return nt=Fn(nt,v),nt.point0=nt.slice(),nt.identifier=It,nt});Uo(v);var Mt=u(v,arguments,!0).beforestart();if(y==="overlay"){D&&(pt=!0);const nt=[it[0],it[1]||it[0]];E.selection=D=[[L=e===Go?N:se(nt[0][0],nt[1][0]),M=e===Rs?V:se(nt[0][1],nt[1][1])],[P=e===Go?w:ie(nt[0][0],nt[1][0]),B=e===Rs?I:ie(nt[0][1],nt[1][1])]],it.length>1&&Ut(g)}else L=D[0][0],M=D[0][1],P=D[1][0],B=D[1][1];C=L,A=M,U=P,j=B;var W=R(v).attr("pointer-events","none"),J=W.selectAll(".overlay").attr("cursor",cn[y]);if(g.touches)Mt.moved=F,Mt.ended=bt;else{var ct=R(g.view).on("mousemove.brush",F,!0).on("mouseup.brush",bt,!0);i&&ct.on("keydown.brush",zt,!0).on("keyup.brush",jt,!0),Jy(g.view)}c.call(v),Mt.start(g,b.name);function F(nt){for(const It of nt.changedTouches||[nt])for(const tn of it)tn.identifier===It.identifier&&(tn.cur=Fn(It,v));if(z&&!K&&!ht&&it.length===1){const It=it[0];Rh(It.cur[0]-It[0])>Rh(It.cur[1]-It[1])?ht=!0:K=!0}for(const It of it)It.cur&&(It[0]=It.cur[0],It[1]=It.cur[1]);pt=!0,Ho(nt),Ut(nt)}function Ut(nt){const It=it[0],tn=It.point0;var en;switch(Y=It[0]-tn[0],et=It[1]-tn[1],b){case Fo:case Dh:{S&&(Y=ie(N-L,se(w-P,Y)),C=L+Y,U=P+Y),_&&(et=ie(V-M,se(I-B,et)),A=M+et,j=B+et);break}case br:{it[1]?(S&&(C=ie(N,se(w,it[0][0])),U=ie(N,se(w,it[1][0])),S=1),_&&(A=ie(V,se(I,it[0][1])),j=ie(V,se(I,it[1][1])),_=1)):(S<0?(Y=ie(N-L,se(w-L,Y)),C=L+Y,U=P):S>0&&(Y=ie(N-P,se(w-P,Y)),C=L,U=P+Y),_<0?(et=ie(V-M,se(I-M,et)),A=M+et,j=B):_>0&&(et=ie(V-B,se(I-B,et)),A=M,j=B+et));break}case xr:{S&&(C=ie(N,se(w,L-Y*S)),U=ie(N,se(w,P+Y*S))),_&&(A=ie(V,se(I,M-et*_)),j=ie(V,se(I,B+et*_)));break}}U<C&&(S*=-1,en=L,L=P,P=en,en=C,C=U,U=en,y in Ph&&J.attr("cursor",cn[y=Ph[y]])),j<A&&(_*=-1,en=M,M=B,B=en,en=A,A=j,j=en,y in Uh&&J.attr("cursor",cn[y=Uh[y]])),E.selection&&(D=E.selection),K&&(C=D[0][0],U=D[1][0]),ht&&(A=D[0][1],j=D[1][1]),(D[0][0]!==C||D[0][1]!==A||D[1][0]!==U||D[1][1]!==j)&&(E.selection=[[C,A],[U,j]],c.call(v),Mt.brush(nt,b.name))}function bt(nt){if(Bb(nt),nt.touches){if(nt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else t1(nt.view,pt),ct.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);W.attr("pointer-events","all"),J.attr("cursor",cn.overlay),E.selection&&(D=E.selection),jb(D)&&(E.selection=null,c.call(v)),Mt.end(nt,b.name)}function zt(nt){switch(nt.keyCode){case 16:{z=S&&_;break}case 18:{b===br&&(S&&(P=U-Y*S,L=C+Y*S),_&&(B=j-et*_,M=A+et*_),b=xr,Ut(nt));break}case 32:{(b===br||b===xr)&&(S<0?P=U-Y:S>0&&(L=C-Y),_<0?B=j-et:_>0&&(M=A-et),b=Fo,J.attr("cursor",cn.selection),Ut(nt));break}default:return}Ho(nt)}function jt(nt){switch(nt.keyCode){case 16:{z&&(K=ht=z=!1,Ut(nt));break}case 18:{b===xr&&(S<0?P=U:S>0&&(L=C),_<0?B=j:_>0&&(M=A),b=br,Ut(nt));break}case 32:{b===Fo&&(nt.altKey?(S&&(P=U-Y*S,L=C+Y*S),_&&(B=j-et*_,M=A+et*_),b=xr):(S<0?P=U:S>0&&(L=C),_<0?B=j:_>0&&(M=A),b=br),J.attr("cursor",cn[y]),Ut(nt));break}default:return}Ho(nt)}}function f(g){u(this,arguments).moved(g)}function p(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=Nh(t.apply(this,arguments)),g.dim=e,g}return l.extent=function(g){return arguments.length?(t=typeof g=="function"?g:Vo(Nh(g)),l):t},l.filter=function(g){return arguments.length?(n=typeof g=="function"?g:Vo(!!g),l):n},l.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:Vo(!!g),l):r},l.handleSize=function(g){return arguments.length?(a=+g,l):a},l.keyModifiers=function(g){return arguments.length?(i=!!g,l):i},l.on=function(){var g=s.on.apply(s,arguments);return g===s?l:g},l}const jo=Math.PI,Wo=2*jo,Wn=1e-6,qb=Wo-Wn;function Vh(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Yb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Vh;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 qo=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Vh:Yb(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,h=o-n,d=u*u+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>Wn)if(!(Math.abs(h*l-c*u)>Wn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,m=l*l+c*c,g=f*f+p*p,v=Math.sqrt(m),y=Math.sqrt(d),b=s*Math.tan((jo-Math.acos((m+d-g)/(2*v*y)))/2),S=b/y,_=b/v;Math.abs(S-1)>Wn&&this._append`L${t+S*u},${n+S*h}`,this._append`A${s},${s},0,0,${+(h*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,h=1^a,d=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Wn||Math.abs(this._y1-u)>Wn)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%Wo+Wo),d>qb?this._append`A${r},${r},0,1,${h},${t-o},${n-l}A${r},${r},0,1,${h},${this._x1=c},${this._y1=u}`:d>Wn&&this._append`A${r},${r},0,${+(d>=jo)},${h},${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 Hh(){return new qo}Hh.prototype=qo.prototype;function Xb(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ns(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 wr(e){return e=Ns(Math.abs(e)),e?e[1]:NaN}function Zb(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 Kb(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Qb=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pi(e){if(!(t=Qb.exec(e)))throw new Error("invalid format: "+e);var t;return new Yo({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}pi.prototype=Yo.prototype;function Yo(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+""}Yo.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 Jb(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 Fh;function tx(e,t){var n=Ns(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Fh=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")+Ns(e,Math.max(0,t+s-1))[0]}function Gh(e,t){var n=Ns(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 zh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Xb,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)=>Gh(e*100,t),r:Gh,s:tx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function jh(e){return e}var Wh=Array.prototype.map,qh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ex(e){var t=e.grouping===void 0||e.thousands===void 0?jh:Zb(Wh.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?jh:Kb(Wh.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(h){h=pi(h);var d=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,v=h.width,y=h.comma,b=h.precision,S=h.trim,_=h.type;_==="n"?(y=!0,_="g"):zh[_]||(b===void 0&&(b=12),S=!0,_="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",T=m==="$"?r:/[%p]/.test(_)?a:"",D=zh[_],N=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function L(C){var V=E,M=T,A,w,P;if(_==="c")M=D(C)+M,C="";else{C=+C;var U=C<0||1/C<0;if(C=isNaN(C)?l:D(Math.abs(C),b),S&&(C=Jb(C)),U&&+C==0&&p!=="+"&&(U=!1),V=(U?p==="("?p:o:p==="-"||p==="("?"":p)+V,M=(_==="s"?qh[8+Fh/3]:"")+M+(U&&p==="("?")":""),N){for(A=-1,w=C.length;++A<w;)if(P=C.charCodeAt(A),48>P||P>57){M=(P===46?i+C.slice(A+1):C.slice(A))+M,C=C.slice(0,A);break}}}y&&!g&&(C=t(C,1/0));var I=V.length+C.length+M.length,B=I<v?new Array(v-I+1).join(d):"";switch(y&&g&&(C=t(B+C,B.length?v-M.length:1/0),B=""),f){case"<":C=V+C+M+B;break;case"=":C=V+B+C+M;break;case"^":C=B.slice(0,I=B.length>>1)+V+C+M+B.slice(I);break;default:C=B+V+C+M;break}return s(C)}return L.toString=function(){return h+""},L}function u(h,d){var f=c((h=pi(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(wr(d)/3)))*3,m=Math.pow(10,-p),g=qh[8+p/3];return function(v){return f(m*v)+g}}return{format:c,formatPrefix:u}}var Ps,Xo,Yh;nx({thousands:",",grouping:[3],currency:["$",""]});function nx(e){return Ps=ex(e),Xo=Ps.format,Yh=Ps.formatPrefix,Ps}function rx(e){return Math.max(0,-wr(Math.abs(e)))}function ix(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(wr(t)/3)))*3-wr(Math.abs(e)))}function sx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,wr(t)-wr(e))+1}var _t=1e-6,Xh=1e-12,dt=Math.PI,pe=dt/2,Zh=dt/4,we=dt*2,ce=180/dt,Ht=dt/180,Et=Math.abs,Kh=Math.atan,qn=Math.atan2,Ot=Math.cos,ax=Math.exp,ox=Math.log,wt=Math.sin,Cn=Math.sign||function(e){return e>0?1:e<0?-1:0},Pe=Math.sqrt,lx=Math.tan;function cx(e){return e>1?0:e<-1?dt:Math.acos(e)}function un(e){return e>1?pe:e<-1?-pe:Math.asin(e)}function Me(){}function Us(e,t){e&&Jh.hasOwnProperty(e.type)&&Jh[e.type](e,t)}var Qh={Feature:function(e,t){Us(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Us(n[r].geometry,t)}},Jh={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){Zo(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Zo(n[r],t,0)},Polygon:function(e,t){td(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)td(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Us(n[r],t)}};function Zo(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 td(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Zo(e[n],t,1);t.polygonEnd()}function _r(e,t){e&&Qh.hasOwnProperty(e.type)?Qh[e.type](e,t):Us(e,t)}function Ko(e){return[qn(e[1],e[0]),un(e[2])]}function Er(e){var t=e[0],n=e[1],r=Ot(n);return[r*Ot(t),r*wt(t),wt(n)]}function Bs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Vs(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 Qo(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Hs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Jo(e){var t=Pe(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function tl(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 el(e,t){return Et(e)>dt&&(e-=Math.round(e/we)*we),[e,t]}el.invert=el;function ed(e,t,n){return(e%=we)?t||n?tl(rd(e),id(t,n)):rd(e):t||n?id(t,n):el}function nd(e){return function(t,n){return t+=e,Et(t)>dt&&(t-=Math.round(t/we)*we),[t,n]}}function rd(e){var t=nd(e);return t.invert=nd(-e),t}function id(e,t){var n=Ot(e),r=wt(e),i=Ot(t),s=wt(t);function a(o,l){var c=Ot(l),u=Ot(o)*c,h=wt(o)*c,d=wt(l),f=d*n+u*r;return[qn(h*i-f*s,u*n-d*r),un(f*i+h*s)]}return a.invert=function(o,l){var c=Ot(l),u=Ot(o)*c,h=wt(o)*c,d=wt(l),f=d*i-h*s;return[qn(h*i+d*s,u*n+f*r),un(f*n-u*r)]},a}function ux(e){e=ed(e[0]*Ht,e[1]*Ht,e.length>2?e[2]*Ht:0);function t(n){return n=e(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n}return t.invert=function(n){return n=e.invert(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n},t}function hx(e,t,n,r,i,s){if(n){var a=Ot(t),o=wt(t),l=r*n;i==null?(i=t+r*we,s=t-l/2):(i=sd(a,i),s=sd(a,s),(r>0?i<s:i>s)&&(i+=r*we));for(var c,u=i;r>0?u>s:u<s;u-=l)c=Ko([a,-o*Ot(u),-o*wt(u)]),e.point(c[0],c[1])}}function sd(e,t){t=Er(t),t[0]-=e,Jo(t);var n=cx(-t[1]);return((-t[2]<0?-n:n)+we-_t)%we}function ad(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Me,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Fs(e,t){return Et(e[0]-t[0])<_t&&Et(e[1]-t[1])<_t}function Gs(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 od(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],v=p[m],y;if(Fs(g,v)){if(!g[2]&&!v[2]){for(i.lineStart(),o=0;o<m;++o)i.point((g=p[o])[0],g[1]);i.lineEnd();return}v[0]+=2*_t}s.push(y=new Gs(g,p,null,!0)),a.push(y.o=new Gs(g,null,y,!1)),s.push(y=new Gs(v,p,null,!1)),a.push(y.o=new Gs(v,null,y,!0))}}),!!s.length){for(a.sort(t),ld(s),ld(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,h;;){for(var d=c,f=!0;d.v;)if((d=d.n)===c)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((h=u[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(f)for(u=d.p.z,o=u.length-1;o>=0;--o)i.point((h=u[o])[0],h[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,f=!f}while(!d.v);i.lineEnd()}}}function ld(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 nl(e){return Et(e[0])<=dt?e[0]:Cn(e[0])*((Et(e[0])+dt)%we-dt)}function dx(e,t){var n=nl(t),r=t[1],i=wt(r),s=[wt(n),-Ot(n),0],a=0,o=0,l=new Vn;i===1?r=pe+_t:i===-1&&(r=-pe-_t);for(var c=0,u=e.length;c<u;++c)if(d=(h=e[c]).length)for(var h,d,f=h[d-1],p=nl(f),m=f[1]/2+Zh,g=wt(m),v=Ot(m),y=0;y<d;++y,p=S,g=E,v=T,f=b){var b=h[y],S=nl(b),_=b[1]/2+Zh,E=wt(_),T=Ot(_),D=S-p,N=D>=0?1:-1,L=N*D,C=L>dt,V=g*E;if(l.add(qn(V*N*wt(L),v*T+V*Ot(L))),a+=C?D+N*we:D,C^p>=n^S>=n){var M=Vs(Er(f),Er(b));Jo(M);var A=Vs(s,M);Jo(A);var w=(C^D>=0?-1:1)*un(A[2]);(r>w||r===w&&(M[0]||M[1]))&&(o+=C^D>=0?1:-1)}}return(a<-_t||a<_t&&l<-Xh)^o&1}function cd(e,t,n,r){return function(i){var s=t(i),a=ad(),o=t(a),l=!1,c,u,h,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=b,u=[],c=[]},polygonEnd:function(){d.point=f,d.lineStart=m,d.lineEnd=g,u=Fu(u);var S=dx(c,r);u.length?(l||(i.polygonStart(),l=!0),od(u,px,S,n,i)):S&&(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(S,_){e(S,_)&&i.point(S,_)}function p(S,_){s.point(S,_)}function m(){d.point=p,s.lineStart()}function g(){d.point=f,s.lineEnd()}function v(S,_){h.push([S,_]),o.point(S,_)}function y(){o.lineStart(),h=[]}function b(){v(h[0][0],h[0][1]),o.lineEnd();var S=o.clean(),_=a.result(),E,T=_.length,D,N,L;if(h.pop(),c.push(h),h=null,!!T){if(S&1){if(N=_[0],(D=N.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),E=0;E<D;++E)i.point((L=N[E])[0],L[1]);i.lineEnd()}return}T>1&&S&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(fx))}}return d}}function fx(e){return e.length>1}function px(e,t){return((e=e.x)[0]<0?e[1]-pe-_t:pe-e[1])-((t=t.x)[0]<0?t[1]-pe-_t:pe-t[1])}const ud=cd(function(){return!0},gx,vx,[-dt,-pe]);function gx(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?dt:-dt,l=Et(s-t);Et(l-dt)<_t?(e.point(t,n=(n+a)/2>0?pe:-pe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=dt&&(Et(t-r)<_t&&(t-=r*_t),Et(s-o)<_t&&(s-=o*_t),n=mx(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 mx(e,t,n,r){var i,s,a=wt(e-n);return Et(a)>_t?Kh((wt(t)*(s=Ot(r))*wt(n)-wt(r)*(i=Ot(t))*wt(e))/(i*s*a)):(t+r)/2}function vx(e,t,n,r){var i;if(e==null)i=n*pe,r.point(-dt,i),r.point(0,i),r.point(dt,i),r.point(dt,0),r.point(dt,-i),r.point(0,-i),r.point(-dt,-i),r.point(-dt,0),r.point(-dt,i);else if(Et(e[0]-t[0])>_t){var s=e[0]<t[0]?dt:-dt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function yx(e){var t=Ot(e),n=6*Ht,r=t>0,i=Et(t)>_t;function s(u,h,d,f){hx(f,e,n,d,u,h)}function a(u,h){return Ot(u)*Ot(h)>t}function o(u){var h,d,f,p,m;return{lineStart:function(){p=f=!1,m=1},point:function(g,v){var y=[g,v],b,S=a(g,v),_=r?S?0:c(g,v):S?c(g+(g<0?dt:-dt),v):0;if(!h&&(p=f=S)&&u.lineStart(),S!==f&&(b=l(h,y),(!b||Fs(h,b)||Fs(y,b))&&(y[2]=1)),S!==f)m=0,S?(u.lineStart(),b=l(y,h),u.point(b[0],b[1])):(b=l(h,y),u.point(b[0],b[1],2),u.lineEnd()),h=b;else if(i&&h&&r^S){var E;!(_&d)&&(E=l(y,h,!0))&&(m=0,r?(u.lineStart(),u.point(E[0][0],E[0][1]),u.point(E[1][0],E[1][1]),u.lineEnd()):(u.point(E[1][0],E[1][1]),u.lineEnd(),u.lineStart(),u.point(E[0][0],E[0][1],3)))}S&&(!h||!Fs(h,y))&&u.point(y[0],y[1]),h=y,f=S,d=_},lineEnd:function(){f&&u.lineEnd(),h=null},clean:function(){return m|(p&&f)<<1}}}function l(u,h,d){var f=Er(u),p=Er(h),m=[1,0,0],g=Vs(f,p),v=Bs(g,g),y=g[0],b=v-y*y;if(!b)return!d&&u;var S=t*v/b,_=-t*y/b,E=Vs(m,g),T=Hs(m,S),D=Hs(g,_);Qo(T,D);var N=E,L=Bs(T,N),C=Bs(N,N),V=L*L-C*(Bs(T,T)-1);if(!(V<0)){var M=Pe(V),A=Hs(N,(-L-M)/C);if(Qo(A,T),A=Ko(A),!d)return A;var w=u[0],P=h[0],U=u[1],I=h[1],B;P<w&&(B=w,w=P,P=B);var j=P-w,Y=Et(j-dt)<_t,et=Y||j<_t;if(!Y&&I<U&&(B=U,U=I,I=B),et?Y?U+I>0^A[1]<(Et(A[0]-w)<_t?U:I):U<=A[1]&&A[1]<=I:j>dt^(w<=A[0]&&A[0]<=P)){var pt=Hs(N,(-L+M)/C);return Qo(pt,T),[A,Ko(pt)]}}}function c(u,h){var d=r?e:dt-e,f=0;return u<-d?f|=1:u>d&&(f|=2),h<-d?f|=4:h>d&&(f|=8),f}return cd(a,o,s,r?[0,-e]:[-dt,e-dt])}function bx(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,h=1,d=l-a,f=c-o,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<h&&(h=p)}else if(d>0){if(p>h)return;p>u&&(u=p)}if(p=i-a,!(!d&&p<0)){if(p/=d,d<0){if(p>h)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<h&&(h=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<h&&(h=p)}else if(f>0){if(p>h)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>h)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<h&&(h=p)}return u>0&&(e[0]=a+u*d,e[1]=o+u*f),h<1&&(t[0]=a+h*d,t[1]=o+h*f),!0}}}}}var gi=1e9,zs=-gi;function xx(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,h,d){var f=0,p=0;if(c==null||(f=a(c,h))!==(p=a(u,h))||l(c,u)<0^h>0)do d.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+h+4)%4)!==p);else d.point(u[0],u[1])}function a(c,u){return Et(c[0]-e)<_t?u>0?0:3:Et(c[0]-n)<_t?u>0?2:1:Et(c[1]-t)<_t?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var h=a(c,1),d=a(u,1);return h!==d?h-d:h===0?u[1]-c[1]:h===1?c[0]-u[0]:h===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,h=ad(),d,f,p,m,g,v,y,b,S,_,E,T={point:D,lineStart:V,lineEnd:M,polygonStart:L,polygonEnd:C};function D(w,P){i(w,P)&&u.point(w,P)}function N(){for(var w=0,P=0,U=f.length;P<U;++P)for(var I=f[P],B=1,j=I.length,Y=I[0],et,pt,z=Y[0],K=Y[1];B<j;++B)et=z,pt=K,Y=I[B],z=Y[0],K=Y[1],pt<=r?K>r&&(z-et)*(r-pt)>(K-pt)*(e-et)&&++w:K<=r&&(z-et)*(r-pt)<(K-pt)*(e-et)&&--w;return w}function L(){u=h,d=[],f=[],E=!0}function C(){var w=N(),P=E&&w,U=(d=Fu(d)).length;(P||U)&&(c.polygonStart(),P&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),U&&od(d,o,w,s,c),c.polygonEnd()),u=c,d=f=p=null}function V(){T.point=A,f&&f.push(p=[]),_=!0,S=!1,y=b=NaN}function M(){d&&(A(m,g),v&&S&&h.rejoin(),d.push(h.result())),T.point=D,S&&u.lineEnd()}function A(w,P){var U=i(w,P);if(f&&p.push([w,P]),_)m=w,g=P,v=U,_=!1,U&&(u.lineStart(),u.point(w,P));else if(U&&S)u.point(w,P);else{var I=[y=Math.max(zs,Math.min(gi,y)),b=Math.max(zs,Math.min(gi,b))],B=[w=Math.max(zs,Math.min(gi,w)),P=Math.max(zs,Math.min(gi,P))];bx(I,B,e,t,n,r)?(S||(u.lineStart(),u.point(I[0],I[1])),u.point(B[0],B[1]),U||u.lineEnd(),E=!1):U&&(u.lineStart(),u.point(w,P),E=!1)}y=w,b=P,S=U}return T}}const rl=e=>e;var il=new Vn,sl=new Vn,hd,dd,al,ol,$n={point:Me,lineStart:Me,lineEnd:Me,polygonStart:function(){$n.lineStart=wx,$n.lineEnd=Ex},polygonEnd:function(){$n.lineStart=$n.lineEnd=$n.point=Me,il.add(Et(sl)),sl=new Vn},result:function(){var e=il/2;return il=new Vn,e}};function wx(){$n.point=_x}function _x(e,t){$n.point=fd,hd=al=e,dd=ol=t}function fd(e,t){sl.add(ol*e-al*t),al=e,ol=t}function Ex(){fd(hd,dd)}const pd=$n;var Sr=1/0,js=Sr,mi=-Sr,Ws=mi,Sx={point:Ox,lineStart:Me,lineEnd:Me,polygonStart:Me,polygonEnd:Me,result:function(){var e=[[Sr,js],[mi,Ws]];return mi=Ws=-(js=Sr=1/0),e}};function Ox(e,t){e<Sr&&(Sr=e),e>mi&&(mi=e),t<js&&(js=t),t>Ws&&(Ws=t)}const qs=Sx;var ll=0,cl=0,vi=0,Ys=0,Xs=0,Or=0,ul=0,hl=0,yi=0,gd,md,Ye,Xe,Ue={point:Yn,lineStart:vd,lineEnd:yd,polygonStart:function(){Ue.lineStart=Cx,Ue.lineEnd=$x},polygonEnd:function(){Ue.point=Yn,Ue.lineStart=vd,Ue.lineEnd=yd},result:function(){var e=yi?[ul/yi,hl/yi]:Or?[Ys/Or,Xs/Or]:vi?[ll/vi,cl/vi]:[NaN,NaN];return ll=cl=vi=Ys=Xs=Or=ul=hl=yi=0,e}};function Yn(e,t){ll+=e,cl+=t,++vi}function vd(){Ue.point=Tx}function Tx(e,t){Ue.point=Mx,Yn(Ye=e,Xe=t)}function Mx(e,t){var n=e-Ye,r=t-Xe,i=Pe(n*n+r*r);Ys+=i*(Ye+e)/2,Xs+=i*(Xe+t)/2,Or+=i,Yn(Ye=e,Xe=t)}function yd(){Ue.point=Yn}function Cx(){Ue.point=Ax}function $x(){bd(gd,md)}function Ax(e,t){Ue.point=bd,Yn(gd=Ye=e,md=Xe=t)}function bd(e,t){var n=e-Ye,r=t-Xe,i=Pe(n*n+r*r);Ys+=i*(Ye+e)/2,Xs+=i*(Xe+t)/2,Or+=i,i=Xe*e-Ye*t,ul+=i*(Ye+e),hl+=i*(Xe+t),yi+=i*3,Yn(Ye=e,Xe=t)}const xd=Ue;function wd(e){this._context=e}wd.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,we);break}}},result:Me};var dl=new Vn,fl,_d,Ed,bi,xi,Zs={point:Me,lineStart:function(){Zs.point=Lx},lineEnd:function(){fl&&Sd(_d,Ed),Zs.point=Me},polygonStart:function(){fl=!0},polygonEnd:function(){fl=null},result:function(){var e=+dl;return dl=new Vn,e}};function Lx(e,t){Zs.point=Sd,_d=bi=e,Ed=xi=t}function Sd(e,t){bi-=e,xi-=t,dl.add(Pe(bi*bi+xi*xi)),bi=e,xi=t}const Od=Zs;let Td,Ks,Md,Cd;class $d{constructor(t){this._append=t==null?Ad:kx(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!==Md||this._append!==Ks){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`,Md=r,Ks=this._append,Cd=this._,this._=i}this._+=Cd;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Ad(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function kx(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Ad;if(t!==Td){const n=10**t;Td=t,Ks=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 Ks}function Dx(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),_r(o,i(s))),s.result()}return a.area=function(o){return _r(o,i(pd)),pd.result()},a.measure=function(o){return _r(o,i(Od)),Od.result()},a.bounds=function(o){return _r(o,i(qs)),qs.result()},a.centroid=function(o){return _r(o,i(xd)),xd.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,rl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new $d(n)):new wd(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 $d(n)),a},a.projection(e).digits(n).context(t)}function pl(e){return function(t){var n=new gl;for(var r in e)n[r]=e[r];return n.stream=t,n}}function gl(){}gl.prototype={constructor:gl,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 ml(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),_r(n,e.stream(qs)),t(qs.result()),r!=null&&e.clipExtent(r),e}function Ld(e,t,n){return ml(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 Rx(e,t,n){return Ld(e,[[0,0],t],n)}function Ix(e,t,n){return ml(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 Nx(e,t,n){return ml(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 kd=16,Px=Ot(30*Ht);function Dd(e,t){return+t?Bx(e,t):Ux(e)}function Ux(e){return pl({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Bx(e,t){function n(r,i,s,a,o,l,c,u,h,d,f,p,m,g){var v=c-r,y=u-i,b=v*v+y*y;if(b>4*t&&m--){var S=a+d,_=o+f,E=l+p,T=Pe(S*S+_*_+E*E),D=un(E/=T),N=Et(Et(E)-1)<_t||Et(s-h)<_t?(s+h)/2:qn(_,S),L=e(N,D),C=L[0],V=L[1],M=C-r,A=V-i,w=y*M-v*A;(w*w/b>t||Et((v*M+y*A)/b-.5)>.3||a*d+o*f+l*p<Px)&&(n(r,i,s,a,o,l,C,V,N,S/=T,_/=T,E,m,g),g.point(C,V),n(C,V,N,S,_,E,c,u,h,d,f,p,m,g))}}return function(r){var i,s,a,o,l,c,u,h,d,f,p,m,g={point:v,lineStart:y,lineEnd:S,polygonStart:function(){r.polygonStart(),g.lineStart=_},polygonEnd:function(){r.polygonEnd(),g.lineStart=y}};function v(D,N){D=e(D,N),r.point(D[0],D[1])}function y(){h=NaN,g.point=b,r.lineStart()}function b(D,N){var L=Er([D,N]),C=e(D,N);n(h,d,u,f,p,m,h=C[0],d=C[1],u=D,f=L[0],p=L[1],m=L[2],kd,r),r.point(h,d)}function S(){g.point=v,r.lineEnd()}function _(){y(),g.point=E,g.lineEnd=T}function E(D,N){b(i=D,N),s=h,a=d,o=f,l=p,c=m,g.point=b}function T(){n(h,d,u,f,p,m,s,a,i,o,l,c,kd,r),g.lineEnd=S,S()}return g}}var Vx=pl({point:function(e,t){this.stream.point(e*Ht,t*Ht)}});function Hx(e){return pl({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Fx(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 Rd(e,t,n,r,i,s){if(!s)return Fx(e,t,n,r,i);var a=Ot(s),o=wt(s),l=a*e,c=o*e,u=a/e,h=o/e,d=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(m,g){return m*=r,g*=i,[l*m-c*g+t,n-c*m-l*g]}return p.invert=function(m,g){return[r*(u*m-h*g+d),i*(f-h*m-u*g)]},p}function Qs(e){return Id(function(){return e})()}function Id(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,h=0,d=1,f=1,p=null,m=ud,g=null,v,y,b,S=rl,_=.5,E,T,D,N,L;function C(w){return D(w[0]*Ht,w[1]*Ht)}function V(w){return w=D.invert(w[0],w[1]),w&&[w[0]*ce,w[1]*ce]}C.stream=function(w){return N&&L===w?N:N=Vx(Hx(u)(m(E(S(L=w)))))},C.preclip=function(w){return arguments.length?(m=w,p=void 0,A()):m},C.postclip=function(w){return arguments.length?(S=w,g=v=y=b=null,A()):S},C.clipAngle=function(w){return arguments.length?(m=+w?yx(p=w*Ht):(p=null,ud),A()):p*ce},C.clipExtent=function(w){return arguments.length?(S=w==null?(g=v=y=b=null,rl):xx(g=+w[0][0],v=+w[0][1],y=+w[1][0],b=+w[1][1]),A()):g==null?null:[[g,v],[y,b]]},C.scale=function(w){return arguments.length?(n=+w,M()):n},C.translate=function(w){return arguments.length?(r=+w[0],i=+w[1],M()):[r,i]},C.center=function(w){return arguments.length?(s=w[0]%360*Ht,a=w[1]%360*Ht,M()):[s*ce,a*ce]},C.rotate=function(w){return arguments.length?(o=w[0]%360*Ht,l=w[1]%360*Ht,c=w.length>2?w[2]%360*Ht:0,M()):[o*ce,l*ce,c*ce]},C.angle=function(w){return arguments.length?(h=w%360*Ht,M()):h*ce},C.reflectX=function(w){return arguments.length?(d=w?-1:1,M()):d<0},C.reflectY=function(w){return arguments.length?(f=w?-1:1,M()):f<0},C.precision=function(w){return arguments.length?(E=Dd(T,_=w*w),A()):Pe(_)},C.fitExtent=function(w,P){return Ld(C,w,P)},C.fitSize=function(w,P){return Rx(C,w,P)},C.fitWidth=function(w,P){return Ix(C,w,P)},C.fitHeight=function(w,P){return Nx(C,w,P)};function M(){var w=Rd(n,0,0,d,f,h).apply(null,t(s,a)),P=Rd(n,r-w[0],i-w[1],d,f,h);return u=ed(o,l,c),T=tl(t,P),D=tl(u,T),E=Dd(T,_),A()}function A(){return N=L=null,C}return function(){return t=e.apply(this,arguments),C.invert=t.invert&&V,M()}}function Nd(e){var t=0,n=dt/3,r=Id(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Ht,n=s[1]*Ht):[t*ce,n*ce]},i}function Gx(e){var t=Ot(e);function n(r,i){return[r*t,wt(i)/t]}return n.invert=function(r,i){return[r/t,un(i*t)]},n}function zx(e,t){var n=wt(e),r=(n+wt(t))/2;if(Et(r)<_t)return Gx(e);var i=1+n*(2*r-n),s=Pe(i)/r;function a(o,l){var c=Pe(i-2*r*wt(l))/r;return[c*wt(o*=r),s-c*Ot(o)]}return a.invert=function(o,l){var c=s-l,u=qn(o,Et(c))*Cn(c);return c*r<0&&(u-=dt*Cn(o)*Cn(c)),[u/r,un((i-(o*o+c*c)*r*r)/(2*r))]},a}function Pd(){return Nd(zx).scale(155.424).center([0,33.6442])}function jx(){return Pd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function vl(e,t){return[e,ox(lx((pe+t)/2))]}vl.invert=function(e,t){return[e,2*Kh(ax(t))-pe]};function Wx(){return qx(vl).scale(961/we)}function qx(e){var t=Qs(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(h){return arguments.length?(r(h),u()):r()},t.translate=function(h){return arguments.length?(i(h),u()):i()},t.center=function(h){return arguments.length?(n(h),u()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=o=l=c=null:(a=+h[0][0],o=+h[0][1],l=+h[1][0],c=+h[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var h=dt*r(),d=t(ux(t.rotate()).invert([0,0]));return s(a==null?[[d[0]-h,d[1]-h],[d[0]+h,d[1]+h]]:e===vl?[[Math.max(d[0]-h,a),o],[Math.min(d[0]+h,l),c]]:[[a,Math.max(d[1]-h,o)],[l,Math.min(d[1]+h,c)]])}return u()}function Js(e,t){return[e,t]}Js.invert=Js;function Yx(){return Qs(Js).scale(152.63)}function Xx(e,t){var n=Ot(e),r=e===t?wt(e):(n-Ot(t))/(t-e),i=n/r+e;if(Et(r)<_t)return Js;function s(a,o){var l=i-o,c=r*a;return[l*wt(c),i-l*Ot(c)]}return s.invert=function(a,o){var l=i-o,c=qn(a,Et(l))*Cn(l);return l*r<0&&(c-=dt*Cn(a)*Cn(l)),[c/r,i-Cn(r)*Pe(a*a+l*l)]},s}function Zx(){return Nd(Xx).scale(131.154).center([0,13.9389])}var wi=1.340264,_i=-.081106,Ei=893e-6,Si=.003796,ta=Pe(3)/2,Kx=12;function Ud(e,t){var n=un(ta*wt(t)),r=n*n,i=r*r*r;return[e*Ot(n)/(ta*(wi+3*_i*r+i*(7*Ei+9*Si*r))),n*(wi+_i*r+i*(Ei+Si*r))]}Ud.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<Kx&&(o=n*(wi+_i*r+i*(Ei+Si*r))-t,l=wi+3*_i*r+i*(7*Ei+9*Si*r),n-=a=o/l,r=n*n,i=r*r*r,!(Et(a)<Xh));++s);return[ta*e*(wi+3*_i*r+i*(7*Ei+9*Si*r))/Ot(n),un(wt(n)/ta)]};function Qx(){return Qs(Ud).scale(177.158)}function Bd(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)))]}Bd.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(Et(i)>_t&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Jx(){return Qs(Bd).scale(175.295)}function tw(e,t){return e.parent===t.parent?1:2}function ew(e){return e.reduce(nw,0)/e.length}function nw(e,t){return e+t.x}function rw(e){return 1+e.reduce(iw,0)}function iw(e,t){return Math.max(e,t.y)}function sw(e){for(var t;t=e.children;)e=t[0];return e}function aw(e){for(var t;t=e.children;)e=t[t.length-1];return e}function ow(){var e=tw,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(d){var f=d.children;f?(d.x=ew(f),d.y=rw(f)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var l=sw(s),c=aw(s),u=l.x-e(l,c)/2,h=c.x+e(c,l)/2;return s.eachAfter(r?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-u)/(h-u)*t,d.y=(1-(s.y?d.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 lw(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 cw(){return this.eachAfter(lw)}function uw(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function hw(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 dw(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 fw(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function pw(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 gw(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function mw(e){for(var t=this,n=vw(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 vw(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 yw(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function bw(){return Array.from(this)}function xw(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function ww(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*_w(){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 Oi(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ow)):t===void 0&&(t=Sw);for(var n=new Ti(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 Ti(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Mw)}function Ew(){return Oi(this).eachBefore(Tw)}function Sw(e){return e.children}function Ow(e){return Array.isArray(e)?e[1]:null}function Tw(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Mw(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ti(e){this.data=e,this.depth=this.height=0,this.parent=null}Ti.prototype=Oi.prototype={constructor:Ti,count:cw,each:uw,eachAfter:dw,eachBefore:hw,find:fw,sum:pw,sort:gw,path:mw,ancestors:yw,descendants:bw,leaves:xw,links:ww,copy:Ew,[Symbol.iterator]:_w};function Cw(e){return e==null?null:Vd(e)}function Vd(e){if(typeof e!="function")throw new Error;return e}function Xn(){return 0}function Tr(e){return function(){return e}}const $w=1664525,Aw=1013904223,Hd=4294967296;function Lw(){let e=1;return()=>(e=($w*e+Aw)%Hd)/Hd}function kw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Dw(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 Rw(e,t){for(var n=0,r=(e=Dw(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Fd(a,s)?++n:(a=Nw(i=Iw(i,s)),n=0);return a}function Iw(e,t){var n,r;if(yl(t,e))return[t];for(n=0;n<e.length;++n)if(ea(t,e[n])&&yl(Mi(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(ea(Mi(e[n],e[r]),t)&&ea(Mi(e[n],t),e[r])&&ea(Mi(e[r],t),e[n])&&yl(Gd(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function ea(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 Fd(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 yl(e,t){for(var n=0;n<t.length;++n)if(!Fd(e,t[n]))return!1;return!0}function Nw(e){switch(e.length){case 1:return Pw(e[0]);case 2:return Mi(e[0],e[1]);case 3:return Gd(e[0],e[1],e[2])}}function Pw(e){return{x:e.x,y:e.y,r:e.r}}function Mi(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,h=Math.sqrt(l*l+c*c);return{x:(n+s+l/h*u)/2,y:(r+a+c/h*u)/2,r:(h+i+o)/2}}function Gd(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,h=n.r,d=r-a,f=r-c,p=i-o,m=i-u,g=l-s,v=h-s,y=r*r+i*i-s*s,b=y-a*a-o*o+l*l,S=y-c*c-u*u+h*h,_=f*p-d*m,E=(p*S-m*b)/(_*2)-r,T=(m*g-p*v)/_,D=(f*b-d*S)/(_*2)-i,N=(d*v-f*g)/_,L=T*T+N*N-1,C=2*(s+E*T+D*N),V=E*E+D*D-s*s,M=-(Math.abs(L)>1e-6?(C+Math.sqrt(C*C-4*L*V))/(2*L):V/C);return{x:r+E+T*M,y:i+D+N*M,r:M}}function zd(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 jd(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 Wd(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 Uw(e,t){if(!(s=(e=kw(e)).length))return 0;var n,r,i,s,a,o,l,c,u,h,d;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;zd(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){zd(n._,r._,i=e[l]),i=new na(i),c=r.next,u=n.previous,h=r._.r,d=n._.r;do if(h<=d){if(jd(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}h+=c._.r,c=c.next}else{if(jd(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}d+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Wd(n);(i=i.next)!==r;)(o=Wd(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Rw(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function Bw(e){return Math.sqrt(e.value)}function Vw(){var e=null,t=1,n=1,r=Xn;function i(s){const a=Lw();return s.x=t/2,s.y=n/2,e?s.eachBefore(qd(e)).eachAfter(bl(r,.5,a)).eachBefore(Yd(1)):s.eachBefore(qd(Bw)).eachAfter(bl(Xn,1,a)).eachAfter(bl(r,s.r/Math.min(t,n),a)).eachBefore(Yd(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=Cw(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:Tr(+s),i):r},i}function qd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function bl(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=Uw(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function Yd(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 Hw(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 Fw(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 Gw(e,t){return e.parent===t.parent?1:2}function xl(e){var t=e.children;return t?t[0]:e.t}function wl(e){var t=e.children;return t?t[t.length-1]:e.t}function zw(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 jw(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 Ww(e,t,n){return e.a.parent===t.parent?e.a:n}function ra(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}ra.prototype=Object.create(Ti.prototype);function qw(e){for(var t=new ra(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 ra(s[a],a)),i.parent=n;return(t.parent=new ra(null,0)).children=[t],t}function Yw(){var e=Gw,t=1,n=1,r=null;function i(c){var u=qw(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var h=c,d=c,f=c;c.eachBefore(function(y){y.x<h.x&&(h=y),y.x>d.x&&(d=y),y.depth>f.depth&&(f=y)});var p=h===d?1:e(h,d)/2,m=p-h.x,g=t/(d.x+p+m),v=n/(f.depth||1);c.eachBefore(function(y){y.x=(y.x+m)*g,y.y=y.depth*v})}return c}function s(c){var u=c.children,h=c.parent.children,d=c.i?h[c.i-1]:null;if(u){jw(c);var f=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-f):c.z=f}else d&&(c.z=d.z+e(c._,d._));c.parent.A=o(c,d,c.parent.A||h[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,h){if(u){for(var d=c,f=c,p=u,m=d.parent.children[0],g=d.m,v=f.m,y=p.m,b=m.m,S;p=wl(p),d=xl(d),p&&d;)m=xl(m),f=wl(f),f.a=c,S=p.z+y-d.z-g+e(p._,d._),S>0&&(zw(Ww(p,c,h),c,S),g+=S,v+=S),y+=p.m,g+=d.m,b+=m.m,v+=f.m;p&&!wl(f)&&(f.t=p,f.m+=y-v),d&&!xl(m)&&(m.t=d,m.m+=g-b,h=c)}return h}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 Xw(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 Zw=(1+Math.sqrt(5))/2;function Kw(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,h=0,d=o.length,f,p,m=t.value,g,v,y,b,S,_,E;u<d;){f=i-n,p=s-r;do g=o[h++].value;while(!g&&h<d);for(v=y=g,_=Math.max(p/f,f/p)/(m*e),E=g*g*_,S=Math.max(y/E,E/v);h<d;++h){if(g+=c=o[h].value,c<v&&(v=c),c>y&&(y=c),E=g*g*_,b=Math.max(y/E,E/v),b>S){g-=c;break}S=b}a.push(l={value:g,dice:f<p,children:o.slice(u,h)}),l.dice?Fw(l,n,r,i,m?r+=p*g/m:s):Xw(l,n,r,m?n+=f*g/m:i,s),m-=g,u=h}return a}const Qw=function e(t){function n(r,i,s,a,o){Kw(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(Zw);function Jw(){var e=Qw,t=!1,n=1,r=1,i=[0],s=Xn,a=Xn,o=Xn,l=Xn,c=Xn;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(h),i=[0],t&&d.eachBefore(Hw),d}function h(d){var f=i[d.depth],p=d.x0+f,m=d.y0+f,g=d.x1-f,v=d.y1-f;g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),d.x0=p,d.y0=m,d.x1=g,d.y1=v,d.children&&(f=i[d.depth+1]=s(d)/2,p+=c(d)-f,m+=a(d)-f,g-=o(d)-f,v-=l(d)-f,g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),e(d,p,m,g,v))}return u.round=function(d){return arguments.length?(t=!!d,u):t},u.size=function(d){return arguments.length?(n=+d[0],r=+d[1],u):[n,r]},u.tile=function(d){return arguments.length?(e=Vd(d),u):e},u.padding=function(d){return arguments.length?u.paddingInner(d).paddingOuter(d):u.paddingInner()},u.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:Tr(+d),u):s},u.paddingOuter=function(d){return arguments.length?u.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):u.paddingTop()},u.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:Tr(+d),u):a},u.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:Tr(+d),u):o},u.paddingBottom=function(d){return arguments.length?(l=typeof d=="function"?d:Tr(+d),u):l},u.paddingLeft=function(d){return arguments.length?(c=typeof d=="function"?d:Tr(+d),u):c},u}function Mr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Xd=Symbol("implicit");function ia(){var e=new Uu,t=[],n=[],r=Xd;function i(s){let a=e.get(s);if(a===void 0){if(r!==Xd)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 Uu;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 ia(t,n).unknown(r)},Mr.apply(i,arguments),i}function Ci(){var e=ia().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 h(){var d=t().length,f=i<r,p=f?i:r,m=f?r:i;s=(m-p)/Math.max(1,d-l+c*2),o&&(s=Math.floor(s)),p+=(m-p-s*(d-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var g=l0(d).map(function(v){return p+s*v});return n(f?g.reverse():g)}return e.domain=function(d){return arguments.length?(t(d),h()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(d){return arguments.length?(o=!!d,h()):o},e.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),h()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),h()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,h()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),h()):u},e.copy=function(){return Ci(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Mr.apply(h(),arguments)}function t_(e){return function(){return e}}function e_(e){return+e}var Zd=[0,1];function Cr(e){return e}function _l(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:t_(isNaN(t)?NaN:.5)}function n_(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function r_(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=_l(i,r),s=n(a,s)):(r=_l(r,i),s=n(s,a)),function(o){return s(r(o))}}function i_(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]=_l(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=fo(e,o,1,r)-1;return s[l](i[l](o))}}function El(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Kd(){var e=Zd,t=Zd,n=ci,r,i,s,a=Cr,o,l,c;function u(){var d=Math.min(e.length,t.length);return a!==Cr&&(a=n_(e[0],e[d-1])),o=d>2?i_:r_,l=c=null,h}function h(d){return d==null||isNaN(d=+d)?s:(l||(l=o(e.map(r),t,n)))(r(a(d)))}return h.invert=function(d){return a(i((c||(c=o(t,e.map(r),xe)))(d)))},h.domain=function(d){return arguments.length?(e=Array.from(d,e_),u()):e.slice()},h.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},h.rangeRound=function(d){return t=Array.from(d),n=vh,u()},h.clamp=function(d){return arguments.length?(a=d?!0:Cr,u()):a!==Cr},h.interpolate=function(d){return arguments.length?(n=d,u()):n},h.unknown=function(d){return arguments.length?(s=d,h):s},function(d,f){return r=d,i=f,u()}}function Qd(){return Kd()(Cr,Cr)}function s_(e,t,n,r){var i=go(e,t,n),s;switch(r=pi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=ix(i,a))&&(r.precision=s),Yh(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=sx(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=rx(i))&&(r.precision=s-(r.type==="%")*2);break}}return Xo(r)}function Jd(e){var t=e.domain;return e.ticks=function(n){var r=t();return ps(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return s_(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=gr(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 Be(){var e=Qd();return e.copy=function(){return El(e,Be())},Mr.apply(e,arguments),Jd(e)}function tf(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 ef(e){return Math.log(e)}function nf(e){return Math.exp(e)}function a_(e){return-Math.log(-e)}function o_(e){return-Math.exp(-e)}function l_(e){return isFinite(e)?+("1e"+e):e<0?0:e}function c_(e){return e===10?l_:e===Math.E?Math.exp:t=>Math.pow(e,t)}function u_(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 rf(e){return(t,n)=>-e(-t,n)}function h_(e){const t=e(ef,nf),n=t.domain;let r=10,i,s;function a(){return i=u_(r),s=c_(r),n()[0]<0?(i=rf(i),s=rf(s),e(a_,o_)):e(ef,nf),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 h=u<c;h&&([c,u]=[u,c]);let d=i(c),f=i(u),p,m;const g=o==null?10:+o;let v=[];if(!(r%1)&&f-d<g){if(d=Math.floor(d),f=Math.ceil(f),c>0){for(;d<=f;++d)for(p=1;p<r;++p)if(m=d<0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}}else for(;d<=f;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}v.length*2<g&&(v=ps(c,u,g))}else v=ps(d,f,Math.min(f-d,g)).map(s);return h?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=pi(l)).precision==null&&(l.trim=!0),l=Xo(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let h=u/s(Math.round(i(u)));return h*r<r-.5&&(h*=r),h<=c?l(u):""}},t.nice=()=>n(tf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function sf(){const e=h_(Kd()).domain([1,10]);return e.copy=()=>El(e,sf()).base(e.base()),Mr.apply(e,arguments),e}function Sl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[fo(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 Sl().domain([e,t]).range(i).unknown(s)},Mr.apply(Jd(a),arguments)}const Ol=new Date,Tl=new Date;function Zt(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=>Zt(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)=>(Ol.setTime(+s),Tl.setTime(+a),e(Ol),e(Tl),Math.floor(n(Ol,Tl))),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 sa=Zt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);sa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Zt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):sa),sa.range;const hn=1e3,Ce=hn*60,dn=Ce*60,fn=dn*24,Ml=fn*7,af=fn*30,Cl=fn*365,$r=Zt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*hn)},(e,t)=>(t-e)/hn,e=>e.getUTCSeconds());$r.range;const $l=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getMinutes());$l.range,Zt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getUTCMinutes()).range;const Al=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn-e.getMinutes()*Ce)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getHours());Al.range,Zt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getUTCHours()).range;const $i=Zt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ce)/fn,e=>e.getDate()-1);$i.range;const Ll=Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fn,e=>e.getUTCDate()-1);Ll.range,Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fn,e=>Math.floor(e/fn)).range;function Zn(e){return Zt(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())*Ce)/Ml)}const aa=Zn(0),oa=Zn(1),d_=Zn(2),f_=Zn(3),Ar=Zn(4),p_=Zn(5),g_=Zn(6);aa.range,oa.range,d_.range,f_.range,Ar.range,p_.range,g_.range;function Kn(e){return Zt(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)/Ml)}const of=Kn(0),la=Kn(1),m_=Kn(2),v_=Kn(3),Lr=Kn(4),y_=Kn(5),b_=Kn(6);of.range,la.range,m_.range,v_.range,Lr.range,y_.range,b_.range;const kl=Zt(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());kl.range,Zt(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 pn=Zt(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());pn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(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)}),pn.range;const Qn=Zt(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());Qn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(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)}),Qn.range;function x_(e,t,n,r,i,s){const a=[[$r,1,hn],[$r,5,5*hn],[$r,15,15*hn],[$r,30,30*hn],[s,1,Ce],[s,5,5*Ce],[s,15,15*Ce],[s,30,30*Ce],[i,1,dn],[i,3,3*dn],[i,6,6*dn],[i,12,12*dn],[r,1,fn],[r,2,2*fn],[n,1,Ml],[t,1,af],[t,3,3*af],[e,1,Cl]];function o(c,u,h){const d=u<c;d&&([c,u]=[u,c]);const f=h&&typeof h.range=="function"?h:l(c,u,h),p=f?f.range(c,+u+1):[];return d?p.reverse():p}function l(c,u,h){const d=Math.abs(u-c)/h,f=ho(([,,g])=>g).right(a,d);if(f===a.length)return e.every(go(c/Cl,u/Cl,h));if(f===0)return sa.every(Math.max(go(c,u,h),1));const[p,m]=a[d/a[f-1][2]<a[f][2]/d?f-1:f];return p.every(m)}return[o,l]}const[w_,__]=x_(pn,kl,aa,$i,Al,$l);function Dl(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 Rl(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 Ai(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function E_(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=Li(i),u=ki(i),h=Li(s),d=ki(s),f=Li(a),p=ki(a),m=Li(o),g=ki(o),v=Li(l),y=ki(l),b={a:U,A:I,b:B,B:j,c:null,d:ff,e:ff,f:W_,g:nE,G:iE,H:G_,I:z_,j:j_,L:pf,m:q_,M:Y_,p:Y,q:et,Q:xf,s:wf,S:X_,u:Z_,U:K_,V:Q_,w:J_,W:tE,x:null,X:null,y:eE,Y:rE,Z:sE,"%":bf},S={a:pt,A:z,b:K,B:ht,c:null,d:mf,e:mf,f:cE,g:bE,G:wE,H:aE,I:oE,j:lE,L:vf,m:uE,M:hE,p:it,q:Mt,Q:xf,s:wf,S:dE,u:fE,U:pE,V:gE,w:mE,W:vE,x:null,X:null,y:yE,Y:xE,Z:_E,"%":bf},_={a:L,A:C,b:V,B:M,c:A,d:hf,e:hf,f:B_,g:uf,G:cf,H:df,I:df,j:I_,L:U_,m:R_,M:N_,p:N,q:D_,Q:H_,s:F_,S:P_,u:C_,U:$_,V:A_,w:M_,W:L_,x:w,X:P,y:uf,Y:cf,Z:k_,"%":V_};b.x=E(n,b),b.X=E(r,b),b.c=E(t,b),S.x=E(n,S),S.X=E(r,S),S.c=E(t,S);function E(W,J){return function(ct){var F=[],Ut=-1,bt=0,zt=W.length,jt,nt,It;for(ct instanceof Date||(ct=new Date(+ct));++Ut<zt;)W.charCodeAt(Ut)===37&&(F.push(W.slice(bt,Ut)),(nt=lf[jt=W.charAt(++Ut)])!=null?jt=W.charAt(++Ut):nt=jt==="e"?" ":"0",(It=J[jt])&&(jt=It(ct,nt)),F.push(jt),bt=Ut+1);return F.push(W.slice(bt,Ut)),F.join("")}}function T(W,J){return function(ct){var F=Ai(1900,void 0,1),Ut=D(F,W,ct+="",0),bt,zt;if(Ut!=ct.length)return null;if("Q"in F)return new Date(F.Q);if("s"in F)return new Date(F.s*1e3+("L"in F?F.L:0));if(J&&!("Z"in F)&&(F.Z=0),"p"in F&&(F.H=F.H%12+F.p*12),F.m===void 0&&(F.m="q"in F?F.q:0),"V"in F){if(F.V<1||F.V>53)return null;"w"in F||(F.w=1),"Z"in F?(bt=Rl(Ai(F.y,0,1)),zt=bt.getUTCDay(),bt=zt>4||zt===0?la.ceil(bt):la(bt),bt=Ll.offset(bt,(F.V-1)*7),F.y=bt.getUTCFullYear(),F.m=bt.getUTCMonth(),F.d=bt.getUTCDate()+(F.w+6)%7):(bt=Dl(Ai(F.y,0,1)),zt=bt.getDay(),bt=zt>4||zt===0?oa.ceil(bt):oa(bt),bt=$i.offset(bt,(F.V-1)*7),F.y=bt.getFullYear(),F.m=bt.getMonth(),F.d=bt.getDate()+(F.w+6)%7)}else("W"in F||"U"in F)&&("w"in F||(F.w="u"in F?F.u%7:"W"in F?1:0),zt="Z"in F?Rl(Ai(F.y,0,1)).getUTCDay():Dl(Ai(F.y,0,1)).getDay(),F.m=0,F.d="W"in F?(F.w+6)%7+F.W*7-(zt+5)%7:F.w+F.U*7-(zt+6)%7);return"Z"in F?(F.H+=F.Z/100|0,F.M+=F.Z%100,Rl(F)):Dl(F)}}function D(W,J,ct,F){for(var Ut=0,bt=J.length,zt=ct.length,jt,nt;Ut<bt;){if(F>=zt)return-1;if(jt=J.charCodeAt(Ut++),jt===37){if(jt=J.charAt(Ut++),nt=_[jt in lf?J.charAt(Ut++):jt],!nt||(F=nt(W,ct,F))<0)return-1}else if(jt!=ct.charCodeAt(F++))return-1}return F}function N(W,J,ct){var F=c.exec(J.slice(ct));return F?(W.p=u.get(F[0].toLowerCase()),ct+F[0].length):-1}function L(W,J,ct){var F=f.exec(J.slice(ct));return F?(W.w=p.get(F[0].toLowerCase()),ct+F[0].length):-1}function C(W,J,ct){var F=h.exec(J.slice(ct));return F?(W.w=d.get(F[0].toLowerCase()),ct+F[0].length):-1}function V(W,J,ct){var F=v.exec(J.slice(ct));return F?(W.m=y.get(F[0].toLowerCase()),ct+F[0].length):-1}function M(W,J,ct){var F=m.exec(J.slice(ct));return F?(W.m=g.get(F[0].toLowerCase()),ct+F[0].length):-1}function A(W,J,ct){return D(W,t,J,ct)}function w(W,J,ct){return D(W,n,J,ct)}function P(W,J,ct){return D(W,r,J,ct)}function U(W){return a[W.getDay()]}function I(W){return s[W.getDay()]}function B(W){return l[W.getMonth()]}function j(W){return o[W.getMonth()]}function Y(W){return i[+(W.getHours()>=12)]}function et(W){return 1+~~(W.getMonth()/3)}function pt(W){return a[W.getUTCDay()]}function z(W){return s[W.getUTCDay()]}function K(W){return l[W.getUTCMonth()]}function ht(W){return o[W.getUTCMonth()]}function it(W){return i[+(W.getUTCHours()>=12)]}function Mt(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var J=E(W+="",b);return J.toString=function(){return W},J},parse:function(W){var J=T(W+="",!1);return J.toString=function(){return W},J},utcFormat:function(W){var J=E(W+="",S);return J.toString=function(){return W},J},utcParse:function(W){var J=T(W+="",!0);return J.toString=function(){return W},J}}}var lf={"-":"",_:" ",0:"0"},Jt=/^\s*\d+/,S_=/^%/,O_=/[\\^$*+?|[\]().{}]/g;function vt(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 T_(e){return e.replace(O_,"\\$&")}function Li(e){return new RegExp("^(?:"+e.map(T_).join("|")+")","i")}function ki(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function M_(e,t,n){var r=Jt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function C_(e,t,n){var r=Jt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function $_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function A_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function L_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function cf(e,t,n){var r=Jt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function uf(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function k_(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 D_(e,t,n){var r=Jt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function R_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function hf(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function I_(e,t,n){var r=Jt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function df(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function N_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function P_(e,t,n){var r=Jt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function U_(e,t,n){var r=Jt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function B_(e,t,n){var r=Jt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function V_(e,t,n){var r=S_.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function H_(e,t,n){var r=Jt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function F_(e,t,n){var r=Jt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ff(e,t){return vt(e.getDate(),t,2)}function G_(e,t){return vt(e.getHours(),t,2)}function z_(e,t){return vt(e.getHours()%12||12,t,2)}function j_(e,t){return vt(1+$i.count(pn(e),e),t,3)}function pf(e,t){return vt(e.getMilliseconds(),t,3)}function W_(e,t){return pf(e,t)+"000"}function q_(e,t){return vt(e.getMonth()+1,t,2)}function Y_(e,t){return vt(e.getMinutes(),t,2)}function X_(e,t){return vt(e.getSeconds(),t,2)}function Z_(e){var t=e.getDay();return t===0?7:t}function K_(e,t){return vt(aa.count(pn(e)-1,e),t,2)}function gf(e){var t=e.getDay();return t>=4||t===0?Ar(e):Ar.ceil(e)}function Q_(e,t){return e=gf(e),vt(Ar.count(pn(e),e)+(pn(e).getDay()===4),t,2)}function J_(e){return e.getDay()}function tE(e,t){return vt(oa.count(pn(e)-1,e),t,2)}function eE(e,t){return vt(e.getFullYear()%100,t,2)}function nE(e,t){return e=gf(e),vt(e.getFullYear()%100,t,2)}function rE(e,t){return vt(e.getFullYear()%1e4,t,4)}function iE(e,t){var n=e.getDay();return e=n>=4||n===0?Ar(e):Ar.ceil(e),vt(e.getFullYear()%1e4,t,4)}function sE(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function mf(e,t){return vt(e.getUTCDate(),t,2)}function aE(e,t){return vt(e.getUTCHours(),t,2)}function oE(e,t){return vt(e.getUTCHours()%12||12,t,2)}function lE(e,t){return vt(1+Ll.count(Qn(e),e),t,3)}function vf(e,t){return vt(e.getUTCMilliseconds(),t,3)}function cE(e,t){return vf(e,t)+"000"}function uE(e,t){return vt(e.getUTCMonth()+1,t,2)}function hE(e,t){return vt(e.getUTCMinutes(),t,2)}function dE(e,t){return vt(e.getUTCSeconds(),t,2)}function fE(e){var t=e.getUTCDay();return t===0?7:t}function pE(e,t){return vt(of.count(Qn(e)-1,e),t,2)}function yf(e){var t=e.getUTCDay();return t>=4||t===0?Lr(e):Lr.ceil(e)}function gE(e,t){return e=yf(e),vt(Lr.count(Qn(e),e)+(Qn(e).getUTCDay()===4),t,2)}function mE(e){return e.getUTCDay()}function vE(e,t){return vt(la.count(Qn(e)-1,e),t,2)}function yE(e,t){return vt(e.getUTCFullYear()%100,t,2)}function bE(e,t){return e=yf(e),vt(e.getUTCFullYear()%100,t,2)}function xE(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function wE(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Lr(e):Lr.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function _E(){return"+0000"}function bf(){return"%"}function xf(e){return+e}function wf(e){return Math.floor(+e/1e3)}var kr,_f;EE({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 EE(e){return kr=E_(e),_f=kr.format,kr.parse,kr.utcFormat,kr.utcParse,kr}function SE(e){return new Date(e)}function OE(e){return e instanceof Date?+e:+new Date(+e)}function Ef(e,t,n,r,i,s,a,o,l,c){var u=Qd(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),S=c("%Y");function _(E){return(l(E)<E?f:o(E)<E?p:a(E)<E?m:s(E)<E?g:r(E)<E?i(E)<E?v:y:n(E)<E?b:S)(E)}return u.invert=function(E){return new Date(h(E))},u.domain=function(E){return arguments.length?d(Array.from(E,OE)):d().map(SE)},u.ticks=function(E){var T=d();return e(T[0],T[T.length-1],E??10)},u.tickFormat=function(E,T){return T==null?_:c(T)},u.nice=function(E){var T=d();return(!E||typeof E.range!="function")&&(E=t(T[0],T[T.length-1],E??10)),E?d(tf(T,E)):u},u.copy=function(){return El(u,Ef(e,t,n,r,i,s,a,o,l,c))},u}function Sf(){return Mr.apply(Ef(w_,__,pn,kl,aa,$i,Al,$l,$r,_f).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ut(e){return function(){return e}}const Of=Math.abs,ae=Math.atan2,Jn=Math.cos,TE=Math.max,Il=Math.min,Ze=Math.sin,Dr=Math.sqrt,oe=1e-12,Di=Math.PI,ca=Di/2,ua=2*Di;function ME(e){return e>1?0:e<-1?Di:Math.acos(e)}function Tf(e){return e>=1?ca:e<=-1?-ca:Math.asin(e)}function ha(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 qo(t)}function CE(e){return e.innerRadius}function $E(e){return e.outerRadius}function AE(e){return e.startAngle}function LE(e){return e.endAngle}function kE(e){return e&&e.padAngle}function DE(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,h=o-s,d=h*l-u*c;if(!(d*d<oe))return d=(u*(t-s)-h*(e-i))/d,[e+d*l,t+d*c]}function da(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Dr(o*o+l*l),u=c*l,h=-c*o,d=e+u,f=t+h,p=n+u,m=r+h,g=(d+p)/2,v=(f+m)/2,y=p-d,b=m-f,S=y*y+b*b,_=i-s,E=d*m-p*f,T=(b<0?-1:1)*Dr(TE(0,_*_*S-E*E)),D=(E*b-y*T)/S,N=(-E*y-b*T)/S,L=(E*b+y*T)/S,C=(-E*y+b*T)/S,V=D-g,M=N-v,A=L-g,w=C-v;return V*V+M*M>A*A+w*w&&(D=L,N=C),{cx:D,cy:N,x01:-u,y01:-h,x11:D*(i/_-1),y11:N*(i/_-1)}}function Ri(){var e=CE,t=$E,n=ut(0),r=null,i=AE,s=LE,a=kE,o=null,l=ha(c);function c(){var u,h,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-ca,m=s.apply(this,arguments)-ca,g=Of(m-p),v=m>p;if(o||(o=u=l()),f<d&&(h=f,f=d,d=h),!(f>oe))o.moveTo(0,0);else if(g>ua-oe)o.moveTo(f*Jn(p),f*Ze(p)),o.arc(0,0,f,p,m,!v),d>oe&&(o.moveTo(d*Jn(m),d*Ze(m)),o.arc(0,0,d,m,p,v));else{var y=p,b=m,S=p,_=m,E=g,T=g,D=a.apply(this,arguments)/2,N=D>oe&&(r?+r.apply(this,arguments):Dr(d*d+f*f)),L=Il(Of(f-d)/2,+n.apply(this,arguments)),C=L,V=L,M,A;if(N>oe){var w=Tf(N/d*Ze(D)),P=Tf(N/f*Ze(D));(E-=w*2)>oe?(w*=v?1:-1,S+=w,_-=w):(E=0,S=_=(p+m)/2),(T-=P*2)>oe?(P*=v?1:-1,y+=P,b-=P):(T=0,y=b=(p+m)/2)}var U=f*Jn(y),I=f*Ze(y),B=d*Jn(_),j=d*Ze(_);if(L>oe){var Y=f*Jn(b),et=f*Ze(b),pt=d*Jn(S),z=d*Ze(S),K;if(g<Di)if(K=DE(U,I,pt,z,Y,et,B,j)){var ht=U-K[0],it=I-K[1],Mt=Y-K[0],W=et-K[1],J=1/Ze(ME((ht*Mt+it*W)/(Dr(ht*ht+it*it)*Dr(Mt*Mt+W*W)))/2),ct=Dr(K[0]*K[0]+K[1]*K[1]);C=Il(L,(d-ct)/(J-1)),V=Il(L,(f-ct)/(J+1))}else C=V=0}T>oe?V>oe?(M=da(pt,z,U,I,f,V,v),A=da(Y,et,B,j,f,V,v),o.moveTo(M.cx+M.x01,M.cy+M.y01),V<L?o.arc(M.cx,M.cy,V,ae(M.y01,M.x01),ae(A.y01,A.x01),!v):(o.arc(M.cx,M.cy,V,ae(M.y01,M.x01),ae(M.y11,M.x11),!v),o.arc(0,0,f,ae(M.cy+M.y11,M.cx+M.x11),ae(A.cy+A.y11,A.cx+A.x11),!v),o.arc(A.cx,A.cy,V,ae(A.y11,A.x11),ae(A.y01,A.x01),!v))):(o.moveTo(U,I),o.arc(0,0,f,y,b,!v)):o.moveTo(U,I),!(d>oe)||!(E>oe)?o.lineTo(B,j):C>oe?(M=da(B,j,Y,et,d,-C,v),A=da(U,I,pt,z,d,-C,v),o.lineTo(M.cx+M.x01,M.cy+M.y01),C<L?o.arc(M.cx,M.cy,C,ae(M.y01,M.x01),ae(A.y01,A.x01),!v):(o.arc(M.cx,M.cy,C,ae(M.y01,M.x01),ae(M.y11,M.x11),!v),o.arc(0,0,d,ae(M.cy+M.y11,M.cx+M.x11),ae(A.cy+A.y11,A.cx+A.x11),v),o.arc(A.cx,A.cy,C,ae(A.y11,A.x11),ae(A.y01,A.x01),!v))):o.arc(0,0,d,_,S,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Di/2;return[Jn(h)*u,Ze(h)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ut(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ut(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ut(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ut(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ut(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ut(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ut(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var RE=Array.prototype.slice;function fa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Mf(e){this._context=e}Mf.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 pa(e){return new Mf(e)}function Nl(e){return e[0]}function Pl(e){return e[1]}function Ii(e,t){var n=ut(!0),r=null,i=pa,s=null,a=ha(o);e=typeof e=="function"?e:e===void 0?Nl:ut(e),t=typeof t=="function"?t:t===void 0?Pl:ut(t);function o(l){var c,u=(l=fa(l)).length,h,d=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(h=l[c],c,l))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,c,l),+t(h,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:ut(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ut(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ut(!!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 Ul(e,t,n){var r=null,i=ut(!0),s=null,a=pa,o=null,l=ha(c);e=typeof e=="function"?e:e===void 0?Nl:ut(+e),t=typeof t=="function"?t:ut(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Pl:ut(+n);function c(h){var d,f,p,m=(h=fa(h)).length,g,v=!1,y,b=new Array(m),S=new Array(m);for(s==null&&(o=a(y=l())),d=0;d<=m;++d){if(!(d<m&&i(g=h[d],d,h))===v)if(v=!v)f=d,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=d-1;p>=f;--p)o.point(b[p],S[p]);o.lineEnd(),o.areaEnd()}v&&(b[d]=+e(g,d,h),S[d]=+t(g,d,h),o.point(r?+r(g,d,h):b[d],n?+n(g,d,h):S[d]))}if(y)return o=null,y+""||null}function u(){return Ii().defined(i).curve(a).context(s)}return c.x=function(h){return arguments.length?(e=typeof h=="function"?h:ut(+h),r=null,c):e},c.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ut(+h),c):e},c.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ut(+h),c):r},c.y=function(h){return arguments.length?(t=typeof h=="function"?h:ut(+h),n=null,c):t},c.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ut(+h),c):t},c.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ut(+h),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(h){return arguments.length?(i=typeof h=="function"?h:ut(!!h),c):i},c.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),c):a},c.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),c):s},c}function IE(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function NE(e){return e}function PE(){var e=NE,t=IE,n=null,r=ut(0),i=ut(ua),s=ut(0);function a(o){var l,c=(o=fa(o)).length,u,h,d=0,f=new Array(c),p=new Array(c),m=+r.apply(this,arguments),g=Math.min(ua,Math.max(-ua,i.apply(this,arguments)-m)),v,y=Math.min(Math.abs(g)/c,s.apply(this,arguments)),b=y*(g<0?-1:1),S;for(l=0;l<c;++l)(S=p[f[l]=l]=+e(o[l],l,o))>0&&(d+=S);for(t!=null?f.sort(function(_,E){return t(p[_],p[E])}):n!=null&&f.sort(function(_,E){return n(o[_],o[E])}),l=0,h=d?(g-c*b)/d:0;l<c;++l,m=v)u=f[l],S=p[u],v=m+(S>0?S*h:0)+b,p[u]={data:o[u],index:l,value:S,startAngle:m,endAngle:v,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ut(+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:ut(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ut(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ut(+o),a):s},a}var UE=$f(pa);function Cf(e){this._curve=e}Cf.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 $f(e){function t(n){return new Cf(e(n))}return t._curve=e,t}function BE(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($f(n)):t()._curve},e}function VE(){return BE(Ii().curve(UE))}class HE{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 FE(e){return new HE(e,!0)}function GE(e){return e.source}function zE(e){return e.target}function jE(e){let t=GE,n=zE,r=Nl,i=Pl,s=null,a=null,o=ha(l);function l(){let c;const u=RE.call(arguments),h=t.apply(this,u),d=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=d,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:ut(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ut(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function WE(){return jE(FE)}function An(){}function ga(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 ma(e){this._context=e}ma.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:ga(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:ga(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qE(e){return new ma(e)}function Af(e){this._context=e}Af.prototype={areaStart:An,areaEnd:An,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:ga(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YE(e){return new Af(e)}function Lf(e){this._context=e}Lf.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:ga(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XE(e){return new Lf(e)}function kf(e,t){this._basis=new ma(e),this._beta=t}kf.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 ZE=function e(t){function n(r){return t===1?new ma(r):new kf(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function va(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 Bl(e,t){this._context=e,this._k=(1-t)/6}Bl.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:va(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:va(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 KE=function e(t){function n(r){return new Bl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Vl(e,t){this._context=e,this._k=(1-t)/6}Vl.prototype={areaStart:An,areaEnd:An,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:va(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 QE=function e(t){function n(r){return new Vl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Hl(e,t){this._context=e,this._k=(1-t)/6}Hl.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:va(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 JE=function e(t){function n(r){return new Hl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Fl(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>oe){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>oe){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 Df(e,t){this._context=e,this._alpha=t}Df.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:Fl(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 tS=function e(t){function n(r){return t?new Df(r,t):new Bl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Rf(e,t){this._context=e,this._alpha=t}Rf.prototype={areaStart:An,areaEnd:An,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:Fl(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 eS=function e(t){function n(r){return t?new Rf(r,t):new Vl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function If(e,t){this._context=e,this._alpha=t}If.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:Fl(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 nS=function e(t){function n(r){return t?new If(r,t):new Hl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Nf(e){this._context=e}Nf.prototype={areaStart:An,areaEnd:An,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 Pf(e){return new Nf(e)}function Uf(e){return e<0?-1:1}function Bf(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(Uf(s)+Uf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Vf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gl(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 ya(e){this._context=e}ya.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:Gl(this,this._t0,Vf(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,Gl(this,Vf(this,n=Bf(this,e,t)),n);break;default:Gl(this,this._t0,n=Bf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Hf(e){this._context=new Ff(e)}(Hf.prototype=Object.create(ya.prototype)).point=function(e,t){ya.prototype.point.call(this,t,e)};function Ff(e){this._context=e}Ff.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 rS(e){return new ya(e)}function iS(e){return new Hf(e)}function Gf(e){this._context=e}Gf.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=zf(e),i=zf(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 zf(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 sS(e){return new Gf(e)}function ba(e,t){this._context=e,this._t=t}ba.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 aS(e){return new ba(e,.5)}function oS(e){return new ba(e,0)}function lS(e){return new ba(e,1)}function jf(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 Wf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function cS(e,t){return e[t]}function uS(e){const t=[];return t.key=e,t}function zl(){var e=ut([]),t=Wf,n=jf,r=cS;function i(s){var a=Array.from(e.apply(this,arguments),uS),o,l=a.length,c=-1,u;for(const h of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(h,a[o].key,c,s)]).data=h;for(o=0,u=fa(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:ut(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ut(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Wf:typeof s=="function"?s:ut(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??jf,i):n},i}function hS(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 Ni(e,t,n){this.k=e,this.x=t,this.y=n}Ni.prototype={constructor:Ni,scale:function(e){return e===1?this:new Ni(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ni(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+")"}},Ni.prototype;function jl(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}function Pi(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&e.formattingValues){var s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{var o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[o]}var c=e.argumentCallback?e.argumentCallback(t):t;return i[c]}}function Ui(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;var a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?fS(o,function(h){return h.test(a)}):dS(o,function(h){return h.test(a)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(a.length);return{value:c,rest:u}}}function dS(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function fS(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function pS(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],s=t.match(e.parsePattern);if(!s)return null;var a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;var o=t.slice(i.length);return{value:a,rest:o}}}function xa(e){"@babel/helpers - typeof";return xa=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},xa(e)}function Kt(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ot(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function yt(e){ot(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||xa(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wa(e,t){ot(2,arguments);var n=yt(e).getTime(),r=Kt(t);return new Date(n+r)}var gS={};function _a(){return gS}function Wl(e){var 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 mS(e){return ot(1,arguments),e instanceof Date||xa(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function vS(e){if(ot(1,arguments),!mS(e)&&typeof e!="number")return!1;var t=yt(e);return!isNaN(Number(t))}function yS(e,t){ot(2,arguments);var n=Kt(t);return wa(e,-n)}var bS=864e5;function xS(e){ot(1,arguments);var t=yt(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=n-r;return Math.floor(i/bS)+1}function Ea(e){ot(1,arguments);var t=1,n=yt(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function qf(e){ot(1,arguments);var t=yt(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=Ea(r),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=Ea(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function wS(e){ot(1,arguments);var t=qf(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Ea(n);return r}var _S=6048e5;function ES(e){ot(1,arguments);var t=yt(e),n=Ea(t).getTime()-wS(t).getTime();return Math.round(n/_S)+1}function Sa(e,t){var n,r,i,s,a,o,l,c;ot(1,arguments);var u=_a(),h=Kt((n=(r=(i=(s=t==null?void 0:t.weekStartsOn)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=yt(e),f=d.getUTCDay(),p=(f<h?7:0)+f-h;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}function Yf(e,t){var n,r,i,s,a,o,l,c;ot(1,arguments);var u=yt(e),h=u.getUTCFullYear(),d=_a(),f=Kt((n=(r=(i=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(h+1,0,f),p.setUTCHours(0,0,0,0);var m=Sa(p,t),g=new Date(0);g.setUTCFullYear(h,0,f),g.setUTCHours(0,0,0,0);var v=Sa(g,t);return u.getTime()>=m.getTime()?h+1:u.getTime()>=v.getTime()?h:h-1}function SS(e,t){var n,r,i,s,a,o,l,c;ot(1,arguments);var u=_a(),h=Kt((n=(r=(i=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=Yf(e,t),f=new Date(0);f.setUTCFullYear(d,0,h),f.setUTCHours(0,0,0,0);var p=Sa(f,t);return p}var OS=6048e5;function TS(e,t){ot(1,arguments);var n=yt(e),r=Sa(n,t).getTime()-SS(n,t).getTime();return Math.round(r/OS)+1}function St(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var MS={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return St(t==="yy"?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):St(n+1,2)},d:function(e,t){return St(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/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:function(e,t){return St(e.getUTCHours()%12||12,t.length)},H:function(e,t){return St(e.getUTCHours(),t.length)},m:function(e,t){return St(e.getUTCMinutes(),t.length)},s:function(e,t){return St(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,n-3));return St(i,t.length)}};const Ln=MS;var Rr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},CS={G:function(e,t,n){var r=e.getUTCFullYear()>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"){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Ln.y(e,t)},Y:function(e,t,n,r){var i=Yf(e,r),s=i>0?i:1-i;if(t==="YY"){var a=s%100;return St(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):St(s,t.length)},R:function(e,t){var n=qf(e);return St(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return St(n,t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return St(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){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return St(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){var r=e.getUTCMonth();switch(t){case"M":case"MM":return Ln.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){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return St(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){var i=TS(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):St(i,t.length)},I:function(e,t,n){var r=ES(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):St(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Ln.d(e,t)},D:function(e,t,n){var r=xS(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):St(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();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){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return St(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){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return St(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){var r=e.getUTCDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return St(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){var r=e.getUTCHours(),i=r/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r=e.getUTCHours(),i;switch(r===12?i=Rr.noon:r===0?i=Rr.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){var r=e.getUTCHours(),i;switch(r>=17?i=Rr.evening:r>=12?i=Rr.afternoon:r>=4?i=Rr.morning:i=Rr.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"){var r=e.getUTCHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ln.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Ln.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Ln.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Ln.s(e,t)},S:function(e,t){return Ln.S(e,t)},X:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Zf(s);case"XXXX":case"XX":return tr(s);case"XXXXX":case"XXX":default:return tr(s,":")}},x:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"x":return Zf(s);case"xxxx":case"xx":return tr(s);case"xxxxx":case"xxx":default:return tr(s,":")}},O:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xf(s,":");case"OOOO":default:return"GMT"+tr(s,":")}},z:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xf(s,":");case"zzzz":default:return"GMT"+tr(s,":")}},t:function(e,t,n,r){var i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return St(s,t.length)},T:function(e,t,n,r){var i=r._originalDate||e,s=i.getTime();return St(s,t.length)}};function Xf(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;if(s===0)return n+String(i);var a=t||"";return n+String(i)+a+St(s,2)}function Zf(e,t){if(e%60===0){var n=e>0?"-":"+";return n+St(Math.abs(e)/60,2)}return tr(e,t)}function tr(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e),s=St(Math.floor(i/60),2),a=St(i%60,2);return r+s+n+a}const $S=CS;var Kf=function(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"})}},Qf=function(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"})}},AS=function(e,t){var n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Kf(e,t);var 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}}",Kf(r,t)).replace("{{time}}",Qf(i,t))},LS={p:Qf,P:AS};const kS=LS;var DS=["D","DD"],RS=["YY","YYYY"];function IS(e){return DS.indexOf(e)!==-1}function NS(e){return RS.indexOf(e)!==-1}function Jf(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(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 `".concat(t,"`) for formatting years to the input `").concat(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 `".concat(t,"`) for formatting days of the month to the input `").concat(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 `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var PS={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"}},US=function(e,t,n){var r,i=PS[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};const BS=US;var VS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},HS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},FS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GS={date:jl({formats:VS,defaultWidth:"full"}),time:jl({formats:HS,defaultWidth:"full"}),dateTime:jl({formats:FS,defaultWidth:"full"})};const zS=GS;var jS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WS=function(e,t,n,r){return jS[e]};const qS=WS;var YS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},XS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ZS={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"]},KS={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"]},QS={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"}},JS={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"}},tO=function(e,t){var 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"},eO={ordinalNumber:tO,era:Pi({values:YS,defaultWidth:"wide"}),quarter:Pi({values:XS,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Pi({values:ZS,defaultWidth:"wide"}),day:Pi({values:KS,defaultWidth:"wide"}),dayPeriod:Pi({values:QS,defaultWidth:"wide",formattingValues:JS,defaultFormattingWidth:"wide"})};const nO=eO;var rO=/^(\d+)(th|st|nd|rd)?/i,iO=/\d+/i,sO={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},aO={any:[/^b/i,/^(a|c)/i]},oO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lO={any:[/1/i,/2/i,/3/i,/4/i]},cO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},uO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},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},dO={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},pO={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}},gO={ordinalNumber:pS({matchPattern:rO,parsePattern:iO,valueCallback:function(e){return parseInt(e,10)}}),era:Ui({matchPatterns:sO,defaultMatchWidth:"wide",parsePatterns:aO,defaultParseWidth:"any"}),quarter:Ui({matchPatterns:oO,defaultMatchWidth:"wide",parsePatterns:lO,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Ui({matchPatterns:cO,defaultMatchWidth:"wide",parsePatterns:uO,defaultParseWidth:"any"}),day:Ui({matchPatterns:hO,defaultMatchWidth:"wide",parsePatterns:dO,defaultParseWidth:"any"}),dayPeriod:Ui({matchPatterns:fO,defaultMatchWidth:"any",parsePatterns:pO,defaultParseWidth:"any"})},mO={code:"en-US",formatDistance:BS,formatLong:zS,formatRelative:qS,localize:nO,match:gO,options:{weekStartsOn:0,firstWeekContainsDate:1}};const tp=mO;var vO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bO=/^'([^]*?)'?$/,xO=/''/g,wO=/[a-zA-Z]/;function Ir(e,t,n){var r,i,s,a,o,l,c,u,h,d,f,p,m,g,v,y,b,S;ot(2,arguments);var _=String(t),E=_a(),T=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:E.locale)!==null&&r!==void 0?r:tp,D=Kt((s=(a=(o=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:E.firstWeekContainsDate)!==null&&a!==void 0?a:(h=E.locale)===null||h===void 0||(d=h.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(D>=1&&D<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=Kt((f=(p=(m=(g=n==null?void 0:n.weekStartsOn)!==null&&g!==void 0?g:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&m!==void 0?m:E.weekStartsOn)!==null&&p!==void 0?p:(b=E.locale)===null||b===void 0||(S=b.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&f!==void 0?f:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var L=yt(e);if(!vS(L))throw new RangeError("Invalid time value");var C=Wl(L),V=yS(L,C),M={firstWeekContainsDate:D,weekStartsOn:N,locale:T,_originalDate:L},A=_.match(yO).map(function(w){var P=w[0];if(P==="p"||P==="P"){var U=kS[P];return U(w,T.formatLong)}return w}).join("").match(vO).map(function(w){if(w==="''")return"'";var P=w[0];if(P==="'")return _O(w);var U=$S[P];if(U)return!(n!=null&&n.useAdditionalWeekYearTokens)&&NS(w)&&Jf(w,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&IS(w)&&Jf(w,t,String(e)),U(V,w,T.localize,M);if(P.match(wO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+P+"`");return w}).join("");return A}function _O(e){var t=e.match(bO);return t?t[1].replace(xO,"'"):e}var EO=typeof global=="object"&&global&&global.Object===Object&&global;const ep=EO;var SO=typeof self=="object"&&self&&self.Object===Object&&self,OO=ep||SO||Function("return this")();const Ve=OO;var TO=Ve.Symbol;const $e=TO;var np=Object.prototype,MO=np.hasOwnProperty,CO=np.toString,Bi=$e?$e.toStringTag:void 0;function $O(e){var t=MO.call(e,Bi),n=e[Bi];try{e[Bi]=void 0;var r=!0}catch{}var i=CO.call(e);return r&&(t?e[Bi]=n:delete e[Bi]),i}var AO=Object.prototype,LO=AO.toString;function kO(e){return LO.call(e)}var DO="[object Null]",RO="[object Undefined]",rp=$e?$e.toStringTag:void 0;function er(e){return e==null?e===void 0?RO:DO:rp&&rp in Object(e)?$O(e):kO(e)}function Ke(e){return e!=null&&typeof e=="object"}var IO="[object Symbol]";function Oa(e){return typeof e=="symbol"||Ke(e)&&er(e)==IO}function ip(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 NO=Array.isArray;const te=NO;var PO=1/0,sp=$e?$e.prototype:void 0,ap=sp?sp.toString:void 0;function op(e){if(typeof e=="string")return e;if(te(e))return ip(e,op)+"";if(Oa(e))return ap?ap.call(e):"";var t=e+"";return t=="0"&&1/e==-PO?"-0":t}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function ql(e){return e}var UO="[object AsyncFunction]",BO="[object Function]",VO="[object GeneratorFunction]",HO="[object Proxy]";function Yl(e){if(!Ae(e))return!1;var t=er(e);return t==BO||t==VO||t==UO||t==HO}var FO=Ve["__core-js_shared__"];const Xl=FO;var lp=function(){var e=/[^.]+$/.exec(Xl&&Xl.keys&&Xl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function GO(e){return!!lp&&lp in e}var zO=Function.prototype,jO=zO.toString;function nr(e){if(e!=null){try{return jO.call(e)}catch{}try{return e+""}catch{}}return""}var WO=/[\\^$.*+?()[\]{}|]/g,qO=/^\[object .+?Constructor\]$/,YO=Function.prototype,XO=Object.prototype,ZO=YO.toString,KO=XO.hasOwnProperty,QO=RegExp("^"+ZO.call(KO).replace(WO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function JO(e){if(!Ae(e)||GO(e))return!1;var t=Yl(e)?QO:qO;return t.test(nr(e))}function tT(e,t){return e==null?void 0:e[t]}function rr(e,t){var n=tT(e,t);return JO(n)?n:void 0}var eT=rr(Ve,"WeakMap");const Zl=eT;var cp=Object.create,nT=function(){function e(){}return function(t){if(!Ae(t))return{};if(cp)return cp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const rT=nT;function iT(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 sT(){}function up(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var aT=800,oT=16,lT=Date.now;function cT(e){var t=0,n=0;return function(){var r=lT(),i=oT-(r-n);if(n=r,i>0){if(++t>=aT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function uT(e){return function(){return e}}var hT=function(){try{var e=rr(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Ta=hT;var dT=Ta?function(e,t){return Ta(e,"toString",{configurable:!0,enumerable:!1,value:uT(t),writable:!0})}:ql,fT=cT(dT);const pT=fT;function gT(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function mT(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 vT(e){return e!==e}function yT(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function bT(e,t,n){return t===t?yT(e,t,n):mT(e,vT,n)}function xT(e,t){var n=e==null?0:e.length;return!!n&&bT(e,t,0)>-1}var wT=9007199254740991,_T=/^(?:0|[1-9]\d*)$/;function Kl(e,t){var n=typeof e;return t=t??wT,!!t&&(n=="number"||n!="symbol"&&_T.test(e))&&e>-1&&e%1==0&&e<t}function Ma(e,t,n){t=="__proto__"&&Ta?Ta(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Vi(e,t){return e===t||e!==e&&t!==t}var ET=Object.prototype,ST=ET.hasOwnProperty;function hp(e,t,n){var r=e[t];(!(ST.call(e,t)&&Vi(r,n))||n===void 0&&!(t in e))&&Ma(e,t,n)}function Hi(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?Ma(n,o,l):hp(n,o,l)}return n}var dp=Math.max;function OT(e,t,n){return t=dp(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=dp(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),iT(e,this,o)}}function fp(e,t){return pT(OT(e,t,ql),e+"")}var TT=9007199254740991;function Ql(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=TT}function ir(e){return e!=null&&Ql(e.length)&&!Yl(e)}function pp(e,t,n){if(!Ae(n))return!1;var r=typeof t;return(r=="number"?ir(n)&&Kl(t,n.length):r=="string"&&t in n)?Vi(n[t],e):!1}function MT(e){return fp(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&&pp(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 CT=Object.prototype;function Ca(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||CT;return e===n}function $T(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var AT="[object Arguments]";function gp(e){return Ke(e)&&er(e)==AT}var mp=Object.prototype,LT=mp.hasOwnProperty,kT=mp.propertyIsEnumerable,DT=gp(function(){return arguments}())?gp:function(e){return Ke(e)&<.call(e,"callee")&&!kT.call(e,"callee")};const Nr=DT;function RT(){return!1}var vp=typeof X=="object"&&X&&!X.nodeType&&X,yp=vp&&typeof module=="object"&&module&&!module.nodeType&&module,IT=yp&&yp.exports===vp,bp=IT?Ve.Buffer:void 0,NT=bp?bp.isBuffer:void 0,PT=NT||RT;const Pr=PT;var UT="[object Arguments]",BT="[object Array]",VT="[object Boolean]",HT="[object Date]",FT="[object Error]",GT="[object Function]",zT="[object Map]",jT="[object Number]",WT="[object Object]",qT="[object RegExp]",YT="[object Set]",XT="[object String]",ZT="[object WeakMap]",KT="[object ArrayBuffer]",QT="[object DataView]",JT="[object Float32Array]",tM="[object Float64Array]",eM="[object Int8Array]",nM="[object Int16Array]",rM="[object Int32Array]",iM="[object Uint8Array]",sM="[object Uint8ClampedArray]",aM="[object Uint16Array]",oM="[object Uint32Array]",Dt={};Dt[JT]=Dt[tM]=Dt[eM]=Dt[nM]=Dt[rM]=Dt[iM]=Dt[sM]=Dt[aM]=Dt[oM]=!0,Dt[UT]=Dt[BT]=Dt[KT]=Dt[VT]=Dt[QT]=Dt[HT]=Dt[FT]=Dt[GT]=Dt[zT]=Dt[jT]=Dt[WT]=Dt[qT]=Dt[YT]=Dt[XT]=Dt[ZT]=!1;function lM(e){return Ke(e)&&Ql(e.length)&&!!Dt[er(e)]}function Jl(e){return function(t){return e(t)}}var xp=typeof X=="object"&&X&&!X.nodeType&&X,Fi=xp&&typeof module=="object"&&module&&!module.nodeType&&module,cM=Fi&&Fi.exports===xp,tc=cM&&ep.process,uM=function(){try{var e=Fi&&Fi.require&&Fi.require("util").types;return e||tc&&tc.binding&&tc.binding("util")}catch{}}();const Ur=uM;var wp=Ur&&Ur.isTypedArray,hM=wp?Jl(wp):lM;const $a=hM;var dM=Object.prototype,fM=dM.hasOwnProperty;function _p(e,t){var n=te(e),r=!n&&Nr(e),i=!n&&!r&&Pr(e),s=!n&&!r&&!i&&$a(e),a=n||r||i||s,o=a?$T(e.length,String):[],l=o.length;for(var c in e)(t||fM.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Kl(c,l)))&&o.push(c);return o}function Ep(e,t){return function(n){return e(t(n))}}var pM=Ep(Object.keys,Object);const gM=pM;var mM=Object.prototype,vM=mM.hasOwnProperty;function Sp(e){if(!Ca(e))return gM(e);var t=[];for(var n in Object(e))vM.call(e,n)&&n!="constructor"&&t.push(n);return t}function Gi(e){return ir(e)?_p(e):Sp(e)}function yM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var bM=Object.prototype,xM=bM.hasOwnProperty;function wM(e){if(!Ae(e))return yM(e);var t=Ca(e),n=[];for(var r in e)r=="constructor"&&(t||!xM.call(e,r))||n.push(r);return n}function zi(e){return ir(e)?_p(e,!0):wM(e)}var _M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,EM=/^\w*$/;function ec(e,t){if(te(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Oa(e)?!0:EM.test(e)||!_M.test(e)||t!=null&&e in Object(t)}var SM=rr(Object,"create");const ji=SM;function OM(){this.__data__=ji?ji(null):{},this.size=0}function TM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var MM="__lodash_hash_undefined__",CM=Object.prototype,$M=CM.hasOwnProperty;function AM(e){var t=this.__data__;if(ji){var n=t[e];return n===MM?void 0:n}return $M.call(t,e)?t[e]:void 0}var LM=Object.prototype,kM=LM.hasOwnProperty;function DM(e){var t=this.__data__;return ji?t[e]!==void 0:kM.call(t,e)}var RM="__lodash_hash_undefined__";function IM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ji&&t===void 0?RM:t,this}function sr(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])}}sr.prototype.clear=OM,sr.prototype.delete=TM,sr.prototype.get=AM,sr.prototype.has=DM,sr.prototype.set=IM;function NM(){this.__data__=[],this.size=0}function Aa(e,t){for(var n=e.length;n--;)if(Vi(e[n][0],t))return n;return-1}var PM=Array.prototype,UM=PM.splice;function BM(e){var t=this.__data__,n=Aa(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():UM.call(t,n,1),--this.size,!0}function VM(e){var t=this.__data__,n=Aa(t,e);return n<0?void 0:t[n][1]}function HM(e){return Aa(this.__data__,e)>-1}function FM(e,t){var n=this.__data__,r=Aa(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function gn(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])}}gn.prototype.clear=NM,gn.prototype.delete=BM,gn.prototype.get=VM,gn.prototype.has=HM,gn.prototype.set=FM;var GM=rr(Ve,"Map");const Wi=GM;function zM(){this.size=0,this.__data__={hash:new sr,map:new(Wi||gn),string:new sr}}function jM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function La(e,t){var n=e.__data__;return jM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function WM(e){var t=La(this,e).delete(e);return this.size-=t?1:0,t}function qM(e){return La(this,e).get(e)}function YM(e){return La(this,e).has(e)}function XM(e,t){var n=La(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,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=zM,mn.prototype.delete=WM,mn.prototype.get=qM,mn.prototype.has=YM,mn.prototype.set=XM;var ZM="Expected a function";function nc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ZM);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(nc.Cache||mn),n}nc.Cache=mn;var KM=500;function QM(e){var t=nc(e,function(r){return n.size===KM&&n.clear(),r}),n=t.cache;return t}var JM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tC=/\\(\\)?/g,eC=QM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(JM,function(n,r,i,s){t.push(i?s.replace(tC,"$1"):r||n)}),t});const nC=eC;function qi(e){return e==null?"":op(e)}function Op(e,t){return te(e)?e:ec(e,t)?[e]:nC(qi(e))}var rC=1/0;function ka(e){if(typeof e=="string"||Oa(e))return e;var t=e+"";return t=="0"&&1/e==-rC?"-0":t}function Tp(e,t){t=Op(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ka(t[n++])];return n&&n==r?e:void 0}function At(e,t,n){var r=e==null?void 0:Tp(e,t);return r===void 0?n:r}function rc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Mp=$e?$e.isConcatSpreadable:void 0;function iC(e){return te(e)||Nr(e)||!!(Mp&&e&&e[Mp])}function Da(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=iC),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Da(o,t-1,n,r,i):rc(i,o):r||(i[i.length]=o)}return i}var sC=Ep(Object.getPrototypeOf,Object);const ic=sC;var aC="[object Object]",oC=Function.prototype,lC=Object.prototype,Cp=oC.toString,cC=lC.hasOwnProperty,uC=Cp.call(Object);function hC(e){if(!Ke(e)||er(e)!=aC)return!1;var t=ic(e);if(t===null)return!0;var n=cC.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Cp.call(n)==uC}function dC(){this.__data__=new gn,this.size=0}function fC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function pC(e){return this.__data__.get(e)}function gC(e){return this.__data__.has(e)}var mC=200;function vC(e,t){var n=this.__data__;if(n instanceof gn){var r=n.__data__;if(!Wi||r.length<mC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mn(r)}return n.set(e,t),this.size=n.size,this}function He(e){var t=this.__data__=new gn(e);this.size=t.size}He.prototype.clear=dC,He.prototype.delete=fC,He.prototype.get=pC,He.prototype.has=gC,He.prototype.set=vC;function yC(e,t){return e&&Hi(t,Gi(t),e)}function bC(e,t){return e&&Hi(t,zi(t),e)}var $p=typeof X=="object"&&X&&!X.nodeType&&X,Ap=$p&&typeof module=="object"&&module&&!module.nodeType&&module,xC=Ap&&Ap.exports===$p,Lp=xC?Ve.Buffer:void 0,kp=Lp?Lp.allocUnsafe:void 0;function Dp(e,t){if(t)return e.slice();var n=e.length,r=kp?kp(n):new e.constructor(n);return e.copy(r),r}function wC(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 Rp(){return[]}var _C=Object.prototype,EC=_C.propertyIsEnumerable,Ip=Object.getOwnPropertySymbols,SC=Ip?function(e){return e==null?[]:(e=Object(e),wC(Ip(e),function(t){return EC.call(e,t)}))}:Rp;const sc=SC;function OC(e,t){return Hi(e,sc(e),t)}var TC=Object.getOwnPropertySymbols,MC=TC?function(e){for(var t=[];e;)rc(t,sc(e)),e=ic(e);return t}:Rp;const Np=MC;function CC(e,t){return Hi(e,Np(e),t)}function Pp(e,t,n){var r=t(e);return te(e)?r:rc(r,n(e))}function ac(e){return Pp(e,Gi,sc)}function $C(e){return Pp(e,zi,Np)}var AC=rr(Ve,"DataView");const oc=AC;var LC=rr(Ve,"Promise");const lc=LC;var kC=rr(Ve,"Set");const Br=kC;var Up="[object Map]",DC="[object Object]",Bp="[object Promise]",Vp="[object Set]",Hp="[object WeakMap]",Fp="[object DataView]",RC=nr(oc),IC=nr(Wi),NC=nr(lc),PC=nr(Br),UC=nr(Zl),ar=er;(oc&&ar(new oc(new ArrayBuffer(1)))!=Fp||Wi&&ar(new Wi)!=Up||lc&&ar(lc.resolve())!=Bp||Br&&ar(new Br)!=Vp||Zl&&ar(new Zl)!=Hp)&&(ar=function(e){var t=er(e),n=t==DC?e.constructor:void 0,r=n?nr(n):"";if(r)switch(r){case RC:return Fp;case IC:return Up;case NC:return Bp;case PC:return Vp;case UC:return Hp}return t});const Vr=ar;var BC=Object.prototype,VC=BC.hasOwnProperty;function HC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&VC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var FC=Ve.Uint8Array;const Ra=FC;function cc(e){var t=new e.constructor(e.byteLength);return new Ra(t).set(new Ra(e)),t}function GC(e,t){var n=t?cc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var zC=/\w*$/;function jC(e){var t=new e.constructor(e.source,zC.exec(e));return t.lastIndex=e.lastIndex,t}var Gp=$e?$e.prototype:void 0,zp=Gp?Gp.valueOf:void 0;function WC(e){return zp?Object(zp.call(e)):{}}function jp(e,t){var n=t?cc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var qC="[object Boolean]",YC="[object Date]",XC="[object Map]",ZC="[object Number]",KC="[object RegExp]",QC="[object Set]",JC="[object String]",t$="[object Symbol]",e$="[object ArrayBuffer]",n$="[object DataView]",r$="[object Float32Array]",i$="[object Float64Array]",s$="[object Int8Array]",a$="[object Int16Array]",o$="[object Int32Array]",l$="[object Uint8Array]",c$="[object Uint8ClampedArray]",u$="[object Uint16Array]",h$="[object Uint32Array]";function d$(e,t,n){var r=e.constructor;switch(t){case e$:return cc(e);case qC:case YC:return new r(+e);case n$:return GC(e,n);case r$:case i$:case s$:case a$:case o$:case l$:case c$:case u$:case h$:return jp(e,n);case XC:return new r;case ZC:case JC:return new r(e);case KC:return jC(e);case QC:return new r;case t$:return WC(e)}}function Wp(e){return typeof e.constructor=="function"&&!Ca(e)?rT(ic(e)):{}}var f$="[object Map]";function p$(e){return Ke(e)&&Vr(e)==f$}var qp=Ur&&Ur.isMap,g$=qp?Jl(qp):p$;const m$=g$;var v$="[object Set]";function y$(e){return Ke(e)&&Vr(e)==v$}var Yp=Ur&&Ur.isSet,b$=Yp?Jl(Yp):y$;const x$=b$;var w$=1,_$=2,E$=4,Xp="[object Arguments]",S$="[object Array]",O$="[object Boolean]",T$="[object Date]",M$="[object Error]",Zp="[object Function]",C$="[object GeneratorFunction]",$$="[object Map]",A$="[object Number]",Kp="[object Object]",L$="[object RegExp]",k$="[object Set]",D$="[object String]",R$="[object Symbol]",I$="[object WeakMap]",N$="[object ArrayBuffer]",P$="[object DataView]",U$="[object Float32Array]",B$="[object Float64Array]",V$="[object Int8Array]",H$="[object Int16Array]",F$="[object Int32Array]",G$="[object Uint8Array]",z$="[object Uint8ClampedArray]",j$="[object Uint16Array]",W$="[object Uint32Array]",Lt={};Lt[Xp]=Lt[S$]=Lt[N$]=Lt[P$]=Lt[O$]=Lt[T$]=Lt[U$]=Lt[B$]=Lt[V$]=Lt[H$]=Lt[F$]=Lt[$$]=Lt[A$]=Lt[Kp]=Lt[L$]=Lt[k$]=Lt[D$]=Lt[R$]=Lt[G$]=Lt[z$]=Lt[j$]=Lt[W$]=!0,Lt[M$]=Lt[Zp]=Lt[I$]=!1;function Ia(e,t,n,r,i,s){var a,o=t&w$,l=t&_$,c=t&E$;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ae(e))return e;var u=te(e);if(u){if(a=HC(e),!o)return up(e,a)}else{var h=Vr(e),d=h==Zp||h==C$;if(Pr(e))return Dp(e,o);if(h==Kp||h==Xp||d&&!i){if(a=l||d?{}:Wp(e),!o)return l?CC(e,bC(a,e)):OC(e,yC(a,e))}else{if(!Lt[h])return i?e:{};a=d$(e,h,o)}}s||(s=new He);var f=s.get(e);if(f)return f;s.set(e,a),x$(e)?e.forEach(function(g){a.add(Ia(g,t,n,g,e,s))}):m$(e)&&e.forEach(function(g,v){a.set(v,Ia(g,t,n,v,e,s))});var p=c?l?$C:ac:l?zi:Gi,m=u?void 0:p(e);return gT(m||e,function(g,v){m&&(v=g,g=e[v]),hp(a,v,Ia(g,t,n,v,e,s))}),a}var q$=1,Y$=4;function vn(e){return Ia(e,q$|Y$)}var X$="__lodash_hash_undefined__";function Z$(e){return this.__data__.set(e,X$),this}function K$(e){return this.__data__.has(e)}function Yi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new mn;++t<n;)this.add(e[t])}Yi.prototype.add=Yi.prototype.push=Z$,Yi.prototype.has=K$;function Qp(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 Jp(e,t){return e.has(t)}var Q$=1,J$=2;function tg(e,t,n,r,i,s){var a=n&Q$,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 h=-1,d=!0,f=n&J$?new Yi:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(r)var g=a?r(m,p,h,t,e,s):r(p,m,h,e,t,s);if(g!==void 0){if(g)continue;d=!1;break}if(f){if(!Qp(t,function(v,y){if(!Jp(f,y)&&(p===v||i(p,v,n,r,s)))return f.push(y)})){d=!1;break}}else if(!(p===m||i(p,m,n,r,s))){d=!1;break}}return s.delete(e),s.delete(t),d}function t2(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function uc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var e2=1,n2=2,r2="[object Boolean]",i2="[object Date]",s2="[object Error]",a2="[object Map]",o2="[object Number]",l2="[object RegExp]",c2="[object Set]",u2="[object String]",h2="[object Symbol]",d2="[object ArrayBuffer]",f2="[object DataView]",eg=$e?$e.prototype:void 0,hc=eg?eg.valueOf:void 0;function p2(e,t,n,r,i,s,a){switch(n){case f2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case d2:return!(e.byteLength!=t.byteLength||!s(new Ra(e),new Ra(t)));case r2:case i2:case o2:return Vi(+e,+t);case s2:return e.name==t.name&&e.message==t.message;case l2:case u2:return e==t+"";case a2:var o=t2;case c2:var l=r&e2;if(o||(o=uc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=n2,a.set(e,t);var u=tg(o(e),o(t),r,i,s,a);return a.delete(e),u;case h2:if(hc)return hc.call(e)==hc.call(t)}return!1}var g2=1,m2=Object.prototype,v2=m2.hasOwnProperty;function y2(e,t,n,r,i,s){var a=n&g2,o=ac(e),l=o.length,c=ac(t),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var d=o[h];if(!(a?d in t:v2.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<l;){d=o[h];var v=e[d],y=t[d];if(r)var b=a?r(y,v,d,t,e,s):r(v,y,d,e,t,s);if(!(b===void 0?v===y||i(v,y,n,r,s):b)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var S=e.constructor,_=t.constructor;S!=_&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return s.delete(e),s.delete(t),m}var b2=1,ng="[object Arguments]",rg="[object Array]",Na="[object Object]",x2=Object.prototype,ig=x2.hasOwnProperty;function w2(e,t,n,r,i,s){var a=te(e),o=te(t),l=a?rg:Vr(e),c=o?rg:Vr(t);l=l==ng?Na:l,c=c==ng?Na:c;var u=l==Na,h=c==Na,d=l==c;if(d&&Pr(e)){if(!Pr(t))return!1;a=!0,u=!1}if(d&&!u)return s||(s=new He),a||$a(e)?tg(e,t,n,r,i,s):p2(e,t,l,n,r,i,s);if(!(n&b2)){var f=u&&ig.call(e,"__wrapped__"),p=h&&ig.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new He),i(m,g,n,r,s)}}return d?(s||(s=new He),y2(e,t,n,r,i,s)):!1}function Pa(e,t,n,r,i){return e===t?!0:e==null||t==null||!Ke(e)&&!Ke(t)?e!==e&&t!==t:w2(e,t,n,r,Pa,i)}var _2=1,E2=2;function S2(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 h=new He;if(r)var d=r(c,u,l,e,t,h);if(!(d===void 0?Pa(u,c,_2|E2,r,h):d))return!1}}return!0}function sg(e){return e===e&&!Ae(e)}function O2(e){for(var t=Gi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,sg(i)]}return t}function ag(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function T2(e){var t=O2(e);return t.length==1&&t[0][2]?ag(t[0][0],t[0][1]):function(n){return n===e||S2(n,e,t)}}function M2(e,t){return e!=null&&t in Object(e)}function C2(e,t,n){t=Op(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=ka(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&&Ql(i)&&Kl(a,i)&&(te(e)||Nr(e)))}function $2(e,t){return e!=null&&C2(e,t,M2)}var A2=1,L2=2;function k2(e,t){return ec(e)&&sg(t)?ag(ka(e),t):function(n){var r=At(n,e);return r===void 0&&r===t?$2(n,e):Pa(t,r,A2|L2)}}function D2(e){return function(t){return t==null?void 0:t[e]}}function R2(e){return function(t){return Tp(t,e)}}function I2(e){return ec(e)?D2(ka(e)):R2(e)}function Ua(e){return typeof e=="function"?e:e==null?ql:typeof e=="object"?te(e)?k2(e[0],e[1]):T2(e):I2(e)}function N2(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 P2=N2();const og=P2;function dc(e,t,n){(n!==void 0&&!Vi(e[t],n)||n===void 0&&!(t in e))&&Ma(e,t,n)}function fc(e){return Ke(e)&&ir(e)}function pc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function U2(e){return Hi(e,zi(e))}function B2(e,t,n,r,i,s,a){var o=pc(e,n),l=pc(t,n),c=a.get(l);if(c){dc(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,h=u===void 0;if(h){var d=te(l),f=!d&&Pr(l),p=!d&&!f&&$a(l);u=l,d||f||p?te(o)?u=o:fc(o)?u=up(o):f?(h=!1,u=Dp(l,!0)):p?(h=!1,u=jp(l,!0)):u=[]:hC(l)||Nr(l)?(u=o,Nr(o)?u=U2(o):(!Ae(o)||Yl(o))&&(u=Wp(l))):h=!1}h&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),dc(e,n,u)}function lg(e,t,n,r,i){e!==t&&og(t,function(s,a){if(i||(i=new He),Ae(s))B2(e,t,a,n,lg,r,i);else{var o=r?r(pc(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),dc(e,a,o)}},zi)}function V2(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 H2(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var F2="[object Map]",G2="[object Set]",z2=Object.prototype,j2=z2.hasOwnProperty;function Fe(e){if(e==null)return!0;if(ir(e)&&(te(e)||typeof e=="string"||typeof e.splice=="function"||Pr(e)||$a(e)||Nr(e)))return!e.length;var t=Vr(e);if(t==F2||t==G2)return!e.size;if(Ca(e))return!Sp(e).length;for(var n in e)if(j2.call(e,n))return!1;return!0}var W2=MT(function(e,t,n){lg(e,t,n)});const rt=W2;var q2=1/0,Y2=Br&&1/uc(new Br([,-0]))[1]==q2?function(e){return new Br(e)}:sT;const X2=Y2;var Z2=200;function cg(e,t,n){var r=-1,i=xT,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=V2;else if(s>=Z2){var c=t?null:X2(e);if(c)return uc(c);a=!1,i=Jp,l=new Yi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],h=t?t(u):u;if(u=n||u!==0?u:0,a&&h===h){for(var d=l.length;d--;)if(l[d]===h)continue t;t&&l.push(h),o.push(u)}else i(l,h,n)||(l!==o&&l.push(h),o.push(u))}return o}var K2=fp(function(e){var t=H2(e);return fc(t)&&(t=void 0),cg(Da(e,1,fc,!0),Ua(t))});const Q2=K2;function Xi(e){return e&&e.length?cg(e):[]}const ge="cds",yn={opacity:{unselected:.05,selected:.4}},kn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Hr={duration:1e3,ease:kh,zoomLevel:3},Fr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},ug={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Le={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},J2={defaultBins:10},Vt={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}},bn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},ee={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},kt={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},or={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Ge={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},hg={minCellDividerDimension:16,chartPadding:.5},dg={default:{size:24}},tA={horizontalOffset:10},fg={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}},_e={height:{[je.GRAPH_VIEW]:32,[je.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},eA=[{type:Xt.RADIUS,name:"Radius"},{type:Xt.AREA,name:"Poor area"},{type:Xt.AREA,name:"Satisfactory area"},{type:Xt.AREA,name:"Great area"},{type:Xt.QUARTILE,name:"Quartiles"}],Gr={type:De.END_LINE,threshold:16,numCharacter:14},nA={enabled:!0,position:ti.BOTTOM,clickable:!0,truncation:Gr,alignment:qt.LEFT,order:null,additionalItems:[]},rA={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},iA={enabled:!0},pg={enabled:!0,showTotal:!0,truncation:Gr,groupLabel:"Group"},gg={top:{visible:!0,includeZero:!0,truncation:Gr},bottom:{visible:!0,includeZero:!0,truncation:Gr},left:{visible:!0,includeZero:!0,truncation:Gr},right:{visible:!0,includeZero:!0,truncation:Gr}},Ba={addSpaceOnEdges:1,showDayName:!1,localeObject:tp,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"}}},sA=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),le={width:null,height:null,resizable:!0,theme:Pu.WHITE,tooltip:pg,legend:nA,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:Bt.SHOW_AS_DATATABLE},...sA?[{type:Bt.MAKE_FULLSCREEN}]:[],{type:Bt.EXPORT_CSV},{type:Bt.EXPORT_PNG},{type:Bt.EXPORT_JPG}]}},mg=rt({},le,{thematic:{projection:sn.geoNaturalEarth1}}),Zi=rt({},le,{axes:gg,timeScale:Ba,grid:rA,ruler:iA,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:je.GRAPH_VIEW}}}),lr=rt({},Zi,{bars:{maxWidth:16,spacingFactor:.25},timeScale:rt(Ba,{addSpaceOnEdges:1})}),aA=rt({},lr,{}),oA=rt({},lr,{}),lA=rt({},lr,{bars:rt({},lr.bars,{dividerSize:1.5})}),cA=rt({},lr,{}),gc=rt({},Zi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),uA=gc,vg=rt({},gc,{points:{radius:3,filled:!1,enabled:!0}}),yg=rt({},vg,{timeScale:rt(Ba,{addSpaceOnEdges:0})}),hA=yg,dA=rt({},Zi,{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:Xt.RADIUS,name:"Radius"}]}}),fA=rt({},Zi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Xt.AREA,name:"Poor area"},{type:Xt.AREA,name:"Satisfactory area"},{type:Xt.AREA,name:"Great area"},{type:Xt.QUARTILE,name:"Quartiles"}]}}),pA=rt({},lr,{bars:{dividerSize:1.5},timeScale:rt(Ba,{addSpaceOnEdges:0})}),gA=rt({},le,{tooltip:rt({},pg,{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"}}),bg=rt({},le,{pie:{labels:{formatter:null,enabled:!0},alignment:qt.LEFT,sortFunction:null,valueMapsTo:"value"}}),mA=rt({},le,{legend:{enabled:!1},gauge:{type:pr.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,numberFormatter:e=>Number(e.toFixed(2))%1!==0?e.toFixed(2).toLocaleString():e.toFixed().toLocaleString(),alignment:qt.LEFT}}),vA=rt({},bg,{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:qt.LEFT}}),xg=rt({},le,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),yA=rt({},xg,{legend:{enabled:!0}}),bA=rt({},le,{radar:{axes:{angle:"key",value:"value"},alignment:qt.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),xA=rt({},lr,{comboChartTypes:[]}),wA=rt({tree:{type:lo.TREE}},le,{}),_A=rt({},le,{data:rt(le.data,{groupMapsTo:"name"})}),EA=rt({},le,Fr,{data:rt(le.data,{groupMapsTo:"name"})}),SA=rt({},le,{alluvial:{data:rt(le.data,{groupMapsTo:"source"}),nodeAlignment:qt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),OA=rt({},le,{axes:gg,heatmap:{divider:{state:ni.AUTO},colorLegend:{type:"linear"}}}),TA=rt({},mg,{choropleth:{colorLegend:{type:"linear"}}}),Tt={alluvialChart:SA,areaChart:yg,axisChart:Zi,boxplotChart:cA,bubbleChart:dA,bulletChart:fA,chart:le,circlePackChart:EA,choroplethChart:TA,comboChart:xA,donutChart:vA,gaugeChart:mA,groupedBarChart:oA,heatmapChart:OA,histogramChart:pA,lineChart:vg,lollipopChart:uA,meterChart:xg,pieChart:bg,proportionalMeterChart:yA,radarChart:bA,scatterChart:gc,simpleBarChart:aA,stackedAreaChart:hA,stackedBarChart:lA,thematicChart:mg,treeChart:wA,treemapChart:_A,wordCloudChart:gA};function MA(e,t,n){let r=null;return(...i)=>{const s=this;s.mousePosition=Fn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Nt(e,t){var n;const r=vn(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://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===Z.TIME?a.mapsTo="date":l===Z.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return mc(r,t),rt(r,t)}function xn(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 Ki(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 wg(e,t,n="value"){const r=e/t.reduce((i,s)=>i+s[n],0)*100;return r%1!==0?parseFloat(r.toFixed(1)):r}function Qi(e,t,n){if(n>e.length)return e;if(t===De.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===De.FRONT_LINE)return"..."+e.substr(-n);if(t===De.END_LINE)return e.substr(0,n)+"..."}function mc(e,t){const n=x(e,"legend","additionalItems"),r=x(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=eA.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=Q2(a,r,"name")}}const x=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},_g=(e,t)=>t===Qt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ue=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=_g(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function wn(e,t,n){return n===Qt.VERTICAL?[e,t]:[t,e]}var Eg=(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))(Eg||{});const vc=[["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 Sg(e,t,n,r,i){const s=t===0,a=Number(Ir(new Date(e),"c"))===2,o=Number(Ir(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ha(e)||Ji(e,l)||Dn(e);case"minute":return s||Ha(e)||Ji(e,l)||Dn(e);case"30minutes":return s||Ha(e)||Ji(e,l)||Dn(e);case"hourly":return s||Ha(e)||Ji(e,l)||Dn(e);case"daily":return i?s||a||Dn(e):s||Ji(e,l)||Dn(e);case"weekly":return s||a||Dn(e);case"monthly":return s||Dn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function yc(e,t,n,r,i){const s=i.showDayName,a=r==="daily"&&s?"weekly":r,o=new Date(e),l=x(i,"timeIntervalFormats")[a],c=x(l,"primary"),u=x(l,"secondary");let h=Sg(e,t,n,r,s)?c:u;r==="15seconds"&&o.getMilliseconds()!==0&&(h=h.replace("pp","h:mm:ss.SSS a"));const d=i.localeObject;return Ir(o,h,{locale:d})}function Va(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function CA(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function $A(e){const t=vc.reduce((n,[,r],i)=>{const s=vc[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return vc[t][0]}function bc(e,t){if(Eg[t])return t;if(e.length===1)return"15seconds";const n=CA(e),r=Mn(n);return $A(r)}function Ha(e){const{s:t,m:n,H:r}=Va(e);return r===0&&n===0&&t===0}function Ji(e,t){const n=Va(e).M,r=Va(t).M;return n!==r}function Dn(e){const{M:t,d:n,s:r,m:i,H:s}=Va(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Og(e){return e===void 0?"":e.toISOString()}function Tg(e){const t=Re(e,r=>r.value),n=Be().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 Mg(e,t){const n=x(t,"gradient","colors"),r=!Fe(n);let i=x(t,"pairing","option");const s=Tg(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 Sl().domain(s).range(o)}var lt=(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))(lt||{});function AA(e,t){return e&&og(e,t,Gi)}function LA(e,t){return function(n,r){if(n==null)return n;if(!ir(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 kA=LA(AA);const xc=kA;function DA(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 RA(e,t,n,r){return xc(e,function(i,s,a){t(r,i,n(i),a)}),r}function IA(e,t){return function(n,r){var i=te(n)?DA:RA,s=t?t():{};return i(n,e,Ua(r),s)}}function NA(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 PA=Object.prototype,UA=PA.hasOwnProperty,BA=IA(function(e,t,n){UA.call(e,n)?e[n].push(t):Ma(e,n,[t])});const VA=BA;class Qe{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}=x(n,"data"),a=x(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===Z.LINEAR||c===Z.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===Z.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,h]=a[o].domain;r=r.filter(d=>!(l in d)||d[l]>=u&&d[l]<=h)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Vt.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(vn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return x(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Vt.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 VA(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=J2.defaultBins}=s,l=Array.isArray(o),c=a0().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],h=Array.from(new Set(t.map(f=>f[a]))),d=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,m=this.aggregateBinDataByGroup(f);h.forEach(g=>{d.push({group:g,key:p,value:m[g]||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 zl().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=Xi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Og(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===Z.TIME?s.sort((l,c)=>{const u=new Date(l),h=new Date(c);return u-h}):(o===Z.LOG||o===Z.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("-"),h={x0:c,x1:u},d=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{h[f]=d.filter(p=>p[i]===f).length}),h}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const h=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Og(f[p])===l:f[p].toString()===l)}),d=this.services.cartesianScales.getRangeIdentifier(c);c[u]=h?h[d]: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=NA(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const h=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/h*100:c[u]=0})})}return(r?zl().offset(hS):zl()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const h=l[u];return h[s]=a[c],h}))}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();mc(n,t),this.set({options:rt(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}=Vt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(O.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=x(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=x(s,"label");if(c===null){const h=x(i,o);h?l=h: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(i=>i.map(s=>`"${s==="–"?"–":s}"`));let n="",r="";t.forEach(function(i,s){r=i.join(","),n+=s<t.length?r+`
|
|
2
2
|
`:r}),this.services.files.downloadCSV(n,"myChart.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}=Vt.items.status,s=this.getOptions(),a=Xi(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=x(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=x(this.getOptions(),"color","pairing");let n=x(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=x(t,"option");const i=ug.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=ia().range(o).domain(this.allDataGroups)}}class cr extends Qe{constructor(t){super(t),this.axisFlavor=ds.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:x(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{cartesianScales:i}=this.services,{primaryDomain:s,primaryRange:a,secondaryDomain:o,secondaryRange:l}=this.assignRangeAndDomains(),c=i.getDomainAxisScaleType();let u;return c===Z.TIME&&(u=h=>Ir(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...l?[l.label]:[]],...t.map(h=>[h[r],h[s.identifier]===null?"–":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"–":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"–":h[o.identifier]]:[],...l?[h[l.identifier]===null||isNaN(h[l.identifier])?"–":h[l.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),x(this.getOptions(),"zoomBar",H.TOP,"enabled"))){const r=x(this.getOptions(),"zoomBar",H.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(vn(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=Xi(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(h=>{h[s].getTime()===l&&(c+=h[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(H).forEach(i=>{const s=H[i],a=n.axes[s];if(a&&a.scaleType===Z.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{x(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let HA=class extends cr{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])]}},FA=class extends cr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:mo(t,.25),q_50:mo(t,.5),q_75:mo(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(b=>b[o]).sort(Bn),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,h=c.quartiles.q_75,d=(h-u)*1.5,f=u-d,p=h+d,m=[],g=[];for(const b of l)b<f||b>p?m.push(b):g.push(b);c.outliers=m;const v=Mn(g),y=Hn(g);c.whiskers={min:v||Mn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||Hn([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=x(i,"outliers");return(s===null||s.length===0)&&(s=["–"]),[i[n],x(i,"whiskers","min")!==null?x(i,"whiskers","min").toLocaleString():"–",x(i,"quartiles","q_25")!==null?x(i,"quartiles","q_25").toLocaleString():"–",x(i,"quartiles","q_50")!==null?x(i,"quartiles","q_50").toLocaleString():"–",x(i,"quartiles","q_75")!==null?x(i,"quartiles","q_75").toLocaleString():"–",x(i,"whiskers","max")!==null?x(i,"whiskers","max").toLocaleString():"–",x(i,"quartiles","q_75")!==null&&x(i,"quartiles","q_25")!==null?(x(i,"quartiles","q_75")-x(i,"quartiles","q_25")).toLocaleString():"–",s.map(a=>a.toLocaleString()).join(",")]})]}setColorClassNames(){const t=x(this.getOptions(),"color","pairing");let n=x(t,"option");const r=ug.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=ia().range(i).domain(this.allDataGroups)}},GA=class extends cr{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=x(n,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(a=>[a.title,a[r],a.value===null?"–":a.value,x(a,"marker")===null?"–":a.marker,x(a,"marker")===null?"–":`${Math.floor(a[i]/a.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(a)]])]}},zA=class extends Qe{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Fe(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Fe(n)&&!Fe(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?"–":n.id,n.name,n.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=x(this.getOptions(),"color");this._colorScale=Mg(this.getDisplayData(),t)}},jA=class extends Qe{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=rt({},t,this.getZoomOptions(t));mc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:rt(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&x(n,0,"children")?x(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),x(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Xt.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(["–",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}},WA=class extends Qe{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(i=>[i[r],i.value===null?"–":i.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},qA=class extends Qe{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?"–":i.value.toLocaleString()])]}},YA=class extends cr{constructor(t){super(t),this.axisFlavor=ds.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=x(this.getOptions(),"axes");if(x(n,"left","scaleType")&&x(n,"left","scaleType")!==Z.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==Z.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==Z.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==Z.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Re(this.getDisplayData(),r=>r.value),n=Be().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(Fe(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(Fe(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(Fe(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]=vn(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(vn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Fe(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?"–":i[n.identifier],i[r.identifier]===null?"–":i[r.identifier].toLocaleString(),i.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!Fe(n);let i=x(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Sl().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=Mg(this.getDisplayData(),l)}},XA=class extends cr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[At(t,"bins.rangeLabel")||"Range",...r.map(i=>At(i,`0.${n}`))],...At(r,0).map((i,s)=>[`${At(i,"data.x0")} – ${At(i,"data.x1")}`,...r.map(a=>At(a[s],`data.${At(a[s],n)}`))])]}},ZA=class extends Qe{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=x(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=x(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=x(t,"meter","proportional")?r:r>100?100:r,s=x(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=x(n,"meter","proportional");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=x(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}},KA=class extends cr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),s=x(n,"0","data").map(a=>a[r]);return[["Group",...s],...n.map(a=>[a.name,...s.map((o,l)=>x(a,"data",l,i)!==null?x(a,"data",l,i).toLocaleString():"–")])]}},QA=class extends Qe{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"–"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}},JA=class extends Qe{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(r=>{Array.isArray(r.children)?r.children.forEach(i=>{n.push([i.name,r.name,i.value])}):x(r.name)!==null&&x(r.value)&&n.push(["–",r.name,r.value])}),n}};class tL extends Qe{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 eL=/\s/;function nL(e){for(var t=e.length;t--&&eL.test(e.charAt(t)););return t}var rL=/^\s+/;function iL(e){return e&&e.slice(0,nL(e)+1).replace(rL,"")}var Cg=0/0,sL=/^[-+]0x[0-9a-f]+$/i,aL=/^0b[01]+$/i,oL=/^0o[0-7]+$/i,lL=parseInt;function ts(e){if(typeof e=="number")return e;if(Oa(e))return Cg;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=iL(e);var n=aL.test(e);return n||oL.test(e)?lL(e.slice(2),n?2:8):sL.test(e)?Cg:+e}var cL=function(){return Ve.Date.now()};const wc=cL;var uL="Expected a function",hL=Math.max,dL=Math.min;function Fa(e,t,n){var r,i,s,a,o,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(uL);t=ts(t)||0,Ae(n)&&(u=!!n.leading,h="maxWait"in n,s=h?hL(ts(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function f(E){var T=r,D=i;return r=i=void 0,c=E,a=e.apply(D,T),a}function p(E){return c=E,o=setTimeout(v,t),u?f(E):a}function m(E){var T=E-l,D=E-c,N=t-T;return h?dL(N,s-D):N}function g(E){var T=E-l,D=E-c;return l===void 0||T>=t||T<0||h&&D>=s}function v(){var E=wc();if(g(E))return y(E);o=setTimeout(v,m(E))}function y(E){return o=void 0,d&&r?f(E):(r=i=void 0,a)}function b(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function S(){return o===void 0?a:y(wc())}function _(){var E=wc(),T=g(E);if(r=arguments,i=this,l=E,T){if(o===void 0)return p(l);if(h)return clearTimeout(o),o=setTimeout(v,t),f(l)}return o===void 0&&(o=setTimeout(v,t)),a}return _.cancel=b,_.flush=S,_}function fL(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 pL=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function _n(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Ga(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function gL(e){const t=Ga(e,"border-left-width"),n=Ga(e,"border-right-width");return e.clientWidth+t+n}function mL(e){const t=Ga(e,"border-top-width"),n=Ga(e,"border-bottom-width");return e.clientHeight+t+n}function $g(e,t={}){const n=t.width||gL(e),r=t.height||mL(e);return{width:n,height:r}}function vL(){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 Ee=16384;function yL(e){(e.width>Ee||e.height>Ee)&&(e.width>Ee&&e.height>Ee?e.width>e.height?(e.height*=Ee/e.width,e.width=Ee):(e.width*=Ee/e.height,e.height=Ee):e.width>Ee?(e.height*=Ee/e.width,e.width=Ee):(e.width*=Ee/e.height,e.height=Ee))}function za(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 bL(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function xL(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),bL(i)}const me=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||me(n,t)};function wL(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function _L(e){return _n(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function EL(e,t,n){const r=`.${e}:${t}`,i=n.cssText?wL(n):_L(n);return document.createTextNode(`${r}{${i}}`)}function Ag(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=pL();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(EL(s,n,r)),t.appendChild(a)}function SL(e,t){Ag(e,t,":before"),Ag(e,t,":after")}const Lg="application/font-woff",kg="image/jpeg",OL={woff:Lg,woff2:Lg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:kg,jpeg:kg,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function TL(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function _c(e){const t=TL(e).toLowerCase();return OL[t]||""}function ML(e){return e.split(/,/)[1]}function Ec(e){return e.search(/^(data:)/)!==-1}function Dg(e,t){return`data:${t};base64,${e}`}async function Rg(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 Sc={};function CL(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 Oc(e,t,n){const r=CL(e,t,n.includeQueryParams);if(Sc[r]!=null)return Sc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Rg(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),ML(o)));i=Dg(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 Sc[r]=i,i}async function $L(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):za(t)}async function AL(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 za(o)}const n=e.poster,r=_c(n),i=await Oc(n,r,t);return za(i)}async function LL(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await ja(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function kL(e,t){return me(e,HTMLCanvasElement)?$L(e):me(e,HTMLVideoElement)?AL(e,t):me(e,HTMLIFrameElement)?LL(e):e.cloneNode(!1)}const DL=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function RL(e,t,n){var r,i;let s=[];return DL(e)&&e.assignedNodes?s=_n(e.assignedNodes()):me(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=_n(e.contentDocument.body.childNodes):s=_n(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||me(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>ja(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function IL(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):_n(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`),me(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 NL(e,t){me(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),me(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function PL(e,t){if(me(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function UL(e,t){return me(t,Element)&&(IL(e,t),SL(e,t),NL(e,t),PL(e,t)),t}async function BL(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 ja(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 ja(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>kL(r,t)).then(r=>RL(e,r,t)).then(r=>UL(e,r)).then(r=>BL(r,t))}const Ig=/url\((['"]?)([^'"]+?)\1\)/g,VL=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,HL=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function FL(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function GL(e){const t=[];return e.replace(Ig,(n,r,i)=>(t.push(i),n)),t.filter(n=>!Ec(n))}async function zL(e,t,n,r,i){try{const s=n?fL(t,n):t,a=_c(t);let o;if(i){const l=await i(s);o=Dg(l,a)}else o=await Oc(s,a,r);return e.replace(FL(t),`$1${o}$3`)}catch{}return e}function jL(e,{preferredFontFormat:t}){return t?e.replace(HL,n=>{for(;;){const[r,,i]=VL.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ng(e){return e.search(Ig)!==-1}async function Pg(e,t,n){if(!Ng(e))return e;const r=jL(e,n);return GL(r).reduce((i,s)=>i.then(a=>zL(a,s,t,n)),Promise.resolve(r))}async function Wa(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Pg(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function WL(e,t){await Wa("background",e,t)||await Wa("background-image",e,t),await Wa("mask",e,t)||await Wa("mask-image",e,t)}async function qL(e,t){const n=me(e,HTMLImageElement);if(!(n&&!Ec(e.src))&&!(me(e,SVGImageElement)&&!Ec(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Oc(r,_c(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 YL(e,t){const n=_n(e.childNodes).map(r=>Ug(r,t));await Promise.all(n).then(()=>e)}async function Ug(e,t){me(e,Element)&&(await WL(e,t),await qL(e,t),await YL(e,t))}function XL(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 Bg={};async function Vg(e){let t=Bg[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Bg[e]=t,t}async function Hg(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),Rg(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function Fg(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 ZL(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{_n(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Vg(l).then(u=>Hg(u,t)).then(u=>Fg(u).forEach(h=>{try{i.insertRule(h,h.startsWith("@import")?o+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:h,error:d})}})).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(Vg(i.href).then(o=>Hg(o,t)).then(o=>Fg(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{_n(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function KL(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ng(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=_n(e.ownerDocument.styleSheets),r=await ZL(n,t);return KL(r)}async function JL(e,t){const n=await QL(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Pg(r.cssText,i,t)}))).join(`
|
|
3
|
-
`)}async function tk(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await JL(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 ek(e,t={}){const{width:n,height:r}=$g(e,t),i=await ja(e,t,!0);return await tk(i,t),await Ug(i,t),XL(i,t),await xL(i,n,r)}async function Gg(e,t={}){const{width:n,height:r}=$g(e,t),i=await ek(e,t),s=await za(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||vL(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||yL(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 nk(e,t={}){return(await Gg(e,t)).toDataURL()}async function rk(e,t={}){return(await Gg(e,t)).toDataURL("image/jpeg",t.quality||1)}class En{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const ik="DONT_STYLE_ME_css_styles_verifier";class k extends En{constructor(t,n){super(t,n),this.chartID=""}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=R(t));const r={width:0,height:0},i=d=>{d&&Object.keys(r).forEach(f=>{if(d[f]){const p=d[f],m=parseFloat(p);p&&m>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=m)}})},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(d){console.error(d)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(d){console.error(d)}let h;if(a instanceof SVGSVGElement&&(h={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(h),r.width>0&&r.height>0))return h;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 d={width:x(t.node(),"width","baseVal","value"),height:x(t.node(),"height","baseVal","value")};i(d)}catch{i(h),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.styleHolderElement(),this.initializeID(),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=x(t,"style","prefix"),r=R(this.getHolder()).append("div").classed(`${ge}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",ik),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),R(this.getHolder()).classed(`${ge}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.getHolder(),r=R(n);r.classed("filled",!0),rk(this.getMainContainer(),{quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.jpg"),r.classed("filled",!1)})}exportToPNG(){const t=this,n=this.getHolder(),r=R(n);r.classed("filled",!0),nk(this.getMainContainer(),{quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.png"),r.classed("filled",!1)}).catch(function(i){console.error("oops, something went wrong!",i)})}toggleFullscreen(){const t=this.getHolder();R(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=R(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=k.getSVGElementSize(R(this.mainContainer),{useBBox:!0}),n=R(this.mainContainer).attr("class"),r=R(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(k.getSVGElementSize(R(s),{useBBox:!0}).height)}),i<=t?R(this.mainContainer).attr("height",i):R(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&R(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=Fa(()=>{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)}}let Tc=class Uv extends En{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:Uv.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function zg(e){const t=sk(jg(e),360);return Rn(t,[0,10])||Rn(t,[350,0])?{textAnchor:nn.START,dominantBaseline:rn.MIDDLE}:Rn(t,[10,80])?{textAnchor:nn.START,dominantBaseline:rn.HANGING}:Rn(t,[80,100])?{textAnchor:nn.MIDDLE,dominantBaseline:rn.HANGING}:Rn(t,[100,170])?{textAnchor:nn.END,dominantBaseline:rn.HANGING}:Rn(t,[170,190])?{textAnchor:nn.END,dominantBaseline:rn.MIDDLE}:Rn(t,[190,260])?{textAnchor:nn.END,dominantBaseline:rn.BASELINE}:Rn(t,[260,280])?{textAnchor:nn.MIDDLE,dominantBaseline:rn.BASELINE}:{textAnchor:nn.START,dominantBaseline:rn.BASELINE}}function sk(e,t){return(e%t+t)%t}function Rn(e,[t,n]){return e>=t&&e<=n}function jg(e){return e*(180/Math.PI)}function Ft(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 ak(e,t){return t*Math.sin(e-Math.PI/2)}function Wg(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 ok(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 Mc(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 lk(e){return e.depth}function ck(e,t){return t-1-e.height}function qg(e,t){return e.sourceLinks.length?e.depth:t-1}function qa(e){return function(){return e}}function Yg(e,t){return Ya(e.source,t.source)||e.index-t.index}function Xg(e,t){return Ya(e.target,t.target)||e.index-t.index}function Ya(e,t){return e.y0-t.y0}function Cc(e){return e.value}function uk(e){return e.index}function hk(e){return e.nodes}function dk(e){return e.links}function Zg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Kg({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 fk(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=uk,l=qg,c,u,h=hk,d=dk,f=6;function p(){const w={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return m(w),g(w),v(w),y(w),_(w),Kg(w),w}p.update=function(w){return Kg(w),w},p.nodeId=function(w){return arguments.length?(o=typeof w=="function"?w:qa(w),p):o},p.nodeAlign=function(w){return arguments.length?(l=typeof w=="function"?w:qa(w),p):l},p.nodeSort=function(w){return arguments.length?(c=w,p):c},p.nodeWidth=function(w){return arguments.length?(i=+w,p):i},p.nodePadding=function(w){return arguments.length?(s=a=+w,p):s},p.nodes=function(w){return arguments.length?(h=typeof w=="function"?w:qa(w),p):h},p.links=function(w){return arguments.length?(d=typeof w=="function"?w:qa(w),p):d},p.linkSort=function(w){return arguments.length?(u=w,p):u},p.size=function(w){return arguments.length?(e=t=0,n=+w[0],r=+w[1],p):[n-e,r-t]},p.extent=function(w){return arguments.length?(e=+w[0][0],n=+w[1][0],t=+w[0][1],r=+w[1][1],p):[[e,t],[n,r]]},p.iterations=function(w){return arguments.length?(f=+w,p):f};function m({nodes:w,links:P}){for(const[I,B]of w.entries())B.index=I,B.sourceLinks=[],B.targetLinks=[];const U=new Map(w.map((I,B)=>[o(I,B,w),I]));for(const[I,B]of P.entries()){B.index=I;let{source:j,target:Y}=B;typeof j!="object"&&(j=B.source=Zg(U,j)),typeof Y!="object"&&(Y=B.target=Zg(U,Y)),j.sourceLinks.push(B),Y.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:I,targetLinks:B}of w)I.sort(u),B.sort(u)}function g({nodes:w}){for(const P of w)P.value=P.fixedValue===void 0?Math.max(Mc(P.sourceLinks,Cc),Mc(P.targetLinks,Cc)):P.fixedValue}function v({nodes:w}){const P=w.length;let U=new Set(w),I=new Set,B=0;for(;U.size;){for(const j of U){j.depth=B;for(const{target:Y}of j.sourceLinks)I.add(Y)}if(++B>P)throw new Error("circular link");U=I,I=new Set}}function y({nodes:w}){const P=w.length;let U=new Set(w),I=new Set,B=0;for(;U.size;){for(const j of U){j.height=B;for(const{source:Y}of j.targetLinks)I.add(Y)}if(++B>P)throw new Error("circular link");U=I,I=new Set}}function b({nodes:w}){const P=Wg(w,B=>B.depth)+1,U=(n-e-i)/(P-1),I=new Array(P);for(const B of w){const j=Math.max(0,Math.min(P-1,Math.floor(l.call(null,B,P))));B.layer=j,B.x0=e+j*U,B.x1=B.x0+i,I[j]?I[j].push(B):I[j]=[B]}if(c)for(const B of I)B.sort(c);return I}function S(w){const P=ok(w,U=>(r-t-(U.length-1)*a)/Mc(U,Cc));for(const U of w){let I=t;for(const B of U){B.y0=I,B.y1=I+B.value*P,I=B.y1+a;for(const j of B.sourceLinks)j.width=j.value*P}I=(r-I+a)/(U.length+1);for(let B=0;B<U.length;++B){const j=U[B];j.y0+=I*(B+1),j.y1+=I*(B+1)}V(U)}}function _(w){const P=b(w);a=Math.min(s,(r-t)/(Wg(P,U=>U.length)-1)),S(P);for(let U=0;U<f;++U){const I=Math.pow(.99,U),B=Math.max(1-I,(U+1)/f);T(P,I,B),E(P,I,B)}}function E(w,P,U){for(let I=1,B=w.length;I<B;++I){const j=w[I];for(const Y of j){let et=0,pt=0;for(const{source:K,value:ht}of Y.targetLinks){let it=ht*(Y.layer-K.layer);et+=M(K,Y)*it,pt+=it}if(!(pt>0))continue;let z=(et/pt-Y.y0)*P;Y.y0+=z,Y.y1+=z,C(Y)}c===void 0&&j.sort(Ya),D(j,U)}}function T(w,P,U){for(let I=w.length,B=I-2;B>=0;--B){const j=w[B];for(const Y of j){let et=0,pt=0;for(const{target:K,value:ht}of Y.sourceLinks){let it=ht*(K.layer-Y.layer);et+=L(Y,K)*it,pt+=it}if(!(pt>0))continue;let z=(et/pt-Y.y0)*P;Y.y0+=z,Y.y1+=z,C(Y)}c===void 0&&j.sort(Ya),D(j,U)}}function D(w,P){const U=w.length>>1,I=w[U];A(w,I.y0-a,U-1,P),N(w,I.y1+a,U+1,P),A(w,r,w.length-1,P),N(w,t,0,P)}function N(w,P,U,I){for(;U<w.length;++U){const B=w[U],j=(P-B.y0)*I;j>1e-6&&(B.y0+=j,B.y1+=j),P=B.y1+a}}function A(w,P,U,I){for(;U>=0;--U){const B=w[U],j=(B.y1-P)*I;j>1e-6&&(B.y0-=j,B.y1-=j),P=B.y0-a}}function C({sourceLinks:w,targetLinks:P}){if(u===void 0){for(const{source:{sourceLinks:U}}of P)U.sort(Xg);for(const{target:{targetLinks:U}}of w)U.sort(Yg)}}function V(w){if(u===void 0)for(const{sourceLinks:P,targetLinks:U}of w)P.sort(Xg),U.sort(Yg)}function M(w,P){let U=w.y0-(w.sourceLinks.length-1)*a/2;for(const{target:I,width:B}of w.sourceLinks){if(I===P)break;U+=B+a}for(const{source:I,width:B}of P.targetLinks){if(I===w)break;U-=B}return U}function L(w,P){let U=P.y0-(P.targetLinks.length-1)*a/2;for(const{source:I,width:B}of P.targetLinks){if(I===w)break;U+=B+a}for(const{target:I,width:B}of w.sourceLinks){if(I===P)break;U-=B}return U}return p}var $c=Math.PI,Ac=2*$c,ur=1e-6,pk=Ac-ur;function Lc(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Qg(){return new Lc}Lc.prototype=Qg.prototype={constructor:Lc,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,h=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(h>ur)if(!(Math.abs(u*o-l*c)>ur)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var d=n-s,f=r-a,p=o*o+l*l,m=d*d+f*f,g=Math.sqrt(p),v=Math.sqrt(h),y=i*Math.tan(($c-Math.acos((p+h-m)/(2*g*v)))/2),b=y/v,S=y/g;Math.abs(b-1)>ur&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+S*o)+","+(this._y1=t+S*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,h=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)>ur||Math.abs(this._y1-c)>ur)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%Ac+Ac),h>pk?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>ur&&(this._+="A"+n+","+n+",0,"+ +(h>=$c)+","+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 Jg(e){return function(){return e}}function gk(e){return e[0]}function mk(e){return e[1]}var vk=Array.prototype.slice;function yk(e){return e.source}function bk(e){return e.target}function xk(e){var t=yk,n=bk,r=gk,i=mk,s=null;function a(){var o,l=vk.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Qg()),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:Jg(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Jg(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function wk(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function _k(){return xk(wk)}function Ek(e){return[e.source.x1,e.y0]}function Sk(e){return[e.target.x0,e.y1]}function Ok(){return _k().source(Ek).target(Sk)}function tm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tk(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 Mk={value:function(){}};function em(){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 Xa(n)}function Xa(e){this._=e}function Ck(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}})}Xa.prototype=em.prototype={constructor:Xa,on:function(e,t){var n=this._,r=Ck(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=$k(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]=nm(n[i],e.name,t);else if(t==null)for(i in n)n[i]=nm(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 Xa(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 $k(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function nm(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Mk,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ak=Tk(Object.freeze(Object.defineProperty({__proto__:null,dispatch:em},Symbol.toStringTag,{value:"Module"}))).dispatch,kc=Math.PI/180,es=64,Za=2048,Lk=function(){var e=[256,256],t=kk,n=Dk,r=Rk,i=rm,s=rm,a=Ik,o=Nk,l=im,c=[],u=1/0,h=Ak("word","end"),d=null,f=Math.random,p={},m=Gk;p.canvas=function(y){return arguments.length?(m=In(y),p):m},p.start=function(){var y=g(m()),b=Fk((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,T=[],D=c.map(function(A,C){return A.text=t.call(this,A,C),A.font=n.call(this,A,C),A.style=i.call(this,A,C),A.weight=s.call(this,A,C),A.rotate=a.call(this,A,C),A.size=~~r.call(this,A,C),A.padding=o.call(this,A,C),A}).sort(function(A,C){return C.size-A.size});return d&&clearInterval(d),d=setInterval(N,0),N(),p;function N(){for(var A=Date.now();Date.now()-A<u&&++E<_&&d;){var C=D[E];C.x=e[0]*(f()+.5)>>1,C.y=e[1]*(f()+.5)>>1,Pk(y,C,D,E),C.hasText&&v(b,C,S)&&(T.push(C),h.call("word",p,C),S?Bk(S,C):S=[{x:C.x+C.x0,y:C.y+C.y0},{x:C.x+C.x1,y:C.y+C.y1}],C.x-=e[0]>>1,C.y-=e[1]>>1)}E>=_&&(p.stop(),h.call("end",p,T,S))}},p.stop=function(){return d&&(clearInterval(d),d=null),p};function g(y){y.width=y.height=1;var b=Math.sqrt(y.getContext("2d").getImageData(0,0,1,1).data.length>>2);y.width=(es<<5)/b,y.height=Za/b;var S=y.getContext("2d");return S.fillStyle=S.strokeStyle="red",S.textAlign="center",{context:S,ratio:b}}function v(y,b,S){e[0],e[1];for(var _=b.x,E=b.y,T=Math.sqrt(e[0]*e[0]+e[1]*e[1]),D=l(e),N=f()<.5?1:-1,A=-N,C,V,M;(C=D(A+=N))&&(V=~~C[0],M=~~C[1],!(Math.min(Math.abs(V),Math.abs(M))>=T));)if(b.x=_+V,b.y=E+M,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!S||!Uk(b,y,e[0]))&&(!S||Vk(b,S))){for(var L=b.sprite,w=b.width>>5,P=e[0]>>5,U=b.x-(w<<4),I=U&127,B=32-I,j=b.y1-b.y0,Y=(b.y+b.y0)*P+(U>>5),et,pt=0;pt<j;pt++){et=0;for(var z=0;z<=w;z++)y[Y+z]|=et<<B|(z<w?(et=L[pt*w+z])>>>I:0);Y+=P}return delete b.sprite,!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=In(y),p):n},p.fontStyle=function(y){return arguments.length?(i=In(y),p):i},p.fontWeight=function(y){return arguments.length?(s=In(y),p):s},p.rotate=function(y){return arguments.length?(a=In(y),p):a},p.text=function(y){return arguments.length?(t=In(y),p):t},p.spiral=function(y){return arguments.length?(l=zk[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=In(y),p):r},p.padding=function(y){return arguments.length?(o=In(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=h.on.apply(h,arguments);return y===h?p:y},p};function kk(e){return e.text}function Dk(){return"serif"}function rm(){return"normal"}function Rk(e){return Math.sqrt(e.value)}function Ik(){return(~~(Math.random()*6)-3)*30}function Nk(){return 1}function Pk(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(es<<5)/s,Za/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;var u=i.measureText(t.text+"m").width*s,h=t.size<<1;if(t.rotate){var d=Math.sin(t.rotate*kc),f=Math.cos(t.rotate*kc),p=u*f,m=u*d,g=h*f,v=h*d;u=Math.max(Math.abs(p+v),Math.abs(p-v))+31>>5<<5,h=~~Math.max(Math.abs(m+g),Math.abs(m-g))}else u=u+31>>5<<5;if(h>l&&(l=h),a+u>=es<<5&&(a=0,o+=l,l=0),o+h>=Za)break;i.translate((a+(u>>1))/s,(o+(h>>1))/s),t.rotate&&i.rotate(t.rotate*kc),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=u,t.height=h,t.xoff=a,t.yoff=o,t.x1=u>>1,t.y1=h>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=u}for(var y=i.getImageData(0,0,(es<<5)/s,Za/s).data,b=[];--r>=0;)if(t=n[r],!!t.hasText){for(var u=t.width,S=u>>5,h=t.y1-t.y0,_=0;_<h*S;_++)b[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,T=-1,D=0;D<h;D++){for(var _=0;_<u;_++){var N=S*D+(_>>5),A=y[(o+D)*(es<<5)+(a+_)<<2]?1<<31-_%32:0;b[N]|=A,E|=A}E?T=D:(t.y0++,h--,D--,o++)}t.y1=t.y0+T,t.sprite=b.slice(0,(t.y1-t.y0)*S)}}}function Uk(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,h=0;h<l;h++){u=0;for(var d=0;d<=i;d++)if((u<<o|(d<i?(u=r[h*i+d])>>>a:0))&t[c+d])return!0;c+=n}return!1}function Bk(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 Vk(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 im(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function Hk(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 Fk(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Gk(){return document.createElement("canvas")}function In(e){return typeof e=="function"?e:function(){return e}}var zk={archimedean:im,rectangular:Hk};const jk=tm(Lk);function Wk(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 qk(e){return function(t){return e==null?void 0:e[t]}}var Yk={À:"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"},Xk=qk(Yk);const Zk=Xk;var Kk=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qk="\\u0300-\\u036f",Jk="\\ufe20-\\ufe2f",tD="\\u20d0-\\u20ff",eD=Qk+Jk+tD,nD="["+eD+"]",rD=RegExp(nD,"g");function iD(e){return e=qi(e),e&&e.replace(Kk,Zk).replace(rD,"")}var sD=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function aD(e){return e.match(sD)||[]}var oD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function lD(e){return oD.test(e)}var sm="\\ud800-\\udfff",cD="\\u0300-\\u036f",uD="\\ufe20-\\ufe2f",hD="\\u20d0-\\u20ff",dD=cD+uD+hD,am="\\u2700-\\u27bf",om="a-z\\xdf-\\xf6\\xf8-\\xff",fD="\\xac\\xb1\\xd7\\xf7",pD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gD="\\u2000-\\u206f",mD=" \\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",lm="A-Z\\xc0-\\xd6\\xd8-\\xde",vD="\\ufe0e\\ufe0f",cm=fD+pD+gD+mD,um="['’]",hm="["+cm+"]",yD="["+dD+"]",dm="\\d+",bD="["+am+"]",fm="["+om+"]",pm="[^"+sm+cm+dm+am+om+lm+"]",xD="\\ud83c[\\udffb-\\udfff]",wD="(?:"+yD+"|"+xD+")",_D="[^"+sm+"]",gm="(?:\\ud83c[\\udde6-\\uddff]){2}",mm="[\\ud800-\\udbff][\\udc00-\\udfff]",zr="["+lm+"]",ED="\\u200d",vm="(?:"+fm+"|"+pm+")",SD="(?:"+zr+"|"+pm+")",ym="(?:"+um+"(?:d|ll|m|re|s|t|ve))?",bm="(?:"+um+"(?:D|LL|M|RE|S|T|VE))?",xm=wD+"?",wm="["+vD+"]?",OD="(?:"+ED+"(?:"+[_D,gm,mm].join("|")+")"+wm+xm+")*",TD="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MD="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",CD=wm+xm+OD,$D="(?:"+[bD,gm,mm].join("|")+")"+CD,AD=RegExp([zr+"?"+fm+"+"+ym+"(?="+[hm,zr,"$"].join("|")+")",SD+"+"+bm+"(?="+[hm,zr+vm,"$"].join("|")+")",zr+"?"+vm+"+"+ym,zr+"+"+bm,MD,TD,dm,$D].join("|"),"g");function LD(e){return e.match(AD)||[]}function kD(e,t,n){return e=qi(e),t=n?void 0:t,t===void 0?lD(e)?LD(e):aD(e):e.match(t)||[]}var DD="['’]",RD=RegExp(DD,"g");function _m(e){return function(t){return Wk(kD(iD(t).replace(RD,"")),e,"")}}function ID(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Em(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),ID(ts(e),t,n)}function ND(e,t){var n=-1,r=ir(e)?Array(e.length):[];return xc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function PD(e,t){var n=te(e)?ip:ND;return n(e,Ua(t))}var UD=1/0;function BD(e,t){return Da(PD(e,t),UD)}function Sm(e,t){return Pa(e,t)}var VD=_m(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const jr=VD;function HD(e,t){var n;return xc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function FD(e,t,n){var r=te(e)?Qp:HD;return n&&pp(e,t,n)&&(t=void 0),r(e,Ua(t))}class ft{constructor(t,n,r){if(this.type="",this.renderType=Q.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=x(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(R(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=x(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${ge}--${i}--${this.type}`,!0),r&&r.classed(`${ge}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=x(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=k.appendOrSelect(this.parent,`${this.renderType===Q.SVG?"svg":"div"}${r}.${ge}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=R(`#${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?rt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const Om=class Bv extends ft{constructor(){super(...arguments),this.type="toolbar",this.renderType=Q.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(x(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
|
|
3
|
+
`)}async function tk(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await JL(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 ek(e,t={}){const{width:n,height:r}=$g(e,t),i=await ja(e,t,!0);return await tk(i,t),await Ug(i,t),XL(i,t),await xL(i,n,r)}async function Gg(e,t={}){const{width:n,height:r}=$g(e,t),i=await ek(e,t),s=await za(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||vL(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||yL(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 nk(e,t={}){return(await Gg(e,t)).toDataURL()}async function rk(e,t={}){return(await Gg(e,t)).toDataURL("image/jpeg",t.quality||1)}class En{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const ik="DONT_STYLE_ME_css_styles_verifier";class k extends En{constructor(t,n){super(t,n),this.chartID=""}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=R(t));const r={width:0,height:0},i=d=>{d&&Object.keys(r).forEach(f=>{if(d[f]){const p=d[f],m=parseFloat(p);p&&m>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=m)}})},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(d){console.error(d)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(d){console.error(d)}let h;if(a instanceof SVGSVGElement&&(h={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(h),r.width>0&&r.height>0))return h;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 d={width:x(t.node(),"width","baseVal","value"),height:x(t.node(),"height","baseVal","value")};i(d)}catch{i(h),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.styleHolderElement(),this.initializeID(),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=x(t,"style","prefix"),r=R(this.getHolder()).append("div").classed(`${ge}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",ik),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),R(this.getHolder()).classed(`${ge}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.getHolder(),r=R(n);r.classed("filled",!0),rk(this.getMainContainer(),{quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.jpg"),r.classed("filled",!1)})}exportToPNG(){const t=this,n=this.getHolder(),r=R(n);r.classed("filled",!0),nk(this.getMainContainer(),{quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.png"),r.classed("filled",!1)}).catch(function(i){console.error("oops, something went wrong!",i)})}toggleFullscreen(){const t=this.getHolder();R(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=R(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=k.getSVGElementSize(R(this.mainContainer),{useBBox:!0}),n=R(this.mainContainer).attr("class"),r=R(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(k.getSVGElementSize(R(s),{useBBox:!0}).height)}),i<=t?R(this.mainContainer).attr("height",i):R(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&R(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=Fa(()=>{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)}}let Tc=class Uv extends En{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:Uv.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function zg(e){const t=sk(jg(e),360);return Rn(t,[0,10])||Rn(t,[350,0])?{textAnchor:nn.START,dominantBaseline:rn.MIDDLE}:Rn(t,[10,80])?{textAnchor:nn.START,dominantBaseline:rn.HANGING}:Rn(t,[80,100])?{textAnchor:nn.MIDDLE,dominantBaseline:rn.HANGING}:Rn(t,[100,170])?{textAnchor:nn.END,dominantBaseline:rn.HANGING}:Rn(t,[170,190])?{textAnchor:nn.END,dominantBaseline:rn.MIDDLE}:Rn(t,[190,260])?{textAnchor:nn.END,dominantBaseline:rn.BASELINE}:Rn(t,[260,280])?{textAnchor:nn.MIDDLE,dominantBaseline:rn.BASELINE}:{textAnchor:nn.START,dominantBaseline:rn.BASELINE}}function sk(e,t){return(e%t+t)%t}function Rn(e,[t,n]){return e>=t&&e<=n}function jg(e){return e*(180/Math.PI)}function Ft(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 ak(e,t){return t*Math.sin(e-Math.PI/2)}function Wg(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 ok(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 Mc(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 lk(e){return e.depth}function ck(e,t){return t-1-e.height}function qg(e,t){return e.sourceLinks.length?e.depth:t-1}function qa(e){return function(){return e}}function Yg(e,t){return Ya(e.source,t.source)||e.index-t.index}function Xg(e,t){return Ya(e.target,t.target)||e.index-t.index}function Ya(e,t){return e.y0-t.y0}function Cc(e){return e.value}function uk(e){return e.index}function hk(e){return e.nodes}function dk(e){return e.links}function Zg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Kg({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 fk(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=uk,l=qg,c,u,h=hk,d=dk,f=6;function p(){const w={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return m(w),g(w),v(w),y(w),_(w),Kg(w),w}p.update=function(w){return Kg(w),w},p.nodeId=function(w){return arguments.length?(o=typeof w=="function"?w:qa(w),p):o},p.nodeAlign=function(w){return arguments.length?(l=typeof w=="function"?w:qa(w),p):l},p.nodeSort=function(w){return arguments.length?(c=w,p):c},p.nodeWidth=function(w){return arguments.length?(i=+w,p):i},p.nodePadding=function(w){return arguments.length?(s=a=+w,p):s},p.nodes=function(w){return arguments.length?(h=typeof w=="function"?w:qa(w),p):h},p.links=function(w){return arguments.length?(d=typeof w=="function"?w:qa(w),p):d},p.linkSort=function(w){return arguments.length?(u=w,p):u},p.size=function(w){return arguments.length?(e=t=0,n=+w[0],r=+w[1],p):[n-e,r-t]},p.extent=function(w){return arguments.length?(e=+w[0][0],n=+w[1][0],t=+w[0][1],r=+w[1][1],p):[[e,t],[n,r]]},p.iterations=function(w){return arguments.length?(f=+w,p):f};function m({nodes:w,links:P}){for(const[I,B]of w.entries())B.index=I,B.sourceLinks=[],B.targetLinks=[];const U=new Map(w.map((I,B)=>[o(I,B,w),I]));for(const[I,B]of P.entries()){B.index=I;let{source:j,target:Y}=B;typeof j!="object"&&(j=B.source=Zg(U,j)),typeof Y!="object"&&(Y=B.target=Zg(U,Y)),j.sourceLinks.push(B),Y.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:I,targetLinks:B}of w)I.sort(u),B.sort(u)}function g({nodes:w}){for(const P of w)P.value=P.fixedValue===void 0?Math.max(Mc(P.sourceLinks,Cc),Mc(P.targetLinks,Cc)):P.fixedValue}function v({nodes:w}){const P=w.length;let U=new Set(w),I=new Set,B=0;for(;U.size;){for(const j of U){j.depth=B;for(const{target:Y}of j.sourceLinks)I.add(Y)}if(++B>P)throw new Error("circular link");U=I,I=new Set}}function y({nodes:w}){const P=w.length;let U=new Set(w),I=new Set,B=0;for(;U.size;){for(const j of U){j.height=B;for(const{source:Y}of j.targetLinks)I.add(Y)}if(++B>P)throw new Error("circular link");U=I,I=new Set}}function b({nodes:w}){const P=Wg(w,B=>B.depth)+1,U=(n-e-i)/(P-1),I=new Array(P);for(const B of w){const j=Math.max(0,Math.min(P-1,Math.floor(l.call(null,B,P))));B.layer=j,B.x0=e+j*U,B.x1=B.x0+i,I[j]?I[j].push(B):I[j]=[B]}if(c)for(const B of I)B.sort(c);return I}function S(w){const P=ok(w,U=>(r-t-(U.length-1)*a)/Mc(U,Cc));for(const U of w){let I=t;for(const B of U){B.y0=I,B.y1=I+B.value*P,I=B.y1+a;for(const j of B.sourceLinks)j.width=j.value*P}I=(r-I+a)/(U.length+1);for(let B=0;B<U.length;++B){const j=U[B];j.y0+=I*(B+1),j.y1+=I*(B+1)}V(U)}}function _(w){const P=b(w);a=Math.min(s,(r-t)/(Wg(P,U=>U.length)-1)),S(P);for(let U=0;U<f;++U){const I=Math.pow(.99,U),B=Math.max(1-I,(U+1)/f);T(P,I,B),E(P,I,B)}}function E(w,P,U){for(let I=1,B=w.length;I<B;++I){const j=w[I];for(const Y of j){let et=0,pt=0;for(const{source:K,value:ht}of Y.targetLinks){let it=ht*(Y.layer-K.layer);et+=M(K,Y)*it,pt+=it}if(!(pt>0))continue;let z=(et/pt-Y.y0)*P;Y.y0+=z,Y.y1+=z,C(Y)}c===void 0&&j.sort(Ya),D(j,U)}}function T(w,P,U){for(let I=w.length,B=I-2;B>=0;--B){const j=w[B];for(const Y of j){let et=0,pt=0;for(const{target:K,value:ht}of Y.sourceLinks){let it=ht*(K.layer-Y.layer);et+=A(Y,K)*it,pt+=it}if(!(pt>0))continue;let z=(et/pt-Y.y0)*P;Y.y0+=z,Y.y1+=z,C(Y)}c===void 0&&j.sort(Ya),D(j,U)}}function D(w,P){const U=w.length>>1,I=w[U];L(w,I.y0-a,U-1,P),N(w,I.y1+a,U+1,P),L(w,r,w.length-1,P),N(w,t,0,P)}function N(w,P,U,I){for(;U<w.length;++U){const B=w[U],j=(P-B.y0)*I;j>1e-6&&(B.y0+=j,B.y1+=j),P=B.y1+a}}function L(w,P,U,I){for(;U>=0;--U){const B=w[U],j=(B.y1-P)*I;j>1e-6&&(B.y0-=j,B.y1-=j),P=B.y0-a}}function C({sourceLinks:w,targetLinks:P}){if(u===void 0){for(const{source:{sourceLinks:U}}of P)U.sort(Xg);for(const{target:{targetLinks:U}}of w)U.sort(Yg)}}function V(w){if(u===void 0)for(const{sourceLinks:P,targetLinks:U}of w)P.sort(Xg),U.sort(Yg)}function M(w,P){let U=w.y0-(w.sourceLinks.length-1)*a/2;for(const{target:I,width:B}of w.sourceLinks){if(I===P)break;U+=B+a}for(const{source:I,width:B}of P.targetLinks){if(I===w)break;U-=B}return U}function A(w,P){let U=P.y0-(P.targetLinks.length-1)*a/2;for(const{source:I,width:B}of P.targetLinks){if(I===w)break;U+=B+a}for(const{target:I,width:B}of w.sourceLinks){if(I===P)break;U-=B}return U}return p}var $c=Math.PI,Ac=2*$c,ur=1e-6,pk=Ac-ur;function Lc(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Qg(){return new Lc}Lc.prototype=Qg.prototype={constructor:Lc,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,h=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(h>ur)if(!(Math.abs(u*o-l*c)>ur)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var d=n-s,f=r-a,p=o*o+l*l,m=d*d+f*f,g=Math.sqrt(p),v=Math.sqrt(h),y=i*Math.tan(($c-Math.acos((p+h-m)/(2*g*v)))/2),b=y/v,S=y/g;Math.abs(b-1)>ur&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+S*o)+","+(this._y1=t+S*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,h=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)>ur||Math.abs(this._y1-c)>ur)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%Ac+Ac),h>pk?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>ur&&(this._+="A"+n+","+n+",0,"+ +(h>=$c)+","+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 Jg(e){return function(){return e}}function gk(e){return e[0]}function mk(e){return e[1]}var vk=Array.prototype.slice;function yk(e){return e.source}function bk(e){return e.target}function xk(e){var t=yk,n=bk,r=gk,i=mk,s=null;function a(){var o,l=vk.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Qg()),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:Jg(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Jg(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function wk(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function _k(){return xk(wk)}function Ek(e){return[e.source.x1,e.y0]}function Sk(e){return[e.target.x0,e.y1]}function Ok(){return _k().source(Ek).target(Sk)}function tm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tk(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 Mk={value:function(){}};function em(){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 Xa(n)}function Xa(e){this._=e}function Ck(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}})}Xa.prototype=em.prototype={constructor:Xa,on:function(e,t){var n=this._,r=Ck(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=$k(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]=nm(n[i],e.name,t);else if(t==null)for(i in n)n[i]=nm(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 Xa(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 $k(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function nm(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Mk,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const Ak=Tk(Object.freeze(Object.defineProperty({__proto__:null,dispatch:em},Symbol.toStringTag,{value:"Module"}))).dispatch,kc=Math.PI/180,Lk={archimedean:im,rectangular:Fk},es=64,Za=2048;var kk=function(){var e=[256,256],t=Dk,n=Rk,r=Ik,i=rm,s=rm,a=Nk,o=Pk,l=im,c=[],u=1/0,h=Ak("word","end"),d=null,f=Math.random,p={},m=zk;p.canvas=function(y){return arguments.length?(m=In(y),p):m},p.start=function(){var y=g(m()),b=Gk((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,T=[],D=c.map(function(L,C){return L.text=t.call(this,L,C),L.font=n.call(this,L,C),L.style=i.call(this,L,C),L.weight=s.call(this,L,C),L.rotate=a.call(this,L,C),L.size=~~r.call(this,L,C),L.padding=o.call(this,L,C),L}).sort(function(L,C){return C.size-L.size});return d&&clearInterval(d),d=setInterval(N,0),N(),p;function N(){for(var L=Date.now();Date.now()-L<u&&++E<_&&d;){var C=D[E];C.x=e[0]*(f()+.5)>>1,C.y=e[1]*(f()+.5)>>1,Uk(y,C,D,E),C.hasText&&v(b,C,S)&&(T.push(C),h.call("word",p,C),S?Vk(S,C):S=[{x:C.x+C.x0,y:C.y+C.y0},{x:C.x+C.x1,y:C.y+C.y1}],C.x-=e[0]>>1,C.y-=e[1]>>1)}E>=_&&(p.stop(),h.call("end",p,T,S))}},p.stop=function(){d&&(clearInterval(d),d=null);for(const y of c)delete y.sprite;return p};function g(y){const b=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const S=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return y.width=(es<<5)/S,y.height=Za/S,b.fillStyle=b.strokeStyle="red",{context:b,ratio:S}}function v(y,b,S){e[0],e[1];for(var _=b.x,E=b.y,T=Math.sqrt(e[0]*e[0]+e[1]*e[1]),D=l(e),N=f()<.5?1:-1,L=-N,C,V,M;(C=D(L+=N))&&(V=~~C[0],M=~~C[1],!(Math.min(Math.abs(V),Math.abs(M))>=T));)if(b.x=_+V,b.y=E+M,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!S||Hk(b,S))&&!Bk(b,y,e[0])){for(var A=b.sprite,w=b.width>>5,P=e[0]>>5,U=b.x-(w<<4),I=U&127,B=32-I,j=b.y1-b.y0,Y=(b.y+b.y0)*P+(U>>5),et,pt=0;pt<j;pt++){et=0;for(var z=0;z<=w;z++)y[Y+z]|=et<<B|(z<w?(et=A[pt*w+z])>>>I:0);Y+=P}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=In(y),p):n},p.fontStyle=function(y){return arguments.length?(i=In(y),p):i},p.fontWeight=function(y){return arguments.length?(s=In(y),p):s},p.rotate=function(y){return arguments.length?(a=In(y),p):a},p.text=function(y){return arguments.length?(t=In(y),p):t},p.spiral=function(y){return arguments.length?(l=Lk[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=In(y),p):r},p.padding=function(y){return arguments.length?(o=In(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=h.on.apply(h,arguments);return y===h?p:y},p};function Dk(e){return e.text}function Rk(){return"serif"}function rm(){return"normal"}function Ik(e){return Math.sqrt(e.value)}function Nk(){return(~~(random()*6)-3)*30}function Pk(){return 1}function Uk(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(es<<5)/s,Za/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 C=i.measureText(t.text),V=-Math.floor(C.width/2);let M=(C.width+1)*s,A=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*kc),h=Math.cos(t.rotate*kc),d=M*h,f=M*u,p=A*h,m=A*u;M=Math.max(Math.abs(d+m),Math.abs(d-m))+31>>5<<5,A=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else M=M+31>>5<<5;if(A>l&&(l=A),a+M>=es<<5&&(a=0,o+=l,l=0),o+A>=Za)break;i.translate((a+(M>>1))/s,(o+(A>>1))/s),t.rotate&&i.rotate(t.rotate*kc),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=A,t.xoff=a,t.yoff=o,t.x1=M>>1,t.y1=A>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=M}for(var g=i.getImageData(0,0,(es<<5)/s,Za/s).data,v=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,b=y>>5,S=t.y1-t.y0,_=0;_<S*b;_++)v[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,T=-1,D=0;D<S;D++){for(var _=0;_<y;_++){var N=b*D+(_>>5),L=g[(o+D)*(es<<5)+(a+_)<<2]?1<<31-_%32:0;v[N]|=L,E|=L}E?T=D:(t.y0++,S--,D--,o++)}t.y1=t.y0+T,t.sprite=v.slice(0,(t.y1-t.y0)*b)}}}function Bk(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,h=0;h<l;h++){u=0;for(var d=0;d<=i;d++)if((u<<o|(d<i?(u=r[h*i+d])>>>a:0))&t[c+d])return!0;c+=n}return!1}function Vk(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 Hk(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 im(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function Fk(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 Gk(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function zk(){return document.createElement("canvas")}function In(e){return typeof e=="function"?e:function(){return e}}const jk=tm(kk);function Wk(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 qk(e){return function(t){return e==null?void 0:e[t]}}var Yk={À:"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"},Xk=qk(Yk);const Zk=Xk;var Kk=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qk="\\u0300-\\u036f",Jk="\\ufe20-\\ufe2f",tD="\\u20d0-\\u20ff",eD=Qk+Jk+tD,nD="["+eD+"]",rD=RegExp(nD,"g");function iD(e){return e=qi(e),e&&e.replace(Kk,Zk).replace(rD,"")}var sD=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function aD(e){return e.match(sD)||[]}var oD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function lD(e){return oD.test(e)}var sm="\\ud800-\\udfff",cD="\\u0300-\\u036f",uD="\\ufe20-\\ufe2f",hD="\\u20d0-\\u20ff",dD=cD+uD+hD,am="\\u2700-\\u27bf",om="a-z\\xdf-\\xf6\\xf8-\\xff",fD="\\xac\\xb1\\xd7\\xf7",pD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gD="\\u2000-\\u206f",mD=" \\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",lm="A-Z\\xc0-\\xd6\\xd8-\\xde",vD="\\ufe0e\\ufe0f",cm=fD+pD+gD+mD,um="['’]",hm="["+cm+"]",yD="["+dD+"]",dm="\\d+",bD="["+am+"]",fm="["+om+"]",pm="[^"+sm+cm+dm+am+om+lm+"]",xD="\\ud83c[\\udffb-\\udfff]",wD="(?:"+yD+"|"+xD+")",_D="[^"+sm+"]",gm="(?:\\ud83c[\\udde6-\\uddff]){2}",mm="[\\ud800-\\udbff][\\udc00-\\udfff]",zr="["+lm+"]",ED="\\u200d",vm="(?:"+fm+"|"+pm+")",SD="(?:"+zr+"|"+pm+")",ym="(?:"+um+"(?:d|ll|m|re|s|t|ve))?",bm="(?:"+um+"(?:D|LL|M|RE|S|T|VE))?",xm=wD+"?",wm="["+vD+"]?",OD="(?:"+ED+"(?:"+[_D,gm,mm].join("|")+")"+wm+xm+")*",TD="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MD="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",CD=wm+xm+OD,$D="(?:"+[bD,gm,mm].join("|")+")"+CD,AD=RegExp([zr+"?"+fm+"+"+ym+"(?="+[hm,zr,"$"].join("|")+")",SD+"+"+bm+"(?="+[hm,zr+vm,"$"].join("|")+")",zr+"?"+vm+"+"+ym,zr+"+"+bm,MD,TD,dm,$D].join("|"),"g");function LD(e){return e.match(AD)||[]}function kD(e,t,n){return e=qi(e),t=n?void 0:t,t===void 0?lD(e)?LD(e):aD(e):e.match(t)||[]}var DD="['’]",RD=RegExp(DD,"g");function _m(e){return function(t){return Wk(kD(iD(t).replace(RD,"")),e,"")}}function ID(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Em(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),ID(ts(e),t,n)}function ND(e,t){var n=-1,r=ir(e)?Array(e.length):[];return xc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function PD(e,t){var n=te(e)?ip:ND;return n(e,Ua(t))}var UD=1/0;function BD(e,t){return Da(PD(e,t),UD)}function Sm(e,t){return Pa(e,t)}var VD=_m(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const jr=VD;function HD(e,t){var n;return xc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function FD(e,t,n){var r=te(e)?Qp:HD;return n&&pp(e,t,n)&&(t=void 0),r(e,Ua(t))}class ft{constructor(t,n,r){if(this.type="",this.renderType=Q.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=x(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(R(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=x(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${ge}--${i}--${this.type}`,!0),r&&r.classed(`${ge}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=x(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=k.appendOrSelect(this.parent,`${this.renderType===Q.SVG?"svg":"div"}${r}.${ge}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=R(`#${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?rt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const Om=class Bv extends ft{constructor(){super(...arguments),this.type="toolbar",this.renderType=Q.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(x(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
|
|
4
4
|
<button
|
|
5
5
|
class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
|
|
6
6
|
aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${l.id}`)}" aria-label="${l.title}">
|
|
@@ -68,19 +68,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
68
68
|
</div>
|
|
69
69
|
${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
|
|
70
70
|
</div>
|
|
71
|
-
</li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=x(r,"tooltip","valueFormatter");if(i)return i(t,n);if(typeof t.getTime=="function")return Ir(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 Ir(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!1){const n=this.getOptions(),r=x(n,"tooltip","enabled");if(r){const i=R(this.services.domUtils.getHolder()),s=x(n,"style","prefix");this.tooltip=k.appendOrSelect(i,`div.${ge}--${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=x(i,"zoomBar","top","enabled");let a=x(t,"detail","mousePosition");if(!a)a=Fn(x(t,"detail","event"),n);else{const d=x(i,"zoomBar","top","type"),f=_e.height[d];s&&(a[1]+=f+_e.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=ne.LEFT:a[0]/o<.1?c=ne.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[ne.RIGHT,ne.LEFT,ne.TOP,ne.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=tA;c===ne.LEFT&&(u*=-1);const h=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,h)}}const Hm=class oo extends ft{constructor(){super(...arguments),this.type="grid-brush",this.renderType=Q.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(),h=c.getMainXScale(),[d]=h.range();r.attr("transform",`translate(${d},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(h&&u===Z.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const m=_=>{const E=_[1]-_[0];let T="0,"+E.toString();const D=Math.floor(l/oo.DASH_LENGTH),N=D*oo.DASH_LENGTH;for(let A=0;A<D;A++)T+=","+oo.DASH_LENGTH;T+=","+(l-N),D%2===1&&(T+=",0"),T+=","+E.toString(),T+=","+l.toString(),f.attr("stroke-dasharray",T)},g=_=>{const E=_.selection;E===null||E[0]===E[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),m(E))},v=(_,E)=>{const T=Sf().range([0,o]).domain(p);let D=[T.invert(_),T.invert(E)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let y;const b=_=>{const E=_.selection;E!==null&&(v(E[0],E[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=Bh().extent([[0,0],[o-1,l]]).on("start brush end",g).on("end.brushed",b),s.call(y));const S=this.services.zoom.getZoomRatio();i.on("click",function(_){if(_.shiftKey){const E=this.services.domUtils.getHolder(),T=Fn(s.node(),E)[0];let D=T-o*S/2;D<0&&(D=0);let N=T+o*S/2;N>o&&(N=o),v(D,N)}})}}};Hm.DASH_LENGTH=4;let iI=Hm;class sI extends ft{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=Q.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Bh(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",H.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(H.TOP),i=this.services.zoom.isZoomBarLocked(H.TOP),s=x(this.getOptions(),"zoomBar",H.TOP,"type"),a=x(this.getOptions(),"axes",H.BOTTOM,"highlights"),o=_e.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 h=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",_e.spacerHeight).attr("opacity",1).attr("fill","none"),s===je.GRAPH_VIEW?k.appendOrSelect(h,"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===je.SLIDER_VIEW&&k.appendOrSelect(h,"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(h,c,l);return}const{cartesianScales:d}=this.services,f=d.getMainXScale(),p=d.getMainYScale(),m=d.getMainXScaleType();if(f&&m===Z.TIME){let g=this.services.zoom.getZoomBarData();if(Fe(g)||g.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(g);g=this.compensateDataForDefaultDomain(g,v);const y=this.model.get("initialZoomDomain"),b=x(this.getOptions(),"zoomBar",H.TOP,"initialZoomDomain");b&&b[0]&&b[1]&&(b[0]=new Date(b[0]),b[1]=new Date(b[1])),b&&!(y&&y[0].valueOf()===b[0].valueOf()&&y[1].valueOf()===b[1].valueOf())?this.model.set({initialZoomDomain:rt([],b),zoomDomain:b?rt([],b):v},{skipUpdate:!0}):b===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:rt([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Re(g,E=>E.value));const S=this.model.get("zoomDomain");if(s===je.GRAPH_VIEW&&(this.renderZoomBarArea(h,"path.zoom-graph-area-unselected",g,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(h,"path.zoom-graph-area",g,this.clipId),this.renderZoomBarBaseline(h,c,l),a)){const E=a.highlightStartMapsTo,T=a.highlightEndMapsTo,D=a.color,N=a.labelMapsTo;a.data.forEach((A,C)=>{k.appendOrSelect(h,`rect.highlight-${C}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(A[E])).attr("width",this.xScale(A[T])-this.xScale(A[E])).style("fill",D&&D.scale[A[N]]?D.scale[A[N]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[A[N]]?D.scale[A[N]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(S,c,l);const _=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(S!==void 0)if(S[0].valueOf()===S[1].valueOf())_.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const E=S.map(T=>this.xScale(T));E[1]-E[0]<this.MIN_SELECTION_DIFF||(_.call(this.brush.move,E),this.updateBrushHandle(this.getComponentContainer(),E))}i&&(this.brush.filter(()=>!1),_.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=x(this.getOptions(),"zoomBar",H.TOP,"type"),a=_e.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=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=_e.handleWidth,s=x(this.getOptions(),"zoomBar",H.TOP,"type"),a=_e.height[s],o=-i/2,l=_e.handleBarWidth,c=s===je.GRAPH_VIEW?_e.handleBarHeight:6,u=-l/2,h=(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 d=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),d.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",h).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===je.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=x(this.getOptions(),"zoomBar",H.TOP,"type"),r=_e.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=(v,y,b)=>S=>s.getValueFromScale(v,y,b,S),h=u(this.xScale,l,a),d=u(this.yScale,c,o),f=x(this.getOptions(),"zoomBar",H.TOP,"type"),p=_e.height[f],m=Ul().x(v=>h(v)).y0(p).y1(v=>p-d(v)),g=k.appendOrSelect(t,n).datum(r).attr("d",m);i&&g.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=vn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=x(this.model.getOptions(),"zoomBar",H.TOP,"type"),a=_e.height[s],o=Ii()([[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),x(this.getOptions(),"zoomBar",H.TOP,"type")===je.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 aI extends ft{constructor(t,n){super(t,n),this.type="threshold",this.renderType=Q.SVG,this.positionService=new so}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(H).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),h=l.services.cartesianScales.getScaleTypeByPosition(c);let d=null,f=null;c===H.LEFT||c===H.RIGHT?(f=u,d=l.services.cartesianScales.getMainXScale()):(d=u,f=l.services.cartesianScales.getMainYScale());const p=h===Z.LABELS,[m,g]=d.range(),[v,y]=f.range(),{cartesianScales:b}=l.services,S=b.getOrientation(),_=A=>b.getDomainValue(A),E=A=>b.getRangeValue(A),[T,D]=wn(_,E,S),N=R(this);c===H.TOP||c===H.BOTTOM?(N.selectAll("line.threshold-line").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"threshold-line-update",animate:t})).attr("y1",y).attr("y2",v).attr("x1",({datum:A})=>T(A)+(p?u.step()/2:0)).attr("x2",({datum:A})=>T(A)+(p?u.step()/2:0)).style("stroke",({fillColor:A})=>A),N.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:A})=>-T(A)).attr("width",Math.abs(v-y)).classed("rotate",!0)):(N.selectAll("line.threshold-line").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"threshold-line-update",animate:t})).attr("x1",m).attr("x2",g).attr("y1",({datum:A})=>D(A)+(p?u.step()/2:0)).attr("y2",({datum:A})=>D(A)+(p?u.step()/2:0)).style("stroke",({fillColor:A})=>A),N.selectAll("rect.threshold-hoverable-area").attr("x",m).attr("y",({datum:A})=>D(A)).attr("width",Math.abs(g-m)).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)===Z.TIME){const s=[H.LEFT,H.RIGHT].includes(r),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),l=s?o:a,c=x(i,"timeScale"),u=bc(l.ticks(),x(c,"timeInterval"));return yc(n,0,l.ticks(),u,c)}return n.toLocaleString("en")}appendThresholdLabel(){const t=R(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${ge}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Fn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${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,[ne.RIGHT,ne.LEFT,ne.TOP,ne.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=x(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){R(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(O.Threshold.SHOW,{event:n,hoveredElement:R(this),datum:R(this).datum()})}).on("mouseout",function(n){R(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(O.Threshold.HIDE,{event:n,hoveredElement:R(this),datum:R(this).datum()})})}}class oI extends ft{constructor(t,n){super(t,n),this.type="highlight",this.renderType=Q.SVG,this.positionService=new so,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(H).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(),h=l.services.cartesianScales.getMainYScale(),[d,f]=u.range(),[p,m]=h.range(),{cartesianScales:g}=l.services,v=g.getOrientation(),y=T=>g.getDomainValue(T),b=T=>g.getRangeValue(T),[S,_]=wn(y,b,v),E=R(this);c===H.TOP||c===H.BOTTOM?E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("y",Math.max(m+l.highlightStrokeWidth,0)).attr("height",Math.max(p-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:T,...D})=>S(D[T])).attr("width",({highlightStartMapsTo:T,highlightEndMapsTo:D,...N})=>Math.max(S(N[D])-S(N[T]),0)).style("stroke",({color:T,labelMapsTo:D,...N})=>T&&T.scale[N[D]]?T.scale[N[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:D,...N})=>T&&T.scale[N[D]]?T.scale[N[D]]:null):E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("x",d).attr("width",Math.max(f-d,0)).attr("y",({highlightEndMapsTo:T,...D})=>_(D[T])).attr("height",({highlightStartMapsTo:T,highlightEndMapsTo:D,...N})=>Math.max(_(N[T])-_(N[D]),0)).style("stroke",({color:T,labelMapsTo:D,...N})=>T&&T.scale[N[D]]?T.scale[N[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:D,...N})=>T&&T.scale[N[D]]?T.scale[N[D]]:null)})}}class Fm extends Zc{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 h;if(n.length===1){const d=n[0],f=i.getRangeIdentifier(d);if(a){const m=i.getRangeAxisPosition({datum:d,groups:[d[o]]});c=i.getScaleLabel(m)}const p=d[f];h=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:d[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(m=>h.push({label:m.label,value:m.value})),h.push({label:r.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(h=[{label:l,value:u}],h=h.concat(n.map(d=>{const f=d[i.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:d[o]})}}).sort((d,f)=>f.value-d.value)),!a&&x(r,"tooltip","showTotal")===!0)){const d=i.getRangeIdentifier();h.push({label:At(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[d],0),bold:!0})}return h}}class lI extends ft{constructor(){super(...arguments),this.type="alluvial",this.renderType=Q.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=x(this.getOptions(),"color","gradient","enabled");let l=Ge.minNodePadding;s.alluvial.nodePadding>Ge.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=qg;c===qt.LEFT?u=lk:c===qt.RIGHT&&(u=ck);const h=fk().nodeId(g=>g.name).nodeWidth(Ge.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=h({nodes:s.alluvial.nodes.map(g=>Object.assign({},g)),links:a.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const d={};this.graph.nodes.forEach(g=>{const v=g.x0;g.category&&(d[v]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(d)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,v)=>this.services.domUtils.generateElementIDString(`alluvial-category-${v}`)).style("font-size","14px").text(g=>d[g]?d[g]:"").attr("y",20).attr("x",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-category-${v}`),{width:b}=k.getSVGElementSize(R(`text#${y}`),{useBBox:!0});let S=0;return g+S>=b&&(S=-b+4),S});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=x(this.getOptions(),"color","scale");g&&f.enter().append("linearGradient").attr("id",v=>`${this.gradient_id}-link-${v.index}`).attr("gradientUnits","userSpaceOnUse").call(v=>v.append("stop").attr("offset","0%").attr("stop-color",y=>g[y.source.name])).call(v=>v.append("stop").attr("offset","100%").attr("stop-color",y=>g[y.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",Ok()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name)).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",Ge.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);p.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const m=p.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`));m.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${g.value})`).attr("aria-label",g=>`${g.name} (${g.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:b}=k.getSVGElementSize(R(`text#${y}`),{useBBox:!0});return b+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:b}=k.getSVGElementSize(R(`text#${y}`),{useBBox:!0}),S=(g.y1-g.y0)/2-9;let _=g.x1-g.x0;return g.x1>=b?_=_-(b+16):_+=4,`translate(${_}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=Fa((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"?(R(i).lower(),a.style("stroke-opacity",Ge.opacity.default)):a.style("stroke-opacity",function(){return i===this?(R(this).raise(),Ge.opacity.selected):Ge.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(i,s){const a=R(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:R(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:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(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=Fa((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",Ge.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)?(R(this).classed("link-hovered",!0).raise(),Ge.opacity.selected):Ge.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=R(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=Ki(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}`),h=Ki(u.attr("transform"));u.attr("transform",`translate(${h.x+4},${h.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:R(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:R(this),datum:i})}).on("mouseout",function(r,i){const s=R(this),a=Ki(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Ge.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Ki(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`
|
|
71
|
+
</li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=x(r,"tooltip","valueFormatter");if(i)return i(t,n);if(typeof t.getTime=="function")return Ir(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 Ir(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!1){const n=this.getOptions(),r=x(n,"tooltip","enabled");if(r){const i=R(this.services.domUtils.getHolder()),s=x(n,"style","prefix");this.tooltip=k.appendOrSelect(i,`div.${ge}--${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=x(i,"zoomBar","top","enabled");let a=x(t,"detail","mousePosition");if(!a)a=Fn(x(t,"detail","event"),n);else{const d=x(i,"zoomBar","top","type"),f=_e.height[d];s&&(a[1]+=f+_e.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=ne.LEFT:a[0]/o<.1?c=ne.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[ne.RIGHT,ne.LEFT,ne.TOP,ne.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=tA;c===ne.LEFT&&(u*=-1);const h=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,h)}}const Hm=class oo extends ft{constructor(){super(...arguments),this.type="grid-brush",this.renderType=Q.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(),h=c.getMainXScale(),[d]=h.range();r.attr("transform",`translate(${d},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(h&&u===Z.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const m=_=>{const E=_[1]-_[0];let T="0,"+E.toString();const D=Math.floor(l/oo.DASH_LENGTH),N=D*oo.DASH_LENGTH;for(let L=0;L<D;L++)T+=","+oo.DASH_LENGTH;T+=","+(l-N),D%2===1&&(T+=",0"),T+=","+E.toString(),T+=","+l.toString(),f.attr("stroke-dasharray",T)},g=_=>{const E=_.selection;E===null||E[0]===E[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),m(E))},v=(_,E)=>{const T=Sf().range([0,o]).domain(p);let D=[T.invert(_),T.invert(E)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let y;const b=_=>{const E=_.selection;E!==null&&(v(E[0],E[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=Bh().extent([[0,0],[o-1,l]]).on("start brush end",g).on("end.brushed",b),s.call(y));const S=this.services.zoom.getZoomRatio();i.on("click",function(_){if(_.shiftKey){const E=this.services.domUtils.getHolder(),T=Fn(s.node(),E)[0];let D=T-o*S/2;D<0&&(D=0);let N=T+o*S/2;N>o&&(N=o),v(D,N)}})}}};Hm.DASH_LENGTH=4;let iI=Hm;class sI extends ft{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=Q.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Bh(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",H.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(H.TOP),i=this.services.zoom.isZoomBarLocked(H.TOP),s=x(this.getOptions(),"zoomBar",H.TOP,"type"),a=x(this.getOptions(),"axes",H.BOTTOM,"highlights"),o=_e.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 h=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",_e.spacerHeight).attr("opacity",1).attr("fill","none"),s===je.GRAPH_VIEW?k.appendOrSelect(h,"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===je.SLIDER_VIEW&&k.appendOrSelect(h,"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(h,c,l);return}const{cartesianScales:d}=this.services,f=d.getMainXScale(),p=d.getMainYScale(),m=d.getMainXScaleType();if(f&&m===Z.TIME){let g=this.services.zoom.getZoomBarData();if(Fe(g)||g.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(g);g=this.compensateDataForDefaultDomain(g,v);const y=this.model.get("initialZoomDomain"),b=x(this.getOptions(),"zoomBar",H.TOP,"initialZoomDomain");b&&b[0]&&b[1]&&(b[0]=new Date(b[0]),b[1]=new Date(b[1])),b&&!(y&&y[0].valueOf()===b[0].valueOf()&&y[1].valueOf()===b[1].valueOf())?this.model.set({initialZoomDomain:rt([],b),zoomDomain:b?rt([],b):v},{skipUpdate:!0}):b===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:rt([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Re(g,E=>E.value));const S=this.model.get("zoomDomain");if(s===je.GRAPH_VIEW&&(this.renderZoomBarArea(h,"path.zoom-graph-area-unselected",g,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(h,"path.zoom-graph-area",g,this.clipId),this.renderZoomBarBaseline(h,c,l),a)){const E=a.highlightStartMapsTo,T=a.highlightEndMapsTo,D=a.color,N=a.labelMapsTo;a.data.forEach((L,C)=>{k.appendOrSelect(h,`rect.highlight-${C}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(L[E])).attr("width",this.xScale(L[T])-this.xScale(L[E])).style("fill",D&&D.scale[L[N]]?D.scale[L[N]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[L[N]]?D.scale[L[N]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(S,c,l);const _=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(S!==void 0)if(S[0].valueOf()===S[1].valueOf())_.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const E=S.map(T=>this.xScale(T));E[1]-E[0]<this.MIN_SELECTION_DIFF||(_.call(this.brush.move,E),this.updateBrushHandle(this.getComponentContainer(),E))}i&&(this.brush.filter(()=>!1),_.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=x(this.getOptions(),"zoomBar",H.TOP,"type"),a=_e.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=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=_e.handleWidth,s=x(this.getOptions(),"zoomBar",H.TOP,"type"),a=_e.height[s],o=-i/2,l=_e.handleBarWidth,c=s===je.GRAPH_VIEW?_e.handleBarHeight:6,u=-l/2,h=(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 d=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),d.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",h).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===je.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=x(this.getOptions(),"zoomBar",H.TOP,"type"),r=_e.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=(v,y,b)=>S=>s.getValueFromScale(v,y,b,S),h=u(this.xScale,l,a),d=u(this.yScale,c,o),f=x(this.getOptions(),"zoomBar",H.TOP,"type"),p=_e.height[f],m=Ul().x(v=>h(v)).y0(p).y1(v=>p-d(v)),g=k.appendOrSelect(t,n).datum(r).attr("d",m);i&&g.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=vn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=x(this.model.getOptions(),"zoomBar",H.TOP,"type"),a=_e.height[s],o=Ii()([[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),x(this.getOptions(),"zoomBar",H.TOP,"type")===je.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 aI extends ft{constructor(t,n){super(t,n),this.type="threshold",this.renderType=Q.SVG,this.positionService=new so}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(H).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),h=l.services.cartesianScales.getScaleTypeByPosition(c);let d=null,f=null;c===H.LEFT||c===H.RIGHT?(f=u,d=l.services.cartesianScales.getMainXScale()):(d=u,f=l.services.cartesianScales.getMainYScale());const p=h===Z.LABELS,[m,g]=d.range(),[v,y]=f.range(),{cartesianScales:b}=l.services,S=b.getOrientation(),_=L=>b.getDomainValue(L),E=L=>b.getRangeValue(L),[T,D]=wn(_,E,S),N=R(this);c===H.TOP||c===H.BOTTOM?(N.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("y1",y).attr("y2",v).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),N.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:L})=>-T(L)).attr("width",Math.abs(v-y)).classed("rotate",!0)):(N.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("x1",m).attr("x2",g).attr("y1",({datum:L})=>D(L)+(p?u.step()/2:0)).attr("y2",({datum:L})=>D(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),N.selectAll("rect.threshold-hoverable-area").attr("x",m).attr("y",({datum:L})=>D(L)).attr("width",Math.abs(g-m)).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)===Z.TIME){const s=[H.LEFT,H.RIGHT].includes(r),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),l=s?o:a,c=x(i,"timeScale"),u=bc(l.ticks(),x(c,"timeInterval"));return yc(n,0,l.ticks(),u,c)}return n.toLocaleString("en")}appendThresholdLabel(){const t=R(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${ge}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Fn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${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,[ne.RIGHT,ne.LEFT,ne.TOP,ne.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=x(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){R(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(O.Threshold.SHOW,{event:n,hoveredElement:R(this),datum:R(this).datum()})}).on("mouseout",function(n){R(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(O.Threshold.HIDE,{event:n,hoveredElement:R(this),datum:R(this).datum()})})}}class oI extends ft{constructor(t,n){super(t,n),this.type="highlight",this.renderType=Q.SVG,this.positionService=new so,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(H).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(),h=l.services.cartesianScales.getMainYScale(),[d,f]=u.range(),[p,m]=h.range(),{cartesianScales:g}=l.services,v=g.getOrientation(),y=T=>g.getDomainValue(T),b=T=>g.getRangeValue(T),[S,_]=wn(y,b,v),E=R(this);c===H.TOP||c===H.BOTTOM?E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("y",Math.max(m+l.highlightStrokeWidth,0)).attr("height",Math.max(p-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:T,...D})=>S(D[T])).attr("width",({highlightStartMapsTo:T,highlightEndMapsTo:D,...N})=>Math.max(S(N[D])-S(N[T]),0)).style("stroke",({color:T,labelMapsTo:D,...N})=>T&&T.scale[N[D]]?T.scale[N[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:D,...N})=>T&&T.scale[N[D]]?T.scale[N[D]]:null):E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("x",d).attr("width",Math.max(f-d,0)).attr("y",({highlightEndMapsTo:T,...D})=>_(D[T])).attr("height",({highlightStartMapsTo:T,highlightEndMapsTo:D,...N})=>Math.max(_(N[T])-_(N[D]),0)).style("stroke",({color:T,labelMapsTo:D,...N})=>T&&T.scale[N[D]]?T.scale[N[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:D,...N})=>T&&T.scale[N[D]]?T.scale[N[D]]:null)})}}class Fm extends Zc{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 h;if(n.length===1){const d=n[0],f=i.getRangeIdentifier(d);if(a){const m=i.getRangeAxisPosition({datum:d,groups:[d[o]]});c=i.getScaleLabel(m)}const p=d[f];h=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:d[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(m=>h.push({label:m.label,value:m.value})),h.push({label:r.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(h=[{label:l,value:u}],h=h.concat(n.map(d=>{const f=d[i.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:d[o]})}}).sort((d,f)=>f.value-d.value)),!a&&x(r,"tooltip","showTotal")===!0)){const d=i.getRangeIdentifier();h.push({label:At(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[d],0),bold:!0})}return h}}class lI extends ft{constructor(){super(...arguments),this.type="alluvial",this.renderType=Q.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=x(this.getOptions(),"color","gradient","enabled");let l=Ge.minNodePadding;s.alluvial.nodePadding>Ge.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=qg;c===qt.LEFT?u=lk:c===qt.RIGHT&&(u=ck);const h=fk().nodeId(g=>g.name).nodeWidth(Ge.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=h({nodes:s.alluvial.nodes.map(g=>Object.assign({},g)),links:a.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const d={};this.graph.nodes.forEach(g=>{const v=g.x0;g.category&&(d[v]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(d)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,v)=>this.services.domUtils.generateElementIDString(`alluvial-category-${v}`)).style("font-size","14px").text(g=>d[g]?d[g]:"").attr("y",20).attr("x",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-category-${v}`),{width:b}=k.getSVGElementSize(R(`text#${y}`),{useBBox:!0});let S=0;return g+S>=b&&(S=-b+4),S});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=x(this.getOptions(),"color","scale");g&&f.enter().append("linearGradient").attr("id",v=>`${this.gradient_id}-link-${v.index}`).attr("gradientUnits","userSpaceOnUse").call(v=>v.append("stop").attr("offset","0%").attr("stop-color",y=>g[y.source.name])).call(v=>v.append("stop").attr("offset","100%").attr("stop-color",y=>g[y.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",Ok()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name)).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",Ge.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);p.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const m=p.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`));m.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${g.value})`).attr("aria-label",g=>`${g.name} (${g.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:b}=k.getSVGElementSize(R(`text#${y}`),{useBBox:!0});return b+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:b}=k.getSVGElementSize(R(`text#${y}`),{useBBox:!0}),S=(g.y1-g.y0)/2-9;let _=g.x1-g.x0;return g.x1>=b?_=_-(b+16):_+=4,`translate(${_}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=Fa((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"?(R(i).lower(),a.style("stroke-opacity",Ge.opacity.default)):a.style("stroke-opacity",function(){return i===this?(R(this).raise(),Ge.opacity.selected):Ge.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(i,s){const a=R(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:R(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:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(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=Fa((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",Ge.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)?(R(this).classed("link-hovered",!0).raise(),Ge.opacity.selected):Ge.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=R(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=Ki(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}`),h=Ki(u.attr("transform"));u.attr("transform",`translate(${h.x+4},${h.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:R(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:R(this),datum:i})}).on("mouseout",function(r,i){const s=R(this),a=Ki(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Ge.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Ki(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
72
|
<svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
|
|
73
73
|
<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"/>
|
|
74
74
|
<rect width="32" height="32"/>
|
|
75
|
-
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Oe extends ft{constructor(){super(...arguments),this.type="grid",this.renderType=Q.SVG}render(t=!0){const n=x(this.getOptions(),"grid","x","enabled"),r=x(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(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=yo(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=zu(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,h)=>Number(xn(u).tx)-Number(xn(h).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+xn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+xn(o).tx;else if(o)l=+xn(o).tx-+xn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+xn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=x(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=xn(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 Gm extends ft{constructor(){super(...arguments),this.type="area",this.renderType=Q.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?yn.opacity.unselected:yn.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",yn.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=Ul().curve(this.services.curves.getD3Curve()).defined(_=>{const E=s.getRangeIdentifier();return _[E]!=null}),l=this.model.getGroupedData(this.configs.groups),c=x(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let h=0;const d=(_,E)=>{x(r,"axes",_,"includeZero")===!1&&E[0]>0&&E[1]>0&&(h=E[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(h),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Qt.VERTICAL?(i=s.getMainYScale().domain(),d(s.getMainYAxisPosition(),i),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(i=s.getMainXScale().domain(),d(s.getMainXAxisPosition(),i),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const m=x(r,"color","gradient","enabled"),g=l&&l.length===1&&m;l.length>1&&m&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,_=>_.name),y=R(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(g){const _=y.select(`path.${this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:l[0].name})}`).node();let E;if(_)E=getComputedStyle(_,null).getPropertyValue("stroke");else{const T=x(this.model.getOptions(),"color","scale");if(T!==null){const D=Object.keys(T);E=T[D[0]]}}Tc.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:Tc.getStops(i,E)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const b=this,S=v.enter().append("path");g?S.merge(v).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:E}=_;return o(E)}):(S.attr("opacity",0).merge(v).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>b.model.getFillColor(_.name)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:yn.opacity.selected).attr("d",_=>{const{data:E}=_;return o(E)}),u&&S.attr("fill-opacity",yn.opacity.selected).style("stroke",_=>b.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 Yr extends ft{constructor(){super(...arguments),this.type="line",this.renderType=Q.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?bn.opacity.unselected:bn.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",bn.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]=wn(s,a,r.getOrientation()),c=this.getOptions(),u=Ii().x(o).y(l).curve(i.getD3Curve()).defined(f=>{const p=r.getRangeIdentifier(f);return f[p]!=null});let h=[];if(this.configs.stacked){const f=Object.keys(c.axes).some(m=>c.axes[m].percentage),{groupMapsTo:p}=c.data;h=this.model.getStackedData({groups:this.configs.groups,percentage:f}).map(m=>{const g=this.services.cartesianScales.getDomainIdentifier(m),v=this.services.cartesianScales.getRangeIdentifier(m);return{name:x(m,0,p),data:m.map(y=>({[g]:y.data.sharedStackKey,[p]:y[p],[v]:y[1]})),hidden:!FD(m,y=>y[0]!==y[1])}})}else h=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(h,f=>f.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(h,f=>f.name).attr("class",f=>this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",f=>{const{data:p}=f;return p.map(m=>{const g=this.services.cartesianScales.getRangeIdentifier(m);return m[g]}).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 zm=5;function cI(e,t){return e>t-zm&&e<t+zm}let Nn=class extends ft{constructor(){super(...arguments),this.type="ruler",this.renderType=Q.SVG,this.isXGridEnabled=x(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=x(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=x(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Qt.HORIZONTAL?r:n,h=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),d=k.appendOrSelect(h,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(g=>({domainValue:this.services.cartesianScales.getDomainValue(g),originalData:g})).filter(g=>cI(g.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(g=>g.domainValue).join()===this.pointsWithinLine.map(g=>g.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(O.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const m=this.pointsWithinLine.reduce((g,v)=>{if(g.length===0)return g.push(v),g;const y=g[0].domainValue,b=Math.abs(u-v.domainValue),S=Math.abs(u-y);return b>S||(b<S?g=[v]:g.push(v)),g},[]);if(m.length>0){const g=m.map(S=>S.originalData).filter(S=>{const _=this.services.cartesianScales.getRangeIdentifier(S);return S[_]!=null}),v=m.map(S=>S.domainValue),y=f.filter(S=>{const _=this.services.cartesianScales.getDomainValue(S);return v.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sm(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:d,data:this.formatTooltipData(g)}),h.attr("opacity",1);const b=m[0];s==="horizontal"?d.attr("x1",c).attr("x2",l).attr("y1",b.domainValue).attr("y2",b.domainValue):d.attr("y1",c).attr("y2",l).attr("x1",b.domainValue).attr("x2",b.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=Fn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=MA(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 Je extends ft{constructor(){super(...arguments),this.type="scatter",this.renderType=Q.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(x(this.getOptions(),"points","enabled")||x(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=wn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=wn(h=>r.getDomainValue(h),h=>r.getRangeValue(h),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,h]=wn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[tt.FILL,tt.STROKE]:[tt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",h).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",d?0:1).attr("role",lt.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=R(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[tt.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=R(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:R(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=R(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),h=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!h).style("fill",d=>h||c?t.model.getFillColor(d[n],d[u],d):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 jm extends ft{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=Q.SVG,this.truncation={[H.LEFT]:!1,[H.RIGHT]:!1,[H.TOP]:!1,[H.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=x(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===H.BOTTOM||n===H.TOP?(c=this.configs.axes[H.LEFT]?this.margins.left:0,u=this.configs.axes[H.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 h=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===Z.LABELS||this.scaleType===Z.LABELS_RATIO?h.rangeRound([c,u]):h.range([c,u]);let d;switch(n){case H.LEFT:d=zu;break;case H.BOTTOM:d=yo;break;case H.RIGHT:d=m0;break;case H.TOP:d=g0;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",`${lt.GRAPHICS_OBJECT} ${lt.GROUP}`),p.attr("aria-label",`${n} ticks`));const m=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),g=x(r,"axes",n),v=this.scaleType===Z.TIME||g.scaleType===Z.TIME,y=n===H.LEFT||n===H.RIGHT,b=this.model.get("zoomDomain");if(b&&v&&!y&&h.domain(b),!i){p.attr("aria-hidden",!0);return}const S=x(g,"scaleType"),_=x(r,"data","loading"),E=x(g,"ticks","number"),T=x(g,"ticks","values"),D=x(g,"truncation","type"),N=x(g,"truncation","threshold"),A=x(g,"truncation","numCharacter"),C=E!==null,V=x(r,"timeScale"),M=k.appendOrSelect(m,"g.tick"),L=k.appendOrSelect(M,"text").text("0"),w=k.getSVGElementSize(L.node(),{useBBox:!0}).height;M.remove();const P=this.scaleType||g.scaleType||Z.LINEAR,U=d(h).tickSizeOuter(0);if(h.ticks){let z;if(C?z=E:(z=kn.ticks.number,y&&(z=this.getNumberOfFittingTicks(o,w,kn.ticks.verticalSpaceRatio))),h.ticks().length===1&&h.ticks()[0]===0&&(z=0),U.ticks(z),v)if(!h.ticks(z).length)U.tickValues([]);else{const K=x(r,"timeScale","addSpaceOnEdges"),ht=x(r,"axes",n,"domain"),it=h.copy();K&&!ht&&it.nice(z);const Mt=it.ticks(z);K&&Mt.length>2&&!ht&&(Mt.splice(Mt.length-1,1),Mt.splice(0,1)),U.tickValues(Mt)}}let I;const B=x(g,"ticks","formatter");if(v){const z=bc(U.tickValues(),x(r,"timeScale","timeInterval"));B===null?I=(K,ht)=>yc(K,ht,U.tickValues(),z,V):I=(K,ht)=>{const it=yc(K,ht,U.tickValues(),z,V);return B(K,ht,it)}}else B===null?P===Z.LINEAR&&(I=z=>z.toLocaleString()):I=B;U.tickFormat(I);const[j,Y]=this.services.cartesianScales.getScaleByPosition(n).domain();let et;if(T){if(v)T.forEach((z,K)=>{z.getTime===void 0&&(T[K]=new Date(z))}),et=T.filter(z=>{const K=z.getTime();return K>=new Date(j).getTime()&&K<=new Date(Y).getTime()});else if(S===Z.LABELS){const z=this.services.cartesianScales.getScaleByPosition(n).domain();et=T.filter(K=>z.includes(K))}else et=T.filter(z=>z>=j&&z<=Y);U.tickValues(et)}switch(n){case H.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case H.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case H.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case H.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const pt=this.model.isDataEmpty();if(g.title){const z=k.appendOrSelect(l,"text.axis-title").html(pt||_?"":g.title),K=x(g,"titleOrientation");let ht;switch(n){case H.LEFT:K===uo.RIGHT?z.attr("transform","rotate(90)").attr("y",0).attr("x",h.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):z.attr("transform","rotate(-90)").attr("y",0).attr("x",-(h.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case H.BOTTOM:z.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case H.RIGHT:K===uo.LEFT?z.attr("transform","rotate(-90)").attr("y",a).attr("x",-(h.range()[0]/2)).style("text-anchor","middle"):z.attr("transform","rotate(90)").attr("y",-a).attr("x",h.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case H.TOP:ht=k.getSVGElementSize(z,{useBBox:!0}).height,z.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(v){const z=bc(U.tickValues(),x(r,"timeScale","timeInterval")),K=V.showDayName,ht=p;t&&(p=p.transition().call(it=>this.services.transitions.setupTransition({transition:it,name:"axis-update",animate:t}))),p=p.call(U),ht.selectAll(".tick").data(U.tickValues(),h).order().select("text").style("font-weight",(it,Mt)=>Sg(it,Mt,U.tickValues(),z,K)?"bold":"normal")}else!t||!f?p=p.call(U):p=p.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"axis-update",animate:t})).call(U);if(m.call(U),n===H.BOTTOM||n===H.TOP){let z=!1;const K=x(g,"ticks","rotation");if(K===us.ALWAYS)z=!0;else if(K===us.NEVER)z=!1;else if(!K||K===us.AUTO)if(h.step)z=m.selectAll("g.tick text").nodes().some(ht=>k.getSVGElementSize(ht,{useBBox:!0}).width>=h.step());else{z=!1;const ht=m.append("text").text("A"),it=k.getSVGElementSize(ht.node(),{useBBox:!0}).width;let Mt;m.selectAll("g.tick").each(function(){const W=R(this),J=parseFloat(x(xn(this),"tx"));J!==null&&Mt+W.text().length*it*.8>=J&&(z=!0),Mt=J}),ht.remove()}z?(C||(U.ticks(this.getNumberOfFittingTicks(a,w,kn.ticks.horizontalSpaceRatio)),m.call(U),p.call(U)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===H.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",z=>z),m.selectAll("g.tick").attr("aria-label",z=>z),D!==De.NONE&&S===Z.LABELS&&!T){const z=this.services.cartesianScales.getScaleDomain(n);if(z.length>0){const K=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(K);const ht=this;l.selectAll("g.tick text").data(z).text(function(it){return it.length>N?(ht.truncation[n]=!0,Qi(it,D,A)):it}),this.getInvisibleAxisRef().selectAll("g.tick text").data(z).text(function(it){return it.length>N?Qi(it,D,A):it}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(z)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:R(this),datum:u}),a===Z.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,hoveredElement:R(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:R(this),datum:u}),a===Z.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:R(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:R(this),datum:u}),a===Z.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 Em(i,2,kn.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 uI extends jm{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=R(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:h}=k.getSVGElementSize(c,{useBBox:!0}),d=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case H.LEFT:f=-u+Number(c.attr("x")),p=-(h/2);break;case H.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(h/2);break;case H.TOP:f=-(u/2),p=-h+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,d.attr("transform","rotate(-45)"));break;case H.BOTTOM:f=-(u/2),p=h/2-2,s.truncation[n]&&(f=-u,d.attr("transform","rotate(-45)"));break}d.attr("x",f-kn.hover.rectanglePadding).attr("y",p).attr("width",u+kn.hover.rectanglePadding*2).attr("height",h).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=R(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:h}),a===Z.LABELS&&h.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,element:u,datum:h})}).on("mousemove",function(c){const u=R(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:h}),l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:R(this).select("text"),datum:R(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:R(this).select("text"),datum:R(this).select("text").datum()}),a===Z.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 h=c.target.getBoundingClientRect();u.clientX=h.x,u.clientY=h.y}l.services.events.dispatchEvent(O.Axis.LABEL_FOCUS,{event:{...c,...u},element:R(this),datum:R(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:R(this),datum:R(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:R(this),datum:R(this).select("text").datum()})),n===H.LEFT||n===H.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 ve extends ft{constructor(){super(...arguments),this.type="2D-axes",this.renderType=Q.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(H),i=x(this.getOptions(),"axes");r.forEach(a=>{i[H[a]]&&(n[H[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=H[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===ds.DEFAULT?new jm(this.model,this.services,l):new uI(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:h}=k.getSVGElementSize(c,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=k.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===H.LEFT||l===H.RIGHT)&&(d+=5)),l){case H.TOP:s.top=h+d;break;case H.BOTTOM:s.bottom=h+d;break;case H.LEFT:s.left=u+d;break;case H.RIGHT:s.right=u+d;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 he extends ft{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=x(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Yt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Yt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Yt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Yt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Qt.VERTICAL&&this.drawYGrid(t),n===Qt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius(),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=Be().domain([0,1]).range(t),this.yScale=Be().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=x(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=x(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=x(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ri().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),h=t+Math.abs(kt.radiusOffset),d=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${h}, ${d})`).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+kt.xOffset;c===qt.CENTER?p=s/2:c===qt.RIGHT&&(p=s-t-kt.xOffset);const m=t+kt.yOffset;f.attr("transform",`translate(${p}, ${m})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+kt.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=`
|
|
75
|
+
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Oe extends ft{constructor(){super(...arguments),this.type="grid",this.renderType=Q.SVG}render(t=!0){const n=x(this.getOptions(),"grid","x","enabled"),r=x(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(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=yo(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=zu(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,h)=>Number(xn(u).tx)-Number(xn(h).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+xn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+xn(o).tx;else if(o)l=+xn(o).tx-+xn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+xn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=x(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=xn(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 Gm extends ft{constructor(){super(...arguments),this.type="area",this.renderType=Q.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?yn.opacity.unselected:yn.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",yn.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=Ul().curve(this.services.curves.getD3Curve()).defined(_=>{const E=s.getRangeIdentifier();return _[E]!=null}),l=this.model.getGroupedData(this.configs.groups),c=x(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let h=0;const d=(_,E)=>{x(r,"axes",_,"includeZero")===!1&&E[0]>0&&E[1]>0&&(h=E[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(h),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Qt.VERTICAL?(i=s.getMainYScale().domain(),d(s.getMainYAxisPosition(),i),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(i=s.getMainXScale().domain(),d(s.getMainXAxisPosition(),i),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const m=x(r,"color","gradient","enabled"),g=l&&l.length===1&&m;l.length>1&&m&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,_=>_.name),y=R(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(g){const _=y.select(`path.${this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:l[0].name})}`).node();let E;if(_)E=getComputedStyle(_,null).getPropertyValue("stroke");else{const T=x(this.model.getOptions(),"color","scale");if(T!==null){const D=Object.keys(T);E=T[D[0]]}}Tc.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:Tc.getStops(i,E)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const b=this,S=v.enter().append("path");g?S.merge(v).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:E}=_;return o(E)}):(S.attr("opacity",0).merge(v).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>b.model.getFillColor(_.name)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:yn.opacity.selected).attr("d",_=>{const{data:E}=_;return o(E)}),u&&S.attr("fill-opacity",yn.opacity.selected).style("stroke",_=>b.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 Yr extends ft{constructor(){super(...arguments),this.type="line",this.renderType=Q.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?bn.opacity.unselected:bn.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",bn.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]=wn(s,a,r.getOrientation()),c=this.getOptions(),u=Ii().x(o).y(l).curve(i.getD3Curve()).defined(f=>{const p=r.getRangeIdentifier(f);return f[p]!=null});let h=[];if(this.configs.stacked){const f=Object.keys(c.axes).some(m=>c.axes[m].percentage),{groupMapsTo:p}=c.data;h=this.model.getStackedData({groups:this.configs.groups,percentage:f}).map(m=>{const g=this.services.cartesianScales.getDomainIdentifier(m),v=this.services.cartesianScales.getRangeIdentifier(m);return{name:x(m,0,p),data:m.map(y=>({[g]:y.data.sharedStackKey,[p]:y[p],[v]:y[1]})),hidden:!FD(m,y=>y[0]!==y[1])}})}else h=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(h,f=>f.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(h,f=>f.name).attr("class",f=>this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",f=>{const{data:p}=f;return p.map(m=>{const g=this.services.cartesianScales.getRangeIdentifier(m);return m[g]}).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 zm=5;function cI(e,t){return e>t-zm&&e<t+zm}let Nn=class extends ft{constructor(){super(...arguments),this.type="ruler",this.renderType=Q.SVG,this.isXGridEnabled=x(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=x(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=x(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Qt.HORIZONTAL?r:n,h=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),d=k.appendOrSelect(h,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(g=>({domainValue:this.services.cartesianScales.getDomainValue(g),originalData:g})).filter(g=>cI(g.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(g=>g.domainValue).join()===this.pointsWithinLine.map(g=>g.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(O.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const m=this.pointsWithinLine.reduce((g,v)=>{if(g.length===0)return g.push(v),g;const y=g[0].domainValue,b=Math.abs(u-v.domainValue),S=Math.abs(u-y);return b>S||(b<S?g=[v]:g.push(v)),g},[]);if(m.length>0){const g=m.map(S=>S.originalData).filter(S=>{const _=this.services.cartesianScales.getRangeIdentifier(S);return S[_]!=null}),v=m.map(S=>S.domainValue),y=f.filter(S=>{const _=this.services.cartesianScales.getDomainValue(S);return v.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sm(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:d,data:this.formatTooltipData(g)}),h.attr("opacity",1);const b=m[0];s==="horizontal"?d.attr("x1",c).attr("x2",l).attr("y1",b.domainValue).attr("y2",b.domainValue):d.attr("y1",c).attr("y2",l).attr("x1",b.domainValue).attr("x2",b.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=Fn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=MA(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 Je extends ft{constructor(){super(...arguments),this.type="scatter",this.renderType=Q.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(x(this.getOptions(),"points","enabled")||x(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=wn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=wn(h=>r.getDomainValue(h),h=>r.getRangeValue(h),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,h]=wn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[tt.FILL,tt.STROKE]:[tt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",h).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",d?0:1).attr("role",lt.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=R(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[tt.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=R(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:R(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=R(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),h=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!h).style("fill",d=>h||c?t.model.getFillColor(d[n],d[u],d):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 jm extends ft{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=Q.SVG,this.truncation={[H.LEFT]:!1,[H.RIGHT]:!1,[H.TOP]:!1,[H.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=x(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===H.BOTTOM||n===H.TOP?(c=this.configs.axes[H.LEFT]?this.margins.left:0,u=this.configs.axes[H.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 h=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===Z.LABELS||this.scaleType===Z.LABELS_RATIO?h.rangeRound([c,u]):h.range([c,u]);let d;switch(n){case H.LEFT:d=zu;break;case H.BOTTOM:d=yo;break;case H.RIGHT:d=m0;break;case H.TOP:d=g0;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",`${lt.GRAPHICS_OBJECT} ${lt.GROUP}`),p.attr("aria-label",`${n} ticks`));const m=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),g=x(r,"axes",n),v=this.scaleType===Z.TIME||g.scaleType===Z.TIME,y=n===H.LEFT||n===H.RIGHT,b=this.model.get("zoomDomain");if(b&&v&&!y&&h.domain(b),!i){p.attr("aria-hidden",!0);return}const S=x(g,"scaleType"),_=x(r,"data","loading"),E=x(g,"ticks","number"),T=x(g,"ticks","values"),D=x(g,"truncation","type"),N=x(g,"truncation","threshold"),L=x(g,"truncation","numCharacter"),C=E!==null,V=x(r,"timeScale"),M=k.appendOrSelect(m,"g.tick"),A=k.appendOrSelect(M,"text").text("0"),w=k.getSVGElementSize(A.node(),{useBBox:!0}).height;M.remove();const P=this.scaleType||g.scaleType||Z.LINEAR,U=d(h).tickSizeOuter(0);if(h.ticks){let z;if(C?z=E:(z=kn.ticks.number,y&&(z=this.getNumberOfFittingTicks(o,w,kn.ticks.verticalSpaceRatio))),h.ticks().length===1&&h.ticks()[0]===0&&(z=0),U.ticks(z),v)if(!h.ticks(z).length)U.tickValues([]);else{const K=x(r,"timeScale","addSpaceOnEdges"),ht=x(r,"axes",n,"domain"),it=h.copy();K&&!ht&&it.nice(z);const Mt=it.ticks(z);K&&Mt.length>2&&!ht&&(Mt.splice(Mt.length-1,1),Mt.splice(0,1)),U.tickValues(Mt)}}let I;const B=x(g,"ticks","formatter");if(v){const z=bc(U.tickValues(),x(r,"timeScale","timeInterval"));B===null?I=(K,ht)=>yc(K,ht,U.tickValues(),z,V):I=(K,ht)=>{const it=yc(K,ht,U.tickValues(),z,V);return B(K,ht,it)}}else B===null?P===Z.LINEAR&&(I=z=>z.toLocaleString()):I=B;U.tickFormat(I);const[j,Y]=this.services.cartesianScales.getScaleByPosition(n).domain();let et;if(T){if(v)T.forEach((z,K)=>{z.getTime===void 0&&(T[K]=new Date(z))}),et=T.filter(z=>{const K=z.getTime();return K>=new Date(j).getTime()&&K<=new Date(Y).getTime()});else if(S===Z.LABELS){const z=this.services.cartesianScales.getScaleByPosition(n).domain();et=T.filter(K=>z.includes(K))}else et=T.filter(z=>z>=j&&z<=Y);U.tickValues(et)}switch(n){case H.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case H.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case H.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case H.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const pt=this.model.isDataEmpty();if(g.title){const z=k.appendOrSelect(l,"text.axis-title").html(pt||_?"":g.title),K=x(g,"titleOrientation");let ht;switch(n){case H.LEFT:K===uo.RIGHT?z.attr("transform","rotate(90)").attr("y",0).attr("x",h.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):z.attr("transform","rotate(-90)").attr("y",0).attr("x",-(h.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case H.BOTTOM:z.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case H.RIGHT:K===uo.LEFT?z.attr("transform","rotate(-90)").attr("y",a).attr("x",-(h.range()[0]/2)).style("text-anchor","middle"):z.attr("transform","rotate(90)").attr("y",-a).attr("x",h.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case H.TOP:ht=k.getSVGElementSize(z,{useBBox:!0}).height,z.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(v){const z=bc(U.tickValues(),x(r,"timeScale","timeInterval")),K=V.showDayName,ht=p;t&&(p=p.transition().call(it=>this.services.transitions.setupTransition({transition:it,name:"axis-update",animate:t}))),p=p.call(U),ht.selectAll(".tick").data(U.tickValues(),h).order().select("text").style("font-weight",(it,Mt)=>Sg(it,Mt,U.tickValues(),z,K)?"bold":"normal")}else!t||!f?p=p.call(U):p=p.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"axis-update",animate:t})).call(U);if(m.call(U),n===H.BOTTOM||n===H.TOP){let z=!1;const K=x(g,"ticks","rotation");if(K===us.ALWAYS)z=!0;else if(K===us.NEVER)z=!1;else if(!K||K===us.AUTO)if(h.step)z=m.selectAll("g.tick text").nodes().some(ht=>k.getSVGElementSize(ht,{useBBox:!0}).width>=h.step());else{z=!1;const ht=m.append("text").text("A"),it=k.getSVGElementSize(ht.node(),{useBBox:!0}).width;let Mt;m.selectAll("g.tick").each(function(){const W=R(this),J=parseFloat(x(xn(this),"tx"));J!==null&&Mt+W.text().length*it*.8>=J&&(z=!0),Mt=J}),ht.remove()}z?(C||(U.ticks(this.getNumberOfFittingTicks(a,w,kn.ticks.horizontalSpaceRatio)),m.call(U),p.call(U)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===H.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",z=>z),m.selectAll("g.tick").attr("aria-label",z=>z),D!==De.NONE&&S===Z.LABELS&&!T){const z=this.services.cartesianScales.getScaleDomain(n);if(z.length>0){const K=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(K);const ht=this;l.selectAll("g.tick text").data(z).text(function(it){return it.length>N?(ht.truncation[n]=!0,Qi(it,D,L)):it}),this.getInvisibleAxisRef().selectAll("g.tick text").data(z).text(function(it){return it.length>N?Qi(it,D,L):it}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(z)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:R(this),datum:u}),a===Z.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,hoveredElement:R(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:R(this),datum:u}),a===Z.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:R(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:R(this),datum:u}),a===Z.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 Em(i,2,kn.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 uI extends jm{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=R(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:h}=k.getSVGElementSize(c,{useBBox:!0}),d=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case H.LEFT:f=-u+Number(c.attr("x")),p=-(h/2);break;case H.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(h/2);break;case H.TOP:f=-(u/2),p=-h+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,d.attr("transform","rotate(-45)"));break;case H.BOTTOM:f=-(u/2),p=h/2-2,s.truncation[n]&&(f=-u,d.attr("transform","rotate(-45)"));break}d.attr("x",f-kn.hover.rectanglePadding).attr("y",p).attr("width",u+kn.hover.rectanglePadding*2).attr("height",h).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=R(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:h}),a===Z.LABELS&&h.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,element:u,datum:h})}).on("mousemove",function(c){const u=R(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:h}),l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:R(this).select("text"),datum:R(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:R(this).select("text"),datum:R(this).select("text").datum()}),a===Z.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 h=c.target.getBoundingClientRect();u.clientX=h.x,u.clientY=h.y}l.services.events.dispatchEvent(O.Axis.LABEL_FOCUS,{event:{...c,...u},element:R(this),datum:R(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:R(this),datum:R(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:R(this),datum:R(this).select("text").datum()})),n===H.LEFT||n===H.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 ve extends ft{constructor(){super(...arguments),this.type="2D-axes",this.renderType=Q.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(H),i=x(this.getOptions(),"axes");r.forEach(a=>{i[H[a]]&&(n[H[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=H[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===ds.DEFAULT?new jm(this.model,this.services,l):new uI(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:h}=k.getSVGElementSize(c,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=k.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===H.LEFT||l===H.RIGHT)&&(d+=5)),l){case H.TOP:s.top=h+d;break;case H.BOTTOM:s.bottom=h+d;break;case H.LEFT:s.left=u+d;break;case H.RIGHT:s.right=u+d;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 he extends ft{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=x(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Yt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Yt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Yt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Yt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Qt.VERTICAL&&this.drawYGrid(t),n===Qt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius(),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=Be().domain([0,1]).range(t),this.yScale=Be().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=x(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=x(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=x(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ri().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),h=t+Math.abs(kt.radiusOffset),d=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${h}, ${d})`).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+kt.xOffset;c===qt.CENTER?p=s/2:c===qt.RIGHT&&(p=s-t-kt.xOffset);const m=t+kt.yOffset;f.attr("transform",`translate(${p}, ${m})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+kt.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
76
|
<stop class="${n}" offset="${a}"></stop>
|
|
77
77
|
<stop class="${r}" offset="${a+.2}"></stop>
|
|
78
78
|
<stop class="${n}" offset="${a+2*.2}"></stop>
|
|
79
|
-
`;c.html(u),h();function h(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(Rb).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",h)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class hI extends ft{constructor(){super(...arguments),this.type="boxplot",this.renderType=Q.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,h]=o.range(),d=c-l,f=u-h;if(d===0)return;const{cartesianScales:p}=this.services,m=p.getOrientation(),g=m===Qt.VERTICAL,[v,y]=wn(C=>this.services.cartesianScales.getDomainValue(C),C=>this.services.cartesianScales.getRangeValue(C),m),b=Math.floor((g?d:f)/s.length),S=Math.min(b/2,16),_=this.model.getBoxplotData(),E=n.selectAll(".box-group").data(_);E.exit().remove();const T=E.enter().append("g").attr("class","box-group"),D=E.merge(T);T.append("path").merge(E.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-verticalstartline",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i]),M=V,L=p.getRangeValue(C.whiskers.min),w=p.getRangeValue(C.quartiles.q_25);return ue({x0:V,x1:M,y0:L,y1:w},m)}),T.append("path").merge(E.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-verticalendline",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i]),M=V,L=p.getRangeValue(C.whiskers.max),w=p.getRangeValue(C.quartiles.q_75);return ue({x0:V,x1:M,y0:L,y1:w},m)}),T.append("path").merge(E.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],originalClassName:"box"})).attr("fill-opacity",Le.box.opacity.default).attr("stroke-width",Le.strokeWidth.default).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",C=>C[i]).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-quartiles",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/2,M=V+S,L=p.getRangeValue(Math[g?"max":"min"](C.quartiles.q_75,C.quartiles.q_25)),w=L+Math.abs(p.getRangeValue(C.quartiles.q_75)-p.getRangeValue(C.quartiles.q_25));return ue({x0:V,x1:M,y0:L,y1:w},m)}),T.append("path").merge(E.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",C=>{const V=p.getDomainValue(C[i])-S/2,M=V+S,L=p.getRangeValue(C.whiskers.min),w=p.getRangeValue(C.whiskers.max);return ue({x0:V,x1:M,y0:L,y1:w},m)}),T.append("path").merge(E.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-startingwhisker",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/4,M=V+S/2,L=p.getRangeValue(C.whiskers.min),w=p.getRangeValue(C.whiskers.min);return ue({x0:V,x1:M,y0:L,y1:w},m)}),T.append("path").merge(E.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-median",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/2,M=V+S,L=p.getRangeValue(C.quartiles.q_50);return ue({x0:V,x1:M,y0:L,y1:L},m)}),T.append("path").merge(E.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-endingwhisker",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/4,M=V+S/2,L=p.getRangeValue(C.whiskers.max),w=p.getRangeValue(C.whiskers.max);return ue({x0:V,x1:M,y0:L,y1:w},m)});const N=D.selectAll("circle.outlier").data(C=>C.outliers.map(V=>({min:C.whiskers.min,max:C.whiskers.max,[i]:C[i],value:V})));N.exit().remove();const A=N.enter().append("circle");N.merge(A).attr("r",Le.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Le.circle.opacity.default).attr("cx",v).transition().call(C=>this.services.transitions.setupTransition({transition:C,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=R(this);R(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Le.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:[tt.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=R(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:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(this);R(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Le.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=R(this);o.classed("hovered",!0).attr("fill-opacity",Le.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:[tt.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=R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(this);o.classed("hovered",!1).attr("fill-opacity",Le.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 Xr extends ft{constructor(){super(...arguments),this.type="zero-line",this.renderType=Q.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 h=_g({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());k.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:t})).attr("y1",h.y0).attr("y2",h.y1).attr("x1",h.x0).attr("x2",h.x1)}}class dI extends Je{constructor(){super(...arguments),this.type="bubble",this.renderType=Q.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?Re(s):[1,1];return Be().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=d=>o.getDomainValue(d),c=d=>o.getRangeValue(d),[u,h]=wn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-label",d=>{const f=o.getRangeIdentifier(d);return d[f]}).transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",h).attr("r",d=>s(d[i]||1)).attr("class",d=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:d[a],originalClassName:"dot"})).style("fill",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getFillColor(d[a],d[f],d)}).style("stroke",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getStrokeColor(d[a],d[f],d)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=x(this.getOptions(),"bubble");return[{label:x(n,"radiusLabel"),value:t[x(n,"radiusMapsTo")]}]}}class fI extends ft{constructor(){super(...arguments),this.type="bullet",this.renderType=Q.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(),h=()=>{const m=[];s.forEach(v=>{v.ranges?v.ranges.forEach((y,b)=>{y!=null&&y<u&&m.push({datum:v,value:y,order:b+1})}):m.push({datum:v,order:1})});const g=k.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(m,v=>`${v[r]}-${v.order}`);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let y,b,S,_;return v.order===1?(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,b=y+16,S=c-2,_=l+1):(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,b=y+16,S=this.services.cartesianScales.getRangeValue(v.value),_=c),ue({x0:y,x1:b,y0:S,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},d=()=>{const m=k.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("bar",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-bar-update-enter",animate:t})).attr("class",g=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:g[r],originalClassName:"bar"})).style("fill",g=>this.model.getFillColor(g[r])).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-4,y=v+8,b=this.services.cartesianScales.getRangeValue(0)+1,S=this.services.cartesianScales.getRangeValue(g);return ue({x0:v,x1:y,y0:b,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",g=>g.value)},f=()=>{const m=k.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(g=>x(g,"marker")!==null),g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("marker",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-marker-update-enter",animate:t})).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-12,y=v+24,b=this.services.cartesianScales.getRangeValue(g.marker);return ue({x0:v,x1:y,y0:b,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let m=[];s.filter(v=>x(v,"marker")!==null).forEach(v=>{const y=v.marker,b=v[o];m=m.concat([{datum:v,value:y*.25,barValue:b},{datum:v,value:y*.5,barValue:b},{datum:v,value:y*.75,barValue:b}])});const g=k.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(m,v=>v[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:y})=>{let b=4;v.ranges&&v.ranges.indexOf(y)!==-1&&(b=8);const S=this.services.cartesianScales.getDomainValue(v)-b/2,_=S+b,E=this.services.cartesianScales.getRangeValue(y);return ue({x0:S,x1:_,y0:E,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};h(),d(),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=R(this);o.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=x(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:[tt.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:R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(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 pI(e){return e}function gI(e){if(e==null)return pI;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,h=new Array(u);for(h[0]=(t+=o[0])*r+s,h[1]=(n+=o[1])*i+a;c<u;)h[c]=o[c],++c;return h}}function mI(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function vI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Wm(e,n)})}:Wm(e,t)}function Wm(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Kc(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 Kc(e,t){var n=gI(e.transform),r=e.arcs;function i(u,h){h.length&&h.pop();for(var d=r[u<0?~u:u],f=0,p=d.length;f<p;++f)h.push(n(d[f],f));u<0&&mI(h,p)}function s(u){return n(u)}function a(u){for(var h=[],d=0,f=u.length;d<f;++d)i(u[d],h);return h.length<2&&h.push(h[0]),h}function o(u){for(var h=a(u);h.length<4;)h.push(h[0]);return h}function l(u){return u.map(o)}function c(u){var h=u.type,d;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(c)};case"Point":d=s(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(s);break;case"LineString":d=a(u.arcs);break;case"MultiLineString":d=u.arcs.map(a);break;case"Polygon":d=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:h,coordinates:d}}return c(t)}function yI(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var h=e.arcs[c<0?~c:c],d;h.length<3&&!h[1][0]&&!h[1][1]&&(d=t[++a],t[a]=c,t[u]=d)}),t.forEach(function(c){var u=o(c),h=u[0],d=u[1],f,p;if(f=i[h])if(delete i[f.end],f.push(c),f.end=d,p=r[d]){delete r[p.start];var m=p===f?f:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[f.start]=i[f.end]=f;else if(f=r[d])if(delete r[f.start],f.unshift(c),f.start=h,p=i[h]){delete i[p.end];var g=p===f?f:p.concat(f);r[g.start=p.start]=i[g.end=f.end]=g}else r[f.start]=i[f.end]=f;else f=[c],r[f.start=h]=i[f.end=d]=f});function o(c){var u=e.arcs[c<0?~c:c],h=u[0],d;return e.transform?(d=[0,0],u.forEach(function(f){d[0]+=f[0],d[1]+=f[1]})):d=u[u.length-1],c<0?[d,h]:[h,d]}function l(c,u){for(var h in c){var d=c[h];delete u[d.start],delete d.start,delete d.end,d.forEach(function(f){n[f<0?~f:f]=1}),s.push(d)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function bI(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 xI(e){return Kc(e,wI.apply(this,arguments))}function wI(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 bI(Kc(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(h){h.forEach(function(d){n[d<0?~d:d].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(m){m.forEach(function(g){g.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=yI(e,c),(u=c.length)>1)for(var h=1,d=o(c[0]),f,p;h<u;++h)(f=o(c[h]))>d&&(p=c[0],c[0]=c[h],c[h]=p,d=f);return c}).filter(function(l){return l.length>0})}}class _I extends Nn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=Q.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(),h=a.getDomainScale(),d=h.invert(o===Qt.VERTICAL?n:r),f=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=k.appendOrSelect(f,"line.ruler-line"),m=i.selectAll("[role=graphics-symbol]").filter(g=>{if(parseFloat(At(g,"data.x0"))<=d&&parseFloat(At(g,"data.x1"))>=d)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sm(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const g=R(m.nodes()[0]).datum(),v=parseFloat(At(g,"data.x0")),y=parseFloat(At(g,"data.x1")),b=this.model.getActiveDataGroupNames(),S=b.reverse().map(_=>({label:_,value:At(g,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(S.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:At(s,"bins.rangeLabel")||"Range",value:`${v} – ${y}`},...S,...x(s,"tooltip","showTotal")===!0?[{label:At(s,"tooltip.totalLabel")||"Total",value:b.reduce((E,T)=>E+parseFloat(At(g,`data.${T}`)),0)}]:[]]}),f.attr("opacity",1);const _=h((v+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 ao extends Nn{formatTooltipData(t){return t.reverse()}}const EI=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=Hh();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},SI={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},OI={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},TI={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"},MI={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},CI={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},$I={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class qm extends Xc{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=Q.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=x(this.getOptions(),"data","loading");if(s>Vt.color.barWidth&&!a){const o=x(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=k.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),h=c[0]-u-9;h>1?i.select("g.legend-title").attr("transform",`translate(${h}, 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=x(n,"color","gradient","colors"),a=x(n,this.chartType,"colorLegend","type");let o=x(n,"color","pairing","option");const l=x(n,"heatmap","colorLegend","title");if(x(this.getOptions(),"data","loading")){r.html("");return}const c=!Fe(s),u=Tg(this.model.getDisplayData()),h=!(i<=Vt.color.barWidth),d=h?Vt.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 m=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let g=[];const v=m==="diverge"?17:11;if(c)g=s;else for(let T=1;T<v+1;T++)g.push(a===hs.LINEAR?`stop-color-${m}-${o}-${T}`:`fill-${m}-${o}-${T}`);const y=xe(u[0],u[1]),b=T1(y,3),S=Be().domain(u).range([0,d]),_=yo(S).tickSize(0).tickValues(b);let E;switch(a){case hs.LINEAR:this.drawLinear(g,f,d);break;case hs.QUANTIZE:E=this.drawQuantize(g,m,c,f,d),S.range([E,d]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Vt.color.axisYTranslation})`).call(_),p.select(".domain").remove(),p.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),p.select("g.tick:first-of-type text").style("text-anchor",h&&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",Vt.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=Ci().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",Vt.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 AI extends rs{constructor(){super(...arguments),this.type="meter-title",this.renderType=Q.SVG}render(t=!1){const n=x(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data;if(x(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=x(n,"meter","proportional","total"),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,h=x(n,"meter","proportional","breakdownFormatter");a=h!==null?h({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=x(n,"meter","proportional","total"),i=r?x(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"",a=x(n,"meter","proportional","totalFormatter"),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-ee.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(h=>h),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=ee.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=x(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),r=k.appendOrSelect(n,"text.meter-title"),i=x(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(i),a=ee.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=ee.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=x(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-ee.total.paddingLeft}else{const i=k.appendOrSelect(this.parent,"text.percent-value"),s=ee.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=k.appendOrSelect(this.parent,"g.status-indicator").node(),l=k.getSVGElementSize(o,{useBBox:!0}).width+ee.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case cs.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 cs.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case cs.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 Qc extends ft{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=x(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class LI extends ft{constructor(){super(...arguments),this.type="circle-pack",this.renderType=Q.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:Fr.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=x(l,"canvasZoom","enabled");a&&x(s,0,"children")&&(s=x(s,0,"children"));const u=Oi({children:s}).sum(p=>p.value).sort((p,m)=>m.value-p.value),h=Vw().size([r,i]).padding(p=>p.depth>=1?Fr.padding.children+3:Fr.padding.mainGroup+3)(u).descendants().splice(1).filter(p=>p.depth<=o),d=n.selectAll("circle.node").data(h);d.exit().attr("width",0).attr("height",0).remove();const f=d.enter().append("circle").classed("node",!0);f.merge(d).attr("class",p=>{const m=c&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${m}`:`node node-leaf ${m}`})}).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",Fr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,Hr),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",Fr.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(){R(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=R(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,Hr)})}getZoomIcon(){return`
|
|
79
|
+
`;c.html(u),h();function h(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(Rb).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",h)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class hI extends ft{constructor(){super(...arguments),this.type="boxplot",this.renderType=Q.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,h]=o.range(),d=c-l,f=u-h;if(d===0)return;const{cartesianScales:p}=this.services,m=p.getOrientation(),g=m===Qt.VERTICAL,[v,y]=wn(C=>this.services.cartesianScales.getDomainValue(C),C=>this.services.cartesianScales.getRangeValue(C),m),b=Math.floor((g?d:f)/s.length),S=Math.min(b/2,16),_=this.model.getBoxplotData(),E=n.selectAll(".box-group").data(_);E.exit().remove();const T=E.enter().append("g").attr("class","box-group"),D=E.merge(T);T.append("path").merge(E.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-verticalstartline",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i]),M=V,A=p.getRangeValue(C.whiskers.min),w=p.getRangeValue(C.quartiles.q_25);return ue({x0:V,x1:M,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-verticalendline",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i]),M=V,A=p.getRangeValue(C.whiskers.max),w=p.getRangeValue(C.quartiles.q_75);return ue({x0:V,x1:M,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],originalClassName:"box"})).attr("fill-opacity",Le.box.opacity.default).attr("stroke-width",Le.strokeWidth.default).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",C=>C[i]).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-quartiles",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/2,M=V+S,A=p.getRangeValue(Math[g?"max":"min"](C.quartiles.q_75,C.quartiles.q_25)),w=A+Math.abs(p.getRangeValue(C.quartiles.q_75)-p.getRangeValue(C.quartiles.q_25));return ue({x0:V,x1:M,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",C=>{const V=p.getDomainValue(C[i])-S/2,M=V+S,A=p.getRangeValue(C.whiskers.min),w=p.getRangeValue(C.whiskers.max);return ue({x0:V,x1:M,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-startingwhisker",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/4,M=V+S/2,A=p.getRangeValue(C.whiskers.min),w=p.getRangeValue(C.whiskers.min);return ue({x0:V,x1:M,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-median",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/2,M=V+S,A=p.getRangeValue(C.quartiles.q_50);return ue({x0:V,x1:M,y0:A,y1:A},m)}),T.append("path").merge(E.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-endingwhisker",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/4,M=V+S/2,A=p.getRangeValue(C.whiskers.max),w=p.getRangeValue(C.whiskers.max);return ue({x0:V,x1:M,y0:A,y1:w},m)});const N=D.selectAll("circle.outlier").data(C=>C.outliers.map(V=>({min:C.whiskers.min,max:C.whiskers.max,[i]:C[i],value:V})));N.exit().remove();const L=N.enter().append("circle");N.merge(L).attr("r",Le.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Le.circle.opacity.default).attr("cx",v).transition().call(C=>this.services.transitions.setupTransition({transition:C,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=R(this);R(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Le.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:[tt.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=R(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:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(this);R(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Le.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=R(this);o.classed("hovered",!0).attr("fill-opacity",Le.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:[tt.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=R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(this);o.classed("hovered",!1).attr("fill-opacity",Le.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 Xr extends ft{constructor(){super(...arguments),this.type="zero-line",this.renderType=Q.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 h=_g({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());k.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:t})).attr("y1",h.y0).attr("y2",h.y1).attr("x1",h.x0).attr("x2",h.x1)}}class dI extends Je{constructor(){super(...arguments),this.type="bubble",this.renderType=Q.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?Re(s):[1,1];return Be().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=d=>o.getDomainValue(d),c=d=>o.getRangeValue(d),[u,h]=wn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-label",d=>{const f=o.getRangeIdentifier(d);return d[f]}).transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",h).attr("r",d=>s(d[i]||1)).attr("class",d=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:d[a],originalClassName:"dot"})).style("fill",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getFillColor(d[a],d[f],d)}).style("stroke",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getStrokeColor(d[a],d[f],d)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=x(this.getOptions(),"bubble");return[{label:x(n,"radiusLabel"),value:t[x(n,"radiusMapsTo")]}]}}class fI extends ft{constructor(){super(...arguments),this.type="bullet",this.renderType=Q.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(),h=()=>{const m=[];s.forEach(v=>{v.ranges?v.ranges.forEach((y,b)=>{y!=null&&y<u&&m.push({datum:v,value:y,order:b+1})}):m.push({datum:v,order:1})});const g=k.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(m,v=>`${v[r]}-${v.order}`);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let y,b,S,_;return v.order===1?(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,b=y+16,S=c-2,_=l+1):(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,b=y+16,S=this.services.cartesianScales.getRangeValue(v.value),_=c),ue({x0:y,x1:b,y0:S,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},d=()=>{const m=k.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("bar",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-bar-update-enter",animate:t})).attr("class",g=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:g[r],originalClassName:"bar"})).style("fill",g=>this.model.getFillColor(g[r])).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-4,y=v+8,b=this.services.cartesianScales.getRangeValue(0)+1,S=this.services.cartesianScales.getRangeValue(g);return ue({x0:v,x1:y,y0:b,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",g=>g.value)},f=()=>{const m=k.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(g=>x(g,"marker")!==null),g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("marker",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-marker-update-enter",animate:t})).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-12,y=v+24,b=this.services.cartesianScales.getRangeValue(g.marker);return ue({x0:v,x1:y,y0:b,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let m=[];s.filter(v=>x(v,"marker")!==null).forEach(v=>{const y=v.marker,b=v[o];m=m.concat([{datum:v,value:y*.25,barValue:b},{datum:v,value:y*.5,barValue:b},{datum:v,value:y*.75,barValue:b}])});const g=k.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(m,v=>v[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:y})=>{let b=4;v.ranges&&v.ranges.indexOf(y)!==-1&&(b=8);const S=this.services.cartesianScales.getDomainValue(v)-b/2,_=S+b,E=this.services.cartesianScales.getRangeValue(y);return ue({x0:S,x1:_,y0:E,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};h(),d(),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=R(this);o.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=x(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:[tt.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:R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(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 pI(e){return e}function gI(e){if(e==null)return pI;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,h=new Array(u);for(h[0]=(t+=o[0])*r+s,h[1]=(n+=o[1])*i+a;c<u;)h[c]=o[c],++c;return h}}function mI(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function vI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Wm(e,n)})}:Wm(e,t)}function Wm(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Kc(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 Kc(e,t){var n=gI(e.transform),r=e.arcs;function i(u,h){h.length&&h.pop();for(var d=r[u<0?~u:u],f=0,p=d.length;f<p;++f)h.push(n(d[f],f));u<0&&mI(h,p)}function s(u){return n(u)}function a(u){for(var h=[],d=0,f=u.length;d<f;++d)i(u[d],h);return h.length<2&&h.push(h[0]),h}function o(u){for(var h=a(u);h.length<4;)h.push(h[0]);return h}function l(u){return u.map(o)}function c(u){var h=u.type,d;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(c)};case"Point":d=s(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(s);break;case"LineString":d=a(u.arcs);break;case"MultiLineString":d=u.arcs.map(a);break;case"Polygon":d=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:h,coordinates:d}}return c(t)}function yI(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var h=e.arcs[c<0?~c:c],d;h.length<3&&!h[1][0]&&!h[1][1]&&(d=t[++a],t[a]=c,t[u]=d)}),t.forEach(function(c){var u=o(c),h=u[0],d=u[1],f,p;if(f=i[h])if(delete i[f.end],f.push(c),f.end=d,p=r[d]){delete r[p.start];var m=p===f?f:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[f.start]=i[f.end]=f;else if(f=r[d])if(delete r[f.start],f.unshift(c),f.start=h,p=i[h]){delete i[p.end];var g=p===f?f:p.concat(f);r[g.start=p.start]=i[g.end=f.end]=g}else r[f.start]=i[f.end]=f;else f=[c],r[f.start=h]=i[f.end=d]=f});function o(c){var u=e.arcs[c<0?~c:c],h=u[0],d;return e.transform?(d=[0,0],u.forEach(function(f){d[0]+=f[0],d[1]+=f[1]})):d=u[u.length-1],c<0?[d,h]:[h,d]}function l(c,u){for(var h in c){var d=c[h];delete u[d.start],delete d.start,delete d.end,d.forEach(function(f){n[f<0?~f:f]=1}),s.push(d)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function bI(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 xI(e){return Kc(e,wI.apply(this,arguments))}function wI(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 bI(Kc(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(h){h.forEach(function(d){n[d<0?~d:d].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(m){m.forEach(function(g){g.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=yI(e,c),(u=c.length)>1)for(var h=1,d=o(c[0]),f,p;h<u;++h)(f=o(c[h]))>d&&(p=c[0],c[0]=c[h],c[h]=p,d=f);return c}).filter(function(l){return l.length>0})}}class _I extends Nn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=Q.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(),h=a.getDomainScale(),d=h.invert(o===Qt.VERTICAL?n:r),f=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=k.appendOrSelect(f,"line.ruler-line"),m=i.selectAll("[role=graphics-symbol]").filter(g=>{if(parseFloat(At(g,"data.x0"))<=d&&parseFloat(At(g,"data.x1"))>=d)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sm(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const g=R(m.nodes()[0]).datum(),v=parseFloat(At(g,"data.x0")),y=parseFloat(At(g,"data.x1")),b=this.model.getActiveDataGroupNames(),S=b.reverse().map(_=>({label:_,value:At(g,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(S.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:At(s,"bins.rangeLabel")||"Range",value:`${v} – ${y}`},...S,...x(s,"tooltip","showTotal")===!0?[{label:At(s,"tooltip.totalLabel")||"Total",value:b.reduce((E,T)=>E+parseFloat(At(g,`data.${T}`)),0)}]:[]]}),f.attr("opacity",1);const _=h((v+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 ao extends Nn{formatTooltipData(t){return t.reverse()}}const EI=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=Hh();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},SI={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},OI={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},TI={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"},MI={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},CI={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},$I={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class qm extends Xc{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=Q.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=x(this.getOptions(),"data","loading");if(s>Vt.color.barWidth&&!a){const o=x(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=k.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),h=c[0]-u-9;h>1?i.select("g.legend-title").attr("transform",`translate(${h}, 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=x(n,"color","gradient","colors"),a=x(n,this.chartType,"colorLegend","type");let o=x(n,"color","pairing","option");const l=x(n,"heatmap","colorLegend","title");if(x(this.getOptions(),"data","loading")){r.html("");return}const c=!Fe(s),u=Tg(this.model.getDisplayData()),h=!(i<=Vt.color.barWidth),d=h?Vt.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 m=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let g=[];const v=m==="diverge"?17:11;if(c)g=s;else for(let T=1;T<v+1;T++)g.push(a===hs.LINEAR?`stop-color-${m}-${o}-${T}`:`fill-${m}-${o}-${T}`);const y=xe(u[0],u[1]),b=T1(y,3),S=Be().domain(u).range([0,d]),_=yo(S).tickSize(0).tickValues(b);let E;switch(a){case hs.LINEAR:this.drawLinear(g,f,d);break;case hs.QUANTIZE:E=this.drawQuantize(g,m,c,f,d),S.range([E,d]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Vt.color.axisYTranslation})`).call(_),p.select(".domain").remove(),p.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),p.select("g.tick:first-of-type text").style("text-anchor",h&&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",Vt.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=Ci().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",Vt.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 AI extends rs{constructor(){super(...arguments),this.type="meter-title",this.renderType=Q.SVG}render(t=!1){const n=x(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data;if(x(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=x(n,"meter","proportional","total"),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,h=x(n,"meter","proportional","breakdownFormatter");a=h!==null?h({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=x(n,"meter","proportional","total"),i=r?x(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"",a=x(n,"meter","proportional","totalFormatter"),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-ee.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(h=>h),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=ee.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=x(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),r=k.appendOrSelect(n,"text.meter-title"),i=x(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(i),a=ee.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=ee.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=x(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-ee.total.paddingLeft}else{const i=k.appendOrSelect(this.parent,"text.percent-value"),s=ee.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=k.appendOrSelect(this.parent,"g.status-indicator").node(),l=k.getSVGElementSize(o,{useBBox:!0}).width+ee.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case cs.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 cs.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case cs.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 Qc extends ft{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=x(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class LI extends ft{constructor(){super(...arguments),this.type="circle-pack",this.renderType=Q.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:Fr.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=x(l,"canvasZoom","enabled");a&&x(s,0,"children")&&(s=x(s,0,"children"));const u=Oi({children:s}).sum(p=>p.value).sort((p,m)=>m.value-p.value),h=Vw().size([r,i]).padding(p=>p.depth>=1?Fr.padding.children+3:Fr.padding.mainGroup+3)(u).descendants().splice(1).filter(p=>p.depth<=o),d=n.selectAll("circle.node").data(h);d.exit().attr("width",0).attr("height",0).remove();const f=d.enter().append("circle").classed("node",!0);f.merge(d).attr("class",p=>{const m=c&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${m}`:`node node-leaf ${m}`})}).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",Fr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,Hr),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",Fr.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(){R(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=R(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,Hr)})}getZoomIcon(){return`
|
|
80
80
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
|
81
81
|
<polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
|
|
82
82
|
<path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
|
|
83
|
-
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=R(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],h=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:At(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else h=r.value;const d=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:d,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:h},...c,...u]})}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=R(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=R(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=R(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Hr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Hr),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 kI(e,t){const n=ci(this._current,e);return r=>(this._current=n(r),t(this._current))}class Ym extends ft{constructor(){super(...arguments),this.type="pie",this.renderType=Q.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 kt.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=Ri().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ri().innerRadius(this.getInnerRadius()).outerRadius(l+kt.hoverArc.outerRadiusOffset);const c=PE().value(T=>T[a]).sort(x(i,"pie","sortFunction")).padAngle(kt.padAngle)(o),u=k.appendOrSelect(r,"g.slices").attr("role",lt.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:[tt.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",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",T=>`${T[a]}, ${wg(T.data[a],o,a)+"%"}`).attrTween("d",function(T){return kI.bind(this)(T,n.arc)});const h=i.pie.labels.enabled,d=h?c.filter(T=>T.data[a]>0):[],f=k.appendOrSelect(r,"g.labels").attr("role",lt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(d,T=>T.data[s]);f.exit().attr("opacity",0).remove();const p=f.enter().append("text").classed("pie-label",!0),m=[];p.merge(f).style("text-anchor","middle").text(T=>i.pie.labels.formatter?i.pie.labels.formatter(T):wg(T.data[a],o,a)+"%").datum(function(T){const D=l+7,N=(T.endAngle-T.startAngle)/2+T.startAngle,A=N/Math.PI*180,C=this.getComputedTextLength();return T.textOffsetX=C/2,T.textOffsetY=A>90&&A<270?10:0,T.xPosition=(T.textOffsetX+D)*Math.sin(N),T.yPosition=(T.textOffsetY+D)*-Math.cos(N),T}).attr("transform",function(T,D){const N=d.length,A=(T.endAngle-T.startAngle)*(180/Math.PI);if(D>=N-2&&A<kt.callout.minSliceDegree){let C,V;return T.index===N-1?(C=T.xPosition+kt.callout.offsetX+kt.callout.textMargin+T.textOffsetX,V=T.yPosition-kt.callout.offsetY,T.direction=ls.RIGHT,m.push(T)):(C=T.xPosition-kt.callout.offsetX-T.textOffsetX-kt.callout.textMargin,V=T.yPosition-kt.callout.offsetY,T.direction=ls.LEFT,m.push(T)),`translate(${C}, ${V})`}return`translate(${T.xPosition}, ${T.yPosition})`}),this.renderCallouts(m);const g=x(i,"donut")?"donut":"pie",v=x(i,g,"alignment"),{width:y}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),b=h?kt.xOffset:0,S=h?kt.yOffset:0;let _=l+b;v===qt.CENTER?_=y/2:v===qt.RIGHT&&(_=y-l-kt.xOffset);let E=l+S;m.length>0&&(E+=kt.yOffsetCallout),r.attr("x",_+7).attr("y",E),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",lt.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",lt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===ls.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+kt.callout.offsetX,y:o-kt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-kt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-kt.callout.offsetX,y:o-kt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+kt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return R(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 R(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=R(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:R(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=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(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+kt.radiusOffset:i}}class DI extends Ym{constructor(){super(...arguments),this.type="donut",this.renderType=Q.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=x(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(R(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=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=vh:s=xe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Xm="4,10 8,6 12,10",Zm="12,6 8,10 4,6";class RI extends ft{constructor(){super(...arguments),this.type="gauge",this.renderType=Q.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Em(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===pr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case co.UP:return Xm;case co.DOWN:return Zm;default:return t>0?Xm:Zm}}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,h=this.computeRadius(),d=this.getInnerRadius();this.backgroundArc=Ri().innerRadius(d).outerRadius(h).startAngle(c).endAngle(u),this.arc=Ri().innerRadius(d).outerRadius(h).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:[tt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=x(r,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let g=h;p===qt.CENTER?g=m/2:p===qt.RIGHT&&(g=m-h),n.attr("x",g).attr("y",h),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let h=0;r===pr.FULL&&!s?h=l(a):r===pr.SEMI&&s&&(h=-(l(a)+c));const d=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${h})`),f=o(a),p=k.appendOrSelect(d,"g.gauge-value-number"),m=x(n,"gauge","numberFormatter"),g=p.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${f}px`).attr("text-anchor","middle").text(T=>m(T));const{width:v}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,b=u?"%":"",S=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",v/2).text(b),{width:_,height:E}=k.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${E/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?x(r,"gauge","deltaFontSize"):()=>0,o=i?x(r,"gauge","numberFormatter"):()=>null,l=x(r,"gauge","deltaArrow","size"),c=x(r,"gauge","numberSpacing"),u=x(r,"gauge","showPercentageSymbol"),h=k.appendOrSelect(n,"g.gauge-numbers"),d=k.appendOrSelect(h,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=k.appendOrSelect(d,"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:m}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=x(r,"gauge","deltaArrow","enabled"),v=d.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);v.enter().append("svg").merge(v).attr("class","gauge-delta-arrow").attr("x",-l(s)-m/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=R(this);k.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=x(r,"gauge","status");k.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),v.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOVER,{event:n,element:R(this),datum:r})}).on("mousemove",function(n,r){const i=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===pr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Km extends Qc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=Q.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=Xi(n.map(u=>{const h=this.services.cartesianScales.getDomainIdentifier(u);return u[h]&&typeof u[h].toString=="function"?u[h].toString():u[h]})),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",lt.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 h=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Qt.VERTICAL?`translate(${h}, 0)`:`translate(0, ${h})`});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:[tt.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[i])).attr("d",u=>{const h=this.groupScale(u[i]),d=this.getBarWidth(),f=h,p=h+d,m=this.services.cartesianScales.getRangeAxisPosition({datum:u}),g=this.services.cartesianScales.getValueThroughAxisPosition(m,0),v=this.services.cartesianScales.getRangeValue(u),y=this.services.cartesianScales.getDomainValue(u)-d/2,b=y+d;if(!this.isOutsideZoomedDomain(y,b))return ue({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",lt.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=R(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=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Ci().domain(t).rangeRound([0,this.getGroupWidth()])}}class II extends ft{constructor(){super(...arguments),this.type="heatmap",this.renderType=Q.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="",h=null,d=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const m=this.matrix[r][p].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const m=this.matrix[p][r].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Mn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Mn(l.range())},${c(r)})`),this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n.event,hoveredElement:R(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:d!==null?d:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:h!==null?h/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(O.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(O.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(O.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),h=i.range(),d=s.range();this.xBandwidth=Math.abs((h[1]-h[0])/l.length),this.yBandwidth=Math.abs((d[1]-d[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",m=>`heat-${m.index}`).classed("cell",!0).attr("transform",m=>`translate(${i(m[a])}, ${s(m[o])})`).append("rect").attr("class",m=>this.model.getColorClassName({value:m.value,originalClassName:`heat-${m.index}`})).classed("heat",!0).classed("null-state",m=>m.index===-1||m.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",m=>m.index===-1||m.value===null?`url(#${f})`:this.model.getFillColor(Number(m.value))).attr("aria-label",m=>m.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(d[1]-d[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(h[1]-h[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=x(this.getOptions(),"heatmap","divider","state");return t!==ni.OFF&&(t===ni.AUTO&&hg.minCellDividerDimension<=this.xBandwidth&&hg.minCellDividerDimension<=this.yBandwidth||t===ni.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=At(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 h=R(this),d=h.select("rect.heat");if(!d.classed("null-state")){const f=Ki(h.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:d,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:d.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:R(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:R(this),datum:u})}).on("mouseout",function(c,u){const h=R(this).select("rect.heat"),d=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),d||(t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class NI extends ft{constructor(){super(...arguments),this.type="histogram",this.renderType=Q.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=>At(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",lt.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,h)=>h).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const h=At(u,"data");if(!h)return;const d=o(h.x1)-o(h.x0)-1,f=this.services.cartesianScales.getDomainValue(h.x0),p=f+d,m=this.services.cartesianScales.getRangeValue(u[0]);let g=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(g-m)>0&&Math.abs(g-m)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?g+=1:g-=1),ue({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=R(this);a.classed("hovered",!0);const o=parseFloat(At(s,"data.x0")),l=parseFloat(At(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:At(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:s[n]})},{label:u,value:At(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("mouseout",function(){R(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 PI extends Je{constructor(){super(...arguments),this.type="lollipop",this.renderType=Q.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]?bn.weight.unselected:bn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",bn.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?bn.opacity.unselected:bn.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",bn.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=g=>s.getDomainValue(g),u=g=>s.getRangeValue(g),h=s.getOrientation(),[d,f]=wn(c,u,h),p=n.selectAll("line.line").data(this.getScatterData(),g=>`${g[i]}-${g[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",g=>this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:g[i],originalClassName:"line"})).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"lollipop-line-update-enter",animate:t})).style("stroke",g=>this.model.getFillColor(g[i],g[l],g)).attr("opacity",1);h===Qt.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",g=>d(g)-r.points.radius):m.attr("x1",d).attr("x2",d).attr("y1",o.range()[0]).attr("y2",g=>f(g)+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 UI extends ft{constructor(){super(...arguments),this.type="meter",this.renderType=Q.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)-ee.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-ee.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;x(i,"meter","proportional")===null?u=100:u=x(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const h=Be().domain([0,u]).range([0,l]),d=this.getStackedBounds(a,h),f=x(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?ee.height.proportional:ee.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?ee.height.proportional:ee.height.default));const p=r.selectAll("rect.value").data(d),m=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",b=>b.x).attr("y",0).attr("height",()=>f||(s?ee.height.proportional:ee.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:b[c],originalClassName:m})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?h(u):b.width).style("fill",b=>n.model.getFillColor(b[c])).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const g=x(i,"meter","peak");let v=g;g!==null&&(g>u?v=u:g<a[0].value&&(v=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(v==null?[]:[v]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?ee.height.proportional:ee.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>h(b)).attr("x2",b=>h(b)).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),y.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=R(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=R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(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 BI extends ft{constructor(){super(...arguments),this.type="radar",this.renderType=Q.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}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=BD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return rt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:rt(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?or.opacity.unselected:or.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?or.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",or.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(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=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:h}=x(o,"radar","axes"),{xLabelPadding:d,yLabelPadding:f,yTicksNumber:p,minRange:m,xAxisRectHeight:g}=or;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 v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),y=(Math.min(r,i)-v)/2;if(y<=0)return;const b=Ci().domain(this.fullDataNormalized.map(M=>M[u])).range([0,2*Math.PI].map(M=>M-Math.PI/2)),S=Mn(this.fullDataNormalized.map(M=>M[h])),_=Be().domain([S>=0?0:S,Hn(this.fullDataNormalized.map(M=>M[h]))]).range([m,y]).nice(p),E=_.ticks(p),T=M=>this.model.getFillColor(M),D=VE().angle(M=>b(M[u])+Math.PI/2).radius(M=>_(M[h])).curve(Pf),N=this.uniqueKeys.map(M=>{const L=this.getLabelDimensions(M).width,w=ak(b(M),y);return L+w}),A={x:Hn(N)+d,y:i/2},C=k.appendOrSelect(n,"g.y-axes").attr("role",lt.GROUP).selectAll("path").data(E,M=>M),V=M=>this.uniqueKeys.map(L=>({[u]:L,[h]:M}));C.join(M=>M.append("path").attr("opacity",0).attr("transform",`translate(${A.x}, ${A.y})`).attr("fill","none").call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",w=>D(V(w)))),M=>M.call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${A.x}, ${A.y})`).attr("d",w=>D(V(w)))),M=>M.call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_exit",animate:t})).attr("d",w=>D(V(w))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",lt.GROUP).selectAll("line").data(this.uniqueKeys,M=>M).join(M=>M.append("line").attr("opacity",0).attr("class",L=>`x-axis-${jr(L)}`).attr("stroke-dasharray","0").attr("x1",L=>Ft(b(L),0,A).x).attr("y1",L=>Ft(b(L),0,A).y).attr("x2",L=>Ft(b(L),0,A).x).attr("y2",L=>Ft(b(L),0,A).y).call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",w=>Ft(b(w),_.range()[0],A).x).attr("y1",w=>Ft(b(w),_.range()[0],A).y).attr("x2",w=>Ft(b(w),_.range()[1],A).x).attr("y2",w=>Ft(b(w),_.range()[1],A).y)),M=>M.call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",w=>Ft(b(w),_.range()[0],A).x).attr("y1",w=>Ft(b(w),_.range()[0],A).y).attr("x2",w=>Ft(b(w),_.range()[1],A).x).attr("y2",w=>Ft(b(w),_.range()[1],A).y)),M=>M.call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",lt.GROUP).selectAll("text").data(this.uniqueKeys).join(M=>M.append("text").text(L=>L).attr("opacity",0).attr("x",L=>Ft(b(L),_.range()[1]+d,A).x).attr("y",L=>Ft(b(L),_.range()[1]+d,A).y).style("text-anchor",L=>zg(b(L)).textAnchor).style("dominant-baseline",L=>zg(b(L)).dominantBaseline).call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",w=>Ft(b(w),_.range()[1]+d,A).x).attr("y",w=>Ft(b(w),_.range()[1]+d,A).y).end().finally(()=>{const w=x(o,"radar","alignment"),P=this.getAlignmentXOffset(w,n,this.getParent());n.attr("x",P)})),M=>M.call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",lt.GROUP).selectAll("path").data(this.groupedDataNormalized,M=>M.name).join(M=>M.append("path").attr("class",L=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:L.name,originalClassName:"blob"})).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-label",L=>L.name).attr("opacity",0).attr("transform",t?()=>`translate(${A.x}, ${A.y}) scale(${1+Math.random()*.35})`:`translate(${A.x}, ${A.y})`).style("fill",L=>T(L.name)).style("fill-opacity",or.opacity.selected).style("stroke",L=>T(L.name)).call(L=>{const w=L.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_blobs_enter",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",`translate(${A.x}, ${A.y})`),w.attr("opacity",1).attr("d",P=>D(P.data))}),M=>(M.attr("class",L=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:L.name,originalClassName:"blob"})).style("fill",L=>T(L.name)).style("stroke",L=>T(L.name)),M.call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${A.x}, ${A.y})`).attr("d",w=>D(w.data))),M),M=>M.call(L=>{const w=L.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_blobs_exit",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",()=>`translate(${A.x}, ${A.y}) scale(${1+Math.random()*.35})`),w.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",lt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(M=>x(M,h)!==null)).join(M=>M.append("circle").attr("role",lt.GRAPHICS_SYMBOL).attr("aria-label",L=>L[c]),M=>M,M=>M.remove()).attr("class",M=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:M[l],originalClassName:jr(M[u])})).attr("cx",M=>Ft(b(M[u]),_(M[h]),A).x).attr("cy",M=>Ft(b(M[u]),_(M[h]),A).y).attr("r",0).attr("opacity",0).style("fill",M=>T(M[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",lt.GROUP).selectAll("rect").data(this.uniqueKeys).join(M=>M.append("rect"),M=>M,M=>M.remove()).attr("x",A.x).attr("y",A.y-g/2).attr("width",_.range()[1]).attr("height",g).style("fill","red").style("fill-opacity",0).attr("transform",M=>`rotate(${jg(b(M))}, ${A.x}, ${A.y})`),k.appendOrSelect(n,"g.y-labels").attr("role",lt.GROUP).selectAll("text").data(Re(E)).join(M=>M.append("text").attr("opacity",0).text(L=>L).attr("x",L=>Ft(-Math.PI/2,_(L),A).x+f).attr("y",L=>Ft(-Math.PI/2,_(L),A).y).style("text-anchor","start").style("dominant-baseline","middle").call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_update",animate:t})).text(w=>w).attr("opacity",1).attr("x",w=>Ft(-Math.PI/2,_(w),A).x+f).attr("y",w=>Ft(-Math.PI/2,_(w),A).y)),M=>M.call(L=>L.transition().call(w=>this.services.transitions.setupTransition({transition:w,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===qt.CENTER?a=Math.floor((s-i.width)/2):t===qt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=R(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-${jr(i)}`),o=t.parent.selectAll(`.dots circle.${jr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,h=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",or.dotsRadius);const d=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:s,items:d.filter(f=>typeof f[h]=="number").map(f=>({label:f[u],value:f[h],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=R(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:R(this),datum:i})}).on("mouseout",function(r,i){const s=R(this),a=t.parent.select(`.x-axes .x-axis-${jr(i)}`),o=t.parent.selectAll(`.dots circle.${jr(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 Qm extends Qc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=Q.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:[tt.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(),h=l[c],d=this.services.cartesianScales.getDomainValue(l)-u/2,f=d+u;let p,m;if(Array.isArray(h)&&h.length===2)p=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,v)),m=this.services.cartesianScales.getRangeValue(l)}const g=Math.abs(m-p);if(g!==0&&g<2&&(h>0&&a===Qt.VERTICAL||h<0&&a===Qt.HORIZONTAL?m=p-2:m=p+2),!this.isOutsideZoomedDomain(d,f))return ue({x0:d,x1:f,y0:p,y1:m},a)}).attr("opacity",1).attr("role",lt.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=R(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:R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(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 VI extends he{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=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 Jm extends ft{constructor(){super(...arguments),this.type="area-stacked",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?yn.opacity.unselected:yn.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",yn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),h=this.services.cartesianScales.getScaleByPosition(u),d=n.selectAll("path.area").data(o,f=>x(f,0,s));this.areaGenerator=Ul().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(c,f.data.sharedStackKey)).y0(f=>h(f[0])).y1(f=>h(f[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,f=>x(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:x(f,0,s),originalClassName:"area"})).style("fill",f=>r.model.getFillColor(x(f,0,s))).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>x(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",yn.opacity.selected).attr("d",this.areaGenerator)}}class tv extends Qc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",lt.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:[tt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,h=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(u)-h/2,f=d+h,p=this.services.cartesianScales.getRangeValue(c[0]);let m=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(d,f)){if(Math.abs(m-p)>0&&Math.abs(m-p)>r.bars.dividerSize){const g=c[0]<0&&c[1]<=0;g&&a.length>1?this.services.cartesianScales.getOrientation()===Qt.VERTICAL?m+=c[1]===0?2:1:m-=1:g||(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?m+=1:m-=1)}return ue({x0:d,x1:f,y0:p,y1:m},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",lt.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=R(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=R(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:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(this);a.classed("hovered",!1),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ev extends Je{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=Q.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>x(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",lt.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 h=u[i],d=this.services.cartesianScales.getDomainIdentifier(u),f=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:h,[d]: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,h)=>{const d=u[i],f=u.data.sharedStackKey;let p=u.data[d];const m=u[1],g=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(m)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][h].data[d]),p!==null&&o.push({[i]:d,[g]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(h=>h[i]==l[i]&&h[c]==l[c]&&h[u]==l[u])!==void 0})}}const Zr=6;class HI extends ft{constructor(){super(...arguments),this.type="tree",this.renderType=Q.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=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),h={top:0,right:0,bottom:0,left:l>0?l+Zr:30-Zr},d=Oi({name:o,children:a}),f=10,p=r/6,m=E=>{const T=d.descendants().reverse(),D=d.links();let N=d,A=d;d.eachBefore(I=>{I.x<N.x&&(N=I),I.x>A.x&&(A=I)});const C=A.x-N.x,V=n.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-h.left,N.x,r,C].join(" ")),M=_.selectAll("g").data(T,I=>I.id),L=this,w=M.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",I=>I.depth!==0&&I.children&&I.children.length>0?"clickable":null).on("mouseover",function(I,B){L.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:I,element:R(this),datum:B})}).on("click",function(I,B){B.depth!==0&&(B.children=B.children?null:B._children,m(B)),L.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:I,element:R(this),datum:B})}).on("mouseout",function(I,B){L.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:I,element:R(this),datum:B})});w.append("circle").attr("r",2.5).attr("class",I=>I._children?"parent":"child").attr("stroke-width",10),w.append("text").attr("dy","0.31em").attr("x",I=>I._children?-Zr:Zr).attr("text-anchor",I=>I._children?"end":"start").text(I=>I.data.name).clone(!0).attr("class","text-stroke").lower(),M.merge(w).transition(V).attr("transform",I=>`translate(${I.y},${I.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),M.exit().transition(V).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const P=S.selectAll("path").data(D,I=>I.target.id),U=P.enter().append("path").attr("d",()=>{const I={x:E.x0,y:E.y0};return b({source:I,target:I})});P.merge(U).transition(V).attr("d",b),P.exit().transition(V).remove().attr("d",()=>{const I={x:E.x,y:E.y};return b({source:I,target:I})}),d.eachBefore(I=>{I.x0=I.x,I.y0=I.y})},g=d.descendants(),v=g[g.length-1].depth,y=x(s,"tree","type")===lo.DENDROGRAM?ow().size([i,r-u-v*Zr-l]):Yw().nodeSize([f,p]).size([i,r-u-v*Zr-l]),b=WE().x(E=>E.y).y(E=>E.x);d.x0=p/2,d.y0=0,d.descendants().forEach((E,T)=>{E.id=T,E._children=E.children}),y(d),n.attr("viewBox",[-h.left,-h.top,r,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");m(d)}}var FI="#000000",GI="#ffffff",zI="#fcf4d6",jI="#fddc69",WI="#f1c21b",qI="#d2a106",YI="#b28600",XI="#8e6a00",ZI="#684e00",KI="#483700",QI="#302400",JI="#1c1500",tN={10:zI,20:jI,30:WI,40:qI,50:YI,60:XI,70:ZI,80:KI,90:QI,100:JI},eN="#fff2e8",nN="#ffd9be",rN="#ffb784",iN="#ff832b",sN="#eb6200",aN="#ba4e00",oN="#8a3800",lN="#5e2900",cN="#3e1a00",uN="#231000",hN={10:eN,20:nN,30:rN,40:iN,50:sN,60:aN,70:oN,80:lN,90:cN,100:uN},dN="#fff1f1",fN="#ffd7d9",pN="#ffb3b8",gN="#ff8389",mN="#fa4d56",vN="#da1e28",yN="#a2191f",bN="#750e13",xN="#520408",wN="#2d0709",_N={10:dN,20:fN,30:pN,40:gN,50:mN,60:vN,70:yN,80:bN,90:xN,100:wN},EN="#fff0f7",SN="#ffd6e8",ON="#ffafd2",TN="#ff7eb6",MN="#ee5396",CN="#d02670",$N="#9f1853",AN="#740937",LN="#510224",kN="#2a0a18",DN={10:EN,20:SN,30:ON,40:TN,50:MN,60:CN,70:$N,80:AN,90:LN,100:kN},RN="#f6f2ff",IN="#e8daff",NN="#d4bbff",PN="#be95ff",UN="#a56eff",BN="#8a3ffc",VN="#6929c4",HN="#491d8b",FN="#31135e",GN="#1c0f30",zN={10:RN,20:IN,30:NN,40:PN,50:UN,60:BN,70:VN,80:HN,90:FN,100:GN},jN="#edf5ff",WN="#d0e2ff",qN="#a6c8ff",YN="#78a9ff",XN="#4589ff",ZN="#0f62fe",KN="#0043ce",QN="#002d9c",JN="#001d6c",tP="#001141",eP={10:jN,20:WN,30:qN,40:YN,50:XN,60:ZN,70:KN,80:QN,90:JN,100:tP},nP="#e5f6ff",rP="#bae6ff",iP="#82cfff",sP="#33b1ff",aP="#1192e8",oP="#0072c3",lP="#00539a",cP="#003a6d",uP="#012749",hP="#061727",dP={10:nP,20:rP,30:iP,40:sP,50:aP,60:oP,70:lP,80:cP,90:uP,100:hP},fP="#d9fbfb",pP="#9ef0f0",gP="#3ddbd9",mP="#08bdba",vP="#009d9a",yP="#007d79",bP="#005d5d",xP="#004144",wP="#022b30",_P="#081a1c",EP={10:fP,20:pP,30:gP,40:mP,50:vP,60:yP,70:bP,80:xP,90:wP,100:_P},SP="#defbe6",OP="#a7f0ba",TP="#6fdc8c",MP="#42be65",CP="#24a148",$P="#198038",AP="#0e6027",LP="#044317",kP="#022d0d",DP="#071908",RP={10:SP,20:OP,30:TP,40:MP,50:CP,60:$P,70:AP,80:LP,90:kP,100:DP},IP="#f2f4f8",NP="#dde1e6",PP="#c1c7cd",UP="#a2a9b0",BP="#878d96",VP="#697077",HP="#4d5358",FP="#343a3f",GP="#21272a",zP="#121619",jP={10:IP,20:NP,30:PP,40:UP,50:BP,60:VP,70:HP,80:FP,90:GP,100:zP},WP="#f4f4f4",qP="#e0e0e0",YP="#c6c6c6",XP="#a8a8a8",ZP="#8d8d8d",KP="#6f6f6f",QP="#525252",JP="#393939",tU="#262626",eU="#161616",nU={10:WP,20:qP,30:YP,40:XP,50:ZP,60:KP,70:QP,80:JP,90:tU,100:eU},rU="#f7f3f2",iU="#e5e0df",sU="#cac5c4",aU="#ada8a8",oU="#8f8b8b",lU="#726e6e",cU="#565151",uU="#3c3838",hU="#272525",dU="#171414",fU={10:rU,20:iU,30:sU,40:aU,50:oU,60:lU,70:cU,80:uU,90:hU,100:dU},nv={black:{100:FI},blue:eP,coolGray:jP,cyan:dP,gray:nU,green:RP,magenta:DN,orange:hN,purple:zN,red:_N,teal:EP,warmGray:fU,white:{0:GI},yellow:tN};const pU=e=>{if(!e)return null;for(const t of Object.keys(nv)){const n=nv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},rv=function(){const e=R(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=an(t);let r;if(n&&(r=pU(n?n.hex():null)),r==null){const i=Mo(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let gU=0;class mU extends ft{constructor(){super(...arguments),this.type="treemap",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Oi({name:i.title||"Treemap",children:r}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=Jw().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 h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>gU++).merge(u);h.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 d=h.selectAll("rect.leaf").data(f=>[f]);d.exit().attr("width",0).attr("height",0).remove(),d.enter().append("rect").classed("leaf",!0).merge(d).attr("width",0).attr("height",0).attr("id",function(){const f=R(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:[tt.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)}),h.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const p=R(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=R(this.parentNode.parentNode).attr("data-uid"),m=`${i.style.prefix}-leaf-${p}`;return new URL(`#${m}`,s)+""}),f=>null,f=>f.remove()),h.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let p=f;for(;p.depth>1;)p=p.parent;const m=Mo(this.model.getFillColor(p.data.name));return[{text:f.data.name,color:m.l<.5?"white":"black"}]},f=>f).join(f=>{const p=f.append("text").text(m=>m.text).style("fill",rv).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const m=R(this.parentNode).attr("data-uid"),g=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${g}`,s)+""})`}),p},f=>f.text(p=>p.text).style("fill",rv),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=R(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),an(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=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(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 vU extends ft{constructor(){super(...arguments),this.type="wordcloud",this.renderType=Q.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:h}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||h===0)return;const d=jk().size([u,h]).words(i.map(function(p){const m=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:m,value:m}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);d.start();function f(p){const m=k.appendOrSelect(r,"g.words");m.attr("transform",`translate(${d.size()[0]/2}, ${d.size()[1]/2})`);const g=m.selectAll("text").data(p,v=>`${v[c]}-${v.text}`);g.exit().attr("opacity",0).remove(),g.enter().append("text").attr("opacity",0).merge(g).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.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?Re(i):[1,1];return Be().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Fa(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:R(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:[tt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(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 yU extends ft{constructor(){super(...arguments),this.type="geo",this.renderType=Q.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=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(g=>{typeof a[g].value=="number"?o[g]=a[g]:l[g]=a[g]});const c=xI(s,Object.values(l)),u=vI(s,{type:"GeometryCollection",geometries:Object.values(o)}),h=i.fitSize([n,r],u),d=Dx().projection(h);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",d);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",Ii()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",d).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case sn.geoEqualEarth:t=Qx();break;case sn.geoAlbers:t=jx();break;case sn.geoConicEqualArea:t=Pd();break;case sn.geoConicEquidistant:t=Zx();break;case sn.geoEquirectangular:t=Yx();break;case sn.geoMercator:t=Wx();break;case sn.geoNaturalEarth1:t=Jx();break;default:throw new Error("Projection is not supported.")}return t}}class bU extends yU{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=R(this);t.services.events.dispatchEvent(dr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Jr.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(dr.CHOROPLETH_MOUSEMOVE,{event:r,element:R(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Jr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(dr.CHOROPLETH_CLICK,{event:r,element:R(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=R(this);t.services.events.dispatchEvent(dr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Jr.HIDE,{event:r,hoveredElement:s})})}}function iv(e,t){ot(2,arguments);var n=yt(e),r=Kt(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function Jc(e,t){ot(2,arguments);var n=yt(e),r=Kt(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),s=new Date(n.getTime());s.setMonth(n.getMonth()+r+1,0);var a=s.getDate();return i>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}var xU=36e5;function sv(e,t){ot(2,arguments);var n=Kt(t);return wa(e,n*xU)}function av(e){ot(1,arguments);var t=yt(e);return t.setHours(0,0,0,0),t}var wU=864e5;function _U(e,t){ot(2,arguments);var n=av(e),r=av(t),i=n.getTime()-Wl(n),s=r.getTime()-Wl(r);return Math.round((i-s)/wU)}var EU=6e4;function tu(e,t){ot(2,arguments);var n=Kt(t);return wa(e,n*EU)}function eu(e,t){ot(2,arguments);var n=Kt(t);return wa(e,n*1e3)}function ov(e,t){ot(2,arguments);var n=Kt(t);return Jc(e,n*12)}function is(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}var SU=6e4,OU=36e5;function TU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function MU(e,t){ot(2,arguments);var n=yt(e),r=yt(t);return n.getFullYear()-r.getFullYear()}function lv(e,t){var 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 CU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=lv(n,r),s=Math.abs(_U(n,r));n.setDate(n.getDate()-i*s);var a=+(lv(n,r)===-i),o=i*(s-a);return o===0?0:o}function nu(e,t){return ot(2,arguments),yt(e).getTime()-yt(t).getTime()}var cv={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},$U="trunc";function ru(e){return e?cv[e]:cv[$U]}function AU(e,t,n){ot(2,arguments);var r=nu(e,t)/OU;return ru(n==null?void 0:n.roundingMethod)(r)}function uv(e,t,n){ot(2,arguments);var r=nu(e,t)/SU;return ru(n==null?void 0:n.roundingMethod)(r)}function LU(e){ot(1,arguments);var t=yt(e);return t.setHours(23,59,59,999),t}function kU(e){ot(1,arguments);var t=yt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function DU(e){ot(1,arguments);var t=yt(e);return LU(t).getTime()===kU(t).getTime()}function RU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=is(n,r),s=Math.abs(TU(n,r)),a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);var o=is(n,r)===-i;DU(yt(e))&&s===1&&is(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function hv(e,t,n){ot(2,arguments);var r=nu(e,t)/1e3;return ru(n==null?void 0:n.roundingMethod)(r)}function IU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=is(n,r),s=Math.abs(MU(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=is(n,r)===-i,o=i*(s-Number(a));return o===0?0:o}function NU(e,t){ot(2,arguments);var n=Kt(t);return iv(e,-n)}function PU(e,t){ot(2,arguments);var n=Kt(t);return Jc(e,-n)}function UU(e,t){ot(2,arguments);var n=Kt(t);return sv(e,-n)}function dv(e,t){ot(2,arguments);var n=Kt(t);return tu(e,-n)}function fv(e,t){ot(2,arguments);var n=Kt(t);return eu(e,-n)}function BU(e,t){ot(2,arguments);var n=Kt(t);return ov(e,-n)}function pv(e){var t=e==null?0:e.length;return t?Da(e,1):[]}class VU extends En{zoomIn(t,n,r){let i,s,a;const o=r||Hr;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:R(t)})}zoomOut(t,n){const r=n||Hr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}}class HU extends En{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 FU extends En{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 GU extends En{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(O.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(x(fg,n,"duration")||fg.default.duration)}getPendingTransitions(){return this.pendingTransitions}}let zU=class extends En{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=x(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=x(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return x(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===H.BOTTOM||t===H.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(H).map(t=>H[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===H.LEFT||this.rangeAxisPosition===H.RIGHT)&&(this.domainAxisPosition===H.BOTTOM||this.domainAxisPosition===H.TOP)?this.orientation=Qt.VERTICAL:this.orientation=Qt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=x(s,"axes");((t=a[H.LEFT])!=null&&t.correspondingDatasets&&a[H.RIGHT]||(n=a[H.RIGHT])!=null&&n.correspondingDatasets&&a[H.LEFT]||(r=a[H.TOP])!=null&&r.correspondingDatasets&&a[H.BOTTOM]||(i=a[H.BOTTOM])!=null&&i.correspondingDatasets&&a[H.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=x(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===Z.LINEAR||this.scaleTypes[t]===Z.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=[H.BOTTOM,H.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[H.LEFT,H.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=x(i,o)!==null?i[o]:i;let c;switch(n){case Z.LABELS:c=t(l)+t.step()/2;break;case Z.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(x(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=x(r,"axes",t);if(i.scaleType===Z.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return jU(n,s)}else return WU(n,kn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,H.LEFT)===null&&x(n,H.RIGHT)!==null||x(n,H.RIGHT,"main")===!0||r&&x(n,H.LEFT,"correspondingDatasets")?{primary:H.RIGHT,secondary:H.LEFT}:{primary:H.LEFT,secondary:H.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,H.BOTTOM)===null&&x(n,H.TOP)!==null||x(n,H.TOP,"main")===!0||r&&x(n,H.BOTTOM,"correspondingDatasets")?{primary:H.TOP,secondary:H.BOTTOM}:{primary:H.BOTTOM,secondary:H.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||Z.LINEAR,o=s.scaleType||Z.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===Z.LABELS||o===Z.TIME)&&a===Z.LABELS||a===Z.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=x(n,"axes",t),i=x(n,"bounds"),{includeZero:s}=r,a=x(r,"scaleType")||Z.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Hn(v,y=>y.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),y=this.model.getStackKeys({bins:v});return[y[0].split("-")[0],y[y.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:h}=r,{reference:d,compareTo:f}=kn.ratio;if(r.domain)return a===Z.LABELS?r.domain:(a===Z.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===Z.LABELS)return Xi(o.map(v=>v[c]));let p,m;const g=this.model.getDataGroupNames();if(a===Z.LABELS_RATIO)return o.map(v=>`${v[d]}/${v[f]}`);if(a===Z.TIME)m=o.map(v=>+new Date(v[c]));else if(i&&n.axes)m=[],o.forEach(v=>{m.push(v[c]),v[i.upperBoundMapsTo]&&m.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&m.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&g&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,y=this.model.getDataValuesGroupedByKeys({groups:g}),b=o.filter(_=>!g.includes(_[v])),S=[];y.forEach(_=>{const{...E}=_;let T=0,D=0;Object.values(E).forEach(N=>{isNaN(N)||(N<0?D+=N:T+=N)}),S.push([D,T])}),m=[...pv(S),...b.map(_=>_[c])]}else m=[],o.forEach(v=>{const y=v[c];Array.isArray(y)&&y.length===2?(m.push(y[0]),m.push(y[1])):(l&&m.push(Math.max(v[c],v[l])),m.push(y))});return a!==Z.TIME&&a!==Z.LOG&&s&&m.push(0),h&&h.length>0&&h.forEach(v=>{const y=x(v,"value");y!==null&&m.push(y)}),p=Re(m),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=x(n,"axes",t);if(!r)return null;const i=x(r,"scaleType")||Z.LINEAR;this.scaleTypes[t]=i;let s;return i===Z.TIME?s=Sf():i===Z.LOG?s=sf().base(r.base||10):i===Z.LABELS||i===Z.LABELS_RATIO?s=Ci():s=Be(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===Z.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}};function jU(e,t){const n=new Date(e[0]),r=new Date(e[1]);return IU(r,n)>1?[BU(n,t),ov(r,t)]:RU(r,n)>1?[PU(n,t),Jc(r,t)]:CU(r,n)>1?[NU(n,t),iv(r,t)]:AU(r,n)>1?[UU(n,t),sv(r,t)]:uv(r,n)>30?[dv(n,t*30),tu(r,t*30)]:uv(r,n)>1?[dv(n,t),tu(r,t)]:hv(r,n)>15?[fv(n,t*15),eu(r,t*15)]:hv(r,n)>1?[fv(n,t),eu(r,t)]:[n,r]}function WU([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===Z.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}let qU=class extends En{constructor(){super(...arguments),this.curveTypes={curveLinear:pa,curveLinearClosed:Pf,curveBasis:qE,curveBasisClosed:YE,curveBasisOpen:XE,curveBundle:ZE,curveCardinal:KE,curveCardinalClosed:QE,curveCardinalOpen:JE,curveCatmullRom:tS,curveCatmullRomClosed:eS,curveCatmullRomOpen:nS,curveMonotoneX:rS,curveMonotoneY:iS,curveNatural:sS,curveStep:aS,curveStepAfter:lS,curveStepBefore:oS}}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}},YU=class extends En{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===H.BOTTOM&&n===Z.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=x(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Re(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=x(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=_e.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let h=a+u,d=o-u;h>=d&&(h=a+c/2-i/2,d=o-c/2+i/2);const f=[s.invert(h),s.invert(d)];(r[0].valueOf()!==f[0].valueOf()||r[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=x(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return x(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return x(this.model.getOptions(),"zoomBar",t,"locked")}};function XU(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 ZU(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:XU(e,t,n)}var KU="\\ud800-\\udfff",QU="\\u0300-\\u036f",JU="\\ufe20-\\ufe2f",tB="\\u20d0-\\u20ff",eB=QU+JU+tB,nB="\\ufe0e\\ufe0f",rB="\\u200d",iB=RegExp("["+rB+KU+eB+nB+"]");function gv(e){return iB.test(e)}function sB(e){return e.split("")}var mv="\\ud800-\\udfff",aB="\\u0300-\\u036f",oB="\\ufe20-\\ufe2f",lB="\\u20d0-\\u20ff",cB=aB+oB+lB,uB="\\ufe0e\\ufe0f",hB="["+mv+"]",iu="["+cB+"]",su="\\ud83c[\\udffb-\\udfff]",dB="(?:"+iu+"|"+su+")",vv="[^"+mv+"]",yv="(?:\\ud83c[\\udde6-\\uddff]){2}",bv="[\\ud800-\\udbff][\\udc00-\\udfff]",fB="\\u200d",xv=dB+"?",wv="["+uB+"]?",pB="(?:"+fB+"(?:"+[vv,yv,bv].join("|")+")"+wv+xv+")*",gB=wv+xv+pB,mB="(?:"+[vv+iu+"?",iu,yv,bv,hB].join("|")+")",vB=RegExp(su+"(?="+su+")|"+mB+gB,"g");function yB(e){return e.match(vB)||[]}function bB(e){return gv(e)?yB(e):sB(e)}function xB(e){return function(t){t=qi(t);var n=gv(t)?bB(t):void 0,r=n?n[0]:t.charAt(0),i=n?ZU(n,1).join(""):t.slice(1);return r[e]()+i}}var wB=xB("toUpperCase");const _B=wB;function EB(e){return _B(qi(e).toLowerCase())}var SB=_m(function(e,t,n){return t=t.toLowerCase(),e+(n?EB(t):t)});const OB=SB;class ze{constructor(t,n){this.components=[],this.services={canvasZoom:VU,domUtils:k,events:HU,files:FU,gradientUtils:Tc,transitions:GU},this.model=new Qe(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(O.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(O.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(O.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s={id:"legend",components:[new Xc(this.model,this.services)],growth:at.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new rI(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},c={id:"toolbar",components:[new Ka(this.model,this.services)],growth:at.PREFERRED},u={id:"header",components:[new Se(this.model,this.services,[l,...i?[c]:[]],{direction:$t.ROW,alignItems:fr.CENTER})],growth:at.PREFERRED},h={id:"graph-frame",components:t,growth:at.STRETCH,renderType:x(n,"graphFrameRenderType")||Q.SVG},d=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=$t.COLUMN;if(d){const v=x(r,"legend","position");v==="left"?(f=$t.ROW,r.legend.orientation||(r.legend.orientation=ei.VERTICAL)):v==="right"?(f=$t.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=ei.VERTICAL)):v==="bottom"&&(f=$t.COLUMN_REVERSE)}const p={id:"spacer",components:[new Sn(this.model,this.services)],growth:at.PREFERRED},m={id:"full-frame",components:[new Se(this.model,this.services,[...d?[s]:[],...d?[p]:[],h],{direction:f})],growth:at.STRETCH},g=[];if(o||i){g.push(u);const v={id:"spacer",components:[new Sn(this.model,this.services,i?{size:15}:void 0)],growth:at.PREFERRED};g.push(v)}return g.push(m),[new Zc(this.model,this.services),new io(this.model,this.services),new Se(this.model,this.services,g,{direction:$t.COLUMN})]}}class ye extends ze{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:zU,curves:qU,zoom:YU}),this.model=new cr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",H.TOP,"enabled"),s=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=x(r,"axes",a,"scaleType"),l=i&&a===H.BOTTOM&&o===Z.TIME,c=this.services.zoom.isZoomBarLocked(H.TOP),u=!!this.model.getOptions().title,h={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},d={id:"toolbar",components:[new Ka(this.model,this.services)],growth:at.PREFERRED},f={id:"header",components:[new Se(this.model,this.services,[h,...s?[d]:[]],{direction:$t.ROW,alignItems:fr.CENTER})],growth:at.PREFERRED},p={id:"legend",components:[new Xc(this.model,this.services)],growth:at.PREFERRED};l&&!c&&t.push(new Um(this.model,this.services),new iI(this.model,this.services)),t.push(new aI(this.model,this.services)),t.push(new oI(this.model,this.services));const m={id:"graph-frame",components:t,growth:at.STRETCH,renderType:Q.SVG},g=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=$t.COLUMN;if(g){const E=x(this.model.getOptions(),"legend","position");E===ti.LEFT?(v=$t.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=ei.VERTICAL)):E===ti.RIGHT?(v=$t.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=ei.VERTICAL)):E===ti.BOTTOM&&(v=$t.COLUMN_REVERSE)}const y={id:"spacer",components:[new Sn(this.model,this.services)],growth:at.PREFERRED},b={id:"full-frame",components:[new Se(this.model,this.services,[...g?[p]:[],...g?[y]:[],m],{direction:v})],growth:at.STRETCH},S={id:"zoom-bar",components:[new sI(this.model,this.services)],growth:at.PREFERRED,renderType:Q.SVG},_=[];if(u||s){_.push(f);const E={id:"spacer",components:[new Sn(this.model,this.services,s?{size:15}:void 0)],growth:at.PREFERRED};_.push(E)}return l&&_.push(S),_.push(b),[new Fm(this.model,this.services),new io(this.model,this.services),new Se(this.model,this.services,_,{direction:$t.COLUMN})]}}class TB extends ze{constructor(t,n){super(t,n),this.model=new HA(this.services),this.model.setOptions(Nt(Tt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new lI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class MB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(vn(Tt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new Yr(this.model,this.services),new Gm(this.model,this.services),new Je(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class CB extends ye{constructor(t,n){super(t,n),this.model=new FA(this.services),this.model.setOptions(Nt(Tt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new hI(this.model,this.services),new Xr(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class $B extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new dI(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class AB extends ye{constructor(t,n){super(t,n),this.model=new GA(this.services),this.model.setOptions(Nt(Tt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new fI(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class LB extends ze{constructor(t,n){super(t,n),this.model=new zA(this.services),this.model.setOptions(Nt(Tt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},o={id:"toolbar",components:[new Ka(this.model,this.services)],growth:at.PREFERRED},l={id:"header",components:[new Se(this.model,this.services,[a,...i?[o]:[]],{direction:$t.ROW,alignItems:fr.CENTER})],growth:at.PREFERRED},c={id:"legend",components:[new qm(this.model,this.services,{chartType:"choropleth"})],growth:at.PREFERRED,renderType:Q.SVG},u={id:"graph-frame",components:t,growth:at.STRETCH,renderType:Q.SVG},h=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=$t.COLUMN_REVERSE,f={id:"spacer",components:[new Sn(this.model,this.services,{size:15})],growth:at.PREFERRED},p={id:"full-frame",components:[new Se(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:at.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new Sn(this.model,this.services,i?{size:15}:void 0)],growth:at.PREFERRED};m.push(g)}return m.push(p),[new Zc(this.model,this.services),new io(this.model,this.services),new Se(this.model,this.services,m,{direction:$t.COLUMN})]}getComponents(){const t=[new bU(this.model,this.services)];return this.getChartComponents(t)}}class kB extends ze{constructor(t,n){super(t,n),this.model=new jA(this.services),this.model.setOptions(Nt(Tt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new LI(this.model,this.services)];return this.getChartComponents(t)}}const _v={[Te.LINE]:[Yr,Je],[Te.SCATTER]:[Je],[Te.AREA]:[Gm,Yr,Je],[Te.STACKED_AREA]:[Jm,Yr,ev,ao],[Te.SIMPLE_BAR]:[Qm],[Te.GROUPED_BAR]:[Km,Xr],[Te.STACKED_BAR]:[tv,ao]};class DB extends ye{constructor(t,n){super(t,n);const r=Nt(Tt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Te.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(_v).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=`${OB(i.type)}Chart`;return a=rt({},Tt[l],this.model.getOptions(),i.options),i.type===Te.STACKED_AREA&&(o=!0),_v[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=rt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return pv(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Te.STACKED_BAR||i.type===Te.STACKED_AREA),r=[new ve(this.model,this.services),new Oe(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID}),...n?[]:[new Nn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Ev extends ze{constructor(t,n,r=!1){super(t,n),this.model=new WA(this.services),!r&&(this.model.setOptions(Nt(Tt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Ym(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.PIE})];return this.getChartComponents(t)}}class RB extends Ev{constructor(t,n){super(t,n,!0),this.model.setOptions(Nt(Tt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new DI(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.DONUT})];return this.getChartComponents(t)}}class IB extends ze{constructor(t,n){super(t,n),this.model=new qA(this.services),this.model.setOptions(Nt(Tt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new RI(this.model,this.services)];return this.getChartComponents(t)}}class NB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Km(this.model,this.services),new Xr(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class PB extends ye{constructor(t,n){super(t,n),this.model=new YA(this.services),this.model.setOptions(Nt(Tt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},o={id:"toolbar",components:[new Ka(this.model,this.services)],growth:at.PREFERRED},l={id:"header",components:[new Se(this.model,this.services,[a,...i?[o]:[]],{direction:$t.ROW,alignItems:fr.CENTER})],growth:at.PREFERRED},c={id:"legend",components:[new qm(this.model,this.services,{chartType:"heatmap"})],growth:at.PREFERRED,renderType:Q.SVG},u={id:"graph-frame",components:t,growth:at.STRETCH,renderType:Q.SVG},h=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=$t.COLUMN_REVERSE,f={id:"spacer",components:[new Sn(this.model,this.services,{size:15})],growth:at.PREFERRED},p={id:"full-frame",components:[new Se(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:at.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new Sn(this.model,this.services,i?{size:15}:void 0)],growth:at.PREFERRED};m.push(g)}return m.push(p),[new Fm(this.model,this.services),new io(this.model,this.services),new Se(this.model,this.services,m,{direction:$t.COLUMN})]}getComponents(){const t=[new ve(this.model,this.services),new II(this.model,this.services)];return this.getAxisChartComponents(t)}}class UB extends ye{constructor(t,n){super(t,n),this.model=new XA(this.services),this.model.setOptions(Nt(Tt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new _I(this.model,this.services),new NI(this.model,this.services)];return this.getAxisChartComponents(t)}}class BB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new Yr(this.model,this.services),new Je(this.model,this.services,{handleThresholds:!0}),new VI(this.model,this.services),new Xr(this.model,this.services)];return this.getAxisChartComponents(t)}}class VB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new PI(this.model,this.services),new Je(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class HB extends ze{constructor(t,n){var r;super(t,n),this.model=new ZA(this.services);const i=(r=n.options.meter)!=null&&r.proportional?rt(vn(Tt.proportionalMeterChart),n.options):rt(vn(Tt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new AI(this.model,this.services)],growth:at.STRETCH,renderType:Q.SVG},{id:"spacer",components:[new Sn(this.model,this.services,{size:8})],growth:at.STRETCH}]:[],{id:"meter-graph",components:[new UI(this.model,this.services)],growth:at.STRETCH,renderType:Q.SVG}],n=[new Se(this.model,this.services,t,{direction:$t.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:Q.HTML})}}class FB extends ze{constructor(t,n){super(t,n),this.model=new KA(this.services),this.model.setOptions(Nt(Tt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new BI(this.model,this.services)];return this.getChartComponents(t)}}class GB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new Je(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class zB extends ze{constructor(t,n){super(t,n),this.model=new QA(this.services),this.model.setOptions(Nt(Tt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new HI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class jB extends ze{constructor(t,n){super(t,n),this.model=new JA(this.services),this.model.setOptions(Nt(Tt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new mU(this.model,this.services)];return this.getChartComponents(t)}}class WB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Qm(this.model,this.services),new Xr(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class qB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new ao(this.model,this.services),new Jm(this.model,this.services),new Yr(this.model,this.services,{stacked:!0}),new ev(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class YB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new ao(this.model,this.services),new tv(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.VERT_OR_HORIZ}),new Xr(this.model,this.services)];return this.getAxisChartComponents(t)}}class XB extends ze{constructor(t,n){super(t,n),this.model=new tL(this.services),this.model.setOptions(Nt(Tt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new vU(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.PIE})];return this.getChartComponents(t)}}var au={exports:{}},ss={};/**
|
|
83
|
+
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=R(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],h=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:At(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else h=r.value;const d=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:d,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:h},...c,...u]})}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=R(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=R(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=R(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Hr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");R(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Hr),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 kI(e,t){const n=ci(this._current,e);return r=>(this._current=n(r),t(this._current))}class Ym extends ft{constructor(){super(...arguments),this.type="pie",this.renderType=Q.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 kt.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=Ri().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ri().innerRadius(this.getInnerRadius()).outerRadius(l+kt.hoverArc.outerRadiusOffset);const c=PE().value(T=>T[a]).sort(x(i,"pie","sortFunction")).padAngle(kt.padAngle)(o),u=k.appendOrSelect(r,"g.slices").attr("role",lt.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:[tt.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",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",T=>`${T[a]}, ${wg(T.data[a],o,a)+"%"}`).attrTween("d",function(T){return kI.bind(this)(T,n.arc)});const h=i.pie.labels.enabled,d=h?c.filter(T=>T.data[a]>0):[],f=k.appendOrSelect(r,"g.labels").attr("role",lt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(d,T=>T.data[s]);f.exit().attr("opacity",0).remove();const p=f.enter().append("text").classed("pie-label",!0),m=[];p.merge(f).style("text-anchor","middle").text(T=>i.pie.labels.formatter?i.pie.labels.formatter(T):wg(T.data[a],o,a)+"%").datum(function(T){const D=l+7,N=(T.endAngle-T.startAngle)/2+T.startAngle,L=N/Math.PI*180,C=this.getComputedTextLength();return T.textOffsetX=C/2,T.textOffsetY=L>90&&L<270?10:0,T.xPosition=(T.textOffsetX+D)*Math.sin(N),T.yPosition=(T.textOffsetY+D)*-Math.cos(N),T}).attr("transform",function(T,D){const N=d.length,L=(T.endAngle-T.startAngle)*(180/Math.PI);if(D>=N-2&&L<kt.callout.minSliceDegree){let C,V;return T.index===N-1?(C=T.xPosition+kt.callout.offsetX+kt.callout.textMargin+T.textOffsetX,V=T.yPosition-kt.callout.offsetY,T.direction=ls.RIGHT,m.push(T)):(C=T.xPosition-kt.callout.offsetX-T.textOffsetX-kt.callout.textMargin,V=T.yPosition-kt.callout.offsetY,T.direction=ls.LEFT,m.push(T)),`translate(${C}, ${V})`}return`translate(${T.xPosition}, ${T.yPosition})`}),this.renderCallouts(m);const g=x(i,"donut")?"donut":"pie",v=x(i,g,"alignment"),{width:y}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),b=h?kt.xOffset:0,S=h?kt.yOffset:0;let _=l+b;v===qt.CENTER?_=y/2:v===qt.RIGHT&&(_=y-l-kt.xOffset);let E=l+S;m.length>0&&(E+=kt.yOffsetCallout),r.attr("x",_+7).attr("y",E),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",lt.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",lt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===ls.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+kt.callout.offsetX,y:o-kt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-kt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-kt.callout.offsetX,y:o-kt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+kt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return R(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 R(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=R(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:R(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=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(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+kt.radiusOffset:i}}class DI extends Ym{constructor(){super(...arguments),this.type="donut",this.renderType=Q.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=x(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(R(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=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=vh:s=xe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Xm="4,10 8,6 12,10",Zm="12,6 8,10 4,6";class RI extends ft{constructor(){super(...arguments),this.type="gauge",this.renderType=Q.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Em(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===pr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case co.UP:return Xm;case co.DOWN:return Zm;default:return t>0?Xm:Zm}}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,h=this.computeRadius(),d=this.getInnerRadius();this.backgroundArc=Ri().innerRadius(d).outerRadius(h).startAngle(c).endAngle(u),this.arc=Ri().innerRadius(d).outerRadius(h).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:[tt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=x(r,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let g=h;p===qt.CENTER?g=m/2:p===qt.RIGHT&&(g=m-h),n.attr("x",g).attr("y",h),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let h=0;r===pr.FULL&&!s?h=l(a):r===pr.SEMI&&s&&(h=-(l(a)+c));const d=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${h})`),f=o(a),p=k.appendOrSelect(d,"g.gauge-value-number"),m=x(n,"gauge","numberFormatter"),g=p.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${f}px`).attr("text-anchor","middle").text(T=>m(T));const{width:v}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,b=u?"%":"",S=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",v/2).text(b),{width:_,height:E}=k.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${E/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?x(r,"gauge","deltaFontSize"):()=>0,o=i?x(r,"gauge","numberFormatter"):()=>null,l=x(r,"gauge","deltaArrow","size"),c=x(r,"gauge","numberSpacing"),u=x(r,"gauge","showPercentageSymbol"),h=k.appendOrSelect(n,"g.gauge-numbers"),d=k.appendOrSelect(h,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=k.appendOrSelect(d,"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:m}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=x(r,"gauge","deltaArrow","enabled"),v=d.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);v.enter().append("svg").merge(v).attr("class","gauge-delta-arrow").attr("x",-l(s)-m/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=R(this);k.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=x(r,"gauge","status");k.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),v.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOVER,{event:n,element:R(this),datum:r})}).on("mousemove",function(n,r){const i=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===pr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Km extends Qc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=Q.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=Xi(n.map(u=>{const h=this.services.cartesianScales.getDomainIdentifier(u);return u[h]&&typeof u[h].toString=="function"?u[h].toString():u[h]})),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",lt.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 h=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Qt.VERTICAL?`translate(${h}, 0)`:`translate(0, ${h})`});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:[tt.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[i])).attr("d",u=>{const h=this.groupScale(u[i]),d=this.getBarWidth(),f=h,p=h+d,m=this.services.cartesianScales.getRangeAxisPosition({datum:u}),g=this.services.cartesianScales.getValueThroughAxisPosition(m,0),v=this.services.cartesianScales.getRangeValue(u),y=this.services.cartesianScales.getDomainValue(u)-d/2,b=y+d;if(!this.isOutsideZoomedDomain(y,b))return ue({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",lt.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=R(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=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Ci().domain(t).rangeRound([0,this.getGroupWidth()])}}class II extends ft{constructor(){super(...arguments),this.type="heatmap",this.renderType=Q.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="",h=null,d=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const m=this.matrix[r][p].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const m=this.matrix[p][r].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Mn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Mn(l.range())},${c(r)})`),this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n.event,hoveredElement:R(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:d!==null?d:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:h!==null?h/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(O.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(O.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(O.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),h=i.range(),d=s.range();this.xBandwidth=Math.abs((h[1]-h[0])/l.length),this.yBandwidth=Math.abs((d[1]-d[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",m=>`heat-${m.index}`).classed("cell",!0).attr("transform",m=>`translate(${i(m[a])}, ${s(m[o])})`).append("rect").attr("class",m=>this.model.getColorClassName({value:m.value,originalClassName:`heat-${m.index}`})).classed("heat",!0).classed("null-state",m=>m.index===-1||m.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",m=>m.index===-1||m.value===null?`url(#${f})`:this.model.getFillColor(Number(m.value))).attr("aria-label",m=>m.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(d[1]-d[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(h[1]-h[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=x(this.getOptions(),"heatmap","divider","state");return t!==ni.OFF&&(t===ni.AUTO&&hg.minCellDividerDimension<=this.xBandwidth&&hg.minCellDividerDimension<=this.yBandwidth||t===ni.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=At(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 h=R(this),d=h.select("rect.heat");if(!d.classed("null-state")){const f=Ki(h.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:d,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:d.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:R(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:R(this),datum:u})}).on("mouseout",function(c,u){const h=R(this).select("rect.heat"),d=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),d||(t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class NI extends ft{constructor(){super(...arguments),this.type="histogram",this.renderType=Q.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=>At(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",lt.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,h)=>h).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const h=At(u,"data");if(!h)return;const d=o(h.x1)-o(h.x0)-1,f=this.services.cartesianScales.getDomainValue(h.x0),p=f+d,m=this.services.cartesianScales.getRangeValue(u[0]);let g=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(g-m)>0&&Math.abs(g-m)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?g+=1:g-=1),ue({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=R(this);a.classed("hovered",!0);const o=parseFloat(At(s,"data.x0")),l=parseFloat(At(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:At(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:s[n]})},{label:u,value:At(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("mouseout",function(){R(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 PI extends Je{constructor(){super(...arguments),this.type="lollipop",this.renderType=Q.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]?bn.weight.unselected:bn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",bn.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?bn.opacity.unselected:bn.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",bn.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=g=>s.getDomainValue(g),u=g=>s.getRangeValue(g),h=s.getOrientation(),[d,f]=wn(c,u,h),p=n.selectAll("line.line").data(this.getScatterData(),g=>`${g[i]}-${g[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",g=>this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:g[i],originalClassName:"line"})).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"lollipop-line-update-enter",animate:t})).style("stroke",g=>this.model.getFillColor(g[i],g[l],g)).attr("opacity",1);h===Qt.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",g=>d(g)-r.points.radius):m.attr("x1",d).attr("x2",d).attr("y1",o.range()[0]).attr("y2",g=>f(g)+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 UI extends ft{constructor(){super(...arguments),this.type="meter",this.renderType=Q.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)-ee.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-ee.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;x(i,"meter","proportional")===null?u=100:u=x(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const h=Be().domain([0,u]).range([0,l]),d=this.getStackedBounds(a,h),f=x(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?ee.height.proportional:ee.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?ee.height.proportional:ee.height.default));const p=r.selectAll("rect.value").data(d),m=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",b=>b.x).attr("y",0).attr("height",()=>f||(s?ee.height.proportional:ee.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:b[c],originalClassName:m})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?h(u):b.width).style("fill",b=>n.model.getFillColor(b[c])).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const g=x(i,"meter","peak");let v=g;g!==null&&(g>u?v=u:g<a[0].value&&(v=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(v==null?[]:[v]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?ee.height.proportional:ee.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>h(b)).attr("x2",b=>h(b)).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),y.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=R(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=R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(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 BI extends ft{constructor(){super(...arguments),this.type="radar",this.renderType=Q.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}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=BD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return rt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:rt(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?or.opacity.unselected:or.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?or.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",or.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(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=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:h}=x(o,"radar","axes"),{xLabelPadding:d,yLabelPadding:f,yTicksNumber:p,minRange:m,xAxisRectHeight:g}=or;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 v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),y=(Math.min(r,i)-v)/2;if(y<=0)return;const b=Ci().domain(this.fullDataNormalized.map(M=>M[u])).range([0,2*Math.PI].map(M=>M-Math.PI/2)),S=Mn(this.fullDataNormalized.map(M=>M[h])),_=Be().domain([S>=0?0:S,Hn(this.fullDataNormalized.map(M=>M[h]))]).range([m,y]).nice(p),E=_.ticks(p),T=M=>this.model.getFillColor(M),D=VE().angle(M=>b(M[u])+Math.PI/2).radius(M=>_(M[h])).curve(Pf),N=this.uniqueKeys.map(M=>{const A=this.getLabelDimensions(M).width,w=ak(b(M),y);return A+w}),L={x:Hn(N)+d,y:i/2},C=k.appendOrSelect(n,"g.y-axes").attr("role",lt.GROUP).selectAll("path").data(E,M=>M),V=M=>this.uniqueKeys.map(A=>({[u]:A,[h]:M}));C.join(M=>M.append("path").attr("opacity",0).attr("transform",`translate(${L.x}, ${L.y})`).attr("fill","none").call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",w=>D(V(w)))),M=>M.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",w=>D(V(w)))),M=>M.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_exit",animate:t})).attr("d",w=>D(V(w))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",lt.GROUP).selectAll("line").data(this.uniqueKeys,M=>M).join(M=>M.append("line").attr("opacity",0).attr("class",A=>`x-axis-${jr(A)}`).attr("stroke-dasharray","0").attr("x1",A=>Ft(b(A),0,L).x).attr("y1",A=>Ft(b(A),0,L).y).attr("x2",A=>Ft(b(A),0,L).x).attr("y2",A=>Ft(b(A),0,L).y).call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",w=>Ft(b(w),_.range()[0],L).x).attr("y1",w=>Ft(b(w),_.range()[0],L).y).attr("x2",w=>Ft(b(w),_.range()[1],L).x).attr("y2",w=>Ft(b(w),_.range()[1],L).y)),M=>M.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",w=>Ft(b(w),_.range()[0],L).x).attr("y1",w=>Ft(b(w),_.range()[0],L).y).attr("x2",w=>Ft(b(w),_.range()[1],L).x).attr("y2",w=>Ft(b(w),_.range()[1],L).y)),M=>M.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",lt.GROUP).selectAll("text").data(this.uniqueKeys).join(M=>M.append("text").text(A=>A).attr("opacity",0).attr("x",A=>Ft(b(A),_.range()[1]+d,L).x).attr("y",A=>Ft(b(A),_.range()[1]+d,L).y).style("text-anchor",A=>zg(b(A)).textAnchor).style("dominant-baseline",A=>zg(b(A)).dominantBaseline).call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",w=>Ft(b(w),_.range()[1]+d,L).x).attr("y",w=>Ft(b(w),_.range()[1]+d,L).y).end().finally(()=>{const w=x(o,"radar","alignment"),P=this.getAlignmentXOffset(w,n,this.getParent());n.attr("x",P)})),M=>M.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",lt.GROUP).selectAll("path").data(this.groupedDataNormalized,M=>M.name).join(M=>M.append("path").attr("class",A=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:A.name,originalClassName:"blob"})).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-label",A=>A.name).attr("opacity",0).attr("transform",t?()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`:`translate(${L.x}, ${L.y})`).style("fill",A=>T(A.name)).style("fill-opacity",or.opacity.selected).style("stroke",A=>T(A.name)).call(A=>{const w=A.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_blobs_enter",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",`translate(${L.x}, ${L.y})`),w.attr("opacity",1).attr("d",P=>D(P.data))}),M=>(M.attr("class",A=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:A.name,originalClassName:"blob"})).style("fill",A=>T(A.name)).style("stroke",A=>T(A.name)),M.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",w=>D(w.data))),M),M=>M.call(A=>{const w=A.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_blobs_exit",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`),w.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",lt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(M=>x(M,h)!==null)).join(M=>M.append("circle").attr("role",lt.GRAPHICS_SYMBOL).attr("aria-label",A=>A[c]),M=>M,M=>M.remove()).attr("class",M=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:M[l],originalClassName:jr(M[u])})).attr("cx",M=>Ft(b(M[u]),_(M[h]),L).x).attr("cy",M=>Ft(b(M[u]),_(M[h]),L).y).attr("r",0).attr("opacity",0).style("fill",M=>T(M[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",lt.GROUP).selectAll("rect").data(this.uniqueKeys).join(M=>M.append("rect"),M=>M,M=>M.remove()).attr("x",L.x).attr("y",L.y-g/2).attr("width",_.range()[1]).attr("height",g).style("fill","red").style("fill-opacity",0).attr("transform",M=>`rotate(${jg(b(M))}, ${L.x}, ${L.y})`),k.appendOrSelect(n,"g.y-labels").attr("role",lt.GROUP).selectAll("text").data(Re(E)).join(M=>M.append("text").attr("opacity",0).text(A=>A).attr("x",A=>Ft(-Math.PI/2,_(A),L).x+f).attr("y",A=>Ft(-Math.PI/2,_(A),L).y).style("text-anchor","start").style("dominant-baseline","middle").call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_update",animate:t})).text(w=>w).attr("opacity",1).attr("x",w=>Ft(-Math.PI/2,_(w),L).x+f).attr("y",w=>Ft(-Math.PI/2,_(w),L).y)),M=>M.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,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===qt.CENTER?a=Math.floor((s-i.width)/2):t===qt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=R(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-${jr(i)}`),o=t.parent.selectAll(`.dots circle.${jr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,h=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",or.dotsRadius);const d=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:s,items:d.filter(f=>typeof f[h]=="number").map(f=>({label:f[u],value:f[h],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=R(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:R(this),datum:i})}).on("mouseout",function(r,i){const s=R(this),a=t.parent.select(`.x-axes .x-axis-${jr(i)}`),o=t.parent.selectAll(`.dots circle.${jr(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 Qm extends Qc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=Q.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:[tt.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(),h=l[c],d=this.services.cartesianScales.getDomainValue(l)-u/2,f=d+u;let p,m;if(Array.isArray(h)&&h.length===2)p=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,v)),m=this.services.cartesianScales.getRangeValue(l)}const g=Math.abs(m-p);if(g!==0&&g<2&&(h>0&&a===Qt.VERTICAL||h<0&&a===Qt.HORIZONTAL?m=p-2:m=p+2),!this.isOutsideZoomedDomain(d,f))return ue({x0:d,x1:f,y0:p,y1:m},a)}).attr("opacity",1).attr("role",lt.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=R(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:R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(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 VI extends he{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=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 Jm extends ft{constructor(){super(...arguments),this.type="area-stacked",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?yn.opacity.unselected:yn.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",yn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),h=this.services.cartesianScales.getScaleByPosition(u),d=n.selectAll("path.area").data(o,f=>x(f,0,s));this.areaGenerator=Ul().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(c,f.data.sharedStackKey)).y0(f=>h(f[0])).y1(f=>h(f[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,f=>x(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:x(f,0,s),originalClassName:"area"})).style("fill",f=>r.model.getFillColor(x(f,0,s))).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>x(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",yn.opacity.selected).attr("d",this.areaGenerator)}}class tv extends Qc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",lt.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:[tt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,h=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(u)-h/2,f=d+h,p=this.services.cartesianScales.getRangeValue(c[0]);let m=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(d,f)){if(Math.abs(m-p)>0&&Math.abs(m-p)>r.bars.dividerSize){const g=c[0]<0&&c[1]<=0;g&&a.length>1?this.services.cartesianScales.getOrientation()===Qt.VERTICAL?m+=c[1]===0?2:1:m-=1:g||(this.services.cartesianScales.getOrientation()===Qt.VERTICAL?m+=1:m-=1)}return ue({x0:d,x1:f,y0:p,y1:m},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",lt.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=R(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=R(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:R(this),datum:s})}).on("mouseout",function(i,s){const a=R(this);a.classed("hovered",!1),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ev extends Je{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=Q.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>x(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",lt.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 h=u[i],d=this.services.cartesianScales.getDomainIdentifier(u),f=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:h,[d]: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,h)=>{const d=u[i],f=u.data.sharedStackKey;let p=u.data[d];const m=u[1],g=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(m)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][h].data[d]),p!==null&&o.push({[i]:d,[g]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(h=>h[i]==l[i]&&h[c]==l[c]&&h[u]==l[u])!==void 0})}}const Zr=6;class HI extends ft{constructor(){super(...arguments),this.type="tree",this.renderType=Q.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=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),h={top:0,right:0,bottom:0,left:l>0?l+Zr:30-Zr},d=Oi({name:o,children:a}),f=10,p=r/6,m=E=>{const T=d.descendants().reverse(),D=d.links();let N=d,L=d;d.eachBefore(I=>{I.x<N.x&&(N=I),I.x>L.x&&(L=I)});const C=L.x-N.x,V=n.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-h.left,N.x,r,C].join(" ")),M=_.selectAll("g").data(T,I=>I.id),A=this,w=M.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",I=>I.depth!==0&&I.children&&I.children.length>0?"clickable":null).on("mouseover",function(I,B){A.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:I,element:R(this),datum:B})}).on("click",function(I,B){B.depth!==0&&(B.children=B.children?null:B._children,m(B)),A.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:I,element:R(this),datum:B})}).on("mouseout",function(I,B){A.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:I,element:R(this),datum:B})});w.append("circle").attr("r",2.5).attr("class",I=>I._children?"parent":"child").attr("stroke-width",10),w.append("text").attr("dy","0.31em").attr("x",I=>I._children?-Zr:Zr).attr("text-anchor",I=>I._children?"end":"start").text(I=>I.data.name).clone(!0).attr("class","text-stroke").lower(),M.merge(w).transition(V).attr("transform",I=>`translate(${I.y},${I.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),M.exit().transition(V).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const P=S.selectAll("path").data(D,I=>I.target.id),U=P.enter().append("path").attr("d",()=>{const I={x:E.x0,y:E.y0};return b({source:I,target:I})});P.merge(U).transition(V).attr("d",b),P.exit().transition(V).remove().attr("d",()=>{const I={x:E.x,y:E.y};return b({source:I,target:I})}),d.eachBefore(I=>{I.x0=I.x,I.y0=I.y})},g=d.descendants(),v=g[g.length-1].depth,y=x(s,"tree","type")===lo.DENDROGRAM?ow().size([i,r-u-v*Zr-l]):Yw().nodeSize([f,p]).size([i,r-u-v*Zr-l]),b=WE().x(E=>E.y).y(E=>E.x);d.x0=p/2,d.y0=0,d.descendants().forEach((E,T)=>{E.id=T,E._children=E.children}),y(d),n.attr("viewBox",[-h.left,-h.top,r,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");m(d)}}var FI="#000000",GI="#ffffff",zI="#fcf4d6",jI="#fddc69",WI="#f1c21b",qI="#d2a106",YI="#b28600",XI="#8e6a00",ZI="#684e00",KI="#483700",QI="#302400",JI="#1c1500",tN={10:zI,20:jI,30:WI,40:qI,50:YI,60:XI,70:ZI,80:KI,90:QI,100:JI},eN="#fff2e8",nN="#ffd9be",rN="#ffb784",iN="#ff832b",sN="#eb6200",aN="#ba4e00",oN="#8a3800",lN="#5e2900",cN="#3e1a00",uN="#231000",hN={10:eN,20:nN,30:rN,40:iN,50:sN,60:aN,70:oN,80:lN,90:cN,100:uN},dN="#fff1f1",fN="#ffd7d9",pN="#ffb3b8",gN="#ff8389",mN="#fa4d56",vN="#da1e28",yN="#a2191f",bN="#750e13",xN="#520408",wN="#2d0709",_N={10:dN,20:fN,30:pN,40:gN,50:mN,60:vN,70:yN,80:bN,90:xN,100:wN},EN="#fff0f7",SN="#ffd6e8",ON="#ffafd2",TN="#ff7eb6",MN="#ee5396",CN="#d02670",$N="#9f1853",AN="#740937",LN="#510224",kN="#2a0a18",DN={10:EN,20:SN,30:ON,40:TN,50:MN,60:CN,70:$N,80:AN,90:LN,100:kN},RN="#f6f2ff",IN="#e8daff",NN="#d4bbff",PN="#be95ff",UN="#a56eff",BN="#8a3ffc",VN="#6929c4",HN="#491d8b",FN="#31135e",GN="#1c0f30",zN={10:RN,20:IN,30:NN,40:PN,50:UN,60:BN,70:VN,80:HN,90:FN,100:GN},jN="#edf5ff",WN="#d0e2ff",qN="#a6c8ff",YN="#78a9ff",XN="#4589ff",ZN="#0f62fe",KN="#0043ce",QN="#002d9c",JN="#001d6c",tP="#001141",eP={10:jN,20:WN,30:qN,40:YN,50:XN,60:ZN,70:KN,80:QN,90:JN,100:tP},nP="#e5f6ff",rP="#bae6ff",iP="#82cfff",sP="#33b1ff",aP="#1192e8",oP="#0072c3",lP="#00539a",cP="#003a6d",uP="#012749",hP="#061727",dP={10:nP,20:rP,30:iP,40:sP,50:aP,60:oP,70:lP,80:cP,90:uP,100:hP},fP="#d9fbfb",pP="#9ef0f0",gP="#3ddbd9",mP="#08bdba",vP="#009d9a",yP="#007d79",bP="#005d5d",xP="#004144",wP="#022b30",_P="#081a1c",EP={10:fP,20:pP,30:gP,40:mP,50:vP,60:yP,70:bP,80:xP,90:wP,100:_P},SP="#defbe6",OP="#a7f0ba",TP="#6fdc8c",MP="#42be65",CP="#24a148",$P="#198038",AP="#0e6027",LP="#044317",kP="#022d0d",DP="#071908",RP={10:SP,20:OP,30:TP,40:MP,50:CP,60:$P,70:AP,80:LP,90:kP,100:DP},IP="#f2f4f8",NP="#dde1e6",PP="#c1c7cd",UP="#a2a9b0",BP="#878d96",VP="#697077",HP="#4d5358",FP="#343a3f",GP="#21272a",zP="#121619",jP={10:IP,20:NP,30:PP,40:UP,50:BP,60:VP,70:HP,80:FP,90:GP,100:zP},WP="#f4f4f4",qP="#e0e0e0",YP="#c6c6c6",XP="#a8a8a8",ZP="#8d8d8d",KP="#6f6f6f",QP="#525252",JP="#393939",tU="#262626",eU="#161616",nU={10:WP,20:qP,30:YP,40:XP,50:ZP,60:KP,70:QP,80:JP,90:tU,100:eU},rU="#f7f3f2",iU="#e5e0df",sU="#cac5c4",aU="#ada8a8",oU="#8f8b8b",lU="#726e6e",cU="#565151",uU="#3c3838",hU="#272525",dU="#171414",fU={10:rU,20:iU,30:sU,40:aU,50:oU,60:lU,70:cU,80:uU,90:hU,100:dU},nv={black:{100:FI},blue:eP,coolGray:jP,cyan:dP,gray:nU,green:RP,magenta:DN,orange:hN,purple:zN,red:_N,teal:EP,warmGray:fU,white:{0:GI},yellow:tN};const pU=e=>{if(!e)return null;for(const t of Object.keys(nv)){const n=nv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},rv=function(){const e=R(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=an(t);let r;if(n&&(r=pU(n?n.hex():null)),r==null){const i=Mo(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let gU=0;class mU extends ft{constructor(){super(...arguments),this.type="treemap",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Oi({name:i.title||"Treemap",children:r}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=Jw().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 h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>gU++).merge(u);h.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 d=h.selectAll("rect.leaf").data(f=>[f]);d.exit().attr("width",0).attr("height",0).remove(),d.enter().append("rect").classed("leaf",!0).merge(d).attr("width",0).attr("height",0).attr("id",function(){const f=R(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:[tt.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)}),h.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const p=R(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=R(this.parentNode.parentNode).attr("data-uid"),m=`${i.style.prefix}-leaf-${p}`;return new URL(`#${m}`,s)+""}),f=>null,f=>f.remove()),h.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let p=f;for(;p.depth>1;)p=p.parent;const m=Mo(this.model.getFillColor(p.data.name));return[{text:f.data.name,color:m.l<.5?"white":"black"}]},f=>f).join(f=>{const p=f.append("text").text(m=>m.text).style("fill",rv).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const m=R(this.parentNode).attr("data-uid"),g=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${g}`,s)+""})`}),p},f=>f.text(p=>p.text).style("fill",rv),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=R(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),an(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=R(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:R(this),datum:r})}).on("mouseout",function(n,r){const i=R(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 vU extends ft{constructor(){super(...arguments),this.type="wordcloud",this.renderType=Q.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:h}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||h===0)return;const d=jk().size([u,h]).words(i.map(function(p){const m=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:m,value:m}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);d.start();function f(p){const m=k.appendOrSelect(r,"g.words");m.attr("transform",`translate(${d.size()[0]/2}, ${d.size()[1]/2})`);const g=m.selectAll("text").data(p,v=>`${v[c]}-${v.text}`);g.exit().attr("opacity",0).remove(),g.enter().append("text").attr("opacity",0).merge(g).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.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?Re(i):[1,1];return Be().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Fa(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:R(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:[tt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=R(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:R(this),datum:a})}).on("mouseout",function(s,a){const o=R(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 yU extends ft{constructor(){super(...arguments),this.type="geo",this.renderType=Q.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=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(g=>{typeof a[g].value=="number"?o[g]=a[g]:l[g]=a[g]});const c=xI(s,Object.values(l)),u=vI(s,{type:"GeometryCollection",geometries:Object.values(o)}),h=i.fitSize([n,r],u),d=Dx().projection(h);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",d);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",Ii()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",d).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case sn.geoEqualEarth:t=Qx();break;case sn.geoAlbers:t=jx();break;case sn.geoConicEqualArea:t=Pd();break;case sn.geoConicEquidistant:t=Zx();break;case sn.geoEquirectangular:t=Yx();break;case sn.geoMercator:t=Wx();break;case sn.geoNaturalEarth1:t=Jx();break;default:throw new Error("Projection is not supported.")}return t}}class bU extends yU{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=R(this);t.services.events.dispatchEvent(dr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Jr.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(dr.CHOROPLETH_MOUSEMOVE,{event:r,element:R(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Jr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(dr.CHOROPLETH_CLICK,{event:r,element:R(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=R(this);t.services.events.dispatchEvent(dr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Jr.HIDE,{event:r,hoveredElement:s})})}}function iv(e,t){ot(2,arguments);var n=yt(e),r=Kt(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function Jc(e,t){ot(2,arguments);var n=yt(e),r=Kt(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),s=new Date(n.getTime());s.setMonth(n.getMonth()+r+1,0);var a=s.getDate();return i>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}var xU=36e5;function sv(e,t){ot(2,arguments);var n=Kt(t);return wa(e,n*xU)}function av(e){ot(1,arguments);var t=yt(e);return t.setHours(0,0,0,0),t}var wU=864e5;function _U(e,t){ot(2,arguments);var n=av(e),r=av(t),i=n.getTime()-Wl(n),s=r.getTime()-Wl(r);return Math.round((i-s)/wU)}var EU=6e4;function tu(e,t){ot(2,arguments);var n=Kt(t);return wa(e,n*EU)}function eu(e,t){ot(2,arguments);var n=Kt(t);return wa(e,n*1e3)}function ov(e,t){ot(2,arguments);var n=Kt(t);return Jc(e,n*12)}function is(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}var SU=6e4,OU=36e5;function TU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function MU(e,t){ot(2,arguments);var n=yt(e),r=yt(t);return n.getFullYear()-r.getFullYear()}function lv(e,t){var 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 CU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=lv(n,r),s=Math.abs(_U(n,r));n.setDate(n.getDate()-i*s);var a=+(lv(n,r)===-i),o=i*(s-a);return o===0?0:o}function nu(e,t){return ot(2,arguments),yt(e).getTime()-yt(t).getTime()}var cv={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},$U="trunc";function ru(e){return e?cv[e]:cv[$U]}function AU(e,t,n){ot(2,arguments);var r=nu(e,t)/OU;return ru(n==null?void 0:n.roundingMethod)(r)}function uv(e,t,n){ot(2,arguments);var r=nu(e,t)/SU;return ru(n==null?void 0:n.roundingMethod)(r)}function LU(e){ot(1,arguments);var t=yt(e);return t.setHours(23,59,59,999),t}function kU(e){ot(1,arguments);var t=yt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function DU(e){ot(1,arguments);var t=yt(e);return LU(t).getTime()===kU(t).getTime()}function RU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=is(n,r),s=Math.abs(TU(n,r)),a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);var o=is(n,r)===-i;DU(yt(e))&&s===1&&is(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function hv(e,t,n){ot(2,arguments);var r=nu(e,t)/1e3;return ru(n==null?void 0:n.roundingMethod)(r)}function IU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=is(n,r),s=Math.abs(MU(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=is(n,r)===-i,o=i*(s-Number(a));return o===0?0:o}function NU(e,t){ot(2,arguments);var n=Kt(t);return iv(e,-n)}function PU(e,t){ot(2,arguments);var n=Kt(t);return Jc(e,-n)}function UU(e,t){ot(2,arguments);var n=Kt(t);return sv(e,-n)}function dv(e,t){ot(2,arguments);var n=Kt(t);return tu(e,-n)}function fv(e,t){ot(2,arguments);var n=Kt(t);return eu(e,-n)}function BU(e,t){ot(2,arguments);var n=Kt(t);return ov(e,-n)}function pv(e){var t=e==null?0:e.length;return t?Da(e,1):[]}class VU extends En{zoomIn(t,n,r){let i,s,a;const o=r||Hr;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:R(t)})}zoomOut(t,n){const r=n||Hr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}}class HU extends En{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 FU extends En{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 GU extends En{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(O.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(x(fg,n,"duration")||fg.default.duration)}getPendingTransitions(){return this.pendingTransitions}}let zU=class extends En{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=x(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=x(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return x(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===H.BOTTOM||t===H.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(H).map(t=>H[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===H.LEFT||this.rangeAxisPosition===H.RIGHT)&&(this.domainAxisPosition===H.BOTTOM||this.domainAxisPosition===H.TOP)?this.orientation=Qt.VERTICAL:this.orientation=Qt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=x(s,"axes");((t=a[H.LEFT])!=null&&t.correspondingDatasets&&a[H.RIGHT]||(n=a[H.RIGHT])!=null&&n.correspondingDatasets&&a[H.LEFT]||(r=a[H.TOP])!=null&&r.correspondingDatasets&&a[H.BOTTOM]||(i=a[H.BOTTOM])!=null&&i.correspondingDatasets&&a[H.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=x(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===Z.LINEAR||this.scaleTypes[t]===Z.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=[H.BOTTOM,H.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[H.LEFT,H.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=x(i,o)!==null?i[o]:i;let c;switch(n){case Z.LABELS:c=t(l)+t.step()/2;break;case Z.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(x(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=x(r,"axes",t);if(i.scaleType===Z.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return jU(n,s)}else return WU(n,kn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,H.LEFT)===null&&x(n,H.RIGHT)!==null||x(n,H.RIGHT,"main")===!0||r&&x(n,H.LEFT,"correspondingDatasets")?{primary:H.RIGHT,secondary:H.LEFT}:{primary:H.LEFT,secondary:H.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,H.BOTTOM)===null&&x(n,H.TOP)!==null||x(n,H.TOP,"main")===!0||r&&x(n,H.BOTTOM,"correspondingDatasets")?{primary:H.TOP,secondary:H.BOTTOM}:{primary:H.BOTTOM,secondary:H.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||Z.LINEAR,o=s.scaleType||Z.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===Z.LABELS||o===Z.TIME)&&a===Z.LABELS||a===Z.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=x(n,"axes",t),i=x(n,"bounds"),{includeZero:s}=r,a=x(r,"scaleType")||Z.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Hn(v,y=>y.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),y=this.model.getStackKeys({bins:v});return[y[0].split("-")[0],y[y.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:h}=r,{reference:d,compareTo:f}=kn.ratio;if(r.domain)return a===Z.LABELS?r.domain:(a===Z.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===Z.LABELS)return Xi(o.map(v=>v[c]));let p,m;const g=this.model.getDataGroupNames();if(a===Z.LABELS_RATIO)return o.map(v=>`${v[d]}/${v[f]}`);if(a===Z.TIME)m=o.map(v=>+new Date(v[c]));else if(i&&n.axes)m=[],o.forEach(v=>{m.push(v[c]),v[i.upperBoundMapsTo]&&m.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&m.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&g&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,y=this.model.getDataValuesGroupedByKeys({groups:g}),b=o.filter(_=>!g.includes(_[v])),S=[];y.forEach(_=>{const{...E}=_;let T=0,D=0;Object.values(E).forEach(N=>{isNaN(N)||(N<0?D+=N:T+=N)}),S.push([D,T])}),m=[...pv(S),...b.map(_=>_[c])]}else m=[],o.forEach(v=>{const y=v[c];Array.isArray(y)&&y.length===2?(m.push(y[0]),m.push(y[1])):(l&&m.push(Math.max(v[c],v[l])),m.push(y))});return a!==Z.TIME&&a!==Z.LOG&&s&&m.push(0),h&&h.length>0&&h.forEach(v=>{const y=x(v,"value");y!==null&&m.push(y)}),p=Re(m),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=x(n,"axes",t);if(!r)return null;const i=x(r,"scaleType")||Z.LINEAR;this.scaleTypes[t]=i;let s;return i===Z.TIME?s=Sf():i===Z.LOG?s=sf().base(r.base||10):i===Z.LABELS||i===Z.LABELS_RATIO?s=Ci():s=Be(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===Z.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}};function jU(e,t){const n=new Date(e[0]),r=new Date(e[1]);return IU(r,n)>1?[BU(n,t),ov(r,t)]:RU(r,n)>1?[PU(n,t),Jc(r,t)]:CU(r,n)>1?[NU(n,t),iv(r,t)]:AU(r,n)>1?[UU(n,t),sv(r,t)]:uv(r,n)>30?[dv(n,t*30),tu(r,t*30)]:uv(r,n)>1?[dv(n,t),tu(r,t)]:hv(r,n)>15?[fv(n,t*15),eu(r,t*15)]:hv(r,n)>1?[fv(n,t),eu(r,t)]:[n,r]}function WU([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===Z.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}let qU=class extends En{constructor(){super(...arguments),this.curveTypes={curveLinear:pa,curveLinearClosed:Pf,curveBasis:qE,curveBasisClosed:YE,curveBasisOpen:XE,curveBundle:ZE,curveCardinal:KE,curveCardinalClosed:QE,curveCardinalOpen:JE,curveCatmullRom:tS,curveCatmullRomClosed:eS,curveCatmullRomOpen:nS,curveMonotoneX:rS,curveMonotoneY:iS,curveNatural:sS,curveStep:aS,curveStepAfter:lS,curveStepBefore:oS}}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}},YU=class extends En{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===H.BOTTOM&&n===Z.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=x(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Re(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=x(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=_e.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let h=a+u,d=o-u;h>=d&&(h=a+c/2-i/2,d=o-c/2+i/2);const f=[s.invert(h),s.invert(d)];(r[0].valueOf()!==f[0].valueOf()||r[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=x(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return x(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return x(this.model.getOptions(),"zoomBar",t,"locked")}};function XU(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 ZU(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:XU(e,t,n)}var KU="\\ud800-\\udfff",QU="\\u0300-\\u036f",JU="\\ufe20-\\ufe2f",tB="\\u20d0-\\u20ff",eB=QU+JU+tB,nB="\\ufe0e\\ufe0f",rB="\\u200d",iB=RegExp("["+rB+KU+eB+nB+"]");function gv(e){return iB.test(e)}function sB(e){return e.split("")}var mv="\\ud800-\\udfff",aB="\\u0300-\\u036f",oB="\\ufe20-\\ufe2f",lB="\\u20d0-\\u20ff",cB=aB+oB+lB,uB="\\ufe0e\\ufe0f",hB="["+mv+"]",iu="["+cB+"]",su="\\ud83c[\\udffb-\\udfff]",dB="(?:"+iu+"|"+su+")",vv="[^"+mv+"]",yv="(?:\\ud83c[\\udde6-\\uddff]){2}",bv="[\\ud800-\\udbff][\\udc00-\\udfff]",fB="\\u200d",xv=dB+"?",wv="["+uB+"]?",pB="(?:"+fB+"(?:"+[vv,yv,bv].join("|")+")"+wv+xv+")*",gB=wv+xv+pB,mB="(?:"+[vv+iu+"?",iu,yv,bv,hB].join("|")+")",vB=RegExp(su+"(?="+su+")|"+mB+gB,"g");function yB(e){return e.match(vB)||[]}function bB(e){return gv(e)?yB(e):sB(e)}function xB(e){return function(t){t=qi(t);var n=gv(t)?bB(t):void 0,r=n?n[0]:t.charAt(0),i=n?ZU(n,1).join(""):t.slice(1);return r[e]()+i}}var wB=xB("toUpperCase");const _B=wB;function EB(e){return _B(qi(e).toLowerCase())}var SB=_m(function(e,t,n){return t=t.toLowerCase(),e+(n?EB(t):t)});const OB=SB;class ze{constructor(t,n){this.components=[],this.services={canvasZoom:VU,domUtils:k,events:HU,files:FU,gradientUtils:Tc,transitions:GU},this.model=new Qe(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(O.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(O.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(O.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s={id:"legend",components:[new Xc(this.model,this.services)],growth:at.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new rI(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},c={id:"toolbar",components:[new Ka(this.model,this.services)],growth:at.PREFERRED},u={id:"header",components:[new Se(this.model,this.services,[l,...i?[c]:[]],{direction:$t.ROW,alignItems:fr.CENTER})],growth:at.PREFERRED},h={id:"graph-frame",components:t,growth:at.STRETCH,renderType:x(n,"graphFrameRenderType")||Q.SVG},d=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=$t.COLUMN;if(d){const v=x(r,"legend","position");v==="left"?(f=$t.ROW,r.legend.orientation||(r.legend.orientation=ei.VERTICAL)):v==="right"?(f=$t.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=ei.VERTICAL)):v==="bottom"&&(f=$t.COLUMN_REVERSE)}const p={id:"spacer",components:[new Sn(this.model,this.services)],growth:at.PREFERRED},m={id:"full-frame",components:[new Se(this.model,this.services,[...d?[s]:[],...d?[p]:[],h],{direction:f})],growth:at.STRETCH},g=[];if(o||i){g.push(u);const v={id:"spacer",components:[new Sn(this.model,this.services,i?{size:15}:void 0)],growth:at.PREFERRED};g.push(v)}return g.push(m),[new Zc(this.model,this.services),new io(this.model,this.services),new Se(this.model,this.services,g,{direction:$t.COLUMN})]}}class ye extends ze{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:zU,curves:qU,zoom:YU}),this.model=new cr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",H.TOP,"enabled"),s=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=x(r,"axes",a,"scaleType"),l=i&&a===H.BOTTOM&&o===Z.TIME,c=this.services.zoom.isZoomBarLocked(H.TOP),u=!!this.model.getOptions().title,h={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},d={id:"toolbar",components:[new Ka(this.model,this.services)],growth:at.PREFERRED},f={id:"header",components:[new Se(this.model,this.services,[h,...s?[d]:[]],{direction:$t.ROW,alignItems:fr.CENTER})],growth:at.PREFERRED},p={id:"legend",components:[new Xc(this.model,this.services)],growth:at.PREFERRED};l&&!c&&t.push(new Um(this.model,this.services),new iI(this.model,this.services)),t.push(new aI(this.model,this.services)),t.push(new oI(this.model,this.services));const m={id:"graph-frame",components:t,growth:at.STRETCH,renderType:Q.SVG},g=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=$t.COLUMN;if(g){const E=x(this.model.getOptions(),"legend","position");E===ti.LEFT?(v=$t.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=ei.VERTICAL)):E===ti.RIGHT?(v=$t.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=ei.VERTICAL)):E===ti.BOTTOM&&(v=$t.COLUMN_REVERSE)}const y={id:"spacer",components:[new Sn(this.model,this.services)],growth:at.PREFERRED},b={id:"full-frame",components:[new Se(this.model,this.services,[...g?[p]:[],...g?[y]:[],m],{direction:v})],growth:at.STRETCH},S={id:"zoom-bar",components:[new sI(this.model,this.services)],growth:at.PREFERRED,renderType:Q.SVG},_=[];if(u||s){_.push(f);const E={id:"spacer",components:[new Sn(this.model,this.services,s?{size:15}:void 0)],growth:at.PREFERRED};_.push(E)}return l&&_.push(S),_.push(b),[new Fm(this.model,this.services),new io(this.model,this.services),new Se(this.model,this.services,_,{direction:$t.COLUMN})]}}class TB extends ze{constructor(t,n){super(t,n),this.model=new HA(this.services),this.model.setOptions(Nt(Tt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new lI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class MB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(vn(Tt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new Yr(this.model,this.services),new Gm(this.model,this.services),new Je(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class CB extends ye{constructor(t,n){super(t,n),this.model=new FA(this.services),this.model.setOptions(Nt(Tt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new hI(this.model,this.services),new Xr(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class $B extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new dI(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class AB extends ye{constructor(t,n){super(t,n),this.model=new GA(this.services),this.model.setOptions(Nt(Tt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new fI(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class LB extends ze{constructor(t,n){super(t,n),this.model=new zA(this.services),this.model.setOptions(Nt(Tt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},o={id:"toolbar",components:[new Ka(this.model,this.services)],growth:at.PREFERRED},l={id:"header",components:[new Se(this.model,this.services,[a,...i?[o]:[]],{direction:$t.ROW,alignItems:fr.CENTER})],growth:at.PREFERRED},c={id:"legend",components:[new qm(this.model,this.services,{chartType:"choropleth"})],growth:at.PREFERRED,renderType:Q.SVG},u={id:"graph-frame",components:t,growth:at.STRETCH,renderType:Q.SVG},h=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=$t.COLUMN_REVERSE,f={id:"spacer",components:[new Sn(this.model,this.services,{size:15})],growth:at.PREFERRED},p={id:"full-frame",components:[new Se(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:at.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new Sn(this.model,this.services,i?{size:15}:void 0)],growth:at.PREFERRED};m.push(g)}return m.push(p),[new Zc(this.model,this.services),new io(this.model,this.services),new Se(this.model,this.services,m,{direction:$t.COLUMN})]}getComponents(){const t=[new bU(this.model,this.services)];return this.getChartComponents(t)}}class kB extends ze{constructor(t,n){super(t,n),this.model=new jA(this.services),this.model.setOptions(Nt(Tt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new LI(this.model,this.services)];return this.getChartComponents(t)}}const _v={[Te.LINE]:[Yr,Je],[Te.SCATTER]:[Je],[Te.AREA]:[Gm,Yr,Je],[Te.STACKED_AREA]:[Jm,Yr,ev,ao],[Te.SIMPLE_BAR]:[Qm],[Te.GROUPED_BAR]:[Km,Xr],[Te.STACKED_BAR]:[tv,ao]};class DB extends ye{constructor(t,n){super(t,n);const r=Nt(Tt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Te.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(_v).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=`${OB(i.type)}Chart`;return a=rt({},Tt[l],this.model.getOptions(),i.options),i.type===Te.STACKED_AREA&&(o=!0),_v[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=rt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return pv(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Te.STACKED_BAR||i.type===Te.STACKED_AREA),r=[new ve(this.model,this.services),new Oe(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID}),...n?[]:[new Nn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Ev extends ze{constructor(t,n,r=!1){super(t,n),this.model=new WA(this.services),!r&&(this.model.setOptions(Nt(Tt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Ym(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.PIE})];return this.getChartComponents(t)}}class RB extends Ev{constructor(t,n){super(t,n,!0),this.model.setOptions(Nt(Tt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new DI(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.DONUT})];return this.getChartComponents(t)}}class IB extends ze{constructor(t,n){super(t,n),this.model=new qA(this.services),this.model.setOptions(Nt(Tt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new RI(this.model,this.services)];return this.getChartComponents(t)}}class NB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Km(this.model,this.services),new Xr(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class PB extends ye{constructor(t,n){super(t,n),this.model=new YA(this.services),this.model.setOptions(Nt(Tt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},o={id:"toolbar",components:[new Ka(this.model,this.services)],growth:at.PREFERRED},l={id:"header",components:[new Se(this.model,this.services,[a,...i?[o]:[]],{direction:$t.ROW,alignItems:fr.CENTER})],growth:at.PREFERRED},c={id:"legend",components:[new qm(this.model,this.services,{chartType:"heatmap"})],growth:at.PREFERRED,renderType:Q.SVG},u={id:"graph-frame",components:t,growth:at.STRETCH,renderType:Q.SVG},h=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=$t.COLUMN_REVERSE,f={id:"spacer",components:[new Sn(this.model,this.services,{size:15})],growth:at.PREFERRED},p={id:"full-frame",components:[new Se(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:at.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new Sn(this.model,this.services,i?{size:15}:void 0)],growth:at.PREFERRED};m.push(g)}return m.push(p),[new Fm(this.model,this.services),new io(this.model,this.services),new Se(this.model,this.services,m,{direction:$t.COLUMN})]}getComponents(){const t=[new ve(this.model,this.services),new II(this.model,this.services)];return this.getAxisChartComponents(t)}}class UB extends ye{constructor(t,n){super(t,n),this.model=new XA(this.services),this.model.setOptions(Nt(Tt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new _I(this.model,this.services),new NI(this.model,this.services)];return this.getAxisChartComponents(t)}}class BB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new Yr(this.model,this.services),new Je(this.model,this.services,{handleThresholds:!0}),new VI(this.model,this.services),new Xr(this.model,this.services)];return this.getAxisChartComponents(t)}}class VB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new PI(this.model,this.services),new Je(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class HB extends ze{constructor(t,n){var r;super(t,n),this.model=new ZA(this.services);const i=(r=n.options.meter)!=null&&r.proportional?rt(vn(Tt.proportionalMeterChart),n.options):rt(vn(Tt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new AI(this.model,this.services)],growth:at.STRETCH,renderType:Q.SVG},{id:"spacer",components:[new Sn(this.model,this.services,{size:8})],growth:at.STRETCH}]:[],{id:"meter-graph",components:[new UI(this.model,this.services)],growth:at.STRETCH,renderType:Q.SVG}],n=[new Se(this.model,this.services,t,{direction:$t.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:Q.HTML})}}class FB extends ze{constructor(t,n){super(t,n),this.model=new KA(this.services),this.model.setOptions(Nt(Tt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new BI(this.model,this.services)];return this.getChartComponents(t)}}class GB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Nn(this.model,this.services),new Je(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class zB extends ze{constructor(t,n){super(t,n),this.model=new QA(this.services),this.model.setOptions(Nt(Tt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new HI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class jB extends ze{constructor(t,n){super(t,n),this.model=new JA(this.services),this.model.setOptions(Nt(Tt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new mU(this.model,this.services)];return this.getChartComponents(t)}}class WB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new Qm(this.model,this.services),new Xr(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class qB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new ao(this.model,this.services),new Jm(this.model,this.services),new Yr(this.model,this.services,{stacked:!0}),new ev(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new he(this.model,this.services,{skeleton:Yt.GRID})];return this.getAxisChartComponents(t)}}class YB extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Oe(this.model,this.services),new ao(this.model,this.services),new tv(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.VERT_OR_HORIZ}),new Xr(this.model,this.services)];return this.getAxisChartComponents(t)}}class XB extends ze{constructor(t,n){super(t,n),this.model=new tL(this.services),this.model.setOptions(Nt(Tt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new vU(this.model,this.services),new he(this.model,this.services,{skeleton:Yt.PIE})];return this.getChartComponents(t)}}var au={exports:{}},ss={};/**
|
|
84
84
|
* @license React
|
|
85
85
|
* react-jsx-runtime.production.min.js
|
|
86
86
|
*
|
|
@@ -96,7 +96,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
96
96
|
*
|
|
97
97
|
* This source code is licensed under the MIT license found in the
|
|
98
98
|
* LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/var Ov;function KB(){return Ov||(Ov=1,process.env.NODE_ENV!=="production"&&function(){var e=re,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"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function g($){if($===null||typeof $!="object")return null;var G=p&&$[p]||$[m];return typeof G=="function"?G:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y($){{for(var G=arguments.length,q=new Array(G>1?G-1:0),st=1;st<G;st++)q[st-1]=arguments[st];b("error",$,q)}}function b($,G,q){{var st=v.ReactDebugCurrentFrame,xt=st.getStackAddendum();xt!==""&&(G+="%s",q=q.concat([xt]));var Ct=q.map(function(mt){return String(mt)});Ct.unshift("Warning: "+G),Function.prototype.apply.call(console[$],console,Ct)}}var S=!1,_=!1,E=!1,T=!1,D=!1,N;N=Symbol.for("react.module.reference");function
|
|
99
|
+
*/var Ov;function KB(){return Ov||(Ov=1,process.env.NODE_ENV!=="production"&&function(){var e=re,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"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function g($){if($===null||typeof $!="object")return null;var G=p&&$[p]||$[m];return typeof G=="function"?G:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y($){{for(var G=arguments.length,q=new Array(G>1?G-1:0),st=1;st<G;st++)q[st-1]=arguments[st];b("error",$,q)}}function b($,G,q){{var st=v.ReactDebugCurrentFrame,xt=st.getStackAddendum();xt!==""&&(G+="%s",q=q.concat([xt]));var Ct=q.map(function(mt){return String(mt)});Ct.unshift("Warning: "+G),Function.prototype.apply.call(console[$],console,Ct)}}var S=!1,_=!1,E=!1,T=!1,D=!1,N;N=Symbol.for("react.module.reference");function L($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===s||D||$===i||$===c||$===u||T||$===f||S||_||E||typeof $=="object"&&$!==null&&($.$$typeof===d||$.$$typeof===h||$.$$typeof===a||$.$$typeof===o||$.$$typeof===l||$.$$typeof===N||$.getModuleId!==void 0))}function C($,G,q){var st=$.displayName;if(st)return st;var xt=G.displayName||G.name||"";return xt!==""?q+"("+xt+")":q}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 G=$;return V(G)+".Consumer";case a:var q=$;return V(q._context)+".Provider";case l:return C($,$.render,"ForwardRef");case h:var st=$.displayName||null;return st!==null?st:M($.type)||"Memo";case d:{var xt=$,Ct=xt._payload,mt=xt._init;try{return M(mt(Ct))}catch{return null}}}return null}var A=Object.assign,w=0,P,U,I,B,j,Y,et;function pt(){}pt.__reactDisabledLog=!0;function z(){{if(w===0){P=console.log,U=console.info,I=console.warn,B=console.error,j=console.group,Y=console.groupCollapsed,et=console.groupEnd;var $={configurable:!0,enumerable:!0,value:pt,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}w++}}function K(){{if(w--,w===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},$,{value:P}),info:A({},$,{value:U}),warn:A({},$,{value:I}),error:A({},$,{value:B}),group:A({},$,{value:j}),groupCollapsed:A({},$,{value:Y}),groupEnd:A({},$,{value:et})})}w<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ht=v.ReactCurrentDispatcher,it;function Mt($,G,q){{if(it===void 0)try{throw Error()}catch(xt){var st=xt.stack.trim().match(/\n( *(at )?)/);it=st&&st[1]||""}return`
|
|
100
100
|
`+it+$}}var W=!1,J;{var ct=typeof WeakMap=="function"?WeakMap:Map;J=new ct}function F($,G){if(!$||W)return"";{var q=J.get($);if(q!==void 0)return q}var st;W=!0;var xt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ct;Ct=ht.current,ht.current=null,z();try{if(G){var mt=function(){throw Error()};if(Object.defineProperty(mt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(mt,[])}catch(On){st=On}Reflect.construct($,[],mt)}else{try{mt.call()}catch(On){st=On}$.call(mt.prototype)}}else{try{throw Error()}catch(On){st=On}$()}}catch(On){if(On&&st&&typeof On.stack=="string"){for(var gt=On.stack.split(`
|
|
101
101
|
`),de=st.stack.split(`
|
|
102
102
|
`),Gt=gt.length-1,Wt=de.length-1;Gt>=1&&Wt>=0&>[Gt]!==de[Wt];)Wt--;for(;Gt>=1&&Wt>=0;Gt--,Wt--)if(gt[Gt]!==de[Wt]){if(Gt!==1||Wt!==1)do if(Gt--,Wt--,Wt<0||gt[Gt]!==de[Wt]){var ke=`
|
|
@@ -106,7 +106,7 @@ Check the render method of \``+$+"`."}return""}}function Y3($){{if($!==void 0){v
|
|
|
106
106
|
|
|
107
107
|
Check your code at `+G+":"+q+"."}return""}}var Dv={};function X3($){{var G=kv();if(!G){var q=typeof $=="string"?$:$.displayName||$.name;q&&(G=`
|
|
108
108
|
|
|
109
|
-
Check the top-level render call using <`+q+">.")}return G}}function Rv($,G){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var q=X3(G);if(Dv[q])return;Dv[q]=!0;var st="";$&&$._owner&&$._owner!==cu.current&&(st=" It was passed a child from "+M($._owner.type)+"."),Kr($),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',q,st),Kr(null)}}function Iv($,G){{if(typeof $!="object")return;if(ou($))for(var q=0;q<$.length;q++){var st=$[q];hu(st)&&Rv(st,G)}else if(hu($))$._store&&($._store.validated=!0);else if($){var xt=g($);if(typeof xt=="function"&&xt!==$.entries)for(var Ct=xt.call($),mt;!(mt=Ct.next()).done;)hu(mt.value)&&Rv(mt.value,G)}}}function Z3($){{var G=$.type;if(G==null||typeof G=="string")return;var q;if(typeof G=="function")q=G.propTypes;else if(typeof G=="object"&&(G.$$typeof===l||G.$$typeof===h))q=G.propTypes;else return;if(q){var st=M(G);en(q,$.props,"prop",st,$)}else if(G.PropTypes!==void 0&&!uu){uu=!0;var xt=M(G);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",xt||"Unknown")}typeof G.getDefaultProps=="function"&&!G.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function K3($){{for(var G=Object.keys($.props),q=0;q<G.length;q++){var st=G[q];if(st!=="children"&&st!=="key"){Kr($),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",st),Kr(null);break}}$.ref!==null&&(Kr($),y("Invalid attribute `ref` supplied to `React.Fragment`."),Kr(null))}}function Nv($,G,q,st,xt,Ct){{var mt=
|
|
109
|
+
Check the top-level render call using <`+q+">.")}return G}}function Rv($,G){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var q=X3(G);if(Dv[q])return;Dv[q]=!0;var st="";$&&$._owner&&$._owner!==cu.current&&(st=" It was passed a child from "+M($._owner.type)+"."),Kr($),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',q,st),Kr(null)}}function Iv($,G){{if(typeof $!="object")return;if(ou($))for(var q=0;q<$.length;q++){var st=$[q];hu(st)&&Rv(st,G)}else if(hu($))$._store&&($._store.validated=!0);else if($){var xt=g($);if(typeof xt=="function"&&xt!==$.entries)for(var Ct=xt.call($),mt;!(mt=Ct.next()).done;)hu(mt.value)&&Rv(mt.value,G)}}}function Z3($){{var G=$.type;if(G==null||typeof G=="string")return;var q;if(typeof G=="function")q=G.propTypes;else if(typeof G=="object"&&(G.$$typeof===l||G.$$typeof===h))q=G.propTypes;else return;if(q){var st=M(G);en(q,$.props,"prop",st,$)}else if(G.PropTypes!==void 0&&!uu){uu=!0;var xt=M(G);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",xt||"Unknown")}typeof G.getDefaultProps=="function"&&!G.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function K3($){{for(var G=Object.keys($.props),q=0;q<G.length;q++){var st=G[q];if(st!=="children"&&st!=="key"){Kr($),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",st),Kr(null);break}}$.ref!==null&&(Kr($),y("Invalid attribute `ref` supplied to `React.Fragment`."),Kr(null))}}function Nv($,G,q,st,xt,Ct){{var mt=L($);if(!mt){var gt="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(gt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var de=Y3(xt);de?gt+=de:gt+=kv();var Gt;$===null?Gt="null":ou($)?Gt="array":$!==void 0&&$.$$typeof===t?(Gt="<"+(M($.type)||"Unknown")+" />",gt=" Did you accidentally export a JSX literal instead of a component?"):Gt=typeof $,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Gt,gt)}var Wt=q3($,G,q,xt,Ct);if(Wt==null)return Wt;if(mt){var ke=G.children;if(ke!==void 0)if(st)if(ou(ke)){for(var Qr=0;Qr<ke.length;Qr++)Iv(ke[Qr],$);Object.freeze&&Object.freeze(ke)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Iv(ke,$)}return $===r?K3(Wt):Z3(Wt),Wt}}function Q3($,G,q){return Nv($,G,q,!0)}function J3($,G,q){return Nv($,G,q,!1)}var tV=J3,eV=Q3;as.Fragment=r,as.jsx=tV,as.jsxs=eV}()),as}process.env.NODE_ENV==="production"?au.exports=ZB():au.exports=KB();var Pt=au.exports;class Rt extends re.PureComponent{constructor(){super(...arguments);du(this,"chart");du(this,"chartRef",re.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 Pt.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class QB extends Rt{createChart(t,n,r){return new TB(t,{data:n,options:r})}}class JB extends Rt{createChart(t,n,r){return new MB(t,{data:n,options:r})}}class t3 extends Rt{createChart(t,n,r){return new CB(t,{data:n,options:r})}}class e3 extends Rt{createChart(t,n,r){return new $B(t,{data:n,options:r})}}class n3 extends Rt{createChart(t,n,r){return new AB(t,{data:n,options:r})}}class r3 extends Rt{createChart(t,n,r){return new LB(t,{data:n,options:r})}}class i3 extends Rt{createChart(t,n,r){return new kB(t,{data:n,options:r})}}class s3 extends Rt{createChart(t,n,r){return new DB(t,{data:n,options:r})}}class a3 extends Rt{createChart(t,n,r){return new RB(t,{data:n,options:r})}}class o3 extends Rt{createChart(t,n,r){return new IB(t,{data:n,options:r})}}class l3 extends Rt{createChart(t,n,r){return new NB(t,{data:n,options:r})}}class c3 extends Rt{createChart(t,n,r){return new PB(t,{data:n,options:r})}}class u3 extends Rt{createChart(t,n,r){return new UB(t,{data:n,options:r})}}class h3 extends Rt{createChart(t,n,r){return new BB(t,{data:n,options:r})}}class d3 extends Rt{createChart(t,n,r){return new VB(t,{data:n,options:r})}}class f3 extends Rt{createChart(t,n,r){return new HB(t,{data:n,options:r})}}class p3 extends Rt{createChart(t,n,r){return new Ev(t,{data:n,options:r})}}class g3 extends Rt{createChart(t,n,r){return new FB(t,{data:n,options:r})}}class m3 extends Rt{createChart(t,n,r){return new GB(t,{data:n,options:r})}}class v3 extends Rt{createChart(t,n,r){return new WB(t,{data:n,options:r})}}class y3 extends Rt{createChart(t,n,r){return new qB(t,{data:n,options:r})}}class b3 extends Rt{createChart(t,n,r){return new YB(t,{data:n,options:r})}}class x3 extends Rt{createChart(t,n,r){return new zB(t,{data:n,options:r})}}class w3 extends Rt{createChart(t,n,r){return new jB(t,{data:n,options:r})}}class _3 extends Rt{createChart(t,n,r){return new XB(t,{data:n,options:r})}}var Tv={exports:{}};/*!
|
|
110
110
|
Copyright (c) 2018 Jed Watson.
|
|
111
111
|
Licensed under the MIT License (MIT), see
|
|
112
112
|
http://jedwatson.github.io/classnames
|