ideogram
Version:
Chromosome visualization for the web
2 lines • 219 kB
JavaScript
/*! For license information please see ideogram.min.js.LICENSE.txt */
!function(t,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e=n();for(var o in e)("object"==typeof exports?exports:t)[o]=e[o]}}(self,(function(){return(()=>{"use strict";var t={d:(n,e)=>{for(var o in e)t.o(e,o)&&!t.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{default:()=>$l});var e={};t.r(e),t.d(e,{blob:()=>_t,buffer:()=>Ct,csv:()=>Gt,dsv:()=>Ot,html:()=>Yt,image:()=>zt,json:()=>Ht,svg:()=>Ut,text:()=>Ft,tsv:()=>jt,xml:()=>$t});var o={};t.r(o),t.d(o,{brush:()=>Oo,brushSelection:()=>Do,brushX:()=>Fo,brushY:()=>Ro});var r={};t.r(r),t.d(r,{dispatch:()=>tn});var i={};t.r(i),t.d(i,{FormatSpecifier:()=>$o,format:()=>Qo,formatDefaultLocale:()=>nr,formatLocale:()=>tr,formatPrefix:()=>Jo,formatSpecifier:()=>qo,precisionFixed:()=>er,precisionPrefix:()=>or,precisionRound:()=>rr});function a(){}function s(t){return null==t?a:function(){return this.querySelector(t)}}function c(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function l(){return[]}function u(t){return null==t?l:function(){return this.querySelectorAll(t)}}function h(t){return function(){return this.matches(t)}}function f(t){return function(n){return n.matches(t)}}var d=Array.prototype.find;function m(){return this.firstElementChild}var g=Array.prototype.filter;function p(){return this.children}function y(t){return new Array(t.length)}function v(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function b(t){return function(){return t}}function w(t,n,e,o,r,i){for(var a,s=0,c=n.length,l=i.length;s<l;++s)(a=n[s])?(a.__data__=i[s],o[s]=a):e[s]=new v(t,i[s]);for(;s<c;++s)(a=n[s])&&(r[s]=a)}function x(t,n,e,o,r,i,a){var s,c,l,u=new Map,h=n.length,f=i.length,d=new Array(h);for(s=0;s<h;++s)(c=n[s])&&(d[s]=l=a.call(c,c.__data__,s,n)+"",u.has(l)?r[s]=c:u.set(l,c));for(s=0;s<f;++s)l=a.call(t,i[s],s,i)+"",(c=u.get(l))?(o[s]=c,c.__data__=i[s],u.delete(l)):e[s]=new v(t,i[s]);for(s=0;s<h;++s)(c=n[s])&&u.get(d[s])===c&&(r[s]=c)}function _(t){return t.__data__}function A(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}v.prototype={constructor:v,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)}};var C="http://www.w3.org/1999/xhtml";const k={svg:"http://www.w3.org/2000/svg",xhtml:C,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function S(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),k.hasOwnProperty(n)?{space:k[n],local:t}:t}function L(t){return function(){this.removeAttribute(t)}}function T(t){return function(){this.removeAttributeNS(t.space,t.local)}}function M(t,n){return function(){this.setAttribute(t,n)}}function P(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function N(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function B(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function E(t){return function(){this.style.removeProperty(t)}}function D(t,n,e){return function(){this.style.setProperty(t,n,e)}}function F(t,n,e){return function(){var o=n.apply(this,arguments);null==o?this.style.removeProperty(t):this.style.setProperty(t,o,e)}}function R(t,n){return t.style.getPropertyValue(n)||B(t).getComputedStyle(t,null).getPropertyValue(n)}function O(t){return function(){delete this[t]}}function G(t,n){return function(){this[t]=n}}function j(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function z(t){return t.trim().split(/^|\s+/)}function W(t){return t.classList||new H(t)}function H(t){this._node=t,this._names=z(t.getAttribute("class")||"")}function q(t,n){for(var e=W(t),o=-1,r=n.length;++o<r;)e.add(n[o])}function $(t,n){for(var e=W(t),o=-1,r=n.length;++o<r;)e.remove(n[o])}function Y(t){return function(){q(this,t)}}function U(t){return function(){$(this,t)}}function X(t,n){return function(){(n.apply(this,arguments)?q:$)(this,t)}}function V(){this.textContent=""}function Q(t){return function(){this.textContent=t}}function J(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function K(){this.innerHTML=""}function Z(t){return function(){this.innerHTML=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function nt(){this.nextSibling&&this.parentNode.appendChild(this)}function et(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===C&&n.documentElement.namespaceURI===C?n.createElement(t):n.createElementNS(e,t)}}function rt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function it(t){var n=S(t);return(n.local?rt:ot)(n)}function at(){return null}function st(){var t=this.parentNode;t&&t.removeChild(this)}function ct(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function lt(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ut(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function ht(t){return function(){var n=this.__on;if(n){for(var e,o=0,r=-1,i=n.length;o<i;++o)e=n[o],t.type&&e.type!==t.type||e.name!==t.name?n[++r]=e:this.removeEventListener(e.type,e.listener,e.options);++r?n.length=r:delete this.__on}}}function ft(t,n,e){return function(){var o,r=this.__on,i=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(r)for(var a=0,s=r.length;a<s;++a)if((o=r[a]).type===t.type&&o.name===t.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=e),void(o.value=n);this.addEventListener(t.type,i,e),o={type:t.type,name:t.name,value:n,listener:i,options:e},r?r.push(o):this.__on=[o]}}function dt(t,n,e){var o=B(t),r=o.CustomEvent;"function"==typeof r?r=new r(n,e):(r=o.document.createEvent("Event"),e?(r.initEvent(n,e.bubbles,e.cancelable),r.detail=e.detail):r.initEvent(n,!1,!1)),t.dispatchEvent(r)}function mt(t,n){return function(){return dt(this,t,n)}}function gt(t,n){return function(){return dt(this,t,n.apply(this,arguments))}}H.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var pt=[null];function yt(t,n){this._groups=t,this._parents=n}function vt(){return new yt([[document.documentElement]],pt)}yt.prototype=vt.prototype={constructor:yt,select:function(t){"function"!=typeof t&&(t=s(t));for(var n=this._groups,e=n.length,o=new Array(e),r=0;r<e;++r)for(var i,a,c=n[r],l=c.length,u=o[r]=new Array(l),h=0;h<l;++h)(i=c[h])&&(a=t.call(i,i.__data__,h,c))&&("__data__"in i&&(a.__data__=i.__data__),u[h]=a);return new yt(o,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:c(n)}}(t):u(t);for(var n=this._groups,e=n.length,o=[],r=[],i=0;i<e;++i)for(var a,s=n[i],l=s.length,h=0;h<l;++h)(a=s[h])&&(o.push(t.call(a,a.__data__,h,s)),r.push(a));return new yt(o,r)},selectChild:function(t){return this.select(null==t?m:function(t){return function(){return d.call(this.children,t)}}("function"==typeof t?t:f(t)))},selectChildren:function(t){return this.selectAll(null==t?p:function(t){return function(){return g.call(this.children,t)}}("function"==typeof t?t:f(t)))},filter:function(t){"function"!=typeof t&&(t=h(t));for(var n=this._groups,e=n.length,o=new Array(e),r=0;r<e;++r)for(var i,a=n[r],s=a.length,c=o[r]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&c.push(i);return new yt(o,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,_);var e=n?x:w,o=this._parents,r=this._groups;"function"!=typeof t&&(t=b(t));for(var i=r.length,a=new Array(i),s=new Array(i),l=new Array(i),u=0;u<i;++u){var h=o[u],f=r[u],d=f.length,m=c(t.call(h,h&&h.__data__,u,o)),g=m.length,p=s[u]=new Array(g),y=a[u]=new Array(g),v=l[u]=new Array(d);e(h,f,p,y,v,m,n);for(var A,C,k=0,S=0;k<g;++k)if(A=p[k]){for(k>=S&&(S=k+1);!(C=y[S])&&++S<g;);A._next=C||null}}return(a=new yt(a,o))._enter=s,a._exit=l,a},enter:function(){return new yt(this._enter||this._groups.map(y),this._parents)},exit:function(){return new yt(this._exit||this._groups.map(y),this._parents)},join:function(t,n,e){var o=this.enter(),r=this,i=this.exit();return o="function"==typeof t?t(o):o.append(t+""),null!=n&&(r=n(r)),null==e?i.remove():e(i),o&&r?o.merge(r).order():r},merge:function(t){if(!(t instanceof yt))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,o=n.length,r=e.length,i=Math.min(o,r),a=new Array(o),s=0;s<i;++s)for(var c,l=n[s],u=e[s],h=l.length,f=a[s]=new Array(h),d=0;d<h;++d)(c=l[d]||u[d])&&(f[d]=c);for(;s<o;++s)a[s]=n[s];return new yt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var o,r=t[n],i=r.length-1,a=r[i];--i>=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=A);for(var e=this._groups,o=e.length,r=new Array(o),i=0;i<o;++i){for(var a,s=e[i],c=s.length,l=r[i]=new Array(c),u=0;u<c;++u)(a=s[u])&&(l[u]=a);l.sort(n)}return new yt(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var o=t[n],r=0,i=o.length;r<i;++r){var a=o[r];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,o=n.length;e<o;++e)for(var r,i=n[e],a=0,s=i.length;a<s;++a)(r=i[a])&&t.call(r,r.__data__,a,i);return this},attr:function(t,n){var e=S(t);if(arguments.length<2){var o=this.node();return e.local?o.getAttributeNS(e.space,e.local):o.getAttribute(e)}return this.each((null==n?e.local?T:L:"function"==typeof n?e.local?I:N:e.local?P:M)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?E:"function"==typeof n?F:D)(t,n,null==e?"":e)):R(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?O:"function"==typeof n?j:G)(t,n)):this.node()[t]},classed:function(t,n){var e=z(t+"");if(arguments.length<2){for(var o=W(this.node()),r=-1,i=e.length;++r<i;)if(!o.contains(e[r]))return!1;return!0}return this.each(("function"==typeof n?X:n?Y:U)(e,n))},text:function(t){return arguments.length?this.each(null==t?V:("function"==typeof t?J:Q)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?K:("function"==typeof t?tt:Z)(t)):this.node().innerHTML},raise:function(){return this.each(nt)},lower:function(){return this.each(et)},append:function(t){var n="function"==typeof t?t:it(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:it(t),o=null==n?at:"function"==typeof n?n:s(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(st)},clone:function(t){return this.select(t?lt:ct)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var o,r,i=ut(t+""),a=i.length;if(!(arguments.length<2)){for(s=n?ft:ht,o=0;o<a;++o)this.each(s(i[o],n,e));return this}var s=this.node().__on;if(s)for(var c,l=0,u=s.length;l<u;++l)for(o=0,c=s[l];o<a;++o)if((r=i[o]).type===c.type&&r.name===c.name)return c.value},dispatch:function(t,n){return this.each(("function"==typeof n?gt:mt)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var o,r=t[n],i=0,a=r.length;i<a;++i)(o=r[i])&&(yield o)}};const bt=vt;function wt(t){return"string"==typeof t?new yt([[document.querySelector(t)]],[document.documentElement]):new yt([[t]],pt)}function xt(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function _t(t,n){return fetch(t,n).then(xt)}function At(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function Ct(t,n){return fetch(t,n).then(At)}var kt={},St={};function Lt(t){return new Function("d","return {"+t.map((function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'})).join(",")+"}")}function Tt(t){var n=Object.create(null),e=[];return t.forEach((function(t){for(var o in t)o in n||e.push(n[o]=o)})),e}function Mt(t,n){var e=t+"",o=e.length;return o<n?new Array(n-o+1).join(0)+e:e}function Pt(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function o(t,n){var o,r=[],i=t.length,a=0,s=0,c=i<=0,l=!1;function u(){if(c)return St;if(l)return l=!1,kt;var n,o,r=a;if(34===t.charCodeAt(r)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(n=a)>=i?c=!0:10===(o=t.charCodeAt(a++))?l=!0:13===o&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(r+1,n-1).replace(/""/g,'"')}for(;a<i;){if(10===(o=t.charCodeAt(n=a++)))l=!0;else if(13===o)l=!0,10===t.charCodeAt(a)&&++a;else if(o!==e)continue;return t.slice(r,n)}return c=!0,t.slice(r,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(o=u())!==St;){for(var h=[];o!==kt&&o!==St;)h.push(o),o=u();n&&null==(h=n(h,s++))||r.push(h)}return r}function r(n,e){return n.map((function(n){return e.map((function(t){return a(n[t])})).join(t)}))}function i(n){return n.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?function(t){var n,e=t.getUTCHours(),o=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((n=t.getUTCFullYear())<0?"-"+Mt(-n,6):n>9999?"+"+Mt(n,6):Mt(n,4))+"-"+Mt(t.getUTCMonth()+1,2)+"-"+Mt(t.getUTCDate(),2)+(i?"T"+Mt(e,2)+":"+Mt(o,2)+":"+Mt(r,2)+"."+Mt(i,3)+"Z":r?"T"+Mt(e,2)+":"+Mt(o,2)+":"+Mt(r,2)+"Z":o||e?"T"+Mt(e,2)+":"+Mt(o,2)+"Z":"")}(t):n.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,n){var e,r,i=o(t,(function(t,o){if(e)return e(t,o-1);r=t,e=n?function(t,n){var e=Lt(t);return function(o,r){return n(e(o),r,t)}}(t,n):Lt(t)}));return i.columns=r||[],i},parseRows:o,format:function(n,e){return null==e&&(e=Tt(n)),[e.map(a).join(t)].concat(r(n,e)).join("\n")},formatBody:function(t,n){return null==n&&(n=Tt(t)),r(t,n).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var Nt=Pt(","),It=Nt.parse,Bt=(Nt.parseRows,Nt.format,Nt.formatBody,Nt.formatRows,Nt.formatRow,Nt.formatValue,Pt("\t")),Et=Bt.parse;function Dt(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Ft(t,n){return fetch(t,n).then(Dt)}function Rt(t){return function(n,e,o){return 2===arguments.length&&"function"==typeof e&&(o=e,e=void 0),Ft(n,e).then((function(n){return t(n,o)}))}}function Ot(t,n,e,o){3===arguments.length&&"function"==typeof e&&(o=e,e=void 0);var r=Pt(t);return Ft(n,e).then((function(t){return r.parse(t,o)}))}Bt.parseRows,Bt.format,Bt.formatBody,Bt.formatRows,Bt.formatRow,Bt.formatValue;var Gt=Rt(It),jt=Rt(Et);function zt(t,n){return new Promise((function(e,o){var r=new Image;for(var i in n)r[i]=n[i];r.onerror=o,r.onload=function(){e(r)},r.src=t}))}function Wt(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Ht(t,n){return fetch(t,n).then(Wt)}function qt(t){return(n,e)=>Ft(n,e).then((n=>(new DOMParser).parseFromString(n,t)))}const $t=qt("application/xml");var Yt=qt("text/html"),Ut=qt("image/svg+xml"),Xt={value:()=>{}};function Vt(){for(var t,n=0,e=arguments.length,o={};n<e;++n){if(!(t=arguments[n]+"")||t in o||/[\s.]/.test(t))throw new Error("illegal type: "+t);o[t]=[]}return new Qt(o)}function Qt(t){this._=t}function Jt(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",o=t.indexOf(".");if(o>=0&&(e=t.slice(o+1),t=t.slice(0,o)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function Kt(t,n){for(var e,o=0,r=t.length;o<r;++o)if((e=t[o]).name===n)return e.value}function Zt(t,n,e){for(var o=0,r=t.length;o<r;++o)if(t[o].name===n){t[o]=Xt,t=t.slice(0,o).concat(t.slice(o+1));break}return null!=e&&t.push({name:n,value:e}),t}Qt.prototype=Vt.prototype={constructor:Qt,on:function(t,n){var e,o=this._,r=Jt(t+"",o),i=-1,a=r.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++i<a;)if(e=(t=r[i]).type)o[e]=Zt(o[e],t.name,n);else if(null==n)for(e in o)o[e]=Zt(o[e],t.name,null);return this}for(;++i<a;)if((e=(t=r[i]).type)&&(e=Kt(o[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Qt(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,o,r=new Array(e),i=0;i<e;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,e=(o=this._[t]).length;i<e;++i)o[i].value.apply(n,r)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(n,e)}};const tn=Vt;function nn(t){t.preventDefault(),t.stopImmediatePropagation()}function en(t){var n=t.document.documentElement,e=wt(t).on("dragstart.drag",nn,!0);"onselectstart"in n?e.on("selectstart.drag",nn,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function on(t,n){var e=t.document.documentElement,o=wt(t).on("dragstart.drag",null);n&&(o.on("click.drag",nn,!0),setTimeout((function(){o.on("click.drag",null)}),0)),"onselectstart"in e?o.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function rn(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function an(t,n){var e=Object.create(t.prototype);for(var o in n)e[o]=n[o];return e}function sn(){}var cn=.7,ln=1/cn,un="\\s*([+-]?\\d+)\\s*",hn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dn=/^#([0-9a-f]{3,8})$/,mn=new RegExp("^rgb\\("+[un,un,un]+"\\)$"),gn=new RegExp("^rgb\\("+[fn,fn,fn]+"\\)$"),pn=new RegExp("^rgba\\("+[un,un,un,hn]+"\\)$"),yn=new RegExp("^rgba\\("+[fn,fn,fn,hn]+"\\)$"),vn=new RegExp("^hsl\\("+[hn,fn,fn]+"\\)$"),bn=new RegExp("^hsla\\("+[hn,fn,fn,hn]+"\\)$"),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};function xn(){return this.rgb().formatHex()}function _n(){return this.rgb().formatRgb()}function An(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=dn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?Cn(n):3===e?new Tn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?kn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?kn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=mn.exec(t))?new Tn(n[1],n[2],n[3],1):(n=gn.exec(t))?new Tn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=pn.exec(t))?kn(n[1],n[2],n[3],n[4]):(n=yn.exec(t))?kn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=vn.exec(t))?In(n[1],n[2]/100,n[3]/100,1):(n=bn.exec(t))?In(n[1],n[2]/100,n[3]/100,n[4]):wn.hasOwnProperty(t)?Cn(wn[t]):"transparent"===t?new Tn(NaN,NaN,NaN,0):null}function Cn(t){return new Tn(t>>16&255,t>>8&255,255&t,1)}function kn(t,n,e,o){return o<=0&&(t=n=e=NaN),new Tn(t,n,e,o)}function Sn(t){return t instanceof sn||(t=An(t)),t?new Tn((t=t.rgb()).r,t.g,t.b,t.opacity):new Tn}function Ln(t,n,e,o){return 1===arguments.length?Sn(t):new Tn(t,n,e,null==o?1:o)}function Tn(t,n,e,o){this.r=+t,this.g=+n,this.b=+e,this.opacity=+o}function Mn(){return"#"+Nn(this.r)+Nn(this.g)+Nn(this.b)}function Pn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Nn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function In(t,n,e,o){return o<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new En(t,n,e,o)}function Bn(t){if(t instanceof En)return new En(t.h,t.s,t.l,t.opacity);if(t instanceof sn||(t=An(t)),!t)return new En;if(t instanceof En)return t;var n=(t=t.rgb()).r/255,e=t.g/255,o=t.b/255,r=Math.min(n,e,o),i=Math.max(n,e,o),a=NaN,s=i-r,c=(i+r)/2;return s?(a=n===i?(e-o)/s+6*(e<o):e===i?(o-n)/s+2:(n-e)/s+4,s/=c<.5?i+r:2-i-r,a*=60):s=c>0&&c<1?0:a,new En(a,s,c,t.opacity)}function En(t,n,e,o){this.h=+t,this.s=+n,this.l=+e,this.opacity=+o}function Dn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Fn(t,n,e,o,r){var i=t*t,a=i*t;return((1-3*t+3*i-a)*n+(4-6*i+3*a)*e+(1+3*t+3*i-3*a)*o+a*r)/6}rn(sn,An,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xn,formatHex:xn,formatHsl:function(){return Bn(this).formatHsl()},formatRgb:_n,toString:_n}),rn(Tn,Ln,an(sn,{brighter:function(t){return t=null==t?ln:Math.pow(ln,t),new Tn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?cn:Math.pow(cn,t),new Tn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:Mn,formatHex:Mn,formatRgb:Pn,toString:Pn})),rn(En,(function(t,n,e,o){return 1===arguments.length?Bn(t):new En(t,n,e,null==o?1:o)}),an(sn,{brighter:function(t){return t=null==t?ln:Math.pow(ln,t),new En(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?cn:Math.pow(cn,t),new En(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,o=e+(e<.5?e:1-e)*n,r=2*e-o;return new Tn(Dn(t>=240?t-240:t+120,r,o),Dn(t,r,o),Dn(t<120?t+240:t-120,r,o),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const Rn=t=>()=>t;function On(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Rn(isNaN(t)?n:t)}const Gn=function t(n){var e=function(t){return 1==(t=+t)?On:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(o){return Math.pow(t+o*n,e)}}(n,e,t):Rn(isNaN(n)?e:n)}}(n);function o(t,n){var o=e((t=Ln(t)).r,(n=Ln(n)).r),r=e(t.g,n.g),i=e(t.b,n.b),a=On(t.opacity,n.opacity);return function(n){return t.r=o(n),t.g=r(n),t.b=i(n),t.opacity=a(n),t+""}}return o.gamma=t,o}(1);function jn(t){return function(n){var e,o,r=n.length,i=new Array(r),a=new Array(r),s=new Array(r);for(e=0;e<r;++e)o=Ln(n[e]),i[e]=o.r||0,a[e]=o.g||0,s[e]=o.b||0;return i=t(i),a=t(a),s=t(s),o.opacity=1,function(t){return o.r=i(t),o.g=a(t),o.b=s(t),o+""}}}function zn(t,n){var e,o=n?n.length:0,r=t?Math.min(o,t.length):0,i=new Array(r),a=new Array(o);for(e=0;e<r;++e)i[e]=Vn(t[e],n[e]);for(;e<o;++e)a[e]=n[e];return function(t){for(e=0;e<r;++e)a[e]=i[e](t);return a}}function Wn(t,n){var e=new Date;return t=+t,n=+n,function(o){return e.setTime(t*(1-o)+n*o),e}}function Hn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function qn(t,n){var e,o={},r={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?o[e]=Vn(t[e],n[e]):r[e]=n[e];return function(t){for(e in o)r[e]=o[e](t);return r}}jn((function(t){var n=t.length-1;return function(e){var o=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),r=t[o],i=t[o+1],a=o>0?t[o-1]:2*r-i,s=o<n-1?t[o+2]:2*i-r;return Fn((e-o/n)*n,a,r,i,s)}})),jn((function(t){var n=t.length;return function(e){var o=Math.floor(((e%=1)<0?++e:e)*n),r=t[(o+n-1)%n],i=t[o%n],a=t[(o+1)%n],s=t[(o+2)%n];return Fn((e-o/n)*n,r,i,a,s)}}));var $n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yn=new RegExp($n.source,"g");function Un(t,n){var e,o,r,i=$n.lastIndex=Yn.lastIndex=0,a=-1,s=[],c=[];for(t+="",n+="";(e=$n.exec(t))&&(o=Yn.exec(n));)(r=o.index)>i&&(r=n.slice(i,r),s[a]?s[a]+=r:s[++a]=r),(e=e[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,c.push({i:a,x:Hn(e,o)})),i=Yn.lastIndex;return i<n.length&&(r=n.slice(i),s[a]?s[a]+=r:s[++a]=r),s.length<2?c[0]?function(t){return function(n){return t(n)+""}}(c[0].x):function(t){return function(){return t}}(n):(n=c.length,function(t){for(var e,o=0;o<n;++o)s[(e=c[o]).i]=e.x(t);return s.join("")})}function Xn(t,n){n||(n=[]);var e,o=t?Math.min(n.length,t.length):0,r=n.slice();return function(i){for(e=0;e<o;++e)r[e]=t[e]*(1-i)+n[e]*i;return r}}function Vn(t,n){var e,o=typeof n;return null==n||"boolean"===o?Rn(n):("number"===o?Hn:"string"===o?(e=An(n))?(n=e,Gn):Un:n instanceof An?Gn:n instanceof Date?Wn:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(n)?Xn:Array.isArray(n)?zn:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?qn:Hn)(t,n)}function Qn(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var o=e.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,[(o=o.matrixTransform(n.getScreenCTM().inverse())).x,o.y]}if(n.getBoundingClientRect){var r=n.getBoundingClientRect();return[t.clientX-r.left-n.clientLeft,t.clientY-r.top-n.clientTop]}}return[t.pageX,t.pageY]}var Jn,Kn,Zn=0,te=0,ne=0,ee=0,oe=0,re=0,ie="object"==typeof performance&&performance.now?performance:Date,ae="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function se(){return oe||(ae(ce),oe=ie.now()+re)}function ce(){oe=0}function le(){this._call=this._time=this._next=null}function ue(t,n,e){var o=new le;return o.restart(t,n,e),o}function he(){oe=(ee=ie.now())+re,Zn=te=0;try{!function(){se(),++Zn;for(var t,n=Jn;n;)(t=oe-n._time)>=0&&n._call.call(null,t),n=n._next;--Zn}()}finally{Zn=0,function(){for(var t,n,e=Jn,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Jn=n);Kn=t,de(o)}(),oe=0}}function fe(){var t=ie.now(),n=t-ee;n>1e3&&(re-=n,ee=t)}function de(t){Zn||(te&&(te=clearTimeout(te)),t-oe>24?(t<1/0&&(te=setTimeout(he,t-ie.now()-re)),ne&&(ne=clearInterval(ne))):(ne||(ee=ie.now(),ne=setInterval(fe,1e3)),Zn=1,ae(he)))}function me(t,n,e){var o=new le;return n=null==n?0:+n,o.restart((e=>{o.stop(),t(e+n)}),n,e),o}le.prototype=ue.prototype={constructor:le,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?se():+e)+(null==n?0:+n),this._next||Kn===this||(Kn?Kn._next=this:Jn=this,Kn=this),this._call=t,this._time=e,de()},stop:function(){this._call&&(this._call=null,this._time=1/0,de())}};var ge=tn("start","end","cancel","interrupt"),pe=[];function ye(t,n,e,o,r,i){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var o,r=t.__transition;function i(c){var l,u,h,f;if(1!==e.state)return s();for(l in r)if((f=r[l]).name===e.name){if(3===f.state)return me(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[l]):+l<n&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete r[l])}if(me((function(){3===e.state&&(e.state=4,e.timer.restart(a,e.delay,e.time),a(c))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,o=new Array(h=e.tween.length),l=0,u=-1;l<h;++l)(f=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(o[++u]=f);o.length=u+1}}function a(n){for(var r=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(s),e.state=5,1),i=-1,a=o.length;++i<a;)o[i].call(t,r);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),s())}function s(){for(var o in e.state=6,e.timer.stop(),delete r[n],r)return;delete t.__transition}r[n]=e,e.timer=ue((function(t){e.state=1,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}),0,e.time)}(t,e,{name:n,index:o,group:r,on:ge,tween:pe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function ve(t,n){var e=we(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function be(t,n){var e=we(t,n);if(e.state>3)throw new Error("too late; already running");return e}function we(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function xe(t,n){var e,o,r,i=t.__transition,a=!0;if(i){for(r in n=null==n?null:n+"",i)(e=i[r]).name===n?(o=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(o?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete i[r]):a=!1;a&&delete t.__transition}}var _e,Ae=180/Math.PI,Ce={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ke(t,n,e,o,r,i){var a,s,c;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(c=t*e+n*o)&&(e-=t*c,o-=n*c),(s=Math.sqrt(e*e+o*o))&&(e/=s,o/=s,c/=s),t*o<n*e&&(t=-t,n=-n,c=-c,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(n,t)*Ae,skewX:Math.atan(c)*Ae,scaleX:a,scaleY:s}}function Se(t,n,e,o){function r(t){return t.length?t.pop()+" ":""}return function(i,a){var s=[],c=[];return i=t(i),a=t(a),function(t,o,r,i,a,s){if(t!==r||o!==i){var c=a.push("translate(",null,n,null,e);s.push({i:c-4,x:Hn(t,r)},{i:c-2,x:Hn(o,i)})}else(r||i)&&a.push("translate("+r+n+i+e)}(i.translateX,i.translateY,a.translateX,a.translateY,s,c),function(t,n,e,i){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),i.push({i:e.push(r(e)+"rotate(",null,o)-2,x:Hn(t,n)})):n&&e.push(r(e)+"rotate("+n+o)}(i.rotate,a.rotate,s,c),function(t,n,e,i){t!==n?i.push({i:e.push(r(e)+"skewX(",null,o)-2,x:Hn(t,n)}):n&&e.push(r(e)+"skewX("+n+o)}(i.skewX,a.skewX,s,c),function(t,n,e,o,i,a){if(t!==e||n!==o){var s=i.push(r(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Hn(t,e)},{i:s-2,x:Hn(n,o)})}else 1===e&&1===o||i.push(r(i)+"scale("+e+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,c),i=a=null,function(t){for(var n,e=-1,o=c.length;++e<o;)s[(n=c[e]).i]=n.x(t);return s.join("")}}}var Le=Se((function(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Ce:ke(n.a,n.b,n.c,n.d,n.e,n.f)}),"px, ","px)","deg)"),Te=Se((function(t){return null==t?Ce:(_e||(_e=document.createElementNS("http://www.w3.org/2000/svg","g")),_e.setAttribute("transform",t),(t=_e.transform.baseVal.consolidate())?ke((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Ce)}),", ",")",")");function Me(t,n){var e,o;return function(){var r=be(this,t),i=r.tween;if(i!==e)for(var a=0,s=(o=e=i).length;a<s;++a)if(o[a].name===n){(o=o.slice()).splice(a,1);break}r.tween=o}}function Pe(t,n,e){var o,r;if("function"!=typeof e)throw new Error;return function(){var i=be(this,t),a=i.tween;if(a!==o){r=(o=a).slice();for(var s={name:n,value:e},c=0,l=r.length;c<l;++c)if(r[c].name===n){r[c]=s;break}c===l&&r.push(s)}i.tween=r}}function Ne(t,n,e){var o=t._id;return t.each((function(){var t=be(this,o);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return we(t,o).value[n]}}function Ie(t,n){var e;return("number"==typeof n?Hn:n instanceof An?Gn:(e=An(n))?(n=e,Gn):Un)(t,n)}function Be(t){return function(){this.removeAttribute(t)}}function Ee(t){return function(){this.removeAttributeNS(t.space,t.local)}}function De(t,n,e){var o,r,i=e+"";return function(){var a=this.getAttribute(t);return a===i?null:a===o?r:r=n(o=a,e)}}function Fe(t,n,e){var o,r,i=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?r:r=n(o=a,e)}}function Re(t,n,e){var o,r,i;return function(){var a,s,c=e(this);if(null!=c)return(a=this.getAttribute(t))===(s=c+"")?null:a===o&&s===r?i:(r=s,i=n(o=a,c));this.removeAttribute(t)}}function Oe(t,n,e){var o,r,i;return function(){var a,s,c=e(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(s=c+"")?null:a===o&&s===r?i:(r=s,i=n(o=a,c));this.removeAttributeNS(t.space,t.local)}}function Ge(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function je(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function ze(t,n){var e,o;function r(){var r=n.apply(this,arguments);return r!==o&&(e=(o=r)&&je(t,r)),e}return r._value=n,r}function We(t,n){var e,o;function r(){var r=n.apply(this,arguments);return r!==o&&(e=(o=r)&&Ge(t,r)),e}return r._value=n,r}function He(t,n){return function(){ve(this,t).delay=+n.apply(this,arguments)}}function qe(t,n){return n=+n,function(){ve(this,t).delay=n}}function $e(t,n){return function(){be(this,t).duration=+n.apply(this,arguments)}}function Ye(t,n){return n=+n,function(){be(this,t).duration=n}}function Ue(t,n){if("function"!=typeof n)throw new Error;return function(){be(this,t).ease=n}}function Xe(t,n,e){var o,r,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?ve:be;return function(){var a=i(this,t),s=a.on;s!==o&&(r=(o=s).copy()).on(n,e),a.on=r}}var Ve=bt.prototype.constructor;function Qe(t){return function(){this.style.removeProperty(t)}}function Je(t,n,e){return function(o){this.style.setProperty(t,n.call(this,o),e)}}function Ke(t,n,e){var o,r;function i(){var i=n.apply(this,arguments);return i!==r&&(o=(r=i)&&Je(t,i,e)),o}return i._value=n,i}function Ze(t){return function(n){this.textContent=t.call(this,n)}}function to(t){var n,e;function o(){var o=t.apply(this,arguments);return o!==e&&(n=(e=o)&&Ze(o)),n}return o._value=t,o}var no=0;function eo(t,n,e,o){this._groups=t,this._parents=n,this._name=e,this._id=o}function oo(){return++no}var ro=bt.prototype;eo.prototype=function(t){return bt().transition(t)}.prototype={constructor:eo,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=s(t));for(var o=this._groups,r=o.length,i=new Array(r),a=0;a<r;++a)for(var c,l,u=o[a],h=u.length,f=i[a]=new Array(h),d=0;d<h;++d)(c=u[d])&&(l=t.call(c,c.__data__,d,u))&&("__data__"in c&&(l.__data__=c.__data__),f[d]=l,ye(f[d],n,e,d,f,we(c,e)));return new eo(i,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=u(t));for(var o=this._groups,r=o.length,i=[],a=[],s=0;s<r;++s)for(var c,l=o[s],h=l.length,f=0;f<h;++f)if(c=l[f]){for(var d,m=t.call(c,c.__data__,f,l),g=we(c,e),p=0,y=m.length;p<y;++p)(d=m[p])&&ye(d,n,e,p,m,g);i.push(m),a.push(c)}return new eo(i,a,n,e)},filter:function(t){"function"!=typeof t&&(t=h(t));for(var n=this._groups,e=n.length,o=new Array(e),r=0;r<e;++r)for(var i,a=n[r],s=a.length,c=o[r]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&c.push(i);return new eo(o,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,o=n.length,r=e.length,i=Math.min(o,r),a=new Array(o),s=0;s<i;++s)for(var c,l=n[s],u=e[s],h=l.length,f=a[s]=new Array(h),d=0;d<h;++d)(c=l[d]||u[d])&&(f[d]=c);for(;s<o;++s)a[s]=n[s];return new eo(a,this._parents,this._name,this._id)},selection:function(){return new Ve(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=oo(),o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],c=s.length,l=0;l<c;++l)if(a=s[l]){var u=we(a,n);ye(a,t,e,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new eo(o,this._parents,t,e)},call:ro.call,nodes:ro.nodes,node:ro.node,size:ro.size,empty:ro.empty,each:ro.each,on:function(t,n){var e=this._id;return arguments.length<2?we(this.node(),e).on.on(t):this.each(Xe(e,t,n))},attr:function(t,n){var e=S(t),o="transform"===e?Te:Ie;return this.attrTween(t,"function"==typeof n?(e.local?Oe:Re)(e,o,Ne(this,"attr."+t,n)):null==n?(e.local?Ee:Be)(e):(e.local?Fe:De)(e,o,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var o=S(t);return this.tween(e,(o.local?ze:We)(o,n))},style:function(t,n,e){var o="transform"==(t+="")?Le:Ie;return null==n?this.styleTween(t,function(t,n){var e,o,r;return function(){var i=R(this,t),a=(this.style.removeProperty(t),R(this,t));return i===a?null:i===e&&a===o?r:r=n(e=i,o=a)}}(t,o)).on("end.style."+t,Qe(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var o,r,i;return function(){var a=R(this,t),s=e(this),c=s+"";return null==s&&(this.style.removeProperty(t),c=s=R(this,t)),a===c?null:a===o&&c===r?i:(r=c,i=n(o=a,s))}}(t,o,Ne(this,"style."+t,n))).each(function(t,n){var e,o,r,i,a="style."+n,s="end."+a;return function(){var c=be(this,t),l=c.on,u=null==c.value[a]?i||(i=Qe(n)):void 0;l===e&&r===u||(o=(e=l).copy()).on(s,r=u),c.on=o}}(this._id,t)):this.styleTween(t,function(t,n,e){var o,r,i=e+"";return function(){var a=R(this,t);return a===i?null:a===o?r:r=n(o=a,e)}}(t,o,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==n)return this.tween(o,null);if("function"!=typeof n)throw new Error;return this.tween(o,Ke(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Ne(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,to(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var o,r=we(this.node(),e).tween,i=0,a=r.length;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((null==n?Me:Pe)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?He:qe)(n,t)):we(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?$e:Ye)(n,t)):we(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(Ue(n,t)):we(this.node(),n).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,n){return function(){var e=n.apply(this,arguments);if("function"!=typeof e)throw new Error;be(this,t).ease=e}}(this._id,t))},end:function(){var t,n,e=this,o=e._id,r=e.size();return new Promise((function(i,a){var s={value:a},c={value:function(){0==--r&&i()}};e.each((function(){var e=be(this,o),r=e.on;r!==t&&((n=(t=r).copy())._.cancel.push(s),n._.interrupt.push(s),n._.end.push(c)),e.on=n})),0===r&&i()}))},[Symbol.iterator]:ro[Symbol.iterator]};var io={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function ao(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}bt.prototype.interrupt=function(t){return this.each((function(){xe(this,t)}))},bt.prototype.transition=function(t){var n,e;t instanceof eo?(n=t._id,t=t._name):(n=oo(),(e=io).time=se(),t=null==t?null:t+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],c=s.length,l=0;l<c;++l)(a=s[l])&&ye(a,t,n,l,s,e||ao(a,n));return new eo(o,this._parents,t,n)};const so=t=>()=>t;function co(t,{sourceEvent:n,target:e,selection:o,mode:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:o,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function lo(t){t.stopImmediatePropagation()}function uo(t){t.preventDefault(),t.stopImmediatePropagation()}var ho={name:"drag"},fo={name:"space"},mo={name:"handle"},go={name:"center"};const{abs:po,max:yo,min:vo}=Math;function bo(t){return[+t[0],+t[1]]}function wo(t){return[bo(t[0]),bo(t[1])]}var xo={name:"x",handles:["w","e"].map(Mo),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},_o={name:"y",handles:["n","s"].map(Mo),input:function(t,n){return null==t?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Ao={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Mo),input:function(t){return null==t?null:wo(t)},output:function(t){return t}},Co={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ko={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},So={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Lo={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},To={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Mo(t){return{type:t}}function Po(t){return!t.ctrlKey&&!t.button}function No(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Io(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bo(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Eo(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Do(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function Fo(){return Go(xo)}function Ro(){return Go(_o)}function Oo(){return Go(Ao)}function Go(t){var n,e=No,o=Po,r=Io,i=!0,a=tn("start","brush","end"),s=6;function c(n){var e=n.property("__brush",g).selectAll(".overlay").data([Mo("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Co.overlay).merge(e).each((function(){var t=Bo(this).extent;wt(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([Mo("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Co.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var o=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));o.exit().remove(),o.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Co[t.type]})),n.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",f).filter(r).on("touchstart.brush",f).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function l(){var t=wt(this),n=Bo(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-s/2:n[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-s/2:n[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+s:s}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(t,n,e){var o=t.__brush.emitter;return!o||e&&o.clean?new h(t,n,e):o}function h(t,n,e){this.that=t,this.args=n,this.state=t.__brush,this.active=0,this.clean=e}function f(e){if((!n||e.touches)&&o.apply(this,arguments)){var r,a,s,c,h,f,d,m,g,p,y,v=this,b=e.target.__data__.type,w="selection"===(i&&e.metaKey?b="overlay":b)?ho:i&&e.altKey?go:mo,x=t===_o?null:Lo[b],_=t===xo?null:To[b],A=Bo(v),C=A.extent,k=A.selection,S=C[0][0],L=C[0][1],T=C[1][0],M=C[1][1],P=0,N=0,I=x&&_&&i&&e.shiftKey,B=Array.from(e.touches||[e],(t=>{const n=t.identifier;return(t=Qn(t,v)).point0=t.slice(),t.identifier=n,t}));if("overlay"===b){k&&(g=!0);const n=[B[0],B[1]||B[0]];A.selection=k=[[r=t===_o?S:vo(n[0][0],n[1][0]),s=t===xo?L:vo(n[0][1],n[1][1])],[h=t===_o?T:yo(n[0][0],n[1][0]),d=t===xo?M:yo(n[0][1],n[1][1])]],B.length>1&&G()}else r=k[0][0],s=k[0][1],h=k[1][0],d=k[1][1];a=r,c=s,f=h,m=d;var E=wt(v).attr("pointer-events","none"),D=E.selectAll(".overlay").attr("cursor",Co[b]);xe(v);var F=u(v,arguments,!0).beforestart();if(e.touches)F.moved=O,F.ended=j;else{var R=wt(e.view).on("mousemove.brush",O,!0).on("mouseup.brush",j,!0);i&&R.on("keydown.brush",z,!0).on("keyup.brush",W,!0),en(e.view)}l.call(v),F.start(e,w.name)}function O(t){for(const n of t.changedTouches||[t])for(const t of B)t.identifier===n.identifier&&(t.cur=Qn(n,v));if(I&&!p&&!y&&1===B.length){const t=B[0];po(t.cur[0]-t[0])>po(t.cur[1]-t[1])?y=!0:p=!0}for(const t of B)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,uo(t),G(t)}function G(t){const n=B[0],e=n.point0;var o;switch(P=n[0]-e[0],N=n[1]-e[1],w){case fo:case ho:x&&(P=yo(S-r,vo(T-h,P)),a=r+P,f=h+P),_&&(N=yo(L-s,vo(M-d,N)),c=s+N,m=d+N);break;case mo:B[1]?(x&&(a=yo(S,vo(T,B[0][0])),f=yo(S,vo(T,B[1][0])),x=1),_&&(c=yo(L,vo(M,B[0][1])),m=yo(L,vo(M,B[1][1])),_=1)):(x<0?(P=yo(S-r,vo(T-r,P)),a=r+P,f=h):x>0&&(P=yo(S-h,vo(T-h,P)),a=r,f=h+P),_<0?(N=yo(L-s,vo(M-s,N)),c=s+N,m=d):_>0&&(N=yo(L-d,vo(M-d,N)),c=s,m=d+N));break;case go:x&&(a=yo(S,vo(T,r-P*x)),f=yo(S,vo(T,h+P*x))),_&&(c=yo(L,vo(M,s-N*_)),m=yo(L,vo(M,d+N*_)))}f<a&&(x*=-1,o=r,r=h,h=o,o=a,a=f,f=o,b in ko&&D.attr("cursor",Co[b=ko[b]])),m<c&&(_*=-1,o=s,s=d,d=o,o=c,c=m,m=o,b in So&&D.attr("cursor",Co[b=So[b]])),A.selection&&(k=A.selection),p&&(a=k[0][0],f=k[1][0]),y&&(c=k[0][1],m=k[1][1]),k[0][0]===a&&k[0][1]===c&&k[1][0]===f&&k[1][1]===m||(A.selection=[[a,c],[f,m]],l.call(v),F.brush(t,w.name))}function j(t){if(lo(t),t.touches){if(t.touches.length)return;n&&clearTimeout(n),n=setTimeout((function(){n=null}),500)}else on(t.view,g),R.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);E.attr("pointer-events","all"),D.attr("cursor",Co.overlay),A.selection&&(k=A.selection),Eo(k)&&(A.selection=null,l.call(v)),F.end(t,w.name)}function z(t){switch(t.keyCode){case 16:I=x&&_;break;case 18:w===mo&&(x&&(h=f-P*x,r=a+P*x),_&&(d=m-N*_,s=c+N*_),w=go,G());break;case 32:w!==mo&&w!==go||(x<0?h=f-P:x>0&&(r=a-P),_<0?d=m-N:_>0&&(s=c-N),w=fo,D.attr("cursor",Co.selection),G());break;default:return}uo(t)}function W(t){switch(t.keyCode){case 16:I&&(p=y=I=!1,G());break;case 18:w===go&&(x<0?h=f:x>0&&(r=a),_<0?d=m:_>0&&(s=c),w=mo,G());break;case 32:w===fo&&(t.altKey?(x&&(h=f-P*x,r=a+P*x),_&&(d=m-N*_,s=c+N*_),w