@carbon/charts 1.23.3 → 1.23.5

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.
@@ -1,4 +1,4 @@
1
- (function(q,$e){typeof exports=="object"&&typeof module<"u"?$e(exports):typeof define=="function"&&define.amd?define(["exports"],$e):(q=typeof globalThis<"u"?globalThis:q||self,$e(q.Charts={}))})(this,function(q){"use strict";function $e(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Wv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function bo(e){let t,n,r;e.length!==2?(t=$e,n=(o,l)=>$e(e(o),l),r=(o,l)=>e(o)-l):(t=e===$e||e===Wv?e:Yv,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Yv(){return 0}function qv(e){return e===null?NaN:+e}function*Xv(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const So=bo($e).right;bo(qv).center;function Zv(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function Fe(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}class Gn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}class Pu extends Map{constructor(t,n=Qv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(Nu(this,t))}has(t){return super.has(Nu(this,t))}set(t,n){return super.set(jv(this,t),n)}delete(t){return super.delete(Kv(this,t))}}function Nu({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function jv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Kv({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Qv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Jv(e){return e}function t0(e=$e){if(e===$e)return $u;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function $u(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var e0=Array.prototype,n0=e0.slice;function _o(e){return()=>e}const r0=Math.sqrt(50),i0=Math.sqrt(10),s0=Math.sqrt(2);function Os(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=r0?10:s>=i0?5:s>=s0?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Os(e,t,n*2):[o,l,c]}function ws(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?Os(t,e,n):Os(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function vr(e,t,n){return t=+t,e=+e,n=+n,Os(e,t,n)[2]}function To(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?vr(t,e,n):vr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function a0(e,t,n){let r;for(;;){const i=vr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function o0(e){return Math.max(1,Math.ceil(Math.log(Zv(e))/Math.LN2)+1)}function l0(){var e=Jv,t=Fe,n=o0;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const E=h,b=+f;if(t===Fe&&([d,h]=a0(d,h,b)),f=ws(d,h,b),f[0]<=d&&(l=vr(d,h,b)),f[f.length-1]>=h)if(E>=h&&t===Fe){const x=vr(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(i[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(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[So(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:_o(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:_o([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:_o(Array.isArray(i)?n0.call(i):i),r):n},r}function Vn(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function kn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Fu(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?$u:t0(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(r,Math.floor(t+(l-c)*d/l+h));Fu(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(li(e,n,t),i(e[r],s)>0&&li(e,n,r);a<o;){for(li(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?li(e,n,o):(++o,li(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function li(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Oo(e,t,n){if(e=Float64Array.from(Xv(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return kn(e);if(t>=1)return Vn(e);var r,i=(r-1)*t,s=Math.floor(i),a=Vn(Fu(e,s).subarray(0,s+1)),o=kn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*c0(e){for(const t of e)yield*t}function Uu(e){return Array.from(c0(e))}function u0(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function h0(e){return e}var Ms=1,Cs=2,wo=3,ci=4,Bu=1e-6;function d0(e){return"translate("+e+",0)"}function f0(e){return"translate(0,"+e+")"}function p0(e){return t=>+e(t)}function g0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function m0(){return!this.__axis}function As(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ms||e===ci?-1:1,u=e===ci||e===Cs?"x":"y",d=e===Ms||e===wo?d0:f0;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):h0),m=Math.max(s,0)+o,v=t.range(),S=+v[0]+l,E=+v[v.length-1]+l,b=(t.bandwidth?g0:p0)(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(),B=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(B),P=P.merge(B.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),w=w.merge(B.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ms?"0em":e===wo?"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",Bu).attr("transform",function(H){return isFinite(H=b(H))?d(H+l):this.getAttribute("transform")}),B.attr("opacity",Bu).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===ci||e===Cs?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(m0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Cs?"start":e===ci?"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?(r=f==null?null:Array.from(f),h):r&&r.slice()},h.tickFormat=function(f){return arguments.length?(i=f,h):i},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function v0(e){return As(Ms,e)}function y0(e){return As(Cs,e)}function Mo(e){return As(wo,e)}function Hu(e){return As(ci,e)}var E0={value:()=>{}};function Co(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ds(n)}function Ds(e){this._=e}function x0(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ds.prototype=Co.prototype={constructor:Ds,on:function(e,t){var n=this._,r=x0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=b0(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Gu(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Gu(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ds(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function b0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Gu(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=E0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ao="http://www.w3.org/1999/xhtml";const Vu={svg:"http://www.w3.org/2000/svg",xhtml:Ao,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ls(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Vu.hasOwnProperty(t)?{space:Vu[t],local:e}:e}function S0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ao&&t.documentElement.namespaceURI===Ao?t.createElement(e):t.createElementNS(n,e)}}function _0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zu(e){var t=Ls(e);return(t.local?_0:S0)(t)}function T0(){}function Do(e){return e==null?T0:function(){return this.querySelector(e)}}function O0(e){typeof e!="function"&&(e=Do(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new ye(r,this._parents)}function w0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function M0(){return[]}function Wu(e){return e==null?M0:function(){return this.querySelectorAll(e)}}function C0(e){return function(){return w0(e.apply(this,arguments))}}function A0(e){typeof e=="function"?e=C0(e):e=Wu(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new ye(r,i)}function Yu(e){return function(){return this.matches(e)}}function qu(e){return function(t){return t.matches(e)}}var D0=Array.prototype.find;function L0(e){return function(){return D0.call(this.children,e)}}function R0(){return this.firstElementChild}function I0(e){return this.select(e==null?R0:L0(typeof e=="function"?e:qu(e)))}var k0=Array.prototype.filter;function P0(){return Array.from(this.children)}function N0(e){return function(){return k0.call(this.children,e)}}function $0(e){return this.selectAll(e==null?P0:N0(typeof e=="function"?e:qu(e)))}function F0(e){typeof e!="function"&&(e=Yu(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new ye(r,this._parents)}function Xu(e){return new Array(e.length)}function U0(){return new ye(this._enter||this._groups.map(Xu),this._parents)}function Rs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Rs.prototype={constructor:Rs,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 B0(e){return function(){return e}}function H0(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new Rs(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function G0(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(r[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new Rs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function V0(e){return e.__data__}function z0(e,t){if(!arguments.length)return Array.from(this,V0);var n=t?G0:H0,r=this._parents,i=this._groups;typeof e!="function"&&(e=B0(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,f=W0(e.call(u,u&&u.__data__,c,r)),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 ye(a,r),a._enter=o,a._exit=l,a}function W0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Y0(){return new ye(this._exit||this._groups.map(Xu),this._parents)}function q0(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function X0(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<i;++l)o[l]=n[l];return new ye(o,this._parents)}function Z0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function j0(e){e||(e=K0);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new ye(i,this._parents).order()}function K0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Q0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function J0(){return Array.from(this)}function ty(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function ey(){let e=0;for(const t of this)++e;return e}function ny(){return!this.node()}function ry(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function iy(e){return function(){this.removeAttribute(e)}}function sy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ay(e,t){return function(){this.setAttribute(e,t)}}function oy(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ly(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function cy(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 uy(e,t){var n=Ls(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?sy:iy:typeof t=="function"?n.local?cy:ly:n.local?oy:ay)(n,t))}function Zu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function hy(e){return function(){this.style.removeProperty(e)}}function dy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fy(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function py(e,t,n){return arguments.length>1?this.each((t==null?hy:typeof t=="function"?fy:dy)(e,t,n??"")):yr(this.node(),e)}function yr(e,t){return e.style.getPropertyValue(t)||Zu(e).getComputedStyle(e,null).getPropertyValue(t)}function gy(e){return function(){delete this[e]}}function my(e,t){return function(){this[e]=t}}function vy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yy(e,t){return arguments.length>1?this.each((t==null?gy:typeof t=="function"?vy:my)(e,t)):this.node()[e]}function ju(e){return e.trim().split(/^|\s+/)}function Lo(e){return e.classList||new Ku(e)}function Ku(e){this._node=e,this._names=ju(e.getAttribute("class")||"")}Ku.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 Qu(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Ju(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ey(e){return function(){Qu(this,e)}}function xy(e){return function(){Ju(this,e)}}function by(e,t){return function(){(t.apply(this,arguments)?Qu:Ju)(this,e)}}function Sy(e,t){var n=ju(e+"");if(arguments.length<2){for(var r=Lo(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?by:t?Ey:xy)(n,t))}function _y(){this.textContent=""}function Ty(e){return function(){this.textContent=e}}function Oy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wy(e){return arguments.length?this.each(e==null?_y:(typeof e=="function"?Oy:Ty)(e)):this.node().textContent}function My(){this.innerHTML=""}function Cy(e){return function(){this.innerHTML=e}}function Ay(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Dy(e){return arguments.length?this.each(e==null?My:(typeof e=="function"?Ay:Cy)(e)):this.node().innerHTML}function Ly(){this.nextSibling&&this.parentNode.appendChild(this)}function Ry(){return this.each(Ly)}function Iy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ky(){return this.each(Iy)}function Py(e){var t=typeof e=="function"?e:zu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ny(){return null}function $y(e,t){var n=typeof e=="function"?e:zu(e),r=t==null?Ny:typeof t=="function"?t:Do(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Fy(){var e=this.parentNode;e&&e.removeChild(this)}function Uy(){return this.each(Fy)}function By(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Hy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gy(e){return this.select(e?Hy:By)}function Vy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zy(e){return function(t){e.call(this,t,this.__data__)}}function Wy(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Yy(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function qy(e,t,n){return function(){var r=this.__on,i,s=zy(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Xy(e,t,n){var r=Wy(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?qy:Yy,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function th(e,t,n){var r=Zu(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Zy(e,t){return function(){return th(this,e,t)}}function jy(e,t){return function(){return th(this,e,t.apply(this,arguments))}}function Ky(e,t){return this.each((typeof t=="function"?jy:Zy)(e,t))}function*Qy(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var eh=[null];function ye(e,t){this._groups=e,this._parents=t}function ui(){return new ye([[document.documentElement]],eh)}function Jy(){return this}ye.prototype=ui.prototype={constructor:ye,select:O0,selectAll:A0,selectChild:I0,selectChildren:$0,filter:F0,data:z0,enter:U0,exit:Y0,join:q0,merge:X0,selection:Jy,order:Z0,sort:j0,call:Q0,nodes:J0,node:ty,size:ey,empty:ny,each:ry,attr:uy,style:py,property:yy,classed:Sy,text:wy,html:Dy,raise:Ry,lower:ky,append:Py,insert:$y,remove:Uy,clone:Gy,datum:Vy,on:Xy,dispatch:Ky,[Symbol.iterator]:Qy};function I(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],eh)}function t1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function zn(e,t){if(e=t1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ro={capture:!0,passive:!1};function Io(e){e.preventDefault(),e.stopImmediatePropagation()}function e1(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",Io,Ro);"onselectstart"in t?n.on("selectstart.drag",Io,Ro):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function n1(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",Io,Ro),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ko(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nh(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hi(){}var di=.7,Is=1/di,Er="\\s*([+-]?\\d+)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",r1=/^#([0-9a-f]{3,8})$/,i1=new RegExp(`^rgb\\(${Er},${Er},${Er}\\)$`),s1=new RegExp(`^rgb\\(${Ke},${Ke},${Ke}\\)$`),a1=new RegExp(`^rgba\\(${Er},${Er},${Er},${fi}\\)$`),o1=new RegExp(`^rgba\\(${Ke},${Ke},${Ke},${fi}\\)$`),l1=new RegExp(`^hsl\\(${fi},${Ke},${Ke}\\)$`),c1=new RegExp(`^hsla\\(${fi},${Ke},${Ke},${fi}\\)$`),rh={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};ko(hi,dn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ih,formatHex:ih,formatHex8:u1,formatHsl:h1,formatRgb:sh,toString:sh});function ih(){return this.rgb().formatHex()}function u1(){return this.rgb().formatHex8()}function h1(){return uh(this).formatHsl()}function sh(){return this.rgb().formatRgb()}function dn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=r1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ah(t):n===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ks(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ks(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=i1.exec(e))?new he(t[1],t[2],t[3],1):(t=s1.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=a1.exec(e))?ks(t[1],t[2],t[3],t[4]):(t=o1.exec(e))?ks(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=l1.exec(e))?ch(t[1],t[2]/100,t[3]/100,1):(t=c1.exec(e))?ch(t[1],t[2]/100,t[3]/100,t[4]):rh.hasOwnProperty(e)?ah(rh[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function ah(e){return new he(e>>16&255,e>>8&255,e&255,1)}function ks(e,t,n,r){return r<=0&&(e=t=n=NaN),new he(e,t,n,r)}function d1(e){return e instanceof hi||(e=dn(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function Po(e,t,n,r){return arguments.length===1?d1(e):new he(e,t,n,r??1)}function he(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ko(he,Po,nh(hi,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(Wn(this.r),Wn(this.g),Wn(this.b),Ps(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:oh,formatHex:oh,formatHex8:f1,formatRgb:lh,toString:lh}));function oh(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}`}function f1(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}${Yn((isNaN(this.opacity)?1:this.opacity)*255)}`}function lh(){const e=Ps(this.opacity);return`${e===1?"rgb(":"rgba("}${Wn(this.r)}, ${Wn(this.g)}, ${Wn(this.b)}${e===1?")":`, ${e})`}`}function Ps(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yn(e){return e=Wn(e),(e<16?"0":"")+e.toString(16)}function ch(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,r)}function uh(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof hi||(e=dn(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new Ue(a,o,l,e.opacity)}function hh(e,t,n,r){return arguments.length===1?uh(e):new Ue(e,t,n,r??1)}function Ue(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ko(Ue,hh,nh(hi,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new he(No(e>=240?e-240:e+120,i,r),No(e,i,r),No(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ue(dh(this.h),Ns(this.s),Ns(this.l),Ps(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=Ps(this.opacity);return`${e===1?"hsl(":"hsla("}${dh(this.h)}, ${Ns(this.s)*100}%, ${Ns(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dh(e){return e=(e||0)%360,e<0?e+360:e}function Ns(e){return Math.max(0,Math.min(1,e||0))}function No(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const $o=e=>()=>e;function p1(e,t){return function(n){return e+n*t}}function g1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function m1(e){return(e=+e)==1?fh:function(t,n){return n-t?g1(t,n,e):$o(isNaN(t)?n:t)}}function fh(e,t){var n=t-e;return n?p1(e,n):$o(isNaN(e)?t:e)}const $s=function e(t){var n=m1(t);function r(i,s){var a=n((i=Po(i)).r,(s=Po(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=fh(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function v1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function y1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function E1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=pi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function x1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ee(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function b1(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=pi(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Fo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uo=new RegExp(Fo.source,"g");function S1(e){return function(){return e}}function _1(e){return function(t){return e(t)+""}}function ph(e,t){var n=Fo.lastIndex=Uo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Fo.exec(e))&&(i=Uo.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:Ee(r,i)})),n=Uo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?_1(l[0].x):S1(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function pi(e,t){var n=typeof t,r;return t==null||n==="boolean"?$o(t):(n==="number"?Ee:n==="string"?(r=dn(t))?(t=r,$s):ph:t instanceof dn?$s:t instanceof Date?x1:y1(t)?v1:Array.isArray(t)?E1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?b1:Ee)(e,t)}function gh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var mh=180/Math.PI,Bo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vh(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*mh,skewX:Math.atan(l)*mh,scaleX:a,scaleY:o}}var Fs;function T1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bo:vh(t.a,t.b,t.c,t.d,t.e,t.f)}function O1(e){return e==null||(Fs||(Fs=document.createElementNS("http://www.w3.org/2000/svg","g")),Fs.setAttribute("transform",e),!(e=Fs.transform.baseVal.consolidate()))?Bo:(e=e.matrix,vh(e.a,e.b,e.c,e.d,e.e,e.f))}function yh(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x:Ee(c,d)},{i:g-2,x:Ee(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Ee(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Ee(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push(i(f)+"scale(",null,",",null,")");p.push({i:g-4,x:Ee(c,d)},{i:g-2,x:Ee(u,h)})}else(d!==1||h!==1)&&f.push(i(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,g=h.length,m;++p<g;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var w1=yh(T1,"px, ","px)","deg)"),M1=yh(O1,", ",")",")");function C1(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var xr=0,gi=0,mi=0,Eh=1e3,Us,vi,Bs=0,qn=0,Hs=0,yi=typeof performance=="object"&&performance.now?performance:Date,xh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ho(){return qn||(xh(A1),qn=yi.now()+Hs)}function A1(){qn=0}function Gs(){this._call=this._time=this._next=null}Gs.prototype=bh.prototype={constructor:Gs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ho():+n)+(t==null?0:+t),!this._next&&vi!==this&&(vi?vi._next=this:Us=this,vi=this),this._call=e,this._time=n,Go()},stop:function(){this._call&&(this._call=null,this._time=1/0,Go())}};function bh(e,t,n){var r=new Gs;return r.restart(e,t,n),r}function D1(){Ho(),++xr;for(var e=Us,t;e;)(t=qn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xr}function Sh(){qn=(Bs=yi.now())+Hs,xr=gi=0;try{D1()}finally{xr=0,R1(),qn=0}}function L1(){var e=yi.now(),t=e-Bs;t>Eh&&(Hs-=t,Bs=e)}function R1(){for(var e,t=Us,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Us=n);vi=e,Go(r)}function Go(e){if(!xr){gi&&(gi=clearTimeout(gi));var t=e-qn;t>24?(e<1/0&&(gi=setTimeout(Sh,e-yi.now()-Hs)),mi&&(mi=clearInterval(mi))):(mi||(Bs=yi.now(),mi=setInterval(L1,Eh)),xr=1,xh(Sh))}}function _h(e,t,n){var r=new Gs;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var I1=Co("start","end","cancel","interrupt"),k1=[],Th=0,Oh=1,Vo=2,Vs=3,wh=4,zo=5,zs=6;function Ws(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;P1(e,n,{name:t,index:r,group:i,on:I1,tween:k1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Th})}function Wo(e,t){var n=Be(e,t);if(n.state>Th)throw new Error("too late; already scheduled");return n}function Qe(e,t){var n=Be(e,t);if(n.state>Vs)throw new Error("too late; already running");return n}function Be(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function P1(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=bh(s,0,n.time);function s(c){n.state=Oh,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!==Oh)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Vs)return _h(a);f.state===wh?(f.state=zs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=zs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(_h(function(){n.state===Vs&&(n.state=wh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Vo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Vo){for(n.state=Vs,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=f);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=zo,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===zo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=zs,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Yo(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Vo&&r.state<zo,r.state=zs,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function N1(e){return this.each(function(){Yo(this,e)})}function $1(e,t){var n,r;return function(){var i=Qe(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function F1(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Qe(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function U1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Be(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?$1:F1)(n,e,t))}function qo(e,t,n){var r=e._id;return e.each(function(){var i=Qe(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Be(i,r).value[t]}}function Mh(e,t){var n;return(typeof t=="number"?Ee:t instanceof dn?$s:(n=dn(t))?(t=n,$s):ph)(e,t)}function B1(e){return function(){this.removeAttribute(e)}}function H1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function G1(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function V1(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function z1(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function W1(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function Y1(e,t){var n=Ls(e),r=n==="transform"?M1:Mh;return this.attrTween(e,typeof t=="function"?(n.local?W1:z1)(n,r,qo(this,"attr."+e,t)):t==null?(n.local?H1:B1)(n):(n.local?V1:G1)(n,r,t))}function q1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function X1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Z1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&X1(e,s)),n}return i._value=t,i}function j1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&q1(e,s)),n}return i._value=t,i}function K1(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ls(e);return this.tween(n,(r.local?Z1:j1)(r,t))}function Q1(e,t){return function(){Wo(this,e).delay=+t.apply(this,arguments)}}function J1(e,t){return t=+t,function(){Wo(this,e).delay=t}}function tE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Q1:J1)(t,e)):Be(this.node(),t).delay}function eE(e,t){return function(){Qe(this,e).duration=+t.apply(this,arguments)}}function nE(e,t){return t=+t,function(){Qe(this,e).duration=t}}function rE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?eE:nE)(t,e)):Be(this.node(),t).duration}function iE(e,t){if(typeof t!="function")throw new Error;return function(){Qe(this,e).ease=t}}function sE(e){var t=this._id;return arguments.length?this.each(iE(t,e)):Be(this.node(),t).ease}function aE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qe(this,e).ease=n}}function oE(e){if(typeof e!="function")throw new Error;return this.each(aE(this._id,e))}function lE(e){typeof e!="function"&&(e=Yu(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new fn(r,this._parents,this._name,this._id)}function cE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<r;++o)a[o]=t[o];return new fn(a,this._parents,this._name,this._id)}function uE(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 hE(e,t,n){var r,i,s=uE(t)?Wo:Qe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function dE(e,t){var n=this._id;return arguments.length<2?Be(this.node(),n).on.on(e):this.each(hE(n,e,t))}function fE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function pE(){return this.on("end.remove",fE(this._id))}function gE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Do(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,Ws(c[h],t,n,h,c,Be(u,n)));return new fn(s,this._parents,t,n)}function mE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wu(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=Be(u,n),g=0,m=h.length;g<m;++g)(f=h[g])&&Ws(f,t,n,g,h,p);s.push(h),a.push(u)}return new fn(s,a,t,n)}var vE=ui.prototype.constructor;function yE(){return new vE(this._groups,this._parents)}function EE(e,t){var n,r,i;return function(){var s=yr(this,e),a=(this.style.removeProperty(e),yr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Ch(e){return function(){this.style.removeProperty(e)}}function xE(e,t,n){var r,i=n+"",s;return function(){var a=yr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function bE(e,t,n){var r,i,s;return function(){var a=yr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),yr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function SE(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=Qe(this,e),c=l.on,u=l.value[s]==null?o||(o=Ch(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function _E(e,t,n){var r=(e+="")=="transform"?w1:Mh;return t==null?this.styleTween(e,EE(e,r)).on("end.style."+e,Ch(e)):typeof t=="function"?this.styleTween(e,bE(e,r,qo(this,"style."+e,t))).each(SE(this._id,e)):this.styleTween(e,xE(e,r,t),n).on("end.style."+e,null)}function TE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function OE(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&TE(e,a,n)),r}return s._value=t,s}function wE(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,OE(e,t,n??""))}function ME(e){return function(){this.textContent=e}}function CE(e){return function(){var t=e(this);this.textContent=t??""}}function AE(e){return this.tween("text",typeof e=="function"?CE(qo(this,"text",e)):ME(e==null?"":e+""))}function DE(e){return function(t){this.textContent=e.call(this,t)}}function LE(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&DE(i)),t}return r._value=e,r}function RE(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,LE(e))}function IE(){for(var e=this._name,t=this._id,n=Ah(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Be(l,t);Ws(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new fn(r,this._parents,e,n)}function kE(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=Qe(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var PE=0;function fn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ah(){return++PE}var pn=ui.prototype;fn.prototype={constructor:fn,select:gE,selectAll:mE,selectChild:pn.selectChild,selectChildren:pn.selectChildren,filter:lE,merge:cE,selection:yE,transition:IE,call:pn.call,nodes:pn.nodes,node:pn.node,size:pn.size,empty:pn.empty,each:pn.each,on:dE,attr:Y1,attrTween:K1,style:_E,styleTween:wE,text:AE,textTween:RE,remove:pE,tween:U1,delay:tE,duration:rE,ease:sE,easeVarying:oE,end:kE,[Symbol.iterator]:pn[Symbol.iterator]};const NE=e=>+e;function Dh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $E={time:null,delay:0,duration:250,ease:Dh};function FE(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 UE(e){var t,n;e instanceof fn?(t=e._id,e=e._name):(t=Ah(),(n=$E).time=Ho(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&Ws(l,e,t,c,a,n||FE(l,t));return new fn(r,this._parents,e,t)}ui.prototype.interrupt=N1,ui.prototype.transition=UE;const Xo=e=>()=>e;function BE(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function HE(e){e.stopImmediatePropagation()}function Zo(e){e.preventDefault(),e.stopImmediatePropagation()}var Lh={name:"drag"},jo={name:"space"},br={name:"handle"},Sr={name:"center"};const{abs:Rh,max:Kt,min:Qt}=Math;function Ih(e){return[+e[0],+e[1]]}function kh(e){return[Ih(e[0]),Ih(e[1])]}var Ys={name:"x",handles:["w","e"].map(Qo),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]]}},Ko={},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"},Ph={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Nh={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},GE={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},VE={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Qo(e){return{type:e}}function zE(e){return!e.ctrlKey&&!e.button}function WE(){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 YE(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function qE(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function $h(){return XE(Ys)}function XE(e){var t=WE,n=zE,r=YE,i=!0,s=Co("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([Qo("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",gn.overlay).merge(v).each(function(){var E=Jo(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([Qo("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(r).on("touchstart.brush",h).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,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=pi(_,C);function B(P){b.selection=P===1&&C===null?null:D(P),c.call(E),x.brush()}return _!==null&&C!==null?B:B(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();Yo(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=Jo(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 BE(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=(i&&m.metaKey?S="overlay":S)==="selection"?Lh:i&&m.altKey?Sr:br,b=e===Ko?null:GE[S],x=e===Ys?null:VE[S],_=Jo(v),C=_.extent,D=_.selection,B=C[0][0],P,w,H=C[0][1],N,M,O=C[1][0],$,F,L=C[1][1],U,tt,X=0,Y=0,Q,ut=b&&x&&i&&m.shiftKey,et,K,nt=Array.from(m.touches||[m],st=>{const _t=st.identifier;return st=zn(st,v),st.point0=st.slice(),st.identifier=_t,st});Yo(v);var ht=u(v,arguments,!0).beforestart();if(S==="overlay"){D&&(Q=!0);const st=[nt[0],nt[1]||nt[0]];_.selection=D=[[P=e===Ko?B:Qt(st[0][0],st[1][0]),N=e===Ys?H:Qt(st[0][1],st[1][1])],[$=e===Ko?O:Kt(st[0][0],st[1][0]),U=e===Ys?L:Kt(st[0][1],st[1][1])]],nt.length>1&&G(m)}else P=D[0][0],N=D[0][1],$=D[1][0],U=D[1][1];w=P,M=N,F=$,tt=U;var W=I(v).attr("pointer-events","none"),j=W.selectAll(".overlay").attr("cursor",gn[S]);if(m.touches)ht.moved=A,ht.ended=V;else{var J=I(m.view).on("mousemove.brush",A,!0).on("mouseup.brush",V,!0);i&&J.on("keydown.brush",xt,!0).on("keyup.brush",Ut,!0),e1(m.view)}c.call(v),ht.start(m,E.name);function A(st){for(const _t of st.changedTouches||[st])for(const Ne of nt)Ne.identifier===_t.identifier&&(Ne.cur=zn(_t,v));if(ut&&!et&&!K&&nt.length===1){const _t=nt[0];Rh(_t.cur[0]-_t[0])>Rh(_t.cur[1]-_t[1])?K=!0:et=!0}for(const _t of nt)_t.cur&&(_t[0]=_t.cur[0],_t[1]=_t.cur[1]);Q=!0,Zo(st),G(st)}function G(st){const _t=nt[0],Ne=_t.point0;var Oe;switch(X=_t[0]-Ne[0],Y=_t[1]-Ne[1],E){case jo:case Lh:{b&&(X=Kt(B-P,Qt(O-$,X)),w=P+X,F=$+X),x&&(Y=Kt(H-N,Qt(L-U,Y)),M=N+Y,tt=U+Y);break}case br:{nt[1]?(b&&(w=Kt(B,Qt(O,nt[0][0])),F=Kt(B,Qt(O,nt[1][0])),b=1),x&&(M=Kt(H,Qt(L,nt[0][1])),tt=Kt(H,Qt(L,nt[1][1])),x=1)):(b<0?(X=Kt(B-P,Qt(O-P,X)),w=P+X,F=$):b>0&&(X=Kt(B-$,Qt(O-$,X)),w=P,F=$+X),x<0?(Y=Kt(H-N,Qt(L-N,Y)),M=N+Y,tt=U):x>0&&(Y=Kt(H-U,Qt(L-U,Y)),M=N,tt=U+Y));break}case Sr:{b&&(w=Kt(B,Qt(O,P-X*b)),F=Kt(B,Qt(O,$+X*b))),x&&(M=Kt(H,Qt(L,N-Y*x)),tt=Kt(H,Qt(L,U+Y*x)));break}}F<w&&(b*=-1,Oe=P,P=$,$=Oe,Oe=w,w=F,F=Oe,S in Ph&&j.attr("cursor",gn[S=Ph[S]])),tt<M&&(x*=-1,Oe=N,N=U,U=Oe,Oe=M,M=tt,tt=Oe,S in Nh&&j.attr("cursor",gn[S=Nh[S]])),_.selection&&(D=_.selection),et&&(w=D[0][0],F=D[1][0]),K&&(M=D[0][1],tt=D[1][1]),(D[0][0]!==w||D[0][1]!==M||D[1][0]!==F||D[1][1]!==tt)&&(_.selection=[[w,M],[F,tt]],c.call(v),ht.brush(st,E.name))}function V(st){if(HE(st),st.touches){if(st.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else n1(st.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),qE(D)&&(_.selection=null,c.call(v)),ht.end(st,E.name)}function xt(st){switch(st.keyCode){case 16:{ut=b&&x;break}case 18:{E===br&&(b&&($=F-X*b,P=w+X*b),x&&(U=tt-Y*x,N=M+Y*x),E=Sr,G(st));break}case 32:{(E===br||E===Sr)&&(b<0?$=F-X:b>0&&(P=w-X),x<0?U=tt-Y:x>0&&(N=M-Y),E=jo,j.attr("cursor",gn.selection),G(st));break}default:return}Zo(st)}function Ut(st){switch(st.keyCode){case 16:{ut&&(et=K=ut=!1,G(st));break}case 18:{E===Sr&&(b<0?$=F:b>0&&(P=w),x<0?U=tt:x>0&&(N=M),E=br,G(st));break}case 32:{E===jo&&(st.altKey?(b&&($=F-X*b,P=w+X*b),x&&(U=tt-Y*x,N=M+Y*x),E=Sr):(b<0?$=F:b>0&&(P=w),x<0?U=tt:x>0&&(N=M),E=br),j.attr("cursor",gn[S]),G(st));break}default:return}Zo(st)}}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=kh(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Xo(kh(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Xo(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Xo(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const tl=Math.PI,el=2*tl,Xn=1e-6,ZE=el-Xn;function Fh(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function jE(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Fh;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let KE=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Fh:jE(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Xn)if(!(Math.abs(d*l-c*u)>Xn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,g=l*l+c*c,m=f*f+p*p,v=Math.sqrt(g),S=Math.sqrt(h),E=s*Math.tan((tl-Math.acos((g+h-m)/(2*v*S)))/2),b=E/S,x=E/v;Math.abs(b-1)>Xn&&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,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Xn||Math.abs(this._y1-u)>Xn)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%el+el),h>ZE?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>Xn&&this._append`A${r},${r},0,${+(h>=tl)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function QE(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function qs(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function _r(e){return e=qs(Math.abs(e)),e?e[1]:NaN}function JE(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function tx(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ex=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ei(e){if(!(t=ex.exec(e)))throw new Error("invalid format: "+e);var t;return new nl({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]})}Ei.prototype=nl.prototype;function nl(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+""}nl.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 nx(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Uh;function rx(e,t){var n=qs(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Uh=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+qs(e,Math.max(0,t+s-1))[0]}function Bh(e,t){var n=qs(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Hh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:QE,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)=>Bh(e*100,t),r:Bh,s:rx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Gh(e){return e}var Vh=Array.prototype.map,zh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ix(e){var t=e.grouping===void 0||e.thousands===void 0?Gh:JE(Vh.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Gh:tx(Vh.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=Ei(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"):Hh[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==="$"?r:/[%p]/.test(x)?a:"",D=Hh[x],B=/[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,$;if(x==="c")N=D(w)+N,w="";else{w=+w;var F=w<0||1/w<0;if(w=isNaN(w)?l:D(Math.abs(w),E),b&&(w=nx(w)),F&&+w==0&&p!=="+"&&(F=!1),H=(F?p==="("?p:o:p==="-"||p==="("?"":p)+H,N=(x==="s"?zh[8+Uh/3]:"")+N+(F&&p==="("?")":""),B){for(M=-1,O=w.length;++M<O;)if($=w.charCodeAt(M),48>$||$>57){N=($===46?i+w.slice(M+1):w.slice(M))+N,w=w.slice(0,M);break}}}S&&!m&&(w=t(w,1/0));var L=H.length+w.length+N.length,U=L<v?new Array(v-L+1).join(h):"";switch(S&&m&&(w=t(U+w,U.length?v-N.length:1/0),U=""),f){case"<":w=H+w+N+U;break;case"=":w=H+U+w+N;break;case"^":w=U.slice(0,L=U.length>>1)+H+w+N+U.slice(L);break;default:w=U+H+w+N;break}return s(w)}return P.toString=function(){return d+""},P}function u(d,h){var f=c((d=Ei(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(_r(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 Xs,rl,Wh;sx({thousands:",",grouping:[3],currency:["$",""]});function sx(e){return Xs=ix(e),rl=Xs.format,Wh=Xs.formatPrefix,Xs}function ax(e){return Math.max(0,-_r(Math.abs(e)))}function ox(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(_r(t)/3)))*3-_r(Math.abs(e)))}function lx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_r(t)-_r(e))+1}var wt=1e-6,cx=1e-12,gt=Math.PI,de=gt/2,Yh=gt/4,xe=gt*2,re=180/gt,Nt=gt/180,Tt=Math.abs,qh=Math.atan,Zn=Math.atan2,Mt=Math.cos,ux=Math.exp,hx=Math.log,bt=Math.sin,Pn=Math.sign||function(e){return e>0?1:e<0?-1:0},He=Math.sqrt,dx=Math.tan;function fx(e){return e>1?0:e<-1?gt:Math.acos(e)}function mn(e){return e>1?de:e<-1?-de:Math.asin(e)}function we(){}function Zs(e,t){e&&Zh.hasOwnProperty(e.type)&&Zh[e.type](e,t)}var Xh={Feature:function(e,t){Zs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Zs(n[r].geometry,t)}},Zh={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){il(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)il(n[r],t,0)},Polygon:function(e,t){jh(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)jh(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Zs(n[r],t)}};function il(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function jh(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)il(e[n],t,1);t.polygonEnd()}function Tr(e,t){e&&Xh.hasOwnProperty(e.type)?Xh[e.type](e,t):Zs(e,t)}function sl(e){return[Zn(e[1],e[0]),mn(e[2])]}function Or(e){var t=e[0],n=e[1],r=Mt(n);return[r*Mt(t),r*bt(t),bt(n)]}function js(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ks(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 al(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Qs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ol(e){var t=He(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function ll(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function cl(e,t){return Tt(e)>gt&&(e-=Math.round(e/xe)*xe),[e,t]}cl.invert=cl;function Kh(e,t,n){return(e%=xe)?t||n?ll(Jh(e),td(t,n)):Jh(e):t||n?td(t,n):cl}function Qh(e){return function(t,n){return t+=e,Tt(t)>gt&&(t-=Math.round(t/xe)*xe),[t,n]}}function Jh(e){var t=Qh(e);return t.invert=Qh(-e),t}function td(e,t){var n=Mt(e),r=bt(e),i=Mt(t),s=bt(t);function a(o,l){var c=Mt(l),u=Mt(o)*c,d=bt(o)*c,h=bt(l),f=h*n+u*r;return[Zn(d*i-f*s,u*n-h*r),mn(f*i+d*s)]}return a.invert=function(o,l){var c=Mt(l),u=Mt(o)*c,d=bt(o)*c,h=bt(l),f=h*i-d*s;return[Zn(d*i+h*s,u*n+f*r),mn(f*n-u*r)]},a}function px(e){e=Kh(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 gx(e,t,n,r,i,s){if(n){var a=Mt(t),o=bt(t),l=r*n;i==null?(i=t+r*xe,s=t-l/2):(i=ed(a,i),s=ed(a,s),(r>0?i<s:i>s)&&(i+=r*xe));for(var c,u=i;r>0?u>s:u<s;u-=l)c=sl([a,-o*Mt(u),-o*bt(u)]),e.point(c[0],c[1])}}function ed(e,t){t=Or(t),t[0]-=e,ol(t);var n=fx(-t[1]);return((-t[2]<0?-n:n)+xe-wt)%xe}function nd(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:we,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Js(e,t){return Tt(e[0]-t[0])<wt&&Tt(e[1]-t[1])<wt}function ta(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function rd(e,t,n,r,i){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(Js(m,v)){if(!m[2]&&!v[2]){for(i.lineStart(),o=0;o<g;++o)i.point((m=p[o])[0],m[1]);i.lineEnd();return}v[0]+=2*wt}s.push(S=new ta(m,p,null,!0)),a.push(S.o=new ta(m,null,S,!1)),s.push(S=new ta(v,p,null,!1)),a.push(S.o=new ta(v,null,S,!0))}}),!!s.length){for(a.sort(t),id(s),id(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,f=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,f=!f}while(!h.v);i.lineEnd()}}}function id(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function ul(e){return Tt(e[0])<=gt?e[0]:Pn(e[0])*((Tt(e[0])+gt)%xe-gt)}function mx(e,t){var n=ul(t),r=t[1],i=bt(r),s=[bt(n),-Mt(n),0],a=0,o=0,l=new Gn;i===1?r=de+wt:i===-1&&(r=-de-wt);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=ul(f),g=f[1]/2+Yh,m=bt(g),v=Mt(g),S=0;S<h;++S,p=b,m=_,v=C,f=E){var E=d[S],b=ul(E),x=E[1]/2+Yh,_=bt(x),C=Mt(x),D=b-p,B=D>=0?1:-1,P=B*D,w=P>gt,H=m*_;if(l.add(Zn(H*B*bt(P),v*C+H*Mt(P))),a+=w?D+B*xe:D,w^p>=n^b>=n){var N=Ks(Or(f),Or(E));ol(N);var M=Ks(s,N);ol(M);var O=(w^D>=0?-1:1)*mn(M[2]);(r>O||r===O&&(N[0]||N[1]))&&(o+=w^D>=0?1:-1)}}return(a<-1e-6||a<wt&&l<-1e-12)^o&1}function sd(e,t,n,r){return function(i){var s=t(i),a=nd(),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=Uu(u);var b=mx(c,r);u.length?(l||(i.polygonStart(),l=!0),rd(u,yx,b,n,i)):b&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(b,x){e(b,x)&&i.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,B,P;if(d.pop(),c.push(d),d=null,!!C){if(b&1){if(B=x[0],(D=B.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_<D;++_)i.point((P=B[_])[0],P[1]);i.lineEnd()}return}C>1&&b&2&&x.push(x.pop().concat(x.shift())),u.push(x.filter(vx))}}return h}}function vx(e){return e.length>1}function yx(e,t){return((e=e.x)[0]<0?e[1]-de-wt:de-e[1])-((t=t.x)[0]<0?t[1]-de-wt:de-t[1])}const ad=sd(function(){return!0},Ex,bx,[-gt,-de]);function Ex(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?gt:-gt,l=Tt(s-t);Tt(l-gt)<wt?(e.point(t,n=(n+a)/2>0?de:-de),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=gt&&(Tt(t-r)<wt&&(t-=r*wt),Tt(s-o)<wt&&(s-=o*wt),n=xx(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function xx(e,t,n,r){var i,s,a=bt(e-n);return Tt(a)>wt?qh((bt(t)*(s=Mt(r))*bt(n)-bt(r)*(i=Mt(t))*bt(e))/(i*s*a)):(t+r)/2}function bx(e,t,n,r){var i;if(e==null)i=n*de,r.point(-gt,i),r.point(0,i),r.point(gt,i),r.point(gt,0),r.point(gt,-i),r.point(0,-i),r.point(-gt,-i),r.point(-gt,0),r.point(-gt,i);else if(Tt(e[0]-t[0])>wt){var s=e[0]<t[0]?gt:-gt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function Sx(e){var t=Mt(e),n=2*Nt,r=t>0,i=Tt(t)>wt;function s(u,d,h,f){gx(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=r?b?0:c(m,v):b?c(m+(m<0?gt:-gt),v):0;if(!d&&(p=f=b)&&u.lineStart(),b!==f&&(E=l(d,S),(!E||Js(d,E)||Js(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(i&&d&&r^b){var _;!(x&h)&&(_=l(S,d,!0))&&(g=0,r?(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||!Js(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=Or(u),p=Or(d),g=[1,0,0],m=Ks(f,p),v=js(m,m),S=m[0],E=v-S*S;if(!E)return!h&&u;var b=t*v/E,x=-t*S/E,_=Ks(g,m),C=Qs(g,b),D=Qs(m,x);al(C,D);var B=_,P=js(C,B),w=js(B,B),H=P*P-w*(js(C,C)-1);if(!(H<0)){var N=He(H),M=Qs(B,(-P-N)/w);if(al(M,C),M=sl(M),!h)return M;var O=u[0],$=d[0],F=u[1],L=d[1],U;$<O&&(U=O,O=$,$=U);var tt=$-O,X=Tt(tt-gt)<wt,Y=X||tt<wt;if(!X&&L<F&&(U=F,F=L,L=U),Y?X?F+L>0^M[1]<(Tt(M[0]-O)<wt?F:L):F<=M[1]&&M[1]<=L:tt>gt^(O<=M[0]&&M[0]<=$)){var Q=Qs(B,(-P+N)/w);return al(Q,C),[M,sl(Q)]}}}function c(u,d){var h=r?e:gt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return sd(a,o,s,r?[0,-e]:[-gt,e-gt])}function _x(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,f=c-o,p;if(p=n-a,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>u&&(u=p)}if(p=i-a,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<d&&(d=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<d&&(d=p)}else if(f>0){if(p>d)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>d)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<d&&(d=p)}return u>0&&(e[0]=a+u*h,e[1]=o+u*f),d<1&&(t[0]=a+d*h,t[1]=o+d*f),!0}}}}}var ea=1e9,na=-1e9;function Tx(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var f=0,p=0;if(c==null||(f=a(c,d))!==(p=a(u,d))||l(c,u)<0^d>0)do h.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+d+4)%4)!==p);else h.point(u[0],u[1])}function a(c,u){return Tt(c[0]-e)<wt?u>0?0:3:Tt(c[0]-n)<wt?u>0?2:1:Tt(c[1]-t)<wt?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=nd(),h,f,p,g,m,v,S,E,b,x,_,C={point:D,lineStart:H,lineEnd:N,polygonStart:P,polygonEnd:w};function D(O,$){i(O,$)&&u.point(O,$)}function B(){for(var O=0,$=0,F=f.length;$<F;++$)for(var L=f[$],U=1,tt=L.length,X=L[0],Y,Q,ut=X[0],et=X[1];U<tt;++U)Y=ut,Q=et,X=L[U],ut=X[0],et=X[1],Q<=r?et>r&&(ut-Y)*(r-Q)>(et-Q)*(e-Y)&&++O:et<=r&&(ut-Y)*(r-Q)<(et-Q)*(e-Y)&&--O;return O}function P(){u=d,h=[],f=[],_=!0}function w(){var O=B(),$=_&&O,F=(h=Uu(h)).length;($||F)&&(c.polygonStart(),$&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),F&&rd(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,$){var F=i(O,$);if(f&&p.push([O,$]),x)g=O,m=$,v=F,x=!1,F&&(u.lineStart(),u.point(O,$));else if(F&&b)u.point(O,$);else{var L=[S=Math.max(na,Math.min(ea,S)),E=Math.max(na,Math.min(ea,E))],U=[O=Math.max(na,Math.min(ea,O)),$=Math.max(na,Math.min(ea,$))];_x(L,U,e,t,n,r)?(b||(u.lineStart(),u.point(L[0],L[1])),u.point(U[0],U[1]),F||u.lineEnd(),_=!1):F&&(u.lineStart(),u.point(O,$),_=!1)}S=O,E=$,b=F}return C}}const hl=e=>e;var dl=new Gn,fl=new Gn,od,ld,pl,gl,vn={point:we,lineStart:we,lineEnd:we,polygonStart:function(){vn.lineStart=Ox,vn.lineEnd=Mx},polygonEnd:function(){vn.lineStart=vn.lineEnd=vn.point=we,dl.add(Tt(fl)),fl=new Gn},result:function(){var e=dl/2;return dl=new Gn,e}};function Ox(){vn.point=wx}function wx(e,t){vn.point=cd,od=pl=e,ld=gl=t}function cd(e,t){fl.add(gl*e-pl*t),pl=e,gl=t}function Mx(){cd(od,ld)}var wr=1/0,ra=wr,xi=-wr,ia=xi,sa={point:Cx,lineStart:we,lineEnd:we,polygonStart:we,polygonEnd:we,result:function(){var e=[[wr,ra],[xi,ia]];return xi=ia=-(ra=wr=1/0),e}};function Cx(e,t){e<wr&&(wr=e),e>xi&&(xi=e),t<ra&&(ra=t),t>ia&&(ia=t)}var ml=0,vl=0,bi=0,aa=0,oa=0,Mr=0,yl=0,El=0,Si=0,ud,hd,Je,tn,Me={point:jn,lineStart:dd,lineEnd:fd,polygonStart:function(){Me.lineStart=Lx,Me.lineEnd=Rx},polygonEnd:function(){Me.point=jn,Me.lineStart=dd,Me.lineEnd=fd},result:function(){var e=Si?[yl/Si,El/Si]:Mr?[aa/Mr,oa/Mr]:bi?[ml/bi,vl/bi]:[NaN,NaN];return ml=vl=bi=aa=oa=Mr=yl=El=Si=0,e}};function jn(e,t){ml+=e,vl+=t,++bi}function dd(){Me.point=Ax}function Ax(e,t){Me.point=Dx,jn(Je=e,tn=t)}function Dx(e,t){var n=e-Je,r=t-tn,i=He(n*n+r*r);aa+=i*(Je+e)/2,oa+=i*(tn+t)/2,Mr+=i,jn(Je=e,tn=t)}function fd(){Me.point=jn}function Lx(){Me.point=Ix}function Rx(){pd(ud,hd)}function Ix(e,t){Me.point=pd,jn(ud=Je=e,hd=tn=t)}function pd(e,t){var n=e-Je,r=t-tn,i=He(n*n+r*r);aa+=i*(Je+e)/2,oa+=i*(tn+t)/2,Mr+=i,i=tn*e-Je*t,yl+=i*(Je+e),El+=i*(tn+t),Si+=i*3,jn(Je=e,tn=t)}function gd(e){this._context=e}gd.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,xe);break}}},result:we};var xl=new Gn,bl,md,vd,_i,Ti,Oi={point:we,lineStart:function(){Oi.point=kx},lineEnd:function(){bl&&yd(md,vd),Oi.point=we},polygonStart:function(){bl=!0},polygonEnd:function(){bl=null},result:function(){var e=+xl;return xl=new Gn,e}};function kx(e,t){Oi.point=yd,md=_i=e,vd=Ti=t}function yd(e,t){_i-=e,Ti-=t,xl.add(He(_i*_i+Ti*Ti)),_i=e,Ti=t}let Ed,la,xd,bd;class Sd{constructor(t){this._append=t==null?_d:Px(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!==xd||this._append!==la){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,xd=r,la=this._append,bd=this._,this._=i}this._+=bd;break}}}result(){const t=this._;return this._="",t.length?t:null}}function _d(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Px(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return _d;if(t!==Ed){const n=10**t;Ed=t,la=function(i){let s=1;this._+=i[0];for(const a=i.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+i[s]}}return la}function Nx(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),Tr(o,i(s))),s.result()}return a.area=function(o){return Tr(o,i(vn)),vn.result()},a.measure=function(o){return Tr(o,i(Oi)),Oi.result()},a.bounds=function(o){return Tr(o,i(sa)),sa.result()},a.centroid=function(o){return Tr(o,i(Me)),Me.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,hl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Sd(n)):new gd(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new Sd(n)),a},a.projection(e).digits(n).context(t)}function Sl(e){return function(t){var n=new _l;for(var r in e)n[r]=e[r];return n.stream=t,n}}function _l(){}_l.prototype={constructor:_l,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 Tl(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Tr(n,e.stream(sa)),t(sa.result()),r!=null&&e.clipExtent(r),e}function Td(e,t,n){return Tl(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function $x(e,t,n){return Td(e,[[0,0],t],n)}function Fx(e,t,n){return Tl(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function Ux(e,t,n){return Tl(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Od=16,Bx=Mt(30*Nt);function wd(e,t){return+t?Gx(e,t):Hx(e)}function Hx(e){return Sl({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Gx(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,g,m){var v=c-r,S=u-i,E=v*v+S*S;if(E>4*t&&g--){var b=a+h,x=o+f,_=l+p,C=He(b*b+x*x+_*_),D=mn(_/=C),B=Tt(Tt(_)-1)<wt||Tt(s-d)<wt?(s+d)/2:Zn(x,b),P=e(B,D),w=P[0],H=P[1],N=w-r,M=H-i,O=S*N-v*M;(O*O/E>t||Tt((v*N+S*M)/E-.5)>.3||a*h+o*f+l*p<Bx)&&(n(r,i,s,a,o,l,w,H,B,b/=C,x/=C,_,g,m),m.point(w,H),n(w,H,B,b,x,_,c,u,d,h,f,p,g,m))}}return function(r){var i,s,a,o,l,c,u,d,h,f,p,g,m={point:v,lineStart:S,lineEnd:b,polygonStart:function(){r.polygonStart(),m.lineStart=x},polygonEnd:function(){r.polygonEnd(),m.lineStart=S}};function v(D,B){D=e(D,B),r.point(D[0],D[1])}function S(){d=NaN,m.point=E,r.lineStart()}function E(D,B){var P=Or([D,B]),w=e(D,B);n(d,h,u,f,p,g,d=w[0],h=w[1],u=D,f=P[0],p=P[1],g=P[2],Od,r),r.point(d,h)}function b(){m.point=v,r.lineEnd()}function x(){S(),m.point=_,m.lineEnd=C}function _(D,B){E(i=D,B),s=d,a=h,o=f,l=p,c=g,m.point=E}function C(){n(d,h,u,f,p,g,s,a,i,o,l,c,Od,r),m.lineEnd=b,b()}return m}}var Vx=Sl({point:function(e,t){this.stream.point(e*Nt,t*Nt)}});function zx(e){return Sl({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Wx(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function Md(e,t,n,r,i,s){if(!s)return Wx(e,t,n,r,i);var a=Mt(s),o=bt(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*=r,m*=i,[l*g-c*m+t,n-c*g-l*m]}return p.invert=function(g,m){return[r*(u*g-d*m+h),i*(f-d*g-u*m)]},p}function ca(e){return Cd(function(){return e})()}function Cd(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,f=1,p=null,g=ad,m=null,v,S,E,b=hl,x=.5,_,C,D,B,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 B&&P===O?B:B=Vx(zx(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?Sx(p=O*Nt):(p=null,ad),M()):p*re},w.clipExtent=function(O){return arguments.length?(b=O==null?(m=v=S=E=null,hl):Tx(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?(r=+O[0],i=+O[1],N()):[r,i]},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?(_=wd(C,x=O*O),M()):He(x)},w.fitExtent=function(O,$){return Td(w,O,$)},w.fitSize=function(O,$){return $x(w,O,$)},w.fitWidth=function(O,$){return Fx(w,O,$)},w.fitHeight=function(O,$){return Ux(w,O,$)};function N(){var O=Md(n,0,0,h,f,d).apply(null,t(s,a)),$=Md(n,r-O[0],i-O[1],h,f,d);return u=Kh(o,l,c),C=ll(t,$),D=ll(u,C),_=wd(C,x),M()}function M(){return B=P=null,w}return function(){return t=e.apply(this,arguments),w.invert=t.invert&&H,N()}}function Ad(e){var t=0,n=gt/3,r=Cd(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Nt,n=s[1]*Nt):[t*re,n*re]},i}function Yx(e){var t=Mt(e);function n(r,i){return[r*t,bt(i)/t]}return n.invert=function(r,i){return[r/t,mn(i*t)]},n}function qx(e,t){var n=bt(e),r=(n+bt(t))/2;if(Tt(r)<wt)return Yx(e);var i=1+n*(2*r-n),s=He(i)/r;function a(o,l){var c=He(i-2*r*bt(l))/r;return[c*bt(o*=r),s-c*Mt(o)]}return a.invert=function(o,l){var c=s-l,u=Zn(o,Tt(c))*Pn(c);return c*r<0&&(u-=gt*Pn(o)*Pn(c)),[u/r,mn((i-(o*o+c*c)*r*r)/(2*r))]},a}function Dd(){return Ad(qx).scale(155.424).center([0,33.6442])}function Xx(){return Dd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Ol(e,t){return[e,hx(dx((de+t)/2))]}Ol.invert=function(e,t){return[e,2*qh(ux(t))-de]};function Zx(){return jx(Ol).scale(961/xe)}function jx(e){var t=ca(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=gt*r(),h=t(px(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Ol?[[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 ua(e,t){return[e,t]}ua.invert=ua;function Kx(){return ca(ua).scale(152.63)}function Qx(e,t){var n=Mt(e),r=e===t?bt(e):(n-Mt(t))/(t-e),i=n/r+e;if(Tt(r)<wt)return ua;function s(a,o){var l=i-o,c=r*a;return[l*bt(c),i-l*Mt(c)]}return s.invert=function(a,o){var l=i-o,c=Zn(a,Tt(l))*Pn(l);return l*r<0&&(c-=gt*Pn(a)*Pn(l)),[c/r,i-Pn(r)*He(a*a+l*l)]},s}function Jx(){return Ad(Qx).scale(131.154).center([0,13.9389])}var wi=1.340264,Mi=-.081106,Ci=893e-6,Ai=.003796,ha=He(3)/2,tb=12;function Ld(e,t){var n=mn(ha*bt(t)),r=n*n,i=r*r*r;return[e*Mt(n)/(ha*(wi+3*Mi*r+i*(7*Ci+9*Ai*r))),n*(wi+Mi*r+i*(Ci+Ai*r))]}Ld.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<tb&&(o=n*(wi+Mi*r+i*(Ci+Ai*r))-t,l=wi+3*Mi*r+i*(7*Ci+9*Ai*r),n-=a=o/l,r=n*n,i=r*r*r,!(Tt(a)<cx));++s);return[ha*e*(wi+3*Mi*r+i*(7*Ci+9*Ai*r))/Mt(n),mn(bt(n)/ha)]};function eb(){return ca(Ld).scale(177.158)}function Rd(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Rd.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Tt(i)>wt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function nb(){return ca(Rd).scale(175.295)}function rb(e,t){return e.parent===t.parent?1:2}function ib(e){return e.reduce(sb,0)/e.length}function sb(e,t){return e+t.x}function ab(e){return 1+e.reduce(ob,0)}function ob(e,t){return Math.max(e,t.y)}function lb(e){for(var t;t=e.children;)e=t[0];return e}function cb(e){for(var t;t=e.children;)e=t[t.length-1];return e}function ub(){var e=rb,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=ib(f),h.y=ab(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=lb(s),c=cb(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function hb(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function db(){return this.eachAfter(hb)}function fb(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function pb(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function gb(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function mb(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function vb(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function yb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Eb(e){for(var t=this,n=xb(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function xb(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function bb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Sb(){return Array.from(this)}function _b(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Tb(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ob(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function Di(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Cb)):t===void 0&&(t=Mb);for(var n=new Li(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new Li(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Db)}function wb(){return Di(this).eachBefore(Ab)}function Mb(e){return e.children}function Cb(e){return Array.isArray(e)?e[1]:null}function Ab(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Db(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Li(e){this.data=e,this.depth=this.height=0,this.parent=null}Li.prototype=Di.prototype={constructor:Li,count:db,each:fb,eachAfter:gb,eachBefore:pb,find:mb,sum:vb,sort:yb,path:Eb,ancestors:bb,descendants:Sb,leaves:_b,links:Tb,copy:wb,[Symbol.iterator]:Ob};function Lb(e){return e==null?null:Id(e)}function Id(e){if(typeof e!="function")throw new Error;return e}function Kn(){return 0}function Cr(e){return function(){return e}}const Rb=1664525,Ib=1013904223,kd=4294967296;function kb(){let e=1;return()=>(e=(Rb*e+Ib)%kd)/kd}function Pb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Nb(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function $b(e,t){for(var n=0,r=(e=Nb(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Pd(a,s)?++n:(a=Ub(i=Fb(i,s)),n=0);return a}function Fb(e,t){var n,r;if(wl(t,e))return[t];for(n=0;n<e.length;++n)if(da(t,e[n])&&wl(Ri(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(da(Ri(e[n],e[r]),t)&&da(Ri(e[n],t),e[r])&&da(Ri(e[r],t),e[n])&&wl(Nd(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function da(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function Pd(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function wl(e,t){for(var n=0;n<t.length;++n)if(!Pd(e,t[n]))return!1;return!0}function Ub(e){switch(e.length){case 1:return Bb(e[0]);case 2:return Ri(e[0],e[1]);case 3:return Nd(e[0],e[1],e[2])}}function Bb(e){return{x:e.x,y:e.y,r:e.r}}function Ri(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function Nd(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-a,f=r-c,p=i-o,g=i-u,m=l-s,v=d-s,S=r*r+i*i-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)-r,C=(g*m-p*v)/x,D=(f*E-h*b)/(x*2)-i,B=(h*v-f*m)/x,P=C*C+B*B-1,w=2*(s+_*C+D*B),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:r+_+C*N,y:i+D+B*N,r:N}}function $d(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function Fd(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Ud(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function fa(e){this._=e,this.next=null,this.previous=null}function Hb(e,t){if(!(s=(e=Pb(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;$d(r,n,i=e[2]),n=new fa(n),r=new fa(r),i=new fa(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){$d(n._,r._,i=e[l]),i=new fa(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(Fd(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(Fd(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Ud(n);(i=i.next)!==r;)(o=Ud(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=$b(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function Gb(e){return Math.sqrt(e.value)}function Vb(){var e=null,t=1,n=1,r=Kn;function i(s){const a=kb();return s.x=t/2,s.y=n/2,e?s.eachBefore(Bd(e)).eachAfter(Ml(r,.5,a)).eachBefore(Hd(1)):s.eachBefore(Bd(Gb)).eachAfter(Ml(Kn,1,a)).eachAfter(Ml(r,s.r/Math.min(t,n),a)).eachBefore(Hd(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=Lb(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:Cr(+s),i):r},i}function Bd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Ml(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=Hb(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function Hd(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 zb(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 Wb(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function Yb(e,t){return e.parent===t.parent?1:2}function Cl(e){var t=e.children;return t?t[0]:e.t}function Al(e){var t=e.children;return t?t[t.length-1]:e.t}function qb(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Xb(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Zb(e,t,n){return e.a.parent===t.parent?e.a:n}function pa(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}pa.prototype=Object.create(Li.prototype);function jb(e){for(var t=new pa(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new pa(s[a],a)),i.parent=n;return(t.parent=new pa(null,0)).children=[t],t}function Kb(){var e=Yb,t=1,n=1,r=null;function i(c){var u=jb(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,f=c;c.eachBefore(function(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){Xb(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=Al(p),h=Cl(h),p&&h;)g=Cl(g),f=Al(f),f.a=c,b=p.z+S-h.z-m+e(p._,h._),b>0&&(qb(Zb(p,c,d),c,b),m+=b,v+=b),S+=p.m,m+=h.m,E+=g.m,v+=f.m;p&&!Al(f)&&(f.t=p,f.m+=S-v),h&&!Cl(g)&&(g.t=h,g.m+=m-E,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function Qb(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var Jb=(1+Math.sqrt(5))/2;function tS(e,t,n,r,i,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=i-n,p=s-r;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?Wb(l,n,r,i,g?r+=p*m/g:s):Qb(l,n,r,g?n+=f*m/g:i,s),g-=m,u=d}return a}const eS=function e(t){function n(r,i,s,a,o){tS(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(Jb);function nS(){var e=eS,t=!1,n=1,r=1,i=[0],s=Kn,a=Kn,o=Kn,l=Kn,c=Kn;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(zb),h}function d(h){var f=i[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=i[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],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=Id(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:Cr(+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:Cr(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:Cr(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:Cr(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:Cr(+h),u):c},u}function Ar(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Gd=Symbol("implicit");function ga(){var e=new Pu,t=[],n=[],r=Gd;function i(s){let a=e.get(s);if(a===void 0){if(r!==Gd)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Pu;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return ga(t,n).unknown(r)},Ar.apply(i,arguments),i}function Ii(){var e=ga().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,f=i<r,p=f?i:r,g=f?r:i;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=u0(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?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return Ii(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Ar.apply(d(),arguments)}function rS(e){return function(){return e}}function iS(e){return+e}var Vd=[0,1];function Dr(e){return e}function Dl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:rS(isNaN(t)?NaN:.5)}function sS(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function aS(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Dl(i,r),s=n(a,s)):(r=Dl(r,i),s=n(s,a)),function(o){return s(r(o))}}function oS(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Dl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=So(e,o,1,r)-1;return s[l](i[l](o))}}function Ll(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function zd(){var e=Vd,t=Vd,n=pi,r,i,s,a=Dr,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Dr&&(a=sS(e[0],e[h-1])),o=h>2?oS:aS,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),Ee)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,iS),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=gh,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Dr,u()):a!==Dr},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return r=h,i=f,u()}}function Wd(){return zd()(Dr,Dr)}function lS(e,t,n,r){var i=To(e,t,n),s;switch(r=Ei(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=ox(i,a))&&(r.precision=s),Wh(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=lx(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=ax(i))&&(r.precision=s-(r.type==="%")*2);break}}return rl(r)}function Yd(e){var t=e.domain;return e.ticks=function(n){var r=t();return ws(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return lS(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=vr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Ge(){var e=Wd();return e.copy=function(){return Ll(e,Ge())},Ar.apply(e,arguments),Yd(e)}function qd(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function Xd(e){return Math.log(e)}function Zd(e){return Math.exp(e)}function cS(e){return-Math.log(-e)}function uS(e){return-Math.exp(-e)}function hS(e){return isFinite(e)?+("1e"+e):e<0?0:e}function dS(e){return e===10?hS:e===Math.E?Math.exp:t=>Math.pow(e,t)}function fS(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 jd(e){return(t,n)=>-e(-t,n)}function pS(e){const t=e(Xd,Zd),n=t.domain;let r=10,i,s;function a(){return i=fS(r),s=dS(r),n()[0]<0?(i=jd(i),s=jd(s),e(cS,uS)):e(Xd,Zd),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),f=i(u),p,g;const m=o==null?10:+o;let v=[];if(!(r%1)&&f-h<m){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(p=1;p<r;++p)if(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=r-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=ws(c,u,m))}else v=ws(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=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Ei(l)).precision==null&&(l.trim=!0),l=rl(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(qd(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Kd(){const e=pS(zd()).domain([1,10]);return e.copy=()=>Ll(e,Kd()).base(e.base()),Ar.apply(e,arguments),e}function Rl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[So(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Rl().domain([e,t]).range(i).unknown(s)},Ar.apply(Yd(a),arguments)}const Il=new Date,kl=new Date;function Wt(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>Wt(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(Il.setTime(+s),kl.setTime(+a),e(Il),e(kl),Math.floor(n(Il,kl))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const ma=Wt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ma.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ma),ma.range;const yn=1e3,Ce=yn*60,En=Ce*60,xn=En*24,Pl=xn*7,Qd=xn*30,Nl=xn*365,Lr=Wt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getUTCSeconds());Lr.range;const $l=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yn)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getMinutes());$l.range,Wt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getUTCMinutes()).range;const Fl=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yn-e.getMinutes()*Ce)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getHours());Fl.range,Wt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getUTCHours()).range;const ki=Wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ce)/xn,e=>e.getDate()-1);ki.range;const Ul=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xn,e=>e.getUTCDate()-1);Ul.range,Wt(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 Qn(e){return Wt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ce)/Pl)}const va=Qn(0),ya=Qn(1),gS=Qn(2),mS=Qn(3),Rr=Qn(4),vS=Qn(5),yS=Qn(6);va.range,ya.range,gS.range,mS.range,Rr.range,vS.range,yS.range;function Jn(e){return Wt(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)/Pl)}const Jd=Jn(0),Ea=Jn(1),ES=Jn(2),xS=Jn(3),Ir=Jn(4),bS=Jn(5),SS=Jn(6);Jd.range,Ea.range,ES.range,xS.range,Ir.range,bS.range,SS.range;const Bl=Wt(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());Bl.range,Wt(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=Wt(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:Wt(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 tr=Wt(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());tr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)}),tr.range;function _S(e,t,n,r,i,s){const a=[[Lr,1,yn],[Lr,5,5*yn],[Lr,15,15*yn],[Lr,30,30*yn],[s,1,Ce],[s,5,5*Ce],[s,15,15*Ce],[s,30,30*Ce],[i,1,En],[i,3,3*En],[i,6,6*En],[i,12,12*En],[r,1,xn],[r,2,2*xn],[n,1,Pl],[t,1,Qd],[t,3,3*Qd],[e,1,Nl]];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=bo(([,,m])=>m).right(a,h);if(f===a.length)return e.every(To(c/Nl,u/Nl,d));if(f===0)return ma.every(Math.max(To(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[TS,OS]=_S(bn,Bl,va,ki,Fl,$l);function Hl(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 Gl(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 Pi(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function wS(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=Ni(i),u=$i(i),d=Ni(s),h=$i(s),f=Ni(a),p=$i(a),g=Ni(o),m=$i(o),v=Ni(l),S=$i(l),E={a:F,A:L,b:U,B:tt,c:null,d:af,e:af,f:ZS,g:s_,G:o_,H:YS,I:qS,j:XS,L:of,m:jS,M:KS,p:X,q:Y,Q:ff,s:pf,S:QS,u:JS,U:t_,V:e_,w:n_,W:r_,x:null,X:null,y:i_,Y:a_,Z:l_,"%":df},b={a:Q,A:ut,b:et,B:K,c:null,d:cf,e:cf,f:d_,g:S_,G:T_,H:c_,I:u_,j:h_,L:uf,m:f_,M:p_,p:nt,q:ht,Q:ff,s:pf,S:g_,u:m_,U:v_,V:y_,w:E_,W:x_,x:null,X:null,y:b_,Y:__,Z:O_,"%":df},x={a:P,A:w,b:H,B:N,c:M,d:rf,e:rf,f:GS,g:nf,G:ef,H:sf,I:sf,j:FS,L:HS,m:$S,M:US,p:B,q:NS,Q:zS,s:WS,S:BS,u:LS,U:RS,V:IS,w:DS,W:kS,x:O,X:$,y:nf,Y:ef,Z:PS,"%":VS};E.x=_(n,E),E.X=_(r,E),E.c=_(t,E),b.x=_(n,b),b.X=_(r,b),b.c=_(t,b);function _(W,j){return function(J){var A=[],G=-1,V=0,xt=W.length,Ut,st,_t;for(J instanceof Date||(J=new Date(+J));++G<xt;)W.charCodeAt(G)===37&&(A.push(W.slice(V,G)),(st=tf[Ut=W.charAt(++G)])!=null?Ut=W.charAt(++G):st=Ut==="e"?" ":"0",(_t=j[Ut])&&(Ut=_t(J,st)),A.push(Ut),V=G+1);return A.push(W.slice(V,G)),A.join("")}}function C(W,j){return function(J){var A=Pi(1900,void 0,1),G=D(A,W,J+="",0),V,xt;if(G!=J.length)return null;if("Q"in A)return new Date(A.Q);if("s"in A)return new Date(A.s*1e3+("L"in A?A.L:0));if(j&&!("Z"in A)&&(A.Z=0),"p"in A&&(A.H=A.H%12+A.p*12),A.m===void 0&&(A.m="q"in A?A.q:0),"V"in A){if(A.V<1||A.V>53)return null;"w"in A||(A.w=1),"Z"in A?(V=Gl(Pi(A.y,0,1)),xt=V.getUTCDay(),V=xt>4||xt===0?Ea.ceil(V):Ea(V),V=Ul.offset(V,(A.V-1)*7),A.y=V.getUTCFullYear(),A.m=V.getUTCMonth(),A.d=V.getUTCDate()+(A.w+6)%7):(V=Hl(Pi(A.y,0,1)),xt=V.getDay(),V=xt>4||xt===0?ya.ceil(V):ya(V),V=ki.offset(V,(A.V-1)*7),A.y=V.getFullYear(),A.m=V.getMonth(),A.d=V.getDate()+(A.w+6)%7)}else("W"in A||"U"in A)&&("w"in A||(A.w="u"in A?A.u%7:"W"in A?1:0),xt="Z"in A?Gl(Pi(A.y,0,1)).getUTCDay():Hl(Pi(A.y,0,1)).getDay(),A.m=0,A.d="W"in A?(A.w+6)%7+A.W*7-(xt+5)%7:A.w+A.U*7-(xt+6)%7);return"Z"in A?(A.H+=A.Z/100|0,A.M+=A.Z%100,Gl(A)):Hl(A)}}function D(W,j,J,A){for(var G=0,V=j.length,xt=J.length,Ut,st;G<V;){if(A>=xt)return-1;if(Ut=j.charCodeAt(G++),Ut===37){if(Ut=j.charAt(G++),st=x[Ut in tf?j.charAt(G++):Ut],!st||(A=st(W,J,A))<0)return-1}else if(Ut!=J.charCodeAt(A++))return-1}return A}function B(W,j,J){var A=c.exec(j.slice(J));return A?(W.p=u.get(A[0].toLowerCase()),J+A[0].length):-1}function P(W,j,J){var A=f.exec(j.slice(J));return A?(W.w=p.get(A[0].toLowerCase()),J+A[0].length):-1}function w(W,j,J){var A=d.exec(j.slice(J));return A?(W.w=h.get(A[0].toLowerCase()),J+A[0].length):-1}function H(W,j,J){var A=v.exec(j.slice(J));return A?(W.m=S.get(A[0].toLowerCase()),J+A[0].length):-1}function N(W,j,J){var A=g.exec(j.slice(J));return A?(W.m=m.get(A[0].toLowerCase()),J+A[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 $(W,j,J){return D(W,r,j,J)}function F(W){return a[W.getDay()]}function L(W){return s[W.getDay()]}function U(W){return l[W.getMonth()]}function tt(W){return o[W.getMonth()]}function X(W){return i[+(W.getHours()>=12)]}function Y(W){return 1+~~(W.getMonth()/3)}function Q(W){return a[W.getUTCDay()]}function ut(W){return s[W.getUTCDay()]}function et(W){return l[W.getUTCMonth()]}function K(W){return o[W.getUTCMonth()]}function nt(W){return i[+(W.getUTCHours()>=12)]}function ht(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 tf={"-":"",_:" ",0:"0"},Yt=/^\s*\d+/,MS=/^%/,CS=/[\\^$*+?|[\]().{}]/g;function Et(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function AS(e){return e.replace(CS,"\\$&")}function Ni(e){return new RegExp("^(?:"+e.map(AS).join("|")+")","i")}function $i(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function DS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function LS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function RS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function IS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ef(e,t,n){var r=Yt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function nf(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function PS(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function NS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function $S(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function rf(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function FS(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function sf(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function US(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function BS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function HS(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function GS(e,t,n){var r=Yt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function VS(e,t,n){var r=MS.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function zS(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function WS(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function af(e,t){return Et(e.getDate(),t,2)}function YS(e,t){return Et(e.getHours(),t,2)}function qS(e,t){return Et(e.getHours()%12||12,t,2)}function XS(e,t){return Et(1+ki.count(bn(e),e),t,3)}function of(e,t){return Et(e.getMilliseconds(),t,3)}function ZS(e,t){return of(e,t)+"000"}function jS(e,t){return Et(e.getMonth()+1,t,2)}function KS(e,t){return Et(e.getMinutes(),t,2)}function QS(e,t){return Et(e.getSeconds(),t,2)}function JS(e){var t=e.getDay();return t===0?7:t}function t_(e,t){return Et(va.count(bn(e)-1,e),t,2)}function lf(e){var t=e.getDay();return t>=4||t===0?Rr(e):Rr.ceil(e)}function e_(e,t){return e=lf(e),Et(Rr.count(bn(e),e)+(bn(e).getDay()===4),t,2)}function n_(e){return e.getDay()}function r_(e,t){return Et(ya.count(bn(e)-1,e),t,2)}function i_(e,t){return Et(e.getFullYear()%100,t,2)}function s_(e,t){return e=lf(e),Et(e.getFullYear()%100,t,2)}function a_(e,t){return Et(e.getFullYear()%1e4,t,4)}function o_(e,t){var n=e.getDay();return e=n>=4||n===0?Rr(e):Rr.ceil(e),Et(e.getFullYear()%1e4,t,4)}function l_(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Et(t/60|0,"0",2)+Et(t%60,"0",2)}function cf(e,t){return Et(e.getUTCDate(),t,2)}function c_(e,t){return Et(e.getUTCHours(),t,2)}function u_(e,t){return Et(e.getUTCHours()%12||12,t,2)}function h_(e,t){return Et(1+Ul.count(tr(e),e),t,3)}function uf(e,t){return Et(e.getUTCMilliseconds(),t,3)}function d_(e,t){return uf(e,t)+"000"}function f_(e,t){return Et(e.getUTCMonth()+1,t,2)}function p_(e,t){return Et(e.getUTCMinutes(),t,2)}function g_(e,t){return Et(e.getUTCSeconds(),t,2)}function m_(e){var t=e.getUTCDay();return t===0?7:t}function v_(e,t){return Et(Jd.count(tr(e)-1,e),t,2)}function hf(e){var t=e.getUTCDay();return t>=4||t===0?Ir(e):Ir.ceil(e)}function y_(e,t){return e=hf(e),Et(Ir.count(tr(e),e)+(tr(e).getUTCDay()===4),t,2)}function E_(e){return e.getUTCDay()}function x_(e,t){return Et(Ea.count(tr(e)-1,e),t,2)}function b_(e,t){return Et(e.getUTCFullYear()%100,t,2)}function S_(e,t){return e=hf(e),Et(e.getUTCFullYear()%100,t,2)}function __(e,t){return Et(e.getUTCFullYear()%1e4,t,4)}function T_(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ir(e):Ir.ceil(e),Et(e.getUTCFullYear()%1e4,t,4)}function O_(){return"+0000"}function df(){return"%"}function ff(e){return+e}function pf(e){return Math.floor(+e/1e3)}var kr,gf;w_({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 w_(e){return kr=wS(e),gf=kr.format,kr.parse,kr.utcFormat,kr.utcParse,kr}function M_(e){return new Date(e)}function C_(e){return e instanceof Date?+e:+new Date(+e)}function mf(e,t,n,r,i,s,a,o,l,c){var u=Wd(),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:r(_)<_?i(_)<_?v:S:n(_)<_?E:b)(_)}return u.invert=function(_){return new Date(d(_))},u.domain=function(_){return arguments.length?h(Array.from(_,C_)):h().map(M_)},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(qd(C,_)):u},u.copy=function(){return Ll(u,mf(e,t,n,r,i,s,a,o,l,c))},u}function vf(){return Ar.apply(mf(TS,OS,bn,Bl,va,ki,Fl,$l,Lr,gf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function pt(e){return function(){return e}}const yf=Math.abs,Jt=Math.atan2,er=Math.cos,A_=Math.max,Vl=Math.min,en=Math.sin,Pr=Math.sqrt,te=1e-12,Fi=Math.PI,xa=Fi/2,ba=2*Fi;function D_(e){return e>1?0:e<-1?Fi:Math.acos(e)}function Ef(e){return e>=1?xa:e<=-1?-xa:Math.asin(e)}function Sa(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new KE(t)}function L_(e){return e.innerRadius}function R_(e){return e.outerRadius}function I_(e){return e.startAngle}function k_(e){return e.endAngle}function P_(e){return e&&e.padAngle}function N_(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<te))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function _a(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Pr(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,g=r+d,m=(h+p)/2,v=(f+g)/2,S=p-h,E=g-f,b=S*S+E*E,x=i-s,_=h*g-p*f,C=(E<0?-1:1)*Pr(A_(0,x*x*b-_*_)),D=(_*E-S*C)/b,B=(-_*S-E*C)/b,P=(_*E+S*C)/b,w=(-_*S+E*C)/b,H=D-m,N=B-v,M=P-m,O=w-v;return H*H+N*N>M*M+O*O&&(D=P,B=w),{cx:D,cy:B,x01:-u,y01:-d,x11:D*(i/x-1),y11:B*(i/x-1)}}function Ui(){var e=L_,t=R_,n=pt(0),r=null,i=I_,s=k_,a=P_,o=null,l=Sa(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-xa,g=s.apply(this,arguments)-xa,m=yf(g-p),v=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>te))o.moveTo(0,0);else if(m>ba-te)o.moveTo(f*er(p),f*en(p)),o.arc(0,0,f,p,g,!v),h>te&&(o.moveTo(h*er(g),h*en(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,B=D>te&&(r?+r.apply(this,arguments):Pr(h*h+f*f)),P=Vl(yf(f-h)/2,+n.apply(this,arguments)),w=P,H=P,N,M;if(B>te){var O=Ef(B/h*en(D)),$=Ef(B/f*en(D));(_-=O*2)>te?(O*=v?1:-1,b+=O,x-=O):(_=0,b=x=(p+g)/2),(C-=$*2)>te?($*=v?1:-1,S+=$,E-=$):(C=0,S=E=(p+g)/2)}var F=f*er(S),L=f*en(S),U=h*er(x),tt=h*en(x);if(P>te){var X=f*er(E),Y=f*en(E),Q=h*er(b),ut=h*en(b),et;if(m<Fi)if(et=N_(F,L,Q,ut,X,Y,U,tt)){var K=F-et[0],nt=L-et[1],ht=X-et[0],W=Y-et[1],j=1/en(D_((K*ht+nt*W)/(Pr(K*K+nt*nt)*Pr(ht*ht+W*W)))/2),J=Pr(et[0]*et[0]+et[1]*et[1]);w=Vl(P,(h-J)/(j-1)),H=Vl(P,(f-J)/(j+1))}else w=H=0}C>te?H>te?(N=_a(Q,ut,F,L,f,H,v),M=_a(X,Y,U,tt,f,H,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),H<P?o.arc(N.cx,N.cy,H,Jt(N.y01,N.x01),Jt(M.y01,M.x01),!v):(o.arc(N.cx,N.cy,H,Jt(N.y01,N.x01),Jt(N.y11,N.x11),!v),o.arc(0,0,f,Jt(N.cy+N.y11,N.cx+N.x11),Jt(M.cy+M.y11,M.cx+M.x11),!v),o.arc(M.cx,M.cy,H,Jt(M.y11,M.x11),Jt(M.y01,M.x01),!v))):(o.moveTo(F,L),o.arc(0,0,f,S,E,!v)):o.moveTo(F,L),!(h>te)||!(_>te)?o.lineTo(U,tt):w>te?(N=_a(U,tt,X,Y,h,-w,v),M=_a(F,L,Q,ut,h,-w,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),w<P?o.arc(N.cx,N.cy,w,Jt(N.y01,N.x01),Jt(M.y01,M.x01),!v):(o.arc(N.cx,N.cy,w,Jt(N.y01,N.x01),Jt(N.y11,N.x11),!v),o.arc(0,0,h,Jt(N.cy+N.y11,N.cx+N.x11),Jt(M.cy+M.y11,M.cx+M.x11),v),o.arc(M.cx,M.cy,w,Jt(M.y11,M.x11),Jt(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=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Fi/2;return[er(d)*u,en(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?(r=u==null?null:typeof u=="function"?u:pt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:pt(+u),c):i},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 $_=Array.prototype.slice;function Ta(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xf(e){this._context=e}xf.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 Oa(e){return new xf(e)}function zl(e){return e[0]}function Wl(e){return e[1]}function Bi(e,t){var n=pt(!0),r=null,i=Oa,s=null,a=Sa(o);e=typeof e=="function"?e:e===void 0?zl:pt(e),t=typeof t=="function"?t:t===void 0?Wl:pt(t);function o(l){var c,u=(l=Ta(l)).length,d,h=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l: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?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function Yl(e,t,n){var r=null,i=pt(!0),s=null,a=Oa,o=null,l=Sa(c);e=typeof e=="function"?e:e===void 0?zl:pt(+e),t=typeof t=="function"?t:pt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Wl:pt(+n);function c(d){var h,f,p,g=(d=Ta(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&&i(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(r?+r(m,h,d):E[h],n?+n(m,h,d):b[h]))}if(S)return o=null,S+""||null}function u(){return Bi().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),r=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?(r=d==null?null:typeof d=="function"?d:pt(+d),c):r},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(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:pt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function F_(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function U_(e){return e}function B_(){var e=U_,t=F_,n=null,r=pt(0),i=pt(ba),s=pt(0);function a(o){var l,c=(o=Ta(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),g=+r.apply(this,arguments),m=Math.min(ba,Math.max(-ba,i.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?(r=typeof o=="function"?o:pt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:pt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:pt(+o),a):s},a}var H_=Sf(Oa);function bf(e){this._curve=e}bf.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 Sf(e){function t(n){return new bf(e(n))}return t._curve=e,t}function G_(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(Sf(n)):t()._curve},e}function V_(){return G_(Bi().curve(H_))}class z_{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 W_(e){return new z_(e,!0)}function Y_(e){return e.source}function q_(e){return e.target}function X_(e){let t=Y_,n=q_,r=zl,i=Wl,s=null,a=null,o=Sa(l);function l(){let c;const u=$_.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:pt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:pt(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function Z_(){return X_(W_)}function Nn(){}function wa(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ma(e){this._context=e}Ma.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:wa(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:wa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function j_(e){return new Ma(e)}function _f(e){this._context=e}_f.prototype={areaStart:Nn,areaEnd:Nn,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:wa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function K_(e){return new _f(e)}function Tf(e){this._context=e}Tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:wa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Q_(e){return new Tf(e)}function Of(e,t){this._basis=new Ma(e),this._beta=t}Of.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const J_=function e(t){function n(r){return t===1?new Ma(r):new Of(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Ca(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 ql(e,t){this._context=e,this._k=(1-t)/6}ql.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:Ca(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:Ca(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tT=function e(t){function n(r){return new ql(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Xl(e,t){this._context=e,this._k=(1-t)/6}Xl.prototype={areaStart:Nn,areaEnd:Nn,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:Ca(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eT=function e(t){function n(r){return new Xl(r,t)}return n.tension=function(r){return e(+r)},n}(0);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(){(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:Ca(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nT=function e(t){function n(r){return new Zl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function jl(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>te){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>te){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function wf(e,t){this._context=e,this._alpha=t}wf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:jl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rT=function e(t){function n(r){return t?new wf(r,t):new ql(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Mf(e,t){this._context=e,this._alpha=t}Mf.prototype={areaStart:Nn,areaEnd:Nn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:jl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iT=function e(t){function n(r){return t?new Mf(r,t):new Xl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Cf(e,t){this._context=e,this._alpha=t}Cf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const sT=function e(t){function n(r){return t?new Cf(r,t):new Zl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Af(e){this._context=e}Af.prototype={areaStart:Nn,areaEnd:Nn,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 Df(e){return new Af(e)}function Lf(e){return e<0?-1:1}function Rf(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(Lf(s)+Lf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function If(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Kl(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function Aa(e){this._context=e}Aa.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:Kl(this,this._t0,If(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,Kl(this,If(this,n=Rf(this,e,t)),n);break;default:Kl(this,this._t0,n=Rf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function kf(e){this._context=new Pf(e)}(kf.prototype=Object.create(Aa.prototype)).point=function(e,t){Aa.prototype.point.call(this,t,e)};function Pf(e){this._context=e}Pf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function aT(e){return new Aa(e)}function oT(e){return new kf(e)}function Nf(e){this._context=e}Nf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=$f(e),i=$f(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function $f(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function lT(e){return new Nf(e)}function Da(e,t){this._context=e,this._t=t}Da.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function cT(e){return new Da(e,.5)}function uT(e){return new Da(e,0)}function hT(e){return new Da(e,1)}function Ff(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Uf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function dT(e,t){return e[t]}function fT(e){const t=[];return t.key=e,t}function Ql(){var e=pt([]),t=Uf,n=Ff,r=dT;function i(s){var a=Array.from(e.apply(this,arguments),fT),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=Ta(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:pt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:pt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Uf:typeof s=="function"?s:pt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Ff,i):n},i}function pT(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function Hi(e,t,n){this.k=e,this.x=t,this.y=n}Hi.prototype={constructor:Hi,scale:function(e){return e===1?this:new Hi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Hi(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+")"}},Hi.prototype;var Bf=typeof global=="object"&&global&&global.Object===Object&&global,gT=typeof self=="object"&&self&&self.Object===Object&&self,Ve=Bf||gT||Function("return this")(),Ae=Ve.Symbol,Hf=Object.prototype,mT=Hf.hasOwnProperty,vT=Hf.toString,Gi=Ae?Ae.toStringTag:void 0;function yT(e){var t=mT.call(e,Gi),n=e[Gi];try{e[Gi]=void 0;var r=!0}catch{}var i=vT.call(e);return r&&(t?e[Gi]=n:delete e[Gi]),i}var ET=Object.prototype,xT=ET.toString;function bT(e){return xT.call(e)}var ST="[object Null]",_T="[object Undefined]",Gf=Ae?Ae.toStringTag:void 0;function nr(e){return e==null?e===void 0?_T:ST:Gf&&Gf in Object(e)?yT(e):bT(e)}function nn(e){return e!=null&&typeof e=="object"}var TT="[object Symbol]";function La(e){return typeof e=="symbol"||nn(e)&&nr(e)==TT}function Jl(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Xt=Array.isArray,Vf=Ae?Ae.prototype:void 0,zf=Vf?Vf.toString:void 0;function Wf(e){if(typeof e=="string")return e;if(Xt(e))return Jl(e,Wf)+"";if(La(e))return zf?zf.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var OT=/\s/;function wT(e){for(var t=e.length;t--&&OT.test(e.charAt(t)););return t}var MT=/^\s+/;function CT(e){return e&&e.slice(0,wT(e)+1).replace(MT,"")}function De(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Yf=NaN,AT=/^[-+]0x[0-9a-f]+$/i,DT=/^0b[01]+$/i,LT=/^0o[0-7]+$/i,RT=parseInt;function Nr(e){if(typeof e=="number")return e;if(La(e))return Yf;if(De(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=De(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=CT(e);var n=DT.test(e);return n||LT.test(e)?RT(e.slice(2),n?2:8):AT.test(e)?Yf:+e}function tc(e){return e}var IT="[object AsyncFunction]",kT="[object Function]",PT="[object GeneratorFunction]",NT="[object Proxy]";function ec(e){if(!De(e))return!1;var t=nr(e);return t==kT||t==PT||t==IT||t==NT}var nc=Ve["__core-js_shared__"],qf=function(){var e=/[^.]+$/.exec(nc&&nc.keys&&nc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function $T(e){return!!qf&&qf in e}var FT=Function.prototype,UT=FT.toString;function rr(e){if(e!=null){try{return UT.call(e)}catch{}try{return e+""}catch{}}return""}var BT=/[\\^$.*+?()[\]{}|]/g,HT=/^\[object .+?Constructor\]$/,GT=Function.prototype,VT=Object.prototype,zT=GT.toString,WT=VT.hasOwnProperty,YT=RegExp("^"+zT.call(WT).replace(BT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qT(e){if(!De(e)||$T(e))return!1;var t=ec(e)?YT:HT;return t.test(rr(e))}function XT(e,t){return e==null?void 0:e[t]}function ir(e,t){var n=XT(e,t);return qT(n)?n:void 0}var rc=ir(Ve,"WeakMap"),Xf=Object.create,ZT=function(){function e(){}return function(t){if(!De(t))return{};if(Xf)return Xf(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 KT(){}function Zf(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var QT=800,JT=16,tO=Date.now;function eO(e){var t=0,n=0;return function(){var r=tO(),i=JT-(r-n);if(n=r,i>0){if(++t>=QT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function nO(e){return function(){return e}}var Ra=function(){try{var e=ir(Object,"defineProperty");return e({},"",{}),e}catch{}}(),rO=Ra?function(e,t){return Ra(e,"toString",{configurable:!0,enumerable:!1,value:nO(t),writable:!0})}:tc,jf=eO(rO);function iO(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function sO(e,t,n,r){for(var i=e.length,s=n+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function aO(e){return e!==e}function oO(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function lO(e,t,n){return t===t?oO(e,t,n):sO(e,aO,n)}function cO(e,t){var n=e==null?0:e.length;return!!n&&lO(e,t,0)>-1}var uO=9007199254740991,hO=/^(?:0|[1-9]\d*)$/;function ic(e,t){var n=typeof e;return t=t??uO,!!t&&(n=="number"||n!="symbol"&&hO.test(e))&&e>-1&&e%1==0&&e<t}function Ia(e,t,n){t=="__proto__"&&Ra?Ra(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Vi(e,t){return e===t||e!==e&&t!==t}var dO=Object.prototype,fO=dO.hasOwnProperty;function Kf(e,t,n){var r=e[t];(!(fO.call(e,t)&&Vi(r,n))||n===void 0&&!(t in e))&&Ia(e,t,n)}function $r(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?Ia(n,o,l):Kf(n,o,l)}return n}var Qf=Math.max;function Jf(e,t,n){return t=Qf(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=Qf(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),jT(e,this,o)}}function sc(e,t){return jf(Jf(e,t,tc),e+"")}var pO=9007199254740991;function ac(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pO}function sr(e){return e!=null&&ac(e.length)&&!ec(e)}function gO(e,t,n){if(!De(n))return!1;var r=typeof t;return(r=="number"?sr(n)&&ic(t,n.length):r=="string"&&t in n)?Vi(n[t],e):!1}function mO(e){return sc(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&gO(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var vO=Object.prototype;function ka(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||vO;return e===n}function yO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var EO="[object Arguments]";function tp(e){return nn(e)&&nr(e)==EO}var ep=Object.prototype,xO=ep.hasOwnProperty,bO=ep.propertyIsEnumerable,Fr=tp(function(){return arguments}())?tp:function(e){return nn(e)&&xO.call(e,"callee")&&!bO.call(e,"callee")};function SO(){return!1}var np=typeof q=="object"&&q&&!q.nodeType&&q,rp=np&&typeof module=="object"&&module&&!module.nodeType&&module,_O=rp&&rp.exports===np,ip=_O?Ve.Buffer:void 0,TO=ip?ip.isBuffer:void 0,Ur=TO||SO,OO="[object Arguments]",wO="[object Array]",MO="[object Boolean]",CO="[object Date]",AO="[object Error]",DO="[object Function]",LO="[object Map]",RO="[object Number]",IO="[object Object]",kO="[object RegExp]",PO="[object Set]",NO="[object String]",$O="[object WeakMap]",FO="[object ArrayBuffer]",UO="[object DataView]",BO="[object Float32Array]",HO="[object Float64Array]",GO="[object Int8Array]",VO="[object Int16Array]",zO="[object Int32Array]",WO="[object Uint8Array]",YO="[object Uint8ClampedArray]",qO="[object Uint16Array]",XO="[object Uint32Array]",Rt={};Rt[BO]=Rt[HO]=Rt[GO]=Rt[VO]=Rt[zO]=Rt[WO]=Rt[YO]=Rt[qO]=Rt[XO]=!0,Rt[OO]=Rt[wO]=Rt[FO]=Rt[MO]=Rt[UO]=Rt[CO]=Rt[AO]=Rt[DO]=Rt[LO]=Rt[RO]=Rt[IO]=Rt[kO]=Rt[PO]=Rt[NO]=Rt[$O]=!1;function ZO(e){return nn(e)&&ac(e.length)&&!!Rt[nr(e)]}function oc(e){return function(t){return e(t)}}var sp=typeof q=="object"&&q&&!q.nodeType&&q,zi=sp&&typeof module=="object"&&module&&!module.nodeType&&module,jO=zi&&zi.exports===sp,lc=jO&&Bf.process,Br=function(){try{var e=zi&&zi.require&&zi.require("util").types;return e||lc&&lc.binding&&lc.binding("util")}catch{}}(),ap=Br&&Br.isTypedArray,Pa=ap?oc(ap):ZO,KO=Object.prototype,QO=KO.hasOwnProperty;function op(e,t){var n=Xt(e),r=!n&&Fr(e),i=!n&&!r&&Ur(e),s=!n&&!r&&!i&&Pa(e),a=n||r||i||s,o=a?yO(e.length,String):[],l=o.length;for(var c in e)(t||QO.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ic(c,l)))&&o.push(c);return o}function lp(e,t){return function(n){return e(t(n))}}var JO=lp(Object.keys,Object),tw=Object.prototype,ew=tw.hasOwnProperty;function cp(e){if(!ka(e))return JO(e);var t=[];for(var n in Object(e))ew.call(e,n)&&n!="constructor"&&t.push(n);return t}function Wi(e){return sr(e)?op(e):cp(e)}function nw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var rw=Object.prototype,iw=rw.hasOwnProperty;function sw(e){if(!De(e))return nw(e);var t=ka(e),n=[];for(var r in e)r=="constructor"&&(t||!iw.call(e,r))||n.push(r);return n}function Yi(e){return sr(e)?op(e,!0):sw(e)}var aw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ow=/^\w*$/;function cc(e,t){if(Xt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||La(e)?!0:ow.test(e)||!aw.test(e)||t!=null&&e in Object(t)}var qi=ir(Object,"create");function lw(){this.__data__=qi?qi(null):{},this.size=0}function cw(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var uw="__lodash_hash_undefined__",hw=Object.prototype,dw=hw.hasOwnProperty;function fw(e){var t=this.__data__;if(qi){var n=t[e];return n===uw?void 0:n}return dw.call(t,e)?t[e]:void 0}var pw=Object.prototype,gw=pw.hasOwnProperty;function mw(e){var t=this.__data__;return qi?t[e]!==void 0:gw.call(t,e)}var vw="__lodash_hash_undefined__";function yw(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qi&&t===void 0?vw:t,this}function ar(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ar.prototype.clear=lw,ar.prototype.delete=cw,ar.prototype.get=fw,ar.prototype.has=mw,ar.prototype.set=yw;function Ew(){this.__data__=[],this.size=0}function Na(e,t){for(var n=e.length;n--;)if(Vi(e[n][0],t))return n;return-1}var xw=Array.prototype,bw=xw.splice;function Sw(e){var t=this.__data__,n=Na(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():bw.call(t,n,1),--this.size,!0}function _w(e){var t=this.__data__,n=Na(t,e);return n<0?void 0:t[n][1]}function Tw(e){return Na(this.__data__,e)>-1}function Ow(e,t){var n=this.__data__,r=Na(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Sn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Sn.prototype.clear=Ew,Sn.prototype.delete=Sw,Sn.prototype.get=_w,Sn.prototype.has=Tw,Sn.prototype.set=Ow;var Xi=ir(Ve,"Map");function ww(){this.size=0,this.__data__={hash:new ar,map:new(Xi||Sn),string:new ar}}function Mw(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function $a(e,t){var n=e.__data__;return Mw(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Cw(e){var t=$a(this,e).delete(e);return this.size-=t?1:0,t}function Aw(e){return $a(this,e).get(e)}function Dw(e){return $a(this,e).has(e)}function Lw(e,t){var n=$a(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function _n(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}_n.prototype.clear=ww,_n.prototype.delete=Cw,_n.prototype.get=Aw,_n.prototype.has=Dw,_n.prototype.set=Lw;var Rw="Expected a function";function uc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Rw);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(uc.Cache||_n),n}uc.Cache=_n;var Iw=500;function kw(e){var t=uc(e,function(r){return n.size===Iw&&n.clear(),r}),n=t.cache;return t}var Pw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nw=/\\(\\)?/g,$w=kw(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Pw,function(n,r,i,s){t.push(i?s.replace(Nw,"$1"):r||n)}),t});function Zi(e){return e==null?"":Wf(e)}function Fa(e,t){return Xt(e)?e:cc(e,t)?[e]:$w(Zi(e))}function ji(e){if(typeof e=="string"||La(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function hc(e,t){t=Fa(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ji(t[n++])];return n&&n==r?e:void 0}function yt(e,t,n){var r=e==null?void 0:hc(e,t);return r===void 0?n:r}function dc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var up=Ae?Ae.isConcatSpreadable:void 0;function Fw(e){return Xt(e)||Fr(e)||!!(up&&e&&e[up])}function Ua(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=Fw),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Ua(o,t-1,n,r,i):dc(i,o):r||(i[i.length]=o)}return i}function fc(e){var t=e==null?0:e.length;return t?Ua(e,1):[]}function Uw(e){return jf(Jf(e,void 0,fc),e+"")}var pc=lp(Object.getPrototypeOf,Object),Bw="[object Object]",Hw=Function.prototype,Gw=Object.prototype,hp=Hw.toString,Vw=Gw.hasOwnProperty,zw=hp.call(Object);function dp(e){if(!nn(e)||nr(e)!=Bw)return!1;var t=pc(e);if(t===null)return!0;var n=Vw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&hp.call(n)==zw}function fp(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function Ww(e,t,n){var r=e.length;return n=n===void 0?r:n,fp(e,t,n)}var Yw="\\ud800-\\udfff",qw="\\u0300-\\u036f",Xw="\\ufe20-\\ufe2f",Zw="\\u20d0-\\u20ff",jw=qw+Xw+Zw,Kw="\\ufe0e\\ufe0f",Qw="\\u200d",Jw=RegExp("["+Qw+Yw+jw+Kw+"]");function pp(e){return Jw.test(e)}function tM(e){return e.split("")}var gp="\\ud800-\\udfff",eM="\\u0300-\\u036f",nM="\\ufe20-\\ufe2f",rM="\\u20d0-\\u20ff",iM=eM+nM+rM,sM="\\ufe0e\\ufe0f",aM="["+gp+"]",gc="["+iM+"]",mc="\\ud83c[\\udffb-\\udfff]",oM="(?:"+gc+"|"+mc+")",mp="[^"+gp+"]",vp="(?:\\ud83c[\\udde6-\\uddff]){2}",yp="[\\ud800-\\udbff][\\udc00-\\udfff]",lM="\\u200d",Ep=oM+"?",xp="["+sM+"]?",cM="(?:"+lM+"(?:"+[mp,vp,yp].join("|")+")"+xp+Ep+")*",uM=xp+Ep+cM,hM="(?:"+[mp+gc+"?",gc,vp,yp,aM].join("|")+")",dM=RegExp(mc+"(?="+mc+")|"+hM+uM,"g");function fM(e){return e.match(dM)||[]}function pM(e){return pp(e)?fM(e):tM(e)}function gM(e){return function(t){t=Zi(t);var n=pp(t)?pM(t):void 0,r=n?n[0]:t.charAt(0),i=n?Ww(n,1).join(""):t.slice(1);return r[e]()+i}}var mM=gM("toUpperCase");function vM(e){return mM(Zi(e).toLowerCase())}function yM(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;)n=t(n,e[i],i,e);return n}function EM(e){return function(t){return e==null?void 0:e[t]}}var xM={À:"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"},bM=EM(xM),SM=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_M="\\u0300-\\u036f",TM="\\ufe20-\\ufe2f",OM="\\u20d0-\\u20ff",wM=_M+TM+OM,MM="["+wM+"]",CM=RegExp(MM,"g");function AM(e){return e=Zi(e),e&&e.replace(SM,bM).replace(CM,"")}var DM=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function LM(e){return e.match(DM)||[]}var RM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function IM(e){return RM.test(e)}var bp="\\ud800-\\udfff",kM="\\u0300-\\u036f",PM="\\ufe20-\\ufe2f",NM="\\u20d0-\\u20ff",$M=kM+PM+NM,Sp="\\u2700-\\u27bf",_p="a-z\\xdf-\\xf6\\xf8-\\xff",FM="\\xac\\xb1\\xd7\\xf7",UM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",BM="\\u2000-\\u206f",HM=" \\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",Tp="A-Z\\xc0-\\xd6\\xd8-\\xde",GM="\\ufe0e\\ufe0f",Op=FM+UM+BM+HM,wp="['’]",Mp="["+Op+"]",VM="["+$M+"]",Cp="\\d+",zM="["+Sp+"]",Ap="["+_p+"]",Dp="[^"+bp+Op+Cp+Sp+_p+Tp+"]",WM="\\ud83c[\\udffb-\\udfff]",YM="(?:"+VM+"|"+WM+")",qM="[^"+bp+"]",Lp="(?:\\ud83c[\\udde6-\\uddff]){2}",Rp="[\\ud800-\\udbff][\\udc00-\\udfff]",Hr="["+Tp+"]",XM="\\u200d",Ip="(?:"+Ap+"|"+Dp+")",ZM="(?:"+Hr+"|"+Dp+")",kp="(?:"+wp+"(?:d|ll|m|re|s|t|ve))?",Pp="(?:"+wp+"(?:D|LL|M|RE|S|T|VE))?",Np=YM+"?",$p="["+GM+"]?",jM="(?:"+XM+"(?:"+[qM,Lp,Rp].join("|")+")"+$p+Np+")*",KM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",QM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",JM=$p+Np+jM,tC="(?:"+[zM,Lp,Rp].join("|")+")"+JM,eC=RegExp([Hr+"?"+Ap+"+"+kp+"(?="+[Mp,Hr,"$"].join("|")+")",ZM+"+"+Pp+"(?="+[Mp,Hr+Ip,"$"].join("|")+")",Hr+"?"+Ip+"+"+kp,Hr+"+"+Pp,QM,KM,Cp,tC].join("|"),"g");function nC(e){return e.match(eC)||[]}function rC(e,t,n){return e=Zi(e),t=t,t===void 0?IM(e)?nC(e):LM(e):e.match(t)||[]}var iC="['’]",sC=RegExp(iC,"g");function Fp(e){return function(t){return yM(rC(AM(t).replace(sC,"")),e,"")}}var aC=Fp(function(e,t,n){return t=t.toLowerCase(),e+(n?vM(t):t)});function oC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Up(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Nr(n),n=n===n?n:0),t!==void 0&&(t=Nr(t),t=t===t?t:0),oC(Nr(e),t,n)}function lC(){this.__data__=new Sn,this.size=0}function cC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function uC(e){return this.__data__.get(e)}function hC(e){return this.__data__.has(e)}var dC=200;function fC(e,t){var n=this.__data__;if(n instanceof Sn){var r=n.__data__;if(!Xi||r.length<dC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _n(r)}return n.set(e,t),this.size=n.size,this}function ze(e){var t=this.__data__=new Sn(e);this.size=t.size}ze.prototype.clear=lC,ze.prototype.delete=cC,ze.prototype.get=uC,ze.prototype.has=hC,ze.prototype.set=fC;function pC(e,t){return e&&$r(t,Wi(t),e)}function gC(e,t){return e&&$r(t,Yi(t),e)}var Bp=typeof q=="object"&&q&&!q.nodeType&&q,Hp=Bp&&typeof module=="object"&&module&&!module.nodeType&&module,mC=Hp&&Hp.exports===Bp,Gp=mC?Ve.Buffer:void 0,Vp=Gp?Gp.allocUnsafe:void 0;function zp(e,t){if(t)return e.slice();var n=e.length,r=Vp?Vp(n):new e.constructor(n);return e.copy(r),r}function vC(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Wp(){return[]}var yC=Object.prototype,EC=yC.propertyIsEnumerable,Yp=Object.getOwnPropertySymbols,vc=Yp?function(e){return e==null?[]:(e=Object(e),vC(Yp(e),function(t){return EC.call(e,t)}))}:Wp;function xC(e,t){return $r(e,vc(e),t)}var bC=Object.getOwnPropertySymbols,qp=bC?function(e){for(var t=[];e;)dc(t,vc(e)),e=pc(e);return t}:Wp;function SC(e,t){return $r(e,qp(e),t)}function Xp(e,t,n){var r=t(e);return Xt(e)?r:dc(r,n(e))}function yc(e){return Xp(e,Wi,vc)}function Zp(e){return Xp(e,Yi,qp)}var Ec=ir(Ve,"DataView"),xc=ir(Ve,"Promise"),Gr=ir(Ve,"Set"),jp="[object Map]",_C="[object Object]",Kp="[object Promise]",Qp="[object Set]",Jp="[object WeakMap]",tg="[object DataView]",TC=rr(Ec),OC=rr(Xi),wC=rr(xc),MC=rr(Gr),CC=rr(rc),Le=nr;(Ec&&Le(new Ec(new ArrayBuffer(1)))!=tg||Xi&&Le(new Xi)!=jp||xc&&Le(xc.resolve())!=Kp||Gr&&Le(new Gr)!=Qp||rc&&Le(new rc)!=Jp)&&(Le=function(e){var t=nr(e),n=t==_C?e.constructor:void 0,r=n?rr(n):"";if(r)switch(r){case TC:return tg;case OC:return jp;case wC:return Kp;case MC:return Qp;case CC:return Jp}return t});var AC=Object.prototype,DC=AC.hasOwnProperty;function LC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&DC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Ba=Ve.Uint8Array;function bc(e){var t=new e.constructor(e.byteLength);return new Ba(t).set(new Ba(e)),t}function RC(e,t){var n=t?bc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var IC=/\w*$/;function kC(e){var t=new e.constructor(e.source,IC.exec(e));return t.lastIndex=e.lastIndex,t}var eg=Ae?Ae.prototype:void 0,ng=eg?eg.valueOf:void 0;function PC(e){return ng?Object(ng.call(e)):{}}function rg(e,t){var n=t?bc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var NC="[object Boolean]",$C="[object Date]",FC="[object Map]",UC="[object Number]",BC="[object RegExp]",HC="[object Set]",GC="[object String]",VC="[object Symbol]",zC="[object ArrayBuffer]",WC="[object DataView]",YC="[object Float32Array]",qC="[object Float64Array]",XC="[object Int8Array]",ZC="[object Int16Array]",jC="[object Int32Array]",KC="[object Uint8Array]",QC="[object Uint8ClampedArray]",JC="[object Uint16Array]",tA="[object Uint32Array]";function eA(e,t,n){var r=e.constructor;switch(t){case zC:return bc(e);case NC:case $C:return new r(+e);case WC:return RC(e,n);case YC:case qC:case XC:case ZC:case jC:case KC:case QC:case JC:case tA:return rg(e,n);case FC:return new r;case UC:case GC:return new r(e);case BC:return kC(e);case HC:return new r;case VC:return PC(e)}}function ig(e){return typeof e.constructor=="function"&&!ka(e)?ZT(pc(e)):{}}var nA="[object Map]";function rA(e){return nn(e)&&Le(e)==nA}var sg=Br&&Br.isMap,iA=sg?oc(sg):rA,sA="[object Set]";function aA(e){return nn(e)&&Le(e)==sA}var ag=Br&&Br.isSet,oA=ag?oc(ag):aA,lA=1,cA=2,uA=4,og="[object Arguments]",hA="[object Array]",dA="[object Boolean]",fA="[object Date]",pA="[object Error]",lg="[object Function]",gA="[object GeneratorFunction]",mA="[object Map]",vA="[object Number]",cg="[object Object]",yA="[object RegExp]",EA="[object Set]",xA="[object String]",bA="[object Symbol]",SA="[object WeakMap]",_A="[object ArrayBuffer]",TA="[object DataView]",OA="[object Float32Array]",wA="[object Float64Array]",MA="[object Int8Array]",CA="[object Int16Array]",AA="[object Int32Array]",DA="[object Uint8Array]",LA="[object Uint8ClampedArray]",RA="[object Uint16Array]",IA="[object Uint32Array]",Dt={};Dt[og]=Dt[hA]=Dt[_A]=Dt[TA]=Dt[dA]=Dt[fA]=Dt[OA]=Dt[wA]=Dt[MA]=Dt[CA]=Dt[AA]=Dt[mA]=Dt[vA]=Dt[cg]=Dt[yA]=Dt[EA]=Dt[xA]=Dt[bA]=Dt[DA]=Dt[LA]=Dt[RA]=Dt[IA]=!0,Dt[pA]=Dt[lg]=Dt[SA]=!1;function Ki(e,t,n,r,i,s){var a,o=t&lA,l=t&cA,c=t&uA;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!De(e))return e;var u=Xt(e);if(u){if(a=LC(e),!o)return Zf(e,a)}else{var d=Le(e),h=d==lg||d==gA;if(Ur(e))return zp(e,o);if(d==cg||d==og||h&&!i){if(a=l||h?{}:ig(e),!o)return l?SC(e,gC(a,e)):xC(e,pC(a,e))}else{if(!Dt[d])return i?e:{};a=eA(e,d,o)}}s||(s=new ze);var f=s.get(e);if(f)return f;s.set(e,a),oA(e)?e.forEach(function(m){a.add(Ki(m,t,n,m,e,s))}):iA(e)&&e.forEach(function(m,v){a.set(v,Ki(m,t,n,v,e,s))});var p=c?l?Zp:yc:l?Yi:Wi,g=u?void 0:p(e);return iO(g||e,function(m,v){g&&(v=m,m=e[v]),Kf(a,v,Ki(m,t,n,v,e,s))}),a}var kA=1,PA=4;function Tn(e){return Ki(e,kA|PA)}var NA="__lodash_hash_undefined__";function $A(e){return this.__data__.set(e,NA),this}function FA(e){return this.__data__.has(e)}function Qi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new _n;++t<n;)this.add(e[t])}Qi.prototype.add=Qi.prototype.push=$A,Qi.prototype.has=FA;function ug(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function hg(e,t){return e.has(t)}var UA=1,BA=2;function dg(e,t,n,r,i,s){var a=n&UA,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&BA?new Qi:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var p=e[d],g=t[d];if(r)var m=a?r(g,p,d,t,e,s):r(p,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(f){if(!ug(t,function(v,S){if(!hg(f,S)&&(p===v||i(p,v,n,r,s)))return f.push(S)})){h=!1;break}}else if(!(p===g||i(p,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function HA(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Sc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var GA=1,VA=2,zA="[object Boolean]",WA="[object Date]",YA="[object Error]",qA="[object Map]",XA="[object Number]",ZA="[object RegExp]",jA="[object Set]",KA="[object String]",QA="[object Symbol]",JA="[object ArrayBuffer]",tD="[object DataView]",fg=Ae?Ae.prototype:void 0,_c=fg?fg.valueOf:void 0;function eD(e,t,n,r,i,s,a){switch(n){case tD:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case JA:return!(e.byteLength!=t.byteLength||!s(new Ba(e),new Ba(t)));case zA:case WA:case XA:return Vi(+e,+t);case YA:return e.name==t.name&&e.message==t.message;case ZA:case KA:return e==t+"";case qA:var o=HA;case jA:var l=r&GA;if(o||(o=Sc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=VA,a.set(e,t);var u=dg(o(e),o(t),r,i,s,a);return a.delete(e),u;case QA:if(_c)return _c.call(e)==_c.call(t)}return!1}var nD=1,rD=Object.prototype,iD=rD.hasOwnProperty;function sD(e,t,n,r,i,s){var a=n&nD,o=yc(e),l=o.length,c=yc(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:iD.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(r)var E=a?r(S,v,h,t,e,s):r(v,S,h,e,t,s);if(!(E===void 0?v===S||i(v,S,n,r,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 aD=1,pg="[object Arguments]",gg="[object Array]",Ha="[object Object]",oD=Object.prototype,mg=oD.hasOwnProperty;function lD(e,t,n,r,i,s){var a=Xt(e),o=Xt(t),l=a?gg:Le(e),c=o?gg:Le(t);l=l==pg?Ha:l,c=c==pg?Ha:c;var u=l==Ha,d=c==Ha,h=l==c;if(h&&Ur(e)){if(!Ur(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new ze),a||Pa(e)?dg(e,t,n,r,i,s):eD(e,t,l,n,r,i,s);if(!(n&aD)){var f=u&&mg.call(e,"__wrapped__"),p=d&&mg.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return s||(s=new ze),i(g,m,n,r,s)}}return h?(s||(s=new ze),sD(e,t,n,r,i,s)):!1}function Ga(e,t,n,r,i){return e===t?!0:e==null||t==null||!nn(e)&&!nn(t)?e!==e&&t!==t:lD(e,t,n,r,Ga,i)}var cD=1,uD=2;function hD(e,t,n,r){var i=n.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new ze,d;if(!(d===void 0?Ga(c,l,cD|uD,r,u):d))return!1}}return!0}function vg(e){return e===e&&!De(e)}function dD(e){for(var t=Wi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,vg(i)]}return t}function yg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function fD(e){var t=dD(e);return t.length==1&&t[0][2]?yg(t[0][0],t[0][1]):function(n){return n===e||hD(n,e,t)}}function pD(e,t){return e!=null&&t in Object(e)}function gD(e,t,n){t=Fa(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=ji(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&ac(i)&&ic(a,i)&&(Xt(e)||Fr(e)))}function mD(e,t){return e!=null&&gD(e,t,pD)}var vD=1,yD=2;function ED(e,t){return cc(e)&&vg(t)?yg(ji(e),t):function(n){var r=yt(n,e);return r===void 0&&r===t?mD(n,e):Ga(t,r,vD|yD)}}function xD(e){return function(t){return t==null?void 0:t[e]}}function bD(e){return function(t){return hc(t,e)}}function SD(e){return cc(e)?xD(ji(e)):bD(e)}function Va(e){return typeof e=="function"?e:e==null?tc:typeof e=="object"?Xt(e)?ED(e[0],e[1]):fD(e):SD(e)}function _D(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function TD(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var Eg=TD();function OD(e,t){return e&&Eg(e,t,Wi)}function wD(e,t){return function(n,r){if(n==null)return n;if(!sr(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var Tc=wD(OD);function MD(e,t,n,r){return Tc(e,function(i,s,a){t(r,i,n(i),a)}),r}function CD(e,t){return function(n,r){var i=Xt(n)?_D:MD,s={};return i(n,e,Va(r),s)}}var Oc=function(){return Ve.Date.now()},AD="Expected a function",DD=Math.max,LD=Math.min;function za(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(AD);t=Nr(t)||0,De(n)&&(u=!!n.leading,d="maxWait"in n,s=d?DD(Nr(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(_){var C=r,D=i;return r=i=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,B=t-C;return d?LD(B,s-D):B}function m(_){var C=_-l,D=_-c;return l===void 0||C>=t||C<0||d&&D>=s}function v(){var _=Oc();if(m(_))return S(_);o=setTimeout(v,g(_))}function S(_){return o=void 0,h&&r?f(_):(r=i=void 0,a)}function E(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function b(){return o===void 0?a:S(Oc())}function x(){var _=Oc(),C=m(_);if(r=arguments,i=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 wc(e,t,n){(n!==void 0&&!Vi(e[t],n)||n===void 0&&!(t in e))&&Ia(e,t,n)}function Mc(e){return nn(e)&&sr(e)}function Cc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function RD(e){return $r(e,Yi(e))}function ID(e,t,n,r,i,s,a){var o=Cc(e,n),l=Cc(t,n),c=a.get(l);if(c){wc(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Xt(l),f=!h&&Ur(l),p=!h&&!f&&Pa(l);u=l,h||f||p?Xt(o)?u=o:Mc(o)?u=Zf(o):f?(d=!1,u=zp(l,!0)):p?(d=!1,u=rg(l,!0)):u=[]:dp(l)||Fr(l)?(u=o,Fr(o)?u=RD(o):(!De(o)||ec(o))&&(u=ig(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),wc(e,n,u)}function xg(e,t,n,r,i){e!==t&&Eg(t,function(s,a){if(i||(i=new ze),De(s))ID(e,t,a,n,xg,r,i);else{var o=r?r(Cc(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),wc(e,a,o)}},Yi)}var kD="Expected a function";function PD(e,t,n){if(typeof e!="function")throw new TypeError(kD);return setTimeout(function(){e.apply(void 0,n)},t)}var ND=sc(function(e,t,n){return PD(e,Nr(t)||0,n)});function bg(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function $D(e,t){var n=-1,r=sr(e)?Array(e.length):[];return Tc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function FD(e,t){var n=Xt(e)?Jl:$D;return n(e,Va(t))}var UD=1/0;function BD(e,t){return Ua(FD(e,t),UD)}function HD(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var GD=Object.prototype,VD=GD.hasOwnProperty,zD=CD(function(e,t,n){VD.call(e,n)?e[n].push(t):Ia(e,n,[t])});function WD(e,t){return t.length<2?e:hc(e,fp(t,0,-1))}var YD="[object Map]",qD="[object Set]",XD=Object.prototype,ZD=XD.hasOwnProperty;function We(e){if(e==null)return!0;if(sr(e)&&(Xt(e)||typeof e=="string"||typeof e.splice=="function"||Ur(e)||Pa(e)||Fr(e)))return!e.length;var t=Le(e);if(t==YD||t==qD)return!e.size;if(ka(e))return!cp(e).length;for(var n in e)if(ZD.call(e,n))return!1;return!0}function Sg(e,t){return Ga(e,t)}var Vr=Fp(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ct=mO(function(e,t,n){xg(e,t,n)});function jD(e,t){return t=Fa(t,e),e=WD(e,t),e==null||delete e[ji(bg(t))]}function KD(e){return dp(e)?void 0:e}var QD=1,JD=2,tL=4,eL=Uw(function(e,t){var n={};if(e==null)return n;var r=!1;t=Jl(t,function(s){return s=Fa(s,e),r||(r=s.length>1),s}),$r(e,Zp(e),n),r&&(n=Ki(n,QD|JD|tL,KD));for(var i=t.length;i--;)jD(n,t[i]);return n});function nL(e,t){var n;return Tc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function rL(e,t,n){var r=Xt(e)?ug:nL;return r(e,Va(t))}var iL=1/0,sL=Gr&&1/Sc(new Gr([,-0]))[1]==iL?function(e){return new Gr(e)}:KT,aL=200;function _g(e,t,n){var r=-1,i=cO,s=e.length,a=!0,o=[],l=o;if(s>=aL){var c=t?null:sL(e);if(c)return Sc(c);a=!1,i=hg,l=new Qi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var oL=sc(function(e){var t=bg(e);return Mc(t)&&(t=void 0),_g(Ua(e,1,Mc,!0),Va(t))});function Ji(e){return e&&e.length?_g(e):[]}var Ac=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Ac||{}),Dc=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Dc||{}),Lc=(e=>(e.UPDATE="model-update",e))(Lc||{}),Tg=(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))(Tg||{}),Rc=(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))(Rc||{}),Ic=(e=>(e.CHANGE="zoom-domain-change",e))(Ic||{}),kc=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(kc||{}),Pc=(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))(Pc||{}),Nc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Nc||{}),$c=(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))($c||{}),Fc=(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))(Fc||{}),Uc=(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))(Uc||{}),Bc=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Bc||{}),Hc=(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))(Hc||{}),Gc=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Gc||{}),Vc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Vc||{}),zc=(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))(zc||{}),Wc=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Wc||{}),Yc=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Yc||{}),zr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(zr||{}),qc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(qc||{}),Og=(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))(Og||{}),wg=(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))(wg||{}),Mg=(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))(Mg||{}),Cg=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Cg||{}),Ag=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Ag||{}),Wr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Wr||{});const T=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Mg,Area:Nc,Axis:Pc,Bar:Bc,Boxplot:Hc,CanvasZoom:kc,Chart:Ac,Choropleth:Wr,CirclePack:wg,Gauge:Uc,Heatmap:Ag,Legend:Og,Line:Vc,Meter:Cg,Modal:Dc,Model:Lc,Pie:Fc,Radar:zc,Scatter:Gc,Threshold:qc,Toolbar:Tg,Tooltip:zr,Tree:Wc,Treemap:Yc,WordCloud:$c,ZoomBar:Rc,ZoomDomain:Ic},Symbol.toStringTag,{value:"Module"}));var at=(e=>(e.HTML="html",e.SVG="svg",e))(at||{}),Xc=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Xc||{}),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||{}),Ye=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ye||{}),Re=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Re||{}),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||{}),Yr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Yr||{}),Gt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Gt||{}),qr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(qr||{}),Wa=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Wa||{}),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||{}),or=(e=>(e.CENTER="center",e))(or||{}),ts=(e=>(e.LEFT="left",e.RIGHT="right",e))(ts||{}),Vt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Vt||{}),rn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(rn||{}),sn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(sn||{}),lr=(e=>(e.SEMI="semi",e.FULL="full",e))(lr||{}),Ya=(e=>(e.UP="up",e.DOWN="down",e))(Ya||{}),es=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(es||{}),ns=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(ns||{}),be=(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))(be||{}),St=(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))(St||{}),qa=(e=>(e.LEFT="left",e.RIGHT="right",e))(qa||{}),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||{}),rs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(rs||{}),Xr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Xr||{}),is=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(is||{}),an=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(an||{});const fe="cds",On={opacity:{unselected:.05,selected:.4}},$n={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Zr={duration:1e3,ease:Dh,zoomLevel:3},jr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},Dg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ie={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},lL={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}},Zt={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}},cr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},qe={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Lg={minCellDividerDimension:16},Rg={default:{size:24}},Ig={defaultOffset:4,horizontalOffset:10},kg={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}},Se={height:{[Ye.GRAPH_VIEW]:32,[Ye.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},cL=[{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 uL(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=zn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function It(e,t){var i;const n=Tn(e),r=Object.keys(t.axes||{});(i=t==null?void 0:t.toolbar)!=null&&i.controls&&delete n.toolbar.controls,r.length===0&&delete n.axes;for(const s in n.axes)if(r.includes(s)){const a=t.axes[s];(a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/");const o=a.mapsTo;if(o==null){const l=a.scaleType;l==null?a.mapsTo="value":l===rt.TIME?a.mapsTo="date":l===rt.LABELS&&(a.mapsTo="key")}}else delete n.axes[s];return jc(n,t),ct(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 r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function ss(e){const n=/\(([^)]+)\)/.exec(e);if(n&&n.length>1){const r=n[1].split(",");if(r.length>1)return{x:parseFloat(r[0]),y:parseFloat(r[1])}}return{x:0,y:0}}function Zc(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function as(e,t,n){if(n>e.length)return e;if(t===Re.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Re.FRONT_LINE)return"..."+e.substr(-n);if(t===Re.END_LINE)return e.substr(0,n)+"..."}function jc(e,t){const n=y(e,"legend","additionalItems"),r=y(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=cL.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=oL(a,r,"name")}}const y=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},Pg=(e,t)=>t===Ht.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ie=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Pg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function Cn(e,t,n){return n===Ht.VERTICAL?[e,t]:[t,e]}function Kc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function os(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function ls(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?dL(o,d=>d.test(a)):hL(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 hL(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function dL(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function fL(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const Ng=6048e5,pL=864e5,$g=6e4,Fg=36e5,Ug=Symbol.for("constructDateFrom");function ke(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ug in e?e[Ug](t):e instanceof Date?new e.constructor(t):new Date(t)}function ur(e,...t){const n=ke.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let gL={};function Xa(){return gL}function $t(e,t){return ke(t||e,e)}function cs(e,t){var o,l,c,u;const n=Xa(),r=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=$t(e,t==null?void 0:t.in),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}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"}},vL=(e,t,n)=>{let r;const i=mL[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},yL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},EL=(e,t,n,r)=>yL[e],xL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},bL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},SL={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"]},_L={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"]},TL={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"}},OL={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"}},wL={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:os({values:xL,defaultWidth:"wide"}),quarter:os({values:bL,defaultWidth:"wide",argumentCallback:e=>e-1}),month:os({values:SL,defaultWidth:"wide"}),day:os({values:_L,defaultWidth:"wide"}),dayPeriod:os({values:TL,defaultWidth:"wide",formattingValues:OL,defaultFormattingWidth:"wide"})},ML=/^(\d+)(th|st|nd|rd)?/i,CL=/\d+/i,AL={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},DL={any:[/^b/i,/^(a|c)/i]},LL={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},RL={any:[/1/i,/2/i,/3/i,/4/i]},IL={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},kL={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]},PL={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},NL={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]},$L={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},FL={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}},UL={ordinalNumber:fL({matchPattern:ML,parsePattern:CL,valueCallback:e=>parseInt(e,10)}),era:ls({matchPatterns:AL,defaultMatchWidth:"wide",parsePatterns:DL,defaultParseWidth:"any"}),quarter:ls({matchPatterns:LL,defaultMatchWidth:"wide",parsePatterns:RL,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ls({matchPatterns:IL,defaultMatchWidth:"wide",parsePatterns:kL,defaultParseWidth:"any"}),day:ls({matchPatterns:PL,defaultMatchWidth:"wide",parsePatterns:NL,defaultParseWidth:"any"}),dayPeriod:ls({matchPatterns:$L,defaultMatchWidth:"any",parsePatterns:FL,defaultParseWidth:"any"})},BL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},HL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},GL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},VL={date:Kc({formats:BL,defaultWidth:"full"}),time:Kc({formats:HL,defaultWidth:"full"}),dateTime:Kc({formats:GL,defaultWidth:"full"})},Bg={code:"en-US",formatDistance:vL,formatLong:VL,formatRelative:EL,localize:wL,match:UL,options:{weekStartsOn:0,firstWeekContainsDate:1}},Kr={type:Re.END_LINE,threshold:16,numCharacter:14},zL={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>e.toLocaleString(t),date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},WL={enabled:!0,position:Yr.BOTTOM,clickable:!0,truncation:Kr,alignment:Gt.LEFT,order:null,additionalItems:[]},YL={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},qL={enabled:!0},Hg={enabled:!0,showTotal:!0,truncation:Kr,groupLabel:"Group"},Gg={top:{visible:!0,includeZero:!0,truncation:Kr},bottom:{visible:!0,includeZero:!0,truncation:Kr},left:{visible:!0,includeZero:!0,truncation:Kr},right:{visible:!0,includeZero:!0,truncation:Kr}},Za={addSpaceOnEdges:1,showDayName:!1,localeObject:Bg,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 Vg=!1;try{Vg=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const ee={width:null,height:null,resizable:!0,theme:Xc.WHITE,tooltip:Hg,legend:WL,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:St.SHOW_AS_DATATABLE},...Vg?[{type:St.MAKE_FULLSCREEN}]:[],{type:St.EXPORT_CSV},{type:St.EXPORT_PNG},{type:St.EXPORT_JPG}]}},zg=ct({},ee,{thematic:{projection:an.geoNaturalEarth1}}),us=ct({},ee,{axes:Gg,timeScale:Za,grid:YL,ruler:qL,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ye.GRAPH_VIEW}}}),hr=ct({},us,{bars:{maxWidth:16,spacingFactor:.25},timeScale:ct(Za,{addSpaceOnEdges:1})}),XL=ct({},hr,{}),ZL=ct({},hr,{}),jL=ct({},hr,{bars:ct({},hr.bars,{dividerSize:1.5})}),KL=ct({},hr,{}),Qc=ct({},us,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),QL=Qc,Wg=ct({},Qc,{points:{radius:3,filled:!1,enabled:!0}}),Yg=ct({},Wg,{timeScale:ct(Za,{addSpaceOnEdges:0})}),JL=Yg,tR=ct({},us,{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"}]}}),eR=ct({},us,{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"}]}}),nR=ct({},hr,{bars:{dividerSize:1.5},timeScale:ct(Za,{addSpaceOnEdges:0})}),rR=ct({},ee,{tooltip:ct({},Hg,{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"}}),qg=ct({},ee,{pie:{labels:{formatter:null,enabled:!0},alignment:Gt.LEFT,sortFunction:null,valueMapsTo:"value"}}),iR=ct({},ee,{legend:{enabled:!1},gauge:{type:lr.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}}),sR=ct({},qg,{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}}),Xg=ct({},ee,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),aR=ct({},Xg,{legend:{enabled:!0}}),oR=ct({},ee,{radar:{axes:{angle:"key",value:"value"},alignment:Gt.LEFT},tooltip:{gridline:{enabled:!0}}}),lR=ct({},hr,{comboChartTypes:[]}),cR=ct({tree:{type:Wa.TREE}},ee,{}),uR=ct({},ee,{data:ct(ee.data,{groupMapsTo:"name"})}),hR=ct({},ee,jr,{data:ct(ee.data,{groupMapsTo:"name"})}),dR=ct({},ee,{alluvial:{data:ct(ee.data,{groupMapsTo:"source"}),nodeAlignment:Gt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),fR=ct({},ee,{axes:Gg,heatmap:{divider:{state:Xr.AUTO},colorLegend:{type:"linear"}}}),pR=ct({},zg,{choropleth:{colorLegend:{type:"linear"}}}),At={alluvialChart:dR,areaChart:Yg,axisChart:us,boxplotChart:KL,bubbleChart:tR,bulletChart:eR,chart:ee,circlePackChart:hR,choroplethChart:pR,comboChart:lR,donutChart:sR,gaugeChart:iR,groupedBarChart:ZL,heatmapChart:fR,histogramChart:nR,lineChart:Wg,lollipopChart:QL,meterChart:Xg,pieChart:qg,proportionalMeterChart:aR,radarChart:oR,scatterChart:Qc,simpleBarChart:XL,stackedAreaChart:JL,stackedBarChart:jL,thematicChart:zg,treeChart:cR,treemapChart:uR,wordCloudChart:rR};function Zg(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 jg(e,t){const n=$t(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Kg(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=jg(r),a=jg(i),o=+s-Zg(s),l=+a-Zg(a);return Math.round((o-l)/pL)}function gR(e,t){const n=$t(e,t==null?void 0: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==null?void 0:t.in);return Kg(n,gR(n))+1}function ja(e,t){return cs(e,{...t,weekStartsOn:1})}function Qg(e,t){const n=$t(e,t==null?void 0:t.in),r=n.getFullYear(),i=ke(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=ja(i),a=ke(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=ja(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function vR(e,t){const n=Qg(e,t),r=ke(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ja(r)}function yR(e,t){const n=$t(e,t==null?void 0:t.in),r=+ja(n)-+vR(n);return Math.round(r/Ng)+1}function Jg(e,t){var u,d,h,f;const n=$t(e,t==null?void 0:t.in),r=n.getFullYear(),i=Xa(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,a=ke((t==null?void 0:t.in)||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=cs(a,t),l=ke((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=cs(l,t);return+n>=+o?r+1:+n>=+c?r:r-1}function ER(e,t){var o,l,c,u;const n=Xa(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=Jg(e,t),s=ke((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),cs(s,t)}function xR(e,t){const n=$t(e,t==null?void 0:t.in),r=+cs(n,t)-+ER(n,t);return Math.round(r/Ng)+1}function Ot(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Fn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ot(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ot(n+1,2)},d(e,t){return Ot(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 Ot(e.getHours()%12||12,t.length)},H(e,t){return Ot(e.getHours(),t.length)},m(e,t){return Ot(e.getMinutes(),t.length)},s(e,t){return Ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ot(i,t.length)}},Qr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Fn.y(e,t)},Y:function(e,t,n,r){const i=Jg(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return Ot(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ot(s,t.length)},R:function(e,t){const n=Qg(e);return Ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ot(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ot(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ot(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Fn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ot(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=xR(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ot(i,t.length)},I:function(e,t,n){const r=yR(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ot(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Fn.d(e,t)},D:function(e,t,n){const r=mR(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ot(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ot(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ot(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Ot(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Qr.noon:r===0?i=Qr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Qr.evening:r>=12?i=Qr.afternoon:r>=4?i=Qr.morning:i=Qr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Fn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Fn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Fn.s(e,t)},S:function(e,t){return Fn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return nm(r);case"XXXX":case"XX":return dr(r);case"XXXXX":case"XXX":default:return dr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return nm(r);case"xxxx":case"xx":return dr(r);case"xxxxx":case"xxx":default:return dr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+em(r,":");case"OOOO":default:return"GMT"+dr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+em(r,":");case"zzzz":default:return"GMT"+dr(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ot(r,t.length)},T:function(e,t,n){return Ot(+e,t.length)}};function em(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Ot(s,2)}function nm(e,t){return e%60===0?(e>0?"-":"+")+Ot(Math.abs(e)/60,2):dr(e,t)}function dr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ot(Math.trunc(r/60),2),s=Ot(r%60,2);return n+i+t+s}const rm=(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"})}},im=(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"})}},bR={p:im,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return rm(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",rm(r,t)).replace("{{time}}",im(i,t))}},SR=/^D+$/,_R=/^Y+$/,TR=["D","DD","YY","YYYY"];function OR(e){return SR.test(e)}function wR(e){return _R.test(e)}function MR(e,t,n){const r=CR(e,t,n);if(console.warn(r),TR.includes(e))throw new RangeError(r)}function CR(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function AR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function DR(e){return!(!AR(e)&&typeof e!="number"||isNaN(+$t(e)))}const LR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,RR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IR=/^'([^]*?)'?$/,kR=/''/g,PR=/[a-zA-Z]/;function Jc(e,t,n){var u,d,h,f,p,g,m,v;const r=Xa(),i=(n==null?void 0:n.locale)??r.locale??Bg,s=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((f=(h=r.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((v=(m=r.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??0,o=$t(e,n==null?void 0:n.in);if(!DR(o))throw new RangeError("Invalid time value");let l=t.match(RR).map(S=>{const E=S[0];if(E==="p"||E==="P"){const b=bR[E];return b(S,i.formatLong)}return S}).join("").match(LR).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const E=S[0];if(E==="'")return{isToken:!1,value:NR(S)};if(tm[E])return{isToken:!0,value:S};if(E.match(PR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const E=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&wR(E)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&OR(E))&&MR(E,t,String(e));const b=tm[E[0]];return b(o,E,i.localize,c)}).join("")}function NR(e){const t=e.match(IR);return t?t[1].replace(kR,"'"):e}var sm=(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))(sm||{});const tu=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function am(e,t,n,r,i){const s=t===0,a=Number(Jc(new Date(e),"c"))===2,o=Number(Jc(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Qa(e)||hs(e,l)||Un(e);case"minute":return s||Qa(e)||hs(e,l)||Un(e);case"30minutes":return s||Qa(e)||hs(e,l)||Un(e);case"hourly":return s||Qa(e)||hs(e,l)||Un(e);case"daily":return i?s||a||Un(e):s||hs(e,l)||Un(e);case"weekly":return s||a||Un(e);case"monthly":return s||Un(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function eu(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=y(i,"timeIntervalFormats")[o],u=y(c,"primary"),d=y(c,"secondary"),h=am(e,t,n,r,a);let f=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=i.localeObject,{code:g,optionsObject:m}=s,v=m[r].type,S=m[r][h?"primary":"secondary"][f];if(r==="quarterly"||!S){const b=Jc(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 Ka(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function $R(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function FR(e){const t=tu.reduce((n,[,r],i)=>{const s=tu[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return tu[t][0]}function nu(e,t){if(sm[t])return t;if(e.length===1)return"15seconds";const n=$R(e),r=kn(n);return FR(r)}function Qa(e){const{s:t,m:n,H:r}=Ka(e);return r===0&&n===0&&t===0}function hs(e,t){const n=Ka(e).M,r=Ka(t).M;return n!==r}function Un(e){const{M:t,d:n,s:r,m:i,H:s}=Ka(e);return t===1&&n===1&&s===0&&i===0&&r===0}function om(e){return e===void 0?"":e.toISOString()}function UR(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class on{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=y(r,"locale"),o=y(r,"tabularRepModal","tableHeadingFormatter"),l=y(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===rt.TIME&&(d=f=>s(f,i,{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,i))}return f})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=y(n,"data"),a=y(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===rt.LINEAR||c===rt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===rt.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Pt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(a=>r.find(o=>o.name===a[i]&&o.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(Tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return y(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(r=>t.includes(r.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Pt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(r=>r.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(r=>r.name)}aggregateBinDataByGroup(t){return zD(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=lL.defaultBins}=s,l=Array.isArray(o),c=l0().value(f=>f[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(f=>f[a]))),h=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,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,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return Ql().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=Ji(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?om(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===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 r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{d[f]=h.filter(p=>p[i]===f).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?om(f[p])===l:f[p].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const c=HD(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(r?Ql().offset(pT):Ql()).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 r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();jc(n,t),this.set({options:ct(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(T.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Pt.items.status,i=this.getDataGroups(),s=i.some(u=>u.status===r),a=i.filter(u=>u.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((u,d)=>{i[d].status=n});else{const u=i.findIndex(d=>d.name===t);i[u].status=i[u].status===r?n:r}else i.forEach((u,d)=>{i[d].status=u.name===t?n:r});const o=i.filter(u=>u.status===n),l=this.getOptions();i.some(u=>u.status===r)?l.data.selectedGroups=o.map(u=>u.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(T.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=y(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=y(s,"label");if(c===null){const d=y(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const n=this.getTabularDataArray().map(a=>a.map(o=>`"${(o==="&ndash;"?"–":o).split(/[,;'"`]/).map(u=>UR(u)).join("")}"`)).map(a=>a.join(",")).join(`
1
+ (function(q,$e){typeof exports=="object"&&typeof module<"u"?$e(exports):typeof define=="function"&&define.amd?define(["exports"],$e):(q=typeof globalThis<"u"?globalThis:q||self,$e(q.Charts={}))})(this,function(q){"use strict";function $e(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Wv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function bo(e){let t,n,r;e.length!==2?(t=$e,n=(o,l)=>$e(e(o),l),r=(o,l)=>e(o)-l):(t=e===$e||e===Wv?e:Yv,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Yv(){return 0}function qv(e){return e===null?NaN:+e}function*Xv(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const So=bo($e).right;bo(qv).center;function Zv(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function Fe(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}class Gn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}class Pu extends Map{constructor(t,n=Qv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(Nu(this,t))}has(t){return super.has(Nu(this,t))}set(t,n){return super.set(jv(this,t),n)}delete(t){return super.delete(Kv(this,t))}}function Nu({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function jv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Kv({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Qv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Jv(e){return e}function t0(e=$e){if(e===$e)return $u;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function $u(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var e0=Array.prototype,n0=e0.slice;function _o(e){return()=>e}const r0=Math.sqrt(50),i0=Math.sqrt(10),s0=Math.sqrt(2);function Os(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=r0?10:s>=i0?5:s>=s0?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Os(e,t,n*2):[o,l,c]}function ws(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?Os(t,e,n):Os(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function vr(e,t,n){return t=+t,e=+e,n=+n,Os(e,t,n)[2]}function To(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?vr(t,e,n):vr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function a0(e,t,n){let r;for(;;){const i=vr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function o0(e){return Math.max(1,Math.ceil(Math.log(Zv(e))/Math.LN2)+1)}function l0(){var e=Jv,t=Fe,n=o0;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const E=h,b=+f;if(t===Fe&&([d,h]=a0(d,h,b)),f=ws(d,h,b),f[0]<=d&&(l=vr(d,h,b)),f[f.length-1]>=h)if(E>=h&&t===Fe){const x=vr(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(i[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(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[So(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:_o(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:_o([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:_o(Array.isArray(i)?n0.call(i):i),r):n},r}function Vn(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function kn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Fu(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?$u:t0(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(r,Math.floor(t+(l-c)*d/l+h));Fu(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(li(e,n,t),i(e[r],s)>0&&li(e,n,r);a<o;){for(li(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?li(e,n,o):(++o,li(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function li(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Oo(e,t,n){if(e=Float64Array.from(Xv(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return kn(e);if(t>=1)return Vn(e);var r,i=(r-1)*t,s=Math.floor(i),a=Vn(Fu(e,s).subarray(0,s+1)),o=kn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*c0(e){for(const t of e)yield*t}function Uu(e){return Array.from(c0(e))}function u0(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function h0(e){return e}var Ms=1,Cs=2,wo=3,ci=4,Bu=1e-6;function d0(e){return"translate("+e+",0)"}function f0(e){return"translate(0,"+e+")"}function p0(e){return t=>+e(t)}function g0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function m0(){return!this.__axis}function As(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ms||e===ci?-1:1,u=e===ci||e===Cs?"x":"y",d=e===Ms||e===wo?d0:f0;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):h0),m=Math.max(s,0)+o,v=t.range(),S=+v[0]+l,E=+v[v.length-1]+l,b=(t.bandwidth?g0:p0)(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(),B=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(B),P=P.merge(B.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),w=w.merge(B.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ms?"0em":e===wo?"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",Bu).attr("transform",function(H){return isFinite(H=b(H))?d(H+l):this.getAttribute("transform")}),B.attr("opacity",Bu).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===ci||e===Cs?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(m0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Cs?"start":e===ci?"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?(r=f==null?null:Array.from(f),h):r&&r.slice()},h.tickFormat=function(f){return arguments.length?(i=f,h):i},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function v0(e){return As(Ms,e)}function y0(e){return As(Cs,e)}function Mo(e){return As(wo,e)}function Hu(e){return As(ci,e)}var E0={value:()=>{}};function Co(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ds(n)}function Ds(e){this._=e}function x0(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ds.prototype=Co.prototype={constructor:Ds,on:function(e,t){var n=this._,r=x0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=b0(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Gu(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Gu(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ds(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function b0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Gu(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=E0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ao="http://www.w3.org/1999/xhtml";const Vu={svg:"http://www.w3.org/2000/svg",xhtml:Ao,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ls(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Vu.hasOwnProperty(t)?{space:Vu[t],local:e}:e}function S0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ao&&t.documentElement.namespaceURI===Ao?t.createElement(e):t.createElementNS(n,e)}}function _0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zu(e){var t=Ls(e);return(t.local?_0:S0)(t)}function T0(){}function Do(e){return e==null?T0:function(){return this.querySelector(e)}}function O0(e){typeof e!="function"&&(e=Do(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new ye(r,this._parents)}function w0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function M0(){return[]}function Wu(e){return e==null?M0:function(){return this.querySelectorAll(e)}}function C0(e){return function(){return w0(e.apply(this,arguments))}}function A0(e){typeof e=="function"?e=C0(e):e=Wu(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new ye(r,i)}function Yu(e){return function(){return this.matches(e)}}function qu(e){return function(t){return t.matches(e)}}var D0=Array.prototype.find;function L0(e){return function(){return D0.call(this.children,e)}}function R0(){return this.firstElementChild}function I0(e){return this.select(e==null?R0:L0(typeof e=="function"?e:qu(e)))}var k0=Array.prototype.filter;function P0(){return Array.from(this.children)}function N0(e){return function(){return k0.call(this.children,e)}}function $0(e){return this.selectAll(e==null?P0:N0(typeof e=="function"?e:qu(e)))}function F0(e){typeof e!="function"&&(e=Yu(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new ye(r,this._parents)}function Xu(e){return new Array(e.length)}function U0(){return new ye(this._enter||this._groups.map(Xu),this._parents)}function Rs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Rs.prototype={constructor:Rs,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 B0(e){return function(){return e}}function H0(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new Rs(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function G0(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(r[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new Rs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function V0(e){return e.__data__}function z0(e,t){if(!arguments.length)return Array.from(this,V0);var n=t?G0:H0,r=this._parents,i=this._groups;typeof e!="function"&&(e=B0(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,f=W0(e.call(u,u&&u.__data__,c,r)),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 ye(a,r),a._enter=o,a._exit=l,a}function W0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Y0(){return new ye(this._exit||this._groups.map(Xu),this._parents)}function q0(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function X0(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<i;++l)o[l]=n[l];return new ye(o,this._parents)}function Z0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function j0(e){e||(e=K0);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new ye(i,this._parents).order()}function K0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Q0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function J0(){return Array.from(this)}function ty(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function ey(){let e=0;for(const t of this)++e;return e}function ny(){return!this.node()}function ry(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function iy(e){return function(){this.removeAttribute(e)}}function sy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ay(e,t){return function(){this.setAttribute(e,t)}}function oy(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ly(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function cy(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 uy(e,t){var n=Ls(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?sy:iy:typeof t=="function"?n.local?cy:ly:n.local?oy:ay)(n,t))}function Zu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function hy(e){return function(){this.style.removeProperty(e)}}function dy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fy(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function py(e,t,n){return arguments.length>1?this.each((t==null?hy:typeof t=="function"?fy:dy)(e,t,n??"")):yr(this.node(),e)}function yr(e,t){return e.style.getPropertyValue(t)||Zu(e).getComputedStyle(e,null).getPropertyValue(t)}function gy(e){return function(){delete this[e]}}function my(e,t){return function(){this[e]=t}}function vy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yy(e,t){return arguments.length>1?this.each((t==null?gy:typeof t=="function"?vy:my)(e,t)):this.node()[e]}function ju(e){return e.trim().split(/^|\s+/)}function Lo(e){return e.classList||new Ku(e)}function Ku(e){this._node=e,this._names=ju(e.getAttribute("class")||"")}Ku.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 Qu(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Ju(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ey(e){return function(){Qu(this,e)}}function xy(e){return function(){Ju(this,e)}}function by(e,t){return function(){(t.apply(this,arguments)?Qu:Ju)(this,e)}}function Sy(e,t){var n=ju(e+"");if(arguments.length<2){for(var r=Lo(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?by:t?Ey:xy)(n,t))}function _y(){this.textContent=""}function Ty(e){return function(){this.textContent=e}}function Oy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wy(e){return arguments.length?this.each(e==null?_y:(typeof e=="function"?Oy:Ty)(e)):this.node().textContent}function My(){this.innerHTML=""}function Cy(e){return function(){this.innerHTML=e}}function Ay(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Dy(e){return arguments.length?this.each(e==null?My:(typeof e=="function"?Ay:Cy)(e)):this.node().innerHTML}function Ly(){this.nextSibling&&this.parentNode.appendChild(this)}function Ry(){return this.each(Ly)}function Iy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ky(){return this.each(Iy)}function Py(e){var t=typeof e=="function"?e:zu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ny(){return null}function $y(e,t){var n=typeof e=="function"?e:zu(e),r=t==null?Ny:typeof t=="function"?t:Do(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Fy(){var e=this.parentNode;e&&e.removeChild(this)}function Uy(){return this.each(Fy)}function By(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Hy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gy(e){return this.select(e?Hy:By)}function Vy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zy(e){return function(t){e.call(this,t,this.__data__)}}function Wy(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Yy(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function qy(e,t,n){return function(){var r=this.__on,i,s=zy(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Xy(e,t,n){var r=Wy(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?qy:Yy,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function th(e,t,n){var r=Zu(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Zy(e,t){return function(){return th(this,e,t)}}function jy(e,t){return function(){return th(this,e,t.apply(this,arguments))}}function Ky(e,t){return this.each((typeof t=="function"?jy:Zy)(e,t))}function*Qy(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var eh=[null];function ye(e,t){this._groups=e,this._parents=t}function ui(){return new ye([[document.documentElement]],eh)}function Jy(){return this}ye.prototype=ui.prototype={constructor:ye,select:O0,selectAll:A0,selectChild:I0,selectChildren:$0,filter:F0,data:z0,enter:U0,exit:Y0,join:q0,merge:X0,selection:Jy,order:Z0,sort:j0,call:Q0,nodes:J0,node:ty,size:ey,empty:ny,each:ry,attr:uy,style:py,property:yy,classed:Sy,text:wy,html:Dy,raise:Ry,lower:ky,append:Py,insert:$y,remove:Uy,clone:Gy,datum:Vy,on:Xy,dispatch:Ky,[Symbol.iterator]:Qy};function I(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],eh)}function t1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function zn(e,t){if(e=t1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ro={capture:!0,passive:!1};function Io(e){e.preventDefault(),e.stopImmediatePropagation()}function e1(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",Io,Ro);"onselectstart"in t?n.on("selectstart.drag",Io,Ro):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function n1(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",Io,Ro),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ko(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nh(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hi(){}var di=.7,Is=1/di,Er="\\s*([+-]?\\d+)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",r1=/^#([0-9a-f]{3,8})$/,i1=new RegExp(`^rgb\\(${Er},${Er},${Er}\\)$`),s1=new RegExp(`^rgb\\(${Ke},${Ke},${Ke}\\)$`),a1=new RegExp(`^rgba\\(${Er},${Er},${Er},${fi}\\)$`),o1=new RegExp(`^rgba\\(${Ke},${Ke},${Ke},${fi}\\)$`),l1=new RegExp(`^hsl\\(${fi},${Ke},${Ke}\\)$`),c1=new RegExp(`^hsla\\(${fi},${Ke},${Ke},${fi}\\)$`),rh={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};ko(hi,dn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ih,formatHex:ih,formatHex8:u1,formatHsl:h1,formatRgb:sh,toString:sh});function ih(){return this.rgb().formatHex()}function u1(){return this.rgb().formatHex8()}function h1(){return uh(this).formatHsl()}function sh(){return this.rgb().formatRgb()}function dn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=r1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ah(t):n===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ks(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ks(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=i1.exec(e))?new he(t[1],t[2],t[3],1):(t=s1.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=a1.exec(e))?ks(t[1],t[2],t[3],t[4]):(t=o1.exec(e))?ks(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=l1.exec(e))?ch(t[1],t[2]/100,t[3]/100,1):(t=c1.exec(e))?ch(t[1],t[2]/100,t[3]/100,t[4]):rh.hasOwnProperty(e)?ah(rh[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function ah(e){return new he(e>>16&255,e>>8&255,e&255,1)}function ks(e,t,n,r){return r<=0&&(e=t=n=NaN),new he(e,t,n,r)}function d1(e){return e instanceof hi||(e=dn(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function Po(e,t,n,r){return arguments.length===1?d1(e):new he(e,t,n,r??1)}function he(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ko(he,Po,nh(hi,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(Wn(this.r),Wn(this.g),Wn(this.b),Ps(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:oh,formatHex:oh,formatHex8:f1,formatRgb:lh,toString:lh}));function oh(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}`}function f1(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}${Yn((isNaN(this.opacity)?1:this.opacity)*255)}`}function lh(){const e=Ps(this.opacity);return`${e===1?"rgb(":"rgba("}${Wn(this.r)}, ${Wn(this.g)}, ${Wn(this.b)}${e===1?")":`, ${e})`}`}function Ps(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yn(e){return e=Wn(e),(e<16?"0":"")+e.toString(16)}function ch(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,r)}function uh(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof hi||(e=dn(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new Ue(a,o,l,e.opacity)}function hh(e,t,n,r){return arguments.length===1?uh(e):new Ue(e,t,n,r??1)}function Ue(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ko(Ue,hh,nh(hi,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new he(No(e>=240?e-240:e+120,i,r),No(e,i,r),No(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ue(dh(this.h),Ns(this.s),Ns(this.l),Ps(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=Ps(this.opacity);return`${e===1?"hsl(":"hsla("}${dh(this.h)}, ${Ns(this.s)*100}%, ${Ns(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dh(e){return e=(e||0)%360,e<0?e+360:e}function Ns(e){return Math.max(0,Math.min(1,e||0))}function No(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const $o=e=>()=>e;function p1(e,t){return function(n){return e+n*t}}function g1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function m1(e){return(e=+e)==1?fh:function(t,n){return n-t?g1(t,n,e):$o(isNaN(t)?n:t)}}function fh(e,t){var n=t-e;return n?p1(e,n):$o(isNaN(e)?t:e)}const $s=function e(t){var n=m1(t);function r(i,s){var a=n((i=Po(i)).r,(s=Po(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=fh(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function v1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function y1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function E1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=pi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function x1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ee(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function b1(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=pi(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Fo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uo=new RegExp(Fo.source,"g");function S1(e){return function(){return e}}function _1(e){return function(t){return e(t)+""}}function ph(e,t){var n=Fo.lastIndex=Uo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Fo.exec(e))&&(i=Uo.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:Ee(r,i)})),n=Uo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?_1(l[0].x):S1(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function pi(e,t){var n=typeof t,r;return t==null||n==="boolean"?$o(t):(n==="number"?Ee:n==="string"?(r=dn(t))?(t=r,$s):ph:t instanceof dn?$s:t instanceof Date?x1:y1(t)?v1:Array.isArray(t)?E1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?b1:Ee)(e,t)}function gh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var mh=180/Math.PI,Bo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vh(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*mh,skewX:Math.atan(l)*mh,scaleX:a,scaleY:o}}var Fs;function T1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bo:vh(t.a,t.b,t.c,t.d,t.e,t.f)}function O1(e){return e==null||(Fs||(Fs=document.createElementNS("http://www.w3.org/2000/svg","g")),Fs.setAttribute("transform",e),!(e=Fs.transform.baseVal.consolidate()))?Bo:(e=e.matrix,vh(e.a,e.b,e.c,e.d,e.e,e.f))}function yh(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x:Ee(c,d)},{i:g-2,x:Ee(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Ee(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Ee(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push(i(f)+"scale(",null,",",null,")");p.push({i:g-4,x:Ee(c,d)},{i:g-2,x:Ee(u,h)})}else(d!==1||h!==1)&&f.push(i(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,g=h.length,m;++p<g;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var w1=yh(T1,"px, ","px)","deg)"),M1=yh(O1,", ",")",")");function C1(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var xr=0,gi=0,mi=0,Eh=1e3,Us,vi,Bs=0,qn=0,Hs=0,yi=typeof performance=="object"&&performance.now?performance:Date,xh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ho(){return qn||(xh(A1),qn=yi.now()+Hs)}function A1(){qn=0}function Gs(){this._call=this._time=this._next=null}Gs.prototype=bh.prototype={constructor:Gs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ho():+n)+(t==null?0:+t),!this._next&&vi!==this&&(vi?vi._next=this:Us=this,vi=this),this._call=e,this._time=n,Go()},stop:function(){this._call&&(this._call=null,this._time=1/0,Go())}};function bh(e,t,n){var r=new Gs;return r.restart(e,t,n),r}function D1(){Ho(),++xr;for(var e=Us,t;e;)(t=qn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xr}function Sh(){qn=(Bs=yi.now())+Hs,xr=gi=0;try{D1()}finally{xr=0,R1(),qn=0}}function L1(){var e=yi.now(),t=e-Bs;t>Eh&&(Hs-=t,Bs=e)}function R1(){for(var e,t=Us,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Us=n);vi=e,Go(r)}function Go(e){if(!xr){gi&&(gi=clearTimeout(gi));var t=e-qn;t>24?(e<1/0&&(gi=setTimeout(Sh,e-yi.now()-Hs)),mi&&(mi=clearInterval(mi))):(mi||(Bs=yi.now(),mi=setInterval(L1,Eh)),xr=1,xh(Sh))}}function _h(e,t,n){var r=new Gs;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var I1=Co("start","end","cancel","interrupt"),k1=[],Th=0,Oh=1,Vo=2,Vs=3,wh=4,zo=5,zs=6;function Ws(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;P1(e,n,{name:t,index:r,group:i,on:I1,tween:k1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Th})}function Wo(e,t){var n=Be(e,t);if(n.state>Th)throw new Error("too late; already scheduled");return n}function Qe(e,t){var n=Be(e,t);if(n.state>Vs)throw new Error("too late; already running");return n}function Be(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function P1(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=bh(s,0,n.time);function s(c){n.state=Oh,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!==Oh)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Vs)return _h(a);f.state===wh?(f.state=zs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=zs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(_h(function(){n.state===Vs&&(n.state=wh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Vo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Vo){for(n.state=Vs,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=f);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=zo,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===zo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=zs,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Yo(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Vo&&r.state<zo,r.state=zs,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function N1(e){return this.each(function(){Yo(this,e)})}function $1(e,t){var n,r;return function(){var i=Qe(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function F1(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Qe(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function U1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Be(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?$1:F1)(n,e,t))}function qo(e,t,n){var r=e._id;return e.each(function(){var i=Qe(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Be(i,r).value[t]}}function Mh(e,t){var n;return(typeof t=="number"?Ee:t instanceof dn?$s:(n=dn(t))?(t=n,$s):ph)(e,t)}function B1(e){return function(){this.removeAttribute(e)}}function H1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function G1(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function V1(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function z1(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function W1(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function Y1(e,t){var n=Ls(e),r=n==="transform"?M1:Mh;return this.attrTween(e,typeof t=="function"?(n.local?W1:z1)(n,r,qo(this,"attr."+e,t)):t==null?(n.local?H1:B1)(n):(n.local?V1:G1)(n,r,t))}function q1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function X1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Z1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&X1(e,s)),n}return i._value=t,i}function j1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&q1(e,s)),n}return i._value=t,i}function K1(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ls(e);return this.tween(n,(r.local?Z1:j1)(r,t))}function Q1(e,t){return function(){Wo(this,e).delay=+t.apply(this,arguments)}}function J1(e,t){return t=+t,function(){Wo(this,e).delay=t}}function tE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Q1:J1)(t,e)):Be(this.node(),t).delay}function eE(e,t){return function(){Qe(this,e).duration=+t.apply(this,arguments)}}function nE(e,t){return t=+t,function(){Qe(this,e).duration=t}}function rE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?eE:nE)(t,e)):Be(this.node(),t).duration}function iE(e,t){if(typeof t!="function")throw new Error;return function(){Qe(this,e).ease=t}}function sE(e){var t=this._id;return arguments.length?this.each(iE(t,e)):Be(this.node(),t).ease}function aE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qe(this,e).ease=n}}function oE(e){if(typeof e!="function")throw new Error;return this.each(aE(this._id,e))}function lE(e){typeof e!="function"&&(e=Yu(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new fn(r,this._parents,this._name,this._id)}function cE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<r;++o)a[o]=t[o];return new fn(a,this._parents,this._name,this._id)}function uE(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 hE(e,t,n){var r,i,s=uE(t)?Wo:Qe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function dE(e,t){var n=this._id;return arguments.length<2?Be(this.node(),n).on.on(e):this.each(hE(n,e,t))}function fE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function pE(){return this.on("end.remove",fE(this._id))}function gE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Do(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,Ws(c[h],t,n,h,c,Be(u,n)));return new fn(s,this._parents,t,n)}function mE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wu(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=Be(u,n),g=0,m=h.length;g<m;++g)(f=h[g])&&Ws(f,t,n,g,h,p);s.push(h),a.push(u)}return new fn(s,a,t,n)}var vE=ui.prototype.constructor;function yE(){return new vE(this._groups,this._parents)}function EE(e,t){var n,r,i;return function(){var s=yr(this,e),a=(this.style.removeProperty(e),yr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Ch(e){return function(){this.style.removeProperty(e)}}function xE(e,t,n){var r,i=n+"",s;return function(){var a=yr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function bE(e,t,n){var r,i,s;return function(){var a=yr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),yr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function SE(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=Qe(this,e),c=l.on,u=l.value[s]==null?o||(o=Ch(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function _E(e,t,n){var r=(e+="")=="transform"?w1:Mh;return t==null?this.styleTween(e,EE(e,r)).on("end.style."+e,Ch(e)):typeof t=="function"?this.styleTween(e,bE(e,r,qo(this,"style."+e,t))).each(SE(this._id,e)):this.styleTween(e,xE(e,r,t),n).on("end.style."+e,null)}function TE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function OE(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&TE(e,a,n)),r}return s._value=t,s}function wE(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,OE(e,t,n??""))}function ME(e){return function(){this.textContent=e}}function CE(e){return function(){var t=e(this);this.textContent=t??""}}function AE(e){return this.tween("text",typeof e=="function"?CE(qo(this,"text",e)):ME(e==null?"":e+""))}function DE(e){return function(t){this.textContent=e.call(this,t)}}function LE(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&DE(i)),t}return r._value=e,r}function RE(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,LE(e))}function IE(){for(var e=this._name,t=this._id,n=Ah(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Be(l,t);Ws(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new fn(r,this._parents,e,n)}function kE(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=Qe(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var PE=0;function fn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ah(){return++PE}var pn=ui.prototype;fn.prototype={constructor:fn,select:gE,selectAll:mE,selectChild:pn.selectChild,selectChildren:pn.selectChildren,filter:lE,merge:cE,selection:yE,transition:IE,call:pn.call,nodes:pn.nodes,node:pn.node,size:pn.size,empty:pn.empty,each:pn.each,on:dE,attr:Y1,attrTween:K1,style:_E,styleTween:wE,text:AE,textTween:RE,remove:pE,tween:U1,delay:tE,duration:rE,ease:sE,easeVarying:oE,end:kE,[Symbol.iterator]:pn[Symbol.iterator]};const NE=e=>+e;function Dh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $E={time:null,delay:0,duration:250,ease:Dh};function FE(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 UE(e){var t,n;e instanceof fn?(t=e._id,e=e._name):(t=Ah(),(n=$E).time=Ho(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&Ws(l,e,t,c,a,n||FE(l,t));return new fn(r,this._parents,e,t)}ui.prototype.interrupt=N1,ui.prototype.transition=UE;const Xo=e=>()=>e;function BE(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function HE(e){e.stopImmediatePropagation()}function Zo(e){e.preventDefault(),e.stopImmediatePropagation()}var Lh={name:"drag"},jo={name:"space"},br={name:"handle"},Sr={name:"center"};const{abs:Rh,max:Kt,min:Qt}=Math;function Ih(e){return[+e[0],+e[1]]}function kh(e){return[Ih(e[0]),Ih(e[1])]}var Ys={name:"x",handles:["w","e"].map(Qo),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]]}},Ko={},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"},Ph={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Nh={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},GE={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},VE={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Qo(e){return{type:e}}function zE(e){return!e.ctrlKey&&!e.button}function WE(){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 YE(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function qE(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function $h(){return XE(Ys)}function XE(e){var t=WE,n=zE,r=YE,i=!0,s=Co("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([Qo("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",gn.overlay).merge(v).each(function(){var E=Jo(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([Qo("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(r).on("touchstart.brush",h).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,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=pi(_,C);function B(P){b.selection=P===1&&C===null?null:D(P),c.call(E),x.brush()}return _!==null&&C!==null?B:B(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();Yo(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=Jo(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 BE(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=(i&&m.metaKey?S="overlay":S)==="selection"?Lh:i&&m.altKey?Sr:br,b=e===Ko?null:GE[S],x=e===Ys?null:VE[S],_=Jo(v),C=_.extent,D=_.selection,B=C[0][0],P,w,H=C[0][1],N,M,O=C[1][0],$,F,L=C[1][1],U,tt,X=0,Y=0,Q,ut=b&&x&&i&&m.shiftKey,et,K,nt=Array.from(m.touches||[m],st=>{const _t=st.identifier;return st=zn(st,v),st.point0=st.slice(),st.identifier=_t,st});Yo(v);var ht=u(v,arguments,!0).beforestart();if(S==="overlay"){D&&(Q=!0);const st=[nt[0],nt[1]||nt[0]];_.selection=D=[[P=e===Ko?B:Qt(st[0][0],st[1][0]),N=e===Ys?H:Qt(st[0][1],st[1][1])],[$=e===Ko?O:Kt(st[0][0],st[1][0]),U=e===Ys?L:Kt(st[0][1],st[1][1])]],nt.length>1&&G(m)}else P=D[0][0],N=D[0][1],$=D[1][0],U=D[1][1];w=P,M=N,F=$,tt=U;var W=I(v).attr("pointer-events","none"),j=W.selectAll(".overlay").attr("cursor",gn[S]);if(m.touches)ht.moved=A,ht.ended=V;else{var J=I(m.view).on("mousemove.brush",A,!0).on("mouseup.brush",V,!0);i&&J.on("keydown.brush",xt,!0).on("keyup.brush",Ut,!0),e1(m.view)}c.call(v),ht.start(m,E.name);function A(st){for(const _t of st.changedTouches||[st])for(const Ne of nt)Ne.identifier===_t.identifier&&(Ne.cur=zn(_t,v));if(ut&&!et&&!K&&nt.length===1){const _t=nt[0];Rh(_t.cur[0]-_t[0])>Rh(_t.cur[1]-_t[1])?K=!0:et=!0}for(const _t of nt)_t.cur&&(_t[0]=_t.cur[0],_t[1]=_t.cur[1]);Q=!0,Zo(st),G(st)}function G(st){const _t=nt[0],Ne=_t.point0;var Oe;switch(X=_t[0]-Ne[0],Y=_t[1]-Ne[1],E){case jo:case Lh:{b&&(X=Kt(B-P,Qt(O-$,X)),w=P+X,F=$+X),x&&(Y=Kt(H-N,Qt(L-U,Y)),M=N+Y,tt=U+Y);break}case br:{nt[1]?(b&&(w=Kt(B,Qt(O,nt[0][0])),F=Kt(B,Qt(O,nt[1][0])),b=1),x&&(M=Kt(H,Qt(L,nt[0][1])),tt=Kt(H,Qt(L,nt[1][1])),x=1)):(b<0?(X=Kt(B-P,Qt(O-P,X)),w=P+X,F=$):b>0&&(X=Kt(B-$,Qt(O-$,X)),w=P,F=$+X),x<0?(Y=Kt(H-N,Qt(L-N,Y)),M=N+Y,tt=U):x>0&&(Y=Kt(H-U,Qt(L-U,Y)),M=N,tt=U+Y));break}case Sr:{b&&(w=Kt(B,Qt(O,P-X*b)),F=Kt(B,Qt(O,$+X*b))),x&&(M=Kt(H,Qt(L,N-Y*x)),tt=Kt(H,Qt(L,U+Y*x)));break}}F<w&&(b*=-1,Oe=P,P=$,$=Oe,Oe=w,w=F,F=Oe,S in Ph&&j.attr("cursor",gn[S=Ph[S]])),tt<M&&(x*=-1,Oe=N,N=U,U=Oe,Oe=M,M=tt,tt=Oe,S in Nh&&j.attr("cursor",gn[S=Nh[S]])),_.selection&&(D=_.selection),et&&(w=D[0][0],F=D[1][0]),K&&(M=D[0][1],tt=D[1][1]),(D[0][0]!==w||D[0][1]!==M||D[1][0]!==F||D[1][1]!==tt)&&(_.selection=[[w,M],[F,tt]],c.call(v),ht.brush(st,E.name))}function V(st){if(HE(st),st.touches){if(st.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else n1(st.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),qE(D)&&(_.selection=null,c.call(v)),ht.end(st,E.name)}function xt(st){switch(st.keyCode){case 16:{ut=b&&x;break}case 18:{E===br&&(b&&($=F-X*b,P=w+X*b),x&&(U=tt-Y*x,N=M+Y*x),E=Sr,G(st));break}case 32:{(E===br||E===Sr)&&(b<0?$=F-X:b>0&&(P=w-X),x<0?U=tt-Y:x>0&&(N=M-Y),E=jo,j.attr("cursor",gn.selection),G(st));break}default:return}Zo(st)}function Ut(st){switch(st.keyCode){case 16:{ut&&(et=K=ut=!1,G(st));break}case 18:{E===Sr&&(b<0?$=F:b>0&&(P=w),x<0?U=tt:x>0&&(N=M),E=br,G(st));break}case 32:{E===jo&&(st.altKey?(b&&($=F-X*b,P=w+X*b),x&&(U=tt-Y*x,N=M+Y*x),E=Sr):(b<0?$=F:b>0&&(P=w),x<0?U=tt:x>0&&(N=M),E=br),j.attr("cursor",gn[S]),G(st));break}default:return}Zo(st)}}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=kh(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Xo(kh(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Xo(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Xo(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const tl=Math.PI,el=2*tl,Xn=1e-6,ZE=el-Xn;function Fh(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function jE(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Fh;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let KE=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Fh:jE(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Xn)if(!(Math.abs(d*l-c*u)>Xn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,g=l*l+c*c,m=f*f+p*p,v=Math.sqrt(g),S=Math.sqrt(h),E=s*Math.tan((tl-Math.acos((g+h-m)/(2*v*S)))/2),b=E/S,x=E/v;Math.abs(b-1)>Xn&&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,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Xn||Math.abs(this._y1-u)>Xn)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%el+el),h>ZE?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>Xn&&this._append`A${r},${r},0,${+(h>=tl)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function QE(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function qs(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function _r(e){return e=qs(Math.abs(e)),e?e[1]:NaN}function JE(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function tx(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ex=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ei(e){if(!(t=ex.exec(e)))throw new Error("invalid format: "+e);var t;return new nl({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]})}Ei.prototype=nl.prototype;function nl(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+""}nl.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 nx(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Uh;function rx(e,t){var n=qs(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Uh=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+qs(e,Math.max(0,t+s-1))[0]}function Bh(e,t){var n=qs(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Hh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:QE,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)=>Bh(e*100,t),r:Bh,s:rx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Gh(e){return e}var Vh=Array.prototype.map,zh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ix(e){var t=e.grouping===void 0||e.thousands===void 0?Gh:JE(Vh.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Gh:tx(Vh.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=Ei(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"):Hh[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==="$"?r:/[%p]/.test(x)?a:"",D=Hh[x],B=/[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,$;if(x==="c")N=D(w)+N,w="";else{w=+w;var F=w<0||1/w<0;if(w=isNaN(w)?l:D(Math.abs(w),E),b&&(w=nx(w)),F&&+w==0&&p!=="+"&&(F=!1),H=(F?p==="("?p:o:p==="-"||p==="("?"":p)+H,N=(x==="s"?zh[8+Uh/3]:"")+N+(F&&p==="("?")":""),B){for(M=-1,O=w.length;++M<O;)if($=w.charCodeAt(M),48>$||$>57){N=($===46?i+w.slice(M+1):w.slice(M))+N,w=w.slice(0,M);break}}}S&&!m&&(w=t(w,1/0));var L=H.length+w.length+N.length,U=L<v?new Array(v-L+1).join(h):"";switch(S&&m&&(w=t(U+w,U.length?v-N.length:1/0),U=""),f){case"<":w=H+w+N+U;break;case"=":w=H+U+w+N;break;case"^":w=U.slice(0,L=U.length>>1)+H+w+N+U.slice(L);break;default:w=U+H+w+N;break}return s(w)}return P.toString=function(){return d+""},P}function u(d,h){var f=c((d=Ei(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(_r(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 Xs,rl,Wh;sx({thousands:",",grouping:[3],currency:["$",""]});function sx(e){return Xs=ix(e),rl=Xs.format,Wh=Xs.formatPrefix,Xs}function ax(e){return Math.max(0,-_r(Math.abs(e)))}function ox(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(_r(t)/3)))*3-_r(Math.abs(e)))}function lx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_r(t)-_r(e))+1}var wt=1e-6,cx=1e-12,gt=Math.PI,de=gt/2,Yh=gt/4,xe=gt*2,re=180/gt,Nt=gt/180,Tt=Math.abs,qh=Math.atan,Zn=Math.atan2,Mt=Math.cos,ux=Math.exp,hx=Math.log,bt=Math.sin,Pn=Math.sign||function(e){return e>0?1:e<0?-1:0},He=Math.sqrt,dx=Math.tan;function fx(e){return e>1?0:e<-1?gt:Math.acos(e)}function mn(e){return e>1?de:e<-1?-de:Math.asin(e)}function we(){}function Zs(e,t){e&&Zh.hasOwnProperty(e.type)&&Zh[e.type](e,t)}var Xh={Feature:function(e,t){Zs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Zs(n[r].geometry,t)}},Zh={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){il(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)il(n[r],t,0)},Polygon:function(e,t){jh(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)jh(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Zs(n[r],t)}};function il(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function jh(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)il(e[n],t,1);t.polygonEnd()}function Tr(e,t){e&&Xh.hasOwnProperty(e.type)?Xh[e.type](e,t):Zs(e,t)}function sl(e){return[Zn(e[1],e[0]),mn(e[2])]}function Or(e){var t=e[0],n=e[1],r=Mt(n);return[r*Mt(t),r*bt(t),bt(n)]}function js(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ks(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 al(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Qs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ol(e){var t=He(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function ll(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function cl(e,t){return Tt(e)>gt&&(e-=Math.round(e/xe)*xe),[e,t]}cl.invert=cl;function Kh(e,t,n){return(e%=xe)?t||n?ll(Jh(e),td(t,n)):Jh(e):t||n?td(t,n):cl}function Qh(e){return function(t,n){return t+=e,Tt(t)>gt&&(t-=Math.round(t/xe)*xe),[t,n]}}function Jh(e){var t=Qh(e);return t.invert=Qh(-e),t}function td(e,t){var n=Mt(e),r=bt(e),i=Mt(t),s=bt(t);function a(o,l){var c=Mt(l),u=Mt(o)*c,d=bt(o)*c,h=bt(l),f=h*n+u*r;return[Zn(d*i-f*s,u*n-h*r),mn(f*i+d*s)]}return a.invert=function(o,l){var c=Mt(l),u=Mt(o)*c,d=bt(o)*c,h=bt(l),f=h*i-d*s;return[Zn(d*i+h*s,u*n+f*r),mn(f*n-u*r)]},a}function px(e){e=Kh(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 gx(e,t,n,r,i,s){if(n){var a=Mt(t),o=bt(t),l=r*n;i==null?(i=t+r*xe,s=t-l/2):(i=ed(a,i),s=ed(a,s),(r>0?i<s:i>s)&&(i+=r*xe));for(var c,u=i;r>0?u>s:u<s;u-=l)c=sl([a,-o*Mt(u),-o*bt(u)]),e.point(c[0],c[1])}}function ed(e,t){t=Or(t),t[0]-=e,ol(t);var n=fx(-t[1]);return((-t[2]<0?-n:n)+xe-wt)%xe}function nd(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:we,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Js(e,t){return Tt(e[0]-t[0])<wt&&Tt(e[1]-t[1])<wt}function ta(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function rd(e,t,n,r,i){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(Js(m,v)){if(!m[2]&&!v[2]){for(i.lineStart(),o=0;o<g;++o)i.point((m=p[o])[0],m[1]);i.lineEnd();return}v[0]+=2*wt}s.push(S=new ta(m,p,null,!0)),a.push(S.o=new ta(m,null,S,!1)),s.push(S=new ta(v,p,null,!1)),a.push(S.o=new ta(v,null,S,!0))}}),!!s.length){for(a.sort(t),id(s),id(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,f=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,f=!f}while(!h.v);i.lineEnd()}}}function id(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function ul(e){return Tt(e[0])<=gt?e[0]:Pn(e[0])*((Tt(e[0])+gt)%xe-gt)}function mx(e,t){var n=ul(t),r=t[1],i=bt(r),s=[bt(n),-Mt(n),0],a=0,o=0,l=new Gn;i===1?r=de+wt:i===-1&&(r=-de-wt);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=ul(f),g=f[1]/2+Yh,m=bt(g),v=Mt(g),S=0;S<h;++S,p=b,m=_,v=C,f=E){var E=d[S],b=ul(E),x=E[1]/2+Yh,_=bt(x),C=Mt(x),D=b-p,B=D>=0?1:-1,P=B*D,w=P>gt,H=m*_;if(l.add(Zn(H*B*bt(P),v*C+H*Mt(P))),a+=w?D+B*xe:D,w^p>=n^b>=n){var N=Ks(Or(f),Or(E));ol(N);var M=Ks(s,N);ol(M);var O=(w^D>=0?-1:1)*mn(M[2]);(r>O||r===O&&(N[0]||N[1]))&&(o+=w^D>=0?1:-1)}}return(a<-1e-6||a<wt&&l<-1e-12)^o&1}function sd(e,t,n,r){return function(i){var s=t(i),a=nd(),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=Uu(u);var b=mx(c,r);u.length?(l||(i.polygonStart(),l=!0),rd(u,yx,b,n,i)):b&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(b,x){e(b,x)&&i.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,B,P;if(d.pop(),c.push(d),d=null,!!C){if(b&1){if(B=x[0],(D=B.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_<D;++_)i.point((P=B[_])[0],P[1]);i.lineEnd()}return}C>1&&b&2&&x.push(x.pop().concat(x.shift())),u.push(x.filter(vx))}}return h}}function vx(e){return e.length>1}function yx(e,t){return((e=e.x)[0]<0?e[1]-de-wt:de-e[1])-((t=t.x)[0]<0?t[1]-de-wt:de-t[1])}const ad=sd(function(){return!0},Ex,bx,[-gt,-de]);function Ex(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?gt:-gt,l=Tt(s-t);Tt(l-gt)<wt?(e.point(t,n=(n+a)/2>0?de:-de),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=gt&&(Tt(t-r)<wt&&(t-=r*wt),Tt(s-o)<wt&&(s-=o*wt),n=xx(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function xx(e,t,n,r){var i,s,a=bt(e-n);return Tt(a)>wt?qh((bt(t)*(s=Mt(r))*bt(n)-bt(r)*(i=Mt(t))*bt(e))/(i*s*a)):(t+r)/2}function bx(e,t,n,r){var i;if(e==null)i=n*de,r.point(-gt,i),r.point(0,i),r.point(gt,i),r.point(gt,0),r.point(gt,-i),r.point(0,-i),r.point(-gt,-i),r.point(-gt,0),r.point(-gt,i);else if(Tt(e[0]-t[0])>wt){var s=e[0]<t[0]?gt:-gt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function Sx(e){var t=Mt(e),n=2*Nt,r=t>0,i=Tt(t)>wt;function s(u,d,h,f){gx(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=r?b?0:c(m,v):b?c(m+(m<0?gt:-gt),v):0;if(!d&&(p=f=b)&&u.lineStart(),b!==f&&(E=l(d,S),(!E||Js(d,E)||Js(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(i&&d&&r^b){var _;!(x&h)&&(_=l(S,d,!0))&&(g=0,r?(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||!Js(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=Or(u),p=Or(d),g=[1,0,0],m=Ks(f,p),v=js(m,m),S=m[0],E=v-S*S;if(!E)return!h&&u;var b=t*v/E,x=-t*S/E,_=Ks(g,m),C=Qs(g,b),D=Qs(m,x);al(C,D);var B=_,P=js(C,B),w=js(B,B),H=P*P-w*(js(C,C)-1);if(!(H<0)){var N=He(H),M=Qs(B,(-P-N)/w);if(al(M,C),M=sl(M),!h)return M;var O=u[0],$=d[0],F=u[1],L=d[1],U;$<O&&(U=O,O=$,$=U);var tt=$-O,X=Tt(tt-gt)<wt,Y=X||tt<wt;if(!X&&L<F&&(U=F,F=L,L=U),Y?X?F+L>0^M[1]<(Tt(M[0]-O)<wt?F:L):F<=M[1]&&M[1]<=L:tt>gt^(O<=M[0]&&M[0]<=$)){var Q=Qs(B,(-P+N)/w);return al(Q,C),[M,sl(Q)]}}}function c(u,d){var h=r?e:gt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return sd(a,o,s,r?[0,-e]:[-gt,e-gt])}function _x(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,f=c-o,p;if(p=n-a,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>u&&(u=p)}if(p=i-a,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<d&&(d=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<d&&(d=p)}else if(f>0){if(p>d)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>d)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<d&&(d=p)}return u>0&&(e[0]=a+u*h,e[1]=o+u*f),d<1&&(t[0]=a+d*h,t[1]=o+d*f),!0}}}}}var ea=1e9,na=-1e9;function Tx(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var f=0,p=0;if(c==null||(f=a(c,d))!==(p=a(u,d))||l(c,u)<0^d>0)do h.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+d+4)%4)!==p);else h.point(u[0],u[1])}function a(c,u){return Tt(c[0]-e)<wt?u>0?0:3:Tt(c[0]-n)<wt?u>0?2:1:Tt(c[1]-t)<wt?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=nd(),h,f,p,g,m,v,S,E,b,x,_,C={point:D,lineStart:H,lineEnd:N,polygonStart:P,polygonEnd:w};function D(O,$){i(O,$)&&u.point(O,$)}function B(){for(var O=0,$=0,F=f.length;$<F;++$)for(var L=f[$],U=1,tt=L.length,X=L[0],Y,Q,ut=X[0],et=X[1];U<tt;++U)Y=ut,Q=et,X=L[U],ut=X[0],et=X[1],Q<=r?et>r&&(ut-Y)*(r-Q)>(et-Q)*(e-Y)&&++O:et<=r&&(ut-Y)*(r-Q)<(et-Q)*(e-Y)&&--O;return O}function P(){u=d,h=[],f=[],_=!0}function w(){var O=B(),$=_&&O,F=(h=Uu(h)).length;($||F)&&(c.polygonStart(),$&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),F&&rd(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,$){var F=i(O,$);if(f&&p.push([O,$]),x)g=O,m=$,v=F,x=!1,F&&(u.lineStart(),u.point(O,$));else if(F&&b)u.point(O,$);else{var L=[S=Math.max(na,Math.min(ea,S)),E=Math.max(na,Math.min(ea,E))],U=[O=Math.max(na,Math.min(ea,O)),$=Math.max(na,Math.min(ea,$))];_x(L,U,e,t,n,r)?(b||(u.lineStart(),u.point(L[0],L[1])),u.point(U[0],U[1]),F||u.lineEnd(),_=!1):F&&(u.lineStart(),u.point(O,$),_=!1)}S=O,E=$,b=F}return C}}const hl=e=>e;var dl=new Gn,fl=new Gn,od,ld,pl,gl,vn={point:we,lineStart:we,lineEnd:we,polygonStart:function(){vn.lineStart=Ox,vn.lineEnd=Mx},polygonEnd:function(){vn.lineStart=vn.lineEnd=vn.point=we,dl.add(Tt(fl)),fl=new Gn},result:function(){var e=dl/2;return dl=new Gn,e}};function Ox(){vn.point=wx}function wx(e,t){vn.point=cd,od=pl=e,ld=gl=t}function cd(e,t){fl.add(gl*e-pl*t),pl=e,gl=t}function Mx(){cd(od,ld)}var wr=1/0,ra=wr,xi=-wr,ia=xi,sa={point:Cx,lineStart:we,lineEnd:we,polygonStart:we,polygonEnd:we,result:function(){var e=[[wr,ra],[xi,ia]];return xi=ia=-(ra=wr=1/0),e}};function Cx(e,t){e<wr&&(wr=e),e>xi&&(xi=e),t<ra&&(ra=t),t>ia&&(ia=t)}var ml=0,vl=0,bi=0,aa=0,oa=0,Mr=0,yl=0,El=0,Si=0,ud,hd,Je,tn,Me={point:jn,lineStart:dd,lineEnd:fd,polygonStart:function(){Me.lineStart=Lx,Me.lineEnd=Rx},polygonEnd:function(){Me.point=jn,Me.lineStart=dd,Me.lineEnd=fd},result:function(){var e=Si?[yl/Si,El/Si]:Mr?[aa/Mr,oa/Mr]:bi?[ml/bi,vl/bi]:[NaN,NaN];return ml=vl=bi=aa=oa=Mr=yl=El=Si=0,e}};function jn(e,t){ml+=e,vl+=t,++bi}function dd(){Me.point=Ax}function Ax(e,t){Me.point=Dx,jn(Je=e,tn=t)}function Dx(e,t){var n=e-Je,r=t-tn,i=He(n*n+r*r);aa+=i*(Je+e)/2,oa+=i*(tn+t)/2,Mr+=i,jn(Je=e,tn=t)}function fd(){Me.point=jn}function Lx(){Me.point=Ix}function Rx(){pd(ud,hd)}function Ix(e,t){Me.point=pd,jn(ud=Je=e,hd=tn=t)}function pd(e,t){var n=e-Je,r=t-tn,i=He(n*n+r*r);aa+=i*(Je+e)/2,oa+=i*(tn+t)/2,Mr+=i,i=tn*e-Je*t,yl+=i*(Je+e),El+=i*(tn+t),Si+=i*3,jn(Je=e,tn=t)}function gd(e){this._context=e}gd.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,xe);break}}},result:we};var xl=new Gn,bl,md,vd,_i,Ti,Oi={point:we,lineStart:function(){Oi.point=kx},lineEnd:function(){bl&&yd(md,vd),Oi.point=we},polygonStart:function(){bl=!0},polygonEnd:function(){bl=null},result:function(){var e=+xl;return xl=new Gn,e}};function kx(e,t){Oi.point=yd,md=_i=e,vd=Ti=t}function yd(e,t){_i-=e,Ti-=t,xl.add(He(_i*_i+Ti*Ti)),_i=e,Ti=t}let Ed,la,xd,bd;class Sd{constructor(t){this._append=t==null?_d:Px(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!==xd||this._append!==la){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,xd=r,la=this._append,bd=this._,this._=i}this._+=bd;break}}}result(){const t=this._;return this._="",t.length?t:null}}function _d(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Px(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return _d;if(t!==Ed){const n=10**t;Ed=t,la=function(i){let s=1;this._+=i[0];for(const a=i.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+i[s]}}return la}function Nx(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),Tr(o,i(s))),s.result()}return a.area=function(o){return Tr(o,i(vn)),vn.result()},a.measure=function(o){return Tr(o,i(Oi)),Oi.result()},a.bounds=function(o){return Tr(o,i(sa)),sa.result()},a.centroid=function(o){return Tr(o,i(Me)),Me.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,hl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Sd(n)):new gd(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new Sd(n)),a},a.projection(e).digits(n).context(t)}function Sl(e){return function(t){var n=new _l;for(var r in e)n[r]=e[r];return n.stream=t,n}}function _l(){}_l.prototype={constructor:_l,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 Tl(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Tr(n,e.stream(sa)),t(sa.result()),r!=null&&e.clipExtent(r),e}function Td(e,t,n){return Tl(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function $x(e,t,n){return Td(e,[[0,0],t],n)}function Fx(e,t,n){return Tl(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function Ux(e,t,n){return Tl(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Od=16,Bx=Mt(30*Nt);function wd(e,t){return+t?Gx(e,t):Hx(e)}function Hx(e){return Sl({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Gx(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,g,m){var v=c-r,S=u-i,E=v*v+S*S;if(E>4*t&&g--){var b=a+h,x=o+f,_=l+p,C=He(b*b+x*x+_*_),D=mn(_/=C),B=Tt(Tt(_)-1)<wt||Tt(s-d)<wt?(s+d)/2:Zn(x,b),P=e(B,D),w=P[0],H=P[1],N=w-r,M=H-i,O=S*N-v*M;(O*O/E>t||Tt((v*N+S*M)/E-.5)>.3||a*h+o*f+l*p<Bx)&&(n(r,i,s,a,o,l,w,H,B,b/=C,x/=C,_,g,m),m.point(w,H),n(w,H,B,b,x,_,c,u,d,h,f,p,g,m))}}return function(r){var i,s,a,o,l,c,u,d,h,f,p,g,m={point:v,lineStart:S,lineEnd:b,polygonStart:function(){r.polygonStart(),m.lineStart=x},polygonEnd:function(){r.polygonEnd(),m.lineStart=S}};function v(D,B){D=e(D,B),r.point(D[0],D[1])}function S(){d=NaN,m.point=E,r.lineStart()}function E(D,B){var P=Or([D,B]),w=e(D,B);n(d,h,u,f,p,g,d=w[0],h=w[1],u=D,f=P[0],p=P[1],g=P[2],Od,r),r.point(d,h)}function b(){m.point=v,r.lineEnd()}function x(){S(),m.point=_,m.lineEnd=C}function _(D,B){E(i=D,B),s=d,a=h,o=f,l=p,c=g,m.point=E}function C(){n(d,h,u,f,p,g,s,a,i,o,l,c,Od,r),m.lineEnd=b,b()}return m}}var Vx=Sl({point:function(e,t){this.stream.point(e*Nt,t*Nt)}});function zx(e){return Sl({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Wx(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function Md(e,t,n,r,i,s){if(!s)return Wx(e,t,n,r,i);var a=Mt(s),o=bt(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*=r,m*=i,[l*g-c*m+t,n-c*g-l*m]}return p.invert=function(g,m){return[r*(u*g-d*m+h),i*(f-d*g-u*m)]},p}function ca(e){return Cd(function(){return e})()}function Cd(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,f=1,p=null,g=ad,m=null,v,S,E,b=hl,x=.5,_,C,D,B,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 B&&P===O?B:B=Vx(zx(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?Sx(p=O*Nt):(p=null,ad),M()):p*re},w.clipExtent=function(O){return arguments.length?(b=O==null?(m=v=S=E=null,hl):Tx(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?(r=+O[0],i=+O[1],N()):[r,i]},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?(_=wd(C,x=O*O),M()):He(x)},w.fitExtent=function(O,$){return Td(w,O,$)},w.fitSize=function(O,$){return $x(w,O,$)},w.fitWidth=function(O,$){return Fx(w,O,$)},w.fitHeight=function(O,$){return Ux(w,O,$)};function N(){var O=Md(n,0,0,h,f,d).apply(null,t(s,a)),$=Md(n,r-O[0],i-O[1],h,f,d);return u=Kh(o,l,c),C=ll(t,$),D=ll(u,C),_=wd(C,x),M()}function M(){return B=P=null,w}return function(){return t=e.apply(this,arguments),w.invert=t.invert&&H,N()}}function Ad(e){var t=0,n=gt/3,r=Cd(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Nt,n=s[1]*Nt):[t*re,n*re]},i}function Yx(e){var t=Mt(e);function n(r,i){return[r*t,bt(i)/t]}return n.invert=function(r,i){return[r/t,mn(i*t)]},n}function qx(e,t){var n=bt(e),r=(n+bt(t))/2;if(Tt(r)<wt)return Yx(e);var i=1+n*(2*r-n),s=He(i)/r;function a(o,l){var c=He(i-2*r*bt(l))/r;return[c*bt(o*=r),s-c*Mt(o)]}return a.invert=function(o,l){var c=s-l,u=Zn(o,Tt(c))*Pn(c);return c*r<0&&(u-=gt*Pn(o)*Pn(c)),[u/r,mn((i-(o*o+c*c)*r*r)/(2*r))]},a}function Dd(){return Ad(qx).scale(155.424).center([0,33.6442])}function Xx(){return Dd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Ol(e,t){return[e,hx(dx((de+t)/2))]}Ol.invert=function(e,t){return[e,2*qh(ux(t))-de]};function Zx(){return jx(Ol).scale(961/xe)}function jx(e){var t=ca(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=gt*r(),h=t(px(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Ol?[[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 ua(e,t){return[e,t]}ua.invert=ua;function Kx(){return ca(ua).scale(152.63)}function Qx(e,t){var n=Mt(e),r=e===t?bt(e):(n-Mt(t))/(t-e),i=n/r+e;if(Tt(r)<wt)return ua;function s(a,o){var l=i-o,c=r*a;return[l*bt(c),i-l*Mt(c)]}return s.invert=function(a,o){var l=i-o,c=Zn(a,Tt(l))*Pn(l);return l*r<0&&(c-=gt*Pn(a)*Pn(l)),[c/r,i-Pn(r)*He(a*a+l*l)]},s}function Jx(){return Ad(Qx).scale(131.154).center([0,13.9389])}var wi=1.340264,Mi=-.081106,Ci=893e-6,Ai=.003796,ha=He(3)/2,tb=12;function Ld(e,t){var n=mn(ha*bt(t)),r=n*n,i=r*r*r;return[e*Mt(n)/(ha*(wi+3*Mi*r+i*(7*Ci+9*Ai*r))),n*(wi+Mi*r+i*(Ci+Ai*r))]}Ld.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<tb&&(o=n*(wi+Mi*r+i*(Ci+Ai*r))-t,l=wi+3*Mi*r+i*(7*Ci+9*Ai*r),n-=a=o/l,r=n*n,i=r*r*r,!(Tt(a)<cx));++s);return[ha*e*(wi+3*Mi*r+i*(7*Ci+9*Ai*r))/Mt(n),mn(bt(n)/ha)]};function eb(){return ca(Ld).scale(177.158)}function Rd(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Rd.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Tt(i)>wt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function nb(){return ca(Rd).scale(175.295)}function rb(e,t){return e.parent===t.parent?1:2}function ib(e){return e.reduce(sb,0)/e.length}function sb(e,t){return e+t.x}function ab(e){return 1+e.reduce(ob,0)}function ob(e,t){return Math.max(e,t.y)}function lb(e){for(var t;t=e.children;)e=t[0];return e}function cb(e){for(var t;t=e.children;)e=t[t.length-1];return e}function ub(){var e=rb,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=ib(f),h.y=ab(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=lb(s),c=cb(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function hb(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function db(){return this.eachAfter(hb)}function fb(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function pb(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function gb(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function mb(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function vb(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function yb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Eb(e){for(var t=this,n=xb(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function xb(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function bb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Sb(){return Array.from(this)}function _b(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Tb(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ob(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function Di(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Cb)):t===void 0&&(t=Mb);for(var n=new Li(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new Li(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Db)}function wb(){return Di(this).eachBefore(Ab)}function Mb(e){return e.children}function Cb(e){return Array.isArray(e)?e[1]:null}function Ab(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Db(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Li(e){this.data=e,this.depth=this.height=0,this.parent=null}Li.prototype=Di.prototype={constructor:Li,count:db,each:fb,eachAfter:gb,eachBefore:pb,find:mb,sum:vb,sort:yb,path:Eb,ancestors:bb,descendants:Sb,leaves:_b,links:Tb,copy:wb,[Symbol.iterator]:Ob};function Lb(e){return e==null?null:Id(e)}function Id(e){if(typeof e!="function")throw new Error;return e}function Kn(){return 0}function Cr(e){return function(){return e}}const Rb=1664525,Ib=1013904223,kd=4294967296;function kb(){let e=1;return()=>(e=(Rb*e+Ib)%kd)/kd}function Pb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Nb(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function $b(e,t){for(var n=0,r=(e=Nb(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Pd(a,s)?++n:(a=Ub(i=Fb(i,s)),n=0);return a}function Fb(e,t){var n,r;if(wl(t,e))return[t];for(n=0;n<e.length;++n)if(da(t,e[n])&&wl(Ri(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(da(Ri(e[n],e[r]),t)&&da(Ri(e[n],t),e[r])&&da(Ri(e[r],t),e[n])&&wl(Nd(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function da(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function Pd(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function wl(e,t){for(var n=0;n<t.length;++n)if(!Pd(e,t[n]))return!1;return!0}function Ub(e){switch(e.length){case 1:return Bb(e[0]);case 2:return Ri(e[0],e[1]);case 3:return Nd(e[0],e[1],e[2])}}function Bb(e){return{x:e.x,y:e.y,r:e.r}}function Ri(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function Nd(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,d=n.r,h=r-a,f=r-c,p=i-o,g=i-u,m=l-s,v=d-s,S=r*r+i*i-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)-r,C=(g*m-p*v)/x,D=(f*E-h*b)/(x*2)-i,B=(h*v-f*m)/x,P=C*C+B*B-1,w=2*(s+_*C+D*B),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:r+_+C*N,y:i+D+B*N,r:N}}function $d(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function Fd(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Ud(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function fa(e){this._=e,this.next=null,this.previous=null}function Hb(e,t){if(!(s=(e=Pb(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;$d(r,n,i=e[2]),n=new fa(n),r=new fa(r),i=new fa(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){$d(n._,r._,i=e[l]),i=new fa(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(Fd(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(Fd(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Ud(n);(i=i.next)!==r;)(o=Ud(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=$b(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function Gb(e){return Math.sqrt(e.value)}function Vb(){var e=null,t=1,n=1,r=Kn;function i(s){const a=kb();return s.x=t/2,s.y=n/2,e?s.eachBefore(Bd(e)).eachAfter(Ml(r,.5,a)).eachBefore(Hd(1)):s.eachBefore(Bd(Gb)).eachAfter(Ml(Kn,1,a)).eachAfter(Ml(r,s.r/Math.min(t,n),a)).eachBefore(Hd(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=Lb(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:Cr(+s),i):r},i}function Bd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Ml(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=Hb(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function Hd(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 zb(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 Wb(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function Yb(e,t){return e.parent===t.parent?1:2}function Cl(e){var t=e.children;return t?t[0]:e.t}function Al(e){var t=e.children;return t?t[t.length-1]:e.t}function qb(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Xb(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Zb(e,t,n){return e.a.parent===t.parent?e.a:n}function pa(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}pa.prototype=Object.create(Li.prototype);function jb(e){for(var t=new pa(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new pa(s[a],a)),i.parent=n;return(t.parent=new pa(null,0)).children=[t],t}function Kb(){var e=Yb,t=1,n=1,r=null;function i(c){var u=jb(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,f=c;c.eachBefore(function(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){Xb(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=Al(p),h=Cl(h),p&&h;)g=Cl(g),f=Al(f),f.a=c,b=p.z+S-h.z-m+e(p._,h._),b>0&&(qb(Zb(p,c,d),c,b),m+=b,v+=b),S+=p.m,m+=h.m,E+=g.m,v+=f.m;p&&!Al(f)&&(f.t=p,f.m+=S-v),h&&!Cl(g)&&(g.t=h,g.m+=m-E,d=c)}return d}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function Qb(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var Jb=(1+Math.sqrt(5))/2;function tS(e,t,n,r,i,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=i-n,p=s-r;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?Wb(l,n,r,i,g?r+=p*m/g:s):Qb(l,n,r,g?n+=f*m/g:i,s),g-=m,u=d}return a}const eS=function e(t){function n(r,i,s,a,o){tS(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(Jb);function nS(){var e=eS,t=!1,n=1,r=1,i=[0],s=Kn,a=Kn,o=Kn,l=Kn,c=Kn;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(zb),h}function d(h){var f=i[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=i[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],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=Id(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:Cr(+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:Cr(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:Cr(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:Cr(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:Cr(+h),u):c},u}function Ar(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Gd=Symbol("implicit");function ga(){var e=new Pu,t=[],n=[],r=Gd;function i(s){let a=e.get(s);if(a===void 0){if(r!==Gd)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Pu;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return ga(t,n).unknown(r)},Ar.apply(i,arguments),i}function Ii(){var e=ga().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var h=t().length,f=i<r,p=f?i:r,g=f?r:i;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=u0(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?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return Ii(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Ar.apply(d(),arguments)}function rS(e){return function(){return e}}function iS(e){return+e}var Vd=[0,1];function Dr(e){return e}function Dl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:rS(isNaN(t)?NaN:.5)}function sS(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function aS(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Dl(i,r),s=n(a,s)):(r=Dl(r,i),s=n(s,a)),function(o){return s(r(o))}}function oS(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Dl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=So(e,o,1,r)-1;return s[l](i[l](o))}}function Ll(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function zd(){var e=Vd,t=Vd,n=pi,r,i,s,a=Dr,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Dr&&(a=sS(e[0],e[h-1])),o=h>2?oS:aS,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),Ee)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,iS),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=gh,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Dr,u()):a!==Dr},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return r=h,i=f,u()}}function Wd(){return zd()(Dr,Dr)}function lS(e,t,n,r){var i=To(e,t,n),s;switch(r=Ei(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=ox(i,a))&&(r.precision=s),Wh(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=lx(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=ax(i))&&(r.precision=s-(r.type==="%")*2);break}}return rl(r)}function Yd(e){var t=e.domain;return e.ticks=function(n){var r=t();return ws(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return lS(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=vr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Ge(){var e=Wd();return e.copy=function(){return Ll(e,Ge())},Ar.apply(e,arguments),Yd(e)}function qd(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function Xd(e){return Math.log(e)}function Zd(e){return Math.exp(e)}function cS(e){return-Math.log(-e)}function uS(e){return-Math.exp(-e)}function hS(e){return isFinite(e)?+("1e"+e):e<0?0:e}function dS(e){return e===10?hS:e===Math.E?Math.exp:t=>Math.pow(e,t)}function fS(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 jd(e){return(t,n)=>-e(-t,n)}function pS(e){const t=e(Xd,Zd),n=t.domain;let r=10,i,s;function a(){return i=fS(r),s=dS(r),n()[0]<0?(i=jd(i),s=jd(s),e(cS,uS)):e(Xd,Zd),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let h=i(c),f=i(u),p,g;const m=o==null?10:+o;let v=[];if(!(r%1)&&f-h<m){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(p=1;p<r;++p)if(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=r-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=ws(c,u,m))}else v=ws(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=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Ei(l)).precision==null&&(l.trim=!0),l=rl(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(qd(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Kd(){const e=pS(zd()).domain([1,10]);return e.copy=()=>Ll(e,Kd()).base(e.base()),Ar.apply(e,arguments),e}function Rl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[So(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Rl().domain([e,t]).range(i).unknown(s)},Ar.apply(Yd(a),arguments)}const Il=new Date,kl=new Date;function Wt(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>Wt(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(Il.setTime(+s),kl.setTime(+a),e(Il),e(kl),Math.floor(n(Il,kl))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const ma=Wt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ma.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ma),ma.range;const yn=1e3,Ce=yn*60,En=Ce*60,xn=En*24,Pl=xn*7,Qd=xn*30,Nl=xn*365,Lr=Wt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getUTCSeconds());Lr.range;const $l=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yn)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getMinutes());$l.range,Wt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getUTCMinutes()).range;const Fl=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yn-e.getMinutes()*Ce)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getHours());Fl.range,Wt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getUTCHours()).range;const ki=Wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ce)/xn,e=>e.getDate()-1);ki.range;const Ul=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xn,e=>e.getUTCDate()-1);Ul.range,Wt(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 Qn(e){return Wt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ce)/Pl)}const va=Qn(0),ya=Qn(1),gS=Qn(2),mS=Qn(3),Rr=Qn(4),vS=Qn(5),yS=Qn(6);va.range,ya.range,gS.range,mS.range,Rr.range,vS.range,yS.range;function Jn(e){return Wt(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)/Pl)}const Jd=Jn(0),Ea=Jn(1),ES=Jn(2),xS=Jn(3),Ir=Jn(4),bS=Jn(5),SS=Jn(6);Jd.range,Ea.range,ES.range,xS.range,Ir.range,bS.range,SS.range;const Bl=Wt(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());Bl.range,Wt(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=Wt(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:Wt(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 tr=Wt(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());tr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)}),tr.range;function _S(e,t,n,r,i,s){const a=[[Lr,1,yn],[Lr,5,5*yn],[Lr,15,15*yn],[Lr,30,30*yn],[s,1,Ce],[s,5,5*Ce],[s,15,15*Ce],[s,30,30*Ce],[i,1,En],[i,3,3*En],[i,6,6*En],[i,12,12*En],[r,1,xn],[r,2,2*xn],[n,1,Pl],[t,1,Qd],[t,3,3*Qd],[e,1,Nl]];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=bo(([,,m])=>m).right(a,h);if(f===a.length)return e.every(To(c/Nl,u/Nl,d));if(f===0)return ma.every(Math.max(To(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[TS,OS]=_S(bn,Bl,va,ki,Fl,$l);function Hl(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 Gl(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 Pi(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function wS(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=Ni(i),u=$i(i),d=Ni(s),h=$i(s),f=Ni(a),p=$i(a),g=Ni(o),m=$i(o),v=Ni(l),S=$i(l),E={a:F,A:L,b:U,B:tt,c:null,d:af,e:af,f:ZS,g:s_,G:o_,H:YS,I:qS,j:XS,L:of,m:jS,M:KS,p:X,q:Y,Q:ff,s:pf,S:QS,u:JS,U:t_,V:e_,w:n_,W:r_,x:null,X:null,y:i_,Y:a_,Z:l_,"%":df},b={a:Q,A:ut,b:et,B:K,c:null,d:cf,e:cf,f:d_,g:S_,G:T_,H:c_,I:u_,j:h_,L:uf,m:f_,M:p_,p:nt,q:ht,Q:ff,s:pf,S:g_,u:m_,U:v_,V:y_,w:E_,W:x_,x:null,X:null,y:b_,Y:__,Z:O_,"%":df},x={a:P,A:w,b:H,B:N,c:M,d:rf,e:rf,f:GS,g:nf,G:ef,H:sf,I:sf,j:FS,L:HS,m:$S,M:US,p:B,q:NS,Q:zS,s:WS,S:BS,u:LS,U:RS,V:IS,w:DS,W:kS,x:O,X:$,y:nf,Y:ef,Z:PS,"%":VS};E.x=_(n,E),E.X=_(r,E),E.c=_(t,E),b.x=_(n,b),b.X=_(r,b),b.c=_(t,b);function _(W,j){return function(J){var A=[],G=-1,V=0,xt=W.length,Ut,st,_t;for(J instanceof Date||(J=new Date(+J));++G<xt;)W.charCodeAt(G)===37&&(A.push(W.slice(V,G)),(st=tf[Ut=W.charAt(++G)])!=null?Ut=W.charAt(++G):st=Ut==="e"?" ":"0",(_t=j[Ut])&&(Ut=_t(J,st)),A.push(Ut),V=G+1);return A.push(W.slice(V,G)),A.join("")}}function C(W,j){return function(J){var A=Pi(1900,void 0,1),G=D(A,W,J+="",0),V,xt;if(G!=J.length)return null;if("Q"in A)return new Date(A.Q);if("s"in A)return new Date(A.s*1e3+("L"in A?A.L:0));if(j&&!("Z"in A)&&(A.Z=0),"p"in A&&(A.H=A.H%12+A.p*12),A.m===void 0&&(A.m="q"in A?A.q:0),"V"in A){if(A.V<1||A.V>53)return null;"w"in A||(A.w=1),"Z"in A?(V=Gl(Pi(A.y,0,1)),xt=V.getUTCDay(),V=xt>4||xt===0?Ea.ceil(V):Ea(V),V=Ul.offset(V,(A.V-1)*7),A.y=V.getUTCFullYear(),A.m=V.getUTCMonth(),A.d=V.getUTCDate()+(A.w+6)%7):(V=Hl(Pi(A.y,0,1)),xt=V.getDay(),V=xt>4||xt===0?ya.ceil(V):ya(V),V=ki.offset(V,(A.V-1)*7),A.y=V.getFullYear(),A.m=V.getMonth(),A.d=V.getDate()+(A.w+6)%7)}else("W"in A||"U"in A)&&("w"in A||(A.w="u"in A?A.u%7:"W"in A?1:0),xt="Z"in A?Gl(Pi(A.y,0,1)).getUTCDay():Hl(Pi(A.y,0,1)).getDay(),A.m=0,A.d="W"in A?(A.w+6)%7+A.W*7-(xt+5)%7:A.w+A.U*7-(xt+6)%7);return"Z"in A?(A.H+=A.Z/100|0,A.M+=A.Z%100,Gl(A)):Hl(A)}}function D(W,j,J,A){for(var G=0,V=j.length,xt=J.length,Ut,st;G<V;){if(A>=xt)return-1;if(Ut=j.charCodeAt(G++),Ut===37){if(Ut=j.charAt(G++),st=x[Ut in tf?j.charAt(G++):Ut],!st||(A=st(W,J,A))<0)return-1}else if(Ut!=J.charCodeAt(A++))return-1}return A}function B(W,j,J){var A=c.exec(j.slice(J));return A?(W.p=u.get(A[0].toLowerCase()),J+A[0].length):-1}function P(W,j,J){var A=f.exec(j.slice(J));return A?(W.w=p.get(A[0].toLowerCase()),J+A[0].length):-1}function w(W,j,J){var A=d.exec(j.slice(J));return A?(W.w=h.get(A[0].toLowerCase()),J+A[0].length):-1}function H(W,j,J){var A=v.exec(j.slice(J));return A?(W.m=S.get(A[0].toLowerCase()),J+A[0].length):-1}function N(W,j,J){var A=g.exec(j.slice(J));return A?(W.m=m.get(A[0].toLowerCase()),J+A[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 $(W,j,J){return D(W,r,j,J)}function F(W){return a[W.getDay()]}function L(W){return s[W.getDay()]}function U(W){return l[W.getMonth()]}function tt(W){return o[W.getMonth()]}function X(W){return i[+(W.getHours()>=12)]}function Y(W){return 1+~~(W.getMonth()/3)}function Q(W){return a[W.getUTCDay()]}function ut(W){return s[W.getUTCDay()]}function et(W){return l[W.getUTCMonth()]}function K(W){return o[W.getUTCMonth()]}function nt(W){return i[+(W.getUTCHours()>=12)]}function ht(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 tf={"-":"",_:" ",0:"0"},Yt=/^\s*\d+/,MS=/^%/,CS=/[\\^$*+?|[\]().{}]/g;function Et(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function AS(e){return e.replace(CS,"\\$&")}function Ni(e){return new RegExp("^(?:"+e.map(AS).join("|")+")","i")}function $i(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function DS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function LS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function RS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function IS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ef(e,t,n){var r=Yt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function nf(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function PS(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function NS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function $S(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function rf(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function FS(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function sf(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function US(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function BS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function HS(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function GS(e,t,n){var r=Yt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function VS(e,t,n){var r=MS.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function zS(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function WS(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function af(e,t){return Et(e.getDate(),t,2)}function YS(e,t){return Et(e.getHours(),t,2)}function qS(e,t){return Et(e.getHours()%12||12,t,2)}function XS(e,t){return Et(1+ki.count(bn(e),e),t,3)}function of(e,t){return Et(e.getMilliseconds(),t,3)}function ZS(e,t){return of(e,t)+"000"}function jS(e,t){return Et(e.getMonth()+1,t,2)}function KS(e,t){return Et(e.getMinutes(),t,2)}function QS(e,t){return Et(e.getSeconds(),t,2)}function JS(e){var t=e.getDay();return t===0?7:t}function t_(e,t){return Et(va.count(bn(e)-1,e),t,2)}function lf(e){var t=e.getDay();return t>=4||t===0?Rr(e):Rr.ceil(e)}function e_(e,t){return e=lf(e),Et(Rr.count(bn(e),e)+(bn(e).getDay()===4),t,2)}function n_(e){return e.getDay()}function r_(e,t){return Et(ya.count(bn(e)-1,e),t,2)}function i_(e,t){return Et(e.getFullYear()%100,t,2)}function s_(e,t){return e=lf(e),Et(e.getFullYear()%100,t,2)}function a_(e,t){return Et(e.getFullYear()%1e4,t,4)}function o_(e,t){var n=e.getDay();return e=n>=4||n===0?Rr(e):Rr.ceil(e),Et(e.getFullYear()%1e4,t,4)}function l_(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Et(t/60|0,"0",2)+Et(t%60,"0",2)}function cf(e,t){return Et(e.getUTCDate(),t,2)}function c_(e,t){return Et(e.getUTCHours(),t,2)}function u_(e,t){return Et(e.getUTCHours()%12||12,t,2)}function h_(e,t){return Et(1+Ul.count(tr(e),e),t,3)}function uf(e,t){return Et(e.getUTCMilliseconds(),t,3)}function d_(e,t){return uf(e,t)+"000"}function f_(e,t){return Et(e.getUTCMonth()+1,t,2)}function p_(e,t){return Et(e.getUTCMinutes(),t,2)}function g_(e,t){return Et(e.getUTCSeconds(),t,2)}function m_(e){var t=e.getUTCDay();return t===0?7:t}function v_(e,t){return Et(Jd.count(tr(e)-1,e),t,2)}function hf(e){var t=e.getUTCDay();return t>=4||t===0?Ir(e):Ir.ceil(e)}function y_(e,t){return e=hf(e),Et(Ir.count(tr(e),e)+(tr(e).getUTCDay()===4),t,2)}function E_(e){return e.getUTCDay()}function x_(e,t){return Et(Ea.count(tr(e)-1,e),t,2)}function b_(e,t){return Et(e.getUTCFullYear()%100,t,2)}function S_(e,t){return e=hf(e),Et(e.getUTCFullYear()%100,t,2)}function __(e,t){return Et(e.getUTCFullYear()%1e4,t,4)}function T_(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ir(e):Ir.ceil(e),Et(e.getUTCFullYear()%1e4,t,4)}function O_(){return"+0000"}function df(){return"%"}function ff(e){return+e}function pf(e){return Math.floor(+e/1e3)}var kr,gf;w_({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 w_(e){return kr=wS(e),gf=kr.format,kr.parse,kr.utcFormat,kr.utcParse,kr}function M_(e){return new Date(e)}function C_(e){return e instanceof Date?+e:+new Date(+e)}function mf(e,t,n,r,i,s,a,o,l,c){var u=Wd(),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:r(_)<_?i(_)<_?v:S:n(_)<_?E:b)(_)}return u.invert=function(_){return new Date(d(_))},u.domain=function(_){return arguments.length?h(Array.from(_,C_)):h().map(M_)},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(qd(C,_)):u},u.copy=function(){return Ll(u,mf(e,t,n,r,i,s,a,o,l,c))},u}function vf(){return Ar.apply(mf(TS,OS,bn,Bl,va,ki,Fl,$l,Lr,gf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function pt(e){return function(){return e}}const yf=Math.abs,Jt=Math.atan2,er=Math.cos,A_=Math.max,Vl=Math.min,en=Math.sin,Pr=Math.sqrt,te=1e-12,Fi=Math.PI,xa=Fi/2,ba=2*Fi;function D_(e){return e>1?0:e<-1?Fi:Math.acos(e)}function Ef(e){return e>=1?xa:e<=-1?-xa:Math.asin(e)}function Sa(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new KE(t)}function L_(e){return e.innerRadius}function R_(e){return e.outerRadius}function I_(e){return e.startAngle}function k_(e){return e.endAngle}function P_(e){return e&&e.padAngle}function N_(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<te))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function _a(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Pr(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,g=r+d,m=(h+p)/2,v=(f+g)/2,S=p-h,E=g-f,b=S*S+E*E,x=i-s,_=h*g-p*f,C=(E<0?-1:1)*Pr(A_(0,x*x*b-_*_)),D=(_*E-S*C)/b,B=(-_*S-E*C)/b,P=(_*E+S*C)/b,w=(-_*S+E*C)/b,H=D-m,N=B-v,M=P-m,O=w-v;return H*H+N*N>M*M+O*O&&(D=P,B=w),{cx:D,cy:B,x01:-u,y01:-d,x11:D*(i/x-1),y11:B*(i/x-1)}}function Ui(){var e=L_,t=R_,n=pt(0),r=null,i=I_,s=k_,a=P_,o=null,l=Sa(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-xa,g=s.apply(this,arguments)-xa,m=yf(g-p),v=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>te))o.moveTo(0,0);else if(m>ba-te)o.moveTo(f*er(p),f*en(p)),o.arc(0,0,f,p,g,!v),h>te&&(o.moveTo(h*er(g),h*en(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,B=D>te&&(r?+r.apply(this,arguments):Pr(h*h+f*f)),P=Vl(yf(f-h)/2,+n.apply(this,arguments)),w=P,H=P,N,M;if(B>te){var O=Ef(B/h*en(D)),$=Ef(B/f*en(D));(_-=O*2)>te?(O*=v?1:-1,b+=O,x-=O):(_=0,b=x=(p+g)/2),(C-=$*2)>te?($*=v?1:-1,S+=$,E-=$):(C=0,S=E=(p+g)/2)}var F=f*er(S),L=f*en(S),U=h*er(x),tt=h*en(x);if(P>te){var X=f*er(E),Y=f*en(E),Q=h*er(b),ut=h*en(b),et;if(m<Fi)if(et=N_(F,L,Q,ut,X,Y,U,tt)){var K=F-et[0],nt=L-et[1],ht=X-et[0],W=Y-et[1],j=1/en(D_((K*ht+nt*W)/(Pr(K*K+nt*nt)*Pr(ht*ht+W*W)))/2),J=Pr(et[0]*et[0]+et[1]*et[1]);w=Vl(P,(h-J)/(j-1)),H=Vl(P,(f-J)/(j+1))}else w=H=0}C>te?H>te?(N=_a(Q,ut,F,L,f,H,v),M=_a(X,Y,U,tt,f,H,v),o.moveTo(N.cx+N.x01,N.cy+N.y01),H<P?o.arc(N.cx,N.cy,H,Jt(N.y01,N.x01),Jt(M.y01,M.x01),!v):(o.arc(N.cx,N.cy,H,Jt(N.y01,N.x01),Jt(N.y11,N.x11),!v),o.arc(0,0,f,Jt(N.cy+N.y11,N.cx+N.x11),Jt(M.cy+M.y11,M.cx+M.x11),!v),o.arc(M.cx,M.cy,H,Jt(M.y11,M.x11),Jt(M.y01,M.x01),!v))):(o.moveTo(F,L),o.arc(0,0,f,S,E,!v)):o.moveTo(F,L),!(h>te)||!(_>te)?o.lineTo(U,tt):w>te?(N=_a(U,tt,X,Y,h,-w,v),M=_a(F,L,Q,ut,h,-w,v),o.lineTo(N.cx+N.x01,N.cy+N.y01),w<P?o.arc(N.cx,N.cy,w,Jt(N.y01,N.x01),Jt(M.y01,M.x01),!v):(o.arc(N.cx,N.cy,w,Jt(N.y01,N.x01),Jt(N.y11,N.x11),!v),o.arc(0,0,h,Jt(N.cy+N.y11,N.cx+N.x11),Jt(M.cy+M.y11,M.cx+M.x11),v),o.arc(M.cx,M.cy,w,Jt(M.y11,M.x11),Jt(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=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Fi/2;return[er(d)*u,en(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?(r=u==null?null:typeof u=="function"?u:pt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:pt(+u),c):i},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 $_=Array.prototype.slice;function Ta(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xf(e){this._context=e}xf.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 Oa(e){return new xf(e)}function zl(e){return e[0]}function Wl(e){return e[1]}function Bi(e,t){var n=pt(!0),r=null,i=Oa,s=null,a=Sa(o);e=typeof e=="function"?e:e===void 0?zl:pt(e),t=typeof t=="function"?t:t===void 0?Wl:pt(t);function o(l){var c,u=(l=Ta(l)).length,d,h=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l: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?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function Yl(e,t,n){var r=null,i=pt(!0),s=null,a=Oa,o=null,l=Sa(c);e=typeof e=="function"?e:e===void 0?zl:pt(+e),t=typeof t=="function"?t:pt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Wl:pt(+n);function c(d){var h,f,p,g=(d=Ta(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&&i(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(r?+r(m,h,d):E[h],n?+n(m,h,d):b[h]))}if(S)return o=null,S+""||null}function u(){return Bi().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),r=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?(r=d==null?null:typeof d=="function"?d:pt(+d),c):r},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(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:pt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function F_(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function U_(e){return e}function B_(){var e=U_,t=F_,n=null,r=pt(0),i=pt(ba),s=pt(0);function a(o){var l,c=(o=Ta(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),g=+r.apply(this,arguments),m=Math.min(ba,Math.max(-ba,i.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?(r=typeof o=="function"?o:pt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:pt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:pt(+o),a):s},a}var H_=Sf(Oa);function bf(e){this._curve=e}bf.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 Sf(e){function t(n){return new bf(e(n))}return t._curve=e,t}function G_(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(Sf(n)):t()._curve},e}function V_(){return G_(Bi().curve(H_))}class z_{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 W_(e){return new z_(e,!0)}function Y_(e){return e.source}function q_(e){return e.target}function X_(e){let t=Y_,n=q_,r=zl,i=Wl,s=null,a=null,o=Sa(l);function l(){let c;const u=$_.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:pt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:pt(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function Z_(){return X_(W_)}function Nn(){}function wa(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ma(e){this._context=e}Ma.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:wa(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:wa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function j_(e){return new Ma(e)}function _f(e){this._context=e}_f.prototype={areaStart:Nn,areaEnd:Nn,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:wa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function K_(e){return new _f(e)}function Tf(e){this._context=e}Tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:wa(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Q_(e){return new Tf(e)}function Of(e,t){this._basis=new Ma(e),this._beta=t}Of.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const J_=function e(t){function n(r){return t===1?new Ma(r):new Of(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Ca(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 ql(e,t){this._context=e,this._k=(1-t)/6}ql.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:Ca(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:Ca(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tT=function e(t){function n(r){return new ql(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Xl(e,t){this._context=e,this._k=(1-t)/6}Xl.prototype={areaStart:Nn,areaEnd:Nn,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:Ca(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eT=function e(t){function n(r){return new Xl(r,t)}return n.tension=function(r){return e(+r)},n}(0);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(){(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:Ca(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nT=function e(t){function n(r){return new Zl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function jl(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>te){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>te){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function wf(e,t){this._context=e,this._alpha=t}wf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:jl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rT=function e(t){function n(r){return t?new wf(r,t):new ql(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Mf(e,t){this._context=e,this._alpha=t}Mf.prototype={areaStart:Nn,areaEnd:Nn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:jl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iT=function e(t){function n(r){return t?new Mf(r,t):new Xl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Cf(e,t){this._context=e,this._alpha=t}Cf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const sT=function e(t){function n(r){return t?new Cf(r,t):new Zl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Af(e){this._context=e}Af.prototype={areaStart:Nn,areaEnd:Nn,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 Df(e){return new Af(e)}function Lf(e){return e<0?-1:1}function Rf(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(Lf(s)+Lf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function If(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Kl(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function Aa(e){this._context=e}Aa.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:Kl(this,this._t0,If(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,Kl(this,If(this,n=Rf(this,e,t)),n);break;default:Kl(this,this._t0,n=Rf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function kf(e){this._context=new Pf(e)}(kf.prototype=Object.create(Aa.prototype)).point=function(e,t){Aa.prototype.point.call(this,t,e)};function Pf(e){this._context=e}Pf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function aT(e){return new Aa(e)}function oT(e){return new kf(e)}function Nf(e){this._context=e}Nf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=$f(e),i=$f(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function $f(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function lT(e){return new Nf(e)}function Da(e,t){this._context=e,this._t=t}Da.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function cT(e){return new Da(e,.5)}function uT(e){return new Da(e,0)}function hT(e){return new Da(e,1)}function Ff(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Uf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function dT(e,t){return e[t]}function fT(e){const t=[];return t.key=e,t}function Ql(){var e=pt([]),t=Uf,n=Ff,r=dT;function i(s){var a=Array.from(e.apply(this,arguments),fT),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=Ta(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:pt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:pt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Uf:typeof s=="function"?s:pt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Ff,i):n},i}function pT(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function Hi(e,t,n){this.k=e,this.x=t,this.y=n}Hi.prototype={constructor:Hi,scale:function(e){return e===1?this:new Hi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Hi(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+")"}},Hi.prototype;var Bf=typeof global=="object"&&global&&global.Object===Object&&global,gT=typeof self=="object"&&self&&self.Object===Object&&self,Ve=Bf||gT||Function("return this")(),Ae=Ve.Symbol,Hf=Object.prototype,mT=Hf.hasOwnProperty,vT=Hf.toString,Gi=Ae?Ae.toStringTag:void 0;function yT(e){var t=mT.call(e,Gi),n=e[Gi];try{e[Gi]=void 0;var r=!0}catch{}var i=vT.call(e);return r&&(t?e[Gi]=n:delete e[Gi]),i}var ET=Object.prototype,xT=ET.toString;function bT(e){return xT.call(e)}var ST="[object Null]",_T="[object Undefined]",Gf=Ae?Ae.toStringTag:void 0;function nr(e){return e==null?e===void 0?_T:ST:Gf&&Gf in Object(e)?yT(e):bT(e)}function nn(e){return e!=null&&typeof e=="object"}var TT="[object Symbol]";function La(e){return typeof e=="symbol"||nn(e)&&nr(e)==TT}function Jl(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Xt=Array.isArray,Vf=Ae?Ae.prototype:void 0,zf=Vf?Vf.toString:void 0;function Wf(e){if(typeof e=="string")return e;if(Xt(e))return Jl(e,Wf)+"";if(La(e))return zf?zf.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var OT=/\s/;function wT(e){for(var t=e.length;t--&&OT.test(e.charAt(t)););return t}var MT=/^\s+/;function CT(e){return e&&e.slice(0,wT(e)+1).replace(MT,"")}function De(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Yf=NaN,AT=/^[-+]0x[0-9a-f]+$/i,DT=/^0b[01]+$/i,LT=/^0o[0-7]+$/i,RT=parseInt;function Nr(e){if(typeof e=="number")return e;if(La(e))return Yf;if(De(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=De(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=CT(e);var n=DT.test(e);return n||LT.test(e)?RT(e.slice(2),n?2:8):AT.test(e)?Yf:+e}function tc(e){return e}var IT="[object AsyncFunction]",kT="[object Function]",PT="[object GeneratorFunction]",NT="[object Proxy]";function ec(e){if(!De(e))return!1;var t=nr(e);return t==kT||t==PT||t==IT||t==NT}var nc=Ve["__core-js_shared__"],qf=function(){var e=/[^.]+$/.exec(nc&&nc.keys&&nc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function $T(e){return!!qf&&qf in e}var FT=Function.prototype,UT=FT.toString;function rr(e){if(e!=null){try{return UT.call(e)}catch{}try{return e+""}catch{}}return""}var BT=/[\\^$.*+?()[\]{}|]/g,HT=/^\[object .+?Constructor\]$/,GT=Function.prototype,VT=Object.prototype,zT=GT.toString,WT=VT.hasOwnProperty,YT=RegExp("^"+zT.call(WT).replace(BT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qT(e){if(!De(e)||$T(e))return!1;var t=ec(e)?YT:HT;return t.test(rr(e))}function XT(e,t){return e==null?void 0:e[t]}function ir(e,t){var n=XT(e,t);return qT(n)?n:void 0}var rc=ir(Ve,"WeakMap"),Xf=Object.create,ZT=function(){function e(){}return function(t){if(!De(t))return{};if(Xf)return Xf(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 KT(){}function Zf(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var QT=800,JT=16,tO=Date.now;function eO(e){var t=0,n=0;return function(){var r=tO(),i=JT-(r-n);if(n=r,i>0){if(++t>=QT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function nO(e){return function(){return e}}var Ra=function(){try{var e=ir(Object,"defineProperty");return e({},"",{}),e}catch{}}(),rO=Ra?function(e,t){return Ra(e,"toString",{configurable:!0,enumerable:!1,value:nO(t),writable:!0})}:tc,jf=eO(rO);function iO(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function sO(e,t,n,r){for(var i=e.length,s=n+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function aO(e){return e!==e}function oO(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function lO(e,t,n){return t===t?oO(e,t,n):sO(e,aO,n)}function cO(e,t){var n=e==null?0:e.length;return!!n&&lO(e,t,0)>-1}var uO=9007199254740991,hO=/^(?:0|[1-9]\d*)$/;function ic(e,t){var n=typeof e;return t=t??uO,!!t&&(n=="number"||n!="symbol"&&hO.test(e))&&e>-1&&e%1==0&&e<t}function Ia(e,t,n){t=="__proto__"&&Ra?Ra(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Vi(e,t){return e===t||e!==e&&t!==t}var dO=Object.prototype,fO=dO.hasOwnProperty;function Kf(e,t,n){var r=e[t];(!(fO.call(e,t)&&Vi(r,n))||n===void 0&&!(t in e))&&Ia(e,t,n)}function $r(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?Ia(n,o,l):Kf(n,o,l)}return n}var Qf=Math.max;function Jf(e,t,n){return t=Qf(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=Qf(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),jT(e,this,o)}}function sc(e,t){return jf(Jf(e,t,tc),e+"")}var pO=9007199254740991;function ac(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pO}function sr(e){return e!=null&&ac(e.length)&&!ec(e)}function gO(e,t,n){if(!De(n))return!1;var r=typeof t;return(r=="number"?sr(n)&&ic(t,n.length):r=="string"&&t in n)?Vi(n[t],e):!1}function mO(e){return sc(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&gO(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var vO=Object.prototype;function ka(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||vO;return e===n}function yO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var EO="[object Arguments]";function tp(e){return nn(e)&&nr(e)==EO}var ep=Object.prototype,xO=ep.hasOwnProperty,bO=ep.propertyIsEnumerable,Fr=tp(function(){return arguments}())?tp:function(e){return nn(e)&&xO.call(e,"callee")&&!bO.call(e,"callee")};function SO(){return!1}var np=typeof q=="object"&&q&&!q.nodeType&&q,rp=np&&typeof module=="object"&&module&&!module.nodeType&&module,_O=rp&&rp.exports===np,ip=_O?Ve.Buffer:void 0,TO=ip?ip.isBuffer:void 0,Ur=TO||SO,OO="[object Arguments]",wO="[object Array]",MO="[object Boolean]",CO="[object Date]",AO="[object Error]",DO="[object Function]",LO="[object Map]",RO="[object Number]",IO="[object Object]",kO="[object RegExp]",PO="[object Set]",NO="[object String]",$O="[object WeakMap]",FO="[object ArrayBuffer]",UO="[object DataView]",BO="[object Float32Array]",HO="[object Float64Array]",GO="[object Int8Array]",VO="[object Int16Array]",zO="[object Int32Array]",WO="[object Uint8Array]",YO="[object Uint8ClampedArray]",qO="[object Uint16Array]",XO="[object Uint32Array]",Rt={};Rt[BO]=Rt[HO]=Rt[GO]=Rt[VO]=Rt[zO]=Rt[WO]=Rt[YO]=Rt[qO]=Rt[XO]=!0,Rt[OO]=Rt[wO]=Rt[FO]=Rt[MO]=Rt[UO]=Rt[CO]=Rt[AO]=Rt[DO]=Rt[LO]=Rt[RO]=Rt[IO]=Rt[kO]=Rt[PO]=Rt[NO]=Rt[$O]=!1;function ZO(e){return nn(e)&&ac(e.length)&&!!Rt[nr(e)]}function oc(e){return function(t){return e(t)}}var sp=typeof q=="object"&&q&&!q.nodeType&&q,zi=sp&&typeof module=="object"&&module&&!module.nodeType&&module,jO=zi&&zi.exports===sp,lc=jO&&Bf.process,Br=function(){try{var e=zi&&zi.require&&zi.require("util").types;return e||lc&&lc.binding&&lc.binding("util")}catch{}}(),ap=Br&&Br.isTypedArray,Pa=ap?oc(ap):ZO,KO=Object.prototype,QO=KO.hasOwnProperty;function op(e,t){var n=Xt(e),r=!n&&Fr(e),i=!n&&!r&&Ur(e),s=!n&&!r&&!i&&Pa(e),a=n||r||i||s,o=a?yO(e.length,String):[],l=o.length;for(var c in e)(t||QO.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ic(c,l)))&&o.push(c);return o}function lp(e,t){return function(n){return e(t(n))}}var JO=lp(Object.keys,Object),tw=Object.prototype,ew=tw.hasOwnProperty;function cp(e){if(!ka(e))return JO(e);var t=[];for(var n in Object(e))ew.call(e,n)&&n!="constructor"&&t.push(n);return t}function Wi(e){return sr(e)?op(e):cp(e)}function nw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var rw=Object.prototype,iw=rw.hasOwnProperty;function sw(e){if(!De(e))return nw(e);var t=ka(e),n=[];for(var r in e)r=="constructor"&&(t||!iw.call(e,r))||n.push(r);return n}function Yi(e){return sr(e)?op(e,!0):sw(e)}var aw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ow=/^\w*$/;function cc(e,t){if(Xt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||La(e)?!0:ow.test(e)||!aw.test(e)||t!=null&&e in Object(t)}var qi=ir(Object,"create");function lw(){this.__data__=qi?qi(null):{},this.size=0}function cw(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var uw="__lodash_hash_undefined__",hw=Object.prototype,dw=hw.hasOwnProperty;function fw(e){var t=this.__data__;if(qi){var n=t[e];return n===uw?void 0:n}return dw.call(t,e)?t[e]:void 0}var pw=Object.prototype,gw=pw.hasOwnProperty;function mw(e){var t=this.__data__;return qi?t[e]!==void 0:gw.call(t,e)}var vw="__lodash_hash_undefined__";function yw(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qi&&t===void 0?vw:t,this}function ar(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ar.prototype.clear=lw,ar.prototype.delete=cw,ar.prototype.get=fw,ar.prototype.has=mw,ar.prototype.set=yw;function Ew(){this.__data__=[],this.size=0}function Na(e,t){for(var n=e.length;n--;)if(Vi(e[n][0],t))return n;return-1}var xw=Array.prototype,bw=xw.splice;function Sw(e){var t=this.__data__,n=Na(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():bw.call(t,n,1),--this.size,!0}function _w(e){var t=this.__data__,n=Na(t,e);return n<0?void 0:t[n][1]}function Tw(e){return Na(this.__data__,e)>-1}function Ow(e,t){var n=this.__data__,r=Na(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Sn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Sn.prototype.clear=Ew,Sn.prototype.delete=Sw,Sn.prototype.get=_w,Sn.prototype.has=Tw,Sn.prototype.set=Ow;var Xi=ir(Ve,"Map");function ww(){this.size=0,this.__data__={hash:new ar,map:new(Xi||Sn),string:new ar}}function Mw(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function $a(e,t){var n=e.__data__;return Mw(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Cw(e){var t=$a(this,e).delete(e);return this.size-=t?1:0,t}function Aw(e){return $a(this,e).get(e)}function Dw(e){return $a(this,e).has(e)}function Lw(e,t){var n=$a(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function _n(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}_n.prototype.clear=ww,_n.prototype.delete=Cw,_n.prototype.get=Aw,_n.prototype.has=Dw,_n.prototype.set=Lw;var Rw="Expected a function";function uc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Rw);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(uc.Cache||_n),n}uc.Cache=_n;var Iw=500;function kw(e){var t=uc(e,function(r){return n.size===Iw&&n.clear(),r}),n=t.cache;return t}var Pw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nw=/\\(\\)?/g,$w=kw(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Pw,function(n,r,i,s){t.push(i?s.replace(Nw,"$1"):r||n)}),t});function Zi(e){return e==null?"":Wf(e)}function Fa(e,t){return Xt(e)?e:cc(e,t)?[e]:$w(Zi(e))}function ji(e){if(typeof e=="string"||La(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function hc(e,t){t=Fa(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ji(t[n++])];return n&&n==r?e:void 0}function yt(e,t,n){var r=e==null?void 0:hc(e,t);return r===void 0?n:r}function dc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var up=Ae?Ae.isConcatSpreadable:void 0;function Fw(e){return Xt(e)||Fr(e)||!!(up&&e&&e[up])}function Ua(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=Fw),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Ua(o,t-1,n,r,i):dc(i,o):r||(i[i.length]=o)}return i}function fc(e){var t=e==null?0:e.length;return t?Ua(e,1):[]}function Uw(e){return jf(Jf(e,void 0,fc),e+"")}var pc=lp(Object.getPrototypeOf,Object),Bw="[object Object]",Hw=Function.prototype,Gw=Object.prototype,hp=Hw.toString,Vw=Gw.hasOwnProperty,zw=hp.call(Object);function dp(e){if(!nn(e)||nr(e)!=Bw)return!1;var t=pc(e);if(t===null)return!0;var n=Vw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&hp.call(n)==zw}function fp(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function Ww(e,t,n){var r=e.length;return n=n===void 0?r:n,fp(e,t,n)}var Yw="\\ud800-\\udfff",qw="\\u0300-\\u036f",Xw="\\ufe20-\\ufe2f",Zw="\\u20d0-\\u20ff",jw=qw+Xw+Zw,Kw="\\ufe0e\\ufe0f",Qw="\\u200d",Jw=RegExp("["+Qw+Yw+jw+Kw+"]");function pp(e){return Jw.test(e)}function tM(e){return e.split("")}var gp="\\ud800-\\udfff",eM="\\u0300-\\u036f",nM="\\ufe20-\\ufe2f",rM="\\u20d0-\\u20ff",iM=eM+nM+rM,sM="\\ufe0e\\ufe0f",aM="["+gp+"]",gc="["+iM+"]",mc="\\ud83c[\\udffb-\\udfff]",oM="(?:"+gc+"|"+mc+")",mp="[^"+gp+"]",vp="(?:\\ud83c[\\udde6-\\uddff]){2}",yp="[\\ud800-\\udbff][\\udc00-\\udfff]",lM="\\u200d",Ep=oM+"?",xp="["+sM+"]?",cM="(?:"+lM+"(?:"+[mp,vp,yp].join("|")+")"+xp+Ep+")*",uM=xp+Ep+cM,hM="(?:"+[mp+gc+"?",gc,vp,yp,aM].join("|")+")",dM=RegExp(mc+"(?="+mc+")|"+hM+uM,"g");function fM(e){return e.match(dM)||[]}function pM(e){return pp(e)?fM(e):tM(e)}function gM(e){return function(t){t=Zi(t);var n=pp(t)?pM(t):void 0,r=n?n[0]:t.charAt(0),i=n?Ww(n,1).join(""):t.slice(1);return r[e]()+i}}var mM=gM("toUpperCase");function vM(e){return mM(Zi(e).toLowerCase())}function yM(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;)n=t(n,e[i],i,e);return n}function EM(e){return function(t){return e==null?void 0:e[t]}}var xM={À:"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"},bM=EM(xM),SM=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_M="\\u0300-\\u036f",TM="\\ufe20-\\ufe2f",OM="\\u20d0-\\u20ff",wM=_M+TM+OM,MM="["+wM+"]",CM=RegExp(MM,"g");function AM(e){return e=Zi(e),e&&e.replace(SM,bM).replace(CM,"")}var DM=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function LM(e){return e.match(DM)||[]}var RM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function IM(e){return RM.test(e)}var bp="\\ud800-\\udfff",kM="\\u0300-\\u036f",PM="\\ufe20-\\ufe2f",NM="\\u20d0-\\u20ff",$M=kM+PM+NM,Sp="\\u2700-\\u27bf",_p="a-z\\xdf-\\xf6\\xf8-\\xff",FM="\\xac\\xb1\\xd7\\xf7",UM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",BM="\\u2000-\\u206f",HM=" \\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",Tp="A-Z\\xc0-\\xd6\\xd8-\\xde",GM="\\ufe0e\\ufe0f",Op=FM+UM+BM+HM,wp="['’]",Mp="["+Op+"]",VM="["+$M+"]",Cp="\\d+",zM="["+Sp+"]",Ap="["+_p+"]",Dp="[^"+bp+Op+Cp+Sp+_p+Tp+"]",WM="\\ud83c[\\udffb-\\udfff]",YM="(?:"+VM+"|"+WM+")",qM="[^"+bp+"]",Lp="(?:\\ud83c[\\udde6-\\uddff]){2}",Rp="[\\ud800-\\udbff][\\udc00-\\udfff]",Hr="["+Tp+"]",XM="\\u200d",Ip="(?:"+Ap+"|"+Dp+")",ZM="(?:"+Hr+"|"+Dp+")",kp="(?:"+wp+"(?:d|ll|m|re|s|t|ve))?",Pp="(?:"+wp+"(?:D|LL|M|RE|S|T|VE))?",Np=YM+"?",$p="["+GM+"]?",jM="(?:"+XM+"(?:"+[qM,Lp,Rp].join("|")+")"+$p+Np+")*",KM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",QM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",JM=$p+Np+jM,tC="(?:"+[zM,Lp,Rp].join("|")+")"+JM,eC=RegExp([Hr+"?"+Ap+"+"+kp+"(?="+[Mp,Hr,"$"].join("|")+")",ZM+"+"+Pp+"(?="+[Mp,Hr+Ip,"$"].join("|")+")",Hr+"?"+Ip+"+"+kp,Hr+"+"+Pp,QM,KM,Cp,tC].join("|"),"g");function nC(e){return e.match(eC)||[]}function rC(e,t,n){return e=Zi(e),t=t,t===void 0?IM(e)?nC(e):LM(e):e.match(t)||[]}var iC="['’]",sC=RegExp(iC,"g");function Fp(e){return function(t){return yM(rC(AM(t).replace(sC,"")),e,"")}}var aC=Fp(function(e,t,n){return t=t.toLowerCase(),e+(n?vM(t):t)});function oC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Up(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Nr(n),n=n===n?n:0),t!==void 0&&(t=Nr(t),t=t===t?t:0),oC(Nr(e),t,n)}function lC(){this.__data__=new Sn,this.size=0}function cC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function uC(e){return this.__data__.get(e)}function hC(e){return this.__data__.has(e)}var dC=200;function fC(e,t){var n=this.__data__;if(n instanceof Sn){var r=n.__data__;if(!Xi||r.length<dC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _n(r)}return n.set(e,t),this.size=n.size,this}function ze(e){var t=this.__data__=new Sn(e);this.size=t.size}ze.prototype.clear=lC,ze.prototype.delete=cC,ze.prototype.get=uC,ze.prototype.has=hC,ze.prototype.set=fC;function pC(e,t){return e&&$r(t,Wi(t),e)}function gC(e,t){return e&&$r(t,Yi(t),e)}var Bp=typeof q=="object"&&q&&!q.nodeType&&q,Hp=Bp&&typeof module=="object"&&module&&!module.nodeType&&module,mC=Hp&&Hp.exports===Bp,Gp=mC?Ve.Buffer:void 0,Vp=Gp?Gp.allocUnsafe:void 0;function zp(e,t){if(t)return e.slice();var n=e.length,r=Vp?Vp(n):new e.constructor(n);return e.copy(r),r}function vC(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Wp(){return[]}var yC=Object.prototype,EC=yC.propertyIsEnumerable,Yp=Object.getOwnPropertySymbols,vc=Yp?function(e){return e==null?[]:(e=Object(e),vC(Yp(e),function(t){return EC.call(e,t)}))}:Wp;function xC(e,t){return $r(e,vc(e),t)}var bC=Object.getOwnPropertySymbols,qp=bC?function(e){for(var t=[];e;)dc(t,vc(e)),e=pc(e);return t}:Wp;function SC(e,t){return $r(e,qp(e),t)}function Xp(e,t,n){var r=t(e);return Xt(e)?r:dc(r,n(e))}function yc(e){return Xp(e,Wi,vc)}function Zp(e){return Xp(e,Yi,qp)}var Ec=ir(Ve,"DataView"),xc=ir(Ve,"Promise"),Gr=ir(Ve,"Set"),jp="[object Map]",_C="[object Object]",Kp="[object Promise]",Qp="[object Set]",Jp="[object WeakMap]",tg="[object DataView]",TC=rr(Ec),OC=rr(Xi),wC=rr(xc),MC=rr(Gr),CC=rr(rc),Le=nr;(Ec&&Le(new Ec(new ArrayBuffer(1)))!=tg||Xi&&Le(new Xi)!=jp||xc&&Le(xc.resolve())!=Kp||Gr&&Le(new Gr)!=Qp||rc&&Le(new rc)!=Jp)&&(Le=function(e){var t=nr(e),n=t==_C?e.constructor:void 0,r=n?rr(n):"";if(r)switch(r){case TC:return tg;case OC:return jp;case wC:return Kp;case MC:return Qp;case CC:return Jp}return t});var AC=Object.prototype,DC=AC.hasOwnProperty;function LC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&DC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Ba=Ve.Uint8Array;function bc(e){var t=new e.constructor(e.byteLength);return new Ba(t).set(new Ba(e)),t}function RC(e,t){var n=t?bc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var IC=/\w*$/;function kC(e){var t=new e.constructor(e.source,IC.exec(e));return t.lastIndex=e.lastIndex,t}var eg=Ae?Ae.prototype:void 0,ng=eg?eg.valueOf:void 0;function PC(e){return ng?Object(ng.call(e)):{}}function rg(e,t){var n=t?bc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var NC="[object Boolean]",$C="[object Date]",FC="[object Map]",UC="[object Number]",BC="[object RegExp]",HC="[object Set]",GC="[object String]",VC="[object Symbol]",zC="[object ArrayBuffer]",WC="[object DataView]",YC="[object Float32Array]",qC="[object Float64Array]",XC="[object Int8Array]",ZC="[object Int16Array]",jC="[object Int32Array]",KC="[object Uint8Array]",QC="[object Uint8ClampedArray]",JC="[object Uint16Array]",tA="[object Uint32Array]";function eA(e,t,n){var r=e.constructor;switch(t){case zC:return bc(e);case NC:case $C:return new r(+e);case WC:return RC(e,n);case YC:case qC:case XC:case ZC:case jC:case KC:case QC:case JC:case tA:return rg(e,n);case FC:return new r;case UC:case GC:return new r(e);case BC:return kC(e);case HC:return new r;case VC:return PC(e)}}function ig(e){return typeof e.constructor=="function"&&!ka(e)?ZT(pc(e)):{}}var nA="[object Map]";function rA(e){return nn(e)&&Le(e)==nA}var sg=Br&&Br.isMap,iA=sg?oc(sg):rA,sA="[object Set]";function aA(e){return nn(e)&&Le(e)==sA}var ag=Br&&Br.isSet,oA=ag?oc(ag):aA,lA=1,cA=2,uA=4,og="[object Arguments]",hA="[object Array]",dA="[object Boolean]",fA="[object Date]",pA="[object Error]",lg="[object Function]",gA="[object GeneratorFunction]",mA="[object Map]",vA="[object Number]",cg="[object Object]",yA="[object RegExp]",EA="[object Set]",xA="[object String]",bA="[object Symbol]",SA="[object WeakMap]",_A="[object ArrayBuffer]",TA="[object DataView]",OA="[object Float32Array]",wA="[object Float64Array]",MA="[object Int8Array]",CA="[object Int16Array]",AA="[object Int32Array]",DA="[object Uint8Array]",LA="[object Uint8ClampedArray]",RA="[object Uint16Array]",IA="[object Uint32Array]",Dt={};Dt[og]=Dt[hA]=Dt[_A]=Dt[TA]=Dt[dA]=Dt[fA]=Dt[OA]=Dt[wA]=Dt[MA]=Dt[CA]=Dt[AA]=Dt[mA]=Dt[vA]=Dt[cg]=Dt[yA]=Dt[EA]=Dt[xA]=Dt[bA]=Dt[DA]=Dt[LA]=Dt[RA]=Dt[IA]=!0,Dt[pA]=Dt[lg]=Dt[SA]=!1;function Ki(e,t,n,r,i,s){var a,o=t&lA,l=t&cA,c=t&uA;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!De(e))return e;var u=Xt(e);if(u){if(a=LC(e),!o)return Zf(e,a)}else{var d=Le(e),h=d==lg||d==gA;if(Ur(e))return zp(e,o);if(d==cg||d==og||h&&!i){if(a=l||h?{}:ig(e),!o)return l?SC(e,gC(a,e)):xC(e,pC(a,e))}else{if(!Dt[d])return i?e:{};a=eA(e,d,o)}}s||(s=new ze);var f=s.get(e);if(f)return f;s.set(e,a),oA(e)?e.forEach(function(m){a.add(Ki(m,t,n,m,e,s))}):iA(e)&&e.forEach(function(m,v){a.set(v,Ki(m,t,n,v,e,s))});var p=c?l?Zp:yc:l?Yi:Wi,g=u?void 0:p(e);return iO(g||e,function(m,v){g&&(v=m,m=e[v]),Kf(a,v,Ki(m,t,n,v,e,s))}),a}var kA=1,PA=4;function Tn(e){return Ki(e,kA|PA)}var NA="__lodash_hash_undefined__";function $A(e){return this.__data__.set(e,NA),this}function FA(e){return this.__data__.has(e)}function Qi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new _n;++t<n;)this.add(e[t])}Qi.prototype.add=Qi.prototype.push=$A,Qi.prototype.has=FA;function ug(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function hg(e,t){return e.has(t)}var UA=1,BA=2;function dg(e,t,n,r,i,s){var a=n&UA,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&BA?new Qi:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var p=e[d],g=t[d];if(r)var m=a?r(g,p,d,t,e,s):r(p,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(f){if(!ug(t,function(v,S){if(!hg(f,S)&&(p===v||i(p,v,n,r,s)))return f.push(S)})){h=!1;break}}else if(!(p===g||i(p,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function HA(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Sc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var GA=1,VA=2,zA="[object Boolean]",WA="[object Date]",YA="[object Error]",qA="[object Map]",XA="[object Number]",ZA="[object RegExp]",jA="[object Set]",KA="[object String]",QA="[object Symbol]",JA="[object ArrayBuffer]",tD="[object DataView]",fg=Ae?Ae.prototype:void 0,_c=fg?fg.valueOf:void 0;function eD(e,t,n,r,i,s,a){switch(n){case tD:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case JA:return!(e.byteLength!=t.byteLength||!s(new Ba(e),new Ba(t)));case zA:case WA:case XA:return Vi(+e,+t);case YA:return e.name==t.name&&e.message==t.message;case ZA:case KA:return e==t+"";case qA:var o=HA;case jA:var l=r&GA;if(o||(o=Sc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=VA,a.set(e,t);var u=dg(o(e),o(t),r,i,s,a);return a.delete(e),u;case QA:if(_c)return _c.call(e)==_c.call(t)}return!1}var nD=1,rD=Object.prototype,iD=rD.hasOwnProperty;function sD(e,t,n,r,i,s){var a=n&nD,o=yc(e),l=o.length,c=yc(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:iD.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(r)var E=a?r(S,v,h,t,e,s):r(v,S,h,e,t,s);if(!(E===void 0?v===S||i(v,S,n,r,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 aD=1,pg="[object Arguments]",gg="[object Array]",Ha="[object Object]",oD=Object.prototype,mg=oD.hasOwnProperty;function lD(e,t,n,r,i,s){var a=Xt(e),o=Xt(t),l=a?gg:Le(e),c=o?gg:Le(t);l=l==pg?Ha:l,c=c==pg?Ha:c;var u=l==Ha,d=c==Ha,h=l==c;if(h&&Ur(e)){if(!Ur(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new ze),a||Pa(e)?dg(e,t,n,r,i,s):eD(e,t,l,n,r,i,s);if(!(n&aD)){var f=u&&mg.call(e,"__wrapped__"),p=d&&mg.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return s||(s=new ze),i(g,m,n,r,s)}}return h?(s||(s=new ze),sD(e,t,n,r,i,s)):!1}function Ga(e,t,n,r,i){return e===t?!0:e==null||t==null||!nn(e)&&!nn(t)?e!==e&&t!==t:lD(e,t,n,r,Ga,i)}var cD=1,uD=2;function hD(e,t,n,r){var i=n.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=n[i];var o=a[0],l=e[o],c=a[1];if(a[2]){if(l===void 0&&!(o in e))return!1}else{var u=new ze,d;if(!(d===void 0?Ga(c,l,cD|uD,r,u):d))return!1}}return!0}function vg(e){return e===e&&!De(e)}function dD(e){for(var t=Wi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,vg(i)]}return t}function yg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function fD(e){var t=dD(e);return t.length==1&&t[0][2]?yg(t[0][0],t[0][1]):function(n){return n===e||hD(n,e,t)}}function pD(e,t){return e!=null&&t in Object(e)}function gD(e,t,n){t=Fa(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=ji(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&ac(i)&&ic(a,i)&&(Xt(e)||Fr(e)))}function mD(e,t){return e!=null&&gD(e,t,pD)}var vD=1,yD=2;function ED(e,t){return cc(e)&&vg(t)?yg(ji(e),t):function(n){var r=yt(n,e);return r===void 0&&r===t?mD(n,e):Ga(t,r,vD|yD)}}function xD(e){return function(t){return t==null?void 0:t[e]}}function bD(e){return function(t){return hc(t,e)}}function SD(e){return cc(e)?xD(ji(e)):bD(e)}function Va(e){return typeof e=="function"?e:e==null?tc:typeof e=="object"?Xt(e)?ED(e[0],e[1]):fD(e):SD(e)}function _D(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function TD(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var Eg=TD();function OD(e,t){return e&&Eg(e,t,Wi)}function wD(e,t){return function(n,r){if(n==null)return n;if(!sr(n))return e(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var Tc=wD(OD);function MD(e,t,n,r){return Tc(e,function(i,s,a){t(r,i,n(i),a)}),r}function CD(e,t){return function(n,r){var i=Xt(n)?_D:MD,s={};return i(n,e,Va(r),s)}}var Oc=function(){return Ve.Date.now()},AD="Expected a function",DD=Math.max,LD=Math.min;function za(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(AD);t=Nr(t)||0,De(n)&&(u=!!n.leading,d="maxWait"in n,s=d?DD(Nr(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(_){var C=r,D=i;return r=i=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,B=t-C;return d?LD(B,s-D):B}function m(_){var C=_-l,D=_-c;return l===void 0||C>=t||C<0||d&&D>=s}function v(){var _=Oc();if(m(_))return S(_);o=setTimeout(v,g(_))}function S(_){return o=void 0,h&&r?f(_):(r=i=void 0,a)}function E(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function b(){return o===void 0?a:S(Oc())}function x(){var _=Oc(),C=m(_);if(r=arguments,i=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 wc(e,t,n){(n!==void 0&&!Vi(e[t],n)||n===void 0&&!(t in e))&&Ia(e,t,n)}function Mc(e){return nn(e)&&sr(e)}function Cc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function RD(e){return $r(e,Yi(e))}function ID(e,t,n,r,i,s,a){var o=Cc(e,n),l=Cc(t,n),c=a.get(l);if(c){wc(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Xt(l),f=!h&&Ur(l),p=!h&&!f&&Pa(l);u=l,h||f||p?Xt(o)?u=o:Mc(o)?u=Zf(o):f?(d=!1,u=zp(l,!0)):p?(d=!1,u=rg(l,!0)):u=[]:dp(l)||Fr(l)?(u=o,Fr(o)?u=RD(o):(!De(o)||ec(o))&&(u=ig(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),wc(e,n,u)}function xg(e,t,n,r,i){e!==t&&Eg(t,function(s,a){if(i||(i=new ze),De(s))ID(e,t,a,n,xg,r,i);else{var o=r?r(Cc(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),wc(e,a,o)}},Yi)}var kD="Expected a function";function PD(e,t,n){if(typeof e!="function")throw new TypeError(kD);return setTimeout(function(){e.apply(void 0,n)},t)}var ND=sc(function(e,t,n){return PD(e,Nr(t)||0,n)});function bg(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function $D(e,t){var n=-1,r=sr(e)?Array(e.length):[];return Tc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function FD(e,t){var n=Xt(e)?Jl:$D;return n(e,Va(t))}var UD=1/0;function BD(e,t){return Ua(FD(e,t),UD)}function HD(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var GD=Object.prototype,VD=GD.hasOwnProperty,zD=CD(function(e,t,n){VD.call(e,n)?e[n].push(t):Ia(e,n,[t])});function WD(e,t){return t.length<2?e:hc(e,fp(t,0,-1))}var YD="[object Map]",qD="[object Set]",XD=Object.prototype,ZD=XD.hasOwnProperty;function We(e){if(e==null)return!0;if(sr(e)&&(Xt(e)||typeof e=="string"||typeof e.splice=="function"||Ur(e)||Pa(e)||Fr(e)))return!e.length;var t=Le(e);if(t==YD||t==qD)return!e.size;if(ka(e))return!cp(e).length;for(var n in e)if(ZD.call(e,n))return!1;return!0}function Sg(e,t){return Ga(e,t)}var Vr=Fp(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ct=mO(function(e,t,n){xg(e,t,n)});function jD(e,t){return t=Fa(t,e),e=WD(e,t),e==null||delete e[ji(bg(t))]}function KD(e){return dp(e)?void 0:e}var QD=1,JD=2,tL=4,eL=Uw(function(e,t){var n={};if(e==null)return n;var r=!1;t=Jl(t,function(s){return s=Fa(s,e),r||(r=s.length>1),s}),$r(e,Zp(e),n),r&&(n=Ki(n,QD|JD|tL,KD));for(var i=t.length;i--;)jD(n,t[i]);return n});function nL(e,t){var n;return Tc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function rL(e,t,n){var r=Xt(e)?ug:nL;return r(e,Va(t))}var iL=1/0,sL=Gr&&1/Sc(new Gr([,-0]))[1]==iL?function(e){return new Gr(e)}:KT,aL=200;function _g(e,t,n){var r=-1,i=cO,s=e.length,a=!0,o=[],l=o;if(s>=aL){var c=t?null:sL(e);if(c)return Sc(c);a=!1,i=hg,l=new Qi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var oL=sc(function(e){var t=bg(e);return Mc(t)&&(t=void 0),_g(Ua(e,1,Mc,!0),Va(t))});function Ji(e){return e&&e.length?_g(e):[]}var Ac=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Ac||{}),Dc=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Dc||{}),Lc=(e=>(e.UPDATE="model-update",e))(Lc||{}),Tg=(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))(Tg||{}),Rc=(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))(Rc||{}),Ic=(e=>(e.CHANGE="zoom-domain-change",e))(Ic||{}),kc=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(kc||{}),Pc=(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))(Pc||{}),Nc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Nc||{}),$c=(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))($c||{}),Fc=(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))(Fc||{}),Uc=(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))(Uc||{}),Bc=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Bc||{}),Hc=(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))(Hc||{}),Gc=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Gc||{}),Vc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Vc||{}),zc=(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))(zc||{}),Wc=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Wc||{}),Yc=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Yc||{}),zr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(zr||{}),qc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(qc||{}),Og=(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))(Og||{}),wg=(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))(wg||{}),Mg=(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))(Mg||{}),Cg=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Cg||{}),Ag=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Ag||{}),Wr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Wr||{});const T=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Mg,Area:Nc,Axis:Pc,Bar:Bc,Boxplot:Hc,CanvasZoom:kc,Chart:Ac,Choropleth:Wr,CirclePack:wg,Gauge:Uc,Heatmap:Ag,Legend:Og,Line:Vc,Meter:Cg,Modal:Dc,Model:Lc,Pie:Fc,Radar:zc,Scatter:Gc,Threshold:qc,Toolbar:Tg,Tooltip:zr,Tree:Wc,Treemap:Yc,WordCloud:$c,ZoomBar:Rc,ZoomDomain:Ic},Symbol.toStringTag,{value:"Module"}));var at=(e=>(e.HTML="html",e.SVG="svg",e))(at||{}),Xc=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Xc||{}),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||{}),Ye=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ye||{}),Re=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Re||{}),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||{}),Yr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Yr||{}),Gt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Gt||{}),qr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(qr||{}),Wa=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Wa||{}),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||{}),or=(e=>(e.CENTER="center",e))(or||{}),ts=(e=>(e.LEFT="left",e.RIGHT="right",e))(ts||{}),Vt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Vt||{}),rn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(rn||{}),sn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(sn||{}),lr=(e=>(e.SEMI="semi",e.FULL="full",e))(lr||{}),Ya=(e=>(e.UP="up",e.DOWN="down",e))(Ya||{}),es=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(es||{}),ns=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(ns||{}),be=(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))(be||{}),St=(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))(St||{}),qa=(e=>(e.LEFT="left",e.RIGHT="right",e))(qa||{}),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||{}),rs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(rs||{}),Xr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Xr||{}),is=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(is||{}),an=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(an||{});const fe="cds",On={opacity:{unselected:.05,selected:.4}},$n={ticks:{number:7,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Zr={duration:1e3,ease:Dh,zoomLevel:3},jr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},depth:2},Dg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ie={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},lL={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}},Zt={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}},cr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},qe={nodeWidth:4,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Lg={minCellDividerDimension:16},Rg={default:{size:24}},Ig={defaultOffset:4,horizontalOffset:10},kg={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}},Se={height:{[Ye.GRAPH_VIEW]:32,[Ye.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},cL=[{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 uL(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=zn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function It(e,t){var i;const n=Tn(e),r=Object.keys(t.axes||{});(i=t==null?void 0:t.toolbar)!=null&&i.controls&&delete n.toolbar.controls,r.length===0&&delete n.axes;for(const s in n.axes)if(r.includes(s)){const a=t.axes[s];(a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://charts.carbondesignsystem.com/");const o=a.mapsTo;if(o==null){const l=a.scaleType;l==null?a.mapsTo="value":l===rt.TIME?a.mapsTo="date":l===rt.LABELS&&(a.mapsTo="key")}}else delete n.axes[s];return jc(n,t),ct(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 r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function ss(e){const n=/\(([^)]+)\)/.exec(e);if(n&&n.length>1){const r=n[1].split(",");if(r.length>1)return{x:parseFloat(r[0]),y:parseFloat(r[1])}}return{x:0,y:0}}function Zc(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function as(e,t,n){if(n>e.length)return e;if(t===Re.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Re.FRONT_LINE)return"..."+e.substr(-n);if(t===Re.END_LINE)return e.substr(0,n)+"..."}function jc(e,t){const n=y(e,"legend","additionalItems"),r=y(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=cL.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=oL(a,r,"name")}}const y=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},Pg=(e,t)=>t===Ht.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ie=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Pg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function Cn(e,t,n){return n===Ht.VERTICAL?[e,t]:[t,e]}function Kc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function os(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function ls(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?dL(o,d=>d.test(a)):hL(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 hL(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function dL(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function fL(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const Ng=6048e5,pL=864e5,$g=6e4,Fg=36e5,Ug=Symbol.for("constructDateFrom");function ke(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ug in e?e[Ug](t):e instanceof Date?new e.constructor(t):new Date(t)}function ur(e,...t){const n=ke.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}let gL={};function Xa(){return gL}function $t(e,t){return ke(t||e,e)}function cs(e,t){var o,l,c,u;const n=Xa(),r=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=$t(e,t==null?void 0:t.in),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}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"}},vL=(e,t,n)=>{let r;const i=mL[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},yL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},EL=(e,t,n,r)=>yL[e],xL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},bL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},SL={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"]},_L={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"]},TL={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"}},OL={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"}},wL={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:os({values:xL,defaultWidth:"wide"}),quarter:os({values:bL,defaultWidth:"wide",argumentCallback:e=>e-1}),month:os({values:SL,defaultWidth:"wide"}),day:os({values:_L,defaultWidth:"wide"}),dayPeriod:os({values:TL,defaultWidth:"wide",formattingValues:OL,defaultFormattingWidth:"wide"})},ML=/^(\d+)(th|st|nd|rd)?/i,CL=/\d+/i,AL={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},DL={any:[/^b/i,/^(a|c)/i]},LL={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},RL={any:[/1/i,/2/i,/3/i,/4/i]},IL={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},kL={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]},PL={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},NL={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]},$L={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},FL={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}},UL={ordinalNumber:fL({matchPattern:ML,parsePattern:CL,valueCallback:e=>parseInt(e,10)}),era:ls({matchPatterns:AL,defaultMatchWidth:"wide",parsePatterns:DL,defaultParseWidth:"any"}),quarter:ls({matchPatterns:LL,defaultMatchWidth:"wide",parsePatterns:RL,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ls({matchPatterns:IL,defaultMatchWidth:"wide",parsePatterns:kL,defaultParseWidth:"any"}),day:ls({matchPatterns:PL,defaultMatchWidth:"wide",parsePatterns:NL,defaultParseWidth:"any"}),dayPeriod:ls({matchPatterns:$L,defaultMatchWidth:"any",parsePatterns:FL,defaultParseWidth:"any"})},BL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},HL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},GL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},VL={date:Kc({formats:BL,defaultWidth:"full"}),time:Kc({formats:HL,defaultWidth:"full"}),dateTime:Kc({formats:GL,defaultWidth:"full"})},Bg={code:"en-US",formatDistance:vL,formatLong:VL,formatRelative:EL,localize:wL,match:UL,options:{weekStartsOn:0,firstWeekContainsDate:1}},Kr={type:Re.END_LINE,threshold:16,numCharacter:14},zL={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>{var n;return(n=e==null?void 0:e.toLocaleString)==null?void 0:n.call(e,t)},date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},WL={enabled:!0,position:Yr.BOTTOM,clickable:!0,truncation:Kr,alignment:Gt.LEFT,order:null,additionalItems:[]},YL={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},qL={enabled:!0},Hg={enabled:!0,showTotal:!0,truncation:Kr,groupLabel:"Group"},Gg={top:{visible:!0,includeZero:!0,truncation:Kr},bottom:{visible:!0,includeZero:!0,truncation:Kr},left:{visible:!0,includeZero:!0,truncation:Kr},right:{visible:!0,includeZero:!0,truncation:Kr}},Za={addSpaceOnEdges:1,showDayName:!1,localeObject:Bg,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 Vg=!1;try{Vg=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const ee={width:null,height:null,resizable:!0,theme:Xc.WHITE,tooltip:Hg,legend:WL,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:St.SHOW_AS_DATATABLE},...Vg?[{type:St.MAKE_FULLSCREEN}]:[],{type:St.EXPORT_CSV},{type:St.EXPORT_PNG},{type:St.EXPORT_JPG}]}},zg=ct({},ee,{thematic:{projection:an.geoNaturalEarth1}}),us=ct({},ee,{axes:Gg,timeScale:Za,grid:YL,ruler:qL,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ye.GRAPH_VIEW}}}),hr=ct({},us,{bars:{maxWidth:16,spacingFactor:.25},timeScale:ct(Za,{addSpaceOnEdges:1})}),XL=ct({},hr,{}),ZL=ct({},hr,{}),jL=ct({},hr,{bars:ct({},hr.bars,{dividerSize:1.5})}),KL=ct({},hr,{}),Qc=ct({},us,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),QL=Qc,Wg=ct({},Qc,{points:{radius:3,filled:!1,enabled:!0}}),Yg=ct({},Wg,{timeScale:ct(Za,{addSpaceOnEdges:0})}),JL=Yg,tR=ct({},us,{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"}]}}),eR=ct({},us,{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"}]}}),nR=ct({},hr,{bars:{dividerSize:1.5},timeScale:ct(Za,{addSpaceOnEdges:0})}),rR=ct({},ee,{tooltip:ct({},Hg,{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"}}),qg=ct({},ee,{pie:{labels:{formatter:null,enabled:!0},alignment:Gt.LEFT,sortFunction:null,valueMapsTo:"value"}}),iR=ct({},ee,{legend:{enabled:!1},gauge:{type:lr.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}}),sR=ct({},qg,{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}}),Xg=ct({},ee,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),aR=ct({},Xg,{legend:{enabled:!0}}),oR=ct({},ee,{radar:{axes:{angle:"key",value:"value"},alignment:Gt.LEFT},tooltip:{gridline:{enabled:!0}}}),lR=ct({},hr,{comboChartTypes:[]}),cR=ct({tree:{type:Wa.TREE}},ee,{}),uR=ct({},ee,{data:ct(ee.data,{groupMapsTo:"name"})}),hR=ct({},ee,jr,{data:ct(ee.data,{groupMapsTo:"name"})}),dR=ct({},ee,{alluvial:{data:ct(ee.data,{groupMapsTo:"source"}),nodeAlignment:Gt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),fR=ct({},ee,{axes:Gg,heatmap:{divider:{state:Xr.AUTO},colorLegend:{type:"linear"}}}),pR=ct({},zg,{choropleth:{colorLegend:{type:"linear"}}}),At={alluvialChart:dR,areaChart:Yg,axisChart:us,boxplotChart:KL,bubbleChart:tR,bulletChart:eR,chart:ee,circlePackChart:hR,choroplethChart:pR,comboChart:lR,donutChart:sR,gaugeChart:iR,groupedBarChart:ZL,heatmapChart:fR,histogramChart:nR,lineChart:Wg,lollipopChart:QL,meterChart:Xg,pieChart:qg,proportionalMeterChart:aR,radarChart:oR,scatterChart:Qc,simpleBarChart:XL,stackedAreaChart:JL,stackedBarChart:jL,thematicChart:zg,treeChart:cR,treemapChart:uR,wordCloudChart:rR};function Zg(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 jg(e,t){const n=$t(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Kg(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=jg(r),a=jg(i),o=+s-Zg(s),l=+a-Zg(a);return Math.round((o-l)/pL)}function gR(e,t){const n=$t(e,t==null?void 0: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==null?void 0:t.in);return Kg(n,gR(n))+1}function ja(e,t){return cs(e,{...t,weekStartsOn:1})}function Qg(e,t){const n=$t(e,t==null?void 0:t.in),r=n.getFullYear(),i=ke(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=ja(i),a=ke(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=ja(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function vR(e,t){const n=Qg(e,t),r=ke(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ja(r)}function yR(e,t){const n=$t(e,t==null?void 0:t.in),r=+ja(n)-+vR(n);return Math.round(r/Ng)+1}function Jg(e,t){var u,d,h,f;const n=$t(e,t==null?void 0:t.in),r=n.getFullYear(),i=Xa(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,a=ke((t==null?void 0:t.in)||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=cs(a,t),l=ke((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=cs(l,t);return+n>=+o?r+1:+n>=+c?r:r-1}function ER(e,t){var o,l,c,u;const n=Xa(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=Jg(e,t),s=ke((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),cs(s,t)}function xR(e,t){const n=$t(e,t==null?void 0:t.in),r=+cs(n,t)-+ER(n,t);return Math.round(r/Ng)+1}function Ot(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Fn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ot(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ot(n+1,2)},d(e,t){return Ot(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 Ot(e.getHours()%12||12,t.length)},H(e,t){return Ot(e.getHours(),t.length)},m(e,t){return Ot(e.getMinutes(),t.length)},s(e,t){return Ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ot(i,t.length)}},Qr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Fn.y(e,t)},Y:function(e,t,n,r){const i=Jg(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return Ot(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ot(s,t.length)},R:function(e,t){const n=Qg(e);return Ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ot(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ot(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ot(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Fn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ot(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=xR(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ot(i,t.length)},I:function(e,t,n){const r=yR(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ot(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Fn.d(e,t)},D:function(e,t,n){const r=mR(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ot(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ot(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ot(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Ot(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Qr.noon:r===0?i=Qr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Qr.evening:r>=12?i=Qr.afternoon:r>=4?i=Qr.morning:i=Qr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Fn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Fn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Fn.s(e,t)},S:function(e,t){return Fn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return nm(r);case"XXXX":case"XX":return dr(r);case"XXXXX":case"XXX":default:return dr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return nm(r);case"xxxx":case"xx":return dr(r);case"xxxxx":case"xxx":default:return dr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+em(r,":");case"OOOO":default:return"GMT"+dr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+em(r,":");case"zzzz":default:return"GMT"+dr(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ot(r,t.length)},T:function(e,t,n){return Ot(+e,t.length)}};function em(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Ot(s,2)}function nm(e,t){return e%60===0?(e>0?"-":"+")+Ot(Math.abs(e)/60,2):dr(e,t)}function dr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ot(Math.trunc(r/60),2),s=Ot(r%60,2);return n+i+t+s}const rm=(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"})}},im=(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"})}},bR={p:im,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return rm(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",rm(r,t)).replace("{{time}}",im(i,t))}},SR=/^D+$/,_R=/^Y+$/,TR=["D","DD","YY","YYYY"];function OR(e){return SR.test(e)}function wR(e){return _R.test(e)}function MR(e,t,n){const r=CR(e,t,n);if(console.warn(r),TR.includes(e))throw new RangeError(r)}function CR(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function AR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function DR(e){return!(!AR(e)&&typeof e!="number"||isNaN(+$t(e)))}const LR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,RR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IR=/^'([^]*?)'?$/,kR=/''/g,PR=/[a-zA-Z]/;function Jc(e,t,n){var u,d,h,f,p,g,m,v;const r=Xa(),i=(n==null?void 0:n.locale)??r.locale??Bg,s=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((f=(h=r.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((v=(m=r.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??0,o=$t(e,n==null?void 0:n.in);if(!DR(o))throw new RangeError("Invalid time value");let l=t.match(RR).map(S=>{const E=S[0];if(E==="p"||E==="P"){const b=bR[E];return b(S,i.formatLong)}return S}).join("").match(LR).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const E=S[0];if(E==="'")return{isToken:!1,value:NR(S)};if(tm[E])return{isToken:!0,value:S};if(E.match(PR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const E=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&wR(E)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&OR(E))&&MR(E,t,String(e));const b=tm[E[0]];return b(o,E,i.localize,c)}).join("")}function NR(e){const t=e.match(IR);return t?t[1].replace(kR,"'"):e}var sm=(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))(sm||{});const tu=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function am(e,t,n,r,i){const s=t===0,a=Number(Jc(new Date(e),"c"))===2,o=Number(Jc(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Qa(e)||hs(e,l)||Un(e);case"minute":return s||Qa(e)||hs(e,l)||Un(e);case"30minutes":return s||Qa(e)||hs(e,l)||Un(e);case"hourly":return s||Qa(e)||hs(e,l)||Un(e);case"daily":return i?s||a||Un(e):s||hs(e,l)||Un(e);case"weekly":return s||a||Un(e);case"monthly":return s||Un(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function eu(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=y(i,"timeIntervalFormats")[o],u=y(c,"primary"),d=y(c,"secondary"),h=am(e,t,n,r,a);let f=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=i.localeObject,{code:g,optionsObject:m}=s,v=m[r].type,S=m[r][h?"primary":"secondary"][f];if(r==="quarterly"||!S){const b=Jc(l,f,{locale:p}).split("").map(x=>{var C;const _=Number(x);return x!==" "&&!Number.isNaN(_)?(C=_==null?void 0:_.toLocaleString)==null?void 0:C.call(_,g):x});return s[v](l,g,{},b.join(""))}else return s[v](l,g,S)}function Ka(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function $R(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function FR(e){const t=tu.reduce((n,[,r],i)=>{const s=tu[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return tu[t][0]}function nu(e,t){if(sm[t])return t;if(e.length===1)return"15seconds";const n=$R(e),r=kn(n);return FR(r)}function Qa(e){const{s:t,m:n,H:r}=Ka(e);return r===0&&n===0&&t===0}function hs(e,t){const n=Ka(e).M,r=Ka(t).M;return n!==r}function Un(e){const{M:t,d:n,s:r,m:i,H:s}=Ka(e);return t===1&&n===1&&s===0&&i===0&&r===0}function om(e){return e===void 0?"":e.toISOString()}function UR(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class on{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=y(r,"locale"),o=y(r,"tabularRepModal","tableHeadingFormatter"),l=y(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===rt.TIME&&(d=f=>s(f,i,{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,i))}return f})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=y(n,"data"),a=y(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===rt.LINEAR||c===rt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===rt.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Pt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(a=>r.find(o=>o.name===a[i]&&o.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(Tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return y(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(r=>t.includes(r.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Pt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(r=>r.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(r=>r.name)}aggregateBinDataByGroup(t){return zD(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=lL.defaultBins}=s,l=Array.isArray(o),c=l0().value(f=>f[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],d=Array.from(new Set(t.map(f=>f[a]))),h=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,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,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return Ql().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=Ji(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?om(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===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 r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{d[f]=h.filter(p=>p[i]===f).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?om(f[p])===l:f[p].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const c=HD(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(r?Ql().offset(pT):Ql()).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 r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();jc(n,t),this.set({options:ct(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(T.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Pt.items.status,i=this.getDataGroups(),s=i.some(u=>u.status===r),a=i.filter(u=>u.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((u,d)=>{i[d].status=n});else{const u=i.findIndex(d=>d.name===t);i[u].status=i[u].status===r?n:r}else i.forEach((u,d)=>{i[d].status=u.name===t?n:r});const o=i.filter(u=>u.status===n),l=this.getOptions();i.some(u=>u.status===r)?l.data.selectedGroups=o.map(u=>u.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(T.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=y(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=y(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://charts.carbondesignsystem.com/");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=y(s,"label");if(c===null){const d=y(i,o);d?l=d:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const n=this.getTabularDataArray().map(a=>a.map(o=>`"${(o==="&ndash;"?"–":o).split(/[,;'"`]/).map(u=>UR(u)).join("")}"`)).map(a=>a.join(",")).join(`
2
2
  `),r=this.getOptions();let i="myChart";const s=y(r,"fileDownload","fileName");typeof s=="function"?i=s("csv"):typeof s=="string"&&(i=s),this.services.files.downloadCSV(n,`${i}.csv`)}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:r,DISABLED:i}=Pt.items.status,s=this.getOptions(),a=Ji(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)?r:i;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(i=>{this.allDataGroups.includes(i)||console.warn(`"${i}" does not exist in data groups.`)}),this.allDataGroups.filter(i=>n[i]).forEach(i=>this.colorScale[i]=n[i])}setColorClassNames(){const t=y(this.getOptions(),"color","pairing");let n=y(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=y(t,"option");const i=Dg.pairingOptions,s=n>5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=ga().range(o).domain(this.allDataGroups)}}function BR(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const HR=(()=>{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,r=e.length;n<r;n++)t.push(e[n]);return t}function Ja(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function GR(e){const t=Ja(e,"border-left-width"),n=Ja(e,"border-right-width");return e.clientWidth+t+n}function VR(e){const t=Ja(e,"border-top-width"),n=Ja(e,"border-bottom-width");return e.clientHeight+t+n}function lm(e,t={}){const n=t.width||GR(e),r=t.height||VR(e);return{width:n,height:r}}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 _e=16384;function WR(e){(e.width>_e||e.height>_e)&&(e.width>_e&&e.height>_e?e.width>e.height?(e.height*=_e/e.width,e.width=_e):(e.width*=_e/e.height,e.height=_e):e.width>_e?(e.height*=_e/e.width,e.width=_e):(e.width*=_e/e.height,e.height=_e))}function to(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function YR(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 r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),YR(i)}const pe=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||pe(n,t)};function XR(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ZR(e){return An(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function jR(e,t,n){const r=`.${e}:${t}`,i=n.cssText?XR(n):ZR(n);return document.createTextNode(`${r}{${i}}`)}function cm(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=HR();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(jR(s,n,r)),t.appendChild(a)}function KR(e,t){cm(e,t,":before"),cm(e,t,":after")}const um="application/font-woff",hm="image/jpeg",QR={woff:um,woff2:um,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:hm,jpeg:hm,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function JR(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ru(e){const t=JR(e).toLowerCase();return QR[t]||""}function tI(e){return e.split(/,/)[1]}function iu(e){return e.search(/^(data:)/)!==-1}function eI(e,t){return`data:${t};base64,${e}`}async function dm(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:r,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const su={};function nI(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function au(e,t,n){const r=nI(e,t,n.includeQueryParams);if(su[r]!=null)return su[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await dm(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),tI(o)));i=eI(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return su[r]=i,i}async function rI(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):to(t)}async function iI(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return to(o)}const n=e.poster,r=ru(n),i=await au(n,r,t);return to(i)}async function sI(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await eo(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function aI(e,t){return pe(e,HTMLCanvasElement)?rI(e):pe(e,HTMLVideoElement)?iI(e,t):pe(e,HTMLIFrameElement)?sI(e):e.cloneNode(!1)}const oI=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function lI(e,t,n){var r,i;let s=[];return oI(e)&&e.assignedNodes?s=An(e.assignedNodes()):pe(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=An(e.contentDocument.body.childNodes):s=An(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||pe(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>eo(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function cI(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):An(r).forEach(i=>{let s=r.getPropertyValue(i);i==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),pe(e,HTMLIFrameElement)&&i==="display"&&s==="inline"&&(s="block"),i==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(i,s,r.getPropertyPriority(i))})}function uI(e,t){pe(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),pe(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function hI(e,t){if(pe(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function dI(e,t){return pe(t,Element)&&(cI(e,t),KR(e,t),uI(e,t),hI(e,t)),t}async function fI(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const o=n[s].getAttribute("xlink:href");if(o){const l=e.querySelector(o),c=document.querySelector(o);!l&&c&&!r[o]&&(r[o]=await eo(c,t,!0))}}const i=Object.values(r);if(i.length){const s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const o=document.createElementNS(s,"defs");a.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(a)}return e}async function eo(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>aI(r,t)).then(r=>lI(e,r,t)).then(r=>dI(e,r)).then(r=>fI(r,t))}const fm=/url\((['"]?)([^'"]+?)\1\)/g,pI=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gI=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function mI(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function vI(e){const t=[];return e.replace(fm,(n,r,i)=>(t.push(i),n)),t.filter(n=>!iu(n))}async function yI(e,t,n,r,i){try{const s=n?BR(t,n):t,a=ru(t);let o;return i||(o=await au(s,a,r)),e.replace(mI(t),`$1${o}$3`)}catch{}return e}function EI(e,{preferredFontFormat:t}){return t?e.replace(gI,n=>{for(;;){const[r,,i]=pI.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function pm(e){return e.search(fm)!==-1}async function gm(e,t,n){if(!pm(e))return e;const r=EI(e,n);return vI(r).reduce((s,a)=>s.then(o=>yI(o,a,t,n)),Promise.resolve(r))}async function no(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await gm(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function xI(e,t){await no("background",e,t)||await no("background-image",e,t),await no("mask",e,t)||await no("mask-image",e,t)}async function bI(e,t){const n=pe(e,HTMLImageElement);if(!(n&&!iu(e.src))&&!(pe(e,SVGImageElement)&&!iu(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await au(r,ru(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function SI(e,t){const r=An(e.childNodes).map(i=>mm(i,t));await Promise.all(r).then(()=>e)}async function mm(e,t){pe(e,Element)&&(await xI(e,t),await bI(e,t),await SI(e,t))}function _I(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const vm={};async function ym(e){let t=vm[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},vm[e]=t,t}async function Em(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let o=a.replace(r,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),dm(o,t.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>n)}function xm(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=o.exec(r),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function TI(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{An(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=ym(l).then(u=>Em(u,t)).then(u=>xm(u).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(ym(i.href).then(o=>Em(o,t)).then(o=>xm(o).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{An(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function OI(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pm(t.style.getPropertyValue("src")))}async function wI(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=An(e.ownerDocument.styleSheets),r=await TI(n,t);return OI(r)}async function MI(e,t){const n=await wI(e,t);return(await Promise.all(n.map(i=>{const s=i.parentStyleSheet?i.parentStyleSheet.href:null;return gm(i.cssText,s,t)}))).join(`
3
3
  `)}async function CI(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await MI(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function AI(e,t={}){const{width:n,height:r}=lm(e,t),i=await eo(e,t,!0);return await CI(i,t),await mm(i,t),_I(i,t),await qR(i,n,r)}async function bm(e,t={}){const{width:n,height:r}=lm(e,t),i=await AI(e,t),s=await to(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||zR(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||WR(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 DI(e,t={}){return(await bm(e,t)).toDataURL()}async function LI(e,t={}){return(await bm(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 RI="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 r={width:0,height:0},i=h=>{h&&Object.keys(r).forEach(f=>{if(h[f]){const p=h[f],g=parseFloat(p);p&&g>r[f]&&(""+p).indexOf("%")===-1&&(r[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==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const h={width:y(t.node(),"width","baseVal","value"),height:y(t.node(),"height","baseVal","value")};i(h)}catch{i(d),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.initializeID(),this.styleHolderElement(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=y(t,"style","prefix"),r=I(this.getHolder()).append("div").classed(`${fe}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",RI),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),I(this.getHolder()).classed(`${fe}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),LI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("jpg"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=I(r);i.classed("filled",!0),DI(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=y(n,"fileDownload","fileName");typeof o=="function"?a=o("png"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.png`),i.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"),r=I(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(k.getSVGElementSize(I(s),{useBBox:!0}).height)}),i<=t?I(this.mainContainer).attr("height",i):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=za(()=>{var a;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(a=this.services.events)==null||a.dispatchEvent(T.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}}class mt{constructor(t,n,r){if(this.type="",this.renderType=at.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=y(this.model.getOptions(),"style","prefix");this.id=`${i}--${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){var r;const n=this.parent;if(this.parent=t,!(n&&n.node()===t.node())&&this.type){const i=y(this.model.getOptions(),"style","prefix");(r=this.parent)==null||r.classed(`${fe}--${i}--${this.type}`,!0),n&&n.classed(`${fe}--${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"),r=this.id?`#${this.id}`:"",i=k.appendOrSelect(this.parent,`${this.renderType===at.SVG?"svg":"div"}${r}.${fe}--${n}--${this.type}`);if(t.ariaLabel&&i.attr("aria-label",t.ariaLabel),t.isPresentational&&i.attr("role","presentation"),t.withinChartClip){const s=this.model.get("chartClipId");if(s){const o=I(`#${s}`).select("rect");o.size()!==0&&parseFloat(o.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?ct({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */const{entries:Sm,setPrototypeOf:_m,isFrozen:II,getPrototypeOf:kI,getOwnPropertyDescriptor:PI}=Object;let{freeze:se,seal:Pe,create:Tm}=Object,{apply:ou,construct:lu}=typeof Reflect<"u"&&Reflect;se||(se=function(t){return t}),Pe||(Pe=function(t){return t}),ou||(ou=function(t,n,r){return t.apply(n,r)}),lu||(lu=function(t,n){return new t(...n)});const ro=oe(Array.prototype.forEach),NI=oe(Array.prototype.lastIndexOf),Om=oe(Array.prototype.pop),ds=oe(Array.prototype.push),$I=oe(Array.prototype.splice),io=oe(String.prototype.toLowerCase),cu=oe(String.prototype.toString),wm=oe(String.prototype.match),fs=oe(String.prototype.replace),FI=oe(String.prototype.indexOf),UI=oe(String.prototype.trim),Xe=oe(Object.prototype.hasOwnProperty),ae=oe(RegExp.prototype.test),ps=BI(TypeError);function oe(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return ou(e,t,r)}}function BI(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return lu(e,n)}}function vt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:io;_m&&_m(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(II(t)||(t[r]=s),i=s)}e[i]=!0}return e}function HI(e){for(let t=0;t<e.length;t++)Xe(e,t)||(e[t]=null);return e}function fr(e){const t=Tm(null);for(const[n,r]of Sm(e))Xe(e,n)&&(Array.isArray(r)?t[n]=HI(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=fr(r):t[n]=r);return t}function gs(e,t){for(;e!==null;){const r=PI(e,t);if(r){if(r.get)return oe(r.get);if(typeof r.value=="function")return oe(r.value)}e=kI(e)}function n(){return null}return n}const Mm=se(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uu=se(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),hu=se(["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"]),GI=se(["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"]),du=se(["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"]),VI=se(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Cm=se(["#text"]),Am=se(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),fu=se(["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","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"]),Dm=se(["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"]),so=se(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zI=Pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),WI=Pe(/<%[\w\W]*|[\w\W]*%>/gm),YI=Pe(/\$\{[\w\W]*/gm),qI=Pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),XI=Pe(/^aria-[\-\w]+$/),Lm=Pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ZI=Pe(/^(?:\w+script|data):/i),jI=Pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rm=Pe(/^html$/i),KI=Pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var Im=Object.freeze({__proto__:null,ARIA_ATTR:XI,ATTR_WHITESPACE:jI,CUSTOM_ELEMENT:KI,DATA_ATTR:qI,DOCTYPE_NAME:Rm,ERB_EXPR:WI,IS_ALLOWED_URI:Lm,IS_SCRIPT_OR_DATA:ZI,MUSTACHE_EXPR:zI,TMPLIT_EXPR:YI});const ms={element:1,text:3,progressingInstruction:7,comment:8,document:9},QI=function(){return typeof window>"u"?null:window},JI=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");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}},km=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Pm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:QI();const t=ot=>Pm(ot);if(t.version="3.2.5",t.removed=[],!e||!e.document||e.document.nodeType!==ms.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=e,p=l.prototype,g=gs(p,"cloneNode"),m=gs(p,"remove"),v=gs(p,"nextSibling"),S=gs(p,"childNodes"),E=gs(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:B}=n,{importNode:P}=r;let w=km();t.isSupported=typeof Sm=="function"&&typeof E=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:H,ERB_EXPR:N,TMPLIT_EXPR:M,DATA_ATTR:O,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:F,ATTR_WHITESPACE:L,CUSTOM_ELEMENT:U}=Im;let{IS_ALLOWED_URI:tt}=Im,X=null;const Y=vt({},[...Mm,...uu,...hu,...du,...Cm]);let Q=null;const ut=vt({},[...Am,...fu,...Dm,...so]);let et=Object.seal(Tm(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,ht=!0,W=!0,j=!1,J=!0,A=!1,G=!0,V=!1,xt=!1,Ut=!1,st=!1,_t=!1,Ne=!1,Oe=!0,bs=!1;const Ss="user-content-";let mr=!0,je=!1,ii={},si=null;const Av=vt({},["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 Dv=null;const Lv=vt({},["audio","video","img","source","image","track"]);let Du=null;const Rv=vt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mo="http://www.w3.org/1998/Math/MathML",vo="http://www.w3.org/2000/svg",Rn="http://www.w3.org/1999/xhtml";let ai=Rn,Lu=!1,Ru=null;const W$=vt({},[mo,vo,Rn],cu);let yo=vt({},["mi","mo","mn","ms","mtext"]),Eo=vt({},["annotation-xml"]);const Y$=vt({},["title","style","font","a","script"]);let _s=null;const q$=["application/xhtml+xml","text/html"],X$="text/html";let qt=null,oi=null;const Z$=n.createElement("form"),Iv=function(R){return R instanceof RegExp||R instanceof Function},Iu=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(oi&&oi===R)){if((!R||typeof R!="object")&&(R={}),R=fr(R),_s=q$.indexOf(R.PARSER_MEDIA_TYPE)===-1?X$:R.PARSER_MEDIA_TYPE,qt=_s==="application/xhtml+xml"?cu:io,X=Xe(R,"ALLOWED_TAGS")?vt({},R.ALLOWED_TAGS,qt):Y,Q=Xe(R,"ALLOWED_ATTR")?vt({},R.ALLOWED_ATTR,qt):ut,Ru=Xe(R,"ALLOWED_NAMESPACES")?vt({},R.ALLOWED_NAMESPACES,cu):W$,Du=Xe(R,"ADD_URI_SAFE_ATTR")?vt(fr(Rv),R.ADD_URI_SAFE_ATTR,qt):Rv,Dv=Xe(R,"ADD_DATA_URI_TAGS")?vt(fr(Lv),R.ADD_DATA_URI_TAGS,qt):Lv,si=Xe(R,"FORBID_CONTENTS")?vt({},R.FORBID_CONTENTS,qt):Av,K=Xe(R,"FORBID_TAGS")?vt({},R.FORBID_TAGS,qt):{},nt=Xe(R,"FORBID_ATTR")?vt({},R.FORBID_ATTR,qt):{},ii=Xe(R,"USE_PROFILES")?R.USE_PROFILES:!1,ht=R.ALLOW_ARIA_ATTR!==!1,W=R.ALLOW_DATA_ATTR!==!1,j=R.ALLOW_UNKNOWN_PROTOCOLS||!1,J=R.ALLOW_SELF_CLOSE_IN_ATTR!==!1,A=R.SAFE_FOR_TEMPLATES||!1,G=R.SAFE_FOR_XML!==!1,V=R.WHOLE_DOCUMENT||!1,st=R.RETURN_DOM||!1,_t=R.RETURN_DOM_FRAGMENT||!1,Ne=R.RETURN_TRUSTED_TYPE||!1,Ut=R.FORCE_BODY||!1,Oe=R.SANITIZE_DOM!==!1,bs=R.SANITIZE_NAMED_PROPS||!1,mr=R.KEEP_CONTENT!==!1,je=R.IN_PLACE||!1,tt=R.ALLOWED_URI_REGEXP||Lm,ai=R.NAMESPACE||Rn,yo=R.MATHML_TEXT_INTEGRATION_POINTS||yo,Eo=R.HTML_INTEGRATION_POINTS||Eo,et=R.CUSTOM_ELEMENT_HANDLING||{},R.CUSTOM_ELEMENT_HANDLING&&Iv(R.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(et.tagNameCheck=R.CUSTOM_ELEMENT_HANDLING.tagNameCheck),R.CUSTOM_ELEMENT_HANDLING&&Iv(R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(et.attributeNameCheck=R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),R.CUSTOM_ELEMENT_HANDLING&&typeof R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),A&&(W=!1),_t&&(st=!0),ii&&(X=vt({},Cm),Q=[],ii.html===!0&&(vt(X,Mm),vt(Q,Am)),ii.svg===!0&&(vt(X,uu),vt(Q,fu),vt(Q,so)),ii.svgFilters===!0&&(vt(X,hu),vt(Q,fu),vt(Q,so)),ii.mathMl===!0&&(vt(X,du),vt(Q,Dm),vt(Q,so))),R.ADD_TAGS&&(X===Y&&(X=fr(X)),vt(X,R.ADD_TAGS,qt)),R.ADD_ATTR&&(Q===ut&&(Q=fr(Q)),vt(Q,R.ADD_ATTR,qt)),R.ADD_URI_SAFE_ATTR&&vt(Du,R.ADD_URI_SAFE_ATTR,qt),R.FORBID_CONTENTS&&(si===Av&&(si=fr(si)),vt(si,R.FORBID_CONTENTS,qt)),mr&&(X["#text"]=!0),V&&vt(X,["html","head","body"]),X.table&&(vt(X,["tbody"]),delete K.tbody),R.TRUSTED_TYPES_POLICY){if(typeof R.TRUSTED_TYPES_POLICY.createHTML!="function")throw ps('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof R.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ps('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=R.TRUSTED_TYPES_POLICY,x=b.createHTML("")}else b===void 0&&(b=JI(f,i)),b!==null&&typeof x=="string"&&(x=b.createHTML(""));se&&se(R),oi=R}},kv=vt({},[...uu,...hu,...GI]),Pv=vt({},[...du,...VI]),j$=function(R){let Z=E(R);(!Z||!Z.tagName)&&(Z={namespaceURI:ai,tagName:"template"});const it=io(R.tagName),kt=io(Z.tagName);return Ru[R.namespaceURI]?R.namespaceURI===vo?Z.namespaceURI===Rn?it==="svg":Z.namespaceURI===mo?it==="svg"&&(kt==="annotation-xml"||yo[kt]):!!kv[it]:R.namespaceURI===mo?Z.namespaceURI===Rn?it==="math":Z.namespaceURI===vo?it==="math"&&Eo[kt]:!!Pv[it]:R.namespaceURI===Rn?Z.namespaceURI===vo&&!Eo[kt]||Z.namespaceURI===mo&&!yo[kt]?!1:!Pv[it]&&(Y$[it]||!kv[it]):!!(_s==="application/xhtml+xml"&&Ru[R.namespaceURI]):!1},un=function(R){ds(t.removed,{element:R});try{E(R).removeChild(R)}catch{m(R)}},xo=function(R,Z){try{ds(t.removed,{attribute:Z.getAttributeNode(R),from:Z})}catch{ds(t.removed,{attribute:null,from:Z})}if(Z.removeAttribute(R),R==="is")if(st||_t)try{un(Z)}catch{}else try{Z.setAttribute(R,"")}catch{}},Nv=function(R){let Z=null,it=null;if(Ut)R="<remove></remove>"+R;else{const jt=wm(R,/^[\r\n\t ]+/);it=jt&&jt[0]}_s==="application/xhtml+xml"&&ai===Rn&&(R='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+R+"</body></html>");const kt=b?b.createHTML(R):R;if(ai===Rn)try{Z=new h().parseFromString(kt,_s)}catch{}if(!Z||!Z.documentElement){Z=_.createDocument(ai,"template",null);try{Z.documentElement.innerHTML=Lu?x:kt}catch{}}const ne=Z.body||Z.documentElement;return R&&it&&ne.insertBefore(n.createTextNode(it),ne.childNodes[0]||null),ai===Rn?B.call(Z,V?"html":"body")[0]:V?Z.documentElement:ne},$v=function(R){return C.call(R.ownerDocument||R,R,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ku=function(R){return R instanceof d&&(typeof R.nodeName!="string"||typeof R.textContent!="string"||typeof R.removeChild!="function"||!(R.attributes instanceof u)||typeof R.removeAttribute!="function"||typeof R.setAttribute!="function"||typeof R.namespaceURI!="string"||typeof R.insertBefore!="function"||typeof R.hasChildNodes!="function")},Fv=function(R){return typeof o=="function"&&R instanceof o};function In(ot,R,Z){ro(ot,it=>{it.call(t,R,Z,oi)})}const Uv=function(R){let Z=null;if(In(w.beforeSanitizeElements,R,null),ku(R))return un(R),!0;const it=qt(R.nodeName);if(In(w.uponSanitizeElement,R,{tagName:it,allowedTags:X}),R.hasChildNodes()&&!Fv(R.firstElementChild)&&ae(/<[/\w!]/g,R.innerHTML)&&ae(/<[/\w!]/g,R.textContent)||R.nodeType===ms.progressingInstruction||G&&R.nodeType===ms.comment&&ae(/<[/\w]/g,R.data))return un(R),!0;if(!X[it]||K[it]){if(!K[it]&&Hv(it)&&(et.tagNameCheck instanceof RegExp&&ae(et.tagNameCheck,it)||et.tagNameCheck instanceof Function&&et.tagNameCheck(it)))return!1;if(mr&&!si[it]){const kt=E(R)||R.parentNode,ne=S(R)||R.childNodes;if(ne&&kt){const jt=ne.length;for(let ve=jt-1;ve>=0;--ve){const hn=g(ne[ve],!0);hn.__removalCount=(R.__removalCount||0)+1,kt.insertBefore(hn,v(R))}}}return un(R),!0}return R instanceof l&&!j$(R)||(it==="noscript"||it==="noembed"||it==="noframes")&&ae(/<\/no(script|embed|frames)/i,R.innerHTML)?(un(R),!0):(A&&R.nodeType===ms.text&&(Z=R.textContent,ro([H,N,M],kt=>{Z=fs(Z,kt," ")}),R.textContent!==Z&&(ds(t.removed,{element:R.cloneNode()}),R.textContent=Z)),In(w.afterSanitizeElements,R,null),!1)},Bv=function(R,Z,it){if(Oe&&(Z==="id"||Z==="name")&&(it in n||it in Z$))return!1;if(!(W&&!nt[Z]&&ae(O,Z))){if(!(ht&&ae($,Z))){if(!Q[Z]||nt[Z]){if(!(Hv(R)&&(et.tagNameCheck instanceof RegExp&&ae(et.tagNameCheck,R)||et.tagNameCheck instanceof Function&&et.tagNameCheck(R))&&(et.attributeNameCheck instanceof RegExp&&ae(et.attributeNameCheck,Z)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(Z))||Z==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&ae(et.tagNameCheck,it)||et.tagNameCheck instanceof Function&&et.tagNameCheck(it))))return!1}else if(!Du[Z]){if(!ae(tt,fs(it,L,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&R!=="script"&&FI(it,"data:")===0&&Dv[R])){if(!(j&&!ae(F,fs(it,L,"")))){if(it)return!1}}}}}}return!0},Hv=function(R){return R!=="annotation-xml"&&wm(R,U)},Gv=function(R){In(w.beforeSanitizeAttributes,R,null);const{attributes:Z}=R;if(!Z||ku(R))return;const it={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let kt=Z.length;for(;kt--;){const ne=Z[kt],{name:jt,namespaceURI:ve,value:hn}=ne,Ts=qt(jt);let ue=jt==="value"?hn:UI(hn);if(it.attrName=Ts,it.attrValue=ue,it.keepAttr=!0,it.forceKeepAttr=void 0,In(w.uponSanitizeAttribute,R,it),ue=it.attrValue,bs&&(Ts==="id"||Ts==="name")&&(xo(jt,R),ue=Ss+ue),G&&ae(/((--!?|])>)|<\/(style|title)/i,ue)){xo(jt,R);continue}if(it.forceKeepAttr||(xo(jt,R),!it.keepAttr))continue;if(!J&&ae(/\/>/i,ue)){xo(jt,R);continue}A&&ro([H,N,M],zv=>{ue=fs(ue,zv," ")});const Vv=qt(R.nodeName);if(Bv(Vv,Ts,ue)){if(b&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!ve)switch(f.getAttributeType(Vv,Ts)){case"TrustedHTML":{ue=b.createHTML(ue);break}case"TrustedScriptURL":{ue=b.createScriptURL(ue);break}}try{ve?R.setAttributeNS(ve,jt,ue):R.setAttribute(jt,ue),ku(R)?un(R):Om(t.removed)}catch{}}}In(w.afterSanitizeAttributes,R,null)},K$=function ot(R){let Z=null;const it=$v(R);for(In(w.beforeSanitizeShadowDOM,R,null);Z=it.nextNode();)In(w.uponSanitizeShadowNode,Z,null),Uv(Z),Gv(Z),Z.content instanceof s&&ot(Z.content);In(w.afterSanitizeShadowDOM,R,null)};return t.sanitize=function(ot){let R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,it=null,kt=null,ne=null;if(Lu=!ot,Lu&&(ot="<!-->"),typeof ot!="string"&&!Fv(ot))if(typeof ot.toString=="function"){if(ot=ot.toString(),typeof ot!="string")throw ps("dirty is not a string, aborting")}else throw ps("toString is not a function");if(!t.isSupported)return ot;if(xt||Iu(R),t.removed=[],typeof ot=="string"&&(je=!1),je){if(ot.nodeName){const hn=qt(ot.nodeName);if(!X[hn]||K[hn])throw ps("root node is forbidden and cannot be sanitized in-place")}}else if(ot instanceof o)Z=Nv("<!---->"),it=Z.ownerDocument.importNode(ot,!0),it.nodeType===ms.element&&it.nodeName==="BODY"||it.nodeName==="HTML"?Z=it:Z.appendChild(it);else{if(!st&&!A&&!V&&ot.indexOf("<")===-1)return b&&Ne?b.createHTML(ot):ot;if(Z=Nv(ot),!Z)return st?null:Ne?x:""}Z&&Ut&&un(Z.firstChild);const jt=$v(je?ot:Z);for(;kt=jt.nextNode();)Uv(kt),Gv(kt),kt.content instanceof s&&K$(kt.content);if(je)return ot;if(st){if(_t)for(ne=D.call(Z.ownerDocument);Z.firstChild;)ne.appendChild(Z.firstChild);else ne=Z;return(Q.shadowroot||Q.shadowrootmode)&&(ne=P.call(r,ne,!0)),ne}let ve=V?Z.outerHTML:Z.innerHTML;return V&&X["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&ae(Rm,Z.ownerDocument.doctype.name)&&(ve="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
4
4
  `+ve),A&&ro([H,N,M],hn=>{ve=fs(ve,hn," ")}),b&&Ne?b.createHTML(ve):ve},t.setConfig=function(){let ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Iu(ot),xt=!0},t.clearConfig=function(){oi=null,xt=!1},t.isValidAttribute=function(ot,R,Z){oi||Iu({});const it=qt(ot),kt=qt(R);return Bv(it,kt,Z)},t.addHook=function(ot,R){typeof R=="function"&&ds(w[ot],R)},t.removeHook=function(ot,R){if(R!==void 0){const Z=NI(w[ot],R);return Z===-1?void 0:$I(w[ot],Z,1)[0]}return Om(w[ot])},t.removeHooks=function(ot){w[ot]=[]},t.removeAllHooks=function(){w=km()},t}var pu=Pm();const ao=e=>pu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),tk=e=>pu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),ln=e=>pu.sanitize(e,{ALLOWED_TAGS:[]}),po=class po extends mt{constructor(){super(...arguments),this.type="toolbar",this.renderType=at.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(T.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(T.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer({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:i,overflowMenuItemList:s}=this.getControlConfigs();s&&i.push(this.getOverflowButtonConfig());const a=n.selectAll("div.toolbar-control").data(i,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=>`
@@ -49,7 +49,7 @@
49
49
  <div class="${fe}--${s}-modal-footer-spacer"></div>
50
50
  <button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${i}</button>
51
51
  </div>
52
- </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=I(this.services.domUtils.getHolder()),i=y(n,"style","prefix");this.modal=k.appendOrSelect(r,`div.${fe}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class vs extends mt{constructor(){super(...arguments),this.type="title",this.renderType=at.HTML}render(t=!1){const n=this.getComponentContainer(),r=y(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>ln(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(T.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=k.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(T.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(T.Tooltip.HIDE)})}}getMaxTitleWidth(){return k.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}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 gu extends mt{constructor(){super(...arguments),this.type="legend",this.renderType=at.HTML}render(t=!1){const n=this.getOptions(),r=y(n,"legend"),i=y(r,"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(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Gt.CENTER).classed("right-aligned",i===Gt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ft.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,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("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((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Pt.area;if(n.type===zt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}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-${r}`,!0).attr("role",ft.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===zt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ft.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?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"),r=y(n,"type"),i=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")}),r!==Re.NONE?a.html(function(o){const l=ln(o.name);return l.length>i&&l.length!==s?as(l,r,s):l}):a.html(o=>ln(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=y(r,"legend"),s=y(i,"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!==Re.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!==Re.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!==Re.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 Nm extends mt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=at.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=k.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class ek extends Nm{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=k.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var ti,Bt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Bt||(Bt={}));var $m=(ti={},ti[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)}},ti[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)}},ti[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)}},ti[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)}},ti),Fm=typeof window<"u"?window:{innerHeight:0,innerWidth:0},lo=function(){function e(t){t===void 0&&(t={}),this.positions=$m,this.positions=Object.assign({},$m,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,f=i();u.top<f.top?d=f.top-u.top:u.bottom>f.height&&(d=u.bottom-f.height),u.left<f.left?h=f.left-u.left:u.right>f.width&&(h=u.right-f.width),d&&!h?h=1:h&&!d&&(d=1);var p=n.offsetHeight*n.offsetWidth,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,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Fm.innerHeight,width:Fm.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new lo;class mu extends mt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=at.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new lo,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items,a=I(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${ao(i.detail.content)}</p></div>`:o=ao(this.getTooltipHTML(l));const c=k.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${ao(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${ao(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(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(T.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==T.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(T.Tooltip.MOVE,null),this.services.events.removeEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=y(n,"tooltip","truncation","type"),i=y(n,"tooltip","truncation","threshold"),s=y(n,"tooltip","truncation","numCharacter");return r!==Re.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>i&&(a.label=as(a.label,r,s)),a.value&&a.value.length>i&&(a.value=as(a.value,r,s)),a}):t.map(a=>(a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
52
+ </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=I(this.services.domUtils.getHolder()),i=y(n,"style","prefix");this.modal=k.appendOrSelect(r,`div.${fe}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class vs extends mt{constructor(){super(...arguments),this.type="title",this.renderType=at.HTML}render(t=!1){const n=this.getComponentContainer(),r=y(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>ln(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(T.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=k.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(T.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(T.Tooltip.HIDE)})}}getMaxTitleWidth(){return k.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}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 gu extends mt{constructor(){super(...arguments),this.type="legend",this.renderType=at.HTML}render(t=!1){const n=this.getOptions(),r=y(n,"legend"),i=y(r,"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(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Gt.CENTER).classed("right-aligned",i===Gt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ft.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,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("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((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Pt.area;if(n.type===zt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}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-${r}`,!0).attr("role",ft.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===zt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ft.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?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"),r=y(n,"type"),i=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")}),r!==Re.NONE?a.html(function(o){const l=ln(o.name);return l.length>i&&l.length!==s?as(l,r,s):l}):a.html(o=>ln(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=y(r,"legend"),s=y(i,"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!==Re.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!==Re.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!==Re.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 Nm extends mt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=at.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=k.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class ek extends Nm{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=k.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=k.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=k.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var ti,Bt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Bt||(Bt={}));var $m=(ti={},ti[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)}},ti[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)}},ti[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)}},ti[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)}},ti),Fm=typeof window<"u"?window:{innerHeight:0,innerWidth:0},lo=function(){function e(t){t===void 0&&(t={}),this.positions=$m,this.positions=Object.assign({},$m,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),d=0,h=0,f=i();u.top<f.top?d=f.top-u.top:u.bottom>f.height&&(d=u.bottom-f.height),u.left<f.left?h=f.left-u.left:u.right>f.width&&(h=u.right-f.width),d&&!h?h=1:h&&!d&&(d=1);var p=n.offsetHeight*n.offsetWidth,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,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Fm.innerHeight,width:Fm.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new lo;class mu extends mt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=at.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",this.positionService=new lo,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items,a=I(i.detail.event.target).datum();let o;const l=this.formatItems(this.getItems(i));i.detail.content?o=`<div class="title-tooltip"><p>${ao(i.detail.content)}</p></div>`:o=ao(this.getTooltipHTML(l));const c=k.appendOrSelect(this.tooltip,"div.content-box");if(y(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const u=`<div class="title-tooltip"><p>${ao(i.detail.content)}</p></div>`;c.html(u)}else c.html(`<div class="title-tooltip"><p>${ao(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(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1),this.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(T.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==T.Toolbar.SHOW_TOOLTIP&&this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.addEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(T.Tooltip.MOVE,null),this.services.events.removeEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip),this.services.events.removeEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=y(n,"tooltip","truncation","type"),i=y(n,"tooltip","truncation","threshold"),s=y(n,"tooltip","truncation","numCharacter");return r!==Re.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>i&&(a.label=as(a.label,r,s)),a.value&&a.value.length>i&&(a.value=as(a.value,r,s)),a}):t.map(a=>(a.value=this.valueFormatter(a.value,a.label),a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
53
53
  <div class="datapoint-tooltip${n.bold?" bold":""}">
54
54
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
55
55
  <div class="label">
@@ -62,7 +62,7 @@
62
62
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
63
63
  <polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
64
64
  <rect width="32" height="32"/>
65
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Mk extends Ze{constructor(t,n){super(t,n),this.model=new ak(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new wk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri extends mt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=at.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(i,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===rt.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=x=>{const _=x[1]-x[0];let C="0,"+_.toString();const D=Math.floor(l/ri.DASH_LENGTH),B=D*ri.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+ri.DASH_LENGTH;C+=","+(l-B),D%2===1&&(C+=",0"),C+=","+_.toString(),C+=","+l.toString(),f.attr("stroke-dasharray",C)},m=x=>{const _=x.selection;_===null||_[0]===_[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(_))},v=(x,_)=>{const C=vf().range([0,o]).domain(p);let D=[C.invert(x),C.invert(_)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let S;const E=x=>{const _=x.selection;_!==null&&(v(_[0],_[1]),s.call(S.move,null),f.style("display","none"))};l!=0&&o!=0&&(S=$h().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();i.on("click",function(x){if(x.shiftKey){const _=this.services.domUtils.getHolder(),C=zn(s.node(),_)[0];let D=C-o*b/2;D<0&&(D=0);let B=C+o*b/2;B>o&&(B=o),v(D,B)}})}}};ri.DASH_LENGTH=4;let Su=ri;class Ck extends mt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=at.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=$h(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=Se.height[s],{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Se.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ye.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ye.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===rt.TIME){let m=this.services.zoom.getZoomBarData();if(We(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const S=this.model.get("initialZoomDomain"),E=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(S&&S[0].valueOf()===E[0].valueOf()&&S[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:ct([],E),zoomDomain:E?ct([],E):v},{skipUpdate:!0}):E===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ct([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Fe(m,_=>_.value));const b=this.model.get("zoomDomain");if(s===Ye.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const _=a.highlightStartMapsTo,C=a.highlightEndMapsTo,D=a.color,B=a.labelMapsTo;a.data.forEach((P,w)=>{k.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(P[_])).attr("width",this.xScale(P[C])-this.xScale(P[_])).style("fill",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(b,c,l);const x=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(b!==void 0)if(b[0].valueOf()===b[1].valueOf())x.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const _=b.map(C=>this.xScale(C));_[1]-_[0]<this.MIN_SELECTION_DIFF||(x.call(this.brush.move,_),this.updateBrushHandle(this.getComponentContainer(),_))}i&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=T.ZoomBar.SELECTION_START:t.type==="brush"?a=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Se.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=-5/2,l=Se.handleBarWidth,c=s===Ye.GRAPH_VIEW?Se.handleBarHeight:6,u=-1/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ye.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),r=Se.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,S,E)=>b=>s.getValueFromScale(v,S,E,b),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=y(this.getOptions(),"zoomBar",z.TOP,"type"),p=Se.height[f],g=Yl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=k.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=Tn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=Bi()([[n,a],[r,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Ye.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class Ak extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=at.SVG,this.positionService=new lo}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&r.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,m=null;h===z.LEFT||h===z.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===rt.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),D=N=>_.getDomainValue(N),B=N=>_.getRangeValue(N),[P,w]=Cn(D,B,C),H=I(this);h===z.TOP||h===z.BOTTOM?(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",b).attr("x1",({datum:N})=>P(N)+(v?f.step()/2:0)).attr("x2",({datum:N})=>P(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:N})=>-P(N)).attr("width",Math.abs(b-x)).classed("rotate",!0)):(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("x1",S).attr("x2",E).attr("y1",({datum:N})=>w(N)+(v?f.step()/2:0)).attr("y2",({datum:N})=>w(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:N})=>w(N)).attr("width",Math.abs(E-S)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===rt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),f=nu(d.ticks(),y(h,"timeInterval"));return eu(n,0,d.ticks(),f,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${fe}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=zn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:I(this),datum:I(this).datum()})})}}class Dk extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=at.SVG,this.positionService=new lo,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&r.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,m]=f.range(),[v,S]=p.range(),{cartesianScales:E}=d.services,b=E.getOrientation(),x=P=>E.getDomainValue(P),_=P=>E.getRangeValue(P),[C,D]=Cn(x,_,b),B=I(this);h===z.TOP||h===z.BOTTOM?B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("y",Math.max(S+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:P,...w})=>C(w[P])).attr("width",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(C(H[w])-C(H[P]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null):B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:P,...w})=>D(w[P])).attr("height",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(D(H[P])-D(H[w]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null)})}}class qm extends mu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:yt(r,"locale.translations.group")||yt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function Es(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Lk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t);return r.getFullYear()-i.getFullYear()}function Rk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Es(r,i),a=Math.abs(Lk(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Es(r,i)===-s,l=s*(a-+o);return l===0?0:l}function _u(e,t,n){const r=$t(e,n==null?void 0:n.in);if(isNaN(t))return ke(e,NaN);if(!t)return r;const i=r.getDate(),s=ke(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function Xm(e,t,n){return _u(e,t*12,n)}function Ik(e,t,n){return Xm(e,-t,n)}function kk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function Pk(e,t){const n=$t(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Nk(e,t){const n=$t(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function $k(e,t){const n=$t(e,t==null?void 0:t.in);return+Pk(n,t)==+Nk(n,t)}function Fk(e,t,n){const[r,i,s]=ur(n==null?void 0:n.in,e,e,t),a=Es(i,s),o=Math.abs(kk(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Es(i,s)===-a;$k(r)&&o===1&&Es(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function Uk(e,t,n){return _u(e,-t,n)}function Bk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Zm(r,i),a=Math.abs(Kg(r,i));r.setDate(r.getDate()-s*a);const o=+(Zm(r,i)===-s),l=s*(a-o);return l===0?0:l}function Zm(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function jm(e,t,n){const r=$t(e,n==null?void 0:n.in);return isNaN(t)?ke(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Hk(e,t,n){return jm(e,-t,n)}function Tu(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=(+r-+i)/Fg;return Tu(n==null?void 0:n.roundingMethod)(s)}function Km(e,t,n){return ke(e,+$t(e)+t)}function Qm(e,t,n){return Km(e,t*Fg)}function Vk(e,t,n){return Qm(e,-t)}function Jm(e,t){return+$t(e)-+$t(t)}function tv(e,t,n){const r=Jm(e,t)/$g;return Tu(n==null?void 0:n.roundingMethod)(r)}function Ou(e,t,n){const r=$t(e,n==null?void 0:n.in);return r.setTime(r.getTime()+t*$g),r}function ev(e,t,n){return Ou(e,-t,n)}function nv(e,t,n){const r=Jm(e,t)/1e3;return Tu(n==null?void 0:n.roundingMethod)(r)}function wu(e,t,n){return Km(e,t*1e3)}function rv(e,t,n){return wu(e,-t)}class zk extends Dn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const r=this.getAxisOptions(t).title;return r||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(n=>z[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=y(t,"axes");((r=n[z.LEFT])!=null&&r.correspondingDatasets&&n[z.RIGHT]||(i=n[z.RIGHT])!=null&&i.correspondingDatasets&&n[z.LEFT]||(s=n[z.TOP])!=null&&s.correspondingDatasets&&n[z.BOTTOM]||(a=n[z.BOTTOM])!=null&&a.correspondingDatasets&&n[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===rt.LINEAR||this.scaleTypes[t]===rt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=y(i,l)!==null?i[l]:i;let u;switch(n){case rt.LABELS:u=t(c)+t.step()/2;break;case rt.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===rt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return Wk(n,s)}else return Yk(n,$n.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||rt.LINEAR,o=s.scaleType||rt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===rt.LABELS||o===rt.TIME)&&a===rt.LABELS||a===rt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||rt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Vn(v,S=>S.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),S=this.model.getStackKeys({bins:v});return[S[0].split(":")[0],S[S.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=$n.ratio;if(r.domain)return a===rt.LABELS?r.domain:(a===rt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===rt.LABELS)return Ji(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===rt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===rt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,S=this.model.getDataValuesGroupedByKeys({groups:m}),E=o.filter(x=>!m.includes(x[v])),b=[];S.forEach(x=>{const{..._}=x;let C=0,D=0;Object.values(eL(_,"sharedStackKey")).forEach(B=>{isNaN(B)||(B<0?D+=B:C+=B)}),b.push([D,C])}),g=[...fc(b),...E.map(x=>x[c])]}else g=[],o.forEach(v=>{const S=v[c];Array.isArray(S)&&S.length===2?(g.push(S[0]),g.push(S[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(S))});return a!==rt.TIME&&a!==rt.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const S=y(v,"value");S!==null&&g.push(S)}),p=Fe(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||rt.LINEAR;this.scaleTypes[t]=i;let s;return i===rt.TIME?s=vf():i===rt.LOG?s=Kd().base(r.base||10):i===rt.LABELS||i===rt.LABELS_RATIO?s=Ii():s=Ge(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Ht.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===rt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function Wk(e,t){const n=new Date(e[0]),r=new Date(e[1]);return Rk(r,n)>1?[Ik(n,t),Xm(r,t)]:Fk(r,n)>1?[Uk(n,t),_u(r,t)]:Bk(r,n)>1?[Hk(n,t),jm(r,t)]:Gk(r,n)>1?[Vk(n,t),Qm(r,t)]:tv(r,n)>30?[ev(n,t*30),Ou(r,t*30)]:tv(r,n)>1?[ev(n,t),Ou(r,t)]:nv(r,n)>15?[rv(n,t*15),wu(r,t*15)]:nv(r,n)>1?[rv(n,t),wu(r,t)]:[n,r]}function Yk([e,t],n,r){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(r===rt.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class qk extends Dn{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:Df,curveBasis:j_,curveBasisClosed:K_,curveBasisOpen:Q_,curveBundle:J_,curveCardinal:tT,curveCardinalClosed:eT,curveCardinalOpen:nT,curveCatmullRom:rT,curveCatmullRomClosed:iT,curveCatmullRomOpen:sT,curveMonotoneX:aT,curveMonotoneY:oT,curveNatural:lT,curveStep:cT,curveStepAfter:hT,curveStepBefore:uT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Xk extends Dn{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===rt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Fe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const o=i.stacked?"sharedStackKey":(a=this.services.cartesianScales)==null?void 0:a.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=r[0]&&new Date(c[o])<=r[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var f;const n=this.model.get("zoomDomain"),r=Se.handleWidth,i=(f=this.services.cartesianScales)==null?void 0:f.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-r/2,d=a-l/2+r/2);const h=[i.invert(u),i.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}class ge extends Ze{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:zk,curves:qk,zoom:Xk}),this.model=new pr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===rt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new le(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new gu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new Nm(this.model,this.services),new Su(this.model,this.services)),t.push(new Ak(this.model,this.services)),t.push(new Dk(this.model,this.services));const g={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Ct.COLUMN;if(m){const _=y(this.model.getOptions(),"legend","position");_===Yr.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.BOTTOM&&(v=Ct.COLUMN_REVERSE)}const S={id:"spacer",components:[new Ln(this.model,this.services)],growth:dt.PREFERRED},E={id:"full-frame",components:[new le(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Ck(this.model,this.services)],growth:dt.PREFERRED,renderType:at.SVG},x=[];if(u||s){x.push(f);const _={id:"spacer",components:[new Ln(this.model,this.services,s?{size:15}:void 0)],growth:dt.PREFERRED};x.push(_)}return l&&x.push(b),x.push(E),[new qm(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,x,{direction:Ct.COLUMN})]}}class Te extends mt{constructor(){super(...arguments),this.type="grid",this.renderType=at.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=Mo(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Hu(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Mn(u).tx)-Number(Mn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Mn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Mn(o).tx;else if(o)l=+Mn(o).tx-+Mn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Mn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=Mn(this),o={min:Number(a.tx)-r,max:Number(a.tx)+r};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class iv extends mt{constructor(){super(...arguments),this.type="area",this.renderType=at.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",On.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Yl().curve(this.services.curves.getD3Curve()).defined(x=>{const _=s.getRangeIdentifier(),C=x[_];return C!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(x,_)=>{y(r,"axes",x,"includeZero")===!1&&_[0]>0&&_[1]>0&&(d=_[0])},f=x=>u?s.getBoundedScaledValues(x)[0]:s.getRangeValue(d),p=x=>u?s.getBoundedScaledValues(x)[1]:s.getRangeValue(x);a===Ht.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,x=>x.name),S=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const x=S.select(`path.${this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:l[0].name})}`).node();let _;if(x)_=getComputedStyle(x,null).getPropertyValue("stroke");else{const C=y(this.model.getOptions(),"color","scale");if(C!==null){const D=Object.keys(C);_=C[D[0]]}}ys.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:ys.getStops(i,_)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,b=v.enter().append("path");m?b.merge(v).style("fill",x=>`url(#${this.services.domUtils.generateElementIDString(`${x.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:x.name,originalClassName:"area"})).attr("d",x=>{const{data:_}=x;return o(_)}):(b.attr("opacity",0).merge(v).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:x.name,originalClassName:"area"})).style("fill",x=>E.model.getFillColor(x.name,null,x.data)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"area-update-enter",animate:t})).attr("opacity",u?1:On.opacity.selected).attr("d",x=>{const{data:_}=x;return o(_)}),u&&b.attr("fill-opacity",On.opacity.selected).style("stroke",x=>E.model.getStrokeColor(x.name,null,x.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ei extends mt{constructor(){super(...arguments),this.type="line",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?wn.opacity.unselected:wn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",wn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=Cn(s,a,r.getOrientation()),c=this.getOptions(),u=Bi().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),m=p[g];return m!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const S=this.services.cartesianScales.getDomainIdentifier(v),E=this.services.cartesianScales.getRangeIdentifier(v);return{name:y(v,0,g),data:v.map(b=>({[S]:b.data.sharedStackKey,[g]:b[g],[E]:b[1]})),hidden:!rL(v,b=>b[0]!==b[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(m=>{const v=this.services.cartesianScales.getRangeIdentifier(m);return m[v]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:g}=p;return u(g)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const sv=5;function Zk(e,t){return e>t-sv&&e<t+sv}class Bn extends mt{constructor(){super(...arguments),this.type="ruler",this.renderType=at.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?r:n,d=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>Zk(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const S=m[0].domainValue,E=Math.abs(u-v.domainValue),b=Math.abs(u-S);return E>b||(E<b?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(b=>b.originalData).filter(b=>{const x=this.services.cartesianScales.getRangeIdentifier(b),_=b[x];return _!=null}),v=g.map(b=>b.domainValue),S=f.filter(b=>{const x=this.services.cartesianScales.getDomainValue(b);return v.includes(x)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=zn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=uL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class cn extends mt{constructor(){super(...arguments),this.type="scatter",this.renderType=at.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.selectAll("circle.dot").data(this.getScatterData(),d=>`${d[s]}-${d[o]}`);l.exit().attr("opacity",0).remove();const u=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(u,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=Cn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Cn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Cn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[lt.FILL,lt.STROKE]:[lt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,i))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",i?s:1).attr("opacity",h?0:1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var a,o;const s=I(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[n],originalClassName:s.attr("class")})).style("fill",l=>{var u;const c=(u=t.services.cartesianScales)==null?void 0:u.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),(a=t.services.events)==null||a.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=I(this);(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=I(this);if(s.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);s.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}destroy(){var n;(n=this.parent)==null||n.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class av extends mt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=at.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===rt.LABELS||this.scaleType===rt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Hu;break;case z.BOTTOM:h=Mo;break;case z.RIGHT:h=y0;break;case z.TOP:h=v0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(r,"axes",n),v=this.scaleType===rt.TIME||m.scaleType===rt.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!i){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(r,"data","loading"),_=y(m,"ticks","number"),C=y(m,"ticks","values"),D=y(m,"truncation","type"),B=y(m,"truncation","threshold"),P=y(m,"truncation","numCharacter"),w=_!==null,H=y(r,"timeScale"),N=k.appendOrSelect(g,"g.tick"),M=k.appendOrSelect(N,"text").text("0"),O=k.getSVGElementSize(M.node(),{useBBox:!0}).height;N.remove();const $=this.scaleType||m.scaleType||rt.LINEAR,F=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=_:(K=$n.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,$n.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),F.ticks(K),v)if(!d.ticks(K).length)F.tickValues([]);else{const nt=y(r,"timeScale","addSpaceOnEdges"),ht=y(r,"axes",n,"domain"),W=d.copy();nt&&!ht&&W.nice(K);const j=W.ticks(K);nt&&j.length>2&&!ht&&(j.splice(j.length-1,1),j.splice(0,1)),F.tickValues(j)}}let L;const U=y(m,"ticks","formatter"),{code:tt,number:X}=y(r,"locale");if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval"));U===null?L=(nt,ht)=>eu(nt,ht,F.tickValues(),K,H,r.locale):L=(nt,ht)=>{const W=eu(nt,ht,F.tickValues(),K,H,r.locale);return U(nt,ht,W)}}else U===null?$===rt.LINEAR&&(L=K=>X(K,tt)):L=U;F.tickFormat(L);const[Y,Q]=this.services.cartesianScales.getScaleByPosition(n).domain();let ut;if(C){if(v)C.forEach((K,nt)=>{K.getTime===void 0&&(C[nt]=new Date(K))}),ut=C.filter(K=>{const nt=K.getTime();return nt>=new Date(Y).getTime()&&nt<=new Date(Q).getTime()});else if(b===rt.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();ut=C.filter(nt=>K.includes(nt))}else ut=C.filter(K=>K>=Y&&K<=Q);F.tickValues(ut)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(m.title){const K=k.appendOrSelect(l,"text.axis-title").html(et||x?"":ln(m.title)),nt=y(m,"titleOrientation");let ht;switch(n){case z.LEFT:nt===qa.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:nt===qa.LEFT?K.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ht=k.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval")),nt=H.showDayName,ht=p;t&&(p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),p=p.call(F),ht.selectAll(".tick").data(F.tickValues(),d).order().select("text").attr("class",(j,J)=>am(j,J,F.tickValues(),K,nt)?"tick-label--primary":"tick-label")}else!t||!f?p=p.call(F):p=p.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(F);if(g.call(F),n===z.BOTTOM||n===z.TOP){let K=!1;const nt=y(m,"ticks","rotation");if(nt===ns.ALWAYS)K=!0;else if(nt===ns.NEVER)K=!1;else if(!nt||nt===ns.AUTO)if(d.step)K=g.selectAll("g.tick text").nodes().some(W=>k.getSVGElementSize(W,{useBBox:!0}).width>=d.step());else{K=!1;const ht=g.append("text").text("A"),W=k.getSVGElementSize(ht.node(),{useBBox:!0}).width;let j;g.selectAll("g.tick").each(function(){const J=I(this),A=parseFloat(y(Mn(this),"tx"));A!==null&&j+J.text().length*W*.8>=A&&(K=!0),j=A}),ht.remove()}K?(w||(F.ticks(this.getNumberOfFittingTicks(a,O,$n.ticks.horizontalSpaceRatio)),g.call(F),p.call(F)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(x?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",K=>K),g.selectAll("g.tick").attr("aria-label",K=>K),D!==Re.NONE&&b===rt.LABELS&&!C){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const ht=this;l.selectAll("g.tick text").data(K).text(function(W){return W.length>B?(ht.truncation[n]=!0,as(W,D,P)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>B?as(W,D,P):W}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===rt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return Up(i,2,$n.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class jk extends av{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=k.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-$n.hover.rectanglePadding).attr("y",p).attr("width",u+$n.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===rt.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===rt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends mt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=at.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(o=>{i[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===is.DEFAULT?new av(this.model,this.services,c):new jk(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=k.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=k.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===z.LEFT||c===z.RIGHT)&&(f+=5)),c){case z.TOP:s.top=h+f;break;case z.BOTTOM:s.bottom=h+f;break;case z.LEFT:s.left=d+f;break;case z.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class ce extends mt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Vt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Vt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Vt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Vt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Ge().domain([0,1]).range(t),this.yScale=Ge().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=k.getSVGElementSize(i,{useAttrs:!0}),o=k.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ui().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Lt.xOffset;c===Gt.CENTER?p=s/2:c===Gt.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=k.appendOrSelect(o,"defs").lower(),h=k.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
65
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Mk extends Ze{constructor(t,n){super(t,n),this.model=new ak(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new wk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri extends mt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=at.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(i,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===rt.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=x=>{const _=x[1]-x[0];let C="0,"+_.toString();const D=Math.floor(l/ri.DASH_LENGTH),B=D*ri.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+ri.DASH_LENGTH;C+=","+(l-B),D%2===1&&(C+=",0"),C+=","+_.toString(),C+=","+l.toString(),f.attr("stroke-dasharray",C)},m=x=>{const _=x.selection;_===null||_[0]===_[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(_))},v=(x,_)=>{const C=vf().range([0,o]).domain(p);let D=[C.invert(x),C.invert(_)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let S;const E=x=>{const _=x.selection;_!==null&&(v(_[0],_[1]),s.call(S.move,null),f.style("display","none"))};l!=0&&o!=0&&(S=$h().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();i.on("click",function(x){if(x.shiftKey){const _=this.services.domUtils.getHolder(),C=zn(s.node(),_)[0];let D=C-o*b/2;D<0&&(D=0);let B=C+o*b/2;B>o&&(B=o),v(D,B)}})}}};ri.DASH_LENGTH=4;let Su=ri;class Ck extends mt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=at.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=$h(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=Se.height[s],{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Se.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ye.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ye.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===rt.TIME){let m=this.services.zoom.getZoomBarData();if(We(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const S=this.model.get("initialZoomDomain"),E=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(S&&S[0].valueOf()===E[0].valueOf()&&S[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:ct([],E),zoomDomain:E?ct([],E):v},{skipUpdate:!0}):E===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ct([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Fe(m,_=>_.value));const b=this.model.get("zoomDomain");if(s===Ye.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const _=a.highlightStartMapsTo,C=a.highlightEndMapsTo,D=a.color,B=a.labelMapsTo;a.data.forEach((P,w)=>{k.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(P[_])).attr("width",this.xScale(P[C])-this.xScale(P[_])).style("fill",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(b,c,l);const x=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(b!==void 0)if(b[0].valueOf()===b[1].valueOf())x.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const _=b.map(C=>this.xScale(C));_[1]-_[0]<this.MIN_SELECTION_DIFF||(x.call(this.brush.move,_),this.updateBrushHandle(this.getComponentContainer(),_))}i&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=T.ZoomBar.SELECTION_START:t.type==="brush"?a=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Se.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=-5/2,l=Se.handleBarWidth,c=s===Ye.GRAPH_VIEW?Se.handleBarHeight:6,u=-1/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ye.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),r=Se.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,S,E)=>b=>s.getValueFromScale(v,S,E,b),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=y(this.getOptions(),"zoomBar",z.TOP,"type"),p=Se.height[f],g=Yl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=k.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=Tn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=Bi()([[n,a],[r,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Ye.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class Ak extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=at.SVG,this.positionService=new lo}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&r.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,m=null;h===z.LEFT||h===z.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===rt.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),D=N=>_.getDomainValue(N),B=N=>_.getRangeValue(N),[P,w]=Cn(D,B,C),H=I(this);h===z.TOP||h===z.BOTTOM?(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",b).attr("x1",({datum:N})=>P(N)+(v?f.step()/2:0)).attr("x2",({datum:N})=>P(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:N})=>-P(N)).attr("width",Math.abs(b-x)).classed("rotate",!0)):(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("x1",S).attr("x2",E).attr("y1",({datum:N})=>w(N)+(v?f.step()/2:0)).attr("y2",({datum:N})=>w(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:N})=>w(N)).attr("width",Math.abs(E-S)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===rt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),f=nu(d.ticks(),y(h,"timeInterval"));return eu(n,0,d.ticks(),f,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${fe}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=zn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:I(this),datum:I(this).datum()})})}}class Dk extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=at.SVG,this.positionService=new lo,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&r.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,m]=f.range(),[v,S]=p.range(),{cartesianScales:E}=d.services,b=E.getOrientation(),x=P=>E.getDomainValue(P),_=P=>E.getRangeValue(P),[C,D]=Cn(x,_,b),B=I(this);h===z.TOP||h===z.BOTTOM?B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("y",Math.max(S+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:P,...w})=>C(w[P])).attr("width",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(C(H[w])-C(H[P]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null):B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:P,...w})=>D(w[P])).attr("height",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(D(H[P])-D(H[w]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null)})}}class qm extends mu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:yt(r,"locale.translations.group")||yt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function Es(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Lk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t);return r.getFullYear()-i.getFullYear()}function Rk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Es(r,i),a=Math.abs(Lk(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Es(r,i)===-s,l=s*(a-+o);return l===0?0:l}function _u(e,t,n){const r=$t(e,n==null?void 0:n.in);if(isNaN(t))return ke(e,NaN);if(!t)return r;const i=r.getDate(),s=ke(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function Xm(e,t,n){return _u(e,t*12,n)}function Ik(e,t,n){return Xm(e,-t,n)}function kk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function Pk(e,t){const n=$t(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Nk(e,t){const n=$t(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function $k(e,t){const n=$t(e,t==null?void 0:t.in);return+Pk(n,t)==+Nk(n,t)}function Fk(e,t,n){const[r,i,s]=ur(n==null?void 0:n.in,e,e,t),a=Es(i,s),o=Math.abs(kk(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Es(i,s)===-a;$k(r)&&o===1&&Es(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function Uk(e,t,n){return _u(e,-t,n)}function Bk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Zm(r,i),a=Math.abs(Kg(r,i));r.setDate(r.getDate()-s*a);const o=+(Zm(r,i)===-s),l=s*(a-o);return l===0?0:l}function Zm(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function jm(e,t,n){const r=$t(e,n==null?void 0:n.in);return isNaN(t)?ke(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Hk(e,t,n){return jm(e,-t,n)}function Tu(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=(+r-+i)/Fg;return Tu(n==null?void 0:n.roundingMethod)(s)}function Km(e,t,n){return ke(e,+$t(e)+t)}function Qm(e,t,n){return Km(e,t*Fg)}function Vk(e,t,n){return Qm(e,-t)}function Jm(e,t){return+$t(e)-+$t(t)}function tv(e,t,n){const r=Jm(e,t)/$g;return Tu(n==null?void 0:n.roundingMethod)(r)}function Ou(e,t,n){const r=$t(e,n==null?void 0:n.in);return r.setTime(r.getTime()+t*$g),r}function ev(e,t,n){return Ou(e,-t,n)}function nv(e,t,n){const r=Jm(e,t)/1e3;return Tu(n==null?void 0:n.roundingMethod)(r)}function wu(e,t,n){return Km(e,t*1e3)}function rv(e,t,n){return wu(e,-t)}class zk extends Dn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const r=this.getAxisOptions(t).title;return r||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(n=>z[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=y(t,"axes");((r=n[z.LEFT])!=null&&r.correspondingDatasets&&n[z.RIGHT]||(i=n[z.RIGHT])!=null&&i.correspondingDatasets&&n[z.LEFT]||(s=n[z.TOP])!=null&&s.correspondingDatasets&&n[z.BOTTOM]||(a=n[z.BOTTOM])!=null&&a.correspondingDatasets&&n[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===rt.LINEAR||this.scaleTypes[t]===rt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=y(i,l)!==null?i[l]:i;let u;switch(n){case rt.LABELS:u=t(c)+t.step()/2;break;case rt.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===rt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return Wk(n,s)}else return Yk(n,$n.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||rt.LINEAR,o=s.scaleType||rt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===rt.LABELS||o===rt.TIME)&&a===rt.LABELS||a===rt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||rt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Vn(v,S=>S.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),S=this.model.getStackKeys({bins:v});return[S[0].split(":")[0],S[S.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=$n.ratio;if(r.domain)return a===rt.LABELS?r.domain:(a===rt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===rt.LABELS)return Ji(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===rt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===rt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,S=this.model.getDataValuesGroupedByKeys({groups:m}),E=o.filter(x=>!m.includes(x[v])),b=[];S.forEach(x=>{const{..._}=x;let C=0,D=0;Object.values(eL(_,"sharedStackKey")).forEach(B=>{isNaN(B)||(B<0?D+=B:C+=B)}),b.push([D,C])}),g=[...fc(b),...E.map(x=>x[c])]}else g=[],o.forEach(v=>{const S=v[c];Array.isArray(S)&&S.length===2?(g.push(S[0]),g.push(S[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(S))});return a!==rt.TIME&&a!==rt.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const S=y(v,"value");S!==null&&g.push(S)}),p=Fe(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||rt.LINEAR;this.scaleTypes[t]=i;let s;return i===rt.TIME?s=vf():i===rt.LOG?s=Kd().base(r.base||10):i===rt.LABELS||i===rt.LABELS_RATIO?s=Ii():s=Ge(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Ht.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===rt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function Wk(e,t){const n=new Date(e[0]),r=new Date(e[1]);return Rk(r,n)>1?[Ik(n,t),Xm(r,t)]:Fk(r,n)>1?[Uk(n,t),_u(r,t)]:Bk(r,n)>1?[Hk(n,t),jm(r,t)]:Gk(r,n)>1?[Vk(n,t),Qm(r,t)]:tv(r,n)>30?[ev(n,t*30),Ou(r,t*30)]:tv(r,n)>1?[ev(n,t),Ou(r,t)]:nv(r,n)>15?[rv(n,t*15),wu(r,t*15)]:nv(r,n)>1?[rv(n,t),wu(r,t)]:[n,r]}function Yk([e,t],n,r){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(r===rt.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class qk extends Dn{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:Df,curveBasis:j_,curveBasisClosed:K_,curveBasisOpen:Q_,curveBundle:J_,curveCardinal:tT,curveCardinalClosed:eT,curveCardinalOpen:nT,curveCatmullRom:rT,curveCatmullRomClosed:iT,curveCatmullRomOpen:sT,curveMonotoneX:aT,curveMonotoneY:oT,curveNatural:lT,curveStep:cT,curveStepAfter:hT,curveStepBefore:uT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Xk extends Dn{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===rt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Fe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const o=i.stacked?"sharedStackKey":(a=this.services.cartesianScales)==null?void 0:a.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=r[0]&&new Date(c[o])<=r[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var f;const n=this.model.get("zoomDomain"),r=Se.handleWidth,i=(f=this.services.cartesianScales)==null?void 0:f.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-r/2,d=a-l/2+r/2);const h=[i.invert(u),i.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}class ge extends Ze{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:zk,curves:qk,zoom:Xk}),this.model=new pr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===rt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new le(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new gu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new Nm(this.model,this.services),new Su(this.model,this.services)),t.push(new Ak(this.model,this.services)),t.push(new Dk(this.model,this.services));const g={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Ct.COLUMN;if(m){const _=y(this.model.getOptions(),"legend","position");_===Yr.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.BOTTOM&&(v=Ct.COLUMN_REVERSE)}const S={id:"spacer",components:[new Ln(this.model,this.services)],growth:dt.PREFERRED},E={id:"full-frame",components:[new le(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Ck(this.model,this.services)],growth:dt.PREFERRED,renderType:at.SVG},x=[];if(u||s){x.push(f);const _={id:"spacer",components:[new Ln(this.model,this.services,s?{size:15}:void 0)],growth:dt.PREFERRED};x.push(_)}return l&&x.push(b),x.push(E),[new qm(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,x,{direction:Ct.COLUMN})]}}class Te extends mt{constructor(){super(...arguments),this.type="grid",this.renderType=at.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=Mo(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Hu(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Mn(u).tx)-Number(Mn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Mn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Mn(o).tx;else if(o)l=+Mn(o).tx-+Mn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Mn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=Mn(this),o={min:Number(a.tx)-r,max:Number(a.tx)+r};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class iv extends mt{constructor(){super(...arguments),this.type="area",this.renderType=at.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",On.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Yl().curve(this.services.curves.getD3Curve()).defined(x=>{const _=s.getRangeIdentifier(),C=x[_];return C!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(x,_)=>{y(r,"axes",x,"includeZero")===!1&&_[0]>0&&_[1]>0&&(d=_[0])},f=x=>u?s.getBoundedScaledValues(x)[0]:s.getRangeValue(d),p=x=>u?s.getBoundedScaledValues(x)[1]:s.getRangeValue(x);a===Ht.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,x=>x.name),S=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const x=S.select(`path.${this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:l[0].name})}`).node();let _;if(x)_=getComputedStyle(x,null).getPropertyValue("stroke");else{const C=y(this.model.getOptions(),"color","scale");if(C!==null){const D=Object.keys(C);_=C[D[0]]}}ys.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:ys.getStops(i,_)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,b=v.enter().append("path");m?b.merge(v).style("fill",x=>`url(#${this.services.domUtils.generateElementIDString(`${x.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:x.name,originalClassName:"area"})).attr("d",x=>{const{data:_}=x;return o(_)}):(b.attr("opacity",0).merge(v).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:x.name,originalClassName:"area"})).style("fill",x=>E.model.getFillColor(x.name,null,x.data)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"area-update-enter",animate:t})).attr("opacity",u?1:On.opacity.selected).attr("d",x=>{const{data:_}=x;return o(_)}),u&&b.attr("fill-opacity",On.opacity.selected).style("stroke",x=>E.model.getStrokeColor(x.name,null,x.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ei extends mt{constructor(){super(...arguments),this.type="line",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?wn.opacity.unselected:wn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",wn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=Cn(s,a,r.getOrientation()),c=this.getOptions(),u=Bi().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),m=p[g];return m!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const S=this.services.cartesianScales.getDomainIdentifier(v),E=this.services.cartesianScales.getRangeIdentifier(v);return{name:y(v,0,g),data:v.map(b=>({[S]:b.data.sharedStackKey,[g]:b[g],[E]:b[1]})),hidden:!rL(v,b=>b[0]!==b[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(m=>{const v=this.services.cartesianScales.getRangeIdentifier(m);return m[v]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:g}=p;return u(g)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const sv=5;function Zk(e,t){return e>t-sv&&e<t+sv}class Bn extends mt{constructor(){super(...arguments),this.type="ruler",this.renderType=at.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?r:n,d=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>Zk(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const S=m[0].domainValue,E=Math.abs(u-v.domainValue),b=Math.abs(u-S);return E>b||(E<b?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(b=>b.originalData).filter(b=>{const x=this.services.cartesianScales.getRangeIdentifier(b),_=b[x];return _!=null}),v=g.map(b=>b.domainValue),S=f.filter(b=>{const x=this.services.cartesianScales.getDomainValue(b);return v.includes(x)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=zn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=uL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class cn extends mt{constructor(){super(...arguments),this.type="scatter",this.renderType=at.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.selectAll("circle.dot").data(this.getScatterData(),d=>`${d[s]}-${d[o]}`);l.exit().attr("opacity",0).remove();const u=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(u,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=Cn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Cn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Cn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[lt.FILL,lt.STROKE]:[lt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,i))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",i?s:1).attr("opacity",h?0:1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var a,o;const s=I(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[n],originalClassName:s.attr("class")})).style("fill",l=>{var u;const c=(u=t.services.cartesianScales)==null?void 0:u.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),(a=t.services.events)==null||a.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=I(this);(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=I(this);if(s.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);s.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}destroy(){var n;(n=this.parent)==null||n.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class av extends mt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=at.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===rt.LABELS||this.scaleType===rt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Hu;break;case z.BOTTOM:h=Mo;break;case z.RIGHT:h=y0;break;case z.TOP:h=v0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(r,"axes",n),v=this.scaleType===rt.TIME||m.scaleType===rt.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!i){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(r,"data","loading"),_=y(m,"ticks","number"),C=y(m,"ticks","values"),D=y(m,"truncation","type"),B=y(m,"truncation","threshold"),P=y(m,"truncation","numCharacter"),w=_!==null,H=y(r,"timeScale"),N=k.appendOrSelect(g,"g.tick"),M=k.appendOrSelect(N,"text").text("0"),O=k.getSVGElementSize(M.node(),{useBBox:!0}).height;N.remove();const $=this.scaleType||m.scaleType||rt.LINEAR,F=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=_:(K=$n.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,$n.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),F.ticks(K),v)if(!d.ticks(K).length)F.tickValues([]);else{const nt=y(r,"timeScale","addSpaceOnEdges"),ht=y(r,"axes",n,"domain"),W=d.copy();nt&&!ht&&W.nice(K);const j=W.ticks(K);nt&&j.length>2&&!ht&&(j.splice(j.length-1,1),j.splice(0,1)),F.tickValues(j)}}let L;const U=y(m,"ticks","formatter"),{code:tt,number:X}=y(r,"locale");if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval"));U===null?L=(nt,ht)=>eu(nt,ht,F.tickValues(),K,H,r.locale):L=(nt,ht)=>{const W=eu(nt,ht,F.tickValues(),K,H,r.locale);return U(nt,ht,W)}}else U===null?$===rt.LINEAR&&(L=K=>X(K,tt)):L=U;F.tickFormat(L);const[Y,Q]=this.services.cartesianScales.getScaleByPosition(n).domain();let ut;if(C){if(v)C.forEach((K,nt)=>{K.getTime===void 0&&(C[nt]=new Date(K))}),ut=C.filter(K=>{const nt=K.getTime();return nt>=new Date(Y).getTime()&&nt<=new Date(Q).getTime()});else if(b===rt.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();ut=C.filter(nt=>K.includes(nt))}else ut=C.filter(K=>K>=Y&&K<=Q);F.tickValues(ut)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(m.title){const K=k.appendOrSelect(l,"text.axis-title").html(et||x?"":ln(m.title)),nt=y(m,"titleOrientation");let ht;switch(n){case z.LEFT:nt===qa.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:nt===qa.LEFT?K.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ht=k.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval")),nt=H.showDayName,ht=p;t&&(p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),p=p.call(F),ht.selectAll(".tick").data(F.tickValues(),d).order().select("text").attr("class",(j,J)=>am(j,J,F.tickValues(),K,nt)?"tick-label--primary":"tick-label")}else!t||!f?p=p.call(F):p=p.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(F);if(g.call(F),n===z.BOTTOM||n===z.TOP){let K=!1;const nt=y(m,"ticks","rotation");if(nt===ns.ALWAYS)K=!0;else if(nt===ns.NEVER)K=!1;else if(!nt||nt===ns.AUTO)if(d.step)K=g.selectAll("g.tick text").nodes().some(W=>k.getSVGElementSize(W,{useBBox:!0}).width>=d.step());else{K=!1;const ht=g.append("text").text("A"),W=k.getSVGElementSize(ht.node(),{useBBox:!0}).width;let j;g.selectAll("g.tick").each(function(){const J=I(this),A=parseFloat(y(Mn(this),"tx"));A!==null&&j+J.text().length*W*.8>=A&&(K=!0),j=A}),ht.remove()}K?(w||(F.ticks(this.getNumberOfFittingTicks(a,O,$n.ticks.horizontalSpaceRatio)),g.call(F),p.call(F)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(x?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",K=>K),g.selectAll("g.tick").attr("aria-label",K=>K),D!==Re.NONE&&b===rt.LABELS&&!C){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const ht=this;l.selectAll("g.tick text").data(K).text(function(W){return W.length>B?(ht.truncation[n]=!0,as(W,D,P)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>B?as(W,D,P):W}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===rt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return Up(i,2,$n.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class jk extends av{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=k.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-$n.hover.rectanglePadding).attr("y",p).attr("width",u+$n.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===rt.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===rt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends mt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=at.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(o=>{i[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===is.DEFAULT?new av(this.model,this.services,c):new jk(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=k.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=k.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===z.LEFT||c===z.RIGHT)&&(f+=5)),c){case z.TOP:s.top=h+f;break;case z.BOTTOM:s.bottom=h+f;break;case z.LEFT:s.left=d+f;break;case z.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class ce extends mt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Vt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Vt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Vt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Vt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Ge().domain([0,1]).range(t),this.yScale=Ge().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",r).attr("height",i);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=k.getSVGElementSize(i,{useAttrs:!0}),o=k.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ui().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Lt.xOffset;c===Gt.CENTER?p=s/2:c===Gt.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=k.appendOrSelect(o,"defs").lower(),h=k.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
66
66
  <stop class="${s}" offset="${c}"></stop>
67
67
  <stop class="${a}" offset="${c+.2}"></stop>
68
68
  <stop class="${s}" offset="${c+2*.2}"></stop>
@@ -70,5 +70,5 @@
70
70
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
71
71
  <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"/>
72
72
  <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"/>
73
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.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,Zr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Zr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function y2(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class hv extends mt{constructor(){super(...arguments),this.type="pie",this.renderType=at.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=B_().value(M=>M[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(r,"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]}, ${Zc(M.data[a],o,a)+"%"}`).attrTween("d",function(M){return y2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(i,"locale"),v=i.pie.labels.enabled,S=v?u.filter(M=>M.data[a]>0):[],b=k.appendOrSelect(r,"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=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const O=l+7,$=(M.endAngle-M.startAngle)/2+M.startAngle,F=$/Math.PI*180,L=this.getComputedTextLength();return M.textOffsetX=L/2,M.textOffsetY=F>90&&F<270?10:0,M.xPosition=(M.textOffsetX+O)*Math.sin($),M.yPosition=(M.textOffsetY+O)*-Math.cos($),M}).attr("transform",function(M,O){const $=S.length,F=(M.endAngle-M.startAngle)*(180/Math.PI);if(O>=$-2&&F<Lt.callout.minSliceDegree){let L,U;return M.index===$-1?(L=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,U=M.yPosition-Lt.callout.offsetY,M.direction=ts.RIGHT,_.push(M)):(L=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,U=M.yPosition-Lt.callout.offsetY,M.direction=ts.LEFT,_.push(M)),`translate(${L}, ${U})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=y(i,"donut")?"donut":"pie",D=y(i,C,"alignment"),{width:B}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let H=l+P;D===Gt.CENTER?H=B/2:D===Gt.RIGHT&&(H=B-l-Lt.xOffset);let N=l+w;_.length>0&&(N+=Lt.yOffsetCallout),r.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"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===ts.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}),i.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),i.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,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);ND(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class E2 extends hv{constructor(){super(...arguments),this.type="donut",this.renderType=at.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 r=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");k.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&k.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=gh:s=Ee;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const dv="4,10 8,6 12,10",fv="12,6 8,10 4,6";class x2 extends mt{constructor(){super(...arguments),this.type="gauge",this.renderType=at.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return Up(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===lr.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 Ya.UP:return dv;case Ya.DOWN:return fv;default:return t>0?dv:fv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Ui().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ui().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[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(r,"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(),r=y(n,"gauge","type"),i=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;r===lr.FULL&&!s?d=l(a):r===lr.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([i]);S.enter().append("text").attr("class","gauge-value-number").merge(S).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let P;return B!=null?P=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.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(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"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(i===null?[]:[i]),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(r,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&S?[i]:[]);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(r,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(i))}),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,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class pv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=at.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=Ji(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()/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[i]);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[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),S=this.services.cartesianScales.getDomainLowerBound(v),E=this.services.cartesianScales.getValueThroughAxisPosition(v,S),b=this.services.cartesianScales.getRangeValue(h),x=this.services.cartesianScales.getDomainValue(h)-p/2,_=x+p;if(!this.isOutsideZoomedDomain(x,_))return ie({x0:g,x1:m,y0:E,y1:b},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;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Ii().domain(t).rangeRound([0,this.getGroupWidth()])}}class b2 extends mt{constructor(){super(...arguments),this.type="heatmap",this.renderType=at.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][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][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${kn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${kn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(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,r){const i=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),k.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),k.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Xr.OFF&&(t===Xr.AUTO&&Lg.minCellDividerDimension<=this.xBandwidth&&Lg.minCellDividerDimension<=this.yBandwidth||t===Xr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ss(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:i,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 S2 extends mt{constructor(){super(...arguments),this.type="histogram",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(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)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),ie({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:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class _2 extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=at.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?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,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?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}),r=this.model.getOptions(),{groupMapsTo:i}=r.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[i]}-${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[i],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[i],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)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class T2 extends mt{constructor(){super(...arguments),this.type="meter",this.renderType=at.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(y(i,"meter","proportional")===null)u=100;else{const E=y(i,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ge().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Zt.height.proportional:Zt.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Zt.height.proportional:Zt.height.default));const p=r.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?Zt.height.proportional:Zt.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(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const S=r.selectAll("line.peak").data(v==null?[]:[v]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>f||(s?Zt.height.proportional:Zt.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,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function gv(e){const t=O2(mv(e),360);return Hn(t,[0,10])||Hn(t,[350,0])?{textAnchor:rn.START,dominantBaseline:sn.MIDDLE}:Hn(t,[10,80])?{textAnchor:rn.START,dominantBaseline:sn.HANGING}:Hn(t,[80,100])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.HANGING}:Hn(t,[100,170])?{textAnchor:rn.END,dominantBaseline:sn.HANGING}:Hn(t,[170,190])?{textAnchor:rn.END,dominantBaseline:sn.MIDDLE}:Hn(t,[190,260])?{textAnchor:rn.END,dominantBaseline:sn.BASELINE}:Hn(t,[260,280])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.BASELINE}:{textAnchor:rn.START,dominantBaseline:sn.BASELINE}}function O2(e,t){return(e%t+t)%t}function Hn(e,[t,n]){return e>=t&&e<=n}function mv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function w2(e,t){return t*Math.sin(e-Math.PI/2)}class M2 extends mt{constructor(){super(...arguments),this.type="radar",this.renderType=at.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=k.appendOrSelect(n,"text").text(t),{width:i,height:s}=k.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=BD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:cr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?cr.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",cr.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:r,height:i}=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}=cr;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),x=(Math.min(r,i)-S)/2;if(x<=0)return;const _=Ii().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=kn(this.fullDataNormalized.map(A=>A[d])),D=Ge().domain([C>=0?0:C,Vn(this.fullDataNormalized.map(A=>A[d]))]).range([g,x]).nice(p),B=D.ticks(p),P=(A,G,V)=>this.model.getFillColor(A,G,V),w=V_().angle(A=>_(A[u])+Math.PI/2).radius(A=>D(A[d])).curve(Df),H=this.uniqueKeys.map(A=>{const G=this.getLabelDimensions(A).width,V=w2(_(A),x);return G+V}),M={x:Vn(H)+h,y:i/2},$=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(B,A=>A),F=A=>this.uniqueKeys.map(G=>({[u]:G,[d]:A}));$.join(A=>A.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(F(V)))),A=>A.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(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(F(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",G=>`x-axis-${Vr(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)),A=>A.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)),A=>A.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(A=>A.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=>gv(_(G)).textAnchor).style("dominant-baseline",G=>gv(_(G)).dominantBaseline).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.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"),xt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",xt)})),A=>A.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,A=>A.name).join(A=>A.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",cr.opacity.selected).style("stroke",G=>P(G.name,null,G.data)).call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,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",xt=>w(xt.data))}),A=>(A.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)),A.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))),A),A=>A.call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,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(A=>y(A,d)!==null)).join(A=>A.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:A[l],originalClassName:Vr(A[u])})).attr("cx",A=>Ft(_(A[u]),D(A[d]),M).x).attr("cy",A=>Ft(_(A[u]),D(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>P(A[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.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",A=>`rotate(${mv(_(A))}, ${M.x}, ${M.y})`);const{code:ht,number:W}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Fe(B)).join(A=>A.append("text").attr("opacity",0).text(G=>W(G,ht)).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)),A=>A.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)),A=>A.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,r){const i=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Gt.CENTER?a=Math.floor((s-i.width)/2):t===Gt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`),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",cr.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class vv extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(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=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],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 ie({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;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class C2 extends ce{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!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&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-skeleton.DAII"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class yv extends mt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==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}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.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=Yl().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=>r.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 Ev extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.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 ie({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,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xv extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=at.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.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 r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const 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({[i]: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[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const xs=6;class A2 extends mt{constructor(){super(...arguments),this.type="tree",this.renderType=at.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=k.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+xs:30-xs},h=Di({name:o,children:a}),f=10,p=r/6,g=_=>{const C=h.descendants().reverse(),D=h.links();let B=h,P=h;h.eachBefore(L=>{L.x<B.x&&(B=L),L.x>P.x&&(P=L)});const w=P.x-B.x,H=n.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,w].join(" ")),N=x.selectAll("g").data(C,L=>L.id),M=this,O=N.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",L=>L.depth!==0&&L.children&&L.children.length>0?"clickable":null).on("mouseover",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:L,element:I(this),datum:U})}).on("click",function(L,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:L,element:I(this),datum:U})}).on("mouseout",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:L,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",L=>L._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",L=>L._children?-6:xs).attr("text-anchor",L=>L._children?"end":"start").text(L=>L.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(H).attr("transform",L=>`translate(${L.y},${L.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 $=b.selectAll("path").data(D,L=>L.target.id),F=$.enter().append("path").attr("d",()=>{const L={x:_.x0,y:_.y0};return E({source:L,target:L})});$.merge(F).transition(H).attr("d",E),$.exit().transition(H).remove().attr("d",()=>{const L={x:_.x,y:_.y};return E({source:L,target:L})}),h.eachBefore(L=>{L.x0=L.x,L.y0=L.y})},m=h.descendants(),v=m[m.length-1].depth,S=y(s,"tree","type")===Wa.DENDROGRAM?ub().size([i,r-u-v*xs-l]):Kb().nodeSize([f,p]).size([i,r-u-v*xs-l]),E=Z_().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,r,f]).style("user-select","none");const b=n.append("g").attr("class","links"),x=n.append("g").attr("class","nodes");g(h)}}var D2="#000000",L2="#ffffff",R2="#fcf4d6",I2="#fddc69",k2="#f1c21b",P2="#d2a106",N2="#b28600",$2="#8e6a00",F2="#684e00",U2="#483700",B2="#302400",H2="#1c1500",G2={10:R2,20:I2,30:k2,40:P2,50:N2,60:$2,70:F2,80:U2,90:B2,100:H2},V2="#fff2e8",z2="#ffd9be",W2="#ffb784",Y2="#ff832b",q2="#eb6200",X2="#ba4e00",Z2="#8a3800",j2="#5e2900",K2="#3e1a00",Q2="#231000",J2={10:V2,20:z2,30:W2,40:Y2,50:q2,60:X2,70:Z2,80:j2,90:K2,100:Q2},tP="#fff1f1",eP="#ffd7d9",nP="#ffb3b8",rP="#ff8389",iP="#fa4d56",sP="#da1e28",aP="#a2191f",oP="#750e13",lP="#520408",cP="#2d0709",uP={10:tP,20:eP,30:nP,40:rP,50:iP,60:sP,70:aP,80:oP,90:lP,100:cP},hP="#fff0f7",dP="#ffd6e8",fP="#ffafd2",pP="#ff7eb6",gP="#ee5396",mP="#d02670",vP="#9f1853",yP="#740937",EP="#510224",xP="#2a0a18",bP={10:hP,20:dP,30:fP,40:pP,50:gP,60:mP,70:vP,80:yP,90:EP,100:xP},SP="#f6f2ff",_P="#e8daff",TP="#d4bbff",OP="#be95ff",wP="#a56eff",MP="#8a3ffc",CP="#6929c4",AP="#491d8b",DP="#31135e",LP="#1c0f30",RP={10:SP,20:_P,30:TP,40:OP,50:wP,60:MP,70:CP,80:AP,90:DP,100:LP},IP="#edf5ff",kP="#d0e2ff",PP="#a6c8ff",NP="#78a9ff",$P="#4589ff",FP="#0f62fe",UP="#0043ce",BP="#002d9c",HP="#001d6c",GP="#001141",VP={10:IP,20:kP,30:PP,40:NP,50:$P,60:FP,70:UP,80:BP,90:HP,100:GP},zP="#e5f6ff",WP="#bae6ff",YP="#82cfff",qP="#33b1ff",XP="#1192e8",ZP="#0072c3",jP="#00539a",KP="#003a6d",QP="#012749",JP="#061727",tN={10:zP,20:WP,30:YP,40:qP,50:XP,60:ZP,70:jP,80:KP,90:QP,100:JP},eN="#d9fbfb",nN="#9ef0f0",rN="#3ddbd9",iN="#08bdba",sN="#009d9a",aN="#007d79",oN="#005d5d",lN="#004144",cN="#022b30",uN="#081a1c",hN={10:eN,20:nN,30:rN,40:iN,50:sN,60:aN,70:oN,80:lN,90:cN,100:uN},dN="#defbe6",fN="#a7f0ba",pN="#6fdc8c",gN="#42be65",mN="#24a148",vN="#198038",yN="#0e6027",EN="#044317",xN="#022d0d",bN="#071908",SN={10:dN,20:fN,30:pN,40:gN,50:mN,60:vN,70:yN,80:EN,90:xN,100:bN},_N="#f2f4f8",TN="#dde1e6",ON="#c1c7cd",wN="#a2a9b0",MN="#878d96",CN="#697077",AN="#4d5358",DN="#343a3f",LN="#21272a",RN="#121619",IN={10:_N,20:TN,30:ON,40:wN,50:MN,60:CN,70:AN,80:DN,90:LN,100:RN},kN="#f4f4f4",PN="#e0e0e0",NN="#c6c6c6",$N="#a8a8a8",FN="#8d8d8d",UN="#6f6f6f",BN="#525252",HN="#393939",GN="#262626",VN="#161616",zN={10:kN,20:PN,30:NN,40:$N,50:FN,60:UN,70:BN,80:HN,90:GN,100:VN},WN="#f7f3f2",YN="#e5e0df",qN="#cac5c4",XN="#ada8a8",ZN="#8f8b8b",jN="#726e6e",KN="#565151",QN="#3c3838",JN="#272525",t$="#171414",e$={10:WN,20:YN,30:qN,40:XN,50:ZN,60:jN,70:KN,80:QN,90:JN,100:t$},bv={black:{100:D2},blue:VP,coolGray:IN,cyan:tN,gray:zN,green:SN,magenta:bP,orange:J2,purple:RP,red:uP,teal:hN,warmGray:e$,white:{0:L2},yellow:G2};const n$=e=>{if(!e)return null;for(const t of Object.keys(bv)){const n=bv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Sv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=dn(n);let i;if(r&&(i=n$(r?r.hex():null)),i==null){const s=hh(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let r$=0;class i$ extends mt{constructor(){super(...arguments),this.type="treemap",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Di({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=nS().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",()=>r$++).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`${i.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`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${i.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",Sv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),S=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${S}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Sv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),dn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function s$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var o$={value:function(){}};function _v(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new fo(n)}function fo(e){this._=e}function l$(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}fo.prototype=_v.prototype={constructor:fo,on:function(e,t){var n=this._,r=l$(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=c$(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Tv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Tv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new fo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function c$(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Tv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=o$,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const u$=a$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:_v},Symbol.toStringTag,{value:"Module"})));var Au,Ov;function h$(){if(Ov)return Au;Ov=1;const e=u$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;Au=function(){var b=[256,256],x=s,_=a,C=l,D=o,B=o,P=c,w=u,H=g,N=[],M=1/0,O=e("word","end"),$=null,F=Math.random,L={},U=S;L.canvas=function(Y){return arguments.length?(U=E(Y),L):U},L.start=function(){var Y=tt(U()),Q=v((b[0]>>5)*b[1]),ut=null,et=N.length,K=-1,nt=[],ht=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=B.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 $&&clearInterval($),$=setInterval(W,0),W(),L;function W(){for(var j=Date.now();Date.now()-j<M&&++K<et&&$;){var J=ht[K];J.x=b[0]*(F()+.5)>>1,J.y=b[1]*(F()+.5)>>1,d(Y,J,ht,K),J.hasText&&X(Q,J,ut)&&(nt.push(J),O.call("word",L,J),ut?f(ut,J):ut=[{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&&(L.stop(),O.call("end",L,nt,ut))}},L.stop=function(){$&&(clearInterval($),$=null);for(const Y of N)delete Y.sprite;return L};function tt(Y){const Q=Y.getContext("2d",{willReadFrequently:!0});Y.width=Y.height=1;const ut=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return Y.width=(r<<5)/ut,Y.height=i/ut,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ut}}function X(Y,Q,ut){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),ht=H(b),W=F()<.5?1:-1,j=-W,J,A,G;(J=ht(j+=W))&&(A=~~J[0],G=~~J[1],!(Math.min(Math.abs(A),Math.abs(G))>=nt));)if(Q.x=et+A,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])&&(!ut||p(Q,ut))&&!h(Q,Y,b[0])){for(var V=Q.sprite,xt=Q.width>>5,Ut=b[0]>>5,st=Q.x-(xt<<4),_t=st&127,Ne=32-_t,Oe=Q.y1-Q.y0,bs=(Q.y+Q.y0)*Ut+(st>>5),Ss,mr=0;mr<Oe;mr++){Ss=0;for(var je=0;je<=xt;je++)Y[bs+je]|=Ss<<Ne|(je<xt?(Ss=V[mr*xt+je])>>>_t:0);bs+=Ut}return!0}return!1}return L.timeInterval=function(Y){return arguments.length?(M=Y??1/0,L):M},L.words=function(Y){return arguments.length?(N=Y,L):N},L.size=function(Y){return arguments.length?(b=[+Y[0],+Y[1]],L):b},L.font=function(Y){return arguments.length?(_=E(Y),L):_},L.fontStyle=function(Y){return arguments.length?(D=E(Y),L):D},L.fontWeight=function(Y){return arguments.length?(B=E(Y),L):B},L.rotate=function(Y){return arguments.length?(P=E(Y),L):P},L.text=function(Y){return arguments.length?(x=E(Y),L):x},L.spiral=function(Y){return arguments.length?(H=n[Y]||Y,L):H},L.fontSize=function(Y){return arguments.length?(C=E(Y),L):C},L.padding=function(Y){return arguments.length?(w=E(Y),L):w},L.random=function(Y){return arguments.length?(F=Y,L):F},L.on=function(){var Y=O.on.apply(O,arguments);return Y===O?L:Y},L};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=b.ratio;D.clearRect(0,0,(r<<5)/B,i/B);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)/B)+"px "+x.font;const J=D.measureText(x.text),A=-Math.floor(J.width/2);let G=(J.width+1)*B,V=x.size<<1;if(x.rotate){var M=Math.sin(x.rotate*t),O=Math.cos(x.rotate*t),$=G*O,F=G*M,L=V*O,U=V*M;G=Math.max(Math.abs($+U),Math.abs($-U))+31>>5<<5,V=~~Math.max(Math.abs(F+L),Math.abs(F-L))}else G=G+31>>5<<5;if(V>H&&(H=V),P+G>=r<<5&&(P=0,w+=H,H=0),w+V>=i)break;D.translate((P+(G>>1))/B,(w+(V>>1))/B),x.rotate&&D.rotate(x.rotate*t),D.fillText(x.text,A,0),x.padding&&(D.lineWidth=2*x.padding,D.strokeText(x.text,A,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,(r<<5)/B,i/B).data,X=[];--C>=0;)if(x=_[C],!!x.hasText){for(var Y=x.width,Q=Y>>5,ut=x.y1-x.y0,et=0;et<ut*Q;et++)X[et]=0;if(P=x.xoff,P==null)return;w=x.yoff;for(var K=0,nt=-1,ht=0;ht<ut;ht++){for(var et=0;et<Y;et++){var W=Q*ht+(et>>5),j=tt[(w+ht)*(r<<5)+(P+et)<<2]?1<<31-et%32:0;X[W]|=j,K|=j}K?nt=ht:(x.y0++,ut--,ht--,w++)}x.y1=x.y0+nt,x.sprite=X.slice(0,(x.y1-x.y0)*Q)}}}function h(b,x,_){_>>=5;for(var C=b.sprite,D=b.width>>5,B=b.x-(D<<4),P=B&127,w=32-P,H=b.y1-b.y0,N=(b.y+b.y0)*_+(B>>5),M,O=0;O<H;O++){M=0;for(var $=0;$<=D;$++)if((M<<w|($<D?(M=C[O*D+$])>>>P:0))&x[N+$])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(B){var P=B<0?-1:1;switch(Math.sqrt(1+4*P*B)-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 Au}var d$=h$();const f$=s$(d$);class p$ extends mt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=f$().size([u,d]).words(i.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(r,"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:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Fe(i):[1,1];return Ge().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=za(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class g$ extends mt{constructor(){super(...arguments),this.type="geo",this.renderType=at.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=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=f2(s,Object.values(l)),u=u2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=Nx().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",Bi()([[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 an.geoEqualEarth:t=eb();break;case an.geoAlbers:t=Xx();break;case an.geoConicEqualArea:t=Dd();break;case an.geoConicEquidistant:t=Jx();break;case an.geoEquirectangular:t=Kx();break;case an.geoMercator:t=Zx();break;case an.geoNaturalEarth1:t=nb();break;default:throw new Error("Projection is not supported.")}return t}}class m$ extends g${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),r=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),i=y(this.getOptions(),"color"),s=y(i,"gradient","colors");r.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(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.HIDE,{event:r,hoveredElement:s})})}}class wv extends Ze{constructor(t,n){super(t,n),this.model=new a2(this.services),this.model.setOptions(It(At.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new le(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.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 le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new m$(this.model,this.services)];return this.getChartComponents(t)}}class v$ extends on{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=ct({},t,this.getZoomOptions(t));jc(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ct(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"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:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=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"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class y$ extends Ze{constructor(t,n){super(t,n),this.model=new v$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new v2(this.model,this.services)];return this.getChartComponents(t)}}const Mv={[be.LINE]:[ei,cn],[be.SCATTER]:[cn],[be.AREA]:[iv,ei,cn],[be.STACKED_AREA]:[yv,ei,xv,ho],[be.SIMPLE_BAR]:[vv],[be.GROUPED_BAR]:[pv,ni],[be.STACKED_BAR]:[Ev,ho]};class E$ extends ge{constructor(t,n){super(t,n);const r=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:be.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Mv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${aC(i.type)}Chart`;return a=ct({},At[l],this.model.getOptions(),i.options),i.type===be.STACKED_AREA&&(o=!0),Mv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return fc(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===be.STACKED_BAR||s.type===be.STACKED_AREA),r=[new me(this.model,this.services),new Te(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID}),...n?[]:[new Bn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class x$ extends on{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Cv extends Ze{constructor(t,n,r=!1){super(t,n),this.model=new x$(this.services),!r&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new hv(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}class b$ extends Cv{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new E2(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.DONUT})];return this.getChartComponents(t)}}class S$ extends on{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class _$ extends Ze{constructor(t,n){super(t,n),this.model=new S$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new x2(this.model,this.services)];return this.getChartComponents(t)}}class T$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new pv(this.model,this.services),new ni(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class O$ extends pr{constructor(t){super(t),this.axisFlavor=is.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=Fe(this.getDisplayData(),r=>r.value),n=Ge().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(We(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(We(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(We(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=Tn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(Tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){We(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!We(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=lv(this.getDisplayData(),l)}}class w$ extends ge{constructor(t,n){super(t,n),this.model=new O$(this.services),this.model.setOptions(It(At.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new le(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.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 le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new qm(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new b2(this.model,this.services)];return this.getAxisChartComponents(t)}}class M$ extends pr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class C$ extends ge{constructor(t,n){super(t,n),this.model=new M$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new g2(this.model,this.services),new S2(this.model,this.services)];return this.getAxisChartComponents(t)}}class A$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new ei(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new C2(this.model,this.services),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class D$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new _2(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class L$ extends on{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=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",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}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[r],h.value===null?"&ndash;":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class R$ extends Ze{constructor(t,n){var i;super(t,n),this.model=new L$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?ct(Tn(At.proportionalMeterChart),n.options):ct(Tn(At.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new m2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG},{id:"spacer",components:[new Ln(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new T2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG}],r=[new le(this.model,this.services,n,{direction:Ct.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:at.HTML})}}class I$ extends pr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}class k$ extends Ze{constructor(t,n){super(t,n),this.model=new I$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new M2(this.model,this.services)];return this.getChartComponents(t)}}class P$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class N$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"&ndash;"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class $$ extends Ze{constructor(t,n){super(t,n),this.model=new N$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new A2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class F$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class U$ extends Ze{constructor(t,n){super(t,n),this.model=new F$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new i$(this.model,this.services)];return this.getChartComponents(t)}}class B$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new vv(this.model,this.services),new ni(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class H$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new yv(this.model,this.services),new ei(this.model,this.services,{stacked:!0}),new xv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class G$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new Ev(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ}),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class V$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class z$ extends Ze{constructor(t,n){super(t,n),this.model=new V$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new p$(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}q.Alignments=Gt,q.AlluvialChart=Mk,q.AreaChart=Kk,q.AreaEvent=Nc,q.ArrowDirections=Ya,q.AxisEvent=Pc,q.AxisFlavor=is,q.AxisPositions=z,q.AxisTitleOrientations=qa,q.BarEvent=Bc,q.BoxplotChart=t2,q.BoxplotEvent=Hc,q.BubbleChart=n2,q.BulletChart=s2,q.CalloutDirections=ts,q.CanvasZoomEvent=kc,q.CartesianOrientations=Ht,q.ChartEvent=Ac,q.ChartTheme=Xc,q.ChartTypes=be,q.ChoroplethChart=wv,q.CirclePackChart=y$,q.ColorClassNameTypes=lt,q.ColorLegendType=rs,q.ComboChart=E$,q.DividerStatus=Xr,q.DominantBaseline=sn,q.DonutChart=b$,q.ExperimentalChoroplethChart=wv,q.GaugeChart=_$,q.GaugeEvent=Uc,q.GaugeTypes=lr,q.GroupedBarChart=T$,q.HeatmapChart=w$,q.HistogramChart=C$,q.LayoutAlignItems=or,q.LayoutDirection=Ct,q.LayoutGrowth=dt,q.LegendItemType=zt,q.LegendOrientations=qr,q.LegendPositions=Yr,q.LineChart=A$,q.LineEvent=Vc,q.LollipopChart=D$,q.MeterChart=R$,q.ModalEvent=Dc,q.ModelEvent=Lc,q.PieChart=Cv,q.PieEvent=Fc,q.Projection=an,q.RadarChart=k$,q.RadarEvent=zc,q.RenderTypes=at,q.ScaleTypes=rt,q.ScatterChart=P$,q.ScatterEvent=Gc,q.SimpleBarChart=B$,q.Skeletons=Vt,q.StackedAreaChart=H$,q.StackedBarChart=G$,q.Statuses=es,q.TextAnchor=rn,q.ThresholdEvent=qc,q.TickRotations=ns,q.ToolbarControlTypes=St,q.TooltipEvent=zr,q.TreeChart=$$,q.TreeEvent=Wc,q.TreeTypes=Wa,q.TreemapChart=U$,q.TreemapEvent=Yc,q.TruncationTypes=Re,q.WordCloudChart=z$,q.WordCloudEvent=$c,q.ZoomBarTypes=Ye,q.ZoomDomainEvent=Ic,q.ZoombarEvent=Rc,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
73
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.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,Zr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Zr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function y2(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class hv extends mt{constructor(){super(...arguments),this.type="pie",this.renderType=at.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=B_().value(M=>M[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(r,"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]}, ${Zc(M.data[a],o,a)+"%"}`).attrTween("d",function(M){return y2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(i,"locale"),v=i.pie.labels.enabled,S=v?u.filter(M=>M.data[a]>0):[],b=k.appendOrSelect(r,"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=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const O=l+7,$=(M.endAngle-M.startAngle)/2+M.startAngle,F=$/Math.PI*180,L=this.getComputedTextLength();return M.textOffsetX=L/2,M.textOffsetY=F>90&&F<270?10:0,M.xPosition=(M.textOffsetX+O)*Math.sin($),M.yPosition=(M.textOffsetY+O)*-Math.cos($),M}).attr("transform",function(M,O){const $=S.length,F=(M.endAngle-M.startAngle)*(180/Math.PI);if(O>=$-2&&F<Lt.callout.minSliceDegree){let L,U;return M.index===$-1?(L=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,U=M.yPosition-Lt.callout.offsetY,M.direction=ts.RIGHT,_.push(M)):(L=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,U=M.yPosition-Lt.callout.offsetY,M.direction=ts.LEFT,_.push(M)),`translate(${L}, ${U})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=y(i,"donut")?"donut":"pie",D=y(i,C,"alignment"),{width:B}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let H=l+P;D===Gt.CENTER?H=B/2:D===Gt.RIGHT&&(H=B-l-Lt.xOffset);let N=l+w;_.length>0&&(N+=Lt.yOffsetCallout),r.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"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===ts.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}),i.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),i.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,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);ND(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class E2 extends hv{constructor(){super(...arguments),this.type="donut",this.renderType=at.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 r=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");k.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&k.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=gh:s=Ee;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const dv="4,10 8,6 12,10",fv="12,6 8,10 4,6";class x2 extends mt{constructor(){super(...arguments),this.type="gauge",this.renderType=at.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return Up(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===lr.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 Ya.UP:return dv;case Ya.DOWN:return fv;default:return t>0?dv:fv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Ui().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ui().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[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(r,"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(),r=y(n,"gauge","type"),i=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;r===lr.FULL&&!s?d=l(a):r===lr.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([i]);S.enter().append("text").attr("class","gauge-value-number").merge(S).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let P;return B!=null?P=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.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(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"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(i===null?[]:[i]),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(r,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&S?[i]:[]);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(r,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(i))}),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,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class pv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=at.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=Ji(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()/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[i]);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[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),S=this.services.cartesianScales.getDomainLowerBound(v),E=this.services.cartesianScales.getValueThroughAxisPosition(v,S),b=this.services.cartesianScales.getRangeValue(h),x=this.services.cartesianScales.getDomainValue(h)-p/2,_=x+p;if(!this.isOutsideZoomedDomain(x,_))return ie({x0:g,x1:m,y0:E,y1:b},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;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Ii().domain(t).rangeRound([0,this.getGroupWidth()])}}class b2 extends mt{constructor(){super(...arguments),this.type="heatmap",this.renderType=at.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][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][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${kn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${kn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(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,r){const i=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),k.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),k.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Xr.OFF&&(t===Xr.AUTO&&Lg.minCellDividerDimension<=this.xBandwidth&&Lg.minCellDividerDimension<=this.yBandwidth||t===Xr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ss(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:i,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 S2 extends mt{constructor(){super(...arguments),this.type="histogram",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(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)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),ie({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:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class _2 extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=at.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?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,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?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}),r=this.model.getOptions(),{groupMapsTo:i}=r.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[i]}-${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[i],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[i],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)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class T2 extends mt{constructor(){super(...arguments),this.type="meter",this.renderType=at.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(y(i,"meter","proportional")===null)u=100;else{const E=y(i,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ge().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Zt.height.proportional:Zt.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Zt.height.proportional:Zt.height.default));const p=r.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?Zt.height.proportional:Zt.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(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const S=r.selectAll("line.peak").data(v==null?[]:[v]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>f||(s?Zt.height.proportional:Zt.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,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function gv(e){const t=O2(mv(e),360);return Hn(t,[0,10])||Hn(t,[350,0])?{textAnchor:rn.START,dominantBaseline:sn.MIDDLE}:Hn(t,[10,80])?{textAnchor:rn.START,dominantBaseline:sn.HANGING}:Hn(t,[80,100])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.HANGING}:Hn(t,[100,170])?{textAnchor:rn.END,dominantBaseline:sn.HANGING}:Hn(t,[170,190])?{textAnchor:rn.END,dominantBaseline:sn.MIDDLE}:Hn(t,[190,260])?{textAnchor:rn.END,dominantBaseline:sn.BASELINE}:Hn(t,[260,280])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.BASELINE}:{textAnchor:rn.START,dominantBaseline:sn.BASELINE}}function O2(e,t){return(e%t+t)%t}function Hn(e,[t,n]){return e>=t&&e<=n}function mv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function w2(e,t){return t*Math.sin(e-Math.PI/2)}class M2 extends mt{constructor(){super(...arguments),this.type="radar",this.renderType=at.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=k.appendOrSelect(n,"text").text(t),{width:i,height:s}=k.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=BD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:cr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?cr.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",cr.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:r,height:i}=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}=cr;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),x=(Math.min(r,i)-S)/2;if(x<=0)return;const _=Ii().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=kn(this.fullDataNormalized.map(A=>A[d])),D=Ge().domain([C>=0?0:C,Vn(this.fullDataNormalized.map(A=>A[d]))]).range([g,x]).nice(p),B=D.ticks(p),P=(A,G,V)=>this.model.getFillColor(A,G,V),w=V_().angle(A=>_(A[u])+Math.PI/2).radius(A=>D(A[d])).curve(Df),H=this.uniqueKeys.map(A=>{const G=this.getLabelDimensions(A).width,V=w2(_(A),x);return G+V}),M={x:Vn(H)+h,y:i/2},$=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(B,A=>A),F=A=>this.uniqueKeys.map(G=>({[u]:G,[d]:A}));$.join(A=>A.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(F(V)))),A=>A.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(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(F(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",G=>`x-axis-${Vr(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)),A=>A.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)),A=>A.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(A=>A.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=>gv(_(G)).textAnchor).style("dominant-baseline",G=>gv(_(G)).dominantBaseline).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.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"),xt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",xt)})),A=>A.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,A=>A.name).join(A=>A.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",cr.opacity.selected).style("stroke",G=>P(G.name,null,G.data)).call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,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",xt=>w(xt.data))}),A=>(A.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)),A.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))),A),A=>A.call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,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(A=>y(A,d)!==null)).join(A=>A.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:A[l],originalClassName:Vr(A[u])})).attr("cx",A=>Ft(_(A[u]),D(A[d]),M).x).attr("cy",A=>Ft(_(A[u]),D(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>P(A[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.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",A=>`rotate(${mv(_(A))}, ${M.x}, ${M.y})`);const{code:ht,number:W}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Fe(B)).join(A=>A.append("text").attr("opacity",0).text(G=>W(G,ht)).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)),A=>A.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)),A=>A.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,r){const i=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Gt.CENTER?a=Math.floor((s-i.width)/2):t===Gt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`),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",cr.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class vv extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(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=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],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 ie({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;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class C2 extends ce{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!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&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-skeleton.DAII").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 yv extends mt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==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}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.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=Yl().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=>r.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 Ev extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.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 ie({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,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xv extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=at.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.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 r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const 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({[i]: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[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const xs=6;class A2 extends mt{constructor(){super(...arguments),this.type="tree",this.renderType=at.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=k.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+xs:30-xs},h=Di({name:o,children:a}),f=10,p=r/6,g=_=>{const C=h.descendants().reverse(),D=h.links();let B=h,P=h;h.eachBefore(L=>{L.x<B.x&&(B=L),L.x>P.x&&(P=L)});const w=P.x-B.x,H=n.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,w].join(" ")),N=x.selectAll("g").data(C,L=>L.id),M=this,O=N.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",L=>L.depth!==0&&L.children&&L.children.length>0?"clickable":null).on("mouseover",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:L,element:I(this),datum:U})}).on("click",function(L,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:L,element:I(this),datum:U})}).on("mouseout",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:L,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",L=>L._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",L=>L._children?-6:xs).attr("text-anchor",L=>L._children?"end":"start").text(L=>L.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(H).attr("transform",L=>`translate(${L.y},${L.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 $=b.selectAll("path").data(D,L=>L.target.id),F=$.enter().append("path").attr("d",()=>{const L={x:_.x0,y:_.y0};return E({source:L,target:L})});$.merge(F).transition(H).attr("d",E),$.exit().transition(H).remove().attr("d",()=>{const L={x:_.x,y:_.y};return E({source:L,target:L})}),h.eachBefore(L=>{L.x0=L.x,L.y0=L.y})},m=h.descendants(),v=m[m.length-1].depth,S=y(s,"tree","type")===Wa.DENDROGRAM?ub().size([i,r-u-v*xs-l]):Kb().nodeSize([f,p]).size([i,r-u-v*xs-l]),E=Z_().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,r,f]).style("user-select","none");const b=n.append("g").attr("class","links"),x=n.append("g").attr("class","nodes");g(h)}}var D2="#000000",L2="#ffffff",R2="#fcf4d6",I2="#fddc69",k2="#f1c21b",P2="#d2a106",N2="#b28600",$2="#8e6a00",F2="#684e00",U2="#483700",B2="#302400",H2="#1c1500",G2={10:R2,20:I2,30:k2,40:P2,50:N2,60:$2,70:F2,80:U2,90:B2,100:H2},V2="#fff2e8",z2="#ffd9be",W2="#ffb784",Y2="#ff832b",q2="#eb6200",X2="#ba4e00",Z2="#8a3800",j2="#5e2900",K2="#3e1a00",Q2="#231000",J2={10:V2,20:z2,30:W2,40:Y2,50:q2,60:X2,70:Z2,80:j2,90:K2,100:Q2},tP="#fff1f1",eP="#ffd7d9",nP="#ffb3b8",rP="#ff8389",iP="#fa4d56",sP="#da1e28",aP="#a2191f",oP="#750e13",lP="#520408",cP="#2d0709",uP={10:tP,20:eP,30:nP,40:rP,50:iP,60:sP,70:aP,80:oP,90:lP,100:cP},hP="#fff0f7",dP="#ffd6e8",fP="#ffafd2",pP="#ff7eb6",gP="#ee5396",mP="#d02670",vP="#9f1853",yP="#740937",EP="#510224",xP="#2a0a18",bP={10:hP,20:dP,30:fP,40:pP,50:gP,60:mP,70:vP,80:yP,90:EP,100:xP},SP="#f6f2ff",_P="#e8daff",TP="#d4bbff",OP="#be95ff",wP="#a56eff",MP="#8a3ffc",CP="#6929c4",AP="#491d8b",DP="#31135e",LP="#1c0f30",RP={10:SP,20:_P,30:TP,40:OP,50:wP,60:MP,70:CP,80:AP,90:DP,100:LP},IP="#edf5ff",kP="#d0e2ff",PP="#a6c8ff",NP="#78a9ff",$P="#4589ff",FP="#0f62fe",UP="#0043ce",BP="#002d9c",HP="#001d6c",GP="#001141",VP={10:IP,20:kP,30:PP,40:NP,50:$P,60:FP,70:UP,80:BP,90:HP,100:GP},zP="#e5f6ff",WP="#bae6ff",YP="#82cfff",qP="#33b1ff",XP="#1192e8",ZP="#0072c3",jP="#00539a",KP="#003a6d",QP="#012749",JP="#061727",tN={10:zP,20:WP,30:YP,40:qP,50:XP,60:ZP,70:jP,80:KP,90:QP,100:JP},eN="#d9fbfb",nN="#9ef0f0",rN="#3ddbd9",iN="#08bdba",sN="#009d9a",aN="#007d79",oN="#005d5d",lN="#004144",cN="#022b30",uN="#081a1c",hN={10:eN,20:nN,30:rN,40:iN,50:sN,60:aN,70:oN,80:lN,90:cN,100:uN},dN="#defbe6",fN="#a7f0ba",pN="#6fdc8c",gN="#42be65",mN="#24a148",vN="#198038",yN="#0e6027",EN="#044317",xN="#022d0d",bN="#071908",SN={10:dN,20:fN,30:pN,40:gN,50:mN,60:vN,70:yN,80:EN,90:xN,100:bN},_N="#f2f4f8",TN="#dde1e6",ON="#c1c7cd",wN="#a2a9b0",MN="#878d96",CN="#697077",AN="#4d5358",DN="#343a3f",LN="#21272a",RN="#121619",IN={10:_N,20:TN,30:ON,40:wN,50:MN,60:CN,70:AN,80:DN,90:LN,100:RN},kN="#f4f4f4",PN="#e0e0e0",NN="#c6c6c6",$N="#a8a8a8",FN="#8d8d8d",UN="#6f6f6f",BN="#525252",HN="#393939",GN="#262626",VN="#161616",zN={10:kN,20:PN,30:NN,40:$N,50:FN,60:UN,70:BN,80:HN,90:GN,100:VN},WN="#f7f3f2",YN="#e5e0df",qN="#cac5c4",XN="#ada8a8",ZN="#8f8b8b",jN="#726e6e",KN="#565151",QN="#3c3838",JN="#272525",t$="#171414",e$={10:WN,20:YN,30:qN,40:XN,50:ZN,60:jN,70:KN,80:QN,90:JN,100:t$},bv={black:{100:D2},blue:VP,coolGray:IN,cyan:tN,gray:zN,green:SN,magenta:bP,orange:J2,purple:RP,red:uP,teal:hN,warmGray:e$,white:{0:L2},yellow:G2};const n$=e=>{if(!e)return null;for(const t of Object.keys(bv)){const n=bv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Sv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=dn(n);let i;if(r&&(i=n$(r?r.hex():null)),i==null){const s=hh(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let r$=0;class i$ extends mt{constructor(){super(...arguments),this.type="treemap",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Di({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=nS().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",()=>r$++).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`${i.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`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${i.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",Sv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),S=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${S}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Sv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),dn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function s$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var o$={value:function(){}};function _v(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new fo(n)}function fo(e){this._=e}function l$(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}fo.prototype=_v.prototype={constructor:fo,on:function(e,t){var n=this._,r=l$(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=c$(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Tv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Tv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new fo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function c$(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Tv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=o$,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const u$=a$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:_v},Symbol.toStringTag,{value:"Module"})));var Au,Ov;function h$(){if(Ov)return Au;Ov=1;const e=u$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;Au=function(){var b=[256,256],x=s,_=a,C=l,D=o,B=o,P=c,w=u,H=g,N=[],M=1/0,O=e("word","end"),$=null,F=Math.random,L={},U=S;L.canvas=function(Y){return arguments.length?(U=E(Y),L):U},L.start=function(){var Y=tt(U()),Q=v((b[0]>>5)*b[1]),ut=null,et=N.length,K=-1,nt=[],ht=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=B.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 $&&clearInterval($),$=setInterval(W,0),W(),L;function W(){for(var j=Date.now();Date.now()-j<M&&++K<et&&$;){var J=ht[K];J.x=b[0]*(F()+.5)>>1,J.y=b[1]*(F()+.5)>>1,d(Y,J,ht,K),J.hasText&&X(Q,J,ut)&&(nt.push(J),O.call("word",L,J),ut?f(ut,J):ut=[{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&&(L.stop(),O.call("end",L,nt,ut))}},L.stop=function(){$&&(clearInterval($),$=null);for(const Y of N)delete Y.sprite;return L};function tt(Y){const Q=Y.getContext("2d",{willReadFrequently:!0});Y.width=Y.height=1;const ut=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return Y.width=(r<<5)/ut,Y.height=i/ut,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ut}}function X(Y,Q,ut){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),ht=H(b),W=F()<.5?1:-1,j=-W,J,A,G;(J=ht(j+=W))&&(A=~~J[0],G=~~J[1],!(Math.min(Math.abs(A),Math.abs(G))>=nt));)if(Q.x=et+A,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])&&(!ut||p(Q,ut))&&!h(Q,Y,b[0])){for(var V=Q.sprite,xt=Q.width>>5,Ut=b[0]>>5,st=Q.x-(xt<<4),_t=st&127,Ne=32-_t,Oe=Q.y1-Q.y0,bs=(Q.y+Q.y0)*Ut+(st>>5),Ss,mr=0;mr<Oe;mr++){Ss=0;for(var je=0;je<=xt;je++)Y[bs+je]|=Ss<<Ne|(je<xt?(Ss=V[mr*xt+je])>>>_t:0);bs+=Ut}return!0}return!1}return L.timeInterval=function(Y){return arguments.length?(M=Y??1/0,L):M},L.words=function(Y){return arguments.length?(N=Y,L):N},L.size=function(Y){return arguments.length?(b=[+Y[0],+Y[1]],L):b},L.font=function(Y){return arguments.length?(_=E(Y),L):_},L.fontStyle=function(Y){return arguments.length?(D=E(Y),L):D},L.fontWeight=function(Y){return arguments.length?(B=E(Y),L):B},L.rotate=function(Y){return arguments.length?(P=E(Y),L):P},L.text=function(Y){return arguments.length?(x=E(Y),L):x},L.spiral=function(Y){return arguments.length?(H=n[Y]||Y,L):H},L.fontSize=function(Y){return arguments.length?(C=E(Y),L):C},L.padding=function(Y){return arguments.length?(w=E(Y),L):w},L.random=function(Y){return arguments.length?(F=Y,L):F},L.on=function(){var Y=O.on.apply(O,arguments);return Y===O?L:Y},L};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=b.ratio;D.clearRect(0,0,(r<<5)/B,i/B);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)/B)+"px "+x.font;const J=D.measureText(x.text),A=-Math.floor(J.width/2);let G=(J.width+1)*B,V=x.size<<1;if(x.rotate){var M=Math.sin(x.rotate*t),O=Math.cos(x.rotate*t),$=G*O,F=G*M,L=V*O,U=V*M;G=Math.max(Math.abs($+U),Math.abs($-U))+31>>5<<5,V=~~Math.max(Math.abs(F+L),Math.abs(F-L))}else G=G+31>>5<<5;if(V>H&&(H=V),P+G>=r<<5&&(P=0,w+=H,H=0),w+V>=i)break;D.translate((P+(G>>1))/B,(w+(V>>1))/B),x.rotate&&D.rotate(x.rotate*t),D.fillText(x.text,A,0),x.padding&&(D.lineWidth=2*x.padding,D.strokeText(x.text,A,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,(r<<5)/B,i/B).data,X=[];--C>=0;)if(x=_[C],!!x.hasText){for(var Y=x.width,Q=Y>>5,ut=x.y1-x.y0,et=0;et<ut*Q;et++)X[et]=0;if(P=x.xoff,P==null)return;w=x.yoff;for(var K=0,nt=-1,ht=0;ht<ut;ht++){for(var et=0;et<Y;et++){var W=Q*ht+(et>>5),j=tt[(w+ht)*(r<<5)+(P+et)<<2]?1<<31-et%32:0;X[W]|=j,K|=j}K?nt=ht:(x.y0++,ut--,ht--,w++)}x.y1=x.y0+nt,x.sprite=X.slice(0,(x.y1-x.y0)*Q)}}}function h(b,x,_){_>>=5;for(var C=b.sprite,D=b.width>>5,B=b.x-(D<<4),P=B&127,w=32-P,H=b.y1-b.y0,N=(b.y+b.y0)*_+(B>>5),M,O=0;O<H;O++){M=0;for(var $=0;$<=D;$++)if((M<<w|($<D?(M=C[O*D+$])>>>P:0))&x[N+$])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(B){var P=B<0?-1:1;switch(Math.sqrt(1+4*P*B)-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 Au}var d$=h$();const f$=s$(d$);class p$ extends mt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=f$().size([u,d]).words(i.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(r,"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:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Fe(i):[1,1];return Ge().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=za(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class g$ extends mt{constructor(){super(...arguments),this.type="geo",this.renderType=at.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=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=f2(s,Object.values(l)),u=u2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=Nx().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",Bi()([[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 an.geoEqualEarth:t=eb();break;case an.geoAlbers:t=Xx();break;case an.geoConicEqualArea:t=Dd();break;case an.geoConicEquidistant:t=Jx();break;case an.geoEquirectangular:t=Kx();break;case an.geoMercator:t=Zx();break;case an.geoNaturalEarth1:t=nb();break;default:throw new Error("Projection is not supported.")}return t}}class m$ extends g${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),r=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),i=y(this.getOptions(),"color"),s=y(i,"gradient","colors");r.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(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.HIDE,{event:r,hoveredElement:s})})}}class wv extends Ze{constructor(t,n){super(t,n),this.model=new a2(this.services),this.model.setOptions(It(At.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new le(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.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 le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new m$(this.model,this.services)];return this.getChartComponents(t)}}class v$ extends on{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=ct({},t,this.getZoomOptions(t));jc(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ct(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"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:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=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"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class y$ extends Ze{constructor(t,n){super(t,n),this.model=new v$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new v2(this.model,this.services)];return this.getChartComponents(t)}}const Mv={[be.LINE]:[ei,cn],[be.SCATTER]:[cn],[be.AREA]:[iv,ei,cn],[be.STACKED_AREA]:[yv,ei,xv,ho],[be.SIMPLE_BAR]:[vv],[be.GROUPED_BAR]:[pv,ni],[be.STACKED_BAR]:[Ev,ho]};class E$ extends ge{constructor(t,n){super(t,n);const r=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:be.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Mv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${aC(i.type)}Chart`;return a=ct({},At[l],this.model.getOptions(),i.options),i.type===be.STACKED_AREA&&(o=!0),Mv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return fc(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===be.STACKED_BAR||s.type===be.STACKED_AREA),r=[new me(this.model,this.services),new Te(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID}),...n?[]:[new Bn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class x$ extends on{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Cv extends Ze{constructor(t,n,r=!1){super(t,n),this.model=new x$(this.services),!r&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new hv(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}class b$ extends Cv{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new E2(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.DONUT})];return this.getChartComponents(t)}}class S$ extends on{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class _$ extends Ze{constructor(t,n){super(t,n),this.model=new S$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new x2(this.model,this.services)];return this.getChartComponents(t)}}class T$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new pv(this.model,this.services),new ni(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class O$ extends pr{constructor(t){super(t),this.axisFlavor=is.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=Fe(this.getDisplayData(),r=>r.value),n=Ge().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(We(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(We(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(We(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=Tn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(Tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){We(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!We(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=lv(this.getDisplayData(),l)}}class w$ extends ge{constructor(t,n){super(t,n),this.model=new O$(this.services),this.model.setOptions(It(At.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new le(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.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 le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new qm(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new b2(this.model,this.services)];return this.getAxisChartComponents(t)}}class M$ extends pr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class C$ extends ge{constructor(t,n){super(t,n),this.model=new M$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new g2(this.model,this.services),new S2(this.model,this.services)];return this.getAxisChartComponents(t)}}class A$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new ei(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new C2(this.model,this.services),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class D$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new _2(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class L$ extends on{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=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",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}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[r],h.value===null?"&ndash;":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class R$ extends Ze{constructor(t,n){var i;super(t,n),this.model=new L$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?ct(Tn(At.proportionalMeterChart),n.options):ct(Tn(At.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new m2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG},{id:"spacer",components:[new Ln(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new T2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG}],r=[new le(this.model,this.services,n,{direction:Ct.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:at.HTML})}}class I$ extends pr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}class k$ extends Ze{constructor(t,n){super(t,n),this.model=new I$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new M2(this.model,this.services)];return this.getChartComponents(t)}}class P$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class N$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"&ndash;"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class $$ extends Ze{constructor(t,n){super(t,n),this.model=new N$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new A2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class F$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class U$ extends Ze{constructor(t,n){super(t,n),this.model=new F$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new i$(this.model,this.services)];return this.getChartComponents(t)}}class B$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new vv(this.model,this.services),new ni(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class H$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new yv(this.model,this.services),new ei(this.model,this.services,{stacked:!0}),new xv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class G$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new Ev(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ}),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class V$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class z$ extends Ze{constructor(t,n){super(t,n),this.model=new V$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new p$(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}q.Alignments=Gt,q.AlluvialChart=Mk,q.AreaChart=Kk,q.AreaEvent=Nc,q.ArrowDirections=Ya,q.AxisEvent=Pc,q.AxisFlavor=is,q.AxisPositions=z,q.AxisTitleOrientations=qa,q.BarEvent=Bc,q.BoxplotChart=t2,q.BoxplotEvent=Hc,q.BubbleChart=n2,q.BulletChart=s2,q.CalloutDirections=ts,q.CanvasZoomEvent=kc,q.CartesianOrientations=Ht,q.ChartEvent=Ac,q.ChartTheme=Xc,q.ChartTypes=be,q.ChoroplethChart=wv,q.CirclePackChart=y$,q.ColorClassNameTypes=lt,q.ColorLegendType=rs,q.ComboChart=E$,q.DividerStatus=Xr,q.DominantBaseline=sn,q.DonutChart=b$,q.ExperimentalChoroplethChart=wv,q.GaugeChart=_$,q.GaugeEvent=Uc,q.GaugeTypes=lr,q.GroupedBarChart=T$,q.HeatmapChart=w$,q.HistogramChart=C$,q.LayoutAlignItems=or,q.LayoutDirection=Ct,q.LayoutGrowth=dt,q.LegendItemType=zt,q.LegendOrientations=qr,q.LegendPositions=Yr,q.LineChart=A$,q.LineEvent=Vc,q.LollipopChart=D$,q.MeterChart=R$,q.ModalEvent=Dc,q.ModelEvent=Lc,q.PieChart=Cv,q.PieEvent=Fc,q.Projection=an,q.RadarChart=k$,q.RadarEvent=zc,q.RenderTypes=at,q.ScaleTypes=rt,q.ScatterChart=P$,q.ScatterEvent=Gc,q.SimpleBarChart=B$,q.Skeletons=Vt,q.StackedAreaChart=H$,q.StackedBarChart=G$,q.Statuses=es,q.TextAnchor=rn,q.ThresholdEvent=qc,q.TickRotations=ns,q.ToolbarControlTypes=St,q.TooltipEvent=zr,q.TreeChart=$$,q.TreeEvent=Wc,q.TreeTypes=Wa,q.TreemapChart=U$,q.TreemapEvent=Yc,q.TruncationTypes=Re,q.WordCloudChart=z$,q.WordCloudEvent=$c,q.ZoomBarTypes=Ye,q.ZoomDomainEvent=Ic,q.ZoombarEvent=Rc,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
74
74
  //# sourceMappingURL=bundle.umd.cjs.map