UNPKG

@carbon/charts

Version:
1 lines 558 kB
(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 Xv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function bo(e){let t,n,i;e.length!==2?(t=$e,n=(o,l)=>$e(e(o),l),i=(o,l)=>e(o)-l):(t=e===$e||e===Xv?e:Zv,n=e,i=e);function r(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=r(o,l,c,u-1);return d>c&&i(o[d-1],l)>-i(o[d],l)?d-1:d}return{left:r,center:a,right:s}}function Zv(){return 0}function jv(e){return e===null?NaN:+e}function*Kv(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const So=bo($e).right;bo(jv).center;function Qv(e,t){let n=0;for(let i of e)i!=null&&(i=+i)>=i&&++n;return n}function Fe(e,t){let n,i;if(t===void 0)for(const r of e)r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i<r&&(i=r)));else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(n===void 0?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}class Vn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const s=n[r],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[i++]=o),t=a}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,s,a=0;if(n>0){for(a=t[--n];n>0&&(i=a,r=t[--n],a=i+r,s=r-(a-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=a+r,r==i-a&&(a=i))}return a}}class Nu extends Map{constructor(t,n=e0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get($u(this,t))}has(t){return super.has($u(this,t))}set(t,n){return super.set(Jv(this,t),n)}delete(t){return super.delete(t0(this,t))}}function $u({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Jv({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function t0({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function e0(e){return e!==null&&typeof e=="object"?e.valueOf():e}function n0(e){return e}function i0(e=$e){if(e===$e)return Fu;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function Fu(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var r0=Array.prototype,s0=r0.slice;function _o(e){return()=>e}const a0=Math.sqrt(50),o0=Math.sqrt(10),l0=Math.sqrt(2);function Ms(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),a=s>=a0?10:s>=o0?5:s>=l0?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Ms(e,t,n*2):[o,l,c]}function Cs(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const i=t<e,[r,s,a]=i?Ms(t,e,n):Ms(e,t,n);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(i)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(r+c)/-a;else for(let c=0;c<o;++c)l[c]=(r+c)*a;return l}function vi(e,t,n){return t=+t,e=+e,n=+n,Ms(e,t,n)[2]}function To(e,t,n){t=+t,e=+e,n=+n;const i=t<e,r=i?vi(t,e,n):vi(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function c0(e,t,n){let i;for(;;){const r=vi(e,t,n);if(r===i||r===0||!isFinite(r))return[e,t];r>0?(e=Math.floor(e/r)*r,t=Math.ceil(t/r)*r):r<0&&(e=Math.ceil(e*r)/r,t=Math.floor(t*r)/r),i=r}}function u0(e){return Math.max(1,Math.ceil(Math.log(Qv(e))/Math.LN2)+1)}function h0(){var e=n0,t=Fe,n=u0;function i(r){Array.isArray(r)||(r=Array.from(r));var s,a=r.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(r[s],s,r);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const E=h,b=+f;if(t===Fe&&([d,h]=c0(d,h,b)),f=Cs(d,h,b),f[0]<=d&&(l=vi(d,h,b)),f[f.length-1]>=h)if(E>=h&&t===Fe){const x=vi(d,h,b);isFinite(x)&&(x>0?h=(Math.floor(h/x)+1)*x:x<0&&(h=(Math.ceil(h*-x)+1)/-x))}else f.pop()}for(var p=f.length,g=0,m=p;f[g]<=d;)++g;for(;f[m-1]>h;)--m;(g||m<p)&&(f=f.slice(g,m),p=m-g);var v=new Array(p+1),S;for(s=0;s<=p;++s)S=v[s]=[],S.x0=s>0?f[s-1]:d,S.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(p,Math.floor((o-d)/l))].push(r[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const E=Math.floor((d-o)*l);v[Math.min(p,E+(f[E]<=o))].push(r[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[So(f,o,0,p)].push(r[s]);return v}return i.value=function(r){return arguments.length?(e=typeof r=="function"?r:_o(r),i):e},i.domain=function(r){return arguments.length?(t=typeof r=="function"?r:_o([r[0],r[1]]),i):t},i.thresholds=function(r){return arguments.length?(n=typeof r=="function"?r:_o(Array.isArray(r)?s0.call(r):r),i):n},i}function zn(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function Pn(e,t){let n;for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);return n}function Uu(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?Fu:i0(r);i>n;){if(i-n>600){const l=i-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(i,Math.floor(t+(l-c)*d/l+h));Uu(e,t,f,p,r)}const s=e[t];let a=n,o=i;for(hr(e,n,t),r(e[i],s)>0&&hr(e,n,i);a<o;){for(hr(e,a,o),++a,--o;r(e[a],s)<0;)++a;for(;r(e[o],s)>0;)--o}r(e[n],s)===0?hr(e,n,o):(++o,hr(e,o,i)),o<=t&&(n=o+1),t<=o&&(i=o-1)}return e}function hr(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Oo(e,t,n){if(e=Float64Array.from(Kv(e)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return Pn(e);if(t>=1)return zn(e);var i,r=(i-1)*t,s=Math.floor(r),a=zn(Uu(e,s).subarray(0,s+1)),o=Pn(e.subarray(s+1));return a+(o-a)*(r-s)}}function*d0(e){for(const t of e)yield*t}function Bu(e){return Array.from(d0(e))}function f0(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i<r;)s[i]=e+i*n;return s}function p0(e){return e}var As=1,Ds=2,wo=3,dr=4,Hu=1e-6;function g0(e){return"translate("+e+",0)"}function m0(e){return"translate(0,"+e+")"}function v0(e){return t=>+e(t)}function y0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function E0(){return!this.__axis}function Ls(e,t){var n=[],i=null,r=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===As||e===dr?-1:1,u=e===dr||e===Ds?"x":"y",d=e===As||e===wo?g0:m0;function h(f){var p=i??(t.ticks?t.ticks.apply(t,n):t.domain()),g=r??(t.tickFormat?t.tickFormat.apply(t,n):p0),m=Math.max(s,0)+o,v=t.range(),S=+v[0]+l,E=+v[v.length-1]+l,b=(t.bandwidth?y0:v0)(t.copy(),l),x=f.selection?f.selection():f,_=x.selectAll(".domain").data([null]),C=x.selectAll(".tick").data(p,t).order(),A=C.exit(),$=C.enter().append("g").attr("class","tick"),P=C.select("line"),w=C.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge($),P=P.merge($.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),w=w.merge($.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===As?"0em":e===wo?"0.71em":"0.32em")),f!==x&&(_=_.transition(f),C=C.transition(f),P=P.transition(f),w=w.transition(f),A=A.transition(f).attr("opacity",Hu).attr("transform",function(H){return isFinite(H=b(H))?d(H+l):this.getAttribute("transform")}),$.attr("opacity",Hu).attr("transform",function(H){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(H))?N:b(H))+l)})),A.remove(),_.attr("d",e===dr||e===Ds?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(E0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Ds?"start":e===dr?"end":"middle"),x.each(function(){this.__axis=b})}return h.scale=function(f){return arguments.length?(t=f,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),h):n.slice()},h.tickValues=function(f){return arguments.length?(i=f==null?null:Array.from(f),h):i&&i.slice()},h.tickFormat=function(f){return arguments.length?(r=f,h):r},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function x0(e){return Ls(As,e)}function b0(e){return Ls(Ds,e)}function Mo(e){return Ls(wo,e)}function Gu(e){return Ls(dr,e)}var S0={value:()=>{}};function Co(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Rs(n)}function Rs(e){this._=e}function _0(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Rs.prototype=Co.prototype={constructor:Rs,on:function(e,t){var n=this._,i=_0(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=T0(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=Vu(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Vu(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Rs(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function T0(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function Vu(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=S0,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ao="http://www.w3.org/1999/xhtml";const zu={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 Is(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),zu.hasOwnProperty(t)?{space:zu[t],local:e}:e}function O0(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 w0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wu(e){var t=Is(e);return(t.local?w0:O0)(t)}function M0(){}function Do(e){return e==null?M0:function(){return this.querySelector(e)}}function C0(e){typeof e!="function"&&(e=Do(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new ye(i,this._parents)}function A0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function D0(){return[]}function Yu(e){return e==null?D0:function(){return this.querySelectorAll(e)}}function L0(e){return function(){return A0(e.apply(this,arguments))}}function R0(e){typeof e=="function"?e=L0(e):e=Yu(e);for(var t=this._groups,n=t.length,i=[],r=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),r.push(l));return new ye(i,r)}function qu(e){return function(){return this.matches(e)}}function Xu(e){return function(t){return t.matches(e)}}var I0=Array.prototype.find;function k0(e){return function(){return I0.call(this.children,e)}}function P0(){return this.firstElementChild}function N0(e){return this.select(e==null?P0:k0(typeof e=="function"?e:Xu(e)))}var $0=Array.prototype.filter;function F0(){return Array.from(this.children)}function U0(e){return function(){return $0.call(this.children,e)}}function B0(e){return this.selectAll(e==null?F0:U0(typeof e=="function"?e:Xu(e)))}function H0(e){typeof e!="function"&&(e=qu(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new ye(i,this._parents)}function Zu(e){return new Array(e.length)}function G0(){return new ye(this._enter||this._groups.map(Zu),this._parents)}function ks(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ks.prototype={constructor:ks,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 V0(e){return function(){return e}}function z0(e,t,n,i,r,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],i[a]=o):n[a]=new ks(e,s[a]);for(;a<l;++a)(o=t[a])&&(r[a]=o)}function W0(e,t,n,i,r,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?r[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(i[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new ks(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(r[o]=l)}function Y0(e){return e.__data__}function q0(e,t){if(!arguments.length)return Array.from(this,Y0);var n=t?W0:z0,i=this._parents,r=this._groups;typeof e!="function"&&(e=V0(e));for(var s=r.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=i[c],d=r[c],h=d.length,f=X0(e.call(u,u&&u.__data__,c,i)),p=f.length,g=o[c]=new Array(p),m=a[c]=new Array(p),v=l[c]=new Array(h);n(u,d,g,m,v,f,t);for(var S=0,E=0,b,x;S<p;++S)if(b=g[S]){for(S>=E&&(E=S+1);!(x=m[E])&&++E<p;);b._next=x||null}}return a=new ye(a,i),a._enter=o,a._exit=l,a}function X0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Z0(){return new ye(this._exit||this._groups.map(Zu),this._parents)}function j0(e,t,n){var i=this.enter(),r=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function K0(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,r=n.length,s=i.length,a=Math.min(r,s),o=new Array(r),l=0;l<a;++l)for(var c=n[l],u=i[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<r;++l)o[l]=n[l];return new ye(o,this._parents)}function Q0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],r=i.length-1,s=i[r],a;--r>=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function J0(e){e||(e=ty);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var a=n[s],o=a.length,l=r[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new ye(r,this._parents).order()}function ty(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ey(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ny(){return Array.from(this)}function iy(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length;r<s;++r){var a=i[r];if(a)return a}return null}function ry(){let e=0;for(const t of this)++e;return e}function sy(){return!this.node()}function ay(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r=t[n],s=0,a=r.length,o;s<a;++s)(o=r[s])&&e.call(o,o.__data__,s,r);return this}function oy(e){return function(){this.removeAttribute(e)}}function ly(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cy(e,t){return function(){this.setAttribute(e,t)}}function uy(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hy(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function dy(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 fy(e,t){var n=Is(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?ly:oy:typeof t=="function"?n.local?dy:hy:n.local?uy:cy)(n,t))}function ju(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function py(e){return function(){this.style.removeProperty(e)}}function gy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function my(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function vy(e,t,n){return arguments.length>1?this.each((t==null?py:typeof t=="function"?my:gy)(e,t,n??"")):yi(this.node(),e)}function yi(e,t){return e.style.getPropertyValue(t)||ju(e).getComputedStyle(e,null).getPropertyValue(t)}function yy(e){return function(){delete this[e]}}function Ey(e,t){return function(){this[e]=t}}function xy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function by(e,t){return arguments.length>1?this.each((t==null?yy:typeof t=="function"?xy:Ey)(e,t)):this.node()[e]}function Ku(e){return e.trim().split(/^|\s+/)}function Lo(e){return e.classList||new Qu(e)}function Qu(e){this._node=e,this._names=Ku(e.getAttribute("class")||"")}Qu.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 Ju(e,t){for(var n=Lo(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function th(e,t){for(var n=Lo(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function Sy(e){return function(){Ju(this,e)}}function _y(e){return function(){th(this,e)}}function Ty(e,t){return function(){(t.apply(this,arguments)?Ju:th)(this,e)}}function Oy(e,t){var n=Ku(e+"");if(arguments.length<2){for(var i=Lo(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Ty:t?Sy:_y)(n,t))}function wy(){this.textContent=""}function My(e){return function(){this.textContent=e}}function Cy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ay(e){return arguments.length?this.each(e==null?wy:(typeof e=="function"?Cy:My)(e)):this.node().textContent}function Dy(){this.innerHTML=""}function Ly(e){return function(){this.innerHTML=e}}function Ry(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Iy(e){return arguments.length?this.each(e==null?Dy:(typeof e=="function"?Ry:Ly)(e)):this.node().innerHTML}function ky(){this.nextSibling&&this.parentNode.appendChild(this)}function Py(){return this.each(ky)}function Ny(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $y(){return this.each(Ny)}function Fy(e){var t=typeof e=="function"?e:Wu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Uy(){return null}function By(e,t){var n=typeof e=="function"?e:Wu(e),i=t==null?Uy:typeof t=="function"?t:Do(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Hy(){var e=this.parentNode;e&&e.removeChild(this)}function Gy(){return this.each(Hy)}function Vy(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function zy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Wy(e){return this.select(e?zy:Vy)}function Yy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function qy(e){return function(t){e.call(this,t,this.__data__)}}function Xy(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function Zy(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n<r;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function jy(e,t,n){return function(){var i=this.__on,r,s=qy(t);if(i){for(var a=0,o=i.length;a<o;++a)if((r=i[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=t;return}}this.addEventListener(e.type,s,n),r={type:e.type,name:e.name,value:t,listener:s,options:n},i?i.push(r):this.__on=[r]}}function Ky(e,t,n){var i=Xy(e+""),r,s=i.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(r=0,u=o[l];r<s;++r)if((a=i[r]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?jy:Zy,r=0;r<s;++r)this.each(o(i[r],t,n));return this}function eh(e,t,n){var i=ju(e),r=i.CustomEvent;typeof r=="function"?r=new r(t,n):(r=i.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Qy(e,t){return function(){return eh(this,e,t)}}function Jy(e,t){return function(){return eh(this,e,t.apply(this,arguments))}}function t1(e,t){return this.each((typeof t=="function"?Jy:Qy)(e,t))}function*e1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length,a;r<s;++r)(a=i[r])&&(yield a)}var nh=[null];function ye(e,t){this._groups=e,this._parents=t}function fr(){return new ye([[document.documentElement]],nh)}function n1(){return this}ye.prototype=fr.prototype={constructor:ye,select:C0,selectAll:R0,selectChild:N0,selectChildren:B0,filter:H0,data:q0,enter:G0,exit:Z0,join:j0,merge:K0,selection:n1,order:Q0,sort:J0,call:ey,nodes:ny,node:iy,size:ry,empty:sy,each:ay,attr:fy,style:vy,property:by,classed:Oy,text:Ay,html:Iy,raise:Py,lower:$y,append:Fy,insert:By,remove:Gy,clone:Wy,datum:Yy,on:Ky,dispatch:t1,[Symbol.iterator]:e1};function I(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],nh)}function i1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Wn(e,t){if(e=i1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ro={capture:!0,passive:!1};function Io(e){e.preventDefault(),e.stopImmediatePropagation()}function r1(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 s1(e,t){var n=e.document.documentElement,i=I(e).on("dragstart.drag",null);t&&(i.on("click.drag",Io,Ro),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ko(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ih(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function pr(){}var gr=.7,Ps=1/gr,Ei="\\s*([+-]?\\d+)\\s*",mr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",a1=/^#([0-9a-f]{3,8})$/,o1=new RegExp(`^rgb\\(${Ei},${Ei},${Ei}\\)$`),l1=new RegExp(`^rgb\\(${Ke},${Ke},${Ke}\\)$`),c1=new RegExp(`^rgba\\(${Ei},${Ei},${Ei},${mr}\\)$`),u1=new RegExp(`^rgba\\(${Ke},${Ke},${Ke},${mr}\\)$`),h1=new RegExp(`^hsl\\(${mr},${Ke},${Ke}\\)$`),d1=new RegExp(`^hsla\\(${mr},${Ke},${Ke},${mr}\\)$`),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(pr,hn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sh,formatHex:sh,formatHex8:f1,formatHsl:p1,formatRgb:ah,toString:ah});function sh(){return this.rgb().formatHex()}function f1(){return this.rgb().formatHex8()}function p1(){return hh(this).formatHsl()}function ah(){return this.rgb().formatRgb()}function hn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=a1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?oh(t):n===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ns(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ns(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=o1.exec(e))?new he(t[1],t[2],t[3],1):(t=l1.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=c1.exec(e))?Ns(t[1],t[2],t[3],t[4]):(t=u1.exec(e))?Ns(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=h1.exec(e))?uh(t[1],t[2]/100,t[3]/100,1):(t=d1.exec(e))?uh(t[1],t[2]/100,t[3]/100,t[4]):rh.hasOwnProperty(e)?oh(rh[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function oh(e){return new he(e>>16&255,e>>8&255,e&255,1)}function Ns(e,t,n,i){return i<=0&&(e=t=n=NaN),new he(e,t,n,i)}function g1(e){return e instanceof pr||(e=hn(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function Po(e,t,n,i){return arguments.length===1?g1(e):new he(e,t,n,i??1)}function he(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}ko(he,Po,ih(pr,{brighter(e){return e=e==null?Ps:Math.pow(Ps,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gr:Math.pow(gr,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(Yn(this.r),Yn(this.g),Yn(this.b),$s(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:lh,formatHex:lh,formatHex8:m1,formatRgb:ch,toString:ch}));function lh(){return`#${qn(this.r)}${qn(this.g)}${qn(this.b)}`}function m1(){return`#${qn(this.r)}${qn(this.g)}${qn(this.b)}${qn((isNaN(this.opacity)?1:this.opacity)*255)}`}function ch(){const e=$s(this.opacity);return`${e===1?"rgb(":"rgba("}${Yn(this.r)}, ${Yn(this.g)}, ${Yn(this.b)}${e===1?")":`, ${e})`}`}function $s(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function qn(e){return e=Yn(e),(e<16?"0":"")+e.toString(16)}function uh(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,i)}function hh(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof pr||(e=hn(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),a=NaN,o=s-r,l=(s+r)/2;return o?(t===s?a=(n-i)/o+(n<i)*6:n===s?a=(i-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new Ue(a,o,l,e.opacity)}function dh(e,t,n,i){return arguments.length===1?hh(e):new Ue(e,t,n,i??1)}function Ue(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}ko(Ue,dh,ih(pr,{brighter(e){return e=e==null?Ps:Math.pow(Ps,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gr:Math.pow(gr,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,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new he(No(e>=240?e-240:e+120,r,i),No(e,r,i),No(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Ue(fh(this.h),Fs(this.s),Fs(this.l),$s(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=$s(this.opacity);return`${e===1?"hsl(":"hsla("}${fh(this.h)}, ${Fs(this.s)*100}%, ${Fs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fh(e){return e=(e||0)%360,e<0?e+360:e}function Fs(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 v1(e,t){return function(n){return e+n*t}}function y1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function E1(e){return(e=+e)==1?ph:function(t,n){return n-t?y1(t,n,e):$o(isNaN(t)?n:t)}}function ph(e,t){var n=t-e;return n?v1(e,n):$o(isNaN(e)?t:e)}const Us=function e(t){var n=E1(t);function i(r,s){var a=n((r=Po(r)).r,(s=Po(s)).r),o=n(r.g,s.g),l=n(r.b,s.b),c=ph(r.opacity,s.opacity);return function(u){return r.r=a(u),r.g=o(u),r.b=l(u),r.opacity=c(u),r+""}}return i.gamma=e,i}(1);function x1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=e[r]*(1-s)+t[r]*s;return i}}function b1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function S1(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),s=new Array(n),a;for(a=0;a<i;++a)r[a]=vr(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<i;++a)s[a]=r[a](o);return s}}function _1(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Ee(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function T1(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=vr(e[r],t[r]):i[r]=t[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var Fo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uo=new RegExp(Fo.source,"g");function O1(e){return function(){return e}}function w1(e){return function(t){return e(t)+""}}function gh(e,t){var n=Fo.lastIndex=Uo.lastIndex=0,i,r,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(i=Fo.exec(e))&&(r=Uo.exec(t));)(s=r.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(i=i[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:Ee(i,r)})),n=Uo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?w1(l[0].x):O1(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 vr(e,t){var n=typeof t,i;return t==null||n==="boolean"?$o(t):(n==="number"?Ee:n==="string"?(i=hn(t))?(t=i,Us):gh:t instanceof hn?Us:t instanceof Date?_1:b1(t)?x1:Array.isArray(t)?S1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?T1:Ee)(e,t)}function mh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var vh=180/Math.PI,Bo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yh(e,t,n,i,r,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(o=Math.sqrt(n*n+i*i))&&(n/=o,i/=o,l/=o),e*i<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*vh,skewX:Math.atan(l)*vh,scaleX:a,scaleY:o}}var Bs;function M1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bo:yh(t.a,t.b,t.c,t.d,t.e,t.f)}function C1(e){return e==null||(Bs||(Bs=document.createElementNS("http://www.w3.org/2000/svg","g")),Bs.setAttribute("transform",e),!(e=Bs.transform.baseVal.consolidate()))?Bo:(e=e.matrix,yh(e.a,e.b,e.c,e.d,e.e,e.f))}function Eh(e,t,n,i){function r(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x: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(r(d)+"rotate(",null,i)-2,x:Ee(c,u)})):u&&d.push(r(d)+"rotate("+u+i)}function o(c,u,d,h){c!==u?h.push({i:d.push(r(d)+"skewX(",null,i)-2,x:Ee(c,u)}):u&&d.push(r(d)+"skewX("+u+i)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push(r(f)+"scale(",null,",",null,")");p.push({i:g-4,x:Ee(c,d)},{i:g-2,x:Ee(u,h)})}else(d!==1||h!==1)&&f.push(r(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,g=h.length,m;++p<g;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var A1=Eh(M1,"px, ","px)","deg)"),D1=Eh(C1,", ",")",")");function L1(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}var xi=0,yr=0,Er=0,xh=1e3,Hs,xr,Gs=0,Xn=0,Vs=0,br=typeof performance=="object"&&performance.now?performance:Date,bh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ho(){return Xn||(bh(R1),Xn=br.now()+Vs)}function R1(){Xn=0}function zs(){this._call=this._time=this._next=null}zs.prototype=Sh.prototype={constructor:zs,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&&xr!==this&&(xr?xr._next=this:Hs=this,xr=this),this._call=e,this._time=n,Go()},stop:function(){this._call&&(this._call=null,this._time=1/0,Go())}};function Sh(e,t,n){var i=new zs;return i.restart(e,t,n),i}function I1(){Ho(),++xi;for(var e=Hs,t;e;)(t=Xn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xi}function _h(){Xn=(Gs=br.now())+Vs,xi=yr=0;try{I1()}finally{xi=0,P1(),Xn=0}}function k1(){var e=br.now(),t=e-Gs;t>xh&&(Vs-=t,Gs=e)}function P1(){for(var e,t=Hs,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Hs=n);xr=e,Go(i)}function Go(e){if(!xi){yr&&(yr=clearTimeout(yr));var t=e-Xn;t>24?(e<1/0&&(yr=setTimeout(_h,e-br.now()-Vs)),Er&&(Er=clearInterval(Er))):(Er||(Gs=br.now(),Er=setInterval(k1,xh)),xi=1,bh(_h))}}function Th(e,t,n){var i=new zs;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var N1=Co("start","end","cancel","interrupt"),$1=[],Oh=0,wh=1,Vo=2,Ws=3,Mh=4,zo=5,Ys=6;function qs(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;F1(e,n,{name:t,index:i,group:r,on:N1,tween:$1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Oh})}function Wo(e,t){var n=Be(e,t);if(n.state>Oh)throw new Error("too late; already scheduled");return n}function Qe(e,t){var n=Be(e,t);if(n.state>Ws)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 F1(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=Sh(s,0,n.time);function s(c){n.state=wh,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!==wh)return l();for(u in i)if(f=i[u],f.name===n.name){if(f.state===Ws)return Th(a);f.state===Mh?(f.state=Ys,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=Ys,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(Th(function(){n.state===Ws&&(n.state=Mh,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=Ws,r=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=f);r.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=zo,1),d=-1,h=r.length;++d<h;)r[d].call(e,u);n.state===zo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ys,n.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function Yo(e,t){var n=e.__transition,i,r,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((i=n[a]).name!==t){s=!1;continue}r=i.state>Vo&&i.state<zo,i.state=Ys,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[a]}s&&delete e.__transition}}function U1(e){return this.each(function(){Yo(this,e)})}function B1(e,t){var n,i;return function(){var r=Qe(this,e),s=r.tween;if(s!==n){i=n=s;for(var a=0,o=i.length;a<o;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}r.tween=i}}function H1(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=Qe(this,e),a=s.tween;if(a!==i){r=(i=a).slice();for(var o={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=o;break}l===c&&r.push(o)}s.tween=r}}function G1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=Be(this.node(),n).tween,r=0,s=i.length,a;r<s;++r)if((a=i[r]).name===e)return a.value;return null}return this.each((t==null?B1:H1)(n,e,t))}function qo(e,t,n){var i=e._id;return e.each(function(){var r=Qe(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Be(r,i).value[t]}}function Ch(e,t){var n;return(typeof t=="number"?Ee:t instanceof hn?Us:(n=hn(t))?(t=n,Us):gh)(e,t)}function V1(e){return function(){this.removeAttribute(e)}}function z1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function W1(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttribute(e);return a===r?null:a===i?s:s=t(i=a,n)}}function Y1(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===r?null:a===i?s:s=t(i=a,n)}}function q1(e,t,n){var i,r,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===i&&l===r?s:(r=l,s=t(i=a,o)))}}function X1(e,t,n){var i,r,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===i&&l===r?s:(r=l,s=t(i=a,o)))}}function Z1(e,t){var n=Is(e),i=n==="transform"?D1:Ch;return this.attrTween(e,typeof t=="function"?(n.local?X1:q1)(n,i,qo(this,"attr."+e,t)):t==null?(n.local?z1:V1)(n):(n.local?Y1:W1)(n,i,t))}function j1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function K1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Q1(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&K1(e,s)),n}return r._value=t,r}function J1(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&j1(e,s)),n}return r._value=t,r}function tE(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=Is(e);return this.tween(n,(i.local?Q1:J1)(i,t))}function eE(e,t){return function(){Wo(this,e).delay=+t.apply(this,arguments)}}function nE(e,t){return t=+t,function(){Wo(this,e).delay=t}}function iE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?eE:nE)(t,e)):Be(this.node(),t).delay}function rE(e,t){return function(){Qe(this,e).duration=+t.apply(this,arguments)}}function sE(e,t){return t=+t,function(){Qe(this,e).duration=t}}function aE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rE:sE)(t,e)):Be(this.node(),t).duration}function oE(e,t){if(typeof t!="function")throw new Error;return function(){Qe(this,e).ease=t}}function lE(e){var t=this._id;return arguments.length?this.each(oE(t,e)):Be(this.node(),t).ease}function cE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qe(this,e).ease=n}}function uE(e){if(typeof e!="function")throw new Error;return this.each(cE(this._id,e))}function hE(e){typeof e!="function"&&(e=qu(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new dn(i,this._parents,this._name,this._id)}function dE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,r=n.length,s=Math.min(i,r),a=new Array(i),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<i;++o)a[o]=t[o];return new dn(a,this._parents,this._name,this._id)}function fE(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 pE(e,t,n){var i,r,s=fE(t)?Wo:Qe;return function(){var a=s(this,e),o=a.on;o!==i&&(r=(i=o).copy()).on(t,n),a.on=r}}function gE(e,t){var n=this._id;return arguments.length<2?Be(this.node(),n).on.on(e):this.each(pE(n,e,t))}function mE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function vE(){return this.on("end.remove",mE(this._id))}function yE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Do(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var o=i[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,qs(c[h],t,n,h,c,Be(u,n)));return new dn(s,this._parents,t,n)}function EE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yu(e));for(var i=this._groups,r=i.length,s=[],a=[],o=0;o<r;++o)for(var l=i[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=Be(u,n),g=0,m=h.length;g<m;++g)(f=h[g])&&qs(f,t,n,g,h,p);s.push(h),a.push(u)}return new dn(s,a,t,n)}var xE=fr.prototype.constructor;function bE(){return new xE(this._groups,this._parents)}function SE(e,t){var n,i,r;return function(){var s=yi(this,e),a=(this.style.removeProperty(e),yi(this,e));return s===a?null:s===n&&a===i?r:r=t(n=s,i=a)}}function Ah(e){return function(){this.style.removeProperty(e)}}function _E(e,t,n){var i,r=n+"",s;return function(){var a=yi(this,e);return a===r?null:a===i?s:s=t(i=a,n)}}function TE(e,t,n){var i,r,s;return function(){var a=yi(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),yi(this,e))),a===l?null:a===i&&l===r?s:(r=l,s=t(i=a,o))}}function OE(e,t){var n,i,r,s="style."+t,a="end."+s,o;return function(){var l=Qe(this,e),c=l.on,u=l.value[s]==null?o||(o=Ah(t)):void 0;(c!==n||r!==u)&&(i=(n=c).copy()).on(a,r=u),l.on=i}}function wE(e,t,n){var i=(e+="")=="transform"?A1:Ch;return t==null?this.styleTween(e,SE(e,i)).on("end.style."+e,Ah(e)):typeof t=="function"?this.styleTween(e,TE(e,i,qo(this,"style."+e,t))).each(OE(this._id,e)):this.styleTween(e,_E(e,i,t),n).on("end.style."+e,null)}function ME(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function CE(e,t,n){var i,r;function s(){var a=t.apply(this,arguments);return a!==r&&(i=(r=a)&&ME(e,a,n)),i}return s._value=t,s}function AE(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,CE(e,t,n??""))}function DE(e){return function(){this.textContent=e}}function LE(e){return function(){var t=e(this);this.textContent=t??""}}function RE(e){return this.tween("text",typeof e=="function"?LE(qo(this,"text",e)):DE(e==null?"":e+""))}function IE(e){return function(t){this.textContent=e.call(this,t)}}function kE(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&IE(r)),t}return i._value=e,i}function PE(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,kE(e))}function NE(){for(var e=this._name,t=this._id,n=Dh(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Be(l,t);qs(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new dn(i,this._parents,e,n)}function $E(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--r===0&&s()}};n.each(function(){var c=Qe(this,i),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),r===0&&s()})}var FE=0;function dn(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Dh(){return++FE}var fn=fr.prototype;dn.prototype={constructor:dn,select:yE,selectAll:EE,selectChild:fn.selectChild,selectChildren:fn.selectChildren,filter:hE,merge:dE,selection:bE,transition:NE,call:fn.call,nodes:fn.nodes,node:fn.node,size:fn.size,empty:fn.empty,each:fn.each,on:gE,attr:Z1,attrTween:tE,style:wE,styleTween:AE,text:RE,textTween:PE,remove:vE,tween:G1,delay:iE,duration:aE,ease:lE,easeVarying:uE,end:$E,[Symbol.iterator]:fn[Symbol.iterator]};const UE=e=>+e;function Lh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var BE={time:null,delay:0,duration:250,ease:Lh};function HE(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 GE(e){var t,n;e instanceof dn?(t=e._id,e=e._name):(t=Dh(),(n=BE).time=Ho(),e=e==null?null:e+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&qs(l,e,t,c,a,n||HE(l,t));return new dn(i,this._parents,e,t)}fr.prototype.interrupt=U1,fr.prototype.transition=GE;const Xo=e=>()=>e;function VE(e,{sourceEvent:t,target:n,selection:i,mode:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function zE(e){e.stopImmediatePropagation()}function Zo(e){e.preventDefault(),e.stopImmediatePropagation()}var Rh={name:"drag"},jo={name:"space"},bi={name:"handle"},Si={name:"center"};const{abs:Ih,max:Kt,min:Qt}=Math;function kh(e){return[+e[0],+e[1]]}function Ph(e){return[kh(e[0]),kh(e[1])]}var Xs={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={},pn={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"},Nh={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},$h={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},WE={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},YE={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 qE(e){return!e.ctrlKey&&!e.button}function XE(){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 ZE(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function jE(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Fh(){return KE(Xs)}function KE(e){var t=XE,n=qE,i=ZE,r=!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",pn.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")