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 Yv(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===Yv?e:qv,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 qv(){return 0}function Xv(e){return e===null?NaN:+e}function*Zv(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const So=bo($e).right;bo(Xv).center;function jv(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 Vn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}class Nu extends Map{constructor(t,n=Jv){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($u(this,t))}has(t){return super.has($u(this,t))}set(t,n){return super.set(Kv(this,t),n)}delete(t){return super.delete(Qv(this,t))}}function $u({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Kv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Qv({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Jv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function t0(e){return e}function e0(e=$e){if(e===$e)return Fu;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 Fu(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var n0=Array.prototype,r0=n0.slice;function _o(e){return()=>e}const i0=Math.sqrt(50),s0=Math.sqrt(10),a0=Math.sqrt(2);function ws(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>=i0?10:s>=s0?5:s>=a0?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?ws(e,t,n*2):[o,l,c]}function Ms(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?ws(t,e,n):ws(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,ws(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 o0(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 l0(e){return Math.max(1,Math.ceil(Math.log(jv(e))/Math.LN2)+1)}function c0(){var e=t0,t=Fe,n=l0;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]=o0(d,h,b)),f=Ms(d,h,b),f[0]<=d&&(l=vr(d,h,b)),f[f.length-1]>=h)if(E>=h&&t===Fe){const S=vr(d,h,b);isFinite(S)&&(S>0?h=(Math.floor(h/S)+1)*S:S<0&&(h=(Math.ceil(h*-S)+1)/-S))}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),x;for(s=0;s<=p;++s)x=v[s]=[],x.x0=s>0?f[s-1]:d,x.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)?r0.call(i):i),r):n},r}function zn(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 Pn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Uu(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?Fu:e0(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));Uu(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(ci(e,n,t),i(e[r],s)>0&&ci(e,n,r);a<o;){for(ci(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?ci(e,n,o):(++o,ci(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function ci(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Oo(e,t,n){if(e=Float64Array.from(Zv(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Pn(e);if(t>=1)return zn(e);var r,i=(r-1)*t,s=Math.floor(i),a=zn(Uu(e,s).subarray(0,s+1)),o=Pn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*u0(e){for(const t of e)yield*t}function Bu(e){return Array.from(u0(e))}function h0(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 d0(e){return e}var Cs=1,As=2,wo=3,ui=4,Hu=1e-6;function f0(e){return"translate("+e+",0)"}function p0(e){return"translate(0,"+e+")"}function g0(e){return t=>+e(t)}function m0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function v0(){return!this.__axis}function Ds(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===Cs||e===ui?-1:1,u=e===ui||e===As?"x":"y",d=e===Cs||e===wo?f0:p0;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):d0),m=Math.max(s,0)+o,v=t.range(),x=+v[0]+l,E=+v[v.length-1]+l,b=(t.bandwidth?m0:g0)(t.copy(),l),S=f.selection?f.selection():f,_=S.selectAll(".domain").data([null]),C=S.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===Cs?"0em":e===wo?"0.71em":"0.32em")),f!==S&&(_=_.transition(f),C=C.transition(f),P=P.transition(f),w=w.transition(f),D=D.transition(f).attr("opacity",Hu).attr("transform",function(H){return isFinite(H=b(H))?d(H+l):this.getAttribute("transform")}),B.attr("opacity",Hu).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===ui||e===As?a?"M"+c*a+","+x+"H"+l+"V"+E+"H"+c*a:"M"+l+","+x+"V"+E:a?"M"+x+","+c*a+"V"+l+"H"+E+"V"+c*a:"M"+x+","+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),S.filter(v0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===As?"start":e===ui?"end":"middle"),S.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 y0(e){return Ds(Cs,e)}function E0(e){return Ds(As,e)}function Mo(e){return Ds(wo,e)}function Gu(e){return Ds(ui,e)}var x0={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 Ls(n)}function Ls(e){this._=e}function b0(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}})}Ls.prototype=Co.prototype={constructor:Ls,on:function(e,t){var n=this._,r=b0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=S0(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]=Vu(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Vu(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 Ls(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 S0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Vu(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=x0,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 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 Rs(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 _0(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 T0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wu(e){var t=Rs(e);return(t.local?T0:_0)(t)}function O0(){}function Do(e){return e==null?O0:function(){return this.querySelector(e)}}function w0(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 M0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function C0(){return[]}function Yu(e){return e==null?C0:function(){return this.querySelectorAll(e)}}function A0(e){return function(){return M0(e.apply(this,arguments))}}function D0(e){typeof e=="function"?e=A0(e):e=Yu(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new ye(r,i)}function qu(e){return function(){return this.matches(e)}}function Xu(e){return function(t){return t.matches(e)}}var L0=Array.prototype.find;function R0(e){return function(){return L0.call(this.children,e)}}function I0(){return this.firstElementChild}function k0(e){return this.select(e==null?I0:R0(typeof e=="function"?e:Xu(e)))}var P0=Array.prototype.filter;function N0(){return Array.from(this.children)}function $0(e){return function(){return P0.call(this.children,e)}}function F0(e){return this.selectAll(e==null?N0:$0(typeof e=="function"?e:Xu(e)))}function U0(e){typeof e!="function"&&(e=qu(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 Zu(e){return new Array(e.length)}function B0(){return new ye(this._enter||this._groups.map(Zu),this._parents)}function Is(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Is.prototype={constructor:Is,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 H0(e){return function(){return e}}function G0(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 Is(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function V0(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,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 Is(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function z0(e){return e.__data__}function W0(e,t){if(!arguments.length)return Array.from(this,z0);var n=t?V0:G0,r=this._parents,i=this._groups;typeof e!="function"&&(e=H0(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=Y0(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 x=0,E=0,b,S;x<p;++x)if(b=g[x]){for(x>=E&&(E=x+1);!(S=m[E])&&++E<p;);b._next=S||null}}return a=new ye(a,r),a._enter=o,a._exit=l,a}function Y0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function q0(){return new ye(this._exit||this._groups.map(Zu),this._parents)}function X0(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 Z0(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 j0(){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 K0(e){e||(e=Q0);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 Q0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function J0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ty(){return Array.from(this)}function ey(){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 ny(){let e=0;for(const t of this)++e;return e}function ry(){return!this.node()}function iy(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 sy(e){return function(){this.removeAttribute(e)}}function ay(e){return function(){this.removeAttributeNS(e.space,e.local)}}function oy(e,t){return function(){this.setAttribute(e,t)}}function ly(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function cy(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function uy(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 hy(e,t){var n=Rs(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?ay:sy:typeof t=="function"?n.local?uy:cy:n.local?ly:oy)(n,t))}function ju(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function dy(e){return function(){this.style.removeProperty(e)}}function fy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function py(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function gy(e,t,n){return arguments.length>1?this.each((t==null?dy:typeof t=="function"?py:fy)(e,t,n??"")):yr(this.node(),e)}function yr(e,t){return e.style.getPropertyValue(t)||ju(e).getComputedStyle(e,null).getPropertyValue(t)}function my(e){return function(){delete this[e]}}function vy(e,t){return function(){this[e]=t}}function yy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ey(e,t){return arguments.length>1?this.each((t==null?my:typeof t=="function"?yy:vy)(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),r=-1,i=t.length;++r<i;)n.add(t[r])}function th(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function xy(e){return function(){Ju(this,e)}}function by(e){return function(){th(this,e)}}function Sy(e,t){return function(){(t.apply(this,arguments)?Ju:th)(this,e)}}function _y(e,t){var n=Ku(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"?Sy:t?xy:by)(n,t))}function Ty(){this.textContent=""}function Oy(e){return function(){this.textContent=e}}function wy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function My(e){return arguments.length?this.each(e==null?Ty:(typeof e=="function"?wy:Oy)(e)):this.node().textContent}function Cy(){this.innerHTML=""}function Ay(e){return function(){this.innerHTML=e}}function Dy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ly(e){return arguments.length?this.each(e==null?Cy:(typeof e=="function"?Dy:Ay)(e)):this.node().innerHTML}function Ry(){this.nextSibling&&this.parentNode.appendChild(this)}function Iy(){return this.each(Ry)}function ky(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Py(){return this.each(ky)}function Ny(e){var t=typeof e=="function"?e:Wu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function $y(){return null}function Fy(e,t){var n=typeof e=="function"?e:Wu(e),r=t==null?$y:typeof t=="function"?t:Do(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Uy(){var e=this.parentNode;e&&e.removeChild(this)}function By(){return this.each(Uy)}function Hy(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vy(e){return this.select(e?Gy:Hy)}function zy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Wy(e){return function(t){e.call(this,t,this.__data__)}}function Yy(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 qy(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 Xy(e,t,n){return function(){var r=this.__on,i,s=Wy(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 Zy(e,t,n){var r=Yy(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?Xy:qy,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function eh(e,t,n){var r=ju(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 jy(e,t){return function(){return eh(this,e,t)}}function Ky(e,t){return function(){return eh(this,e,t.apply(this,arguments))}}function Qy(e,t){return this.each((typeof t=="function"?Ky:jy)(e,t))}function*Jy(){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 nh=[null];function ye(e,t){this._groups=e,this._parents=t}function hi(){return new ye([[document.documentElement]],nh)}function t1(){return this}ye.prototype=hi.prototype={constructor:ye,select:w0,selectAll:D0,selectChild:k0,selectChildren:F0,filter:U0,data:W0,enter:B0,exit:q0,join:X0,merge:Z0,selection:t1,order:j0,sort:K0,call:J0,nodes:ty,node:ey,size:ny,empty:ry,each:iy,attr:hy,style:gy,property:Ey,classed:_y,text:My,html:Ly,raise:Iy,lower:Py,append:Ny,insert:Fy,remove:By,clone:Vy,datum:zy,on:Zy,dispatch:Qy,[Symbol.iterator]:Jy};function I(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],nh)}function e1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Wn(e,t){if(e=e1(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 n1(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 r1(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 rh(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function di(){}var fi=.7,ks=1/fi,Er="\\s*([+-]?\\d+)\\s*",pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",i1=/^#([0-9a-f]{3,8})$/,s1=new RegExp(`^rgb\\(${Er},${Er},${Er}\\)$`),a1=new RegExp(`^rgb\\(${Ke},${Ke},${Ke}\\)$`),o1=new RegExp(`^rgba\\(${Er},${Er},${Er},${pi}\\)$`),l1=new RegExp(`^rgba\\(${Ke},${Ke},${Ke},${pi}\\)$`),c1=new RegExp(`^hsl\\(${pi},${Ke},${Ke}\\)$`),u1=new RegExp(`^hsla\\(${pi},${Ke},${Ke},${pi}\\)$`),ih={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(di,hn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sh,formatHex:sh,formatHex8:h1,formatHsl:d1,formatRgb:ah,toString:ah});function sh(){return this.rgb().formatHex()}function h1(){return this.rgb().formatHex8()}function d1(){return hh(this).formatHsl()}function ah(){return this.rgb().formatRgb()}function hn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=i1.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?Ps(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ps(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=s1.exec(e))?new he(t[1],t[2],t[3],1):(t=a1.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=o1.exec(e))?Ps(t[1],t[2],t[3],t[4]):(t=l1.exec(e))?Ps(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=c1.exec(e))?uh(t[1],t[2]/100,t[3]/100,1):(t=u1.exec(e))?uh(t[1],t[2]/100,t[3]/100,t[4]):ih.hasOwnProperty(e)?oh(ih[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 Ps(e,t,n,r){return r<=0&&(e=t=n=NaN),new he(e,t,n,r)}function f1(e){return e instanceof di||(e=hn(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?f1(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,rh(di,{brighter(e){return e=e==null?ks:Math.pow(ks,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fi:Math.pow(fi,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),Ns(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:p1,formatRgb:ch,toString:ch}));function lh(){return`#${qn(this.r)}${qn(this.g)}${qn(this.b)}`}function p1(){return`#${qn(this.r)}${qn(this.g)}${qn(this.b)}${qn((isNaN(this.opacity)?1:this.opacity)*255)}`}function ch(){const e=Ns(this.opacity);return`${e===1?"rgb(":"rgba("}${Yn(this.r)}, ${Yn(this.g)}, ${Yn(this.b)}${e===1?")":`, ${e})`}`}function Ns(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,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 hh(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof di||(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,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 dh(e,t,n,r){return arguments.length===1?hh(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,dh,rh(di,{brighter(e){return e=e==null?ks:Math.pow(ks,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fi:Math.pow(fi,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(fh(this.h),$s(this.s),$s(this.l),Ns(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=Ns(this.opacity);return`${e===1?"hsl(":"hsla("}${fh(this.h)}, ${$s(this.s)*100}%, ${$s(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fh(e){return e=(e||0)%360,e<0?e+360:e}function $s(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 g1(e,t){return function(n){return e+n*t}}function m1(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 v1(e){return(e=+e)==1?ph:function(t,n){return n-t?m1(t,n,e):$o(isNaN(t)?n:t)}}function ph(e,t){var n=t-e;return n?g1(e,n):$o(isNaN(e)?t:e)}const Fs=function e(t){var n=v1(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=ph(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 y1(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 E1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function x1(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]=gi(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 b1(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 S1(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]=gi(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 _1(e){return function(){return e}}function T1(e){return function(t){return e(t)+""}}function gh(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]?T1(l[0].x):_1(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 gi(e,t){var n=typeof t,r;return t==null||n==="boolean"?$o(t):(n==="number"?Ee:n==="string"?(r=hn(t))?(t=r,Fs):gh:t instanceof hn?Fs:t instanceof Date?b1:E1(t)?y1:Array.isArray(t)?x1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?S1: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,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)*vh,skewX:Math.atan(l)*vh,scaleX:a,scaleY:o}}var Us;function O1(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 w1(e){return e==null||(Us||(Us=document.createElementNS("http://www.w3.org/2000/svg","g")),Us.setAttribute("transform",e),!(e=Us.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,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 M1=Eh(O1,"px, ","px)","deg)"),C1=Eh(w1,", ",")",")");function A1(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var xr=0,mi=0,vi=0,xh=1e3,Bs,yi,Hs=0,Xn=0,Gs=0,Ei=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(D1),Xn=Ei.now()+Gs)}function D1(){Xn=0}function Vs(){this._call=this._time=this._next=null}Vs.prototype=Sh.prototype={constructor:Vs,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&&yi!==this&&(yi?yi._next=this:Bs=this,yi=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 r=new Vs;return r.restart(e,t,n),r}function L1(){Ho(),++xr;for(var e=Bs,t;e;)(t=Xn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xr}function _h(){Xn=(Hs=Ei.now())+Gs,xr=mi=0;try{L1()}finally{xr=0,I1(),Xn=0}}function R1(){var e=Ei.now(),t=e-Hs;t>xh&&(Gs-=t,Hs=e)}function I1(){for(var e,t=Bs,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:Bs=n);yi=e,Go(r)}function Go(e){if(!xr){mi&&(mi=clearTimeout(mi));var t=e-Xn;t>24?(e<1/0&&(mi=setTimeout(_h,e-Ei.now()-Gs)),vi&&(vi=clearInterval(vi))):(vi||(Hs=Ei.now(),vi=setInterval(R1,xh)),xr=1,bh(_h))}}function Th(e,t,n){var r=new Vs;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var k1=Co("start","end","cancel","interrupt"),P1=[],Oh=0,wh=1,Vo=2,zs=3,Mh=4,zo=5,Ws=6;function Ys(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;N1(e,n,{name:t,index:r,group:i,on:k1,tween:P1,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>zs)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 N1(e,t,n){var r=e.__transition,i;r[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 r)if(f=r[u],f.name===n.name){if(f.state===zs)return Th(a);f.state===Mh?(f.state=Ws,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=Ws,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Th(function(){n.state===zs&&(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=zs,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=Ws,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=Ws,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function $1(e){return this.each(function(){Yo(this,e)})}function F1(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 U1(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 B1(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?F1:U1)(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 Ch(e,t){var n;return(typeof t=="number"?Ee:t instanceof hn?Fs:(n=hn(t))?(t=n,Fs):gh)(e,t)}function H1(e){return function(){this.removeAttribute(e)}}function G1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function V1(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function z1(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 W1(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 Y1(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 q1(e,t){var n=Rs(e),r=n==="transform"?C1:Ch;return this.attrTween(e,typeof t=="function"?(n.local?Y1:W1)(n,r,qo(this,"attr."+e,t)):t==null?(n.local?G1:H1)(n):(n.local?z1:V1)(n,r,t))}function X1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Z1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function j1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Z1(e,s)),n}return i._value=t,i}function K1(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 Q1(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=Rs(e);return this.tween(n,(r.local?j1:K1)(r,t))}function J1(e,t){return function(){Wo(this,e).delay=+t.apply(this,arguments)}}function tE(e,t){return t=+t,function(){Wo(this,e).delay=t}}function eE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?J1:tE)(t,e)):Be(this.node(),t).delay}function nE(e,t){return function(){Qe(this,e).duration=+t.apply(this,arguments)}}function rE(e,t){return t=+t,function(){Qe(this,e).duration=t}}function iE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nE:rE)(t,e)):Be(this.node(),t).duration}function sE(e,t){if(typeof t!="function")throw new Error;return function(){Qe(this,e).ease=t}}function aE(e){var t=this._id;return arguments.length?this.each(sE(t,e)):Be(this.node(),t).ease}function oE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qe(this,e).ease=n}}function lE(e){if(typeof e!="function")throw new Error;return this.each(oE(this._id,e))}function cE(e){typeof e!="function"&&(e=qu(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 dn(r,this._parents,this._name,this._id)}function uE(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 dn(a,this._parents,this._name,this._id)}function hE(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 dE(e,t,n){var r,i,s=hE(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 fE(e,t){var n=this._id;return arguments.length<2?Be(this.node(),n).on.on(e):this.each(dE(n,e,t))}function pE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function gE(){return this.on("end.remove",pE(this._id))}function mE(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,Ys(c[h],t,n,h,c,Be(u,n)));return new dn(s,this._parents,t,n)}function vE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yu(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,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])&&Ys(f,t,n,g,h,p);s.push(h),a.push(u)}return new dn(s,a,t,n)}var yE=hi.prototype.constructor;function EE(){return new yE(this._groups,this._parents)}function xE(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 Ah(e){return function(){this.style.removeProperty(e)}}function bE(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 SE(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 _E(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=Qe(this,e),c=l.on,u=l.value[s]==null?o||(o=Ah(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function TE(e,t,n){var r=(e+="")=="transform"?M1:Ch;return t==null?this.styleTween(e,xE(e,r)).on("end.style."+e,Ah(e)):typeof t=="function"?this.styleTween(e,SE(e,r,qo(this,"style."+e,t))).each(_E(this._id,e)):this.styleTween(e,bE(e,r,t),n).on("end.style."+e,null)}function OE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function wE(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&OE(e,a,n)),r}return s._value=t,s}function ME(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,wE(e,t,n??""))}function CE(e){return function(){this.textContent=e}}function AE(e){return function(){var t=e(this);this.textContent=t??""}}function DE(e){return this.tween("text",typeof e=="function"?AE(qo(this,"text",e)):CE(e==null?"":e+""))}function LE(e){return function(t){this.textContent=e.call(this,t)}}function RE(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&LE(i)),t}return r._value=e,r}function IE(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,RE(e))}function kE(){for(var e=this._name,t=this._id,n=Dh(),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);Ys(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new dn(r,this._parents,e,n)}function PE(){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 NE=0;function dn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Dh(){return++NE}var fn=hi.prototype;dn.prototype={constructor:dn,select:mE,selectAll:vE,selectChild:fn.selectChild,selectChildren:fn.selectChildren,filter:cE,merge:uE,selection:EE,transition:kE,call:fn.call,nodes:fn.nodes,node:fn.node,size:fn.size,empty:fn.empty,each:fn.each,on:fE,attr:q1,attrTween:Q1,style:TE,styleTween:ME,text:DE,textTween:IE,remove:gE,tween:B1,delay:eE,duration:iE,ease:aE,easeVarying:lE,end:PE,[Symbol.iterator]:fn[Symbol.iterator]};const $E=e=>+e;function Lh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var FE={time:null,delay:0,duration:250,ease:Lh};function UE(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 BE(e){var t,n;e instanceof dn?(t=e._id,e=e._name):(t=Dh(),(n=FE).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])&&Ys(l,e,t,c,a,n||UE(l,t));return new dn(r,this._parents,e,t)}hi.prototype.interrupt=$1,hi.prototype.transition=BE;const Xo=e=>()=>e;function HE(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 GE(e){e.stopImmediatePropagation()}function Zo(e){e.preventDefault(),e.stopImmediatePropagation()}var Rh={name:"drag"},jo={name:"space"},br={name:"handle"},Sr={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 qs={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"},VE={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},zE={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 WE(e){return!e.ctrlKey&&!e.button}function YE(){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 qE(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function XE(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Fh(){return ZE(qs)}function ZE(e){var t=YE,n=WE,r=qE,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",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")