UNPKG

react-force-graph-2d

Version:
2 lines 182 kB
// Version 1.25.1 react-force-graph-2d - https://github.com/vasturiano/react-force-graph !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).ForceGraph2D=n(t.React)}(this,(function(n){"use strict";function e(t,n,e){return(n=function(t){var n=function(t,n){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,n||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeof n?n:String(n)}(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function r(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,i,o,a,u=[],s=!0,l=!1;try{if(o=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;s=!1}else for(;!(s=(r=o.call(e)).done)&&(u.push(r.value),u.length!==n);s=!0);}catch(t){l=!0,i=t}finally{try{if(!s&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,n)||o(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,n){if(t){if("string"==typeof t)return a(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?a(t,n):void 0}}function a(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var s=u((function(t){return[...t].reduce(((t,[n,e])=>(t[n]=e,t)),{})}));function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function c(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,i,o,a,u=[],s=!0,l=!1;try{if(o=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;s=!1}else for(;!(s=(r=o.call(e)).done)&&(u.push(r.value),u.length!==n);s=!0);}catch(t){l=!0,i=t}finally{try{if(!s&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,n)||h(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||h(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,n){if(t){if("string"==typeof t)return p(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?p(t,n):void 0}}function p(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.useEffect,r=n.useRef(),i=n.useRef(!1),o=n.useRef(!1),a=c(n.useState(0),2);a[0];var u=a[1];i.current&&(o.current=!0),e((function(){return i.current||(r.current=t(),i.current=!0),u((function(t){return t+1})),function(){o.current&&r.current&&r.current()}}),[])}var y="http://www.w3.org/1999/xhtml",g={svg:"http://www.w3.org/2000/svg",xhtml:y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function v(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),g.hasOwnProperty(n)?{space:g[n],local:t}:t}function m(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===y&&n.documentElement.namespaceURI===y?n.createElement(t):n.createElementNS(e,t)}}function _(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function b(t){var n=v(t);return(n.local?_:m)(n)}function x(){}function w(t){return null==t?x:function(){return this.querySelector(t)}}function k(){return[]}function A(t){return null==t?k:function(){return this.querySelectorAll(t)}}function S(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function M(t){return function(){return this.matches(t)}}function O(t){return function(n){return n.matches(t)}}var z=Array.prototype.find;function C(){return this.firstElementChild}var E=Array.prototype.filter;function j(){return Array.from(this.children)}function P(t){return new Array(t.length)}function T(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function N(t,n,e,r,i,o){for(var a,u=0,s=n.length,l=o.length;u<l;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new T(t,o[u]);for(;u<s;++u)(a=n[u])&&(i[u]=a)}function R(t,n,e,r,i,o,a){var u,s,l,c=new Map,f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(s=n[u])&&(p[u]=l=a.call(s,s.__data__,u,n)+"",c.has(l)?i[u]=s:c.set(l,s));for(u=0;u<h;++u)l=a.call(t,o[u],u,o)+"",(s=c.get(l))?(r[u]=s,s.__data__=o[u],c.delete(l)):e[u]=new T(t,o[u]);for(u=0;u<f;++u)(s=n[u])&&c.get(p[u])===s&&(i[u]=s)}function I(t){return t.__data__}function D(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function U(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function F(t){return function(){this.removeAttribute(t)}}function L(t){return function(){this.removeAttributeNS(t.space,t.local)}}function $(t,n){return function(){this.setAttribute(t,n)}}function q(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function B(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function H(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function V(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function G(t){return function(){this.style.removeProperty(t)}}function X(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Y(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function W(t,n){return t.style.getPropertyValue(n)||V(t).getComputedStyle(t,null).getPropertyValue(n)}function Z(t){return function(){delete this[t]}}function Q(t,n){return function(){this[t]=n}}function J(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function K(t){return t.trim().split(/^|\s+/)}function tt(t){return t.classList||new nt(t)}function nt(t){this._node=t,this._names=K(t.getAttribute("class")||"")}function et(t,n){for(var e=tt(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function rt(t,n){for(var e=tt(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function it(t){return function(){et(this,t)}}function ot(t){return function(){rt(this,t)}}function at(t,n){return function(){(n.apply(this,arguments)?et:rt)(this,t)}}function ut(){this.textContent=""}function st(t){return function(){this.textContent=t}}function lt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function ct(){this.innerHTML=""}function ft(t){return function(){this.innerHTML=t}}function ht(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function pt(){this.nextSibling&&this.parentNode.appendChild(this)}function dt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yt(){return null}function gt(){var t=this.parentNode;t&&t.removeChild(this)}function vt(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function mt(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function _t(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function bt(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function xt(t,n,e){var r=V(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function wt(t,n){return function(){return xt(this,t,n)}}function kt(t,n){return function(){return xt(this,t,n.apply(this,arguments))}}T.prototype={constructor:T,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},nt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var At=[null];function St(t,n){this._groups=t,this._parents=n}function Mt(){return new St([[document.documentElement]],At)}function Ot(t){return"string"==typeof t?new St([[document.querySelector(t)]],[document.documentElement]):new St([[t]],At)}function zt(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}St.prototype=Mt.prototype={constructor:St,select:function(t){"function"!=typeof t&&(t=w(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],s=u.length,l=r[i]=new Array(s),c=0;c<s;++c)(o=u[c])&&(a=t.call(o,o.__data__,c,u))&&("__data__"in o&&(a.__data__=o.__data__),l[c]=a);return new St(r,this._parents)},selectAll:function(t){t="function"==typeof t?S(t):A(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],s=u.length,l=0;l<s;++l)(a=u[l])&&(r.push(t.call(a,a.__data__,l,u)),i.push(a));return new St(r,i)},selectChild:function(t){return this.select(null==t?C:function(t){return function(){return z.call(this.children,t)}}("function"==typeof t?t:O(t)))},selectChildren:function(t){return this.selectAll(null==t?j:function(t){return function(){return E.call(this.children,t)}}("function"==typeof t?t:O(t)))},filter:function(t){"function"!=typeof t&&(t=M(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,s=r[i]=[],l=0;l<u;++l)(o=a[l])&&t.call(o,o.__data__,l,a)&&s.push(o);return new St(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,I);var e=n?R:N,r=this._parents,i=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=D(t.call(c,c&&c.__data__,l,r)),d=p.length,y=u[l]=new Array(d),g=a[l]=new Array(d);e(c,f,y,g,s[l]=new Array(h),p,n);for(var v,m,_=0,b=0;_<d;++_)if(v=y[_]){for(_>=b&&(b=_+1);!(m=g[b])&&++b<d;);v._next=m||null}}return(a=new St(a,r))._enter=u,a._exit=s,a},enter:function(){return new St(this._enter||this._groups.map(P),this._parents)},exit:function(){return new St(this._exit||this._groups.map(P),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++s)for(var l,c=e[s],f=r[s],h=c.length,p=u[s]=new Array(h),d=0;d<h;++d)(l=c[d]||f[d])&&(p[d]=l);for(;s<i;++s)u[s]=e[s];return new St(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=U);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],s=u.length,l=i[o]=new Array(s),c=0;c<s;++c)(a=u[c])&&(l[c]=a);l.sort(n)}return new St(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=v(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?L:F:"function"==typeof n?e.local?H:B:e.local?q:$)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?G:"function"==typeof n?Y:X)(t,n,null==e?"":e)):W(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?Z:"function"==typeof n?J:Q)(t,n)):this.node()[t]},classed:function(t,n){var e=K(t+"");if(arguments.length<2){for(var r=tt(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?at:n?it:ot)(e,n))},text:function(t){return arguments.length?this.each(null==t?ut:("function"==typeof t?lt:st)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ct:("function"==typeof t?ht:ft)(t)):this.node().innerHTML},raise:function(){return this.each(pt)},lower:function(){return this.each(dt)},append:function(t){var n="function"==typeof t?t:b(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:b(t),r=null==n?yt:"function"==typeof n?n:w(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(gt)},clone:function(t){return this.select(t?mt:vt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?bt:_t,r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var s,l=0,c=u.length;l<c;++l)for(r=0,s=u[l];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?kt:wt)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var Ct={value:()=>{}};function Et(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new jt(r)}function jt(t){this._=t}function Pt(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function Tt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=Ct,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}jt.prototype=Et.prototype={constructor:jt,on:function(t,n){var e,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a<u;)if(e=(t=o[a]).type)i[e]=Tt(i[e],t.name,n);else if(null==n)for(e in i)i[e]=Tt(i[e],t.name,null);return this}for(;++a<u;)if((e=(t=o[a]).type)&&(e=Pt(i[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new jt(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};const Nt={passive:!1},Rt={capture:!0,passive:!1};function It(t){t.stopImmediatePropagation()}function Dt(t){t.preventDefault(),t.stopImmediatePropagation()}function Ut(t){var n=t.document.documentElement,e=Ot(t).on("dragstart.drag",Dt,Rt);"onselectstart"in n?e.on("selectstart.drag",Dt,Rt):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Ft(t,n){var e=t.document.documentElement,r=Ot(t).on("dragstart.drag",null);n&&(r.on("click.drag",Dt,Rt),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var Lt=t=>()=>t;function $t(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}function qt(t){return!t.ctrlKey&&!t.button}function Bt(){return this.parentNode}function Ht(t,n){return null==n?{x:t.x,y:t.y}:n}function Vt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Xt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Yt(){}$t.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Wt=.7,Zt=1/Wt,Qt="\\s*([+-]?\\d+)\\s*",Jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tn=/^#([0-9a-f]{3,8})$/,nn=new RegExp(`^rgb\\(${Qt},${Qt},${Qt}\\)$`),en=new RegExp(`^rgb\\(${Kt},${Kt},${Kt}\\)$`),rn=new RegExp(`^rgba\\(${Qt},${Qt},${Qt},${Jt}\\)$`),on=new RegExp(`^rgba\\(${Kt},${Kt},${Kt},${Jt}\\)$`),an=new RegExp(`^hsl\\(${Jt},${Kt},${Kt}\\)$`),un=new RegExp(`^hsla\\(${Jt},${Kt},${Kt},${Jt}\\)$`),sn={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};function ln(){return this.rgb().formatHex()}function cn(){return this.rgb().formatRgb()}function fn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=tn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?hn(n):3===e?new yn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?pn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?pn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=nn.exec(t))?new yn(n[1],n[2],n[3],1):(n=en.exec(t))?new yn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=rn.exec(t))?pn(n[1],n[2],n[3],n[4]):(n=on.exec(t))?pn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=an.exec(t))?xn(n[1],n[2]/100,n[3]/100,1):(n=un.exec(t))?xn(n[1],n[2]/100,n[3]/100,n[4]):sn.hasOwnProperty(t)?hn(sn[t]):"transparent"===t?new yn(NaN,NaN,NaN,0):null}function hn(t){return new yn(t>>16&255,t>>8&255,255&t,1)}function pn(t,n,e,r){return r<=0&&(t=n=e=NaN),new yn(t,n,e,r)}function dn(t,n,e,r){return 1===arguments.length?((i=t)instanceof Yt||(i=fn(i)),i?new yn((i=i.rgb()).r,i.g,i.b,i.opacity):new yn):new yn(t,n,e,null==r?1:r);var i}function yn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function gn(){return`#${bn(this.r)}${bn(this.g)}${bn(this.b)}`}function vn(){const t=mn(this.opacity);return`${1===t?"rgb(":"rgba("}${_n(this.r)}, ${_n(this.g)}, ${_n(this.b)}${1===t?")":`, ${t})`}`}function mn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function _n(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function bn(t){return((t=_n(t))<16?"0":"")+t.toString(16)}function xn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new kn(t,n,e,r)}function wn(t){if(t instanceof kn)return new kn(t.h,t.s,t.l,t.opacity);if(t instanceof Yt||(t=fn(t)),!t)return new kn;if(t instanceof kn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e<r):e===o?(r-n)/u+2:(n-e)/u+4,u/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new kn(a,u,s,t.opacity)}function kn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function An(t){return(t=(t||0)%360)<0?t+360:t}function Sn(t){return Math.max(0,Math.min(1,t||0))}function Mn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Gt(Yt,fn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ln,formatHex:ln,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return wn(this).formatHsl()},formatRgb:cn,toString:cn}),Gt(yn,dn,Xt(Yt,{brighter(t){return t=null==t?Zt:Math.pow(Zt,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new yn(_n(this.r),_n(this.g),_n(this.b),mn(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:gn,formatHex:gn,formatHex8:function(){return`#${bn(this.r)}${bn(this.g)}${bn(this.b)}${bn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:vn,toString:vn})),Gt(kn,(function(t,n,e,r){return 1===arguments.length?wn(t):new kn(t,n,e,null==r?1:r)}),Xt(Yt,{brighter(t){return t=null==t?Zt:Math.pow(Zt,t),new kn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Wt:Math.pow(Wt,t),new kn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new yn(Mn(t>=240?t-240:t+120,i,r),Mn(t,i,r),Mn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new kn(An(this.h),Sn(this.s),Sn(this.l),mn(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 t=mn(this.opacity);return`${1===t?"hsl(":"hsla("}${An(this.h)}, ${100*Sn(this.s)}%, ${100*Sn(this.l)}%${1===t?")":`, ${t})`}`}}));var On=t=>()=>t;function zn(t){return 1==(t=+t)?Cn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):On(isNaN(n)?e:n)}}function Cn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):On(isNaN(t)?n:t)}var En=function t(n){var e=zn(n);function r(t,n){var r=e((t=dn(t)).r,(n=dn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=Cn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function jn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var Pn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tn=new RegExp(Pn.source,"g");function Nn(t,n){var e,r,i,o=Pn.lastIndex=Tn.lastIndex=0,a=-1,u=[],s=[];for(t+="",n+="";(e=Pn.exec(t))&&(r=Tn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:jn(e,r)})),o=Tn.lastIndex;return o<n.length&&(i=n.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)u[(e=s[r]).i]=e.x(t);return u.join("")})}var Rn,In=180/Math.PI,Dn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Un(t,n,e,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(u=Math.sqrt(e*e+r*r))&&(e/=u,r/=u,s/=u),t*r<n*e&&(t=-t,n=-n,s=-s,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*In,skewX:Math.atan(s)*In,scaleX:a,scaleY:u}}function Fn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u=[],s=[];return o=t(o),a=t(a),function(t,r,i,o,a,u){if(t!==i||r!==o){var s=a.push("translate(",null,n,null,e);u.push({i:s-4,x:jn(t,i)},{i:s-2,x:jn(r,o)})}else(i||o)&&a.push("translate("+i+n+o+e)}(o.translateX,o.translateY,a.translateX,a.translateY,u,s),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:jn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:jn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,s),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:jn(t,e)},{i:u-2,x:jn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var n,e=-1,r=s.length;++e<r;)u[(n=s[e]).i]=n.x(t);return u.join("")}}}var Ln=Fn((function(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Dn:Un(n.a,n.b,n.c,n.d,n.e,n.f)}),"px, ","px)","deg)"),$n=Fn((function(t){return null==t?Dn:(Rn||(Rn=document.createElementNS("http://www.w3.org/2000/svg","g")),Rn.setAttribute("transform",t),(t=Rn.transform.baseVal.consolidate())?Un((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Dn)}),", ",")",")");function qn(t){return((t=Math.exp(t))+1/t)/2}var Bn,Hn,Vn=function t(n,e,r){function i(t,i){var o,a,u=t[0],s=t[1],l=t[2],c=i[0],f=i[1],h=i[2],p=c-u,d=f-s,y=p*p+d*d;if(y<1e-12)a=Math.log(h/l)/n,o=function(t){return[u+t*p,s+t*d,l*Math.exp(n*t*a)]};else{var g=Math.sqrt(y),v=(h*h-l*l+r*y)/(2*l*e*g),m=(h*h-l*l-r*y)/(2*h*e*g),_=Math.log(Math.sqrt(v*v+1)-v),b=Math.log(Math.sqrt(m*m+1)-m);a=(b-_)/n,o=function(t){var r=t*a,i=qn(_),o=l/(e*g)*(i*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(n*r+_)-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[u+o*p,s+o*d,l*i/qn(n*r+_)]}}return o.duration=1e3*a*n/Math.SQRT2,o}return i.rho=function(n){var e=Math.max(.001,+n),r=e*e;return t(e,r,r*r)},i}(Math.SQRT2,2,4),Gn=0,Xn=0,Yn=0,Wn=1e3,Zn=0,Qn=0,Jn=0,Kn="object"==typeof performance&&performance.now?performance:Date,te="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ne(){return Qn||(te(ee),Qn=Kn.now()+Jn)}function ee(){Qn=0}function re(){this._call=this._time=this._next=null}function ie(t,n,e){var r=new re;return r.restart(t,n,e),r}function oe(){Qn=(Zn=Kn.now())+Jn,Gn=Xn=0;try{!function(){ne(),++Gn;for(var t,n=Bn;n;)(t=Qn-n._time)>=0&&n._call.call(void 0,t),n=n._next;--Gn}()}finally{Gn=0,function(){var t,n,e=Bn,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Bn=n);Hn=t,ue(r)}(),Qn=0}}function ae(){var t=Kn.now(),n=t-Zn;n>Wn&&(Jn-=n,Zn=t)}function ue(t){Gn||(Xn&&(Xn=clearTimeout(Xn)),t-Qn>24?(t<1/0&&(Xn=setTimeout(oe,t-Kn.now()-Jn)),Yn&&(Yn=clearInterval(Yn))):(Yn||(Zn=Kn.now(),Yn=setInterval(ae,Wn)),Gn=1,te(oe)))}function se(t,n,e){var r=new re;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}re.prototype=ie.prototype={constructor:re,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?ne():+e)+(null==n?0:+n),this._next||Hn===this||(Hn?Hn._next=this:Bn=this,Hn=this),this._call=t,this._time=e,ue()},stop:function(){this._call&&(this._call=null,this._time=1/0,ue())}};var le=Et("start","end","cancel","interrupt"),ce=[],fe=0,he=1,pe=2,de=3,ye=4,ge=5,ve=6;function me(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=he,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(o){var l,c,f,h;if(e.state!==he)return s();for(l in i)if((h=i[l]).name===e.name){if(h.state===de)return se(a);h.state===ye?(h.state=ve,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[l]):+l<n&&(h.state=ve,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[l])}if(se((function(){e.state===de&&(e.state=ye,e.timer.restart(u,e.delay,e.time),u(o))})),e.state=pe,e.on.call("start",t,t.__data__,e.index,e.group),e.state===pe){for(e.state=de,r=new Array(f=e.tween.length),l=0,c=-1;l<f;++l)(h=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=h);r.length=c+1}}function u(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(s),e.state=ge,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);e.state===ge&&(e.on.call("end",t,t.__data__,e.index,e.group),s())}function s(){for(var r in e.state=ve,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=ie(o,0,e.time)}(t,e,{name:n,index:r,group:i,on:le,tween:ce,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:fe})}function _e(t,n){var e=xe(t,n);if(e.state>fe)throw new Error("too late; already scheduled");return e}function be(t,n){var e=xe(t,n);if(e.state>de)throw new Error("too late; already running");return e}function xe(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function we(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>pe&&e.state<ge,e.state=ve,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}function ke(t,n){var e,r;return function(){var i=be(this,t),o=i.tween;if(o!==e)for(var a=0,u=(r=e=o).length;a<u;++a)if(r[a].name===n){(r=r.slice()).splice(a,1);break}i.tween=r}}function Ae(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=be(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=u;break}s===l&&i.push(u)}o.tween=i}}function Se(t,n,e){var r=t._id;return t.each((function(){var t=be(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return xe(t,r).value[n]}}function Me(t,n){var e;return("number"==typeof n?jn:n instanceof fn?En:(e=fn(n))?(n=e,En):Nn)(t,n)}function Oe(t){return function(){this.removeAttribute(t)}}function ze(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ce(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=n(r=a,e)}}function Ee(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=n(r=a,e)}}function je(t,n,e){var r,i,o;return function(){var a,u,s=e(this);if(null!=s)return(a=this.getAttribute(t))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,s));this.removeAttribute(t)}}function Pe(t,n,e){var r,i,o;return function(){var a,u,s=e(this);if(null!=s)return(a=this.getAttributeNS(t.space,t.local))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,s));this.removeAttributeNS(t.space,t.local)}}function Te(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}(t,i)),e}return i._value=n,i}function Ne(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}(t,i)),e}return i._value=n,i}function Re(t,n){return function(){_e(this,t).delay=+n.apply(this,arguments)}}function Ie(t,n){return n=+n,function(){_e(this,t).delay=n}}function De(t,n){return function(){be(this,t).duration=+n.apply(this,arguments)}}function Ue(t,n){return n=+n,function(){be(this,t).duration=n}}var Fe=Mt.prototype.constructor;function Le(t){return function(){this.style.removeProperty(t)}}var $e=0;function qe(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Be(){return++$e}var He=Mt.prototype;qe.prototype={constructor:qe,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=w(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var u,s,l=r[a],c=l.length,f=o[a]=new Array(c),h=0;h<c;++h)(u=l[h])&&(s=t.call(u,u.__data__,h,l))&&("__data__"in u&&(s.__data__=u.__data__),f[h]=s,me(f[h],n,e,h,f,xe(u,e)));return new qe(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=A(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var s,l=r[u],c=l.length,f=0;f<c;++f)if(s=l[f]){for(var h,p=t.call(s,s.__data__,f,l),d=xe(s,e),y=0,g=p.length;y<g;++y)(h=p[y])&&me(h,n,e,y,p,d);o.push(p),a.push(s)}return new qe(o,a,n,e)},selectChild:He.selectChild,selectChildren:He.selectChildren,filter:function(t){"function"!=typeof t&&(t=M(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,s=r[i]=[],l=0;l<u;++l)(o=a[l])&&t.call(o,o.__data__,l,a)&&s.push(o);return new qe(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s,l=n[u],c=e[u],f=l.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=l[p]||c[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new qe(a,this._parents,this._name,this._id)},selection:function(){return new Fe(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=Be(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,l=0;l<s;++l)if(a=u[l]){var c=xe(a,n);me(a,t,e,l,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new qe(r,this._parents,t,e)},call:He.call,nodes:He.nodes,node:He.node,size:He.size,empty:He.empty,each:He.each,on:function(t,n){var e=this._id;return arguments.length<2?xe(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?_e:be;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=v(t),r="transform"===e?$n:Me;return this.attrTween(t,"function"==typeof n?(e.local?Pe:je)(e,r,Se(this,"attr."+t,n)):null==n?(e.local?ze:Oe)(e):(e.local?Ee:Ce)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=v(t);return this.tween(e,(r.local?Te:Ne)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Ln:Me;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=W(this,t),a=(this.style.removeProperty(t),W(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,Le(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=W(this,t),u=e(this),s=u+"";return null==u&&(this.style.removeProperty(t),s=u=W(this,t)),a===s?null:a===r&&s===i?o:(i=s,o=n(r=a,u))}}(t,r,Se(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var s=be(this,t),l=s.on,c=null==s.value[a]?o||(o=Le(n)):void 0;l===e&&i===c||(r=(e=l).copy()).on(u,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=W(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Se(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=xe(this.node(),e).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?ke:Ae)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Re:Ie)(n,t)):xe(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?De:Ue)(n,t)):xe(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){be(this,t).ease=n}}(n,t)):xe(this.node(),n).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,n){return function(){var e=n.apply(this,arguments);if("function"!=typeof e)throw new Error;be(this,t).ease=e}}(this._id,t))},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,a){var u={value:a},s={value:function(){0==--i&&o()}};e.each((function(){var e=be(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(u),n._.interrupt.push(u),n._.end.push(s)),e.on=n})),0===i&&o()}))},[Symbol.iterator]:He[Symbol.iterator]};var Ve={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Ge(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}Mt.prototype.interrupt=function(t){return this.each((function(){we(this,t)}))},Mt.prototype.transition=function(t){var n,e;t instanceof qe?(n=t._id,t=t._name):(n=Be(),(e=Ve).time=ne(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,l=0;l<s;++l)(a=u[l])&&me(a,t,n,l,u,e||Ge(a,n));return new qe(r,this._parents,t,n)};var Xe=t=>()=>t;function Ye(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function We(t,n,e){this.k=t,this.x=n,this.y=e}We.prototype={constructor:We,scale:function(t){return 1===t?this:new We(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new We(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ze=new We(1,0,0);function Qe(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Ze;return t.__zoom}function Je(t){t.stopImmediatePropagation()}function Ke(t){t.preventDefault(),t.stopImmediatePropagation()}function tr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function nr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function er(){return this.__zoom||Ze}function rr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ir(){return navigator.maxTouchPoints||"ontouchstart"in this}function or(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function ar(){var t,n,e,r=tr,i=nr,o=or,a=rr,u=ir,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,f=Vn,h=Et("start","zoom","end"),p=500,d=150,y=0,g=10;function v(t){t.property("__zoom",er).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",M).filter(u).on("touchstart.zoom",O).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,n){return(n=Math.max(s[0],Math.min(s[1],n)))===t.k?t:new We(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new We(t.k,r,i)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e,r){t.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=w(t,o).event(r),u=i.apply(t,o),s=null==e?b(u):"function"==typeof e?e.apply(t,o):e,l=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),c=t.__zoom,h="function"==typeof n?n.apply(t,o):n,p=f(c.invert(s).concat(l/c.k),h.invert(s).concat(l/h.k));return function(t){if(1===t)t=h;else{var n=p(t),e=l/n[2];t=new We(e,s[0]-n[0]*e,s[1]-n[1]*e)}a.zoom(null,t)}}))}function w(t,n,e){return!e&&t.__zooming||new k(t,n)}function k(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function A(t,...n){if(r.apply(this,arguments)){var e=w(this,n).event(t),i=this.__zoom,u=Math.max(s[0],Math.min(s[1],i.k*Math.pow(2,a.apply(this,arguments)))),c=zt(t);if(e.wheel)e.mouse[0][0]===c[0]&&e.mouse[0][1]===c[1]||(e.mouse[1]=i.invert(e.mouse[0]=c)),clearTimeout(e.wheel);else{if(i.k===u)return;e.mouse=[c,i.invert(c)],we(this),e.start()}Ke(t),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),d),e.zoom("mouse",o(_(m(i,u),e.mouse[0],e.mouse[1]),e.extent,l))}}function S(t,...n){if(!e&&r.apply(this,arguments)){var i=t.currentTarget,a=w(this,n,!0).event(t),u=Ot(t.view).on("mousemove.zoom",(function(t){if(Ke(t),!a.moved){var n=t.clientX-c,e=t.clientY-f;a.moved=n*n+e*e>y}a.event(t).zoom("mouse",o(_(a.that.__zoom,a.mouse[0]=zt(t,i),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),Ft(t.view,a.moved),Ke(t),a.event(t).end()}),!0),s=zt(t,i),c=t.clientX,f=t.clientY;Ut(t.view),Je(t),a.mouse=[s,this.__zoom.invert(s)],we(this),a.start()}}function M(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=zt(t.changedTouches?t.changedTouches[0]:t,this),u=e.invert(a),s=e.k*(t.shiftKey?.5:2),f=o(_(m(e,s),a,u),i.apply(this,n),l);Ke(t),c>0?Ot(this).transition().duration(c).call(x,f,a,t):Ot(this).call(v.transform,f,a,t)}}function O(e,...i){if(r.apply(this,arguments)){var o,a,u,s,l=e.touches,c=l.length,f=w(this,i,e.changedTouches.length===c).event(e);for(Je(e),a=0;a<c;++a)s=[s=zt(u=l[a],this),this.__zoom.invert(s),u.identifier],f.touch0?f.touch1||f.touch0[2]===s[2]||(f.touch1=s,f.taps=0):(f.touch0=s,o=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),o&&(f.taps<2&&(n=s[0],t=setTimeout((function(){t=null}),p)),we(this),f.start())}}function z(t,...n){if(this.__zooming){var e,r,i,a,u=w(this,n).event(t),s=t.changedTouches,c=s.length;for(Ke(t),e=0;e<c;++e)i=zt(r=s[e],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=i:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=i);if(r=u.that.__zoom,u.touch1){var f=u.touch0[0],h=u.touch0[1],p=u.touch1[0],d=u.touch1[1],y=(y=p[0]-f[0])*y+(y=p[1]-f[1])*y,g=(g=d[0]-h[0])*g+(g=d[1]-h[1])*g;r=m(r,Math.sqrt(y/g)),i=[(f[0]+p[0])/2,(f[1]+p[1])/2],a=[(h[0]+d[0])/2,(h[1]+d[1])/2]}else{if(!u.touch0)return;i=u.touch0[0],a=u.touch0[1]}u.zoom("touch",o(_(r,i,a),u.extent,l))}}function C(t,...r){if(this.__zooming){var i,o,a=w(this,r).event(t),u=t.changedTouches,s=u.length;for(Je(t),e&&clearTimeout(e),e=setTimeout((function(){e=null}),p),i=0;i<s;++i)o=u[i],a.touch0&&a.touch0[2]===o.identifier?delete a.touch0:a.touch1&&a.touch1[2]===o.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(o=zt(o,this),Math.hypot(n[0]-o[0],n[1]-o[1])<g)){var l=Ot(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return v.transform=function(t,n,e,r){var i=t.selection?t.selection():t;i.property("__zoom",er),t!==i?x(t,n,e,r):i.interrupt().each((function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()}))},v.scaleBy=function(t,n,e,r){v.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof n?n.apply(this,arguments):n)}),e,r)},v.scaleTo=function(t,n,e,r){v.transform(t,(function(){var t=i.apply(this,arguments),r=this.__zoom,a=null==e?b(t):"function"==typeof e?e.apply(this,arguments):e,u=r.invert(a),s="function"==typeof n?n.apply(this,arguments):n;return o(_(m(r,s),a,u),t,l)}),e,r)},v.translateBy=function(t,n,e,r){v.transform(t,(function(){return o(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),i.apply(this,arguments),l)}),null,r)},v.translateTo=function(t,n,e,r,a){v.transform(t,(function(){var