UNPKG

@aarpaardev/stix-visualizer

Version:

STIX Visualizer is a React-based, enhanced version of the OASIS CTI STIX Visualization project. It offers interactive canvas-based rendering of STIX 2.0 bundles with support for custom nodes, links, labels, and complete styling and behavior control.

2 lines 537 kB
// Version 1.2.12 @aarpaardev/stix-visualizer - https://github.com/aarpaardev/stix2-visualizer !function(A,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((A="undefined"!=typeof globalThis?globalThis:A||self).AaarPaarDevStixVisualizer={},A.React)}(this,(function(A,g){"use strict";var n=function(){return n=Object.assign||function(A){for(var t,g=1,n=arguments.length;g<n;g++)for(var e in t=arguments[g])Object.prototype.hasOwnProperty.call(t,e)&&(A[e]=t[e]);return A},n.apply(this,arguments)};function e(A,t,g){return(t=function(A){var t=function(A,t){if("object"!=typeof A||null===A)return A;var g=A[Symbol.toPrimitive];if(void 0!==g){var n=g.call(A,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(A)}(A,"string");return"symbol"==typeof t?t:String(t)}(t))in A?Object.defineProperty(A,t,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[t]=g,A}function I(A,t){return function(A){if(Array.isArray(A))return A}(A)||function(A,t){var g=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=g){var n,e,I,C,r=[],i=!0,o=!1;try{if(I=(g=g.call(A)).next,0===t){if(Object(g)!==g)return;i=!1}else for(;!(i=(n=I.call(g)).done)&&(r.push(n.value),r.length!==t);i=!0);}catch(A){o=!0,e=A}finally{try{if(!i&&null!=g.return&&(C=g.return(),Object(C)!==C))return}finally{if(o)throw e}}return r}}(A,t)||r(A,t)||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 C(A){return function(A){if(Array.isArray(A))return i(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||r(A)||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 r(A,t){if(A){if("string"==typeof A)return i(A,t);var g=Object.prototype.toString.call(A).slice(8,-1);return"Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g?Array.from(A):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?i(A,t):void 0}}function i(A,t){(null==t||t>A.length)&&(t=A.length);for(var g=0,n=new Array(t);g<t;g++)n[g]=A[g];return n}"function"==typeof SuppressedError&&SuppressedError;function o(A,t){(null==t||t>A.length)&&(t=A.length);for(var g=0,n=Array(t);g<t;g++)n[g]=A[g];return n}function a(A,t){return function(A){if(Array.isArray(A))return A}(A)||function(A,t){var g=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=g){var n,e,I,C,r=[],i=!0,o=!1;try{if(I=(g=g.call(A)).next,0===t);else for(;!(i=(n=I.call(g)).done)&&(r.push(n.value),r.length!==t);i=!0);}catch(A){o=!0,e=A}finally{try{if(!i&&null!=g.return&&(C=g.return(),Object(C)!==C))return}finally{if(o)throw e}}return r}}(A,t)||c(A,t)||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 l(A){return function(A){if(Array.isArray(A))return o(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||c(A)||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 c(A,t){if(A){if("string"==typeof A)return o(A,t);var g={}.toString.call(A).slice(8,-1);return"Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g?Array.from(A):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?o(A,t):void 0}}function u(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.useEffect,n=g.useRef(),e=g.useRef(!1),I=g.useRef(!1),C=a(g.useState(0),2);C[0];var r=C[1];e.current&&(I.current=!0),t((function(){return e.current||(n.current=A(),e.current=!0),r((function(A){return A+1})),function(){I.current&&n.current&&n.current()}}),[])}var s="http://www.w3.org/1999/xhtml",h={svg:"http://www.w3.org/2000/svg",xhtml:s,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function d(A){var t=A+="",g=t.indexOf(":");return g>=0&&"xmlns"!==(t=A.slice(0,g))&&(A=A.slice(g+1)),h.hasOwnProperty(t)?{space:h[t],local:A}:A}function f(A){return function(){var t=this.ownerDocument,g=this.namespaceURI;return g===s&&t.documentElement.namespaceURI===s?t.createElement(A):t.createElementNS(g,A)}}function p(A){return function(){return this.ownerDocument.createElementNS(A.space,A.local)}}function b(A){var t=d(A);return(t.local?p:f)(t)}function y(){}function v(A){return null==A?y:function(){return this.querySelector(A)}}function m(){return[]}function w(A){return null==A?m:function(){return this.querySelectorAll(A)}}function R(A){return function(){return function(A){return null==A?[]:Array.isArray(A)?A:Array.from(A)}(A.apply(this,arguments))}}function G(A){return function(){return this.matches(A)}}function x(A){return function(t){return t.matches(A)}}var M=Array.prototype.find;function N(){return this.firstElementChild}var k=Array.prototype.filter;function S(){return Array.from(this.children)}function D(A){return new Array(A.length)}function j(A,t){this.ownerDocument=A.ownerDocument,this.namespaceURI=A.namespaceURI,this._next=null,this._parent=A,this.__data__=t}function Z(A,t,g,n,e,I){for(var C,r=0,i=t.length,o=I.length;r<o;++r)(C=t[r])?(C.__data__=I[r],n[r]=C):g[r]=new j(A,I[r]);for(;r<i;++r)(C=t[r])&&(e[r]=C)}function O(A,t,g,n,e,I,C){var r,i,o,a=new Map,l=t.length,c=I.length,u=new Array(l);for(r=0;r<l;++r)(i=t[r])&&(u[r]=o=C.call(i,i.__data__,r,t)+"",a.has(o)?e[r]=i:a.set(o,i));for(r=0;r<c;++r)o=C.call(A,I[r],r,I)+"",(i=a.get(o))?(n[r]=i,i.__data__=I[r],a.delete(o)):g[r]=new j(A,I[r]);for(r=0;r<l;++r)(i=t[r])&&a.get(u[r])===i&&(e[r]=i)}function E(A){return A.__data__}function U(A){return"object"==typeof A&&"length"in A?A:Array.from(A)}function z(A,t){return A<t?-1:A>t?1:A>=t?0:NaN}function B(A){return function(){this.removeAttribute(A)}}function Q(A){return function(){this.removeAttributeNS(A.space,A.local)}}function Y(A,t){return function(){this.setAttribute(A,t)}}function L(A,t){return function(){this.setAttributeNS(A.space,A.local,t)}}function V(A,t){return function(){var g=t.apply(this,arguments);null==g?this.removeAttribute(A):this.setAttribute(A,g)}}function T(A,t){return function(){var g=t.apply(this,arguments);null==g?this.removeAttributeNS(A.space,A.local):this.setAttributeNS(A.space,A.local,g)}}function P(A){return A.ownerDocument&&A.ownerDocument.defaultView||A.document&&A||A.defaultView}function W(A){return function(){this.style.removeProperty(A)}}function F(A,t,g){return function(){this.style.setProperty(A,t,g)}}function J(A,t,g){return function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(A):this.style.setProperty(A,n,g)}}function K(A,t){return A.style.getPropertyValue(t)||P(A).getComputedStyle(A,null).getPropertyValue(t)}function X(A){return function(){delete this[A]}}function H(A,t){return function(){this[A]=t}}function q(A,t){return function(){var g=t.apply(this,arguments);null==g?delete this[A]:this[A]=g}}function _(A){return A.trim().split(/^|\s+/)}function $(A){return A.classList||new AA(A)}function AA(A){this._node=A,this._names=_(A.getAttribute("class")||"")}function tA(A,t){for(var g=$(A),n=-1,e=t.length;++n<e;)g.add(t[n])}function gA(A,t){for(var g=$(A),n=-1,e=t.length;++n<e;)g.remove(t[n])}function nA(A){return function(){tA(this,A)}}function eA(A){return function(){gA(this,A)}}function IA(A,t){return function(){(t.apply(this,arguments)?tA:gA)(this,A)}}function CA(){this.textContent=""}function rA(A){return function(){this.textContent=A}}function iA(A){return function(){var t=A.apply(this,arguments);this.textContent=null==t?"":t}}function oA(){this.innerHTML=""}function aA(A){return function(){this.innerHTML=A}}function lA(A){return function(){var t=A.apply(this,arguments);this.innerHTML=null==t?"":t}}function cA(){this.nextSibling&&this.parentNode.appendChild(this)}function uA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function sA(){return null}function hA(){var A=this.parentNode;A&&A.removeChild(this)}function dA(){var A=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(A,this.nextSibling):A}function fA(){var A=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(A,this.nextSibling):A}function pA(A){return function(){var t=this.__on;if(t){for(var g,n=0,e=-1,I=t.length;n<I;++n)g=t[n],A.type&&g.type!==A.type||g.name!==A.name?t[++e]=g:this.removeEventListener(g.type,g.listener,g.options);++e?t.length=e:delete this.__on}}}function bA(A,t,g){return function(){var n,e=this.__on,I=function(A){return function(t){A.call(this,t,this.__data__)}}(t);if(e)for(var C=0,r=e.length;C<r;++C)if((n=e[C]).type===A.type&&n.name===A.name)return this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=I,n.options=g),void(n.value=t);this.addEventListener(A.type,I,g),n={type:A.type,name:A.name,value:t,listener:I,options:g},e?e.push(n):this.__on=[n]}}function yA(A,t,g){var n=P(A),e=n.CustomEvent;"function"==typeof e?e=new e(t,g):(e=n.document.createEvent("Event"),g?(e.initEvent(t,g.bubbles,g.cancelable),e.detail=g.detail):e.initEvent(t,!1,!1)),A.dispatchEvent(e)}function vA(A,t){return function(){return yA(this,A,t)}}function mA(A,t){return function(){return yA(this,A,t.apply(this,arguments))}}j.prototype={constructor:j,appendChild:function(A){return this._parent.insertBefore(A,this._next)},insertBefore:function(A,t){return this._parent.insertBefore(A,t)},querySelector:function(A){return this._parent.querySelector(A)},querySelectorAll:function(A){return this._parent.querySelectorAll(A)}},AA.prototype={add:function(A){this._names.indexOf(A)<0&&(this._names.push(A),this._node.setAttribute("class",this._names.join(" ")))},remove:function(A){var t=this._names.indexOf(A);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(A){return this._names.indexOf(A)>=0}};var wA=[null];function RA(A,t){this._groups=A,this._parents=t}function GA(){return new RA([[document.documentElement]],wA)}function xA(A){return"string"==typeof A?new RA([[document.querySelector(A)]],[document.documentElement]):new RA([[A]],wA)}function MA(A,t){if(A=function(A){let t;for(;t=A.sourceEvent;)A=t;return A}(A),void 0===t&&(t=A.currentTarget),t){var g=t.ownerSVGElement||t;if(g.createSVGPoint){var n=g.createSVGPoint();return n.x=A.clientX,n.y=A.clientY,[(n=n.matrixTransform(t.getScreenCTM().inverse())).x,n.y]}if(t.getBoundingClientRect){var e=t.getBoundingClientRect();return[A.clientX-e.left-t.clientLeft,A.clientY-e.top-t.clientTop]}}return[A.pageX,A.pageY]}RA.prototype=GA.prototype={constructor:RA,select:function(A){"function"!=typeof A&&(A=v(A));for(var t=this._groups,g=t.length,n=new Array(g),e=0;e<g;++e)for(var I,C,r=t[e],i=r.length,o=n[e]=new Array(i),a=0;a<i;++a)(I=r[a])&&(C=A.call(I,I.__data__,a,r))&&("__data__"in I&&(C.__data__=I.__data__),o[a]=C);return new RA(n,this._parents)},selectAll:function(A){A="function"==typeof A?R(A):w(A);for(var t=this._groups,g=t.length,n=[],e=[],I=0;I<g;++I)for(var C,r=t[I],i=r.length,o=0;o<i;++o)(C=r[o])&&(n.push(A.call(C,C.__data__,o,r)),e.push(C));return new RA(n,e)},selectChild:function(A){return this.select(null==A?N:function(A){return function(){return M.call(this.children,A)}}("function"==typeof A?A:x(A)))},selectChildren:function(A){return this.selectAll(null==A?S:function(A){return function(){return k.call(this.children,A)}}("function"==typeof A?A:x(A)))},filter:function(A){"function"!=typeof A&&(A=G(A));for(var t=this._groups,g=t.length,n=new Array(g),e=0;e<g;++e)for(var I,C=t[e],r=C.length,i=n[e]=[],o=0;o<r;++o)(I=C[o])&&A.call(I,I.__data__,o,C)&&i.push(I);return new RA(n,this._parents)},data:function(A,t){if(!arguments.length)return Array.from(this,E);var g=t?O:Z,n=this._parents,e=this._groups;"function"!=typeof A&&(A=function(A){return function(){return A}}(A));for(var I=e.length,C=new Array(I),r=new Array(I),i=new Array(I),o=0;o<I;++o){var a=n[o],l=e[o],c=l.length,u=U(A.call(a,a&&a.__data__,o,n)),s=u.length,h=r[o]=new Array(s),d=C[o]=new Array(s);g(a,l,h,d,i[o]=new Array(c),u,t);for(var f,p,b=0,y=0;b<s;++b)if(f=h[b]){for(b>=y&&(y=b+1);!(p=d[y])&&++y<s;);f._next=p||null}}return(C=new RA(C,n))._enter=r,C._exit=i,C},enter:function(){return new RA(this._enter||this._groups.map(D),this._parents)},exit:function(){return new RA(this._exit||this._groups.map(D),this._parents)},join:function(A,t,g){var n=this.enter(),e=this,I=this.exit();return"function"==typeof A?(n=A(n))&&(n=n.selection()):n=n.append(A+""),null!=t&&(e=t(e))&&(e=e.selection()),null==g?I.remove():g(I),n&&e?n.merge(e).order():e},merge:function(A){for(var t=A.selection?A.selection():A,g=this._groups,n=t._groups,e=g.length,I=n.length,C=Math.min(e,I),r=new Array(e),i=0;i<C;++i)for(var o,a=g[i],l=n[i],c=a.length,u=r[i]=new Array(c),s=0;s<c;++s)(o=a[s]||l[s])&&(u[s]=o);for(;i<e;++i)r[i]=g[i];return new RA(r,this._parents)},selection:function(){return this},order:function(){for(var A=this._groups,t=-1,g=A.length;++t<g;)for(var n,e=A[t],I=e.length-1,C=e[I];--I>=0;)(n=e[I])&&(C&&4^n.compareDocumentPosition(C)&&C.parentNode.insertBefore(n,C),C=n);return this},sort:function(A){function t(t,g){return t&&g?A(t.__data__,g.__data__):!t-!g}A||(A=z);for(var g=this._groups,n=g.length,e=new Array(n),I=0;I<n;++I){for(var C,r=g[I],i=r.length,o=e[I]=new Array(i),a=0;a<i;++a)(C=r[a])&&(o[a]=C);o.sort(t)}return new RA(e,this._parents).order()},call:function(){var A=arguments[0];return arguments[0]=this,A.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var A=this._groups,t=0,g=A.length;t<g;++t)for(var n=A[t],e=0,I=n.length;e<I;++e){var C=n[e];if(C)return C}return null},size:function(){let A=0;for(const t of this)++A;return A},empty:function(){return!this.node()},each:function(A){for(var t=this._groups,g=0,n=t.length;g<n;++g)for(var e,I=t[g],C=0,r=I.length;C<r;++C)(e=I[C])&&A.call(e,e.__data__,C,I);return this},attr:function(A,t){var g=d(A);if(arguments.length<2){var n=this.node();return g.local?n.getAttributeNS(g.space,g.local):n.getAttribute(g)}return this.each((null==t?g.local?Q:B:"function"==typeof t?g.local?T:V:g.local?L:Y)(g,t))},style:function(A,t,g){return arguments.length>1?this.each((null==t?W:"function"==typeof t?J:F)(A,t,null==g?"":g)):K(this.node(),A)},property:function(A,t){return arguments.length>1?this.each((null==t?X:"function"==typeof t?q:H)(A,t)):this.node()[A]},classed:function(A,t){var g=_(A+"");if(arguments.length<2){for(var n=$(this.node()),e=-1,I=g.length;++e<I;)if(!n.contains(g[e]))return!1;return!0}return this.each(("function"==typeof t?IA:t?nA:eA)(g,t))},text:function(A){return arguments.length?this.each(null==A?CA:("function"==typeof A?iA:rA)(A)):this.node().textContent},html:function(A){return arguments.length?this.each(null==A?oA:("function"==typeof A?lA:aA)(A)):this.node().innerHTML},raise:function(){return this.each(cA)},lower:function(){return this.each(uA)},append:function(A){var t="function"==typeof A?A:b(A);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(A,t){var g="function"==typeof A?A:b(A),n=null==t?sA:"function"==typeof t?t:v(t);return this.select((function(){return this.insertBefore(g.apply(this,arguments),n.apply(this,arguments)||null)}))},remove:function(){return this.each(hA)},clone:function(A){return this.select(A?fA:dA)},datum:function(A){return arguments.length?this.property("__data__",A):this.node().__data__},on:function(A,t,g){var n,e,I=function(A){return A.trim().split(/^|\s+/).map((function(A){var t="",g=A.indexOf(".");return g>=0&&(t=A.slice(g+1),A=A.slice(0,g)),{type:A,name:t}}))}(A+""),C=I.length;if(!(arguments.length<2)){for(r=t?bA:pA,n=0;n<C;++n)this.each(r(I[n],t,g));return this}var r=this.node().__on;if(r)for(var i,o=0,a=r.length;o<a;++o)for(n=0,i=r[o];n<C;++n)if((e=I[n]).type===i.type&&e.name===i.name)return i.value},dispatch:function(A,t){return this.each(("function"==typeof t?mA:vA)(A,t))},[Symbol.iterator]:function*(){for(var A=this._groups,t=0,g=A.length;t<g;++t)for(var n,e=A[t],I=0,C=e.length;I<C;++I)(n=e[I])&&(yield n)}};var NA={value:()=>{}};function kA(){for(var A,t=0,g=arguments.length,n={};t<g;++t){if(!(A=arguments[t]+"")||A in n||/[\s.]/.test(A))throw new Error("illegal type: "+A);n[A]=[]}return new SA(n)}function SA(A){this._=A}function DA(A,t){for(var g,n=0,e=A.length;n<e;++n)if((g=A[n]).name===t)return g.value}function jA(A,t,g){for(var n=0,e=A.length;n<e;++n)if(A[n].name===t){A[n]=NA,A=A.slice(0,n).concat(A.slice(n+1));break}return null!=g&&A.push({name:t,value:g}),A}SA.prototype=kA.prototype={constructor:SA,on:function(A,t){var g,n,e=this._,I=(n=e,(A+"").trim().split(/^|\s+/).map((function(A){var t="",g=A.indexOf(".");if(g>=0&&(t=A.slice(g+1),A=A.slice(0,g)),A&&!n.hasOwnProperty(A))throw new Error("unknown type: "+A);return{type:A,name:t}}))),C=-1,r=I.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++C<r;)if(g=(A=I[C]).type)e[g]=jA(e[g],A.name,t);else if(null==t)for(g in e)e[g]=jA(e[g],A.name,null);return this}for(;++C<r;)if((g=(A=I[C]).type)&&(g=DA(e[g],A.name)))return g},copy:function(){var A={},t=this._;for(var g in t)A[g]=t[g].slice();return new SA(A)},call:function(A,t){if((g=arguments.length-2)>0)for(var g,n,e=new Array(g),I=0;I<g;++I)e[I]=arguments[I+2];if(!this._.hasOwnProperty(A))throw new Error("unknown type: "+A);for(I=0,g=(n=this._[A]).length;I<g;++I)n[I].value.apply(t,e)},apply:function(A,t,g){if(!this._.hasOwnProperty(A))throw new Error("unknown type: "+A);for(var n=this._[A],e=0,I=n.length;e<I;++e)n[e].value.apply(t,g)}};const ZA={passive:!1},OA={capture:!0,passive:!1};function EA(A){A.stopImmediatePropagation()}function UA(A){A.preventDefault(),A.stopImmediatePropagation()}function zA(A){var t=A.document.documentElement,g=xA(A).on("dragstart.drag",UA,OA);"onselectstart"in t?g.on("selectstart.drag",UA,OA):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function BA(A,t){var g=A.document.documentElement,n=xA(A).on("dragstart.drag",null);t&&(n.on("click.drag",UA,OA),setTimeout((function(){n.on("click.drag",null)}),0)),"onselectstart"in g?n.on("selectstart.drag",null):(g.style.MozUserSelect=g.__noselect,delete g.__noselect)}var QA=A=>()=>A;function YA(A,{sourceEvent:t,subject:g,target:n,identifier:e,active:I,x:C,y:r,dx:i,dy:o,dispatch:a}){Object.defineProperties(this,{type:{value:A,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:g,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:e,enumerable:!0,configurable:!0},active:{value:I,enumerable:!0,configurable:!0},x:{value:C,enumerable:!0,configurable:!0},y:{value:r,enumerable:!0,configurable:!0},dx:{value:i,enumerable:!0,configurable:!0},dy:{value:o,enumerable:!0,configurable:!0},_:{value:a}})}function LA(A){return!A.ctrlKey&&!A.button}function VA(){return this.parentNode}function TA(A,t){return null==t?{x:A.x,y:A.y}:t}function PA(){return navigator.maxTouchPoints||"ontouchstart"in this}function WA(A,t,g){A.prototype=t.prototype=g,g.constructor=A}function FA(A,t){var g=Object.create(A.prototype);for(var n in t)g[n]=t[n];return g}function JA(){}YA.prototype.on=function(){var A=this._.on.apply(this._,arguments);return A===this._?this:A};var KA=.7,XA=1/KA,HA="\\s*([+-]?\\d+)\\s*",qA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_A="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$A=/^#([0-9a-f]{3,8})$/,At=new RegExp(`^rgb\\(${HA},${HA},${HA}\\)$`),tt=new RegExp(`^rgb\\(${_A},${_A},${_A}\\)$`),gt=new RegExp(`^rgba\\(${HA},${HA},${HA},${qA}\\)$`),nt=new RegExp(`^rgba\\(${_A},${_A},${_A},${qA}\\)$`),et=new RegExp(`^hsl\\(${qA},${_A},${_A}\\)$`),It=new RegExp(`^hsla\\(${qA},${_A},${_A},${qA}\\)$`),Ct={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 rt(){return this.rgb().formatHex()}function it(){return this.rgb().formatRgb()}function ot(A){var t,g;return A=(A+"").trim().toLowerCase(),(t=$A.exec(A))?(g=t[1].length,t=parseInt(t[1],16),6===g?at(t):3===g?new ut(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===g?lt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===g?lt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=At.exec(A))?new ut(t[1],t[2],t[3],1):(t=tt.exec(A))?new ut(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=gt.exec(A))?lt(t[1],t[2],t[3],t[4]):(t=nt.exec(A))?lt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=et.exec(A))?bt(t[1],t[2]/100,t[3]/100,1):(t=It.exec(A))?bt(t[1],t[2]/100,t[3]/100,t[4]):Ct.hasOwnProperty(A)?at(Ct[A]):"transparent"===A?new ut(NaN,NaN,NaN,0):null}function at(A){return new ut(A>>16&255,A>>8&255,255&A,1)}function lt(A,t,g,n){return n<=0&&(A=t=g=NaN),new ut(A,t,g,n)}function ct(A,t,g,n){return 1===arguments.length?function(A){return A instanceof JA||(A=ot(A)),A?new ut((A=A.rgb()).r,A.g,A.b,A.opacity):new ut}(A):new ut(A,t,g,null==n?1:n)}function ut(A,t,g,n){this.r=+A,this.g=+t,this.b=+g,this.opacity=+n}function st(){return`#${pt(this.r)}${pt(this.g)}${pt(this.b)}`}function ht(){const A=dt(this.opacity);return`${1===A?"rgb(":"rgba("}${ft(this.r)}, ${ft(this.g)}, ${ft(this.b)}${1===A?")":`, ${A})`}`}function dt(A){return isNaN(A)?1:Math.max(0,Math.min(1,A))}function ft(A){return Math.max(0,Math.min(255,Math.round(A)||0))}function pt(A){return((A=ft(A))<16?"0":"")+A.toString(16)}function bt(A,t,g,n){return n<=0?A=t=g=NaN:g<=0||g>=1?A=t=NaN:t<=0&&(A=NaN),new vt(A,t,g,n)}function yt(A){if(A instanceof vt)return new vt(A.h,A.s,A.l,A.opacity);if(A instanceof JA||(A=ot(A)),!A)return new vt;if(A instanceof vt)return A;var t=(A=A.rgb()).r/255,g=A.g/255,n=A.b/255,e=Math.min(t,g,n),I=Math.max(t,g,n),C=NaN,r=I-e,i=(I+e)/2;return r?(C=t===I?(g-n)/r+6*(g<n):g===I?(n-t)/r+2:(t-g)/r+4,r/=i<.5?I+e:2-I-e,C*=60):r=i>0&&i<1?0:C,new vt(C,r,i,A.opacity)}function vt(A,t,g,n){this.h=+A,this.s=+t,this.l=+g,this.opacity=+n}function mt(A){return(A=(A||0)%360)<0?A+360:A}function wt(A){return Math.max(0,Math.min(1,A||0))}function Rt(A,t,g){return 255*(A<60?t+(g-t)*A/60:A<180?g:A<240?t+(g-t)*(240-A)/60:t)}WA(JA,ot,{copy(A){return Object.assign(new this.constructor,this,A)},displayable(){return this.rgb().displayable()},hex:rt,formatHex:rt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return yt(this).formatHsl()},formatRgb:it,toString:it}),WA(ut,ct,FA(JA,{brighter(A){return A=null==A?XA:Math.pow(XA,A),new ut(this.r*A,this.g*A,this.b*A,this.opacity)},darker(A){return A=null==A?KA:Math.pow(KA,A),new ut(this.r*A,this.g*A,this.b*A,this.opacity)},rgb(){return this},clamp(){return new ut(ft(this.r),ft(this.g),ft(this.b),dt(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:st,formatHex:st,formatHex8:function(){return`#${pt(this.r)}${pt(this.g)}${pt(this.b)}${pt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ht,toString:ht})),WA(vt,(function(A,t,g,n){return 1===arguments.length?yt(A):new vt(A,t,g,null==n?1:n)}),FA(JA,{brighter(A){return A=null==A?XA:Math.pow(XA,A),new vt(this.h,this.s,this.l*A,this.opacity)},darker(A){return A=null==A?KA:Math.pow(KA,A),new vt(this.h,this.s,this.l*A,this.opacity)},rgb(){var A=this.h%360+360*(this.h<0),t=isNaN(A)||isNaN(this.s)?0:this.s,g=this.l,n=g+(g<.5?g:1-g)*t,e=2*g-n;return new ut(Rt(A>=240?A-240:A+120,e,n),Rt(A,e,n),Rt(A<120?A+240:A-120,e,n),this.opacity)},clamp(){return new vt(mt(this.h),wt(this.s),wt(this.l),dt(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 A=dt(this.opacity);return`${1===A?"hsl(":"hsla("}${mt(this.h)}, ${100*wt(this.s)}%, ${100*wt(this.l)}%${1===A?")":`, ${A})`}`}}));var Gt=A=>()=>A;function xt(A){return 1==(A=+A)?Mt:function(t,g){return g-t?function(A,t,g){return A=Math.pow(A,g),t=Math.pow(t,g)-A,g=1/g,function(n){return Math.pow(A+n*t,g)}}(t,g,A):Gt(isNaN(t)?g:t)}}function Mt(A,t){var g=t-A;return g?function(A,t){return function(g){return A+g*t}}(A,g):Gt(isNaN(A)?t:A)}var Nt=function A(t){var g=xt(t);function n(A,t){var n=g((A=ct(A)).r,(t=ct(t)).r),e=g(A.g,t.g),I=g(A.b,t.b),C=Mt(A.opacity,t.opacity);return function(t){return A.r=n(t),A.g=e(t),A.b=I(t),A.opacity=C(t),A+""}}return n.gamma=A,n}(1);function kt(A,t){return A=+A,t=+t,function(g){return A*(1-g)+t*g}}var St=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Dt=new RegExp(St.source,"g");function jt(A,t){var g,n,e,I=St.lastIndex=Dt.lastIndex=0,C=-1,r=[],i=[];for(A+="",t+="";(g=St.exec(A))&&(n=Dt.exec(t));)(e=n.index)>I&&(e=t.slice(I,e),r[C]?r[C]+=e:r[++C]=e),(g=g[0])===(n=n[0])?r[C]?r[C]+=n:r[++C]=n:(r[++C]=null,i.push({i:C,x:kt(g,n)})),I=Dt.lastIndex;return I<t.length&&(e=t.slice(I),r[C]?r[C]+=e:r[++C]=e),r.length<2?i[0]?function(A){return function(t){return A(t)+""}}(i[0].x):function(A){return function(){return A}}(t):(t=i.length,function(A){for(var g,n=0;n<t;++n)r[(g=i[n]).i]=g.x(A);return r.join("")})}var Zt,Ot=180/Math.PI,Et={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ut(A,t,g,n,e,I){var C,r,i;return(C=Math.sqrt(A*A+t*t))&&(A/=C,t/=C),(i=A*g+t*n)&&(g-=A*i,n-=t*i),(r=Math.sqrt(g*g+n*n))&&(g/=r,n/=r,i/=r),A*n<t*g&&(A=-A,t=-t,i=-i,C=-C),{translateX:e,translateY:I,rotate:Math.atan2(t,A)*Ot,skewX:Math.atan(i)*Ot,scaleX:C,scaleY:r}}function zt(A,t,g,n){function e(A){return A.length?A.pop()+" ":""}return function(I,C){var r=[],i=[];return I=A(I),C=A(C),function(A,n,e,I,C,r){if(A!==e||n!==I){var i=C.push("translate(",null,t,null,g);r.push({i:i-4,x:kt(A,e)},{i:i-2,x:kt(n,I)})}else(e||I)&&C.push("translate("+e+t+I+g)}(I.translateX,I.translateY,C.translateX,C.translateY,r,i),function(A,t,g,I){A!==t?(A-t>180?t+=360:t-A>180&&(A+=360),I.push({i:g.push(e(g)+"rotate(",null,n)-2,x:kt(A,t)})):t&&g.push(e(g)+"rotate("+t+n)}(I.rotate,C.rotate,r,i),function(A,t,g,I){A!==t?I.push({i:g.push(e(g)+"skewX(",null,n)-2,x:kt(A,t)}):t&&g.push(e(g)+"skewX("+t+n)}(I.skewX,C.skewX,r,i),function(A,t,g,n,I,C){if(A!==g||t!==n){var r=I.push(e(I)+"scale(",null,",",null,")");C.push({i:r-4,x:kt(A,g)},{i:r-2,x:kt(t,n)})}else 1===g&&1===n||I.push(e(I)+"scale("+g+","+n+")")}(I.scaleX,I.scaleY,C.scaleX,C.scaleY,r,i),I=C=null,function(A){for(var t,g=-1,n=i.length;++g<n;)r[(t=i[g]).i]=t.x(A);return r.join("")}}}var Bt=zt((function(A){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(A+"");return t.isIdentity?Et:Ut(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),Qt=zt((function(A){return null==A?Et:(Zt||(Zt=document.createElementNS("http://www.w3.org/2000/svg","g")),Zt.setAttribute("transform",A),(A=Zt.transform.baseVal.consolidate())?Ut((A=A.matrix).a,A.b,A.c,A.d,A.e,A.f):Et)}),", ",")",")");function Yt(A){return((A=Math.exp(A))+1/A)/2}var Lt,Vt,Tt=function A(t,g,n){function e(A,e){var I,C,r=A[0],i=A[1],o=A[2],a=e[0],l=e[1],c=e[2],u=a-r,s=l-i,h=u*u+s*s;if(h<1e-12)C=Math.log(c/o)/t,I=function(A){return[r+A*u,i+A*s,o*Math.exp(t*A*C)]};else{var d=Math.sqrt(h),f=(c*c-o*o+n*h)/(2*o*g*d),p=(c*c-o*o-n*h)/(2*c*g*d),b=Math.log(Math.sqrt(f*f+1)-f),y=Math.log(Math.sqrt(p*p+1)-p);C=(y-b)/t,I=function(A){var n=A*C,e=Yt(b),I=o/(g*d)*(e*function(A){return((A=Math.exp(2*A))-1)/(A+1)}(t*n+b)-function(A){return((A=Math.exp(A))-1/A)/2}(b));return[r+I*u,i+I*s,o*e/Yt(t*n+b)]}}return I.duration=1e3*C*t/Math.SQRT2,I}return e.rho=function(t){var g=Math.max(.001,+t),n=g*g;return A(g,n,n*n)},e}(Math.SQRT2,2,4),Pt=0,Wt=0,Ft=0,Jt=1e3,Kt=0,Xt=0,Ht=0,qt="object"==typeof performance&&performance.now?performance:Date,_t="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(A){setTimeout(A,17)};function $t(){return Xt||(_t(Ag),Xt=qt.now()+Ht)}function Ag(){Xt=0}function tg(){this._call=this._time=this._next=null}function gg(A,t,g){var n=new tg;return n.restart(A,t,g),n}function ng(){Xt=(Kt=qt.now())+Ht,Pt=Wt=0;try{!function(){$t(),++Pt;for(var A,t=Lt;t;)(A=Xt-t._time)>=0&&t._call.call(void 0,A),t=t._next;--Pt}()}finally{Pt=0,function(){var A,t,g=Lt,n=1/0;for(;g;)g._call?(n>g._time&&(n=g._time),A=g,g=g._next):(t=g._next,g._next=null,g=A?A._next=t:Lt=t);Vt=A,Ig(n)}(),Xt=0}}function eg(){var A=qt.now(),t=A-Kt;t>Jt&&(Ht-=t,Kt=A)}function Ig(A){Pt||(Wt&&(Wt=clearTimeout(Wt)),A-Xt>24?(A<1/0&&(Wt=setTimeout(ng,A-qt.now()-Ht)),Ft&&(Ft=clearInterval(Ft))):(Ft||(Kt=qt.now(),Ft=setInterval(eg,Jt)),Pt=1,_t(ng)))}function Cg(A,t,g){var n=new tg;return t=null==t?0:+t,n.restart((g=>{n.stop(),A(g+t)}),t,g),n}tg.prototype=gg.prototype={constructor:tg,restart:function(A,t,g){if("function"!=typeof A)throw new TypeError("callback is not a function");g=(null==g?$t():+g)+(null==t?0:+t),this._next||Vt===this||(Vt?Vt._next=this:Lt=this,Vt=this),this._call=A,this._time=g,Ig()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ig())}};var rg=kA("start","end","cancel","interrupt"),ig=[],og=0,ag=1,lg=2,cg=3,ug=4,sg=5,hg=6;function dg(A,t,g,n,e,I){var C=A.__transition;if(C){if(g in C)return}else A.__transition={};!function(A,t,g){var n,e=A.__transition;function I(A){g.state=ag,g.timer.restart(C,g.delay,g.time),g.delay<=A&&C(A-g.delay)}function C(I){var o,a,l,c;if(g.state!==ag)return i();for(o in e)if((c=e[o]).name===g.name){if(c.state===cg)return Cg(C);c.state===ug?(c.state=hg,c.timer.stop(),c.on.call("interrupt",A,A.__data__,c.index,c.group),delete e[o]):+o<t&&(c.state=hg,c.timer.stop(),c.on.call("cancel",A,A.__data__,c.index,c.group),delete e[o])}if(Cg((function(){g.state===cg&&(g.state=ug,g.timer.restart(r,g.delay,g.time),r(I))})),g.state=lg,g.on.call("start",A,A.__data__,g.index,g.group),g.state===lg){for(g.state=cg,n=new Array(l=g.tween.length),o=0,a=-1;o<l;++o)(c=g.tween[o].value.call(A,A.__data__,g.index,g.group))&&(n[++a]=c);n.length=a+1}}function r(t){for(var e=t<g.duration?g.ease.call(null,t/g.duration):(g.timer.restart(i),g.state=sg,1),I=-1,C=n.length;++I<C;)n[I].call(A,e);g.state===sg&&(g.on.call("end",A,A.__data__,g.index,g.group),i())}function i(){for(var n in g.state=hg,g.timer.stop(),delete e[t],e)return;delete A.__transition}e[t]=g,g.timer=gg(I,0,g.time)}(A,g,{name:t,index:n,group:e,on:rg,tween:ig,time:I.time,delay:I.delay,duration:I.duration,ease:I.ease,timer:null,state:og})}function fg(A,t){var g=bg(A,t);if(g.state>og)throw new Error("too late; already scheduled");return g}function pg(A,t){var g=bg(A,t);if(g.state>cg)throw new Error("too late; already running");return g}function bg(A,t){var g=A.__transition;if(!g||!(g=g[t]))throw new Error("transition not found");return g}function yg(A,t){var g,n,e,I=A.__transition,C=!0;if(I){for(e in t=null==t?null:t+"",I)(g=I[e]).name===t?(n=g.state>lg&&g.state<sg,g.state=hg,g.timer.stop(),g.on.call(n?"interrupt":"cancel",A,A.__data__,g.index,g.group),delete I[e]):C=!1;C&&delete A.__transition}}function vg(A,t){var g,n;return function(){var e=pg(this,A),I=e.tween;if(I!==g)for(var C=0,r=(n=g=I).length;C<r;++C)if(n[C].name===t){(n=n.slice()).splice(C,1);break}e.tween=n}}function mg(A,t,g){var n,e;if("function"!=typeof g)throw new Error;return function(){var I=pg(this,A),C=I.tween;if(C!==n){e=(n=C).slice();for(var r={name:t,value:g},i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=r;break}i===o&&e.push(r)}I.tween=e}}function wg(A,t,g){var n=A._id;return A.each((function(){var A=pg(this,n);(A.value||(A.value={}))[t]=g.apply(this,arguments)})),function(A){return bg(A,n).value[t]}}function Rg(A,t){var g;return("number"==typeof t?kt:t instanceof ot?Nt:(g=ot(t))?(t=g,Nt):jt)(A,t)}function Gg(A){return function(){this.removeAttribute(A)}}function xg(A){return function(){this.removeAttributeNS(A.space,A.local)}}function Mg(A,t,g){var n,e,I=g+"";return function(){var C=this.getAttribute(A);return C===I?null:C===n?e:e=t(n=C,g)}}function Ng(A,t,g){var n,e,I=g+"";return function(){var C=this.getAttributeNS(A.space,A.local);return C===I?null:C===n?e:e=t(n=C,g)}}function kg(A,t,g){var n,e,I;return function(){var C,r,i=g(this);if(null!=i)return(C=this.getAttribute(A))===(r=i+"")?null:C===n&&r===e?I:(e=r,I=t(n=C,i));this.removeAttribute(A)}}function Sg(A,t,g){var n,e,I;return function(){var C,r,i=g(this);if(null!=i)return(C=this.getAttributeNS(A.space,A.local))===(r=i+"")?null:C===n&&r===e?I:(e=r,I=t(n=C,i));this.removeAttributeNS(A.space,A.local)}}function Dg(A,t){var g,n;function e(){var e=t.apply(this,arguments);return e!==n&&(g=(n=e)&&function(A,t){return function(g){this.setAttributeNS(A.space,A.local,t.call(this,g))}}(A,e)),g}return e._value=t,e}function jg(A,t){var g,n;function e(){var e=t.apply(this,arguments);return e!==n&&(g=(n=e)&&function(A,t){return function(g){this.setAttribute(A,t.call(this,g))}}(A,e)),g}return e._value=t,e}function Zg(A,t){return function(){fg(this,A).delay=+t.apply(this,arguments)}}function Og(A,t){return t=+t,function(){fg(this,A).delay=t}}function Eg(A,t){return function(){pg(this,A).duration=+t.apply(this,arguments)}}function Ug(A,t){return t=+t,function(){pg(this,A).duration=t}}var zg=GA.prototype.constructor;function Bg(A){return function(){this.style.removeProperty(A)}}var Qg=0;function Yg(A,t,g,n){this._groups=A,this._parents=t,this._name=g,this._id=n}function Lg(){return++Qg}var Vg=GA.prototype;Yg.prototype={constructor:Yg,select:function(A){var t=this._name,g=this._id;"function"!=typeof A&&(A=v(A));for(var n=this._groups,e=n.length,I=new Array(e),C=0;C<e;++C)for(var r,i,o=n[C],a=o.length,l=I[C]=new Array(a),c=0;c<a;++c)(r=o[c])&&(i=A.call(r,r.__data__,c,o))&&("__data__"in r&&(i.__data__=r.__data__),l[c]=i,dg(l[c],t,g,c,l,bg(r,g)));return new Yg(I,this._parents,t,g)},selectAll:function(A){var t=this._name,g=this._id;"function"!=typeof A&&(A=w(A));for(var n=this._groups,e=n.length,I=[],C=[],r=0;r<e;++r)for(var i,o=n[r],a=o.length,l=0;l<a;++l)if(i=o[l]){for(var c,u=A.call(i,i.__data__,l,o),s=bg(i,g),h=0,d=u.length;h<d;++h)(c=u[h])&&dg(c,t,g,h,u,s);I.push(u),C.push(i)}return new Yg(I,C,t,g)},selectChild:Vg.selectChild,selectChildren:Vg.selectChildren,filter:function(A){"function"!=typeof A&&(A=G(A));for(var t=this._groups,g=t.length,n=new Array(g),e=0;e<g;++e)for(var I,C=t[e],r=C.length,i=n[e]=[],o=0;o<r;++o)(I=C[o])&&A.call(I,I.__data__,o,C)&&i.push(I);return new Yg(n,this._parents,this._name,this._id)},merge:function(A){if(A._id!==this._id)throw new Error;for(var t=this._groups,g=A._groups,n=t.length,e=g.length,I=Math.min(n,e),C=new Array(n),r=0;r<I;++r)for(var i,o=t[r],a=g[r],l=o.length,c=C[r]=new Array(l),u=0;u<l;++u)(i=o[u]||a[u])&&(c[u]=i);for(;r<n;++r)C[r]=t[r];return new Yg(C,this._parents,this._name,this._id)},selection:function(){return new zg(this._groups,this._parents)},transition:function(){for(var A=this._name,t=this._id,g=Lg(),n=this._groups,e=n.length,I=0;I<e;++I)for(var C,r=n[I],i=r.length,o=0;o<i;++o)if(C=r[o]){var a=bg(C,t);dg(C,A,g,o,r,{time:a.time+a.delay+a.duration,delay:0,duration:a.duration,ease:a.ease})}return new Yg(n,this._parents,A,g)},call:Vg.call,nodes:Vg.nodes,node:Vg.node,size:Vg.size,empty:Vg.empty,each:Vg.each,on:function(A,t){var g=this._id;return arguments.length<2?bg(this.node(),g).on.on(A):this.each(function(A,t,g){var n,e,I=function(A){return(A+"").trim().split(/^|\s+/).every((function(A){var t=A.indexOf(".");return t>=0&&(A=A.slice(0,t)),!A||"start"===A}))}(t)?fg:pg;return function(){var C=I(this,A),r=C.on;r!==n&&(e=(n=r).copy()).on(t,g),C.on=e}}(g,A,t))},attr:function(A,t){var g=d(A),n="transform"===g?Qt:Rg;return this.attrTween(A,"function"==typeof t?(g.local?Sg:kg)(g,n,wg(this,"attr."+A,t)):null==t?(g.local?xg:Gg)(g):(g.local?Ng:Mg)(g,n,t))},attrTween:function(A,t){var g="attr."+A;if(arguments.length<2)return(g=this.tween(g))&&g._value;if(null==t)return this.tween(g,null);if("function"!=typeof t)throw new Error;var n=d(A);return this.tween(g,(n.local?Dg:jg)(n,t))},style:function(A,t,g){var n="transform"==(A+="")?Bt:Rg;return null==t?this.styleTween(A,function(A,t){var g,n,e;return function(){var I=K(this,A),C=(this.style.removeProperty(A),K(this,A));return I===C?null:I===g&&C===n?e:e=t(g=I,n=C)}}(A,n)).on("end.style."+A,Bg(A)):"function"==typeof t?this.styleTween(A,function(A,t,g){var n,e,I;return function(){var C=K(this,A),r=g(this),i=r+"";return null==r&&(this.style.removeProperty(A),i=r=K(this,A)),C===i?null:C===n&&i===e?I:(e=i,I=t(n=C,r))}}(A,n,wg(this,"style."+A,t))).each(function(A,t){var g,n,e,I,C="style."+t,r="end."+C;return function(){var i=pg(this,A),o=i.on,a=null==i.value[C]?I||(I=Bg(t)):void 0;o===g&&e===a||(n=(g=o).copy()).on(r,e=a),i.on=n}}(this._id,A)):this.styleTween(A,function(A,t,g){var n,e,I=g+"";return function(){var C=K(this,A);return C===I?null:C===n?e:e=t(n=C,g)}}(A,n,t),g).on("end.style."+A,null)},styleTween:function(A,t,g){var n="style."+(A+="");if(arguments.length<2)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(A,t,g){var n,e;function I(){var I=t.apply(this,arguments);return I!==e&&(n=(e=I)&&function(A,t,g){return function(n){this.style.setProperty(A,t.call(this,n),g)}}(A,I,g)),n}return I._value=t,I}(A,t,null==g?"":g))},text:function(A){return this.tween("text","function"==typeof A?function(A){return function(){var t=A(this);this.textContent=null==t?"":t}}(wg(this,"text",A)):function(A){return function(){this.textContent=A}}(null==A?"":A+""))},textTween:function(A){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==A)return this.tween(t,null);if("function"!=typeof A)throw new Error;return this.tween(t,function(A){var t,g;function n(){var n=A.apply(this,arguments);return n!==g&&(t=(g=n)&&function(A){return function(t){this.textContent=A.call(this,t)}}(n)),t}return n._value=A,n}(A))},remove:function(){return this.on("end.remove",function(A){return function(){var t=this.parentNode;for(var g in this.__transition)if(+g!==A)return;t&&t.removeChild(this)}}(this._id))},tween:function(A,t){var g=this._id;if(A+="",arguments.length<2){for(var n,e=bg(this.node(),g).tween,I=0,C=e.length;I<C;++I)if((n=e[I]).name===A)return n.value;return null}return this.each((null==t?vg:mg)(g,A,t))},delay:function(A){var t=this._id;return arguments.length?this.each(("function"==typeof A?Zg:Og)(t,A)):bg(this.node(),t).delay},duration:function(A){var t=this._id;return arguments.length?this.each(("function"==typeof A?Eg:Ug)(t,A)):bg(this.node(),t).duration},ease:function(A){var t=this._id;return arguments.length?this.each(function(A,t){if("function"!=typeof t)throw new Error;return function(){pg(this,A).ease=t}}(t,A)):bg(this.node(),t).ease},easeVarying:function(A){if("function"!=typeof A)throw new Error;return this.each(function(A,t){return function(){var g=t.apply(this,arguments);if("function"!=typeof g)throw new Error;pg(this,A).ease=g}}(this._id,A))},end:function(){var A,t,g=this,n=g._id,e=g.size();return new Promise((function(I,C){var r={value:C},i={value:function(){0==--e&&I()}};g.each((function(){var g=pg(this,n),e=g.on;e!==A&&((t=(A=e).copy())._.cancel.push(r),t._.interrupt.push(r),t._.end.push(i)),g.on=t})),0===e&&I()}))},[Symbol.iterator]:Vg[Symbol.iterator]};var Tg={time:null,delay:0,duration:250,ease:function(A){return((A*=2)<=1?A*A*A:(A-=2)*A*A+2)/2}};function Pg(A,t){for(var g;!(g=A.__transition)||!(g=g[t]);)if(!(A=A.parentNode))throw new Error(`transition ${t} not found`);return g}GA.prototype.interrupt=function(A){return this.each((function(){yg(this,A)}))},GA.prototype.transition=function(A){var t,g;A instanceof Yg?(t=A._id,A=A._name):(t=Lg(),(g=Tg).time=$t(),A=null==A?null:A+"");for(var n=this._groups,e=n.length,I=0;I<e;++I)for(var C,r=n[I],i=r.length,o=0;o<i;++o)(C=r[o])&&dg(C,A,t,o,r,g||Pg(C,t));return new Yg(n,this._parents,A,t)};var Wg=A=>()=>A;function Fg(A,{sourceEvent:t,target:g,transform:n,dispatch:e}){Object.defineProperties(this,{type:{value:A,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:g,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:e}})}function Jg(A,t,g){this.k=A,this.x=t,this.y=g}Jg.prototype={constructor:Jg,scale:function(A){return 1===A?this:new Jg(this.k*A,this.x,this.y)},translate:function(A,t){return 0===A&0===t?this:new Jg(this.k,this.x+this.k*A,this.y+this.k*t)},apply:function(A){return[A[0]*this.k+this.x,A[1]*this.k+this.y]},applyX:function(A){return A*this.k+this.x},applyY:function(A){return A*this.k+this.y},invert:function(A){return[(A[0]-this.x)/this.k,(A[1]-this.y)/this.k]},invertX:function(A){return(A-this.x)/this.k},invertY:function(A){return(A-this.y)/this.k},rescaleX:function(A){return A.copy().domain(A.range().map(this.invertX,this).map(A.invert,A))},rescaleY:function(A){return A.copy().domain(A.range().map(this.invertY,this).map(A.invert,A))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Kg=new Jg(1,0,0);function Xg(A){for(;!A.__zoom;)if(!(A=A.parentNode))return Kg;return A.__zoom}function Hg(A){A.stopImmediatePropagation()}function qg(A){A.preventDefault(),A.stopImmediatePropagation()}function _g(A){return!(A.ctrlKey&&"wheel"!==A.type||A.button)}function $g(){var A=this;return A instanceof SVGElement?(A=A.ownerSVGElement||A).hasAttribute("viewBox")?[[(A=A.viewBox.baseVal).x,A.y],[A.x+A.width,A.y+A.height]]:[[0,0],[A.width.baseVal.value,A.height.baseVal.value]]:[[0,0],[A.clientWidth,A.clientHeight]]}function An(){return this.__zoom||Kg}function tn(A){return-A.deltaY*(1===A.deltaMode?.05:A.deltaMode?1:.002)*(A.ctrlKey?10:1)}function gn(){return navigator.maxTouchPoints||"ontouchstart"in this}function nn(A,t,g){var n=A.invertX(t[0][0])-g[0][0],e=A.invertX(t[1][0])-g[1][0],I=A.invertY(t[0][1])-g[0][1],C=A.invertY(t[1][1])-g[1][1];return A.translate(e>n?(n+e)/2:Math.min(0,n)||Math.max(0,e),C>I?(I+C)/2:Math.min(0,I)||Math.max(0,C))}function en(){var A,t,g,n=_g,e=$g,I=nn,C=tn,r=gn,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Tt,c=kA("start","zoom","end"),u=500,s=150,h=0,d=10;function f(A){A.property("__zoom",An).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",x).filter(r).on("touchstart.zoom",M).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(A,t){return(t=Math.max(i[0],Math.min(i[1],t)))===A.k?A:new Jg(t,A.x,A.y)}function b(A,t,g){var n=t[0]-g[0]*A.k,e=t[1]-g[1]*A.k;return n===A.x&&e===A.y?A:new Jg(A.k,n,e)}function y(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function v(A,t,g,n){A.on("start.zoom",(function(){m(this,arguments).event(n).start()})).on("interrupt.zoom end.zoom",(function(){m(this,arguments).event(n).end()})).tween("zoom",(function(){var A=this,I=arguments,C=m(A,I).event(n),r=e.apply(A,I),i=null==g?y(r):"function"==typeof g?g.apply(A,I):g,o=Math.max(r[1][0]-r[0][0],r[1][1]-r[0][1]),a=A.__zoom,c="function"==typeof t?t.apply(A,I):t,u=l(a.invert(i).concat(o/a.k),c.invert(i).concat(o/c.k));return function(A){if(1===A)A=c;else{var t=u(A),g=o/t[2];A=new Jg(g,i[0]-t[0]*g,i[1]-t[1]*g)}C.zoom(null,A)}}))}function m(A,t,g){return!g&&A.__zooming||new w(A,t)}function w(A,t){this.that=A,this.args=t,this.active=0,this.sourceEvent=null,this.extent=e.apply(A,t),this.taps=0}function R(A,...t){if(n.apply(this,arguments)){var g=m(this,t).event(A),e=this.__zoom,r=Math.max(i[0],Math.min(i[1],e.k*Math.pow(2,C.apply(this,arguments)))),a=MA(A);if(g.wheel)g.mouse[0][0]===a[0]&&g.mouse[0][1]===a[1]||(g.mouse[1]=e.invert(g.mouse[0]=a)),clearTimeout(g.wheel);else{if(e.k===r)return;g.mouse=[a,e.invert(a)],yg(this),g.start()}qg(A),g.wheel=setTimeout((function(){g.wheel=null,g.end()}),s),g.zoom("mouse",I(b(p(e,r),g.mouse[0],g.mouse[1]),g.extent,o))}}function G(A,...t){if(!g&&n.apply(this,arguments)){var e=A.currentTarget,C=m(this,t,!0).event(A),r=xA(A.view).on("mousemove.zoom",(function(A){if(qg(A),!C.moved){var t=A.clientX-a,g=A.clientY-l;C.moved=t*t+g*g>h}C.event(A).zoom("mouse",I(b(C.that.__zoom,C.mouse[0]=MA(A,e),C.mouse[1]),C.extent,o))}),!0).on("mouseup.zoom",(function(A){r.on("mousemove.zoom mouseup.zoom",null),BA(A.view,C.moved),qg(A),C.event(A).end()}),!0),i=MA(A,e),a=A.clientX,l=A.clientY;zA(A.view),Hg(A),C.mouse=[i,this.__zoom.invert(i)],yg(this),C.start()}}function x(A,...t){if(n.apply(this,arguments)){var g=this.__zoom,C=MA(A.changedTouches?A.changedTouches[0]:A,this),r=g.invert(C),i=g.k*(A.shiftKey?.5:2),l=I(b(p(g,i),C,r),e.apply(this,t),o);qg(A),a>0?xA(this).transition().duration(a).call(v,l,C,A):xA(this).call(f.transform,l,C,A)}}function M(g,...e){if(n.apply(this,arguments)){var I,C,r,i,o=g.touches,a=o.length,l=m(this,e,g.changedTouches.length===a).event(g);for(Hg(g),C=0;C<a;++C)i=[i=MA(r=o[C],this),this.__zoom.invert(i),r.identifier],l.touch0?l.touch1||l.touch0[2]===i[2]||(l.touch1=i,l.taps=0):(l.touch0=i,I=!0,l.taps=1+!!A);A&&(A=clearTimeout(A)),I&&(l.taps<2&&(t=i[0],A=setTimeout((function(){A=null}),u)),yg(this),l.start())}}function N(A,...t){if(this.__zooming){var g,n,e,C,r=m(this,t).event(A),i=A.changedTouches,a=i.length;for(qg(A),g=0;g<a;++g)e=MA(n=i[g],this),r.touch0&&r.touch0[2]===n.identifier?r.touch0[0]=e:r.touch1&&r.touch1[2]===n.identifier&&(r.touch1[0]=e);if(n=r.that.__zoom,r.touch1){var l=r.touch0[0],c=r.touch0[1],u=r.touch1[0],s=r.touch1[1],h=(h=u[0]-l[0])*h+(h=u[1]-l[1])*h,d=(d=s[0]-c[0])*d+(d=s[1]-c[1])*d;n=p(n,Math.sqrt(h/d)),e=[(l[0]+u[0])/2,(l[1]+u[1])/2],C=[(c[0]+s[0])/2,(c[1]+s[1])/2]}else{if(!r.touch0)return;e=r.touch0[0],C=r.touch0[1]}r.zoom("touch",I(b(n,e,C),r.extent,o))}}function k(A,...n){if(this.__zooming){var e,I,C=m(this,n).event(A),r=A.changedTouches,i=r.length;for(Hg(A),g&&clearTimeout(g),g=setTimeout((function(){g=null}),u),e=0;e<i;++e)I=r[e],C.touch0&&C.touch0[2]===I.identifier?delete C.touch0:C.touch1&&C.touch1[2]===I.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),2===C.taps&&(I=MA(I,this),Math.hypot(t[0]-I[0],t[1]-I[1])<d)){var o=xA(this).on("dblclick.zoom");o&&o.apply(this,arguments)}}}return f.transform=function(A,t,g,n){var e=A.selection?A.selection():A;e.property("__zoom",An),A!==e?v(A,t,g,n):e.interrupt().each((function(){m(this,arguments).event(n).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},f.scaleBy=function(A,t,g,n){f.scaleTo(A,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),g,n)},f.scaleTo=function(A,t,g,n){f.transform(A,(function(){var A=e.apply(this,arguments),n=this.__zoom,C=null==g?y(A):"function"==typeof g?g.apply(this,arguments):g,r=n.invert(C),i="function"==typeof t?t.apply(this,arguments):t;return I(b(p(n,i),C,r),A,o)}),g,n)},f.translateBy=function(A,t,g,n){f.transform(A,(function(){return I(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof g?g.apply(this,arguments):g),e.apply(this,arguments),o)}),null,n)},f.translateTo=function(A,t,g,n,C){f.transform(A,(function(){var A=e.apply(this,arguments),C=this.__zoom,r=null==n?y(A):"function"==typeof n?n.apply(this,arguments):n;return I(Kg.translate(r[0],r[1]).scale(C.k).translate("func