@carbon/charts 1.27.10 → 1.27.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/{choropleth-TkZkP8Rn.mjs → choropleth-Bn8eKXA6.mjs} +2654 -2612
- package/dist/choropleth-Bn8eKXA6.mjs.map +1 -0
- package/dist/components/index.mjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/umd/bundle.umd.cjs +19 -19
- package/dist/umd/bundle.umd.cjs.map +1 -1
- package/dist/umd/bundle.umd.js +19 -19
- package/package.json +3 -3
- package/dist/choropleth-TkZkP8Rn.mjs.map +0 -1
package/dist/umd/bundle.umd.cjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
(function(q,Fe){typeof exports=="object"&&typeof module<"u"?Fe(exports):typeof define=="function"&&define.amd?define(["exports"],Fe):(q=typeof globalThis<"u"?globalThis:q||self,Fe(q.Charts={}))})(this,function(q){"use strict";function Fe(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Zv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function _o(e){let t,n,i;e.length!==2?(t=Fe,n=(o,l)=>Fe(e(o),l),i=(o,l)=>e(o)-l):(t=e===Fe||e===Zv?e:jv,n=e,i=e);function r(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=r(o,l,c,u-1);return d>c&&i(o[d-1],l)>-i(o[d],l)?d-1:d}return{left:r,center:a,right:s}}function jv(){return 0}function Kv(e){return e===null?NaN:+e}function*Qv(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const To=_o(Fe).right;_o(Kv).center;function Jv(e,t){let n=0;for(let i of e)i!=null&&(i=+i)>=i&&++n;return n}function Ue(e,t){let n,i;if(t===void 0)for(const r of e)r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i<r&&(i=r)));else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(n===void 0?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}class zn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const s=n[r],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[i++]=o),t=a}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,s,a=0;if(n>0){for(a=t[--n];n>0&&(i=a,r=t[--n],a=i+r,s=r-(a-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=a+r,r==i-a&&(a=i))}return a}}class Bu extends Map{constructor(t,n=n0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(Hu(this,t))}has(t){return super.has(Hu(this,t))}set(t,n){return super.set(t0(this,t),n)}delete(t){return super.delete(e0(this,t))}}function Hu({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function t0({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function e0({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function n0(e){return e!==null&&typeof e=="object"?e.valueOf():e}function i0(e){return e}function r0(e=Fe){if(e===Fe)return Gu;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function Gu(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var s0=Array.prototype,a0=s0.slice;function Oo(e){return()=>e}const o0=Math.sqrt(50),l0=Math.sqrt(10),c0=Math.sqrt(2);function As(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),a=s>=o0?10:s>=l0?5:s>=c0?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/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,r)*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?As(e,t,n*2):[o,l,c]}function Ds(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const i=t<e,[r,s,a]=i?As(t,e,n):As(e,t,n);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(i)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]=(r+c)/-a;else for(let c=0;c<o;++c)l[c]=(r+c)*a;return l}function yi(e,t,n){return t=+t,e=+e,n=+n,As(e,t,n)[2]}function wo(e,t,n){t=+t,e=+e,n=+n;const i=t<e,r=i?yi(t,e,n):yi(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function u0(e,t,n){let i;for(;;){const r=yi(e,t,n);if(r===i||r===0||!isFinite(r))return[e,t];r>0?(e=Math.floor(e/r)*r,t=Math.ceil(t/r)*r):r<0&&(e=Math.ceil(e*r)/r,t=Math.floor(t*r)/r),i=r}}function h0(e){return Math.max(1,Math.ceil(Math.log(Jv(e))/Math.LN2)+1)}function d0(){var e=i0,t=Ue,n=h0;function i(r){Array.isArray(r)||(r=Array.from(r));var s,a=r.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(r[s],s,r);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const E=h,b=+f;if(t===Ue&&([d,h]=u0(d,h,b)),f=Ds(d,h,b),f[0]<=d&&(l=yi(d,h,b)),f[f.length-1]>=h)if(E>=h&&t===Ue){const x=yi(d,h,b);isFinite(x)&&(x>0?h=(Math.floor(h/x)+1)*x:x<0&&(h=(Math.ceil(h*-x)+1)/-x))}else f.pop()}for(var p=f.length,g=0,m=p;f[g]<=d;)++g;for(;f[m-1]>h;)--m;(g||m<p)&&(f=f.slice(g,m),p=m-g);var v=new Array(p+1),S;for(s=0;s<=p;++s)S=v[s]=[],S.x0=s>0?f[s-1]:d,S.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(p,Math.floor((o-d)/l))].push(r[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const E=Math.floor((d-o)*l);v[Math.min(p,E+(f[E]<=o))].push(r[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[To(f,o,0,p)].push(r[s]);return v}return i.value=function(r){return arguments.length?(e=typeof r=="function"?r:Oo(r),i):e},i.domain=function(r){return arguments.length?(t=typeof r=="function"?r:Oo([r[0],r[1]]),i):t},i.thresholds=function(r){return arguments.length?(n=typeof r=="function"?r:Oo(Array.isArray(r)?a0.call(r):r),i):n},i}function Wn(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function Nn(e,t){let n;for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);return n}function Vu(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?Gu:r0(r);i>n;){if(i-n>600){const l=i-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(i,Math.floor(t+(l-c)*d/l+h));Vu(e,t,f,p,r)}const s=e[t];let a=n,o=i;for(fr(e,n,t),r(e[i],s)>0&&fr(e,n,i);a<o;){for(fr(e,a,o),++a,--o;r(e[a],s)<0;)++a;for(;r(e[o],s)>0;)--o}r(e[n],s)===0?fr(e,n,o):(++o,fr(e,o,i)),o<=t&&(n=o+1),t<=o&&(i=o-1)}return e}function fr(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Mo(e,t,n){if(e=Float64Array.from(Qv(e)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return Nn(e);if(t>=1)return Wn(e);var i,r=(i-1)*t,s=Math.floor(r),a=Wn(Vu(e,s).subarray(0,s+1)),o=Nn(e.subarray(s+1));return a+(o-a)*(r-s)}}function*f0(e){for(const t of e)yield*t}function zu(e){return Array.from(f0(e))}function p0(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i<r;)s[i]=e+i*n;return s}function g0(e){return e}var Ls=1,Rs=2,Co=3,pr=4,Wu=1e-6;function m0(e){return"translate("+e+",0)"}function v0(e){return"translate(0,"+e+")"}function y0(e){return t=>+e(t)}function E0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function x0(){return!this.__axis}function Is(e,t){var n=[],i=null,r=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ls||e===pr?-1:1,u=e===pr||e===Rs?"x":"y",d=e===Ls||e===Co?m0:v0;function h(f){var p=i??(t.ticks?t.ticks.apply(t,n):t.domain()),g=r??(t.tickFormat?t.tickFormat.apply(t,n):g0),m=Math.max(s,0)+o,v=t.range(),S=+v[0]+l,E=+v[v.length-1]+l,b=(t.bandwidth?E0:y0)(t.copy(),l),x=f.selection?f.selection():f,_=x.selectAll(".domain").data([null]),C=x.selectAll(".tick").data(p,t).order(),D=C.exit(),$=C.enter().append("g").attr("class","tick"),P=C.select("line"),w=C.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge($),P=P.merge($.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),w=w.merge($.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ls?"0em":e===Co?"0.71em":"0.32em")),f!==x&&(_=_.transition(f),C=C.transition(f),P=P.transition(f),w=w.transition(f),D=D.transition(f).attr("opacity",Wu).attr("transform",function(H){return isFinite(H=b(H))?d(H+l):this.getAttribute("transform")}),$.attr("opacity",Wu).attr("transform",function(H){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(H))?N:b(H))+l)})),D.remove(),_.attr("d",e===pr||e===Rs?a?"M"+c*a+","+S+"H"+l+"V"+E+"H"+c*a:"M"+l+","+S+"V"+E:a?"M"+S+","+c*a+"V"+l+"H"+E+"V"+c*a:"M"+S+","+l+"H"+E),C.attr("opacity",1).attr("transform",function(H){return d(b(H)+l)}),P.attr(u+"2",c*s),w.attr(u,c*m).text(g),x.filter(x0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Rs?"start":e===pr?"end":"middle"),x.each(function(){this.__axis=b})}return h.scale=function(f){return arguments.length?(t=f,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),h):n.slice()},h.tickValues=function(f){return arguments.length?(i=f==null?null:Array.from(f),h):i&&i.slice()},h.tickFormat=function(f){return arguments.length?(r=f,h):r},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function b0(e){return Is(Ls,e)}function S0(e){return Is(Rs,e)}function Ao(e){return Is(Co,e)}function Yu(e){return Is(pr,e)}var _0={value:()=>{}};function Do(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new ks(n)}function ks(e){this._=e}function T0(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}ks.prototype=Do.prototype={constructor:ks,on:function(e,t){var n=this._,i=T0(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=O0(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=qu(n[r],e.name,t);else if(t==null)for(r in n)n[r]=qu(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ks(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function O0(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function qu(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=_0,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Lo="http://www.w3.org/1999/xhtml";const Xu={svg:"http://www.w3.org/2000/svg",xhtml:Lo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ps(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Xu.hasOwnProperty(t)?{space:Xu[t],local:e}:e}function w0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Lo&&t.documentElement.namespaceURI===Lo?t.createElement(e):t.createElementNS(n,e)}}function M0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Zu(e){var t=Ps(e);return(t.local?M0:w0)(t)}function C0(){}function Ro(e){return e==null?C0:function(){return this.querySelector(e)}}function A0(e){typeof e!="function"&&(e=Ro(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=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 Ee(i,this._parents)}function D0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function L0(){return[]}function ju(e){return e==null?L0:function(){return this.querySelectorAll(e)}}function R0(e){return function(){return D0(e.apply(this,arguments))}}function I0(e){typeof e=="function"?e=R0(e):e=ju(e);for(var t=this._groups,n=t.length,i=[],r=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),r.push(l));return new Ee(i,r)}function Ku(e){return function(){return this.matches(e)}}function Qu(e){return function(t){return t.matches(e)}}var k0=Array.prototype.find;function P0(e){return function(){return k0.call(this.children,e)}}function N0(){return this.firstElementChild}function $0(e){return this.select(e==null?N0:P0(typeof e=="function"?e:Qu(e)))}var F0=Array.prototype.filter;function U0(){return Array.from(this.children)}function B0(e){return function(){return F0.call(this.children,e)}}function H0(e){return this.selectAll(e==null?U0:B0(typeof e=="function"?e:Qu(e)))}function G0(e){typeof e!="function"&&(e=Ku(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Ee(i,this._parents)}function Ju(e){return new Array(e.length)}function V0(){return new Ee(this._enter||this._groups.map(Ju),this._parents)}function Ns(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ns.prototype={constructor:Ns,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 z0(e){return function(){return e}}function W0(e,t,n,i,r,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],i[a]=o):n[a]=new Ns(e,s[a]);for(;a<l;++a)(o=t[a])&&(r[a]=o)}function Y0(e,t,n,i,r,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?r[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(i[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new Ns(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(r[o]=l)}function q0(e){return e.__data__}function X0(e,t){if(!arguments.length)return Array.from(this,q0);var n=t?Y0:W0,i=this._parents,r=this._groups;typeof e!="function"&&(e=z0(e));for(var s=r.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=i[c],d=r[c],h=d.length,f=Z0(e.call(u,u&&u.__data__,c,i)),p=f.length,g=o[c]=new Array(p),m=a[c]=new Array(p),v=l[c]=new Array(h);n(u,d,g,m,v,f,t);for(var S=0,E=0,b,x;S<p;++S)if(b=g[S]){for(S>=E&&(E=S+1);!(x=m[E])&&++E<p;);b._next=x||null}}return a=new Ee(a,i),a._enter=o,a._exit=l,a}function Z0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function j0(){return new Ee(this._exit||this._groups.map(Ju),this._parents)}function K0(e,t,n){var i=this.enter(),r=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function Q0(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,r=n.length,s=i.length,a=Math.min(r,s),o=new Array(r),l=0;l<a;++l)for(var c=n[l],u=i[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<r;++l)o[l]=n[l];return new Ee(o,this._parents)}function J0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],r=i.length-1,s=i[r],a;--r>=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function ty(e){e||(e=ey);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var a=n[s],o=a.length,l=r[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new Ee(r,this._parents).order()}function ey(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ny(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iy(){return Array.from(this)}function ry(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length;r<s;++r){var a=i[r];if(a)return a}return null}function sy(){let e=0;for(const t of this)++e;return e}function ay(){return!this.node()}function oy(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r=t[n],s=0,a=r.length,o;s<a;++s)(o=r[s])&&e.call(o,o.__data__,s,r);return this}function ly(e){return function(){this.removeAttribute(e)}}function cy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function uy(e,t){return function(){this.setAttribute(e,t)}}function hy(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function dy(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function fy(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 py(e,t){var n=Ps(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?cy:ly:typeof t=="function"?n.local?fy:dy:n.local?hy:uy)(n,t))}function th(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function gy(e){return function(){this.style.removeProperty(e)}}function my(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vy(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function yy(e,t,n){return arguments.length>1?this.each((t==null?gy:typeof t=="function"?vy:my)(e,t,n??"")):Ei(this.node(),e)}function Ei(e,t){return e.style.getPropertyValue(t)||th(e).getComputedStyle(e,null).getPropertyValue(t)}function Ey(e){return function(){delete this[e]}}function xy(e,t){return function(){this[e]=t}}function by(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Sy(e,t){return arguments.length>1?this.each((t==null?Ey:typeof t=="function"?by:xy)(e,t)):this.node()[e]}function eh(e){return e.trim().split(/^|\s+/)}function Io(e){return e.classList||new nh(e)}function nh(e){this._node=e,this._names=eh(e.getAttribute("class")||"")}nh.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 ih(e,t){for(var n=Io(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function rh(e,t){for(var n=Io(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function _y(e){return function(){ih(this,e)}}function Ty(e){return function(){rh(this,e)}}function Oy(e,t){return function(){(t.apply(this,arguments)?ih:rh)(this,e)}}function wy(e,t){var n=eh(e+"");if(arguments.length<2){for(var i=Io(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Oy:t?_y:Ty)(n,t))}function My(){this.textContent=""}function Cy(e){return function(){this.textContent=e}}function Ay(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Dy(e){return arguments.length?this.each(e==null?My:(typeof e=="function"?Ay:Cy)(e)):this.node().textContent}function Ly(){this.innerHTML=""}function Ry(e){return function(){this.innerHTML=e}}function Iy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function ky(e){return arguments.length?this.each(e==null?Ly:(typeof e=="function"?Iy:Ry)(e)):this.node().innerHTML}function Py(){this.nextSibling&&this.parentNode.appendChild(this)}function Ny(){return this.each(Py)}function $y(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fy(){return this.each($y)}function Uy(e){var t=typeof e=="function"?e:Zu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function By(){return null}function Hy(e,t){var n=typeof e=="function"?e:Zu(e),i=t==null?By:typeof t=="function"?t:Ro(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Gy(){var e=this.parentNode;e&&e.removeChild(this)}function Vy(){return this.each(Gy)}function zy(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Wy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Yy(e){return this.select(e?Wy:zy)}function qy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Xy(e){return function(t){e.call(this,t,this.__data__)}}function Zy(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function jy(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n<r;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function Ky(e,t,n){return function(){var i=this.__on,r,s=Xy(t);if(i){for(var a=0,o=i.length;a<o;++a)if((r=i[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=t;return}}this.addEventListener(e.type,s,n),r={type:e.type,name:e.name,value:t,listener:s,options:n},i?i.push(r):this.__on=[r]}}function Qy(e,t,n){var i=Zy(e+""),r,s=i.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(r=0,u=o[l];r<s;++r)if((a=i[r]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?Ky:jy,r=0;r<s;++r)this.each(o(i[r],t,n));return this}function sh(e,t,n){var i=th(e),r=i.CustomEvent;typeof r=="function"?r=new r(t,n):(r=i.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Jy(e,t){return function(){return sh(this,e,t)}}function t1(e,t){return function(){return sh(this,e,t.apply(this,arguments))}}function e1(e,t){return this.each((typeof t=="function"?t1:Jy)(e,t))}function*n1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length,a;r<s;++r)(a=i[r])&&(yield a)}var ah=[null];function Ee(e,t){this._groups=e,this._parents=t}function gr(){return new Ee([[document.documentElement]],ah)}function i1(){return this}Ee.prototype=gr.prototype={constructor:Ee,select:A0,selectAll:I0,selectChild:$0,selectChildren:H0,filter:G0,data:X0,enter:V0,exit:j0,join:K0,merge:Q0,selection:i1,order:J0,sort:ty,call:ny,nodes:iy,node:ry,size:sy,empty:ay,each:oy,attr:py,style:yy,property:Sy,classed:wy,text:Dy,html:ky,raise:Ny,lower:Fy,append:Uy,insert:Hy,remove:Vy,clone:Yy,datum:qy,on:Qy,dispatch:e1,[Symbol.iterator]:n1};function I(e){return typeof e=="string"?new Ee([[document.querySelector(e)]],[document.documentElement]):new Ee([[e]],ah)}function r1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Yn(e,t){if(e=r1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const ko={capture:!0,passive:!1};function Po(e){e.preventDefault(),e.stopImmediatePropagation()}function s1(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",Po,ko);"onselectstart"in t?n.on("selectstart.drag",Po,ko):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function a1(e,t){var n=e.document.documentElement,i=I(e).on("dragstart.drag",null);t&&(i.on("click.drag",Po,ko),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function No(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function oh(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function mr(){}var vr=.7,$s=1/vr,xi="\\s*([+-]?\\d+)\\s*",yr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",o1=/^#([0-9a-f]{3,8})$/,l1=new RegExp(`^rgb\\(${xi},${xi},${xi}\\)$`),c1=new RegExp(`^rgb\\(${je},${je},${je}\\)$`),u1=new RegExp(`^rgba\\(${xi},${xi},${xi},${yr}\\)$`),h1=new RegExp(`^rgba\\(${je},${je},${je},${yr}\\)$`),d1=new RegExp(`^hsl\\(${yr},${je},${je}\\)$`),f1=new RegExp(`^hsla\\(${yr},${je},${je},${yr}\\)$`),lh={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};No(mr,dn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ch,formatHex:ch,formatHex8:p1,formatHsl:g1,formatRgb:uh,toString:uh});function ch(){return this.rgb().formatHex()}function p1(){return this.rgb().formatHex8()}function g1(){return gh(this).formatHsl()}function uh(){return this.rgb().formatRgb()}function dn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=o1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?hh(t):n===3?new de(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Fs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Fs(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=l1.exec(e))?new de(t[1],t[2],t[3],1):(t=c1.exec(e))?new de(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=u1.exec(e))?Fs(t[1],t[2],t[3],t[4]):(t=h1.exec(e))?Fs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=d1.exec(e))?ph(t[1],t[2]/100,t[3]/100,1):(t=f1.exec(e))?ph(t[1],t[2]/100,t[3]/100,t[4]):lh.hasOwnProperty(e)?hh(lh[e]):e==="transparent"?new de(NaN,NaN,NaN,0):null}function hh(e){return new de(e>>16&255,e>>8&255,e&255,1)}function Fs(e,t,n,i){return i<=0&&(e=t=n=NaN),new de(e,t,n,i)}function m1(e){return e instanceof mr||(e=dn(e)),e?(e=e.rgb(),new de(e.r,e.g,e.b,e.opacity)):new de}function $o(e,t,n,i){return arguments.length===1?m1(e):new de(e,t,n,i??1)}function de(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}No(de,$o,oh(mr,{brighter(e){return e=e==null?$s:Math.pow($s,e),new de(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vr:Math.pow(vr,e),new de(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new de(qn(this.r),qn(this.g),qn(this.b),Us(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:dh,formatHex:dh,formatHex8:v1,formatRgb:fh,toString:fh}));function dh(){return`#${Xn(this.r)}${Xn(this.g)}${Xn(this.b)}`}function v1(){return`#${Xn(this.r)}${Xn(this.g)}${Xn(this.b)}${Xn((isNaN(this.opacity)?1:this.opacity)*255)}`}function fh(){const e=Us(this.opacity);return`${e===1?"rgb(":"rgba("}${qn(this.r)}, ${qn(this.g)}, ${qn(this.b)}${e===1?")":`, ${e})`}`}function Us(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xn(e){return e=qn(e),(e<16?"0":"")+e.toString(16)}function ph(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Be(e,t,n,i)}function gh(e){if(e instanceof Be)return new Be(e.h,e.s,e.l,e.opacity);if(e instanceof mr||(e=dn(e)),!e)return new Be;if(e instanceof Be)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),a=NaN,o=s-r,l=(s+r)/2;return o?(t===s?a=(n-i)/o+(n<i)*6:n===s?a=(i-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new Be(a,o,l,e.opacity)}function mh(e,t,n,i){return arguments.length===1?gh(e):new Be(e,t,n,i??1)}function Be(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}No(Be,mh,oh(mr,{brighter(e){return e=e==null?$s:Math.pow($s,e),new Be(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vr:Math.pow(vr,e),new Be(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,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new de(Fo(e>=240?e-240:e+120,r,i),Fo(e,r,i),Fo(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Be(vh(this.h),Bs(this.s),Bs(this.l),Us(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=Us(this.opacity);return`${e===1?"hsl(":"hsla("}${vh(this.h)}, ${Bs(this.s)*100}%, ${Bs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vh(e){return e=(e||0)%360,e<0?e+360:e}function Bs(e){return Math.max(0,Math.min(1,e||0))}function Fo(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 Uo=e=>()=>e;function y1(e,t){return function(n){return e+n*t}}function E1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function x1(e){return(e=+e)==1?yh:function(t,n){return n-t?E1(t,n,e):Uo(isNaN(t)?n:t)}}function yh(e,t){var n=t-e;return n?y1(e,n):Uo(isNaN(e)?t:e)}const Hs=function e(t){var n=x1(t);function i(r,s){var a=n((r=$o(r)).r,(s=$o(s)).r),o=n(r.g,s.g),l=n(r.b,s.b),c=yh(r.opacity,s.opacity);return function(u){return r.r=a(u),r.g=o(u),r.b=l(u),r.opacity=c(u),r+""}}return i.gamma=e,i}(1);function b1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=e[r]*(1-s)+t[r]*s;return i}}function S1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _1(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),s=new Array(n),a;for(a=0;a<i;++a)r[a]=Er(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<i;++a)s[a]=r[a](o);return s}}function T1(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function O1(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Er(e[r],t[r]):i[r]=t[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var Bo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ho=new RegExp(Bo.source,"g");function w1(e){return function(){return e}}function M1(e){return function(t){return e(t)+""}}function Eh(e,t){var n=Bo.lastIndex=Ho.lastIndex=0,i,r,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(i=Bo.exec(e))&&(r=Ho.exec(t));)(s=r.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(i=i[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:xe(i,r)})),n=Ho.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?M1(l[0].x):w1(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Er(e,t){var n=typeof t,i;return t==null||n==="boolean"?Uo(t):(n==="number"?xe:n==="string"?(i=dn(t))?(t=i,Hs):Eh:t instanceof dn?Hs:t instanceof Date?T1:S1(t)?b1:Array.isArray(t)?_1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?O1:xe)(e,t)}function xh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var bh=180/Math.PI,Go={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Sh(e,t,n,i,r,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(o=Math.sqrt(n*n+i*i))&&(n/=o,i/=o,l/=o),e*i<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*bh,skewX:Math.atan(l)*bh,scaleX:a,scaleY:o}}var Gs;function C1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Go:Sh(t.a,t.b,t.c,t.d,t.e,t.f)}function A1(e){return e==null||(Gs||(Gs=document.createElementNS("http://www.w3.org/2000/svg","g")),Gs.setAttribute("transform",e),!(e=Gs.transform.baseVal.consolidate()))?Go:(e=e.matrix,Sh(e.a,e.b,e.c,e.d,e.e,e.f))}function _h(e,t,n,i){function r(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x:xe(c,d)},{i:g-2,x:xe(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(r(d)+"rotate(",null,i)-2,x:xe(c,u)})):u&&d.push(r(d)+"rotate("+u+i)}function o(c,u,d,h){c!==u?h.push({i:d.push(r(d)+"skewX(",null,i)-2,x:xe(c,u)}):u&&d.push(r(d)+"skewX("+u+i)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push(r(f)+"scale(",null,",",null,")");p.push({i:g-4,x:xe(c,d)},{i:g-2,x:xe(u,h)})}else(d!==1||h!==1)&&f.push(r(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,g=h.length,m;++p<g;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var D1=_h(C1,"px, ","px)","deg)"),L1=_h(A1,", ",")",")");function R1(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}var bi=0,xr=0,br=0,Th=1e3,Vs,Sr,zs=0,Zn=0,Ws=0,_r=typeof performance=="object"&&performance.now?performance:Date,Oh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vo(){return Zn||(Oh(I1),Zn=_r.now()+Ws)}function I1(){Zn=0}function Ys(){this._call=this._time=this._next=null}Ys.prototype=wh.prototype={constructor:Ys,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Vo():+n)+(t==null?0:+t),!this._next&&Sr!==this&&(Sr?Sr._next=this:Vs=this,Sr=this),this._call=e,this._time=n,zo()},stop:function(){this._call&&(this._call=null,this._time=1/0,zo())}};function wh(e,t,n){var i=new Ys;return i.restart(e,t,n),i}function k1(){Vo(),++bi;for(var e=Vs,t;e;)(t=Zn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--bi}function Mh(){Zn=(zs=_r.now())+Ws,bi=xr=0;try{k1()}finally{bi=0,N1(),Zn=0}}function P1(){var e=_r.now(),t=e-zs;t>Th&&(Ws-=t,zs=e)}function N1(){for(var e,t=Vs,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Vs=n);Sr=e,zo(i)}function zo(e){if(!bi){xr&&(xr=clearTimeout(xr));var t=e-Zn;t>24?(e<1/0&&(xr=setTimeout(Mh,e-_r.now()-Ws)),br&&(br=clearInterval(br))):(br||(zs=_r.now(),br=setInterval(P1,Th)),bi=1,Oh(Mh))}}function Ch(e,t,n){var i=new Ys;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var $1=Do("start","end","cancel","interrupt"),F1=[],Ah=0,Dh=1,Wo=2,qs=3,Lh=4,Yo=5,Xs=6;function Zs(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;U1(e,n,{name:t,index:i,group:r,on:$1,tween:F1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Ah})}function qo(e,t){var n=He(e,t);if(n.state>Ah)throw new Error("too late; already scheduled");return n}function Ke(e,t){var n=He(e,t);if(n.state>qs)throw new Error("too late; already running");return n}function He(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function U1(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=wh(s,0,n.time);function s(c){n.state=Dh,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,f;if(n.state!==Dh)return l();for(u in i)if(f=i[u],f.name===n.name){if(f.state===qs)return Ch(a);f.state===Lh?(f.state=Xs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=Xs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(Ch(function(){n.state===qs&&(n.state=Lh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Wo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Wo){for(n.state=qs,r=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=f);r.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Yo,1),d=-1,h=r.length;++d<h;)r[d].call(e,u);n.state===Yo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Xs,n.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function Xo(e,t){var n=e.__transition,i,r,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((i=n[a]).name!==t){s=!1;continue}r=i.state>Wo&&i.state<Yo,i.state=Xs,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[a]}s&&delete e.__transition}}function B1(e){return this.each(function(){Xo(this,e)})}function H1(e,t){var n,i;return function(){var r=Ke(this,e),s=r.tween;if(s!==n){i=n=s;for(var a=0,o=i.length;a<o;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}r.tween=i}}function G1(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=Ke(this,e),a=s.tween;if(a!==i){r=(i=a).slice();for(var o={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=o;break}l===c&&r.push(o)}s.tween=r}}function V1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=He(this.node(),n).tween,r=0,s=i.length,a;r<s;++r)if((a=i[r]).name===e)return a.value;return null}return this.each((t==null?H1:G1)(n,e,t))}function Zo(e,t,n){var i=e._id;return e.each(function(){var r=Ke(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return He(r,i).value[t]}}function Rh(e,t){var n;return(typeof t=="number"?xe:t instanceof dn?Hs:(n=dn(t))?(t=n,Hs):Eh)(e,t)}function z1(e){return function(){this.removeAttribute(e)}}function W1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Y1(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttribute(e);return a===r?null:a===i?s:s=t(i=a,n)}}function q1(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===r?null:a===i?s:s=t(i=a,n)}}function X1(e,t,n){var i,r,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===i&&l===r?s:(r=l,s=t(i=a,o)))}}function Z1(e,t,n){var i,r,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===i&&l===r?s:(r=l,s=t(i=a,o)))}}function j1(e,t){var n=Ps(e),i=n==="transform"?L1:Rh;return this.attrTween(e,typeof t=="function"?(n.local?Z1:X1)(n,i,Zo(this,"attr."+e,t)):t==null?(n.local?W1:z1)(n):(n.local?q1:Y1)(n,i,t))}function K1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Q1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function J1(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&Q1(e,s)),n}return r._value=t,r}function tE(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&K1(e,s)),n}return r._value=t,r}function eE(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 i=Ps(e);return this.tween(n,(i.local?J1:tE)(i,t))}function nE(e,t){return function(){qo(this,e).delay=+t.apply(this,arguments)}}function iE(e,t){return t=+t,function(){qo(this,e).delay=t}}function rE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nE:iE)(t,e)):He(this.node(),t).delay}function sE(e,t){return function(){Ke(this,e).duration=+t.apply(this,arguments)}}function aE(e,t){return t=+t,function(){Ke(this,e).duration=t}}function oE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sE:aE)(t,e)):He(this.node(),t).duration}function lE(e,t){if(typeof t!="function")throw new Error;return function(){Ke(this,e).ease=t}}function cE(e){var t=this._id;return arguments.length?this.each(lE(t,e)):He(this.node(),t).ease}function uE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ke(this,e).ease=n}}function hE(e){if(typeof e!="function")throw new Error;return this.each(uE(this._id,e))}function dE(e){typeof e!="function"&&(e=Ku(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new fn(i,this._parents,this._name,this._id)}function fE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,r=n.length,s=Math.min(i,r),a=new Array(i),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<i;++o)a[o]=t[o];return new fn(a,this._parents,this._name,this._id)}function pE(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 gE(e,t,n){var i,r,s=pE(t)?qo:Ke;return function(){var a=s(this,e),o=a.on;o!==i&&(r=(i=o).copy()).on(t,n),a.on=r}}function mE(e,t){var n=this._id;return arguments.length<2?He(this.node(),n).on.on(e):this.each(gE(n,e,t))}function vE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function yE(){return this.on("end.remove",vE(this._id))}function EE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ro(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var o=i[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,Zs(c[h],t,n,h,c,He(u,n)));return new fn(s,this._parents,t,n)}function xE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ju(e));for(var i=this._groups,r=i.length,s=[],a=[],o=0;o<r;++o)for(var l=i[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=He(u,n),g=0,m=h.length;g<m;++g)(f=h[g])&&Zs(f,t,n,g,h,p);s.push(h),a.push(u)}return new fn(s,a,t,n)}var bE=gr.prototype.constructor;function SE(){return new bE(this._groups,this._parents)}function _E(e,t){var n,i,r;return function(){var s=Ei(this,e),a=(this.style.removeProperty(e),Ei(this,e));return s===a?null:s===n&&a===i?r:r=t(n=s,i=a)}}function Ih(e){return function(){this.style.removeProperty(e)}}function TE(e,t,n){var i,r=n+"",s;return function(){var a=Ei(this,e);return a===r?null:a===i?s:s=t(i=a,n)}}function OE(e,t,n){var i,r,s;return function(){var a=Ei(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Ei(this,e))),a===l?null:a===i&&l===r?s:(r=l,s=t(i=a,o))}}function wE(e,t){var n,i,r,s="style."+t,a="end."+s,o;return function(){var l=Ke(this,e),c=l.on,u=l.value[s]==null?o||(o=Ih(t)):void 0;(c!==n||r!==u)&&(i=(n=c).copy()).on(a,r=u),l.on=i}}function ME(e,t,n){var i=(e+="")=="transform"?D1:Rh;return t==null?this.styleTween(e,_E(e,i)).on("end.style."+e,Ih(e)):typeof t=="function"?this.styleTween(e,OE(e,i,Zo(this,"style."+e,t))).each(wE(this._id,e)):this.styleTween(e,TE(e,i,t),n).on("end.style."+e,null)}function CE(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function AE(e,t,n){var i,r;function s(){var a=t.apply(this,arguments);return a!==r&&(i=(r=a)&&CE(e,a,n)),i}return s._value=t,s}function DE(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,AE(e,t,n??""))}function LE(e){return function(){this.textContent=e}}function RE(e){return function(){var t=e(this);this.textContent=t??""}}function IE(e){return this.tween("text",typeof e=="function"?RE(Zo(this,"text",e)):LE(e==null?"":e+""))}function kE(e){return function(t){this.textContent=e.call(this,t)}}function PE(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&kE(r)),t}return i._value=e,i}function NE(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,PE(e))}function $E(){for(var e=this._name,t=this._id,n=kh(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=He(l,t);Zs(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new fn(i,this._parents,e,n)}function FE(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--r===0&&s()}};n.each(function(){var c=Ke(this,i),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),r===0&&s()})}var UE=0;function fn(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function kh(){return++UE}var pn=gr.prototype;fn.prototype={constructor:fn,select:EE,selectAll:xE,selectChild:pn.selectChild,selectChildren:pn.selectChildren,filter:dE,merge:fE,selection:SE,transition:$E,call:pn.call,nodes:pn.nodes,node:pn.node,size:pn.size,empty:pn.empty,each:pn.each,on:mE,attr:j1,attrTween:eE,style:ME,styleTween:DE,text:IE,textTween:NE,remove:yE,tween:V1,delay:rE,duration:oE,ease:cE,easeVarying:hE,end:FE,[Symbol.iterator]:pn[Symbol.iterator]};const BE=e=>+e;function Ph(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var HE={time:null,delay:0,duration:250,ease:Ph};function GE(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 VE(e){var t,n;e instanceof fn?(t=e._id,e=e._name):(t=kh(),(n=HE).time=Vo(),e=e==null?null:e+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&Zs(l,e,t,c,a,n||GE(l,t));return new fn(i,this._parents,e,t)}gr.prototype.interrupt=B1,gr.prototype.transition=VE;const jo=e=>()=>e;function zE(e,{sourceEvent:t,target:n,selection:i,mode:r,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:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function WE(e){e.stopImmediatePropagation()}function Ko(e){e.preventDefault(),e.stopImmediatePropagation()}var Nh={name:"drag"},Qo={name:"space"},Si={name:"handle"},_i={name:"center"};const{abs:$h,max:Qt,min:Jt}=Math;function Fh(e){return[+e[0],+e[1]]}function Uh(e){return[Fh(e[0]),Fh(e[1])]}var js={name:"x",handles:["w","e"].map(tl),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]]}},Jo={},gn={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"},Bh={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Hh={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},YE={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},qE={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function tl(e){return{type:e}}function XE(e){return!e.ctrlKey&&!e.button}function ZE(){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 jE(){return navigator.maxTouchPoints||"ontouchstart"in this}function el(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function KE(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Gh(){return QE(js)}function QE(e){var t=ZE,n=XE,i=jE,r=!0,s=Do("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([tl("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",gn.overlay).merge(v).each(function(){var E=el(this).extent;I(this).attr("x",E[0][0]).attr("y",E[0][1]).attr("width",E[1][0]-E[0][0]).attr("height",E[1][1]-E[0][1])}),m.selectAll(".selection").data([tl("selection")]).enter().append("rect").attr("class","selection").attr("cursor",gn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var S=m.selectAll(".handle").data(e.handles,function(E){return E.type});S.exit().remove(),S.enter().append("rect").attr("class",function(E){return"handle handle--"+E.type}).attr("cursor",function(E){return gn[E.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,v,S){m.tween?m.on("start.brush",function(E){u(this,arguments).beforestart().start(E)}).on("interrupt.brush end.brush",function(E){u(this,arguments).end(E)}).tween("brush",function(){var E=this,b=E.__brush,x=u(E,arguments),_=b.selection,C=e.input(typeof v=="function"?v.apply(this,arguments):v,b.extent),D=Er(_,C);function $(P){b.selection=P===1&&C===null?null:D(P),c.call(E),x.brush()}return _!==null&&C!==null?$:$(1)}):m.each(function(){var E=this,b=arguments,x=E.__brush,_=e.input(typeof v=="function"?v.apply(E,b):v,x.extent),C=u(E,b).beforestart();Xo(E),x.selection=_===null?null:_,c.call(E),C.start(S).brush(S).end(S)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=I(this),v=el(this).selection;v?(m.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]),m.selectAll(".handle").style("display",null).attr("x",function(S){return S.type[S.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(S){return S.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(S){return S.type==="n"||S.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(S){return S.type==="e"||S.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,S){var E=m.__brush.emitter;return E&&(!S||!E.clean)?E:new d(m,v,S)}function d(m,v,S){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=S}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,S){var E=I(this.that).datum();s.call(m,this.that,new zE(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:S,dispatch:s}),E)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,S=m.target.__data__.type,E=(r&&m.metaKey?S="overlay":S)==="selection"?Nh:r&&m.altKey?_i:Si,b=e===Jo?null:YE[S],x=e===js?null:qE[S],_=el(v),C=_.extent,D=_.selection,$=C[0][0],P,w,H=C[0][1],N,M,O=C[1][0],F,U,R=C[1][1],B,tt,Z=0,Y=0,Q,ht=b&&x&&r&&m.shiftKey,et,K,nt=Array.from(m.touches||[m],at=>{const bt=at.identifier;return at=Yn(at,v),at.point0=at.slice(),at.identifier=bt,at});Xo(v);var ct=u(v,arguments,!0).beforestart();if(S==="overlay"){D&&(Q=!0);const at=[nt[0],nt[1]||nt[0]];_.selection=D=[[P=e===Jo?$:Jt(at[0][0],at[1][0]),N=e===js?H:Jt(at[0][1],at[1][1])],[F=e===Jo?O:Qt(at[0][0],at[1][0]),B=e===js?R:Qt(at[0][1],at[1][1])]],nt.length>1&&G(m)}else P=D[0][0],N=D[0][1],F=D[1][0],B=D[1][1];w=P,M=N,U=F,tt=B;var W=I(v).attr("pointer-events","none"),j=W.selectAll(".overlay").attr("cursor",gn[S]);if(m.touches)ct.moved=L,ct.ended=V;else{var J=I(m.view).on("mousemove.brush",L,!0).on("mouseup.brush",V,!0);r&&J.on("keydown.brush",yt,!0).on("keyup.brush",Ut,!0),s1(m.view)}c.call(v),ct.start(m,E.name);function L(at){for(const bt of at.changedTouches||[at])for(const $e of nt)$e.identifier===bt.identifier&&($e.cur=Yn(bt,v));if(ht&&!et&&!K&&nt.length===1){const bt=nt[0];$h(bt.cur[0]-bt[0])>$h(bt.cur[1]-bt[1])?K=!0:et=!0}for(const bt of nt)bt.cur&&(bt[0]=bt.cur[0],bt[1]=bt.cur[1]);Q=!0,Ko(at),G(at)}function G(at){const bt=nt[0],$e=bt.point0;var he;switch(Z=bt[0]-$e[0],Y=bt[1]-$e[1],E){case Qo:case Nh:{b&&(Z=Qt($-P,Jt(O-F,Z)),w=P+Z,U=F+Z),x&&(Y=Qt(H-N,Jt(R-B,Y)),M=N+Y,tt=B+Y);break}case Si:{nt[1]?(b&&(w=Qt($,Jt(O,nt[0][0])),U=Qt($,Jt(O,nt[1][0])),b=1),x&&(M=Qt(H,Jt(R,nt[0][1])),tt=Qt(H,Jt(R,nt[1][1])),x=1)):(b<0?(Z=Qt($-P,Jt(O-P,Z)),w=P+Z,U=F):b>0&&(Z=Qt($-F,Jt(O-F,Z)),w=P,U=F+Z),x<0?(Y=Qt(H-N,Jt(R-N,Y)),M=N+Y,tt=B):x>0&&(Y=Qt(H-B,Jt(R-B,Y)),M=N,tt=B+Y));break}case _i:{b&&(w=Qt($,Jt(O,P-Z*b)),U=Qt($,Jt(O,F+Z*b))),x&&(M=Qt(H,Jt(R,N-Y*x)),tt=Qt(H,Jt(R,B+Y*x)));break}}U<w&&(b*=-1,he=P,P=F,F=he,he=w,w=U,U=he,S in Bh&&j.attr("cursor",gn[S=Bh[S]])),tt<M&&(x*=-1,he=N,N=B,B=he,he=M,M=tt,tt=he,S in Hh&&j.attr("cursor",gn[S=Hh[S]])),_.selection&&(D=_.selection),et&&(w=D[0][0],U=D[1][0]),K&&(M=D[0][1],tt=D[1][1]),(D[0][0]!==w||D[0][1]!==M||D[1][0]!==U||D[1][1]!==tt)&&(_.selection=[[w,M],[U,tt]],c.call(v),ct.brush(at,E.name))}function V(at){if(WE(at),at.touches){if(at.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else a1(at.view,Q),J.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);W.attr("pointer-events","all"),j.attr("cursor",gn.overlay),_.selection&&(D=_.selection),KE(D)&&(_.selection=null,c.call(v)),ct.end(at,E.name)}function yt(at){switch(at.keyCode){case 16:{ht=b&&x;break}case 18:{E===Si&&(b&&(F=U-Z*b,P=w+Z*b),x&&(B=tt-Y*x,N=M+Y*x),E=_i,G(at));break}case 32:{(E===Si||E===_i)&&(b<0?F=U-Z:b>0&&(P=w-Z),x<0?B=tt-Y:x>0&&(N=M-Y),E=Qo,j.attr("cursor",gn.selection),G(at));break}default:return}Ko(at)}function Ut(at){switch(at.keyCode){case 16:{ht&&(et=K=ht=!1,G(at));break}case 18:{E===_i&&(b<0?F=U:b>0&&(P=w),x<0?B=tt:x>0&&(N=M),E=Si,G(at));break}case 32:{E===Qo&&(at.altKey?(b&&(F=U-Z*b,P=w+Z*b),x&&(B=tt-Y*x,N=M+Y*x),E=_i):(b<0?F=U:b>0&&(P=w),x<0?B=tt:x>0&&(N=M),E=Si),j.attr("cursor",gn[S]),G(at));break}default:return}Ko(at)}}function f(m){u(this,arguments).moved(m)}function p(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=Uh(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:jo(Uh(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:jo(!!m),l):n},l.touchable=function(m){return arguments.length?(i=typeof m=="function"?m:jo(!!m),l):i},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(r=!!m,l):r},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const nl=Math.PI,il=2*nl,jn=1e-6,JE=il-jn;function Vh(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function tx(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(i){this._+=i[0];for(let r=1,s=i.length;r<s;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let ex=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Vh:tx(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,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,s,a){this._append`C${+t},${+n},${+i},${+r},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,i,r,s){if(t=+t,n=+n,i=+i,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=i-t,c=r-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>jn)if(!(Math.abs(d*l-c*u)>jn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=i-a,p=r-o,g=l*l+c*c,m=f*f+p*p,v=Math.sqrt(g),S=Math.sqrt(h),E=s*Math.tan((nl-Math.acos((g+h-m)/(2*v*S)))/2),b=E/S,x=E/v;Math.abs(b-1)>jn&&this._append`L${t+b*u},${n+b*d}`,this._append`A${s},${s},0,0,${+(d*f>u*p)},${this._x1=t+x*l},${this._y1=n+x*c}`}}arc(t,n,i,r,s,a){if(t=+t,n=+n,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(r),l=i*Math.sin(r),c=t+o,u=n+l,d=1^a,h=a?r-s:s-r;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>jn||Math.abs(this._y1-u)>jn)&&this._append`L${c},${u}`,i&&(h<0&&(h=h%il+il),h>JE?this._append`A${i},${i},0,1,${d},${t-o},${n-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=u}`:h>jn&&this._append`A${i},${i},0,${+(h>=nl)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function nx(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ks(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Ti(e){return e=Ks(Math.abs(e)),e?e[1]:NaN}function ix(e,t){return function(n,i){for(var r=n.length,s=[],a=0,o=e[0],l=0;r>0&&o>0&&(l+o+1>i&&(o=Math.max(1,i-l)),s.push(n.substring(r-=o,r+o)),!((l+=o+1)>i));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function rx(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var sx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Tr(e){if(!(t=sx.exec(e)))throw new Error("invalid format: "+e);var t;return new rl({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]})}Tr.prototype=rl.prototype;function rl(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+""}rl.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 ax(e){t:for(var t=e.length,n=1,i=-1,r;n<t;++n)switch(e[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+e[n])break t;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var zh;function ox(e,t){var n=Ks(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(zh=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Ks(e,Math.max(0,t+s-1))[0]}function Wh(e,t){var n=Ks(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const Yh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:nx,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)=>Wh(e*100,t),r:Wh,s:ox,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qh(e){return e}var Xh=Array.prototype.map,Zh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lx(e){var t=e.grouping===void 0||e.thousands===void 0?qh:ix(Xh.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?qh:rx(Xh.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Tr(d);var h=d.fill,f=d.align,p=d.sign,g=d.symbol,m=d.zero,v=d.width,S=d.comma,E=d.precision,b=d.trim,x=d.type;x==="n"?(S=!0,x="g"):Yh[x]||(E===void 0&&(E=12),b=!0,x="g"),(m||h==="0"&&f==="=")&&(m=!0,h="0",f="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",C=g==="$"?i:/[%p]/.test(x)?a:"",D=Yh[x],$=/[defgprs%]/.test(x);E=E===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function P(w){var H=_,N=C,M,O,F;if(x==="c")N=D(w)+N,w="";else{w=+w;var U=w<0||1/w<0;if(w=isNaN(w)?l:D(Math.abs(w),E),b&&(w=ax(w)),U&&+w==0&&p!=="+"&&(U=!1),H=(U?p==="("?p:o:p==="-"||p==="("?"":p)+H,N=(x==="s"?Zh[8+zh/3]:"")+N+(U&&p==="("?")":""),$){for(M=-1,O=w.length;++M<O;)if(F=w.charCodeAt(M),48>F||F>57){N=(F===46?r+w.slice(M+1):w.slice(M))+N,w=w.slice(0,M);break}}}S&&!m&&(w=t(w,1/0));var R=H.length+w.length+N.length,B=R<v?new Array(v-R+1).join(h):"";switch(S&&m&&(w=t(B+w,B.length?v-N.length:1/0),B=""),f){case"<":w=H+w+N+B;break;case"=":w=H+B+w+N;break;case"^":w=B.slice(0,R=B.length>>1)+H+w+N+B.slice(R);break;default:w=B+H+w+N;break}return s(w)}return P.toString=function(){return d+""},P}function u(d,h){var f=c((d=Tr(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(Ti(h)/3)))*3,g=Math.pow(10,-p),m=Zh[8+p/3];return function(v){return f(g*v)+m}}return{format:c,formatPrefix:u}}var Qs,sl,jh;cx({thousands:",",grouping:[3],currency:["$",""]});function cx(e){return Qs=lx(e),sl=Qs.format,jh=Qs.formatPrefix,Qs}function ux(e){return Math.max(0,-Ti(Math.abs(e)))}function hx(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ti(t)/3)))*3-Ti(Math.abs(e)))}function dx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ti(t)-Ti(e))+1}var Tt=1e-6,Kh=1e-12,mt=Math.PI,fe=mt/2,Qh=mt/4,be=mt*2,re=180/mt,Nt=mt/180,Ot=Math.abs,Jh=Math.atan,Kn=Math.atan2,Mt=Math.cos,fx=Math.exp,px=Math.log,St=Math.sin,$n=Math.sign||function(e){return e>0?1:e<0?-1:0},Ge=Math.sqrt,gx=Math.tan;function mx(e){return e>1?0:e<-1?mt:Math.acos(e)}function mn(e){return e>1?fe:e<-1?-fe:Math.asin(e)}function Me(){}function Js(e,t){e&&ed.hasOwnProperty(e.type)&&ed[e.type](e,t)}var td={Feature:function(e,t){Js(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)Js(n[i].geometry,t)}},ed={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,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){al(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)al(n[i],t,0)},Polygon:function(e,t){nd(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)nd(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)Js(n[i],t)}};function al(e,t,n){var i=-1,r=e.length-n,s;for(t.lineStart();++i<r;)s=e[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function nd(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)al(e[n],t,1);t.polygonEnd()}function Oi(e,t){e&&td.hasOwnProperty(e.type)?td[e.type](e,t):Js(e,t)}function ol(e){return[Kn(e[1],e[0]),mn(e[2])]}function wi(e){var t=e[0],n=e[1],i=Mt(n);return[i*Mt(t),i*St(t),St(n)]}function ta(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ea(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 ll(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function na(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function cl(e){var t=Ge(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function ul(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function hl(e,t){return Ot(e)>mt&&(e-=Math.round(e/be)*be),[e,t]}hl.invert=hl;function id(e,t,n){return(e%=be)?t||n?ul(sd(e),ad(t,n)):sd(e):t||n?ad(t,n):hl}function rd(e){return function(t,n){return t+=e,Ot(t)>mt&&(t-=Math.round(t/be)*be),[t,n]}}function sd(e){var t=rd(e);return t.invert=rd(-e),t}function ad(e,t){var n=Mt(e),i=St(e),r=Mt(t),s=St(t);function a(o,l){var c=Mt(l),u=Mt(o)*c,d=St(o)*c,h=St(l),f=h*n+u*i;return[Kn(d*r-f*s,u*n-h*i),mn(f*r+d*s)]}return a.invert=function(o,l){var c=Mt(l),u=Mt(o)*c,d=St(o)*c,h=St(l),f=h*r-d*s;return[Kn(d*r+h*s,u*n+f*i),mn(f*n-u*i)]},a}function vx(e){e=id(e[0]*Nt,e[1]*Nt,e.length>2?e[2]*Nt:0);function t(n){return n=e(n[0]*Nt,n[1]*Nt),n[0]*=re,n[1]*=re,n}return t.invert=function(n){return n=e.invert(n[0]*Nt,n[1]*Nt),n[0]*=re,n[1]*=re,n},t}function yx(e,t,n,i,r,s){if(n){var a=Mt(t),o=St(t),l=i*n;r==null?(r=t+i*be,s=t-l/2):(r=od(a,r),s=od(a,s),(i>0?r<s:r>s)&&(r+=i*be));for(var c,u=r;i>0?u>s:u<s;u-=l)c=ol([a,-o*Mt(u),-o*St(u)]),e.point(c[0],c[1])}}function od(e,t){t=wi(t),t[0]-=e,cl(t);var n=mx(-t[1]);return((-t[2]<0?-n:n)+be-Tt)%be}function ld(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},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 ia(e,t){return Ot(e[0]-t[0])<Tt&&Ot(e[1]-t[1])<Tt}function ra(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function cd(e,t,n,i,r){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],v=p[g],S;if(ia(m,v)){if(!m[2]&&!v[2]){for(r.lineStart(),o=0;o<g;++o)r.point((m=p[o])[0],m[1]);r.lineEnd();return}v[0]+=2*Tt}s.push(S=new ra(m,p,null,!0)),a.push(S.o=new ra(m,null,S,!1)),s.push(S=new ra(v,p,null,!1)),a.push(S.o=new ra(v,null,S,!0))}}),!!s.length){for(a.sort(t),ud(s),ud(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,f=!0;h.v;)if((h=h.n)===c)return;u=h.z,r.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,l=u.length;o<l;++o)r.point((d=u[o])[0],d[1]);else i(h.x,h.n.x,1,r);h=h.n}else{if(f)for(u=h.p.z,o=u.length-1;o>=0;--o)r.point((d=u[o])[0],d[1]);else i(h.x,h.p.x,-1,r);h=h.p}h=h.o,u=h.z,f=!f}while(!h.v);r.lineEnd()}}}function ud(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function dl(e){return Ot(e[0])<=mt?e[0]:$n(e[0])*((Ot(e[0])+mt)%be-mt)}function Ex(e,t){var n=dl(t),i=t[1],r=St(i),s=[St(n),-Mt(n),0],a=0,o=0,l=new zn;r===1?i=fe+Tt:r===-1&&(i=-fe-Tt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],p=dl(f),g=f[1]/2+Qh,m=St(g),v=Mt(g),S=0;S<h;++S,p=b,m=_,v=C,f=E){var E=d[S],b=dl(E),x=E[1]/2+Qh,_=St(x),C=Mt(x),D=b-p,$=D>=0?1:-1,P=$*D,w=P>mt,H=m*_;if(l.add(Kn(H*$*St(P),v*C+H*Mt(P))),a+=w?D+$*be:D,w^p>=n^b>=n){var N=ea(wi(f),wi(E));cl(N);var M=ea(s,N);cl(M);var O=(w^D>=0?-1:1)*mn(M[2]);(i>O||i===O&&(N[0]||N[1]))&&(o+=w^D>=0?1:-1)}}return(a<-Tt||a<Tt&&l<-Kh)^o&1}function hd(e,t,n,i){return function(r){var s=t(r),a=ld(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=S,h.lineEnd=E,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=g,h.lineEnd=m,u=zu(u);var b=Ex(c,i);u.length?(l||(r.polygonStart(),l=!0),cd(u,bx,b,n,r)):b&&(l||(r.polygonStart(),l=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),l&&(r.polygonEnd(),l=!1),u=c=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function f(b,x){e(b,x)&&r.point(b,x)}function p(b,x){s.point(b,x)}function g(){h.point=p,s.lineStart()}function m(){h.point=f,s.lineEnd()}function v(b,x){d.push([b,x]),o.point(b,x)}function S(){o.lineStart(),d=[]}function E(){v(d[0][0],d[0][1]),o.lineEnd();var b=o.clean(),x=a.result(),_,C=x.length,D,$,P;if(d.pop(),c.push(d),d=null,!!C){if(b&1){if($=x[0],(D=$.length-1)>0){for(l||(r.polygonStart(),l=!0),r.lineStart(),_=0;_<D;++_)r.point((P=$[_])[0],P[1]);r.lineEnd()}return}C>1&&b&2&&x.push(x.pop().concat(x.shift())),u.push(x.filter(xx))}}return h}}function xx(e){return e.length>1}function bx(e,t){return((e=e.x)[0]<0?e[1]-fe-Tt:fe-e[1])-((t=t.x)[0]<0?t[1]-fe-Tt:fe-t[1])}const dd=hd(function(){return!0},Sx,Tx,[-mt,-fe]);function Sx(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,a){var o=s>0?mt:-mt,l=Ot(s-t);Ot(l-mt)<Tt?(e.point(t,n=(n+a)/2>0?fe:-fe),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),r=0):i!==o&&l>=mt&&(Ot(t-i)<Tt&&(t-=i*Tt),Ot(s-o)<Tt&&(s-=o*Tt),n=_x(t,n,s,a),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(o,n),r=0),e.point(t=s,n=a),i=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function _x(e,t,n,i){var r,s,a=St(e-n);return Ot(a)>Tt?Jh((St(t)*(s=Mt(i))*St(n)-St(i)*(r=Mt(t))*St(e))/(r*s*a)):(t+i)/2}function Tx(e,t,n,i){var r;if(e==null)r=n*fe,i.point(-mt,r),i.point(0,r),i.point(mt,r),i.point(mt,0),i.point(mt,-r),i.point(0,-r),i.point(-mt,-r),i.point(-mt,0),i.point(-mt,r);else if(Ot(e[0]-t[0])>Tt){var s=e[0]<t[0]?mt:-mt;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function Ox(e){var t=Mt(e),n=2*Nt,i=t>0,r=Ot(t)>Tt;function s(u,d,h,f){yx(f,e,n,h,u,d)}function a(u,d){return Mt(u)*Mt(d)>t}function o(u){var d,h,f,p,g;return{lineStart:function(){p=f=!1,g=1},point:function(m,v){var S=[m,v],E,b=a(m,v),x=i?b?0:c(m,v):b?c(m+(m<0?mt:-mt),v):0;if(!d&&(p=f=b)&&u.lineStart(),b!==f&&(E=l(d,S),(!E||ia(d,E)||ia(S,E))&&(S[2]=1)),b!==f)g=0,b?(u.lineStart(),E=l(S,d),u.point(E[0],E[1])):(E=l(d,S),u.point(E[0],E[1],2),u.lineEnd()),d=E;else if(r&&d&&i^b){var _;!(x&h)&&(_=l(S,d,!0))&&(g=0,i?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}b&&(!d||!ia(d,S))&&u.point(S[0],S[1]),d=S,f=b,h=x},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return g|(p&&f)<<1}}}function l(u,d,h){var f=wi(u),p=wi(d),g=[1,0,0],m=ea(f,p),v=ta(m,m),S=m[0],E=v-S*S;if(!E)return!h&&u;var b=t*v/E,x=-t*S/E,_=ea(g,m),C=na(g,b),D=na(m,x);ll(C,D);var $=_,P=ta(C,$),w=ta($,$),H=P*P-w*(ta(C,C)-1);if(!(H<0)){var N=Ge(H),M=na($,(-P-N)/w);if(ll(M,C),M=ol(M),!h)return M;var O=u[0],F=d[0],U=u[1],R=d[1],B;F<O&&(B=O,O=F,F=B);var tt=F-O,Z=Ot(tt-mt)<Tt,Y=Z||tt<Tt;if(!Z&&R<U&&(B=U,U=R,R=B),Y?Z?U+R>0^M[1]<(Ot(M[0]-O)<Tt?U:R):U<=M[1]&&M[1]<=R:tt>mt^(O<=M[0]&&M[0]<=F)){var Q=na($,(-P+N)/w);return ll(Q,C),[M,ol(Q)]}}}function c(u,d){var h=i?e:mt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return hd(a,o,s,i?[0,-e]:[-mt,e-mt])}function wx(e,t,n,i,r,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,f=c-o,p;if(p=n-a,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>u&&(u=p)}if(p=r-a,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<d&&(d=p)}if(p=i-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<d&&(d=p)}else if(f>0){if(p>d)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>d)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<d&&(d=p)}return u>0&&(e[0]=a+u*h,e[1]=o+u*f),d<1&&(t[0]=a+d*h,t[1]=o+d*f),!0}}}}}var Or=1e9,sa=-Or;function Mx(e,t,n,i){function r(c,u){return e<=c&&c<=n&&t<=u&&u<=i}function s(c,u,d,h){var f=0,p=0;if(c==null||(f=a(c,d))!==(p=a(u,d))||l(c,u)<0^d>0)do h.point(f===0||f===3?e:n,f>1?i:t);while((f=(f+d+4)%4)!==p);else h.point(u[0],u[1])}function a(c,u){return Ot(c[0]-e)<Tt?u>0?0:3:Ot(c[0]-n)<Tt?u>0?2:1:Ot(c[1]-t)<Tt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=ld(),h,f,p,g,m,v,S,E,b,x,_,C={point:D,lineStart:H,lineEnd:N,polygonStart:P,polygonEnd:w};function D(O,F){r(O,F)&&u.point(O,F)}function $(){for(var O=0,F=0,U=f.length;F<U;++F)for(var R=f[F],B=1,tt=R.length,Z=R[0],Y,Q,ht=Z[0],et=Z[1];B<tt;++B)Y=ht,Q=et,Z=R[B],ht=Z[0],et=Z[1],Q<=i?et>i&&(ht-Y)*(i-Q)>(et-Q)*(e-Y)&&++O:et<=i&&(ht-Y)*(i-Q)<(et-Q)*(e-Y)&&--O;return O}function P(){u=d,h=[],f=[],_=!0}function w(){var O=$(),F=_&&O,U=(h=zu(h)).length;(F||U)&&(c.polygonStart(),F&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),U&&cd(h,o,O,s,c),c.polygonEnd()),u=c,h=f=p=null}function H(){C.point=M,f&&f.push(p=[]),x=!0,b=!1,S=E=NaN}function N(){h&&(M(g,m),v&&b&&d.rejoin(),h.push(d.result())),C.point=D,b&&u.lineEnd()}function M(O,F){var U=r(O,F);if(f&&p.push([O,F]),x)g=O,m=F,v=U,x=!1,U&&(u.lineStart(),u.point(O,F));else if(U&&b)u.point(O,F);else{var R=[S=Math.max(sa,Math.min(Or,S)),E=Math.max(sa,Math.min(Or,E))],B=[O=Math.max(sa,Math.min(Or,O)),F=Math.max(sa,Math.min(Or,F))];wx(R,B,e,t,n,i)?(b||(u.lineStart(),u.point(R[0],R[1])),u.point(B[0],B[1]),U||u.lineEnd(),_=!1):U&&(u.lineStart(),u.point(O,F),_=!1)}S=O,E=F,b=U}return C}}const fl=e=>e;var pl=new zn,gl=new zn,fd,pd,ml,vl,vn={point:Me,lineStart:Me,lineEnd:Me,polygonStart:function(){vn.lineStart=Cx,vn.lineEnd=Dx},polygonEnd:function(){vn.lineStart=vn.lineEnd=vn.point=Me,pl.add(Ot(gl)),gl=new zn},result:function(){var e=pl/2;return pl=new zn,e}};function Cx(){vn.point=Ax}function Ax(e,t){vn.point=gd,fd=ml=e,pd=vl=t}function gd(e,t){gl.add(vl*e-ml*t),ml=e,vl=t}function Dx(){gd(fd,pd)}var Mi=1/0,aa=Mi,wr=-Mi,oa=wr,la={point:Lx,lineStart:Me,lineEnd:Me,polygonStart:Me,polygonEnd:Me,result:function(){var e=[[Mi,aa],[wr,oa]];return wr=oa=-(aa=Mi=1/0),e}};function Lx(e,t){e<Mi&&(Mi=e),e>wr&&(wr=e),t<aa&&(aa=t),t>oa&&(oa=t)}var yl=0,El=0,Mr=0,ca=0,ua=0,Ci=0,xl=0,bl=0,Cr=0,md,vd,Qe,Je,Ce={point:Qn,lineStart:yd,lineEnd:Ed,polygonStart:function(){Ce.lineStart=kx,Ce.lineEnd=Px},polygonEnd:function(){Ce.point=Qn,Ce.lineStart=yd,Ce.lineEnd=Ed},result:function(){var e=Cr?[xl/Cr,bl/Cr]:Ci?[ca/Ci,ua/Ci]:Mr?[yl/Mr,El/Mr]:[NaN,NaN];return yl=El=Mr=ca=ua=Ci=xl=bl=Cr=0,e}};function Qn(e,t){yl+=e,El+=t,++Mr}function yd(){Ce.point=Rx}function Rx(e,t){Ce.point=Ix,Qn(Qe=e,Je=t)}function Ix(e,t){var n=e-Qe,i=t-Je,r=Ge(n*n+i*i);ca+=r*(Qe+e)/2,ua+=r*(Je+t)/2,Ci+=r,Qn(Qe=e,Je=t)}function Ed(){Ce.point=Qn}function kx(){Ce.point=Nx}function Px(){xd(md,vd)}function Nx(e,t){Ce.point=xd,Qn(md=Qe=e,vd=Je=t)}function xd(e,t){var n=e-Qe,i=t-Je,r=Ge(n*n+i*i);ca+=r*(Qe+e)/2,ua+=r*(Je+t)/2,Ci+=r,r=Je*e-Qe*t,xl+=r*(Qe+e),bl+=r*(Je+t),Cr+=r*3,Qn(Qe=e,Je=t)}function bd(e){this._context=e}bd.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,be);break}}},result:Me};var Sl=new zn,_l,Sd,_d,Ar,Dr,Lr={point:Me,lineStart:function(){Lr.point=$x},lineEnd:function(){_l&&Td(Sd,_d),Lr.point=Me},polygonStart:function(){_l=!0},polygonEnd:function(){_l=null},result:function(){var e=+Sl;return Sl=new zn,e}};function $x(e,t){Lr.point=Td,Sd=Ar=e,_d=Dr=t}function Td(e,t){Ar-=e,Dr-=t,Sl.add(Ge(Ar*Ar+Dr*Dr)),Ar=e,Dr=t}let Od,ha,wd,Md;class Cd{constructor(t){this._append=t==null?Ad:Fx(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!==wd||this._append!==ha){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,wd=i,ha=this._append,Md=this._,this._=r}this._+=Md;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 Fx(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Ad;if(t!==Od){const n=10**t;Od=t,ha=function(r){let s=1;this._+=r[0];for(const a=r.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}return ha}function Ux(e,t){let n=3,i=4.5,r,s;function a(o){return o&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),Oi(o,r(s))),s.result()}return a.area=function(o){return Oi(o,r(vn)),vn.result()},a.measure=function(o){return Oi(o,r(Lr)),Lr.result()},a.bounds=function(o){return Oi(o,r(la)),la.result()},a.centroid=function(o){return Oi(o,r(Ce)),Ce.result()},a.projection=function(o){return arguments.length?(r=o==null?(e=null,fl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Cd(n)):new bd(t=o),typeof i!="function"&&s.pointRadius(i),a):t},a.pointRadius=function(o){return arguments.length?(i=typeof o=="function"?o:(s.pointRadius(+o),+o),a):i},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 Cd(n)),a},a.projection(e).digits(n).context(t)}function Tl(e){return function(t){var n=new Ol;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Ol(){}Ol.prototype={constructor:Ol,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 wl(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Oi(n,e.stream(la)),t(la.result()),i!=null&&e.clipExtent(i),e}function Dd(e,t,n){return wl(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),o=+t[0][0]+(r-a*(i[1][0]+i[0][0]))/2,l=+t[0][1]+(s-a*(i[1][1]+i[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function Bx(e,t,n){return Dd(e,[[0,0],t],n)}function Hx(e,t,n){return wl(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),a=(r-s*(i[1][0]+i[0][0]))/2,o=-s*i[0][1];e.scale(150*s).translate([a,o])},n)}function Gx(e,t,n){return wl(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),a=-s*i[0][0],o=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Ld=16,Vx=Mt(30*Nt);function Rd(e,t){return+t?Wx(e,t):zx(e)}function zx(e){return Tl({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Wx(e,t){function n(i,r,s,a,o,l,c,u,d,h,f,p,g,m){var v=c-i,S=u-r,E=v*v+S*S;if(E>4*t&&g--){var b=a+h,x=o+f,_=l+p,C=Ge(b*b+x*x+_*_),D=mn(_/=C),$=Ot(Ot(_)-1)<Tt||Ot(s-d)<Tt?(s+d)/2:Kn(x,b),P=e($,D),w=P[0],H=P[1],N=w-i,M=H-r,O=S*N-v*M;(O*O/E>t||Ot((v*N+S*M)/E-.5)>.3||a*h+o*f+l*p<Vx)&&(n(i,r,s,a,o,l,w,H,$,b/=C,x/=C,_,g,m),m.point(w,H),n(w,H,$,b,x,_,c,u,d,h,f,p,g,m))}}return function(i){var r,s,a,o,l,c,u,d,h,f,p,g,m={point:v,lineStart:S,lineEnd:b,polygonStart:function(){i.polygonStart(),m.lineStart=x},polygonEnd:function(){i.polygonEnd(),m.lineStart=S}};function v(D,$){D=e(D,$),i.point(D[0],D[1])}function S(){d=NaN,m.point=E,i.lineStart()}function E(D,$){var P=wi([D,$]),w=e(D,$);n(d,h,u,f,p,g,d=w[0],h=w[1],u=D,f=P[0],p=P[1],g=P[2],Ld,i),i.point(d,h)}function b(){m.point=v,i.lineEnd()}function x(){S(),m.point=_,m.lineEnd=C}function _(D,$){E(r=D,$),s=d,a=h,o=f,l=p,c=g,m.point=E}function C(){n(d,h,u,f,p,g,s,a,r,o,l,c,Ld,i),m.lineEnd=b,b()}return m}}var Yx=Tl({point:function(e,t){this.stream.point(e*Nt,t*Nt)}});function qx(e){return Tl({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function Xx(e,t,n,i,r){function s(a,o){return a*=i,o*=r,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*i,(n-o)/e*r]},s}function Id(e,t,n,i,r,s){if(!s)return Xx(e,t,n,i,r);var a=Mt(s),o=St(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(g,m){return g*=i,m*=r,[l*g-c*m+t,n-c*g-l*m]}return p.invert=function(g,m){return[i*(u*g-d*m+h),r*(f-d*g-u*m)]},p}function da(e){return kd(function(){return e})()}function kd(e){var t,n=150,i=480,r=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,f=1,p=null,g=dd,m=null,v,S,E,b=fl,x=.5,_,C,D,$,P;function w(O){return D(O[0]*Nt,O[1]*Nt)}function H(O){return O=D.invert(O[0],O[1]),O&&[O[0]*re,O[1]*re]}w.stream=function(O){return $&&P===O?$:$=Yx(qx(u)(g(_(b(P=O)))))},w.preclip=function(O){return arguments.length?(g=O,p=void 0,M()):g},w.postclip=function(O){return arguments.length?(b=O,m=v=S=E=null,M()):b},w.clipAngle=function(O){return arguments.length?(g=+O?Ox(p=O*Nt):(p=null,dd),M()):p*re},w.clipExtent=function(O){return arguments.length?(b=O==null?(m=v=S=E=null,fl):Mx(m=+O[0][0],v=+O[0][1],S=+O[1][0],E=+O[1][1]),M()):m==null?null:[[m,v],[S,E]]},w.scale=function(O){return arguments.length?(n=+O,N()):n},w.translate=function(O){return arguments.length?(i=+O[0],r=+O[1],N()):[i,r]},w.center=function(O){return arguments.length?(s=O[0]%360*Nt,a=O[1]%360*Nt,N()):[s*re,a*re]},w.rotate=function(O){return arguments.length?(o=O[0]%360*Nt,l=O[1]%360*Nt,c=O.length>2?O[2]%360*Nt:0,N()):[o*re,l*re,c*re]},w.angle=function(O){return arguments.length?(d=O%360*Nt,N()):d*re},w.reflectX=function(O){return arguments.length?(h=O?-1:1,N()):h<0},w.reflectY=function(O){return arguments.length?(f=O?-1:1,N()):f<0},w.precision=function(O){return arguments.length?(_=Rd(C,x=O*O),M()):Ge(x)},w.fitExtent=function(O,F){return Dd(w,O,F)},w.fitSize=function(O,F){return Bx(w,O,F)},w.fitWidth=function(O,F){return Hx(w,O,F)},w.fitHeight=function(O,F){return Gx(w,O,F)};function N(){var O=Id(n,0,0,h,f,d).apply(null,t(s,a)),F=Id(n,i-O[0],r-O[1],h,f,d);return u=id(o,l,c),C=ul(t,F),D=ul(u,C),_=Rd(C,x),M()}function M(){return $=P=null,w}return function(){return t=e.apply(this,arguments),w.invert=t.invert&&H,N()}}function Pd(e){var t=0,n=mt/3,i=kd(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*Nt,n=s[1]*Nt):[t*re,n*re]},r}function Zx(e){var t=Mt(e);function n(i,r){return[i*t,St(r)/t]}return n.invert=function(i,r){return[i/t,mn(r*t)]},n}function jx(e,t){var n=St(e),i=(n+St(t))/2;if(Ot(i)<Tt)return Zx(e);var r=1+n*(2*i-n),s=Ge(r)/i;function a(o,l){var c=Ge(r-2*i*St(l))/i;return[c*St(o*=i),s-c*Mt(o)]}return a.invert=function(o,l){var c=s-l,u=Kn(o,Ot(c))*$n(c);return c*i<0&&(u-=mt*$n(o)*$n(c)),[u/i,mn((r-(o*o+c*c)*i*i)/(2*i))]},a}function Nd(){return Pd(jx).scale(155.424).center([0,33.6442])}function Kx(){return Nd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Ml(e,t){return[e,px(gx((fe+t)/2))]}Ml.invert=function(e,t){return[e,2*Jh(fx(t))-fe]};function Qx(){return Jx(Ml).scale(961/be)}function Jx(e){var t=da(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(i(d),u()):i()},t.translate=function(d){return arguments.length?(r(d),u()):r()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=mt*i(),h=t(vx(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Ml?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function fa(e,t){return[e,t]}fa.invert=fa;function tb(){return da(fa).scale(152.63)}function eb(e,t){var n=Mt(e),i=e===t?St(e):(n-Mt(t))/(t-e),r=n/i+e;if(Ot(i)<Tt)return fa;function s(a,o){var l=r-o,c=i*a;return[l*St(c),r-l*Mt(c)]}return s.invert=function(a,o){var l=r-o,c=Kn(a,Ot(l))*$n(l);return l*i<0&&(c-=mt*$n(a)*$n(l)),[c/i,r-$n(i)*Ge(a*a+l*l)]},s}function nb(){return Pd(eb).scale(131.154).center([0,13.9389])}var Rr=1.340264,Ir=-.081106,kr=893e-6,Pr=.003796,pa=Ge(3)/2,ib=12;function $d(e,t){var n=mn(pa*St(t)),i=n*n,r=i*i*i;return[e*Mt(n)/(pa*(Rr+3*Ir*i+r*(7*kr+9*Pr*i))),n*(Rr+Ir*i+r*(kr+Pr*i))]}$d.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,a,o,l;s<ib&&(o=n*(Rr+Ir*i+r*(kr+Pr*i))-t,l=Rr+3*Ir*i+r*(7*kr+9*Pr*i),n-=a=o/l,i=n*n,r=i*i*i,!(Ot(a)<Kh));++s);return[pa*e*(Rr+3*Ir*i+r*(7*kr+9*Pr*i))/Mt(n),mn(St(n)/pa)]};function rb(){return da($d).scale(177.158)}function Fd(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}Fd.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,a=s*s;n-=r=(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(Ot(r)>Tt&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function sb(){return da(Fd).scale(175.295)}function ab(e,t){return e.parent===t.parent?1:2}function ob(e){return e.reduce(lb,0)/e.length}function lb(e,t){return e+t.x}function cb(e){return 1+e.reduce(ub,0)}function ub(e,t){return Math.max(e,t.y)}function hb(e){for(var t;t=e.children;)e=t[0];return e}function db(e){for(var t;t=e.children;)e=t[t.length-1];return e}function fb(){var e=ab,t=1,n=1,i=!1;function r(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=ob(f),h.y=cb(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=hb(s),c=db(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(i?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function pb(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function gb(){return this.eachAfter(pb)}function mb(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function vb(e,t){for(var n=this,i=[n],r,s,a=-1;n=i.pop();)if(e.call(t,n,++a,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function yb(e,t){for(var n=this,i=[n],r=[],s,a,o,l=-1;n=i.pop();)if(r.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)i.push(s[a]);for(;n=r.pop();)e.call(t,n,++l,this);return this}function Eb(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function xb(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function bb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Sb(e){for(var t=this,n=_b(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function _b(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function Tb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Ob(){return Array.from(this)}function wb(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Mb(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Cb(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function Nr(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Lb)):t===void 0&&(t=Db);for(var n=new $r(e),i,r=[n],s,a,o,l;i=r.pop();)if((a=t(i.data))&&(l=(a=Array.from(a)).length))for(i.children=a,o=l-1;o>=0;--o)r.push(s=a[o]=new $r(a[o])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(Ib)}function Ab(){return Nr(this).eachBefore(Rb)}function Db(e){return e.children}function Lb(e){return Array.isArray(e)?e[1]:null}function Rb(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ib(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function $r(e){this.data=e,this.depth=this.height=0,this.parent=null}$r.prototype=Nr.prototype={constructor:$r,count:gb,each:mb,eachAfter:yb,eachBefore:vb,find:Eb,sum:xb,sort:bb,path:Sb,ancestors:Tb,descendants:Ob,leaves:wb,links:Mb,copy:Ab,[Symbol.iterator]:Cb};function kb(e){return e==null?null:Ud(e)}function Ud(e){if(typeof e!="function")throw new Error;return e}function Jn(){return 0}function Ai(e){return function(){return e}}const Pb=1664525,Nb=1013904223,Bd=4294967296;function $b(){let e=1;return()=>(e=(Pb*e+Nb)%Bd)/Bd}function Fb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ub(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Bb(e,t){for(var n=0,i=(e=Ub(Array.from(e),t)).length,r=[],s,a;n<i;)s=e[n],a&&Hd(a,s)?++n:(a=Gb(r=Hb(r,s)),n=0);return a}function Hb(e,t){var n,i;if(Cl(t,e))return[t];for(n=0;n<e.length;++n)if(ga(t,e[n])&&Cl(Fr(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(ga(Fr(e[n],e[i]),t)&&ga(Fr(e[n],t),e[i])&&ga(Fr(e[i],t),e[n])&&Cl(Gd(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function ga(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Hd(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Cl(e,t){for(var n=0;n<t.length;++n)if(!Hd(e,t[n]))return!1;return!0}function Gb(e){switch(e.length){case 1:return Vb(e[0]);case 2:return Fr(e[0],e[1]);case 3:return Gd(e[0],e[1],e[2])}}function Vb(e){return{x:e.x,y:e.y,r:e.r}}function Fr(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-i,u=o-r,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(i+a+c/d*u)/2,r:(d+r+o)/2}}function Gd(e,t,n){var i=e.x,r=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=i-a,f=i-c,p=r-o,g=r-u,m=l-s,v=d-s,S=i*i+r*r-s*s,E=S-a*a-o*o+l*l,b=S-c*c-u*u+d*d,x=f*p-h*g,_=(p*b-g*E)/(x*2)-i,C=(g*m-p*v)/x,D=(f*E-h*b)/(x*2)-r,$=(h*v-f*m)/x,P=C*C+$*$-1,w=2*(s+_*C+D*$),H=_*_+D*D-s*s,N=-(Math.abs(P)>1e-6?(w+Math.sqrt(w*w-4*P*H))/(2*P):H/w);return{x:i+_+C*N,y:r+D+$*N,r:N}}function Vd(e,t,n){var i=e.x-t.x,r,s,a=e.y-t.y,o,l,c=i*i+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(r=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-r*r)),n.x=e.x-r*i-o*a,n.y=e.y-r*a+o*i):(r=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-r*r)),n.x=t.x+r*i-o*a,n.y=t.y+r*a+o*i)):(n.x=t.x+n.r,n.y=t.y)}function zd(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Wd(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function ma(e){this._=e,this.next=null,this.previous=null}function zb(e,t){if(!(s=(e=Fb(e)).length))return 0;var n,i,r,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;Vd(i,n,r=e[2]),n=new ma(n),i=new ma(i),r=new ma(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(l=3;l<s;++l){Vd(n._,i._,r=e[l]),r=new ma(r),c=i.next,u=n.previous,d=i._.r,h=n._.r;do if(d<=h){if(zd(c._,r._)){i=c,n.next=i,i.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(zd(u._,r._)){n=u,n.next=i,i.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=Wd(n);(r=r.next)!==i;)(o=Wd(r))<a&&(n=r,a=o);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=Bb(n,t),l=0;l<s;++l)n=e[l],n.x-=r.x,n.y-=r.y;return r.r}function Wb(e){return Math.sqrt(e.value)}function Yb(){var e=null,t=1,n=1,i=Jn;function r(s){const a=$b();return s.x=t/2,s.y=n/2,e?s.eachBefore(Yd(e)).eachAfter(Al(i,.5,a)).eachBefore(qd(1)):s.eachBefore(Yd(Wb)).eachAfter(Al(Jn,1,a)).eachAfter(Al(i,s.r/Math.min(t,n),a)).eachBefore(qd(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=kb(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:Ai(+s),r):i},r}function Yd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Al(e,t,n){return function(i){if(r=i.children){var r,s,a=r.length,o=e(i)*t||0,l;if(o)for(s=0;s<a;++s)r[s].r+=o;if(l=zb(r,n),o)for(s=0;s<a;++s)r[s].r-=o;i.r=l+o}}}function qd(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 qb(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 Xb(e,t,n,i,r){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=r,a.x0=t,a.x1=t+=a.value*c}function Zb(e,t){return e.parent===t.parent?1:2}function Dl(e){var t=e.children;return t?t[0]:e.t}function Ll(e){var t=e.children;return t?t[t.length-1]:e.t}function jb(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function Kb(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Qb(e,t,n){return e.a.parent===t.parent?e.a:n}function va(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}va.prototype=Object.create($r.prototype);function Jb(e){for(var t=new va(e,0),n,i=[t],r,s,a,o;n=i.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)i.push(r=n.children[a]=new va(s[a],a)),r.parent=n;return(t.parent=new va(null,0)).children=[t],t}function tS(){var e=Zb,t=1,n=1,i=null;function r(c){var u=Jb(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),i)c.eachBefore(l);else{var d=c,h=c,f=c;c.eachBefore(function(S){S.x<d.x&&(d=S),S.x>h.x&&(h=S),S.depth>f.depth&&(f=S)});var p=d===h?1:e(d,h)/2,g=p-d.x,m=t/(h.x+p+g),v=n/(f.depth||1);c.eachBefore(function(S){S.x=(S.x+g)*m,S.y=S.depth*v})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){Kb(c);var f=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-f):c.z=f}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,f=c,p=u,g=h.parent.children[0],m=h.m,v=f.m,S=p.m,E=g.m,b;p=Ll(p),h=Dl(h),p&&h;)g=Dl(g),f=Ll(f),f.a=c,b=p.z+S-h.z-m+e(p._,h._),b>0&&(jb(Qb(p,c,d),c,b),m+=b,v+=b),S+=p.m,m+=h.m,E+=g.m,v+=f.m;p&&!Ll(f)&&(f.t=p,f.m+=S-v),h&&!Dl(g)&&(g.t=h,g.m+=m-E,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return r.separation=function(c){return arguments.length?(e=c,r):e},r.size=function(c){return arguments.length?(i=!1,t=+c[0],n=+c[1],r):i?null:[t,n]},r.nodeSize=function(c){return arguments.length?(i=!0,t=+c[0],n=+c[1],r):i?[t,n]:null},r}function eS(e,t,n,i,r){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=i,a.y0=n,a.y1=n+=a.value*c}var nS=(1+Math.sqrt(5))/2;function iS(e,t,n,i,r,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,f,p,g=t.value,m,v,S,E,b,x,_;u<h;){f=r-n,p=s-i;do m=o[d++].value;while(!m&&d<h);for(v=S=m,x=Math.max(p/f,f/p)/(g*e),_=m*m*x,b=Math.max(S/_,_/v);d<h;++d){if(m+=c=o[d].value,c<v&&(v=c),c>S&&(S=c),_=m*m*x,E=Math.max(S/_,_/v),E>b){m-=c;break}b=E}a.push(l={value:m,dice:f<p,children:o.slice(u,d)}),l.dice?Xb(l,n,i,r,g?i+=p*m/g:s):eS(l,n,i,g?n+=f*m/g:r,s),g-=m,u=d}return a}const rS=function e(t){function n(i,r,s,a,o){iS(t,i,r,s,a,o)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(nS);function sS(){var e=rS,t=!1,n=1,i=1,r=[0],s=Jn,a=Jn,o=Jn,l=Jn,c=Jn;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=i,h.eachBefore(d),r=[0],t&&h.eachBefore(qb),h}function d(h){var f=r[h.depth],p=h.x0+f,g=h.y0+f,m=h.x1-f,v=h.y1-f;m<p&&(p=m=(p+m)/2),v<g&&(g=v=(g+v)/2),h.x0=p,h.y0=g,h.x1=m,h.y1=v,h.children&&(f=r[h.depth+1]=s(h)/2,p+=c(h)-f,g+=a(h)-f,m-=o(h)-f,v-=l(h)-f,m<p&&(p=m=(p+m)/2),v<g&&(g=v=(g+v)/2),e(h,p,g,m,v))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],i=+h[1],u):[n,i]},u.tile=function(h){return arguments.length?(e=Ud(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:Ai(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:Ai(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:Ai(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:Ai(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:Ai(+h),u):c},u}function Di(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 ya(){var e=new Bu,t=[],n=[],i=Xd;function r(s){let a=e.get(s);if(a===void 0){if(i!==Xd)return i;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Bu;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return ya(t,n).unknown(i)},Di.apply(r,arguments),r}function Li(){var e=ya().unknown(void 0),t=e.domain,n=e.range,i=0,r=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,f=r<i,p=f?r:i,g=f?i:r;s=(g-p)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),p+=(g-p-s*(h-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var m=p0(h).map(function(v){return p+s*v});return n(f?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([i,r]=h,i=+i,r=+r,d()):[i,r]},e.rangeRound=function(h){return[i,r]=h,i=+i,r=+r,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return Li(t(),[i,r]).round(o).paddingInner(l).paddingOuter(c).align(u)},Di.apply(d(),arguments)}function aS(e){return function(){return e}}function oS(e){return+e}var Zd=[0,1];function Ri(e){return e}function Rl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:aS(isNaN(t)?NaN:.5)}function lS(e,t){var n;return e>t&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function cS(e,t,n){var i=e[0],r=e[1],s=t[0],a=t[1];return r<i?(i=Rl(r,i),s=n(a,s)):(i=Rl(i,r),s=n(s,a)),function(o){return s(i(o))}}function uS(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),s=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=Rl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=To(e,o,1,i)-1;return s[l](r[l](o))}}function Il(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function jd(){var e=Zd,t=Zd,n=Er,i,r,s,a=Ri,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Ri&&(a=lS(e[0],e[h-1])),o=h>2?uS:cS,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(i),t,n)))(i(a(h)))}return d.invert=function(h){return a(r((c||(c=o(t,e.map(i),xe)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,oS),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=xh,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Ri,u()):a!==Ri},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return i=h,r=f,u()}}function Kd(){return jd()(Ri,Ri)}function hS(e,t,n,i){var r=wo(e,t,n),s;switch(i=Tr(i??",f"),i.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=hx(r,a))&&(i.precision=s),jh(i,a)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=dx(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=ux(r))&&(i.precision=s-(i.type==="%")*2);break}}return sl(i)}function Qd(e){var t=e.domain;return e.ticks=function(n){var i=t();return Ds(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return hS(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,a=i[r],o=i[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=r,r=s,s=c);u-- >0;){if(c=yi(a,o,n),c===l)return i[r]=a,i[s]=o,t(i);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 Ve(){var e=Kd();return e.copy=function(){return Il(e,Ve())},Di.apply(e,arguments),Qd(e)}function Jd(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],a;return s<r&&(a=n,n=i,i=a,a=r,r=s,s=a),e[n]=t.floor(r),e[i]=t.ceil(s),e}function tf(e){return Math.log(e)}function ef(e){return Math.exp(e)}function dS(e){return-Math.log(-e)}function fS(e){return-Math.exp(-e)}function pS(e){return isFinite(e)?+("1e"+e):e<0?0:e}function gS(e){return e===10?pS:e===Math.E?Math.exp:t=>Math.pow(e,t)}function mS(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 nf(e){return(t,n)=>-e(-t,n)}function vS(e){const t=e(tf,ef),n=t.domain;let i=10,r,s;function a(){return r=mS(i),s=gS(i),n()[0]<0?(r=nf(r),s=nf(s),e(dS,fS)):e(tf,ef),t}return t.base=function(o){return arguments.length?(i=+o,a()):i},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=r(c),f=r(u),p,g;const m=o==null?10:+o;let v=[];if(!(i%1)&&f-h<m){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(p=1;p<i;++p)if(g=h<0?p/s(-h):p*s(h),!(g<c)){if(g>u)break;v.push(g)}}else for(;h<=f;++h)for(p=i-1;p>=1;--p)if(g=h>0?p/s(-h):p*s(h),!(g<c)){if(g>u)break;v.push(g)}v.length*2<m&&(v=Ds(c,u,m))}else v=Ds(h,f,Math.min(f-h,m)).map(s);return d?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=Tr(l)).precision==null&&(l.trim=!0),l=sl(l)),o===1/0)return l;const c=Math.max(1,i*o/t.ticks().length);return u=>{let d=u/s(Math.round(r(u)));return d*i<i-.5&&(d*=i),d<=c?l(u):""}},t.nice=()=>n(Jd(n(),{floor:o=>s(Math.floor(r(o))),ceil:o=>s(Math.ceil(r(o)))})),t}function rf(){const e=vS(jd()).domain([1,10]);return e.copy=()=>Il(e,rf()).base(e.base()),Di.apply(e,arguments),e}function kl(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function a(l){return l!=null&&l<=l?r[To(i,l,0,n)]:s}function o(){var l=-1;for(i=new Array(n);++l<n;)i[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=(r=Array.from(l)).length-1,o()):r.slice()},a.invertExtent=function(l){var c=r.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,i[0]]:c>=n?[i[n-1],t]:[i[c-1],i[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return i.slice()},a.copy=function(){return kl().domain([e,t]).range(r).unknown(s)},Di.apply(Qd(a),arguments)}const Pl=new Date,Nl=new Date;function Yt(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const a=r(s),o=r.ceil(s);return s-a<o-s?a:o},r.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),r.range=(s,a,o)=>{const l=[];if(s=r.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},r.filter=s=>Yt(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&&(r.count=(s,a)=>(Pl.setTime(+s),Nl.setTime(+a),e(Pl),e(Nl),Math.floor(n(Pl,Nl))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?a=>i(a)%s===0:a=>r.count(0,a)%s===0):r)),r}const Ea=Yt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ea.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Yt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ea),Ea.range;const yn=1e3,Ae=yn*60,En=Ae*60,xn=En*24,$l=xn*7,sf=xn*30,Fl=xn*365,Ii=Yt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getUTCSeconds());Ii.range;const Ul=Yt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yn)},(e,t)=>{e.setTime(+e+t*Ae)},(e,t)=>(t-e)/Ae,e=>e.getMinutes());Ul.range,Yt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ae)},(e,t)=>(t-e)/Ae,e=>e.getUTCMinutes()).range;const Bl=Yt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yn-e.getMinutes()*Ae)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getHours());Bl.range,Yt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getUTCHours()).range;const Ur=Yt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ae)/xn,e=>e.getDate()-1);Ur.range;const Hl=Yt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xn,e=>e.getUTCDate()-1);Hl.range,Yt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xn,e=>Math.floor(e/xn)).range;function ti(e){return Yt(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())*Ae)/$l)}const xa=ti(0),ba=ti(1),yS=ti(2),ES=ti(3),ki=ti(4),xS=ti(5),bS=ti(6);xa.range,ba.range,yS.range,ES.range,ki.range,xS.range,bS.range;function ei(e){return Yt(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)/$l)}const af=ei(0),Sa=ei(1),SS=ei(2),_S=ei(3),Pi=ei(4),TS=ei(5),OS=ei(6);af.range,Sa.range,SS.range,_S.range,Pi.range,TS.range,OS.range;const Gl=Yt(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());Gl.range,Yt(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 bn=Yt(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());bn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yt(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)}),bn.range;const ni=Yt(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());ni.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yt(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)}),ni.range;function wS(e,t,n,i,r,s){const a=[[Ii,1,yn],[Ii,5,5*yn],[Ii,15,15*yn],[Ii,30,30*yn],[s,1,Ae],[s,5,5*Ae],[s,15,15*Ae],[s,30,30*Ae],[r,1,En],[r,3,3*En],[r,6,6*En],[r,12,12*En],[i,1,xn],[i,2,2*xn],[n,1,$l],[t,1,sf],[t,3,3*sf],[e,1,Fl]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const f=d&&typeof d.range=="function"?d:l(c,u,d),p=f?f.range(c,+u+1):[];return h?p.reverse():p}function l(c,u,d){const h=Math.abs(u-c)/d,f=_o(([,,m])=>m).right(a,h);if(f===a.length)return e.every(wo(c/Fl,u/Fl,d));if(f===0)return Ea.every(Math.max(wo(c,u,d),1));const[p,g]=a[h/a[f-1][2]<a[f][2]/h?f-1:f];return p.every(g)}return[o,l]}const[MS,CS]=wS(bn,Gl,xa,Ur,Bl,Ul);function Vl(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 zl(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 Br(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function AS(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=Hr(r),u=Gr(r),d=Hr(s),h=Gr(s),f=Hr(a),p=Gr(a),g=Hr(o),m=Gr(o),v=Hr(l),S=Gr(l),E={a:U,A:R,b:B,B:tt,c:null,d:df,e:df,f:QS,g:l_,G:u_,H:ZS,I:jS,j:KS,L:ff,m:JS,M:t_,p:Z,q:Y,Q:Ef,s:xf,S:e_,u:n_,U:i_,V:r_,w:s_,W:a_,x:null,X:null,y:o_,Y:c_,Z:h_,"%":yf},b={a:Q,A:ht,b:et,B:K,c:null,d:gf,e:gf,f:g_,g:O_,G:M_,H:d_,I:f_,j:p_,L:mf,m:m_,M:v_,p:nt,q:ct,Q:Ef,s:xf,S:y_,u:E_,U:x_,V:b_,w:S_,W:__,x:null,X:null,y:T_,Y:w_,Z:C_,"%":yf},x={a:P,A:w,b:H,B:N,c:M,d:uf,e:uf,f:WS,g:cf,G:lf,H:hf,I:hf,j:HS,L:zS,m:BS,M:GS,p:$,q:US,Q:qS,s:XS,S:VS,u:kS,U:PS,V:NS,w:IS,W:$S,x:O,X:F,y:cf,Y:lf,Z:FS,"%":YS};E.x=_(n,E),E.X=_(i,E),E.c=_(t,E),b.x=_(n,b),b.X=_(i,b),b.c=_(t,b);function _(W,j){return function(J){var L=[],G=-1,V=0,yt=W.length,Ut,at,bt;for(J instanceof Date||(J=new Date(+J));++G<yt;)W.charCodeAt(G)===37&&(L.push(W.slice(V,G)),(at=of[Ut=W.charAt(++G)])!=null?Ut=W.charAt(++G):at=Ut==="e"?" ":"0",(bt=j[Ut])&&(Ut=bt(J,at)),L.push(Ut),V=G+1);return L.push(W.slice(V,G)),L.join("")}}function C(W,j){return function(J){var L=Br(1900,void 0,1),G=D(L,W,J+="",0),V,yt;if(G!=J.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(L.s*1e3+("L"in L?L.L:0));if(j&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+L.p*12),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(V=zl(Br(L.y,0,1)),yt=V.getUTCDay(),V=yt>4||yt===0?Sa.ceil(V):Sa(V),V=Hl.offset(V,(L.V-1)*7),L.y=V.getUTCFullYear(),L.m=V.getUTCMonth(),L.d=V.getUTCDate()+(L.w+6)%7):(V=Vl(Br(L.y,0,1)),yt=V.getDay(),V=yt>4||yt===0?ba.ceil(V):ba(V),V=Ur.offset(V,(L.V-1)*7),L.y=V.getFullYear(),L.m=V.getMonth(),L.d=V.getDate()+(L.w+6)%7)}else("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),yt="Z"in L?zl(Br(L.y,0,1)).getUTCDay():Vl(Br(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+L.W*7-(yt+5)%7:L.w+L.U*7-(yt+6)%7);return"Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,zl(L)):Vl(L)}}function D(W,j,J,L){for(var G=0,V=j.length,yt=J.length,Ut,at;G<V;){if(L>=yt)return-1;if(Ut=j.charCodeAt(G++),Ut===37){if(Ut=j.charAt(G++),at=x[Ut in of?j.charAt(G++):Ut],!at||(L=at(W,J,L))<0)return-1}else if(Ut!=J.charCodeAt(L++))return-1}return L}function $(W,j,J){var L=c.exec(j.slice(J));return L?(W.p=u.get(L[0].toLowerCase()),J+L[0].length):-1}function P(W,j,J){var L=f.exec(j.slice(J));return L?(W.w=p.get(L[0].toLowerCase()),J+L[0].length):-1}function w(W,j,J){var L=d.exec(j.slice(J));return L?(W.w=h.get(L[0].toLowerCase()),J+L[0].length):-1}function H(W,j,J){var L=v.exec(j.slice(J));return L?(W.m=S.get(L[0].toLowerCase()),J+L[0].length):-1}function N(W,j,J){var L=g.exec(j.slice(J));return L?(W.m=m.get(L[0].toLowerCase()),J+L[0].length):-1}function M(W,j,J){return D(W,t,j,J)}function O(W,j,J){return D(W,n,j,J)}function F(W,j,J){return D(W,i,j,J)}function U(W){return a[W.getDay()]}function R(W){return s[W.getDay()]}function B(W){return l[W.getMonth()]}function tt(W){return o[W.getMonth()]}function Z(W){return r[+(W.getHours()>=12)]}function Y(W){return 1+~~(W.getMonth()/3)}function Q(W){return a[W.getUTCDay()]}function ht(W){return s[W.getUTCDay()]}function et(W){return l[W.getUTCMonth()]}function K(W){return o[W.getUTCMonth()]}function nt(W){return r[+(W.getUTCHours()>=12)]}function ct(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var j=_(W+="",E);return j.toString=function(){return W},j},parse:function(W){var j=C(W+="",!1);return j.toString=function(){return W},j},utcFormat:function(W){var j=_(W+="",b);return j.toString=function(){return W},j},utcParse:function(W){var j=C(W+="",!0);return j.toString=function(){return W},j}}}var of={"-":"",_:" ",0:"0"},Xt=/^\s*\d+/,DS=/^%/,LS=/[\\^$*+?|[\]().{}]/g;function xt(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function RS(e){return e.replace(LS,"\\$&")}function Hr(e){return new RegExp("^(?:"+e.map(RS).join("|")+")","i")}function Gr(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function IS(e,t,n){var i=Xt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function kS(e,t,n){var i=Xt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function PS(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function NS(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function $S(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function lf(e,t,n){var i=Xt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function cf(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function FS(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function US(e,t,n){var i=Xt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function BS(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function uf(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function HS(e,t,n){var i=Xt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function hf(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function GS(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function VS(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function zS(e,t,n){var i=Xt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function WS(e,t,n){var i=Xt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function YS(e,t,n){var i=DS.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function qS(e,t,n){var i=Xt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function XS(e,t,n){var i=Xt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function df(e,t){return xt(e.getDate(),t,2)}function ZS(e,t){return xt(e.getHours(),t,2)}function jS(e,t){return xt(e.getHours()%12||12,t,2)}function KS(e,t){return xt(1+Ur.count(bn(e),e),t,3)}function ff(e,t){return xt(e.getMilliseconds(),t,3)}function QS(e,t){return ff(e,t)+"000"}function JS(e,t){return xt(e.getMonth()+1,t,2)}function t_(e,t){return xt(e.getMinutes(),t,2)}function e_(e,t){return xt(e.getSeconds(),t,2)}function n_(e){var t=e.getDay();return t===0?7:t}function i_(e,t){return xt(xa.count(bn(e)-1,e),t,2)}function pf(e){var t=e.getDay();return t>=4||t===0?ki(e):ki.ceil(e)}function r_(e,t){return e=pf(e),xt(ki.count(bn(e),e)+(bn(e).getDay()===4),t,2)}function s_(e){return e.getDay()}function a_(e,t){return xt(ba.count(bn(e)-1,e),t,2)}function o_(e,t){return xt(e.getFullYear()%100,t,2)}function l_(e,t){return e=pf(e),xt(e.getFullYear()%100,t,2)}function c_(e,t){return xt(e.getFullYear()%1e4,t,4)}function u_(e,t){var n=e.getDay();return e=n>=4||n===0?ki(e):ki.ceil(e),xt(e.getFullYear()%1e4,t,4)}function h_(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+xt(t/60|0,"0",2)+xt(t%60,"0",2)}function gf(e,t){return xt(e.getUTCDate(),t,2)}function d_(e,t){return xt(e.getUTCHours(),t,2)}function f_(e,t){return xt(e.getUTCHours()%12||12,t,2)}function p_(e,t){return xt(1+Hl.count(ni(e),e),t,3)}function mf(e,t){return xt(e.getUTCMilliseconds(),t,3)}function g_(e,t){return mf(e,t)+"000"}function m_(e,t){return xt(e.getUTCMonth()+1,t,2)}function v_(e,t){return xt(e.getUTCMinutes(),t,2)}function y_(e,t){return xt(e.getUTCSeconds(),t,2)}function E_(e){var t=e.getUTCDay();return t===0?7:t}function x_(e,t){return xt(af.count(ni(e)-1,e),t,2)}function vf(e){var t=e.getUTCDay();return t>=4||t===0?Pi(e):Pi.ceil(e)}function b_(e,t){return e=vf(e),xt(Pi.count(ni(e),e)+(ni(e).getUTCDay()===4),t,2)}function S_(e){return e.getUTCDay()}function __(e,t){return xt(Sa.count(ni(e)-1,e),t,2)}function T_(e,t){return xt(e.getUTCFullYear()%100,t,2)}function O_(e,t){return e=vf(e),xt(e.getUTCFullYear()%100,t,2)}function w_(e,t){return xt(e.getUTCFullYear()%1e4,t,4)}function M_(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Pi(e):Pi.ceil(e),xt(e.getUTCFullYear()%1e4,t,4)}function C_(){return"+0000"}function yf(){return"%"}function Ef(e){return+e}function xf(e){return Math.floor(+e/1e3)}var Ni,bf;A_({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 A_(e){return Ni=AS(e),bf=Ni.format,Ni.parse,Ni.utcFormat,Ni.utcParse,Ni}function D_(e){return new Date(e)}function L_(e){return e instanceof Date?+e:+new Date(+e)}function Sf(e,t,n,i,r,s,a,o,l,c){var u=Kd(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),S=c("%b %d"),E=c("%B"),b=c("%Y");function x(_){return(l(_)<_?f:o(_)<_?p:a(_)<_?g:s(_)<_?m:i(_)<_?r(_)<_?v:S:n(_)<_?E:b)(_)}return u.invert=function(_){return new Date(d(_))},u.domain=function(_){return arguments.length?h(Array.from(_,L_)):h().map(D_)},u.ticks=function(_){var C=h();return e(C[0],C[C.length-1],_??10)},u.tickFormat=function(_,C){return C==null?x:c(C)},u.nice=function(_){var C=h();return(!_||typeof _.range!="function")&&(_=t(C[0],C[C.length-1],_??10)),_?h(Jd(C,_)):u},u.copy=function(){return Il(u,Sf(e,t,n,i,r,s,a,o,l,c))},u}function _f(){return Di.apply(Sf(MS,CS,bn,Gl,xa,Ur,Bl,Ul,Ii,bf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function pt(e){return function(){return e}}const Tf=Math.abs,te=Math.atan2,ii=Math.cos,R_=Math.max,Wl=Math.min,tn=Math.sin,$i=Math.sqrt,ee=1e-12,Vr=Math.PI,_a=Vr/2,Ta=2*Vr;function I_(e){return e>1?0:e<-1?Vr:Math.acos(e)}function Of(e){return e>=1?_a:e<=-1?-_a:Math.asin(e)}function Oa(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new ex(t)}function k_(e){return e.innerRadius}function P_(e){return e.outerRadius}function N_(e){return e.startAngle}function $_(e){return e.endAngle}function F_(e){return e&&e.padAngle}function U_(e,t,n,i,r,s,a,o){var l=n-e,c=i-t,u=a-r,d=o-s,h=d*l-u*c;if(!(h*h<ee))return h=(u*(t-s)-d*(e-r))/h,[e+h*l,t+h*c]}function wa(e,t,n,i,r,s,a){var o=e-n,l=t-i,c=(a?s:-s)/$i(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,g=i+d,m=(h+p)/2,v=(f+g)/2,S=p-h,E=g-f,b=S*S+E*E,x=r-s,_=h*g-p*f,C=(E<0?-1:1)*$i(R_(0,x*x*b-_*_)),D=(_*E-S*C)/b,$=(-_*S-E*C)/b,P=(_*E+S*C)/b,w=(-_*S+E*C)/b,H=D-m,N=$-v,M=P-m,O=w-v;return H*H+N*N>M*M+O*O&&(D=P,$=w),{cx:D,cy:$,x01:-u,y01:-d,x11:D*(r/x-1),y11:$*(r/x-1)}}function zr(){var e=k_,t=P_,n=pt(0),i=null,r=N_,s=$_,a=F_,o=null,l=Oa(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=r.apply(this,arguments)-_a,g=s.apply(this,arguments)-_a,m=Tf(g-p),v=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>ee))o.moveTo(0,0);else if(m>Ta-ee)o.moveTo(f*ii(p),f*tn(p)),o.arc(0,0,f,p,g,!v),h>ee&&(o.moveTo(h*ii(g),h*tn(g)),o.arc(0,0,h,g,p,v));else{var S=p,E=g,b=p,x=g,_=m,C=m,D=a.apply(this,arguments)/2,$=D>ee&&(i?+i.apply(this,arguments):$i(h*h+f*f)),P=Wl(Tf(f-h)/2,+n.apply(this,arguments)),w=P,H=P,N,M;if($>ee){var O=Of($/h*tn(D)),F=Of($/f*tn(D));(_-=O*2)>ee?(O*=v?1:-1,b+=O,x-=O):(_=0,b=x=(p+g)/2),(C-=F*2)>ee?(F*=v?1:-1,S+=F,E-=F):(C=0,S=E=(p+g)/2)}var U=f*ii(S),R=f*tn(S),B=h*ii(x),tt=h*tn(x);if(P>ee){var Z=f*ii(E),Y=f*tn(E),Q=h*ii(b),ht=h*tn(b),et;if(m<Vr)if(et=U_(U,R,Q,ht,Z,Y,B,tt)){var K=U-et[0],nt=R-et[1],ct=Z-et[0],W=Y-et[1],j=1/tn(I_((K*ct+nt*W)/($i(K*K+nt*nt)*$i(ct*ct+W*W)))/2),J=$i(et[0]*et[0]+et[1]*et[1]);w=Wl(P,(h-J)/(j-1)),H=Wl(P,(f-J)/(j+1))}else w=H=0}C>ee?H>ee?(N=wa(Q,ht,U,R,f,H,v),M=wa(Z,Y,B,tt,f,H,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),H<P?o.arc(N.cx,N.cy,H,te(N.y01,N.x01),te(M.y01,M.x01),!v):(o.arc(N.cx,N.cy,H,te(N.y01,N.x01),te(N.y11,N.x11),!v),o.arc(0,0,f,te(N.cy+N.y11,N.cx+N.x11),te(M.cy+M.y11,M.cx+M.x11),!v),o.arc(M.cx,M.cy,H,te(M.y11,M.x11),te(M.y01,M.x01),!v))):(o.moveTo(U,R),o.arc(0,0,f,S,E,!v)):o.moveTo(U,R),!(h>ee)||!(_>ee)?o.lineTo(B,tt):w>ee?(N=wa(B,tt,Z,Y,h,-w,v),M=wa(U,R,Q,ht,h,-w,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),w<P?o.arc(N.cx,N.cy,w,te(N.y01,N.x01),te(M.y01,M.x01),!v):(o.arc(N.cx,N.cy,w,te(N.y01,N.x01),te(N.y11,N.x11),!v),o.arc(0,0,h,te(N.cy+N.y11,N.cx+N.x11),te(M.cy+M.y11,M.cx+M.x11),v),o.arc(M.cx,M.cy,w,te(M.y11,M.x11),te(M.y01,M.x01),!v))):o.arc(0,0,h,x,b,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,d=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-Vr/2;return[ii(d)*u,tn(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:pt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:pt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:pt(+u),c):n},c.padRadius=function(u){return arguments.length?(i=u==null?null:typeof u=="function"?u:pt(+u),c):i},c.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:pt(+u),c):r},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:pt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:pt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var B_=Array.prototype.slice;function Ma(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function wf(e){this._context=e}wf.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 Ca(e){return new wf(e)}function Yl(e){return e[0]}function ql(e){return e[1]}function Wr(e,t){var n=pt(!0),i=null,r=Ca,s=null,a=Oa(o);e=typeof e=="function"?e:e===void 0?Yl:pt(e),t=typeof t=="function"?t:t===void 0?ql:pt(t);function o(l){var c,u=(l=Ma(l)).length,d,h=!1,f;for(i==null&&(s=r(f=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:pt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:pt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:pt(!!l),o):n},o.curve=function(l){return arguments.length?(r=l,i!=null&&(s=r(i)),o):r},o.context=function(l){return arguments.length?(l==null?i=s=null:s=r(i=l),o):i},o}function Xl(e,t,n){var i=null,r=pt(!0),s=null,a=Ca,o=null,l=Oa(c);e=typeof e=="function"?e:e===void 0?Yl:pt(+e),t=typeof t=="function"?t:pt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?ql:pt(+n);function c(d){var h,f,p,g=(d=Ma(d)).length,m,v=!1,S,E=new Array(g),b=new Array(g);for(s==null&&(o=a(S=l())),h=0;h<=g;++h){if(!(h<g&&r(m=d[h],h,d))===v)if(v=!v)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(E[p],b[p]);o.lineEnd(),o.areaEnd()}v&&(E[h]=+e(m,h,d),b[h]=+t(m,h,d),o.point(i?+i(m,h,d):E[h],n?+n(m,h,d):b[h]))}if(S)return o=null,S+""||null}function u(){return Wr().defined(r).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),i=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),c):e},c.x1=function(d){return arguments.length?(i=d==null?null:typeof d=="function"?d:pt(+d),c):i},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:pt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(i).y(t)},c.defined=function(d){return arguments.length?(r=typeof d=="function"?d:pt(!!d),c):r},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function H_(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function G_(e){return e}function V_(){var e=G_,t=H_,n=null,i=pt(0),r=pt(Ta),s=pt(0);function a(o){var l,c=(o=Ma(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),g=+i.apply(this,arguments),m=Math.min(Ta,Math.max(-Ta,r.apply(this,arguments)-g)),v,S=Math.min(Math.abs(m)/c,s.apply(this,arguments)),E=S*(m<0?-1:1),b;for(l=0;l<c;++l)(b=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=b);for(t!=null?f.sort(function(x,_){return t(p[x],p[_])}):n!=null&&f.sort(function(x,_){return n(o[x],o[_])}),l=0,d=h?(m-c*E)/h:0;l<c;++l,g=v)u=f[l],b=p[u],v=g+(b>0?b*d:0)+E,p[u]={data:o[u],index:l,value:b,startAngle:g,endAngle:v,padAngle:S};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:pt(+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?(i=typeof o=="function"?o:pt(+o),a):i},a.endAngle=function(o){return arguments.length?(r=typeof o=="function"?o:pt(+o),a):r},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:pt(+o),a):s},a}var z_=Cf(Ca);function Mf(e){this._curve=e}Mf.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 Cf(e){function t(n){return new Mf(e(n))}return t._curve=e,t}function W_(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(Cf(n)):t()._curve},e}function Y_(){return W_(Wr().curve(z_))}class q_{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 X_(e){return new q_(e,!0)}function Z_(e){return e.source}function j_(e){return e.target}function K_(e){let t=Z_,n=j_,i=Yl,r=ql,s=null,a=null,o=Oa(l);function l(){let c;const u=B_.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+i.apply(this,u),+r.apply(this,u)),u[0]=h,a.point(+i.apply(this,u),+r.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?(i=typeof c=="function"?c:pt(+c),l):i},l.y=function(c){return arguments.length?(r=typeof c=="function"?c:pt(+c),l):r},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function Q_(){return K_(X_)}function Fn(){}function Aa(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 Da(e){this._context=e}Da.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:Aa(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:Aa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function J_(e){return new Da(e)}function Af(e){this._context=e}Af.prototype={areaStart:Fn,areaEnd:Fn,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:Aa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tT(e){return new Af(e)}function Df(e){this._context=e}Df.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,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Aa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function eT(e){return new Df(e)}function Lf(e,t){this._basis=new Da(e),this._beta=t}Lf.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 i=e[0],r=t[0],s=e[n]-i,a=t[n]-r,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(i+l*s),this._beta*t[o]+(1-this._beta)*(r+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const nT=function e(t){function n(i){return t===1?new Da(i):new Lf(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function La(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 Zl(e,t){this._context=e,this._k=(1-t)/6}Zl.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:La(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:La(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 iT=function e(t){function n(i){return new Zl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function jl(e,t){this._context=e,this._k=(1-t)/6}jl.prototype={areaStart:Fn,areaEnd:Fn,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:La(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rT=function e(t){function n(i){return new jl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Kl(e,t){this._context=e,this._k=(1-t)/6}Kl.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:La(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 sT=function e(t){function n(i){return new Kl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Ql(e,t,n){var i=e._x1,r=e._y1,s=e._x2,a=e._y2;if(e._l01_a>ee){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);i=(i*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ee){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(i,r,s,a,e._x2,e._y2)}function Rf(e,t){this._context=e,this._alpha=t}Rf.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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ql(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const aT=function e(t){function n(i){return t?new Rf(i,t):new Zl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function If(e,t){this._context=e,this._alpha=t}If.prototype={areaStart:Fn,areaEnd:Fn,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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ql(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 oT=function e(t){function n(i){return t?new If(i,t):new jl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function kf(e,t){this._context=e,this._alpha=t}kf.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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ql(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 lT=function e(t){function n(i){return t?new kf(i,t):new Kl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Pf(e){this._context=e}Pf.prototype={areaStart:Fn,areaEnd:Fn,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 Nf(e){return new Pf(e)}function $f(e){return e<0?-1:1}function Ff(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),o=(s*r+a*i)/(i+r);return($f(s)+$f(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Uf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Jl(e,t,n){var i=e._x0,r=e._y0,s=e._x1,a=e._y1,o=(s-i)/3;e._context.bezierCurveTo(i+o,r+o*t,s-o,a-o*n,s,a)}function Ra(e){this._context=e}Ra.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:Jl(this,this._t0,Uf(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,Jl(this,Uf(this,n=Ff(this,e,t)),n);break;default:Jl(this,this._t0,n=Ff(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Bf(e){this._context=new Hf(e)}(Bf.prototype=Object.create(Ra.prototype)).point=function(e,t){Ra.prototype.point.call(this,t,e)};function Hf(e){this._context=e}Hf.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,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function cT(e){return new Ra(e)}function uT(e){return new Bf(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 i=Vf(e),r=Vf(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[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 Vf(e){var t,n=e.length-1,i,r=new Array(n),s=new Array(n),a=new Array(n);for(r[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(r[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)r[t]=(a[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function hT(e){return new Gf(e)}function Ia(e,t){this._context=e,this._t=t}Ia.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 dT(e){return new Ia(e,.5)}function fT(e){return new Ia(e,0)}function pT(e){return new Ia(e,1)}function zf(e,t){if((a=e.length)>1)for(var n=1,i,r,s=e[t[0]],a,o=s.length;n<a;++n)for(r=s,s=e[t[n]],i=0;i<o;++i)s[i][1]+=s[i][0]=isNaN(r[i][1])?r[i][0]:r[i][1]}function Wf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function gT(e,t){return e[t]}function mT(e){const t=[];return t.key=e,t}function tc(){var e=pt([]),t=Wf,n=zf,i=gT;function r(s){var a=Array.from(e.apply(this,arguments),mT),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+i(d,a[o].key,c,s)]).data=d;for(o=0,u=Ma(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return r.keys=function(s){return arguments.length?(e=typeof s=="function"?s:pt(Array.from(s)),r):e},r.value=function(s){return arguments.length?(i=typeof s=="function"?s:pt(+s),r):i},r.order=function(s){return arguments.length?(t=s==null?Wf:typeof s=="function"?s:pt(Array.from(s)),r):t},r.offset=function(s){return arguments.length?(n=s??zf,r):n},r}function vT(e,t){if((l=e.length)>0)for(var n,i=0,r,s,a,o,l,c=e[t[0]].length;i<c;++i)for(a=o=0,n=0;n<l;++n)(s=(r=e[t[n]][i])[1]-r[0])>0?(r[0]=a,r[1]=a+=s):s<0?(r[1]=o,r[0]=o+=s):(r[0]=0,r[1]=s)}function Yr(e,t,n){this.k=e,this.x=t,this.y=n}Yr.prototype={constructor:Yr,scale:function(e){return e===1?this:new Yr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Yr(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+")"}},Yr.prototype;var Yf=typeof global=="object"&&global&&global.Object===Object&&global,yT=typeof self=="object"&&self&&self.Object===Object&&self,ze=Yf||yT||Function("return this")(),De=ze.Symbol,qf=Object.prototype,ET=qf.hasOwnProperty,xT=qf.toString,qr=De?De.toStringTag:void 0;function bT(e){var t=ET.call(e,qr),n=e[qr];try{e[qr]=void 0;var i=!0}catch{}var r=xT.call(e);return i&&(t?e[qr]=n:delete e[qr]),r}var ST=Object.prototype,_T=ST.toString;function TT(e){return _T.call(e)}var OT="[object Null]",wT="[object Undefined]",Xf=De?De.toStringTag:void 0;function ri(e){return e==null?e===void 0?wT:OT:Xf&&Xf in Object(e)?bT(e):TT(e)}function en(e){return e!=null&&typeof e=="object"}var MT="[object Symbol]";function ka(e){return typeof e=="symbol"||en(e)&&ri(e)==MT}function ec(e,t){for(var n=-1,i=e==null?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}var Zt=Array.isArray,Zf=De?De.prototype:void 0,jf=Zf?Zf.toString:void 0;function Kf(e){if(typeof e=="string")return e;if(Zt(e))return ec(e,Kf)+"";if(ka(e))return jf?jf.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var CT=/\s/;function AT(e){for(var t=e.length;t--&&CT.test(e.charAt(t)););return t}var DT=/^\s+/;function LT(e){return e&&e.slice(0,AT(e)+1).replace(DT,"")}function Le(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Qf=NaN,RT=/^[-+]0x[0-9a-f]+$/i,IT=/^0b[01]+$/i,kT=/^0o[0-7]+$/i,PT=parseInt;function Fi(e){if(typeof e=="number")return e;if(ka(e))return Qf;if(Le(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Le(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=LT(e);var n=IT.test(e);return n||kT.test(e)?PT(e.slice(2),n?2:8):RT.test(e)?Qf:+e}function nc(e){return e}var NT="[object AsyncFunction]",$T="[object Function]",FT="[object GeneratorFunction]",UT="[object Proxy]";function ic(e){if(!Le(e))return!1;var t=ri(e);return t==$T||t==FT||t==NT||t==UT}var rc=ze["__core-js_shared__"],Jf=function(){var e=/[^.]+$/.exec(rc&&rc.keys&&rc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function BT(e){return!!Jf&&Jf in e}var HT=Function.prototype,GT=HT.toString;function si(e){if(e!=null){try{return GT.call(e)}catch{}try{return e+""}catch{}}return""}var VT=/[\\^$.*+?()[\]{}|]/g,zT=/^\[object .+?Constructor\]$/,WT=Function.prototype,YT=Object.prototype,qT=WT.toString,XT=YT.hasOwnProperty,ZT=RegExp("^"+qT.call(XT).replace(VT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jT(e){if(!Le(e)||BT(e))return!1;var t=ic(e)?ZT:zT;return t.test(si(e))}function KT(e,t){return e?.[t]}function ai(e,t){var n=KT(e,t);return jT(n)?n:void 0}var sc=ai(ze,"WeakMap"),tp=Object.create,QT=function(){function e(){}return function(t){if(!Le(t))return{};if(tp)return tp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function JT(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 tO(){}function ep(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}var eO=800,nO=16,iO=Date.now;function rO(e){var t=0,n=0;return function(){var i=iO(),r=nO-(i-n);if(n=i,r>0){if(++t>=eO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function sO(e){return function(){return e}}var Pa=function(){try{var e=ai(Object,"defineProperty");return e({},"",{}),e}catch{}}(),aO=Pa?function(e,t){return Pa(e,"toString",{configurable:!0,enumerable:!1,value:sO(t),writable:!0})}:nc,np=rO(aO);function oO(e,t){for(var n=-1,i=e==null?0:e.length;++n<i&&t(e[n],n,e)!==!1;);return e}function lO(e,t,n,i){for(var r=e.length,s=n+-1;++s<r;)if(t(e[s],s,e))return s;return-1}function cO(e){return e!==e}function uO(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}function hO(e,t,n){return t===t?uO(e,t,n):lO(e,cO,n)}function dO(e,t){var n=e==null?0:e.length;return!!n&&hO(e,t,0)>-1}var fO=9007199254740991,pO=/^(?:0|[1-9]\d*)$/;function ac(e,t){var n=typeof e;return t=t??fO,!!t&&(n=="number"||n!="symbol"&&pO.test(e))&&e>-1&&e%1==0&&e<t}function Xr(e,t,n){t=="__proto__"&&Pa?Pa(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Zr(e,t){return e===t||e!==e&&t!==t}var gO=Object.prototype,mO=gO.hasOwnProperty;function ip(e,t,n){var i=e[t];(!(mO.call(e,t)&&Zr(i,n))||n===void 0&&!(t in e))&&Xr(e,t,n)}function Ui(e,t,n,i){var r=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),r?Xr(n,o,l):ip(n,o,l)}return n}var rp=Math.max;function sp(e,t,n){return t=rp(t===void 0?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=rp(i.length-t,0),a=Array(s);++r<s;)a[r]=i[t+r];r=-1;for(var o=Array(t+1);++r<t;)o[r]=i[r];return o[t]=n(a),JT(e,this,o)}}function oc(e,t){return np(sp(e,t,nc),e+"")}var vO=9007199254740991;function lc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=vO}function oi(e){return e!=null&&lc(e.length)&&!ic(e)}function yO(e,t,n){if(!Le(n))return!1;var i=typeof t;return(i=="number"?oi(n)&&ac(t,n.length):i=="string"&&t in n)?Zr(n[t],e):!1}function EO(e){return oc(function(t,n){var i=-1,r=n.length,s=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(r--,s):void 0,a&&yO(n[0],n[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var o=n[i];o&&e(t,o,i,s)}return t})}var xO=Object.prototype;function Na(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||xO;return e===n}function bO(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}var SO="[object Arguments]";function ap(e){return en(e)&&ri(e)==SO}var op=Object.prototype,_O=op.hasOwnProperty,TO=op.propertyIsEnumerable,Bi=ap(function(){return arguments}())?ap:function(e){return en(e)&&_O.call(e,"callee")&&!TO.call(e,"callee")};function OO(){return!1}var lp=typeof q=="object"&&q&&!q.nodeType&&q,cp=lp&&typeof module=="object"&&module&&!module.nodeType&&module,wO=cp&&cp.exports===lp,up=wO?ze.Buffer:void 0,MO=up?up.isBuffer:void 0,Hi=MO||OO,CO="[object Arguments]",AO="[object Array]",DO="[object Boolean]",LO="[object Date]",RO="[object Error]",IO="[object Function]",kO="[object Map]",PO="[object Number]",NO="[object Object]",$O="[object RegExp]",FO="[object Set]",UO="[object String]",BO="[object WeakMap]",HO="[object ArrayBuffer]",GO="[object DataView]",VO="[object Float32Array]",zO="[object Float64Array]",WO="[object Int8Array]",YO="[object Int16Array]",qO="[object Int32Array]",XO="[object Uint8Array]",ZO="[object Uint8ClampedArray]",jO="[object Uint16Array]",KO="[object Uint32Array]",Rt={};Rt[VO]=Rt[zO]=Rt[WO]=Rt[YO]=Rt[qO]=Rt[XO]=Rt[ZO]=Rt[jO]=Rt[KO]=!0,Rt[CO]=Rt[AO]=Rt[HO]=Rt[DO]=Rt[GO]=Rt[LO]=Rt[RO]=Rt[IO]=Rt[kO]=Rt[PO]=Rt[NO]=Rt[$O]=Rt[FO]=Rt[UO]=Rt[BO]=!1;function QO(e){return en(e)&&lc(e.length)&&!!Rt[ri(e)]}function cc(e){return function(t){return e(t)}}var hp=typeof q=="object"&&q&&!q.nodeType&&q,jr=hp&&typeof module=="object"&&module&&!module.nodeType&&module,JO=jr&&jr.exports===hp,uc=JO&&Yf.process,Gi=function(){try{var e=jr&&jr.require&&jr.require("util").types;return e||uc&&uc.binding&&uc.binding("util")}catch{}}(),dp=Gi&&Gi.isTypedArray,$a=dp?cc(dp):QO,tw=Object.prototype,ew=tw.hasOwnProperty;function fp(e,t){var n=Zt(e),i=!n&&Bi(e),r=!n&&!i&&Hi(e),s=!n&&!i&&!r&&$a(e),a=n||i||r||s,o=a?bO(e.length,String):[],l=o.length;for(var c in e)(t||ew.call(e,c))&&!(a&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ac(c,l)))&&o.push(c);return o}function pp(e,t){return function(n){return e(t(n))}}var nw=pp(Object.keys,Object),iw=Object.prototype,rw=iw.hasOwnProperty;function gp(e){if(!Na(e))return nw(e);var t=[];for(var n in Object(e))rw.call(e,n)&&n!="constructor"&&t.push(n);return t}function Kr(e){return oi(e)?fp(e):gp(e)}function sw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var aw=Object.prototype,ow=aw.hasOwnProperty;function lw(e){if(!Le(e))return sw(e);var t=Na(e),n=[];for(var i in e)i=="constructor"&&(t||!ow.call(e,i))||n.push(i);return n}function Qr(e){return oi(e)?fp(e,!0):lw(e)}var cw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uw=/^\w*$/;function hc(e,t){if(Zt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ka(e)?!0:uw.test(e)||!cw.test(e)||t!=null&&e in Object(t)}var Jr=ai(Object,"create");function hw(){this.__data__=Jr?Jr(null):{},this.size=0}function dw(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var fw="__lodash_hash_undefined__",pw=Object.prototype,gw=pw.hasOwnProperty;function mw(e){var t=this.__data__;if(Jr){var n=t[e];return n===fw?void 0:n}return gw.call(t,e)?t[e]:void 0}var vw=Object.prototype,yw=vw.hasOwnProperty;function Ew(e){var t=this.__data__;return Jr?t[e]!==void 0:yw.call(t,e)}var xw="__lodash_hash_undefined__";function bw(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Jr&&t===void 0?xw:t,this}function li(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}li.prototype.clear=hw,li.prototype.delete=dw,li.prototype.get=mw,li.prototype.has=Ew,li.prototype.set=bw;function Sw(){this.__data__=[],this.size=0}function Fa(e,t){for(var n=e.length;n--;)if(Zr(e[n][0],t))return n;return-1}var _w=Array.prototype,Tw=_w.splice;function Ow(e){var t=this.__data__,n=Fa(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Tw.call(t,n,1),--this.size,!0}function ww(e){var t=this.__data__,n=Fa(t,e);return n<0?void 0:t[n][1]}function Mw(e){return Fa(this.__data__,e)>-1}function Cw(e,t){var n=this.__data__,i=Fa(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function Sn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Sn.prototype.clear=Sw,Sn.prototype.delete=Ow,Sn.prototype.get=ww,Sn.prototype.has=Mw,Sn.prototype.set=Cw;var ts=ai(ze,"Map");function Aw(){this.size=0,this.__data__={hash:new li,map:new(ts||Sn),string:new li}}function Dw(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ua(e,t){var n=e.__data__;return Dw(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Lw(e){var t=Ua(this,e).delete(e);return this.size-=t?1:0,t}function Rw(e){return Ua(this,e).get(e)}function Iw(e){return Ua(this,e).has(e)}function kw(e,t){var n=Ua(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function _n(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}_n.prototype.clear=Aw,_n.prototype.delete=Lw,_n.prototype.get=Rw,_n.prototype.has=Iw,_n.prototype.set=kw;var Pw="Expected a function";function dc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Pw);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var a=e.apply(this,i);return n.cache=s.set(r,a)||s,a};return n.cache=new(dc.Cache||_n),n}dc.Cache=_n;var Nw=500;function $w(e){var t=dc(e,function(i){return n.size===Nw&&n.clear(),i}),n=t.cache;return t}var Fw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Uw=/\\(\\)?/g,Bw=$w(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Fw,function(n,i,r,s){t.push(r?s.replace(Uw,"$1"):i||n)}),t});function es(e){return e==null?"":Kf(e)}function Ba(e,t){return Zt(e)?e:hc(e,t)?[e]:Bw(es(e))}function Vi(e){if(typeof e=="string"||ka(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function fc(e,t){t=Ba(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[Vi(t[n++])];return n&&n==i?e:void 0}function Et(e,t,n){var i=e==null?void 0:fc(e,t);return i===void 0?n:i}function pc(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var mp=De?De.isConcatSpreadable:void 0;function Hw(e){return Zt(e)||Bi(e)||!!(mp&&e&&e[mp])}function Ha(e,t,n,i,r){var s=-1,a=e.length;for(n||(n=Hw),r||(r=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Ha(o,t-1,n,i,r):pc(r,o):i||(r[r.length]=o)}return r}function gc(e){var t=e==null?0:e.length;return t?Ha(e,1):[]}function Gw(e){return np(sp(e,void 0,gc),e+"")}var mc=pp(Object.getPrototypeOf,Object),Vw="[object Object]",zw=Function.prototype,Ww=Object.prototype,vp=zw.toString,Yw=Ww.hasOwnProperty,qw=vp.call(Object);function yp(e){if(!en(e)||ri(e)!=Vw)return!1;var t=mc(e);if(t===null)return!0;var n=Yw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&vp.call(n)==qw}function Ep(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),n=n>r?r:n,n<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(r);++i<r;)s[i]=e[i+t];return s}function Xw(e,t,n){var i=e.length;return n=n===void 0?i:n,!t&&n>=i?e:Ep(e,t,n)}var Zw="\\ud800-\\udfff",jw="\\u0300-\\u036f",Kw="\\ufe20-\\ufe2f",Qw="\\u20d0-\\u20ff",Jw=jw+Kw+Qw,tM="\\ufe0e\\ufe0f",eM="\\u200d",nM=RegExp("["+eM+Zw+Jw+tM+"]");function xp(e){return nM.test(e)}function iM(e){return e.split("")}var bp="\\ud800-\\udfff",rM="\\u0300-\\u036f",sM="\\ufe20-\\ufe2f",aM="\\u20d0-\\u20ff",oM=rM+sM+aM,lM="\\ufe0e\\ufe0f",cM="["+bp+"]",vc="["+oM+"]",yc="\\ud83c[\\udffb-\\udfff]",uM="(?:"+vc+"|"+yc+")",Sp="[^"+bp+"]",_p="(?:\\ud83c[\\udde6-\\uddff]){2}",Tp="[\\ud800-\\udbff][\\udc00-\\udfff]",hM="\\u200d",Op=uM+"?",wp="["+lM+"]?",dM="(?:"+hM+"(?:"+[Sp,_p,Tp].join("|")+")"+wp+Op+")*",fM=wp+Op+dM,pM="(?:"+[Sp+vc+"?",vc,_p,Tp,cM].join("|")+")",gM=RegExp(yc+"(?="+yc+")|"+pM+fM,"g");function mM(e){return e.match(gM)||[]}function vM(e){return xp(e)?mM(e):iM(e)}function yM(e){return function(t){t=es(t);var n=xp(t)?vM(t):void 0,i=n?n[0]:t.charAt(0),r=n?Xw(n,1).join(""):t.slice(1);return i[e]()+r}}var EM=yM("toUpperCase");function xM(e){return EM(es(e).toLowerCase())}function bM(e,t,n,i){for(var r=-1,s=e==null?0:e.length;++r<s;)n=t(n,e[r],r,e);return n}function SM(e){return function(t){return e?.[t]}}var _M={À:"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"},TM=SM(_M),OM=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wM="\\u0300-\\u036f",MM="\\ufe20-\\ufe2f",CM="\\u20d0-\\u20ff",AM=wM+MM+CM,DM="["+AM+"]",LM=RegExp(DM,"g");function RM(e){return e=es(e),e&&e.replace(OM,TM).replace(LM,"")}var IM=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function kM(e){return e.match(IM)||[]}var PM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function NM(e){return PM.test(e)}var Mp="\\ud800-\\udfff",$M="\\u0300-\\u036f",FM="\\ufe20-\\ufe2f",UM="\\u20d0-\\u20ff",BM=$M+FM+UM,Cp="\\u2700-\\u27bf",Ap="a-z\\xdf-\\xf6\\xf8-\\xff",HM="\\xac\\xb1\\xd7\\xf7",GM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",VM="\\u2000-\\u206f",zM=" \\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",Dp="A-Z\\xc0-\\xd6\\xd8-\\xde",WM="\\ufe0e\\ufe0f",Lp=HM+GM+VM+zM,Rp="['’]",Ip="["+Lp+"]",YM="["+BM+"]",kp="\\d+",qM="["+Cp+"]",Pp="["+Ap+"]",Np="[^"+Mp+Lp+kp+Cp+Ap+Dp+"]",XM="\\ud83c[\\udffb-\\udfff]",ZM="(?:"+YM+"|"+XM+")",jM="[^"+Mp+"]",$p="(?:\\ud83c[\\udde6-\\uddff]){2}",Fp="[\\ud800-\\udbff][\\udc00-\\udfff]",zi="["+Dp+"]",KM="\\u200d",Up="(?:"+Pp+"|"+Np+")",QM="(?:"+zi+"|"+Np+")",Bp="(?:"+Rp+"(?:d|ll|m|re|s|t|ve))?",Hp="(?:"+Rp+"(?:D|LL|M|RE|S|T|VE))?",Gp=ZM+"?",Vp="["+WM+"]?",JM="(?:"+KM+"(?:"+[jM,$p,Fp].join("|")+")"+Vp+Gp+")*",tC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",eC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nC=Vp+Gp+JM,iC="(?:"+[qM,$p,Fp].join("|")+")"+nC,rC=RegExp([zi+"?"+Pp+"+"+Bp+"(?="+[Ip,zi,"$"].join("|")+")",QM+"+"+Hp+"(?="+[Ip,zi+Up,"$"].join("|")+")",zi+"?"+Up+"+"+Bp,zi+"+"+Hp,eC,tC,kp,iC].join("|"),"g");function sC(e){return e.match(rC)||[]}function aC(e,t,n){return e=es(e),t=t,t===void 0?NM(e)?sC(e):kM(e):e.match(t)||[]}var oC="['’]",lC=RegExp(oC,"g");function zp(e){return function(t){return bM(aC(RM(t).replace(lC,"")),e,"")}}var cC=zp(function(e,t,n){return t=t.toLowerCase(),e+(n?xM(t):t)});function uC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Wp(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Fi(n),n=n===n?n:0),t!==void 0&&(t=Fi(t),t=t===t?t:0),uC(Fi(e),t,n)}function hC(){this.__data__=new Sn,this.size=0}function dC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function fC(e){return this.__data__.get(e)}function pC(e){return this.__data__.has(e)}var gC=200;function mC(e,t){var n=this.__data__;if(n instanceof Sn){var i=n.__data__;if(!ts||i.length<gC-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new _n(i)}return n.set(e,t),this.size=n.size,this}function We(e){var t=this.__data__=new Sn(e);this.size=t.size}We.prototype.clear=hC,We.prototype.delete=dC,We.prototype.get=fC,We.prototype.has=pC,We.prototype.set=mC;function vC(e,t){return e&&Ui(t,Kr(t),e)}function yC(e,t){return e&&Ui(t,Qr(t),e)}var Yp=typeof q=="object"&&q&&!q.nodeType&&q,qp=Yp&&typeof module=="object"&&module&&!module.nodeType&&module,EC=qp&&qp.exports===Yp,Xp=EC?ze.Buffer:void 0,Zp=Xp?Xp.allocUnsafe:void 0;function jp(e,t){if(t)return e.slice();var n=e.length,i=Zp?Zp(n):new e.constructor(n);return e.copy(i),i}function xC(e,t){for(var n=-1,i=e==null?0:e.length,r=0,s=[];++n<i;){var a=e[n];t(a,n,e)&&(s[r++]=a)}return s}function Kp(){return[]}var bC=Object.prototype,SC=bC.propertyIsEnumerable,Qp=Object.getOwnPropertySymbols,Ec=Qp?function(e){return e==null?[]:(e=Object(e),xC(Qp(e),function(t){return SC.call(e,t)}))}:Kp;function _C(e,t){return Ui(e,Ec(e),t)}var TC=Object.getOwnPropertySymbols,Jp=TC?function(e){for(var t=[];e;)pc(t,Ec(e)),e=mc(e);return t}:Kp;function OC(e,t){return Ui(e,Jp(e),t)}function tg(e,t,n){var i=t(e);return Zt(e)?i:pc(i,n(e))}function xc(e){return tg(e,Kr,Ec)}function eg(e){return tg(e,Qr,Jp)}var bc=ai(ze,"DataView"),Sc=ai(ze,"Promise"),Wi=ai(ze,"Set"),ng="[object Map]",wC="[object Object]",ig="[object Promise]",rg="[object Set]",sg="[object WeakMap]",ag="[object DataView]",MC=si(bc),CC=si(ts),AC=si(Sc),DC=si(Wi),LC=si(sc),Re=ri;(bc&&Re(new bc(new ArrayBuffer(1)))!=ag||ts&&Re(new ts)!=ng||Sc&&Re(Sc.resolve())!=ig||Wi&&Re(new Wi)!=rg||sc&&Re(new sc)!=sg)&&(Re=function(e){var t=ri(e),n=t==wC?e.constructor:void 0,i=n?si(n):"";if(i)switch(i){case MC:return ag;case CC:return ng;case AC:return ig;case DC:return rg;case LC:return sg}return t});var RC=Object.prototype,IC=RC.hasOwnProperty;function kC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&IC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Ga=ze.Uint8Array;function _c(e){var t=new e.constructor(e.byteLength);return new Ga(t).set(new Ga(e)),t}function PC(e,t){var n=t?_c(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var NC=/\w*$/;function $C(e){var t=new e.constructor(e.source,NC.exec(e));return t.lastIndex=e.lastIndex,t}var og=De?De.prototype:void 0,lg=og?og.valueOf:void 0;function FC(e){return lg?Object(lg.call(e)):{}}function cg(e,t){var n=t?_c(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var UC="[object Boolean]",BC="[object Date]",HC="[object Map]",GC="[object Number]",VC="[object RegExp]",zC="[object Set]",WC="[object String]",YC="[object Symbol]",qC="[object ArrayBuffer]",XC="[object DataView]",ZC="[object Float32Array]",jC="[object Float64Array]",KC="[object Int8Array]",QC="[object Int16Array]",JC="[object Int32Array]",tA="[object Uint8Array]",eA="[object Uint8ClampedArray]",nA="[object Uint16Array]",iA="[object Uint32Array]";function rA(e,t,n){var i=e.constructor;switch(t){case qC:return _c(e);case UC:case BC:return new i(+e);case XC:return PC(e,n);case ZC:case jC:case KC:case QC:case JC:case tA:case eA:case nA:case iA:return cg(e,n);case HC:return new i;case GC:case WC:return new i(e);case VC:return $C(e);case zC:return new i;case YC:return FC(e)}}function ug(e){return typeof e.constructor=="function"&&!Na(e)?QT(mc(e)):{}}var sA="[object Map]";function aA(e){return en(e)&&Re(e)==sA}var hg=Gi&&Gi.isMap,oA=hg?cc(hg):aA,lA="[object Set]";function cA(e){return en(e)&&Re(e)==lA}var dg=Gi&&Gi.isSet,uA=dg?cc(dg):cA,hA=1,dA=2,fA=4,fg="[object Arguments]",pA="[object Array]",gA="[object Boolean]",mA="[object Date]",vA="[object Error]",pg="[object Function]",yA="[object GeneratorFunction]",EA="[object Map]",xA="[object Number]",gg="[object Object]",bA="[object RegExp]",SA="[object Set]",_A="[object String]",TA="[object Symbol]",OA="[object WeakMap]",wA="[object ArrayBuffer]",MA="[object DataView]",CA="[object Float32Array]",AA="[object Float64Array]",DA="[object Int8Array]",LA="[object Int16Array]",RA="[object Int32Array]",IA="[object Uint8Array]",kA="[object Uint8ClampedArray]",PA="[object Uint16Array]",NA="[object Uint32Array]",Dt={};Dt[fg]=Dt[pA]=Dt[wA]=Dt[MA]=Dt[gA]=Dt[mA]=Dt[CA]=Dt[AA]=Dt[DA]=Dt[LA]=Dt[RA]=Dt[EA]=Dt[xA]=Dt[gg]=Dt[bA]=Dt[SA]=Dt[_A]=Dt[TA]=Dt[IA]=Dt[kA]=Dt[PA]=Dt[NA]=!0,Dt[vA]=Dt[pg]=Dt[OA]=!1;function ns(e,t,n,i,r,s){var a,o=t&hA,l=t&dA,c=t&fA;if(n&&(a=r?n(e,i,r,s):n(e)),a!==void 0)return a;if(!Le(e))return e;var u=Zt(e);if(u){if(a=kC(e),!o)return ep(e,a)}else{var d=Re(e),h=d==pg||d==yA;if(Hi(e))return jp(e,o);if(d==gg||d==fg||h&&!r){if(a=l||h?{}:ug(e),!o)return l?OC(e,yC(a,e)):_C(e,vC(a,e))}else{if(!Dt[d])return r?e:{};a=rA(e,d,o)}}s||(s=new We);var f=s.get(e);if(f)return f;s.set(e,a),uA(e)?e.forEach(function(m){a.add(ns(m,t,n,m,e,s))}):oA(e)&&e.forEach(function(m,v){a.set(v,ns(m,t,n,v,e,s))});var p=c?l?eg:xc:l?Qr:Kr,g=u?void 0:p(e);return oO(g||e,function(m,v){g&&(v=m,m=e[v]),ip(a,v,ns(m,t,n,v,e,s))}),a}var $A=1,FA=4;function Tn(e){return ns(e,$A|FA)}var UA="__lodash_hash_undefined__";function BA(e){return this.__data__.set(e,UA),this}function HA(e){return this.__data__.has(e)}function is(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new _n;++t<n;)this.add(e[t])}is.prototype.add=is.prototype.push=BA,is.prototype.has=HA;function mg(e,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function vg(e,t){return e.has(t)}var GA=1,VA=2;function yg(e,t,n,i,r,s){var a=n&GA,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&VA?new is:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var p=e[d],g=t[d];if(i)var m=a?i(g,p,d,t,e,s):i(p,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(f){if(!mg(t,function(v,S){if(!vg(f,S)&&(p===v||r(p,v,n,i,s)))return f.push(S)})){h=!1;break}}else if(!(p===g||r(p,g,n,i,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function zA(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function Tc(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var WA=1,YA=2,qA="[object Boolean]",XA="[object Date]",ZA="[object Error]",jA="[object Map]",KA="[object Number]",QA="[object RegExp]",JA="[object Set]",tD="[object String]",eD="[object Symbol]",nD="[object ArrayBuffer]",iD="[object DataView]",Eg=De?De.prototype:void 0,Oc=Eg?Eg.valueOf:void 0;function rD(e,t,n,i,r,s,a){switch(n){case iD:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case nD:return!(e.byteLength!=t.byteLength||!s(new Ga(e),new Ga(t)));case qA:case XA:case KA:return Zr(+e,+t);case ZA:return e.name==t.name&&e.message==t.message;case QA:case tD:return e==t+"";case jA:var o=zA;case JA:var l=i&WA;if(o||(o=Tc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;i|=YA,a.set(e,t);var u=yg(o(e),o(t),i,r,s,a);return a.delete(e),u;case eD:if(Oc)return Oc.call(e)==Oc.call(t)}return!1}var sD=1,aD=Object.prototype,oD=aD.hasOwnProperty;function lD(e,t,n,i,r,s){var a=n&sD,o=xc(e),l=o.length,c=xc(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:oD.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=a;++d<l;){h=o[d];var v=e[h],S=t[h];if(i)var E=a?i(S,v,h,t,e,s):i(v,S,h,e,t,s);if(!(E===void 0?v===S||r(v,S,n,i,s):E)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var b=e.constructor,x=t.constructor;b!=x&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof x=="function"&&x instanceof x)&&(g=!1)}return s.delete(e),s.delete(t),g}var cD=1,xg="[object Arguments]",bg="[object Array]",Va="[object Object]",uD=Object.prototype,Sg=uD.hasOwnProperty;function hD(e,t,n,i,r,s){var a=Zt(e),o=Zt(t),l=a?bg:Re(e),c=o?bg:Re(t);l=l==xg?Va:l,c=c==xg?Va:c;var u=l==Va,d=c==Va,h=l==c;if(h&&Hi(e)){if(!Hi(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new We),a||$a(e)?yg(e,t,n,i,r,s):rD(e,t,l,n,i,r,s);if(!(n&cD)){var f=u&&Sg.call(e,"__wrapped__"),p=d&&Sg.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return s||(s=new We),r(g,m,n,i,s)}}return h?(s||(s=new We),lD(e,t,n,i,r,s)):!1}function za(e,t,n,i,r){return e===t?!0:e==null||t==null||!en(e)&&!en(t)?e!==e&&t!==t:hD(e,t,n,i,za,r)}var dD=1,fD=2;function pD(e,t,n,i){var r=n.length,s=r;if(e==null)return!s;for(e=Object(e);r--;){var a=n[r];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<s;){a=n[r];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new We,d;if(!(d===void 0?za(c,l,dD|fD,i,u):d))return!1}}return!0}function _g(e){return e===e&&!Le(e)}function gD(e){for(var t=Kr(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,_g(r)]}return t}function Tg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function mD(e){var t=gD(e);return t.length==1&&t[0][2]?Tg(t[0][0],t[0][1]):function(n){return n===e||pD(n,e,t)}}function vD(e,t){return e!=null&&t in Object(e)}function yD(e,t,n){t=Ba(t,e);for(var i=-1,r=t.length,s=!1;++i<r;){var a=Vi(t[i]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++i!=r?s:(r=e==null?0:e.length,!!r&&lc(r)&&ac(a,r)&&(Zt(e)||Bi(e)))}function ED(e,t){return e!=null&&yD(e,t,vD)}var xD=1,bD=2;function SD(e,t){return hc(e)&&_g(t)?Tg(Vi(e),t):function(n){var i=Et(n,e);return i===void 0&&i===t?ED(n,e):za(t,i,xD|bD)}}function _D(e){return function(t){return t?.[e]}}function TD(e){return function(t){return fc(t,e)}}function OD(e){return hc(e)?_D(Vi(e)):TD(e)}function Wa(e){return typeof e=="function"?e:e==null?nc:typeof e=="object"?Zt(e)?SD(e[0],e[1]):mD(e):OD(e)}function wD(e,t,n,i){for(var r=-1,s=e==null?0:e.length;++r<s;){var a=e[r];t(i,a,n(a),e)}return i}function MD(e){return function(t,n,i){for(var r=-1,s=Object(t),a=i(t),o=a.length;o--;){var l=a[++r];if(n(s[l],l,s)===!1)break}return t}}var Og=MD();function CD(e,t){return e&&Og(e,t,Kr)}function AD(e,t){return function(n,i){if(n==null)return n;if(!oi(n))return e(n,i);for(var r=n.length,s=-1,a=Object(n);++s<r&&i(a[s],s,a)!==!1;);return n}}var wc=AD(CD);function DD(e,t,n,i){return wc(e,function(r,s,a){t(i,r,n(r),a)}),i}function LD(e,t){return function(n,i){var r=Zt(n)?wD:DD,s={};return r(n,e,Wa(i),s)}}var Mc=function(){return ze.Date.now()},RD="Expected a function",ID=Math.max,kD=Math.min;function Ya(e,t,n){var i,r,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(RD);t=Fi(t)||0,Le(n)&&(u=!!n.leading,d="maxWait"in n,s=d?ID(Fi(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(_){var C=i,D=r;return i=r=void 0,c=_,a=e.apply(D,C),a}function p(_){return c=_,o=setTimeout(v,t),u?f(_):a}function g(_){var C=_-l,D=_-c,$=t-C;return d?kD($,s-D):$}function m(_){var C=_-l,D=_-c;return l===void 0||C>=t||C<0||d&&D>=s}function v(){var _=Mc();if(m(_))return S(_);o=setTimeout(v,g(_))}function S(_){return o=void 0,h&&i?f(_):(i=r=void 0,a)}function E(){o!==void 0&&clearTimeout(o),c=0,i=l=r=o=void 0}function b(){return o===void 0?a:S(Mc())}function x(){var _=Mc(),C=m(_);if(i=arguments,r=this,l=_,C){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(v,t),f(l)}return o===void 0&&(o=setTimeout(v,t)),a}return x.cancel=E,x.flush=b,x}function Cc(e,t,n){(n!==void 0&&!Zr(e[t],n)||n===void 0&&!(t in e))&&Xr(e,t,n)}function Ac(e){return en(e)&&oi(e)}function Dc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function PD(e){return Ui(e,Qr(e))}function ND(e,t,n,i,r,s,a){var o=Dc(e,n),l=Dc(t,n),c=a.get(l);if(c){Cc(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Zt(l),f=!h&&Hi(l),p=!h&&!f&&$a(l);u=l,h||f||p?Zt(o)?u=o:Ac(o)?u=ep(o):f?(d=!1,u=jp(l,!0)):p?(d=!1,u=cg(l,!0)):u=[]:yp(l)||Bi(l)?(u=o,Bi(o)?u=PD(o):(!Le(o)||ic(o))&&(u=ug(l))):d=!1}d&&(a.set(l,u),r(u,l,i,s,a),a.delete(l)),Cc(e,n,u)}function wg(e,t,n,i,r){e!==t&&Og(t,function(s,a){if(r||(r=new We),Le(s))ND(e,t,a,n,wg,i,r);else{var o=i?i(Dc(e,a),s,a+"",e,t,r):void 0;o===void 0&&(o=s),Cc(e,a,o)}},Qr)}var $D="Expected a function";function FD(e,t,n){if(typeof e!="function")throw new TypeError($D);return setTimeout(function(){e.apply(void 0,n)},t)}var UD=oc(function(e,t,n){return FD(e,Fi(t)||0,n)});function Mg(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function BD(e,t){var n=-1,i=oi(e)?Array(e.length):[];return wc(e,function(r,s,a){i[++n]=t(r,s,a)}),i}function HD(e,t){var n=Zt(e)?ec:BD;return n(e,Wa(t))}var GD=1/0;function VD(e,t){return Ha(HD(e,t),GD)}function zD(e){for(var t=-1,n=e==null?0:e.length,i={};++t<n;){var r=e[t];Xr(i,r[0],r[1])}return i}var WD=Object.prototype,YD=WD.hasOwnProperty,qD=LD(function(e,t,n){YD.call(e,n)?e[n].push(t):Xr(e,n,[t])});function XD(e,t){return t.length<2?e:fc(e,Ep(t,0,-1))}var ZD="[object Map]",jD="[object Set]",KD=Object.prototype,QD=KD.hasOwnProperty;function Ye(e){if(e==null)return!0;if(oi(e)&&(Zt(e)||typeof e=="string"||typeof e.splice=="function"||Hi(e)||$a(e)||Bi(e)))return!e.length;var t=Re(e);if(t==ZD||t==jD)return!e.size;if(Na(e))return!gp(e).length;for(var n in e)if(QD.call(e,n))return!1;return!0}function Cg(e,t){return za(e,t)}var Yi=zp(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ut=EO(function(e,t,n){wg(e,t,n)}),JD=Object.prototype,tL=JD.hasOwnProperty;function eL(e,t){t=Ba(t,e);var n=-1,i=t.length;if(!i)return!0;for(;++n<i;){var r=Vi(t[n]);if(r==="__proto__"&&!tL.call(e,"__proto__")||(r==="constructor"||r==="prototype")&&n<i-1)return!1}var s=XD(e,t);return s==null||delete s[Vi(Mg(t))]}function nL(e){return yp(e)?void 0:e}var iL=1,rL=2,sL=4,aL=Gw(function(e,t){var n={};if(e==null)return n;var i=!1;t=ec(t,function(s){return s=Ba(s,e),i||(i=s.length>1),s}),Ui(e,eg(e),n),i&&(n=ns(n,iL|rL|sL,nL));for(var r=t.length;r--;)eL(n,t[r]);return n});function oL(e,t){var n;return wc(e,function(i,r,s){return n=t(i,r,s),!n}),!!n}function lL(e,t,n){var i=Zt(e)?mg:oL;return i(e,Wa(t))}var cL=1/0,uL=Wi&&1/Tc(new Wi([,-0]))[1]==cL?function(e){return new Wi(e)}:tO,hL=200;function Ag(e,t,n){var i=-1,r=dO,s=e.length,a=!0,o=[],l=o;if(s>=hL){var c=t?null:uL(e);if(c)return Tc(c);a=!1,r=vg,l=new is}else l=t?[]:o;t:for(;++i<s;){var u=e[i],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else r(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var dL=oc(function(e){var t=Mg(e);return Ac(t)&&(t=void 0),Ag(Ha(e,1,Ac,!0),Wa(t))});function rs(e){return e&&e.length?Ag(e):[]}var Lc=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Lc||{}),Rc=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Rc||{}),Ic=(e=>(e.UPDATE="model-update",e))(Ic||{}),Dg=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Dg||{}),kc=(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))(kc||{}),Pc=(e=>(e.CHANGE="zoom-domain-change",e))(Pc||{}),Nc=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Nc||{}),$c=(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))($c||{}),Fc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Fc||{}),Uc=(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))(Uc||{}),Bc=(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))(Bc||{}),Hc=(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))(Hc||{}),Gc=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Gc||{}),Vc=(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))(Vc||{}),zc=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(zc||{}),Wc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Wc||{}),Yc=(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))(Yc||{}),qc=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(qc||{}),Xc=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Xc||{}),qi=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(qi||{}),Zc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Zc||{}),Lg=(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))(Lg||{}),Rg=(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))(Rg||{}),Ig=(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))(Ig||{}),kg=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(kg||{}),Pg=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Pg||{}),Xi=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Xi||{});const T=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Ig,Area:Fc,Axis:$c,Bar:Gc,Boxplot:Vc,CanvasZoom:Nc,Chart:Lc,Choropleth:Xi,CirclePack:Rg,Gauge:Hc,Heatmap:Pg,Legend:Lg,Line:Wc,Meter:kg,Modal:Rc,Model:Ic,Pie:Bc,Radar:Yc,Scatter:zc,Threshold:Zc,Toolbar:Dg,Tooltip:qi,Tree:qc,Treemap:Xc,WordCloud:Uc,ZoomBar:kc,ZoomDomain:Pc},Symbol.toStringTag,{value:"Module"}));var st=(e=>(e.HTML="html",e.SVG="svg",e))(st||{}),jc=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(jc||{}),lt=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(lt||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),qe=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(qe||{}),Ie=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ie||{}),Ht=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Ht||{}),it=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(it||{}),Zi=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Zi||{}),Gt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Gt||{}),ji=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(ji||{}),qa=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(qa||{}),Ct=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Ct||{}),dt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(dt||{}),ci=(e=>(e.CENTER="center",e))(ci||{}),ss=(e=>(e.LEFT="left",e.RIGHT="right",e))(ss||{}),Vt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Vt||{}),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||{}),ui=(e=>(e.SEMI="semi",e.FULL="full",e))(ui||{}),Xa=(e=>(e.UP="up",e.DOWN="down",e))(Xa||{}),as=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(as||{}),os=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(os||{}),Se=(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))(Se||{}),_t=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(_t||{}),Za=(e=>(e.LEFT="left",e.RIGHT="right",e))(Za||{}),zt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(zt||{}),ls=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(ls||{}),Ki=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Ki||{}),cs=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(cs||{}),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||{});const pe="cds",On={opacity:{unselected:.05,selected:.4}},Un={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Qi={duration:1e3,ease:Ph,zoomLevel:3},Ji={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},Ng={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},ke={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},fL={defaultBins:10},Pt={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}},wn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},jt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Lt={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}},hi={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Xe={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},$g={minCellDividerDimension:16},Fg={default:{size:24}},Ug={defaultOffset:4,horizontalOffset:10},Bg={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},_e={height:{[qe.GRAPH_VIEW]:32,[qe.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},pL=[{type:zt.RADIUS,name:"Radius"},{type:zt.AREA,name:"Poor area"},{type:zt.AREA,name:"Satisfactory area"},{type:zt.AREA,name:"Great area"},{type:zt.QUARTILE,name:"Quartiles"}];function gL(e,t,n){let i=null;return function(...r){const s=this;s.mousePosition=Yn(r[0],n),clearTimeout(i),i=setTimeout(function(){e.apply(s,r)},t)}}function It(e,t){const n=Tn(e),i=Object.keys(t.axes||{});t?.toolbar?.controls&&delete n.toolbar.controls,i.length===0&&delete n.axes;for(const r in n.axes)if(i.includes(r)){const s=t.axes[r];(s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/");const a=s.mapsTo;if(a==null){const o=s.scaleType;o==null?s.mapsTo="value":o===it.TIME?s.mapsTo="date":o===it.LABELS&&(s.mapsTo="key")}}else delete n.axes[r];return Qc(n,t),ut(n,t)}function Mn(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 i=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:i[0],ty:i[1]}}return null}function us(e){const n=/\(([^)]+)\)/.exec(e);if(n&&n.length>1){const i=n[1].split(",");if(i.length>1)return{x:parseFloat(i[0]),y:parseFloat(i[1])}}return{x:0,y:0}}function Kc(e,t,n="value",i=!1){const r=e/t.reduce((s,a)=>s+a[n],0)*100;return i?r:r%1!==0?parseFloat(r.toFixed(1)):r}function hs(e,t,n){if(n>e.length)return e;if(t===Ie.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ie.FRONT_LINE)return"..."+e.substr(-n);if(t===Ie.END_LINE)return e.substr(0,n)+"..."}function Qc(e,t){const n=y(e,"legend","additionalItems"),i=y(t,"legend","additionalItems");if(n&&i){const r=i.map(o=>o.type),s=n.map(o=>o.type),a=pL.filter(o=>s.includes(o.type)&&!r.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=dL(a,i,"name")}}const y=(e,...t)=>{let n=e;if(n){for(const i of t)if(n[i]!==null&&n[i]!==void 0)n=n[i];else return null;return n}return null},Hg=(e,t)=>t===Ht.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,se=(e,t)=>{const{x0:n,x1:i,y0:r,y1:s}=Hg(e,t);return`M${n},${r}L${n},${s}L${i},${s}L${i},${r}L${n},${r}`};function Cn(e,t,n){return n===Ht.VERTICAL?[e,t]:[t,e]}function Jc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function ds(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):a;r=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}function fs(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?vL(o,d=>d.test(a)):mL(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function mL(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function vL(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function yL(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(r.length);return{value:a,rest:o}}}const Gg=6048e5,EL=864e5,Vg=6e4,zg=36e5,Wg=Symbol.for("constructDateFrom");function Pe(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Wg in e?e[Wg](t):e instanceof Date?new e.constructor(t):new Date(t)}function di(e,...t){const n=Pe.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}let xL={};function ja(){return xL}function $t(e,t){return Pe(t||e,e)}function ps(e,t){const n=ja(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=$t(e,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}const bL={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"}},SL=(e,t,n)=>{let i;const r=bL[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},_L={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},TL=(e,t,n,i)=>_L[e],OL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ML={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"]},CL={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"]},AL={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"}},DL={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"}},LL={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ds({values:OL,defaultWidth:"wide"}),quarter:ds({values:wL,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ds({values:ML,defaultWidth:"wide"}),day:ds({values:CL,defaultWidth:"wide"}),dayPeriod:ds({values:AL,defaultWidth:"wide",formattingValues:DL,defaultFormattingWidth:"wide"})},RL=/^(\d+)(th|st|nd|rd)?/i,IL=/\d+/i,kL={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},PL={any:[/^b/i,/^(a|c)/i]},NL={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$L={any:[/1/i,/2/i,/3/i,/4/i]},FL={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},UL={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]},BL={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},HL={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]},GL={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},VL={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}},zL={ordinalNumber:yL({matchPattern:RL,parsePattern:IL,valueCallback:e=>parseInt(e,10)}),era:fs({matchPatterns:kL,defaultMatchWidth:"wide",parsePatterns:PL,defaultParseWidth:"any"}),quarter:fs({matchPatterns:NL,defaultMatchWidth:"wide",parsePatterns:$L,defaultParseWidth:"any",valueCallback:e=>e+1}),month:fs({matchPatterns:FL,defaultMatchWidth:"wide",parsePatterns:UL,defaultParseWidth:"any"}),day:fs({matchPatterns:BL,defaultMatchWidth:"wide",parsePatterns:HL,defaultParseWidth:"any"}),dayPeriod:fs({matchPatterns:GL,defaultMatchWidth:"any",parsePatterns:VL,defaultParseWidth:"any"})},WL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},YL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},XL={date:Jc({formats:WL,defaultWidth:"full"}),time:Jc({formats:YL,defaultWidth:"full"}),dateTime:Jc({formats:qL,defaultWidth:"full"})},Yg={code:"en-US",formatDistance:SL,formatLong:XL,formatRelative:TL,localize:LL,match:zL,options:{weekStartsOn:0,firstWeekContainsDate:1}},tr={type:Ie.END_LINE,threshold:16,numCharacter:14},qg=4,ZL={code:typeof navigator<"u"&&navigator?.language||"en-US",number:(e,t=navigator?.language||"en-US")=>e?.toLocaleString?.(t),date:(e,t=navigator?.language||"en-US",n={},i=null)=>i||e.toLocaleDateString(t,n),time:(e,t=navigator?.language||"en-US",n={},i=null)=>i||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},jL={enabled:!0,position:Zi.BOTTOM,clickable:!0,truncation:tr,alignment:Gt.LEFT,order:null,additionalItems:[]},KL={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},QL={enabled:!0},Xg={enabled:!0,showTotal:!0,truncation:tr,groupLabel:"Group"},Zg={top:{visible:!0,includeZero:!0,truncation:tr},bottom:{visible:!0,includeZero:!0,truncation:tr},left:{visible:!0,includeZero:!0,truncation:tr},right:{visible:!0,includeZero:!0,truncation:tr}},Ka={addSpaceOnEdges:1,showDayName:!1,localeObject:Yg,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}};let jg=!1;try{jg=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const ne={width:null,height:null,resizable:!0,theme:jc.WHITE,tooltip:Xg,legend:jL,locale:ZL,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:_t.SHOW_AS_DATATABLE},...jg?[{type:_t.MAKE_FULLSCREEN}]:[],{type:_t.EXPORT_CSV},{type:_t.EXPORT_PNG},{type:_t.EXPORT_JPG}]}},Kg=ut({},ne,{thematic:{projection:sn.geoNaturalEarth1}}),gs=ut({},ne,{axes:Zg,timeScale:Ka,grid:KL,ruler:QL,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:qe.GRAPH_VIEW}}}),fi=ut({},gs,{bars:{maxWidth:16,spacingFactor:.25,preserveSpaceForMissingBars:!0},timeScale:ut(Ka,{addSpaceOnEdges:1})}),JL=ut({},fi,{}),tR=ut({},fi,{}),eR=ut({},fi,{bars:ut({},fi.bars,{dividerSize:1.5})}),nR=ut({},fi,{}),tu=ut({},gs,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),iR=tu,Qg=ut({},tu,{points:{radius:3,filled:!1,enabled:!0}}),Jg=ut({},Qg,{timeScale:ut(Ka,{addSpaceOnEdges:0})}),rR=Jg,sR=ut({},gs,{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:zt.RADIUS,name:"Radius"}]}}),aR=ut({},gs,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:zt.AREA,name:"Poor area"},{type:zt.AREA,name:"Satisfactory area"},{type:zt.AREA,name:"Great area"},{type:zt.QUARTILE,name:"Quartiles"}]}}),oR=ut({},fi,{bars:{dividerSize:1.5},timeScale:ut(Ka,{addSpaceOnEdges:0})}),lR=ut({},ne,{tooltip:ut({},Xg,{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"}}),tm=ut({},ne,{pie:{labels:{formatter:null,enabled:!0},alignment:Gt.LEFT,sortFunction:null,valueMapsTo:"value"}}),cR=ut({},ne,{legend:{enabled:!1},gauge:{type:ui.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:Gt.LEFT}}),uR=ut({},tm,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:Gt.LEFT}}),em=ut({},ne,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),hR=ut({},em,{legend:{enabled:!0}}),dR=ut({},ne,{radar:{axes:{angle:"key",value:"value"},alignment:Gt.LEFT},tooltip:{gridline:{enabled:!0}}}),fR=ut({},fi,{comboChartTypes:[]}),pR=ut({tree:{type:qa.TREE}},ne,{}),gR=ut({},ne,{data:ut(ne.data,{groupMapsTo:"name"})}),mR=ut({},ne,Ji,{data:ut(ne.data,{groupMapsTo:"name"})}),vR=ut({},ne,{alluvial:{data:ut(ne.data,{groupMapsTo:"source"}),nodeAlignment:Gt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),yR=ut({},ne,{axes:Zg,heatmap:{divider:{state:Ki.AUTO},colorLegend:{type:"linear"}}}),ER=ut({},Kg,{choropleth:{colorLegend:{type:"linear"}}}),At={alluvialChart:vR,areaChart:Jg,axisChart:gs,boxplotChart:nR,bubbleChart:sR,bulletChart:aR,chart:ne,circlePackChart:mR,choroplethChart:ER,comboChart:fR,donutChart:uR,gaugeChart:cR,groupedBarChart:tR,heatmapChart:yR,histogramChart:oR,lineChart:Qg,lollipopChart:iR,meterChart:em,pieChart:tm,proportionalMeterChart:hR,radarChart:dR,scatterChart:tu,simpleBarChart:JL,stackedAreaChart:rR,stackedBarChart:eR,thematicChart:Kg,treeChart:pR,treemapChart:gR,wordCloudChart:lR};function nm(e){const t=$t(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function im(e,t){const n=$t(e,t?.in);return n.setHours(0,0,0,0),n}function rm(e,t,n){const[i,r]=di(n?.in,e,t),s=im(i),a=im(r),o=+s-nm(s),l=+a-nm(a);return Math.round((o-l)/EL)}function xR(e,t){const n=$t(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function bR(e,t){const n=$t(e,t?.in);return rm(n,xR(n))+1}function Qa(e,t){return ps(e,{...t,weekStartsOn:1})}function sm(e,t){const n=$t(e,t?.in),i=n.getFullYear(),r=Pe(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Qa(r),a=Pe(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Qa(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=o.getTime()?i:i-1}function SR(e,t){const n=sm(e,t),i=Pe(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Qa(i)}function _R(e,t){const n=$t(e,t?.in),i=+Qa(n)-+SR(n);return Math.round(i/Gg)+1}function am(e,t){const n=$t(e,t?.in),i=n.getFullYear(),r=ja(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Pe(t?.in||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const o=ps(a,t),l=Pe(t?.in||e,0);l.setFullYear(i,0,s),l.setHours(0,0,0,0);const c=ps(l,t);return+n>=+o?i+1:+n>=+c?i:i-1}function TR(e,t){const n=ja(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=am(e,t),s=Pe(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ps(s,t)}function OR(e,t){const n=$t(e,t?.in),i=+ps(n,t)-+TR(n,t);return Math.round(i/Gg)+1}function wt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Bn={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return wt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):wt(n+1,2)},d(e,t){return wt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return wt(e.getHours()%12||12,t.length)},H(e,t){return wt(e.getHours(),t.length)},m(e,t){return wt(e.getMinutes(),t.length)},s(e,t){return wt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return wt(r,t.length)}},er={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},om={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Bn.y(e,t)},Y:function(e,t,n,i){const r=am(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return wt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):wt(s,t.length)},R:function(e,t){const n=sm(e);return wt(n,t.length)},u:function(e,t){const n=e.getFullYear();return wt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return wt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return wt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Bn.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return wt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=OR(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):wt(r,t.length)},I:function(e,t,n){const i=_R(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):wt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Bn.d(e,t)},D:function(e,t,n){const i=bR(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):wt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":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"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return wt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});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"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return wt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return wt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=er.noon:i===0?r=er.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=er.evening:i>=12?r=er.afternoon:i>=4?r=er.morning:r=er.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Bn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Bn.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):wt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):wt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Bn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Bn.s(e,t)},S:function(e,t){return Bn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return cm(i);case"XXXX":case"XX":return pi(i);case"XXXXX":case"XXX":default:return pi(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return cm(i);case"xxxx":case"xx":return pi(i);case"xxxxx":case"xxx":default:return pi(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+lm(i,":");case"OOOO":default:return"GMT"+pi(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+lm(i,":");case"zzzz":default:return"GMT"+pi(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return wt(i,t.length)},T:function(e,t,n){return wt(+e,t.length)}};function lm(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+wt(s,2)}function cm(e,t){return e%60===0?(e>0?"-":"+")+wt(Math.abs(e)/60,2):pi(e,t)}function pi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=wt(Math.trunc(i/60),2),s=wt(i%60,2);return n+r+t+s}const um=(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"})}},hm=(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"})}},wR={p:hm,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return um(e,t);let s;switch(i){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}}",um(i,t)).replace("{{time}}",hm(r,t))}},MR=/^D+$/,CR=/^Y+$/,AR=["D","DD","YY","YYYY"];function DR(e){return MR.test(e)}function LR(e){return CR.test(e)}function RR(e,t,n){const i=IR(e,t,n);if(console.warn(i),AR.includes(e))throw new RangeError(i)}function IR(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function kR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function PR(e){return!(!kR(e)&&typeof e!="number"||isNaN(+$t(e)))}const NR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$R=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FR=/^'([^]*?)'?$/,UR=/''/g,BR=/[a-zA-Z]/;function eu(e,t,n){const i=ja(),r=n?.locale??i.locale??Yg,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=$t(e,n?.in);if(!PR(o))throw new RangeError("Invalid time value");let l=t.match($R).map(u=>{const d=u[0];if(d==="p"||d==="P"){const h=wR[d];return h(u,r.formatLong)}return u}).join("").match(NR).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:HR(u)};if(om[d])return{isToken:!0,value:u};if(d.match(BR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(l=r.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return l.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!n?.useAdditionalWeekYearTokens&&LR(d)||!n?.useAdditionalDayOfYearTokens&&DR(d))&&RR(d,t,String(e));const h=om[d[0]];return h(o,d,r.localize,c)}).join("")}function HR(e){const t=e.match(FR);return t?t[1].replace(UR,"'"):e}var dm=(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))(dm||{});const nu=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",1800*1e3],["hourly",3600*1e3],["daily",1440*60*1e3],["monthly",720*60*60*1e3],["quarterly",2160*60*60*1e3],["yearly",360*24*60*60*1e3]];function fm(e,t,n,i,r){const s=t===0,a=Number(eu(new Date(e),"c"))===2,o=Number(eu(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(i){case"15seconds":return s||to(e)||ms(e,l)||Hn(e);case"minute":return s||to(e)||ms(e,l)||Hn(e);case"30minutes":return s||to(e)||ms(e,l)||Hn(e);case"hourly":return s||to(e)||ms(e,l)||Hn(e);case"daily":return r?s||a||Hn(e):s||ms(e,l)||Hn(e);case"weekly":return s||a||Hn(e);case"monthly":return s||Hn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function iu(e,t,n,i,r,s){const a=r.showDayName,o=i==="daily"&&a?"weekly":i,l=new Date(e),c=y(r,"timeIntervalFormats")[o],u=y(c,"primary"),d=y(c,"secondary"),h=fm(e,t,n,i,a);let f=h?u:d;i==="15seconds"&&l.getMilliseconds()!==0&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=r.localeObject,{code:g,optionsObject:m}=s,v=m[i].type,S=m[i][h?"primary":"secondary"][f];if(i==="quarterly"||!S){const b=eu(l,f,{locale:p}).split("").map(x=>{const _=Number(x);return x!==" "&&!Number.isNaN(_)?_?.toLocaleString?.(g):x});return s[v](l,g,{},b.join(""))}else return s[v](l,g,S)}function Ja(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function GR(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function VR(e){const t=nu.reduce((n,[,i],r)=>{const s=nu[n][1],a=Math.abs(s-e),o=Math.abs(i-e);return a<o?n:r},0);return nu[t][0]}function ru(e,t){if(dm[t])return t;if(e.length===1)return"15seconds";const n=GR(e),i=Nn(n);return VR(i)}function to(e){const{s:t,m:n,H:i}=Ja(e);return i===0&&n===0&&t===0}function ms(e,t){const n=Ja(e).M,i=Ja(t).M;return n!==i}function Hn(e){const{M:t,d:n,s:i,m:r,H:s}=Ja(e);return t===1&&n===1&&s===0&&r===0&&i===0}function pm(e){return e===void 0?"":e.toISOString()}function zR(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class an{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const i=this.getOptions(),{code:r,date:s,number:a}=y(i,"locale"),o=y(i,"tabularRepModal","tableHeadingFormatter"),l=y(i,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c?.getDomainAxisScaleType();let d;return u===it.TIME&&(d=f=>s(f,r,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(f=>{d&&(f[1]=d(f[1]));for(const p in f){const g=f[p];typeof g=="number"&&(f[p]=a(g,r))}return f})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let i=this.getData();const r=this.getDataGroups(),{groupMapsTo:s}=y(n,"data"),a=y(n,"axes");return t&&(i=i.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===it.LINEAR||c===it.LOG)&&(i=i.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===it.LABELS)i=i.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;i=i.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),i.filter(o=>r.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Pt.items.status,i=this.getDataGroups(t),{groupMapsTo:r}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(a=>i.find(o=>o.name===a[r]&&o.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(Tn(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),n}getDataGroups(t){return y(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(i=>t.includes(i.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Pt.items.status;return this.getDataGroups(t).filter(i=>i.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(i=>i.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(i=>i.name)}aggregateBinDataByGroup(t){return qD(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),i=this.services.cartesianScales.getMainXAxisPosition(),r=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[i],{groupMapsTo:a}=n.data,{bins:o=fL.defaultBins}=s,l=Array.isArray(o),c=d0().value(f=>f[r]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(f=>f[a]))),h=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,g=this.aggregateBinDataByGroup(f);d.forEach(m=>{h.push({group:m,key:p,value:g[m]||0,bin:f.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getActiveDataGroupNames(),{bins:r}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:r});return tc().keys(i)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=i[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),i={},{groupMapsTo:r}=this.getOptions().data;return n.map(s=>{const a=s[r];i[a]!==null&&i[a]!==void 0?i[a].push(s):i[a]=[s]}),Object.keys(i).map(s=>({name:s,data:i[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const i=this.getOptions(),r=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=rs(r.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?pm(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=i.axes[a].scaleType;return o===it.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===it.LOG||o===it.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{d[f]=h.filter(p=>p[r]===f).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[r]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?pm(f[p])===l:f[p].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:i=!1}){const r=this.getOptions(),{groupMapsTo:s}=r.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const c=zD(o.map(u=>[u.sharedStackKey,0]));o.forEach(u=>{a.forEach(d=>{c[u.sharedStackKey]+=u[d]})}),o.forEach(u=>{a.forEach(d=>{const h=c[u.sharedStackKey];c[u.sharedStackKey]?u[d]=u[d]/h*100:u[d]=0})})}return(i?tc().offset(vT):tc()).keys(a)(o).map((c,u)=>Object.keys(c).filter(d=>!isNaN(d)).map(d=>{const h=c[d];return h[s]=a[u],h}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const i=Object.assign({skipUpdate:!1,animate:!0},n);i.skipUpdate||this.update(i.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();Qc(n,t),this.set({options:ut(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(T.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:i}=Pt.items.status,r=this.getDataGroups(),s=r.some(u=>u.status===i),a=r.filter(u=>u.status===n);if(s)if(a.length===1&&a[0].name===t)r.forEach((u,d)=>{r[d].status=n});else{const u=r.findIndex(d=>d.name===t);r[u].status=r[u].status===i?n:i}else r.forEach((u,d)=>{r[d].status=u.name===t?n:i});const o=r.filter(u=>u.status===n),l=this.getOptions();r.some(u=>u.status===i)?l.data.selectedGroups=o.map(u=>u.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(T.Legend.ITEMS_UPDATE,{dataGroups:r}),this.set({dataGroups:r})}getIsFilled(t,n,i,r){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,i,r):r}getFillColor(t,n,i){const r=this.getOptions(),s=y(this.colorScale,t);return r.getFillColor?r.getFillColor(t,n,i,s):s}getStrokeColor(t,n,i){const r=this.getOptions(),s=y(this.colorScale,t);return r.getStrokeColor?r.getStrokeColor(t,n,i,s):s}isUserProvidedColorScaleValid(){const t=y(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(i=>Object.keys(t).includes(i.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let i=t.originalClassName;return t.classNameTypes.forEach(r=>i=t.originalClassName?`${i} ${r}-${n}`:`${r}-${n}`),i||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:i,labels:r}=t;return i.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=y(s,"label");if(c===null){const d=y(r,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:r[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const n=this.getTabularDataArray().map(a=>a.map(o=>`"${(o==="–"?"–":o).split(/[,;'"`]/).map(u=>zR(u)).join("")}"`)).map(a=>a.join(",")).join(`
|
|
2
|
-
`),i=this.getOptions();let r="myChart";const s=y(i,"fileDownload","fileName");typeof s=="function"?r=s("csv"):typeof s=="string"&&(r=s),this.services.files.downloadCSV(n,`${r}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:i,DISABLED:r}=Pt.items.status,s=this.getOptions(),a=rs(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(c=>a.includes(c))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?i:r;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=y(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=y(this.getOptions(),"color","pairing");let n=y(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let i=y(t,"option");const r=Ng.pairingOptions,s=n>5?14:n,a=`${s}-color`;i=i<=r[a]?i:1;const o=this.allDataGroups.map((l,c)=>`${s}-${i}-${c%14+1}`);this.colorClassNames=ya().range(o).domain(this.allDataGroups)}}function WR(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(),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),t&&(i.href=t),r.href=e,r.href}const YR=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function An(e){const t=[];for(let n=0,i=e.length;n<i;n++)t.push(e[n]);return t}function eo(e,t){const i=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return i?parseFloat(i.replace("px","")):0}function qR(e){const t=eo(e,"border-left-width"),n=eo(e,"border-right-width");return e.clientWidth+t+n}function XR(e){const t=eo(e,"border-top-width"),n=eo(e,"border-bottom-width");return e.clientHeight+t+n}function gm(e,t={}){const n=t.width||qR(e),i=t.height||XR(e);return{width:n,height:i}}function ZR(){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 Te=16384;function jR(e){(e.width>Te||e.height>Te)&&(e.width>Te&&e.height>Te?e.width>e.height?(e.height*=Te/e.width,e.width=Te):(e.width*=Te/e.height,e.height=Te):e.width>Te?(e.height*=Te/e.width,e.width=Te):(e.width*=Te/e.height,e.height=Te))}function no(e){return new Promise((t,n)=>{const i=new Image;i.decode=()=>t(i),i.onload=()=>t(i),i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=e})}async function KR(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function QR(e,t,n){const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),s=document.createElementNS(i,"foreignObject");return r.setAttribute("width",`${t}`),r.setAttribute("height",`${n}`),r.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"),r.appendChild(s),s.appendChild(e),KR(r)}const ge=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ge(n,t)};function JR(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function tI(e){return An(e).map(t=>{const n=e.getPropertyValue(t),i=e.getPropertyPriority(t);return`${t}: ${n}${i?" !important":""};`}).join(" ")}function eI(e,t,n){const i=`.${e}:${t}`,r=n.cssText?JR(n):tI(n);return document.createTextNode(`${i}{${r}}`)}function mm(e,t,n){const i=window.getComputedStyle(e,n),r=i.getPropertyValue("content");if(r===""||r==="none")return;const s=YR();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(eI(s,n,i)),t.appendChild(a)}function nI(e,t){mm(e,t,":before"),mm(e,t,":after")}const vm="application/font-woff",ym="image/jpeg",iI={woff:vm,woff2:vm,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:ym,jpeg:ym,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function rI(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function su(e){const t=rI(e).toLowerCase();return iI[t]||""}function sI(e){return e.split(/,/)[1]}function au(e){return e.search(/^(data:)/)!==-1}function aI(e,t){return`data:${t};base64,${e}`}async function Em(e,t,n){const i=await fetch(e,t);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const r=await i.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:i,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(r)})}const ou={};function oI(e,t,n){let i=e.replace(/\?.*/,"");return n&&(i=e),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),t?`[${t}]${i}`:i}async function lu(e,t,n){const i=oI(e,t,n.includeQueryParams);if(ou[i]!=null)return ou[i];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let r;try{const s=await Em(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),sI(o)));r=aI(s,t)}catch(s){r=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return ou[i]=r,r}async function lI(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):no(t)}async function cI(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a?.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return no(o)}const n=e.poster,i=su(n),r=await lu(n,i,t);return no(r)}async function uI(e){var t;try{if(!((t=e?.contentDocument)===null||t===void 0)&&t.body)return await io(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function hI(e,t){return ge(e,HTMLCanvasElement)?lI(e):ge(e,HTMLVideoElement)?cI(e,t):ge(e,HTMLIFrameElement)?uI(e):e.cloneNode(!1)}const dI=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function fI(e,t,n){var i,r;let s=[];return dI(e)&&e.assignedNodes?s=An(e.assignedNodes()):ge(e,HTMLIFrameElement)&&(!((i=e.contentDocument)===null||i===void 0)&&i.body)?s=An(e.contentDocument.body.childNodes):s=An(((r=e.shadowRoot)!==null&&r!==void 0?r:e).childNodes),s.length===0||ge(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>io(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function pI(e,t){const n=t.style;if(!n)return;const i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):An(i).forEach(r=>{let s=i.getPropertyValue(r);r==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),ge(e,HTMLIFrameElement)&&r==="display"&&s==="inline"&&(s="block"),r==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(r,s,i.getPropertyPriority(r))})}function gI(e,t){ge(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ge(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function mI(e,t){if(ge(e,HTMLSelectElement)){const n=t,i=Array.from(n.children).find(r=>e.value===r.getAttribute("value"));i&&i.setAttribute("selected","")}}function vI(e,t){return ge(t,Element)&&(pI(e,t),nI(e,t),gI(e,t),mI(e,t)),t}async function yI(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const i={};for(let s=0;s<n.length;s++){const o=n[s].getAttribute("xlink:href");if(o){const l=e.querySelector(o),c=document.querySelector(o);!l&&c&&!i[o]&&(i[o]=await io(c,t,!0))}}const r=Object.values(i);if(r.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<r.length;l++)o.appendChild(r[l]);e.appendChild(a)}return e}async function io(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(i=>hI(i,t)).then(i=>fI(e,i,t)).then(i=>vI(e,i)).then(i=>yI(i,t))}const xm=/url\((['"]?)([^'"]+?)\1\)/g,EI=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,xI=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function bI(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function SI(e){const t=[];return e.replace(xm,(n,i,r)=>(t.push(r),n)),t.filter(n=>!au(n))}async function _I(e,t,n,i,r){try{const s=n?WR(t,n):t,a=su(t);let o;return r||(o=await lu(s,a,i)),e.replace(bI(t),`$1${o}$3`)}catch{}return e}function TI(e,{preferredFontFormat:t}){return t?e.replace(xI,n=>{for(;;){const[i,,r]=EI.exec(n)||[];if(!r)return"";if(r===t)return`src: ${i};`}}):e}function bm(e){return e.search(xm)!==-1}async function Sm(e,t,n){if(!bm(e))return e;const i=TI(e,n);return SI(i).reduce((s,a)=>s.then(o=>_I(o,a,t,n)),Promise.resolve(i))}async function ro(e,t,n){var i;const r=(i=t.style)===null||i===void 0?void 0:i.getPropertyValue(e);if(r){const s=await Sm(r,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function OI(e,t){await ro("background",e,t)||await ro("background-image",e,t),await ro("mask",e,t)||await ro("mask-image",e,t)}async function wI(e,t){const n=ge(e,HTMLImageElement);if(!(n&&!au(e.src))&&!(ge(e,SVGImageElement)&&!au(e.href.baseVal)))return;const i=n?e.src:e.href.baseVal,r=await lu(i,su(i),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=r):e.href.baseVal=r})}async function MI(e,t){const i=An(e.childNodes).map(r=>_m(r,t));await Promise.all(i).then(()=>e)}async function _m(e,t){ge(e,Element)&&(await OI(e,t),await wI(e,t),await MI(e,t))}function CI(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 i=t.style;return i!=null&&Object.keys(i).forEach(r=>{n[r]=i[r]}),e}const Tm={};async function Om(e){let t=Tm[e];if(t!=null)return t;const i=await(await fetch(e)).text();return t={url:e,cssText:i},Tm[e]=t,t}async function wm(e,t){let n=e.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let o=a.replace(i,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Em(o,t.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>n)}function Mm(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=e.replace(n,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=r.exec(i);if(l===null)break;t.push(l[0])}i=i.replace(r,"");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(i);if(l===null){if(l=o.exec(i),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function AI(e,t){const n=[],i=[];return e.forEach(r=>{if("cssRules"in r)try{An(r.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Om(l).then(u=>wm(u,t)).then(u=>Mm(u).forEach(d=>{try{r.insertRule(d,d.startsWith("@import")?o+=1:r.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});i.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];r.href!=null&&i.push(Om(r.href).then(o=>wm(o,t)).then(o=>Mm(o).forEach(l=>{a.insertRule(l,r.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(i).then(()=>(e.forEach(r=>{if("cssRules"in r)try{An(r.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${r.href}`,s)}}),n))}function DI(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>bm(t.style.getPropertyValue("src")))}async function LI(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=An(e.ownerDocument.styleSheets),i=await AI(n,t);return DI(i)}async function RI(e,t){const n=await LI(e,t);return(await Promise.all(n.map(r=>{const s=r.parentStyleSheet?r.parentStyleSheet.href:null;return Sm(r.cssText,s,t)}))).join(`
|
|
3
|
-
`)}async function II(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await RI(e,t);if(n){const i=document.createElement("style"),r=document.createTextNode(n);i.appendChild(r),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}}async function kI(e,t={}){const{width:n,height:i}=gm(e,t),r=await io(e,t,!0);return await II(r,t),await _m(r,t),CI(r,t),await QR(r,n,i)}async function Cm(e,t={}){const{width:n,height:i}=gm(e,t),r=await kI(e,t),s=await no(r),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||ZR(),c=t.canvasWidth||n,u=t.canvasHeight||i;return a.width=c*l,a.height=u*l,t.skipAutoScale||jR(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 PI(e,t={}){return(await Cm(e,t)).toDataURL()}async function NI(e,t={}){return(await Cm(e,t)).toDataURL("image/jpeg",t.quality||1)}class Dn{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const $I="DONT_STYLE_ME_css_styles_verifier";class k extends Dn{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=I(t));const i={width:0,height:0},r=h=>{h&&Object.keys(i).forEach(f=>{if(h[f]){const p=h[f],g=parseFloat(p);p&&g>i[f]&&(""+p).indexOf("%")===-1&&(i[f]=g)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof a?.getBoundingClientRect=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(r(s),i.width>0&&i.height>0))return i;if(n.useClientDimensions&&(r(d),i.width>0&&i.height>0))return d;if(n.useBBox&&(r(l),i.width>0&&i.height>0))return l;if(n.useBoundingRect&&(r(u),i.width>0&&i.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};r(h)}catch{r(d),r(l),r(s)}return i}static appendOrSelect(t,n){const i=t.select(`${n}`);if(i.empty()){let r=n.split("#"),s,a;return r.length===2?(s=r[0],r=r[1].split("."),a=r[0]):(r=n.split("."),s=r[0]),t.append(s).attr("id",a).attr("class",r.slice(1).join(" "))}return i}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const i={left:0,top:0},r=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{i.left=r.left-s.left,i.top=r.top-s.top}catch(a){console.error(a)}return i}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){const t=this.model.getOptions().chartId;t?this.chartID=t:this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),i=I(this.getHolder()).append("div").classed(`${pe}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");i.append("g").attr("class",$I),this.mainContainer=i.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:i,theme:r}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),i!==this.height&&(t.style.height=i,this.height=i),I(this.getHolder()).classed(`${pe}--chart-holder`,!0).attr("data-carbon-theme",r)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),i=this.getHolder(),r=I(i);r.classed("filled",!0),NI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("jpg"):typeof o=="string"&&(a=o),t.services.files?.downloadImage(s,`${a}.jpg`),r.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),i=this.getHolder(),r=I(i);r.classed("filled",!0),PI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("png"):typeof o=="string"&&(a=o),t.services.files?.downloadImage(s,`${a}.png`),r.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(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=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=k.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),i=I(this.mainContainer).selectAll(`.${n} > svg`);let r=0;i.nodes().forEach(function(s){r+=Number(k.getSVGElementSize(I(s),{useBBox:!0}).height)}),r<=t?I(this.mainContainer).attr("height",r):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(t).on("mouseover",()=>{this.services.events?.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{this.services.events?.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,i=t.clientHeight;const r=Ya(()=>{t&&(Math.abs(n-t.clientWidth)>1||Math.abs(i-t.clientHeight)>1)&&(n=t.clientWidth,i=t.clientHeight,this.services.events?.dispatchEvent(T.Chart.RESIZE))},12.5);new ResizeObserver(r).observe(t)}}class vt{constructor(t,n,i){if(this.type="",this.renderType=st.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,i&&(this.configs=i,this.configs.id)){const r=y(this.model.getOptions(),"style","prefix");this.id=`${r}--${this.configs.id}`}this.parent||this.setParent(I(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){const n=this.parent;if(this.parent=t,!(n&&n.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");this.parent?.classed(`${pe}--${i}--${this.type}`,!0),n&&n.classed(`${pe}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=y(this.model.getOptions(),"style","prefix"),i=this.id?`#${this.id}`:"",r=k.appendOrSelect(this.parent,`${this.renderType===st.SVG?"svg":"div"}${i}.${pe}--${n}--${this.type}`);if(t.ariaLabel&&r.attr("aria-label",t.ariaLabel),t.isPresentational&&r.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const o=I(`#${s}`).select("rect");if(o.size()!==0){const l=parseFloat(o.attr("height")),c=parseFloat(o.attr("width"));!isNaN(l)&&!isNaN(c)&&l>0&&c>0&&r.attr("clip-path",`url(#${s})`)}}}return r.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ut({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:Am,setPrototypeOf:Dm,isFrozen:FI,getPrototypeOf:UI,getOwnPropertyDescriptor:BI}=Object;let{freeze:ae,seal:Ne,create:so}=Object,{apply:cu,construct:uu}=typeof Reflect<"u"&&Reflect;ae||(ae=function(t){return t}),Ne||(Ne=function(t){return t}),cu||(cu=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];return t.apply(n,r)}),uu||(uu=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});const ao=le(Array.prototype.forEach),HI=le(Array.prototype.lastIndexOf),Lm=le(Array.prototype.pop),vs=le(Array.prototype.push),GI=le(Array.prototype.splice),oo=le(String.prototype.toLowerCase),hu=le(String.prototype.toString),du=le(String.prototype.match),ys=le(String.prototype.replace),VI=le(String.prototype.indexOf),zI=le(String.prototype.trim),Oe=le(Object.prototype.hasOwnProperty),oe=le(RegExp.prototype.test),Es=WI(TypeError);function le(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return cu(e,t,i)}}function WI(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return uu(e,n)}}function gt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oo;Dm&&Dm(e,null);let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){const s=n(r);s!==r&&(FI(t)||(t[i]=s),r=s)}e[r]=!0}return e}function YI(e){for(let t=0;t<e.length;t++)Oe(e,t)||(e[t]=null);return e}function on(e){const t=so(null);for(const[n,i]of Am(e))Oe(e,n)&&(Array.isArray(i)?t[n]=YI(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=on(i):t[n]=i);return t}function xs(e,t){for(;e!==null;){const i=BI(e,t);if(i){if(i.get)return le(i.get);if(typeof i.value=="function")return le(i.value)}e=UI(e)}function n(){return null}return n}const Rm=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fu=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),pu=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),qI=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),gu=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),XI=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Im=ae(["#text"]),km=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),mu=ae(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pm=ae(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),lo=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ZI=Ne(/\{\{[\w\W]*|[\w\W]*\}\}/gm),jI=Ne(/<%[\w\W]*|[\w\W]*%>/gm),KI=Ne(/\$\{[\w\W]*/gm),QI=Ne(/^data-[\-\w.\u00B7-\uFFFF]+$/),JI=Ne(/^aria-[\-\w]+$/),Nm=Ne(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tk=Ne(/^(?:\w+script|data):/i),ek=Ne(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$m=Ne(/^html$/i),nk=Ne(/^[a-z][.\w]*(-[.\w]+)+$/i);var Fm=Object.freeze({__proto__:null,ARIA_ATTR:JI,ATTR_WHITESPACE:ek,CUSTOM_ELEMENT:nk,DATA_ATTR:QI,DOCTYPE_NAME:$m,ERB_EXPR:jI,IS_ALLOWED_URI:Nm,IS_SCRIPT_OR_DATA:tk,MUSTACHE_EXPR:ZI,TMPLIT_EXPR:KI});const bs={element:1,text:3,progressingInstruction:7,comment:8,document:9},ik=function(){return typeof window>"u"?null:window},rk=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Um=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Bm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ik();const t=ot=>Bm(ot);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==bs.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const i=n,r=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=e,p=l.prototype,g=xs(p,"cloneNode"),m=xs(p,"remove"),v=xs(p,"nextSibling"),S=xs(p,"childNodes"),E=xs(p,"parentNode");if(typeof a=="function"){const ot=n.createElement("template");ot.content&&ot.content.ownerDocument&&(n=ot.content.ownerDocument)}let b,x="";const{implementation:_,createNodeIterator:C,createDocumentFragment:D,getElementsByTagName:$}=n,{importNode:P}=i;let w=Um();t.isSupported=typeof Am=="function"&&typeof E=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:N,TMPLIT_EXPR:M,DATA_ATTR:O,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:B}=Fm;let{IS_ALLOWED_URI:tt}=Fm,Z=null;const Y=gt({},[...Rm,...fu,...pu,...gu,...Im]);let Q=null;const ht=gt({},[...km,...mu,...Pm,...lo]);let et=Object.seal(so(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),K=null,nt=null;const ct=Object.seal(so(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let W=!0,j=!0,J=!1,L=!0,G=!1,V=!0,yt=!1,Ut=!1,at=!1,bt=!1,$e=!1,he=!1,Os=!0,lr=!1;const ws="user-content-";let Rn=!0,Ms=!1,cr={},un=null;const Iu=gt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let kv=null;const Pv=gt({},["audio","video","img","source","image","track"]);let ku=null;const Nv=gt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Eo="http://www.w3.org/1998/Math/MathML",xo="http://www.w3.org/2000/svg",In="http://www.w3.org/1999/xhtml";let ur=In,Pu=!1,Nu=null;const j$=gt({},[Eo,xo,In],hu);let bo=gt({},["mi","mo","mn","ms","mtext"]),So=gt({},["annotation-xml"]);const K$=gt({},["title","style","font","a","script"]);let Cs=null;const Q$=["application/xhtml+xml","text/html"],J$="text/html";let qt=null,hr=null;const tF=n.createElement("form"),$v=function(A){return A instanceof RegExp||A instanceof Function},$u=function(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(hr&&hr===A)){if((!A||typeof A!="object")&&(A={}),A=on(A),Cs=Q$.indexOf(A.PARSER_MEDIA_TYPE)===-1?J$:A.PARSER_MEDIA_TYPE,qt=Cs==="application/xhtml+xml"?hu:oo,Z=Oe(A,"ALLOWED_TAGS")?gt({},A.ALLOWED_TAGS,qt):Y,Q=Oe(A,"ALLOWED_ATTR")?gt({},A.ALLOWED_ATTR,qt):ht,Nu=Oe(A,"ALLOWED_NAMESPACES")?gt({},A.ALLOWED_NAMESPACES,hu):j$,ku=Oe(A,"ADD_URI_SAFE_ATTR")?gt(on(Nv),A.ADD_URI_SAFE_ATTR,qt):Nv,kv=Oe(A,"ADD_DATA_URI_TAGS")?gt(on(Pv),A.ADD_DATA_URI_TAGS,qt):Pv,un=Oe(A,"FORBID_CONTENTS")?gt({},A.FORBID_CONTENTS,qt):Iu,K=Oe(A,"FORBID_TAGS")?gt({},A.FORBID_TAGS,qt):on({}),nt=Oe(A,"FORBID_ATTR")?gt({},A.FORBID_ATTR,qt):on({}),cr=Oe(A,"USE_PROFILES")?A.USE_PROFILES:!1,W=A.ALLOW_ARIA_ATTR!==!1,j=A.ALLOW_DATA_ATTR!==!1,J=A.ALLOW_UNKNOWN_PROTOCOLS||!1,L=A.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=A.SAFE_FOR_TEMPLATES||!1,V=A.SAFE_FOR_XML!==!1,yt=A.WHOLE_DOCUMENT||!1,bt=A.RETURN_DOM||!1,$e=A.RETURN_DOM_FRAGMENT||!1,he=A.RETURN_TRUSTED_TYPE||!1,at=A.FORCE_BODY||!1,Os=A.SANITIZE_DOM!==!1,lr=A.SANITIZE_NAMED_PROPS||!1,Rn=A.KEEP_CONTENT!==!1,Ms=A.IN_PLACE||!1,tt=A.ALLOWED_URI_REGEXP||Nm,ur=A.NAMESPACE||In,bo=A.MATHML_TEXT_INTEGRATION_POINTS||bo,So=A.HTML_INTEGRATION_POINTS||So,et=A.CUSTOM_ELEMENT_HANDLING||{},A.CUSTOM_ELEMENT_HANDLING&&$v(A.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(et.tagNameCheck=A.CUSTOM_ELEMENT_HANDLING.tagNameCheck),A.CUSTOM_ELEMENT_HANDLING&&$v(A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(et.attributeNameCheck=A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),A.CUSTOM_ELEMENT_HANDLING&&typeof A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(j=!1),$e&&(bt=!0),cr&&(Z=gt({},Im),Q=so(null),cr.html===!0&&(gt(Z,Rm),gt(Q,km)),cr.svg===!0&&(gt(Z,fu),gt(Q,mu),gt(Q,lo)),cr.svgFilters===!0&&(gt(Z,pu),gt(Q,mu),gt(Q,lo)),cr.mathMl===!0&&(gt(Z,gu),gt(Q,Pm),gt(Q,lo))),Oe(A,"ADD_TAGS")||(ct.tagCheck=null),Oe(A,"ADD_ATTR")||(ct.attributeCheck=null),A.ADD_TAGS&&(typeof A.ADD_TAGS=="function"?ct.tagCheck=A.ADD_TAGS:(Z===Y&&(Z=on(Z)),gt(Z,A.ADD_TAGS,qt))),A.ADD_ATTR&&(typeof A.ADD_ATTR=="function"?ct.attributeCheck=A.ADD_ATTR:(Q===ht&&(Q=on(Q)),gt(Q,A.ADD_ATTR,qt))),A.ADD_URI_SAFE_ATTR&>(ku,A.ADD_URI_SAFE_ATTR,qt),A.FORBID_CONTENTS&&(un===Iu&&(un=on(un)),gt(un,A.FORBID_CONTENTS,qt)),A.ADD_FORBID_CONTENTS&&(un===Iu&&(un=on(un)),gt(un,A.ADD_FORBID_CONTENTS,qt)),Rn&&(Z["#text"]=!0),yt&>(Z,["html","head","body"]),Z.table&&(gt(Z,["tbody"]),delete K.tbody),A.TRUSTED_TYPES_POLICY){if(typeof A.TRUSTED_TYPES_POLICY.createHTML!="function")throw Es('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof A.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Es('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=A.TRUSTED_TYPES_POLICY,x=b.createHTML("")}else b===void 0&&(b=rk(f,r)),b!==null&&typeof x=="string"&&(x=b.createHTML(""));ae&&ae(A),hr=A}},Fv=gt({},[...fu,...pu,...qI]),Uv=gt({},[...gu,...XI]),eF=function(A){let X=E(A);(!X||!X.tagName)&&(X={namespaceURI:ur,tagName:"template"});const rt=oo(A.tagName),kt=oo(X.tagName);return Nu[A.namespaceURI]?A.namespaceURI===xo?X.namespaceURI===In?rt==="svg":X.namespaceURI===Eo?rt==="svg"&&(kt==="annotation-xml"||bo[kt]):!!Fv[rt]:A.namespaceURI===Eo?X.namespaceURI===In?rt==="math":X.namespaceURI===xo?rt==="math"&&So[kt]:!!Uv[rt]:A.namespaceURI===In?X.namespaceURI===xo&&!So[kt]||X.namespaceURI===Eo&&!bo[kt]?!1:!Uv[rt]&&(K$[rt]||!Fv[rt]):!!(Cs==="application/xhtml+xml"&&Nu[A.namespaceURI]):!1},hn=function(A){vs(t.removed,{element:A});try{E(A).removeChild(A)}catch{m(A)}},vi=function(A,X){try{vs(t.removed,{attribute:X.getAttributeNode(A),from:X})}catch{vs(t.removed,{attribute:null,from:X})}if(X.removeAttribute(A),A==="is")if(bt||$e)try{hn(X)}catch{}else try{X.setAttribute(A,"")}catch{}},Bv=function(A){let X=null,rt=null;if(at)A="<remove></remove>"+A;else{const Wt=du(A,/^[\r\n\t ]+/);rt=Wt&&Wt[0]}Cs==="application/xhtml+xml"&&ur===In&&(A='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+A+"</body></html>");const kt=b?b.createHTML(A):A;if(ur===In)try{X=new h().parseFromString(kt,Cs)}catch{}if(!X||!X.documentElement){X=_.createDocument(ur,"template",null);try{X.documentElement.innerHTML=Pu?x:kt}catch{}}const ie=X.body||X.documentElement;return A&&rt&&ie.insertBefore(n.createTextNode(rt),ie.childNodes[0]||null),ur===In?$.call(X,yt?"html":"body")[0]:yt?X.documentElement:ie},Hv=function(A){return C.call(A.ownerDocument||A,A,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Fu=function(A){return A instanceof d&&(typeof A.nodeName!="string"||typeof A.textContent!="string"||typeof A.removeChild!="function"||!(A.attributes instanceof u)||typeof A.removeAttribute!="function"||typeof A.setAttribute!="function"||typeof A.namespaceURI!="string"||typeof A.insertBefore!="function"||typeof A.hasChildNodes!="function")},Gv=function(A){return typeof o=="function"&&A instanceof o};function kn(ot,A,X){ao(ot,rt=>{rt.call(t,A,X,hr)})}const Vv=function(A){let X=null;if(kn(w.beforeSanitizeElements,A,null),Fu(A))return hn(A),!0;const rt=qt(A.nodeName);if(kn(w.uponSanitizeElement,A,{tagName:rt,allowedTags:Z}),V&&A.hasChildNodes()&&!Gv(A.firstElementChild)&&oe(/<[/\w!]/g,A.innerHTML)&&oe(/<[/\w!]/g,A.textContent)||A.nodeType===bs.progressingInstruction||V&&A.nodeType===bs.comment&&oe(/<[/\w]/g,A.data))return hn(A),!0;if(!(ct.tagCheck instanceof Function&&ct.tagCheck(rt))&&(!Z[rt]||K[rt])){if(!K[rt]&&Wv(rt)&&(et.tagNameCheck instanceof RegExp&&oe(et.tagNameCheck,rt)||et.tagNameCheck instanceof Function&&et.tagNameCheck(rt)))return!1;if(Rn&&!un[rt]){const kt=E(A)||A.parentNode,ie=S(A)||A.childNodes;if(ie&&kt){const Wt=ie.length;for(let ye=Wt-1;ye>=0;--ye){const Pn=g(ie[ye],!0);Pn.__removalCount=(A.__removalCount||0)+1,kt.insertBefore(Pn,v(A))}}}return hn(A),!0}return A instanceof l&&!eF(A)||(rt==="noscript"||rt==="noembed"||rt==="noframes")&&oe(/<\/no(script|embed|frames)/i,A.innerHTML)?(hn(A),!0):(G&&A.nodeType===bs.text&&(X=A.textContent,ao([H,N,M],kt=>{X=ys(X,kt," ")}),A.textContent!==X&&(vs(t.removed,{element:A.cloneNode()}),A.textContent=X)),kn(w.afterSanitizeElements,A,null),!1)},zv=function(A,X,rt){if(nt[X]||Os&&(X==="id"||X==="name")&&(rt in n||rt in tF))return!1;if(!(j&&!nt[X]&&oe(O,X))){if(!(W&&oe(F,X))){if(!(ct.attributeCheck instanceof Function&&ct.attributeCheck(X,A))){if(!Q[X]||nt[X]){if(!(Wv(A)&&(et.tagNameCheck instanceof RegExp&&oe(et.tagNameCheck,A)||et.tagNameCheck instanceof Function&&et.tagNameCheck(A))&&(et.attributeNameCheck instanceof RegExp&&oe(et.attributeNameCheck,X)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(X,A))||X==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&oe(et.tagNameCheck,rt)||et.tagNameCheck instanceof Function&&et.tagNameCheck(rt))))return!1}else if(!ku[X]){if(!oe(tt,ys(rt,R,""))){if(!((X==="src"||X==="xlink:href"||X==="href")&&A!=="script"&&VI(rt,"data:")===0&&kv[A])){if(!(J&&!oe(U,ys(rt,R,"")))){if(rt)return!1}}}}}}}return!0},Wv=function(A){return A!=="annotation-xml"&&du(A,B)},Yv=function(A){kn(w.beforeSanitizeAttributes,A,null);const{attributes:X}=A;if(!X||Fu(A))return;const rt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let kt=X.length;for(;kt--;){const ie=X[kt],{name:Wt,namespaceURI:ye,value:Pn}=ie,dr=qt(Wt),Uu=Pn;let Kt=Wt==="value"?Uu:zI(Uu);if(rt.attrName=dr,rt.attrValue=Kt,rt.keepAttr=!0,rt.forceKeepAttr=void 0,kn(w.uponSanitizeAttribute,A,rt),Kt=rt.attrValue,lr&&(dr==="id"||dr==="name")&&(vi(Wt,A),Kt=ws+Kt),V&&oe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Kt)){vi(Wt,A);continue}if(dr==="attributename"&&du(Kt,"href")){vi(Wt,A);continue}if(rt.forceKeepAttr)continue;if(!rt.keepAttr){vi(Wt,A);continue}if(!L&&oe(/\/>/i,Kt)){vi(Wt,A);continue}G&&ao([H,N,M],Xv=>{Kt=ys(Kt,Xv," ")});const qv=qt(A.nodeName);if(!zv(qv,dr,Kt)){vi(Wt,A);continue}if(b&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ye)switch(f.getAttributeType(qv,dr)){case"TrustedHTML":{Kt=b.createHTML(Kt);break}case"TrustedScriptURL":{Kt=b.createScriptURL(Kt);break}}if(Kt!==Uu)try{ye?A.setAttributeNS(ye,Wt,Kt):A.setAttribute(Wt,Kt),Fu(A)?hn(A):Lm(t.removed)}catch{vi(Wt,A)}}kn(w.afterSanitizeAttributes,A,null)},nF=function ot(A){let X=null;const rt=Hv(A);for(kn(w.beforeSanitizeShadowDOM,A,null);X=rt.nextNode();)kn(w.uponSanitizeShadowNode,X,null),Vv(X),Yv(X),X.content instanceof s&&ot(X.content);kn(w.afterSanitizeShadowDOM,A,null)};return t.sanitize=function(ot){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=null,rt=null,kt=null,ie=null;if(Pu=!ot,Pu&&(ot="<!-->"),typeof ot!="string"&&!Gv(ot))if(typeof ot.toString=="function"){if(ot=ot.toString(),typeof ot!="string")throw Es("dirty is not a string, aborting")}else throw Es("toString is not a function");if(!t.isSupported)return ot;if(Ut||$u(A),t.removed=[],typeof ot=="string"&&(Ms=!1),Ms){if(ot.nodeName){const Pn=qt(ot.nodeName);if(!Z[Pn]||K[Pn])throw Es("root node is forbidden and cannot be sanitized in-place")}}else if(ot instanceof o)X=Bv("<!---->"),rt=X.ownerDocument.importNode(ot,!0),rt.nodeType===bs.element&&rt.nodeName==="BODY"||rt.nodeName==="HTML"?X=rt:X.appendChild(rt);else{if(!bt&&!G&&!yt&&ot.indexOf("<")===-1)return b&&he?b.createHTML(ot):ot;if(X=Bv(ot),!X)return bt?null:he?x:""}X&&at&&hn(X.firstChild);const Wt=Hv(Ms?ot:X);for(;kt=Wt.nextNode();)Vv(kt),Yv(kt),kt.content instanceof s&&nF(kt.content);if(Ms)return ot;if(bt){if($e)for(ie=D.call(X.ownerDocument);X.firstChild;)ie.appendChild(X.firstChild);else ie=X;return(Q.shadowroot||Q.shadowrootmode)&&(ie=P.call(i,ie,!0)),ie}let ye=yt?X.outerHTML:X.innerHTML;return yt&&Z["!doctype"]&&X.ownerDocument&&X.ownerDocument.doctype&&X.ownerDocument.doctype.name&&oe($m,X.ownerDocument.doctype.name)&&(ye="<!DOCTYPE "+X.ownerDocument.doctype.name+`>
|
|
4
|
-
`+
|
|
1
|
+
(function(X,Ge){typeof exports=="object"&&typeof module<"u"?Ge(exports):typeof define=="function"&&define.amd?define(["exports"],Ge):(X=typeof globalThis<"u"?globalThis:X||self,Ge(X.Charts={}))})(this,function(X){"use strict";function Ge(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function e0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function To(e){let t,n,i;e.length!==2?(t=Ge,n=(o,l)=>Ge(e(o),l),i=(o,l)=>e(o)-l):(t=e===Ge||e===e0?e:n0,n=e,i=e);function r(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=r(o,l,c,u-1);return d>c&&i(o[d-1],l)>-i(o[d],l)?d-1:d}return{left:r,center:a,right:s}}function n0(){return 0}function i0(e){return e===null?NaN:+e}function*r0(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const _o=To(Ge).right;To(i0).center;function s0(e,t){let n=0;for(let i of e)i!=null&&(i=+i)>=i&&++n;return n}function He(e,t){let n,i;if(t===void 0)for(const r of e)r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i<r&&(i=r)));else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(n===void 0?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}class Yn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const s=n[r],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[i++]=o),t=a}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,s,a=0;if(n>0){for(a=t[--n];n>0&&(i=a,r=t[--n],a=i+r,s=r-(a-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=a+r,r==i-a&&(a=i))}return a}}class Hu extends Map{constructor(t,n=l0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(Vu(this,t))}has(t){return super.has(Vu(this,t))}set(t,n){return super.set(a0(this,t),n)}delete(t){return super.delete(o0(this,t))}}function Vu({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function a0({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function o0({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function l0(e){return e!==null&&typeof e=="object"?e.valueOf():e}function c0(e){return e}function u0(e=Ge){if(e===Ge)return zu;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function zu(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var h0=Array.prototype,d0=h0.slice;function Oo(e){return()=>e}const f0=Math.sqrt(50),p0=Math.sqrt(10),g0=Math.sqrt(2);function Is(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),a=s>=f0?10:s>=p0?5:s>=g0?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/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,r)*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?Is(e,t,n*2):[o,l,c]}function ks(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const i=t<e,[r,s,a]=i?Is(t,e,n):Is(e,t,n);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(i)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]=(r+c)/-a;else for(let c=0;c<o;++c)l[c]=(r+c)*a;return l}function xi(e,t,n){return t=+t,e=+e,n=+n,Is(e,t,n)[2]}function wo(e,t,n){t=+t,e=+e,n=+n;const i=t<e,r=i?xi(t,e,n):xi(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function m0(e,t,n){let i;for(;;){const r=xi(e,t,n);if(r===i||r===0||!isFinite(r))return[e,t];r>0?(e=Math.floor(e/r)*r,t=Math.ceil(t/r)*r):r<0&&(e=Math.ceil(e*r)/r,t=Math.floor(t*r)/r),i=r}}function v0(e){return Math.max(1,Math.ceil(Math.log(s0(e))/Math.LN2)+1)}function y0(){var e=c0,t=He,n=v0;function i(r){Array.isArray(r)||(r=Array.from(r));var s,a=r.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(r[s],s,r);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const E=h,b=+f;if(t===He&&([d,h]=m0(d,h,b)),f=ks(d,h,b),f[0]<=d&&(l=xi(d,h,b)),f[f.length-1]>=h)if(E>=h&&t===He){const x=xi(d,h,b);isFinite(x)&&(x>0?h=(Math.floor(h/x)+1)*x:x<0&&(h=(Math.ceil(h*-x)+1)/-x))}else f.pop()}for(var p=f.length,g=0,m=p;f[g]<=d;)++g;for(;f[m-1]>h;)--m;(g||m<p)&&(f=f.slice(g,m),p=m-g);var v=new Array(p+1),S;for(s=0;s<=p;++s)S=v[s]=[],S.x0=s>0?f[s-1]:d,S.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(p,Math.floor((o-d)/l))].push(r[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const E=Math.floor((d-o)*l);v[Math.min(p,E+(f[E]<=o))].push(r[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[_o(f,o,0,p)].push(r[s]);return v}return i.value=function(r){return arguments.length?(e=typeof r=="function"?r:Oo(r),i):e},i.domain=function(r){return arguments.length?(t=typeof r=="function"?r:Oo([r[0],r[1]]),i):t},i.thresholds=function(r){return arguments.length?(n=typeof r=="function"?r:Oo(Array.isArray(r)?d0.call(r):r),i):n},i}function qn(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function Fn(e,t){let n;for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);return n}function Wu(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?zu:u0(r);i>n;){if(i-n>600){const l=i-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(i,Math.floor(t+(l-c)*d/l+h));Wu(e,t,f,p,r)}const s=e[t];let a=n,o=i;for(yr(e,n,t),r(e[i],s)>0&&yr(e,n,i);a<o;){for(yr(e,a,o),++a,--o;r(e[a],s)<0;)++a;for(;r(e[o],s)>0;)--o}r(e[n],s)===0?yr(e,n,o):(++o,yr(e,o,i)),o<=t&&(n=o+1),t<=o&&(i=o-1)}return e}function yr(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Mo(e,t,n){if(e=Float64Array.from(r0(e)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return Fn(e);if(t>=1)return qn(e);var i,r=(i-1)*t,s=Math.floor(r),a=qn(Wu(e,s).subarray(0,s+1)),o=Fn(e.subarray(s+1));return a+(o-a)*(r-s)}}function*E0(e){for(const t of e)yield*t}function Yu(e){return Array.from(E0(e))}function x0(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i<r;)s[i]=e+i*n;return s}function b0(e){return e}var Ps=1,Ns=2,Ao=3,Er=4,qu=1e-6;function S0(e){return"translate("+e+",0)"}function T0(e){return"translate(0,"+e+")"}function _0(e){return t=>+e(t)}function O0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function w0(){return!this.__axis}function $s(e,t){var n=[],i=null,r=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ps||e===Er?-1:1,u=e===Er||e===Ns?"x":"y",d=e===Ps||e===Ao?S0:T0;function h(f){var p=i??(t.ticks?t.ticks.apply(t,n):t.domain()),g=r??(t.tickFormat?t.tickFormat.apply(t,n):b0),m=Math.max(s,0)+o,v=t.range(),S=+v[0]+l,E=+v[v.length-1]+l,b=(t.bandwidth?O0:_0)(t.copy(),l),x=f.selection?f.selection():f,T=x.selectAll(".domain").data([null]),C=x.selectAll(".tick").data(p,t).order(),D=C.exit(),$=C.enter().append("g").attr("class","tick"),P=C.select("line"),w=C.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge($),P=P.merge($.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),w=w.merge($.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ps?"0em":e===Ao?"0.71em":"0.32em")),f!==x&&(T=T.transition(f),C=C.transition(f),P=P.transition(f),w=w.transition(f),D=D.transition(f).attr("opacity",qu).attr("transform",function(G){return isFinite(G=b(G))?d(G+l):this.getAttribute("transform")}),$.attr("opacity",qu).attr("transform",function(G){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(G))?N:b(G))+l)})),D.remove(),T.attr("d",e===Er||e===Ns?a?"M"+c*a+","+S+"H"+l+"V"+E+"H"+c*a:"M"+l+","+S+"V"+E:a?"M"+S+","+c*a+"V"+l+"H"+E+"V"+c*a:"M"+S+","+l+"H"+E),C.attr("opacity",1).attr("transform",function(G){return d(b(G)+l)}),P.attr(u+"2",c*s),w.attr(u,c*m).text(g),x.filter(w0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Ns?"start":e===Er?"end":"middle"),x.each(function(){this.__axis=b})}return h.scale=function(f){return arguments.length?(t=f,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),h):n.slice()},h.tickValues=function(f){return arguments.length?(i=f==null?null:Array.from(f),h):i&&i.slice()},h.tickFormat=function(f){return arguments.length?(r=f,h):r},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function M0(e){return $s(Ps,e)}function A0(e){return $s(Ns,e)}function Co(e){return $s(Ao,e)}function Xu(e){return $s(Er,e)}var C0={value:()=>{}};function Do(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Fs(n)}function Fs(e){this._=e}function D0(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Fs.prototype=Do.prototype={constructor:Fs,on:function(e,t){var n=this._,i=D0(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=L0(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=Zu(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Zu(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fs(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function L0(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function Zu(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=C0,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Lo="http://www.w3.org/1999/xhtml";const ju={svg:"http://www.w3.org/2000/svg",xhtml:Lo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Us(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ju.hasOwnProperty(t)?{space:ju[t],local:e}:e}function R0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Lo&&t.documentElement.namespaceURI===Lo?t.createElement(e):t.createElementNS(n,e)}}function I0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ku(e){var t=Us(e);return(t.local?I0:R0)(t)}function k0(){}function Ro(e){return e==null?k0:function(){return this.querySelector(e)}}function P0(e){typeof e!="function"&&(e=Ro(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new Se(i,this._parents)}function N0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function $0(){return[]}function Qu(e){return e==null?$0:function(){return this.querySelectorAll(e)}}function F0(e){return function(){return N0(e.apply(this,arguments))}}function U0(e){typeof e=="function"?e=F0(e):e=Qu(e);for(var t=this._groups,n=t.length,i=[],r=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),r.push(l));return new Se(i,r)}function Ju(e){return function(){return this.matches(e)}}function th(e){return function(t){return t.matches(e)}}var B0=Array.prototype.find;function G0(e){return function(){return B0.call(this.children,e)}}function H0(){return this.firstElementChild}function V0(e){return this.select(e==null?H0:G0(typeof e=="function"?e:th(e)))}var z0=Array.prototype.filter;function W0(){return Array.from(this.children)}function Y0(e){return function(){return z0.call(this.children,e)}}function q0(e){return this.selectAll(e==null?W0:Y0(typeof e=="function"?e:th(e)))}function X0(e){typeof e!="function"&&(e=Ju(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Se(i,this._parents)}function eh(e){return new Array(e.length)}function Z0(){return new Se(this._enter||this._groups.map(eh),this._parents)}function Bs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Bs.prototype={constructor:Bs,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 j0(e){return function(){return e}}function K0(e,t,n,i,r,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],i[a]=o):n[a]=new Bs(e,s[a]);for(;a<l;++a)(o=t[a])&&(r[a]=o)}function Q0(e,t,n,i,r,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?r[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(i[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new Bs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(r[o]=l)}function J0(e){return e.__data__}function ty(e,t){if(!arguments.length)return Array.from(this,J0);var n=t?Q0:K0,i=this._parents,r=this._groups;typeof e!="function"&&(e=j0(e));for(var s=r.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=i[c],d=r[c],h=d.length,f=ey(e.call(u,u&&u.__data__,c,i)),p=f.length,g=o[c]=new Array(p),m=a[c]=new Array(p),v=l[c]=new Array(h);n(u,d,g,m,v,f,t);for(var S=0,E=0,b,x;S<p;++S)if(b=g[S]){for(S>=E&&(E=S+1);!(x=m[E])&&++E<p;);b._next=x||null}}return a=new Se(a,i),a._enter=o,a._exit=l,a}function ey(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ny(){return new Se(this._exit||this._groups.map(eh),this._parents)}function iy(e,t,n){var i=this.enter(),r=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function ry(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,r=n.length,s=i.length,a=Math.min(r,s),o=new Array(r),l=0;l<a;++l)for(var c=n[l],u=i[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<r;++l)o[l]=n[l];return new Se(o,this._parents)}function sy(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],r=i.length-1,s=i[r],a;--r>=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function ay(e){e||(e=oy);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var a=n[s],o=a.length,l=r[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new Se(r,this._parents).order()}function oy(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ly(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cy(){return Array.from(this)}function uy(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length;r<s;++r){var a=i[r];if(a)return a}return null}function hy(){let e=0;for(const t of this)++e;return e}function dy(){return!this.node()}function fy(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r=t[n],s=0,a=r.length,o;s<a;++s)(o=r[s])&&e.call(o,o.__data__,s,r);return this}function py(e){return function(){this.removeAttribute(e)}}function gy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function my(e,t){return function(){this.setAttribute(e,t)}}function vy(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function yy(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ey(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 xy(e,t){var n=Us(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?gy:py:typeof t=="function"?n.local?Ey:yy:n.local?vy:my)(n,t))}function nh(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function by(e){return function(){this.style.removeProperty(e)}}function Sy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ty(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function _y(e,t,n){return arguments.length>1?this.each((t==null?by:typeof t=="function"?Ty:Sy)(e,t,n??"")):bi(this.node(),e)}function bi(e,t){return e.style.getPropertyValue(t)||nh(e).getComputedStyle(e,null).getPropertyValue(t)}function Oy(e){return function(){delete this[e]}}function wy(e,t){return function(){this[e]=t}}function My(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ay(e,t){return arguments.length>1?this.each((t==null?Oy:typeof t=="function"?My:wy)(e,t)):this.node()[e]}function ih(e){return e.trim().split(/^|\s+/)}function Io(e){return e.classList||new rh(e)}function rh(e){this._node=e,this._names=ih(e.getAttribute("class")||"")}rh.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 sh(e,t){for(var n=Io(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function ah(e,t){for(var n=Io(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function Cy(e){return function(){sh(this,e)}}function Dy(e){return function(){ah(this,e)}}function Ly(e,t){return function(){(t.apply(this,arguments)?sh:ah)(this,e)}}function Ry(e,t){var n=ih(e+"");if(arguments.length<2){for(var i=Io(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Ly:t?Cy:Dy)(n,t))}function Iy(){this.textContent=""}function ky(e){return function(){this.textContent=e}}function Py(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ny(e){return arguments.length?this.each(e==null?Iy:(typeof e=="function"?Py:ky)(e)):this.node().textContent}function $y(){this.innerHTML=""}function Fy(e){return function(){this.innerHTML=e}}function Uy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function By(e){return arguments.length?this.each(e==null?$y:(typeof e=="function"?Uy:Fy)(e)):this.node().innerHTML}function Gy(){this.nextSibling&&this.parentNode.appendChild(this)}function Hy(){return this.each(Gy)}function Vy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zy(){return this.each(Vy)}function Wy(e){var t=typeof e=="function"?e:Ku(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Yy(){return null}function qy(e,t){var n=typeof e=="function"?e:Ku(e),i=t==null?Yy:typeof t=="function"?t:Ro(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Xy(){var e=this.parentNode;e&&e.removeChild(this)}function Zy(){return this.each(Xy)}function jy(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ky(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qy(e){return this.select(e?Ky:jy)}function Jy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function t1(e){return function(t){e.call(this,t,this.__data__)}}function e1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function n1(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n<r;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function i1(e,t,n){return function(){var i=this.__on,r,s=t1(t);if(i){for(var a=0,o=i.length;a<o;++a)if((r=i[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=t;return}}this.addEventListener(e.type,s,n),r={type:e.type,name:e.name,value:t,listener:s,options:n},i?i.push(r):this.__on=[r]}}function r1(e,t,n){var i=e1(e+""),r,s=i.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(r=0,u=o[l];r<s;++r)if((a=i[r]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?i1:n1,r=0;r<s;++r)this.each(o(i[r],t,n));return this}function oh(e,t,n){var i=nh(e),r=i.CustomEvent;typeof r=="function"?r=new r(t,n):(r=i.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function s1(e,t){return function(){return oh(this,e,t)}}function a1(e,t){return function(){return oh(this,e,t.apply(this,arguments))}}function o1(e,t){return this.each((typeof t=="function"?a1:s1)(e,t))}function*l1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length,a;r<s;++r)(a=i[r])&&(yield a)}var lh=[null];function Se(e,t){this._groups=e,this._parents=t}function xr(){return new Se([[document.documentElement]],lh)}function c1(){return this}Se.prototype=xr.prototype={constructor:Se,select:P0,selectAll:U0,selectChild:V0,selectChildren:q0,filter:X0,data:ty,enter:Z0,exit:ny,join:iy,merge:ry,selection:c1,order:sy,sort:ay,call:ly,nodes:cy,node:uy,size:hy,empty:dy,each:fy,attr:xy,style:_y,property:Ay,classed:Ry,text:Ny,html:By,raise:Hy,lower:zy,append:Wy,insert:qy,remove:Zy,clone:Qy,datum:Jy,on:r1,dispatch:o1,[Symbol.iterator]:l1};function I(e){return typeof e=="string"?new Se([[document.querySelector(e)]],[document.documentElement]):new Se([[e]],lh)}function u1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xn(e,t){if(e=u1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const ko={capture:!0,passive:!1};function Po(e){e.preventDefault(),e.stopImmediatePropagation()}function h1(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",Po,ko);"onselectstart"in t?n.on("selectstart.drag",Po,ko):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function d1(e,t){var n=e.document.documentElement,i=I(e).on("dragstart.drag",null);t&&(i.on("click.drag",Po,ko),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function No(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ch(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function br(){}var Sr=.7,Gs=1/Sr,Si="\\s*([+-]?\\d+)\\s*",Tr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",en="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",f1=/^#([0-9a-f]{3,8})$/,p1=new RegExp(`^rgb\\(${Si},${Si},${Si}\\)$`),g1=new RegExp(`^rgb\\(${en},${en},${en}\\)$`),m1=new RegExp(`^rgba\\(${Si},${Si},${Si},${Tr}\\)$`),v1=new RegExp(`^rgba\\(${en},${en},${en},${Tr}\\)$`),y1=new RegExp(`^hsl\\(${Tr},${en},${en}\\)$`),E1=new RegExp(`^hsla\\(${Tr},${en},${en},${Tr}\\)$`),uh={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};No(br,mn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:hh,formatHex:hh,formatHex8:x1,formatHsl:b1,formatRgb:dh,toString:dh});function hh(){return this.rgb().formatHex()}function x1(){return this.rgb().formatHex8()}function b1(){return vh(this).formatHsl()}function dh(){return this.rgb().formatRgb()}function mn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=f1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?fh(t):n===3?new pe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Hs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Hs(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=p1.exec(e))?new pe(t[1],t[2],t[3],1):(t=g1.exec(e))?new pe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=m1.exec(e))?Hs(t[1],t[2],t[3],t[4]):(t=v1.exec(e))?Hs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=y1.exec(e))?mh(t[1],t[2]/100,t[3]/100,1):(t=E1.exec(e))?mh(t[1],t[2]/100,t[3]/100,t[4]):uh.hasOwnProperty(e)?fh(uh[e]):e==="transparent"?new pe(NaN,NaN,NaN,0):null}function fh(e){return new pe(e>>16&255,e>>8&255,e&255,1)}function Hs(e,t,n,i){return i<=0&&(e=t=n=NaN),new pe(e,t,n,i)}function S1(e){return e instanceof br||(e=mn(e)),e?(e=e.rgb(),new pe(e.r,e.g,e.b,e.opacity)):new pe}function $o(e,t,n,i){return arguments.length===1?S1(e):new pe(e,t,n,i??1)}function pe(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}No(pe,$o,ch(br,{brighter(e){return e=e==null?Gs:Math.pow(Gs,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sr:Math.pow(Sr,e),new pe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pe(Zn(this.r),Zn(this.g),Zn(this.b),Vs(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:ph,formatHex:ph,formatHex8:T1,formatRgb:gh,toString:gh}));function ph(){return`#${jn(this.r)}${jn(this.g)}${jn(this.b)}`}function T1(){return`#${jn(this.r)}${jn(this.g)}${jn(this.b)}${jn((isNaN(this.opacity)?1:this.opacity)*255)}`}function gh(){const e=Vs(this.opacity);return`${e===1?"rgb(":"rgba("}${Zn(this.r)}, ${Zn(this.g)}, ${Zn(this.b)}${e===1?")":`, ${e})`}`}function Vs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jn(e){return e=Zn(e),(e<16?"0":"")+e.toString(16)}function mh(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ve(e,t,n,i)}function vh(e){if(e instanceof Ve)return new Ve(e.h,e.s,e.l,e.opacity);if(e instanceof br||(e=mn(e)),!e)return new Ve;if(e instanceof Ve)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),a=NaN,o=s-r,l=(s+r)/2;return o?(t===s?a=(n-i)/o+(n<i)*6:n===s?a=(i-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new Ve(a,o,l,e.opacity)}function yh(e,t,n,i){return arguments.length===1?vh(e):new Ve(e,t,n,i??1)}function Ve(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}No(Ve,yh,ch(br,{brighter(e){return e=e==null?Gs:Math.pow(Gs,e),new Ve(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sr:Math.pow(Sr,e),new Ve(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,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new pe(Fo(e>=240?e-240:e+120,r,i),Fo(e,r,i),Fo(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Ve(Eh(this.h),zs(this.s),zs(this.l),Vs(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=Vs(this.opacity);return`${e===1?"hsl(":"hsla("}${Eh(this.h)}, ${zs(this.s)*100}%, ${zs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Eh(e){return e=(e||0)%360,e<0?e+360:e}function zs(e){return Math.max(0,Math.min(1,e||0))}function Fo(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 Uo=e=>()=>e;function _1(e,t){return function(n){return e+n*t}}function O1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function w1(e){return(e=+e)==1?xh:function(t,n){return n-t?O1(t,n,e):Uo(isNaN(t)?n:t)}}function xh(e,t){var n=t-e;return n?_1(e,n):Uo(isNaN(e)?t:e)}const Ws=function e(t){var n=w1(t);function i(r,s){var a=n((r=$o(r)).r,(s=$o(s)).r),o=n(r.g,s.g),l=n(r.b,s.b),c=xh(r.opacity,s.opacity);return function(u){return r.r=a(u),r.g=o(u),r.b=l(u),r.opacity=c(u),r+""}}return i.gamma=e,i}(1);function M1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=e[r]*(1-s)+t[r]*s;return i}}function A1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function C1(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),s=new Array(n),a;for(a=0;a<i;++a)r[a]=_r(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<i;++a)s[a]=r[a](o);return s}}function D1(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Te(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function L1(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=_r(e[r],t[r]):i[r]=t[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var Bo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Go=new RegExp(Bo.source,"g");function R1(e){return function(){return e}}function I1(e){return function(t){return e(t)+""}}function bh(e,t){var n=Bo.lastIndex=Go.lastIndex=0,i,r,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(i=Bo.exec(e))&&(r=Go.exec(t));)(s=r.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(i=i[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:Te(i,r)})),n=Go.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?I1(l[0].x):R1(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function _r(e,t){var n=typeof t,i;return t==null||n==="boolean"?Uo(t):(n==="number"?Te:n==="string"?(i=mn(t))?(t=i,Ws):bh:t instanceof mn?Ws:t instanceof Date?D1:A1(t)?M1:Array.isArray(t)?C1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?L1:Te)(e,t)}function Sh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Th=180/Math.PI,Ho={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _h(e,t,n,i,r,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(o=Math.sqrt(n*n+i*i))&&(n/=o,i/=o,l/=o),e*i<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*Th,skewX:Math.atan(l)*Th,scaleX:a,scaleY:o}}var Ys;function k1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ho:_h(t.a,t.b,t.c,t.d,t.e,t.f)}function P1(e){return e==null||(Ys||(Ys=document.createElementNS("http://www.w3.org/2000/svg","g")),Ys.setAttribute("transform",e),!(e=Ys.transform.baseVal.consolidate()))?Ho:(e=e.matrix,_h(e.a,e.b,e.c,e.d,e.e,e.f))}function Oh(e,t,n,i){function r(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x:Te(c,d)},{i:g-2,x:Te(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(r(d)+"rotate(",null,i)-2,x:Te(c,u)})):u&&d.push(r(d)+"rotate("+u+i)}function o(c,u,d,h){c!==u?h.push({i:d.push(r(d)+"skewX(",null,i)-2,x:Te(c,u)}):u&&d.push(r(d)+"skewX("+u+i)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push(r(f)+"scale(",null,",",null,")");p.push({i:g-4,x:Te(c,d)},{i:g-2,x:Te(u,h)})}else(d!==1||h!==1)&&f.push(r(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,g=h.length,m;++p<g;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var N1=Oh(k1,"px, ","px)","deg)"),$1=Oh(P1,", ",")",")");function F1(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}var Ti=0,Or=0,wr=0,wh=1e3,qs,Mr,Xs=0,Kn=0,Zs=0,Ar=typeof performance=="object"&&performance.now?performance:Date,Mh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vo(){return Kn||(Mh(U1),Kn=Ar.now()+Zs)}function U1(){Kn=0}function js(){this._call=this._time=this._next=null}js.prototype=Ah.prototype={constructor:js,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Vo():+n)+(t==null?0:+t),!this._next&&Mr!==this&&(Mr?Mr._next=this:qs=this,Mr=this),this._call=e,this._time=n,zo()},stop:function(){this._call&&(this._call=null,this._time=1/0,zo())}};function Ah(e,t,n){var i=new js;return i.restart(e,t,n),i}function B1(){Vo(),++Ti;for(var e=qs,t;e;)(t=Kn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ti}function Ch(){Kn=(Xs=Ar.now())+Zs,Ti=Or=0;try{B1()}finally{Ti=0,H1(),Kn=0}}function G1(){var e=Ar.now(),t=e-Xs;t>wh&&(Zs-=t,Xs=e)}function H1(){for(var e,t=qs,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:qs=n);Mr=e,zo(i)}function zo(e){if(!Ti){Or&&(Or=clearTimeout(Or));var t=e-Kn;t>24?(e<1/0&&(Or=setTimeout(Ch,e-Ar.now()-Zs)),wr&&(wr=clearInterval(wr))):(wr||(Xs=Ar.now(),wr=setInterval(G1,wh)),Ti=1,Mh(Ch))}}function Dh(e,t,n){var i=new js;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var V1=Do("start","end","cancel","interrupt"),z1=[],Lh=0,Rh=1,Wo=2,Ks=3,Ih=4,Yo=5,Qs=6;function Js(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;W1(e,n,{name:t,index:i,group:r,on:V1,tween:z1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Lh})}function qo(e,t){var n=ze(e,t);if(n.state>Lh)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=ze(e,t);if(n.state>Ks)throw new Error("too late; already running");return n}function ze(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function W1(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=Ah(s,0,n.time);function s(c){n.state=Rh,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,f;if(n.state!==Rh)return l();for(u in i)if(f=i[u],f.name===n.name){if(f.state===Ks)return Dh(a);f.state===Ih?(f.state=Qs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=Qs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(Dh(function(){n.state===Ks&&(n.state=Ih,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Wo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Wo){for(n.state=Ks,r=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=f);r.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Yo,1),d=-1,h=r.length;++d<h;)r[d].call(e,u);n.state===Yo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Qs,n.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function Xo(e,t){var n=e.__transition,i,r,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((i=n[a]).name!==t){s=!1;continue}r=i.state>Wo&&i.state<Yo,i.state=Qs,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[a]}s&&delete e.__transition}}function Y1(e){return this.each(function(){Xo(this,e)})}function q1(e,t){var n,i;return function(){var r=nn(this,e),s=r.tween;if(s!==n){i=n=s;for(var a=0,o=i.length;a<o;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}r.tween=i}}function X1(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=nn(this,e),a=s.tween;if(a!==i){r=(i=a).slice();for(var o={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=o;break}l===c&&r.push(o)}s.tween=r}}function Z1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=ze(this.node(),n).tween,r=0,s=i.length,a;r<s;++r)if((a=i[r]).name===e)return a.value;return null}return this.each((t==null?q1:X1)(n,e,t))}function Zo(e,t,n){var i=e._id;return e.each(function(){var r=nn(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return ze(r,i).value[t]}}function kh(e,t){var n;return(typeof t=="number"?Te:t instanceof mn?Ws:(n=mn(t))?(t=n,Ws):bh)(e,t)}function j1(e){return function(){this.removeAttribute(e)}}function K1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Q1(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttribute(e);return a===r?null:a===i?s:s=t(i=a,n)}}function J1(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===r?null:a===i?s:s=t(i=a,n)}}function tE(e,t,n){var i,r,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===i&&l===r?s:(r=l,s=t(i=a,o)))}}function eE(e,t,n){var i,r,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===i&&l===r?s:(r=l,s=t(i=a,o)))}}function nE(e,t){var n=Us(e),i=n==="transform"?$1:kh;return this.attrTween(e,typeof t=="function"?(n.local?eE:tE)(n,i,Zo(this,"attr."+e,t)):t==null?(n.local?K1:j1)(n):(n.local?J1:Q1)(n,i,t))}function iE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function rE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function sE(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&rE(e,s)),n}return r._value=t,r}function aE(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&iE(e,s)),n}return r._value=t,r}function oE(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 i=Us(e);return this.tween(n,(i.local?sE:aE)(i,t))}function lE(e,t){return function(){qo(this,e).delay=+t.apply(this,arguments)}}function cE(e,t){return t=+t,function(){qo(this,e).delay=t}}function uE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?lE:cE)(t,e)):ze(this.node(),t).delay}function hE(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function dE(e,t){return t=+t,function(){nn(this,e).duration=t}}function fE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hE:dE)(t,e)):ze(this.node(),t).duration}function pE(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function gE(e){var t=this._id;return arguments.length?this.each(pE(t,e)):ze(this.node(),t).ease}function mE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function vE(e){if(typeof e!="function")throw new Error;return this.each(mE(this._id,e))}function yE(e){typeof e!="function"&&(e=Ju(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new vn(i,this._parents,this._name,this._id)}function EE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,r=n.length,s=Math.min(i,r),a=new Array(i),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<i;++o)a[o]=t[o];return new vn(a,this._parents,this._name,this._id)}function xE(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 bE(e,t,n){var i,r,s=xE(t)?qo:nn;return function(){var a=s(this,e),o=a.on;o!==i&&(r=(i=o).copy()).on(t,n),a.on=r}}function SE(e,t){var n=this._id;return arguments.length<2?ze(this.node(),n).on.on(e):this.each(bE(n,e,t))}function TE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _E(){return this.on("end.remove",TE(this._id))}function OE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ro(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var o=i[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,Js(c[h],t,n,h,c,ze(u,n)));return new vn(s,this._parents,t,n)}function wE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Qu(e));for(var i=this._groups,r=i.length,s=[],a=[],o=0;o<r;++o)for(var l=i[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=ze(u,n),g=0,m=h.length;g<m;++g)(f=h[g])&&Js(f,t,n,g,h,p);s.push(h),a.push(u)}return new vn(s,a,t,n)}var ME=xr.prototype.constructor;function AE(){return new ME(this._groups,this._parents)}function CE(e,t){var n,i,r;return function(){var s=bi(this,e),a=(this.style.removeProperty(e),bi(this,e));return s===a?null:s===n&&a===i?r:r=t(n=s,i=a)}}function Ph(e){return function(){this.style.removeProperty(e)}}function DE(e,t,n){var i,r=n+"",s;return function(){var a=bi(this,e);return a===r?null:a===i?s:s=t(i=a,n)}}function LE(e,t,n){var i,r,s;return function(){var a=bi(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),bi(this,e))),a===l?null:a===i&&l===r?s:(r=l,s=t(i=a,o))}}function RE(e,t){var n,i,r,s="style."+t,a="end."+s,o;return function(){var l=nn(this,e),c=l.on,u=l.value[s]==null?o||(o=Ph(t)):void 0;(c!==n||r!==u)&&(i=(n=c).copy()).on(a,r=u),l.on=i}}function IE(e,t,n){var i=(e+="")=="transform"?N1:kh;return t==null?this.styleTween(e,CE(e,i)).on("end.style."+e,Ph(e)):typeof t=="function"?this.styleTween(e,LE(e,i,Zo(this,"style."+e,t))).each(RE(this._id,e)):this.styleTween(e,DE(e,i,t),n).on("end.style."+e,null)}function kE(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function PE(e,t,n){var i,r;function s(){var a=t.apply(this,arguments);return a!==r&&(i=(r=a)&&kE(e,a,n)),i}return s._value=t,s}function NE(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,PE(e,t,n??""))}function $E(e){return function(){this.textContent=e}}function FE(e){return function(){var t=e(this);this.textContent=t??""}}function UE(e){return this.tween("text",typeof e=="function"?FE(Zo(this,"text",e)):$E(e==null?"":e+""))}function BE(e){return function(t){this.textContent=e.call(this,t)}}function GE(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&BE(r)),t}return i._value=e,i}function HE(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,GE(e))}function VE(){for(var e=this._name,t=this._id,n=Nh(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=ze(l,t);Js(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new vn(i,this._parents,e,n)}function zE(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--r===0&&s()}};n.each(function(){var c=nn(this,i),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),r===0&&s()})}var WE=0;function vn(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Nh(){return++WE}var yn=xr.prototype;vn.prototype={constructor:vn,select:OE,selectAll:wE,selectChild:yn.selectChild,selectChildren:yn.selectChildren,filter:yE,merge:EE,selection:AE,transition:VE,call:yn.call,nodes:yn.nodes,node:yn.node,size:yn.size,empty:yn.empty,each:yn.each,on:SE,attr:nE,attrTween:oE,style:IE,styleTween:NE,text:UE,textTween:HE,remove:_E,tween:Z1,delay:uE,duration:fE,ease:gE,easeVarying:vE,end:zE,[Symbol.iterator]:yn[Symbol.iterator]};const YE=e=>+e;function $h(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var qE={time:null,delay:0,duration:250,ease:$h};function XE(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 ZE(e){var t,n;e instanceof vn?(t=e._id,e=e._name):(t=Nh(),(n=qE).time=Vo(),e=e==null?null:e+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&Js(l,e,t,c,a,n||XE(l,t));return new vn(i,this._parents,e,t)}xr.prototype.interrupt=Y1,xr.prototype.transition=ZE;const jo=e=>()=>e;function jE(e,{sourceEvent:t,target:n,selection:i,mode:r,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:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function KE(e){e.stopImmediatePropagation()}function Ko(e){e.preventDefault(),e.stopImmediatePropagation()}var Fh={name:"drag"},Qo={name:"space"},_i={name:"handle"},Oi={name:"center"};const{abs:Uh,max:ee,min:ne}=Math;function Bh(e){return[+e[0],+e[1]]}function Gh(e){return[Bh(e[0]),Bh(e[1])]}var ta={name:"x",handles:["w","e"].map(tl),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]]}},Jo={},En={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Hh={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Vh={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},QE={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},JE={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function tl(e){return{type:e}}function tx(e){return!e.ctrlKey&&!e.button}function ex(){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 nx(){return navigator.maxTouchPoints||"ontouchstart"in this}function el(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function ix(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function zh(){return rx(ta)}function rx(e){var t=ex,n=tx,i=nx,r=!0,s=Do("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([tl("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",En.overlay).merge(v).each(function(){var E=el(this).extent;I(this).attr("x",E[0][0]).attr("y",E[0][1]).attr("width",E[1][0]-E[0][0]).attr("height",E[1][1]-E[0][1])}),m.selectAll(".selection").data([tl("selection")]).enter().append("rect").attr("class","selection").attr("cursor",En.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var S=m.selectAll(".handle").data(e.handles,function(E){return E.type});S.exit().remove(),S.enter().append("rect").attr("class",function(E){return"handle handle--"+E.type}).attr("cursor",function(E){return En[E.type]}),m.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,v,S){m.tween?m.on("start.brush",function(E){u(this,arguments).beforestart().start(E)}).on("interrupt.brush end.brush",function(E){u(this,arguments).end(E)}).tween("brush",function(){var E=this,b=E.__brush,x=u(E,arguments),T=b.selection,C=e.input(typeof v=="function"?v.apply(this,arguments):v,b.extent),D=_r(T,C);function $(P){b.selection=P===1&&C===null?null:D(P),c.call(E),x.brush()}return T!==null&&C!==null?$:$(1)}):m.each(function(){var E=this,b=arguments,x=E.__brush,T=e.input(typeof v=="function"?v.apply(E,b):v,x.extent),C=u(E,b).beforestart();Xo(E),x.selection=T===null?null:T,c.call(E),C.start(S).brush(S).end(S)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=I(this),v=el(this).selection;v?(m.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]),m.selectAll(".handle").style("display",null).attr("x",function(S){return S.type[S.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(S){return S.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(S){return S.type==="n"||S.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(S){return S.type==="e"||S.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,S){var E=m.__brush.emitter;return E&&(!S||!E.clean)?E:new d(m,v,S)}function d(m,v,S){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=S}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,S){var E=I(this.that).datum();s.call(m,this.that,new jE(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:S,dispatch:s}),E)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,S=m.target.__data__.type,E=(r&&m.metaKey?S="overlay":S)==="selection"?Fh:r&&m.altKey?Oi:_i,b=e===Jo?null:QE[S],x=e===ta?null:JE[S],T=el(v),C=T.extent,D=T.selection,$=C[0][0],P,w,G=C[0][1],N,A,O=C[1][0],F,U,R=C[1][1],B,tt,Z=0,q=0,Q,ht=b&&x&&r&&m.shiftKey,et,K,nt=Array.from(m.touches||[m],at=>{const bt=at.identifier;return at=Xn(at,v),at.point0=at.slice(),at.identifier=bt,at});Xo(v);var lt=u(v,arguments,!0).beforestart();if(S==="overlay"){D&&(Q=!0);const at=[nt[0],nt[1]||nt[0]];T.selection=D=[[P=e===Jo?$:ne(at[0][0],at[1][0]),N=e===ta?G:ne(at[0][1],at[1][1])],[F=e===Jo?O:ee(at[0][0],at[1][0]),B=e===ta?R:ee(at[0][1],at[1][1])]],nt.length>1&&H(m)}else P=D[0][0],N=D[0][1],F=D[1][0],B=D[1][1];w=P,A=N,U=F,tt=B;var Y=I(v).attr("pointer-events","none"),j=Y.selectAll(".overlay").attr("cursor",En[S]);if(m.touches)lt.moved=L,lt.ended=V;else{var J=I(m.view).on("mousemove.brush",L,!0).on("mouseup.brush",V,!0);r&&J.on("keydown.brush",yt,!0).on("keyup.brush",Bt,!0),h1(m.view)}c.call(v),lt.start(m,E.name);function L(at){for(const bt of at.changedTouches||[at])for(const Ue of nt)Ue.identifier===bt.identifier&&(Ue.cur=Xn(bt,v));if(ht&&!et&&!K&&nt.length===1){const bt=nt[0];Uh(bt.cur[0]-bt[0])>Uh(bt.cur[1]-bt[1])?K=!0:et=!0}for(const bt of nt)bt.cur&&(bt[0]=bt.cur[0],bt[1]=bt.cur[1]);Q=!0,Ko(at),H(at)}function H(at){const bt=nt[0],Ue=bt.point0;var fe;switch(Z=bt[0]-Ue[0],q=bt[1]-Ue[1],E){case Qo:case Fh:{b&&(Z=ee($-P,ne(O-F,Z)),w=P+Z,U=F+Z),x&&(q=ee(G-N,ne(R-B,q)),A=N+q,tt=B+q);break}case _i:{nt[1]?(b&&(w=ee($,ne(O,nt[0][0])),U=ee($,ne(O,nt[1][0])),b=1),x&&(A=ee(G,ne(R,nt[0][1])),tt=ee(G,ne(R,nt[1][1])),x=1)):(b<0?(Z=ee($-P,ne(O-P,Z)),w=P+Z,U=F):b>0&&(Z=ee($-F,ne(O-F,Z)),w=P,U=F+Z),x<0?(q=ee(G-N,ne(R-N,q)),A=N+q,tt=B):x>0&&(q=ee(G-B,ne(R-B,q)),A=N,tt=B+q));break}case Oi:{b&&(w=ee($,ne(O,P-Z*b)),U=ee($,ne(O,F+Z*b))),x&&(A=ee(G,ne(R,N-q*x)),tt=ee(G,ne(R,B+q*x)));break}}U<w&&(b*=-1,fe=P,P=F,F=fe,fe=w,w=U,U=fe,S in Hh&&j.attr("cursor",En[S=Hh[S]])),tt<A&&(x*=-1,fe=N,N=B,B=fe,fe=A,A=tt,tt=fe,S in Vh&&j.attr("cursor",En[S=Vh[S]])),T.selection&&(D=T.selection),et&&(w=D[0][0],U=D[1][0]),K&&(A=D[0][1],tt=D[1][1]),(D[0][0]!==w||D[0][1]!==A||D[1][0]!==U||D[1][1]!==tt)&&(T.selection=[[w,A],[U,tt]],c.call(v),lt.brush(at,E.name))}function V(at){if(KE(at),at.touches){if(at.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else d1(at.view,Q),J.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Y.attr("pointer-events","all"),j.attr("cursor",En.overlay),T.selection&&(D=T.selection),ix(D)&&(T.selection=null,c.call(v)),lt.end(at,E.name)}function yt(at){switch(at.keyCode){case 16:{ht=b&&x;break}case 18:{E===_i&&(b&&(F=U-Z*b,P=w+Z*b),x&&(B=tt-q*x,N=A+q*x),E=Oi,H(at));break}case 32:{(E===_i||E===Oi)&&(b<0?F=U-Z:b>0&&(P=w-Z),x<0?B=tt-q:x>0&&(N=A-q),E=Qo,j.attr("cursor",En.selection),H(at));break}default:return}Ko(at)}function Bt(at){switch(at.keyCode){case 16:{ht&&(et=K=ht=!1,H(at));break}case 18:{E===Oi&&(b<0?F=U:b>0&&(P=w),x<0?B=tt:x>0&&(N=A),E=_i,H(at));break}case 32:{E===Qo&&(at.altKey?(b&&(F=U-Z*b,P=w+Z*b),x&&(B=tt-q*x,N=A+q*x),E=Oi):(b<0?F=U:b>0&&(P=w),x<0?B=tt:x>0&&(N=A),E=_i),j.attr("cursor",En[S]),H(at));break}default:return}Ko(at)}}function f(m){u(this,arguments).moved(m)}function p(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=Gh(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:jo(Gh(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:jo(!!m),l):n},l.touchable=function(m){return arguments.length?(i=typeof m=="function"?m:jo(!!m),l):i},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(r=!!m,l):r},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const nl=Math.PI,il=2*nl,Qn=1e-6,sx=il-Qn;function Wh(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ax(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Wh;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r<s;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let ox=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Wh:ax(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,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,s,a){this._append`C${+t},${+n},${+i},${+r},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,i,r,s){if(t=+t,n=+n,i=+i,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=i-t,c=r-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Qn)if(!(Math.abs(d*l-c*u)>Qn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=i-a,p=r-o,g=l*l+c*c,m=f*f+p*p,v=Math.sqrt(g),S=Math.sqrt(h),E=s*Math.tan((nl-Math.acos((g+h-m)/(2*v*S)))/2),b=E/S,x=E/v;Math.abs(b-1)>Qn&&this._append`L${t+b*u},${n+b*d}`,this._append`A${s},${s},0,0,${+(d*f>u*p)},${this._x1=t+x*l},${this._y1=n+x*c}`}}arc(t,n,i,r,s,a){if(t=+t,n=+n,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(r),l=i*Math.sin(r),c=t+o,u=n+l,d=1^a,h=a?r-s:s-r;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Qn||Math.abs(this._y1-u)>Qn)&&this._append`L${c},${u}`,i&&(h<0&&(h=h%il+il),h>sx?this._append`A${i},${i},0,1,${d},${t-o},${n-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=u}`:h>Qn&&this._append`A${i},${i},0,${+(h>=nl)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function lx(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ea(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function wi(e){return e=ea(Math.abs(e)),e?e[1]:NaN}function cx(e,t){return function(n,i){for(var r=n.length,s=[],a=0,o=e[0],l=0;r>0&&o>0&&(l+o+1>i&&(o=Math.max(1,i-l)),s.push(n.substring(r-=o,r+o)),!((l+=o+1)>i));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function ux(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var hx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Cr(e){if(!(t=hx.exec(e)))throw new Error("invalid format: "+e);var t;return new rl({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]})}Cr.prototype=rl.prototype;function rl(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+""}rl.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 dx(e){t:for(var t=e.length,n=1,i=-1,r;n<t;++n)switch(e[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+e[n])break t;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var Yh;function fx(e,t){var n=ea(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(Yh=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+ea(e,Math.max(0,t+s-1))[0]}function qh(e,t){var n=ea(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const Xh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:lx,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)=>qh(e*100,t),r:qh,s:fx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Zh(e){return e}var jh=Array.prototype.map,Kh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function px(e){var t=e.grouping===void 0||e.thousands===void 0?Zh:cx(jh.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Zh:ux(jh.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Cr(d);var h=d.fill,f=d.align,p=d.sign,g=d.symbol,m=d.zero,v=d.width,S=d.comma,E=d.precision,b=d.trim,x=d.type;x==="n"?(S=!0,x="g"):Xh[x]||(E===void 0&&(E=12),b=!0,x="g"),(m||h==="0"&&f==="=")&&(m=!0,h="0",f="=");var T=g==="$"?n:g==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",C=g==="$"?i:/[%p]/.test(x)?a:"",D=Xh[x],$=/[defgprs%]/.test(x);E=E===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function P(w){var G=T,N=C,A,O,F;if(x==="c")N=D(w)+N,w="";else{w=+w;var U=w<0||1/w<0;if(w=isNaN(w)?l:D(Math.abs(w),E),b&&(w=dx(w)),U&&+w==0&&p!=="+"&&(U=!1),G=(U?p==="("?p:o:p==="-"||p==="("?"":p)+G,N=(x==="s"?Kh[8+Yh/3]:"")+N+(U&&p==="("?")":""),$){for(A=-1,O=w.length;++A<O;)if(F=w.charCodeAt(A),48>F||F>57){N=(F===46?r+w.slice(A+1):w.slice(A))+N,w=w.slice(0,A);break}}}S&&!m&&(w=t(w,1/0));var R=G.length+w.length+N.length,B=R<v?new Array(v-R+1).join(h):"";switch(S&&m&&(w=t(B+w,B.length?v-N.length:1/0),B=""),f){case"<":w=G+w+N+B;break;case"=":w=G+B+w+N;break;case"^":w=B.slice(0,R=B.length>>1)+G+w+N+B.slice(R);break;default:w=B+G+w+N;break}return s(w)}return P.toString=function(){return d+""},P}function u(d,h){var f=c((d=Cr(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(wi(h)/3)))*3,g=Math.pow(10,-p),m=Kh[8+p/3];return function(v){return f(g*v)+m}}return{format:c,formatPrefix:u}}var na,sl,Qh;gx({thousands:",",grouping:[3],currency:["$",""]});function gx(e){return na=px(e),sl=na.format,Qh=na.formatPrefix,na}function mx(e){return Math.max(0,-wi(Math.abs(e)))}function vx(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(wi(t)/3)))*3-wi(Math.abs(e)))}function yx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,wi(t)-wi(e))+1}var _t=1e-6,Jh=1e-12,mt=Math.PI,ge=mt/2,td=mt/4,_e=mt*2,oe=180/mt,Nt=mt/180,Ot=Math.abs,ed=Math.atan,Jn=Math.atan2,Mt=Math.cos,Ex=Math.exp,xx=Math.log,St=Math.sin,Un=Math.sign||function(e){return e>0?1:e<0?-1:0},We=Math.sqrt,bx=Math.tan;function Sx(e){return e>1?0:e<-1?mt:Math.acos(e)}function xn(e){return e>1?ge:e<-1?-ge:Math.asin(e)}function Ce(){}function ia(e,t){e&&id.hasOwnProperty(e.type)&&id[e.type](e,t)}var nd={Feature:function(e,t){ia(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)ia(n[i].geometry,t)}},id={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,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){al(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)al(n[i],t,0)},Polygon:function(e,t){rd(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)rd(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)ia(n[i],t)}};function al(e,t,n){var i=-1,r=e.length-n,s;for(t.lineStart();++i<r;)s=e[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function rd(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)al(e[n],t,1);t.polygonEnd()}function Mi(e,t){e&&nd.hasOwnProperty(e.type)?nd[e.type](e,t):ia(e,t)}function ol(e){return[Jn(e[1],e[0]),xn(e[2])]}function Ai(e){var t=e[0],n=e[1],i=Mt(n);return[i*Mt(t),i*St(t),St(n)]}function ra(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function sa(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 ll(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function aa(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function cl(e){var t=We(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function ul(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function hl(e,t){return Ot(e)>mt&&(e-=Math.round(e/_e)*_e),[e,t]}hl.invert=hl;function sd(e,t,n){return(e%=_e)?t||n?ul(od(e),ld(t,n)):od(e):t||n?ld(t,n):hl}function ad(e){return function(t,n){return t+=e,Ot(t)>mt&&(t-=Math.round(t/_e)*_e),[t,n]}}function od(e){var t=ad(e);return t.invert=ad(-e),t}function ld(e,t){var n=Mt(e),i=St(e),r=Mt(t),s=St(t);function a(o,l){var c=Mt(l),u=Mt(o)*c,d=St(o)*c,h=St(l),f=h*n+u*i;return[Jn(d*r-f*s,u*n-h*i),xn(f*r+d*s)]}return a.invert=function(o,l){var c=Mt(l),u=Mt(o)*c,d=St(o)*c,h=St(l),f=h*r-d*s;return[Jn(d*r+h*s,u*n+f*i),xn(f*n-u*i)]},a}function Tx(e){e=sd(e[0]*Nt,e[1]*Nt,e.length>2?e[2]*Nt:0);function t(n){return n=e(n[0]*Nt,n[1]*Nt),n[0]*=oe,n[1]*=oe,n}return t.invert=function(n){return n=e.invert(n[0]*Nt,n[1]*Nt),n[0]*=oe,n[1]*=oe,n},t}function _x(e,t,n,i,r,s){if(n){var a=Mt(t),o=St(t),l=i*n;r==null?(r=t+i*_e,s=t-l/2):(r=cd(a,r),s=cd(a,s),(i>0?r<s:r>s)&&(r+=i*_e));for(var c,u=r;i>0?u>s:u<s;u-=l)c=ol([a,-o*Mt(u),-o*St(u)]),e.point(c[0],c[1])}}function cd(e,t){t=Ai(t),t[0]-=e,cl(t);var n=Sx(-t[1]);return((-t[2]<0?-n:n)+_e-_t)%_e}function ud(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:Ce,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function oa(e,t){return Ot(e[0]-t[0])<_t&&Ot(e[1]-t[1])<_t}function la(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function hd(e,t,n,i,r){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],v=p[g],S;if(oa(m,v)){if(!m[2]&&!v[2]){for(r.lineStart(),o=0;o<g;++o)r.point((m=p[o])[0],m[1]);r.lineEnd();return}v[0]+=2*_t}s.push(S=new la(m,p,null,!0)),a.push(S.o=new la(m,null,S,!1)),s.push(S=new la(v,p,null,!1)),a.push(S.o=new la(v,null,S,!0))}}),!!s.length){for(a.sort(t),dd(s),dd(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,f=!0;h.v;)if((h=h.n)===c)return;u=h.z,r.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,l=u.length;o<l;++o)r.point((d=u[o])[0],d[1]);else i(h.x,h.n.x,1,r);h=h.n}else{if(f)for(u=h.p.z,o=u.length-1;o>=0;--o)r.point((d=u[o])[0],d[1]);else i(h.x,h.p.x,-1,r);h=h.p}h=h.o,u=h.z,f=!f}while(!h.v);r.lineEnd()}}}function dd(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function dl(e){return Ot(e[0])<=mt?e[0]:Un(e[0])*((Ot(e[0])+mt)%_e-mt)}function Ox(e,t){var n=dl(t),i=t[1],r=St(i),s=[St(n),-Mt(n),0],a=0,o=0,l=new Yn;r===1?i=ge+_t:r===-1&&(i=-ge-_t);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],p=dl(f),g=f[1]/2+td,m=St(g),v=Mt(g),S=0;S<h;++S,p=b,m=T,v=C,f=E){var E=d[S],b=dl(E),x=E[1]/2+td,T=St(x),C=Mt(x),D=b-p,$=D>=0?1:-1,P=$*D,w=P>mt,G=m*T;if(l.add(Jn(G*$*St(P),v*C+G*Mt(P))),a+=w?D+$*_e:D,w^p>=n^b>=n){var N=sa(Ai(f),Ai(E));cl(N);var A=sa(s,N);cl(A);var O=(w^D>=0?-1:1)*xn(A[2]);(i>O||i===O&&(N[0]||N[1]))&&(o+=w^D>=0?1:-1)}}return(a<-_t||a<_t&&l<-Jh)^o&1}function fd(e,t,n,i){return function(r){var s=t(r),a=ud(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=S,h.lineEnd=E,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=g,h.lineEnd=m,u=Yu(u);var b=Ox(c,i);u.length?(l||(r.polygonStart(),l=!0),hd(u,Mx,b,n,r)):b&&(l||(r.polygonStart(),l=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),l&&(r.polygonEnd(),l=!1),u=c=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function f(b,x){e(b,x)&&r.point(b,x)}function p(b,x){s.point(b,x)}function g(){h.point=p,s.lineStart()}function m(){h.point=f,s.lineEnd()}function v(b,x){d.push([b,x]),o.point(b,x)}function S(){o.lineStart(),d=[]}function E(){v(d[0][0],d[0][1]),o.lineEnd();var b=o.clean(),x=a.result(),T,C=x.length,D,$,P;if(d.pop(),c.push(d),d=null,!!C){if(b&1){if($=x[0],(D=$.length-1)>0){for(l||(r.polygonStart(),l=!0),r.lineStart(),T=0;T<D;++T)r.point((P=$[T])[0],P[1]);r.lineEnd()}return}C>1&&b&2&&x.push(x.pop().concat(x.shift())),u.push(x.filter(wx))}}return h}}function wx(e){return e.length>1}function Mx(e,t){return((e=e.x)[0]<0?e[1]-ge-_t:ge-e[1])-((t=t.x)[0]<0?t[1]-ge-_t:ge-t[1])}const pd=fd(function(){return!0},Ax,Dx,[-mt,-ge]);function Ax(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,a){var o=s>0?mt:-mt,l=Ot(s-t);Ot(l-mt)<_t?(e.point(t,n=(n+a)/2>0?ge:-ge),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),r=0):i!==o&&l>=mt&&(Ot(t-i)<_t&&(t-=i*_t),Ot(s-o)<_t&&(s-=o*_t),n=Cx(t,n,s,a),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(o,n),r=0),e.point(t=s,n=a),i=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function Cx(e,t,n,i){var r,s,a=St(e-n);return Ot(a)>_t?ed((St(t)*(s=Mt(i))*St(n)-St(i)*(r=Mt(t))*St(e))/(r*s*a)):(t+i)/2}function Dx(e,t,n,i){var r;if(e==null)r=n*ge,i.point(-mt,r),i.point(0,r),i.point(mt,r),i.point(mt,0),i.point(mt,-r),i.point(0,-r),i.point(-mt,-r),i.point(-mt,0),i.point(-mt,r);else if(Ot(e[0]-t[0])>_t){var s=e[0]<t[0]?mt:-mt;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function Lx(e){var t=Mt(e),n=2*Nt,i=t>0,r=Ot(t)>_t;function s(u,d,h,f){_x(f,e,n,h,u,d)}function a(u,d){return Mt(u)*Mt(d)>t}function o(u){var d,h,f,p,g;return{lineStart:function(){p=f=!1,g=1},point:function(m,v){var S=[m,v],E,b=a(m,v),x=i?b?0:c(m,v):b?c(m+(m<0?mt:-mt),v):0;if(!d&&(p=f=b)&&u.lineStart(),b!==f&&(E=l(d,S),(!E||oa(d,E)||oa(S,E))&&(S[2]=1)),b!==f)g=0,b?(u.lineStart(),E=l(S,d),u.point(E[0],E[1])):(E=l(d,S),u.point(E[0],E[1],2),u.lineEnd()),d=E;else if(r&&d&&i^b){var T;!(x&h)&&(T=l(S,d,!0))&&(g=0,i?(u.lineStart(),u.point(T[0][0],T[0][1]),u.point(T[1][0],T[1][1]),u.lineEnd()):(u.point(T[1][0],T[1][1]),u.lineEnd(),u.lineStart(),u.point(T[0][0],T[0][1],3)))}b&&(!d||!oa(d,S))&&u.point(S[0],S[1]),d=S,f=b,h=x},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return g|(p&&f)<<1}}}function l(u,d,h){var f=Ai(u),p=Ai(d),g=[1,0,0],m=sa(f,p),v=ra(m,m),S=m[0],E=v-S*S;if(!E)return!h&&u;var b=t*v/E,x=-t*S/E,T=sa(g,m),C=aa(g,b),D=aa(m,x);ll(C,D);var $=T,P=ra(C,$),w=ra($,$),G=P*P-w*(ra(C,C)-1);if(!(G<0)){var N=We(G),A=aa($,(-P-N)/w);if(ll(A,C),A=ol(A),!h)return A;var O=u[0],F=d[0],U=u[1],R=d[1],B;F<O&&(B=O,O=F,F=B);var tt=F-O,Z=Ot(tt-mt)<_t,q=Z||tt<_t;if(!Z&&R<U&&(B=U,U=R,R=B),q?Z?U+R>0^A[1]<(Ot(A[0]-O)<_t?U:R):U<=A[1]&&A[1]<=R:tt>mt^(O<=A[0]&&A[0]<=F)){var Q=aa($,(-P+N)/w);return ll(Q,C),[A,ol(Q)]}}}function c(u,d){var h=i?e:mt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return fd(a,o,s,i?[0,-e]:[-mt,e-mt])}function Rx(e,t,n,i,r,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,f=c-o,p;if(p=n-a,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>u&&(u=p)}if(p=r-a,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<d&&(d=p)}if(p=i-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<d&&(d=p)}else if(f>0){if(p>d)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>d)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<d&&(d=p)}return u>0&&(e[0]=a+u*h,e[1]=o+u*f),d<1&&(t[0]=a+d*h,t[1]=o+d*f),!0}}}}}var Dr=1e9,ca=-Dr;function Ix(e,t,n,i){function r(c,u){return e<=c&&c<=n&&t<=u&&u<=i}function s(c,u,d,h){var f=0,p=0;if(c==null||(f=a(c,d))!==(p=a(u,d))||l(c,u)<0^d>0)do h.point(f===0||f===3?e:n,f>1?i:t);while((f=(f+d+4)%4)!==p);else h.point(u[0],u[1])}function a(c,u){return Ot(c[0]-e)<_t?u>0?0:3:Ot(c[0]-n)<_t?u>0?2:1:Ot(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 d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=ud(),h,f,p,g,m,v,S,E,b,x,T,C={point:D,lineStart:G,lineEnd:N,polygonStart:P,polygonEnd:w};function D(O,F){r(O,F)&&u.point(O,F)}function $(){for(var O=0,F=0,U=f.length;F<U;++F)for(var R=f[F],B=1,tt=R.length,Z=R[0],q,Q,ht=Z[0],et=Z[1];B<tt;++B)q=ht,Q=et,Z=R[B],ht=Z[0],et=Z[1],Q<=i?et>i&&(ht-q)*(i-Q)>(et-Q)*(e-q)&&++O:et<=i&&(ht-q)*(i-Q)<(et-Q)*(e-q)&&--O;return O}function P(){u=d,h=[],f=[],T=!0}function w(){var O=$(),F=T&&O,U=(h=Yu(h)).length;(F||U)&&(c.polygonStart(),F&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),U&&hd(h,o,O,s,c),c.polygonEnd()),u=c,h=f=p=null}function G(){C.point=A,f&&f.push(p=[]),x=!0,b=!1,S=E=NaN}function N(){h&&(A(g,m),v&&b&&d.rejoin(),h.push(d.result())),C.point=D,b&&u.lineEnd()}function A(O,F){var U=r(O,F);if(f&&p.push([O,F]),x)g=O,m=F,v=U,x=!1,U&&(u.lineStart(),u.point(O,F));else if(U&&b)u.point(O,F);else{var R=[S=Math.max(ca,Math.min(Dr,S)),E=Math.max(ca,Math.min(Dr,E))],B=[O=Math.max(ca,Math.min(Dr,O)),F=Math.max(ca,Math.min(Dr,F))];Rx(R,B,e,t,n,i)?(b||(u.lineStart(),u.point(R[0],R[1])),u.point(B[0],B[1]),U||u.lineEnd(),T=!1):U&&(u.lineStart(),u.point(O,F),T=!1)}S=O,E=F,b=U}return C}}const fl=e=>e;var pl=new Yn,gl=new Yn,gd,md,ml,vl,bn={point:Ce,lineStart:Ce,lineEnd:Ce,polygonStart:function(){bn.lineStart=kx,bn.lineEnd=Nx},polygonEnd:function(){bn.lineStart=bn.lineEnd=bn.point=Ce,pl.add(Ot(gl)),gl=new Yn},result:function(){var e=pl/2;return pl=new Yn,e}};function kx(){bn.point=Px}function Px(e,t){bn.point=vd,gd=ml=e,md=vl=t}function vd(e,t){gl.add(vl*e-ml*t),ml=e,vl=t}function Nx(){vd(gd,md)}var Ci=1/0,ua=Ci,Lr=-Ci,ha=Lr,da={point:$x,lineStart:Ce,lineEnd:Ce,polygonStart:Ce,polygonEnd:Ce,result:function(){var e=[[Ci,ua],[Lr,ha]];return Lr=ha=-(ua=Ci=1/0),e}};function $x(e,t){e<Ci&&(Ci=e),e>Lr&&(Lr=e),t<ua&&(ua=t),t>ha&&(ha=t)}var yl=0,El=0,Rr=0,fa=0,pa=0,Di=0,xl=0,bl=0,Ir=0,yd,Ed,rn,sn,De={point:ti,lineStart:xd,lineEnd:bd,polygonStart:function(){De.lineStart=Bx,De.lineEnd=Gx},polygonEnd:function(){De.point=ti,De.lineStart=xd,De.lineEnd=bd},result:function(){var e=Ir?[xl/Ir,bl/Ir]:Di?[fa/Di,pa/Di]:Rr?[yl/Rr,El/Rr]:[NaN,NaN];return yl=El=Rr=fa=pa=Di=xl=bl=Ir=0,e}};function ti(e,t){yl+=e,El+=t,++Rr}function xd(){De.point=Fx}function Fx(e,t){De.point=Ux,ti(rn=e,sn=t)}function Ux(e,t){var n=e-rn,i=t-sn,r=We(n*n+i*i);fa+=r*(rn+e)/2,pa+=r*(sn+t)/2,Di+=r,ti(rn=e,sn=t)}function bd(){De.point=ti}function Bx(){De.point=Hx}function Gx(){Sd(yd,Ed)}function Hx(e,t){De.point=Sd,ti(yd=rn=e,Ed=sn=t)}function Sd(e,t){var n=e-rn,i=t-sn,r=We(n*n+i*i);fa+=r*(rn+e)/2,pa+=r*(sn+t)/2,Di+=r,r=sn*e-rn*t,xl+=r*(rn+e),bl+=r*(sn+t),Ir+=r*3,ti(rn=e,sn=t)}function Td(e){this._context=e}Td.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,_e);break}}},result:Ce};var Sl=new Yn,Tl,_d,Od,kr,Pr,Nr={point:Ce,lineStart:function(){Nr.point=Vx},lineEnd:function(){Tl&&wd(_d,Od),Nr.point=Ce},polygonStart:function(){Tl=!0},polygonEnd:function(){Tl=null},result:function(){var e=+Sl;return Sl=new Yn,e}};function Vx(e,t){Nr.point=wd,_d=kr=e,Od=Pr=t}function wd(e,t){kr-=e,Pr-=t,Sl.add(We(kr*kr+Pr*Pr)),kr=e,Pr=t}let Md,ga,Ad,Cd;class Dd{constructor(t){this._append=t==null?Ld:zx(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!==Ad||this._append!==ga){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,Ad=i,ga=this._append,Cd=this._,this._=r}this._+=Cd;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Ld(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function zx(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Ld;if(t!==Md){const n=10**t;Md=t,ga=function(r){let s=1;this._+=r[0];for(const a=r.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}return ga}function Wx(e,t){let n=3,i=4.5,r,s;function a(o){return o&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),Mi(o,r(s))),s.result()}return a.area=function(o){return Mi(o,r(bn)),bn.result()},a.measure=function(o){return Mi(o,r(Nr)),Nr.result()},a.bounds=function(o){return Mi(o,r(da)),da.result()},a.centroid=function(o){return Mi(o,r(De)),De.result()},a.projection=function(o){return arguments.length?(r=o==null?(e=null,fl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Dd(n)):new Td(t=o),typeof i!="function"&&s.pointRadius(i),a):t},a.pointRadius=function(o){return arguments.length?(i=typeof o=="function"?o:(s.pointRadius(+o),+o),a):i},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 Dd(n)),a},a.projection(e).digits(n).context(t)}function _l(e){return function(t){var n=new Ol;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Ol(){}Ol.prototype={constructor:Ol,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 wl(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Mi(n,e.stream(da)),t(da.result()),i!=null&&e.clipExtent(i),e}function Rd(e,t,n){return wl(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),o=+t[0][0]+(r-a*(i[1][0]+i[0][0]))/2,l=+t[0][1]+(s-a*(i[1][1]+i[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function Yx(e,t,n){return Rd(e,[[0,0],t],n)}function qx(e,t,n){return wl(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),a=(r-s*(i[1][0]+i[0][0]))/2,o=-s*i[0][1];e.scale(150*s).translate([a,o])},n)}function Xx(e,t,n){return wl(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),a=-s*i[0][0],o=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Id=16,Zx=Mt(30*Nt);function kd(e,t){return+t?Kx(e,t):jx(e)}function jx(e){return _l({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Kx(e,t){function n(i,r,s,a,o,l,c,u,d,h,f,p,g,m){var v=c-i,S=u-r,E=v*v+S*S;if(E>4*t&&g--){var b=a+h,x=o+f,T=l+p,C=We(b*b+x*x+T*T),D=xn(T/=C),$=Ot(Ot(T)-1)<_t||Ot(s-d)<_t?(s+d)/2:Jn(x,b),P=e($,D),w=P[0],G=P[1],N=w-i,A=G-r,O=S*N-v*A;(O*O/E>t||Ot((v*N+S*A)/E-.5)>.3||a*h+o*f+l*p<Zx)&&(n(i,r,s,a,o,l,w,G,$,b/=C,x/=C,T,g,m),m.point(w,G),n(w,G,$,b,x,T,c,u,d,h,f,p,g,m))}}return function(i){var r,s,a,o,l,c,u,d,h,f,p,g,m={point:v,lineStart:S,lineEnd:b,polygonStart:function(){i.polygonStart(),m.lineStart=x},polygonEnd:function(){i.polygonEnd(),m.lineStart=S}};function v(D,$){D=e(D,$),i.point(D[0],D[1])}function S(){d=NaN,m.point=E,i.lineStart()}function E(D,$){var P=Ai([D,$]),w=e(D,$);n(d,h,u,f,p,g,d=w[0],h=w[1],u=D,f=P[0],p=P[1],g=P[2],Id,i),i.point(d,h)}function b(){m.point=v,i.lineEnd()}function x(){S(),m.point=T,m.lineEnd=C}function T(D,$){E(r=D,$),s=d,a=h,o=f,l=p,c=g,m.point=E}function C(){n(d,h,u,f,p,g,s,a,r,o,l,c,Id,i),m.lineEnd=b,b()}return m}}var Qx=_l({point:function(e,t){this.stream.point(e*Nt,t*Nt)}});function Jx(e){return _l({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function tb(e,t,n,i,r){function s(a,o){return a*=i,o*=r,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*i,(n-o)/e*r]},s}function Pd(e,t,n,i,r,s){if(!s)return tb(e,t,n,i,r);var a=Mt(s),o=St(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(g,m){return g*=i,m*=r,[l*g-c*m+t,n-c*g-l*m]}return p.invert=function(g,m){return[i*(u*g-d*m+h),r*(f-d*g-u*m)]},p}function ma(e){return Nd(function(){return e})()}function Nd(e){var t,n=150,i=480,r=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,f=1,p=null,g=pd,m=null,v,S,E,b=fl,x=.5,T,C,D,$,P;function w(O){return D(O[0]*Nt,O[1]*Nt)}function G(O){return O=D.invert(O[0],O[1]),O&&[O[0]*oe,O[1]*oe]}w.stream=function(O){return $&&P===O?$:$=Qx(Jx(u)(g(T(b(P=O)))))},w.preclip=function(O){return arguments.length?(g=O,p=void 0,A()):g},w.postclip=function(O){return arguments.length?(b=O,m=v=S=E=null,A()):b},w.clipAngle=function(O){return arguments.length?(g=+O?Lx(p=O*Nt):(p=null,pd),A()):p*oe},w.clipExtent=function(O){return arguments.length?(b=O==null?(m=v=S=E=null,fl):Ix(m=+O[0][0],v=+O[0][1],S=+O[1][0],E=+O[1][1]),A()):m==null?null:[[m,v],[S,E]]},w.scale=function(O){return arguments.length?(n=+O,N()):n},w.translate=function(O){return arguments.length?(i=+O[0],r=+O[1],N()):[i,r]},w.center=function(O){return arguments.length?(s=O[0]%360*Nt,a=O[1]%360*Nt,N()):[s*oe,a*oe]},w.rotate=function(O){return arguments.length?(o=O[0]%360*Nt,l=O[1]%360*Nt,c=O.length>2?O[2]%360*Nt:0,N()):[o*oe,l*oe,c*oe]},w.angle=function(O){return arguments.length?(d=O%360*Nt,N()):d*oe},w.reflectX=function(O){return arguments.length?(h=O?-1:1,N()):h<0},w.reflectY=function(O){return arguments.length?(f=O?-1:1,N()):f<0},w.precision=function(O){return arguments.length?(T=kd(C,x=O*O),A()):We(x)},w.fitExtent=function(O,F){return Rd(w,O,F)},w.fitSize=function(O,F){return Yx(w,O,F)},w.fitWidth=function(O,F){return qx(w,O,F)},w.fitHeight=function(O,F){return Xx(w,O,F)};function N(){var O=Pd(n,0,0,h,f,d).apply(null,t(s,a)),F=Pd(n,i-O[0],r-O[1],h,f,d);return u=sd(o,l,c),C=ul(t,F),D=ul(u,C),T=kd(C,x),A()}function A(){return $=P=null,w}return function(){return t=e.apply(this,arguments),w.invert=t.invert&&G,N()}}function $d(e){var t=0,n=mt/3,i=Nd(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*Nt,n=s[1]*Nt):[t*oe,n*oe]},r}function eb(e){var t=Mt(e);function n(i,r){return[i*t,St(r)/t]}return n.invert=function(i,r){return[i/t,xn(r*t)]},n}function nb(e,t){var n=St(e),i=(n+St(t))/2;if(Ot(i)<_t)return eb(e);var r=1+n*(2*i-n),s=We(r)/i;function a(o,l){var c=We(r-2*i*St(l))/i;return[c*St(o*=i),s-c*Mt(o)]}return a.invert=function(o,l){var c=s-l,u=Jn(o,Ot(c))*Un(c);return c*i<0&&(u-=mt*Un(o)*Un(c)),[u/i,xn((r-(o*o+c*c)*i*i)/(2*i))]},a}function Fd(){return $d(nb).scale(155.424).center([0,33.6442])}function ib(){return Fd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Ml(e,t){return[e,xx(bx((ge+t)/2))]}Ml.invert=function(e,t){return[e,2*ed(Ex(t))-ge]};function rb(){return sb(Ml).scale(961/_e)}function sb(e){var t=ma(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(i(d),u()):i()},t.translate=function(d){return arguments.length?(r(d),u()):r()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=mt*i(),h=t(Tx(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Ml?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function va(e,t){return[e,t]}va.invert=va;function ab(){return ma(va).scale(152.63)}function ob(e,t){var n=Mt(e),i=e===t?St(e):(n-Mt(t))/(t-e),r=n/i+e;if(Ot(i)<_t)return va;function s(a,o){var l=r-o,c=i*a;return[l*St(c),r-l*Mt(c)]}return s.invert=function(a,o){var l=r-o,c=Jn(a,Ot(l))*Un(l);return l*i<0&&(c-=mt*Un(a)*Un(l)),[c/i,r-Un(i)*We(a*a+l*l)]},s}function lb(){return $d(ob).scale(131.154).center([0,13.9389])}var $r=1.340264,Fr=-.081106,Ur=893e-6,Br=.003796,ya=We(3)/2,cb=12;function Ud(e,t){var n=xn(ya*St(t)),i=n*n,r=i*i*i;return[e*Mt(n)/(ya*($r+3*Fr*i+r*(7*Ur+9*Br*i))),n*($r+Fr*i+r*(Ur+Br*i))]}Ud.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,a,o,l;s<cb&&(o=n*($r+Fr*i+r*(Ur+Br*i))-t,l=$r+3*Fr*i+r*(7*Ur+9*Br*i),n-=a=o/l,i=n*n,r=i*i*i,!(Ot(a)<Jh));++s);return[ya*e*($r+3*Fr*i+r*(7*Ur+9*Br*i))/Mt(n),xn(St(n)/ya)]};function ub(){return ma(Ud).scale(177.158)}function Bd(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}Bd.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,a=s*s;n-=r=(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(Ot(r)>_t&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function hb(){return ma(Bd).scale(175.295)}function db(e,t){return e.parent===t.parent?1:2}function fb(e){return e.reduce(pb,0)/e.length}function pb(e,t){return e+t.x}function gb(e){return 1+e.reduce(mb,0)}function mb(e,t){return Math.max(e,t.y)}function vb(e){for(var t;t=e.children;)e=t[0];return e}function yb(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Eb(){var e=db,t=1,n=1,i=!1;function r(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=fb(f),h.y=gb(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=vb(s),c=yb(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(i?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function xb(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function bb(){return this.eachAfter(xb)}function Sb(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function Tb(e,t){for(var n=this,i=[n],r,s,a=-1;n=i.pop();)if(e.call(t,n,++a,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function _b(e,t){for(var n=this,i=[n],r=[],s,a,o,l=-1;n=i.pop();)if(r.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)i.push(s[a]);for(;n=r.pop();)e.call(t,n,++l,this);return this}function Ob(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function wb(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function Mb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Ab(e){for(var t=this,n=Cb(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function Cb(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function Db(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Lb(){return Array.from(this)}function Rb(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Ib(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*kb(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function Gr(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=$b)):t===void 0&&(t=Nb);for(var n=new Hr(e),i,r=[n],s,a,o,l;i=r.pop();)if((a=t(i.data))&&(l=(a=Array.from(a)).length))for(i.children=a,o=l-1;o>=0;--o)r.push(s=a[o]=new Hr(a[o])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(Ub)}function Pb(){return Gr(this).eachBefore(Fb)}function Nb(e){return e.children}function $b(e){return Array.isArray(e)?e[1]:null}function Fb(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ub(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Hr(e){this.data=e,this.depth=this.height=0,this.parent=null}Hr.prototype=Gr.prototype={constructor:Hr,count:bb,each:Sb,eachAfter:_b,eachBefore:Tb,find:Ob,sum:wb,sort:Mb,path:Ab,ancestors:Db,descendants:Lb,leaves:Rb,links:Ib,copy:Pb,[Symbol.iterator]:kb};function Bb(e){return e==null?null:Gd(e)}function Gd(e){if(typeof e!="function")throw new Error;return e}function ei(){return 0}function Li(e){return function(){return e}}const Gb=1664525,Hb=1013904223,Hd=4294967296;function Vb(){let e=1;return()=>(e=(Gb*e+Hb)%Hd)/Hd}function zb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Wb(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Yb(e,t){for(var n=0,i=(e=Wb(Array.from(e),t)).length,r=[],s,a;n<i;)s=e[n],a&&Vd(a,s)?++n:(a=Xb(r=qb(r,s)),n=0);return a}function qb(e,t){var n,i;if(Al(t,e))return[t];for(n=0;n<e.length;++n)if(Ea(t,e[n])&&Al(Vr(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(Ea(Vr(e[n],e[i]),t)&&Ea(Vr(e[n],t),e[i])&&Ea(Vr(e[i],t),e[n])&&Al(zd(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function Ea(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Vd(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Al(e,t){for(var n=0;n<t.length;++n)if(!Vd(e,t[n]))return!1;return!0}function Xb(e){switch(e.length){case 1:return Zb(e[0]);case 2:return Vr(e[0],e[1]);case 3:return zd(e[0],e[1],e[2])}}function Zb(e){return{x:e.x,y:e.y,r:e.r}}function Vr(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-i,u=o-r,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(i+a+c/d*u)/2,r:(d+r+o)/2}}function zd(e,t,n){var i=e.x,r=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=i-a,f=i-c,p=r-o,g=r-u,m=l-s,v=d-s,S=i*i+r*r-s*s,E=S-a*a-o*o+l*l,b=S-c*c-u*u+d*d,x=f*p-h*g,T=(p*b-g*E)/(x*2)-i,C=(g*m-p*v)/x,D=(f*E-h*b)/(x*2)-r,$=(h*v-f*m)/x,P=C*C+$*$-1,w=2*(s+T*C+D*$),G=T*T+D*D-s*s,N=-(Math.abs(P)>1e-6?(w+Math.sqrt(w*w-4*P*G))/(2*P):G/w);return{x:i+T+C*N,y:r+D+$*N,r:N}}function Wd(e,t,n){var i=e.x-t.x,r,s,a=e.y-t.y,o,l,c=i*i+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(r=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-r*r)),n.x=e.x-r*i-o*a,n.y=e.y-r*a+o*i):(r=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-r*r)),n.x=t.x+r*i-o*a,n.y=t.y+r*a+o*i)):(n.x=t.x+n.r,n.y=t.y)}function Yd(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function qd(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function xa(e){this._=e,this.next=null,this.previous=null}function jb(e,t){if(!(s=(e=zb(e)).length))return 0;var n,i,r,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;Wd(i,n,r=e[2]),n=new xa(n),i=new xa(i),r=new xa(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(l=3;l<s;++l){Wd(n._,i._,r=e[l]),r=new xa(r),c=i.next,u=n.previous,d=i._.r,h=n._.r;do if(d<=h){if(Yd(c._,r._)){i=c,n.next=i,i.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(Yd(u._,r._)){n=u,n.next=i,i.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=qd(n);(r=r.next)!==i;)(o=qd(r))<a&&(n=r,a=o);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=Yb(n,t),l=0;l<s;++l)n=e[l],n.x-=r.x,n.y-=r.y;return r.r}function Kb(e){return Math.sqrt(e.value)}function Qb(){var e=null,t=1,n=1,i=ei;function r(s){const a=Vb();return s.x=t/2,s.y=n/2,e?s.eachBefore(Xd(e)).eachAfter(Cl(i,.5,a)).eachBefore(Zd(1)):s.eachBefore(Xd(Kb)).eachAfter(Cl(ei,1,a)).eachAfter(Cl(i,s.r/Math.min(t,n),a)).eachBefore(Zd(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=Bb(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:Li(+s),r):i},r}function Xd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Cl(e,t,n){return function(i){if(r=i.children){var r,s,a=r.length,o=e(i)*t||0,l;if(o)for(s=0;s<a;++s)r[s].r+=o;if(l=jb(r,n),o)for(s=0;s<a;++s)r[s].r-=o;i.r=l+o}}}function Zd(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 Jb(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 tS(e,t,n,i,r){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=r,a.x0=t,a.x1=t+=a.value*c}function eS(e,t){return e.parent===t.parent?1:2}function Dl(e){var t=e.children;return t?t[0]:e.t}function Ll(e){var t=e.children;return t?t[t.length-1]:e.t}function nS(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function iS(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function rS(e,t,n){return e.a.parent===t.parent?e.a:n}function ba(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}ba.prototype=Object.create(Hr.prototype);function sS(e){for(var t=new ba(e,0),n,i=[t],r,s,a,o;n=i.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)i.push(r=n.children[a]=new ba(s[a],a)),r.parent=n;return(t.parent=new ba(null,0)).children=[t],t}function aS(){var e=eS,t=1,n=1,i=null;function r(c){var u=sS(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),i)c.eachBefore(l);else{var d=c,h=c,f=c;c.eachBefore(function(S){S.x<d.x&&(d=S),S.x>h.x&&(h=S),S.depth>f.depth&&(f=S)});var p=d===h?1:e(d,h)/2,g=p-d.x,m=t/(h.x+p+g),v=n/(f.depth||1);c.eachBefore(function(S){S.x=(S.x+g)*m,S.y=S.depth*v})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){iS(c);var f=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-f):c.z=f}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,f=c,p=u,g=h.parent.children[0],m=h.m,v=f.m,S=p.m,E=g.m,b;p=Ll(p),h=Dl(h),p&&h;)g=Dl(g),f=Ll(f),f.a=c,b=p.z+S-h.z-m+e(p._,h._),b>0&&(nS(rS(p,c,d),c,b),m+=b,v+=b),S+=p.m,m+=h.m,E+=g.m,v+=f.m;p&&!Ll(f)&&(f.t=p,f.m+=S-v),h&&!Dl(g)&&(g.t=h,g.m+=m-E,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return r.separation=function(c){return arguments.length?(e=c,r):e},r.size=function(c){return arguments.length?(i=!1,t=+c[0],n=+c[1],r):i?null:[t,n]},r.nodeSize=function(c){return arguments.length?(i=!0,t=+c[0],n=+c[1],r):i?[t,n]:null},r}function oS(e,t,n,i,r){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=i,a.y0=n,a.y1=n+=a.value*c}var lS=(1+Math.sqrt(5))/2;function cS(e,t,n,i,r,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,f,p,g=t.value,m,v,S,E,b,x,T;u<h;){f=r-n,p=s-i;do m=o[d++].value;while(!m&&d<h);for(v=S=m,x=Math.max(p/f,f/p)/(g*e),T=m*m*x,b=Math.max(S/T,T/v);d<h;++d){if(m+=c=o[d].value,c<v&&(v=c),c>S&&(S=c),T=m*m*x,E=Math.max(S/T,T/v),E>b){m-=c;break}b=E}a.push(l={value:m,dice:f<p,children:o.slice(u,d)}),l.dice?tS(l,n,i,r,g?i+=p*m/g:s):oS(l,n,i,g?n+=f*m/g:r,s),g-=m,u=d}return a}const uS=function e(t){function n(i,r,s,a,o){cS(t,i,r,s,a,o)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(lS);function hS(){var e=uS,t=!1,n=1,i=1,r=[0],s=ei,a=ei,o=ei,l=ei,c=ei;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=i,h.eachBefore(d),r=[0],t&&h.eachBefore(Jb),h}function d(h){var f=r[h.depth],p=h.x0+f,g=h.y0+f,m=h.x1-f,v=h.y1-f;m<p&&(p=m=(p+m)/2),v<g&&(g=v=(g+v)/2),h.x0=p,h.y0=g,h.x1=m,h.y1=v,h.children&&(f=r[h.depth+1]=s(h)/2,p+=c(h)-f,g+=a(h)-f,m-=o(h)-f,v-=l(h)-f,m<p&&(p=m=(p+m)/2),v<g&&(g=v=(g+v)/2),e(h,p,g,m,v))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],i=+h[1],u):[n,i]},u.tile=function(h){return arguments.length?(e=Gd(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:Li(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:Li(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:Li(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:Li(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:Li(+h),u):c},u}function Ri(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const jd=Symbol("implicit");function Sa(){var e=new Hu,t=[],n=[],i=jd;function r(s){let a=e.get(s);if(a===void 0){if(i!==jd)return i;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Hu;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return Sa(t,n).unknown(i)},Ri.apply(r,arguments),r}function Ii(){var e=Sa().unknown(void 0),t=e.domain,n=e.range,i=0,r=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,f=r<i,p=f?r:i,g=f?i:r;s=(g-p)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),p+=(g-p-s*(h-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var m=x0(h).map(function(v){return p+s*v});return n(f?m.reverse():m)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([i,r]=h,i=+i,r=+r,d()):[i,r]},e.rangeRound=function(h){return[i,r]=h,i=+i,r=+r,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return Ii(t(),[i,r]).round(o).paddingInner(l).paddingOuter(c).align(u)},Ri.apply(d(),arguments)}function dS(e){return function(){return e}}function fS(e){return+e}var Kd=[0,1];function ki(e){return e}function Rl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:dS(isNaN(t)?NaN:.5)}function pS(e,t){var n;return e>t&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function gS(e,t,n){var i=e[0],r=e[1],s=t[0],a=t[1];return r<i?(i=Rl(r,i),s=n(a,s)):(i=Rl(i,r),s=n(s,a)),function(o){return s(i(o))}}function mS(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),s=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=Rl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=_o(e,o,1,i)-1;return s[l](r[l](o))}}function Il(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Qd(){var e=Kd,t=Kd,n=_r,i,r,s,a=ki,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==ki&&(a=pS(e[0],e[h-1])),o=h>2?mS:gS,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(i),t,n)))(i(a(h)))}return d.invert=function(h){return a(r((c||(c=o(t,e.map(i),Te)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,fS),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Sh,u()},d.clamp=function(h){return arguments.length?(a=h?!0:ki,u()):a!==ki},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return i=h,r=f,u()}}function Jd(){return Qd()(ki,ki)}function vS(e,t,n,i){var r=wo(e,t,n),s;switch(i=Cr(i??",f"),i.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=vx(r,a))&&(i.precision=s),Qh(i,a)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=yx(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=mx(r))&&(i.precision=s-(i.type==="%")*2);break}}return sl(i)}function tf(e){var t=e.domain;return e.ticks=function(n){var i=t();return ks(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return vS(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,a=i[r],o=i[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=r,r=s,s=c);u-- >0;){if(c=xi(a,o,n),c===l)return i[r]=a,i[s]=o,t(i);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Ye(){var e=Jd();return e.copy=function(){return Il(e,Ye())},Ri.apply(e,arguments),tf(e)}function ef(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],a;return s<r&&(a=n,n=i,i=a,a=r,r=s,s=a),e[n]=t.floor(r),e[i]=t.ceil(s),e}function nf(e){return Math.log(e)}function rf(e){return Math.exp(e)}function yS(e){return-Math.log(-e)}function ES(e){return-Math.exp(-e)}function xS(e){return isFinite(e)?+("1e"+e):e<0?0:e}function bS(e){return e===10?xS:e===Math.E?Math.exp:t=>Math.pow(e,t)}function SS(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 sf(e){return(t,n)=>-e(-t,n)}function TS(e){const t=e(nf,rf),n=t.domain;let i=10,r,s;function a(){return r=SS(i),s=bS(i),n()[0]<0?(r=sf(r),s=sf(s),e(yS,ES)):e(nf,rf),t}return t.base=function(o){return arguments.length?(i=+o,a()):i},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=r(c),f=r(u),p,g;const m=o==null?10:+o;let v=[];if(!(i%1)&&f-h<m){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(p=1;p<i;++p)if(g=h<0?p/s(-h):p*s(h),!(g<c)){if(g>u)break;v.push(g)}}else for(;h<=f;++h)for(p=i-1;p>=1;--p)if(g=h>0?p/s(-h):p*s(h),!(g<c)){if(g>u)break;v.push(g)}v.length*2<m&&(v=ks(c,u,m))}else v=ks(h,f,Math.min(f-h,m)).map(s);return d?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=Cr(l)).precision==null&&(l.trim=!0),l=sl(l)),o===1/0)return l;const c=Math.max(1,i*o/t.ticks().length);return u=>{let d=u/s(Math.round(r(u)));return d*i<i-.5&&(d*=i),d<=c?l(u):""}},t.nice=()=>n(ef(n(),{floor:o=>s(Math.floor(r(o))),ceil:o=>s(Math.ceil(r(o)))})),t}function af(){const e=TS(Qd()).domain([1,10]);return e.copy=()=>Il(e,af()).base(e.base()),Ri.apply(e,arguments),e}function kl(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function a(l){return l!=null&&l<=l?r[_o(i,l,0,n)]:s}function o(){var l=-1;for(i=new Array(n);++l<n;)i[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=(r=Array.from(l)).length-1,o()):r.slice()},a.invertExtent=function(l){var c=r.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,i[0]]:c>=n?[i[n-1],t]:[i[c-1],i[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return i.slice()},a.copy=function(){return kl().domain([e,t]).range(r).unknown(s)},Ri.apply(tf(a),arguments)}const Pl=new Date,Nl=new Date;function Xt(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const a=r(s),o=r.ceil(s);return s-a<o-s?a:o},r.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),r.range=(s,a,o)=>{const l=[];if(s=r.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},r.filter=s=>Xt(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&&(r.count=(s,a)=>(Pl.setTime(+s),Nl.setTime(+a),e(Pl),e(Nl),Math.floor(n(Pl,Nl))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?a=>i(a)%s===0:a=>r.count(0,a)%s===0):r)),r}const Ta=Xt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ta.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Xt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ta),Ta.range;const Sn=1e3,Le=Sn*60,Tn=Le*60,_n=Tn*24,$l=_n*7,of=_n*30,Fl=_n*365,Pi=Xt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getUTCSeconds());Pi.range;const Ul=Xt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sn)},(e,t)=>{e.setTime(+e+t*Le)},(e,t)=>(t-e)/Le,e=>e.getMinutes());Ul.range,Xt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Le)},(e,t)=>(t-e)/Le,e=>e.getUTCMinutes()).range;const Bl=Xt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Sn-e.getMinutes()*Le)},(e,t)=>{e.setTime(+e+t*Tn)},(e,t)=>(t-e)/Tn,e=>e.getHours());Bl.range,Xt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Tn)},(e,t)=>(t-e)/Tn,e=>e.getUTCHours()).range;const zr=Xt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Le)/_n,e=>e.getDate()-1);zr.range;const Gl=Xt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_n,e=>e.getUTCDate()-1);Gl.range,Xt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_n,e=>Math.floor(e/_n)).range;function ni(e){return Xt(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())*Le)/$l)}const _a=ni(0),Oa=ni(1),_S=ni(2),OS=ni(3),Ni=ni(4),wS=ni(5),MS=ni(6);_a.range,Oa.range,_S.range,OS.range,Ni.range,wS.range,MS.range;function ii(e){return Xt(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)/$l)}const lf=ii(0),wa=ii(1),AS=ii(2),CS=ii(3),$i=ii(4),DS=ii(5),LS=ii(6);lf.range,wa.range,AS.range,CS.range,$i.range,DS.range,LS.range;const Hl=Xt(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());Hl.range,Xt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const On=Xt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());On.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),On.range;const ri=Xt(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());ri.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xt(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)}),ri.range;function RS(e,t,n,i,r,s){const a=[[Pi,1,Sn],[Pi,5,5*Sn],[Pi,15,15*Sn],[Pi,30,30*Sn],[s,1,Le],[s,5,5*Le],[s,15,15*Le],[s,30,30*Le],[r,1,Tn],[r,3,3*Tn],[r,6,6*Tn],[r,12,12*Tn],[i,1,_n],[i,2,2*_n],[n,1,$l],[t,1,of],[t,3,3*of],[e,1,Fl]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const f=d&&typeof d.range=="function"?d:l(c,u,d),p=f?f.range(c,+u+1):[];return h?p.reverse():p}function l(c,u,d){const h=Math.abs(u-c)/d,f=To(([,,m])=>m).right(a,h);if(f===a.length)return e.every(wo(c/Fl,u/Fl,d));if(f===0)return Ta.every(Math.max(wo(c,u,d),1));const[p,g]=a[h/a[f-1][2]<a[f][2]/h?f-1:f];return p.every(g)}return[o,l]}const[IS,kS]=RS(On,Hl,_a,zr,Bl,Ul);function Vl(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 zl(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 Wr(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function PS(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=Yr(r),u=qr(r),d=Yr(s),h=qr(s),f=Yr(a),p=qr(a),g=Yr(o),m=qr(o),v=Yr(l),S=qr(l),E={a:U,A:R,b:B,B:tt,c:null,d:pf,e:pf,f:rT,g:pT,G:mT,H:eT,I:nT,j:iT,L:gf,m:sT,M:aT,p:Z,q,Q:bf,s:Sf,S:oT,u:lT,U:cT,V:uT,w:hT,W:dT,x:null,X:null,y:fT,Y:gT,Z:vT,"%":xf},b={a:Q,A:ht,b:et,B:K,c:null,d:vf,e:vf,f:bT,g:LT,G:IT,H:yT,I:ET,j:xT,L:yf,m:ST,M:TT,p:nt,q:lt,Q:bf,s:Sf,S:_T,u:OT,U:wT,V:MT,w:AT,W:CT,x:null,X:null,y:DT,Y:RT,Z:kT,"%":xf},x={a:P,A:w,b:G,B:N,c:A,d:df,e:df,f:KS,g:hf,G:uf,H:ff,I:ff,j:qS,L:jS,m:YS,M:XS,p:$,q:WS,Q:JS,s:tT,S:ZS,u:BS,U:GS,V:HS,w:US,W:VS,x:O,X:F,y:hf,Y:uf,Z:zS,"%":QS};E.x=T(n,E),E.X=T(i,E),E.c=T(t,E),b.x=T(n,b),b.X=T(i,b),b.c=T(t,b);function T(Y,j){return function(J){var L=[],H=-1,V=0,yt=Y.length,Bt,at,bt;for(J instanceof Date||(J=new Date(+J));++H<yt;)Y.charCodeAt(H)===37&&(L.push(Y.slice(V,H)),(at=cf[Bt=Y.charAt(++H)])!=null?Bt=Y.charAt(++H):at=Bt==="e"?" ":"0",(bt=j[Bt])&&(Bt=bt(J,at)),L.push(Bt),V=H+1);return L.push(Y.slice(V,H)),L.join("")}}function C(Y,j){return function(J){var L=Wr(1900,void 0,1),H=D(L,Y,J+="",0),V,yt;if(H!=J.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(L.s*1e3+("L"in L?L.L:0));if(j&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+L.p*12),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(V=zl(Wr(L.y,0,1)),yt=V.getUTCDay(),V=yt>4||yt===0?wa.ceil(V):wa(V),V=Gl.offset(V,(L.V-1)*7),L.y=V.getUTCFullYear(),L.m=V.getUTCMonth(),L.d=V.getUTCDate()+(L.w+6)%7):(V=Vl(Wr(L.y,0,1)),yt=V.getDay(),V=yt>4||yt===0?Oa.ceil(V):Oa(V),V=zr.offset(V,(L.V-1)*7),L.y=V.getFullYear(),L.m=V.getMonth(),L.d=V.getDate()+(L.w+6)%7)}else("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),yt="Z"in L?zl(Wr(L.y,0,1)).getUTCDay():Vl(Wr(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+L.W*7-(yt+5)%7:L.w+L.U*7-(yt+6)%7);return"Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,zl(L)):Vl(L)}}function D(Y,j,J,L){for(var H=0,V=j.length,yt=J.length,Bt,at;H<V;){if(L>=yt)return-1;if(Bt=j.charCodeAt(H++),Bt===37){if(Bt=j.charAt(H++),at=x[Bt in cf?j.charAt(H++):Bt],!at||(L=at(Y,J,L))<0)return-1}else if(Bt!=J.charCodeAt(L++))return-1}return L}function $(Y,j,J){var L=c.exec(j.slice(J));return L?(Y.p=u.get(L[0].toLowerCase()),J+L[0].length):-1}function P(Y,j,J){var L=f.exec(j.slice(J));return L?(Y.w=p.get(L[0].toLowerCase()),J+L[0].length):-1}function w(Y,j,J){var L=d.exec(j.slice(J));return L?(Y.w=h.get(L[0].toLowerCase()),J+L[0].length):-1}function G(Y,j,J){var L=v.exec(j.slice(J));return L?(Y.m=S.get(L[0].toLowerCase()),J+L[0].length):-1}function N(Y,j,J){var L=g.exec(j.slice(J));return L?(Y.m=m.get(L[0].toLowerCase()),J+L[0].length):-1}function A(Y,j,J){return D(Y,t,j,J)}function O(Y,j,J){return D(Y,n,j,J)}function F(Y,j,J){return D(Y,i,j,J)}function U(Y){return a[Y.getDay()]}function R(Y){return s[Y.getDay()]}function B(Y){return l[Y.getMonth()]}function tt(Y){return o[Y.getMonth()]}function Z(Y){return r[+(Y.getHours()>=12)]}function q(Y){return 1+~~(Y.getMonth()/3)}function Q(Y){return a[Y.getUTCDay()]}function ht(Y){return s[Y.getUTCDay()]}function et(Y){return l[Y.getUTCMonth()]}function K(Y){return o[Y.getUTCMonth()]}function nt(Y){return r[+(Y.getUTCHours()>=12)]}function lt(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var j=T(Y+="",E);return j.toString=function(){return Y},j},parse:function(Y){var j=C(Y+="",!1);return j.toString=function(){return Y},j},utcFormat:function(Y){var j=T(Y+="",b);return j.toString=function(){return Y},j},utcParse:function(Y){var j=C(Y+="",!0);return j.toString=function(){return Y},j}}}var cf={"-":"",_:" ",0:"0"},jt=/^\s*\d+/,NS=/^%/,$S=/[\\^$*+?|[\]().{}]/g;function xt(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function FS(e){return e.replace($S,"\\$&")}function Yr(e){return new RegExp("^(?:"+e.map(FS).join("|")+")","i")}function qr(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function US(e,t,n){var i=jt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function BS(e,t,n){var i=jt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function GS(e,t,n){var i=jt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function HS(e,t,n){var i=jt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function VS(e,t,n){var i=jt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function uf(e,t,n){var i=jt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function hf(e,t,n){var i=jt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function zS(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function WS(e,t,n){var i=jt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function YS(e,t,n){var i=jt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function df(e,t,n){var i=jt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function qS(e,t,n){var i=jt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function ff(e,t,n){var i=jt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function XS(e,t,n){var i=jt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function ZS(e,t,n){var i=jt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function jS(e,t,n){var i=jt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function KS(e,t,n){var i=jt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function QS(e,t,n){var i=NS.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function JS(e,t,n){var i=jt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function tT(e,t,n){var i=jt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function pf(e,t){return xt(e.getDate(),t,2)}function eT(e,t){return xt(e.getHours(),t,2)}function nT(e,t){return xt(e.getHours()%12||12,t,2)}function iT(e,t){return xt(1+zr.count(On(e),e),t,3)}function gf(e,t){return xt(e.getMilliseconds(),t,3)}function rT(e,t){return gf(e,t)+"000"}function sT(e,t){return xt(e.getMonth()+1,t,2)}function aT(e,t){return xt(e.getMinutes(),t,2)}function oT(e,t){return xt(e.getSeconds(),t,2)}function lT(e){var t=e.getDay();return t===0?7:t}function cT(e,t){return xt(_a.count(On(e)-1,e),t,2)}function mf(e){var t=e.getDay();return t>=4||t===0?Ni(e):Ni.ceil(e)}function uT(e,t){return e=mf(e),xt(Ni.count(On(e),e)+(On(e).getDay()===4),t,2)}function hT(e){return e.getDay()}function dT(e,t){return xt(Oa.count(On(e)-1,e),t,2)}function fT(e,t){return xt(e.getFullYear()%100,t,2)}function pT(e,t){return e=mf(e),xt(e.getFullYear()%100,t,2)}function gT(e,t){return xt(e.getFullYear()%1e4,t,4)}function mT(e,t){var n=e.getDay();return e=n>=4||n===0?Ni(e):Ni.ceil(e),xt(e.getFullYear()%1e4,t,4)}function vT(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+xt(t/60|0,"0",2)+xt(t%60,"0",2)}function vf(e,t){return xt(e.getUTCDate(),t,2)}function yT(e,t){return xt(e.getUTCHours(),t,2)}function ET(e,t){return xt(e.getUTCHours()%12||12,t,2)}function xT(e,t){return xt(1+Gl.count(ri(e),e),t,3)}function yf(e,t){return xt(e.getUTCMilliseconds(),t,3)}function bT(e,t){return yf(e,t)+"000"}function ST(e,t){return xt(e.getUTCMonth()+1,t,2)}function TT(e,t){return xt(e.getUTCMinutes(),t,2)}function _T(e,t){return xt(e.getUTCSeconds(),t,2)}function OT(e){var t=e.getUTCDay();return t===0?7:t}function wT(e,t){return xt(lf.count(ri(e)-1,e),t,2)}function Ef(e){var t=e.getUTCDay();return t>=4||t===0?$i(e):$i.ceil(e)}function MT(e,t){return e=Ef(e),xt($i.count(ri(e),e)+(ri(e).getUTCDay()===4),t,2)}function AT(e){return e.getUTCDay()}function CT(e,t){return xt(wa.count(ri(e)-1,e),t,2)}function DT(e,t){return xt(e.getUTCFullYear()%100,t,2)}function LT(e,t){return e=Ef(e),xt(e.getUTCFullYear()%100,t,2)}function RT(e,t){return xt(e.getUTCFullYear()%1e4,t,4)}function IT(e,t){var n=e.getUTCDay();return e=n>=4||n===0?$i(e):$i.ceil(e),xt(e.getUTCFullYear()%1e4,t,4)}function kT(){return"+0000"}function xf(){return"%"}function bf(e){return+e}function Sf(e){return Math.floor(+e/1e3)}var Fi,Tf;PT({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 PT(e){return Fi=PS(e),Tf=Fi.format,Fi.parse,Fi.utcFormat,Fi.utcParse,Fi}function NT(e){return new Date(e)}function $T(e){return e instanceof Date?+e:+new Date(+e)}function _f(e,t,n,i,r,s,a,o,l,c){var u=Jd(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),S=c("%b %d"),E=c("%B"),b=c("%Y");function x(T){return(l(T)<T?f:o(T)<T?p:a(T)<T?g:s(T)<T?m:i(T)<T?r(T)<T?v:S:n(T)<T?E:b)(T)}return u.invert=function(T){return new Date(d(T))},u.domain=function(T){return arguments.length?h(Array.from(T,$T)):h().map(NT)},u.ticks=function(T){var C=h();return e(C[0],C[C.length-1],T??10)},u.tickFormat=function(T,C){return C==null?x:c(C)},u.nice=function(T){var C=h();return(!T||typeof T.range!="function")&&(T=t(C[0],C[C.length-1],T??10)),T?h(ef(C,T)):u},u.copy=function(){return Il(u,_f(e,t,n,i,r,s,a,o,l,c))},u}function Of(){return Ri.apply(_f(IS,kS,On,Hl,_a,zr,Bl,Ul,Pi,Tf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gt(e){return function(){return e}}const wf=Math.abs,ie=Math.atan2,si=Math.cos,FT=Math.max,Wl=Math.min,an=Math.sin,Ui=Math.sqrt,re=1e-12,Xr=Math.PI,Ma=Xr/2,Aa=2*Xr;function UT(e){return e>1?0:e<-1?Xr:Math.acos(e)}function Mf(e){return e>=1?Ma:e<=-1?-Ma:Math.asin(e)}function Ca(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new ox(t)}function BT(e){return e.innerRadius}function GT(e){return e.outerRadius}function HT(e){return e.startAngle}function VT(e){return e.endAngle}function zT(e){return e&&e.padAngle}function WT(e,t,n,i,r,s,a,o){var l=n-e,c=i-t,u=a-r,d=o-s,h=d*l-u*c;if(!(h*h<re))return h=(u*(t-s)-d*(e-r))/h,[e+h*l,t+h*c]}function Da(e,t,n,i,r,s,a){var o=e-n,l=t-i,c=(a?s:-s)/Ui(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,g=i+d,m=(h+p)/2,v=(f+g)/2,S=p-h,E=g-f,b=S*S+E*E,x=r-s,T=h*g-p*f,C=(E<0?-1:1)*Ui(FT(0,x*x*b-T*T)),D=(T*E-S*C)/b,$=(-T*S-E*C)/b,P=(T*E+S*C)/b,w=(-T*S+E*C)/b,G=D-m,N=$-v,A=P-m,O=w-v;return G*G+N*N>A*A+O*O&&(D=P,$=w),{cx:D,cy:$,x01:-u,y01:-d,x11:D*(r/x-1),y11:$*(r/x-1)}}function Zr(){var e=BT,t=GT,n=gt(0),i=null,r=HT,s=VT,a=zT,o=null,l=Ca(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=r.apply(this,arguments)-Ma,g=s.apply(this,arguments)-Ma,m=wf(g-p),v=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>re))o.moveTo(0,0);else if(m>Aa-re)o.moveTo(f*si(p),f*an(p)),o.arc(0,0,f,p,g,!v),h>re&&(o.moveTo(h*si(g),h*an(g)),o.arc(0,0,h,g,p,v));else{var S=p,E=g,b=p,x=g,T=m,C=m,D=a.apply(this,arguments)/2,$=D>re&&(i?+i.apply(this,arguments):Ui(h*h+f*f)),P=Wl(wf(f-h)/2,+n.apply(this,arguments)),w=P,G=P,N,A;if($>re){var O=Mf($/h*an(D)),F=Mf($/f*an(D));(T-=O*2)>re?(O*=v?1:-1,b+=O,x-=O):(T=0,b=x=(p+g)/2),(C-=F*2)>re?(F*=v?1:-1,S+=F,E-=F):(C=0,S=E=(p+g)/2)}var U=f*si(S),R=f*an(S),B=h*si(x),tt=h*an(x);if(P>re){var Z=f*si(E),q=f*an(E),Q=h*si(b),ht=h*an(b),et;if(m<Xr)if(et=WT(U,R,Q,ht,Z,q,B,tt)){var K=U-et[0],nt=R-et[1],lt=Z-et[0],Y=q-et[1],j=1/an(UT((K*lt+nt*Y)/(Ui(K*K+nt*nt)*Ui(lt*lt+Y*Y)))/2),J=Ui(et[0]*et[0]+et[1]*et[1]);w=Wl(P,(h-J)/(j-1)),G=Wl(P,(f-J)/(j+1))}else w=G=0}C>re?G>re?(N=Da(Q,ht,U,R,f,G,v),A=Da(Z,q,B,tt,f,G,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),G<P?o.arc(N.cx,N.cy,G,ie(N.y01,N.x01),ie(A.y01,A.x01),!v):(o.arc(N.cx,N.cy,G,ie(N.y01,N.x01),ie(N.y11,N.x11),!v),o.arc(0,0,f,ie(N.cy+N.y11,N.cx+N.x11),ie(A.cy+A.y11,A.cx+A.x11),!v),o.arc(A.cx,A.cy,G,ie(A.y11,A.x11),ie(A.y01,A.x01),!v))):(o.moveTo(U,R),o.arc(0,0,f,S,E,!v)):o.moveTo(U,R),!(h>re)||!(T>re)?o.lineTo(B,tt):w>re?(N=Da(B,tt,Z,q,h,-w,v),A=Da(U,R,Q,ht,h,-w,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),w<P?o.arc(N.cx,N.cy,w,ie(N.y01,N.x01),ie(A.y01,A.x01),!v):(o.arc(N.cx,N.cy,w,ie(N.y01,N.x01),ie(N.y11,N.x11),!v),o.arc(0,0,h,ie(N.cy+N.y11,N.cx+N.x11),ie(A.cy+A.y11,A.cx+A.x11),v),o.arc(A.cx,A.cy,w,ie(A.y11,A.x11),ie(A.y01,A.x01),!v))):o.arc(0,0,h,x,b,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,d=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-Xr/2;return[si(d)*u,an(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:gt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:gt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:gt(+u),c):n},c.padRadius=function(u){return arguments.length?(i=u==null?null:typeof u=="function"?u:gt(+u),c):i},c.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:gt(+u),c):r},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:gt(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:gt(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var YT=Array.prototype.slice;function La(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Af(e){this._context=e}Af.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 Ra(e){return new Af(e)}function Yl(e){return e[0]}function ql(e){return e[1]}function jr(e,t){var n=gt(!0),i=null,r=Ra,s=null,a=Ca(o);e=typeof e=="function"?e:e===void 0?Yl:gt(e),t=typeof t=="function"?t:t===void 0?ql:gt(t);function o(l){var c,u=(l=La(l)).length,d,h=!1,f;for(i==null&&(s=r(f=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:gt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:gt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:gt(!!l),o):n},o.curve=function(l){return arguments.length?(r=l,i!=null&&(s=r(i)),o):r},o.context=function(l){return arguments.length?(l==null?i=s=null:s=r(i=l),o):i},o}function Xl(e,t,n){var i=null,r=gt(!0),s=null,a=Ra,o=null,l=Ca(c);e=typeof e=="function"?e:e===void 0?Yl:gt(+e),t=typeof t=="function"?t:gt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?ql:gt(+n);function c(d){var h,f,p,g=(d=La(d)).length,m,v=!1,S,E=new Array(g),b=new Array(g);for(s==null&&(o=a(S=l())),h=0;h<=g;++h){if(!(h<g&&r(m=d[h],h,d))===v)if(v=!v)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(E[p],b[p]);o.lineEnd(),o.areaEnd()}v&&(E[h]=+e(m,h,d),b[h]=+t(m,h,d),o.point(i?+i(m,h,d):E[h],n?+n(m,h,d):b[h]))}if(S)return o=null,S+""||null}function u(){return jr().defined(r).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:gt(+d),i=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:gt(+d),c):e},c.x1=function(d){return arguments.length?(i=d==null?null:typeof d=="function"?d:gt(+d),c):i},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:gt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:gt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:gt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(i).y(t)},c.defined=function(d){return arguments.length?(r=typeof d=="function"?d:gt(!!d),c):r},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function qT(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function XT(e){return e}function ZT(){var e=XT,t=qT,n=null,i=gt(0),r=gt(Aa),s=gt(0);function a(o){var l,c=(o=La(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),g=+i.apply(this,arguments),m=Math.min(Aa,Math.max(-Aa,r.apply(this,arguments)-g)),v,S=Math.min(Math.abs(m)/c,s.apply(this,arguments)),E=S*(m<0?-1:1),b;for(l=0;l<c;++l)(b=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=b);for(t!=null?f.sort(function(x,T){return t(p[x],p[T])}):n!=null&&f.sort(function(x,T){return n(o[x],o[T])}),l=0,d=h?(m-c*E)/h:0;l<c;++l,g=v)u=f[l],b=p[u],v=g+(b>0?b*d:0)+E,p[u]={data:o[u],index:l,value:b,startAngle:g,endAngle:v,padAngle:S};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:gt(+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?(i=typeof o=="function"?o:gt(+o),a):i},a.endAngle=function(o){return arguments.length?(r=typeof o=="function"?o:gt(+o),a):r},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:gt(+o),a):s},a}var jT=Df(Ra);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 Df(e){function t(n){return new Cf(e(n))}return t._curve=e,t}function KT(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(Df(n)):t()._curve},e}function QT(){return KT(jr().curve(jT))}class JT{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 t_(e){return new JT(e,!0)}function e_(e){return e.source}function n_(e){return e.target}function i_(e){let t=e_,n=n_,i=Yl,r=ql,s=null,a=null,o=Ca(l);function l(){let c;const u=YT.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+i.apply(this,u),+r.apply(this,u)),u[0]=h,a.point(+i.apply(this,u),+r.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?(i=typeof c=="function"?c:gt(+c),l):i},l.y=function(c){return arguments.length?(r=typeof c=="function"?c:gt(+c),l):r},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function r_(){return i_(t_)}function Bn(){}function Ia(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 ka(e){this._context=e}ka.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:Ia(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:Ia(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function s_(e){return new ka(e)}function Lf(e){this._context=e}Lf.prototype={areaStart:Bn,areaEnd:Bn,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:Ia(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function a_(e){return new Lf(e)}function Rf(e){this._context=e}Rf.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,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Ia(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function o_(e){return new Rf(e)}function If(e,t){this._basis=new ka(e),this._beta=t}If.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 i=e[0],r=t[0],s=e[n]-i,a=t[n]-r,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(i+l*s),this._beta*t[o]+(1-this._beta)*(r+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const l_=function e(t){function n(i){return t===1?new ka(i):new If(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Pa(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 Zl(e,t){this._context=e,this._k=(1-t)/6}Zl.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:Pa(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:Pa(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 c_=function e(t){function n(i){return new Zl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function jl(e,t){this._context=e,this._k=(1-t)/6}jl.prototype={areaStart:Bn,areaEnd:Bn,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:Pa(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 u_=function e(t){function n(i){return new jl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Kl(e,t){this._context=e,this._k=(1-t)/6}Kl.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:Pa(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 h_=function e(t){function n(i){return new Kl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Ql(e,t,n){var i=e._x1,r=e._y1,s=e._x2,a=e._y2;if(e._l01_a>re){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);i=(i*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>re){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(i,r,s,a,e._x2,e._y2)}function kf(e,t){this._context=e,this._alpha=t}kf.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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ql(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 d_=function e(t){function n(i){return t?new kf(i,t):new Zl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Pf(e,t){this._context=e,this._alpha=t}Pf.prototype={areaStart:Bn,areaEnd:Bn,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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ql(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 f_=function e(t){function n(i){return t?new Pf(i,t):new jl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Nf(e,t){this._context=e,this._alpha=t}Nf.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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,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:Ql(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 p_=function e(t){function n(i){return t?new Nf(i,t):new Kl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function $f(e){this._context=e}$f.prototype={areaStart:Bn,areaEnd:Bn,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 Ff(e){return new $f(e)}function Uf(e){return e<0?-1:1}function Bf(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),o=(s*r+a*i)/(i+r);return(Uf(s)+Uf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Gf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Jl(e,t,n){var i=e._x0,r=e._y0,s=e._x1,a=e._y1,o=(s-i)/3;e._context.bezierCurveTo(i+o,r+o*t,s-o,a-o*n,s,a)}function Na(e){this._context=e}Na.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:Jl(this,this._t0,Gf(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,Jl(this,Gf(this,n=Bf(this,e,t)),n);break;default:Jl(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 Vf(e)}(Hf.prototype=Object.create(Na.prototype)).point=function(e,t){Na.prototype.point.call(this,t,e)};function Vf(e){this._context=e}Vf.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,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function g_(e){return new Na(e)}function m_(e){return new Hf(e)}function zf(e){this._context=e}zf.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 i=Wf(e),r=Wf(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[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 Wf(e){var t,n=e.length-1,i,r=new Array(n),s=new Array(n),a=new Array(n);for(r[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(r[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)r[t]=(a[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function v_(e){return new zf(e)}function $a(e,t){this._context=e,this._t=t}$a.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 y_(e){return new $a(e,.5)}function E_(e){return new $a(e,0)}function x_(e){return new $a(e,1)}function Yf(e,t){if((a=e.length)>1)for(var n=1,i,r,s=e[t[0]],a,o=s.length;n<a;++n)for(r=s,s=e[t[n]],i=0;i<o;++i)s[i][1]+=s[i][0]=isNaN(r[i][1])?r[i][0]:r[i][1]}function qf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function b_(e,t){return e[t]}function S_(e){const t=[];return t.key=e,t}function tc(){var e=gt([]),t=qf,n=Yf,i=b_;function r(s){var a=Array.from(e.apply(this,arguments),S_),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+i(d,a[o].key,c,s)]).data=d;for(o=0,u=La(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return r.keys=function(s){return arguments.length?(e=typeof s=="function"?s:gt(Array.from(s)),r):e},r.value=function(s){return arguments.length?(i=typeof s=="function"?s:gt(+s),r):i},r.order=function(s){return arguments.length?(t=s==null?qf:typeof s=="function"?s:gt(Array.from(s)),r):t},r.offset=function(s){return arguments.length?(n=s??Yf,r):n},r}function T_(e,t){if((l=e.length)>0)for(var n,i=0,r,s,a,o,l,c=e[t[0]].length;i<c;++i)for(a=o=0,n=0;n<l;++n)(s=(r=e[t[n]][i])[1]-r[0])>0?(r[0]=a,r[1]=a+=s):s<0?(r[1]=o,r[0]=o+=s):(r[0]=0,r[1]=s)}function Kr(e,t,n){this.k=e,this.x=t,this.y=n}Kr.prototype={constructor:Kr,scale:function(e){return e===1?this:new Kr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Kr(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+")"}},Kr.prototype;var Xf=typeof global=="object"&&global&&global.Object===Object&&global,__=typeof self=="object"&&self&&self.Object===Object&&self,qe=Xf||__||Function("return this")(),Re=qe.Symbol,Zf=Object.prototype,O_=Zf.hasOwnProperty,w_=Zf.toString,Qr=Re?Re.toStringTag:void 0;function M_(e){var t=O_.call(e,Qr),n=e[Qr];try{e[Qr]=void 0;var i=!0}catch{}var r=w_.call(e);return i&&(t?e[Qr]=n:delete e[Qr]),r}var A_=Object.prototype,C_=A_.toString;function D_(e){return C_.call(e)}var L_="[object Null]",R_="[object Undefined]",jf=Re?Re.toStringTag:void 0;function ai(e){return e==null?e===void 0?R_:L_:jf&&jf in Object(e)?M_(e):D_(e)}function on(e){return e!=null&&typeof e=="object"}var I_="[object Symbol]";function Fa(e){return typeof e=="symbol"||on(e)&&ai(e)==I_}function ec(e,t){for(var n=-1,i=e==null?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}var Qt=Array.isArray,Kf=Re?Re.prototype:void 0,Qf=Kf?Kf.toString:void 0;function Jf(e){if(typeof e=="string")return e;if(Qt(e))return ec(e,Jf)+"";if(Fa(e))return Qf?Qf.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var k_=/\s/;function P_(e){for(var t=e.length;t--&&k_.test(e.charAt(t)););return t}var N_=/^\s+/;function $_(e){return e&&e.slice(0,P_(e)+1).replace(N_,"")}function Ie(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var tp=NaN,F_=/^[-+]0x[0-9a-f]+$/i,U_=/^0b[01]+$/i,B_=/^0o[0-7]+$/i,G_=parseInt;function Bi(e){if(typeof e=="number")return e;if(Fa(e))return tp;if(Ie(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ie(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$_(e);var n=U_.test(e);return n||B_.test(e)?G_(e.slice(2),n?2:8):F_.test(e)?tp:+e}function nc(e){return e}var H_="[object AsyncFunction]",V_="[object Function]",z_="[object GeneratorFunction]",W_="[object Proxy]";function ic(e){if(!Ie(e))return!1;var t=ai(e);return t==V_||t==z_||t==H_||t==W_}var rc=qe["__core-js_shared__"],ep=function(){var e=/[^.]+$/.exec(rc&&rc.keys&&rc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Y_(e){return!!ep&&ep in e}var q_=Function.prototype,X_=q_.toString;function oi(e){if(e!=null){try{return X_.call(e)}catch{}try{return e+""}catch{}}return""}var Z_=/[\\^$.*+?()[\]{}|]/g,j_=/^\[object .+?Constructor\]$/,K_=Function.prototype,Q_=Object.prototype,J_=K_.toString,tO=Q_.hasOwnProperty,eO=RegExp("^"+J_.call(tO).replace(Z_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nO(e){if(!Ie(e)||Y_(e))return!1;var t=ic(e)?eO:j_;return t.test(oi(e))}function iO(e,t){return e?.[t]}function li(e,t){var n=iO(e,t);return nO(n)?n:void 0}var sc=li(qe,"WeakMap"),np=Object.create,rO=function(){function e(){}return function(t){if(!Ie(t))return{};if(np)return np(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function sO(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 aO(){}function ip(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}var oO=800,lO=16,cO=Date.now;function uO(e){var t=0,n=0;return function(){var i=cO(),r=lO-(i-n);if(n=i,r>0){if(++t>=oO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function hO(e){return function(){return e}}var Ua=function(){try{var e=li(Object,"defineProperty");return e({},"",{}),e}catch{}}(),dO=Ua?function(e,t){return Ua(e,"toString",{configurable:!0,enumerable:!1,value:hO(t),writable:!0})}:nc,rp=uO(dO);function fO(e,t){for(var n=-1,i=e==null?0:e.length;++n<i&&t(e[n],n,e)!==!1;);return e}function pO(e,t,n,i){for(var r=e.length,s=n+-1;++s<r;)if(t(e[s],s,e))return s;return-1}function gO(e){return e!==e}function mO(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}function vO(e,t,n){return t===t?mO(e,t,n):pO(e,gO,n)}function yO(e,t){var n=e==null?0:e.length;return!!n&&vO(e,t,0)>-1}var EO=9007199254740991,xO=/^(?:0|[1-9]\d*)$/;function ac(e,t){var n=typeof e;return t=t??EO,!!t&&(n=="number"||n!="symbol"&&xO.test(e))&&e>-1&&e%1==0&&e<t}function Jr(e,t,n){t=="__proto__"&&Ua?Ua(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ts(e,t){return e===t||e!==e&&t!==t}var bO=Object.prototype,SO=bO.hasOwnProperty;function sp(e,t,n){var i=e[t];(!(SO.call(e,t)&&ts(i,n))||n===void 0&&!(t in e))&&Jr(e,t,n)}function Gi(e,t,n,i){var r=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),r?Jr(n,o,l):sp(n,o,l)}return n}var ap=Math.max;function op(e,t,n){return t=ap(t===void 0?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=ap(i.length-t,0),a=Array(s);++r<s;)a[r]=i[t+r];r=-1;for(var o=Array(t+1);++r<t;)o[r]=i[r];return o[t]=n(a),sO(e,this,o)}}function oc(e,t){return rp(op(e,t,nc),e+"")}var TO=9007199254740991;function lc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=TO}function ci(e){return e!=null&&lc(e.length)&&!ic(e)}function _O(e,t,n){if(!Ie(n))return!1;var i=typeof t;return(i=="number"?ci(n)&&ac(t,n.length):i=="string"&&t in n)?ts(n[t],e):!1}function OO(e){return oc(function(t,n){var i=-1,r=n.length,s=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(r--,s):void 0,a&&_O(n[0],n[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var o=n[i];o&&e(t,o,i,s)}return t})}var wO=Object.prototype;function Ba(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||wO;return e===n}function MO(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}var AO="[object Arguments]";function lp(e){return on(e)&&ai(e)==AO}var cp=Object.prototype,CO=cp.hasOwnProperty,DO=cp.propertyIsEnumerable,Hi=lp(function(){return arguments}())?lp:function(e){return on(e)&&CO.call(e,"callee")&&!DO.call(e,"callee")};function LO(){return!1}var up=typeof X=="object"&&X&&!X.nodeType&&X,hp=up&&typeof module=="object"&&module&&!module.nodeType&&module,RO=hp&&hp.exports===up,dp=RO?qe.Buffer:void 0,IO=dp?dp.isBuffer:void 0,Vi=IO||LO,kO="[object Arguments]",PO="[object Array]",NO="[object Boolean]",$O="[object Date]",FO="[object Error]",UO="[object Function]",BO="[object Map]",GO="[object Number]",HO="[object Object]",VO="[object RegExp]",zO="[object Set]",WO="[object String]",YO="[object WeakMap]",qO="[object ArrayBuffer]",XO="[object DataView]",ZO="[object Float32Array]",jO="[object Float64Array]",KO="[object Int8Array]",QO="[object Int16Array]",JO="[object Int32Array]",tw="[object Uint8Array]",ew="[object Uint8ClampedArray]",nw="[object Uint16Array]",iw="[object Uint32Array]",It={};It[ZO]=It[jO]=It[KO]=It[QO]=It[JO]=It[tw]=It[ew]=It[nw]=It[iw]=!0,It[kO]=It[PO]=It[qO]=It[NO]=It[XO]=It[$O]=It[FO]=It[UO]=It[BO]=It[GO]=It[HO]=It[VO]=It[zO]=It[WO]=It[YO]=!1;function rw(e){return on(e)&&lc(e.length)&&!!It[ai(e)]}function cc(e){return function(t){return e(t)}}var fp=typeof X=="object"&&X&&!X.nodeType&&X,es=fp&&typeof module=="object"&&module&&!module.nodeType&&module,sw=es&&es.exports===fp,uc=sw&&Xf.process,zi=function(){try{var e=es&&es.require&&es.require("util").types;return e||uc&&uc.binding&&uc.binding("util")}catch{}}(),pp=zi&&zi.isTypedArray,Ga=pp?cc(pp):rw,aw=Object.prototype,ow=aw.hasOwnProperty;function gp(e,t){var n=Qt(e),i=!n&&Hi(e),r=!n&&!i&&Vi(e),s=!n&&!i&&!r&&Ga(e),a=n||i||r||s,o=a?MO(e.length,String):[],l=o.length;for(var c in e)(t||ow.call(e,c))&&!(a&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ac(c,l)))&&o.push(c);return o}function mp(e,t){return function(n){return e(t(n))}}var lw=mp(Object.keys,Object),cw=Object.prototype,uw=cw.hasOwnProperty;function vp(e){if(!Ba(e))return lw(e);var t=[];for(var n in Object(e))uw.call(e,n)&&n!="constructor"&&t.push(n);return t}function ns(e){return ci(e)?gp(e):vp(e)}function hw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var dw=Object.prototype,fw=dw.hasOwnProperty;function pw(e){if(!Ie(e))return hw(e);var t=Ba(e),n=[];for(var i in e)i=="constructor"&&(t||!fw.call(e,i))||n.push(i);return n}function is(e){return ci(e)?gp(e,!0):pw(e)}var gw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mw=/^\w*$/;function hc(e,t){if(Qt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Fa(e)?!0:mw.test(e)||!gw.test(e)||t!=null&&e in Object(t)}var rs=li(Object,"create");function vw(){this.__data__=rs?rs(null):{},this.size=0}function yw(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ew="__lodash_hash_undefined__",xw=Object.prototype,bw=xw.hasOwnProperty;function Sw(e){var t=this.__data__;if(rs){var n=t[e];return n===Ew?void 0:n}return bw.call(t,e)?t[e]:void 0}var Tw=Object.prototype,_w=Tw.hasOwnProperty;function Ow(e){var t=this.__data__;return rs?t[e]!==void 0:_w.call(t,e)}var ww="__lodash_hash_undefined__";function Mw(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=rs&&t===void 0?ww:t,this}function ui(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}ui.prototype.clear=vw,ui.prototype.delete=yw,ui.prototype.get=Sw,ui.prototype.has=Ow,ui.prototype.set=Mw;function Aw(){this.__data__=[],this.size=0}function Ha(e,t){for(var n=e.length;n--;)if(ts(e[n][0],t))return n;return-1}var Cw=Array.prototype,Dw=Cw.splice;function Lw(e){var t=this.__data__,n=Ha(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():Dw.call(t,n,1),--this.size,!0}function Rw(e){var t=this.__data__,n=Ha(t,e);return n<0?void 0:t[n][1]}function Iw(e){return Ha(this.__data__,e)>-1}function kw(e,t){var n=this.__data__,i=Ha(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function wn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}wn.prototype.clear=Aw,wn.prototype.delete=Lw,wn.prototype.get=Rw,wn.prototype.has=Iw,wn.prototype.set=kw;var ss=li(qe,"Map");function Pw(){this.size=0,this.__data__={hash:new ui,map:new(ss||wn),string:new ui}}function Nw(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Va(e,t){var n=e.__data__;return Nw(t)?n[typeof t=="string"?"string":"hash"]:n.map}function $w(e){var t=Va(this,e).delete(e);return this.size-=t?1:0,t}function Fw(e){return Va(this,e).get(e)}function Uw(e){return Va(this,e).has(e)}function Bw(e,t){var n=Va(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function Mn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Mn.prototype.clear=Pw,Mn.prototype.delete=$w,Mn.prototype.get=Fw,Mn.prototype.has=Uw,Mn.prototype.set=Bw;var Gw="Expected a function";function dc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Gw);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var a=e.apply(this,i);return n.cache=s.set(r,a)||s,a};return n.cache=new(dc.Cache||Mn),n}dc.Cache=Mn;var Hw=500;function Vw(e){var t=dc(e,function(i){return n.size===Hw&&n.clear(),i}),n=t.cache;return t}var zw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ww=/\\(\\)?/g,Yw=Vw(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(zw,function(n,i,r,s){t.push(r?s.replace(Ww,"$1"):i||n)}),t});function as(e){return e==null?"":Jf(e)}function za(e,t){return Qt(e)?e:hc(e,t)?[e]:Yw(as(e))}function Wi(e){if(typeof e=="string"||Fa(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function fc(e,t){t=za(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[Wi(t[n++])];return n&&n==i?e:void 0}function Et(e,t,n){var i=e==null?void 0:fc(e,t);return i===void 0?n:i}function pc(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var yp=Re?Re.isConcatSpreadable:void 0;function qw(e){return Qt(e)||Hi(e)||!!(yp&&e&&e[yp])}function Wa(e,t,n,i,r){var s=-1,a=e.length;for(n||(n=qw),r||(r=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Wa(o,t-1,n,i,r):pc(r,o):i||(r[r.length]=o)}return r}function gc(e){var t=e==null?0:e.length;return t?Wa(e,1):[]}function Xw(e){return rp(op(e,void 0,gc),e+"")}var mc=mp(Object.getPrototypeOf,Object),Zw="[object Object]",jw=Function.prototype,Kw=Object.prototype,Ep=jw.toString,Qw=Kw.hasOwnProperty,Jw=Ep.call(Object);function xp(e){if(!on(e)||ai(e)!=Zw)return!1;var t=mc(e);if(t===null)return!0;var n=Qw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ep.call(n)==Jw}function bp(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),n=n>r?r:n,n<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(r);++i<r;)s[i]=e[i+t];return s}function tM(e,t,n){var i=e.length;return n=n===void 0?i:n,!t&&n>=i?e:bp(e,t,n)}var eM="\\ud800-\\udfff",nM="\\u0300-\\u036f",iM="\\ufe20-\\ufe2f",rM="\\u20d0-\\u20ff",sM=nM+iM+rM,aM="\\ufe0e\\ufe0f",oM="\\u200d",lM=RegExp("["+oM+eM+sM+aM+"]");function Sp(e){return lM.test(e)}function cM(e){return e.split("")}var Tp="\\ud800-\\udfff",uM="\\u0300-\\u036f",hM="\\ufe20-\\ufe2f",dM="\\u20d0-\\u20ff",fM=uM+hM+dM,pM="\\ufe0e\\ufe0f",gM="["+Tp+"]",vc="["+fM+"]",yc="\\ud83c[\\udffb-\\udfff]",mM="(?:"+vc+"|"+yc+")",_p="[^"+Tp+"]",Op="(?:\\ud83c[\\udde6-\\uddff]){2}",wp="[\\ud800-\\udbff][\\udc00-\\udfff]",vM="\\u200d",Mp=mM+"?",Ap="["+pM+"]?",yM="(?:"+vM+"(?:"+[_p,Op,wp].join("|")+")"+Ap+Mp+")*",EM=Ap+Mp+yM,xM="(?:"+[_p+vc+"?",vc,Op,wp,gM].join("|")+")",bM=RegExp(yc+"(?="+yc+")|"+xM+EM,"g");function SM(e){return e.match(bM)||[]}function TM(e){return Sp(e)?SM(e):cM(e)}function _M(e){return function(t){t=as(t);var n=Sp(t)?TM(t):void 0,i=n?n[0]:t.charAt(0),r=n?tM(n,1).join(""):t.slice(1);return i[e]()+r}}var OM=_M("toUpperCase");function wM(e){return OM(as(e).toLowerCase())}function MM(e,t,n,i){for(var r=-1,s=e==null?0:e.length;++r<s;)n=t(n,e[r],r,e);return n}function AM(e){return function(t){return e?.[t]}}var CM={À:"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"},DM=AM(CM),LM=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,RM="\\u0300-\\u036f",IM="\\ufe20-\\ufe2f",kM="\\u20d0-\\u20ff",PM=RM+IM+kM,NM="["+PM+"]",$M=RegExp(NM,"g");function FM(e){return e=as(e),e&&e.replace(LM,DM).replace($M,"")}var UM=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function BM(e){return e.match(UM)||[]}var GM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function HM(e){return GM.test(e)}var Cp="\\ud800-\\udfff",VM="\\u0300-\\u036f",zM="\\ufe20-\\ufe2f",WM="\\u20d0-\\u20ff",YM=VM+zM+WM,Dp="\\u2700-\\u27bf",Lp="a-z\\xdf-\\xf6\\xf8-\\xff",qM="\\xac\\xb1\\xd7\\xf7",XM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ZM="\\u2000-\\u206f",jM=" \\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",Rp="A-Z\\xc0-\\xd6\\xd8-\\xde",KM="\\ufe0e\\ufe0f",Ip=qM+XM+ZM+jM,kp="['’]",Pp="["+Ip+"]",QM="["+YM+"]",Np="\\d+",JM="["+Dp+"]",$p="["+Lp+"]",Fp="[^"+Cp+Ip+Np+Dp+Lp+Rp+"]",tA="\\ud83c[\\udffb-\\udfff]",eA="(?:"+QM+"|"+tA+")",nA="[^"+Cp+"]",Up="(?:\\ud83c[\\udde6-\\uddff]){2}",Bp="[\\ud800-\\udbff][\\udc00-\\udfff]",Yi="["+Rp+"]",iA="\\u200d",Gp="(?:"+$p+"|"+Fp+")",rA="(?:"+Yi+"|"+Fp+")",Hp="(?:"+kp+"(?:d|ll|m|re|s|t|ve))?",Vp="(?:"+kp+"(?:D|LL|M|RE|S|T|VE))?",zp=eA+"?",Wp="["+KM+"]?",sA="(?:"+iA+"(?:"+[nA,Up,Bp].join("|")+")"+Wp+zp+")*",aA="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oA="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lA=Wp+zp+sA,cA="(?:"+[JM,Up,Bp].join("|")+")"+lA,uA=RegExp([Yi+"?"+$p+"+"+Hp+"(?="+[Pp,Yi,"$"].join("|")+")",rA+"+"+Vp+"(?="+[Pp,Yi+Gp,"$"].join("|")+")",Yi+"?"+Gp+"+"+Hp,Yi+"+"+Vp,oA,aA,Np,cA].join("|"),"g");function hA(e){return e.match(uA)||[]}function dA(e,t,n){return e=as(e),t=t,t===void 0?HM(e)?hA(e):BM(e):e.match(t)||[]}var fA="['’]",pA=RegExp(fA,"g");function Yp(e){return function(t){return MM(dA(FM(t).replace(pA,"")),e,"")}}var gA=Yp(function(e,t,n){return t=t.toLowerCase(),e+(n?wM(t):t)});function mA(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function qp(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Bi(n),n=n===n?n:0),t!==void 0&&(t=Bi(t),t=t===t?t:0),mA(Bi(e),t,n)}function vA(){this.__data__=new wn,this.size=0}function yA(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function EA(e){return this.__data__.get(e)}function xA(e){return this.__data__.has(e)}var bA=200;function SA(e,t){var n=this.__data__;if(n instanceof wn){var i=n.__data__;if(!ss||i.length<bA-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mn(i)}return n.set(e,t),this.size=n.size,this}function Xe(e){var t=this.__data__=new wn(e);this.size=t.size}Xe.prototype.clear=vA,Xe.prototype.delete=yA,Xe.prototype.get=EA,Xe.prototype.has=xA,Xe.prototype.set=SA;function TA(e,t){return e&&Gi(t,ns(t),e)}function _A(e,t){return e&&Gi(t,is(t),e)}var Xp=typeof X=="object"&&X&&!X.nodeType&&X,Zp=Xp&&typeof module=="object"&&module&&!module.nodeType&&module,OA=Zp&&Zp.exports===Xp,jp=OA?qe.Buffer:void 0,Kp=jp?jp.allocUnsafe:void 0;function Qp(e,t){if(t)return e.slice();var n=e.length,i=Kp?Kp(n):new e.constructor(n);return e.copy(i),i}function wA(e,t){for(var n=-1,i=e==null?0:e.length,r=0,s=[];++n<i;){var a=e[n];t(a,n,e)&&(s[r++]=a)}return s}function Jp(){return[]}var MA=Object.prototype,AA=MA.propertyIsEnumerable,tg=Object.getOwnPropertySymbols,Ec=tg?function(e){return e==null?[]:(e=Object(e),wA(tg(e),function(t){return AA.call(e,t)}))}:Jp;function CA(e,t){return Gi(e,Ec(e),t)}var DA=Object.getOwnPropertySymbols,eg=DA?function(e){for(var t=[];e;)pc(t,Ec(e)),e=mc(e);return t}:Jp;function LA(e,t){return Gi(e,eg(e),t)}function ng(e,t,n){var i=t(e);return Qt(e)?i:pc(i,n(e))}function xc(e){return ng(e,ns,Ec)}function ig(e){return ng(e,is,eg)}var bc=li(qe,"DataView"),Sc=li(qe,"Promise"),qi=li(qe,"Set"),rg="[object Map]",RA="[object Object]",sg="[object Promise]",ag="[object Set]",og="[object WeakMap]",lg="[object DataView]",IA=oi(bc),kA=oi(ss),PA=oi(Sc),NA=oi(qi),$A=oi(sc),ke=ai;(bc&&ke(new bc(new ArrayBuffer(1)))!=lg||ss&&ke(new ss)!=rg||Sc&&ke(Sc.resolve())!=sg||qi&&ke(new qi)!=ag||sc&&ke(new sc)!=og)&&(ke=function(e){var t=ai(e),n=t==RA?e.constructor:void 0,i=n?oi(n):"";if(i)switch(i){case IA:return lg;case kA:return rg;case PA:return sg;case NA:return ag;case $A:return og}return t});var FA=Object.prototype,UA=FA.hasOwnProperty;function BA(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&UA.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Ya=qe.Uint8Array;function Tc(e){var t=new e.constructor(e.byteLength);return new Ya(t).set(new Ya(e)),t}function GA(e,t){var n=t?Tc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var HA=/\w*$/;function VA(e){var t=new e.constructor(e.source,HA.exec(e));return t.lastIndex=e.lastIndex,t}var cg=Re?Re.prototype:void 0,ug=cg?cg.valueOf:void 0;function zA(e){return ug?Object(ug.call(e)):{}}function hg(e,t){var n=t?Tc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var WA="[object Boolean]",YA="[object Date]",qA="[object Map]",XA="[object Number]",ZA="[object RegExp]",jA="[object Set]",KA="[object String]",QA="[object Symbol]",JA="[object ArrayBuffer]",tC="[object DataView]",eC="[object Float32Array]",nC="[object Float64Array]",iC="[object Int8Array]",rC="[object Int16Array]",sC="[object Int32Array]",aC="[object Uint8Array]",oC="[object Uint8ClampedArray]",lC="[object Uint16Array]",cC="[object Uint32Array]";function uC(e,t,n){var i=e.constructor;switch(t){case JA:return Tc(e);case WA:case YA:return new i(+e);case tC:return GA(e,n);case eC:case nC:case iC:case rC:case sC:case aC:case oC:case lC:case cC:return hg(e,n);case qA:return new i;case XA:case KA:return new i(e);case ZA:return VA(e);case jA:return new i;case QA:return zA(e)}}function dg(e){return typeof e.constructor=="function"&&!Ba(e)?rO(mc(e)):{}}var hC="[object Map]";function dC(e){return on(e)&&ke(e)==hC}var fg=zi&&zi.isMap,fC=fg?cc(fg):dC,pC="[object Set]";function gC(e){return on(e)&&ke(e)==pC}var pg=zi&&zi.isSet,mC=pg?cc(pg):gC,vC=1,yC=2,EC=4,gg="[object Arguments]",xC="[object Array]",bC="[object Boolean]",SC="[object Date]",TC="[object Error]",mg="[object Function]",_C="[object GeneratorFunction]",OC="[object Map]",wC="[object Number]",vg="[object Object]",MC="[object RegExp]",AC="[object Set]",CC="[object String]",DC="[object Symbol]",LC="[object WeakMap]",RC="[object ArrayBuffer]",IC="[object DataView]",kC="[object Float32Array]",PC="[object Float64Array]",NC="[object Int8Array]",$C="[object Int16Array]",FC="[object Int32Array]",UC="[object Uint8Array]",BC="[object Uint8ClampedArray]",GC="[object Uint16Array]",HC="[object Uint32Array]",Dt={};Dt[gg]=Dt[xC]=Dt[RC]=Dt[IC]=Dt[bC]=Dt[SC]=Dt[kC]=Dt[PC]=Dt[NC]=Dt[$C]=Dt[FC]=Dt[OC]=Dt[wC]=Dt[vg]=Dt[MC]=Dt[AC]=Dt[CC]=Dt[DC]=Dt[UC]=Dt[BC]=Dt[GC]=Dt[HC]=!0,Dt[TC]=Dt[mg]=Dt[LC]=!1;function os(e,t,n,i,r,s){var a,o=t&vC,l=t&yC,c=t&EC;if(n&&(a=r?n(e,i,r,s):n(e)),a!==void 0)return a;if(!Ie(e))return e;var u=Qt(e);if(u){if(a=BA(e),!o)return ip(e,a)}else{var d=ke(e),h=d==mg||d==_C;if(Vi(e))return Qp(e,o);if(d==vg||d==gg||h&&!r){if(a=l||h?{}:dg(e),!o)return l?LA(e,_A(a,e)):CA(e,TA(a,e))}else{if(!Dt[d])return r?e:{};a=uC(e,d,o)}}s||(s=new Xe);var f=s.get(e);if(f)return f;s.set(e,a),mC(e)?e.forEach(function(m){a.add(os(m,t,n,m,e,s))}):fC(e)&&e.forEach(function(m,v){a.set(v,os(m,t,n,v,e,s))});var p=c?l?ig:xc:l?is:ns,g=u?void 0:p(e);return fO(g||e,function(m,v){g&&(v=m,m=e[v]),sp(a,v,os(m,t,n,v,e,s))}),a}var VC=1,zC=4;function An(e){return os(e,VC|zC)}var WC="__lodash_hash_undefined__";function YC(e){return this.__data__.set(e,WC),this}function qC(e){return this.__data__.has(e)}function ls(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}ls.prototype.add=ls.prototype.push=YC,ls.prototype.has=qC;function yg(e,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function Eg(e,t){return e.has(t)}var XC=1,ZC=2;function xg(e,t,n,i,r,s){var a=n&XC,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,f=n&ZC?new ls:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var p=e[d],g=t[d];if(i)var m=a?i(g,p,d,t,e,s):i(p,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(f){if(!yg(t,function(v,S){if(!Eg(f,S)&&(p===v||r(p,v,n,i,s)))return f.push(S)})){h=!1;break}}else if(!(p===g||r(p,g,n,i,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function jC(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function _c(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var KC=1,QC=2,JC="[object Boolean]",tD="[object Date]",eD="[object Error]",nD="[object Map]",iD="[object Number]",rD="[object RegExp]",sD="[object Set]",aD="[object String]",oD="[object Symbol]",lD="[object ArrayBuffer]",cD="[object DataView]",bg=Re?Re.prototype:void 0,Oc=bg?bg.valueOf:void 0;function uD(e,t,n,i,r,s,a){switch(n){case cD:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case lD:return!(e.byteLength!=t.byteLength||!s(new Ya(e),new Ya(t)));case JC:case tD:case iD:return ts(+e,+t);case eD:return e.name==t.name&&e.message==t.message;case rD:case aD:return e==t+"";case nD:var o=jC;case sD:var l=i&KC;if(o||(o=_c),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;i|=QC,a.set(e,t);var u=xg(o(e),o(t),i,r,s,a);return a.delete(e),u;case oD:if(Oc)return Oc.call(e)==Oc.call(t)}return!1}var hD=1,dD=Object.prototype,fD=dD.hasOwnProperty;function pD(e,t,n,i,r,s){var a=n&hD,o=xc(e),l=o.length,c=xc(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:fD.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=a;++d<l;){h=o[d];var v=e[h],S=t[h];if(i)var E=a?i(S,v,h,t,e,s):i(v,S,h,e,t,s);if(!(E===void 0?v===S||r(v,S,n,i,s):E)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var b=e.constructor,x=t.constructor;b!=x&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof x=="function"&&x instanceof x)&&(g=!1)}return s.delete(e),s.delete(t),g}var gD=1,Sg="[object Arguments]",Tg="[object Array]",qa="[object Object]",mD=Object.prototype,_g=mD.hasOwnProperty;function vD(e,t,n,i,r,s){var a=Qt(e),o=Qt(t),l=a?Tg:ke(e),c=o?Tg:ke(t);l=l==Sg?qa:l,c=c==Sg?qa:c;var u=l==qa,d=c==qa,h=l==c;if(h&&Vi(e)){if(!Vi(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Xe),a||Ga(e)?xg(e,t,n,i,r,s):uD(e,t,l,n,i,r,s);if(!(n&gD)){var f=u&&_g.call(e,"__wrapped__"),p=d&&_g.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return s||(s=new Xe),r(g,m,n,i,s)}}return h?(s||(s=new Xe),pD(e,t,n,i,r,s)):!1}function Xa(e,t,n,i,r){return e===t?!0:e==null||t==null||!on(e)&&!on(t)?e!==e&&t!==t:vD(e,t,n,i,Xa,r)}var yD=1,ED=2;function xD(e,t,n,i){var r=n.length,s=r;if(e==null)return!s;for(e=Object(e);r--;){var a=n[r];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<s;){a=n[r];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new Xe,d;if(!(d===void 0?Xa(c,l,yD|ED,i,u):d))return!1}}return!0}function Og(e){return e===e&&!Ie(e)}function bD(e){for(var t=ns(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,Og(r)]}return t}function wg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function SD(e){var t=bD(e);return t.length==1&&t[0][2]?wg(t[0][0],t[0][1]):function(n){return n===e||xD(n,e,t)}}function TD(e,t){return e!=null&&t in Object(e)}function _D(e,t,n){t=za(t,e);for(var i=-1,r=t.length,s=!1;++i<r;){var a=Wi(t[i]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++i!=r?s:(r=e==null?0:e.length,!!r&&lc(r)&&ac(a,r)&&(Qt(e)||Hi(e)))}function OD(e,t){return e!=null&&_D(e,t,TD)}var wD=1,MD=2;function AD(e,t){return hc(e)&&Og(t)?wg(Wi(e),t):function(n){var i=Et(n,e);return i===void 0&&i===t?OD(n,e):Xa(t,i,wD|MD)}}function CD(e){return function(t){return t?.[e]}}function DD(e){return function(t){return fc(t,e)}}function LD(e){return hc(e)?CD(Wi(e)):DD(e)}function Za(e){return typeof e=="function"?e:e==null?nc:typeof e=="object"?Qt(e)?AD(e[0],e[1]):SD(e):LD(e)}function RD(e,t,n,i){for(var r=-1,s=e==null?0:e.length;++r<s;){var a=e[r];t(i,a,n(a),e)}return i}function ID(e){return function(t,n,i){for(var r=-1,s=Object(t),a=i(t),o=a.length;o--;){var l=a[++r];if(n(s[l],l,s)===!1)break}return t}}var Mg=ID();function kD(e,t){return e&&Mg(e,t,ns)}function PD(e,t){return function(n,i){if(n==null)return n;if(!ci(n))return e(n,i);for(var r=n.length,s=-1,a=Object(n);++s<r&&i(a[s],s,a)!==!1;);return n}}var wc=PD(kD);function ND(e,t,n,i){return wc(e,function(r,s,a){t(i,r,n(r),a)}),i}function $D(e,t){return function(n,i){var r=Qt(n)?RD:ND,s={};return r(n,e,Za(i),s)}}var Mc=function(){return qe.Date.now()},FD="Expected a function",UD=Math.max,BD=Math.min;function ja(e,t,n){var i,r,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(FD);t=Bi(t)||0,Ie(n)&&(u=!!n.leading,d="maxWait"in n,s=d?UD(Bi(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(T){var C=i,D=r;return i=r=void 0,c=T,a=e.apply(D,C),a}function p(T){return c=T,o=setTimeout(v,t),u?f(T):a}function g(T){var C=T-l,D=T-c,$=t-C;return d?BD($,s-D):$}function m(T){var C=T-l,D=T-c;return l===void 0||C>=t||C<0||d&&D>=s}function v(){var T=Mc();if(m(T))return S(T);o=setTimeout(v,g(T))}function S(T){return o=void 0,h&&i?f(T):(i=r=void 0,a)}function E(){o!==void 0&&clearTimeout(o),c=0,i=l=r=o=void 0}function b(){return o===void 0?a:S(Mc())}function x(){var T=Mc(),C=m(T);if(i=arguments,r=this,l=T,C){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(v,t),f(l)}return o===void 0&&(o=setTimeout(v,t)),a}return x.cancel=E,x.flush=b,x}function Ac(e,t,n){(n!==void 0&&!ts(e[t],n)||n===void 0&&!(t in e))&&Jr(e,t,n)}function Cc(e){return on(e)&&ci(e)}function Dc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function GD(e){return Gi(e,is(e))}function HD(e,t,n,i,r,s,a){var o=Dc(e,n),l=Dc(t,n),c=a.get(l);if(c){Ac(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Qt(l),f=!h&&Vi(l),p=!h&&!f&&Ga(l);u=l,h||f||p?Qt(o)?u=o:Cc(o)?u=ip(o):f?(d=!1,u=Qp(l,!0)):p?(d=!1,u=hg(l,!0)):u=[]:xp(l)||Hi(l)?(u=o,Hi(o)?u=GD(o):(!Ie(o)||ic(o))&&(u=dg(l))):d=!1}d&&(a.set(l,u),r(u,l,i,s,a),a.delete(l)),Ac(e,n,u)}function Ag(e,t,n,i,r){e!==t&&Mg(t,function(s,a){if(r||(r=new Xe),Ie(s))HD(e,t,a,n,Ag,i,r);else{var o=i?i(Dc(e,a),s,a+"",e,t,r):void 0;o===void 0&&(o=s),Ac(e,a,o)}},is)}var VD="Expected a function";function zD(e,t,n){if(typeof e!="function")throw new TypeError(VD);return setTimeout(function(){e.apply(void 0,n)},t)}var WD=oc(function(e,t,n){return zD(e,Bi(t)||0,n)});function Cg(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function YD(e,t){var n=-1,i=ci(e)?Array(e.length):[];return wc(e,function(r,s,a){i[++n]=t(r,s,a)}),i}function qD(e,t){var n=Qt(e)?ec:YD;return n(e,Za(t))}var XD=1/0;function ZD(e,t){return Wa(qD(e,t),XD)}function jD(e){for(var t=-1,n=e==null?0:e.length,i={};++t<n;){var r=e[t];Jr(i,r[0],r[1])}return i}var KD=Object.prototype,QD=KD.hasOwnProperty,JD=$D(function(e,t,n){QD.call(e,n)?e[n].push(t):Jr(e,n,[t])});function tL(e,t){return t.length<2?e:fc(e,bp(t,0,-1))}var eL="[object Map]",nL="[object Set]",iL=Object.prototype,rL=iL.hasOwnProperty;function Ze(e){if(e==null)return!0;if(ci(e)&&(Qt(e)||typeof e=="string"||typeof e.splice=="function"||Vi(e)||Ga(e)||Hi(e)))return!e.length;var t=ke(e);if(t==eL||t==nL)return!e.size;if(Ba(e))return!vp(e).length;for(var n in e)if(rL.call(e,n))return!1;return!0}function Dg(e,t){return Xa(e,t)}var Xi=Yp(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ut=OO(function(e,t,n){Ag(e,t,n)}),sL=Object.prototype,aL=sL.hasOwnProperty;function oL(e,t){t=za(t,e);var n=-1,i=t.length;if(!i)return!0;for(;++n<i;){var r=Wi(t[n]);if(r==="__proto__"&&!aL.call(e,"__proto__")||(r==="constructor"||r==="prototype")&&n<i-1)return!1}var s=tL(e,t);return s==null||delete s[Wi(Cg(t))]}function lL(e){return xp(e)?void 0:e}var cL=1,uL=2,hL=4,dL=Xw(function(e,t){var n={};if(e==null)return n;var i=!1;t=ec(t,function(s){return s=za(s,e),i||(i=s.length>1),s}),Gi(e,ig(e),n),i&&(n=os(n,cL|uL|hL,lL));for(var r=t.length;r--;)oL(n,t[r]);return n});function fL(e,t){var n;return wc(e,function(i,r,s){return n=t(i,r,s),!n}),!!n}function pL(e,t,n){var i=Qt(e)?yg:fL;return i(e,Za(t))}var gL=1/0,mL=qi&&1/_c(new qi([,-0]))[1]==gL?function(e){return new qi(e)}:aO,vL=200;function Lg(e,t,n){var i=-1,r=yO,s=e.length,a=!0,o=[],l=o;if(s>=vL){var c=t?null:mL(e);if(c)return _c(c);a=!1,r=Eg,l=new ls}else l=t?[]:o;t:for(;++i<s;){var u=e[i],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else r(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var yL=oc(function(e){var t=Cg(e);return Cc(t)&&(t=void 0),Lg(Wa(e,1,Cc,!0),Za(t))});function cs(e){return e&&e.length?Lg(e):[]}var Lc=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Lc||{}),Rc=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Rc||{}),Ic=(e=>(e.UPDATE="model-update",e))(Ic||{}),Rg=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Rg||{}),kc=(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))(kc||{}),Pc=(e=>(e.CHANGE="zoom-domain-change",e))(Pc||{}),Nc=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Nc||{}),$c=(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))($c||{}),Fc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Fc||{}),Uc=(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))(Uc||{}),Bc=(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))(Bc||{}),Gc=(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))(Gc||{}),Hc=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Hc||{}),Vc=(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))(Vc||{}),zc=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(zc||{}),Wc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Wc||{}),Yc=(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))(Yc||{}),qc=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(qc||{}),Xc=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Xc||{}),Zi=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Zi||{}),Zc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Zc||{}),Ig=(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))(Ig||{}),kg=(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))(kg||{}),Pg=(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))(Pg||{}),Ng=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Ng||{}),$g=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))($g||{}),ji=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(ji||{});const _=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Pg,Area:Fc,Axis:$c,Bar:Hc,Boxplot:Vc,CanvasZoom:Nc,Chart:Lc,Choropleth:ji,CirclePack:kg,Gauge:Gc,Heatmap:$g,Legend:Ig,Line:Wc,Meter:Ng,Modal:Rc,Model:Ic,Pie:Bc,Radar:Yc,Scatter:zc,Threshold:Zc,Toolbar:Rg,Tooltip:Zi,Tree:qc,Treemap:Xc,WordCloud:Uc,ZoomBar:kc,ZoomDomain:Pc},Symbol.toStringTag,{value:"Module"}));var st=(e=>(e.HTML="html",e.SVG="svg",e))(st||{}),jc=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(jc||{}),ot=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(ot||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),je=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(je||{}),Pe=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Pe||{}),Ht=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Ht||{}),rt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(rt||{}),Ki=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Ki||{}),Vt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Vt||{}),Qi=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Qi||{}),Ka=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Ka||{}),At=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(At||{}),dt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(dt||{}),hi=(e=>(e.CENTER="center",e))(hi||{}),us=(e=>(e.LEFT="left",e.RIGHT="right",e))(us||{}),zt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(zt||{}),ln=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(ln||{}),cn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(cn||{}),di=(e=>(e.SEMI="semi",e.FULL="full",e))(di||{}),Qa=(e=>(e.UP="up",e.DOWN="down",e))(Qa||{}),hs=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(hs||{}),ds=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(ds||{}),Oe=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(Oe||{}),Tt=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(Tt||{}),Ja=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ja||{}),Wt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Wt||{}),fs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(fs||{}),Ji=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Ji||{}),ps=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(ps||{}),un=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(un||{});const me="cds",Cn={opacity:{unselected:.05,selected:.4}},Gn={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},tr={duration:1e3,ease:$h,zoomLevel:3},er={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},Fg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ne={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},EL={defaultBins:10},Pt={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}},Dn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Jt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Lt={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}},fi={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Ke={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Ug={minCellDividerDimension:16},Bg={default:{size:24}},Gg={defaultOffset:4,horizontalOffset:10},Hg={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},we={height:{[je.GRAPH_VIEW]:32,[je.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},xL=[{type:Wt.RADIUS,name:"Radius"},{type:Wt.AREA,name:"Poor area"},{type:Wt.AREA,name:"Satisfactory area"},{type:Wt.AREA,name:"Great area"},{type:Wt.QUARTILE,name:"Quartiles"}];function bL(e,t,n){let i=null;return function(...r){const s=this;s.mousePosition=Xn(r[0],n),clearTimeout(i),i=setTimeout(function(){e.apply(s,r)},t)}}function kt(e,t){const n=An(e),i=Object.keys(t.axes||{});t?.toolbar?.controls&&delete n.toolbar.controls,i.length===0&&delete n.axes;for(const r in n.axes)if(i.includes(r)){const s=t.axes[r];(s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/");const a=s.mapsTo;if(a==null){const o=s.scaleType;o==null?s.mapsTo="value":o===rt.TIME?s.mapsTo="date":o===rt.LABELS&&(s.mapsTo="key")}}else delete n.axes[r];return Qc(n,t),ut(n,t)}function Ln(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const i=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:i[0],ty:i[1]}}return null}function gs(e){const n=/\(([^)]+)\)/.exec(e);if(n&&n.length>1){const i=n[1].split(",");if(i.length>1)return{x:parseFloat(i[0]),y:parseFloat(i[1])}}return{x:0,y:0}}function Kc(e,t,n="value",i=!1){const r=e/t.reduce((s,a)=>s+a[n],0)*100;return i?r:r%1!==0?parseFloat(r.toFixed(1)):r}function ms(e,t,n){if(n>e.length)return e;if(t===Pe.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Pe.FRONT_LINE)return"..."+e.substr(-n);if(t===Pe.END_LINE)return e.substr(0,n)+"..."}function Qc(e,t){const n=y(e,"legend","additionalItems"),i=y(t,"legend","additionalItems");if(n&&i){const r=i.map(o=>o.type),s=n.map(o=>o.type),a=xL.filter(o=>s.includes(o.type)&&!r.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=yL(a,i,"name")}}const y=(e,...t)=>{let n=e;if(n){for(const i of t)if(n[i]!==null&&n[i]!==void 0)n=n[i];else return null;return n}return null},Vg=(e,t)=>t===Ht.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,le=(e,t)=>{const{x0:n,x1:i,y0:r,y1:s}=Vg(e,t);return`M${n},${r}L${n},${s}L${i},${s}L${i},${r}L${n},${r}`};function Rn(e,t,n){return n===Ht.VERTICAL?[e,t]:[t,e]}function Jc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function vs(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):a;r=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}function ys(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?TL(o,d=>d.test(a)):SL(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function SL(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function TL(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _L(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(r.length);return{value:a,rest:o}}}const zg=6048e5,OL=864e5,Wg=6e4,Yg=36e5,qg=Symbol.for("constructDateFrom");function $e(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&qg in e?e[qg](t):e instanceof Date?new e.constructor(t):new Date(t)}function pi(e,...t){const n=$e.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}let wL={};function to(){return wL}function $t(e,t){return $e(t||e,e)}function Es(e,t){const n=to(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=$t(e,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}const ML={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"}},AL=(e,t,n)=>{let i;const r=ML[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},CL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},DL=(e,t,n,i)=>CL[e],LL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},RL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},IL={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"]},kL={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"]},PL={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"}},NL={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"}},$L={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:vs({values:LL,defaultWidth:"wide"}),quarter:vs({values:RL,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vs({values:IL,defaultWidth:"wide"}),day:vs({values:kL,defaultWidth:"wide"}),dayPeriod:vs({values:PL,defaultWidth:"wide",formattingValues:NL,defaultFormattingWidth:"wide"})},FL=/^(\d+)(th|st|nd|rd)?/i,UL=/\d+/i,BL={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},GL={any:[/^b/i,/^(a|c)/i]},HL={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},VL={any:[/1/i,/2/i,/3/i,/4/i]},zL={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},WL={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]},YL={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},qL={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]},XL={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},ZL={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}},jL={ordinalNumber:_L({matchPattern:FL,parsePattern:UL,valueCallback:e=>parseInt(e,10)}),era:ys({matchPatterns:BL,defaultMatchWidth:"wide",parsePatterns:GL,defaultParseWidth:"any"}),quarter:ys({matchPatterns:HL,defaultMatchWidth:"wide",parsePatterns:VL,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ys({matchPatterns:zL,defaultMatchWidth:"wide",parsePatterns:WL,defaultParseWidth:"any"}),day:ys({matchPatterns:YL,defaultMatchWidth:"wide",parsePatterns:qL,defaultParseWidth:"any"}),dayPeriod:ys({matchPatterns:XL,defaultMatchWidth:"any",parsePatterns:ZL,defaultParseWidth:"any"})},KL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},QL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},JL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tR={date:Jc({formats:KL,defaultWidth:"full"}),time:Jc({formats:QL,defaultWidth:"full"}),dateTime:Jc({formats:JL,defaultWidth:"full"})},Xg={code:"en-US",formatDistance:AL,formatLong:tR,formatRelative:DL,localize:$L,match:jL,options:{weekStartsOn:0,firstWeekContainsDate:1}},nr={type:Pe.END_LINE,threshold:16,numCharacter:14},Zg=4,eR={code:typeof navigator<"u"&&navigator?.language||"en-US",number:(e,t=navigator?.language||"en-US")=>e?.toLocaleString?.(t),date:(e,t=navigator?.language||"en-US",n={},i=null)=>i||e.toLocaleDateString(t,n),time:(e,t=navigator?.language||"en-US",n={},i=null)=>i||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},nR={enabled:!0,position:Ki.BOTTOM,clickable:!0,truncation:nr,alignment:Vt.LEFT,order:null,additionalItems:[]},iR={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},rR={enabled:!0},jg={enabled:!0,showTotal:!0,truncation:nr,groupLabel:"Group"},Kg={top:{visible:!0,includeZero:!0,truncation:nr},bottom:{visible:!0,includeZero:!0,truncation:nr},left:{visible:!0,includeZero:!0,truncation:nr},right:{visible:!0,includeZero:!0,truncation:nr}},eo={addSpaceOnEdges:1,showDayName:!1,localeObject:Xg,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}};let Qg=!1;try{Qg=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const se={width:null,height:null,resizable:!0,theme:jc.WHITE,tooltip:jg,legend:nR,locale:eR,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:Tt.SHOW_AS_DATATABLE},...Qg?[{type:Tt.MAKE_FULLSCREEN}]:[],{type:Tt.EXPORT_CSV},{type:Tt.EXPORT_PNG},{type:Tt.EXPORT_JPG}]}},Jg=ut({},se,{thematic:{projection:un.geoNaturalEarth1}}),xs=ut({},se,{axes:Kg,timeScale:eo,grid:iR,ruler:rR,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:je.GRAPH_VIEW}}}),gi=ut({},xs,{bars:{maxWidth:16,spacingFactor:.25,preserveSpaceForMissingBars:!0},timeScale:ut(eo,{addSpaceOnEdges:1})}),sR=ut({},gi,{}),aR=ut({},gi,{}),oR=ut({},gi,{bars:ut({},gi.bars,{dividerSize:1.5})}),lR=ut({},gi,{}),tu=ut({},xs,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),cR=tu,tm=ut({},tu,{points:{radius:3,filled:!1,enabled:!0}}),em=ut({},tm,{timeScale:ut(eo,{addSpaceOnEdges:0})}),uR=em,hR=ut({},xs,{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:Wt.RADIUS,name:"Radius"}]}}),dR=ut({},xs,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Wt.AREA,name:"Poor area"},{type:Wt.AREA,name:"Satisfactory area"},{type:Wt.AREA,name:"Great area"},{type:Wt.QUARTILE,name:"Quartiles"}]}}),fR=ut({},gi,{bars:{dividerSize:1.5},timeScale:ut(eo,{addSpaceOnEdges:0})}),pR=ut({},se,{tooltip:ut({},jg,{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"}}),nm=ut({},se,{pie:{labels:{formatter:null,enabled:!0},alignment:Vt.LEFT,sortFunction:null,valueMapsTo:"value"}}),gR=ut({},se,{legend:{enabled:!1},gauge:{type:di.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:Vt.LEFT}}),mR=ut({},nm,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20)},alignment:Vt.LEFT}}),im=ut({},se,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),vR=ut({},im,{legend:{enabled:!0}}),yR=ut({},se,{radar:{axes:{angle:"key",value:"value"},alignment:Vt.LEFT},tooltip:{gridline:{enabled:!0}}}),ER=ut({},gi,{comboChartTypes:[]}),xR=ut({tree:{type:Ka.TREE}},se,{}),bR=ut({},se,{data:ut(se.data,{groupMapsTo:"name"})}),SR=ut({},se,er,{data:ut(se.data,{groupMapsTo:"name"})}),TR=ut({},se,{alluvial:{data:ut(se.data,{groupMapsTo:"source"}),nodeAlignment:Vt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),_R=ut({},se,{axes:Kg,heatmap:{divider:{state:Ji.AUTO},colorLegend:{type:"linear"}}}),OR=ut({},Jg,{choropleth:{colorLegend:{type:"linear"}}}),Ct={alluvialChart:TR,areaChart:em,axisChart:xs,boxplotChart:lR,bubbleChart:hR,bulletChart:dR,chart:se,circlePackChart:SR,choroplethChart:OR,comboChart:ER,donutChart:mR,gaugeChart:gR,groupedBarChart:aR,heatmapChart:_R,histogramChart:fR,lineChart:tm,lollipopChart:cR,meterChart:im,pieChart:nm,proportionalMeterChart:vR,radarChart:yR,scatterChart:tu,simpleBarChart:sR,stackedAreaChart:uR,stackedBarChart:oR,thematicChart:Jg,treeChart:xR,treemapChart:bR,wordCloudChart:pR};function rm(e){const t=$t(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function sm(e,t){const n=$t(e,t?.in);return n.setHours(0,0,0,0),n}function am(e,t,n){const[i,r]=pi(n?.in,e,t),s=sm(i),a=sm(r),o=+s-rm(s),l=+a-rm(a);return Math.round((o-l)/OL)}function wR(e,t){const n=$t(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function MR(e,t){const n=$t(e,t?.in);return am(n,wR(n))+1}function no(e,t){return Es(e,{...t,weekStartsOn:1})}function om(e,t){const n=$t(e,t?.in),i=n.getFullYear(),r=$e(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=no(r),a=$e(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=no(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=o.getTime()?i:i-1}function AR(e,t){const n=om(e,t),i=$e(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),no(i)}function CR(e,t){const n=$t(e,t?.in),i=+no(n)-+AR(n);return Math.round(i/zg)+1}function lm(e,t){const n=$t(e,t?.in),i=n.getFullYear(),r=to(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=$e(t?.in||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const o=Es(a,t),l=$e(t?.in||e,0);l.setFullYear(i,0,s),l.setHours(0,0,0,0);const c=Es(l,t);return+n>=+o?i+1:+n>=+c?i:i-1}function DR(e,t){const n=to(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=lm(e,t),s=$e(t?.in||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Es(s,t)}function LR(e,t){const n=$t(e,t?.in),i=+Es(n,t)-+DR(n,t);return Math.round(i/zg)+1}function wt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Hn={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return wt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):wt(n+1,2)},d(e,t){return wt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return wt(e.getHours()%12||12,t.length)},H(e,t){return wt(e.getHours(),t.length)},m(e,t){return wt(e.getMinutes(),t.length)},s(e,t){return wt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return wt(r,t.length)}},ir={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cm={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Hn.y(e,t)},Y:function(e,t,n,i){const r=lm(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return wt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):wt(s,t.length)},R:function(e,t){const n=om(e);return wt(n,t.length)},u:function(e,t){const n=e.getFullYear();return wt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return wt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return wt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Hn.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return wt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=LR(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):wt(r,t.length)},I:function(e,t,n){const i=CR(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):wt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Hn.d(e,t)},D:function(e,t,n){const i=MR(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):wt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":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"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return wt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});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"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return wt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return wt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=ir.noon:i===0?r=ir.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=ir.evening:i>=12?r=ir.afternoon:i>=4?r=ir.morning:r=ir.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Hn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Hn.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):wt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):wt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Hn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Hn.s(e,t)},S:function(e,t){return Hn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return hm(i);case"XXXX":case"XX":return mi(i);case"XXXXX":case"XXX":default:return mi(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return hm(i);case"xxxx":case"xx":return mi(i);case"xxxxx":case"xxx":default:return mi(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+um(i,":");case"OOOO":default:return"GMT"+mi(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+um(i,":");case"zzzz":default:return"GMT"+mi(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return wt(i,t.length)},T:function(e,t,n){return wt(+e,t.length)}};function um(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+wt(s,2)}function hm(e,t){return e%60===0?(e>0?"-":"+")+wt(Math.abs(e)/60,2):mi(e,t)}function mi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=wt(Math.trunc(i/60),2),s=wt(i%60,2);return n+r+t+s}const dm=(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"})}},fm=(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"})}},RR={p:fm,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return dm(e,t);let s;switch(i){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}}",dm(i,t)).replace("{{time}}",fm(r,t))}},IR=/^D+$/,kR=/^Y+$/,PR=["D","DD","YY","YYYY"];function NR(e){return IR.test(e)}function $R(e){return kR.test(e)}function FR(e,t,n){const i=UR(e,t,n);if(console.warn(i),PR.includes(e))throw new RangeError(i)}function UR(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function BR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function GR(e){return!(!BR(e)&&typeof e!="number"||isNaN(+$t(e)))}const HR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,VR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,zR=/^'([^]*?)'?$/,WR=/''/g,YR=/[a-zA-Z]/;function eu(e,t,n){const i=to(),r=n?.locale??i.locale??Xg,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=$t(e,n?.in);if(!GR(o))throw new RangeError("Invalid time value");let l=t.match(VR).map(u=>{const d=u[0];if(d==="p"||d==="P"){const h=RR[d];return h(u,r.formatLong)}return u}).join("").match(HR).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const d=u[0];if(d==="'")return{isToken:!1,value:qR(u)};if(cm[d])return{isToken:!0,value:u};if(d.match(YR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(l=r.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return l.map(u=>{if(!u.isToken)return u.value;const d=u.value;(!n?.useAdditionalWeekYearTokens&&$R(d)||!n?.useAdditionalDayOfYearTokens&&NR(d))&&FR(d,t,String(e));const h=cm[d[0]];return h(o,d,r.localize,c)}).join("")}function qR(e){const t=e.match(zR);return t?t[1].replace(WR,"'"):e}var pm=(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))(pm||{});const nu=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",1800*1e3],["hourly",3600*1e3],["daily",1440*60*1e3],["monthly",720*60*60*1e3],["quarterly",2160*60*60*1e3],["yearly",360*24*60*60*1e3]];function gm(e,t,n,i,r){const s=t===0,a=Number(eu(new Date(e),"c"))===2,o=Number(eu(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(i){case"15seconds":return s||ro(e)||bs(e,l)||Vn(e);case"minute":return s||ro(e)||bs(e,l)||Vn(e);case"30minutes":return s||ro(e)||bs(e,l)||Vn(e);case"hourly":return s||ro(e)||bs(e,l)||Vn(e);case"daily":return r?s||a||Vn(e):s||bs(e,l)||Vn(e);case"weekly":return s||a||Vn(e);case"monthly":return s||Vn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function iu(e,t,n,i,r,s){const a=r.showDayName,o=i==="daily"&&a?"weekly":i,l=new Date(e),c=y(r,"timeIntervalFormats")[o],u=y(c,"primary"),d=y(c,"secondary"),h=gm(e,t,n,i,a);let f=h?u:d;i==="15seconds"&&l.getMilliseconds()!==0&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=r.localeObject,{code:g,optionsObject:m}=s,v=m[i].type,S=m[i][h?"primary":"secondary"][f];if(i==="quarterly"||!S){const b=eu(l,f,{locale:p}).split("").map(x=>{const T=Number(x);return x!==" "&&!Number.isNaN(T)?T?.toLocaleString?.(g):x});return s[v](l,g,{},b.join(""))}else return s[v](l,g,S)}function io(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function XR(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function ZR(e){const t=nu.reduce((n,[,i],r)=>{const s=nu[n][1],a=Math.abs(s-e),o=Math.abs(i-e);return a<o?n:r},0);return nu[t][0]}function ru(e,t){if(pm[t])return t;if(e.length===1)return"15seconds";const n=XR(e),i=Fn(n);return ZR(i)}function ro(e){const{s:t,m:n,H:i}=io(e);return i===0&&n===0&&t===0}function bs(e,t){const n=io(e).M,i=io(t).M;return n!==i}function Vn(e){const{M:t,d:n,s:i,m:r,H:s}=io(e);return t===1&&n===1&&s===0&&r===0&&i===0}function mm(e){return e===void 0?"":e.toISOString()}function jR(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class hn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const i=this.getOptions(),{code:r,date:s,number:a}=y(i,"locale"),o=y(i,"tabularRepModal","tableHeadingFormatter"),l=y(i,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c?.getDomainAxisScaleType();let d;return u===rt.TIME&&(d=f=>s(f,r,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(f=>{d&&(f[1]=d(f[1]));for(const p in f){const g=f[p];typeof g=="number"&&(f[p]=a(g,r))}return f})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let i=this.getData();const r=this.getDataGroups(),{groupMapsTo:s}=y(n,"data"),a=y(n,"axes");return t&&(i=i.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===rt.LINEAR||c===rt.LOG)&&(i=i.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===rt.LABELS)i=i.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;i=i.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),i.filter(o=>r.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Pt.items.status,i=this.getDataGroups(t),{groupMapsTo:r}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(a=>i.find(o=>o.name===a[r]&&o.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(An(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),n}getDataGroups(t){return y(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(i=>t.includes(i.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Pt.items.status;return this.getDataGroups(t).filter(i=>i.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(i=>i.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(i=>i.name)}aggregateBinDataByGroup(t){return JD(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),i=this.services.cartesianScales.getMainXAxisPosition(),r=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[i],{groupMapsTo:a}=n.data,{bins:o=EL.defaultBins}=s,l=Array.isArray(o),c=y0().value(f=>f[r]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(f=>f[a]))),h=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,g=this.aggregateBinDataByGroup(f);d.forEach(m=>{h.push({group:m,key:p,value:g[m]||0,bin:f.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getActiveDataGroupNames(),{bins:r}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:r});return tc().keys(i)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=i[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),i={},{groupMapsTo:r}=this.getOptions().data;return n.map(s=>{const a=s[r];i[a]!==null&&i[a]!==void 0?i[a].push(s):i[a]=[s]}),Object.keys(i).map(s=>({name:s,data:i[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const i=this.getOptions(),r=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=cs(r.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?mm(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=i.axes[a].scaleType;return o===rt.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===rt.LOG||o===rt.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{d[f]=h.filter(p=>p[r]===f).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[r]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?mm(f[p])===l:f[p].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:i=!1}){const r=this.getOptions(),{groupMapsTo:s}=r.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const c=jD(o.map(u=>[u.sharedStackKey,0]));o.forEach(u=>{a.forEach(d=>{c[u.sharedStackKey]+=u[d]})}),o.forEach(u=>{a.forEach(d=>{const h=c[u.sharedStackKey];c[u.sharedStackKey]?u[d]=u[d]/h*100:u[d]=0})})}return(i?tc().offset(T_):tc()).keys(a)(o).map((c,u)=>Object.keys(c).filter(d=>!isNaN(d)).map(d=>{const h=c[d];return h[s]=a[u],h}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const i=Object.assign({skipUpdate:!1,animate:!0},n);i.skipUpdate||this.update(i.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();Qc(n,t),this.set({options:ut(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(_.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:i}=Pt.items.status,r=this.getDataGroups(),s=r.some(u=>u.status===i),a=r.filter(u=>u.status===n);if(s)if(a.length===1&&a[0].name===t)r.forEach((u,d)=>{r[d].status=n});else{const u=r.findIndex(d=>d.name===t);r[u].status=r[u].status===i?n:i}else r.forEach((u,d)=>{r[d].status=u.name===t?n:i});const o=r.filter(u=>u.status===n),l=this.getOptions();r.some(u=>u.status===i)?l.data.selectedGroups=o.map(u=>u.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(_.Legend.ITEMS_UPDATE,{dataGroups:r}),this.set({dataGroups:r})}getIsFilled(t,n,i,r){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,i,r):r}getFillColor(t,n,i){const r=this.getOptions(),s=y(this.colorScale,t);return r.getFillColor?r.getFillColor(t,n,i,s):s}getStrokeColor(t,n,i){const r=this.getOptions(),s=y(this.colorScale,t);return r.getStrokeColor?r.getStrokeColor(t,n,i,s):s}isUserProvidedColorScaleValid(){const t=y(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(i=>Object.keys(t).includes(i.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let i=t.originalClassName;return t.classNameTypes.forEach(r=>i=t.originalClassName?`${i} ${r}-${n}`:`${r}-${n}`),i||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:i,labels:r}=t;return i.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=y(s,"label");if(c===null){const d=y(r,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:r[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const n=this.getTabularDataArray().map(a=>a.map(o=>`"${(o==="–"?"–":o).split(/[,;'"`]/).map(u=>jR(u)).join("")}"`)).map(a=>a.join(",")).join(`
|
|
2
|
+
`),i=this.getOptions();let r="myChart";const s=y(i,"fileDownload","fileName");typeof s=="function"?r=s("csv"):typeof s=="string"&&(r=s),this.services.files.downloadCSV(n,`${r}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:i,DISABLED:r}=Pt.items.status,s=this.getOptions(),a=cs(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(c=>a.includes(c))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?i:r;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=y(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=y(this.getOptions(),"color","pairing");let n=y(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let i=y(t,"option");const r=Fg.pairingOptions,s=n>5?14:n,a=`${s}-color`;i=i<=r[a]?i:1;const o=this.allDataGroups.map((l,c)=>`${s}-${i}-${c%14+1}`);this.colorClassNames=Sa().range(o).domain(this.allDataGroups)}}function KR(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(),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),t&&(i.href=t),r.href=e,r.href}const QR=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function In(e){const t=[];for(let n=0,i=e.length;n<i;n++)t.push(e[n]);return t}function so(e,t){const i=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return i?parseFloat(i.replace("px","")):0}function JR(e){const t=so(e,"border-left-width"),n=so(e,"border-right-width");return e.clientWidth+t+n}function tI(e){const t=so(e,"border-top-width"),n=so(e,"border-bottom-width");return e.clientHeight+t+n}function vm(e,t={}){const n=t.width||JR(e),i=t.height||tI(e);return{width:n,height:i}}function eI(){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 Me=16384;function nI(e){(e.width>Me||e.height>Me)&&(e.width>Me&&e.height>Me?e.width>e.height?(e.height*=Me/e.width,e.width=Me):(e.width*=Me/e.height,e.height=Me):e.width>Me?(e.height*=Me/e.width,e.width=Me):(e.width*=Me/e.height,e.height=Me))}function ao(e){return new Promise((t,n)=>{const i=new Image;i.decode=()=>t(i),i.onload=()=>t(i),i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=e})}async function iI(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function rI(e,t,n){const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),s=document.createElementNS(i,"foreignObject");return r.setAttribute("width",`${t}`),r.setAttribute("height",`${n}`),r.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"),r.appendChild(s),s.appendChild(e),iI(r)}const ve=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ve(n,t)};function sI(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function aI(e){return In(e).map(t=>{const n=e.getPropertyValue(t),i=e.getPropertyPriority(t);return`${t}: ${n}${i?" !important":""};`}).join(" ")}function oI(e,t,n){const i=`.${e}:${t}`,r=n.cssText?sI(n):aI(n);return document.createTextNode(`${i}{${r}}`)}function ym(e,t,n){const i=window.getComputedStyle(e,n),r=i.getPropertyValue("content");if(r===""||r==="none")return;const s=QR();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(oI(s,n,i)),t.appendChild(a)}function lI(e,t){ym(e,t,":before"),ym(e,t,":after")}const Em="application/font-woff",xm="image/jpeg",cI={woff:Em,woff2:Em,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:xm,jpeg:xm,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function uI(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function su(e){const t=uI(e).toLowerCase();return cI[t]||""}function hI(e){return e.split(/,/)[1]}function au(e){return e.search(/^(data:)/)!==-1}function dI(e,t){return`data:${t};base64,${e}`}async function bm(e,t,n){const i=await fetch(e,t);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const r=await i.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:i,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(r)})}const ou={};function fI(e,t,n){let i=e.replace(/\?.*/,"");return n&&(i=e),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),t?`[${t}]${i}`:i}async function lu(e,t,n){const i=fI(e,t,n.includeQueryParams);if(ou[i]!=null)return ou[i];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let r;try{const s=await bm(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),hI(o)));r=dI(s,t)}catch(s){r=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return ou[i]=r,r}async function pI(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ao(t)}async function gI(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a?.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return ao(o)}const n=e.poster,i=su(n),r=await lu(n,i,t);return ao(r)}async function mI(e){var t;try{if(!((t=e?.contentDocument)===null||t===void 0)&&t.body)return await oo(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function vI(e,t){return ve(e,HTMLCanvasElement)?pI(e):ve(e,HTMLVideoElement)?gI(e,t):ve(e,HTMLIFrameElement)?mI(e):e.cloneNode(!1)}const yI=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function EI(e,t,n){var i,r;let s=[];return yI(e)&&e.assignedNodes?s=In(e.assignedNodes()):ve(e,HTMLIFrameElement)&&(!((i=e.contentDocument)===null||i===void 0)&&i.body)?s=In(e.contentDocument.body.childNodes):s=In(((r=e.shadowRoot)!==null&&r!==void 0?r:e).childNodes),s.length===0||ve(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>oo(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function xI(e,t){const n=t.style;if(!n)return;const i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):In(i).forEach(r=>{let s=i.getPropertyValue(r);r==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),ve(e,HTMLIFrameElement)&&r==="display"&&s==="inline"&&(s="block"),r==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(r,s,i.getPropertyPriority(r))})}function bI(e,t){ve(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ve(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function SI(e,t){if(ve(e,HTMLSelectElement)){const n=t,i=Array.from(n.children).find(r=>e.value===r.getAttribute("value"));i&&i.setAttribute("selected","")}}function TI(e,t){return ve(t,Element)&&(xI(e,t),lI(e,t),bI(e,t),SI(e,t)),t}async function _I(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const i={};for(let s=0;s<n.length;s++){const o=n[s].getAttribute("xlink:href");if(o){const l=e.querySelector(o),c=document.querySelector(o);!l&&c&&!i[o]&&(i[o]=await oo(c,t,!0))}}const r=Object.values(i);if(r.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<r.length;l++)o.appendChild(r[l]);e.appendChild(a)}return e}async function oo(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(i=>vI(i,t)).then(i=>EI(e,i,t)).then(i=>TI(e,i)).then(i=>_I(i,t))}const Sm=/url\((['"]?)([^'"]+?)\1\)/g,OI=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,wI=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function MI(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function AI(e){const t=[];return e.replace(Sm,(n,i,r)=>(t.push(r),n)),t.filter(n=>!au(n))}async function CI(e,t,n,i,r){try{const s=n?KR(t,n):t,a=su(t);let o;return r||(o=await lu(s,a,i)),e.replace(MI(t),`$1${o}$3`)}catch{}return e}function DI(e,{preferredFontFormat:t}){return t?e.replace(wI,n=>{for(;;){const[i,,r]=OI.exec(n)||[];if(!r)return"";if(r===t)return`src: ${i};`}}):e}function Tm(e){return e.search(Sm)!==-1}async function _m(e,t,n){if(!Tm(e))return e;const i=DI(e,n);return AI(i).reduce((s,a)=>s.then(o=>CI(o,a,t,n)),Promise.resolve(i))}async function lo(e,t,n){var i;const r=(i=t.style)===null||i===void 0?void 0:i.getPropertyValue(e);if(r){const s=await _m(r,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function LI(e,t){await lo("background",e,t)||await lo("background-image",e,t),await lo("mask",e,t)||await lo("mask-image",e,t)}async function RI(e,t){const n=ve(e,HTMLImageElement);if(!(n&&!au(e.src))&&!(ve(e,SVGImageElement)&&!au(e.href.baseVal)))return;const i=n?e.src:e.href.baseVal,r=await lu(i,su(i),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=r):e.href.baseVal=r})}async function II(e,t){const i=In(e.childNodes).map(r=>Om(r,t));await Promise.all(i).then(()=>e)}async function Om(e,t){ve(e,Element)&&(await LI(e,t),await RI(e,t),await II(e,t))}function kI(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 i=t.style;return i!=null&&Object.keys(i).forEach(r=>{n[r]=i[r]}),e}const wm={};async function Mm(e){let t=wm[e];if(t!=null)return t;const i=await(await fetch(e)).text();return t={url:e,cssText:i},wm[e]=t,t}async function Am(e,t){let n=e.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let o=a.replace(i,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),bm(o,t.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>n)}function Cm(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=e.replace(n,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=r.exec(i);if(l===null)break;t.push(l[0])}i=i.replace(r,"");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(i);if(l===null){if(l=o.exec(i),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function PI(e,t){const n=[],i=[];return e.forEach(r=>{if("cssRules"in r)try{In(r.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Mm(l).then(u=>Am(u,t)).then(u=>Cm(u).forEach(d=>{try{r.insertRule(d,d.startsWith("@import")?o+=1:r.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});i.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];r.href!=null&&i.push(Mm(r.href).then(o=>Am(o,t)).then(o=>Cm(o).forEach(l=>{a.insertRule(l,r.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(i).then(()=>(e.forEach(r=>{if("cssRules"in r)try{In(r.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${r.href}`,s)}}),n))}function NI(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Tm(t.style.getPropertyValue("src")))}async function $I(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=In(e.ownerDocument.styleSheets),i=await PI(n,t);return NI(i)}async function FI(e,t){const n=await $I(e,t);return(await Promise.all(n.map(r=>{const s=r.parentStyleSheet?r.parentStyleSheet.href:null;return _m(r.cssText,s,t)}))).join(`
|
|
3
|
+
`)}async function UI(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await FI(e,t);if(n){const i=document.createElement("style"),r=document.createTextNode(n);i.appendChild(r),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}}async function BI(e,t={}){const{width:n,height:i}=vm(e,t),r=await oo(e,t,!0);return await UI(r,t),await Om(r,t),kI(r,t),await rI(r,n,i)}async function Dm(e,t={}){const{width:n,height:i}=vm(e,t),r=await BI(e,t),s=await ao(r),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||eI(),c=t.canvasWidth||n,u=t.canvasHeight||i;return a.width=c*l,a.height=u*l,t.skipAutoScale||nI(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 GI(e,t={}){return(await Dm(e,t)).toDataURL()}async function HI(e,t={}){return(await Dm(e,t)).toDataURL("image/jpeg",t.quality||1)}class kn{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const VI="DONT_STYLE_ME_css_styles_verifier";class k extends kn{constructor(t,n){super(t,n)}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=I(t));const i={width:0,height:0},r=h=>{h&&Object.keys(i).forEach(f=>{if(h[f]){const p=h[f],g=parseFloat(p);p&&g>i[f]&&(""+p).indexOf("%")===-1&&(i[f]=g)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(h){console.error(h)}try{typeof a?.getBoundingClientRect=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(r(s),i.width>0&&i.height>0))return i;if(n.useClientDimensions&&(r(d),i.width>0&&i.height>0))return d;if(n.useBBox&&(r(l),i.width>0&&i.height>0))return l;if(n.useBoundingRect&&(r(u),i.width>0&&i.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};r(h)}catch{r(d),r(l),r(s)}return i}static appendOrSelect(t,n){const i=t.select(`${n}`);if(i.empty()){let r=n.split("#"),s,a;return r.length===2?(s=r[0],r=r[1].split("."),a=r[0]):(r=n.split("."),s=r[0]),t.append(s).attr("id",a).attr("class",r.slice(1).join(" "))}return i}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const i={left:0,top:0},r=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{i.left=r.left-s.left,i.top=r.top-s.top}catch(a){console.error(a)}return i}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){const t=this.model.getOptions().chartId;t?this.chartID=t:this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),i=I(this.getHolder()).append("div").classed(`${me}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");i.append("g").attr("class",VI),this.mainContainer=i.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:i,theme:r}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),i!==this.height&&(t.style.height=i,this.height=i),I(this.getHolder()).classed(`${me}--chart-holder`,!0).attr("data-carbon-theme",r)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),i=this.getHolder(),r=I(i);r.classed("filled",!0),HI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("jpg"):typeof o=="string"&&(a=o),t.services.files?.downloadImage(s,`${a}.jpg`),r.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),i=this.getHolder(),r=I(i);r.classed("filled",!0),GI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("png"):typeof o=="string"&&(a=o),t.services.files?.downloadImage(s,`${a}.png`),r.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(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=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=k.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),i=I(this.mainContainer).selectAll(`.${n} > svg`);let r=0;i.nodes().forEach(function(s){r+=Number(k.getSVGElementSize(I(s),{useBBox:!0}).height)}),r<=t?I(this.mainContainer).attr("height",r):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(t).on("mouseover",()=>{this.services.events?.dispatchEvent(_.Chart.MOUSEOVER)}).on("mouseout",()=>{this.services.events?.dispatchEvent(_.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,i=t.clientHeight;const r=ja(()=>{t&&(Math.abs(n-t.clientWidth)>1||Math.abs(i-t.clientHeight)>1)&&(n=t.clientWidth,i=t.clientHeight,this.services.events?.dispatchEvent(_.Chart.RESIZE))},12.5);new ResizeObserver(r).observe(t)}}class vt{constructor(t,n,i){if(this.type="",this.renderType=st.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,i&&(this.configs=i,this.configs.id)){const r=y(this.model.getOptions(),"style","prefix");this.id=`${r}--${this.configs.id}`}this.parent||this.setParent(I(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){const n=this.parent;if(this.parent=t,!(n&&n.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");this.parent?.classed(`${me}--${i}--${this.type}`,!0),n&&n.classed(`${me}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={ariaLabel:null,isPresentational:!1,withinChartClip:!1}){if(this.type){const n=y(this.model.getOptions(),"style","prefix"),i=this.id?`#${this.id}`:"",r=k.appendOrSelect(this.parent,`${this.renderType===st.SVG?"svg":"div"}${i}.${me}--${n}--${this.type}`);if(t.ariaLabel&&r.attr("aria-label",t.ariaLabel),t.isPresentational&&r.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const o=I(`#${s}`).select("rect");if(o.size()!==0){const l=parseFloat(o.attr("height")),c=parseFloat(o.attr("width"));!isNaN(l)&&!isNaN(c)&&l>0&&c>0&&r.attr("clip-path",`url(#${s})`)}}}return r.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ut({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */const{entries:Lm,setPrototypeOf:Rm,isFrozen:zI,getPrototypeOf:WI,getOwnPropertyDescriptor:YI}=Object;let{freeze:ce,seal:Fe,create:rr}=Object,{apply:cu,construct:uu}=typeof Reflect<"u"&&Reflect;ce||(ce=function(t){return t}),Fe||(Fe=function(t){return t}),cu||(cu=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];return t.apply(n,r)}),uu||(uu=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});const Ss=Yt(Array.prototype.forEach),qI=Yt(Array.prototype.lastIndexOf),Im=Yt(Array.prototype.pop),Ts=Yt(Array.prototype.push),XI=Yt(Array.prototype.splice),ue=Array.isArray,_s=Yt(String.prototype.toLowerCase),hu=Yt(String.prototype.toString),km=Yt(String.prototype.match),sr=Yt(String.prototype.replace),Pm=Yt(String.prototype.indexOf),ZI=Yt(String.prototype.trim),jI=Yt(Number.prototype.toString),KI=Yt(Boolean.prototype.toString),Nm=typeof BigInt>"u"?null:Yt(BigInt.prototype.toString),$m=typeof Symbol>"u"?null:Yt(Symbol.prototype.toString),Ft=Yt(Object.prototype.hasOwnProperty),Os=Yt(Object.prototype.toString),te=Yt(RegExp.prototype.test),co=QI(TypeError);function Yt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return cu(e,t,i)}}function QI(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return uu(e,n)}}function pt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_s;if(Rm&&Rm(e,null),!ue(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){const s=n(r);s!==r&&(zI(t)||(t[i]=s),r=s)}e[r]=!0}return e}function JI(e){for(let t=0;t<e.length;t++)Ft(e,t)||(e[t]=null);return e}function ye(e){const t=rr(null);for(const[n,i]of Lm(e))Ft(e,n)&&(ue(i)?t[n]=JI(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=ye(i):t[n]=i);return t}function tk(e){switch(typeof e){case"string":return e;case"number":return jI(e);case"boolean":return KI(e);case"bigint":return Nm?Nm(e):"0";case"symbol":return $m?$m(e):"Symbol()";case"undefined":return Os(e);case"function":case"object":{if(e===null)return Os(e);const t=e,n=ar(t,"toString");if(typeof n=="function"){const i=n(t);return typeof i=="string"?i:Os(i)}return Os(e)}default:return Os(e)}}function ar(e,t){for(;e!==null;){const i=YI(e,t);if(i){if(i.get)return Yt(i.get);if(typeof i.value=="function")return Yt(i.value)}e=WI(e)}function n(){return null}return n}function ek(e){try{return te(e,""),!0}catch{return!1}}const Fm=ce(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),du=ce(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fu=ce(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),nk=ce(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),pu=ce(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ik=ce(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Um=ce(["#text"]),Bm=ce(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),gu=ce(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Gm=ce(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),uo=ce(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rk=Fe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sk=Fe(/<%[\w\W]*|[\w\W]*%>/gm),ak=Fe(/\$\{[\w\W]*/gm),ok=Fe(/^data-[\-\w.\u00B7-\uFFFF]+$/),lk=Fe(/^aria-[\-\w]+$/),Hm=Fe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ck=Fe(/^(?:\w+script|data):/i),uk=Fe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Vm=Fe(/^html$/i),hk=Fe(/^[a-z][.\w]*(-[.\w]+)+$/i);var zm=Object.freeze({__proto__:null,ARIA_ATTR:lk,ATTR_WHITESPACE:uk,CUSTOM_ELEMENT:hk,DATA_ATTR:ok,DOCTYPE_NAME:Vm,ERB_EXPR:sk,IS_ALLOWED_URI:Hm,IS_SCRIPT_OR_DATA:ck,MUSTACHE_EXPR:rk,TMPLIT_EXPR:ak});const ws={element:1,text:3,progressingInstruction:7,comment:8,document:9},dk=function(){return typeof window>"u"?null:window},fk=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Wm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ym(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dk();const t=ct=>Ym(ct);if(t.version="3.4.2",t.removed=[],!e||!e.document||e.document.nodeType!==ws.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const i=n,r=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=e,p=l.prototype,g=ar(p,"cloneNode"),m=ar(p,"remove"),v=ar(p,"nextSibling"),S=ar(p,"childNodes"),E=ar(p,"parentNode");if(typeof a=="function"){const ct=n.createElement("template");ct.content&&ct.content.ownerDocument&&(n=ct.content.ownerDocument)}let b,x="";const{implementation:T,createNodeIterator:C,createDocumentFragment:D,getElementsByTagName:$}=n,{importNode:P}=i;let w=Wm();t.isSupported=typeof Lm=="function"&&typeof E=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:N,TMPLIT_EXPR:A,DATA_ATTR:O,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:R,CUSTOM_ELEMENT:B}=zm;let{IS_ALLOWED_URI:tt}=zm,Z=null;const q=pt({},[...Fm,...du,...fu,...pu,...Um]);let Q=null;const ht=pt({},[...Bm,...gu,...Gm,...uo]);let et=Object.seal(rr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),K=null,nt=null;const lt=Object.seal(rr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Y=!0,j=!0,J=!1,L=!0,H=!1,V=!0,yt=!1,Bt=!1,at=!1,bt=!1,Ue=!1,fe=!1,Ds=!0,fr=!1;const pr="user-content-";let Nn=!0,Ls=!1,gr={},pn=null;const Ru=pt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Bv=null;const Gv=pt({},["audio","video","img","source","image","track"]);let Iu=null;const Hv=pt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bo="http://www.w3.org/1998/Math/MathML",So="http://www.w3.org/2000/svg",gn="http://www.w3.org/1999/xhtml";let mr=gn,ku=!1,Pu=null;const sF=pt({},[bo,So,gn],hu);let Nu=pt({},["mi","mo","mn","ms","mtext"]),$u=pt({},["annotation-xml"]);const aF=pt({},["title","style","font","a","script"]);let Rs=null;const oF=["application/xhtml+xml","text/html"],lF="text/html";let Zt=null,vr=null;const cF=n.createElement("form"),Vv=function(M){return M instanceof RegExp||M instanceof Function},Fu=function(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(vr&&vr===M)return;(!M||typeof M!="object")&&(M={}),M=ye(M),Rs=oF.indexOf(M.PARSER_MEDIA_TYPE)===-1?lF:M.PARSER_MEDIA_TYPE,Zt=Rs==="application/xhtml+xml"?hu:_s,Z=Ft(M,"ALLOWED_TAGS")&&ue(M.ALLOWED_TAGS)?pt({},M.ALLOWED_TAGS,Zt):q,Q=Ft(M,"ALLOWED_ATTR")&&ue(M.ALLOWED_ATTR)?pt({},M.ALLOWED_ATTR,Zt):ht,Pu=Ft(M,"ALLOWED_NAMESPACES")&&ue(M.ALLOWED_NAMESPACES)?pt({},M.ALLOWED_NAMESPACES,hu):sF,Iu=Ft(M,"ADD_URI_SAFE_ATTR")&&ue(M.ADD_URI_SAFE_ATTR)?pt(ye(Hv),M.ADD_URI_SAFE_ATTR,Zt):Hv,Bv=Ft(M,"ADD_DATA_URI_TAGS")&&ue(M.ADD_DATA_URI_TAGS)?pt(ye(Gv),M.ADD_DATA_URI_TAGS,Zt):Gv,pn=Ft(M,"FORBID_CONTENTS")&&ue(M.FORBID_CONTENTS)?pt({},M.FORBID_CONTENTS,Zt):Ru,K=Ft(M,"FORBID_TAGS")&&ue(M.FORBID_TAGS)?pt({},M.FORBID_TAGS,Zt):ye({}),nt=Ft(M,"FORBID_ATTR")&&ue(M.FORBID_ATTR)?pt({},M.FORBID_ATTR,Zt):ye({}),gr=Ft(M,"USE_PROFILES")?M.USE_PROFILES&&typeof M.USE_PROFILES=="object"?ye(M.USE_PROFILES):M.USE_PROFILES:!1,Y=M.ALLOW_ARIA_ATTR!==!1,j=M.ALLOW_DATA_ATTR!==!1,J=M.ALLOW_UNKNOWN_PROTOCOLS||!1,L=M.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=M.SAFE_FOR_TEMPLATES||!1,V=M.SAFE_FOR_XML!==!1,yt=M.WHOLE_DOCUMENT||!1,bt=M.RETURN_DOM||!1,Ue=M.RETURN_DOM_FRAGMENT||!1,fe=M.RETURN_TRUSTED_TYPE||!1,at=M.FORCE_BODY||!1,Ds=M.SANITIZE_DOM!==!1,fr=M.SANITIZE_NAMED_PROPS||!1,Nn=M.KEEP_CONTENT!==!1,Ls=M.IN_PLACE||!1,tt=ek(M.ALLOWED_URI_REGEXP)?M.ALLOWED_URI_REGEXP:Hm,mr=typeof M.NAMESPACE=="string"?M.NAMESPACE:gn,Nu=Ft(M,"MATHML_TEXT_INTEGRATION_POINTS")&&M.MATHML_TEXT_INTEGRATION_POINTS&&typeof M.MATHML_TEXT_INTEGRATION_POINTS=="object"?ye(M.MATHML_TEXT_INTEGRATION_POINTS):pt({},["mi","mo","mn","ms","mtext"]),$u=Ft(M,"HTML_INTEGRATION_POINTS")&&M.HTML_INTEGRATION_POINTS&&typeof M.HTML_INTEGRATION_POINTS=="object"?ye(M.HTML_INTEGRATION_POINTS):pt({},["annotation-xml"]);const W=Ft(M,"CUSTOM_ELEMENT_HANDLING")&&M.CUSTOM_ELEMENT_HANDLING&&typeof M.CUSTOM_ELEMENT_HANDLING=="object"?ye(M.CUSTOM_ELEMENT_HANDLING):rr(null);if(et=rr(null),Ft(W,"tagNameCheck")&&Vv(W.tagNameCheck)&&(et.tagNameCheck=W.tagNameCheck),Ft(W,"attributeNameCheck")&&Vv(W.attributeNameCheck)&&(et.attributeNameCheck=W.attributeNameCheck),Ft(W,"allowCustomizedBuiltInElements")&&typeof W.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=W.allowCustomizedBuiltInElements),H&&(j=!1),Ue&&(bt=!0),gr&&(Z=pt({},Um),Q=rr(null),gr.html===!0&&(pt(Z,Fm),pt(Q,Bm)),gr.svg===!0&&(pt(Z,du),pt(Q,gu),pt(Q,uo)),gr.svgFilters===!0&&(pt(Z,fu),pt(Q,gu),pt(Q,uo)),gr.mathMl===!0&&(pt(Z,pu),pt(Q,Gm),pt(Q,uo))),lt.tagCheck=null,lt.attributeCheck=null,Ft(M,"ADD_TAGS")&&(typeof M.ADD_TAGS=="function"?lt.tagCheck=M.ADD_TAGS:ue(M.ADD_TAGS)&&(Z===q&&(Z=ye(Z)),pt(Z,M.ADD_TAGS,Zt))),Ft(M,"ADD_ATTR")&&(typeof M.ADD_ATTR=="function"?lt.attributeCheck=M.ADD_ATTR:ue(M.ADD_ATTR)&&(Q===ht&&(Q=ye(Q)),pt(Q,M.ADD_ATTR,Zt))),Ft(M,"ADD_URI_SAFE_ATTR")&&ue(M.ADD_URI_SAFE_ATTR)&&pt(Iu,M.ADD_URI_SAFE_ATTR,Zt),Ft(M,"FORBID_CONTENTS")&&ue(M.FORBID_CONTENTS)&&(pn===Ru&&(pn=ye(pn)),pt(pn,M.FORBID_CONTENTS,Zt)),Ft(M,"ADD_FORBID_CONTENTS")&&ue(M.ADD_FORBID_CONTENTS)&&(pn===Ru&&(pn=ye(pn)),pt(pn,M.ADD_FORBID_CONTENTS,Zt)),Nn&&(Z["#text"]=!0),yt&&pt(Z,["html","head","body"]),Z.table&&(pt(Z,["tbody"]),delete K.tbody),M.TRUSTED_TYPES_POLICY){if(typeof M.TRUSTED_TYPES_POLICY.createHTML!="function")throw co('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof M.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw co('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=M.TRUSTED_TYPES_POLICY,x=b.createHTML("")}else b===void 0&&(b=fk(f,r)),b!==null&&typeof x=="string"&&(x=b.createHTML(""));ce&&ce(M),vr=M},zv=pt({},[...du,...fu,...nk]),Wv=pt({},[...pu,...ik]),uF=function(M){let W=E(M);(!W||!W.tagName)&&(W={namespaceURI:mr,tagName:"template"});const it=_s(M.tagName),Rt=_s(W.tagName);return Pu[M.namespaceURI]?M.namespaceURI===So?W.namespaceURI===gn?it==="svg":W.namespaceURI===bo?it==="svg"&&(Rt==="annotation-xml"||Nu[Rt]):!!zv[it]:M.namespaceURI===bo?W.namespaceURI===gn?it==="math":W.namespaceURI===So?it==="math"&&$u[Rt]:!!Wv[it]:M.namespaceURI===gn?W.namespaceURI===So&&!$u[Rt]||W.namespaceURI===bo&&!Nu[Rt]?!1:!Wv[it]&&(aF[it]||!zv[it]):!!(Rs==="application/xhtml+xml"&&Pu[M.namespaceURI]):!1},Je=function(M){Ts(t.removed,{element:M});try{E(M).removeChild(M)}catch{m(M)}},Ei=function(M,W){try{Ts(t.removed,{attribute:W.getAttributeNode(M),from:W})}catch{Ts(t.removed,{attribute:null,from:W})}if(W.removeAttribute(M),M==="is")if(bt||Ue)try{Je(W)}catch{}else try{W.setAttribute(M,"")}catch{}},Yv=function(M){let W=null,it=null;if(at)M="<remove></remove>"+M;else{const qt=km(M,/^[\r\n\t ]+/);it=qt&&qt[0]}Rs==="application/xhtml+xml"&&mr===gn&&(M='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+M+"</body></html>");const Rt=b?b.createHTML(M):M;if(mr===gn)try{W=new h().parseFromString(Rt,Rs)}catch{}if(!W||!W.documentElement){W=T.createDocument(mr,"template",null);try{W.documentElement.innerHTML=ku?x:Rt}catch{}}const ae=W.body||W.documentElement;return M&&it&&ae.insertBefore(n.createTextNode(it),ae.childNodes[0]||null),mr===gn?$.call(W,yt?"html":"body")[0]:yt?W.documentElement:ae},qv=function(M){return C.call(M.ownerDocument||M,M,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Uu=function(M){return M instanceof d&&(typeof M.nodeName!="string"||typeof M.textContent!="string"||typeof M.removeChild!="function"||!(M.attributes instanceof u)||typeof M.removeAttribute!="function"||typeof M.setAttribute!="function"||typeof M.namespaceURI!="string"||typeof M.insertBefore!="function"||typeof M.hasChildNodes!="function")},Bu=function(M){return typeof o=="function"&&M instanceof o};function $n(ct,M,W){Ss(ct,it=>{it.call(t,M,W,vr)})}const Xv=function(M){let W=null;if($n(w.beforeSanitizeElements,M,null),Uu(M))return Je(M),!0;const it=Zt(M.nodeName);if($n(w.uponSanitizeElement,M,{tagName:it,allowedTags:Z}),V&&M.hasChildNodes()&&!Bu(M.firstElementChild)&&te(/<[/\w!]/g,M.innerHTML)&&te(/<[/\w!]/g,M.textContent)||V&&M.namespaceURI===gn&&it==="style"&&Bu(M.firstElementChild)||M.nodeType===ws.progressingInstruction||V&&M.nodeType===ws.comment&&te(/<[/\w]/g,M.data))return Je(M),!0;if(K[it]||!(lt.tagCheck instanceof Function&<.tagCheck(it))&&!Z[it]){if(!K[it]&&jv(it)&&(et.tagNameCheck instanceof RegExp&&te(et.tagNameCheck,it)||et.tagNameCheck instanceof Function&&et.tagNameCheck(it)))return!1;if(Nn&&!pn[it]){const Rt=E(M)||M.parentNode,ae=S(M)||M.childNodes;if(ae&&Rt){const qt=ae.length;for(let be=qt-1;be>=0;--be){const Be=g(ae[be],!0);Rt.insertBefore(Be,v(M))}}}return Je(M),!0}return M instanceof l&&!uF(M)||(it==="noscript"||it==="noembed"||it==="noframes")&&te(/<\/no(script|embed|frames)/i,M.innerHTML)?(Je(M),!0):(H&&M.nodeType===ws.text&&(W=M.textContent,Ss([G,N,A],Rt=>{W=sr(W,Rt," ")}),M.textContent!==W&&(Ts(t.removed,{element:M.cloneNode()}),M.textContent=W)),$n(w.afterSanitizeElements,M,null),!1)},Zv=function(M,W,it){if(nt[W]||Ds&&(W==="id"||W==="name")&&(it in n||it in cF))return!1;const Rt=Q[W]||lt.attributeCheck instanceof Function&<.attributeCheck(W,M);if(!(j&&!nt[W]&&te(O,W))){if(!(Y&&te(F,W))){if(!Rt||nt[W]){if(!(jv(M)&&(et.tagNameCheck instanceof RegExp&&te(et.tagNameCheck,M)||et.tagNameCheck instanceof Function&&et.tagNameCheck(M))&&(et.attributeNameCheck instanceof RegExp&&te(et.attributeNameCheck,W)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(W,M))||W==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&te(et.tagNameCheck,it)||et.tagNameCheck instanceof Function&&et.tagNameCheck(it))))return!1}else if(!Iu[W]){if(!te(tt,sr(it,R,""))){if(!((W==="src"||W==="xlink:href"||W==="href")&&M!=="script"&&Pm(it,"data:")===0&&Bv[M])){if(!(J&&!te(U,sr(it,R,"")))){if(it)return!1}}}}}}return!0},hF=pt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),jv=function(M){return!hF[_s(M)]&&te(B,M)},Kv=function(M){$n(w.beforeSanitizeAttributes,M,null);const{attributes:W}=M;if(!W||Uu(M))return;const it={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let Rt=W.length;for(;Rt--;){const ae=W[Rt],{name:qt,namespaceURI:be,value:Be}=ae,tn=Zt(qt),Gu=Be;let Kt=qt==="value"?Gu:ZI(Gu);if(it.attrName=tn,it.attrValue=Kt,it.keepAttr=!0,it.forceKeepAttr=void 0,$n(w.uponSanitizeAttribute,M,it),Kt=it.attrValue,fr&&(tn==="id"||tn==="name")&&Pm(Kt,pr)!==0&&(Ei(qt,M),Kt=pr+Kt),V&&te(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Kt)){Ei(qt,M);continue}if(tn==="attributename"&&km(Kt,"href")){Ei(qt,M);continue}if(it.forceKeepAttr)continue;if(!it.keepAttr){Ei(qt,M);continue}if(!L&&te(/\/>/i,Kt)){Ei(qt,M);continue}H&&Ss([G,N,A],t0=>{Kt=sr(Kt,t0," ")});const Jv=Zt(M.nodeName);if(!Zv(Jv,tn,Kt)){Ei(qt,M);continue}if(b&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!be)switch(f.getAttributeType(Jv,tn)){case"TrustedHTML":{Kt=b.createHTML(Kt);break}case"TrustedScriptURL":{Kt=b.createScriptURL(Kt);break}}if(Kt!==Gu)try{be?M.setAttributeNS(be,qt,Kt):M.setAttribute(qt,Kt),Uu(M)?Je(M):Im(t.removed)}catch{Ei(qt,M)}}$n(w.afterSanitizeAttributes,M,null)},Qv=function(M){let W=null;const it=qv(M);for($n(w.beforeSanitizeShadowDOM,M,null);W=it.nextNode();)$n(w.uponSanitizeShadowNode,W,null),Xv(W),Kv(W),W.content instanceof s&&Qv(W.content);$n(w.afterSanitizeShadowDOM,M,null)};return t.sanitize=function(ct){let M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,it=null,Rt=null,ae=null;if(ku=!ct,ku&&(ct="<!-->"),typeof ct!="string"&&!Bu(ct)&&(ct=tk(ct),typeof ct!="string"))throw co("dirty is not a string, aborting");if(!t.isSupported)return ct;if(Bt||Fu(M),t.removed=[],typeof ct=="string"&&(Ls=!1),Ls){const Be=ct.nodeName;if(typeof Be=="string"){const tn=Zt(Be);if(!Z[tn]||K[tn])throw co("root node is forbidden and cannot be sanitized in-place")}}else if(ct instanceof o)W=Yv("<!---->"),it=W.ownerDocument.importNode(ct,!0),it.nodeType===ws.element&&it.nodeName==="BODY"||it.nodeName==="HTML"?W=it:W.appendChild(it);else{if(!bt&&!H&&!yt&&ct.indexOf("<")===-1)return b&&fe?b.createHTML(ct):ct;if(W=Yv(ct),!W)return bt?null:fe?x:""}W&&at&&Je(W.firstChild);const qt=qv(Ls?ct:W);for(;Rt=qt.nextNode();)Xv(Rt),Kv(Rt),Rt.content instanceof s&&Qv(Rt.content);if(Ls)return ct;if(bt){if(H){W.normalize();let Be=W.innerHTML;Ss([G,N,A],tn=>{Be=sr(Be,tn," ")}),W.innerHTML=Be}if(Ue)for(ae=D.call(W.ownerDocument);W.firstChild;)ae.appendChild(W.firstChild);else ae=W;return(Q.shadowroot||Q.shadowrootmode)&&(ae=P.call(i,ae,!0)),ae}let be=yt?W.outerHTML:W.innerHTML;return yt&&Z["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&te(Vm,W.ownerDocument.doctype.name)&&(be="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
|
|
4
|
+
`+be),H&&Ss([G,N,A],Be=>{be=sr(be,Be," ")}),b&&fe?b.createHTML(be):be},t.setConfig=function(){let ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fu(ct),Bt=!0},t.clearConfig=function(){vr=null,Bt=!1},t.isValidAttribute=function(ct,M,W){vr||Fu({});const it=Zt(ct),Rt=Zt(M);return Zv(it,Rt,W)},t.addHook=function(ct,M){typeof M=="function"&&Ts(w[ct],M)},t.removeHook=function(ct,M){if(M!==void 0){const W=qI(w[ct],M);return W===-1?void 0:XI(w[ct],W,1)[0]}return Im(w[ct])},t.removeHooks=function(ct){w[ct]=[]},t.removeAllHooks=function(){w=Wm()},t}var mu=Ym();const ho=e=>mu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),pk=e=>mu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),dn=e=>mu.sanitize(e,{ALLOWED_TAGS:[]}),Eo=class Eo extends vt{constructor(){super(...arguments),this.type="toolbar",this.renderType=st.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(_.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(_.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({ariaLabel:"toolbar"}).attr("role","group");if(y(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:s}=this.getControlConfigs();s&&r.push(this.getOverflowButtonConfig());const a=n.selectAll("div.toolbar-control").data(r,c=>c.id);a.exit().remove();const o=a.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu"),l=this;o.merge(a).classed("disabled",c=>c.shouldBeDisabled()).attr("role","button").attr("aria-disabled",c=>c.shouldBeDisabled()).attr("aria-label",c=>c.title).html(c=>`
|
|
5
5
|
<button
|
|
6
6
|
type="button"
|
|
7
7
|
class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
|
|
8
|
-
aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${
|
|
8
|
+
aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${dn(c.id)}`)}" aria-label="${dn(c.title)}">
|
|
9
9
|
<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
|
|
10
|
-
${
|
|
10
|
+
${pk(c.iconSVG.content)}
|
|
11
11
|
</svg>
|
|
12
|
-
</button>`).each(function(c,u){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(d){const h=I(this);h.classed("hovered",!0),l.services.events.dispatchEvent(
|
|
12
|
+
</button>`).each(function(c,u){I(this).select("svg").style("pointer-events","none").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),I(this).select("button").on("mouseover focus",function(d){const h=I(this);h.classed("hovered",!0),l.services.events.dispatchEvent(_.Toolbar.SHOW_TOOLTIP,{event:d,hoveredElement:h,content:c.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){l.services.events.dispatchEvent(_.Toolbar.HIDE_TOOLTIP)}).on("click",d=>{c.shouldBeDisabled()||l.triggerFunctionAndEvent(c,d,this)}).on("keydown",d=>{d.key&&d.key==="Enter"||d.key===" "?(d.preventDefault(),l.triggerFunctionAndEvent(c,d,this)):d.key&&d.key==="ArrowLeft"?l.focusOnPreviousEnabledToolbarItem(u):d.key&&d.key==="ArrowRight"&&l.focusOnNextEnabledToolbarItem(u)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,r=>y(r,"id"));n.exit().remove();const i=n.enter().append("li").attr("id",r=>this.services.domUtils.generateElementIDString(`control-${r.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);i.append("button").attr("type","button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),i.merge(n).classed("cds--overflow-menu-options__option--disabled",r=>r.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",r=>r.shouldBeDisabled()).attr("aria-disabled",r=>r.shouldBeDisabled()).selectAll("button").text(r=>r.title)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),I(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(_.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(_.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let i=n.length;for(let r=t-1;r>=0;r--)if(!n[r].shouldBeDisabled()){i=r;break}if(i<n.length){const r=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)}`).node();"focus"in r&&r.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let i=-1;for(let r=t+1;r<n.length;r++)if(!n[r].shouldBeDisabled()){i=r;break}if(i>-1){const r=I(`button#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)}`).node();"focus"in r&&r.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let i=n.length;for(let r=t-1;r>=0;r--)if(!n[r].shouldBeDisabled()){i=r;break}if(i<n.length){const r=I(`#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)} button`).node();"focus"in r&&r.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let i=-1;for(let r=t+1;r<n.length;r++)if(!n[r].shouldBeDisabled()){i=r;break}if(i>-1){const r=I(`#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)} button`).node();"focus"in r&&r.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,s)=>{const a=I(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(r,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",o=>{o&&o.key==="Enter"?n.triggerFunctionAndEvent(r,t,a.node()):o&&o.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(s):o&&o.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(s):o&&o.key==="Escape"&&n.updateOverflowMenu(!1),o.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,i){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(_.Toolbar.BUTTON_CLICK,{control:t,event:n,element:i}))}getControlConfigs(){const t=y(this.getOptions(),"toolbar","numberOfIcons")-1,n=y(this.getOptions(),"toolbar","controls"),i=[],r=[],s=[];return n.forEach(a=>{let o=null;if(a.type===Tt.CUSTOM)y(a,"id")===null&&(a.id=`toolbar-button-${Eo.buttonID++}`),y(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===Tt.MAKE_FULLSCREEN&&l?a.type=Tt.EXIT_FULLSCREEN:a.type===Tt.EXIT_FULLSCREEN&&!l&&(a.type=Tt.MAKE_FULLSCREEN),o=this.getControlConfigByType(a.type)}o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?i.push(o):r.length<t?y(o,"iconSVG","content")===null?s.push(o):r.push(o):s.push(o))}),s.push(...i),s.length?{buttonList:r,overflowMenuItemList:s}:{buttonList:r}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){const{moreOptions:t}=y(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
|
|
13
13
|
<circle cx="16" cy="16" r="2"></circle>
|
|
14
|
-
<circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),i=this.model.getDisplayData(),r=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:f}=y(r,"locale","translations","toolbar");let p;switch(t){case
|
|
15
|
-
<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case
|
|
16
|
-
<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case
|
|
14
|
+
<circle cx="16" cy="24" r="2"></circle>`},clickFunction:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),i=this.model.getDisplayData(),r=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:f}=y(r,"locale","translations","toolbar");let p;switch(t){case Tt.ZOOM_IN:n&&(p={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case Tt.ZOOM_OUT:n&&(p={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case Tt.RESET_ZOOM:n&&(p={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case Tt.MAKE_FULLSCREEN:p={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Tt.EXIT_FULLSCREEN:p={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Tt.SHOW_AS_DATATABLE:p={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:f,shouldBeDisabled:()=>i.length===0,clickFunction:()=>this.services.events.dispatchEvent(_.Modal.SHOW)};break;case Tt.EXPORT_CSV:p={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case Tt.EXPORT_PNG:p={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case Tt.EXPORT_JPG:p={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return p}getControlIconByType(t){switch(t){case Tt.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
|
|
15
|
+
<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Tt.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
|
|
16
|
+
<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Tt.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Tt.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case Tt.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case Tt.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case Tt.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Tt.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Tt.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};Eo.buttonID=0;let or=Eo;const xo=class xo extends vt{constructor(t,n,i,r){super(t,n,r),this.type="layout",this.configs=r,this.children=i,this._instanceID=xo.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(i=>{const r=y(i,"growth");return r===dt.PREFERRED||r===dt.FIXED}).each(function(i){n+=i.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(n=>y(n,"growth")===dt.STRETCH).size()}render(t=!0){const n=this.model.getOptions(),i=this.parent,{width:r,height:s}=k.getHTMLElementSize(i.node()),a=this.configs.direction===At.ROW||this.configs.direction===At.ROW_REVERSE,o=y(this.model.getOptions(),"style","prefix"),l=i.classed(`${me}--${o}--layout-row`,this.configs.direction===At.ROW).classed(`${me}--${o}--layout-row-reverse`,this.configs.direction===At.ROW_REVERSE).classed(`${me}--${o}--layout-column`,this.configs.direction===At.COLUMN).classed(`${me}--${o}--layout-column-reverse`,this.configs.direction===At.COLUMN_REVERSE).classed(`${me}--${o}--layout-alignitems-center`,this.configs.alignItems===hi.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,d=>d.id);l.enter().append("div").merge(i.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",d=>`layout-child layout-child-${this._instanceID} ${d.id}`).each(function(d){d.components.forEach(h=>{const f=I(this),g=y(d,"renderType")===st.SVG;h.setParent(g?k.appendOrSelect(f,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):f),g&&!f.select("svg.layout-svg-wrapper").attr("aria-label")&&f.select("svg.layout-svg-wrapper").attr("aria-label",n?.accessibility?.svgAriaLabel||n?.title);const m=y(d,"growth");(m===dt.PREFERRED||m===dt.FIXED)&&h.render(t)})}),i.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(d){const h=y(d,"growth"),p=y(d,"renderType")===st.SVG?k.getSVGElementSize(I(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):k.getHTMLElementSize(this);if(h===dt.PREFERRED){const g=a?p.width:p.height,m=a?r:s;d.size=g/m*100}}),l.exit().remove(),this.children.filter(d=>y(d,"growth")===dt.STRETCH).forEach(d=>{d.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const u=i.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,d=>d.id);a?u.style("width",d=>`${d.size/100*r}px`).style("height","100%"):u.style("height",d=>`${d.size/100*s}px`).style("width","100%"),u.each(function(d){d.components.forEach(h=>{y(d,"growth")===dt.STRETCH&&h.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(i=>i.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(i=>i.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};xo.instanceID=Math.floor(Math.random()*99999999999);let he=xo;class Pn extends vt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer({isPresentational:!0}).style("width",`${this.configs.size||Bg.default.size}px`).style("height",`${this.configs.size||Bg.default.size}px`).attr("opacity",0)}}class fo extends vt{constructor(t,n,i){super(t,n,i),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const r=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${r}__modal-title`).attr("aria-describedby",`${r}__modal-description`).attr("tabindex",-1).style("opacity",1).style("visibility","visible"),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),this.modal.on("click",this.handleHideModal),this.modal.select(".cds--modal-container").on("click",s=>{s.stopPropagation()}),this.modal.select(".cds--modal-close").on("click",this.handleHideModal),typeof window<"u"&&window.addEventListener("keydown",this.handleEscapeKey)},this.handleEscapeKey=r=>{r.key==="Escape"&&this.handleHideModal()},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null).style("opacity",0).style("visibility","hidden"),this.modal.on("click",null),this.modal.select(".cds--modal-container").on("click",null),this.modal.select(".cds--modal-close").on("click",null),typeof window<"u"&&window.removeEventListener("keydown",this.handleEscapeKey)},this.init()}addEventListeners(){this.services.events.addEventListener(_.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(_.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),{title:i,downloadAsCSV:r}=y(n,"locale","translations","tabularRep"),s=y(n,"style","prefix"),a=this.model.getTabularDataArray();return`
|
|
17
17
|
<div class="cds--modal-container">
|
|
18
18
|
<div class="cds--modal-header">
|
|
19
19
|
|
|
20
20
|
<p class="cds--modal-header__label cds--type-delta" id="${t}__modal-title">${i}</p>
|
|
21
21
|
|
|
22
|
-
<p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${
|
|
22
|
+
<p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${dn(n.title)}</p>
|
|
23
23
|
|
|
24
24
|
<button class="cds--modal-close" type="button" data-modal-close aria-label="close modal" data-modal-primary-focus>
|
|
25
25
|
<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-label="Close" width="20" height="20" viewBox="0 0 32 32" role="img" class="cds--modal-close__icon">
|
|
@@ -33,24 +33,24 @@
|
|
|
33
33
|
<thead>
|
|
34
34
|
<tr>
|
|
35
35
|
${Et(a,0).map(o=>`<th scope="col">
|
|
36
|
-
<div class="cds--table-header-label">${
|
|
36
|
+
<div class="cds--table-header-label">${dn(o)}</div>
|
|
37
37
|
</th>`).join("")}
|
|
38
38
|
</tr>
|
|
39
39
|
</thead>
|
|
40
40
|
|
|
41
41
|
<tbody>${a.slice(1).map(o=>`
|
|
42
42
|
<tr>
|
|
43
|
-
${o.map(l=>`<td>${
|
|
43
|
+
${o.map(l=>`<td>${dn(l)}</td>`).join("")}
|
|
44
44
|
</tr>`).join("")}
|
|
45
45
|
</tbody>
|
|
46
46
|
</table>
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
49
|
<div class="cds--modal-footer">
|
|
50
|
-
<div class="${
|
|
50
|
+
<div class="${me}--${s}-modal-footer-spacer"></div>
|
|
51
51
|
<button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${r}</button>
|
|
52
52
|
</div>
|
|
53
|
-
</div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const i=I(this.services.domUtils.getHolder()),r=y(n,"style","prefix");this.modal=k.appendOrSelect(i,`div.${pe}--${r}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Ss extends vt{constructor(){super(...arguments),this.type="title",this.renderType=st.HTML}render(t=!1){const n=this.getComponentContainer(),i=y(this.getOptions(),"title"),r=n.selectAll("p.title").data([i]);if(r.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(r).html(s=>ln(s)),r.node()&&r.node().offsetWidth<r.node().scrollWidth){const s=this;r.on("mouseover",function(a){s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:r,content:r.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(T.Tooltip.HIDE)})}r.exit().remove()}truncateTitle(t,n){if(n<=0)return;const i=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const r=k.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-r);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(T.Tooltip.SHOW,{event:l,hoveredElement:t,content:i})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(T.Tooltip.HIDE)})}}getMaxTitleWidth(){return k.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,i,r){const s=Math.floor((i+n)/2);return t.getSubStringLength(0,s)>r?this.getSubstringIndex(t,n,s,r):t.getSubStringLength(0,s)<r?t.getSubStringLength(0,s+1)>r?s:this.getSubstringIndex(t,s,i,r):s}}var ft=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(ft||{});class yu extends vt{constructor(){super(...arguments),this.type="legend",this.renderType=st.HTML}render(t=!1){const n=this.getOptions(),i=y(n,"legend"),r=y(i,"alignment"),s=y(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Pt.items.status,l=a.some(S=>S.status===o),c=y(i,"order"),u=this.getComponentContainer().classed("center-aligned",r===Gt.CENTER).classed("right-aligned",r===Gt.RIGHT).classed(s||"horizontal",!0).classed("has-deactivated-items",l).attr("role",ft.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,S=>S.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(S){return S.status===Pt.items.status.ACTIVE});const f=y(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Pt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",ft.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(S,E)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${E}-title`)).attr("aria-checked",({status:S})=>S===Pt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",S=>this.model.getColorClassName({classNameTypes:[lt.BACKGROUND],dataGroupName:S.name,originalClassName:"checkbox"})).style("background",S=>S.status===Pt.items.status.ACTIVE?this.model.getFillColor(S.name)||this.model.getStrokeColor(S.name):null).classed("active",function(S){return S.status===Pt.items.status.ACTIVE});g.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(d.select("p"));const v=y(n,"legend","additionalItems");if(v&&a.length){const S=this,E=u.selectAll("div.additional-item").data(v);E.exit().remove();const b=E.enter().append("div").merge(E).classed("legend-item",!0).classed("additional",!0).attr("role","img").attr("aria-labelledby",(C,D)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+D}-title`));b.selectAll("*").remove();let x,_=1;b.append("svg").classed("icon",!0).each(function(C){const D=I(this);!x||x!=C.type?(x=C.type,_=1):_++,S.addAdditionalItem(D,C,_)}),b.append("p").merge(b.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((i,r)=>n.indexOf(i.name)-n.indexOf(r.name)),n.length<t.length){const i=t.length-n.length;return t.slice(i).concat(t.slice(0,i))}return t}addAdditionalItem(t,n,i){const{width:r,height:s}=Pt.area;if(n.type===zt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${r}px`).style("height",`${s}px`),n.type===zt.RADIUS){const{iconData:a,fill:o,stroke:l}=Pt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ft.IMG).attr("aria-label","radius").attr("cx",u=>u.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===zt.LINE){const a=Pt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${i}`,!0).attr("role",ft.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",r).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===zt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${i}`,!0).attr("role",ft.IMG).attr("aria-label","area").attr("width",r).attr("height",s).style("fill",i>3&&!n.fill?Pt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===zt.SIZE){const{iconData:a,fill:o,stroke:l}=Pt.size;t.attr("fill","none").attr("role",ft.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===zt.QUARTILE){const{iconData:a}=Pt.quartile;t.selectAll("rect").attr("role",ft.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(l,c)=>`quartile-${c===0?"wrapper":"line"}`).attr("x",l=>l.x).attr("y",l=>l.y).attr("width",l=>l.width).attr("height",l=>l.height)}else if(n.type===zt.ZOOM){const{iconData:a,color:o}=y(Pt,"zoom"),l=t.attr("role",ft.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=y(this.getOptions(),"legend","truncation"),i=y(n,"type"),r=y(n,"threshold"),s=y(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),i!==Ie.NONE?a.html(function(o){const l=ln(o.name);return l.length>r&&l.length!==s?hs(l,i,s):l}):a.html(o=>ln(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=y(i,"legend"),s=y(r,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:I(this)});const o=I(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==Ie.NONE&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){I(this).datum().name.length>s.threshold&&s.type!==Ie.NONE&&t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(T.Legend.ITEM_CLICK,{clickedElement:I(this)});const o=I(this).datum();t.model.toggleDataLabel(o.name)}).on("mouseout",function(){const a=I(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Ie.NONE&&t.services.events.dispatchEvent(T.Tooltip.HIDE),t.services.events.dispatchEvent(T.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:I(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(T.Legend.ITEM_MOUSEOUT,{hoveredElement:I(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=I(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class Hm extends vt{constructor(t,n,i){super(t,n,i),this.type="chart-clip",this.renderType=st.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const i=n.getMainXScale(),r=n.getMainYScale(),[s,a]=i.range(),[o,l]=r.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=k.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class ak extends Hm{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const r=k.appendOrSelect(this.chartClipPath,`rect.${this.type}`);r.attr("x",0).attr("y",0).attr("width",n).attr("height",i),this.chartClipPath.merge(r).lower()}}var ir,Bt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Bt||(Bt={}));var Gm=(ir={},ir[Bt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},ir[Bt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},ir[Bt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},ir[Bt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},ir),Vm=typeof window<"u"?window:{innerHeight:0,innerWidth:0},ho=function(){function e(t){t===void 0&&(t={}),this.positions=Gm,this.positions=Object.assign({},Gm,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,i={top:0,left:0};n.offsetParent;){var r=getComputedStyle(n.offsetParent);r.position==="static"&&r.marginLeft&&r.marginTop&&(parseInt(r.marginTop,10)&&(i.top+=parseInt(r.marginTop,10)),parseInt(r.marginLeft,10)&&(i.left+=parseInt(r.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+i.top,left:s.left-a.left+i.left}},e.prototype.findRelative=function(t,n,i){var r=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},e.prototype.findAbsolute=function(t,n,i){var r=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},e.prototype.findPosition=function(t,n,i,r){r===void 0&&(r=this.getAbsoluteOffset.bind(this));var s=r(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,i)},e.prototype.findPositionAt=function(t,n,i){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,i)},e.prototype.getPlacementBox=function(t,n){var i=t.offsetHeight+n.top,r=t.offsetWidth+n.left;return{top:n.top,bottom:i,left:n.left,right:r}},e.prototype.addOffset=function(t,n,i){return n===void 0&&(n=0),i===void 0&&(i=0),Object.assign({},t,{top:t.top+n,left:t.left+i})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,i,r,s){var a=this;r===void 0&&(r=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=i.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,f=r();u.top<f.top?d=f.top-u.top:u.bottom>f.height&&(d=u.bottom-f.height),u.left<f.left?h=f.left-u.left:u.right>f.width&&(h=u.right-f.width),d&&!h?h=1:h&&!d&&(d=1);var p=n.offsetHeight*n.offsetWidth,g=d*h,m=p-g,v=m/p;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,i,r){var s=this;r===void 0&&(r=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,i,r,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Vm.innerHeight,width:Vm.innerWidth}},e.prototype.calculatePosition=function(t,n,i,r){return this.positions[r]?this.positions[r](t,i,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new ho;class Eu extends vt{constructor(t,n,i){super(t,n,i),this.type="tooltip",this.renderType=st.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new ho,this.handleShowTooltip=r=>{const s=r.detail.data||r.detail.items,a=I(r.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(r));r.detail.content?o=`<div class="title-tooltip"><p>${co(r.detail.content)}</p></div>`:o=co(this.getTooltipHTML(l));const c=k.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(r.detail.content){const u=`<div class="title-tooltip"><p>${co(r.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${co(this.model.getOptions().tooltip.customHTML(s,o,a))}</p></div>`);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,d){const h=l[d];l[d]&&l[d].color&&I(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(r),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=r.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(T.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==T.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(T.Tooltip.MOVE,null),this.services.events.removeEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),i=y(n,"tooltip","truncation","type"),r=y(n,"tooltip","truncation","threshold"),s=y(n,"tooltip","truncation","numCharacter");return i!==Ie.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=this.valueFormatter(a.value,a.label),a.label&&a.label.length+o>r&&(a.label=hs(a.label,i,s)),a.value&&a.value.length>r&&(a.value=hs(a.value,i,s)),a}):t.map(a=>(a.value=this.valueFormatter(a.value,a.label),a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
|
|
53
|
+
</div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const i=I(this.services.domUtils.getHolder()),r=y(n,"style","prefix");this.modal=k.appendOrSelect(i,`div.${me}--${r}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Ms extends vt{constructor(){super(...arguments),this.type="title",this.renderType=st.HTML}render(t=!1){const n=this.getComponentContainer(),i=y(this.getOptions(),"title"),r=n.selectAll("p.title").data([i]);if(r.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(r).html(s=>dn(s)),r.node()&&r.node().offsetWidth<r.node().scrollWidth){const s=this;r.on("mouseover",function(a){s.services.events.dispatchEvent(_.Tooltip.SHOW,{event:a,hoveredElement:r,content:r.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(_.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(_.Tooltip.HIDE)})}r.exit().remove()}truncateTitle(t,n){if(n<=0)return;const i=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const r=k.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-r);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(_.Tooltip.SHOW,{event:l,hoveredElement:t,content:i})}).on("mousemove",function(l){o.services.events.dispatchEvent(_.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(_.Tooltip.HIDE)})}}getMaxTitleWidth(){return k.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,i,r){const s=Math.floor((i+n)/2);return t.getSubStringLength(0,s)>r?this.getSubstringIndex(t,n,s,r):t.getSubStringLength(0,s)<r?t.getSubStringLength(0,s+1)>r?s:this.getSubstringIndex(t,s,i,r):s}}var ft=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(ft||{});class vu extends vt{constructor(){super(...arguments),this.type="legend",this.renderType=st.HTML}render(t=!1){const n=this.getOptions(),i=y(n,"legend"),r=y(i,"alignment"),s=y(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Pt.items.status,l=a.some(S=>S.status===o),c=y(i,"order"),u=this.getComponentContainer().classed("center-aligned",r===Vt.CENTER).classed("right-aligned",r===Vt.RIGHT).classed(s||"horizontal",!0).classed("has-deactivated-items",l).attr("role",ft.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,S=>S.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(S){return S.status===Pt.items.status.ACTIVE});const f=y(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Pt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",ft.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(S,E)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${E}-title`)).attr("aria-checked",({status:S})=>S===Pt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",S=>this.model.getColorClassName({classNameTypes:[ot.BACKGROUND],dataGroupName:S.name,originalClassName:"checkbox"})).style("background",S=>S.status===Pt.items.status.ACTIVE?this.model.getFillColor(S.name)||this.model.getStrokeColor(S.name):null).classed("active",function(S){return S.status===Pt.items.status.ACTIVE});g.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),h.append("p").merge(d.select("p"));const v=y(n,"legend","additionalItems");if(v&&a.length){const S=this,E=u.selectAll("div.additional-item").data(v);E.exit().remove();const b=E.enter().append("div").merge(E).classed("legend-item",!0).classed("additional",!0).attr("role","img").attr("aria-labelledby",(C,D)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+D}-title`));b.selectAll("*").remove();let x,T=1;b.append("svg").classed("icon",!0).each(function(C){const D=I(this);!x||x!=C.type?(x=C.type,T=1):T++,S.addAdditionalItem(D,C,T)}),b.append("p").merge(b.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&h.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((i,r)=>n.indexOf(i.name)-n.indexOf(r.name)),n.length<t.length){const i=t.length-n.length;return t.slice(i).concat(t.slice(0,i))}return t}addAdditionalItem(t,n,i){const{width:r,height:s}=Pt.area;if(n.type===Wt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${r}px`).style("height",`${s}px`),n.type===Wt.RADIUS){const{iconData:a,fill:o,stroke:l}=Pt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ft.IMG).attr("aria-label","radius").attr("cx",u=>u.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===Wt.LINE){const a=Pt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${i}`,!0).attr("role",ft.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",r).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===Wt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${i}`,!0).attr("role",ft.IMG).attr("aria-label","area").attr("width",r).attr("height",s).style("fill",i>3&&!n.fill?Pt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Wt.SIZE){const{iconData:a,fill:o,stroke:l}=Pt.size;t.attr("fill","none").attr("role",ft.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===Wt.QUARTILE){const{iconData:a}=Pt.quartile;t.selectAll("rect").attr("role",ft.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(l,c)=>`quartile-${c===0?"wrapper":"line"}`).attr("x",l=>l.x).attr("y",l=>l.y).attr("width",l=>l.width).attr("height",l=>l.height)}else if(n.type===Wt.ZOOM){const{iconData:a,color:o}=y(Pt,"zoom"),l=t.attr("role",ft.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=y(this.getOptions(),"legend","truncation"),i=y(n,"type"),r=y(n,"threshold"),s=y(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),i!==Pe.NONE?a.html(function(o){const l=dn(o.name);return l.length>r&&l.length!==s?ms(l,i,s):l}):a.html(o=>dn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=y(i,"legend"),s=y(r,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(_.Legend.ITEM_HOVER,{hoveredElement:I(this)});const o=I(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==Pe.NONE&&t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){I(this).datum().name.length>s.threshold&&s.type!==Pe.NONE&&t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(_.Legend.ITEM_CLICK,{clickedElement:I(this)});const o=I(this).datum();t.model.toggleDataLabel(o.name)}).on("mouseout",function(){const a=I(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Pe.NONE&&t.services.events.dispatchEvent(_.Tooltip.HIDE),t.services.events.dispatchEvent(_.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(_.Legend.ITEM_HOVER,{hoveredElement:I(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(_.Legend.ITEM_MOUSEOUT,{hoveredElement:I(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=I(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class qm extends vt{constructor(t,n,i){super(t,n,i),this.type="chart-clip",this.renderType=st.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const i=n.getMainXScale(),r=n.getMainYScale(),[s,a]=i.range(),[o,l]=r.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=k.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class gk extends qm{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const r=k.appendOrSelect(this.chartClipPath,`rect.${this.type}`);r.attr("x",0).attr("y",0).attr("width",n).attr("height",i),this.chartClipPath.merge(r).lower()}}var lr,Gt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Gt||(Gt={}));var Xm=(lr={},lr[Gt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},lr[Gt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},lr[Gt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},lr[Gt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},lr),Zm=typeof window<"u"?window:{innerHeight:0,innerWidth:0},po=function(){function e(t){t===void 0&&(t={}),this.positions=Xm,this.positions=Object.assign({},Xm,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,i={top:0,left:0};n.offsetParent;){var r=getComputedStyle(n.offsetParent);r.position==="static"&&r.marginLeft&&r.marginTop&&(parseInt(r.marginTop,10)&&(i.top+=parseInt(r.marginTop,10)),parseInt(r.marginLeft,10)&&(i.left+=parseInt(r.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+i.top,left:s.left-a.left+i.left}},e.prototype.findRelative=function(t,n,i){var r=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},e.prototype.findAbsolute=function(t,n,i){var r=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},e.prototype.findPosition=function(t,n,i,r){r===void 0&&(r=this.getAbsoluteOffset.bind(this));var s=r(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,i)},e.prototype.findPositionAt=function(t,n,i){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,i)},e.prototype.getPlacementBox=function(t,n){var i=t.offsetHeight+n.top,r=t.offsetWidth+n.left;return{top:n.top,bottom:i,left:n.left,right:r}},e.prototype.addOffset=function(t,n,i){return n===void 0&&(n=0),i===void 0&&(i=0),Object.assign({},t,{top:t.top+n,left:t.left+i})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,i,r,s){var a=this;r===void 0&&(r=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=i.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,f=r();u.top<f.top?d=f.top-u.top:u.bottom>f.height&&(d=u.bottom-f.height),u.left<f.left?h=f.left-u.left:u.right>f.width&&(h=u.right-f.width),d&&!h?h=1:h&&!d&&(d=1);var p=n.offsetHeight*n.offsetWidth,g=d*h,m=p-g,v=m/p;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,i,r){var s=this;r===void 0&&(r=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,i,r,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Zm.innerHeight,width:Zm.innerWidth}},e.prototype.calculatePosition=function(t,n,i,r){return this.positions[r]?this.positions[r](t,i,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new po;class yu extends vt{constructor(t,n,i){super(t,n,i),this.type="tooltip",this.renderType=st.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new po,this.handleShowTooltip=r=>{const s=r.detail.data||r.detail.items,a=I(r.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(r));r.detail.content?o=`<div class="title-tooltip"><p>${ho(r.detail.content)}</p></div>`:o=ho(this.getTooltipHTML(l));const c=k.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(r.detail.content){const u=`<div class="title-tooltip"><p>${ho(r.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${ho(this.model.getOptions().tooltip.customHTML(s,o,a))}</p></div>`);else c.html(o);c.selectAll(".datapoint-tooltip").each(function(u,d){const h=l[d];l[d]&&l[d].color&&I(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(r),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=r.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(_.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==_.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(_.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(_.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(_.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(_.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(_.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(_.Tooltip.MOVE,null),this.services.events.removeEventListener(_.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(_.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(_.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(_.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(_.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),i=y(n,"tooltip","truncation","type"),r=y(n,"tooltip","truncation","threshold"),s=y(n,"tooltip","truncation","numCharacter");return i!==Pe.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=this.valueFormatter(a.value,a.label),a.label&&a.label.length+o>r&&(a.label=ms(a.label,i,s)),a.value&&a.value.length>r&&(a.value=ms(a.value,i,s)),a}):t.map(a=>(a.value=this.valueFormatter(a.value,a.label),a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
|
|
54
54
|
<div class="datapoint-tooltip${n.bold?" bold":""}">
|
|
55
55
|
${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
|
|
56
56
|
<div class="label">
|
|
@@ -59,17 +59,17 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
|
|
61
61
|
</div>
|
|
62
|
-
</li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const i=this.getOptions(),r=y(i,"tooltip","valueFormatter"),{code:s,number:a,date:o}=y(i,"locale");if(r)return r(t,n);if(this.isDate(t))return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),i=y(n,"tooltip","enabled");if(i){const r=I(this.services.domUtils.getHolder()),s=y(n,"style","prefix");this.tooltip=k.appendOrSelect(r,`div.${pe}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!i&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,i){const r=Object.assign({},t);return n==Bt.LEFT?r.left-=i:n==Bt.RIGHT?r.left+=i:n==Bt.TOP?r.top-=i:n==Bt.BOTTOM&&(r.top+=i),r}positionTooltip(t){const n=this.services.domUtils.getHolder(),i=n.offsetWidth,r=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=y(a,"zoomBar","top","enabled"),l=!!y(t,"detail","noWrap"),c=Array.isArray(y(t,"detail","placements")),u=c?y(t,"detail","placements"):[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM];let d,{horizontalOffset:h}=Ug;const{defaultOffset:f}=Ug;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=y(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:i,height:r}));let S=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));S=this.addOffsetByPlacement(S,d,f),this.positionService.setElement(s,S);return}let p=y(t,"detail","mousePosition");if(!p)p=Yn(y(t,"detail","event"),n);else{const m=y(a,"zoomBar","top","type"),v=_e.height[m];o&&(p[1]+=v+_e.spacerHeight)}p[0]/i>.9?d=Bt.LEFT:p[0]/i<.1?d=Bt.RIGHT:d=this.positionService.findBestPlacementAt({left:p[0],top:p[1]},s,u,()=>({top:void 0,left:void 0,width:i,height:r})),d===Bt.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:p[0]+h,top:p[1]},s,d);this.positionService.setElement(s,g)}}class ok extends Dn{zoomIn(t,n,i){let r,s,a;const o=i||Qi;t&&(r=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(${-r},${-s})`),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_IN,{element:I(t)})}zoomOut(t,n){const i=n||Qi;t.transition().duration(i.duration).ease(i.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}}class lk extends Dn{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 i;n?i=new CustomEvent(t,{detail:n}):(i=document.createEvent("Event"),i.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(i)}}class ck extends Dn{constructor(t,n){super(t,n)}downloadCSV(t,n){const i=document.createElement("a"),r="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:r}),n);else if(URL&&"download"in i){const s=URL.createObjectURL(new Blob([t],{type:r}));i.href=s,i.setAttribute("download",n),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const i=document.createElement("a");i.download=n,i.href=t,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class _s extends Dn{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",i=>i.offset).style("stop-color",i=>i.color).style("stop-opacity",i=>i.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const i=t[0]<0&&t[1]>0;let r=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return i&&(r=[{offset:"0%",color:n,opacity:"0.6"},{offset:_s.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),r}}class uk extends Dn{constructor(){super(...arguments),this.pendingTransitions={}}init(){this.services.events?.addEventListener(T.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:i}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||i===!1?t.duration(0):t.duration(y(Bg,n,"duration")||Bg.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Ze{constructor(t,n){this.components=[],this.services={canvasZoom:ok,domUtils:k,events:lk,files:ck,gradientUtils:_s,transitions:uk},this.model=new an(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(i=>{const r=this.services[i];this.services[i]=new r(this.model,this.services)}),this.services.events.addEventListener(T.Model.UPDATE,i=>{const r=!!y(i,"detail","animate");this.update(r)}),this.model.setData(n.data),this.services.events.addEventListener(T.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(r=>{this.services[r].update()}),this.components.forEach(r=>r.render(t));const n=this.services.transitions.getPendingTransitions(),i=Object.keys(n).map(r=>n[r].end().catch(a=>a));Promise.all(i).then(()=>this.services.events.dispatchEvent(T.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"toolbar","enabled"),s={id:"legend",components:[new yu(this.model,this.services)],growth:dt.PREFERRED},a=y(i,"canvasZoom","enabled");a&&a===!0&&t.push(new ak(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Ss(this.model,this.services)],growth:dt.STRETCH},c={id:"toolbar",components:[new nr(this.model,this.services)],growth:dt.PREFERRED},u={id:"header",components:[new ce(this.model,this.services,[l,...r?[c]:[]],{direction:Ct.ROW,alignItems:ci.CENTER})],growth:dt.PREFERRED},d={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:y(n,"graphFrameRenderType")||st.SVG},h=y(n,"excludeLegend")!==!0&&i.legend.enabled!==!1;let f=Ct.COLUMN;if(h){const v=y(i,"legend","position");v==="left"?(f=Ct.ROW,i.legend.orientation||(i.legend.orientation=ji.VERTICAL)):v==="right"?(f=Ct.ROW_REVERSE,i.legend.orientation||(i.legend.orientation=ji.VERTICAL)):v==="bottom"&&(f=Ct.COLUMN_REVERSE)}const p={id:"spacer",components:[new Ln(this.model,this.services)],growth:dt.PREFERRED},g={id:"full-frame",components:[new ce(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:dt.STRETCH},m=[];if(o||r){m.push(u);const v={id:"spacer",components:[new Ln(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};m.push(v)}return m.push(g),[new Eu(this.model,this.services),new uo(this.model,this.services),new ce(this.model,this.services,m,{direction:Ct.COLUMN})]}}class gi extends an{constructor(t){super(t),this.axisFlavor=cs.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),i=t.isDualAxes(),r={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return i&&(r.secondaryDomain=t.secondaryDomainAxisPosition,r.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(r).forEach(s=>{const a=r[s];t.scales[a]?r[s]={position:a,label:t.getScaleLabel(a),identifier:y(n,"axes",a,"mapsTo")}:r[s]=null}),r}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{primaryDomain:r,primaryRange:s,secondaryDomain:a,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=y(this.getOptions(),"locale"),u=["Group",r.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[i],h[r.identifier]===null?"–":h[r.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"–":l(h[s.identifier],c),...a?[h[a.identifier]===null?"–":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"–":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),y(this.getOptions(),"zoomBar",z.TOP,"enabled"))){const i=y(this.getOptions(),"zoomBar",z.TOP,"data");this.setZoomBarData(i)}return n}setZoomBarData(t){const n=t?this.sanitize(Tn(t)):this.getDisplayData();let i=n;const{cartesianScales:r}=this.services;if(n&&r.domainAxisPosition&&r.rangeAxisPosition){const s=r.getDomainIdentifier(),a=r.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=rs(o).sort(),i=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:i})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const i=[];return Object.keys(z).forEach(r=>{const s=z[r],a=n.axes[s];if(a&&a.scaleType===it.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&i.push(o)}}),i.length>0&&t.forEach(r=>{i.forEach(s=>{y(r,s,"getTime")===null&&(r[s]=new Date(r[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}class hk extends gi{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const r=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"–":n(a.value,i)])];return super.formatTable({headers:r,cells:s})}}function zm(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function dk(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function xu(e,t){let n=0;if(t===void 0)for(let i of e)(i=+i)&&(n+=i);else{let i=-1;for(let r of e)(r=+t(r,++i,e))&&(n+=r)}return n}function fk(e){return e.depth}function pk(e,t){return t-1-e.height}function Wm(e,t){return e.sourceLinks.length?e.depth:t-1}function fo(e){return function(){return e}}function Ym(e,t){return po(e.source,t.source)||e.index-t.index}function qm(e,t){return po(e.target,t.target)||e.index-t.index}function po(e,t){return e.y0-t.y0}function bu(e){return e.value}function gk(e){return e.index}function mk(e){return e.nodes}function vk(e){return e.links}function Xm(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Zm({nodes:e}){for(const t of e){let n=t.y0,i=n;for(const r of t.sourceLinks)r.y0=n+r.width/2,n+=r.width;for(const r of t.targetLinks)r.y1=i+r.width/2,i+=r.width}}function yk(){let e=0,t=0,n=1,i=1,r=24,s=8,a,o=gk,l=Wm,c,u,d=mk,h=vk,f=6;function p(){const O={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(O),m(O),v(O),S(O),x(O),Zm(O),O}p.update=function(O){return Zm(O),O},p.nodeId=function(O){return arguments.length?(o=typeof O=="function"?O:fo(O),p):o},p.nodeAlign=function(O){return arguments.length?(l=typeof O=="function"?O:fo(O),p):l},p.nodeSort=function(O){return arguments.length?(c=O,p):c},p.nodeWidth=function(O){return arguments.length?(r=+O,p):r},p.nodePadding=function(O){return arguments.length?(s=a=+O,p):s},p.nodes=function(O){return arguments.length?(d=typeof O=="function"?O:fo(O),p):d},p.links=function(O){return arguments.length?(h=typeof O=="function"?O:fo(O),p):h},p.linkSort=function(O){return arguments.length?(u=O,p):u},p.size=function(O){return arguments.length?(e=t=0,n=+O[0],i=+O[1],p):[n-e,i-t]},p.extent=function(O){return arguments.length?(e=+O[0][0],n=+O[1][0],t=+O[0][1],i=+O[1][1],p):[[e,t],[n,i]]},p.iterations=function(O){return arguments.length?(f=+O,p):f};function g({nodes:O,links:F}){for(const[R,B]of O.entries())B.index=R,B.sourceLinks=[],B.targetLinks=[];const U=new Map(O.map((R,B)=>[o(R,B,O),R]));for(const[R,B]of F.entries()){B.index=R;let{source:tt,target:Z}=B;typeof tt!="object"&&(tt=B.source=Xm(U,tt)),typeof Z!="object"&&(Z=B.target=Xm(U,Z)),tt.sourceLinks.push(B),Z.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:R,targetLinks:B}of O)R.sort(u),B.sort(u)}function m({nodes:O}){for(const F of O)F.value=F.fixedValue===void 0?Math.max(xu(F.sourceLinks,bu),xu(F.targetLinks,bu)):F.fixedValue}function v({nodes:O}){const F=O.length;let U=new Set(O),R=new Set,B=0;for(;U.size;){for(const tt of U){tt.depth=B;for(const{target:Z}of tt.sourceLinks)R.add(Z)}if(++B>F)throw new Error("circular link");U=R,R=new Set}}function S({nodes:O}){const F=O.length;let U=new Set(O),R=new Set,B=0;for(;U.size;){for(const tt of U){tt.height=B;for(const{source:Z}of tt.targetLinks)R.add(Z)}if(++B>F)throw new Error("circular link");U=R,R=new Set}}function E({nodes:O}){const F=zm(O,B=>B.depth)+1,U=(n-e-r)/(F-1),R=new Array(F);for(const B of O){const tt=Math.max(0,Math.min(F-1,Math.floor(l.call(null,B,F))));B.layer=tt,B.x0=e+tt*U,B.x1=B.x0+r,R[tt]?R[tt].push(B):R[tt]=[B]}if(c)for(const B of R)B.sort(c);return R}function b(O){const F=dk(O,U=>(i-t-(U.length-1)*a)/xu(U,bu));for(const U of O){let R=t;for(const B of U){B.y0=R,B.y1=R+B.value*F,R=B.y1+a;for(const tt of B.sourceLinks)tt.width=tt.value*F}R=(i-R+a)/(U.length+1);for(let B=0;B<U.length;++B){const tt=U[B];tt.y0+=R*(B+1),tt.y1+=R*(B+1)}H(U)}}function x(O){const F=E(O);a=Math.min(s,(i-t)/(zm(F,U=>U.length)-1)),b(F);for(let U=0;U<f;++U){const R=Math.pow(.99,U),B=Math.max(1-R,(U+1)/f);C(F,R,B),_(F,R,B)}}function _(O,F,U){for(let R=1,B=O.length;R<B;++R){const tt=O[R];for(const Z of tt){let Y=0,Q=0;for(const{source:et,value:K}of Z.targetLinks){let nt=K*(Z.layer-et.layer);Y+=N(et,Z)*nt,Q+=nt}if(!(Q>0))continue;let ht=(Y/Q-Z.y0)*F;Z.y0+=ht,Z.y1+=ht,w(Z)}c===void 0&&tt.sort(po),D(tt,U)}}function C(O,F,U){for(let R=O.length,B=R-2;B>=0;--B){const tt=O[B];for(const Z of tt){let Y=0,Q=0;for(const{target:et,value:K}of Z.sourceLinks){let nt=K*(et.layer-Z.layer);Y+=M(Z,et)*nt,Q+=nt}if(!(Q>0))continue;let ht=(Y/Q-Z.y0)*F;Z.y0+=ht,Z.y1+=ht,w(Z)}c===void 0&&tt.sort(po),D(tt,U)}}function D(O,F){const U=O.length>>1,R=O[U];P(O,R.y0-a,U-1,F),$(O,R.y1+a,U+1,F),P(O,i,O.length-1,F),$(O,t,0,F)}function $(O,F,U,R){for(;U<O.length;++U){const B=O[U],tt=(F-B.y0)*R;tt>1e-6&&(B.y0+=tt,B.y1+=tt),F=B.y1+a}}function P(O,F,U,R){for(;U>=0;--U){const B=O[U],tt=(B.y1-F)*R;tt>1e-6&&(B.y0-=tt,B.y1-=tt),F=B.y0-a}}function w({sourceLinks:O,targetLinks:F}){if(u===void 0){for(const{source:{sourceLinks:U}}of F)U.sort(qm);for(const{target:{targetLinks:U}}of O)U.sort(Ym)}}function H(O){if(u===void 0)for(const{sourceLinks:F,targetLinks:U}of O)F.sort(qm),U.sort(Ym)}function N(O,F){let U=O.y0-(O.sourceLinks.length-1)*a/2;for(const{target:R,width:B}of O.sourceLinks){if(R===F)break;U+=B+a}for(const{source:R,width:B}of F.targetLinks){if(R===O)break;U-=B}return U}function M(O,F){let U=F.y0-(F.targetLinks.length-1)*a/2;for(const{source:R,width:B}of F.targetLinks){if(R===O)break;U+=B+a}for(const{target:R,width:B}of O.sourceLinks){if(R===F)break;U-=B}return U}return p}var Su=Math.PI,_u=2*Su,mi=1e-6,Ek=_u-mi;function Tu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function jm(){return new Tu}Tu.prototype=jm.prototype={constructor:Tu,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,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var s=this._x1,a=this._y1,o=n-e,l=i-t,c=s-e,u=a-t,d=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>mi)if(!(Math.abs(u*o-l*c)>mi)||!r)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,f=i-a,p=o*o+l*l,g=h*h+f*f,m=Math.sqrt(p),v=Math.sqrt(d),S=r*Math.tan((Su-Math.acos((p+d-g)/(2*m*v)))/2),E=S/v,b=S/m;Math.abs(E-1)>mi&&(this._+="L"+(e+E*c)+","+(t+E*u)),this._+="A"+r+","+r+",0,0,"+ +(u*h>c*f)+","+(this._x1=e+b*o)+","+(this._y1=t+b*l)}},arc:function(e,t,n,i,r,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(i),o=n*Math.sin(i),l=e+a,c=t+o,u=1^s,d=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>mi||Math.abs(this._y1-c)>mi)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%_u+_u),d>Ek?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>mi&&(this._+="A"+n+","+n+",0,"+ +(d>=Su)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};function Km(e){return function(){return e}}function xk(e){return e[0]}function bk(e){return e[1]}var Sk=Array.prototype.slice;function _k(e){return e.source}function Tk(e){return e.target}function Ok(e){var t=_k,n=Tk,i=xk,r=bk,s=null;function a(){var o,l=Sk.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=jm()),e(s,+i.apply(this,(l[0]=c,l)),+r.apply(this,l),+i.apply(this,(l[0]=u,l)),+r.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?(i=typeof o=="function"?o:Km(+o),a):i},a.y=function(o){return arguments.length?(r=typeof o=="function"?o:Km(+o),a):r},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function wk(e,t,n,i,r){e.moveTo(t,n),e.bezierCurveTo(t=(t+i)/2,n,t,r,i,r)}function Mk(){return Ok(wk)}function Ck(e){return[e.source.x1,e.y0]}function Ak(e){return[e.target.x0,e.y1]}function Dk(){return Mk().source(Ck).target(Ak)}class Lk extends vt{constructor(){super(...arguments),this.type="alluvial",this.renderType=st.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"alluvial graphs",withinChartClip:!0});n.html("");const{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(this.getOptions(),"color","gradient","enabled");let l=Xe.minNodePadding;s.alluvial.nodePadding>Xe.minNodePadding&&(l=s.alluvial.nodePadding);const c=y(s,"alluvial","nodeAlignment");let u=Wm;c===Gt.LEFT?u=fk:c===Gt.RIGHT&&(u=pk);const d=yk().nodeId(E=>E.name).nodeWidth(Xe.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[i-2,r]]);this.graph=d({nodes:s.alluvial.nodes.map(E=>Object.assign({},E)),links:a.map(E=>Object.assign({},E))}),this.graph.nodes=this.graph.nodes.filter(E=>E.value!==0);const h={};this.graph.nodes.forEach(E=>{const b=E.x0;E.category&&(h[b]=E?.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",E=>`translate(${E}, 0)`).append("text").attr("id",(E,b)=>this.services.domUtils.generateElementIDString(`alluvial-category-${b}`)).style("font-size","14px").text(E=>h[E]?h[E]:"").attr("y",20).attr("x",(E,b)=>{const x=this.services.domUtils.generateElementIDString(`alluvial-category-${b}`),{width:_}=k.getSVGElementSize(I(`text#${x}`),{useBBox:!0});let C=0;return E+C>=_&&(C=-_+4),C});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const E=y(this.getOptions(),"color","scale");E&&p.enter().append("linearGradient").attr("id",b=>`${this.gradient_id}-link-${b.index}`).attr("gradientUnits","userSpaceOnUse").call(b=>b.append("stop").attr("offset","0%").attr("stop-color",x=>E[x.source.name])).call(b=>b.append("stop").attr("offset","100%").attr("stop-color",x=>E[x.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",Dk()).attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-line-${E.index}`)).attr("class",E=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:E.source.index,originalClassName:"link"})).style("stroke",E=>o?`url(#${this.gradient_id}-link-${E.index})`:this.model.getFillColor(E.source.name,null,{...E,source:E.source.name,target:E.target.name})).attr("stroke-width",E=>Math.max(1,E.width)).style("stroke-opacity",Xe.opacity.default).attr("aria-label",E=>`${E.source.name} → ${E.target.name} (${E.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const g=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-${E.index}`)).classed("node-group",!0).attr("transform",E=>`translate(${E.x0}, ${E.y0})`);g.append("rect").classed("node",!0).attr("height",E=>E.y1-E.y0).attr("width",E=>E.x1-E.x0).attr("fill","black");const m=g.append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${E.index}`)),{code:v,number:S}=y(s,"locale");m.append("text").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${E.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(E=>`${E.name} (${S(E.value,v)})`).attr("aria-label",E=>`${E.name} (${E.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(E,b)=>{const x=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:_}=k.getSVGElementSize(I(`text#${x}`),{useBBox:!0});return _+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(E,b)=>{const x=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:_}=k.getSVGElementSize(I(`text#${x}`),{useBBox:!0}),C=(E.y1-E.y0)/2-9;let D=E.x1-E.x0;return E.x1>=_?D=D-(_+16):D+=4,`translate(${D}, ${C})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:i,code:r}=y(this.getOptions(),"locale"),s=Ya((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(I(a).lower(),l.style("stroke-opacity",Xe.opacity.default)):l.style("stroke-opacity",function(){return a===this?(I(this).raise(),Xe.opacity.selected):Xe.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=I(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(i(o.value,r)?`${i(o.value,r)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEMOVE,{event:a,element:I(this),datum:o}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=Ya((i=[],r="mouseover")=>{if(r==="mouseout"||i.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,a=>a.index).order().style("stroke-opacity",Xe.opacity.default);return}t.parent.selectAll("path.link").transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(a){return i.some(o=>o===a.index)?(I(this).classed("link-hovered",!0).raise(),Xe.opacity.selected):Xe.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(i,r){const s=I(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},r,a),t.traverse({link:"targetLinks",node:"source"},r,a),a.length){const o=us(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),r.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),u=t.parent.select(`g#${c}`),d=us(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${r.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOVER,{event:i,element:s,datum:r})}}).on("mousemove",function(i,r){t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEMOVE,{event:i,element:I(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(T.Alluvial.NODE_CLICK,{event:i,element:I(this),datum:r})}).on("mouseout",function(i,r){const s=I(this),a=us(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Xe.nodeWidth),r.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),c=t.parent.select(`g#${l}`),u=us(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${r.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,i=[]){n[t.link].map(s=>(i.push(s.index),s[t.node])).forEach(s=>this.traverse(t,s,i))}getRightArrowIcon(){return`
|
|
62
|
+
</li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const i=this.getOptions(),r=y(i,"tooltip","valueFormatter"),{code:s,number:a,date:o}=y(i,"locale");if(r)return r(t,n);if(this.isDate(t))return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),i=y(n,"tooltip","enabled");if(i){const r=I(this.services.domUtils.getHolder()),s=y(n,"style","prefix");this.tooltip=k.appendOrSelect(r,`div.${me}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!i&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,i){const r=Object.assign({},t);return n==Gt.LEFT?r.left-=i:n==Gt.RIGHT?r.left+=i:n==Gt.TOP?r.top-=i:n==Gt.BOTTOM&&(r.top+=i),r}positionTooltip(t){const n=this.services.domUtils.getHolder(),i=n.offsetWidth,r=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=y(a,"zoomBar","top","enabled"),l=!!y(t,"detail","noWrap"),c=Array.isArray(y(t,"detail","placements")),u=c?y(t,"detail","placements"):[Gt.RIGHT,Gt.LEFT,Gt.TOP,Gt.BOTTOM];let d,{horizontalOffset:h}=Gg;const{defaultOffset:f}=Gg;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=y(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:i,height:r}));let S=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));S=this.addOffsetByPlacement(S,d,f),this.positionService.setElement(s,S);return}let p=y(t,"detail","mousePosition");if(!p)p=Xn(y(t,"detail","event"),n);else{const m=y(a,"zoomBar","top","type"),v=we.height[m];o&&(p[1]+=v+we.spacerHeight)}p[0]/i>.9?d=Gt.LEFT:p[0]/i<.1?d=Gt.RIGHT:d=this.positionService.findBestPlacementAt({left:p[0],top:p[1]},s,u,()=>({top:void 0,left:void 0,width:i,height:r})),d===Gt.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:p[0]+h,top:p[1]},s,d);this.positionService.setElement(s,g)}}class mk extends kn{zoomIn(t,n,i){let r,s,a;const o=i||tr;t&&(r=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(${-r},${-s})`),this.services.events.dispatchEvent(_.CanvasZoom.CANVAS_ZOOM_IN,{element:I(t)})}zoomOut(t,n){const i=n||tr;t.transition().duration(i.duration).ease(i.ease).attr("transform",""),this.services.events.dispatchEvent(_.CanvasZoom.CANVAS_ZOOM_OUT)}}class vk extends kn{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 i;n?i=new CustomEvent(t,{detail:n}):(i=document.createEvent("Event"),i.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(i)}}class yk extends kn{constructor(t,n){super(t,n)}downloadCSV(t,n){const i=document.createElement("a"),r="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:r}),n);else if(URL&&"download"in i){const s=URL.createObjectURL(new Blob([t],{type:r}));i.href=s,i.setAttribute("download",n),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const i=document.createElement("a");i.download=n,i.href=t,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class As extends kn{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",i=>i.offset).style("stop-color",i=>i.color).style("stop-opacity",i=>i.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const i=t[0]<0&&t[1]>0;let r=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return i&&(r=[{offset:"0%",color:n,opacity:"0.6"},{offset:As.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),r}}class Ek extends kn{constructor(){super(...arguments),this.pendingTransitions={}}init(){this.services.events?.addEventListener(_.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:i}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||i===!1?t.duration(0):t.duration(y(Hg,n,"duration")||Hg.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Qe{constructor(t,n){this.components=[],this.services={canvasZoom:mk,domUtils:k,events:vk,files:yk,gradientUtils:As,transitions:Ek},this.model=new hn(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(i=>{const r=this.services[i];this.services[i]=new r(this.model,this.services)}),this.services.events.addEventListener(_.Model.UPDATE,i=>{const r=!!y(i,"detail","animate");this.update(r)}),this.model.setData(n.data),this.services.events.addEventListener(_.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(r=>{this.services[r].update()}),this.components.forEach(r=>r.render(t));const n=this.services.transitions.getPendingTransitions(),i=Object.keys(n).map(r=>n[r].end().catch(a=>a));Promise.all(i).then(()=>this.services.events.dispatchEvent(_.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 i=this.model.getOptions(),r=y(i,"toolbar","enabled"),s={id:"legend",components:[new vu(this.model,this.services)],growth:dt.PREFERRED},a=y(i,"canvasZoom","enabled");a&&a===!0&&t.push(new gk(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Ms(this.model,this.services)],growth:dt.STRETCH},c={id:"toolbar",components:[new or(this.model,this.services)],growth:dt.PREFERRED},u={id:"header",components:[new he(this.model,this.services,[l,...r?[c]:[]],{direction:At.ROW,alignItems:hi.CENTER})],growth:dt.PREFERRED},d={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:y(n,"graphFrameRenderType")||st.SVG},h=y(n,"excludeLegend")!==!0&&i.legend.enabled!==!1;let f=At.COLUMN;if(h){const v=y(i,"legend","position");v==="left"?(f=At.ROW,i.legend.orientation||(i.legend.orientation=Qi.VERTICAL)):v==="right"?(f=At.ROW_REVERSE,i.legend.orientation||(i.legend.orientation=Qi.VERTICAL)):v==="bottom"&&(f=At.COLUMN_REVERSE)}const p={id:"spacer",components:[new Pn(this.model,this.services)],growth:dt.PREFERRED},g={id:"full-frame",components:[new he(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:dt.STRETCH},m=[];if(o||r){m.push(u);const v={id:"spacer",components:[new Pn(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};m.push(v)}return m.push(g),[new yu(this.model,this.services),new fo(this.model,this.services),new he(this.model,this.services,m,{direction:At.COLUMN})]}}class vi extends hn{constructor(t){super(t),this.axisFlavor=ps.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),i=t.isDualAxes(),r={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return i&&(r.secondaryDomain=t.secondaryDomainAxisPosition,r.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(r).forEach(s=>{const a=r[s];t.scales[a]?r[s]={position:a,label:t.getScaleLabel(a),identifier:y(n,"axes",a,"mapsTo")}:r[s]=null}),r}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{primaryDomain:r,primaryRange:s,secondaryDomain:a,secondaryRange:o}=this.assignRangeAndDomains(),{number:l,code:c}=y(this.getOptions(),"locale"),u=["Group",r.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[i],h[r.identifier]===null?"–":h[r.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"–":l(h[s.identifier],c),...a?[h[a.identifier]===null?"–":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"–":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),y(this.getOptions(),"zoomBar",z.TOP,"enabled"))){const i=y(this.getOptions(),"zoomBar",z.TOP,"data");this.setZoomBarData(i)}return n}setZoomBarData(t){const n=t?this.sanitize(An(t)):this.getDisplayData();let i=n;const{cartesianScales:r}=this.services;if(n&&r.domainAxisPosition&&r.rangeAxisPosition){const s=r.getDomainIdentifier(),a=r.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=cs(o).sort(),i=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:i})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const i=[];return Object.keys(z).forEach(r=>{const s=z[r],a=n.axes[s];if(a&&a.scaleType===rt.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&i.push(o)}}),i.length>0&&t.forEach(r=>{i.forEach(s=>{y(r,s,"getTime")===null&&(r[s]=new Date(r[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}class xk extends vi{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const r=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"–":n(a.value,i)])];return super.formatTable({headers:r,cells:s})}}function jm(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function bk(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Eu(e,t){let n=0;if(t===void 0)for(let i of e)(i=+i)&&(n+=i);else{let i=-1;for(let r of e)(r=+t(r,++i,e))&&(n+=r)}return n}function Sk(e){return e.depth}function Tk(e,t){return t-1-e.height}function Km(e,t){return e.sourceLinks.length?e.depth:t-1}function go(e){return function(){return e}}function Qm(e,t){return mo(e.source,t.source)||e.index-t.index}function Jm(e,t){return mo(e.target,t.target)||e.index-t.index}function mo(e,t){return e.y0-t.y0}function xu(e){return e.value}function _k(e){return e.index}function Ok(e){return e.nodes}function wk(e){return e.links}function tv(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function ev({nodes:e}){for(const t of e){let n=t.y0,i=n;for(const r of t.sourceLinks)r.y0=n+r.width/2,n+=r.width;for(const r of t.targetLinks)r.y1=i+r.width/2,i+=r.width}}function Mk(){let e=0,t=0,n=1,i=1,r=24,s=8,a,o=_k,l=Km,c,u,d=Ok,h=wk,f=6;function p(){const O={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(O),m(O),v(O),S(O),x(O),ev(O),O}p.update=function(O){return ev(O),O},p.nodeId=function(O){return arguments.length?(o=typeof O=="function"?O:go(O),p):o},p.nodeAlign=function(O){return arguments.length?(l=typeof O=="function"?O:go(O),p):l},p.nodeSort=function(O){return arguments.length?(c=O,p):c},p.nodeWidth=function(O){return arguments.length?(r=+O,p):r},p.nodePadding=function(O){return arguments.length?(s=a=+O,p):s},p.nodes=function(O){return arguments.length?(d=typeof O=="function"?O:go(O),p):d},p.links=function(O){return arguments.length?(h=typeof O=="function"?O:go(O),p):h},p.linkSort=function(O){return arguments.length?(u=O,p):u},p.size=function(O){return arguments.length?(e=t=0,n=+O[0],i=+O[1],p):[n-e,i-t]},p.extent=function(O){return arguments.length?(e=+O[0][0],n=+O[1][0],t=+O[0][1],i=+O[1][1],p):[[e,t],[n,i]]},p.iterations=function(O){return arguments.length?(f=+O,p):f};function g({nodes:O,links:F}){for(const[R,B]of O.entries())B.index=R,B.sourceLinks=[],B.targetLinks=[];const U=new Map(O.map((R,B)=>[o(R,B,O),R]));for(const[R,B]of F.entries()){B.index=R;let{source:tt,target:Z}=B;typeof tt!="object"&&(tt=B.source=tv(U,tt)),typeof Z!="object"&&(Z=B.target=tv(U,Z)),tt.sourceLinks.push(B),Z.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:R,targetLinks:B}of O)R.sort(u),B.sort(u)}function m({nodes:O}){for(const F of O)F.value=F.fixedValue===void 0?Math.max(Eu(F.sourceLinks,xu),Eu(F.targetLinks,xu)):F.fixedValue}function v({nodes:O}){const F=O.length;let U=new Set(O),R=new Set,B=0;for(;U.size;){for(const tt of U){tt.depth=B;for(const{target:Z}of tt.sourceLinks)R.add(Z)}if(++B>F)throw new Error("circular link");U=R,R=new Set}}function S({nodes:O}){const F=O.length;let U=new Set(O),R=new Set,B=0;for(;U.size;){for(const tt of U){tt.height=B;for(const{source:Z}of tt.targetLinks)R.add(Z)}if(++B>F)throw new Error("circular link");U=R,R=new Set}}function E({nodes:O}){const F=jm(O,B=>B.depth)+1,U=(n-e-r)/(F-1),R=new Array(F);for(const B of O){const tt=Math.max(0,Math.min(F-1,Math.floor(l.call(null,B,F))));B.layer=tt,B.x0=e+tt*U,B.x1=B.x0+r,R[tt]?R[tt].push(B):R[tt]=[B]}if(c)for(const B of R)B.sort(c);return R}function b(O){const F=bk(O,U=>(i-t-(U.length-1)*a)/Eu(U,xu));for(const U of O){let R=t;for(const B of U){B.y0=R,B.y1=R+B.value*F,R=B.y1+a;for(const tt of B.sourceLinks)tt.width=tt.value*F}R=(i-R+a)/(U.length+1);for(let B=0;B<U.length;++B){const tt=U[B];tt.y0+=R*(B+1),tt.y1+=R*(B+1)}G(U)}}function x(O){const F=E(O);a=Math.min(s,(i-t)/(jm(F,U=>U.length)-1)),b(F);for(let U=0;U<f;++U){const R=Math.pow(.99,U),B=Math.max(1-R,(U+1)/f);C(F,R,B),T(F,R,B)}}function T(O,F,U){for(let R=1,B=O.length;R<B;++R){const tt=O[R];for(const Z of tt){let q=0,Q=0;for(const{source:et,value:K}of Z.targetLinks){let nt=K*(Z.layer-et.layer);q+=N(et,Z)*nt,Q+=nt}if(!(Q>0))continue;let ht=(q/Q-Z.y0)*F;Z.y0+=ht,Z.y1+=ht,w(Z)}c===void 0&&tt.sort(mo),D(tt,U)}}function C(O,F,U){for(let R=O.length,B=R-2;B>=0;--B){const tt=O[B];for(const Z of tt){let q=0,Q=0;for(const{target:et,value:K}of Z.sourceLinks){let nt=K*(et.layer-Z.layer);q+=A(Z,et)*nt,Q+=nt}if(!(Q>0))continue;let ht=(q/Q-Z.y0)*F;Z.y0+=ht,Z.y1+=ht,w(Z)}c===void 0&&tt.sort(mo),D(tt,U)}}function D(O,F){const U=O.length>>1,R=O[U];P(O,R.y0-a,U-1,F),$(O,R.y1+a,U+1,F),P(O,i,O.length-1,F),$(O,t,0,F)}function $(O,F,U,R){for(;U<O.length;++U){const B=O[U],tt=(F-B.y0)*R;tt>1e-6&&(B.y0+=tt,B.y1+=tt),F=B.y1+a}}function P(O,F,U,R){for(;U>=0;--U){const B=O[U],tt=(B.y1-F)*R;tt>1e-6&&(B.y0-=tt,B.y1-=tt),F=B.y0-a}}function w({sourceLinks:O,targetLinks:F}){if(u===void 0){for(const{source:{sourceLinks:U}}of F)U.sort(Jm);for(const{target:{targetLinks:U}}of O)U.sort(Qm)}}function G(O){if(u===void 0)for(const{sourceLinks:F,targetLinks:U}of O)F.sort(Jm),U.sort(Qm)}function N(O,F){let U=O.y0-(O.sourceLinks.length-1)*a/2;for(const{target:R,width:B}of O.sourceLinks){if(R===F)break;U+=B+a}for(const{source:R,width:B}of F.targetLinks){if(R===O)break;U-=B}return U}function A(O,F){let U=F.y0-(F.targetLinks.length-1)*a/2;for(const{source:R,width:B}of F.targetLinks){if(R===O)break;U+=B+a}for(const{target:R,width:B}of O.sourceLinks){if(R===F)break;U-=B}return U}return p}var bu=Math.PI,Su=2*bu,yi=1e-6,Ak=Su-yi;function Tu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function nv(){return new Tu}Tu.prototype=nv.prototype={constructor:Tu,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,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var s=this._x1,a=this._y1,o=n-e,l=i-t,c=s-e,u=a-t,d=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>yi)if(!(Math.abs(u*o-l*c)>yi)||!r)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,f=i-a,p=o*o+l*l,g=h*h+f*f,m=Math.sqrt(p),v=Math.sqrt(d),S=r*Math.tan((bu-Math.acos((p+d-g)/(2*m*v)))/2),E=S/v,b=S/m;Math.abs(E-1)>yi&&(this._+="L"+(e+E*c)+","+(t+E*u)),this._+="A"+r+","+r+",0,0,"+ +(u*h>c*f)+","+(this._x1=e+b*o)+","+(this._y1=t+b*l)}},arc:function(e,t,n,i,r,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(i),o=n*Math.sin(i),l=e+a,c=t+o,u=1^s,d=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>yi||Math.abs(this._y1-c)>yi)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%Su+Su),d>Ak?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>yi&&(this._+="A"+n+","+n+",0,"+ +(d>=bu)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};function iv(e){return function(){return e}}function Ck(e){return e[0]}function Dk(e){return e[1]}var Lk=Array.prototype.slice;function Rk(e){return e.source}function Ik(e){return e.target}function kk(e){var t=Rk,n=Ik,i=Ck,r=Dk,s=null;function a(){var o,l=Lk.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=nv()),e(s,+i.apply(this,(l[0]=c,l)),+r.apply(this,l),+i.apply(this,(l[0]=u,l)),+r.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?(i=typeof o=="function"?o:iv(+o),a):i},a.y=function(o){return arguments.length?(r=typeof o=="function"?o:iv(+o),a):r},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function Pk(e,t,n,i,r){e.moveTo(t,n),e.bezierCurveTo(t=(t+i)/2,n,t,r,i,r)}function Nk(){return kk(Pk)}function $k(e){return[e.source.x1,e.y0]}function Fk(e){return[e.target.x0,e.y1]}function Uk(){return Nk().source($k).target(Fk)}class Bk extends vt{constructor(){super(...arguments),this.type="alluvial",this.renderType=st.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"alluvial graphs",withinChartClip:!0});n.html("");const{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(this.getOptions(),"color","gradient","enabled");let l=Ke.minNodePadding;s.alluvial.nodePadding>Ke.minNodePadding&&(l=s.alluvial.nodePadding);const c=y(s,"alluvial","nodeAlignment");let u=Km;c===Vt.LEFT?u=Sk:c===Vt.RIGHT&&(u=Tk);const d=Mk().nodeId(E=>E.name).nodeWidth(Ke.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[i-2,r]]);this.graph=d({nodes:s.alluvial.nodes.map(E=>Object.assign({},E)),links:a.map(E=>Object.assign({},E))}),this.graph.nodes=this.graph.nodes.filter(E=>E.value!==0);const h={};this.graph.nodes.forEach(E=>{const b=E.x0;E.category&&(h[b]=E?.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",E=>`translate(${E}, 0)`).append("text").attr("id",(E,b)=>this.services.domUtils.generateElementIDString(`alluvial-category-${b}`)).style("font-size","14px").text(E=>h[E]?h[E]:"").attr("y",20).attr("x",(E,b)=>{const x=this.services.domUtils.generateElementIDString(`alluvial-category-${b}`),{width:T}=k.getSVGElementSize(I(`text#${x}`),{useBBox:!0});let C=0;return E+C>=T&&(C=-T+4),C});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const E=y(this.getOptions(),"color","scale");E&&p.enter().append("linearGradient").attr("id",b=>`${this.gradient_id}-link-${b.index}`).attr("gradientUnits","userSpaceOnUse").call(b=>b.append("stop").attr("offset","0%").attr("stop-color",x=>E[x.source.name])).call(b=>b.append("stop").attr("offset","100%").attr("stop-color",x=>E[x.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",Uk()).attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-line-${E.index}`)).attr("class",E=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:E.source.index,originalClassName:"link"})).style("stroke",E=>o?`url(#${this.gradient_id}-link-${E.index})`:this.model.getFillColor(E.source.name,null,{...E,source:E.source.name,target:E.target.name})).attr("stroke-width",E=>Math.max(1,E.width)).style("stroke-opacity",Ke.opacity.default).attr("aria-label",E=>`${E.source.name} → ${E.target.name} (${E.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const g=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-${E.index}`)).classed("node-group",!0).attr("transform",E=>`translate(${E.x0}, ${E.y0})`);g.append("rect").classed("node",!0).attr("height",E=>E.y1-E.y0).attr("width",E=>E.x1-E.x0).attr("fill","black");const m=g.append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${E.index}`)),{code:v,number:S}=y(s,"locale");m.append("text").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${E.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(E=>`${E.name} (${S(E.value,v)})`).attr("aria-label",E=>`${E.name} (${E.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(E,b)=>{const x=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:T}=k.getSVGElementSize(I(`text#${x}`),{useBBox:!0});return T+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(E,b)=>{const x=this.services.domUtils.generateElementIDString(`alluvial-node-text-${b}`),{width:T}=k.getSVGElementSize(I(`text#${x}`),{useBBox:!0}),C=(E.y1-E.y0)/2-9;let D=E.x1-E.x0;return E.x1>=T?D=D-(T+16):D+=4,`translate(${D}, ${C})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:i,code:r}=y(this.getOptions(),"locale"),s=ja((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(I(a).lower(),l.style("stroke-opacity",Ke.opacity.default)):l.style("stroke-opacity",function(){return a===this?(I(this).raise(),Ke.opacity.selected):Ke.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=I(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(_.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(_.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(i(o.value,r)?`${i(o.value,r)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(_.Alluvial.LINE_MOUSEMOVE,{event:a,element:I(this),datum:o}),n.services.events.dispatchEvent(_.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(_.Alluvial.LINE_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(_.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(_.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=ja((i=[],r="mouseover")=>{if(r==="mouseout"||i.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,a=>a.index).order().style("stroke-opacity",Ke.opacity.default);return}t.parent.selectAll("path.link").transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(a){return i.some(o=>o===a.index)?(I(this).classed("link-hovered",!0).raise(),Ke.opacity.selected):Ke.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(i,r){const s=I(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},r,a),t.traverse({link:"targetLinks",node:"source"},r,a),a.length){const o=gs(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),r.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),u=t.parent.select(`g#${c}`),d=gs(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${r.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(_.Alluvial.NODE_MOUSEOVER,{event:i,element:s,datum:r})}}).on("mousemove",function(i,r){t.services.events.dispatchEvent(_.Alluvial.NODE_MOUSEMOVE,{event:i,element:I(this),datum:r}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(_.Alluvial.NODE_CLICK,{event:i,element:I(this),datum:r})}).on("mouseout",function(i,r){const s=I(this),a=gs(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Ke.nodeWidth),r.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),c=t.parent.select(`g#${l}`),u=gs(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${r.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(_.Alluvial.NODE_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,i=[]){n[t.link].map(s=>(i.push(s.index),s[t.node])).forEach(s=>this.traverse(t,s,i))}getRightArrowIcon(){return`
|
|
63
63
|
<svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
|
|
64
64
|
<polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
|
|
65
65
|
<rect width="32" height="32"/>
|
|
66
|
-
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Rk extends Ze{constructor(t,n){super(t,n),this.model=new hk(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Lk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const or=class or extends vt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=st.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,i=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const r=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(r,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(r,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();i.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(i,this.frontSelectionSelector);if(d&&u===it.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=x=>{const _=x[1]-x[0];let C="0,"+_.toString();const D=Math.floor(l/or.DASH_LENGTH),$=D*or.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+or.DASH_LENGTH;C+=","+(l-$),D%2===1&&(C+=",0"),C+=","+_.toString(),C+=","+l.toString(),f.attr("stroke-dasharray",C)},m=x=>{const _=x.selection;_===null||_[0]===_[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(r.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(_))},v=(x,_)=>{const C=_f().range([0,o]).domain(p);let D=[C.invert(x),C.invert(_)],$="manual";D[0].valueOf()===D[1].valueOf()?(D=this.services.zoom.getDefaultZoomBarDomain(),$="reset"):$="manual",(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D,{dispatchEvent:!0,type:$})};let S;const E=x=>{const _=x.selection;_!==null&&(v(_[0],_[1]),s.call(S.move,null),f.style("display","none"))};l!=0&&o!=0&&(S=Gh().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();r.on("click",function(x){if(x.shiftKey){const _=this.services.domUtils.getHolder(),C=Yn(s.node(),_)[0];let D=C-o*b/2;D<0&&(D=0);let $=C+o*b/2;$>o&&($=o),v(D,$)}})}}};or.DASH_LENGTH=4;let Ou=or;class Ik extends vt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=st.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Gh(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),i=this.services.zoom.isZoomBarLoading(z.TOP),r=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=_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 d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1).attr("role","presentation");if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",_e.spacerHeight).attr("opacity",1).attr("fill","none"),s===qe.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===qe.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===it.TIME){let m=this.services.zoom.getZoomBarData();if(Ye(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const S=this.model.get("initialZoomDomain"),E=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(S&&S[0].valueOf()===E[0].valueOf()&&S[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:ut([],E),zoomDomain:E?ut([],E):v},{skipUpdate:!0}):E===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ut([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ue(m,_=>_.value));const b=this.model.get("zoomDomain");if(s===qe.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const _=a.highlightStartMapsTo,C=a.highlightEndMapsTo,D=a.color,$=a.labelMapsTo;a.data.forEach((P,w)=>{k.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(P[_])).attr("width",this.xScale(P[C])-this.xScale(P[_])).style("fill",D&&D.scale[P[$]]?D.scale[P[$]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[P[$]]?D.scale[P[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(b,c,l);const x=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(b!==void 0)if(b[0].valueOf()===b[1].valueOf())x.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const _=b.map(C=>this.xScale(C));_[1]-_[0]<this.MIN_SELECTION_DIFF||(x.call(this.brush.move,_),this.updateBrushHandle(this.getComponentContainer(),_))}r&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,i){const r=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=_e.height[s];this.brush.extent([[n,0],[i,a]]).on("start brush end",null).on("start brush end",r)}handleBrushedEvent(t,n,i,r){const s=[i.invert(r[0]),i.invert(r[1])];if(this.updateBrushHandle(this.getComponentContainer(),r),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){let a="manual";if(n&&n[0]&&n[1]){const l=this.services.zoom.getDefaultZoomBarDomain();s[0].valueOf()===l[0].valueOf()&&s[1].valueOf()===l[1].valueOf()?a="reset":a="manual"}(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1,type:a});let o;t.type==="start"?o=T.ZoomBar.SELECTION_START:t.type==="brush"?o=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(o=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s,type:a})),this.services.events.dispatchEvent(o,{selection:r,newDomain:s})}}updateBrushHandle(t,n){const i=this,r=_e.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=_e.height[s],o=-r/2,l=_e.handleBarWidth,c=s===qe.GRAPH_VIEW?_e.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-r)}).attr("y",0).attr("width",r).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,i.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,i.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===qe.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),i=_e.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",i/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,i,r){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,S,E)=>b=>s.getValueFromScale(v,S,E,b),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=y(this.getOptions(),"zoomBar",z.TOP,"type"),p=_e.height[f],g=Xl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=k.appendOrSelect(t,n).datum(i).attr("d",g);r&&m.attr("clip-path",`url(#${r})`)}updateClipPath(t,n,i,r,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",i).attr("y",r).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const i=Tn(t),r=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(i[0][r])){const a={};a[r]=n[0],a[s]=0,i.unshift(a)}if(Number(n[1])>Number(i[i.length-1][r])){const a={};a[r]=n[1],a[s]=0,i.push(a)}return i}renderZoomBarBaseline(t,n,i,r=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=_e.height[s],o=Wr()([[n,a],[i,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,i){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===qe.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class kk extends vt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=st.SVG,this.positionService=new ho}render(t=!1){const n=y(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&i.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f?.correspondingDatasets,mapsTo:f?.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,m=null;h===z.LEFT||h===z.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===it.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),D=N=>_.getDomainValue(N),$=N=>_.getRangeValue(N),[P,w]=Cn(D,$,C),H=I(this);h===z.TOP||h===z.BOTTOM?(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",b).attr("x1",({datum:N})=>P(N)+(v?f.step()/2:0)).attr("x2",({datum:N})=>P(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:N})=>-P(N)).attr("width",Math.abs(b-x)).classed("rotate",!0)):(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("x1",S).attr("x2",E).attr("y1",({datum:N})=>w(N)+(v?f.step()/2:0)).attr("y2",({datum:N})=>w(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:N})=>w(N)).attr("width",Math.abs(E-S)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:i}=t,r=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(i),{code:a,number:o}=y(r,"locale");if(s===it.TIME){const l=[z.LEFT,z.RIGHT].includes(i),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(r,"timeScale"),f=ru(d.ticks(),y(h,"timeInterval"));return iu(n,0,d.ticks(),f,h,r.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${pe}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const i=this.services.domUtils.getHolder(),r=Yn(t,i),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:r[0],top:r[1]},a,[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),l=this.positionService.findPositionAt({left:r[0],top:r[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const i={};return t.correspondingDatasets&&(i.group=y(t,"correspondingDatasets",0)),i[t.mapsTo]=n.value,i}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(i){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:i,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(i){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:i,hoveredElement:I(this),datum:I(this).datum()})})}}class Pk extends vt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=st.SVG,this.positionService=new ho,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&i.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(i,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,m]=f.range(),[v,S]=p.range(),{cartesianScales:E}=d.services,b=E.getOrientation(),x=P=>E.getDomainValue(P),_=P=>E.getRangeValue(P),[C,D]=Cn(x,_,b),$=I(this);h===z.TOP||h===z.BOTTOM?$.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("y",Math.max(S+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:P,...w})=>C(w[P])).attr("width",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(C(H[w])-C(H[P]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null):$.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:P,...w})=>D(w[P])).attr("height",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(D(H[P])-D(H[w]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null)})}}class Qm extends Eu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:r}=this.services,s=r.getDomainIdentifier(),a=r.isDualAxes(),{groupMapsTo:o}=i.data,l=r.getDomainLabel();let c=r.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=r.getRangeIdentifier(h);if(a){const g=r.getRangeAxisPosition({datum:h,groups:[h[o]]});c=r.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:Et(i,"locale.translations.group")||Et(i,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[r.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&y(i,"tooltip","showTotal")===!0)){const h=r.getRangeIdentifier(),f=y(i,"tooltip","customTotalCalculation");let p;f?p=f(n):p=n.reduce((g,m)=>g+m[h],0),d.push({label:Et(i,"tooltip.totalLabel")||Et(i,"locale.translations.total")||"Total",value:p,bold:!0})}return d}}function Ts(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Nk(e,t,n){const[i,r]=di(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function $k(e,t,n){const[i,r]=di(n?.in,e,t),s=Ts(i,r),a=Math.abs(Nk(i,r));i.setFullYear(1584),r.setFullYear(1584);const o=Ts(i,r)===-s,l=s*(a-+o);return l===0?0:l}function wu(e,t,n){const i=$t(e,n?.in);if(isNaN(t))return Pe(e,NaN);if(!t)return i;const r=i.getDate(),s=Pe(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Jm(e,t,n){return wu(e,t*12,n)}function Fk(e,t,n){return Jm(e,-t,n)}function Uk(e,t,n){const[i,r]=di(n?.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function Bk(e,t){const n=$t(e,t?.in);return n.setHours(23,59,59,999),n}function Hk(e,t){const n=$t(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function Gk(e,t){const n=$t(e,t?.in);return+Bk(n,t)==+Hk(n,t)}function Vk(e,t,n){const[i,r,s]=di(n?.in,e,e,t),a=Ts(r,s),o=Math.abs(Uk(r,s));if(o<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*o);let l=Ts(r,s)===-a;Gk(i)&&o===1&&Ts(i,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function zk(e,t,n){return wu(e,-t,n)}function Wk(e,t,n){const[i,r]=di(n?.in,e,t),s=tv(i,r),a=Math.abs(rm(i,r));i.setDate(i.getDate()-s*a);const o=+(tv(i,r)===-s),l=s*(a-o);return l===0?0:l}function tv(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function ev(e,t,n){const i=$t(e,n?.in);return isNaN(t)?Pe(e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Yk(e,t,n){return ev(e,-t,n)}function Mu(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function qk(e,t,n){const[i,r]=di(n?.in,e,t),s=(+i-+r)/zg;return Mu(n?.roundingMethod)(s)}function nv(e,t,n){return Pe(e,+$t(e)+t)}function iv(e,t,n){return nv(e,t*zg)}function Xk(e,t,n){return iv(e,-t)}function rv(e,t){return+$t(e)-+$t(t)}function sv(e,t,n){const i=rv(e,t)/Vg;return Mu(n?.roundingMethod)(i)}function Cu(e,t,n){const i=$t(e,n?.in);return i.setTime(i.getTime()+t*Vg),i}function av(e,t,n){return Cu(e,-t,n)}function ov(e,t,n){const i=rv(e,t)/1e3;return Mu(n?.roundingMethod)(i)}function Au(e,t,n){return nv(e,t*1e3)}function lv(e,t,n){return Au(e,-t)}class Zk extends Dn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,r=y(n,"axes",this.secondaryDomainAxisPosition),s=t[i];if(r?.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:r}=i.data,s=y(i,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[r]:n&&n.length>0&&(a=n[0]),s?.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const i=this.getAxisOptions(t).title;return i||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(n=>z[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){const t=this.model.getOptions(),n=y(t,"axes");(n[z.LEFT]?.correspondingDatasets&&n[z.RIGHT]||n[z.RIGHT]?.correspondingDatasets&&n[z.LEFT]||n[z.TOP]?.correspondingDatasets&&n[z.BOTTOM]||n[z.BOTTOM]?.correspondingDatasets&&n[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===it.LINEAR||this.scaleTypes[t]===it.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,i,r){const s=this.model.getOptions(),o=y(s,"axes")[i],{mapsTo:l}=o,c=y(r,l)!==null?r[l]:r;let u;switch(n){case it.LABELS:u=t(c)+t.step()/2;break;case it.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:t}),r=this.scales[i],s=this.model.getOptions(),o=y(s,"axes")[i],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[r(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),r(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const i=this.scaleTypes[t],r=this.scales[t];return this.getValueFromScale(r,i,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const i=this.model.getOptions(),r=y(i,"axes",t);if(r.scaleType===it.TIME){const s=y(i,"timeScale","addSpaceOnEdges");return jk(n,s)}else return Kk(n,Un.paddingRatio,r.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),i=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||i&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),i=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||i&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const i=this.model.getOptions(),r=y(i,"axes",t.primary),s=y(i,"axes",n.primary),a=r.scaleType||it.LINEAR,o=s.scaleType||it.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===it.LABELS||o===it.TIME)&&a===it.LABELS||a===it.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),i=y(n,"axes",t),r=y(n,"bounds"),{includeZero:s}=i,a=y(i,"scaleType")||it.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Wn(v,S=>S.length)]}else if(i.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),S=this.model.getStackKeys({bins:v});return[S[0].split(":")[0],S[S.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=i,{reference:h,compareTo:f}=Un.ratio;if(i.domain)return a===it.LABELS?i.domain:(a===it.TIME&&(i.domain=i.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,i.domain));if(u)return[0,100];if(i&&a===it.LABELS)return rs(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===it.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===it.TIME)g=o.map(v=>+new Date(v[c]));else if(r&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[r.upperBoundMapsTo]&&g.push(v[r.upperBoundMapsTo]),v[r.lowerBoundMapsTo]&&g.push(v[r.lowerBoundMapsTo])});else if(i.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,S=this.model.getDataValuesGroupedByKeys({groups:m}),E=o.filter(x=>!m.includes(x[v])),b=[];S.forEach(x=>{const{..._}=x;let C=0,D=0;Object.values(aL(_,"sharedStackKey")).forEach($=>{isNaN($)||($<0?D+=$:C+=$)}),b.push([D,C])}),g=[...gc(b),...E.map(x=>x[c])]}else g=[],o.forEach(v=>{const S=v[c];Array.isArray(S)&&S.length===2?(g.push(S[0]),g.push(S[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(S))});return a!==it.TIME&&a!==it.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const S=y(v,"value");S!==null&&g.push(S)}),p=Ue(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),i=y(n,"axes",t);if(!i)return null;const r=y(i,"scaleType")||it.LINEAR;this.scaleTypes[t]=r;let s;return r===it.TIME?s=_f():r===it.LOG?s=rf().base(i.base||10):r===it.LABELS||r===it.LABELS_RATIO?s=Li():s=Ve(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,i=0;return this.getOrientation()===Ht.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(i=n[0]),i}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getDomainScale(),s=i.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===it.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:r(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getRangeScale(),s=i.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:r(s.value)}}}function jk(e,t){const n=new Date(e[0]),i=new Date(e[1]);return $k(i,n)>1?[Fk(n,t),Jm(i,t)]:Vk(i,n)>1?[zk(n,t),wu(i,t)]:Wk(i,n)>1?[Yk(n,t),ev(i,t)]:qk(i,n)>1?[Xk(n,t),iv(i,t)]:sv(i,n)>30?[av(n,t*30),Cu(i,t*30)]:sv(i,n)>1?[av(n,t),Cu(i,t)]:ov(i,n)>15?[lv(n,t*15),Au(i,t*15)]:ov(i,n)>1?[lv(n,t),Au(i,t)]:[n,i]}function Kk([e,t],n,i){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(i===it.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class Qk extends Dn{constructor(){super(...arguments),this.curveTypes={curveLinear:Ca,curveLinearClosed:Nf,curveBasis:J_,curveBasisClosed:tT,curveBasisOpen:eT,curveBundle:nT,curveCardinal:iT,curveCardinalClosed:rT,curveCardinalOpen:sT,curveCatmullRom:aT,curveCatmullRomClosed:oT,curveCatmullRomOpen:lT,curveMonotoneX:cT,curveMonotoneY:uT,curveNatural:hT,curveStep:dT,curveStepAfter:pT,curveStepBefore:fT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let i=this.curveTypes[t];return n&&Object.keys(n).forEach(r=>{i[r]&&(i=i[r](n[r]))}),i}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Jk extends Dn{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===it.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const r=i.getMainXAxisPosition(),s=i.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",r,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!r)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(r,Ue(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0,type:"manual"}){this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&this.services.events?.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t,type:n.type})}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){const i=this.model.get("zoomDomain"),r=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&i){const a=r.stacked?"sharedStackKey":this.services.cartesianScales?.getDomainIdentifier(),o=t.filter(l=>new Date(l[a])>=i[0]&&new Date(l[a])<=i[1]);if(o.length>0)return o}return t}zoomIn(t=this.getZoomRatio()){const n=this.model.get("zoomDomain"),i=_e.handleWidth,r=this.services.cartesianScales?.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const s=r(n[0]),a=r(n[1]);if(a-s<i+1)return;const o=r.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-i/2,d=a-l/2+i/2);const h=[r.invert(u),r.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h,{dispatchEvent:!0,type:"in"})}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const r=i(n[0]),s=i(n[1]),a=i.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(r-o,a[0]),c=Math.min(s+o,a[1]),u=[i.invert(l),i.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u,{dispatchEvent:!0,type:"out"})}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n,{dispatchEvent:!0,type:"reset"})}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const i=t[1].valueOf()-t[0].valueOf(),r=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return i/r<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}class me extends Ze{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:Zk,curves:Qk,zoom:Jk}),this.model=new gi(this.services)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"zoomBar",z.TOP,"enabled"),s=y(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(i,"axes",a,"scaleType"),l=r&&a===z.BOTTOM&&o===it.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Ss(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new nr(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new ce(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:ci.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new yu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new Hm(this.model,this.services),new Ou(this.model,this.services)),t.push(new kk(this.model,this.services)),t.push(new Pk(this.model,this.services));const g={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:st.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Ct.COLUMN;if(m){const _=y(this.model.getOptions(),"legend","position");_===Zi.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=ji.VERTICAL)):_===Zi.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=ji.VERTICAL)):_===Zi.BOTTOM&&(v=Ct.COLUMN_REVERSE)}const S={id:"spacer",components:[new Ln(this.model,this.services)],growth:dt.PREFERRED},E={id:"full-frame",components:[new ce(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Ik(this.model,this.services)],growth:dt.PREFERRED,renderType:st.SVG},x=[];if(u||s){x.push(f);const _={id:"spacer",components:[new Ln(this.model,this.services,s?{size:15}:void 0)],growth:dt.PREFERRED};x.push(_)}return l&&x.push(b),x.push(E),[new Qm(this.model,this.services),new uo(this.model,this.services),new ce(this.model,this.services,x,{direction:Ct.COLUMN})]}}class we extends vt{constructor(){super(...arguments),this.type="grid",this.renderType=st.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),i=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),i&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,i=this.backdrop.attr("height"),r=this.services.cartesianScales.getMainXScale(),s=Ao(r).tickSizeInner(-i).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,i=this.backdrop.attr("width"),r=this.services.cartesianScales.getMainYScale(),s=Yu(r).tickSizeInner(-i).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Mn(u).tx)-Number(Mn(d).tx));let r=-1;if(!i.length)return;i.forEach(u=>{t[0]>=+Mn(u).tx&&r++});const s=r+1<i.length?r+1:i.length,a=i[r],o=i[s];let l;if(!a)l=+Mn(o).tx;else if(o)l=+Mn(o).tx-+Mn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Mn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),i=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=Mn(this),o={min:Number(a.tx)-i,max:Number(a.tx)+i};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const i=this.parent,r=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=r.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(i,"svg.chart-grid-backdrop").attr("role","presentation");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class cv extends vt{constructor(){super(...arguments),this.type="area",this.renderType=st.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",On.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),i=this.getOptions();let r=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Xl().curve(this.services.curves.getD3Curve()).defined(x=>{const _=s.getRangeIdentifier(),C=x[_];return C!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(i,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(x,_)=>{y(i,"axes",x,"includeZero")===!1&&_[0]>0&&_[1]>0&&(d=_[0])},f=x=>u?s.getBoundedScaledValues(x)[0]:s.getRangeValue(d),p=x=>u?s.getBoundedScaledValues(x)[1]:s.getRangeValue(x);a===Ht.VERTICAL?(r=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),r),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(r=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),r),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(i,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,x=>x.name),S=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const x=S.select(`path.${this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:l[0].name})}`).node();let _;if(x)_=getComputedStyle(x,null).getPropertyValue("stroke");else{const C=y(this.model.getOptions(),"color","scale");if(C!==null){const D=Object.keys(C);_=C[D[0]]}}_s.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:_s.getStops(r,_)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,b=v.enter().append("path");m?b.merge(v).style("fill",x=>`url(#${this.services.domUtils.generateElementIDString(`${x.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:x.name,originalClassName:"area"})).attr("d",x=>{const{data:_}=x;return o(_)}):(b.attr("opacity",0).merge(v).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:x.name,originalClassName:"area"})).style("fill",x=>E.model.getFillColor(x.name,null,x.data)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"area-update-enter",animate:t})).attr("opacity",u?1:On.opacity.selected).attr("d",x=>{const{data:_}=x;return o(_)}),u&&b.attr("fill-opacity",On.opacity.selected).style("stroke",x=>E.model.getStrokeColor(x.name,null,x.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class rr extends vt{constructor(){super(...arguments),this.type="line",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?wn.opacity.unselected:wn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",wn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,i=this.model.get("zoomDomain")!==void 0,r=n&&i?this.getComponentContainer({ariaLabel:"lines",withinChartClip:!1}):this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:s,curves:a}=this.services,o=v=>s.getDomainValue(v),l=v=>s.getRangeValue(v),[c,u]=Cn(o,l,s.getOrientation()),d=this.getOptions(),h=Wr().x(c).y(u).curve(a.getD3Curve()).defined(v=>{const S=s.getRangeIdentifier(v),E=v[S];return E!=null});let f=[];if(this.configs.stacked){const v=Object.keys(d.axes).some(b=>d.axes[b].percentage),{groupMapsTo:S}=d.data;f=this.model.getStackedData({groups:this.configs.groups,percentage:v}).map(b=>{const x=this.services.cartesianScales.getDomainIdentifier(b),_=this.services.cartesianScales.getRangeIdentifier(b);return{name:y(b,0,S),data:b.map(C=>({[x]:C.data.sharedStackKey,[S]:C[S],[_]:C[1]})),hidden:!lL(b,C=>C[0]!==C[1])}})}else f=this.model.getGroupedData(this.configs.groups);const p=r.selectAll("path.line").data(f,v=>v.name);p.exit().attr("opacity",0).remove();const m=p.enter().append("path").classed("line",!0).attr("opacity",0).merge(p).data(f,v=>v.name).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v.name,originalClassName:"line"})).style("stroke",v=>this.model.getStrokeColor(v.name,null,v.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",v=>{const{data:S}=v;return S.map(E=>{const b=this.services.cartesianScales.getRangeIdentifier(E);return E[b]}).join(",")});if(n&&i){const v=s.getMainXScale(),S=s.getMainYScale();if(v&&S){const[E,b]=v.range(),[x,_]=S.range();r.style("overflow","hidden").style("clip",`rect(${_}px, ${b}px, ${x}px, ${E}px)`)}}m.transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"line-update-enter",animate:t})).attr("opacity",v=>v.hidden?0:1).attr("d",v=>{const{data:S}=v;return h(S)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const uv=5;function t2(e,t){return e>t-uv&&e<t+uv}class Gn extends vt{constructor(){super(...arguments),this.type="ruler",this.renderType=st.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled"),i=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),r=n||i;this.drawBackdrop(),r&&!this.isEventListenerAdded?this.addBackdropEventListeners():!r&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,i]){const r=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?i:n,d=k.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=r.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>t2(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const S=m[0].domainValue,E=Math.abs(u-v.domainValue),b=Math.abs(u-S);return E>b||(E<b?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(b=>b.originalData).filter(b=>{const x=this.services.cartesianScales.getRangeIdentifier(b),_=b[x];return _!=null}),v=g.map(b=>b.domainValue),S=f.filter(b=>{const x=this.services.cartesianScales.getDomainValue(b);return v.includes(x)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Cg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,i],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let r=function(s){const a=Yn(s,t.parent.node());t.showRuler(s,a)};if(i.length>100){const s=i.length%50*12.5;r=gL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",r).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class cn extends vt{constructor(){super(...arguments),this.type="scatter",this.renderType=st.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"chart-holder-hover-scatter"})).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(r=>this.services.transitions?.setupTransition({transition:r,name:"legend-hover-scatter"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"legend-mouseout-scatter"})).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(t),r=this.model.get("zoomDomain");return r!==void 0?t.filter(s=>s[i].getTime()>=r[0].getTime()&&s[i].getTime()<=r[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const r=Object.keys(t.axes).some(s=>t.axes[s].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:r})}else{const{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=r.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(i)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const i=this.services.zoom?.isZoomBarEnabled()||!1,r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:i}),s=this.getOptions(),{groupMapsTo:a}=s.data,{cartesianScales:o}=this.services;if(!o)throw new Error("Services cartesianScales are undefined.");const l=o.getDomainIdentifier(),c=r.selectAll("circle.dot").data(this.getScatterData(),h=>`${h[a]}-${h[l]}`);c.exit().attr("opacity",0).remove();const d=c.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(c);this.styleCircles(d,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const r=i.getOrientation(),[s,a]=Cn(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),r),[o,l]=Cn(d=>i.getDomainValue(d),d=>i.getRangeValue(d),r),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const i=this.getOptions(),{filled:r,fillOpacity:s}=i.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Cn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,r)?[lt.FILL,lt.STROKE]:[lt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,r)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,r)}).transition().call(f=>this.services.transitions?.setupTransition({transition:f,name:"scatter-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",i.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,r))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",r?s:1).attr("opacity",h?0:1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data,i=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip");if(!this.parent)throw new Error("Parent not defined");const r=this.parent.selectAll("circle");i?r.style("pointer-events","none"):r.style("pointer-events",null),r.on("mouseover",function(s,a){const o=I(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{const c=t.services.cartesianScales?.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),i||t.services.events?.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,data:[a],additionalItems:t.getTooltipAdditionalItems(a)}),t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=I(this);t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events?.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);if(o.classed("hovered",!1),!t.configs.filled){const{filled:l}=t.getOptions().points,c=t.services.cartesianScales?.getDomainIdentifier(a),u=t.model.getIsFilled(a[n],a[c],a,l);o.classed("unfilled",!u).style("fill",d=>u||l?t.model.getFillColor(d[n],d[c],d):null)}t.services.events?.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent?.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class hv extends vt{constructor(t,n,i){super(t,n,i),this.type="axes",this.renderType=st.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,i=this.getOptions(),r=y(i,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===it.LABELS||this.scaleType===it.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Yu;break;case z.BOTTOM:h=Ao;break;case z.RIGHT:h=S0;break;case z.TOP:h=b0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(i,"axes",n),v=this.scaleType===it.TIME||m.scaleType===it.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!r){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(i,"data","loading"),_=y(m,"ticks","number"),C=y(m,"ticks","values"),D=y(m,"truncation","type"),$=y(m,"truncation","threshold"),P=y(m,"truncation","numCharacter"),w=_!==null,H=y(i,"timeScale"),N=k.appendOrSelect(g,"g.tick"),M=k.appendOrSelect(N,"text").text("0"),O=k.getSVGElementSize(M.node(),{useBBox:!0}).height;N.remove();const F=this.scaleType||m.scaleType||it.LINEAR,U=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=_:(K=Un.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,Un.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),U.ticks(K),v)if(!d.ticks(K).length)U.tickValues([]);else{const nt=y(i,"timeScale","addSpaceOnEdges"),ct=y(i,"axes",n,"domain"),W=d.copy();nt&&!ct&&W.nice(K);const j=W.ticks(K);nt&&j.length>2&&!ct&&(j.splice(j.length-1,1),j.splice(0,1)),U.tickValues(j)}}let R;const B=y(m,"ticks","formatter"),{code:tt,number:Z}=y(i,"locale");if(v){const K=ru(U.tickValues(),y(i,"timeScale","timeInterval"));B===null?R=(nt,ct)=>iu(nt,ct,U.tickValues(),K,H,i.locale):R=(nt,ct)=>{const W=iu(nt,ct,U.tickValues(),K,H,i.locale);return B(nt,ct,W)}}else B===null?F===it.LINEAR&&(R=K=>Z(K,tt)):R=B;U.tickFormat(R);const[Y,Q]=this.services.cartesianScales.getScaleByPosition(n).domain();let ht;if(C){if(v)C.forEach((K,nt)=>{K.getTime===void 0&&(C[nt]=new Date(K))}),ht=C.filter(K=>{const nt=K.getTime();return nt>=new Date(Y).getTime()&&nt<=new Date(Q).getTime()});else if(b===it.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();ht=C.filter(nt=>K.includes(nt))}else ht=C.filter(K=>K>=Y&&K<=Q);U.tickValues(ht)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(m.title){const K=k.appendOrSelect(l,"text.axis-title").html(et||x?"":ln(m.title)),nt=y(m,"titleOrientation");let ct;switch(n){case z.LEFT:nt===Za.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:const W=o-qg;K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${W})`);break;case z.RIGHT:nt===Za.LEFT?K.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ct=k.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ct/2})`).style("text-anchor","middle");break}}if(v){const K=ru(U.tickValues(),y(i,"timeScale","timeInterval")),nt=H.showDayName,ct=p;t&&(p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),p=p.call(U),ct.selectAll(".tick").data(U.tickValues(),d).order().select("text").attr("class",(j,J)=>fm(j,J,U.tickValues(),K,nt)?"tick-label--primary":"tick-label")}else!t||!f?p=p.call(U):p=p.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(U);if(g.call(U),n===z.BOTTOM||n===z.TOP){let K=!1;const nt=y(m,"ticks","rotation");if(nt===os.ALWAYS)K=!0;else if(nt===os.NEVER)K=!1;else if(!nt||nt===os.AUTO)if(d.step)K=g.selectAll("g.tick text").nodes().some(W=>k.getSVGElementSize(W,{useBBox:!0}).width>=d.step());else{K=!1;const ct=g.append("text").text("A"),W=k.getSVGElementSize(ct.node(),{useBBox:!0}).width;let j;g.selectAll("g.tick").each(function(){const J=I(this),L=parseFloat(y(Mn(this),"tx"));L!==null&&j+J.text().length*W*.8>=L&&(K=!0),j=L}),ct.remove()}K?(w||(U.ticks(this.getNumberOfFittingTicks(a,O,Un.ticks.horizontalSpaceRatio)),g.call(U),p.call(U)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(x?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",K=>K),g.selectAll("g.tick").attr("aria-label",K=>K),D!==Ie.NONE&&b===it.LABELS&&!C){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const ct=this;l.selectAll("g.tick text").data(K).text(function(W){return W.length>$?(ct.truncation[n]=!0,hs(W,D,P)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>$?hs(W,D,P):W}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=k.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=y(r,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;i.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===it.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===it.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===it.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,i){const r=Math.floor(t/(n*i));return Wp(r,2,Un.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 e2 extends hv{constructor(t,n,i){super(t,n,i)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,i=this.getComponentContainer({ariaLabel:"axes"}),r=k.appendOrSelect(i,`g.axis.${n}`),s=this;r.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("role","button").attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-Un.hover.rectanglePadding).attr("y",p).attr("width",u+Un.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=k.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=y(r,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===it.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===it.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class ve extends vt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=st.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},i=Object.keys(z),r=y(this.getOptions(),"axes");i.forEach(o=>{r[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,i.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===cs.DEFAULT?new hv(this.model,this.services,c):new e2(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=k.getSVGElementSize(u,{useBBox:!0});let f=0;if(!l.getTitleRef().empty()){const m=k.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height;c===z.LEFT||c===z.RIGHT?f=m+5:c===z.BOTTOM?f=m+qg:f=m}const p=d,g=h;switch(c){case z.TOP:s.top=g+f;break;case z.BOTTOM:s.bottom=g+f;break;case z.LEFT:s.left=p+f;break;case z.RIGHT:s.right=p+f;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class ue extends vt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Vt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Vt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Vt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Vt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Ve().domain([0,1]).range(t),this.yScale=Ve().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",i).attr("height",r);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),i=y(this.getOptions(),"grid","x","numberOfTicks"),r=this.xScale.ticks(i).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(r);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),r=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(r).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,i=!0){const r=this.parent,{width:s,height:a}=k.getSVGElementSize(r,{useAttrs:!0}),o=k.appendOrSelect(r,"svg.chart-skeleton").attr("width",s).attr("height",a).attr("role","presentation"),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=zr().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Lt.xOffset;c===Gt.CENTER?p=s/2:c===Gt.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=k.appendOrSelect(o,"defs").lower(),h=k.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
|
|
66
|
+
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Gk extends Qe{constructor(t,n){super(t,n),this.model=new xk(this.services),this.model.setOptions(kt(Ct.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Bk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const dr=class dr extends vt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=st.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,i=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const r=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(r,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(r,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();i.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(i,this.frontSelectionSelector);if(d&&u===rt.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=x=>{const T=x[1]-x[0];let C="0,"+T.toString();const D=Math.floor(l/dr.DASH_LENGTH),$=D*dr.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+dr.DASH_LENGTH;C+=","+(l-$),D%2===1&&(C+=",0"),C+=","+T.toString(),C+=","+l.toString(),f.attr("stroke-dasharray",C)},m=x=>{const T=x.selection;T===null||T[0]===T[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(r.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(T))},v=(x,T)=>{const C=Of().range([0,o]).domain(p);let D=[C.invert(x),C.invert(T)],$="manual";D[0].valueOf()===D[1].valueOf()?(D=this.services.zoom.getDefaultZoomBarDomain(),$="reset"):$="manual",(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D,{dispatchEvent:!0,type:$})};let S;const E=x=>{const T=x.selection;T!==null&&(v(T[0],T[1]),s.call(S.move,null),f.style("display","none"))};l!=0&&o!=0&&(S=zh().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();r.on("click",function(x){if(x.shiftKey){const T=this.services.domUtils.getHolder(),C=Xn(s.node(),T)[0];let D=C-o*b/2;D<0&&(D=0);let $=C+o*b/2;$>o&&($=o),v(D,$)}})}}};dr.DASH_LENGTH=4;let _u=dr;class Hk extends vt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=st.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=zh(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(_.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),i=this.services.zoom.isZoomBarLoading(z.TOP),r=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=we.height[s],{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1).attr("role","presentation");if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",we.spacerHeight).attr("opacity",1).attr("fill","none"),s===je.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===je.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===rt.TIME){let m=this.services.zoom.getZoomBarData();if(Ze(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const S=this.model.get("initialZoomDomain"),E=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(S&&S[0].valueOf()===E[0].valueOf()&&S[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:ut([],E),zoomDomain:E?ut([],E):v},{skipUpdate:!0}):E===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ut([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(He(m,T=>T.value));const b=this.model.get("zoomDomain");if(s===je.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const T=a.highlightStartMapsTo,C=a.highlightEndMapsTo,D=a.color,$=a.labelMapsTo;a.data.forEach((P,w)=>{k.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(P[T])).attr("width",this.xScale(P[C])-this.xScale(P[T])).style("fill",D&&D.scale[P[$]]?D.scale[P[$]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[P[$]]?D.scale[P[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(b,c,l);const x=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(b!==void 0)if(b[0].valueOf()===b[1].valueOf())x.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const T=b.map(C=>this.xScale(C));T[1]-T[0]<this.MIN_SELECTION_DIFF||(x.call(this.brush.move,T),this.updateBrushHandle(this.getComponentContainer(),T))}r&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,i){const r=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=we.height[s];this.brush.extent([[n,0],[i,a]]).on("start brush end",null).on("start brush end",r)}handleBrushedEvent(t,n,i,r){const s=[i.invert(r[0]),i.invert(r[1])];if(this.updateBrushHandle(this.getComponentContainer(),r),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){let a="manual";if(n&&n[0]&&n[1]){const l=this.services.zoom.getDefaultZoomBarDomain();s[0].valueOf()===l[0].valueOf()&&s[1].valueOf()===l[1].valueOf()?a="reset":a="manual"}(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1,type:a});let o;t.type==="start"?o=_.ZoomBar.SELECTION_START:t.type==="brush"?o=_.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(o=_.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(_.ZoomDomain.CHANGE,{newDomain:s,type:a})),this.services.events.dispatchEvent(o,{selection:r,newDomain:s})}}updateBrushHandle(t,n){const i=this,r=we.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=we.height[s],o=-r/2,l=we.handleBarWidth,c=s===je.GRAPH_VIEW?we.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-r)}).attr("y",0).attr("width",r).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,i.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,i.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===je.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),i=we.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",i/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,i,r){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,S,E)=>b=>s.getValueFromScale(v,S,E,b),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=y(this.getOptions(),"zoomBar",z.TOP,"type"),p=we.height[f],g=Xl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=k.appendOrSelect(t,n).datum(i).attr("d",g);r&&m.attr("clip-path",`url(#${r})`)}updateClipPath(t,n,i,r,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",i).attr("y",r).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const i=An(t),r=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(i[0][r])){const a={};a[r]=n[0],a[s]=0,i.unshift(a)}if(Number(n[1])>Number(i[i.length-1][r])){const a={};a[r]=n[1],a[s]=0,i.push(a)}return i}renderZoomBarBaseline(t,n,i,r=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=we.height[s],o=jr()([[n,a],[i,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,i){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===je.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(_.ZoomBar.UPDATE,this.render.bind(this))}}class Vk extends vt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=st.SVG,this.positionService=new po}render(t=!1){const n=y(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&i.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f?.correspondingDatasets,mapsTo:f?.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,m=null;h===z.LEFT||h===z.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===rt.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:T}=d.services,C=T.getOrientation(),D=N=>T.getDomainValue(N),$=N=>T.getRangeValue(N),[P,w]=Rn(D,$,C),G=I(this);h===z.TOP||h===z.BOTTOM?(G.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",b).attr("x1",({datum:N})=>P(N)+(v?f.step()/2:0)).attr("x2",({datum:N})=>P(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),G.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:N})=>-P(N)).attr("width",Math.abs(b-x)).classed("rotate",!0)):(G.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("x1",S).attr("x2",E).attr("y1",({datum:N})=>w(N)+(v?f.step()/2:0)).attr("y2",({datum:N})=>w(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),G.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:N})=>w(N)).attr("width",Math.abs(E-S)).classed("rotate",!1))}),this.services.events.addEventListener(_.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(_.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:i}=t,r=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(i),{code:a,number:o}=y(r,"locale");if(s===rt.TIME){const l=[z.LEFT,z.RIGHT].includes(i),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(r,"timeScale"),f=ru(d.ticks(),y(h,"timeInterval"));return iu(n,0,d.ticks(),f,h,r.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${me}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const i=this.services.domUtils.getHolder(),r=Xn(t,i),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(dn(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:r[0],top:r[1]},a,[Gt.RIGHT,Gt.LEFT,Gt.TOP,Gt.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),l=this.positionService.findPositionAt({left:r[0],top:r[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const i={};return t.correspondingDatasets&&(i.group=y(t,"correspondingDatasets",0)),i[t.mapsTo]=n.value,i}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(i){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(_.Threshold.SHOW,{event:i,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(i){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(_.Threshold.HIDE,{event:i,hoveredElement:I(this),datum:I(this).datum()})})}}class zk extends vt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=st.SVG,this.positionService=new po,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&i.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(i,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,m]=f.range(),[v,S]=p.range(),{cartesianScales:E}=d.services,b=E.getOrientation(),x=P=>E.getDomainValue(P),T=P=>E.getRangeValue(P),[C,D]=Rn(x,T,b),$=I(this);h===z.TOP||h===z.BOTTOM?$.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("y",Math.max(S+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:P,...w})=>C(w[P])).attr("width",({highlightStartMapsTo:P,highlightEndMapsTo:w,...G})=>Math.max(C(G[w])-C(G[P]),0)).style("stroke",({color:P,labelMapsTo:w,...G})=>P&&P.scale[G[w]]?P.scale[G[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...G})=>P&&P.scale[G[w]]?P.scale[G[w]]:null):$.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:P,...w})=>D(w[P])).attr("height",({highlightStartMapsTo:P,highlightEndMapsTo:w,...G})=>Math.max(D(G[P])-D(G[w]),0)).style("stroke",({color:P,labelMapsTo:w,...G})=>P&&P.scale[G[w]]?P.scale[G[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...G})=>P&&P.scale[G[w]]?P.scale[G[w]]:null)})}}class rv extends yu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:r}=this.services,s=r.getDomainIdentifier(),a=r.isDualAxes(),{groupMapsTo:o}=i.data,l=r.getDomainLabel();let c=r.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=r.getRangeIdentifier(h);if(a){const g=r.getRangeAxisPosition({datum:h,groups:[h[o]]});c=r.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:Et(i,"locale.translations.group")||Et(i,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[r.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&y(i,"tooltip","showTotal")===!0)){const h=r.getRangeIdentifier(),f=y(i,"tooltip","customTotalCalculation");let p;f?p=f(n):p=n.reduce((g,m)=>g+m[h],0),d.push({label:Et(i,"tooltip.totalLabel")||Et(i,"locale.translations.total")||"Total",value:p,bold:!0})}return d}}function Cs(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Wk(e,t,n){const[i,r]=pi(n?.in,e,t);return i.getFullYear()-r.getFullYear()}function Yk(e,t,n){const[i,r]=pi(n?.in,e,t),s=Cs(i,r),a=Math.abs(Wk(i,r));i.setFullYear(1584),r.setFullYear(1584);const o=Cs(i,r)===-s,l=s*(a-+o);return l===0?0:l}function Ou(e,t,n){const i=$t(e,n?.in);if(isNaN(t))return $e(e,NaN);if(!t)return i;const r=i.getDate(),s=$e(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function sv(e,t,n){return Ou(e,t*12,n)}function qk(e,t,n){return sv(e,-t,n)}function Xk(e,t,n){const[i,r]=pi(n?.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function Zk(e,t){const n=$t(e,t?.in);return n.setHours(23,59,59,999),n}function jk(e,t){const n=$t(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function Kk(e,t){const n=$t(e,t?.in);return+Zk(n,t)==+jk(n,t)}function Qk(e,t,n){const[i,r,s]=pi(n?.in,e,e,t),a=Cs(r,s),o=Math.abs(Xk(r,s));if(o<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*o);let l=Cs(r,s)===-a;Kk(i)&&o===1&&Cs(i,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function Jk(e,t,n){return Ou(e,-t,n)}function t2(e,t,n){const[i,r]=pi(n?.in,e,t),s=av(i,r),a=Math.abs(am(i,r));i.setDate(i.getDate()-s*a);const o=+(av(i,r)===-s),l=s*(a-o);return l===0?0:l}function av(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function ov(e,t,n){const i=$t(e,n?.in);return isNaN(t)?$e(e,NaN):(t&&i.setDate(i.getDate()+t),i)}function e2(e,t,n){return ov(e,-t,n)}function wu(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function n2(e,t,n){const[i,r]=pi(n?.in,e,t),s=(+i-+r)/Yg;return wu(n?.roundingMethod)(s)}function lv(e,t,n){return $e(e,+$t(e)+t)}function cv(e,t,n){return lv(e,t*Yg)}function i2(e,t,n){return cv(e,-t)}function uv(e,t){return+$t(e)-+$t(t)}function hv(e,t,n){const i=uv(e,t)/Wg;return wu(n?.roundingMethod)(i)}function Mu(e,t,n){const i=$t(e,n?.in);return i.setTime(i.getTime()+t*Wg),i}function dv(e,t,n){return Mu(e,-t,n)}function fv(e,t,n){const i=uv(e,t)/1e3;return wu(n?.roundingMethod)(i)}function Au(e,t,n){return lv(e,t*1e3)}function pv(e,t,n){return Au(e,-t)}class r2 extends kn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,r=y(n,"axes",this.secondaryDomainAxisPosition),s=t[i];if(r?.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:r}=i.data,s=y(i,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[r]:n&&n.length>0&&(a=n[0]),s?.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const i=this.getAxisOptions(t).title;return i||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(n=>z[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){const t=this.model.getOptions(),n=y(t,"axes");(n[z.LEFT]?.correspondingDatasets&&n[z.RIGHT]||n[z.RIGHT]?.correspondingDatasets&&n[z.LEFT]||n[z.TOP]?.correspondingDatasets&&n[z.BOTTOM]||n[z.BOTTOM]?.correspondingDatasets&&n[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===rt.LINEAR||this.scaleTypes[t]===rt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,i,r){const s=this.model.getOptions(),o=y(s,"axes")[i],{mapsTo:l}=o,c=y(r,l)!==null?r[l]:r;let u;switch(n){case rt.LABELS:u=t(c)+t.step()/2;break;case rt.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:t}),r=this.scales[i],s=this.model.getOptions(),o=y(s,"axes")[i],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[r(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),r(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const i=this.scaleTypes[t],r=this.scales[t];return this.getValueFromScale(r,i,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const i=this.model.getOptions(),r=y(i,"axes",t);if(r.scaleType===rt.TIME){const s=y(i,"timeScale","addSpaceOnEdges");return s2(n,s)}else return a2(n,Gn.paddingRatio,r.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),i=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||i&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),i=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||i&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const i=this.model.getOptions(),r=y(i,"axes",t.primary),s=y(i,"axes",n.primary),a=r.scaleType||rt.LINEAR,o=s.scaleType||rt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===rt.LABELS||o===rt.TIME)&&a===rt.LABELS||a===rt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),i=y(n,"axes",t),r=y(n,"bounds"),{includeZero:s}=i,a=y(i,"scaleType")||rt.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:v}=this.model.getBinConfigurations();return[0,qn(v,S=>S.length)]}else if(i.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),S=this.model.getStackKeys({bins:v});return[S[0].split(":")[0],S[S.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=i,{reference:h,compareTo:f}=Gn.ratio;if(i.domain)return a===rt.LABELS?i.domain:(a===rt.TIME&&(i.domain=i.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,i.domain));if(u)return[0,100];if(i&&a===rt.LABELS)return cs(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===rt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===rt.TIME)g=o.map(v=>+new Date(v[c]));else if(r&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[r.upperBoundMapsTo]&&g.push(v[r.upperBoundMapsTo]),v[r.lowerBoundMapsTo]&&g.push(v[r.lowerBoundMapsTo])});else if(i.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,S=this.model.getDataValuesGroupedByKeys({groups:m}),E=o.filter(x=>!m.includes(x[v])),b=[];S.forEach(x=>{const{...T}=x;let C=0,D=0;Object.values(dL(T,"sharedStackKey")).forEach($=>{isNaN($)||($<0?D+=$:C+=$)}),b.push([D,C])}),g=[...gc(b),...E.map(x=>x[c])]}else g=[],o.forEach(v=>{const S=v[c];Array.isArray(S)&&S.length===2?(g.push(S[0]),g.push(S[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(S))});return a!==rt.TIME&&a!==rt.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const S=y(v,"value");S!==null&&g.push(S)}),p=He(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),i=y(n,"axes",t);if(!i)return null;const r=y(i,"scaleType")||rt.LINEAR;this.scaleTypes[t]=r;let s;return r===rt.TIME?s=Of():r===rt.LOG?s=af().base(i.base||10):r===rt.LABELS||r===rt.LABELS_RATIO?s=Ii():s=Ye(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,i=0;return this.getOrientation()===Ht.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(i=n[0]),i}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getDomainScale(),s=i.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===rt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:r(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getRangeScale(),s=i.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:r(s.value)}}}function s2(e,t){const n=new Date(e[0]),i=new Date(e[1]);return Yk(i,n)>1?[qk(n,t),sv(i,t)]:Qk(i,n)>1?[Jk(n,t),Ou(i,t)]:t2(i,n)>1?[e2(n,t),ov(i,t)]:n2(i,n)>1?[i2(n,t),cv(i,t)]:hv(i,n)>30?[dv(n,t*30),Mu(i,t*30)]:hv(i,n)>1?[dv(n,t),Mu(i,t)]:fv(i,n)>15?[pv(n,t*15),Au(i,t*15)]:fv(i,n)>1?[pv(n,t),Au(i,t)]:[n,i]}function a2([e,t],n,i){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(i===rt.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class o2 extends kn{constructor(){super(...arguments),this.curveTypes={curveLinear:Ra,curveLinearClosed:Ff,curveBasis:s_,curveBasisClosed:a_,curveBasisOpen:o_,curveBundle:l_,curveCardinal:c_,curveCardinalClosed:u_,curveCardinalOpen:h_,curveCatmullRom:d_,curveCatmullRomClosed:f_,curveCatmullRomOpen:p_,curveMonotoneX:g_,curveMonotoneY:m_,curveNatural:v_,curveStep:y_,curveStepAfter:x_,curveStepBefore:E_}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let i=this.curveTypes[t];return n&&Object.keys(n).forEach(r=>{i[r]&&(i=i[r](n[r]))}),i}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class l2 extends kn{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===rt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const r=i.getMainXAxisPosition(),s=i.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",r,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!r)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(r,He(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0,type:"manual"}){this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&this.services.events?.dispatchEvent(_.ZoomDomain.CHANGE,{newDomain:t,type:n.type})}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){const i=this.model.get("zoomDomain"),r=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&i){const a=r.stacked?"sharedStackKey":this.services.cartesianScales?.getDomainIdentifier(),o=t.filter(l=>new Date(l[a])>=i[0]&&new Date(l[a])<=i[1]);if(o.length>0)return o}return t}zoomIn(t=this.getZoomRatio()){const n=this.model.get("zoomDomain"),i=we.handleWidth,r=this.services.cartesianScales?.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const s=r(n[0]),a=r(n[1]);if(a-s<i+1)return;const o=r.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-i/2,d=a-l/2+i/2);const h=[r.invert(u),r.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h,{dispatchEvent:!0,type:"in"})}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const r=i(n[0]),s=i(n[1]),a=i.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(r-o,a[0]),c=Math.min(s+o,a[1]),u=[i.invert(l),i.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u,{dispatchEvent:!0,type:"out"})}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n,{dispatchEvent:!0,type:"reset"})}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const i=t[1].valueOf()-t[0].valueOf(),r=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return i/r<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}class Ee extends Qe{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:r2,curves:o2,zoom:l2}),this.model=new vi(this.services)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"zoomBar",z.TOP,"enabled"),s=y(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(i,"axes",a,"scaleType"),l=r&&a===z.BOTTOM&&o===rt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Ms(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new or(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new he(this.model,this.services,[d,...s?[h]:[]],{direction:At.ROW,alignItems:hi.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new vu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new qm(this.model,this.services),new _u(this.model,this.services)),t.push(new Vk(this.model,this.services)),t.push(new zk(this.model,this.services));const g={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:st.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=At.COLUMN;if(m){const T=y(this.model.getOptions(),"legend","position");T===Ki.LEFT?(v=At.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Qi.VERTICAL)):T===Ki.RIGHT?(v=At.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Qi.VERTICAL)):T===Ki.BOTTOM&&(v=At.COLUMN_REVERSE)}const S={id:"spacer",components:[new Pn(this.model,this.services)],growth:dt.PREFERRED},E={id:"full-frame",components:[new he(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Hk(this.model,this.services)],growth:dt.PREFERRED,renderType:st.SVG},x=[];if(u||s){x.push(f);const T={id:"spacer",components:[new Pn(this.model,this.services,s?{size:15}:void 0)],growth:dt.PREFERRED};x.push(T)}return l&&x.push(b),x.push(E),[new rv(this.model,this.services),new fo(this.model,this.services),new he(this.model,this.services,x,{direction:At.COLUMN})]}}class Ae extends vt{constructor(){super(...arguments),this.type="grid",this.renderType=st.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),i=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),i&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,i=this.backdrop.attr("height"),r=this.services.cartesianScales.getMainXScale(),s=Co(r).tickSizeInner(-i).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,i=this.backdrop.attr("width"),r=this.services.cartesianScales.getMainYScale(),s=Xu(r).tickSizeInner(-i).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Ln(u).tx)-Number(Ln(d).tx));let r=-1;if(!i.length)return;i.forEach(u=>{t[0]>=+Ln(u).tx&&r++});const s=r+1<i.length?r+1:i.length,a=i[r],o=i[s];let l;if(!a)l=+Ln(o).tx;else if(o)l=+Ln(o).tx-+Ln(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Ln(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),i=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=Ln(this),o={min:Number(a.tx)-i,max:Number(a.tx)+i};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const i=this.parent,r=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=r.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(i,"svg.chart-grid-backdrop").attr("role","presentation");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class gv extends vt{constructor(){super(...arguments),this.type="area",this.renderType=st.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?Cn.opacity.unselected:Cn.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",Cn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),i=this.getOptions();let r=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Xl().curve(this.services.curves.getD3Curve()).defined(x=>{const T=s.getRangeIdentifier(),C=x[T];return C!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(i,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(x,T)=>{y(i,"axes",x,"includeZero")===!1&&T[0]>0&&T[1]>0&&(d=T[0])},f=x=>u?s.getBoundedScaledValues(x)[0]:s.getRangeValue(d),p=x=>u?s.getBoundedScaledValues(x)[1]:s.getRangeValue(x);a===Ht.VERTICAL?(r=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),r),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(r=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),r),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(i,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,x=>x.name),S=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const x=S.select(`path.${this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:l[0].name})}`).node();let T;if(x)T=getComputedStyle(x,null).getPropertyValue("stroke");else{const C=y(this.model.getOptions(),"color","scale");if(C!==null){const D=Object.keys(C);T=C[D[0]]}}As.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:As.getStops(r,T)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,b=v.enter().append("path");m?b.merge(v).style("fill",x=>`url(#${this.services.domUtils.generateElementIDString(`${x.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:x.name,originalClassName:"area"})).attr("d",x=>{const{data:T}=x;return o(T)}):(b.attr("opacity",0).merge(v).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:x.name,originalClassName:"area"})).style("fill",x=>E.model.getFillColor(x.name,null,x.data)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"area-update-enter",animate:t})).attr("opacity",u?1:Cn.opacity.selected).attr("d",x=>{const{data:T}=x;return o(T)}),u&&b.attr("fill-opacity",Cn.opacity.selected).style("stroke",x=>E.model.getStrokeColor(x.name,null,x.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class cr extends vt{constructor(){super(...arguments),this.type="line",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?Dn.opacity.unselected:Dn.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",Dn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,i=this.model.get("zoomDomain")!==void 0,r=n&&i?this.getComponentContainer({ariaLabel:"lines",withinChartClip:!1}):this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:s,curves:a}=this.services,o=v=>s.getDomainValue(v),l=v=>s.getRangeValue(v),[c,u]=Rn(o,l,s.getOrientation()),d=this.getOptions(),h=jr().x(c).y(u).curve(a.getD3Curve()).defined(v=>{const S=s.getRangeIdentifier(v),E=v[S];return E!=null});let f=[];if(this.configs.stacked){const v=Object.keys(d.axes).some(b=>d.axes[b].percentage),{groupMapsTo:S}=d.data;f=this.model.getStackedData({groups:this.configs.groups,percentage:v}).map(b=>{const x=this.services.cartesianScales.getDomainIdentifier(b),T=this.services.cartesianScales.getRangeIdentifier(b);return{name:y(b,0,S),data:b.map(C=>({[x]:C.data.sharedStackKey,[S]:C[S],[T]:C[1]})),hidden:!pL(b,C=>C[0]!==C[1])}})}else f=this.model.getGroupedData(this.configs.groups);const p=r.selectAll("path.line").data(f,v=>v.name);p.exit().attr("opacity",0).remove();const m=p.enter().append("path").classed("line",!0).attr("opacity",0).merge(p).data(f,v=>v.name).attr("class",v=>this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:v.name,originalClassName:"line"})).style("stroke",v=>this.model.getStrokeColor(v.name,null,v.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",v=>{const{data:S}=v;return S.map(E=>{const b=this.services.cartesianScales.getRangeIdentifier(E);return E[b]}).join(",")});if(n&&i){const v=s.getMainXScale(),S=s.getMainYScale();if(v&&S){const[E,b]=v.range(),[x,T]=S.range();r.style("overflow","hidden").style("clip",`rect(${T}px, ${b}px, ${x}px, ${E}px)`)}}m.transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"line-update-enter",animate:t})).attr("opacity",v=>v.hidden?0:1).attr("d",v=>{const{data:S}=v;return h(S)})}destroy(){const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const mv=5;function c2(e,t){return e>t-mv&&e<t+mv}class zn extends vt{constructor(){super(...arguments),this.type="ruler",this.renderType=st.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled"),i=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),r=n||i;this.drawBackdrop(),r&&!this.isEventListenerAdded?this.addBackdropEventListeners():!r&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,i]){const r=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?i:n,d=k.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=r.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>c2(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(_.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const S=m[0].domainValue,E=Math.abs(u-v.domainValue),b=Math.abs(u-S);return E>b||(E<b?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(b=>b.originalData).filter(b=>{const x=this.services.cartesianScales.getRangeIdentifier(b),T=b[x];return T!=null}),v=g.map(b=>b.domainValue),S=f.filter(b=>{const x=this.services.cartesianScales.getDomainValue(b);return v.includes(x)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Dg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(_.Tooltip.SHOW,{event:t,mousePosition:[n,i],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(_.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let r=function(s){const a=Xn(s,t.parent.node());t.showRuler(s,a)};if(i.length>100){const s=i.length%50*12.5;r=bL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",r).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class fn extends vt{constructor(){super(...arguments),this.type="scatter",this.renderType=st.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"chart-holder-hover-scatter"})).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(r=>this.services.transitions?.setupTransition({transition:r,name:"legend-hover-scatter"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>this.services.transitions?.setupTransition({transition:t,name:"legend-mouseout-scatter"})).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(_.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(_.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(t),r=this.model.get("zoomDomain");return r!==void 0?t.filter(s=>s[i].getTime()>=r[0].getTime()&&s[i].getTime()<=r[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const r=Object.keys(t.axes).some(s=>t.axes[s].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:r})}else{const{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=r.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(i)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const i=this.services.zoom?.isZoomBarEnabled()||!1,r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:i}),s=this.getOptions(),{groupMapsTo:a}=s.data,{cartesianScales:o}=this.services;if(!o)throw new Error("Services cartesianScales are undefined.");const l=o.getDomainIdentifier(),c=r.selectAll("circle.dot").data(this.getScatterData(),h=>`${h[a]}-${h[l]}`);c.exit().attr("opacity",0).remove();const d=c.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(c);this.styleCircles(d,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const r=i.getOrientation(),[s,a]=Rn(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),r),[o,l]=Rn(d=>i.getDomainValue(d),d=>i.getRangeValue(d),r),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const i=this.getOptions(),{filled:r,fillOpacity:s}=i.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Rn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,r)?[ot.FILL,ot.STROKE]:[ot.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,r)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,r)}).transition().call(f=>this.services.transitions?.setupTransition({transition:f,name:"scatter-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",i.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,r))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",r?s:1).attr("opacity",h?0:1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data,i=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip");if(!this.parent)throw new Error("Parent not defined");const r=this.parent.selectAll("circle");i?r.style("pointer-events","none"):r.style("pointer-events",null),r.on("mouseover",function(s,a){const o=I(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{const c=t.services.cartesianScales?.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),i||t.services.events?.dispatchEvent(_.Tooltip.SHOW,{event:s,hoveredElement:o,data:[a],additionalItems:t.getTooltipAdditionalItems(a)}),t.services.events?.dispatchEvent(_.Scatter.SCATTER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=I(this);t.services.events?.dispatchEvent(_.Scatter.SCATTER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(_.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events?.dispatchEvent(_.Scatter.SCATTER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);if(o.classed("hovered",!1),!t.configs.filled){const{filled:l}=t.getOptions().points,c=t.services.cartesianScales?.getDomainIdentifier(a),u=t.model.getIsFilled(a[n],a[c],a,l);o.classed("unfilled",!u).style("fill",d=>u||l?t.model.getFillColor(d[n],d[c],d):null)}t.services.events?.dispatchEvent(_.Scatter.SCATTER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events?.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent?.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(_.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(_.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class vv extends vt{constructor(t,n,i){super(t,n,i),this.type="axes",this.renderType=st.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,i=this.getOptions(),r=y(i,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===rt.LABELS||this.scaleType===rt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Xu;break;case z.BOTTOM:h=Co;break;case z.RIGHT:h=A0;break;case z.TOP:h=M0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(i,"axes",n),v=this.scaleType===rt.TIME||m.scaleType===rt.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!r){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(i,"data","loading"),T=y(m,"ticks","number"),C=y(m,"ticks","values"),D=y(m,"truncation","type"),$=y(m,"truncation","threshold"),P=y(m,"truncation","numCharacter"),w=T!==null,G=y(i,"timeScale"),N=k.appendOrSelect(g,"g.tick"),A=k.appendOrSelect(N,"text").text("0"),O=k.getSVGElementSize(A.node(),{useBBox:!0}).height;N.remove();const F=this.scaleType||m.scaleType||rt.LINEAR,U=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=T:(K=Gn.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,Gn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),U.ticks(K),v)if(!d.ticks(K).length)U.tickValues([]);else{const nt=y(i,"timeScale","addSpaceOnEdges"),lt=y(i,"axes",n,"domain"),Y=d.copy();nt&&!lt&&Y.nice(K);const j=Y.ticks(K);nt&&j.length>2&&!lt&&(j.splice(j.length-1,1),j.splice(0,1)),U.tickValues(j)}}let R;const B=y(m,"ticks","formatter"),{code:tt,number:Z}=y(i,"locale");if(v){const K=ru(U.tickValues(),y(i,"timeScale","timeInterval"));B===null?R=(nt,lt)=>iu(nt,lt,U.tickValues(),K,G,i.locale):R=(nt,lt)=>{const Y=iu(nt,lt,U.tickValues(),K,G,i.locale);return B(nt,lt,Y)}}else B===null?F===rt.LINEAR&&(R=K=>Z(K,tt)):R=B;U.tickFormat(R);const[q,Q]=this.services.cartesianScales.getScaleByPosition(n).domain();let ht;if(C){if(v)C.forEach((K,nt)=>{K.getTime===void 0&&(C[nt]=new Date(K))}),ht=C.filter(K=>{const nt=K.getTime();return nt>=new Date(q).getTime()&&nt<=new Date(Q).getTime()});else if(b===rt.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();ht=C.filter(nt=>K.includes(nt))}else ht=C.filter(K=>K>=q&&K<=Q);U.tickValues(ht)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(m.title){const K=k.appendOrSelect(l,"text.axis-title").html(et||x?"":dn(m.title)),nt=y(m,"titleOrientation");let lt;switch(n){case z.LEFT:nt===Ja.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:const Y=o-Zg;K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${Y})`);break;case z.RIGHT:nt===Ja.LEFT?K.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:lt=k.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${lt/2})`).style("text-anchor","middle");break}}if(v){const K=ru(U.tickValues(),y(i,"timeScale","timeInterval")),nt=G.showDayName,lt=p;t&&(p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),p=p.call(U),lt.selectAll(".tick").data(U.tickValues(),d).order().select("text").attr("class",(j,J)=>gm(j,J,U.tickValues(),K,nt)?"tick-label--primary":"tick-label")}else!t||!f?p=p.call(U):p=p.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(U);if(g.call(U),n===z.BOTTOM||n===z.TOP){let K=!1;const nt=y(m,"ticks","rotation");if(nt===ds.ALWAYS)K=!0;else if(nt===ds.NEVER)K=!1;else if(!nt||nt===ds.AUTO)if(d.step)K=g.selectAll("g.tick text").nodes().some(Y=>k.getSVGElementSize(Y,{useBBox:!0}).width>=d.step());else{K=!1;const lt=g.append("text").text("A"),Y=k.getSVGElementSize(lt.node(),{useBBox:!0}).width;let j;g.selectAll("g.tick").each(function(){const J=I(this),L=parseFloat(y(Ln(this),"tx"));L!==null&&j+J.text().length*Y*.8>=L&&(K=!0),j=L}),lt.remove()}K?(w||(U.ticks(this.getNumberOfFittingTicks(a,O,Gn.ticks.horizontalSpaceRatio)),g.call(U),p.call(U)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(x?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",K=>K),g.selectAll("g.tick").attr("aria-label",K=>K),D!==Pe.NONE&&b===rt.LABELS&&!C){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const lt=this;l.selectAll("g.tick text").data(K).text(function(Y){return Y.length>$?(lt.truncation[n]=!0,ms(Y,D,P)):Y}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(Y){return Y.length>$?ms(Y,D,P):Y}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=k.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=y(r,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;i.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(_.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(_.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(_.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(_.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(_.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(_.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===rt.LABELS&&l.services.events.dispatchEvent(_.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,i){const r=Math.floor(t/(n*i));return qp(r,2,Gn.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 u2 extends vv{constructor(t,n,i){super(t,n,i)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,i=this.getComponentContainer({ariaLabel:"axes"}),r=k.appendOrSelect(i,`g.axis.${n}`),s=this;r.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("role","button").attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-Gn.hover.rectanglePadding).attr("y",p).attr("width",u+Gn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=k.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=y(r,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(_.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===rt.LABELS&&d.length>o&&l.services.events.dispatchEvent(_.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(_.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(_.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(_.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(_.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===rt.LABELS&&l.services.events.dispatchEvent(_.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(_.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(_.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(_.Tooltip.HIDE),l.services.events.dispatchEvent(_.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class xe extends vt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=st.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},i=Object.keys(z),r=y(this.getOptions(),"axes");i.forEach(o=>{r[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,i.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===ps.DEFAULT?new vv(this.model,this.services,c):new u2(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=k.getSVGElementSize(u,{useBBox:!0});let f=0;if(!l.getTitleRef().empty()){const m=k.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height;c===z.LEFT||c===z.RIGHT?f=m+5:c===z.BOTTOM?f=m+Zg:f=m}const p=d,g=h;switch(c){case z.TOP:s.top=g+f;break;case z.BOTTOM:s.bottom=g+f;break;case z.LEFT:s.left=p+f;break;case z.RIGHT:s.right=p+f;break}}),this.services.events.dispatchEvent(_.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(_.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class de extends vt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===zt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===zt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===zt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===zt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Ye().domain([0,1]).range(t),this.yScale=Ye().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",i).attr("height",r);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),i=y(this.getOptions(),"grid","x","numberOfTicks"),r=this.xScale.ticks(i).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(r);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),r=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(r).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,i=!0){const r=this.parent,{width:s,height:a}=k.getSVGElementSize(r,{useAttrs:!0}),o=k.appendOrSelect(r,"svg.chart-skeleton").attr("width",s).attr("height",a).attr("role","presentation"),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Zr().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Lt.xOffset;c===Vt.CENTER?p=s/2:c===Vt.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=k.appendOrSelect(o,"defs").lower(),h=k.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
|
|
67
67
|
<stop class="${s}" offset="${c}"></stop>
|
|
68
68
|
<stop class="${a}" offset="${c+.2}"></stop>
|
|
69
69
|
<stop class="${s}" offset="${c+2*.2}"></stop>
|
|
70
|
-
`;h.html(f),p();function p(){h.attr("gradientTransform",`translate(${c-3*.2*l}, 0)`).transition().duration(2e3).delay(1e3).ease(BE).attr("gradientTransform",`translate(${u+3*.2*l}, 0)`).on("end",p)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class n2 extends me{constructor(t,n){super(t,n),this.model.setOptions(It(Tn(At.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new Gn(this.model,this.services),new rr(this.model,this.services),new cv(this.model,this.services),new cn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class i2 extends gi{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,i=this.getGroupedData(),r=[];for(const{name:s,data:a}of i){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(E=>E[o]).sort(Fe),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,d=c.quartiles.q_75,h=(d-u)*1.5,f=u-h,p=d+h,g=[],m=[];for(const E of l)E<f||E>p?g.push(E):m.push(E);c.outliers=g;const v=Nn(m),S=Wn(m);c.whiskers={min:v||Nn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:S||Wn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},r.push(c)}return r}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getBoxplotData(),{number:r,code:s}=y(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...i.map(l=>{let c=y(l,"outliers");return(c===null||c.length===0)&&(c=["–"]),[l[n],y(l,"whiskers","min")!==null?r(y(l,"whiskers","min"),s):"–",y(l,"quartiles","q_25")!==null?r(y(l,"quartiles","q_25"),s):"–",y(l,"quartiles","q_50")!==null?r(y(l,"quartiles","q_50"),s):"–",y(l,"quartiles","q_75")!==null?r(y(l,"quartiles","q_75"),s):"–",y(l,"whiskers","max")!==null?r(y(l,"whiskers","max"),s):"–",y(l,"quartiles","q_75")!==null&&y(l,"quartiles","q_25")!==null?(r(y(l,"quartiles","q_75")-y(l,"quartiles","q_25")),s):"–",c.map(u=>r(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const n=y(this.getOptions(),"color","pairing");let i=y(n,"option");const r=Ng.pairingOptions;i=i<=r["1-color"]?i:1;const s=this.allDataGroups.map(()=>`1-${i}-1`);this.colorClassNames=ya().range(s).domain(this.allDataGroups)}}class r2 extends vt{constructor(){super(...arguments),this.type="boxplot",this.renderType=st.SVG}render(t){const n=this.getComponentContainer({ariaLabel:"box plots",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,d]=o.range(),h=c-l,f=u-d;if(h===0)return;const{cartesianScales:p}=this.services,g=p.getOrientation(),m=g===Ht.VERTICAL,[v,S]=Cn(w=>this.services.cartesianScales.getDomainValue(w),w=>this.services.cartesianScales.getRangeValue(w),g),E=Math.floor((m?h:f)/s.length),b=Math.min(E/2,16),x=this.model.getBoxplotData(),_=n.selectAll(".box-group").data(x);_.exit().remove();const C=_.enter().append("g").attr("class","box-group"),D=_.merge(C);C.append("path").merge(_.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",ke.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalstartline",animate:t})).attr("d",w=>{const H=p.getDomainValue(w[r]),N=H,M=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.quartiles.q_25);return se({x0:H,x1:N,y0:M,y1:O},g)}),C.append("path").merge(_.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",ke.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalendline",animate:t})).attr("d",w=>{const H=p.getDomainValue(w[r]),N=H,M=p.getRangeValue(w.whiskers.max),O=p.getRangeValue(w.quartiles.q_75);return se({x0:H,x1:N,y0:M,y1:O},g)}),C.append("path").merge(_.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],originalClassName:"box"})).attr("fill-opacity",ke.box.opacity.default).attr("stroke-width",ke.strokeWidth.default).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",w=>w[r]).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-quartiles",animate:t})).attr("d",w=>{const H=p.getDomainValue(w[r])-b/2,N=H+b,M=p.getRangeValue(Math[m?"max":"min"](w.quartiles.q_75,w.quartiles.q_25)),O=M+Math.abs(p.getRangeValue(w.quartiles.q_75)-p.getRangeValue(w.quartiles.q_25));return se({x0:H,x1:N,y0:M,y1:O},g)}),C.append("path").merge(_.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",w=>{const H=p.getDomainValue(w[r])-b/2,N=H+b,M=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.whiskers.max);return se({x0:H,x1:N,y0:M,y1:O},g)}),C.append("path").merge(_.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"whisker start"})).attr("stroke-width",ke.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-startingwhisker",animate:t})).attr("d",w=>{const H=p.getDomainValue(w[r])-b/4,N=H+b/2,M=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.whiskers.min);return se({x0:H,x1:N,y0:M,y1:O},g)}),C.append("path").merge(_.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-median",animate:t})).attr("d",w=>{const H=p.getDomainValue(w[r])-b/2,N=H+b,M=p.getRangeValue(w.quartiles.q_50);return se({x0:H,x1:N,y0:M,y1:M},g)}),C.append("path").merge(_.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.STROKE],originalClassName:"whisker end"})).attr("stroke-width",ke.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-endingwhisker",animate:t})).attr("d",w=>{const H=p.getDomainValue(w[r])-b/4,N=H+b/2,M=p.getRangeValue(w.whiskers.max),O=p.getRangeValue(w.whiskers.max);return se({x0:H,x1:N,y0:M,y1:O},g)});const $=D.selectAll("circle.outlier").data(w=>w.outliers.map(H=>({min:w.whiskers.min,max:w.whiskers.max,[r]:w[r],value:H})));$.exit().remove();const P=$.enter().append("circle");$.merge(P).attr("r",ke.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],originalClassName:"outlier"})).attr("fill-opacity",ke.circle.opacity.default).attr("cx",v).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-circles",animate:t})).attr("cy",S),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(r,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",ke.box.opacity.hovered),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:s[i],class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEOVER,{event:r,element:a,datum:s})}).on("mousemove",function(r,s){const a=I(this);t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEMOVE,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(T.Boxplot.BOX_CLICK,{event:r,element:I(this),datum:s})}).on("mouseout",function(r,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",ke.box.opacity.default),t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=I(this);o.classed("hovered",!0).attr("fill-opacity",ke.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:a[i],class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP]})},{label:"Outlier",value:a[r]}]}),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=I(this);t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(T.Boxplot.OUTLIER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);o.classed("hovered",!1).attr("fill-opacity",ke.circle.opacity.default),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class sr extends vt{constructor(){super(...arguments),this.type="zero-line",this.renderType=st.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),i=this.services.cartesianScales.getScaleByPosition(n),[r,s]=i.domain(),a=r>0&&s<0||r<0&&s>0,o=this.getComponentContainer({isPresentational:!0});if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+i(0)+.5;u||(u=i.range()[0]);const d=Hg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());k.appendOrSelect(o,"line.domain").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class s2 extends me{constructor(t,n){super(t,n),this.model=new i2(this.services),this.model.setOptions(It(At.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new r2(this.model,this.services),new sr(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class a2 extends cn{constructor(){super(...arguments),this.type="bubble",this.renderType=st.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:i}=n.bubble,r=t.data(),s=r.map(c=>c[i]).filter(c=>c),a=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?Ue(s):[1,1];return Ve().domain(l).range(o?n.bubble.radiusRange(a,r):[4,4])}styleCircles(t,n){const i=this.getOptions(),{radiusMapsTo:r}=i.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=i.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=Cn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",h=>{const f=o.getRangeIdentifier(h);return h[f]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[r]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[f],h)}).style("stroke",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[f],h)}).attr("fill-opacity",i.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=y(this.getOptions(),"bubble");return[{label:y(n,"radiusLabel"),value:t[y(n,"radiusMapsTo")]}]}}class o2 extends me{constructor(t,n){super(t,n),this.model.setOptions(It(At.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new Gn(this.model,this.services),new a2(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class l2 extends gi{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let i=t.ranges.length-1;i>0;i--){const r=t.ranges[i];if(t.value>=r)return n=i,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier(),{number:s,code:a}=y(n,"locale"),o=y(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[i],u.value===null?"–":s(u.value,a),y(u,"marker")===null?"–":s(u.marker,a),y(u,"marker")===null?"–":`${s(Math.floor(u[r]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}}class c2 extends vt{constructor(){super(...arguments),this.type="bullet",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({ariaLabel:"bullet graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),d=()=>{const g=[];s.forEach(S=>{S.ranges?S.ranges.forEach((E,b)=>{E!=null&&E<u&&g.push({datum:S,value:E,order:b+1})}):g.push({datum:S,order:1})});const m=k.appendOrSelect(r,"g.range-boxes").selectAll("path.range-box").data(g,S=>`${S[i]}-${S.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",S=>`range-box order-${S.order}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-range-box-update-enter",animate:t})).attr("d",S=>{let b,x,_,C;return S.order===1?(b=this.services.cartesianScales.getDomainValue(S.datum)-16/2,x=b+16,_=c-2,C=l+1):(b=this.services.cartesianScales.getDomainValue(S.datum)-16/2,x=b+16,_=this.services.cartesianScales.getRangeValue(S.value),C=c),se({x0:b,x1:x,y0:_,y1:C},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=k.appendOrSelect(r,"g.bars").selectAll("path.bar").data(s,v=>v[i]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-bar-update-enter",animate:t})).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:v[i],originalClassName:"bar"})).style("fill",v=>{const S=this.services.cartesianScales.getDomainIdentifier(v);return this.model.getFillColor(v[i],v[S],v)}).attr("d",v=>{const E=this.services.cartesianScales.getDomainValue(v)-4,b=E+8,x=this.services.cartesianScales.getRangeValue(0)+1,_=this.services.cartesianScales.getRangeValue(v);return se({x0:E,x1:b,y0:x,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",v=>v.value)},f=()=>{const g=k.appendOrSelect(r,"g.markers").selectAll("path.marker").data(s.filter(v=>y(v,"marker")!==null),v=>v[i]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-marker-update-enter",animate:t})).attr("d",v=>{const E=this.services.cartesianScales.getDomainValue(v)-12,b=E+24,x=this.services.cartesianScales.getRangeValue(v.marker);return se({x0:E,x1:b,y0:x,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let g=[];s.filter(S=>y(S,"marker")!==null).forEach(S=>{const E=S.marker,b=S[o];g=g.concat([{datum:S,value:E*.25,barValue:b},{datum:S,value:E*.5,barValue:b},{datum:S,value:E*.75,barValue:b}])});const m=k.appendOrSelect(r,"g.quartiles").selectAll("path.quartile").data(g,S=>S[i]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",S=>`quartile ${S.value<=S.barValue?"over-bar":""}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:S,value:E})=>{let b=4;S.ranges&&S.ranges.indexOf(E)!==-1&&(b=8);const x=this.services.cartesianScales.getDomainValue(S)-b/2,_=x+b,C=this.services.cartesianScales.getRangeValue(E);return se({x0:x,x1:_,y0:C,y1:C},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),f(),p(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier(),{code:s,number:a}=y(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=I(this);c.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=y(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:l[i],class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:l[i]})},{label:"Value",value:l[r]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[r]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:o,element:I(this),datum:l}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:o,element:I(this),datum:l})}).on("mouseout",function(o,l){const c=I(this);c.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:c})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class u2 extends me{constructor(t,n){super(t,n),this.model=new l2(this.services),this.model.setOptions(It(At.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new c2(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}function dv(e){const t=Ue(e,i=>i.value),n=Ve().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 fv(e,t){const n=y(t,"gradient","colors"),i=!Ye(n);let r=y(t,"pairing","option");const s=dv(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${r}-${c}`)}return kl().domain(s).range(o)}class h2 extends an{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ye(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ye(n)&&!Ye(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(i=>{this._matrix[i.properties.NAME]=i}),n.forEach(i=>{this._matrix[i.name]?this._matrix[i.name].value=i.value||null:console.warn(`Data point ${i} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"–":a.id,a.name,a.value===null?"–":n(a.value,i)])];return super.formatTable({headers:r,cells:s})}getColorClassName(t){return`${t.originalClassName||""} ${this._colorScale(t.value)}`}setColorClassNames(){const t=y(this.getOptions(),"color");this._colorScale=fv(this.getDisplayData(),t)}}function d2(e){return e}function f2(e){if(e==null)return d2;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,d=new Array(u);for(d[0]=(t+=o[0])*i+s,d[1]=(n+=o[1])*r+a;c<u;)d[c]=o[c],++c;return d}}function p2(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function g2(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return pv(e,n)})}:pv(e,t)}function pv(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,s=Du(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:s}:i==null?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function Du(e,t){var n=f2(e.transform),i=e.arcs;function r(u,d){d.length&&d.pop();for(var h=i[u<0?~u:u],f=0,p=h.length;f<p;++f)d.push(n(h[f],f));u<0&&p2(d,p)}function s(u){return n(u)}function a(u){for(var d=[],h=0,f=u.length;h<f;++h)r(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=s(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(s);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function m2(e,t){var n={},i={},r={},s=[],a=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++a],t[a]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],f,p;if(f=r[d])if(delete r[f.end],f.push(c),f.end=h,p=i[h]){delete i[p.start];var g=p===f?f:f.concat(p);i[g.start=f.start]=r[g.end=p.end]=g}else i[f.start]=r[f.end]=f;else if(f=i[h])if(delete i[f.start],f.unshift(c),f.start=d,p=r[d]){delete r[p.end];var m=p===f?f:p.concat(f);i[m.start=p.start]=r[m.end=f.end]=m}else i[f.start]=r[f.end]=f;else f=[c],i[f.start=d]=r[f.end=h]=f});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(f){h[0]+=f[0],h[1]+=f[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(f){n[f<0?~f:f]=1}),s.push(h)}}return l(r,i),l(i,r),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function v2(e){for(var t=-1,n=e.length,i,r=e[n-1],s=0;++t<n;)i=r,r=e[t],s+=i[0]*r[1]-i[1]*r[0];return Math.abs(s)}function y2(e){return Du(e,E2.apply(this,arguments))}function E2(e,t){var n={},i=[],r=[];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)})}),i.push(l)}function o(l){return v2(Du(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return i.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,r.push(c);l=u.pop();)c.push(l),l.forEach(function(d){d.forEach(function(h){n[h<0?~h:h].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),i.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:r.map(function(l){var c=[],u;if(l.forEach(function(g){g.forEach(function(m){m.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=m2(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),f,p;d<u;++d)(f=o(c[d]))>h&&(p=c[0],c[0]=c[d],c[d]=p,h=f);return c}).filter(function(l){return l.length>0})}}class x2 extends Gn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=st.SVG}showRuler(t,[n,i]){const r=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),d=a.getDomainScale(),h=d.invert(o===Ht.VERTICAL?n:i),f=k.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),p=k.appendOrSelect(f,"line.ruler-line"),m=r.selectAll("[role=graphics-symbol]").filter(v=>{if(parseFloat(Et(v,"data.x0"))<=h&&parseFloat(Et(v,"data.x1"))>=h)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Cg(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const v=I(m.nodes()[0]).datum(),S=parseFloat(Et(v,"data.x0")),E=parseFloat(Et(v,"data.x1")),b=this.model.getActiveDataGroupNames(),x=b.reverse().map(C=>({label:C,value:Et(v,`data.${C}`),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:C})})).filter(C=>C.value!==0);if(x.length>0){this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,i],hoveredElement:p,items:[{label:Et(s,"bins.rangeLabel")||"Range",value:`${S} – ${E}`},...x,...y(s,"tooltip","showTotal")===!0?[{label:Et(s,"tooltip.totalLabel")||Et(s,"locale.translations.total")||"Total",value:(()=>{const D=y(s,"tooltip","customTotalCalculation");if(D){const $=b.map(P=>({[P]:parseFloat(Et(v,`data.${P}`))}));return D($)}else return b.reduce(($,P)=>$+parseFloat(Et(v,`data.${P}`)),0)})()}]:[]]}),f.attr("opacity",1);const C=d((S+E)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",C).attr("y2",C):p.attr("y1",u).attr("y2",c).attr("x1",C).attr("x2",C)}else this.hideRuler()}else this.hideRuler()}}class go extends Gn{formatTooltipData(t){return t.reverse()}}class gv extends yu{constructor(t,n,i){super(t,n,i),this.type="color-legend",this.renderType=st.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const r=this.getComponentContainer(),{width:s}=k.getSVGElementSize(r,{useAttrs:!0}),a=y(this.getOptions(),"data","loading");if(s>Pt.color.barWidth&&!a){const o=y(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,u=l.getMainXScale().range();if(u[0]>1&&(r.select("g.legend").attr("transform",`translate(${u[0]}, 0)`),o)){const{width:d}=k.getSVGElementSize(r.select("g.legend-title").select("text"),{useBBox:!0}),h=u[0]-d-9;h>1?r.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(r.select("g.legend").attr("transform",`translate(${u[0]}, 16)`),r.select("g.legend-title").attr("transform",`translate(${u[0]}, 0)`))}}else r.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=i.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(T.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),i=this.getComponentContainer({ariaLabel:"legend"}),{width:r}=k.getSVGElementSize(i,{useAttrs:!0}),s=y(n,"color","gradient","colors"),a=y(n,this.chartType,"colorLegend","type");let o=y(n,"color","pairing","option");const l=y(n,"heatmap","colorLegend","title");if(y(this.getOptions(),"data","loading")){i.html("");return}const u=!Ye(s),d=dv(this.model.getDisplayData()),h=!(r<=Pt.color.barWidth),f=h?Pt.color.barWidth:r,p=k.appendOrSelect(i,"g.legend"),g=k.appendOrSelect(p,"g.legend-axis");if(l){const P=k.appendOrSelect(i,"g.legend-title");k.appendOrSelect(P,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const m=d[0]<0&&d[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let v=[];const S=m==="diverge"?17:11;if(u)v=s;else for(let P=1;P<S+1;P++)v.push(a===ls.LINEAR?`stop-color-${m}-${o}-${P}`:`fill-${m}-${o}-${P}`);const E=xe(d[0],d[1]),b=R1(E,3),x=Ve().domain(d).range([0,f]),_=Ao(x).tickSize(0).tickValues(b),{code:C,number:D}=y(n,"locale");_.tickFormat(P=>D(P,C));let $;switch(a){case ls.LINEAR:this.drawLinear(v,p,f);break;case ls.QUANTIZE:$=this.drawQuantize(v,m,u,p,f),x.range([$,f]);break;default:throw Error("Entered color legend type is not supported.")}g.attr("transform",`translate(0,${Pt.color.axisYTranslation})`).call(_),g.select(".domain").remove(),g.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),g.select("g.tick:first-of-type text").style("text-anchor",h&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,i){const r=100/(t.length-1);k.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(o,l)=>`${l*r}%`).attr("class",(o,l)=>t[l]).attr("stop-color",o=>o),k.appendOrSelect(n,"rect").attr("width",i).attr("height",Pt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,i,r,s){!i&&n==="diverge"&&t.splice(t.length/2,1);const a=Li().domain(t).range([0,s]);return k.appendOrSelect(r,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",l=>a(l)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Pt.color.barHeight).attr("class",l=>l).attr("fill",l=>l),(!i&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(T.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class b2 extends Ss{constructor(){super(...arguments),this.type="meter-title",this.renderType=st.SVG}render(t=!1){const n=y(this.model.getDisplayData(),0),i=this.getOptions(),r=this.getComponentContainer({ariaLabel:"meter title"}),{groupMapsTo:s}=i.data,a=i.locale.translations.meter.title;if(y(i,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const u=r.selectAll("text.meter-title").data(a?[a]:[n[s]]);u.enter().append("text").classed("meter-title",!0).merge(u).attr("x",0).attr("y","1em").text(d=>d),u.exit().remove(),this.appendPercentage()}this.displayStatus();const l=this.getMaxTitleWidth(),c=k.appendOrSelect(r,"text.meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),i=this.model.getMaximumDomain(this.model.getDisplayData()),r=y(n,"meter","proportional","total"),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"";let a;if(i===r)a=null;else{const u=r!==null?r-i:i,d=y(n,"meter","proportional","breakdownFormatter"),{code:h,number:f}=y(n,"locale");a=d!==null?d({datasetsTotal:i,total:r}):`${f(i,h)} ${s} used (${f(u,h)} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=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(),i=y(n,"meter","proportional","total"),r=i?y(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"",a=y(n,"meter","proportional","totalFormatter"),{code:o,number:l}=y(n,"locale"),c=a!==null?a(r):`${l(i,o)} ${s} total`,u=k.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-jt.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),i=k.getHTMLElementSize(this.parent.node()).width||0,r=this.model.getStatus(),s=jt.status.indicatorSize/2,a=k.appendOrSelect(n,"g.status-indicator").attr("class",r!==null?`status-indicator status--${r}`:"").attr("transform",`translate(${i-s}, 0)`),o=r?[r]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(r)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=y(this.model.getDisplayData(),0,"value"),{code:n,number:i}=y(this.getOptions(),"locale"),r=this.getComponentContainer(),s=k.appendOrSelect(r,"text.meter-title"),a=y(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=r.selectAll("text.percent-value").data(a),l=jt.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?i(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const i=k.appendOrSelect(this.parent,"tspan"),r=jt.statusBar.paddingRight,s=Math.ceil(i.node().getComputedTextLength());k.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+r)}getMaxTitleWidth(){const t=y(this.getOptions(),"meter","proportional"),n=k.getHTMLElementSize(this.parent.node()).width;if(t!==null){const i=k.appendOrSelect(this.parent,"text.proportional-meter-total").node(),r=k.getSVGElementSize(i,{useBBox:!0}).width;return n-r-jt.total.paddingLeft}else{const i=k.appendOrSelect(this.parent,"text.percent-value"),r=jt.statusBar.paddingRight,s=i.node().getComputedTextLength(),a=k.appendOrSelect(this.parent,"g.status-indicator").node(),o=k.getSVGElementSize(a,{useBBox:!0}).width+jt.status.paddingLeft;return n-s-r-o}}getStatusIconPathString(t){switch(t){case as.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 as.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case as.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 Lu extends vt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,i=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!i.step){const s=y(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,r*s/n)}return Math.min(t.bars.maxWidth,i.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const s=this.services.cartesianScales.getDomainScale();return t<s(r[0])||n>s(r[1])}return!1}}class S2 extends vt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-circlepack"})).attr("opacity",i=>i.data.dataGroupName===n.datum().name?1:Ji.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({ariaLabel:"circle packs",withinChartClip:!0}),{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=y(l,"canvasZoom","enabled");a&&y(s,0,"children")&&(s=y(s,0,"children"));const u=Nr({children:s}).sum(g=>g.value).sort((g,m)=>m.value-g.value),h=Yb().size([i,r]).padding(g=>g.depth>=1?Ji.padding.children+3:Ji.padding.mainGroup+3)(u).descendants().splice(1).filter(g=>g.depth<=o),f=n.selectAll("circle.node").data(h);f.exit().attr("width",0).attr("height",0).remove();const p=f.enter().append("circle").classed("node",!0);p.merge(f).attr("class",g=>{const m=c&&o===3?this.getZoomClass(g):"";return this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:g.data.dataGroupName,originalClassName:g.children?`node ${m}`:`node node-leaf ${m}`})}).style("fill",g=>this.model.getFillColor(g.data.dataGroupName,null,g.data)).style("stroke",g=>this.model.getFillColor(g.data.dataGroupName,null,g.data)).attr("cx",g=>g.x).attr("cy",g=>g.y).transition("circlepack-leaf-update-enter").call(g=>this.services.transitions.setupTransition({transition:g,name:"circlepack-leaf-update-enter"})).attr("r",g=>g.r).attr("opacity",1).attr("fill-opacity",Ji.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,Qi),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(i=>i.data);this.parent.selectAll("circle.node").filter(i=>n.some(r=>r===i.data)&&i.depth>1).style("stroke",i=>this.model.getFillColor(i.data.dataGroupName,null,i.data))}highlightChildren(t){const n=t.map(i=>i.data);this.parent.selectAll("circle.node").filter(i=>n.some(r=>r===i.data)&&i.depth>1).style("stroke",Ji.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){I(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=I(this.services.domUtils.getMainContainer()),n=this,i=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(i,Qi)})}getZoomIcon(){return`
|
|
70
|
+
`;h.html(f),p();function p(){h.attr("gradientTransform",`translate(${c-3*.2*l}, 0)`).transition().duration(2e3).delay(1e3).ease(YE).attr("gradientTransform",`translate(${u+3*.2*l}, 0)`).on("end",p)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class h2 extends Ee{constructor(t,n){super(t,n),this.model.setOptions(kt(An(Ct.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new zn(this.model,this.services),new cr(this.model,this.services),new gv(this.model,this.services),new fn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new de(this.model,this.services,{skeleton:zt.GRID})];return this.getAxisChartComponents(t)}}class d2 extends vi{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,i=this.getGroupedData(),r=[];for(const{name:s,data:a}of i){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(E=>E[o]).sort(Ge),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,d=c.quartiles.q_75,h=(d-u)*1.5,f=u-h,p=d+h,g=[],m=[];for(const E of l)E<f||E>p?g.push(E):m.push(E);c.outliers=g;const v=Fn(m),S=qn(m);c.whiskers={min:v||Fn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:S||qn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},r.push(c)}return r}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getBoxplotData(),{number:r,code:s}=y(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...i.map(l=>{let c=y(l,"outliers");return(c===null||c.length===0)&&(c=["–"]),[l[n],y(l,"whiskers","min")!==null?r(y(l,"whiskers","min"),s):"–",y(l,"quartiles","q_25")!==null?r(y(l,"quartiles","q_25"),s):"–",y(l,"quartiles","q_50")!==null?r(y(l,"quartiles","q_50"),s):"–",y(l,"quartiles","q_75")!==null?r(y(l,"quartiles","q_75"),s):"–",y(l,"whiskers","max")!==null?r(y(l,"whiskers","max"),s):"–",y(l,"quartiles","q_75")!==null&&y(l,"quartiles","q_25")!==null?(r(y(l,"quartiles","q_75")-y(l,"quartiles","q_25")),s):"–",c.map(u=>r(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const n=y(this.getOptions(),"color","pairing");let i=y(n,"option");const r=Fg.pairingOptions;i=i<=r["1-color"]?i:1;const s=this.allDataGroups.map(()=>`1-${i}-1`);this.colorClassNames=Sa().range(s).domain(this.allDataGroups)}}class f2 extends vt{constructor(){super(...arguments),this.type="boxplot",this.renderType=st.SVG}render(t){const n=this.getComponentContainer({ariaLabel:"box plots",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,d]=o.range(),h=c-l,f=u-d;if(h===0)return;const{cartesianScales:p}=this.services,g=p.getOrientation(),m=g===Ht.VERTICAL,[v,S]=Rn(w=>this.services.cartesianScales.getDomainValue(w),w=>this.services.cartesianScales.getRangeValue(w),g),E=Math.floor((m?h:f)/s.length),b=Math.min(E/2,16),x=this.model.getBoxplotData(),T=n.selectAll(".box-group").data(x);T.exit().remove();const C=T.enter().append("g").attr("class","box-group"),D=T.merge(C);C.append("path").merge(T.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ne.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalstartline",animate:t})).attr("d",w=>{const G=p.getDomainValue(w[r]),N=G,A=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.quartiles.q_25);return le({x0:G,x1:N,y0:A,y1:O},g)}),C.append("path").merge(T.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ne.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalendline",animate:t})).attr("d",w=>{const G=p.getDomainValue(w[r]),N=G,A=p.getRangeValue(w.whiskers.max),O=p.getRangeValue(w.quartiles.q_75);return le({x0:G,x1:N,y0:A,y1:O},g)}),C.append("path").merge(T.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],originalClassName:"box"})).attr("fill-opacity",Ne.box.opacity.default).attr("stroke-width",Ne.strokeWidth.default).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",w=>w[r]).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-quartiles",animate:t})).attr("d",w=>{const G=p.getDomainValue(w[r])-b/2,N=G+b,A=p.getRangeValue(Math[m?"max":"min"](w.quartiles.q_75,w.quartiles.q_25)),O=A+Math.abs(p.getRangeValue(w.quartiles.q_75)-p.getRangeValue(w.quartiles.q_25));return le({x0:G,x1:N,y0:A,y1:O},g)}),C.append("path").merge(T.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",w=>{const G=p.getDomainValue(w[r])-b/2,N=G+b,A=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.whiskers.max);return le({x0:G,x1:N,y0:A,y1:O},g)}),C.append("path").merge(T.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ne.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-startingwhisker",animate:t})).attr("d",w=>{const G=p.getDomainValue(w[r])-b/4,N=G+b/2,A=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.whiskers.min);return le({x0:G,x1:N,y0:A,y1:O},g)}),C.append("path").merge(T.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-median",animate:t})).attr("d",w=>{const G=p.getDomainValue(w[r])-b/2,N=G+b,A=p.getRangeValue(w.quartiles.q_50);return le({x0:G,x1:N,y0:A,y1:A},g)}),C.append("path").merge(T.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ne.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-endingwhisker",animate:t})).attr("d",w=>{const G=p.getDomainValue(w[r])-b/4,N=G+b/2,A=p.getRangeValue(w.whiskers.max),O=p.getRangeValue(w.whiskers.max);return le({x0:G,x1:N,y0:A,y1:O},g)});const $=D.selectAll("circle.outlier").data(w=>w.outliers.map(G=>({min:w.whiskers.min,max:w.whiskers.max,[r]:w[r],value:G})));$.exit().remove();const P=$.enter().append("circle");$.merge(P).attr("r",Ne.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ne.circle.opacity.default).attr("cx",v).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-circles",animate:t})).attr("cy",S),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(r,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ne.box.opacity.hovered),t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:s[i],class:t.model.getColorClassName({classNameTypes:[ot.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(_.Boxplot.BOX_MOUSEOVER,{event:r,element:a,datum:s})}).on("mousemove",function(r,s){const a=I(this);t.services.events.dispatchEvent(_.Boxplot.BOX_MOUSEMOVE,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(_.Boxplot.BOX_CLICK,{event:r,element:I(this),datum:s})}).on("mouseout",function(r,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ne.box.opacity.default),t.services.events.dispatchEvent(_.Boxplot.BOX_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=I(this);o.classed("hovered",!0).attr("fill-opacity",Ne.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:a[i],class:t.model.getColorClassName({classNameTypes:[ot.TOOLTIP]})},{label:"Outlier",value:a[r]}]}),t.services.events.dispatchEvent(_.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=I(this);t.services.events.dispatchEvent(_.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(_.Boxplot.OUTLIER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);o.classed("hovered",!1).attr("fill-opacity",Ne.circle.opacity.default),t.services.events.dispatchEvent(_.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:o})})}}class ur extends vt{constructor(){super(...arguments),this.type="zero-line",this.renderType=st.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),i=this.services.cartesianScales.getScaleByPosition(n),[r,s]=i.domain(),a=r>0&&s<0||r<0&&s>0,o=this.getComponentContainer({isPresentational:!0});if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+i(0)+.5;u||(u=i.range()[0]);const d=Vg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());k.appendOrSelect(o,"line.domain").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class p2 extends Ee{constructor(t,n){super(t,n),this.model=new d2(this.services),this.model.setOptions(kt(Ct.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new f2(this.model,this.services),new ur(this.model,this.services),new de(this.model,this.services,{skeleton:zt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class g2 extends fn{constructor(){super(...arguments),this.type="bubble",this.renderType=st.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:i}=n.bubble,r=t.data(),s=r.map(c=>c[i]).filter(c=>c),a=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?He(s):[1,1];return Ye().domain(l).range(o?n.bubble.radiusRange(a,r):[4,4])}styleCircles(t,n){const i=this.getOptions(),{radiusMapsTo:r}=i.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=i.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=Rn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",h=>{const f=o.getRangeIdentifier(h);return h[f]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[r]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[f],h)}).style("stroke",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[f],h)}).attr("fill-opacity",i.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=y(this.getOptions(),"bubble");return[{label:y(n,"radiusLabel"),value:t[y(n,"radiusMapsTo")]}]}}class m2 extends Ee{constructor(t,n){super(t,n),this.model.setOptions(kt(Ct.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new zn(this.model,this.services),new g2(this.model,this.services),new de(this.model,this.services,{skeleton:zt.GRID})];return this.getAxisChartComponents(t)}}class v2 extends vi{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let i=t.ranges.length-1;i>0;i--){const r=t.ranges[i];if(t.value>=r)return n=i,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier(),{number:s,code:a}=y(n,"locale"),o=y(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[i],u.value===null?"–":s(u.value,a),y(u,"marker")===null?"–":s(u.marker,a),y(u,"marker")===null?"–":`${s(Math.floor(u[r]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}}class y2 extends vt{constructor(){super(...arguments),this.type="bullet",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({ariaLabel:"bullet graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),d=()=>{const g=[];s.forEach(S=>{S.ranges?S.ranges.forEach((E,b)=>{E!=null&&E<u&&g.push({datum:S,value:E,order:b+1})}):g.push({datum:S,order:1})});const m=k.appendOrSelect(r,"g.range-boxes").selectAll("path.range-box").data(g,S=>`${S[i]}-${S.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",S=>`range-box order-${S.order}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-range-box-update-enter",animate:t})).attr("d",S=>{let b,x,T,C;return S.order===1?(b=this.services.cartesianScales.getDomainValue(S.datum)-16/2,x=b+16,T=c-2,C=l+1):(b=this.services.cartesianScales.getDomainValue(S.datum)-16/2,x=b+16,T=this.services.cartesianScales.getRangeValue(S.value),C=c),le({x0:b,x1:x,y0:T,y1:C},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=k.appendOrSelect(r,"g.bars").selectAll("path.bar").data(s,v=>v[i]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-bar-update-enter",animate:t})).attr("class",v=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:v[i],originalClassName:"bar"})).style("fill",v=>{const S=this.services.cartesianScales.getDomainIdentifier(v);return this.model.getFillColor(v[i],v[S],v)}).attr("d",v=>{const E=this.services.cartesianScales.getDomainValue(v)-4,b=E+8,x=this.services.cartesianScales.getRangeValue(0)+1,T=this.services.cartesianScales.getRangeValue(v);return le({x0:E,x1:b,y0:x,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",v=>v.value)},f=()=>{const g=k.appendOrSelect(r,"g.markers").selectAll("path.marker").data(s.filter(v=>y(v,"marker")!==null),v=>v[i]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-marker-update-enter",animate:t})).attr("d",v=>{const E=this.services.cartesianScales.getDomainValue(v)-12,b=E+24,x=this.services.cartesianScales.getRangeValue(v.marker);return le({x0:E,x1:b,y0:x,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let g=[];s.filter(S=>y(S,"marker")!==null).forEach(S=>{const E=S.marker,b=S[o];g=g.concat([{datum:S,value:E*.25,barValue:b},{datum:S,value:E*.5,barValue:b},{datum:S,value:E*.75,barValue:b}])});const m=k.appendOrSelect(r,"g.quartiles").selectAll("path.quartile").data(g,S=>S[i]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",S=>`quartile ${S.value<=S.barValue?"over-bar":""}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:S,value:E})=>{let b=4;S.ranges&&S.ranges.indexOf(E)!==-1&&(b=8);const x=this.services.cartesianScales.getDomainValue(S)-b/2,T=x+b,C=this.services.cartesianScales.getRangeValue(E);return le({x0:x,x1:T,y0:C,y1:C},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),f(),p(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier(),{code:s,number:a}=y(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=I(this);c.classed("hovered",!0),t.services.events.dispatchEvent(_.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=y(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:y(n,"locale","translations","group")||y(n,"tooltip","groupLabel")||"Group",value:l[i],class:t.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:l[i]})},{label:"Value",value:l[r]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[r]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(_.Bar.BAR_MOUSEMOVE,{event:o,element:I(this),datum:l}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(_.Bar.BAR_CLICK,{event:o,element:I(this),datum:l})}).on("mouseout",function(o,l){const c=I(this);c.classed("hovered",!1),t.services.events.dispatchEvent(_.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:c})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class E2 extends Ee{constructor(t,n){super(t,n),this.model=new v2(this.services),this.model.setOptions(kt(Ct.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new y2(this.model,this.services),new de(this.model,this.services,{skeleton:zt.GRID})];return this.getAxisChartComponents(t)}}function yv(e){const t=He(e,i=>i.value),n=Ye().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Ev(e,t){const n=y(t,"gradient","colors"),i=!Ze(n);let r=y(t,"pairing","option");const s=yv(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${r}-${c}`)}return kl().domain(s).range(o)}class x2 extends hn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ze(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ze(n)&&!Ze(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(i=>{this._matrix[i.properties.NAME]=i}),n.forEach(i=>{this._matrix[i.name]?this._matrix[i.name].value=i.value||null:console.warn(`Data point ${i} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"–":a.id,a.name,a.value===null?"–":n(a.value,i)])];return super.formatTable({headers:r,cells:s})}getColorClassName(t){return`${t.originalClassName||""} ${this._colorScale(t.value)}`}setColorClassNames(){const t=y(this.getOptions(),"color");this._colorScale=Ev(this.getDisplayData(),t)}}function b2(e){return e}function S2(e){if(e==null)return b2;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,d=new Array(u);for(d[0]=(t+=o[0])*i+s,d[1]=(n+=o[1])*r+a;c<u;)d[c]=o[c],++c;return d}}function T2(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function _2(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return xv(e,n)})}:xv(e,t)}function xv(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,s=Cu(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:s}:i==null?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function Cu(e,t){var n=S2(e.transform),i=e.arcs;function r(u,d){d.length&&d.pop();for(var h=i[u<0?~u:u],f=0,p=h.length;f<p;++f)d.push(n(h[f],f));u<0&&T2(d,p)}function s(u){return n(u)}function a(u){for(var d=[],h=0,f=u.length;h<f;++h)r(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=s(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(s);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function O2(e,t){var n={},i={},r={},s=[],a=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++a],t[a]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],f,p;if(f=r[d])if(delete r[f.end],f.push(c),f.end=h,p=i[h]){delete i[p.start];var g=p===f?f:f.concat(p);i[g.start=f.start]=r[g.end=p.end]=g}else i[f.start]=r[f.end]=f;else if(f=i[h])if(delete i[f.start],f.unshift(c),f.start=d,p=r[d]){delete r[p.end];var m=p===f?f:p.concat(f);i[m.start=p.start]=r[m.end=f.end]=m}else i[f.start]=r[f.end]=f;else f=[c],i[f.start=d]=r[f.end=h]=f});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(f){h[0]+=f[0],h[1]+=f[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(f){n[f<0?~f:f]=1}),s.push(h)}}return l(r,i),l(i,r),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function w2(e){for(var t=-1,n=e.length,i,r=e[n-1],s=0;++t<n;)i=r,r=e[t],s+=i[0]*r[1]-i[1]*r[0];return Math.abs(s)}function M2(e){return Cu(e,A2.apply(this,arguments))}function A2(e,t){var n={},i=[],r=[];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)})}),i.push(l)}function o(l){return w2(Cu(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return i.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,r.push(c);l=u.pop();)c.push(l),l.forEach(function(d){d.forEach(function(h){n[h<0?~h:h].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),i.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:r.map(function(l){var c=[],u;if(l.forEach(function(g){g.forEach(function(m){m.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=O2(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),f,p;d<u;++d)(f=o(c[d]))>h&&(p=c[0],c[0]=c[d],c[d]=p,h=f);return c}).filter(function(l){return l.length>0})}}class C2 extends zn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=st.SVG}showRuler(t,[n,i]){const r=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),d=a.getDomainScale(),h=d.invert(o===Ht.VERTICAL?n:i),f=k.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),p=k.appendOrSelect(f,"line.ruler-line"),m=r.selectAll("[role=graphics-symbol]").filter(v=>{if(parseFloat(Et(v,"data.x0"))<=h&&parseFloat(Et(v,"data.x1"))>=h)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Dg(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const v=I(m.nodes()[0]).datum(),S=parseFloat(Et(v,"data.x0")),E=parseFloat(Et(v,"data.x1")),b=this.model.getActiveDataGroupNames(),x=b.reverse().map(C=>({label:C,value:Et(v,`data.${C}`),class:this.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:C})})).filter(C=>C.value!==0);if(x.length>0){this.services.events.dispatchEvent(_.Tooltip.SHOW,{event:t,mousePosition:[n,i],hoveredElement:p,items:[{label:Et(s,"bins.rangeLabel")||"Range",value:`${S} – ${E}`},...x,...y(s,"tooltip","showTotal")===!0?[{label:Et(s,"tooltip.totalLabel")||Et(s,"locale.translations.total")||"Total",value:(()=>{const D=y(s,"tooltip","customTotalCalculation");if(D){const $=b.map(P=>({[P]:parseFloat(Et(v,`data.${P}`))}));return D($)}else return b.reduce(($,P)=>$+parseFloat(Et(v,`data.${P}`)),0)})()}]:[]]}),f.attr("opacity",1);const C=d((S+E)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",C).attr("y2",C):p.attr("y1",u).attr("y2",c).attr("x1",C).attr("x2",C)}else this.hideRuler()}else this.hideRuler()}}class vo extends zn{formatTooltipData(t){return t.reverse()}}class bv extends vu{constructor(t,n,i){super(t,n,i),this.type="color-legend",this.renderType=st.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const r=this.getComponentContainer(),{width:s}=k.getSVGElementSize(r,{useAttrs:!0}),a=y(this.getOptions(),"data","loading");if(s>Pt.color.barWidth&&!a){const o=y(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,u=l.getMainXScale().range();if(u[0]>1&&(r.select("g.legend").attr("transform",`translate(${u[0]}, 0)`),o)){const{width:d}=k.getSVGElementSize(r.select("g.legend-title").select("text"),{useBBox:!0}),h=u[0]-d-9;h>1?r.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(r.select("g.legend").attr("transform",`translate(${u[0]}, 16)`),r.select("g.legend-title").attr("transform",`translate(${u[0]}, 0)`))}}else r.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=i.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(_.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),i=this.getComponentContainer({ariaLabel:"legend"}),{width:r}=k.getSVGElementSize(i,{useAttrs:!0}),s=y(n,"color","gradient","colors"),a=y(n,this.chartType,"colorLegend","type");let o=y(n,"color","pairing","option");const l=y(n,"heatmap","colorLegend","title");if(y(this.getOptions(),"data","loading")){i.html("");return}const u=!Ze(s),d=yv(this.model.getDisplayData()),h=!(r<=Pt.color.barWidth),f=h?Pt.color.barWidth:r,p=k.appendOrSelect(i,"g.legend"),g=k.appendOrSelect(p,"g.legend-axis");if(l){const P=k.appendOrSelect(i,"g.legend-title");k.appendOrSelect(P,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const m=d[0]<0&&d[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let v=[];const S=m==="diverge"?17:11;if(u)v=s;else for(let P=1;P<S+1;P++)v.push(a===fs.LINEAR?`stop-color-${m}-${o}-${P}`:`fill-${m}-${o}-${P}`);const E=Te(d[0],d[1]),b=F1(E,3),x=Ye().domain(d).range([0,f]),T=Co(x).tickSize(0).tickValues(b),{code:C,number:D}=y(n,"locale");T.tickFormat(P=>D(P,C));let $;switch(a){case fs.LINEAR:this.drawLinear(v,p,f);break;case fs.QUANTIZE:$=this.drawQuantize(v,m,u,p,f),x.range([$,f]);break;default:throw Error("Entered color legend type is not supported.")}g.attr("transform",`translate(0,${Pt.color.axisYTranslation})`).call(T),g.select(".domain").remove(),g.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),g.select("g.tick:first-of-type text").style("text-anchor",h&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,i){const r=100/(t.length-1);k.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(o,l)=>`${l*r}%`).attr("class",(o,l)=>t[l]).attr("stop-color",o=>o),k.appendOrSelect(n,"rect").attr("width",i).attr("height",Pt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,i,r,s){!i&&n==="diverge"&&t.splice(t.length/2,1);const a=Ii().domain(t).range([0,s]);return k.appendOrSelect(r,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",l=>a(l)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Pt.color.barHeight).attr("class",l=>l).attr("fill",l=>l),(!i&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(_.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class D2 extends Ms{constructor(){super(...arguments),this.type="meter-title",this.renderType=st.SVG}render(t=!1){const n=y(this.model.getDisplayData(),0),i=this.getOptions(),r=this.getComponentContainer({ariaLabel:"meter title"}),{groupMapsTo:s}=i.data,a=i.locale.translations.meter.title;if(y(i,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const u=r.selectAll("text.meter-title").data(a?[a]:[n[s]]);u.enter().append("text").classed("meter-title",!0).merge(u).attr("x",0).attr("y","1em").text(d=>d),u.exit().remove(),this.appendPercentage()}this.displayStatus();const l=this.getMaxTitleWidth(),c=k.appendOrSelect(r,"text.meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),i=this.model.getMaximumDomain(this.model.getDisplayData()),r=y(n,"meter","proportional","total"),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"";let a;if(i===r)a=null;else{const u=r!==null?r-i:i,d=y(n,"meter","proportional","breakdownFormatter"),{code:h,number:f}=y(n,"locale");a=d!==null?d({datasetsTotal:i,total:r}):`${f(i,h)} ${s} used (${f(u,h)} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=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(),i=y(n,"meter","proportional","total"),r=i?y(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=y(n,"meter","proportional","unit")?y(n,"meter","proportional","unit"):"",a=y(n,"meter","proportional","totalFormatter"),{code:o,number:l}=y(n,"locale"),c=a!==null?a(r):`${l(i,o)} ${s} total`,u=k.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-Jt.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),i=k.getHTMLElementSize(this.parent.node()).width||0,r=this.model.getStatus(),s=Jt.status.indicatorSize/2,a=k.appendOrSelect(n,"g.status-indicator").attr("class",r!==null?`status-indicator status--${r}`:"").attr("transform",`translate(${i-s}, 0)`),o=r?[r]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(r)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=y(this.model.getDisplayData(),0,"value"),{code:n,number:i}=y(this.getOptions(),"locale"),r=this.getComponentContainer(),s=k.appendOrSelect(r,"text.meter-title"),a=y(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=r.selectAll("text.percent-value").data(a),l=Jt.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?i(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const i=k.appendOrSelect(this.parent,"tspan"),r=Jt.statusBar.paddingRight,s=Math.ceil(i.node().getComputedTextLength());k.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+r)}getMaxTitleWidth(){const t=y(this.getOptions(),"meter","proportional"),n=k.getHTMLElementSize(this.parent.node()).width;if(t!==null){const i=k.appendOrSelect(this.parent,"text.proportional-meter-total").node(),r=k.getSVGElementSize(i,{useBBox:!0}).width;return n-r-Jt.total.paddingLeft}else{const i=k.appendOrSelect(this.parent,"text.percent-value"),r=Jt.statusBar.paddingRight,s=i.node().getComputedTextLength(),a=k.appendOrSelect(this.parent,"g.status-indicator").node(),o=k.getSVGElementSize(a,{useBBox:!0}).width+Jt.status.paddingLeft;return n-s-r-o}}getStatusIconPathString(t){switch(t){case hs.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 hs.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case hs.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 Du extends vt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,i=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!i.step){const s=y(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,r*s/n)}return Math.min(t.bars.maxWidth,i.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const s=this.services.cartesianScales.getDomainScale();return t<s(r[0])||n>s(r[1])}return!1}}class L2 extends vt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-circlepack"})).attr("opacity",i=>i.data.dataGroupName===n.datum().name?1:er.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({ariaLabel:"circle packs",withinChartClip:!0}),{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=y(l,"canvasZoom","enabled");a&&y(s,0,"children")&&(s=y(s,0,"children"));const u=Gr({children:s}).sum(g=>g.value).sort((g,m)=>m.value-g.value),h=Qb().size([i,r]).padding(g=>g.depth>=1?er.padding.children+3:er.padding.mainGroup+3)(u).descendants().splice(1).filter(g=>g.depth<=o),f=n.selectAll("circle.node").data(h);f.exit().attr("width",0).attr("height",0).remove();const p=f.enter().append("circle").classed("node",!0);p.merge(f).attr("class",g=>{const m=c&&o===3?this.getZoomClass(g):"";return this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:g.data.dataGroupName,originalClassName:g.children?`node ${m}`:`node node-leaf ${m}`})}).style("fill",g=>this.model.getFillColor(g.data.dataGroupName,null,g.data)).style("stroke",g=>this.model.getFillColor(g.data.dataGroupName,null,g.data)).attr("cx",g=>g.x).attr("cy",g=>g.y).transition("circlepack-leaf-update-enter").call(g=>this.services.transitions.setupTransition({transition:g,name:"circlepack-leaf-update-enter"})).attr("r",g=>g.r).attr("opacity",1).attr("fill-opacity",er.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,tr),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(i=>i.data);this.parent.selectAll("circle.node").filter(i=>n.some(r=>r===i.data)&&i.depth>1).style("stroke",i=>this.model.getFillColor(i.data.dataGroupName,null,i.data))}highlightChildren(t){const n=t.map(i=>i.data);this.parent.selectAll("circle.node").filter(i=>n.some(r=>r===i.data)&&i.depth>1).style("stroke",er.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(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){I(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=I(this.services.domUtils.getMainContainer()),n=this,i=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(i,tr)})}getZoomIcon(){return`
|
|
71
71
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
|
72
72
|
<polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
|
|
73
73
|
<path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
|
|
74
|
-
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,i){const r=I(this);r.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!r.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(i.children){i.depth>1&&o&&(l=!0,r.classed("clickable",!0)),c=i.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:Et(f,"locale.translations.total")||Et(f,"tooltip.totalLabel")||"Total",value:i.value,bold:!0}],t.highlightChildren(i.children)}else d=i.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:h,label:i.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1),i.children&&t.unhighlightChildren(i.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})}).on("click",function(n,i){const r=I(this),s=r.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Qi)}else if(i.depth===2&&i.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=i,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(i,o,Qi),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:r,datum:i})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function _2(e,t){const n=Er(this._current,e);return i=>(this._current=n(i),t(this._current))}class mv extends vt{constructor(){super(...arguments),this.type="pie",this.renderType=st.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r.data[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"pie graph"}),r=this.getOptions(),{groupMapsTo:s}=r.data,{valueMapsTo:a}=r.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=zr().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=zr().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=V_().value(M=>M[a]).sort(y(r,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(i,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>[M[a],Kc(M.data[a],o,a)+"%",M.data[s]].filter(Boolean).join(", ")).attrTween("d",function(M){return _2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(r,"locale"),v=r.pie.labels.enabled,S=v?u.filter(M=>M.data[a]>0):[],b=k.appendOrSelect(i,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(S,M=>M.data[s]);b.exit().attr("opacity",0).remove();const x=b.enter().append("text").classed("pie-label",!0),_=[];x.merge(b).style("text-anchor","middle").text(M=>r.pie.labels.formatter?r.pie.labels.formatter({...M,percentageValue:Kc(M.data[a],o,a,!0)}):m(Kc(M.data[a],o,a),g)+"%").datum(function(M){const O=l+7,F=(M.endAngle-M.startAngle)/2+M.startAngle,U=F/Math.PI*180,R=this.getComputedTextLength();return M.textOffsetX=R/2,M.textOffsetY=U>90&&U<270?10:0,M.xPosition=(M.textOffsetX+O)*Math.sin(F),M.yPosition=(M.textOffsetY+O)*-Math.cos(F),M}).attr("transform",function(M,O){const F=S.length,U=(M.endAngle-M.startAngle)*(180/Math.PI);if(O>=F-2&&U<Lt.callout.minSliceDegree){let R,B;return M.index===F-1?(R=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,B=M.yPosition-Lt.callout.offsetY,M.direction=ss.RIGHT,_.push(M)):(R=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,B=M.yPosition-Lt.callout.offsetY,M.direction=ss.LEFT,_.push(M)),`translate(${R}, ${B})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=y(r,"donut")?"donut":"pie",D=y(r,C,"alignment"),{width:$}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let H=l+P;D===Gt.CENTER?H=$/2:D===Gt.RIGHT&&(H=$-l-Lt.xOffset);let N=l+w;_.length>0&&(N+=Lt.yOffsetCallout),i.attr("x",H+7).attr("y",N),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.GROUP).attr("data-name","callouts"),i=n.selectAll("g.callout").data(t);i.exit().remove();const r=i.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");r.merge(i).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===ss.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),r.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),r.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,i){const r=I(this);t.isRendering||r.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:i});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{label:i.data[s],value:i.data[a]}]})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);UD(()=>{t.isRendering||r.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),i=this.getOptions(),r=Math.min(t,n)/2;return i.pie.labels.enabled?r+Lt.radiusOffset:r}}class T2 extends mv{constructor(){super(...arguments),this.type="donut",this.renderType=st.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const i=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),r=this.getOptions(),s=this.computeRadius(),a=y(r,"donut","center","label");k.appendOrSelect(i,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>r.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&k.appendOrSelect(i,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>r.donut.center.titleFontSize(s)).attr("y",r.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let i=y(n,"donut","center","number");i===null&&(i=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const r=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;r%1===0&&i%1===0?s=xh:s=xe;const a=s(r,i);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const vv="4,10 8,6 12,10",yv="12,6 8,10 4,6";class O2 extends vt{constructor(){super(...arguments),this.type="gauge",this.renderType=st.SVG}getValue(){return this.model.getData().find(i=>i.group==="value")?.value??null}getValueRatio(){return Wp(this.getValue(),0,100)/100}getDelta(){return this.model.getData().find(i=>i.group==="delta")?.value??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===ui.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case Xa.UP:return vv;case Xa.DOWN:return yv;default:return t>0?vv:yv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),i=this.getOptions(),r=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=zr().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=zr().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([r]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=y(i,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Gt.CENTER?v=m/2:g===Gt.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),i=y(n,"gauge","type"),r=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;i===ui.FULL&&!s?d=l(a):i===ui.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),S=p.selectAll("text.gauge-value-number").data([r]);S.enter().append("text").attr("class","gauge-value-number").merge(S).style("font-size",`${f}px`).attr("text-anchor","middle").text($=>{let P;return $!=null?P=Number($.toFixed(2))%1!==0?$.toFixed(2):$.toFixed():P=0,v?v(P):m(Number(P),g)});const{width:E}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,x=u?"%":"",_=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",E/2).text(x),{width:C,height:D}=k.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${D/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=this.getDelta(),{code:s,number:a}=y(i,"locale");if(r){const o=this.computeRadius(),l=r?y(i,"gauge","deltaFontSize"):()=>0,c=r?y(i,"gauge","numberFormatter"):()=>null,u=y(i,"gauge","deltaArrow","size"),d=y(i,"gauge","numberSpacing"),h=y(i,"gauge","showPercentageSymbol"),f=k.appendOrSelect(n,"g.gauge-numbers"),p=k.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=k.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(r===null?[]:[r]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let x;return b!=null?x=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():x=0,c?`${c(x)}${m}`:`${a(Number(x),s)}${m}`});const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),S=y(i,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(r!==null&&S?[r]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=I(this);k.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=y(i,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(r))}),E.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,i){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:r,datum:i})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:r,datum:i})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===ui.SEMI?Math.min(i/2,r):Math.min(i/2,r/2)}}class Ev extends Lu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=st.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:r}=i.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=rs(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth(h)/2;return this.services.cartesianScales.getOrientation()===Ht.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[r]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:h[r],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[r],h[f],h)}).attr("d",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h),p=h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f],m=this.getGroupScaleForLabel(p)(h[r]),v=this.getBarWidth(),S=m,E=m+v,b=this.services.cartesianScales.getRangeAxisPosition({datum:h}),x=this.services.cartesianScales.getDomainLowerBound(b),_=this.services.cartesianScales.getValueThroughAxisPosition(b,x),C=this.services.cartesianScales.getRangeValue(h),D=this.services.cartesianScales.getDomainValue(h)-v/2,$=D+v;if(!this.isOutsideZoomedDomain(D,$))return se({x0:S,x1:E,y0:_,y1:C},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),i=this.parent.selectAll("path.bar");n?i.style("pointer-events","none"):i.style("pointer-events",null),i.on("mouseover",function(r,s){const a=I(this);a.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s}),n||t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:a,data:[s]})}).on("mousemove",function(r,s){const a=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:r,element:I(this),datum:s})}).on("mouseout",function(r,s){const a=I(this);a.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(i=>{const r=this.services.cartesianScales.getDomainIdentifier(i);return i[r].toString()===t})}getGroupWidth(t){const n=this.getOptions();if(!(y(n,"bars","preserveSpaceForMissingBars")!==!1)&&t){const a=this.getDataCorrespondingToLabel(t),o=this.getTotalGroupPadding(a.length);return this.getBarWidth()*a.length+o}const r=this.model.getGroupedData(this.configs.groups),s=this.getTotalGroupPadding();return this.getBarWidth()*r.length+s}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let i=this.defaultStepFactor;if(typeof t.step=="function")i=t.step();else if(n.length>0){const r=n.find(s=>s.data?.length>1);if(r){const s=this.services.cartesianScales.getDomainIdentifier(r.data[0]);i=Math.abs(t(r.data[1][s])-t(r.data[0][s]))}}return i}getTotalGroupPadding(t){const n=this.model.getGroupedData(this.configs.groups),i=t!==void 0?t:n.length;return i===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(i-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),i=y(t,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Li().domain(t).rangeRound([0,this.getGroupWidth()])}getGroupScaleForLabel(t){const n=this.getOptions();if(!(y(n,"bars","preserveSpaceForMissingBars")!==!1)){const r=this.getDataCorrespondingToLabel(t),{groupMapsTo:s}=n.data,a=r.map(o=>o[s]);return Li().domain(a).rangeRound([0,this.getGroupWidth(t)])}return this.groupScale}}class w2 extends vt{constructor(){super(...arguments),this.type="heatmap",this.renderType=st.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:i}=n,r=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[i]!==void 0?(u=a,r.forEach(p=>{if(typeof this.matrix[i][p].value=="number"){const g=this.matrix[i][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][i].value=="number"){const g=this.matrix[p][i].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(i)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(i)}, ${Nn(c.range())})`):c(i)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Nn(l.range())},${c(i)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:i,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:i}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const r=i.getMainXScale(),s=i.getMainYScale(),a=i.getDomainIdentifier(),o=i.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=r.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${r(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,i){const r=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(r,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(r,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",i+1),k.appendOrSelect(r,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",i).attr("y2",i),k.appendOrSelect(r,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",i+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Ki.OFF&&(t===Ki.AUTO&&$g.minCellDividerDimension<=this.xBandwidth&&$g.minCellDividerDimension<=this.yBandwidth||t===Ki.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,i=this.getOptions(),r=Et(i,"locale.translations.total")||Et(i,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=us(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:r,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class M2 extends vt{constructor(){super(...arguments),this.type="histogram",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),i=this.model.getOptions(),{groupIdentifier:r}=i,{groupMapsTo:s}=i.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>Et(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(r,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=Et(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>i.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),se({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:i,number:r}=y(t,"locale"),s=y(t,"tooltip","alwaysShowRulerTooltip"),a=this.parent.selectAll("path.bar");s?a.style("pointer-events","none"):a.style("pointer-events",null);const o=this;a.on("mouseover",function(l,c){const u=I(this);u.classed("hovered",!0);const d=r(parseFloat(Et(c,"data.x0")),i),h=r(parseFloat(Et(c,"data.x1")),i),f=o.services.cartesianScales.getRangeAxisPosition(),p=o.services.cartesianScales.getScaleLabel(f);s||o.services.events.dispatchEvent(T.Tooltip.SHOW,{event:l,hoveredElement:u,items:[{label:Et(t,"bins.rangeLabel")||"Range",value:`${d} – ${h}`},{label:t.tooltip.groupLabel||"Group",value:c[n],class:o.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:c[n]})},{label:p,value:Et(c,`data.${c[n]}`)}]})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){I(this).classed("hovered",!1),o.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class C2 extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=st.SVG,this.handleScatterOnHover=t=>{const n=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[r]!==n.datum[r]?wn.weight.unselected:wn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",wn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[r]!==n.datum().name?wn.opacity.unselected:wn.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",wn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),i=this.model.getOptions(),{groupMapsTo:r}=i.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Cn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[r]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v[r],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[r],v[l],v)).attr("opacity",1);d===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-i.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+i.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class A2 extends vt{constructor(){super(...arguments),this.type="meter",this.renderType=st.SVG}getStackedBounds(t,n){let i=0;return t.map((s,a)=>a!==0?(i+=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:i-n(s.value)}):(i=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:0}))}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"meter lines"}),r=this.getOptions(),s=y(r,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(i,{useAttrs:!0}),{groupMapsTo:c}=r.data;let u;if(y(r,"meter","proportional")===null)u=100;else{const E=y(r,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ve().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(r,"meter","height");k.appendOrSelect(i,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?jt.height.proportional:jt.height.default)),k.appendOrSelect(i,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?jt.height.proportional:jt.height.default));const p=i.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",E=>E.x).attr("y",0).attr("height",()=>f||(s?jt.height.proportional:jt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):Math.max(E.width,2)).style("fill",E=>n.model.getFillColor(E[c],null,E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.value),p.exit().remove();const m=y(r,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const S=i.selectAll("line.peak").data(v==null?[]:[v]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>f||(s?jt.height.proportional:jt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!0),i.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),r&&i.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!1),i.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function xv(e){const t=D2(bv(e),360);return Vn(t,[0,10])||Vn(t,[350,0])?{textAnchor:nn.START,dominantBaseline:rn.MIDDLE}:Vn(t,[10,80])?{textAnchor:nn.START,dominantBaseline:rn.HANGING}:Vn(t,[80,100])?{textAnchor:nn.MIDDLE,dominantBaseline:rn.HANGING}:Vn(t,[100,170])?{textAnchor:nn.END,dominantBaseline:rn.HANGING}:Vn(t,[170,190])?{textAnchor:nn.END,dominantBaseline:rn.MIDDLE}:Vn(t,[190,260])?{textAnchor:nn.END,dominantBaseline:rn.BASELINE}:Vn(t,[260,280])?{textAnchor:nn.MIDDLE,dominantBaseline:rn.BASELINE}:{textAnchor:nn.START,dominantBaseline:rn.BASELINE}}function D2(e,t){return(e%t+t)%t}function Vn(e,[t,n]){return e>=t&&e<=n}function bv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const i=t*Math.cos(e)+n.x,r=t*Math.sin(e)+n.y;return{x:isNaN(i)?0:i,y:isNaN(r)?0:r}}function L2(e,t){return t*Math.sin(e-Math.PI/2)}class R2 extends vt{constructor(){super(...arguments),this.type="radar",this.renderType=st.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),i=k.appendOrSelect(n,"text").text(t),{width:r,height:s}=k.getSVGElementSize(i.node(),{useBBox:!0});return n.remove(),{width:r,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:i,value:r}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=VD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[i]:o,[s]:l,[r]:null}))));return ut(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:i,value:r}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[i]:c,[r]:null}));return{name:a,data:ut(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-blob"})).style("fill-opacity",i=>i.name!==n.datum().name?hi.opacity.unselected:hi.opacity.selected).style("stroke-opacity",i=>i.name!==n.datum().name?hi.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",hi.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=hi;this.uniqueKeys=Array.from(new Set(s.map(L=>L[u]))),this.uniqueGroups=Array.from(new Set(s.map(L=>L[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),x=(Math.min(i,r)-S)/2;if(x<=0)return;const _=Li().domain(this.fullDataNormalized.map(L=>L[u])).range([0,2*Math.PI].map(L=>L-Math.PI/2)),C=Nn(this.fullDataNormalized.map(L=>L[d])),D=Ve().domain([C>=0?0:C,Wn(this.fullDataNormalized.map(L=>L[d]))]).range([g,x]).nice(p),$=D.ticks(p),P=(L,G,V)=>this.model.getFillColor(L,G,V),w=Y_().angle(L=>_(L[u])+Math.PI/2).radius(L=>D(L[d])).curve(Nf),H=this.uniqueKeys.map(L=>{const G=this.getLabelDimensions(L).width,V=L2(_(L),x);return G+V}),M={x:Wn(H)+h,y:r/2},F=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data($,L=>L),U=L=>this.uniqueKeys.map(G=>({[u]:G,[d]:L}));F.join(L=>L.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>w(U(V)))),L=>L.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(U(V)))),L=>L.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(U(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,L=>L).join(L=>L.append("line").attr("opacity",0).attr("class",G=>`x-axis-${Yi(G)}`).attr("stroke-dasharray","0").attr("x1",G=>Ft(_(G),0,M).x).attr("y1",G=>Ft(_(G),0,M).y).attr("x2",G=>Ft(_(G),0,M).x).attr("y2",G=>Ft(_(G),0,M).y).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),L=>L.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),L=>L.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(L=>L.append("text").text(G=>G).attr("opacity",0).attr("x",G=>Ft(_(G),D.range()[1]+h,M).x).attr("y",G=>Ft(_(G),D.range()[1]+h,M).y).style("text-anchor",G=>xv(_(G)).textAnchor).style("dominant-baseline",G=>xv(_(G)).dominantBaseline).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),L=>L.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ft(_(V),D.range()[1]+h,M).x).attr("y",V=>Ft(_(V),D.range()[1]+h,M).y).end().finally(()=>{const V=y(o,"radar","alignment"),yt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",yt)})),L=>L.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,L=>L.name).join(L=>L.append("path").attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",G=>P(G.name,null,G.data)).style("fill-opacity",hi.opacity.selected).style("stroke",G=>P(G.name,null,G.data)).call(G=>{const V=G.transition().call(yt=>this.services.transitions.setupTransition({transition:yt,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),V.attr("opacity",1).attr("d",yt=>w(yt.data))}),L=>(L.attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).style("fill",G=>P(G.name,null,G.data)).style("stroke",G=>P(G.name,null,G.data)),L.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(V.data))),L),L=>L.call(G=>{const V=G.transition().call(yt=>this.services.transitions.setupTransition({transition:yt,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(L=>y(L,d)!==null)).join(L=>L.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),L=>L,L=>L.remove()).attr("class",L=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:L[l],originalClassName:Yi(L[u])})).attr("cx",L=>Ft(_(L[u]),D(L[d]),M).x).attr("cy",L=>Ft(_(L[u]),D(L[d]),M).y).attr("r",0).attr("opacity",0).style("fill",L=>P(L[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(L=>L.append("rect"),L=>L,L=>L.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",D.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",L=>`rotate(${bv(_(L))}, ${M.x}, ${M.y})`);const{code:ct,number:W}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Ue($)).join(L=>L.append("text").attr("opacity",0).text(G=>W(G,ct)).attr("x",G=>Ft(-Math.PI/2,D(G),M).x+f).attr("y",G=>Ft(-Math.PI/2,D(G),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),L=>L.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ft(-Math.PI/2,D(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,D(V),M).y)),L=>L.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,i){const r=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(i,{useAttrs:!0});let a=0;return t===Gt.CENTER?a=Math.floor((s-r.width)/2):t===Gt.RIGHT&&(a=s-r.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(i,r){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:i,element:s,datum:r});const a=t.parent.select(`.x-axes .x-axis-${Yi(r)}`),o=t.parent.selectAll(`.dots circle.${Yi(r)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",hi.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===r&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(i,r){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:i,element:I(this),datum:r})}).on("mouseout",function(i,r){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Yi(r)}`),o=t.parent.selectAll(`.dots circle.${Yi(r)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class Sv extends Lu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=r.selectAll("path.bar").data(s,c=>c[i]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[i],c[u],c)}).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return se({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),i=this.parent.selectAll("path.bar");n?i.style("pointer-events","none"):i.style("pointer-events",null),i.on("mouseover",function(r,s){const a=I(this);a.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s}),n||t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:a,data:[s]})}).on("mousemove",function(r,s){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:r,element:I(this),datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:r,element:I(this),datum:s})}).on("mouseout",function(r,s){const a=I(this);a.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class I2 extends ue{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),i=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!i?super.renderGridSkeleton(n):n&&i?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),i=[100],r=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=r.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),r.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class _v extends vt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,r)!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",On.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),i=this,r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(p=>r.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=Xl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>i.model.getFillColor(y(p,0,s),null,p)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",On.opacity.selected).attr("d",this.areaGenerator)}}class Tv extends Lu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,r));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>i.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1)}return se({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=y(t,"tooltip","alwaysShowRulerTooltip"),r=this.parent.selectAll("path.bar");i?r.style("pointer-events","none"):r.style("pointer-events",null);const s=this;r.on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0),s.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:a,element:l,datum:o});let u=s.model.getDisplayData(s.configs.groups).find(d=>{const h=s.services.cartesianScales.getDomainIdentifier(d),f=s.services.cartesianScales.getRangeIdentifier(d);return d[f]===o.data[o[n]]&&d[h].toString()===o.data.sharedStackKey&&d[n]===o[n]});if(u===void 0){const d=s.services.cartesianScales.getDomainIdentifier(),h=s.services.cartesianScales.getRangeIdentifier();u={[d]:o.data.sharedStackKey,[h]:o.data[o[n]],[n]:o[n]}}i||s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,data:[u]})}).on("mousemove",function(a,o){const l=I(this);s.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){s.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);l.classed("hovered",!1),s.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:l})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,r=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,i*s/r)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Ov extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=st.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const i=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(f=>r.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=i.selectAll("g.dots").data(o,f=>y(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ft.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=Object.keys(i.axes).some(l=>i.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[r],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[r]:h,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[r]==l[r]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const ar=6;class k2 extends vt{constructor(){super(...arguments),this.type="tree",this.renderType=st.SVG}getLongestLabel(t){let n="";return t.forEach(i=>{const r=i.children?this.getLongestLabel(i.children):"";(r.length>n.length||i.name.length>n.length)&&(n=r.length>i.name.length?r:i.name)}),n}getMockLabelWidth(t,n){const i=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:r}=k.getSVGElementSize(i.node(),{useBBox:!0});return i.remove(),r}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+ar:30-ar},h=Nr({name:o,children:a}),f=10,p=i/6,g=_=>{const C=h.descendants().reverse(),D=h.links();let $=h,P=h;h.eachBefore(R=>{R.x<$.x&&($=R),R.x>P.x&&(P=R)});const w=P.x-$.x,H=n.transition().call(R=>this.services.transitions.setupTransition({transition:R,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,$.x,i,w].join(" ")),N=x.selectAll("g").data(C,R=>R.id),M=this,O=N.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",R=>R.depth!==0&&R.children&&R.children.length>0?"clickable":null).on("mouseover",function(R,B){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:R,element:I(this),datum:B})}).on("click",function(R,B){B.depth!==0&&(B.children=B.children?null:B._children,g(B)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:R,element:I(this),datum:B})}).on("mouseout",function(R,B){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:R,element:I(this),datum:B})});O.append("circle").attr("r",2.5).attr("class",R=>R._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",R=>R._children?-ar:ar).attr("text-anchor",R=>R._children?"end":"start").text(R=>R.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(H).attr("transform",R=>`translate(${R.y},${R.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),N.exit().transition(H).remove().attr("transform",()=>`translate(${_.y},${_.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const F=b.selectAll("path").data(D,R=>R.target.id),U=F.enter().append("path").attr("d",()=>{const R={x:_.x0,y:_.y0};return E({source:R,target:R})});F.merge(U).transition(H).attr("d",E),F.exit().transition(H).remove().attr("d",()=>{const R={x:_.x,y:_.y};return E({source:R,target:R})}),h.eachBefore(R=>{R.x0=R.x,R.y0=R.y})},m=h.descendants(),v=m[m.length-1].depth,S=y(s,"tree","type")===qa.DENDROGRAM?fb().size([r,i-u-v*ar-l]):tS().nodeSize([f,p]).size([r,i-u-v*ar-l]),E=Q_().x(_=>_.y).y(_=>_.x);h.x0=p/2,h.y0=0,h.descendants().forEach((_,C)=>{_.id=C,_._children=_.children}),S(h),n.attr("viewBox",[-d.left,-0,i,f]).style("user-select","none");const b=n.append("g").attr("class","links"),x=n.append("g").attr("class","nodes");g(h)}}var P2="#000000",N2="#ffffff",$2="#fcf4d6",F2="#fddc69",U2="#f1c21b",B2="#d2a106",H2="#b28600",G2="#8e6a00",V2="#684e00",z2="#483700",W2="#302400",Y2="#1c1500",q2={10:$2,20:F2,30:U2,40:B2,50:H2,60:G2,70:V2,80:z2,90:W2,100:Y2},X2="#fff2e8",Z2="#ffd9be",j2="#ffb784",K2="#ff832b",Q2="#eb6200",J2="#ba4e00",tP="#8a3800",eP="#5e2900",nP="#3e1a00",iP="#231000",rP={10:X2,20:Z2,30:j2,40:K2,50:Q2,60:J2,70:tP,80:eP,90:nP,100:iP},sP="#fff1f1",aP="#ffd7d9",oP="#ffb3b8",lP="#ff8389",cP="#fa4d56",uP="#da1e28",hP="#a2191f",dP="#750e13",fP="#520408",pP="#2d0709",gP={10:sP,20:aP,30:oP,40:lP,50:cP,60:uP,70:hP,80:dP,90:fP,100:pP},mP="#fff0f7",vP="#ffd6e8",yP="#ffafd2",EP="#ff7eb6",xP="#ee5396",bP="#d02670",SP="#9f1853",_P="#740937",TP="#510224",OP="#2a0a18",wP={10:mP,20:vP,30:yP,40:EP,50:xP,60:bP,70:SP,80:_P,90:TP,100:OP},MP="#f6f2ff",CP="#e8daff",AP="#d4bbff",DP="#be95ff",LP="#a56eff",RP="#8a3ffc",IP="#6929c4",kP="#491d8b",PP="#31135e",NP="#1c0f30",$P={10:MP,20:CP,30:AP,40:DP,50:LP,60:RP,70:IP,80:kP,90:PP,100:NP},FP="#edf5ff",UP="#d0e2ff",BP="#a6c8ff",HP="#78a9ff",GP="#4589ff",VP="#0f62fe",zP="#0043ce",WP="#002d9c",YP="#001d6c",qP="#001141",XP={10:FP,20:UP,30:BP,40:HP,50:GP,60:VP,70:zP,80:WP,90:YP,100:qP},ZP="#e5f6ff",jP="#bae6ff",KP="#82cfff",QP="#33b1ff",JP="#1192e8",tN="#0072c3",eN="#00539a",nN="#003a6d",iN="#012749",rN="#061727",sN={10:ZP,20:jP,30:KP,40:QP,50:JP,60:tN,70:eN,80:nN,90:iN,100:rN},aN="#d9fbfb",oN="#9ef0f0",lN="#3ddbd9",cN="#08bdba",uN="#009d9a",hN="#007d79",dN="#005d5d",fN="#004144",pN="#022b30",gN="#081a1c",mN={10:aN,20:oN,30:lN,40:cN,50:uN,60:hN,70:dN,80:fN,90:pN,100:gN},vN="#defbe6",yN="#a7f0ba",EN="#6fdc8c",xN="#42be65",bN="#24a148",SN="#198038",_N="#0e6027",TN="#044317",ON="#022d0d",wN="#071908",MN={10:vN,20:yN,30:EN,40:xN,50:bN,60:SN,70:_N,80:TN,90:ON,100:wN},CN="#f2f4f8",AN="#dde1e6",DN="#c1c7cd",LN="#a2a9b0",RN="#878d96",IN="#697077",kN="#4d5358",PN="#343a3f",NN="#21272a",$N="#121619",FN={10:CN,20:AN,30:DN,40:LN,50:RN,60:IN,70:kN,80:PN,90:NN,100:$N},UN="#f4f4f4",BN="#e0e0e0",HN="#c6c6c6",GN="#a8a8a8",VN="#8d8d8d",zN="#6f6f6f",WN="#525252",YN="#393939",qN="#262626",XN="#161616",ZN={10:UN,20:BN,30:HN,40:GN,50:VN,60:zN,70:WN,80:YN,90:qN,100:XN},jN="#f7f3f2",KN="#e5e0df",QN="#cac5c4",JN="#ada8a8",t$="#8f8b8b",e$="#726e6e",n$="#565151",i$="#3c3838",r$="#272525",s$="#171414",a$={10:jN,20:KN,30:QN,40:JN,50:t$,60:e$,70:n$,80:i$,90:r$,100:s$},wv={black:{100:P2},blue:XP,coolGray:FN,cyan:sN,gray:ZN,green:MN,magenta:wP,orange:rP,purple:$P,red:gP,teal:mN,warmGray:a$,white:{0:N2},yellow:q2};const o$=e=>{if(!e)return null;for(const t of Object.keys(wv)){const n=wv[t];for(const i of Object.keys(n))if(n[+i]===e)return i}return null},Mv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),i=dn(n);let r;if(i&&(r=o$(i?i.hex():null)),r==null){const s=mh(i).l;r=Math.abs(s*100-100)}return r>50?"white":"black"};let l$=0;class c$ extends vt{constructor(){super(...arguments),this.type="treemap",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-treemap"})).attr("opacity",i=>i.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const i=this.model.getDisplayData(),r=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Nr({name:r.title||"Treemap",children:i}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=sS().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>l$++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=I(this.parentNode).attr("data-uid");return`${r.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${r.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${r.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",Mv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),S=`${r.style.prefix}-clip-${v}`;return`url(${new URL(`#${S}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Mv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,i){const r=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=i;for(;a.depth>1;)a=a.parent;r.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),dn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:s,label:a.data.name,bold:!0},{label:i.data.name,value:i.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1);let s=i;for(;s.depth>1;)s=s.parent;r.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:r})})}}function u$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function h$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}),n}var d$={value:function(){}};function Cv(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new mo(n)}function mo(e){this._=e}function f$(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}mo.prototype=Cv.prototype={constructor:mo,on:function(e,t){var n=this._,i=f$(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=p$(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=Av(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Av(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new mo(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function p$(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function Av(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=d$,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}const g$=h$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Cv},Symbol.toStringTag,{value:"Module"})));var Ru,Dv;function m$(){if(Dv)return Ru;Dv=1;const e=g$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},i=64,r=2048;Ru=function(){var b=[256,256],x=s,_=a,C=l,D=o,$=o,P=c,w=u,H=g,N=[],M=1/0,O=e("word","end"),F=null,U=Math.random,R={},B=S;R.canvas=function(Y){return arguments.length?(B=E(Y),R):B},R.start=function(){var Y=tt(B()),Q=v((b[0]>>5)*b[1]),ht=null,et=N.length,K=-1,nt=[],ct=N.map(function(j,J){return j.text=x.call(this,j,J),j.font=_.call(this,j,J),j.style=D.call(this,j,J),j.weight=$.call(this,j,J),j.rotate=P.call(this,j,J),j.size=~~C.call(this,j,J),j.padding=w.call(this,j,J),j}).sort(function(j,J){return J.size-j.size});return F&&clearInterval(F),F=setInterval(W,0),W(),R;function W(){for(var j=Date.now();Date.now()-j<M&&++K<et&&F;){var J=ct[K];J.x=b[0]*(U()+.5)>>1,J.y=b[1]*(U()+.5)>>1,d(Y,J,ct,K),J.hasText&&Z(Q,J,ht)&&(nt.push(J),O.call("word",R,J),ht?f(ht,J):ht=[{x:J.x+J.x0,y:J.y+J.y0},{x:J.x+J.x1,y:J.y+J.y1}],J.x-=b[0]>>1,J.y-=b[1]>>1)}K>=et&&(R.stop(),O.call("end",R,nt,ht))}},R.stop=function(){F&&(clearInterval(F),F=null);for(const Y of N)delete Y.sprite;return R};function tt(Y){const Q=Y.getContext("2d",{willReadFrequently:!0});Y.width=Y.height=1;const ht=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return Y.width=(i<<5)/ht,Y.height=r/ht,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ht}}function Z(Y,Q,ht){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),ct=H(b),W=U()<.5?1:-1,j=-W,J,L,G;(J=ct(j+=W))&&(L=~~J[0],G=~~J[1],!(Math.min(Math.abs(L),Math.abs(G))>=nt));)if(Q.x=et+L,Q.y=K+G,!(Q.x+Q.x0<0||Q.y+Q.y0<0||Q.x+Q.x1>b[0]||Q.y+Q.y1>b[1])&&(!ht||p(Q,ht))&&!h(Q,Y,b[0])){for(var V=Q.sprite,yt=Q.width>>5,Ut=b[0]>>5,at=Q.x-(yt<<4),bt=at&127,$e=32-bt,he=Q.y1-Q.y0,Os=(Q.y+Q.y0)*Ut+(at>>5),lr,ws=0;ws<he;ws++){lr=0;for(var Rn=0;Rn<=yt;Rn++)Y[Os+Rn]|=lr<<$e|(Rn<yt?(lr=V[ws*yt+Rn])>>>bt:0);Os+=Ut}return!0}return!1}return R.timeInterval=function(Y){return arguments.length?(M=Y??1/0,R):M},R.words=function(Y){return arguments.length?(N=Y,R):N},R.size=function(Y){return arguments.length?(b=[+Y[0],+Y[1]],R):b},R.font=function(Y){return arguments.length?(_=E(Y),R):_},R.fontStyle=function(Y){return arguments.length?(D=E(Y),R):D},R.fontWeight=function(Y){return arguments.length?($=E(Y),R):$},R.rotate=function(Y){return arguments.length?(P=E(Y),R):P},R.text=function(Y){return arguments.length?(x=E(Y),R):x},R.spiral=function(Y){return arguments.length?(H=n[Y]||Y,R):H},R.fontSize=function(Y){return arguments.length?(C=E(Y),R):C},R.padding=function(Y){return arguments.length?(w=E(Y),R):w},R.random=function(Y){return arguments.length?(U=Y,R):U},R.on=function(){var Y=O.on.apply(O,arguments);return Y===O?R:Y},R};function s(b){return b.text}function a(){return"serif"}function o(){return"normal"}function l(b){return Math.sqrt(b.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(b,x,_,C){if(!x.sprite){var D=b.context,$=b.ratio;D.clearRect(0,0,(i<<5)/$,r/$);var P=0,w=0,H=0,N=_.length;for(--C;++C<N;){x=_[C],D.save(),D.font=x.style+" "+x.weight+" "+~~((x.size+1)/$)+"px "+x.font;const J=D.measureText(x.text),L=-Math.floor(J.width/2);let G=(J.width+1)*$,V=x.size<<1;if(x.rotate){var M=Math.sin(x.rotate*t),O=Math.cos(x.rotate*t),F=G*O,U=G*M,R=V*O,B=V*M;G=Math.max(Math.abs(F+B),Math.abs(F-B))+31>>5<<5,V=~~Math.max(Math.abs(U+R),Math.abs(U-R))}else G=G+31>>5<<5;if(V>H&&(H=V),P+G>=i<<5&&(P=0,w+=H,H=0),w+V>=r)break;D.translate((P+(G>>1))/$,(w+(V>>1))/$),x.rotate&&D.rotate(x.rotate*t),D.fillText(x.text,L,0),x.padding&&(D.lineWidth=2*x.padding,D.strokeText(x.text,L,0)),D.restore(),x.width=G,x.height=V,x.xoff=P,x.yoff=w,x.x1=G>>1,x.y1=V>>1,x.x0=-x.x1,x.y0=-x.y1,x.hasText=!0,P+=G}for(var tt=D.getImageData(0,0,(i<<5)/$,r/$).data,Z=[];--C>=0;)if(x=_[C],!!x.hasText){for(var Y=x.width,Q=Y>>5,ht=x.y1-x.y0,et=0;et<ht*Q;et++)Z[et]=0;if(P=x.xoff,P==null)return;w=x.yoff;for(var K=0,nt=-1,ct=0;ct<ht;ct++){for(var et=0;et<Y;et++){var W=Q*ct+(et>>5),j=tt[(w+ct)*(i<<5)+(P+et)<<2]?1<<31-et%32:0;Z[W]|=j,K|=j}K?nt=ct:(x.y0++,ht--,ct--,w++)}x.y1=x.y0+nt,x.sprite=Z.slice(0,(x.y1-x.y0)*Q)}}}function h(b,x,_){_>>=5;for(var C=b.sprite,D=b.width>>5,$=b.x-(D<<4),P=$&127,w=32-P,H=b.y1-b.y0,N=(b.y+b.y0)*_+($>>5),M,O=0;O<H;O++){M=0;for(var F=0;F<=D;F++)if((M<<w|(F<D?(M=C[O*D+F])>>>P:0))&x[N+F])return!0;N+=_}return!1}function f(b,x){var _=b[0],C=b[1];x.x+x.x0<_.x&&(_.x=x.x+x.x0),x.y+x.y0<_.y&&(_.y=x.y+x.y0),x.x+x.x1>C.x&&(C.x=x.x+x.x1),x.y+x.y1>C.y&&(C.y=x.y+x.y1)}function p(b,x){return b.x+b.x1>x[0].x&&b.x+b.x0<x[1].x&&b.y+b.y1>x[0].y&&b.y+b.y0<x[1].y}function g(b){var x=b[0]/b[1];return function(_){return[x*(_*=.1)*Math.cos(_),_*Math.sin(_)]}}function m(b){var x=4,_=x*b[0]/b[1],C=0,D=0;return function($){var P=$<0?-1:1;switch(Math.sqrt(1+4*P*$)-P&3){case 0:C+=_;break;case 1:D+=x;break;case 2:C-=_;break;default:D-=x;break}return[C,D]}}function v(b){for(var x=[],_=-1;++_<b;)x[_]=0;return x}function S(){return document.createElement("canvas")}function E(b){return typeof b=="function"?b:function(){return b}}return Ru}var v$=m$();const y$=u$(v$);class E$ extends vt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-wordcloud"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),r=this.model.getDisplayData(),s=this.getFontSizeScale(r),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(i,{useAttrs:!0});if(u===0||d===0)return;const h=y$().size([u,d]).words(r.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=k.appendOrSelect(i,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,S=>`${S[c]}-${S.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>n.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:S[c],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>n.model.getFillColor(S[c],S.text,S)).attr("text-anchor","middle").transition().call(S=>n.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:t})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:i}=n.wordCloud,r=t.map(l=>l[i]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=r.length>0,o=a?Ue(r):[1,1];return Ve().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=Ya(s=>{const a=i.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>i.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;r(o),i.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),i.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:Et(t,"locale.translations.group")||Et(t,"tooltip.groupLabel")||"Group",value:a[n],class:i.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);i.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),i.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r(null),i.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),i.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class x$ extends vt{constructor(){super(...arguments),this.type="geo",this.renderType=st.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:i}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||i<1)return;const r=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=y2(s,Object.values(l)),u=g2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=r.fitSize([n,i],u),h=Ux().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=k.appendOrSelect(t,"defs");k.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Wr()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case sn.geoEqualEarth:t=rb();break;case sn.geoAlbers:t=Kx();break;case sn.geoConicEqualArea:t=Nd();break;case sn.geoConicEquidistant:t=nb();break;case sn.geoEquirectangular:t=tb();break;case sn.geoMercator:t=Qx();break;case sn.geoNaturalEarth1:t=sb();break;default:throw new Error("Projection is not supported.")}return t}}class b$ extends x${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),i=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),r=y(this.getOptions(),"color"),s=y(r,"gradient","colors");i.select("g.geo").selectAll("path").classed("border",!0).attr("class",o=>this.model.getColorClassName({value:n[o.properties.NAME].value,originalClassName:"border"})).attr("style",o=>s?`fill: ${this.model.getColorClassName({value:n[o.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(i,r){const s=I(this);t.services.events.dispatchEvent(Xi.CHOROPLETH_MOUSEOVER,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(qi.SHOW,{event:i,hoveredElement:s,items:[{label:r.properties.NAME,value:n[r.properties.NAME].value}]})}).on("mousemove",function(i,r){t.services.events.dispatchEvent(Xi.CHOROPLETH_MOUSEMOVE,{event:i,element:I(this),datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(qi.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(Xi.CHOROPLETH_CLICK,{event:i,element:I(this),datum:n[r.properties.NAME]})}).on("mouseout",function(i,r){const s=I(this);t.services.events.dispatchEvent(Xi.CHOROPLETH_MOUSEOUT,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(qi.HIDE,{event:i,hoveredElement:s})})}}class Lv extends Ze{constructor(t,n){super(t,n),this.model=new h2(this.services),this.model.setOptions(It(At.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Ss(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new nr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...r?[o]:[]],{direction:Ct.ROW,alignItems:ci.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new gv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:st.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:st.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||r){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new Eu(this.model,this.services),new uo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new b$(this.model,this.services)];return this.getChartComponents(t)}}class S$ extends an{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),i=ut({},t,this.getZoomOptions(t));Qc(n,i);const r=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ut(n,i),depth:s&&s<4?s:r})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),i=t||this.getOptions(),r=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return r.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(i,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:zt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=t.map(s=>{const a=s[i];return this.setChildrenDataGroup(s,a)});this.set({data:r},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(i=>this.setChildrenDataGroup(i,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,i)])}),super.formatTable({headers:r,cells:s})}getChildrenDatums(t,n,i=[],r=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(r+=l.value),u+=this.getChildrenDatums(l.children,c,i,u),i.push([c,s,a(u,o)]),r+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,r+=l.value),i.push([l.name,s,a(d,o)])}}),r}}class _$ extends Ze{constructor(t,n){super(t,n),this.model=new S$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new S2(this.model,this.services)];return this.getChartComponents(t)}}const Rv={[Se.LINE]:[rr,cn],[Se.SCATTER]:[cn],[Se.AREA]:[cv,rr,cn],[Se.STACKED_AREA]:[_v,rr,Ov,go],[Se.SIMPLE_BAR]:[Sv],[Se.GROUPED_BAR]:[Ev,sr],[Se.STACKED_BAR]:[Tv,go]};class T$ extends me{constructor(t,n){super(t,n);const i=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),i.comboChartTypes=[{type:Se.LINE,correspondingDatasets:[]}]),this.model.setOptions(i),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const i=t.map(r=>{const s=r.type;let a;if(typeof r.type=="string"){if(!Object.keys(Rv).includes(r.type))return console.error(`Invalid chart type "${r.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${cC(r.type)}Chart`;return a=ut({},At[l],this.model.getOptions(),r.options),r.type===Se.STACKED_AREA&&(o=!0),Rv[r.type].map(c=>new c(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ut({},this.model.getOptions(),r.options),new s(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a})}).filter(r=>r!==null);return gc(i)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===Se.STACKED_BAR||s.type===Se.STACKED_AREA),i=[new ve(this.model,this.services),new we(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID}),...n?[]:[new Gn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(i)}}class O$ extends an{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(i=>{i.key&&i.key!==i.group&&(i.group=i.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{valueMapsTo:r}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[i],c[r]===null?"–":s(c[r],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((i,r)=>r.value-i.value)}}class Iv extends Ze{constructor(t,n,i=!1){super(t,n),this.model=new O$(this.services),!i&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new mv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}class w$ extends Iv{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new T2(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.DONUT})];return this.getChartComponents(t)}}class M$ extends an{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{number:r,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[i],l.value===null?"–":r(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class C$ extends Ze{constructor(t,n){super(t,n),this.model=new M$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new O2(this.model,this.services)];return this.getChartComponents(t)}}class A$ extends me{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new Ev(this.model,this.services),new sr(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class D$ extends gi{constructor(t){super(t),this.axisFlavor=cs.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==it.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==it.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==it.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==it.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ue(this.getDisplayData(),i=>i.value),n=Ve().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(Ye(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getDomainIdentifier(),r=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[i])))}return this._domains}getUniqueRanges(){if(Ye(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getRangeIdentifier(),r=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[i])))}return this._ranges}getMatrix(){if(Ye(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=Tn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[i]][a[r]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(Tn(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ye(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[i]=a,l[r]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:i}=this.assignRangeAndDomains(),{number:r,code:s}=y(this.getOptions(),"locale"),a=[n.label,i.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[i.identifier]===null?"–":l[i.identifier],l.value===null?"–":r(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),i=!Ye(n);let r=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${r}-${u}`)}this._colorScale=kl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=fv(this.getDisplayData(),l)}}class L$ extends me{constructor(t,n){super(t,n),this.model=new D$(this.services),this.model.setOptions(It(At.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Ss(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new nr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new ce(this.model,this.services,[a,...r?[o]:[]],{direction:Ct.ROW,alignItems:ci.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new gv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:st.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:st.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new ce(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||r){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new Qm(this.model,this.services),new uo(this.model,this.services),new ce(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new ve(this.model,this.services),new w2(this.model,this.services)];return this.getAxisChartComponents(t)}}class R$ extends gi{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:i,code:r}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[Et(t,"bins.rangeLabel")||"Range",...s.map(l=>Et(l,`0.${n}`))],o=[...Et(s,0).map((l,c)=>[`${i(Number(Et(l,"data.x0")),r)} – ${i(Number(Et(l,"data.x1")),r)}`,...s.map(u=>i(Et(u[c],`data.${Et(u[c],n)}`),r))])];return super.formatTable({headers:a,cells:o})}}class I$ extends me{constructor(t,n){super(t,n),this.model=new R$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new x2(this.model,this.services),new M2(this.model,this.services)];return this.getAxisChartComponents(t)}}class k$ extends me{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new Gn(this.model,this.services),new rr(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new I2(this.model,this.services),new sr(this.model,this.services)];return this.getAxisChartComponents(t)}}class P$ extends me{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new Gn(this.model,this.services),new C2(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class N$ extends an{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((i,r)=>i+r.value,0)}getFillColor(t){const n=this.getOptions(),i=y(n,"color","scale"),r=this.getStatus();return i||!r?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),i=y(this.getDisplayData())?.reduce((a,o)=>a+o.value,0)??0,r=y(t,"meter","proportional")?i:i>100?100:i,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=r&&r<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...r?["Status"]:[]],c=[[d[i],d.value===null?"–":a(d.value,o),...r?[r]:[]]]}else{const d=y(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[i],h.value===null?"–":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class $$ extends Ze{constructor(t,n){super(t,n),this.model=new N$(this.services);const i=n.options.meter?.proportional?ut(Tn(At.proportionalMeterChart),n.options):ut(Tn(At.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new b2(this.model,this.services)],growth:dt.STRETCH,renderType:st.SVG},{id:"spacer",components:[new Ln(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new A2(this.model,this.services)],growth:dt.STRETCH,renderType:st.SVG}],i=[new ce(this.model,this.services,n,{direction:Ct.COLUMN})];return this.getChartComponents(i,{graphFrameRenderType:st.HTML})}}class F$ extends gi{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:i,value:r}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[i]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,r)!==null?s(y(u,"data",h,r),a):"–")])];return super.formatTable({headers:l,cells:c})}}class U$ extends Ze{constructor(t,n){super(t,n),this.model=new F$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new R2(this.model,this.services)];return this.getChartComponents(t)}}class B$ extends me{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new Gn(this.model,this.services),new cn(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class H$ extends an{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],i=[];return t.forEach(r=>{this.getChildrenDatums(r,i),i.push([r.name,"–"])}),super.formatTable({headers:n,cells:i})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(i=>{this.getChildrenDatums(i,n),n.push([i.name,t.name])})}}class G$ extends Ze{constructor(t,n){super(t,n),this.model=new H$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new k2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class V$ extends an{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,i)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,i)])}),super.formatTable({headers:r,cells:s})}}class z$ extends Ze{constructor(t,n){super(t,n),this.model=new V$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new c$(this.model,this.services)];return this.getChartComponents(t)}}class W$ extends me{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new Sv(this.model,this.services),new sr(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class Y$ extends me{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new go(this.model,this.services),new _v(this.model,this.services),new rr(this.model,this.services,{stacked:!0}),new Ov(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ue(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class q$ extends me{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new we(this.model,this.services),new go(this.model,this.services),new Tv(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ}),new sr(this.model,this.services)];return this.getAxisChartComponents(t)}}class X$ extends an{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:i,wordMapsTo:r}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[r],u[s],o(u[i],a)])];return super.formatTable({headers:l,cells:c})}}class Z$ extends Ze{constructor(t,n){super(t,n),this.model=new X$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new E$(this.model,this.services),new ue(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}q.Alignments=Gt,q.AlluvialChart=Rk,q.AreaChart=n2,q.AreaEvent=Fc,q.ArrowDirections=Xa,q.AxisEvent=$c,q.AxisFlavor=cs,q.AxisPositions=z,q.AxisTitleOrientations=Za,q.BarEvent=Gc,q.BoxplotChart=s2,q.BoxplotEvent=Vc,q.BubbleChart=o2,q.BulletChart=u2,q.CalloutDirections=ss,q.CanvasZoomEvent=Nc,q.CartesianOrientations=Ht,q.ChartEvent=Lc,q.ChartTheme=jc,q.ChartTypes=Se,q.ChoroplethChart=Lv,q.CirclePackChart=_$,q.ColorClassNameTypes=lt,q.ColorLegendType=ls,q.ComboChart=T$,q.DividerStatus=Ki,q.DominantBaseline=rn,q.DonutChart=w$,q.ExperimentalChoroplethChart=Lv,q.GaugeChart=C$,q.GaugeEvent=Hc,q.GaugeTypes=ui,q.GroupedBarChart=A$,q.HeatmapChart=L$,q.HistogramChart=I$,q.LayoutAlignItems=ci,q.LayoutDirection=Ct,q.LayoutGrowth=dt,q.LegendItemType=zt,q.LegendOrientations=ji,q.LegendPositions=Zi,q.LineChart=k$,q.LineEvent=Wc,q.LollipopChart=P$,q.MeterChart=$$,q.ModalEvent=Rc,q.ModelEvent=Ic,q.PieChart=Iv,q.PieEvent=Bc,q.Projection=sn,q.RadarChart=U$,q.RadarEvent=Yc,q.RenderTypes=st,q.ScaleTypes=it,q.ScatterChart=B$,q.ScatterEvent=zc,q.SimpleBarChart=W$,q.Skeletons=Vt,q.StackedAreaChart=Y$,q.StackedBarChart=q$,q.Statuses=as,q.TextAnchor=nn,q.ThresholdEvent=Zc,q.TickRotations=os,q.ToolbarControlTypes=_t,q.TooltipEvent=qi,q.TreeChart=G$,q.TreeEvent=qc,q.TreeTypes=qa,q.TreemapChart=z$,q.TreemapEvent=Xc,q.TruncationTypes=Ie,q.WordCloudChart=Z$,q.WordCloudEvent=Uc,q.ZoomBarTypes=qe,q.ZoomDomainEvent=Pc,q.ZoombarEvent=kc,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
|
74
|
+
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,i){const r=I(this);r.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!r.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(i.children){i.depth>1&&o&&(l=!0,r.classed("clickable",!0)),c=i.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:Et(f,"locale.translations.total")||Et(f,"tooltip.totalLabel")||"Total",value:i.value,bold:!0}],t.highlightChildren(i.children)}else d=i.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:h,label:i.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(_.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(_.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1),i.children&&t.unhighlightChildren(i.children),t.services.events.dispatchEvent(_.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:r})}).on("click",function(n,i){const r=I(this),s=r.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,tr)}else if(i.depth===2&&i.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=i,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(i,o,tr),n.stopPropagation()}t.services.events.dispatchEvent(_.CirclePack.CIRCLE_CLICK,{event:n,element:r,datum:i})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function R2(e,t){const n=_r(this._current,e);return i=>(this._current=n(i),t(this._current))}class Sv extends vt{constructor(){super(...arguments),this.type="pie",this.renderType=st.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r.data[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"pie graph"}),r=this.getOptions(),{groupMapsTo:s}=r.data,{valueMapsTo:a}=r.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(A=>A[a]>0),l=this.computeRadius();this.arc=Zr().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Zr().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=ZT().value(A=>A[a]).sort(y(r,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(i,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,A=>A.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",A=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:A.data[s],originalClassName:"slice"})).style("fill",A=>n.model.getFillColor(A.data[s],null,A.data)).attr("d",this.arc).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",A=>[A[a],Kc(A.data[a],o,a)+"%",A.data[s]].filter(Boolean).join(", ")).attrTween("d",function(A){return R2.bind(this)(A,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(r,"locale"),v=r.pie.labels.enabled,S=v?u.filter(A=>A.data[a]>0):[],b=k.appendOrSelect(i,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(S,A=>A.data[s]);b.exit().attr("opacity",0).remove();const x=b.enter().append("text").classed("pie-label",!0),T=[];x.merge(b).style("text-anchor","middle").text(A=>r.pie.labels.formatter?r.pie.labels.formatter({...A,percentageValue:Kc(A.data[a],o,a,!0)}):m(Kc(A.data[a],o,a),g)+"%").datum(function(A){const O=l+7,F=(A.endAngle-A.startAngle)/2+A.startAngle,U=F/Math.PI*180,R=this.getComputedTextLength();return A.textOffsetX=R/2,A.textOffsetY=U>90&&U<270?10:0,A.xPosition=(A.textOffsetX+O)*Math.sin(F),A.yPosition=(A.textOffsetY+O)*-Math.cos(F),A}).attr("transform",function(A,O){const F=S.length,U=(A.endAngle-A.startAngle)*(180/Math.PI);if(O>=F-2&&U<Lt.callout.minSliceDegree){let R,B;return A.index===F-1?(R=A.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+A.textOffsetX,B=A.yPosition-Lt.callout.offsetY,A.direction=us.RIGHT,T.push(A)):(R=A.xPosition-Lt.callout.offsetX-A.textOffsetX-Lt.callout.textMargin,B=A.yPosition-Lt.callout.offsetY,A.direction=us.LEFT,T.push(A)),`translate(${R}, ${B})`}return`translate(${A.xPosition}, ${A.yPosition})`}),this.renderCallouts(T);const C=y(r,"donut")?"donut":"pie",D=y(r,C,"alignment"),{width:$}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let G=l+P;D===Vt.CENTER?G=$/2:D===Vt.RIGHT&&(G=$-l-Lt.xOffset);let N=l+w;T.length>0&&(N+=Lt.yOffsetCallout),i.attr("x",G+7).attr("y",N),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.GROUP).attr("data-name","callouts"),i=n.selectAll("g.callout").data(t);i.exit().remove();const r=i.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");r.merge(i).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===us.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),r.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),r.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,i){const r=I(this);t.isRendering||r.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(_.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:i});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{label:i.data[s],value:i.data[a]}]})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(_.Pie.SLICE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(_.Pie.SLICE_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);WD(()=>{t.isRendering||r.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(_.Pie.SLICE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:r})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),i=this.getOptions(),r=Math.min(t,n)/2;return i.pie.labels.enabled?r+Lt.radiusOffset:r}}class I2 extends Sv{constructor(){super(...arguments),this.type="donut",this.renderType=st.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const i=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),r=this.getOptions(),s=this.computeRadius(),a=y(r,"donut","center","label");k.appendOrSelect(i,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>r.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&k.appendOrSelect(i,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>r.donut.center.titleFontSize(s)).attr("y",r.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let i=y(n,"donut","center","number");i===null&&(i=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const r=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;r%1===0&&i%1===0?s=Sh:s=Te;const a=s(r,i);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const Tv="4,10 8,6 12,10",_v="12,6 8,10 4,6";class k2 extends vt{constructor(){super(...arguments),this.type="gauge",this.renderType=st.SVG}getValue(){return this.model.getData().find(i=>i.group==="value")?.value??null}getValueRatio(){return qp(this.getValue(),0,100)/100}getDelta(){return this.model.getData().find(i=>i.group==="delta")?.value??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===di.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case Qa.UP:return Tv;case Qa.DOWN:return _v;default:return t>0?Tv:_v}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),i=this.getOptions(),r=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Zr().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Zr().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([r]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=y(i,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Vt.CENTER?v=m/2:g===Vt.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),i=y(n,"gauge","type"),r=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;i===di.FULL&&!s?d=l(a):i===di.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),S=p.selectAll("text.gauge-value-number").data([r]);S.enter().append("text").attr("class","gauge-value-number").merge(S).style("font-size",`${f}px`).attr("text-anchor","middle").text($=>{let P;return $!=null?P=Number($.toFixed(2))%1!==0?$.toFixed(2):$.toFixed():P=0,v?v(P):m(Number(P),g)});const{width:E}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,x=u?"%":"",T=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",E/2).text(x),{width:C,height:D}=k.getSVGElementSize(T,{useBBox:!0});T.attr("y",`-${D/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=this.getDelta(),{code:s,number:a}=y(i,"locale");if(r){const o=this.computeRadius(),l=r?y(i,"gauge","deltaFontSize"):()=>0,c=r?y(i,"gauge","numberFormatter"):()=>null,u=y(i,"gauge","deltaArrow","size"),d=y(i,"gauge","numberSpacing"),h=y(i,"gauge","showPercentageSymbol"),f=k.appendOrSelect(n,"g.gauge-numbers"),p=k.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=k.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(r===null?[]:[r]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let x;return b!=null?x=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():x=0,c?`${c(x)}${m}`:`${a(Number(x),s)}${m}`});const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),S=y(i,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(r!==null&&S?[r]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=I(this);k.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=y(i,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(r))}),E.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,i){t.services.events.dispatchEvent(_.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(_.Gauge.ARC_MOUSEMOVE,{event:n,element:r,datum:i})}).on("click",function(n,i){t.services.events.dispatchEvent(_.Gauge.ARC_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);t.services.events.dispatchEvent(_.Gauge.ARC_MOUSEOUT,{event:n,element:r,datum:i})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===di.SEMI?Math.min(i/2,r):Math.min(i/2,r/2)}}class Ov extends Du{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=st.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:r}=i.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=cs(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth(h)/2;return this.services.cartesianScales.getOrientation()===Ht.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[r]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:h[r],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[r],h[f],h)}).attr("d",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h),p=h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f],m=this.getGroupScaleForLabel(p)(h[r]),v=this.getBarWidth(),S=m,E=m+v,b=this.services.cartesianScales.getRangeAxisPosition({datum:h}),x=this.services.cartesianScales.getDomainLowerBound(b),T=this.services.cartesianScales.getValueThroughAxisPosition(b,x),C=this.services.cartesianScales.getRangeValue(h),D=this.services.cartesianScales.getDomainValue(h)-v/2,$=D+v;if(!this.isOutsideZoomedDomain(D,$))return le({x0:S,x1:E,y0:T,y1:C},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),i=this.parent.selectAll("path.bar");n?i.style("pointer-events","none"):i.style("pointer-events",null),i.on("mouseover",function(r,s){const a=I(this);a.classed("hovered",!0),t.services.events.dispatchEvent(_.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s}),n||t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:r,hoveredElement:a,data:[s]})}).on("mousemove",function(r,s){const a=I(this);t.services.events.dispatchEvent(_.Bar.BAR_MOUSEMOVE,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(_.Bar.BAR_CLICK,{event:r,element:I(this),datum:s})}).on("mouseout",function(r,s){const a=I(this);a.classed("hovered",!1),t.services.events.dispatchEvent(_.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:a})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(i=>{const r=this.services.cartesianScales.getDomainIdentifier(i);return i[r].toString()===t})}getGroupWidth(t){const n=this.getOptions();if(!(y(n,"bars","preserveSpaceForMissingBars")!==!1)&&t){const a=this.getDataCorrespondingToLabel(t),o=this.getTotalGroupPadding(a.length);return this.getBarWidth()*a.length+o}const r=this.model.getGroupedData(this.configs.groups),s=this.getTotalGroupPadding();return this.getBarWidth()*r.length+s}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let i=this.defaultStepFactor;if(typeof t.step=="function")i=t.step();else if(n.length>0){const r=n.find(s=>s.data?.length>1);if(r){const s=this.services.cartesianScales.getDomainIdentifier(r.data[0]);i=Math.abs(t(r.data[1][s])-t(r.data[0][s]))}}return i}getTotalGroupPadding(t){const n=this.model.getGroupedData(this.configs.groups),i=t!==void 0?t:n.length;return i===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(i-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),i=y(t,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Ii().domain(t).rangeRound([0,this.getGroupWidth()])}getGroupScaleForLabel(t){const n=this.getOptions();if(!(y(n,"bars","preserveSpaceForMissingBars")!==!1)){const r=this.getDataCorrespondingToLabel(t),{groupMapsTo:s}=n.data,a=r.map(o=>o[s]);return Ii().domain(a).rangeRound([0,this.getGroupWidth(t)])}return this.groupScale}}class P2 extends vt{constructor(){super(...arguments),this.type="heatmap",this.renderType=st.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:i}=n,r=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[i]!==void 0?(u=a,r.forEach(p=>{if(typeof this.matrix[i][p].value=="number"){const g=this.matrix[i][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][i].value=="number"){const g=this.matrix[p][i].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(i)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(i)}, ${Fn(c.range())})`):c(i)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Fn(l.range())},${c(i)})`),this.services.events.dispatchEvent(_.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:i,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(_.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(_.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(_.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(_.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(_.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:i}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const r=i.getMainXScale(),s=i.getMainYScale(),a=i.getDomainIdentifier(),o=i.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=r.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${r(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,i){const r=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(r,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(r,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",i+1),k.appendOrSelect(r,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",i).attr("y2",i),k.appendOrSelect(r,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",i+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Ji.OFF&&(t===Ji.AUTO&&Ug.minCellDividerDimension<=this.xBandwidth&&Ug.minCellDividerDimension<=this.yBandwidth||t===Ji.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,i=this.getOptions(),r=Et(i,"locale.translations.total")||Et(i,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=gs(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(_.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:r,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(_.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(_.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(_.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(_.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(_.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class N2 extends vt{constructor(){super(...arguments),this.type="histogram",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),i=this.model.getOptions(),{groupIdentifier:r}=i,{groupMapsTo:s}=i.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>Et(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(r,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=Et(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>i.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),le({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:i,number:r}=y(t,"locale"),s=y(t,"tooltip","alwaysShowRulerTooltip"),a=this.parent.selectAll("path.bar");s?a.style("pointer-events","none"):a.style("pointer-events",null);const o=this;a.on("mouseover",function(l,c){const u=I(this);u.classed("hovered",!0);const d=r(parseFloat(Et(c,"data.x0")),i),h=r(parseFloat(Et(c,"data.x1")),i),f=o.services.cartesianScales.getRangeAxisPosition(),p=o.services.cartesianScales.getScaleLabel(f);s||o.services.events.dispatchEvent(_.Tooltip.SHOW,{event:l,hoveredElement:u,items:[{label:Et(t,"bins.rangeLabel")||"Range",value:`${d} – ${h}`},{label:t.tooltip.groupLabel||"Group",value:c[n],class:o.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:c[n]})},{label:p,value:Et(c,`data.${c[n]}`)}]})}).on("mousemove",function(l){o.services.events.dispatchEvent(_.Tooltip.MOVE,{event:l})}).on("mouseout",function(){I(this).classed("hovered",!1),o.services.events.dispatchEvent(_.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class $2 extends fn{constructor(){super(...arguments),this.type="lollipop",this.renderType=st.SVG,this.handleScatterOnHover=t=>{const n=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[r]!==n.datum[r]?Dn.weight.unselected:Dn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Dn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[r]!==n.datum().name?Dn.opacity.unselected:Dn.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",Dn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),i=this.model.getOptions(),{groupMapsTo:r}=i.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Rn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[r]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[ot.STROKE],dataGroupName:v[r],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[r],v[l],v)).attr("opacity",1);d===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-i.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+i.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(_.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(_.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(_.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(_.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class F2 extends vt{constructor(){super(...arguments),this.type="meter",this.renderType=st.SVG}getStackedBounds(t,n){let i=0;return t.map((s,a)=>a!==0?(i+=n(s.value),{...s,width:Math.abs(n(s.value)-Jt.dividerWidth),x:i-n(s.value)}):(i=n(s.value),{...s,width:Math.abs(n(s.value)-Jt.dividerWidth),x:0}))}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"meter lines"}),r=this.getOptions(),s=y(r,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(i,{useAttrs:!0}),{groupMapsTo:c}=r.data;let u;if(y(r,"meter","proportional")===null)u=100;else{const E=y(r,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ye().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(r,"meter","height");k.appendOrSelect(i,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Jt.height.proportional:Jt.height.default)),k.appendOrSelect(i,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Jt.height.proportional:Jt.height.default));const p=i.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",E=>E.x).attr("y",0).attr("height",()=>f||(s?Jt.height.proportional:Jt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):Math.max(E.width,2)).style("fill",E=>n.model.getFillColor(E[c],null,E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.value),p.exit().remove();const m=y(r,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const S=i.selectAll("line.peak").data(v==null?[]:[v]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>f||(s?Jt.height.proportional:Jt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);i.services.events.dispatchEvent(_.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!0),i.services.events.dispatchEvent(_.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);i.services.events.dispatchEvent(_.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),r&&i.services.events.dispatchEvent(_.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(_.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i.services.events.dispatchEvent(_.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!1),i.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function wv(e){const t=U2(Mv(e),360);return Wn(t,[0,10])||Wn(t,[350,0])?{textAnchor:ln.START,dominantBaseline:cn.MIDDLE}:Wn(t,[10,80])?{textAnchor:ln.START,dominantBaseline:cn.HANGING}:Wn(t,[80,100])?{textAnchor:ln.MIDDLE,dominantBaseline:cn.HANGING}:Wn(t,[100,170])?{textAnchor:ln.END,dominantBaseline:cn.HANGING}:Wn(t,[170,190])?{textAnchor:ln.END,dominantBaseline:cn.MIDDLE}:Wn(t,[190,260])?{textAnchor:ln.END,dominantBaseline:cn.BASELINE}:Wn(t,[260,280])?{textAnchor:ln.MIDDLE,dominantBaseline:cn.BASELINE}:{textAnchor:ln.START,dominantBaseline:cn.BASELINE}}function U2(e,t){return(e%t+t)%t}function Wn(e,[t,n]){return e>=t&&e<=n}function Mv(e){return e*(180/Math.PI)}function Ut(e,t,n={x:0,y:0}){const i=t*Math.cos(e)+n.x,r=t*Math.sin(e)+n.y;return{x:isNaN(i)?0:i,y:isNaN(r)?0:r}}function B2(e,t){return t*Math.sin(e-Math.PI/2)}class G2 extends vt{constructor(){super(...arguments),this.type="radar",this.renderType=st.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),i=k.appendOrSelect(n,"text").text(t),{width:r,height:s}=k.getSVGElementSize(i.node(),{useBBox:!0});return n.remove(),{width:r,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:i,value:r}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=ZD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[i]:o,[s]:l,[r]:null}))));return ut(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:i,value:r}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[i]:c,[r]:null}));return{name:a,data:ut(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-blob"})).style("fill-opacity",i=>i.name!==n.datum().name?fi.opacity.unselected:fi.opacity.selected).style("stroke-opacity",i=>i.name!==n.datum().name?fi.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",fi.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:i,height:r}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=fi;this.uniqueKeys=Array.from(new Set(s.map(L=>L[u]))),this.uniqueGroups=Array.from(new Set(s.map(L=>L[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),x=(Math.min(i,r)-S)/2;if(x<=0)return;const T=Ii().domain(this.fullDataNormalized.map(L=>L[u])).range([0,2*Math.PI].map(L=>L-Math.PI/2)),C=Fn(this.fullDataNormalized.map(L=>L[d])),D=Ye().domain([C>=0?0:C,qn(this.fullDataNormalized.map(L=>L[d]))]).range([g,x]).nice(p),$=D.ticks(p),P=(L,H,V)=>this.model.getFillColor(L,H,V),w=QT().angle(L=>T(L[u])+Math.PI/2).radius(L=>D(L[d])).curve(Ff),G=this.uniqueKeys.map(L=>{const H=this.getLabelDimensions(L).width,V=B2(T(L),x);return H+V}),A={x:qn(G)+h,y:r/2},F=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data($,L=>L),U=L=>this.uniqueKeys.map(H=>({[u]:H,[d]:L}));F.join(L=>L.append("path").attr("opacity",0).attr("transform",`translate(${A.x}, ${A.y})`).attr("fill","none").call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>w(U(V)))),L=>L.call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${A.x}, ${A.y})`).attr("d",V=>w(U(V)))),L=>L.call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(U(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,L=>L).join(L=>L.append("line").attr("opacity",0).attr("class",H=>`x-axis-${Xi(H)}`).attr("stroke-dasharray","0").attr("x1",H=>Ut(T(H),0,A).x).attr("y1",H=>Ut(T(H),0,A).y).attr("x2",H=>Ut(T(H),0,A).x).attr("y2",H=>Ut(T(H),0,A).y).call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ut(T(V),D.range()[0],A).x).attr("y1",V=>Ut(T(V),D.range()[0],A).y).attr("x2",V=>Ut(T(V),D.range()[1],A).x).attr("y2",V=>Ut(T(V),D.range()[1],A).y)),L=>L.call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ut(T(V),D.range()[0],A).x).attr("y1",V=>Ut(T(V),D.range()[0],A).y).attr("x2",V=>Ut(T(V),D.range()[1],A).x).attr("y2",V=>Ut(T(V),D.range()[1],A).y)),L=>L.call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(L=>L.append("text").text(H=>H).attr("opacity",0).attr("x",H=>Ut(T(H),D.range()[1]+h,A).x).attr("y",H=>Ut(T(H),D.range()[1]+h,A).y).style("text-anchor",H=>wv(T(H)).textAnchor).style("dominant-baseline",H=>wv(T(H)).dominantBaseline).call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),L=>L.call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ut(T(V),D.range()[1]+h,A).x).attr("y",V=>Ut(T(V),D.range()[1]+h,A).y).end().finally(()=>{const V=y(o,"radar","alignment"),yt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",yt)})),L=>L.call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,L=>L.name).join(L=>L.append("path").attr("class",H=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:H.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",H=>H.name).attr("opacity",0).attr("transform",t?()=>`translate(${A.x}, ${A.y}) scale(${1+Math.random()*.35})`:`translate(${A.x}, ${A.y})`).style("fill",H=>P(H.name,null,H.data)).style("fill-opacity",fi.opacity.selected).style("stroke",H=>P(H.name,null,H.data)).call(H=>{const V=H.transition().call(yt=>this.services.transitions.setupTransition({transition:yt,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${A.x}, ${A.y})`),V.attr("opacity",1).attr("d",yt=>w(yt.data))}),L=>(L.attr("class",H=>this.model.getColorClassName({classNameTypes:[ot.FILL,ot.STROKE],dataGroupName:H.name,originalClassName:"blob"})).style("fill",H=>P(H.name,null,H.data)).style("stroke",H=>P(H.name,null,H.data)),L.call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${A.x}, ${A.y})`).attr("d",V=>w(V.data))),L),L=>L.call(H=>{const V=H.transition().call(yt=>this.services.transitions.setupTransition({transition:yt,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${A.x}, ${A.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(L=>y(L,d)!==null)).join(L=>L.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",H=>H[c]),L=>L,L=>L.remove()).attr("class",L=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:L[l],originalClassName:Xi(L[u])})).attr("cx",L=>Ut(T(L[u]),D(L[d]),A).x).attr("cy",L=>Ut(T(L[u]),D(L[d]),A).y).attr("r",0).attr("opacity",0).style("fill",L=>P(L[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(L=>L.append("rect"),L=>L,L=>L.remove()).attr("x",A.x).attr("y",A.y-m/2).attr("width",D.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",L=>`rotate(${Mv(T(L))}, ${A.x}, ${A.y})`);const{code:lt,number:Y}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(He($)).join(L=>L.append("text").attr("opacity",0).text(H=>Y(H,lt)).attr("x",H=>Ut(-Math.PI/2,D(H),A).x+f).attr("y",H=>Ut(-Math.PI/2,D(H),A).y).style("text-anchor","start").style("dominant-baseline","middle").call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),L=>L.call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ut(-Math.PI/2,D(V),A).x+f).attr("y",V=>Ut(-Math.PI/2,D(V),A).y)),L=>L.call(H=>H.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,i){const r=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(i,{useAttrs:!0});let a=0;return t===Vt.CENTER?a=Math.floor((s-r.width)/2):t===Vt.RIGHT&&(a=s-r.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(i,r){const s=I(this);t.services.events.dispatchEvent(_.Radar.X_AXIS_MOUSEOVER,{event:i,element:s,datum:r});const a=t.parent.select(`.x-axes .x-axis-${Xi(r)}`),o=t.parent.selectAll(`.dots circle.${Xi(r)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",fi.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===r&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:i,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(i,r){const s=I(this);t.services.events.dispatchEvent(_.Radar.X_AXIS_MOUSEMOVE,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(_.Radar.X_AXIS_CLICK,{event:i,element:I(this),datum:r})}).on("mouseout",function(i,r){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Xi(r)}`),o=t.parent.selectAll(`.dots circle.${Xi(r)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(_.Radar.X_AXIS_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(_.Tooltip.HIDE)})}}class Av extends Du{constructor(){super(...arguments),this.type="simple-bar",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=r.selectAll("path.bar").data(s,c=>c[i]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[i],c[u],c)}).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return le({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this,n=y(this.getOptions(),"tooltip","alwaysShowRulerTooltip"),i=this.parent.selectAll("path.bar");n?i.style("pointer-events","none"):i.style("pointer-events",null),i.on("mouseover",function(r,s){const a=I(this);a.classed("hovered",!0),t.services.events.dispatchEvent(_.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s}),n||t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:r,hoveredElement:a,data:[s]})}).on("mousemove",function(r,s){t.services.events.dispatchEvent(_.Bar.BAR_MOUSEMOVE,{event:r,element:I(this),datum:s}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(_.Bar.BAR_CLICK,{event:r,element:I(this),datum:s})}).on("mouseout",function(r,s){const a=I(this);a.classed("hovered",!1),t.services.events.dispatchEvent(_.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:a})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class H2 extends de{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),i=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!i?super.renderGridSkeleton(n):n&&i?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),i=[100],r=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=r.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),r.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Cv extends vt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,r)!==n.datum().name?Cn.opacity.unselected:Cn.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",Cn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),i=this,r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(p=>r.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=Xl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>i.model.getFillColor(y(p,0,s),null,p)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",Cn.opacity.selected).attr("d",this.areaGenerator)}}class Dv extends Du{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,r));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>i.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1)}return le({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=y(t,"tooltip","alwaysShowRulerTooltip"),r=this.parent.selectAll("path.bar");i?r.style("pointer-events","none"):r.style("pointer-events",null);const s=this;r.on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0),s.services.events.dispatchEvent(_.Bar.BAR_MOUSEOVER,{event:a,element:l,datum:o});let u=s.model.getDisplayData(s.configs.groups).find(d=>{const h=s.services.cartesianScales.getDomainIdentifier(d),f=s.services.cartesianScales.getRangeIdentifier(d);return d[f]===o.data[o[n]]&&d[h].toString()===o.data.sharedStackKey&&d[n]===o[n]});if(u===void 0){const d=s.services.cartesianScales.getDomainIdentifier(),h=s.services.cartesianScales.getRangeIdentifier();u={[d]:o.data.sharedStackKey,[h]:o.data[o[n]],[n]:o[n]}}i||s.services.events.dispatchEvent(_.Tooltip.SHOW,{event:a,hoveredElement:l,data:[u]})}).on("mousemove",function(a,o){const l=I(this);s.services.events.dispatchEvent(_.Bar.BAR_MOUSEMOVE,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(_.Tooltip.MOVE,{event:a})}).on("click",function(a,o){s.services.events.dispatchEvent(_.Bar.BAR_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);l.classed("hovered",!1),s.services.events.dispatchEvent(_.Bar.BAR_MOUSEOUT,{event:a,element:l,datum:o}),s.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:l})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,r=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,i*s/r)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Lv extends fn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=st.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const i=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(f=>r.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=i.selectAll("g.dots").data(o,f=>y(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ft.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=Object.keys(i.axes).some(l=>i.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[r],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[r]:h,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[r]==l[r]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const hr=6;class V2 extends vt{constructor(){super(...arguments),this.type="tree",this.renderType=st.SVG}getLongestLabel(t){let n="";return t.forEach(i=>{const r=i.children?this.getLongestLabel(i.children):"";(r.length>n.length||i.name.length>n.length)&&(n=r.length>i.name.length?r:i.name)}),n}getMockLabelWidth(t,n){const i=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:r}=k.getSVGElementSize(i.node(),{useBBox:!0});return i.remove(),r}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:i,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+hr:30-hr},h=Gr({name:o,children:a}),f=10,p=i/6,g=T=>{const C=h.descendants().reverse(),D=h.links();let $=h,P=h;h.eachBefore(R=>{R.x<$.x&&($=R),R.x>P.x&&(P=R)});const w=P.x-$.x,G=n.transition().call(R=>this.services.transitions.setupTransition({transition:R,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,$.x,i,w].join(" ")),N=x.selectAll("g").data(C,R=>R.id),A=this,O=N.enter().append("g").attr("transform",()=>`translate(${T.y0},${T.x0})`).attr("class",R=>R.depth!==0&&R.children&&R.children.length>0?"clickable":null).on("mouseover",function(R,B){A.services.events.dispatchEvent(_.Tree.NODE_MOUSEOVER,{event:R,element:I(this),datum:B})}).on("click",function(R,B){B.depth!==0&&(B.children=B.children?null:B._children,g(B)),A.services.events.dispatchEvent(_.Tree.NODE_CLICK,{event:R,element:I(this),datum:B})}).on("mouseout",function(R,B){A.services.events.dispatchEvent(_.Tree.NODE_MOUSEOUT,{event:R,element:I(this),datum:B})});O.append("circle").attr("r",2.5).attr("class",R=>R._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",R=>R._children?-hr:hr).attr("text-anchor",R=>R._children?"end":"start").text(R=>R.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(G).attr("transform",R=>`translate(${R.y},${R.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),N.exit().transition(G).remove().attr("transform",()=>`translate(${T.y},${T.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const F=b.selectAll("path").data(D,R=>R.target.id),U=F.enter().append("path").attr("d",()=>{const R={x:T.x0,y:T.y0};return E({source:R,target:R})});F.merge(U).transition(G).attr("d",E),F.exit().transition(G).remove().attr("d",()=>{const R={x:T.x,y:T.y};return E({source:R,target:R})}),h.eachBefore(R=>{R.x0=R.x,R.y0=R.y})},m=h.descendants(),v=m[m.length-1].depth,S=y(s,"tree","type")===Ka.DENDROGRAM?Eb().size([r,i-u-v*hr-l]):aS().nodeSize([f,p]).size([r,i-u-v*hr-l]),E=r_().x(T=>T.y).y(T=>T.x);h.x0=p/2,h.y0=0,h.descendants().forEach((T,C)=>{T.id=C,T._children=T.children}),S(h),n.attr("viewBox",[-d.left,-0,i,f]).style("user-select","none");const b=n.append("g").attr("class","links"),x=n.append("g").attr("class","nodes");g(h)}}var z2="#000000",W2="#ffffff",Y2="#fcf4d6",q2="#fddc69",X2="#f1c21b",Z2="#d2a106",j2="#b28600",K2="#8e6a00",Q2="#684e00",J2="#483700",tP="#302400",eP="#1c1500",nP={10:Y2,20:q2,30:X2,40:Z2,50:j2,60:K2,70:Q2,80:J2,90:tP,100:eP},iP="#fff2e8",rP="#ffd9be",sP="#ffb784",aP="#ff832b",oP="#eb6200",lP="#ba4e00",cP="#8a3800",uP="#5e2900",hP="#3e1a00",dP="#231000",fP={10:iP,20:rP,30:sP,40:aP,50:oP,60:lP,70:cP,80:uP,90:hP,100:dP},pP="#fff1f1",gP="#ffd7d9",mP="#ffb3b8",vP="#ff8389",yP="#fa4d56",EP="#da1e28",xP="#a2191f",bP="#750e13",SP="#520408",TP="#2d0709",_P={10:pP,20:gP,30:mP,40:vP,50:yP,60:EP,70:xP,80:bP,90:SP,100:TP},OP="#fff0f7",wP="#ffd6e8",MP="#ffafd2",AP="#ff7eb6",CP="#ee5396",DP="#d02670",LP="#9f1853",RP="#740937",IP="#510224",kP="#2a0a18",PP={10:OP,20:wP,30:MP,40:AP,50:CP,60:DP,70:LP,80:RP,90:IP,100:kP},NP="#f6f2ff",$P="#e8daff",FP="#d4bbff",UP="#be95ff",BP="#a56eff",GP="#8a3ffc",HP="#6929c4",VP="#491d8b",zP="#31135e",WP="#1c0f30",YP={10:NP,20:$P,30:FP,40:UP,50:BP,60:GP,70:HP,80:VP,90:zP,100:WP},qP="#edf5ff",XP="#d0e2ff",ZP="#a6c8ff",jP="#78a9ff",KP="#4589ff",QP="#0f62fe",JP="#0043ce",tN="#002d9c",eN="#001d6c",nN="#001141",iN={10:qP,20:XP,30:ZP,40:jP,50:KP,60:QP,70:JP,80:tN,90:eN,100:nN},rN="#e5f6ff",sN="#bae6ff",aN="#82cfff",oN="#33b1ff",lN="#1192e8",cN="#0072c3",uN="#00539a",hN="#003a6d",dN="#012749",fN="#061727",pN={10:rN,20:sN,30:aN,40:oN,50:lN,60:cN,70:uN,80:hN,90:dN,100:fN},gN="#d9fbfb",mN="#9ef0f0",vN="#3ddbd9",yN="#08bdba",EN="#009d9a",xN="#007d79",bN="#005d5d",SN="#004144",TN="#022b30",_N="#081a1c",ON={10:gN,20:mN,30:vN,40:yN,50:EN,60:xN,70:bN,80:SN,90:TN,100:_N},wN="#defbe6",MN="#a7f0ba",AN="#6fdc8c",CN="#42be65",DN="#24a148",LN="#198038",RN="#0e6027",IN="#044317",kN="#022d0d",PN="#071908",NN={10:wN,20:MN,30:AN,40:CN,50:DN,60:LN,70:RN,80:IN,90:kN,100:PN},$N="#f2f4f8",FN="#dde1e6",UN="#c1c7cd",BN="#a2a9b0",GN="#878d96",HN="#697077",VN="#4d5358",zN="#343a3f",WN="#21272a",YN="#121619",qN={10:$N,20:FN,30:UN,40:BN,50:GN,60:HN,70:VN,80:zN,90:WN,100:YN},XN="#f4f4f4",ZN="#e0e0e0",jN="#c6c6c6",KN="#a8a8a8",QN="#8d8d8d",JN="#6f6f6f",t$="#525252",e$="#393939",n$="#262626",i$="#161616",r$={10:XN,20:ZN,30:jN,40:KN,50:QN,60:JN,70:t$,80:e$,90:n$,100:i$},s$="#f7f3f2",a$="#e5e0df",o$="#cac5c4",l$="#ada8a8",c$="#8f8b8b",u$="#726e6e",h$="#565151",d$="#3c3838",f$="#272525",p$="#171414",g$={10:s$,20:a$,30:o$,40:l$,50:c$,60:u$,70:h$,80:d$,90:f$,100:p$},Rv={black:{100:z2},blue:iN,coolGray:qN,cyan:pN,gray:r$,green:NN,magenta:PP,orange:fP,purple:YP,red:_P,teal:ON,warmGray:g$,white:{0:W2},yellow:nP};const m$=e=>{if(!e)return null;for(const t of Object.keys(Rv)){const n=Rv[t];for(const i of Object.keys(n))if(n[+i]===e)return i}return null},Iv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),i=mn(n);let r;if(i&&(r=m$(i?i.hex():null)),r==null){const s=yh(i).l;r=Math.abs(s*100-100)}return r>50?"white":"black"};let v$=0;class y$ extends vt{constructor(){super(...arguments),this.type="treemap",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-treemap"})).attr("opacity",i=>i.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const i=this.model.getDisplayData(),r=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Gr({name:r.title||"Treemap",children:i}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=hS().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>v$++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=I(this.parentNode).attr("data-uid");return`${r.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${r.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${r.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",Iv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),S=`${r.style.prefix}-clip-${v}`;return`url(${new URL(`#${S}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Iv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,i){const r=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=i;for(;a.depth>1;)a=a.parent;r.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),mn(s).darker(.7).toString()}),t.services.events.dispatchEvent(_.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:s,label:a.data.name,bold:!0},{label:i.data.name,value:i.data.value}]}),t.services.events.dispatchEvent(_.Treemap.LEAF_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=I(this);t.services.events.dispatchEvent(_.Treemap.LEAF_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(_.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(_.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:i})}).on("mouseout",function(n,i){const r=I(this);r.classed("hovered",!1);let s=i;for(;s.depth>1;)s=s.parent;r.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(_.Treemap.LEAF_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:r})})}}function E$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function x$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}),n}var b$={value:function(){}};function kv(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new yo(n)}function yo(e){this._=e}function S$(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}yo.prototype=kv.prototype={constructor:yo,on:function(e,t){var n=this._,i=S$(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=T$(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=Pv(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Pv(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new yo(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function T$(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function Pv(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=b$,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}const _$=x$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:kv},Symbol.toStringTag,{value:"Module"})));var Lu,Nv;function O$(){if(Nv)return Lu;Nv=1;const e=_$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},i=64,r=2048;Lu=function(){var b=[256,256],x=s,T=a,C=l,D=o,$=o,P=c,w=u,G=g,N=[],A=1/0,O=e("word","end"),F=null,U=Math.random,R={},B=S;R.canvas=function(q){return arguments.length?(B=E(q),R):B},R.start=function(){var q=tt(B()),Q=v((b[0]>>5)*b[1]),ht=null,et=N.length,K=-1,nt=[],lt=N.map(function(j,J){return j.text=x.call(this,j,J),j.font=T.call(this,j,J),j.style=D.call(this,j,J),j.weight=$.call(this,j,J),j.rotate=P.call(this,j,J),j.size=~~C.call(this,j,J),j.padding=w.call(this,j,J),j}).sort(function(j,J){return J.size-j.size});return F&&clearInterval(F),F=setInterval(Y,0),Y(),R;function Y(){for(var j=Date.now();Date.now()-j<A&&++K<et&&F;){var J=lt[K];J.x=b[0]*(U()+.5)>>1,J.y=b[1]*(U()+.5)>>1,d(q,J,lt,K),J.hasText&&Z(Q,J,ht)&&(nt.push(J),O.call("word",R,J),ht?f(ht,J):ht=[{x:J.x+J.x0,y:J.y+J.y0},{x:J.x+J.x1,y:J.y+J.y1}],J.x-=b[0]>>1,J.y-=b[1]>>1)}K>=et&&(R.stop(),O.call("end",R,nt,ht))}},R.stop=function(){F&&(clearInterval(F),F=null);for(const q of N)delete q.sprite;return R};function tt(q){const Q=q.getContext("2d",{willReadFrequently:!0});q.width=q.height=1;const ht=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return q.width=(i<<5)/ht,q.height=r/ht,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ht}}function Z(q,Q,ht){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),lt=G(b),Y=U()<.5?1:-1,j=-Y,J,L,H;(J=lt(j+=Y))&&(L=~~J[0],H=~~J[1],!(Math.min(Math.abs(L),Math.abs(H))>=nt));)if(Q.x=et+L,Q.y=K+H,!(Q.x+Q.x0<0||Q.y+Q.y0<0||Q.x+Q.x1>b[0]||Q.y+Q.y1>b[1])&&(!ht||p(Q,ht))&&!h(Q,q,b[0])){for(var V=Q.sprite,yt=Q.width>>5,Bt=b[0]>>5,at=Q.x-(yt<<4),bt=at&127,Ue=32-bt,fe=Q.y1-Q.y0,Ds=(Q.y+Q.y0)*Bt+(at>>5),fr,pr=0;pr<fe;pr++){fr=0;for(var Nn=0;Nn<=yt;Nn++)q[Ds+Nn]|=fr<<Ue|(Nn<yt?(fr=V[pr*yt+Nn])>>>bt:0);Ds+=Bt}return!0}return!1}return R.timeInterval=function(q){return arguments.length?(A=q??1/0,R):A},R.words=function(q){return arguments.length?(N=q,R):N},R.size=function(q){return arguments.length?(b=[+q[0],+q[1]],R):b},R.font=function(q){return arguments.length?(T=E(q),R):T},R.fontStyle=function(q){return arguments.length?(D=E(q),R):D},R.fontWeight=function(q){return arguments.length?($=E(q),R):$},R.rotate=function(q){return arguments.length?(P=E(q),R):P},R.text=function(q){return arguments.length?(x=E(q),R):x},R.spiral=function(q){return arguments.length?(G=n[q]||q,R):G},R.fontSize=function(q){return arguments.length?(C=E(q),R):C},R.padding=function(q){return arguments.length?(w=E(q),R):w},R.random=function(q){return arguments.length?(U=q,R):U},R.on=function(){var q=O.on.apply(O,arguments);return q===O?R:q},R};function s(b){return b.text}function a(){return"serif"}function o(){return"normal"}function l(b){return Math.sqrt(b.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(b,x,T,C){if(!x.sprite){var D=b.context,$=b.ratio;D.clearRect(0,0,(i<<5)/$,r/$);var P=0,w=0,G=0,N=T.length;for(--C;++C<N;){x=T[C],D.save(),D.font=x.style+" "+x.weight+" "+~~((x.size+1)/$)+"px "+x.font;const J=D.measureText(x.text),L=-Math.floor(J.width/2);let H=(J.width+1)*$,V=x.size<<1;if(x.rotate){var A=Math.sin(x.rotate*t),O=Math.cos(x.rotate*t),F=H*O,U=H*A,R=V*O,B=V*A;H=Math.max(Math.abs(F+B),Math.abs(F-B))+31>>5<<5,V=~~Math.max(Math.abs(U+R),Math.abs(U-R))}else H=H+31>>5<<5;if(V>G&&(G=V),P+H>=i<<5&&(P=0,w+=G,G=0),w+V>=r)break;D.translate((P+(H>>1))/$,(w+(V>>1))/$),x.rotate&&D.rotate(x.rotate*t),D.fillText(x.text,L,0),x.padding&&(D.lineWidth=2*x.padding,D.strokeText(x.text,L,0)),D.restore(),x.width=H,x.height=V,x.xoff=P,x.yoff=w,x.x1=H>>1,x.y1=V>>1,x.x0=-x.x1,x.y0=-x.y1,x.hasText=!0,P+=H}for(var tt=D.getImageData(0,0,(i<<5)/$,r/$).data,Z=[];--C>=0;)if(x=T[C],!!x.hasText){for(var q=x.width,Q=q>>5,ht=x.y1-x.y0,et=0;et<ht*Q;et++)Z[et]=0;if(P=x.xoff,P==null)return;w=x.yoff;for(var K=0,nt=-1,lt=0;lt<ht;lt++){for(var et=0;et<q;et++){var Y=Q*lt+(et>>5),j=tt[(w+lt)*(i<<5)+(P+et)<<2]?1<<31-et%32:0;Z[Y]|=j,K|=j}K?nt=lt:(x.y0++,ht--,lt--,w++)}x.y1=x.y0+nt,x.sprite=Z.slice(0,(x.y1-x.y0)*Q)}}}function h(b,x,T){T>>=5;for(var C=b.sprite,D=b.width>>5,$=b.x-(D<<4),P=$&127,w=32-P,G=b.y1-b.y0,N=(b.y+b.y0)*T+($>>5),A,O=0;O<G;O++){A=0;for(var F=0;F<=D;F++)if((A<<w|(F<D?(A=C[O*D+F])>>>P:0))&x[N+F])return!0;N+=T}return!1}function f(b,x){var T=b[0],C=b[1];x.x+x.x0<T.x&&(T.x=x.x+x.x0),x.y+x.y0<T.y&&(T.y=x.y+x.y0),x.x+x.x1>C.x&&(C.x=x.x+x.x1),x.y+x.y1>C.y&&(C.y=x.y+x.y1)}function p(b,x){return b.x+b.x1>x[0].x&&b.x+b.x0<x[1].x&&b.y+b.y1>x[0].y&&b.y+b.y0<x[1].y}function g(b){var x=b[0]/b[1];return function(T){return[x*(T*=.1)*Math.cos(T),T*Math.sin(T)]}}function m(b){var x=4,T=x*b[0]/b[1],C=0,D=0;return function($){var P=$<0?-1:1;switch(Math.sqrt(1+4*P*$)-P&3){case 0:C+=T;break;case 1:D+=x;break;case 2:C-=T;break;default:D-=x;break}return[C,D]}}function v(b){for(var x=[],T=-1;++T<b;)x[T]=0;return x}function S(){return document.createElement("canvas")}function E(b){return typeof b=="function"?b:function(){return b}}return Lu}var w$=O$();const M$=E$(w$);class A$ extends vt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=st.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-wordcloud"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(_.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(_.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,i=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),r=this.model.getDisplayData(),s=this.getFontSizeScale(r),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(i,{useAttrs:!0});if(u===0||d===0)return;const h=M$().size([u,d]).words(r.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=k.appendOrSelect(i,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,S=>`${S[c]}-${S.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>n.model.getColorClassName({classNameTypes:[ot.FILL],dataGroupName:S[c],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>n.model.getFillColor(S[c],S.text,S)).attr("text-anchor","middle").transition().call(S=>n.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:t})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:i}=n.wordCloud,r=t.map(l=>l[i]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=r.length>0,o=a?He(r):[1,1];return Ye().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=ja(s=>{const a=i.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>i.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;r(o),i.services.events.dispatchEvent(_.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),i.services.events.dispatchEvent(_.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:Et(t,"locale.translations.group")||Et(t,"tooltip.groupLabel")||"Group",value:a[n],class:i.model.getColorClassName({classNameTypes:[ot.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);i.services.events.dispatchEvent(_.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),i.services.events.dispatchEvent(_.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(_.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r(null),i.services.events.dispatchEvent(_.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),i.services.events.dispatchEvent(_.Tooltip.HIDE,{hoveredElement:o})})}}class C$ extends vt{constructor(){super(...arguments),this.type="geo",this.renderType=st.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:i}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||i<1)return;const r=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=M2(s,Object.values(l)),u=_2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=r.fitSize([n,i],u),h=Wx().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=k.appendOrSelect(t,"defs");k.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",jr()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case un.geoEqualEarth:t=ub();break;case un.geoAlbers:t=ib();break;case un.geoConicEqualArea:t=Fd();break;case un.geoConicEquidistant:t=lb();break;case un.geoEquirectangular:t=ab();break;case un.geoMercator:t=rb();break;case un.geoNaturalEarth1:t=hb();break;default:throw new Error("Projection is not supported.")}return t}}class D$ extends C${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),i=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),r=y(this.getOptions(),"color"),s=y(r,"gradient","colors");i.select("g.geo").selectAll("path").classed("border",!0).attr("class",o=>this.model.getColorClassName({value:n[o.properties.NAME].value,originalClassName:"border"})).attr("style",o=>s?`fill: ${this.model.getColorClassName({value:n[o.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(i,r){const s=I(this);t.services.events.dispatchEvent(ji.CHOROPLETH_MOUSEOVER,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(Zi.SHOW,{event:i,hoveredElement:s,items:[{label:r.properties.NAME,value:n[r.properties.NAME].value}]})}).on("mousemove",function(i,r){t.services.events.dispatchEvent(ji.CHOROPLETH_MOUSEMOVE,{event:i,element:I(this),datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(Zi.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(ji.CHOROPLETH_CLICK,{event:i,element:I(this),datum:n[r.properties.NAME]})}).on("mouseout",function(i,r){const s=I(this);t.services.events.dispatchEvent(ji.CHOROPLETH_MOUSEOUT,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(Zi.HIDE,{event:i,hoveredElement:s})})}}class $v extends Qe{constructor(t,n){super(t,n),this.model=new x2(this.services),this.model.setOptions(kt(Ct.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Ms(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new or(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new he(this.model,this.services,[a,...r?[o]:[]],{direction:At.ROW,alignItems:hi.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new bv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:st.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:st.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=At.COLUMN_REVERSE,f={id:"spacer",components:[new Pn(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new he(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||r){g.push(l);const m={id:"spacer",components:[new Pn(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new yu(this.model,this.services),new fo(this.model,this.services),new he(this.model,this.services,g,{direction:At.COLUMN})]}getComponents(){const t=[new D$(this.model,this.services)];return this.getChartComponents(t)}}class L$ extends hn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),i=ut({},t,this.getZoomOptions(t));Qc(n,i);const r=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ut(n,i),depth:s&&s<4?s:r})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),i=t||this.getOptions(),r=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return r.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(i,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Wt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=t.map(s=>{const a=s[i];return this.setChildrenDataGroup(s,a)});this.set({data:r},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(i=>this.setChildrenDataGroup(i,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,i)])}),super.formatTable({headers:r,cells:s})}getChildrenDatums(t,n,i=[],r=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(r+=l.value),u+=this.getChildrenDatums(l.children,c,i,u),i.push([c,s,a(u,o)]),r+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,r+=l.value),i.push([l.name,s,a(d,o)])}}),r}}class R$ extends Qe{constructor(t,n){super(t,n),this.model=new L$(this.services),this.model.setOptions(kt(Ct.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new L2(this.model,this.services)];return this.getChartComponents(t)}}const Fv={[Oe.LINE]:[cr,fn],[Oe.SCATTER]:[fn],[Oe.AREA]:[gv,cr,fn],[Oe.STACKED_AREA]:[Cv,cr,Lv,vo],[Oe.SIMPLE_BAR]:[Av],[Oe.GROUPED_BAR]:[Ov,ur],[Oe.STACKED_BAR]:[Dv,vo]};class I$ extends Ee{constructor(t,n){super(t,n);const i=kt(Ct.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),i.comboChartTypes=[{type:Oe.LINE,correspondingDatasets:[]}]),this.model.setOptions(i),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const i=t.map(r=>{const s=r.type;let a;if(typeof r.type=="string"){if(!Object.keys(Fv).includes(r.type))return console.error(`Invalid chart type "${r.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${gA(r.type)}Chart`;return a=ut({},Ct[l],this.model.getOptions(),r.options),r.type===Oe.STACKED_AREA&&(o=!0),Fv[r.type].map(c=>new c(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ut({},this.model.getOptions(),r.options),new s(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a})}).filter(r=>r!==null);return gc(i)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===Oe.STACKED_BAR||s.type===Oe.STACKED_AREA),i=[new xe(this.model,this.services),new Ae(this.model,this.services),new de(this.model,this.services,{skeleton:zt.GRID}),...n?[]:[new zn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(i)}}class k$ extends hn{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(i=>{i.key&&i.key!==i.group&&(i.group=i.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{valueMapsTo:r}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[i],c[r]===null?"–":s(c[r],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((i,r)=>r.value-i.value)}}class Uv extends Qe{constructor(t,n,i=!1){super(t,n),this.model=new k$(this.services),!i&&(this.model.setOptions(kt(Ct.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Sv(this.model,this.services),new de(this.model,this.services,{skeleton:zt.PIE})];return this.getChartComponents(t)}}class P$ extends Uv{constructor(t,n){super(t,n,!0),this.model.setOptions(kt(Ct.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new I2(this.model,this.services),new de(this.model,this.services,{skeleton:zt.DONUT})];return this.getChartComponents(t)}}class N$ extends hn{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{number:r,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[i],l.value===null?"–":r(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class $$ extends Qe{constructor(t,n){super(t,n),this.model=new N$(this.services),this.model.setOptions(kt(Ct.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new k2(this.model,this.services)];return this.getChartComponents(t)}}class F$ extends Ee{constructor(t,n){super(t,n),this.model.setOptions(kt(Ct.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new Ov(this.model,this.services),new ur(this.model,this.services),new de(this.model,this.services,{skeleton:zt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class U$ extends vi{constructor(t){super(t),this.axisFlavor=ps.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==rt.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==rt.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==rt.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==rt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=He(this.getDisplayData(),i=>i.value),n=Ye().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ze(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getDomainIdentifier(),r=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[i])))}return this._domains}getUniqueRanges(){if(Ze(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getRangeIdentifier(),r=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[i])))}return this._ranges}getMatrix(){if(Ze(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=An(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[i]][a[r]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(An(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ze(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[i]=a,l[r]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:i}=this.assignRangeAndDomains(),{number:r,code:s}=y(this.getOptions(),"locale"),a=[n.label,i.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[i.identifier]===null?"–":l[i.identifier],l.value===null?"–":r(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),i=!Ze(n);let r=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${r}-${u}`)}this._colorScale=kl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=Ev(this.getDisplayData(),l)}}class B$ extends Ee{constructor(t,n){super(t,n),this.model=new U$(this.services),this.model.setOptions(kt(Ct.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=y(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Ms(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new or(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new he(this.model,this.services,[a,...r?[o]:[]],{direction:At.ROW,alignItems:hi.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new bv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:st.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:st.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=At.COLUMN_REVERSE,f={id:"spacer",components:[new Pn(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new he(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||r){g.push(l);const m={id:"spacer",components:[new Pn(this.model,this.services,r?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new rv(this.model,this.services),new fo(this.model,this.services),new he(this.model,this.services,g,{direction:At.COLUMN})]}getComponents(){const t=[new xe(this.model,this.services),new P2(this.model,this.services)];return this.getAxisChartComponents(t)}}class G$ extends vi{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:i,code:r}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[Et(t,"bins.rangeLabel")||"Range",...s.map(l=>Et(l,`0.${n}`))],o=[...Et(s,0).map((l,c)=>[`${i(Number(Et(l,"data.x0")),r)} – ${i(Number(Et(l,"data.x1")),r)}`,...s.map(u=>i(Et(u[c],`data.${Et(u[c],n)}`),r))])];return super.formatTable({headers:a,cells:o})}}class H$ extends Ee{constructor(t,n){super(t,n),this.model=new G$(this.services),this.model.setOptions(kt(Ct.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new C2(this.model,this.services),new N2(this.model,this.services)];return this.getAxisChartComponents(t)}}class V$ extends Ee{constructor(t,n){super(t,n),this.model.setOptions(kt(Ct.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new zn(this.model,this.services),new cr(this.model,this.services),new fn(this.model,this.services,{handleThresholds:!0}),new H2(this.model,this.services),new ur(this.model,this.services)];return this.getAxisChartComponents(t)}}class z$ extends Ee{constructor(t,n){super(t,n),this.model.setOptions(kt(Ct.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new zn(this.model,this.services),new $2(this.model,this.services),new fn(this.model,this.services),new de(this.model,this.services,{skeleton:zt.GRID})];return this.getAxisChartComponents(t)}}class W$ extends hn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((i,r)=>i+r.value,0)}getFillColor(t){const n=this.getOptions(),i=y(n,"color","scale"),r=this.getStatus();return i||!r?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),i=y(this.getDisplayData())?.reduce((a,o)=>a+o.value,0)??0,r=y(t,"meter","proportional")?i:i>100?100:i,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=r&&r<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...r?["Status"]:[]],c=[[d[i],d.value===null?"–":a(d.value,o),...r?[r]:[]]]}else{const d=y(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[i],h.value===null?"–":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class Y$ extends Qe{constructor(t,n){super(t,n),this.model=new W$(this.services);const i=n.options.meter?.proportional?ut(An(Ct.proportionalMeterChart),n.options):ut(An(Ct.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new D2(this.model,this.services)],growth:dt.STRETCH,renderType:st.SVG},{id:"spacer",components:[new Pn(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new F2(this.model,this.services)],growth:dt.STRETCH,renderType:st.SVG}],i=[new he(this.model,this.services,n,{direction:At.COLUMN})];return this.getChartComponents(i,{graphFrameRenderType:st.HTML})}}class q$ extends vi{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:i,value:r}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[i]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,r)!==null?s(y(u,"data",h,r),a):"–")])];return super.formatTable({headers:l,cells:c})}}class X$ extends Qe{constructor(t,n){super(t,n),this.model=new q$(this.services),this.model.setOptions(kt(Ct.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new G2(this.model,this.services)];return this.getChartComponents(t)}}class Z$ extends Ee{constructor(t,n){super(t,n),this.model.setOptions(kt(Ct.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new zn(this.model,this.services),new fn(this.model,this.services),new de(this.model,this.services,{skeleton:zt.GRID})];return this.getAxisChartComponents(t)}}class j$ extends hn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],i=[];return t.forEach(r=>{this.getChildrenDatums(r,i),i.push([r.name,"–"])}),super.formatTable({headers:n,cells:i})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(i=>{this.getChildrenDatums(i,n),n.push([i.name,t.name])})}}class K$ extends Qe{constructor(t,n){super(t,n),this.model=new j$(this.services),this.model.setOptions(kt(Ct.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new V2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class Q$ extends hn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:i}=y(this.getOptions(),"locale"),r=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,i)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,i)])}),super.formatTable({headers:r,cells:s})}}class J$ extends Qe{constructor(t,n){super(t,n),this.model=new Q$(this.services),this.model.setOptions(kt(Ct.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new y$(this.model,this.services)];return this.getChartComponents(t)}}class tF extends Ee{constructor(t,n){super(t,n),this.model.setOptions(kt(Ct.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new Av(this.model,this.services),new ur(this.model,this.services),new de(this.model,this.services,{skeleton:zt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class eF extends Ee{constructor(t,n){super(t,n),this.model.setOptions(kt(Ct.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new vo(this.model,this.services),new Cv(this.model,this.services),new cr(this.model,this.services,{stacked:!0}),new Lv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new de(this.model,this.services,{skeleton:zt.GRID})];return this.getAxisChartComponents(t)}}class nF extends Ee{constructor(t,n){super(t,n),this.model.setOptions(kt(Ct.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new xe(this.model,this.services),new Ae(this.model,this.services),new vo(this.model,this.services),new Dv(this.model,this.services),new de(this.model,this.services,{skeleton:zt.VERT_OR_HORIZ}),new ur(this.model,this.services)];return this.getAxisChartComponents(t)}}class iF extends hn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:i,wordMapsTo:r}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[r],u[s],o(u[i],a)])];return super.formatTable({headers:l,cells:c})}}class rF extends Qe{constructor(t,n){super(t,n),this.model=new iF(this.services),this.model.setOptions(kt(Ct.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new A$(this.model,this.services),new de(this.model,this.services,{skeleton:zt.PIE})];return this.getChartComponents(t)}}X.Alignments=Vt,X.AlluvialChart=Gk,X.AreaChart=h2,X.AreaEvent=Fc,X.ArrowDirections=Qa,X.AxisEvent=$c,X.AxisFlavor=ps,X.AxisPositions=z,X.AxisTitleOrientations=Ja,X.BarEvent=Hc,X.BoxplotChart=p2,X.BoxplotEvent=Vc,X.BubbleChart=m2,X.BulletChart=E2,X.CalloutDirections=us,X.CanvasZoomEvent=Nc,X.CartesianOrientations=Ht,X.ChartEvent=Lc,X.ChartTheme=jc,X.ChartTypes=Oe,X.ChoroplethChart=$v,X.CirclePackChart=R$,X.ColorClassNameTypes=ot,X.ColorLegendType=fs,X.ComboChart=I$,X.DividerStatus=Ji,X.DominantBaseline=cn,X.DonutChart=P$,X.ExperimentalChoroplethChart=$v,X.GaugeChart=$$,X.GaugeEvent=Gc,X.GaugeTypes=di,X.GroupedBarChart=F$,X.HeatmapChart=B$,X.HistogramChart=H$,X.LayoutAlignItems=hi,X.LayoutDirection=At,X.LayoutGrowth=dt,X.LegendItemType=Wt,X.LegendOrientations=Qi,X.LegendPositions=Ki,X.LineChart=V$,X.LineEvent=Wc,X.LollipopChart=z$,X.MeterChart=Y$,X.ModalEvent=Rc,X.ModelEvent=Ic,X.PieChart=Uv,X.PieEvent=Bc,X.Projection=un,X.RadarChart=X$,X.RadarEvent=Yc,X.RenderTypes=st,X.ScaleTypes=rt,X.ScatterChart=Z$,X.ScatterEvent=zc,X.SimpleBarChart=tF,X.Skeletons=zt,X.StackedAreaChart=eF,X.StackedBarChart=nF,X.Statuses=hs,X.TextAnchor=ln,X.ThresholdEvent=Zc,X.TickRotations=ds,X.ToolbarControlTypes=Tt,X.TooltipEvent=Zi,X.TreeChart=K$,X.TreeEvent=qc,X.TreeTypes=Ka,X.TreemapChart=J$,X.TreemapEvent=Xc,X.TruncationTypes=Pe,X.WordCloudChart=rF,X.WordCloudEvent=Uc,X.ZoomBarTypes=je,X.ZoomDomainEvent=Pc,X.ZoombarEvent=kc,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
|
|
75
75
|
//# sourceMappingURL=bundle.umd.cjs.map
|