@patricksurry/g3
Version:
A flexible Javascript framework for building steam gauge instrument panels that display live external metrics from flight (or other) simulators like XPlane or MS FS2020
1 lines • 160 kB
JavaScript
var g3=function(e){"use strict";!function(){const e={};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}();var t=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),n="-ms-",r="-moz-",a="-webkit-",i="comm",o="rule",s="decl",l="@keyframes",u=Math.abs,c=String.fromCharCode,h=Object.assign;function f(e){return e.trim()}function p(e,t,n){return e.replace(t,n)}function m(e,t){return e.indexOf(t)}function g(e,t){return 0|e.charCodeAt(t)}function d(e,t,n){return e.slice(t,n)}function y(e){return e.length}function v(e){return e.length}function _(e,t){return t.push(e),e}var b=1,w=1,k=0,x=0,M=0,C="";function z(e,t,n,r,a,i,o){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:b,column:w,length:o,return:""}}function A(e,t){return h(z("",null,null,"",null,null,0),e,{length:-e.length},t)}function S(){return M=x>0?g(C,--x):0,w--,10===M&&(w=1,b--),M}function $(){return M=x<k?g(C,x++):0,w++,10===M&&(w=1,b++),M}function T(){return g(C,x)}function D(){return x}function E(e,t){return d(C,e,t)}function N(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function O(e){return b=w=1,k=y(C=e),x=0,[]}function U(e){return C="",e}function P(e){return f(E(x-1,j(91===e?e+2:40===e?e+1:e)))}function L(e){for(;(M=T())&&M<33;)$();return N(e)>2||N(M)>3?"":" "}function F(e,t){for(;--t&&$()&&!(M<48||M>102||M>57&&M<65||M>70&&M<97););return E(e,D()+(t<6&&32==T()&&32==$()))}function j(e){for(;$();)switch(M){case e:return x;case 34:case 39:34!==e&&39!==e&&j(M);break;case 40:41===e&&j(e);break;case 92:$()}return x}function R(e,t){for(;$()&&e+M!==57&&(e+M!==84||47!==T()););return"/*"+E(t,x-1)+"*"+c(47===e?e:$())}function G(e){for(;!N(T());)$();return E(e,x)}function H(e){return U(I("",null,null,null,[""],e=O(e),0,[0],e))}function I(e,t,n,r,a,i,o,s,l){for(var u=0,h=0,f=o,d=0,v=0,b=0,w=1,k=1,x=1,M=0,C="",z=a,A=i,E=r,N=C;k;)switch(b=M,M=$()){case 40:if(108!=b&&58==g(N,f-1)){-1!=m(N+=p(P(M),"&","&\f"),"&\f")&&(x=-1);break}case 34:case 39:case 91:N+=P(M);break;case 9:case 10:case 13:case 32:N+=L(b);break;case 92:N+=F(D()-1,7);continue;case 47:switch(T()){case 42:case 47:_(K(R($(),D()),t,n),l);break;default:N+="/"}break;case 123*w:s[u++]=y(N)*x;case 125*w:case 59:case 0:switch(M){case 0:case 125:k=0;case 59+h:-1==x&&(N=p(N,/\f/g,"")),v>0&&y(N)-f&&_(v>32?B(N+";",r,n,f-1):B(p(N," ","")+";",r,n,f-2),l);break;case 59:N+=";";default:if(_(E=q(N,t,n,u,h,a,s,C,z=[],A=[],f),i),123===M)if(0===h)I(N,t,E,E,z,i,f,s,A);else switch(99===d&&110===g(N,3)?100:d){case 100:case 108:case 109:case 115:I(e,E,E,r&&_(q(e,E,E,0,0,a,s,C,a,z=[],f),A),a,A,f,s,r?z:A);break;default:I(N,E,E,E,[""],A,0,s,A)}}u=h=v=0,w=x=1,C=N="",f=o;break;case 58:f=1+y(N),v=b;default:if(w<1)if(123==M)--w;else if(125==M&&0==w++&&125==S())continue;switch(N+=c(M),M*w){case 38:x=h>0?1:(N+="\f",-1);break;case 44:s[u++]=(y(N)-1)*x,x=1;break;case 64:45===T()&&(N+=P($())),d=T(),h=f=y(C=N+=G(D())),M++;break;case 45:45===b&&2==y(N)&&(w=0)}}return i}function q(e,t,n,r,a,i,s,l,c,h,m){for(var g=a-1,y=0===a?i:[""],_=v(y),b=0,w=0,k=0;b<r;++b)for(var x=0,M=d(e,g+1,g=u(w=s[b])),C=e;x<_;++x)(C=f(w>0?y[x]+" "+M:p(M,/&\f/g,y[x])))&&(c[k++]=C);return z(e,t,n,0===a?o:l,c,h,m)}function K(e,t,n){return z(e,t,n,i,c(M),d(e,2,-2),0)}function B(e,t,n,r){return z(e,t,n,s,d(e,0,r),d(e,r+1,-1),r)}function Y(e,t){for(var n="",r=v(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function V(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case s:return e.return=e.return||e.value;case i:return"";case l:return e.return=e.value+"{"+Y(e.children,r)+"}";case o:e.value=e.props.join(",")}return y(n=Y(e.children,r))?e.return=e.value+"{"+n+"}":""}function W(e){var t=v(e);return function(n,r,a,i){for(var o="",s=0;s<t;s++)o+=e[s](n,r,a,i)||"";return o}}function X(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Z="undefined"!=typeof document,Q=function(e,t,n){for(var r=0,a=0;r=a,a=T(),38===r&&12===a&&(t[n]=1),!N(a);)$();return E(e,x)},J=function(e,t){return U(function(e,t){var n=-1,r=44;do{switch(N(r)){case 0:38===r&&12===T()&&(t[n]=1),e[n]+=Q(x-1,t,n);break;case 2:e[n]+=P(r);break;case 4:if(44===r){e[++n]=58===T()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=c(r)}}while(r=$());return e}(O(e),t))},ee=new WeakMap,te=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ee.get(n))&&!r){ee.set(e,!0);for(var a=[],i=J(t,a),o=n.props,s=0,l=0;s<i.length;s++)for(var u=0;u<o.length;u++,l++)e.props[l]=a[s]?i[s].replace(/&\f/g,o[u]):o[u]+" "+i[s]}}},ne=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function re(e,t){switch(function(e,t){return 45^g(e,0)?(((t<<2^g(e,0))<<2^g(e,1))<<2^g(e,2))<<2^g(e,3):0}(e,t)){case 5103:return a+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return a+e+r+e+n+e+e;case 6828:case 4268:return a+e+n+e+e;case 6165:return a+e+n+"flex-"+e+e;case 5187:return a+e+p(e,/(\w+).+(:[^]+)/,a+"box-$1$2"+n+"flex-$1$2")+e;case 5443:return a+e+n+"flex-item-"+p(e,/flex-|-self/,"")+e;case 4675:return a+e+n+"flex-line-pack"+p(e,/align-content|flex-|-self/,"")+e;case 5548:return a+e+n+p(e,"shrink","negative")+e;case 5292:return a+e+n+p(e,"basis","preferred-size")+e;case 6060:return a+"box-"+p(e,"-grow","")+a+e+n+p(e,"grow","positive")+e;case 4554:return a+p(e,/([^-])(transform)/g,"$1"+a+"$2")+e;case 6187:return p(p(p(e,/(zoom-|grab)/,a+"$1"),/(image-set)/,a+"$1"),e,"")+e;case 5495:case 3959:return p(e,/(image-set\([^]*)/,a+"$1$`$1");case 4968:return p(p(e,/(.+:)(flex-)?(.*)/,a+"box-pack:$3"+n+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a+e+e;case 4095:case 3583:case 4068:case 2532:return p(e,/(.+)-inline(.+)/,a+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(y(e)-1-t>6)switch(g(e,t+1)){case 109:if(45!==g(e,t+4))break;case 102:return p(e,/(.+:)(.+)-([^]+)/,"$1"+a+"$2-$3$1"+r+(108==g(e,t+3)?"$3":"$2-$3"))+e;case 115:return~m(e,"stretch")?re(p(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==g(e,t+1))break;case 6444:switch(g(e,y(e)-3-(~m(e,"!important")&&10))){case 107:return p(e,":",":"+a)+e;case 101:return p(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+a+(45===g(e,14)?"inline-":"")+"box$3$1"+a+"$2$3$1"+n+"$2box$3")+e}break;case 5936:switch(g(e,t+11)){case 114:return a+e+n+p(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return a+e+n+p(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return a+e+n+p(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return a+e+n+e+e}return e}var ae,ie,oe=Z?void 0:(ae=function(){return X(function(){return{}})},ie=new WeakMap,function(e){if(ie.has(e))return ie.get(e);var t=ae(e);return ie.set(e,t),t}),se=[function(e,t,r,i){if(e.length>-1&&!e.return)switch(e.type){case s:e.return=re(e.value,e.length);break;case l:return Y([A(e,{value:p(e.value,"@","@"+a)})],i);case o:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Y([A(e,{props:[p(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return Y([A(e,{props:[p(t,/:(plac\w+)/,":"+a+"input-$1")]}),A(e,{props:[p(t,/:(plac\w+)/,":-moz-$1")]}),A(e,{props:[p(t,/:(plac\w+)/,n+"input-$1")]})],i)}return""})}}],le=function(e){var n=e.key;if(Z&&"css"===n){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var a,i,o=e.stylisPlugins||se,s={},l=[];Z&&(a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)s[t[n]]=!0;l.push(e)}));var u,c=[te,ne];if(oe){var h=[V],f=W(c.concat(o,h)),p=oe(o)(n),m=function(e,t){var n=t.name;return void 0===p[n]&&(p[n]=Y(H(e?e+"{"+t.styles+"}":t.styles),f)),p[n]};i=function(e,t,n,r){var a=t.name,i=m(e,t);return void 0===v.compat?(r&&(v.inserted[a]=!0),i):r?void(v.inserted[a]=i):i}}else{var g,d=[V,(u=function(e){g.insert(e)},function(e){e.root||(e=e.return)&&u(e)})],y=W(c.concat(o,d));i=function(e,t,n,r){g=n,Y(H(e?e+"{"+t.styles+"}":t.styles),y),r&&(v.inserted[t.name]=!0)}}var v={key:n,sheet:new t({key:n,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:i};return v.sheet.hydrate(l),v};var ue={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ce=/[A-Z]|^ms/g,he=/_EMO_([^_]+?)_([^]*?)_EMO_/g,fe=function(e){return 45===e.charCodeAt(1)},pe=function(e){return null!=e&&"boolean"!=typeof e},me=X(function(e){return fe(e)?e:e.replace(ce,"-$&").toLowerCase()}),ge=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(he,function(e,t,n){return ye={name:t,styles:n,next:ye},t})}return 1===ue[e]||fe(e)||"number"!=typeof t||0===t?t:t+"px"};function de(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var a=n;if(1===a.anim)return ye={name:a.name,styles:a.styles,next:ye},a.name;var i=n;if(void 0!==i.styles){var o=i.next;if(void 0!==o)for(;void 0!==o;)ye={name:o.name,styles:o.styles,next:ye},o=o.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=de(e,t,n[a])+";";else for(var i in n){var o=n[i];if("object"!=typeof o){var s=o;null!=t&&void 0!==t[s]?r+=i+"{"+t[s]+"}":pe(s)&&(r+=me(i)+":"+ge(i,s)+";")}else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var l=de(e,t,o);switch(i){case"animation":case"animationName":r+=me(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var u=0;u<o.length;u++)pe(o[u])&&(r+=me(i)+":"+ge(i,o[u])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=ye,l=n(e);return ye=s,de(e,t,l)}}var u=n;if(null==t)return u;var c=t[u];return void 0!==c?c:u}var ye,ve=/label:\s*([^\s;{]+)\s*(;|$)/g;function _e(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,a="";ye=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,a+=de(n,t,i)):a+=i[0];for(var o=1;o<e.length;o++){if(a+=de(n,t,e[o]),r)a+=i[o]}ve.lastIndex=0;for(var s,l="";null!==(s=ve.exec(a));)l+="-"+s[1];var u=function(e){for(var t,n=0,r=0,a=e.length;a>=4;++r,a-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(a){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(a)+l;return{name:u,styles:a,next:ye}}var be="undefined"!=typeof document;function we(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}var ke=function(e,t,n){!function(e,t,n){var r=e.key+"-"+t.name;(!1===n||!1===be&&void 0!==e.compat)&&void 0===e.registered[r]&&(e.registered[r]=t.styles)}(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a="",i=t;do{var o=e.insert(t===i?"."+r:"",i,e.sheet,!0);be||void 0===o||(a+=o),i=i.next}while(void 0!==i);if(!be&&0!==a.length)return a}};function xe(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function Me(e,t,n){var r=[],a=we(e,r,n);return r.length<2?n:a+t(r)}var Ce=function e(t){for(var n="",r=0;r<t.length;r++){var a=t[r];if(null!=a){var i=void 0;switch(typeof a){case"boolean":break;case"object":if(Array.isArray(a))i=e(a);else for(var o in i="",a)a[o]&&o&&(i&&(i+=" "),i+=o);break;default:i=a}i&&(n&&(n+=" "),n+=i)}}return n},ze=function(e){var t=le(e);t.sheet.speedy=function(e){this.isSpeedy=e},t.compat=!0;var n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var a=_e(n,t.registered,void 0);return ke(t,a,!1),t.key+"-"+a.name};return{css:n,cx:function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return Me(t.registered,n,Ce(r))},injectGlobal:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var a=_e(n,t.registered);xe(t,a)},keyframes:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var a=_e(n,t.registered),i="animation-"+a.name;return xe(t,{name:a.name,styles:"@keyframes "+i+"{"+a.styles+"}"}),i},hydrate:function(e){e.forEach(function(e){t.inserted[e]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:we.bind(null,t.registered),merge:Me.bind(null,t.registered,n)}}({key:"css"}),Ae=ze.injectGlobal,Se=ze.css;function $e(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Te(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function De(e){let t,n,r;function a(e,r,a=0,i=e.length){if(a<i){if(0!==t(r,r))return i;do{const t=a+i>>>1;n(e[t],r)<0?a=t+1:i=t}while(a<i)}return a}return 2!==e.length?(t=$e,n=(t,n)=>$e(e(t),n),r=(t,n)=>e(t)-n):(t=e===$e||e===Te?e:Ee,n=e,r=e),{left:a,center:function(e,t,n=0,i=e.length){const o=a(e,t,n,i-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o},right:function(e,r,a=0,i=e.length){if(a<i){if(0!==t(r,r))return i;do{const t=a+i>>>1;n(e[t],r)<=0?a=t+1:i=t}while(a<i)}return a}}}function Ee(){return 0}const Ne=De($e).right;De(function(e){return null===e?NaN:+e}).center;var Oe=Ne;const Ue=Math.sqrt(50),Pe=Math.sqrt(10),Le=Math.sqrt(2);function Fe(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=Ue?10:i>=Pe?5:i>=Le?2:1;let s,l,u;return a<0?(u=Math.pow(10,-a)/o,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,a)*o,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=n&&n<2?Fe(e,t,2*n):[s,l,u]}function je(e,t,n){return Fe(e=+e,t=+t,n=+n)[2]}function Re(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n)),i=new Array(a);++r<a;)i[r]=e+r*n;return i}var Ge={value:()=>{}};function He(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new Ie(r)}function Ie(e){this._=e}function qe(e,t){for(var n,r=0,a=e.length;r<a;++r)if((n=e[r]).name===t)return n.value}function Ke(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=Ge,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}Ie.prototype=He.prototype={constructor:Ie,on:function(e,t){var n,r,a=this._,i=(r=a,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),o=-1,s=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++o<s;)if(n=(e=i[o]).type)a[n]=Ke(a[n],e.name,t);else if(null==t)for(n in a)a[n]=Ke(a[n],e.name,null);return this}for(;++o<s;)if((n=(e=i[o]).type)&&(n=qe(a[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ie(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,a=new Array(n),i=0;i<n;++i)a[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(r=this._[e]).length;i<n;++i)r[i].value.apply(t,a)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)}};var Be="http://www.w3.org/1999/xhtml",Ye={svg:"http://www.w3.org/2000/svg",xhtml:Be,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ve(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Ye.hasOwnProperty(t)?{space:Ye[t],local:e}:e}function We(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Be&&t.documentElement.namespaceURI===Be?t.createElement(e):t.createElementNS(n,e)}}function Xe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ze(e){var t=Ve(e);return(t.local?Xe:We)(t)}function Qe(){}function Je(e){return null==e?Qe:function(){return this.querySelector(e)}}function et(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function tt(){return[]}function nt(e){return null==e?tt:function(){return this.querySelectorAll(e)}}function rt(e){return function(){return this.matches(e)}}function at(e){return function(t){return t.matches(e)}}var it=Array.prototype.find;function ot(){return this.firstElementChild}var st=Array.prototype.filter;function lt(){return Array.from(this.children)}function ut(e){return new Array(e.length)}function ct(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ht(e,t,n,r,a,i){for(var o,s=0,l=t.length,u=i.length;s<u;++s)(o=t[s])?(o.__data__=i[s],r[s]=o):n[s]=new ct(e,i[s]);for(;s<l;++s)(o=t[s])&&(a[s]=o)}function ft(e,t,n,r,a,i,o){var s,l,u,c=new Map,h=t.length,f=i.length,p=new Array(h);for(s=0;s<h;++s)(l=t[s])&&(p[s]=u=o.call(l,l.__data__,s,t)+"",c.has(u)?a[s]=l:c.set(u,l));for(s=0;s<f;++s)u=o.call(e,i[s],s,i)+"",(l=c.get(u))?(r[s]=l,l.__data__=i[s],c.delete(u)):n[s]=new ct(e,i[s]);for(s=0;s<h;++s)(l=t[s])&&c.get(p[s])===l&&(a[s]=l)}function pt(e){return e.__data__}function mt(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function gt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dt(e){return function(){this.removeAttribute(e)}}function yt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vt(e,t){return function(){this.setAttribute(e,t)}}function _t(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function bt(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function wt(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function kt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function xt(e){return function(){this.style.removeProperty(e)}}function Mt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ct(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function zt(e,t){return e.style.getPropertyValue(t)||kt(e).getComputedStyle(e,null).getPropertyValue(t)}function At(e){return function(){delete this[e]}}function St(e,t){return function(){this[e]=t}}function $t(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Tt(e){return e.trim().split(/^|\s+/)}function Dt(e){return e.classList||new Et(e)}function Et(e){this._node=e,this._names=Tt(e.getAttribute("class")||"")}function Nt(e,t){for(var n=Dt(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function Ot(e,t){for(var n=Dt(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function Ut(e){return function(){Nt(this,e)}}function Pt(e){return function(){Ot(this,e)}}function Lt(e,t){return function(){(t.apply(this,arguments)?Nt:Ot)(this,e)}}function Ft(){this.textContent=""}function jt(e){return function(){this.textContent=e}}function Rt(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Gt(){this.innerHTML=""}function Ht(e){return function(){this.innerHTML=e}}function It(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function qt(){this.nextSibling&&this.parentNode.appendChild(this)}function Kt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Bt(){return null}function Yt(){var e=this.parentNode;e&&e.removeChild(this)}function Vt(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Wt(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Xt(e){return function(){var t=this.__on;if(t){for(var n,r=0,a=-1,i=t.length;r<i;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++a]=n:this.removeEventListener(n.type,n.listener,n.options);++a?t.length=a:delete this.__on}}}function Zt(e,t,n){return function(){var r,a=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(a)for(var o=0,s=a.length;o<s;++o)if((r=a[o]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=t);this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},a?a.push(r):this.__on=[r]}}function Qt(e,t,n){var r=kt(e),a=r.CustomEvent;"function"==typeof a?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function Jt(e,t){return function(){return Qt(this,e,t)}}function en(e,t){return function(){return Qt(this,e,t.apply(this,arguments))}}ct.prototype={constructor:ct,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},Et.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var tn=[null];function nn(e,t){this._groups=e,this._parents=t}function rn(){return new nn([[document.documentElement]],tn)}function an(e){return"string"==typeof e?new nn([[document.querySelector(e)]],[document.documentElement]):new nn([[e]],tn)}function on(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sn(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ln(){}nn.prototype=rn.prototype={constructor:nn,select:function(e){"function"!=typeof e&&(e=Je(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i,o,s=t[a],l=s.length,u=r[a]=new Array(l),c=0;c<l;++c)(i=s[c])&&(o=e.call(i,i.__data__,c,s))&&("__data__"in i&&(o.__data__=i.__data__),u[c]=o);return new nn(r,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return et(e.apply(this,arguments))}}(e):nt(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var o,s=t[i],l=s.length,u=0;u<l;++u)(o=s[u])&&(r.push(e.call(o,o.__data__,u,s)),a.push(o));return new nn(r,a)},selectChild:function(e){return this.select(null==e?ot:function(e){return function(){return it.call(this.children,e)}}("function"==typeof e?e:at(e)))},selectChildren:function(e){return this.selectAll(null==e?lt:function(e){return function(){return st.call(this.children,e)}}("function"==typeof e?e:at(e)))},filter:function(e){"function"!=typeof e&&(e=rt(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i,o=t[a],s=o.length,l=r[a]=[],u=0;u<s;++u)(i=o[u])&&e.call(i,i.__data__,u,o)&&l.push(i);return new nn(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,pt);var n=t?ft:ht,r=this._parents,a=this._groups;"function"!=typeof e&&(e=function(e){return function(){return e}}(e));for(var i=a.length,o=new Array(i),s=new Array(i),l=new Array(i),u=0;u<i;++u){var c=r[u],h=a[u],f=h.length,p=mt(e.call(c,c&&c.__data__,u,r)),m=p.length,g=s[u]=new Array(m),d=o[u]=new Array(m);n(c,h,g,d,l[u]=new Array(f),p,t);for(var y,v,_=0,b=0;_<m;++_)if(y=g[_]){for(_>=b&&(b=_+1);!(v=d[b])&&++b<m;);y._next=v||null}}return(o=new nn(o,r))._enter=s,o._exit=l,o},enter:function(){return new nn(this._enter||this._groups.map(ut),this._parents)},exit:function(){return new nn(this._exit||this._groups.map(ut),this._parents)},join:function(e,t,n){var r=this.enter(),a=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(a=t(a))&&(a=a.selection()),null==n?i.remove():n(i),r&&a?r.merge(a).order():a},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,i=r.length,o=Math.min(a,i),s=new Array(a),l=0;l<o;++l)for(var u,c=n[l],h=r[l],f=c.length,p=s[l]=new Array(f),m=0;m<f;++m)(u=c[m]||h[m])&&(p[m]=u);for(;l<a;++l)s[l]=n[l];return new nn(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,a=e[t],i=a.length-1,o=a[i];--i>=0;)(r=a[i])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=gt);for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var o,s=n[i],l=s.length,u=a[i]=new Array(l),c=0;c<l;++c)(o=s[c])&&(u[c]=o);u.sort(t)}return new nn(a,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a,i=t[n],o=0,s=i.length;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this},attr:function(e,t){var n=Ve(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?yt:dt:"function"==typeof t?n.local?wt:bt:n.local?_t:vt)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?xt:"function"==typeof t?Ct:Mt)(e,t,null==n?"":n)):zt(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?At:"function"==typeof t?$t:St)(e,t)):this.node()[e]},classed:function(e,t){var n=Tt(e+"");if(arguments.length<2){for(var r=Dt(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each(("function"==typeof t?Lt:t?Ut:Pt)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ft:("function"==typeof e?Rt:jt)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Gt:("function"==typeof e?It:Ht)(e)):this.node().innerHTML},raise:function(){return this.each(qt)},lower:function(){return this.each(Kt)},append:function(e){var t="function"==typeof e?e:Ze(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Ze(e),r=null==t?Bt:"function"==typeof t?t:Je(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Yt)},clone:function(e){return this.select(e?Wt:Vt)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,a,i=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),o=i.length;if(!(arguments.length<2)){for(s=t?Zt:Xt,r=0;r<o;++r)this.each(s(i[r],t,n));return this}var s=this.node().__on;if(s)for(var l,u=0,c=s.length;u<c;++u)for(r=0,l=s[u];r<o;++r)if((a=i[r]).type===l.type&&a.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?en:Jt)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,a=e[t],i=0,o=a.length;i<o;++i)(r=a[i])&&(yield r)}};var un=.7,cn=1/un,hn="\\s*([+-]?\\d+)\\s*",fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mn=/^#([0-9a-f]{3,8})$/,gn=new RegExp(`^rgb\\(${hn},${hn},${hn}\\)$`),dn=new RegExp(`^rgb\\(${pn},${pn},${pn}\\)$`),yn=new RegExp(`^rgba\\(${hn},${hn},${hn},${fn}\\)$`),vn=new RegExp(`^rgba\\(${pn},${pn},${pn},${fn}\\)$`),_n=new RegExp(`^hsl\\(${fn},${pn},${pn}\\)$`),bn=new RegExp(`^hsla\\(${fn},${pn},${pn},${fn}\\)$`),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 kn(){return this.rgb().formatHex()}function xn(){return this.rgb().formatRgb()}function Mn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=mn.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Cn(t):3===n?new Sn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?zn(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?zn(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=gn.exec(e))?new Sn(t[1],t[2],t[3],1):(t=dn.exec(e))?new Sn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=yn.exec(e))?zn(t[1],t[2],t[3],t[4]):(t=vn.exec(e))?zn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=_n.exec(e))?On(t[1],t[2]/100,t[3]/100,1):(t=bn.exec(e))?On(t[1],t[2]/100,t[3]/100,t[4]):wn.hasOwnProperty(e)?Cn(wn[e]):"transparent"===e?new Sn(NaN,NaN,NaN,0):null}function Cn(e){return new Sn(e>>16&255,e>>8&255,255&e,1)}function zn(e,t,n,r){return r<=0&&(e=t=n=NaN),new Sn(e,t,n,r)}function An(e,t,n,r){return 1===arguments.length?((a=e)instanceof ln||(a=Mn(a)),a?new Sn((a=a.rgb()).r,a.g,a.b,a.opacity):new Sn):new Sn(e,t,n,null==r?1:r);var a}function Sn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function $n(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}`}function Tn(){const e=Dn(this.opacity);return`${1===e?"rgb(":"rgba("}${En(this.r)}, ${En(this.g)}, ${En(this.b)}${1===e?")":`, ${e})`}`}function Dn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function En(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Nn(e){return((e=En(e))<16?"0":"")+e.toString(16)}function On(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Pn(e,t,n,r)}function Un(e){if(e instanceof Pn)return new Pn(e.h,e.s,e.l,e.opacity);if(e instanceof ln||(e=Mn(e)),!e)return new Pn;if(e instanceof Pn)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,s=i-a,l=(i+a)/2;return s?(o=t===i?(n-r)/s+6*(n<r):n===i?(r-t)/s+2:(t-n)/s+4,s/=l<.5?i+a:2-i-a,o*=60):s=l>0&&l<1?0:o,new Pn(o,s,l,e.opacity)}function Pn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ln(e){return(e=(e||0)%360)<0?e+360:e}function Fn(e){return Math.max(0,Math.min(1,e||0))}function jn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}on(ln,Mn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kn,formatHex:kn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Un(this).formatHsl()},formatRgb:xn,toString:xn}),on(Sn,An,sn(ln,{brighter(e){return e=null==e?cn:Math.pow(cn,e),new Sn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?un:Math.pow(un,e),new Sn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Sn(En(this.r),En(this.g),En(this.b),Dn(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:$n,formatHex:$n,formatHex8:function(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}${Nn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Tn,toString:Tn})),on(Pn,function(e,t,n,r){return 1===arguments.length?Un(e):new Pn(e,t,n,null==r?1:r)},sn(ln,{brighter(e){return e=null==e?cn:Math.pow(cn,e),new Pn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?un:Math.pow(un,e),new Pn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Sn(jn(e>=240?e-240:e+120,a,r),jn(e,a,r),jn(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Pn(Ln(this.h),Fn(this.s),Fn(this.l),Dn(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 e=Dn(this.opacity);return`${1===e?"hsl(":"hsla("}${Ln(this.h)}, ${100*Fn(this.s)}%, ${100*Fn(this.l)}%${1===e?")":`, ${e})`}`}}));var Rn=e=>()=>e;function Gn(e){return 1===(e=+e)?Hn:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Rn(isNaN(t)?n:t)}}function Hn(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Rn(isNaN(e)?t:e)}var In=function e(t){var n=Gn(t);function r(e,t){var r=n((e=An(e)).r,(t=An(t)).r),a=n(e.g,t.g),i=n(e.b,t.b),o=Hn(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=a(t),e.b=i(t),e.opacity=o(t),e+""}}return r.gamma=e,r}(1);function qn(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,a=t.slice();return function(i){for(n=0;n<r;++n)a[n]=e[n]*(1-i)+t[n]*i;return a}}function Kn(e,t){var n,r=t?t.length:0,a=e?Math.min(r,e.length):0,i=new Array(a),o=new Array(r);for(n=0;n<a;++n)i[n]=Qn(e[n],t[n]);for(;n<r;++n)o[n]=t[n];return function(e){for(n=0;n<a;++n)o[n]=i[n](e);return o}}function Bn(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Yn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Vn(e,t){var n,r={},a={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Qn(e[n],t[n]):a[n]=t[n];return function(e){for(n in r)a[n]=r[n](e);return a}}var Wn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xn=new RegExp(Wn.source,"g");function Zn(e,t){var n,r,a,i=Wn.lastIndex=Xn.lastIndex=0,o=-1,s=[],l=[];for(e+="",t+="";(n=Wn.exec(e))&&(r=Xn.exec(t));)(a=r.index)>i&&(a=t.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,l.push({i:o,x:Yn(n,r)})),i=Xn.lastIndex;return i<t.length&&(a=t.slice(i),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Qn(e,t){var n,r=typeof t;return null==t||"boolean"===r?Rn(t):("number"===r?Yn:"string"===r?(n=Mn(t))?(t=n,In):Zn:t instanceof Mn?In:t instanceof Date?Bn:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?qn:Array.isArray(t)?Kn:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Vn:Yn)(e,t)}function Jn(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var er,tr=180/Math.PI,nr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function rr(e,t,n,r,a,i){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*tr,skewX:Math.atan(l)*tr,scaleX:o,scaleY:s}}function ar(e,t,n,r){function a(e){return e.length?e.pop()+" ":""}return function(i,o){var s=[],l=[];return i=e(i),o=e(o),function(e,r,a,i,o,s){if(e!==a||r!==i){var l=o.push("translate(",null,t,null,n);s.push({i:l-4,x:Yn(e,a)},{i:l-2,x:Yn(r,i)})}else(a||i)&&o.push("translate("+a+t+i+n)}(i.translateX,i.translateY,o.translateX,o.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(a(n)+"rotate(",null,r)-2,x:Yn(e,t)})):t&&n.push(a(n)+"rotate("+t+r)}(i.rotate,o.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(a(n)+"skewX(",null,r)-2,x:Yn(e,t)}):t&&n.push(a(n)+"skewX("+t+r)}(i.skewX,o.skewX,s,l),function(e,t,n,r,i,o){if(e!==n||t!==r){var s=i.push(a(i)+"scale(",null,",",null,")");o.push({i:s-4,x:Yn(e,n)},{i:s-2,x:Yn(t,r)})}else 1===n&&1===r||i.push(a(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,o.scaleX,o.scaleY,s,l),i=o=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var ir,or,sr=ar(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?nr:rr(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),lr=ar(function(e){return null==e?nr:(er||(er=document.createElementNS("http://www.w3.org/2000/svg","g")),er.setAttribute("transform",e),(e=er.transform.baseVal.consolidate())?rr((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):nr)},", ",")",")"),ur=0,cr=0,hr=0,fr=0,pr=0,mr=0,gr="object"==typeof performance&&performance.now?performance:Date,dr="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function yr(){return pr||(dr(vr),pr=gr.now()+mr)}function vr(){pr=0}function _r(){this._call=this._time=this._next=null}function br(e,t,n){var r=new _r;return r.restart(e,t,n),r}function wr(){pr=(fr=gr.now())+mr,ur=cr=0;try{!function(){yr(),++ur;for(var e,t=ir;t;)(e=pr-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ur}()}finally{ur=0,function(){var e,t,n=ir,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:ir=t);or=e,xr(r)}(),pr=0}}function kr(){var e=gr.now(),t=e-fr;t>1e3&&(mr-=t,fr=e)}function xr(e){ur||(cr&&(cr=clearTimeout(cr)),e-pr>24?(e<1/0&&(cr=setTimeout(wr,e-gr.now()-mr)),hr&&(hr=clearInterval(hr))):(hr||(fr=gr.now(),hr=setInterval(kr,1e3)),ur=1,dr(wr)))}function Mr(e,t,n){var r=new _r;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}_r.prototype=br.prototype={constructor:_r,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?yr():+n)+(null==t?0:+t),this._next||or===this||(or?or._next=this:ir=this,or=this),this._call=e,this._time=n,xr()},stop:function(){this._call&&(this._call=null,this._time=1/0,xr())}};var Cr=He("start","end","cancel","interrupt"),zr=[];function Ar(e,t,n,r,a,i){var o=e.__transition;if(o){if(n in o)return}else e.__transition={};!function(e,t,n){var r,a=e.__transition;function i(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(i){var u,c,h,f;if(1!==n.state)return l();for(u in a)if((f=a[u]).name===n.name){if(3===f.state)return Mr(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete a[u]):+u<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete a[u])}if(Mr(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(i))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(h=n.tween.length),u=0,c=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function s(t){for(var a=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,o=r.length;++i<o;)r[i].call(e,a);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete a[t],a)return;delete e.__transition}a[t]=n,n.timer=br(i,0,n.time)}(e,n,{name:t,index:r,group:a,on:Cr,tween:zr,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Sr(e,t){var n=Tr(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function $r(e,t){var n=Tr(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Tr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Dr(e,t){var n,r;return function(){var a=$r(this,e),i=a.tween;if(i!==n)for(var o=0,s=(r=n=i).length;o<s;++o)if(r[o].name===t){(r=r.slice()).splice(o,1);break}a.tween=r}}function Er(e,t,n){var r,a;if("function"!=typeof n)throw new Error;return function(){var i=$r(this,e),o=i.tween;if(o!==r){a=(r=o).slice();for(var s={name:t,value:n},l=0,u=a.length;l<u;++l)if(a[l].name===t){a[l]=s;break}l===u&&a.push(s)}i.tween=a}}function Nr(e,t,n){var r=e._id;return e.each(function(){var e=$r(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return Tr(e,r).value[t]}}function Or(e,t){var n;return("number"==typeof t?Yn:t instanceof Mn?In:(n=Mn(t))?(t=n,In):Zn)(e,t)}function Ur(e){return function(){this.removeAttribute(e)}}function Pr(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lr(e,t,n){var r,a,i=n+"";return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Fr(e,t,n){var r,a,i=n+"";return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function jr(e,t,n){var r,a,i;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttribute(e))===(s=l+"")?null:o===r&&s===a?i:(a=s,i=t(r=o,l));this.removeAttribute(e)}}function Rr(e,t,n){var r,a,i;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:o===r&&s===a?i:(a=s,i=t(r=o,l));this.removeAttributeNS(e.space,e.local)}}function Gr(e,t){var n,r;function a(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,a)),n}return a._value=t,a}function Hr(e,t){var n,r;function a(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,a)),n}return a._value=t,a}function Ir(e,t){return function(){Sr(this,e).delay=+t.apply(this,arguments)}}function qr(e,t){return t=+t,function(){Sr(this,e).delay=t}}function Kr(e,t){return function(){$r(this,e).duration=+t.apply(this,arguments)}}function Br(e,t){return t=+t,function(){$r(this,e).duration=t}}var Yr=rn.prototype.constructor;function Vr(e){return function(){this.style.removeProperty(e)}}var Wr=0;function Xr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zr(){return++Wr}var Qr=rn.prototype;Xr.prototype={constructor:Xr,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Je(e));for(var r=this._groups,a=r.length,i=new Array(a),o=0;o<a;++o)for(var s,l,u=r[o],c=u.length,h=i[o]=new Array(c),f=0;f<c;++f)(s=u[f])&&(l=e.call(s,s.__data__,f,u))&&("__data__"in s&&(l.__data__=s.__data__),h[f]=l,Ar(h[f],t,n,f,h,Tr(s,n)));return new Xr(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=nt(e));for(var r=this._groups,a=r.length,i=[],o=[],s=0;s<a;++s)for(var l,u=r[s],c=u.length,h=0;h<c;++h)if(l=u[h]){for(var f,p=e.call(l,l.__data__,h,u),m=Tr(l,n),g=0,d=p.length;g<d;++g)(f=p[g])&&Ar(f,t,n,g,p,m);i.push(p),o.push(l)}return new Xr(i,o,t,n)},selectChild:Qr.selectChild,selectChildren:Qr.selectChildren,filter:function(e){"function"!=typeof e&&(e=rt(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i,o=t[a],s=o.length,l=r[a]=[],u=0;u<s;++u)(i=o[u])&&e.call(i,i.__data__,u,o)&&l.push(i);return new Xr(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,i=Math.min(r,a),o=new Array(r),s=0;s<i;++s)for(var l,u=t[s],c=n[s],h=u.length,f=o[s]=new Array(h),p=0;p<h;++p)(l=u[p]||c[p])&&(f[p]=l);for(;s<r;++s)o[s]=t[s];return new Xr(o,this._parents,this._name,this._id)},selection:function(){return new Yr(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Zr(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o,s=r[i],l=s.length,u=0;u<l;++u)if(o=s[u]){var c=Tr(o,t);Ar(o,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Xr(r,this._parents,e,n)},call:Qr.call,nodes:Qr.nodes,node:Qr.node,size:Qr.size,empty:Qr.empty,each:Qr.each,on:function(e,t){var n=this._id;return arguments.length<2?Tr(this.node(),n).on.on(e):this.each(function(e,t,n){var r,a,i=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?Sr:$r;return function(){var o=i(this,e),s=o.on;s!==r&&(a=(r=s).copy()).on(t,n),o.on=a}}(n,e,t))},attr:function(e,t){var n=Ve(e),r="transform"===n?lr:Or;return this.attrTween(e,"function"==typeof t?(n.local?Rr:jr)(n,r,Nr(this,"attr."+e,t)):null==t?(n.local?Pr:Ur)(n):(n.local?Fr:Lr)(n,r,t))},attrTween:function(e,t){var n="attr."+e;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;var r=Ve(e);return this.tween(n,(r.local?Gr:Hr)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?sr:Or;return null==t?this.styleTween(e,function(e,t){var n,r,a;return function(){var i=zt(this,e),o=(this.style.removeProperty(e),zt(this,e));return i===o?null:i===n&&o===r?a:a=t(n=i,r=o)}}(e,r)).on("end.style."+e,Vr(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,a,i;return function(){var o=zt(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=zt(this,e)),o===l?null:o===r&&l===a?i:(a=l,i=t(r=o,s))}}(e,r,Nr(this,"style."+e,t))).each(function(e,t){var n,r,a,i,o="style."+t,s="end."+o;return function(