@kit-data-manager/visualization-component
Version:
The visualization-component is a dynamic, interactive graph component built using D3.js. It is designed to render graphs based on provided JSON data, making it ideal for visualizing complex relationships and networks in an intuitive manner.
1 lines • 79 kB
JavaScript
import{r as t,h as n,g as i}from"./p-d3a03820.js";function r(t,n){return t==null||n==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}class e extends Map{constructor(t,n=f){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}});if(t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(o(this,t))}has(t){return super.has(o(this,t))}set(t,n){return super.set(u(this,t),n)}delete(t){return super.delete(s(this,t))}}function o({_intern:t,_key:n},i){const r=n(i);return t.has(r)?t.get(r):i}function u({_intern:t,_key:n},i){const r=n(i);if(t.has(r))return t.get(r);t.set(r,i);return i}function s({_intern:t,_key:n},i){const r=n(i);if(t.has(r)){i=t.get(r);t.delete(r)}return i}function f(t){return t!==null&&typeof t==="object"?t.valueOf():t}var a={value:()=>{}};function c(){for(var t=0,n=arguments.length,i={},r;t<n;++t){if(!(r=arguments[t]+"")||r in i||/[\s.]/.test(r))throw new Error("illegal type: "+r);i[r]=[]}return new h(i)}function h(t){this._=t}function l(t,n){return t.trim().split(/^|\s+/).map((function(t){var i="",r=t.indexOf(".");if(r>=0)i=t.slice(r+1),t=t.slice(0,r);if(t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}}))}h.prototype=c.prototype={constructor:h,on:function(t,n){var i=this._,r=l(t+"",i),e,o=-1,u=r.length;if(arguments.length<2){while(++o<u)if((e=(t=r[o]).type)&&(e=d(i[e],t.name)))return e;return}if(n!=null&&typeof n!=="function")throw new Error("invalid callback: "+n);while(++o<u){if(e=(t=r[o]).type)i[e]=v(i[e],t.name,n);else if(n==null)for(e in i)i[e]=v(i[e],t.name,null)}return this},copy:function(){var t={},n=this._;for(var i in n)t[i]=n[i].slice();return new h(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var i=new Array(e),r=0,e,o;r<e;++r)i[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,e=o.length;r<e;++r)o[r].value.apply(n,i)},apply:function(t,n,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],e=0,o=r.length;e<o;++e)r[e].value.apply(n,i)}};function d(t,n){for(var i=0,r=t.length,e;i<r;++i){if((e=t[i]).name===n){return e.value}}}function v(t,n,i){for(var r=0,e=t.length;r<e;++r){if(t[r].name===n){t[r]=a,t=t.slice(0,r).concat(t.slice(r+1));break}}if(i!=null)t.push({name:n,value:i});return t}var p="http://www.w3.org/1999/xhtml";const y={svg:"http://www.w3.org/2000/svg",xhtml:p,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function w(t){var n=t+="",i=n.indexOf(":");if(i>=0&&(n=t.slice(0,i))!=="xmlns")t=t.slice(i+1);return y.hasOwnProperty(n)?{space:y[n],local:t}:t}function g(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===p&&n.documentElement.namespaceURI===p?n.createElement(t):n.createElementNS(i,t)}}function m(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function b(t){var n=w(t);return(n.local?m:g)(n)}function k(){}function M(t){return t==null?k:function(){return this.querySelector(t)}}function x(t){if(typeof t!=="function")t=M(t);for(var n=this._groups,i=n.length,r=new Array(i),e=0;e<i;++e){for(var o=n[e],u=o.length,s=r[e]=new Array(u),f,a,c=0;c<u;++c){if((f=o[c])&&(a=t.call(f,f.__data__,c,o))){if("__data__"in f)a.__data__=f.__data__;s[c]=a}}}return new ln(r,this._parents)}function N(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function A(){return[]}function $(t){return t==null?A:function(){return this.querySelectorAll(t)}}function E(t){return function(){return N(t.apply(this,arguments))}}function C(t){if(typeof t==="function")t=E(t);else t=$(t);for(var n=this._groups,i=n.length,r=[],e=[],o=0;o<i;++o){for(var u=n[o],s=u.length,f,a=0;a<s;++a){if(f=u[a]){r.push(t.call(f,f.__data__,a,u));e.push(f)}}}return new ln(r,e)}function _(t){return function(){return this.matches(t)}}function z(t){return function(n){return n.matches(t)}}var S=Array.prototype.find;function j(t){return function(){return S.call(this.children,t)}}function I(){return this.firstElementChild}function T(t){return this.select(t==null?I:j(typeof t==="function"?t:z(t)))}var L=Array.prototype.filter;function F(){return Array.from(this.children)}function O(t){return function(){return L.call(this.children,t)}}function P(t){return this.selectAll(t==null?F:O(typeof t==="function"?t:z(t)))}function Y(t){if(typeof t!=="function")t=_(t);for(var n=this._groups,i=n.length,r=new Array(i),e=0;e<i;++e){for(var o=n[e],u=o.length,s=r[e]=[],f,a=0;a<u;++a){if((f=o[a])&&t.call(f,f.__data__,a,o)){s.push(f)}}}return new ln(r,this._parents)}function D(t){return new Array(t.length)}function R(){return new ln(this._enter||this._groups.map(D),this._parents)}function X(t,n){this.ownerDocument=t.ownerDocument;this.namespaceURI=t.namespaceURI;this._next=null;this._parent=t;this.__data__=n}X.prototype={constructor:X,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)}};function q(t){return function(){return t}}function H(t,n,i,r,e,o){var u=0,s,f=n.length,a=o.length;for(;u<a;++u){if(s=n[u]){s.__data__=o[u];r[u]=s}else{i[u]=new X(t,o[u])}}for(;u<f;++u){if(s=n[u]){e[u]=s}}}function B(t,n,i,r,e,o,u){var s,f,a=new Map,c=n.length,h=o.length,l=new Array(c),d;for(s=0;s<c;++s){if(f=n[s]){l[s]=d=u.call(f,f.__data__,s,n)+"";if(a.has(d)){e[s]=f}else{a.set(d,f)}}}for(s=0;s<h;++s){d=u.call(t,o[s],s,o)+"";if(f=a.get(d)){r[s]=f;f.__data__=o[s];a.delete(d)}else{i[s]=new X(t,o[s])}}for(s=0;s<c;++s){if((f=n[s])&&a.get(l[s])===f){e[s]=f}}}function V(t){return t.__data__}function W(t,n){if(!arguments.length)return Array.from(this,V);var i=n?B:H,r=this._parents,e=this._groups;if(typeof t!=="function")t=q(t);for(var o=e.length,u=new Array(o),s=new Array(o),f=new Array(o),a=0;a<o;++a){var c=r[a],h=e[a],l=h.length,d=K(t.call(c,c&&c.__data__,a,r)),v=d.length,p=s[a]=new Array(v),y=u[a]=new Array(v),w=f[a]=new Array(l);i(c,h,p,y,w,d,n);for(var g=0,m=0,b,k;g<v;++g){if(b=p[g]){if(g>=m)m=g+1;while(!(k=y[m])&&++m<v);b._next=k||null}}}u=new ln(u,r);u._enter=s;u._exit=f;return u}function K(t){return typeof t==="object"&&"length"in t?t:Array.from(t)}function G(){return new ln(this._exit||this._groups.map(D),this._parents)}function J(t,n,i){var r=this.enter(),e=this,o=this.exit();if(typeof t==="function"){r=t(r);if(r)r=r.selection()}else{r=r.append(t+"")}if(n!=null){e=n(e);if(e)e=e.selection()}if(i==null)o.remove();else i(o);return r&&e?r.merge(e).order():e}function Q(t){var n=t.selection?t.selection():t;for(var i=this._groups,r=n._groups,e=i.length,o=r.length,u=Math.min(e,o),s=new Array(e),f=0;f<u;++f){for(var a=i[f],c=r[f],h=a.length,l=s[f]=new Array(h),d,v=0;v<h;++v){if(d=a[v]||c[v]){l[v]=d}}}for(;f<e;++f){s[f]=i[f]}return new ln(s,this._parents)}function U(){for(var t=this._groups,n=-1,i=t.length;++n<i;){for(var r=t[n],e=r.length-1,o=r[e],u;--e>=0;){if(u=r[e]){if(o&&u.compareDocumentPosition(o)^4)o.parentNode.insertBefore(u,o);o=u}}}return this}function Z(t){if(!t)t=tt;function n(n,i){return n&&i?t(n.__data__,i.__data__):!n-!i}for(var i=this._groups,r=i.length,e=new Array(r),o=0;o<r;++o){for(var u=i[o],s=u.length,f=e[o]=new Array(s),a,c=0;c<s;++c){if(a=u[c]){f[c]=a}}f.sort(n)}return new ln(e,this._parents).order()}function tt(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function nt(){var t=arguments[0];arguments[0]=this;t.apply(null,arguments);return this}function it(){return Array.from(this)}function rt(){for(var t=this._groups,n=0,i=t.length;n<i;++n){for(var r=t[n],e=0,o=r.length;e<o;++e){var u=r[e];if(u)return u}}return null}function et(){let t=0;for(const n of this)++t;return t}function ot(){return!this.node()}function ut(t){for(var n=this._groups,i=0,r=n.length;i<r;++i){for(var e=n[i],o=0,u=e.length,s;o<u;++o){if(s=e[o])t.call(s,s.__data__,o,e)}}return this}function st(t){return function(){this.removeAttribute(t)}}function ft(t){return function(){this.removeAttributeNS(t.space,t.local)}}function at(t,n){return function(){this.setAttribute(t,n)}}function ct(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function ht(t,n){return function(){var i=n.apply(this,arguments);if(i==null)this.removeAttribute(t);else this.setAttribute(t,i)}}function lt(t,n){return function(){var i=n.apply(this,arguments);if(i==null)this.removeAttributeNS(t.space,t.local);else this.setAttributeNS(t.space,t.local,i)}}function dt(t,n){var i=w(t);if(arguments.length<2){var r=this.node();return i.local?r.getAttributeNS(i.space,i.local):r.getAttribute(i)}return this.each((n==null?i.local?ft:st:typeof n==="function"?i.local?lt:ht:i.local?ct:at)(i,n))}function vt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function pt(t){return function(){this.style.removeProperty(t)}}function yt(t,n,i){return function(){this.style.setProperty(t,n,i)}}function wt(t,n,i){return function(){var r=n.apply(this,arguments);if(r==null)this.style.removeProperty(t);else this.style.setProperty(t,r,i)}}function gt(t,n,i){return arguments.length>1?this.each((n==null?pt:typeof n==="function"?wt:yt)(t,n,i==null?"":i)):mt(this.node(),t)}function mt(t,n){return t.style.getPropertyValue(n)||vt(t).getComputedStyle(t,null).getPropertyValue(n)}function bt(t){return function(){delete this[t]}}function kt(t,n){return function(){this[t]=n}}function Mt(t,n){return function(){var i=n.apply(this,arguments);if(i==null)delete this[t];else this[t]=i}}function xt(t,n){return arguments.length>1?this.each((n==null?bt:typeof n==="function"?Mt:kt)(t,n)):this.node()[t]}function Nt(t){return t.trim().split(/^|\s+/)}function At(t){return t.classList||new $t(t)}function $t(t){this._node=t;this._names=Nt(t.getAttribute("class")||"")}$t.prototype={add:function(t){var n=this._names.indexOf(t);if(n<0){this._names.push(t);this._node.setAttribute("class",this._names.join(" "))}},remove:function(t){var n=this._names.indexOf(t);if(n>=0){this._names.splice(n,1);this._node.setAttribute("class",this._names.join(" "))}},contains:function(t){return this._names.indexOf(t)>=0}};function Et(t,n){var i=At(t),r=-1,e=n.length;while(++r<e)i.add(n[r])}function Ct(t,n){var i=At(t),r=-1,e=n.length;while(++r<e)i.remove(n[r])}function _t(t){return function(){Et(this,t)}}function zt(t){return function(){Ct(this,t)}}function St(t,n){return function(){(n.apply(this,arguments)?Et:Ct)(this,t)}}function jt(t,n){var i=Nt(t+"");if(arguments.length<2){var r=At(this.node()),e=-1,o=i.length;while(++e<o)if(!r.contains(i[e]))return false;return true}return this.each((typeof n==="function"?St:n?_t:zt)(i,n))}function It(){this.textContent=""}function Tt(t){return function(){this.textContent=t}}function Lt(t){return function(){var n=t.apply(this,arguments);this.textContent=n==null?"":n}}function Ft(t){return arguments.length?this.each(t==null?It:(typeof t==="function"?Lt:Tt)(t)):this.node().textContent}function Ot(){this.innerHTML=""}function Pt(t){return function(){this.innerHTML=t}}function Yt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n==null?"":n}}function Dt(t){return arguments.length?this.each(t==null?Ot:(typeof t==="function"?Yt:Pt)(t)):this.node().innerHTML}function Rt(){if(this.nextSibling)this.parentNode.appendChild(this)}function Xt(){return this.each(Rt)}function qt(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ht(){return this.each(qt)}function Bt(t){var n=typeof t==="function"?t:b(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))}function Vt(){return null}function Wt(t,n){var i=typeof t==="function"?t:b(t),r=n==null?Vt:typeof n==="function"?n:M(n);return this.select((function(){return this.insertBefore(i.apply(this,arguments),r.apply(this,arguments)||null)}))}function Kt(){var t=this.parentNode;if(t)t.removeChild(this)}function Gt(){return this.each(Kt)}function Jt(){var t=this.cloneNode(false),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Qt(){var t=this.cloneNode(true),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Ut(t){return this.select(t?Qt:Jt)}function Zt(t){return arguments.length?this.property("__data__",t):this.node().__data__}function tn(t){return function(n){t.call(this,n,this.__data__)}}function nn(t){return t.trim().split(/^|\s+/).map((function(t){var n="",i=t.indexOf(".");if(i>=0)n=t.slice(i+1),t=t.slice(0,i);return{type:t,name:n}}))}function rn(t){return function(){var n=this.__on;if(!n)return;for(var i=0,r=-1,e=n.length,o;i<e;++i){if(o=n[i],(!t.type||o.type===t.type)&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options)}else{n[++r]=o}}if(++r)n.length=r;else delete this.__on}}function en(t,n,i){return function(){var r=this.__on,e,o=tn(n);if(r)for(var u=0,s=r.length;u<s;++u){if((e=r[u]).type===t.type&&e.name===t.name){this.removeEventListener(e.type,e.listener,e.options);this.addEventListener(e.type,e.listener=o,e.options=i);e.value=n;return}}this.addEventListener(t.type,o,i);e={type:t.type,name:t.name,value:n,listener:o,options:i};if(!r)this.__on=[e];else r.push(e)}}function on(t,n,i){var r=nn(t+""),e,o=r.length,u;if(arguments.length<2){var s=this.node().__on;if(s)for(var f=0,a=s.length,c;f<a;++f){for(e=0,c=s[f];e<o;++e){if((u=r[e]).type===c.type&&u.name===c.name){return c.value}}}return}s=n?en:rn;for(e=0;e<o;++e)this.each(s(r[e],n,i));return this}function un(t,n,i){var r=vt(t),e=r.CustomEvent;if(typeof e==="function"){e=new e(n,i)}else{e=r.document.createEvent("Event");if(i)e.initEvent(n,i.bubbles,i.cancelable),e.detail=i.detail;else e.initEvent(n,false,false)}t.dispatchEvent(e)}function sn(t,n){return function(){return un(this,t,n)}}function fn(t,n){return function(){return un(this,t,n.apply(this,arguments))}}function an(t,n){return this.each((typeof n==="function"?fn:sn)(t,n))}function*cn(){for(var t=this._groups,n=0,i=t.length;n<i;++n){for(var r=t[n],e=0,o=r.length,u;e<o;++e){if(u=r[e])yield u}}}var hn=[null];function ln(t,n){this._groups=t;this._parents=n}function dn(){return new ln([[document.documentElement]],hn)}function vn(){return this}ln.prototype=dn.prototype={constructor:ln,select:x,selectAll:C,selectChild:T,selectChildren:P,filter:Y,data:W,enter:R,exit:G,join:J,merge:Q,selection:vn,order:U,sort:Z,call:nt,nodes:it,node:rt,size:et,empty:ot,each:ut,attr:dt,style:gt,property:xt,classed:jt,text:Ft,html:Dt,raise:Xt,lower:Ht,append:Bt,insert:Wt,remove:Gt,clone:Ut,datum:Zt,on,dispatch:an,[Symbol.iterator]:cn};function pn(t){return typeof t==="string"?new ln([[document.querySelector(t)]],[document.documentElement]):new ln([[t]],hn)}function yn(t){let n;while(n=t.sourceEvent)t=n;return t}function wn(t,n){t=yn(t);if(n===undefined)n=t.currentTarget;if(n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var r=i.createSVGPoint();r.x=t.clientX,r.y=t.clientY;r=r.matrixTransform(n.getScreenCTM().inverse());return[r.x,r.y]}if(n.getBoundingClientRect){var e=n.getBoundingClientRect();return[t.clientX-e.left-n.clientLeft,t.clientY-e.top-n.clientTop]}}return[t.pageX,t.pageY]}function gn(t){return typeof t==="string"?new ln([document.querySelectorAll(t)],[document.documentElement]):new ln([N(t)],hn)}const mn={passive:false};const bn={capture:true,passive:false};function kn(t){t.stopImmediatePropagation()}function Mn(t){t.preventDefault();t.stopImmediatePropagation()}function xn(t){var n=t.document.documentElement,i=pn(t).on("dragstart.drag",Mn,bn);if("onselectstart"in n){i.on("selectstart.drag",Mn,bn)}else{n.__noselect=n.style.MozUserSelect;n.style.MozUserSelect="none"}}function Nn(t,n){var i=t.document.documentElement,r=pn(t).on("dragstart.drag",null);if(n){r.on("click.drag",Mn,bn);setTimeout((function(){r.on("click.drag",null)}),0)}if("onselectstart"in i){r.on("selectstart.drag",null)}else{i.style.MozUserSelect=i.__noselect;delete i.__noselect}}const An=t=>()=>t;function $n(t,{sourceEvent:n,subject:i,target:r,identifier:e,active:o,x:u,y:s,dx:f,dy:a,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:true,configurable:true},sourceEvent:{value:n,enumerable:true,configurable:true},subject:{value:i,enumerable:true,configurable:true},target:{value:r,enumerable:true,configurable:true},identifier:{value:e,enumerable:true,configurable:true},active:{value:o,enumerable:true,configurable:true},x:{value:u,enumerable:true,configurable:true},y:{value:s,enumerable:true,configurable:true},dx:{value:f,enumerable:true,configurable:true},dy:{value:a,enumerable:true,configurable:true},_:{value:c}})}$n.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function En(t){return!t.ctrlKey&&!t.button}function Cn(){return this.parentNode}function _n(t,n){return n==null?{x:t.x,y:t.y}:n}function zn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sn(){var t=En,n=Cn,i=_n,r=zn,e={},o=c("start","drag","end"),u=0,s,f,a,h,l=0;function d(t){t.on("mousedown.drag",v).filter(r).on("touchstart.drag",w).on("touchmove.drag",g,mn).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(i,r){if(h||!t.call(this,i,r))return;var e=b(this,n.call(this,i,r),i,r,"mouse");if(!e)return;pn(i.view).on("mousemove.drag",p,bn).on("mouseup.drag",y,bn);xn(i.view);kn(i);a=false;s=i.clientX;f=i.clientY;e("start",i)}function p(t){Mn(t);if(!a){var n=t.clientX-s,i=t.clientY-f;a=n*n+i*i>l}e.mouse("drag",t)}function y(t){pn(t.view).on("mousemove.drag mouseup.drag",null);Nn(t.view,a);Mn(t);e.mouse("end",t)}function w(i,r){if(!t.call(this,i,r))return;var e=i.changedTouches,o=n.call(this,i,r),u=e.length,s,f;for(s=0;s<u;++s){if(f=b(this,o,i,r,e[s].identifier,e[s])){kn(i);f("start",i,e[s])}}}function g(t){var n=t.changedTouches,i=n.length,r,o;for(r=0;r<i;++r){if(o=e[n[r].identifier]){Mn(t);o("drag",t,n[r])}}}function m(t){var n=t.changedTouches,i=n.length,r,o;if(h)clearTimeout(h);h=setTimeout((function(){h=null}),500);for(r=0;r<i;++r){if(o=e[n[r].identifier]){kn(t);o("end",t,n[r])}}}function b(t,n,r,s,f,a){var c=o.copy(),h=wn(a||r,n),l,v,p;if((p=i.call(t,new $n("beforestart",{sourceEvent:r,target:d,identifier:f,active:u,x:h[0],y:h[1],dx:0,dy:0,dispatch:c}),s))==null)return;l=p.x-h[0]||0;v=p.y-h[1]||0;return function i(r,o,a){var y=h,w;switch(r){case"start":e[f]=i,w=u++;break;case"end":delete e[f],--u;case"drag":h=wn(a||o,n),w=u;break}c.call(r,t,new $n(r,{sourceEvent:o,subject:p,target:d,identifier:f,active:w,x:h[0]+l,y:h[1]+v,dx:h[0]-y[0],dy:h[1]-y[1],dispatch:c}),s)}}d.filter=function(n){return arguments.length?(t=typeof n==="function"?n:An(!!n),d):t};d.container=function(t){return arguments.length?(n=typeof t==="function"?t:An(t),d):n};d.subject=function(t){return arguments.length?(i=typeof t==="function"?t:An(t),d):i};d.touchable=function(t){return arguments.length?(r=typeof t==="function"?t:An(!!t),d):r};d.on=function(){var t=o.on.apply(o,arguments);return t===o?d:t};d.clickDistance=function(t){return arguments.length?(l=(t=+t)*t,d):Math.sqrt(l)};return d}function jn(t,n,i){t.prototype=n.prototype=i;i.constructor=t}function In(t,n){var i=Object.create(t.prototype);for(var r in n)i[r]=n[r];return i}function Tn(){}var Ln=.7;var Fn=1/Ln;var On="\\s*([+-]?\\d+)\\s*",Pn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dn=/^#([0-9a-f]{3,8})$/,Rn=new RegExp(`^rgb\\(${On},${On},${On}\\)$`),Xn=new RegExp(`^rgb\\(${Yn},${Yn},${Yn}\\)$`),qn=new RegExp(`^rgba\\(${On},${On},${On},${Pn}\\)$`),Hn=new RegExp(`^rgba\\(${Yn},${Yn},${Yn},${Pn}\\)$`),Bn=new RegExp(`^hsl\\(${Pn},${Yn},${Yn}\\)$`),Vn=new RegExp(`^hsla\\(${Pn},${Yn},${Yn},${Pn}\\)$`);var Wn={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};jn(Tn,Un,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Kn,formatHex:Kn,formatHex8:Gn,formatHsl:Jn,formatRgb:Qn,toString:Qn});function Kn(){return this.rgb().formatHex()}function Gn(){return this.rgb().formatHex8()}function Jn(){return hi(this).formatHsl()}function Qn(){return this.rgb().formatRgb()}function Un(t){var n,i;t=(t+"").trim().toLowerCase();return(n=Dn.exec(t))?(i=n[1].length,n=parseInt(n[1],16),i===6?Zn(n):i===3?new ri(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?ti(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?ti(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Rn.exec(t))?new ri(n[1],n[2],n[3],1):(n=Xn.exec(t))?new ri(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=qn.exec(t))?ti(n[1],n[2],n[3],n[4]):(n=Hn.exec(t))?ti(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Bn.exec(t))?ci(n[1],n[2]/100,n[3]/100,1):(n=Vn.exec(t))?ci(n[1],n[2]/100,n[3]/100,n[4]):Wn.hasOwnProperty(t)?Zn(Wn[t]):t==="transparent"?new ri(NaN,NaN,NaN,0):null}function Zn(t){return new ri(t>>16&255,t>>8&255,t&255,1)}function ti(t,n,i,r){if(r<=0)t=n=i=NaN;return new ri(t,n,i,r)}function ni(t){if(!(t instanceof Tn))t=Un(t);if(!t)return new ri;t=t.rgb();return new ri(t.r,t.g,t.b,t.opacity)}function ii(t,n,i,r){return arguments.length===1?ni(t):new ri(t,n,i,r==null?1:r)}function ri(t,n,i,r){this.r=+t;this.g=+n;this.b=+i;this.opacity=+r}jn(ri,ii,In(Tn,{brighter(t){t=t==null?Fn:Math.pow(Fn,t);return new ri(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){t=t==null?Ln:Math.pow(Ln,t);return new ri(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ri(fi(this.r),fi(this.g),fi(this.b),si(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:ei,formatHex:ei,formatHex8:oi,formatRgb:ui,toString:ui}));function ei(){return`#${ai(this.r)}${ai(this.g)}${ai(this.b)}`}function oi(){return`#${ai(this.r)}${ai(this.g)}${ai(this.b)}${ai((isNaN(this.opacity)?1:this.opacity)*255)}`}function ui(){const t=si(this.opacity);return`${t===1?"rgb(":"rgba("}${fi(this.r)}, ${fi(this.g)}, ${fi(this.b)}${t===1?")":`, ${t})`}`}function si(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function fi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ai(t){t=fi(t);return(t<16?"0":"")+t.toString(16)}function ci(t,n,i,r){if(r<=0)t=n=i=NaN;else if(i<=0||i>=1)t=n=NaN;else if(n<=0)t=NaN;return new di(t,n,i,r)}function hi(t){if(t instanceof di)return new di(t.h,t.s,t.l,t.opacity);if(!(t instanceof Tn))t=Un(t);if(!t)return new di;if(t instanceof di)return t;t=t.rgb();var n=t.r/255,i=t.g/255,r=t.b/255,e=Math.min(n,i,r),o=Math.max(n,i,r),u=NaN,s=o-e,f=(o+e)/2;if(s){if(n===o)u=(i-r)/s+(i<r)*6;else if(i===o)u=(r-n)/s+2;else u=(n-i)/s+4;s/=f<.5?o+e:2-o-e;u*=60}else{s=f>0&&f<1?0:u}return new di(u,s,f,t.opacity)}function li(t,n,i,r){return arguments.length===1?hi(t):new di(t,n,i,r==null?1:r)}function di(t,n,i,r){this.h=+t;this.s=+n;this.l=+i;this.opacity=+r}jn(di,li,In(Tn,{brighter(t){t=t==null?Fn:Math.pow(Fn,t);return new di(this.h,this.s,this.l*t,this.opacity)},darker(t){t=t==null?Ln:Math.pow(Ln,t);return new di(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,r=i+(i<.5?i:1-i)*n,e=2*i-r;return new ri(yi(t>=240?t-240:t+120,e,r),yi(t,e,r),yi(t<120?t+240:t-120,e,r),this.opacity)},clamp(){return new di(vi(this.h),pi(this.s),pi(this.l),si(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=si(this.opacity);return`${t===1?"hsl(":"hsla("}${vi(this.h)}, ${pi(this.s)*100}%, ${pi(this.l)*100}%${t===1?")":`, ${t})`}`}}));function vi(t){t=(t||0)%360;return t<0?t+360:t}function pi(t){return Math.max(0,Math.min(1,t||0))}function yi(t,n,i){return(t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n)*255}const wi=t=>()=>t;function gi(t,n){return function(i){return t+i*n}}function mi(t,n,i){return t=Math.pow(t,i),n=Math.pow(n,i)-t,i=1/i,function(r){return Math.pow(t+r*n,i)}}function bi(t){return(t=+t)===1?ki:function(n,i){return i-n?mi(n,i,t):wi(isNaN(n)?i:n)}}function ki(t,n){var i=n-t;return i?gi(t,i):wi(isNaN(t)?n:t)}const Mi=function t(n){var i=bi(n);function r(t,n){var r=i((t=ii(t)).r,(n=ii(n)).r),e=i(t.g,n.g),o=i(t.b,n.b),u=ki(t.opacity,n.opacity);return function(n){t.r=r(n);t.g=e(n);t.b=o(n);t.opacity=u(n);return t+""}}r.gamma=t;return r}(1);function xi(t,n){return t=+t,n=+n,function(i){return t*(1-i)+n*i}}var Ni=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ai=new RegExp(Ni.source,"g");function $i(t){return function(){return t}}function Ei(t){return function(n){return t(n)+""}}function Ci(t,n){var i=Ni.lastIndex=Ai.lastIndex=0,r,e,o,u=-1,s=[],f=[];t=t+"",n=n+"";while((r=Ni.exec(t))&&(e=Ai.exec(n))){if((o=e.index)>i){o=n.slice(i,o);if(s[u])s[u]+=o;else s[++u]=o}if((r=r[0])===(e=e[0])){if(s[u])s[u]+=e;else s[++u]=e}else{s[++u]=null;f.push({i:u,x:xi(r,e)})}i=Ai.lastIndex}if(i<n.length){o=n.slice(i);if(s[u])s[u]+=o;else s[++u]=o}return s.length<2?f[0]?Ei(f[0].x):$i(n):(n=f.length,function(t){for(var i=0,r;i<n;++i)s[(r=f[i]).i]=r.x(t);return s.join("")})}var _i=180/Math.PI;var zi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Si(t,n,i,r,e,o){var u,s,f;if(u=Math.sqrt(t*t+n*n))t/=u,n/=u;if(f=t*i+n*r)i-=t*f,r-=n*f;if(s=Math.sqrt(i*i+r*r))i/=s,r/=s,f/=s;if(t*r<n*i)t=-t,n=-n,f=-f,u=-u;return{translateX:e,translateY:o,rotate:Math.atan2(n,t)*_i,skewX:Math.atan(f)*_i,scaleX:u,scaleY:s}}var ji;function Ii(t){const n=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?zi:Si(n.a,n.b,n.c,n.d,n.e,n.f)}function Ti(t){if(t==null)return zi;if(!ji)ji=document.createElementNS("http://www.w3.org/2000/svg","g");ji.setAttribute("transform",t);if(!(t=ji.transform.baseVal.consolidate()))return zi;t=t.matrix;return Si(t.a,t.b,t.c,t.d,t.e,t.f)}function Li(t,n,i,r){function e(t){return t.length?t.pop()+" ":""}function o(t,r,e,o,u,s){if(t!==e||r!==o){var f=u.push("translate(",null,n,null,i);s.push({i:f-4,x:xi(t,e)},{i:f-2,x:xi(r,o)})}else if(e||o){u.push("translate("+e+n+o+i)}}function u(t,n,i,o){if(t!==n){if(t-n>180)n+=360;else if(n-t>180)t+=360;o.push({i:i.push(e(i)+"rotate(",null,r)-2,x:xi(t,n)})}else if(n){i.push(e(i)+"rotate("+n+r)}}function s(t,n,i,o){if(t!==n){o.push({i:i.push(e(i)+"skewX(",null,r)-2,x:xi(t,n)})}else if(n){i.push(e(i)+"skewX("+n+r)}}function f(t,n,i,r,o,u){if(t!==i||n!==r){var s=o.push(e(o)+"scale(",null,",",null,")");u.push({i:s-4,x:xi(t,i)},{i:s-2,x:xi(n,r)})}else if(i!==1||r!==1){o.push(e(o)+"scale("+i+","+r+")")}}return function(n,i){var r=[],e=[];n=t(n),i=t(i);o(n.translateX,n.translateY,i.translateX,i.translateY,r,e);u(n.rotate,i.rotate,r,e);s(n.skewX,i.skewX,r,e);f(n.scaleX,n.scaleY,i.scaleX,i.scaleY,r,e);n=i=null;return function(t){var n=-1,i=e.length,o;while(++n<i)r[(o=e[n]).i]=o.x(t);return r.join("")}}}var Fi=Li(Ii,"px, ","px)","deg)");var Oi=Li(Ti,", ",")",")");var Pi=1e-12;function Yi(t){return((t=Math.exp(t))+1/t)/2}function Di(t){return((t=Math.exp(t))-1/t)/2}function Ri(t){return((t=Math.exp(2*t))-1)/(t+1)}const Xi=function t(n,i,r){function e(t,e){var o=t[0],u=t[1],s=t[2],f=e[0],a=e[1],c=e[2],h=f-o,l=a-u,d=h*h+l*l,v,p;if(d<Pi){p=Math.log(c/s)/n;v=function(t){return[o+t*h,u+t*l,s*Math.exp(n*t*p)]}}else{var y=Math.sqrt(d),w=(c*c-s*s+r*d)/(2*s*i*y),g=(c*c-s*s-r*d)/(2*c*i*y),m=Math.log(Math.sqrt(w*w+1)-w),b=Math.log(Math.sqrt(g*g+1)-g);p=(b-m)/n;v=function(t){var r=t*p,e=Yi(m),f=s/(i*y)*(e*Ri(n*r+m)-Di(m));return[o+f*h,u+f*l,s*e/Yi(n*r+m)]}}v.duration=p*1e3*n/Math.SQRT2;return v}e.rho=function(n){var i=Math.max(.001,+n),r=i*i,e=r*r;return t(i,r,e)};return e}(Math.SQRT2,2,4);var qi=0,Hi=0,Bi=0,Vi=1e3,Wi,Ki,Gi=0,Ji=0,Qi=0,Ui=typeof performance==="object"&&performance.now?performance:Date,Zi=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function tr(){return Ji||(Zi(nr),Ji=Ui.now()+Qi)}function nr(){Ji=0}function ir(){this._call=this._time=this._next=null}ir.prototype=rr.prototype={constructor:ir,restart:function(t,n,i){if(typeof t!=="function")throw new TypeError("callback is not a function");i=(i==null?tr():+i)+(n==null?0:+n);if(!this._next&&Ki!==this){if(Ki)Ki._next=this;else Wi=this;Ki=this}this._call=t;this._time=i;fr()},stop:function(){if(this._call){this._call=null;this._time=Infinity;fr()}}};function rr(t,n,i){var r=new ir;r.restart(t,n,i);return r}function er(){tr();++qi;var t=Wi,n;while(t){if((n=Ji-t._time)>=0)t._call.call(undefined,n);t=t._next}--qi}function or(){Ji=(Gi=Ui.now())+Qi;qi=Hi=0;try{er()}finally{qi=0;sr();Ji=0}}function ur(){var t=Ui.now(),n=t-Gi;if(n>Vi)Qi-=n,Gi=t}function sr(){var t,n=Wi,i,r=Infinity;while(n){if(n._call){if(r>n._time)r=n._time;t=n,n=n._next}else{i=n._next,n._next=null;n=t?t._next=i:Wi=i}}Ki=t;fr(r)}function fr(t){if(qi)return;if(Hi)Hi=clearTimeout(Hi);var n=t-Ji;if(n>24){if(t<Infinity)Hi=setTimeout(or,t-Ui.now()-Qi);if(Bi)Bi=clearInterval(Bi)}else{if(!Bi)Gi=Ui.now(),Bi=setInterval(ur,Vi);qi=1,Zi(or)}}function ar(t,n,i){var r=new ir;n=n==null?0:+n;r.restart((i=>{r.stop();t(i+n)}),n,i);return r}var cr=c("start","end","cancel","interrupt");var hr=[];var lr=0;var dr=1;var vr=2;var pr=3;var yr=4;var wr=5;var gr=6;function mr(t,n,i,r,e,o){var u=t.__transition;if(!u)t.__transition={};else if(i in u)return;xr(t,i,{name:n,index:r,group:e,on:cr,tween:hr,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:lr})}function br(t,n){var i=Mr(t,n);if(i.state>lr)throw new Error("too late; already scheduled");return i}function kr(t,n){var i=Mr(t,n);if(i.state>pr)throw new Error("too late; already running");return i}function Mr(t,n){var i=t.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function xr(t,n,i){var r=t.__transition,e;r[n]=i;i.timer=rr(o,0,i.time);function o(t){i.state=dr;i.timer.restart(u,i.delay,i.time);if(i.delay<=t)u(t-i.delay)}function u(o){var a,c,h,l;if(i.state!==dr)return f();for(a in r){l=r[a];if(l.name!==i.name)continue;if(l.state===pr)return ar(u);if(l.state===yr){l.state=gr;l.timer.stop();l.on.call("interrupt",t,t.__data__,l.index,l.group);delete r[a]}else if(+a<n){l.state=gr;l.timer.stop();l.on.call("cancel",t,t.__data__,l.index,l.group);delete r[a]}}ar((function(){if(i.state===pr){i.state=yr;i.timer.restart(s,i.delay,i.time);s(o)}}));i.state=vr;i.on.call("start",t,t.__data__,i.index,i.group);if(i.state!==vr)return;i.state=pr;e=new Array(h=i.tween.length);for(a=0,c=-1;a<h;++a){if(l=i.tween[a].value.call(t,t.__data__,i.index,i.group)){e[++c]=l}}e.length=c+1}function s(n){var r=n<i.duration?i.ease.call(null,n/i.duration):(i.timer.restart(f),i.state=wr,1),o=-1,u=e.length;while(++o<u){e[o].call(t,r)}if(i.state===wr){i.on.call("end",t,t.__data__,i.index,i.group);f()}}function f(){i.state=gr;i.timer.stop();delete r[n];for(var e in r)return;delete t.__transition}}function Nr(t,n){var i=t.__transition,r,e,o=true,u;if(!i)return;n=n==null?null:n+"";for(u in i){if((r=i[u]).name!==n){o=false;continue}e=r.state>vr&&r.state<wr;r.state=gr;r.timer.stop();r.on.call(e?"interrupt":"cancel",t,t.__data__,r.index,r.group);delete i[u]}if(o)delete t.__transition}function Ar(t){return this.each((function(){Nr(this,t)}))}function $r(t,n){var i,r;return function(){var e=kr(this,t),o=e.tween;if(o!==i){r=i=o;for(var u=0,s=r.length;u<s;++u){if(r[u].name===n){r=r.slice();r.splice(u,1);break}}}e.tween=r}}function Er(t,n,i){var r,e;if(typeof i!=="function")throw new Error;return function(){var o=kr(this,t),u=o.tween;if(u!==r){e=(r=u).slice();for(var s={name:n,value:i},f=0,a=e.length;f<a;++f){if(e[f].name===n){e[f]=s;break}}if(f===a)e.push(s)}o.tween=e}}function Cr(t,n){var i=this._id;t+="";if(arguments.length<2){var r=Mr(this.node(),i).tween;for(var e=0,o=r.length,u;e<o;++e){if((u=r[e]).name===t){return u.value}}return null}return this.each((n==null?$r:Er)(i,t,n))}function _r(t,n,i){var r=t._id;t.each((function(){var t=kr(this,r);(t.value||(t.value={}))[n]=i.apply(this,arguments)}));return function(t){return Mr(t,r).value[n]}}function zr(t,n){var i;return(typeof n==="number"?xi:n instanceof Un?Mi:(i=Un(n))?(n=i,Mi):Ci)(t,n)}function Sr(t){return function(){this.removeAttribute(t)}}function jr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ir(t,n,i){var r,e=i+"",o;return function(){var u=this.getAttribute(t);return u===e?null:u===r?o:o=n(r=u,i)}}function Tr(t,n,i){var r,e=i+"",o;return function(){var u=this.getAttributeNS(t.space,t.local);return u===e?null:u===r?o:o=n(r=u,i)}}function Lr(t,n,i){var r,e,o;return function(){var u,s=i(this),f;if(s==null)return void this.removeAttribute(t);u=this.getAttribute(t);f=s+"";return u===f?null:u===r&&f===e?o:(e=f,o=n(r=u,s))}}function Fr(t,n,i){var r,e,o;return function(){var u,s=i(this),f;if(s==null)return void this.removeAttributeNS(t.space,t.local);u=this.getAttributeNS(t.space,t.local);f=s+"";return u===f?null:u===r&&f===e?o:(e=f,o=n(r=u,s))}}function Or(t,n){var i=w(t),r=i==="transform"?Oi:zr;return this.attrTween(t,typeof n==="function"?(i.local?Fr:Lr)(i,r,_r(this,"attr."+t,n)):n==null?(i.local?jr:Sr)(i):(i.local?Tr:Ir)(i,r,n))}function Pr(t,n){return function(i){this.setAttribute(t,n.call(this,i))}}function Yr(t,n){return function(i){this.setAttributeNS(t.space,t.local,n.call(this,i))}}function Dr(t,n){var i,r;function e(){var e=n.apply(this,arguments);if(e!==r)i=(r=e)&&Yr(t,e);return i}e._value=n;return e}function Rr(t,n){var i,r;function e(){var e=n.apply(this,arguments);if(e!==r)i=(r=e)&&Pr(t,e);return i}e._value=n;return e}function Xr(t,n){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!=="function")throw new Error;var r=w(t);return this.tween(i,(r.local?Dr:Rr)(r,n))}function qr(t,n){return function(){br(this,t).delay=+n.apply(this,arguments)}}function Hr(t,n){return n=+n,function(){br(this,t).delay=n}}function Br(t){var n=this._id;return arguments.length?this.each((typeof t==="function"?qr:Hr)(n,t)):Mr(this.node(),n).delay}function Vr(t,n){return function(){kr(this,t).duration=+n.apply(this,arguments)}}function Wr(t,n){return n=+n,function(){kr(this,t).duration=n}}function Kr(t){var n=this._id;return arguments.length?this.each((typeof t==="function"?Vr:Wr)(n,t)):Mr(this.node(),n).duration}function Gr(t,n){if(typeof n!=="function")throw new Error;return function(){kr(this,t).ease=n}}function Jr(t){var n=this._id;return arguments.length?this.each(Gr(n,t)):Mr(this.node(),n).ease}function Qr(t,n){return function(){var i=n.apply(this,arguments);if(typeof i!=="function")throw new Error;kr(this,t).ease=i}}function Ur(t){if(typeof t!=="function")throw new Error;return this.each(Qr(this._id,t))}function Zr(t){if(typeof t!=="function")t=_(t);for(var n=this._groups,i=n.length,r=new Array(i),e=0;e<i;++e){for(var o=n[e],u=o.length,s=r[e]=[],f,a=0;a<u;++a){if((f=o[a])&&t.call(f,f.__data__,a,o)){s.push(f)}}}return new Ce(r,this._parents,this._name,this._id)}function te(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,i=t._groups,r=n.length,e=i.length,o=Math.min(r,e),u=new Array(r),s=0;s<o;++s){for(var f=n[s],a=i[s],c=f.length,h=u[s]=new Array(c),l,d=0;d<c;++d){if(l=f[d]||a[d]){h[d]=l}}}for(;s<r;++s){u[s]=n[s]}return new Ce(u,this._parents,this._name,this._id)}function ne(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");if(n>=0)t=t.slice(0,n);return!t||t==="start"}))}function ie(t,n,i){var r,e,o=ne(n)?br:kr;return function(){var u=o(this,t),s=u.on;if(s!==r)(e=(r=s).copy()).on(n,i);u.on=e}}function re(t,n){var i=this._id;return arguments.length<2?Mr(this.node(),i).on.on(t):this.each(ie(i,t,n))}function ee(t){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==t)return;if(n)n.removeChild(this)}}function oe(){return this.on("end.remove",ee(this._id))}function ue(t){var n=this._name,i=this._id;if(typeof t!=="function")t=M(t);for(var r=this._groups,e=r.length,o=new Array(e),u=0;u<e;++u){for(var s=r[u],f=s.length,a=o[u]=new Array(f),c,h,l=0;l<f;++l){if((c=s[l])&&(h=t.call(c,c.__data__,l,s))){if("__data__"in c)h.__data__=c.__data__;a[l]=h;mr(a[l],n,i,l,a,Mr(c,i))}}}return new Ce(o,this._parents,n,i)}function se(t){var n=this._name,i=this._id;if(typeof t!=="function")t=$(t);for(var r=this._groups,e=r.length,o=[],u=[],s=0;s<e;++s){for(var f=r[s],a=f.length,c,h=0;h<a;++h){if(c=f[h]){for(var l=t.call(c,c.__data__,h,f),d,v=Mr(c,i),p=0,y=l.length;p<y;++p){if(d=l[p]){mr(d,n,i,p,l,v)}}o.push(l);u.push(c)}}}return new Ce(o,u,n,i)}var fe=dn.prototype.constructor;function ae(){return new fe(this._groups,this._parents)}function ce(t,n){var i,r,e;return function(){var o=mt(this,t),u=(this.style.removeProperty(t),mt(this,t));return o===u?null:o===i&&u===r?e:e=n(i=o,r=u)}}function he(t){return function(){this.style.removeProperty(t)}}function le(t,n,i){var r,e=i+"",o;return function(){var u=mt(this,t);return u===e?null:u===r?o:o=n(r=u,i)}}function de(t,n,i){var r,e,o;return function(){var u=mt(this,t),s=i(this),f=s+"";if(s==null)f=s=(this.style.removeProperty(t),mt(this,t));return u===f?null:u===r&&f===e?o:(e=f,o=n(r=u,s))}}function ve(t,n){var i,r,e,o="style."+n,u="end."+o,s;return function(){var f=kr(this,t),a=f.on,c=f.value[o]==null?s||(s=he(n)):undefined;if(a!==i||e!==c)(r=(i=a).copy()).on(u,e=c);f.on=r}}function pe(t,n,i){var r=(t+="")==="transform"?Fi:zr;return n==null?this.styleTween(t,ce(t,r)).on("end.style."+t,he(t)):typeof n==="function"?this.styleTween(t,de(t,r,_r(this,"style."+t,n))).each(ve(this._id,t)):this.styleTween(t,le(t,r,n),i).on("end.style."+t,null)}function ye(t,n,i){return function(r){this.style.setProperty(t,n.call(this,r),i)}}function we(t,n,i){var r,e;function o(){var o=n.apply(this,arguments);if(o!==e)r=(e=o)&&ye(t,o,i);return r}o._value=n;return o}function ge(t,n,i){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!=="function")throw new Error;return this.tween(r,we(t,n,i==null?"":i))}function me(t){return function(){this.textContent=t}}function be(t){return function(){var n=t(this);this.textContent=n==null?"":n}}function ke(t){return this.tween("text",typeof t==="function"?be(_r(this,"text",t)):me(t==null?"":t+""))}function Me(t){return function(n){this.textContent=t.call(this,n)}}function xe(t){var n,i;function r(){var r=t.apply(this,arguments);if(r!==i)n=(i=r)&&Me(r);return n}r._value=t;return r}function Ne(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=="function")throw new Error;return this.tween(n,xe(t))}function Ae(){var t=this._name,n=this._id,i=_e();for(var r=this._groups,e=r.length,o=0;o<e;++o){for(var u=r[o],s=u.length,f,a=0;a<s;++a){if(f=u[a]){var c=Mr(f,n);mr(f,t,i,a,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}}}return new Ce(r,this._parents,t,i)}function $e(){var t,n,i=this,r=i._id,e=i.size();return new Promise((function(o,u){var s={value:u},f={value:function(){if(--e===0)o()}};i.each((function(){var i=kr(this,r),e=i.on;if(e!==t){n=(t=e).copy();n._.cancel.push(s);n._.interrupt.push(s);n._.end.push(f)}i.on=n}));if(e===0)o()}))}var Ee=0;function Ce(t,n,i,r){this._groups=t;this._parents=n;this._name=i;this._id=r}function _e(){return++Ee}var ze=dn.prototype;Ce.prototype={constructor:Ce,select:ue,selectAll:se,selectChild:ze.selectChild,selectChildren:ze.selectChildren,filter:Zr,merge:te,selection:ae,transition:Ae,call:ze.call,nodes:ze.nodes,node:ze.node,size:ze.size,empty:ze.empty,each:ze.each,on:re,attr:Or,attrTween:Xr,style:pe,styleTween:ge,text:ke,textTween:Ne,remove:oe,tween:Cr,delay:Br,duration:Kr,ease:Jr,easeVarying:Ur,end:$e,[Symbol.iterator]:ze[Symbol.iterator]};function Se(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var je={time:null,delay:0,duration:250,ease:Se};function Ie(t,n){var i;while(!(i=t.__transition)||!(i=i[n])){if(!(t=t.parentNode)){throw new Error(`transition ${n} not found`)}}return i}function Te(t){var n,i;if(t instanceof Ce){n=t._id,t=t._name}else{n=_e(),(i=je).time=tr(),t=t==null?null:t+""}for(var r=this._groups,e=r.length,o=0;o<e;++o){for(var u=r[o],s=u.length,f,a=0;a<s;++a){if(f=u[a]){mr(f,t,n,a,u,i||Ie(f,n))}}}return new Ce(r,this._parents,t,n)}dn.prototype.interrupt=Ar;dn.prototype.transition=Te;function Le(t,n){var i,r=1;if(t==null)t=0;if(n==null)n=0;function e(){var e,o=i.length,u,s=0,f=0;for(e=0;e<o;++e){u=i[e],s+=u.x,f+=u.y}for(s=(s/o-t)*r,f=(f/o-n)*r,e=0;e<o;++e){u=i[e],u.x-=s,u.y-=f}}e.initialize=function(t){i=t};e.x=function(n){return arguments.length?(t=+n,e):t};e.y=function(t){return arguments.length?(n=+t,e):n};e.strength=function(t){return arguments.length?(r=+t,e):r};return e}function Fe(t){const n=+this._x.call(null,t),i=+this._y.call(null,t);return Oe(this.cover(n,i),n,i,t)}function Oe(t,n,i,r){if(isNaN(n)||isNaN(i))return t;var e,o=t._root,u={data:r},s=t._x0,f=t._y0,a=t._x1,c=t._y1,h,l,d,v,p,y,w,g;if(!o)return t._root=u,t;while(o.length){if(p=n>=(h=(s+a)/2))s=h;else a=h;if(y=i>=(l=(f+c)/2))f=l;else c=l;if(e=o,!(o=o[w=y<<1|p]))return e[w]=u,t}d=+t._x.call(null,o.data);v=+t._y.call(null,o.data);if(n===d&&i===v)return u.next=o,e?e[w]=u:t._root=u,t;do{e=e?e[w]=new Array(4):t._root=new Array(4);if(p=n>=(h=(s+a)/2))s=h;else a=h;if(y=i>=(l=(f+c)/2))f=l;else c=l}while((w=y<<1|p)===(g=(v>=l)<<1|d>=h));return e[g]=o,e[w]=u,t}function Pe(t){var n,i,r=t.length,e,o,u=new Array(r),s=new Array(r),f=Infinity,a=Infinity,c=-Infinity,h=-Infinity;for(i=0;i<r;++i){if(isNaN(e=+this._x.call(null,n=t[i]))||isNaN(o=+this._y.call(null,n)))continue;u[i]=e;s[i]=o;if(e<f)f=e;if(e>c)c=e;if(o<a)a=o;if(o>h)h=o}if(f>c||a>h)return this;this.cover(f,a).cover(c,h);for(i=0;i<r;++i){Oe(this,u[i],s[i],t[i])}return this}function Ye(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var i=this._x0,r=this._y0,e=this._x1,o=this._y1;if(isNaN(i)){e=(i=Math.floor(t))+1;o=(r=Math.floor(n))+1}else{var u=e-i||1,s=this._root,f,a;while(i>t||t>=e||r>n||n>=o){a=(n<r)<<1|t<i;f=new Array(4),f[a]=s,s=f,u*=2;switch(a){case 0:e=i+u,o=r+u;break;case 1:i=e-u,o=r+u;break;case 2:e=i+u,r=o-u;break;case 3:i=e-u,r=o-u;break}}if(this._root&&this._root.length)this._root=s}this._x0=i;this._y0=r;this._x1=e;this._y1=o;return this}function De(){var t=[];this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}));return t}function Re(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?undefined:[[this._x0,this._y0],[this._x1,this._y1]]}function Xe(t,n,i,r,e){this.node=t;this.x0=n;this.y0=i;this.x1=r;this.y1=e}function qe(t,n,i){var r,e=this._x0,o=this._y0,u,s,f,a,c=this._x1,h=this._y1,l=[],d=this._root,v,p;if(d)l.push(new Xe(d,e,o,c,h));if(i==null)i=Infinity;else{e=t-i,o=n-i;c=t+i,h=n+i;i*=i}while(v=l.pop()){if(!(d=v.node)||(u=v.x0)>c||(s=v.y0)>h||(f=v.x1)<e||(a=v.y1)<o)continue;if(d.length){var y=(u+f)/2,w=(s+a)/2;l.push(new Xe(d[3],y,w,f,a),new Xe(d[2],u,w,y,a),new Xe(d[1],y,s,f,w),new Xe(d[0],u,s,y,w));if(p=(n>=w)<<1|t>=y){v=l[l.length-1];l[l.length-1]=l[l.length-1-p];l[l.length-1-p]=v}}else{var g=t-+this._x.call(null,d.data),m=n-+this._y.call(null,d.data),b=g*g+m*m;if(b<i){var k=Math.sqrt(i=b);e=t-k,o=n-k;c=t+k,h=n+k;r=d.data}}}return r}function He(t){if(isNaN(c=+this._x.call(null,t))||isNaN(h=+this._y.call(null,t)))return this;var n,i=this._root,r,e,o,u=this._x0,s=this._y0,f=this._x1,a=this._y1,c,h,l,d,v,p,y,w;if(!i)return this;if(i.length)while(true){if(v=c>=(l=(u+f)/2))u=l;else f=l;if(p=h>=(d=(s+a)/2))s=d;else a=d;if(!(n=i,i=i[y=p<<1|v]))return this;if(!i.length)break;if(n[y+1&3]||n[y+2&3]||n[y+3&3])r=n,w=y}while(i.data!==t)if(!(e=i,i=i.next))return this;if(o=i.next)delete i.next;if(e)return o?e.next=o:delete e.next,this;if(!n)return this._root=o,this;o?n[y]=o:delete n[y];if((i=n[0]||n[1]||n[2]||n[3])&&i===(n[3]||n[2]||n[1]||n[0])&&!i.length){if(r)r[w]=i;else this._root=i}return this}function Be(t){for(var n=0,i=t.length;n<i;++n)this.remove(t[n]);return this}function Ve(){return this._root}function We(){var t=0;this.visit((function(n){if(!n.length)do{++t}while(n=n.next)}));return t}function Ke(t){var n=[],i,r=this._root,e,o,u,s,f;if(r)n.push(new Xe(r,this._x0,this._y0,this._x1,this._y1));while(i=n.pop()){if(!t(r=i.node,o=i.x0,u=i.y0,s=i.x1,f=i.y1)&&r.length){var a=(o+s)/2,c=(u+f)/2;if(e=r[3])n.push(new Xe(e,a,c,s,f));if(e=r[2])n.push(new Xe(e,o,c,a,f));if(e=r[1])n.push(new Xe(e,a,u,s,c));if(e=r[0])n.push(new Xe(e,o,u,a,c))}}return this}function Ge(t){var n=[],i=[],r;if(this._root)n.push(new Xe(this._root,this._x0,this._y0,this._x1,this._y1));while(r=n.pop()){var e=r.node;if(e.length){var o,u=r.x0,s=r.y0,f=r.x1,a=r.y1,c=(u+f)/2,h=(s+a)/2;if(o=e[0])n.push(new Xe(o,u,s,c,h));if(o=e[1])n.push(new Xe(o,c,s,f,h));if(o=e[2])n.push(new Xe(o,u,h,c,a));if(o=e[3])n.push(new Xe(o,c,h,f,a))}i.push(r)}while(r=i.pop()){t(r.node,r.x0,r.y0,r.x1,r.y1)}return this}function Je(t){return t[0]}function Qe(t){return arguments.length?(this._x=t,this):this._x}function Ue(t){return t[1]}function Ze(t){return arguments.length?(this._y=t,this):this._y}function to(t,n,i){var r=new no(n==null?Je:n,i==null?Ue:i,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function no(t,n,i,r,e,o){this._x=t;this._y=n;this._x0=i;this._y0=r;this._x1=e;this._y1=o;this._root=undefined}function io(t){var n={data:t.data},i=n;while(t=t.next)i=i.next={data:t.data};return n}var ro=to.prototype=no.prototype;ro.copy=function(){var t=new no(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,i,r;if(!n)return t;if(!n.length)return t._root=io(n),t;i=[{source:n,target:t._root=new Array(4)}];while(n=i.pop()){for(var e=0;e<4;++e){if(r=n.source[e]){if(r.length)i.push({source:r,target:n.target[e]=new Array(4)});else n.target[e]=io(r)}}}return t};ro.add=Fe;ro.addAll=Pe;ro.cover=Ye;ro.data=De;ro.extent=Re;ro.find=qe;ro.remove=He;ro.removeAll=Be;ro.root=Ve;ro.size=We;ro.visit=Ke;ro.visitAfter=Ge;ro.x=Qe;ro.y=Ze;function eo(t){return function(){return t}}function oo(t){return(t()-.5)*1e-6}function uo(t){return t.index}function so(t,n){var i=t.get(n);if(!i)throw new Error("node not found: "+n);return i}function fo(t){var n=uo,i=h,r,e=eo(30),o,u,s,f,a,c=1;if(t==null)t=[];function h(t){return 1/Math.min(s[t.source.index],s[t.target.index])}function l(n){for(var i=0,e=t.length;i<c;++i){for(var u=0,s,h,l,d,v,p,y;u<e;++u){s=t[u],h=s.source,l=s.target;d=l.x+l.vx-h.x-h.vx||oo(a);v=l.y+l.vy-h.y-h.vy||oo(a);p=Math.sqrt(d*d+v*v);p=(p-o[u])/p*n*r[u];d*=p,v*=p;l.vx-=d*(y=f[u]);l.vy-=v*y;h.vx+=d*(y=1-y);h.vy+=v*y}}}function d(){if(!u)return;var i,e=u.length,a=t.length,c=new Map(u.map(((t,i)=>[n(t,i,u),t]))),h;for(i=0,s=new Array(e);i<a;++i){h=t[i],h.index=i;if(typeof h.source!=="object")h.source=so(c,h.source);if(typeof h.target!=="object")h.target=so(c,h.target);s[h.source.index]=(s[h.source.index]||0)+1;s[h.target.index]=(s[h.target.index]||0)+1}for(i=0,f=new Array(a);i<a;++i){h=t[i],f[i]=s[h.source.index]/(s[h.source.index]+s[h.target.index])}r=new Array(a),v();o=new Array(a),p()}function v(){if(!u)return;for(var n=0,e=t.length;n<e;++n){r[n]=+i(t[n],n,t)}}function p(){if(!u)return;for(var n=0,i=t.length;n<i;++n){o[n]=+e(t[n],n,t)}}l.initialize=function(t,n){u=t;a=n;d()};l.links=function(n){return arguments.length?(t=n,d(),l):t};l.id=function(t){return arguments.length?(n=t,l):n};l.iterations=function(t){return arguments.length?(c=+t,l):c};l.strength=function(t){return arguments.length?(i=typeof t==="function"?t:eo(+t),v(),l):i};l.distance=function(t){return arguments.length?