var e={value:()=>{}};function t(){for(var e=0,t=arguments.length,r={},i;e=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}n.prototype=t.prototype={constructor:n,on:function(e,t){var n=this._,o=r(e+``,n),s,c=-1,l=o.length;if(arguments.length<2){for(;++c0)for(var n=Array(i),r=0,i,a;r=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),o.hasOwnProperty(t)?{space:o[t],local:e}:e}function c(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function l(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function u(e){var t=s(e);return(t.local?l:c)(t)}function d(){}function f(e){return e==null?d:function(){return this.querySelector(e)}}function p(e){typeof e!=`function`&&(e=f(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i=v&&(v=_+1);!(b=g[v])&&++v=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function xe(e){e||=Se;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;at?1:e>=t?0:NaN}function Ce(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function we(){return Array.from(this)}function Te(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Le:typeof t==`function`?ze:Re)(e,t,n??``)):S(this.node(),e)}function S(e,t){return e.style.getPropertyValue(t)||Ie(e).getComputedStyle(e,null).getPropertyValue(t)}function Ve(e){return function(){delete this[e]}}function He(e,t){return function(){this[e]=t}}function Ue(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function We(e,t){return arguments.length>1?this.each((t==null?Ve:typeof t==`function`?Ue:He)(e,t)):this.node()[e]}function Ge(e){return e.trim().split(/^|\s+/)}function Ke(e){return e.classList||new qe(e)}function qe(e){this._node=e,this._names=Ge(e.getAttribute(`class`)||``)}qe.prototype={add:function(e){this._names.indexOf(e)<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 Je(e,t){for(var n=Ke(e),r=-1,i=t.length;++r=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Ct(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?tn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?tn(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=Ut.exec(e))?new P(t[1],t[2],t[3],1):(t=Wt.exec(e))?new P(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gt.exec(e))?tn(t[1],t[2],t[3],t[4]):(t=Kt.exec(e))?tn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qt.exec(e))?ln(t[1],t[2]/100,t[3]/100,1):(t=Jt.exec(e))?ln(t[1],t[2]/100,t[3]/100,t[4]):Yt.hasOwnProperty(e)?en(Yt[e]):e===`transparent`?new P(NaN,NaN,NaN,0):null}function en(e){return new P(e>>16&255,e>>8&255,e&255,1)}function tn(e,t,n,r){return r<=0&&(e=t=n=NaN),new P(e,t,n,r)}function nn(e){return e instanceof O||(e=N(e)),e?(e=e.rgb(),new P(e.r,e.g,e.b,e.opacity)):new P}function rn(e,t,n,r){return arguments.length===1?nn(e):new P(e,t,n,r??1)}function P(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}D(P,rn,Bt(O,{brighter(e){return e=e==null?Vt:Vt**+e,new P(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?k:k**+e,new P(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new P(F(this.r),F(this.g),F(this.b),cn(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:an,formatHex:an,formatHex8:on,formatRgb:sn,toString:sn}));function an(){return`#${I(this.r)}${I(this.g)}${I(this.b)}`}function on(){return`#${I(this.r)}${I(this.g)}${I(this.b)}${I((isNaN(this.opacity)?1:this.opacity)*255)}`}function sn(){let e=cn(this.opacity);return`${e===1?`rgb(`:`rgba(`}${F(this.r)}, ${F(this.g)}, ${F(this.b)}${e===1?`)`:`, ${e})`}`}function cn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function F(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function I(e){return e=F(e),(e<16?`0`:``)+e.toString(16)}function ln(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new L(e,t,n,r)}function un(e){if(e instanceof L)return new L(e.h,e.s,e.l,e.opacity);if(e instanceof O||(e=N(e)),!e)return new L;if(e instanceof L)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n0&&c<1?0:o,new L(o,s,c,e.opacity)}function dn(e,t,n,r){return arguments.length===1?un(e):new L(e,t,n,r??1)}function L(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}D(L,dn,Bt(O,{brighter(e){return e=e==null?Vt:Vt**+e,new L(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?k:k**+e,new L(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 P(pn(e>=240?e-240:e+120,i,r),pn(e,i,r),pn(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new L(fn(this.h),R(this.s),R(this.l),cn(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(){let e=cn(this.opacity);return`${e===1?`hsl(`:`hsla(`}${fn(this.h)}, ${R(this.s)*100}%, ${R(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function fn(e){return e=(e||0)%360,e<0?e+360:e}function R(e){return Math.max(0,Math.min(1,e||0))}function pn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var z=e=>()=>e;function mn(e,t){return function(n){return e+n*t}}function hn(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function gn(e,t){var n=t-e;return n?mn(e,n>180||n<-180?n-360*Math.round(n/360):n):z(isNaN(e)?t:e)}function _n(e){return(e=+e)==1?vn:function(t,n){return n-t?hn(t,n,e):z(isNaN(t)?n:t)}}function vn(e,t){var n=t-e;return n?mn(e,n):z(isNaN(e)?t:e)}var yn=(function e(t){var n=_n(t);function r(e,t){var r=n((e=rn(e)).r,(t=rn(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=vn(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function B(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var bn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xn=new RegExp(bn.source,`g`);function Sn(e){return function(){return e}}function Cn(e){return function(t){return e(t)+``}}function wn(e,t){var n=bn.lastIndex=xn.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=bn.exec(e))&&(i=xn.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:B(r,i)})),n=xn.lastIndex;return n180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:B(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:B(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:B(e,n)},{i:s-2,x:B(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t=0&&e._call.call(void 0,t),e=e._next;--V}function Yn(){G=(Vn=K.now())+Hn,V=H=0;try{Jn()}finally{V=0,Zn(),G=0}}function Xn(){var e=K.now(),t=e-Vn;t>Bn&&(Hn-=t,Vn=e)}function Zn(){for(var e,t=U,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:U=n);W=e,Qn(r)}function Qn(e){V||(H&&=clearTimeout(H),e-G>24?(e<1/0&&(H=setTimeout(Yn,e-K.now()-Hn)),zn&&=clearInterval(zn)):(zn||=(Vn=K.now(),setInterval(Xn,Bn)),V=1,Un(Yn)))}function $n(e,t,n){var r=new Kn;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var er=t(`start`,`end`,`cancel`,`interrupt`),tr=[];function q(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;rr(e,n,{name:t,index:r,group:i,on:er,tween:tr,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function nr(e,t){var n=Y(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function J(e,t){var n=Y(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Y(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function rr(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=qn(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return $n(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function ar(e){return this.each(function(){ir(this,e)})}function or(e,t){var n,r;return function(){var i=J(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o=0&&(e=e.slice(0,t)),!e||e===`start`})}function Ir(e,t,n){var r,i,a=Fr(t)?nr:J;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Lr(e,t){var n=this._id;return arguments.length<2?Y(this.node(),n).on.on(e):this.each(Ir(n,e,t))}function Rr(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function zr(){return this.on(`end.remove`,Rr(this._id))}function Br(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=f(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o()=>e;function hi(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Q(e,t,n){this.k=e,this.x=t,this.y=n}Q.prototype={constructor:Q,scale:function(e){return e===1?this:new Q(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Q(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var gi=new Q(1,0,0);_i.prototype=Q.prototype;function _i(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gi;return e.__zoom}function vi(e){e.stopImmediatePropagation()}function $(e){e.preventDefault(),e.stopImmediatePropagation()}function yi(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function bi(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,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]]):[[0,0],[e.clientWidth,e.clientHeight]]}function xi(){return this.__zoom||gi}function Si(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ci(){return navigator.maxTouchPoints||`ontouchstart`in this}function wi(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Ti(){var e=yi,n=bi,r=wi,i=Si,a=Ci,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,l=Rn,u=t(`start`,`zoom`,`end`),d,f,p,m=500,h=150,g=0,_=10;function v(e){e.property(`__zoom`,xi).on(`wheel.zoom`,re,{passive:!1}).on(`mousedown.zoom`,ie).on(`dblclick.zoom`,ae).filter(a).on(`touchstart.zoom`,oe).on(`touchmove.zoom`,se).on(`touchend.zoom touchcancel.zoom`,ce).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}v.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,xi),e===i?i.interrupt().each(function(){x(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):te(e,t,n,r)},v.scaleBy=function(e,t,n,r){v.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},v.scaleTo=function(e,t,i,a){v.transform(e,function(){var e=n.apply(this,arguments),a=this.__zoom,o=i==null?ee(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(o),l=typeof t==`function`?t.apply(this,arguments):t;return r(b(y(a,l),o,c),e,s)},i,a)},v.translateBy=function(e,t,i,a){v.transform(e,function(){return r(this.__zoom.translate(typeof t==`function`?t.apply(this,arguments):t,typeof i==`function`?i.apply(this,arguments):i),n.apply(this,arguments),s)},null,a)},v.translateTo=function(e,t,i,a,o){v.transform(e,function(){var e=n.apply(this,arguments),o=this.__zoom,c=a==null?ee(e):typeof a==`function`?a.apply(this,arguments):a;return r(gi.translate(c[0],c[1]).scale(o.k).translate(typeof t==`function`?-t.apply(this,arguments):-t,typeof i==`function`?-i.apply(this,arguments):-i),e,s)},a,o)};function y(e,t){return t=Math.max(o[0],Math.min(o[1],t)),t===e.k?e:new Q(t,e.x,e.y)}function b(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Q(e.k,r,i)}function ee(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function te(e,t,r,i){e.on(`start.zoom`,function(){x(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){x(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=x(e,a).event(i),s=n.apply(e,a),c=r==null?ee(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof t==`function`?t.apply(e,a):t,p=l(d.invert(c).concat(u/d.k),f.invert(c).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Q(n,c[0]-t[0]*n,c[1]-t[1]*n)}o.zoom(null,e)}})}function x(e,t,n){return!n&&e.__zooming||new ne(e,t)}function ne(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=n.apply(e,t),this.taps=0}ne.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=T(this.that).datum();u.call(e,this.that,new hi(e,{sourceEvent:this.sourceEvent,target:v,type:e,transform:this.that.__zoom,dispatch:u}),t)}};function re(t,...n){if(!e.apply(this,arguments))return;var a=x(this,n).event(t),c=this.__zoom,l=Math.max(o[0],Math.min(o[1],c.k*2**i.apply(this,arguments))),u=E(t);if(a.wheel)(a.mouse[0][0]!==u[0]||a.mouse[0][1]!==u[1])&&(a.mouse[1]=c.invert(a.mouse[0]=u)),clearTimeout(a.wheel);else if(c.k===l)return;else a.mouse=[u,c.invert(u)],ir(this),a.start();$(t),a.wheel=setTimeout(d,h),a.zoom(`mouse`,r(b(y(c,l),a.mouse[0],a.mouse[1]),a.extent,s));function d(){a.wheel=null,a.end()}}function ie(t,...n){if(p||!e.apply(this,arguments))return;var i=t.currentTarget,a=x(this,n,!0).event(t),o=T(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,f,!0),c=E(t,i),l=t.clientX,u=t.clientY;Rt(t.view),vi(t),a.mouse=[c,this.__zoom.invert(c)],ir(this),a.start();function d(e){if($(e),!a.moved){var t=e.clientX-l,n=e.clientY-u;a.moved=t*t+n*n>g}a.event(e).zoom(`mouse`,r(b(a.that.__zoom,a.mouse[0]=E(e,i),a.mouse[1]),a.extent,s))}function f(e){o.on(`mousemove.zoom mouseup.zoom`,null),zt(e.view,a.moved),$(e),a.event(e).end()}}function ae(t,...i){if(e.apply(this,arguments)){var a=this.__zoom,o=E(t.changedTouches?t.changedTouches[0]:t,this),l=a.invert(o),u=a.k*(t.shiftKey?.5:2),d=r(b(y(a,u),o,l),n.apply(this,i),s);$(t),c>0?T(this).transition().duration(c).call(te,d,o,t):T(this).call(v.transform,d,o,t)}}function oe(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=x(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(vi(t),s=0;s