factoriomod-debug 2.0.13 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1025 -1007
- package/dist/chunk-W6FPGVXO.js +74 -0
- package/dist/fmtk-cli.js +56 -93
- package/dist/fmtk-vscode.js +31 -15
- package/package.json +781 -1078
- package/readme.md +2 -3
- package/schema/datainfo.json +5 -1
- package/schema/modinfo.json +2 -2
- package/dist/Flamegraph.css +0 -2
- package/dist/Flamegraph.js +0 -2
- package/dist/chunk-S7WJEOJD.js +0 -149
- package/doc/debugadapter.md +0 -16
- package/doc/debugapi.md +0 -41
- package/doc/profile.md +0 -9
package/readme.md
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
A collection of tools for developing Factorio mods. This package is both [an npm package](https://www.npmjs.com/package/factoriomod-debug) providing the command line tool `fmtk`, and a [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=justarandomgeek.factoriomod-debug) providing additional editor integration.
|
|
4
4
|
|
|
5
|
-
*
|
|
6
|
-
* [Mod Profiling](doc/profile.md)
|
|
5
|
+
* Debug Adapter - This extension uses Factorio's native [LuaDebugAdapter](https://lua-api.factorio.com/latest/classes/LuaDebugAdapter.html) support to enable debugging and profiling of mods
|
|
7
6
|
* [JSON Validation](doc/language-json.md)
|
|
8
7
|
* [Language Support for Locale and Changelog files](doc/language.md)
|
|
9
|
-
* [Language Server integration for Lua](doc/language-lua.md) via [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
|
|
8
|
+
* [Language Server integration for Lua](doc/language-lua.md) via [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) or [tangzx.emmylua](https://marketplace.visualstudio.com/items?itemName=tangzx.emmylua), [xuhuanzy.emmylua-luals](https://open-vsx.org/extension/xuhuanzy/emmylua-luals), [theo.emmylua](https://open-vsx.org/extension/theo/emmylua)
|
|
10
9
|
* [Packaging and Publishing](doc/package.md)
|
|
11
10
|
|
|
12
11
|
* [Getting LSP on text editors other than vscode](doc/lsptutorial.md)
|
package/schema/datainfo.json
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"title": "Mods this mod depends on or are incompatible with",
|
|
52
52
|
"items": {
|
|
53
53
|
"type":"string",
|
|
54
|
-
"pattern": "^(([
|
|
54
|
+
"pattern": "^(([!?~+]|\\(\\?\\)) *)?([a-zA-Z0-9_ -]+)( *([<>]=?|=) *((\\d+\\.){1,2}\\d+))?$",
|
|
55
55
|
"defaultSnippets": [
|
|
56
56
|
{
|
|
57
57
|
"label": "simple",
|
|
@@ -69,6 +69,10 @@
|
|
|
69
69
|
"label": "optional",
|
|
70
70
|
"body": "? ${1:modname}"
|
|
71
71
|
},
|
|
72
|
+
{
|
|
73
|
+
"label": "recommended",
|
|
74
|
+
"body": "+ ${1:modname}"
|
|
75
|
+
},
|
|
72
76
|
{
|
|
73
77
|
"label": "hidden",
|
|
74
78
|
"body": "(?) ${1:modname}"
|
package/schema/modinfo.json
CHANGED
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"description": "$3",
|
|
20
20
|
"version": "${4:0.0.0}",
|
|
21
21
|
"author": "$5",
|
|
22
|
-
"factorio_version": "2.
|
|
22
|
+
"factorio_version": "2.1"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
26
|
"properties": {
|
|
27
27
|
"factorio_version": {
|
|
28
|
-
"default": "2.
|
|
28
|
+
"default": "2.1"
|
|
29
29
|
},
|
|
30
30
|
"package": {
|
|
31
31
|
"type":"object",
|
package/dist/Flamegraph.css
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.d3-flame-graph rect{stroke:#eee;fill-opacity:.8}.d3-flame-graph rect:hover{stroke:#474747;stroke-width:.5;cursor:pointer}.d3-flame-graph-label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:12px;font-family:Verdana;margin-left:4px;margin-right:4px;line-height:1.5;padding:0;font-weight:400;color:#000;text-align:left}.d3-flame-graph .fade{opacity:.6!important}.d3-flame-graph .title{font-size:20px;font-family:Verdana}.d3-flame-graph-tip{background-color:#000;border:none;border-radius:3px;padding:5px 10px;min-width:250px;text-align:left;color:#fff;z-index:10}
|
|
2
|
-
/*# sourceMappingURL=Flamegraph.css.map */
|
package/dist/Flamegraph.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function Y(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ze(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jt(t){let e,r,n;t.length!==2?(e=Y,r=(u,f)=>Y(t(u),f),n=(u,f)=>t(u)-f):(e=t===Y||t===ze?t:Zi,r=t,n=t);function i(u,f,s=0,c=u.length){if(s<c){if(e(f,f)!==0)return c;do{let h=s+c>>>1;r(u[h],f)<0?s=h+1:c=h}while(s<c)}return s}function a(u,f,s=0,c=u.length){if(s<c){if(e(f,f)!==0)return c;do{let h=s+c>>>1;r(u[h],f)<=0?s=h+1:c=h}while(s<c)}return s}function o(u,f,s=0,c=u.length){let h=i(u,f,s,c-1);return h>s&&n(u[h-1],f)>-n(u[h],f)?h-1:h}return{left:i,center:o,right:a}}function Zi(){return 0}function Oe(t){return t===null?NaN:+t}var yr=jt(Y),wr=yr.right,Ki=yr.left,Ui=jt(Oe).center,De=wr;var Wi=Math.sqrt(50),Qi=Math.sqrt(10),Ji=Math.sqrt(2);function te(t,e,r){let n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=Wi?10:a>=Qi?5:a>=Ji?2:1,u,f,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(t*s),f=Math.round(e*s),u/s<t&&++u,f/s>e&&--f,s=-s):(s=Math.pow(10,i)*o,u=Math.round(t/s),f=Math.round(e/s),u*s<t&&++u,f*s>e&&--f),f<u&&.5<=r&&r<2?te(t,e,r*2):[u,f,s]}function ee(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];let n=e<t,[i,a,o]=n?te(e,t,r):te(t,e,r);if(!(a>=i))return[];let u=a-i+1,f=new Array(u);if(n)if(o<0)for(let s=0;s<u;++s)f[s]=(a-s)/-o;else for(let s=0;s<u;++s)f[s]=(a-s)*o;else if(o<0)for(let s=0;s<u;++s)f[s]=(i+s)/-o;else for(let s=0;s<u;++s)f[s]=(i+s)*o;return f}function zt(t,e,r){return e=+e,t=+t,r=+r,te(t,e,r)[2]}function He(t,e,r){e=+e,t=+t,r=+r;let n=e<t,i=n?zt(e,t,r):zt(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}var ji={value:()=>{}};function _r(){for(var t=0,e=arguments.length,r={},n;t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new re(r)}function re(t){this._=t}function to(t,e){return t.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}re.prototype=_r.prototype={constructor:re,on:function(t,e){var r=this._,n=to(t+"",r),i,a=-1,o=n.length;if(arguments.length<2){for(;++a<o;)if((i=(t=n[a]).type)&&(i=eo(r[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=n[a]).type)r[i]=vr(r[i],t.name,e);else if(e==null)for(i in r)r[i]=vr(r[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new re(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],n=0,i=a.length;n<i;++n)a[n].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}};function eo(t,e){for(var r=0,n=t.length,i;r<n;++r)if((i=t[r]).name===e)return i.value}function vr(t,e,r){for(var n=0,i=t.length;n<i;++n)if(t[n].name===e){t[n]=ji,t=t.slice(0,n).concat(t.slice(n+1));break}return r!=null&&t.push({name:e,value:r}),t}var Re=_r;var ne="http://www.w3.org/1999/xhtml",Pe={svg:"http://www.w3.org/2000/svg",xhtml:ne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Q(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Pe.hasOwnProperty(e)?{space:Pe[e],local:t}:t}function ro(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===ne&&e.documentElement.namespaceURI===ne?e.createElement(t):e.createElementNS(r,t)}}function no(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ie(t){var e=Q(t);return(e.local?no:ro)(e)}function io(){}function ft(t){return t==null?io:function(){return this.querySelector(t)}}function br(t){typeof t!="function"&&(t=ft(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a=e[i],o=a.length,u=n[i]=new Array(o),f,s,c=0;c<o;++c)(f=a[c])&&(s=t.call(f,f.__data__,c,a))&&("__data__"in f&&(s.__data__=f.__data__),u[c]=s);return new A(n,this._parents)}function $e(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function oo(){return[]}function Ot(t){return t==null?oo:function(){return this.querySelectorAll(t)}}function ao(t){return function(){return $e(t.apply(this,arguments))}}function Mr(t){typeof t=="function"?t=ao(t):t=Ot(t);for(var e=this._groups,r=e.length,n=[],i=[],a=0;a<r;++a)for(var o=e[a],u=o.length,f,s=0;s<u;++s)(f=o[s])&&(n.push(t.call(f,f.__data__,s,o)),i.push(f));return new A(n,i)}function Dt(t){return function(){return this.matches(t)}}function oe(t){return function(e){return e.matches(t)}}var uo=Array.prototype.find;function fo(t){return function(){return uo.call(this.children,t)}}function so(){return this.firstElementChild}function kr(t){return this.select(t==null?so:fo(typeof t=="function"?t:oe(t)))}var lo=Array.prototype.filter;function co(){return Array.from(this.children)}function ho(t){return function(){return lo.call(this.children,t)}}function Nr(t){return this.selectAll(t==null?co:ho(typeof t=="function"?t:oe(t)))}function Ar(t){typeof t!="function"&&(t=Dt(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a=e[i],o=a.length,u=n[i]=[],f,s=0;s<o;++s)(f=a[s])&&t.call(f,f.__data__,s,a)&&u.push(f);return new A(n,this._parents)}function ae(t){return new Array(t.length)}function Sr(){return new A(this._enter||this._groups.map(ae),this._parents)}function Ht(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ht.prototype={constructor:Ht,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Er(t){return function(){return t}}function po(t,e,r,n,i,a){for(var o=0,u,f=e.length,s=a.length;o<s;++o)(u=e[o])?(u.__data__=a[o],n[o]=u):r[o]=new Ht(t,a[o]);for(;o<f;++o)(u=e[o])&&(i[o]=u)}function mo(t,e,r,n,i,a,o){var u,f,s=new Map,c=e.length,h=a.length,p=new Array(c),x;for(u=0;u<c;++u)(f=e[u])&&(p[u]=x=o.call(f,f.__data__,u,e)+"",s.has(x)?i[u]=f:s.set(x,f));for(u=0;u<h;++u)x=o.call(t,a[u],u,a)+"",(f=s.get(x))?(n[u]=f,f.__data__=a[u],s.delete(x)):r[u]=new Ht(t,a[u]);for(u=0;u<c;++u)(f=e[u])&&s.get(p[u])===f&&(i[u]=f)}function go(t){return t.__data__}function Ir(t,e){if(!arguments.length)return Array.from(this,go);var r=e?mo:po,n=this._parents,i=this._groups;typeof t!="function"&&(t=Er(t));for(var a=i.length,o=new Array(a),u=new Array(a),f=new Array(a),s=0;s<a;++s){var c=n[s],h=i[s],p=h.length,x=xo(t.call(c,c&&c.__data__,s,n)),M=x.length,k=u[s]=new Array(M),T=o[s]=new Array(M),X=f[s]=new Array(p);r(c,h,k,T,X,x,e);for(var D=0,L=0,H,R;D<M;++D)if(H=k[D]){for(D>=L&&(L=D+1);!(R=T[L])&&++L<M;);H._next=R||null}}return o=new A(o,n),o._enter=u,o._exit=f,o}function xo(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Cr(){return new A(this._exit||this._groups.map(ae),this._parents)}function Tr(t,e,r){var n=this.enter(),i=this,a=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}function zr(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,a=n.length,o=Math.min(i,a),u=new Array(i),f=0;f<o;++f)for(var s=r[f],c=n[f],h=s.length,p=u[f]=new Array(h),x,M=0;M<h;++M)(x=s[M]||c[M])&&(p[M]=x);for(;f<i;++f)u[f]=r[f];return new A(u,this._parents)}function Or(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n=t[e],i=n.length-1,a=n[i],o;--i>=0;)(o=n[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Dr(t){t||(t=yo);function e(h,p){return h&&p?t(h.__data__,p.__data__):!h-!p}for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var o=r[a],u=o.length,f=i[a]=new Array(u),s,c=0;c<u;++c)(s=o[c])&&(f[c]=s);f.sort(e)}return new A(i,this._parents).order()}function yo(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Hr(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Rr(){return Array.from(this)}function Pr(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,a=n.length;i<a;++i){var o=n[i];if(o)return o}return null}function $r(){let t=0;for(let e of this)++t;return t}function qr(){return!this.node()}function Lr(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var i=e[r],a=0,o=i.length,u;a<o;++a)(u=i[a])&&t.call(u,u.__data__,a,i);return this}function wo(t){return function(){this.removeAttribute(t)}}function vo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _o(t,e){return function(){this.setAttribute(t,e)}}function bo(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Mo(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function ko(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function Fr(t,e){var r=Q(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?vo:wo:typeof e=="function"?r.local?ko:Mo:r.local?bo:_o)(r,e))}function ue(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function No(t){return function(){this.style.removeProperty(t)}}function Ao(t,e,r){return function(){this.style.setProperty(t,e,r)}}function So(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function Br(t,e,r){return arguments.length>1?this.each((e==null?No:typeof e=="function"?So:Ao)(t,e,r??"")):et(this.node(),t)}function et(t,e){return t.style.getPropertyValue(e)||ue(t).getComputedStyle(t,null).getPropertyValue(e)}function Eo(t){return function(){delete this[t]}}function Io(t,e){return function(){this[t]=e}}function Co(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Vr(t,e){return arguments.length>1?this.each((e==null?Eo:typeof e=="function"?Co:Io)(t,e)):this.node()[t]}function Xr(t){return t.trim().split(/^|\s+/)}function qe(t){return t.classList||new Yr(t)}function Yr(t){this._node=t,this._names=Xr(t.getAttribute("class")||"")}Yr.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Gr(t,e){for(var r=qe(t),n=-1,i=e.length;++n<i;)r.add(e[n])}function Zr(t,e){for(var r=qe(t),n=-1,i=e.length;++n<i;)r.remove(e[n])}function To(t){return function(){Gr(this,t)}}function zo(t){return function(){Zr(this,t)}}function Oo(t,e){return function(){(e.apply(this,arguments)?Gr:Zr)(this,t)}}function Kr(t,e){var r=Xr(t+"");if(arguments.length<2){for(var n=qe(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof e=="function"?Oo:e?To:zo)(r,e))}function Do(){this.textContent=""}function Ho(t){return function(){this.textContent=t}}function Ro(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ur(t){return arguments.length?this.each(t==null?Do:(typeof t=="function"?Ro:Ho)(t)):this.node().textContent}function Po(){this.innerHTML=""}function $o(t){return function(){this.innerHTML=t}}function qo(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Wr(t){return arguments.length?this.each(t==null?Po:(typeof t=="function"?qo:$o)(t)):this.node().innerHTML}function Lo(){this.nextSibling&&this.parentNode.appendChild(this)}function Qr(){return this.each(Lo)}function Fo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Jr(){return this.each(Fo)}function jr(t){var e=typeof t=="function"?t:ie(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Bo(){return null}function tn(t,e){var r=typeof t=="function"?t:ie(t),n=e==null?Bo:typeof e=="function"?e:ft(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function Vo(){var t=this.parentNode;t&&t.removeChild(this)}function en(){return this.each(Vo)}function Xo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Yo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function rn(t){return this.select(t?Yo:Xo)}function nn(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Go(t){return function(e){t.call(this,e,this.__data__)}}function Zo(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Ko(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r<i;++r)a=e[r],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++n]=a;++n?e.length=n:delete this.__on}}}function Uo(t,e,r){return function(){var n=this.__on,i,a=Go(e);if(n){for(var o=0,u=n.length;o<u;++o)if((i=n[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=e;return}}this.addEventListener(t.type,a,r),i={type:t.type,name:t.name,value:e,listener:a,options:r},n?n.push(i):this.__on=[i]}}function on(t,e,r){var n=Zo(t+""),i,a=n.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var f=0,s=u.length,c;f<s;++f)for(i=0,c=u[f];i<a;++i)if((o=n[i]).type===c.type&&o.name===c.name)return c.value}return}for(u=e?Uo:Ko,i=0;i<a;++i)this.each(u(n[i],e,r));return this}function an(t,e,r){var n=ue(t),i=n.CustomEvent;typeof i=="function"?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Wo(t,e){return function(){return an(this,t,e)}}function Qo(t,e){return function(){return an(this,t,e.apply(this,arguments))}}function un(t,e){return this.each((typeof e=="function"?Qo:Wo)(t,e))}function*fn(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,a=n.length,o;i<a;++i)(o=n[i])&&(yield o)}var Le=[null];function A(t,e){this._groups=t,this._parents=e}function sn(){return new A([[document.documentElement]],Le)}function Jo(){return this}A.prototype=sn.prototype={constructor:A,select:br,selectAll:Mr,selectChild:kr,selectChildren:Nr,filter:Ar,data:Ir,enter:Sr,exit:Cr,join:Tr,merge:zr,selection:Jo,order:Or,sort:Dr,call:Hr,nodes:Rr,node:Pr,size:$r,empty:qr,each:Lr,attr:Fr,style:Br,property:Vr,classed:Kr,text:Ur,html:Wr,raise:Qr,lower:Jr,append:jr,insert:tn,remove:en,clone:rn,datum:nn,on,dispatch:un,[Symbol.iterator]:fn};var J=sn;function st(t){return typeof t=="string"?new A([[document.querySelector(t)]],[document.documentElement]):new A([[t]],Le)}function fe(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Fe(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function $t(){}var Rt=.7,ce=1/Rt,_t="\\s*([+-]?\\d+)\\s*",Pt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",G="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jo=/^#([0-9a-f]{3,8})$/,ta=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),ea=new RegExp(`^rgb\\(${G},${G},${G}\\)$`),ra=new RegExp(`^rgba\\(${_t},${_t},${_t},${Pt}\\)$`),na=new RegExp(`^rgba\\(${G},${G},${G},${Pt}\\)$`),ia=new RegExp(`^hsl\\(${Pt},${G},${G}\\)$`),oa=new RegExp(`^hsla\\(${Pt},${G},${G},${Pt}\\)$`),ln={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};fe($t,V,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:cn,formatHex:cn,formatHex8:aa,formatHsl:ua,formatRgb:hn,toString:hn});function cn(){return this.rgb().formatHex()}function aa(){return this.rgb().formatHex8()}function ua(){return yn(this).formatHsl()}function hn(){return this.rgb().formatRgb()}function V(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=jo.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?pn(e):r===3?new q(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?se(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?se(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=ta.exec(t))?new q(e[1],e[2],e[3],1):(e=ea.exec(t))?new q(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ra.exec(t))?se(e[1],e[2],e[3],e[4]):(e=na.exec(t))?se(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ia.exec(t))?gn(e[1],e[2]/100,e[3]/100,1):(e=oa.exec(t))?gn(e[1],e[2]/100,e[3]/100,e[4]):ln.hasOwnProperty(t)?pn(ln[t]):t==="transparent"?new q(NaN,NaN,NaN,0):null}function pn(t){return new q(t>>16&255,t>>8&255,t&255,1)}function se(t,e,r,n){return n<=0&&(t=e=r=NaN),new q(t,e,r,n)}function fa(t){return t instanceof $t||(t=V(t)),t?(t=t.rgb(),new q(t.r,t.g,t.b,t.opacity)):new q}function bt(t,e,r,n){return arguments.length===1?fa(t):new q(t,e,r,n??1)}function q(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}fe(q,bt,Fe($t,{brighter(t){return t=t==null?ce:Math.pow(ce,t),new q(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Rt:Math.pow(Rt,t),new q(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new q(ct(this.r),ct(this.g),ct(this.b),he(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:mn,formatHex:mn,formatHex8:sa,formatRgb:dn,toString:dn}));function mn(){return`#${lt(this.r)}${lt(this.g)}${lt(this.b)}`}function sa(){return`#${lt(this.r)}${lt(this.g)}${lt(this.b)}${lt((isNaN(this.opacity)?1:this.opacity)*255)}`}function dn(){let t=he(this.opacity);return`${t===1?"rgb(":"rgba("}${ct(this.r)}, ${ct(this.g)}, ${ct(this.b)}${t===1?")":`, ${t})`}`}function he(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ct(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function lt(t){return t=ct(t),(t<16?"0":"")+t.toString(16)}function gn(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new B(t,e,r,n)}function yn(t){if(t instanceof B)return new B(t.h,t.s,t.l,t.opacity);if(t instanceof $t||(t=V(t)),!t)return new B;if(t instanceof B)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,u=a-i,f=(a+i)/2;return u?(e===a?o=(r-n)/u+(r<n)*6:r===a?o=(n-e)/u+2:o=(e-r)/u+4,u/=f<.5?a+i:2-a-i,o*=60):u=f>0&&f<1?0:o,new B(o,u,f,t.opacity)}function wn(t,e,r,n){return arguments.length===1?yn(t):new B(t,e,r,n??1)}function B(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}fe(B,wn,Fe($t,{brighter(t){return t=t==null?ce:Math.pow(ce,t),new B(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Rt:Math.pow(Rt,t),new B(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new q(Be(t>=240?t-240:t+120,i,n),Be(t,i,n),Be(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new B(xn(this.h),le(this.s),le(this.l),he(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(){let t=he(this.opacity);return`${t===1?"hsl(":"hsla("}${xn(this.h)}, ${le(this.s)*100}%, ${le(this.l)*100}%${t===1?")":`, ${t})`}`}}));function xn(t){return t=(t||0)%360,t<0?t+360:t}function le(t){return Math.max(0,Math.min(1,t||0))}function Be(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function Ve(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function vn(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],a=t[n+1],o=n>0?t[n-1]:2*i-a,u=n<e-1?t[n+2]:2*a-i;return Ve((r-n/e)*e,o,i,a,u)}}function _n(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],a=t[n%e],o=t[(n+1)%e],u=t[(n+2)%e];return Ve((r-n/e)*e,i,a,o,u)}}var qt=t=>()=>t;function la(t,e){return function(r){return t+r*e}}function ca(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function bn(t){return(t=+t)==1?pe:function(e,r){return r-e?ca(e,r,t):qt(isNaN(e)?r:e)}}function pe(t,e){var r=e-t;return r?la(t,r):qt(isNaN(t)?e:t)}var ht=(function t(e){var r=bn(e);function n(i,a){var o=r((i=bt(i)).r,(a=bt(a)).r),u=r(i.g,a.g),f=r(i.b,a.b),s=pe(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=u(c),i.b=f(c),i.opacity=s(c),i+""}}return n.gamma=t,n})(1);function Mn(t){return function(e){var r=e.length,n=new Array(r),i=new Array(r),a=new Array(r),o,u;for(o=0;o<r;++o)u=bt(e[o]),n[o]=u.r||0,i[o]=u.g||0,a[o]=u.b||0;return n=t(n),i=t(i),a=t(a),u.opacity=1,function(f){return u.r=n(f),u.g=i(f),u.b=a(f),u+""}}}var ha=Mn(vn),pa=Mn(_n);function kn(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=t[i]*(1-a)+e[i]*a;return n}}function Nn(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function An(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=pt(t[o],e[o]);for(;o<r;++o)a[o]=e[o];return function(u){for(o=0;o<n;++o)a[o]=i[o](u);return a}}function Sn(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function z(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function En(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=pt(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Ye=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xe=new RegExp(Ye.source,"g");function ma(t){return function(){return t}}function da(t){return function(e){return t(e)+""}}function Lt(t,e){var r=Ye.lastIndex=Xe.lastIndex=0,n,i,a,o=-1,u=[],f=[];for(t=t+"",e=e+"";(n=Ye.exec(t))&&(i=Xe.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,f.push({i:o,x:z(n,i)})),r=Xe.lastIndex;return r<e.length&&(a=e.slice(r),u[o]?u[o]+=a:u[++o]=a),u.length<2?f[0]?da(f[0].x):ma(e):(e=f.length,function(s){for(var c=0,h;c<e;++c)u[(h=f[c]).i]=h.x(s);return u.join("")})}function pt(t,e){var r=typeof e,n;return e==null||r==="boolean"?qt(e):(r==="number"?z:r==="string"?(n=V(e))?(e=n,ht):Lt:e instanceof V?ht:e instanceof Date?Sn:Nn(e)?kn:Array.isArray(e)?An:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?En:z)(t,e)}function Ge(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var In=180/Math.PI,me={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ze(t,e,r,n,i,a){var o,u,f;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(f=t*r+e*n)&&(r-=t*f,n-=e*f),(u=Math.sqrt(r*r+n*n))&&(r/=u,n/=u,f/=u),t*n<e*r&&(t=-t,e=-e,f=-f,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*In,skewX:Math.atan(f)*In,scaleX:o,scaleY:u}}var de;function Cn(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?me:Ze(e.a,e.b,e.c,e.d,e.e,e.f)}function Tn(t){return t==null?me:(de||(de=document.createElementNS("http://www.w3.org/2000/svg","g")),de.setAttribute("transform",t),(t=de.transform.baseVal.consolidate())?(t=t.matrix,Ze(t.a,t.b,t.c,t.d,t.e,t.f)):me)}function zn(t,e,r,n){function i(s){return s.length?s.pop()+" ":""}function a(s,c,h,p,x,M){if(s!==h||c!==p){var k=x.push("translate(",null,e,null,r);M.push({i:k-4,x:z(s,h)},{i:k-2,x:z(c,p)})}else(h||p)&&x.push("translate("+h+e+p+r)}function o(s,c,h,p){s!==c?(s-c>180?c+=360:c-s>180&&(s+=360),p.push({i:h.push(i(h)+"rotate(",null,n)-2,x:z(s,c)})):c&&h.push(i(h)+"rotate("+c+n)}function u(s,c,h,p){s!==c?p.push({i:h.push(i(h)+"skewX(",null,n)-2,x:z(s,c)}):c&&h.push(i(h)+"skewX("+c+n)}function f(s,c,h,p,x,M){if(s!==h||c!==p){var k=x.push(i(x)+"scale(",null,",",null,")");M.push({i:k-4,x:z(s,h)},{i:k-2,x:z(c,p)})}else(h!==1||p!==1)&&x.push(i(x)+"scale("+h+","+p+")")}return function(s,c){var h=[],p=[];return s=t(s),c=t(c),a(s.translateX,s.translateY,c.translateX,c.translateY,h,p),o(s.rotate,c.rotate,h,p),u(s.skewX,c.skewX,h,p),f(s.scaleX,s.scaleY,c.scaleX,c.scaleY,h,p),s=c=null,function(x){for(var M=-1,k=p.length,T;++M<k;)h[(T=p[M]).i]=T.x(x);return h.join("")}}}var Ke=zn(Cn,"px, ","px)","deg)"),Ue=zn(Tn,", ",")",")");var Mt=0,Bt=0,Ft=0,Dn=1e3,ge,Vt,xe=0,mt=0,ye=0,Xt=typeof performance=="object"&&performance.now?performance:Date,Hn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Gt(){return mt||(Hn(ga),mt=Xt.now()+ye)}function ga(){mt=0}function Yt(){this._call=this._time=this._next=null}Yt.prototype=we.prototype={constructor:Yt,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?Gt():+r)+(e==null?0:+e),!this._next&&Vt!==this&&(Vt?Vt._next=this:ge=this,Vt=this),this._call=t,this._time=r,We()},stop:function(){this._call&&(this._call=null,this._time=1/0,We())}};function we(t,e,r){var n=new Yt;return n.restart(t,e,r),n}function Rn(){Gt(),++Mt;for(var t=ge,e;t;)(e=mt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Mt}function On(){mt=(xe=Xt.now())+ye,Mt=Bt=0;try{Rn()}finally{Mt=0,ya(),mt=0}}function xa(){var t=Xt.now(),e=t-xe;e>Dn&&(ye-=e,xe=t)}function ya(){for(var t,e=ge,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:ge=r);Vt=t,We(n)}function We(t){if(!Mt){Bt&&(Bt=clearTimeout(Bt));var e=t-mt;e>24?(t<1/0&&(Bt=setTimeout(On,t-Xt.now()-ye)),Ft&&(Ft=clearInterval(Ft))):(Ft||(xe=Xt.now(),Ft=setInterval(xa,Dn)),Mt=1,Hn(On))}}function ve(t,e,r){var n=new Yt;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var wa=Re("start","end","cancel","interrupt"),va=[],qn=0,Pn=1,be=2,_e=3,$n=4,Me=5,Zt=6;function rt(t,e,r,n,i,a){var o=t.__transition;if(!o)t.__transition={};else if(r in o)return;_a(t,r,{name:e,index:n,group:i,on:wa,tween:va,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:qn})}function Kt(t,e){var r=I(t,e);if(r.state>qn)throw new Error("too late; already scheduled");return r}function O(t,e){var r=I(t,e);if(r.state>_e)throw new Error("too late; already running");return r}function I(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function _a(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=we(a,0,r.time);function a(s){r.state=Pn,r.timer.restart(o,r.delay,r.time),r.delay<=s&&o(s-r.delay)}function o(s){var c,h,p,x;if(r.state!==Pn)return f();for(c in n)if(x=n[c],x.name===r.name){if(x.state===_e)return ve(o);x.state===$n?(x.state=Zt,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete n[c]):+c<e&&(x.state=Zt,x.timer.stop(),x.on.call("cancel",t,t.__data__,x.index,x.group),delete n[c])}if(ve(function(){r.state===_e&&(r.state=$n,r.timer.restart(u,r.delay,r.time),u(s))}),r.state=be,r.on.call("start",t,t.__data__,r.index,r.group),r.state===be){for(r.state=_e,i=new Array(p=r.tween.length),c=0,h=-1;c<p;++c)(x=r.tween[c].value.call(t,t.__data__,r.index,r.group))&&(i[++h]=x);i.length=h+1}}function u(s){for(var c=s<r.duration?r.ease.call(null,s/r.duration):(r.timer.restart(f),r.state=Me,1),h=-1,p=i.length;++h<p;)i[h].call(t,c);r.state===Me&&(r.on.call("end",t,t.__data__,r.index,r.group),f())}function f(){r.state=Zt,r.timer.stop(),delete n[e];for(var s in n)return;delete t.__transition}}function ke(t,e){var r=t.__transition,n,i,a=!0,o;if(r){e=e==null?null:e+"";for(o in r){if((n=r[o]).name!==e){a=!1;continue}i=n.state>be&&n.state<Me,n.state=Zt,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[o]}a&&delete t.__transition}}function Ln(t){return this.each(function(){ke(this,t)})}function ba(t,e){var r,n;return function(){var i=O(this,t),a=i.tween;if(a!==r){n=r=a;for(var o=0,u=n.length;o<u;++o)if(n[o].name===e){n=n.slice(),n.splice(o,1);break}}i.tween=n}}function Ma(t,e,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=O(this,t),o=a.tween;if(o!==n){i=(n=o).slice();for(var u={name:e,value:r},f=0,s=i.length;f<s;++f)if(i[f].name===e){i[f]=u;break}f===s&&i.push(u)}a.tween=i}}function Fn(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n=I(this.node(),r).tween,i=0,a=n.length,o;i<a;++i)if((o=n[i]).name===t)return o.value;return null}return this.each((e==null?ba:Ma)(r,t,e))}function kt(t,e,r){var n=t._id;return t.each(function(){var i=O(this,n);(i.value||(i.value={}))[e]=r.apply(this,arguments)}),function(i){return I(i,n).value[e]}}function Ne(t,e){var r;return(typeof e=="number"?z:e instanceof V?ht:(r=V(e))?(e=r,ht):Lt)(t,e)}function ka(t){return function(){this.removeAttribute(t)}}function Na(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Aa(t,e,r){var n,i=r+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===n?a:a=e(n=o,r)}}function Sa(t,e,r){var n,i=r+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===n?a:a=e(n=o,r)}}function Ea(t,e,r){var n,i,a;return function(){var o,u=r(this),f;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),f=u+"",o===f?null:o===n&&f===i?a:(i=f,a=e(n=o,u)))}}function Ia(t,e,r){var n,i,a;return function(){var o,u=r(this),f;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),f=u+"",o===f?null:o===n&&f===i?a:(i=f,a=e(n=o,u)))}}function Bn(t,e){var r=Q(t),n=r==="transform"?Ue:Ne;return this.attrTween(t,typeof e=="function"?(r.local?Ia:Ea)(r,n,kt(this,"attr."+t,e)):e==null?(r.local?Na:ka)(r):(r.local?Sa:Aa)(r,n,e))}function Ca(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function Ta(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function za(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&Ta(t,a)),r}return i._value=e,i}function Oa(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&Ca(t,a)),r}return i._value=e,i}function Vn(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var n=Q(t);return this.tween(r,(n.local?za:Oa)(n,e))}function Da(t,e){return function(){Kt(this,t).delay=+e.apply(this,arguments)}}function Ha(t,e){return e=+e,function(){Kt(this,t).delay=e}}function Xn(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Da:Ha)(e,t)):I(this.node(),e).delay}function Ra(t,e){return function(){O(this,t).duration=+e.apply(this,arguments)}}function Pa(t,e){return e=+e,function(){O(this,t).duration=e}}function Yn(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ra:Pa)(e,t)):I(this.node(),e).duration}function $a(t,e){if(typeof e!="function")throw new Error;return function(){O(this,t).ease=e}}function Gn(t){var e=this._id;return arguments.length?this.each($a(e,t)):I(this.node(),e).ease}function qa(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;O(this,t).ease=r}}function Zn(t){if(typeof t!="function")throw new Error;return this.each(qa(this._id,t))}function Kn(t){typeof t!="function"&&(t=Dt(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a=e[i],o=a.length,u=n[i]=[],f,s=0;s<o;++s)(f=a[s])&&t.call(f,f.__data__,s,a)&&u.push(f);return new P(n,this._parents,this._name,this._id)}function Un(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,a=Math.min(n,i),o=new Array(n),u=0;u<a;++u)for(var f=e[u],s=r[u],c=f.length,h=o[u]=new Array(c),p,x=0;x<c;++x)(p=f[x]||s[x])&&(h[x]=p);for(;u<n;++u)o[u]=e[u];return new P(o,this._parents,this._name,this._id)}function La(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function Fa(t,e,r){var n,i,a=La(e)?Kt:O;return function(){var o=a(this,t),u=o.on;u!==n&&(i=(n=u).copy()).on(e,r),o.on=i}}function Wn(t,e){var r=this._id;return arguments.length<2?I(this.node(),r).on.on(t):this.each(Fa(r,t,e))}function Ba(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Qn(){return this.on("end.remove",Ba(this._id))}function Jn(t){var e=this._name,r=this._id;typeof t!="function"&&(t=ft(t));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var u=n[o],f=u.length,s=a[o]=new Array(f),c,h,p=0;p<f;++p)(c=u[p])&&(h=t.call(c,c.__data__,p,u))&&("__data__"in c&&(h.__data__=c.__data__),s[p]=h,rt(s[p],e,r,p,s,I(c,r)));return new P(a,this._parents,e,r)}function jn(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Ot(t));for(var n=this._groups,i=n.length,a=[],o=[],u=0;u<i;++u)for(var f=n[u],s=f.length,c,h=0;h<s;++h)if(c=f[h]){for(var p=t.call(c,c.__data__,h,f),x,M=I(c,r),k=0,T=p.length;k<T;++k)(x=p[k])&&rt(x,e,r,k,p,M);a.push(p),o.push(c)}return new P(a,o,e,r)}var Va=J.prototype.constructor;function ti(){return new Va(this._groups,this._parents)}function Xa(t,e){var r,n,i;return function(){var a=et(this,t),o=(this.style.removeProperty(t),et(this,t));return a===o?null:a===r&&o===n?i:i=e(r=a,n=o)}}function ei(t){return function(){this.style.removeProperty(t)}}function Ya(t,e,r){var n,i=r+"",a;return function(){var o=et(this,t);return o===i?null:o===n?a:a=e(n=o,r)}}function Ga(t,e,r){var n,i,a;return function(){var o=et(this,t),u=r(this),f=u+"";return u==null&&(f=u=(this.style.removeProperty(t),et(this,t))),o===f?null:o===n&&f===i?a:(i=f,a=e(n=o,u))}}function Za(t,e){var r,n,i,a="style."+e,o="end."+a,u;return function(){var f=O(this,t),s=f.on,c=f.value[a]==null?u||(u=ei(e)):void 0;(s!==r||i!==c)&&(n=(r=s).copy()).on(o,i=c),f.on=n}}function ri(t,e,r){var n=(t+="")=="transform"?Ke:Ne;return e==null?this.styleTween(t,Xa(t,n)).on("end.style."+t,ei(t)):typeof e=="function"?this.styleTween(t,Ga(t,n,kt(this,"style."+t,e))).each(Za(this._id,t)):this.styleTween(t,Ya(t,n,e),r).on("end.style."+t,null)}function Ka(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function Ua(t,e,r){var n,i;function a(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&Ka(t,o,r)),n}return a._value=e,a}function ni(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,Ua(t,e,r??""))}function Wa(t){return function(){this.textContent=t}}function Qa(t){return function(){var e=t(this);this.textContent=e??""}}function ii(t){return this.tween("text",typeof t=="function"?Qa(kt(this,"text",t)):Wa(t==null?"":t+""))}function Ja(t){return function(e){this.textContent=t.call(this,e)}}function ja(t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&Ja(i)),e}return n._value=t,n}function oi(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,ja(t))}function ai(){for(var t=this._name,e=this._id,r=Ae(),n=this._groups,i=n.length,a=0;a<i;++a)for(var o=n[a],u=o.length,f,s=0;s<u;++s)if(f=o[s]){var c=I(f,e);rt(f,t,r,s,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new P(n,this._parents,t,r)}function ui(){var t,e,r=this,n=r._id,i=r.size();return new Promise(function(a,o){var u={value:o},f={value:function(){--i===0&&a()}};r.each(function(){var s=O(this,n),c=s.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(f)),s.on=e}),i===0&&a()})}var tu=0;function P(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function fi(t){return J().transition(t)}function Ae(){return++tu}var j=J.prototype;P.prototype=fi.prototype={constructor:P,select:Jn,selectAll:jn,selectChild:j.selectChild,selectChildren:j.selectChildren,filter:Kn,merge:Un,selection:ti,transition:ai,call:j.call,nodes:j.nodes,node:j.node,size:j.size,empty:j.empty,each:j.each,on:Wn,attr:Bn,attrTween:Vn,style:ri,styleTween:ni,text:ii,textTween:oi,remove:Qn,tween:Fn,delay:Xn,duration:Yn,ease:Gn,easeVarying:Zn,end:ui,[Symbol.iterator]:j[Symbol.iterator]};function Nt(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var eu={time:null,delay:0,duration:250,ease:Nt};function ru(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function si(t){var e,r;t instanceof P?(e=t._id,t=t._name):(e=Ae(),(r=eu).time=Gt(),t=t==null?null:t+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var o=n[a],u=o.length,f,s=0;s<u;++s)(f=o[s])&&rt(f,t,e,s,o,r||ru(f,e));return new P(n,this._parents,t,e)}J.prototype.interrupt=Ln;J.prototype.transition=si;var{abs:Wh,max:Qh,min:Jh}=Math;function li(t){return[+t[0],+t[1]]}function nu(t){return[li(t[0]),li(t[1])]}var jh={name:"x",handles:["w","e"].map(Qe),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},tp={name:"y",handles:["n","s"].map(Qe),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},ep={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Qe),input:function(t){return t==null?null:nu(t)},output:function(t){return t}};function Qe(t){return{type:t}}function ci(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function dt(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Z(t){return t=dt(Math.abs(t)),t?t[1]:NaN}function hi(t,e){return function(r,n){for(var i=r.length,a=[],o=0,u=t[0],f=0;i>0&&u>0&&(f+u+1>n&&(u=Math.max(1,n-f)),a.push(r.substring(i-=u,i+u)),!((f+=u+1)>n));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function pi(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var iu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nt(t){if(!(e=iu.exec(t)))throw new Error("invalid format: "+t);var e;return new Se({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}nt.prototype=Se.prototype;function Se(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Se.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function mi(t){t:for(var e=t.length,r=1,n=-1,i;r<e;++r)switch(t[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+t[r])break t;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var Ut;function di(t,e){var r=dt(t,e);if(!r)return Ut=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(Ut=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+dt(t,Math.max(0,e+a-1))[0]}function Je(t,e){var r=dt(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var je={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:ci,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Je(t*100,e),r:Je,s:di,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function tr(t){return t}var gi=Array.prototype.map,xi=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function yi(t){var e=t.grouping===void 0||t.thousands===void 0?tr:hi(gi.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?tr:pi(gi.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"\u2212":t.minus+"",f=t.nan===void 0?"NaN":t.nan+"";function s(h,p){h=nt(h);var x=h.fill,M=h.align,k=h.sign,T=h.symbol,X=h.zero,D=h.width,L=h.comma,H=h.precision,R=h.trim,E=h.type;E==="n"?(L=!0,E="g"):je[E]||(H===void 0&&(H=12),R=!0,E="g"),(X||x==="0"&&M==="=")&&(X=!0,x="0",M="=");var It=(p&&p.prefix!==void 0?p.prefix:"")+(T==="$"?r:T==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),Ct=(T==="$"?n:/[%p]/.test(E)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),xt=je[E],yt=/[defgprs%]/.test(E);H=H===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,H)):Math.max(0,Math.min(20,H));function Jt(v){var K=It,S=Ct,tt,ot,U;if(E==="c")S=xt(v)+S,v="";else{v=+v;var at=v<0||1/v<0;if(v=isNaN(v)?f:xt(Math.abs(v),H),R&&(v=mi(v)),at&&+v==0&&k!=="+"&&(at=!1),K=(at?k==="("?k:u:k==="-"||k==="("?"":k)+K,S=(E==="s"&&!isNaN(v)&&Ut!==void 0?xi[8+Ut/3]:"")+S+(at&&k==="("?")":""),yt){for(tt=-1,ot=v.length;++tt<ot;)if(U=v.charCodeAt(tt),48>U||U>57){S=(U===46?i+v.slice(tt+1):v.slice(tt))+S,v=v.slice(0,tt);break}}}L&&!X&&(v=e(v,1/0));var wt=K.length+v.length+S.length,F=wt<D?new Array(D-wt+1).join(x):"";switch(L&&X&&(v=e(F+v,F.length?D-S.length:1/0),F=""),M){case"<":v=K+v+S+F;break;case"=":v=K+F+v+S;break;case"^":v=F.slice(0,wt=F.length>>1)+K+v+S+F.slice(wt);break;default:v=F+K+v+S;break}return a(v)}return Jt.toString=function(){return h+""},Jt}function c(h,p){var x=Math.max(-8,Math.min(8,Math.floor(Z(p)/3)))*3,M=Math.pow(10,-x),k=s((h=nt(h),h.type="f",h),{suffix:xi[8+x/3]});return function(T){return k(M*T)}}return{format:s,formatPrefix:c}}var Ee,gt,Ie;er({thousands:",",grouping:[3],currency:["$",""]});function er(t){return Ee=yi(t),gt=Ee.format,Ie=Ee.formatPrefix,Ee}function rr(t){return Math.max(0,-Z(Math.abs(t)))}function nr(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Z(e)/3)))*3-Z(Math.abs(t)))}function ir(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Z(e)-Z(t))+1}function ou(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function wi(){return this.eachAfter(ou)}function vi(t,e){let r=-1;for(let n of this)t.call(e,n,++r,this);return this}function _i(t,e){for(var r=this,n=[r],i,a,o=-1;r=n.pop();)if(t.call(e,r,++o,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function bi(t,e){for(var r=this,n=[r],i=[],a,o,u,f=-1;r=n.pop();)if(i.push(r),a=r.children)for(o=0,u=a.length;o<u;++o)n.push(a[o]);for(;r=i.pop();)t.call(e,r,++f,this);return this}function Mi(t,e){let r=-1;for(let n of this)if(t.call(e,n,++r,this))return n}function ki(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r})}function Ni(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Ai(t){for(var e=this,r=au(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function au(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function Si(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Ei(){return Array.from(this)}function Ii(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Ci(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*Ti(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i<a;++i)r.push(n[i]);while(r.length)}function At(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=su)):e===void 0&&(e=fu);for(var r=new Wt(t),n,i=[r],a,o,u,f;n=i.pop();)if((o=e(n.data))&&(f=(o=Array.from(o)).length))for(n.children=o,u=f-1;u>=0;--u)i.push(a=o[u]=new Wt(o[u])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(cu)}function uu(){return At(this).eachBefore(lu)}function fu(t){return t.children}function su(t){return Array.isArray(t)?t[1]:null}function lu(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function cu(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Wt(t){this.data=t,this.depth=this.height=0,this.parent=null}Wt.prototype=At.prototype={constructor:Wt,count:wi,each:vi,eachAfter:bi,eachBefore:_i,find:Mi,sum:ki,sort:Ni,path:Ai,ancestors:Si,descendants:Ei,leaves:Ii,links:Ci,copy:uu,[Symbol.iterator]:Ti};function zi(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Oi(t,e,r,n,i){for(var a=t.children,o,u=-1,f=a.length,s=t.value&&(n-e)/t.value;++u<f;)o=a[u],o.y0=r,o.y1=i,o.x0=e,o.x1=e+=o.value*s}function or(){var t=1,e=1,r=0,n=!1;function i(o){var u=o.height+1;return o.x0=o.y0=r,o.x1=t,o.y1=e/u,o.eachBefore(a(e,u)),n&&o.eachBefore(zi),o}function a(o,u){return function(f){f.children&&Oi(f,f.x0,o*(f.depth+1)/u,f.x1,o*(f.depth+2)/u);var s=f.x0,c=f.y0,h=f.x1-r,p=f.y1-r;h<s&&(s=h=(s+h)/2),p<c&&(c=p=(c+p)/2),f.x0=s,f.y0=c,f.x1=h,f.y1=p}}return i.round=function(o){return arguments.length?(n=!!o,i):n},i.size=function(o){return arguments.length?(t=+o[0],e=+o[1],i):[t,e]},i.padding=function(o){return arguments.length?(r=+o,i):r},i}function Di(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function ar(t){return function(){return t}}function ur(t){return+t}var Hi=[0,1];function St(t){return t}function fr(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:ar(isNaN(e)?NaN:.5)}function hu(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function pu(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=fr(i,n),a=r(o,a)):(n=fr(n,i),a=r(a,o)),function(u){return a(n(u))}}function mu(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),a=new Array(n),o=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<n;)i[o]=fr(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(u){var f=De(t,u,1,n)-1;return a[f](i[f](u))}}function Ri(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function du(){var t=Hi,e=Hi,r=pt,n,i,a,o=St,u,f,s;function c(){var p=Math.min(t.length,e.length);return o!==St&&(o=hu(t[0],t[p-1])),u=p>2?mu:pu,f=s=null,h}function h(p){return p==null||isNaN(p=+p)?a:(f||(f=u(t.map(n),e,r)))(n(o(p)))}return h.invert=function(p){return o(i((s||(s=u(e,t.map(n),z)))(p)))},h.domain=function(p){return arguments.length?(t=Array.from(p,ur),c()):t.slice()},h.range=function(p){return arguments.length?(e=Array.from(p),c()):e.slice()},h.rangeRound=function(p){return e=Array.from(p),r=Ge,c()},h.clamp=function(p){return arguments.length?(o=p?!0:St,c()):o!==St},h.interpolate=function(p){return arguments.length?(r=p,c()):r},h.unknown=function(p){return arguments.length?(a=p,h):a},function(p,x){return n=p,i=x,c()}}function sr(){return du()(St,St)}function lr(t,e,r,n){var i=He(t,e,r),a;switch(n=nt(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=nr(i,o))&&(n.precision=a),Ie(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=ir(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=rr(i))&&(n.precision=a-(n.type==="%")*2);break}}return gt(n)}function gu(t){var e=t.domain;return t.ticks=function(r){var n=e();return ee(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return lr(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,o=n[i],u=n[a],f,s,c=10;for(u<o&&(s=o,o=u,u=s,s=i,i=a,a=s);c-- >0;){if(s=zt(o,u,r),s===f)return n[i]=o,n[a]=u,e(n);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;f=s}return t},t}function Et(){var t=sr();return t.copy=function(){return Ri(t,Et())},Di.apply(t,arguments),gu(t)}function it(t,e,r){this.k=t,this.x=e,this.y=r}it.prototype={constructor:it,scale:function(t){return t===1?this:new it(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new it(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var cr=new it(1,0,0);hr.prototype=it.prototype;function hr(t){for(;!t.__zoom;)if(!(t=t.parentNode))return cr;return t.__zoom}function yu(t){let r=0,n=0,i=1,a=10;if(t){for(let o=0;o<t.length&&!(o>6);o++)r+=i*(t.charCodeAt(o)%a),n+=i*(a-1),i*=.7;n>0&&(r=r/n)}return r}function wu(t){let e=0;if(t){let r=t.split("`");r.length>1&&(t=r[r.length-1]),t=t.split("(")[0],e=yu(t)}return e}function vu(t,e){let r,n,i;return t==="red"?(r=200+Math.round(55*e),n=50+Math.round(80*e),i=n):t==="orange"?(r=190+Math.round(65*e),n=90+Math.round(65*e),i=0):t==="yellow"?(r=175+Math.round(55*e),n=r,i=50+Math.round(20*e)):t==="green"?(r=50+Math.round(60*e),n=200+Math.round(55*e),i=r):t==="pastelgreen"?(r=163+Math.round(75*e),n=195+Math.round(49*e),i=72+Math.round(149*e)):t==="blue"?(r=91+Math.round(126*e),n=156+Math.round(76*e),i=221+Math.round(26*e)):t==="aqua"?(r=50+Math.round(60*e),n=165+Math.round(55*e),i=n):t==="cold"?(r=0+Math.round(55*(1-e)),n=0+Math.round(230*(1-e)),i=200+Math.round(55*e)):(r=200+Math.round(55*e),n=0+Math.round(230*(1-e)),i=0+Math.round(55*(1-e))),"rgb("+r+","+n+","+i+")"}function Pi(){let t=960,e=null,r=18,n=null,i=null,a="",o=750,u=Nt,f=!1,s=!1,c=null,h=null,p=0,x=null,M=null,k=!1,T=!1,X=!1,D=null,L=!1,H=null,R=function(l){return l.data.n||l.data.name},E=function(l){return"v"in l?l.v:l.value},It=function(l){return l.c||l.children},Ct=function(l){return l.data.l||l.data.libtype},xt=function(l){return"d"in l.data?l.data.d:l.data.delta},yt=function(l,g,d){M=()=>{x&&(x.textContent="search: "+g+" of "+d+" total samples ( "+gt(".3f")(100*(g/d),3)+"%)")},M()},Jt=yt,v=(l,g,d=!1)=>{if(!g)return!1;let y=R(l);d&&(g=g.toLowerCase(),y=y.toLowerCase());let w=new RegExp(g);return typeof y<"u"&&y&&y.match(w)},K=v,S=function(l){x&&(l?x.textContent=l:typeof M=="function"?M():x.textContent="")},tt=S,ot=function(l){return R(l)+" ("+gt(".3f")(100*(l.x1-l.x0),3)+"%, "+E(l)+" samples)"},U=function(l){return l.highlight?"#E600E6":wt(R(l),Ct(l))},at=U;function wt(l,g){let d=H||"warm";!H&&!(typeof g>"u"||g==="")&&(d="red",typeof l<"u"&&l&&l.match(/::/)&&(d="yellow"),g==="kernel"?d="orange":g==="jit"?d="green":g==="inlined"&&(d="aqua"));let y=wu(l);return vu(d,y)}function F(l){l.data.fade=!1,l.data.hide=!1,l.children&&l.children.forEach(F)}function qi(l){let g=l,d=g.parent,y,w,b;for(;d;){for(y=d.children,w=y.length;w--;)b=y[w],b!==g&&(b.data.hide=!0);g=d,d=g.parent}}function pr(l){l.parent&&(l.parent.data.fade=!0,pr(l.parent))}function Ce(l,g){if(i&&i.hide(),qi(l),F(l),pr(l),vt(),X){let d=g.parentNode.offsetTop,y=(window.innerHeight-d)/r,w=(l.height-y+10)*r;window.scrollTo({top:d+w,left:0,behavior:"smooth"})}typeof c=="function"&&c(l)}function Li(l,g){let d=[],y=0;function w(b,C){let N=!1;v(b,g)?(b.highlight=!0,N=!0,C||(y+=E(b)),d.push(b)):b.highlight=!1,b.children&&b.children.forEach(function(W){w(W,C||N)})}return w(l,!1),[d,y]}function mr(l,g){if(l.id===g)return l;{let d=l.children;if(d)for(let y=0;y<d.length;y++){let w=mr(d[y],g);if(w)return w}}}function dr(l){l.highlight=!1,l.children&&l.children.forEach(function(g){dr(g)})}function Fi(l,g){if(typeof f=="function")return f(l,g);if(f)return Y(R(l),R(g))}let Bi=or();function Vi(l){let g=l.descendants();if(p>0){let d=t/(l.x1-l.x0);g=g.filter(function(y){return(y.x1-y.x0)*d>p})}return g}function vt(){n.each(function(l){let g=Et().range([0,t]),d=Et().range([0,r]);f&&l.sort(Fi),xr(l),Bi(l);let y=t/(l.x1-l.x0);function w(_){return(_.x1-_.x0)*y}let b=Vi(l),C=st(this).select("svg");C.attr("width",t);let N=C.selectAll("g").data(b,function(_){return _.id});if(!e||T){let _=0;for(let $=0;$<b.length;++$)b[$].depth>_&&(_=b[$].depth);e=(_+3)*r,e<D&&(e=D),C.attr("height",e)}N.transition().duration(o).ease(u).attr("transform",function(_){return"translate("+g(_.x0)+","+(s?d(_.depth):e-d(_.depth)-r)+")"}),N.select("rect").transition().duration(o).ease(u).attr("width",w);let W=N.enter().append("svg:g").attr("transform",function(_){return"translate("+g(_.x0)+","+(s?d(_.depth):e-d(_.depth)-r)+")"});W.append("svg:rect").transition().delay(o/2).attr("width",w),i||W.append("svg:title"),W.append("foreignObject").append("xhtml:div"),N=C.selectAll("g").data(b,function(_){return _.id}),N.attr("width",w).attr("height",function(_){return r}).attr("name",function(_){return R(_)}).attr("class",function(_){return _.data.fade?"frame fade":"frame"}),N.select("rect").attr("height",function(_){return r}).attr("fill",function(_){return U(_)}),i||N.select("title").text(ot),N.select("foreignObject").attr("width",w).attr("height",function(_){return r}).style("pointer-events","none").select("div").attr("class","d3-flame-graph-label").style("display",function(_){return w(_)<35?"none":"block"}).transition().delay(o).text(R),N.on("click",function(_,$){Ce($,this)}),N.exit().remove(),N.on("mouseover",function(_,$){i&&i.show(_,$),S(ot($)),typeof h=="function"&&h($)}).on("mouseout",function(){i&&i.hide(),S(null)})})}function gr(l,g){g.forEach(function(d){let y=l.find(function(w){return w.name===d.name});y?(y.value+=d.value,d.children&&(y.children||(y.children=[]),gr(y.children,d.children))):l.push(d)})}function Xi(l,g){g(l);let d=l.children;if(d){let y=[d],w,b,C;for(;y.length;)for(d=y.pop(),w=d.length;w--;)b=d[w],g(b),C=b.children,C&&y.push(C)}}function Yi(l){let g=0;Xi(l,function(d){d.id=g++})}function xr(l){let g,d,y,w,b,C,N,W,_=[],$=[],Tt=[],Gi=!k,ut=l.data;for(ut.hide?(l.value=0,d=l.children,d&&Tt.push(d)):(l.value=ut.fade?0:E(ut),_.push(l));g=_.pop();)if(d=g.children,d&&(b=d.length)){for(w=0;b--;){if(N=d[b],ut=N.data,ut.hide){N.value=0,y=N.children,y&&Tt.push(y);continue}ut.fade?N.value=0:(W=E(ut),N.value=W,w+=W),_.push(N)}Gi&&g.value&&(g.value-=w),$.push(d)}for(b=$.length;b--;){for(d=$[b],w=0,C=d.length;C--;)w+=d[C].value;d[0].parent.value+=w}for(;Tt.length;)for(d=Tt.pop(),C=d.length;C--;)N=d[C],N.value=0,y=N.children,y&&Tt.push(y)}function Te(){n.datum(l=>{if(l.constructor.name!=="Node"){let g=At(l,It);return Yi(g),xr(g),g.originalValue=g.value,L&&g.eachAfter(d=>{let y=xt(d),w=d.children,b=w&&w.length;for(;--b>=0;)y+=w[b].delta;d.delta=y}),g}})}function m(l){if(!arguments.length)return m;n=l,Te(),n.each(function(g){if(st(this).select("svg").size()===0){let d=st(this).append("svg:svg").attr("width",t).attr("class","partition d3-flame-graph");e&&(e<D&&(e=D),d.attr("height",e)),d.append("svg:text").attr("class","title").attr("text-anchor","middle").attr("y","25").attr("x",t/2).attr("fill","#808080").text(a),i&&d.call(i)}}),vt()}return m.height=function(l){return arguments.length?(e=l,m):e},m.minHeight=function(l){return arguments.length?(D=l,m):D},m.width=function(l){return arguments.length?(t=l,m):t},m.cellHeight=function(l){return arguments.length?(r=l,m):r},m.tooltip=function(l){return arguments.length?(typeof l=="function"&&(i=l),m):i},m.title=function(l){return arguments.length?(a=l,m):a},m.transitionDuration=function(l){return arguments.length?(o=l,m):o},m.transitionEase=function(l){return arguments.length?(u=l,m):u},m.sort=function(l){return arguments.length?(f=l,m):f},m.inverted=function(l){return arguments.length?(s=l,m):s},m.computeDelta=function(l){return arguments.length?(L=l,m):L},m.setLabelHandler=function(l){return arguments.length?(ot=l,m):ot},m.label=m.setLabelHandler,m.search=function(l){let g=[],d=0,y=0;n.each(function(w){let b=Li(w,l);g.push(...b[0]),d+=b[1],y+=w.originalValue}),yt(g,d,y),vt()},m.findById=function(l){if(typeof l>"u"||l===null)return null;let g=null;return n.each(function(d){g===null&&(g=mr(d,l))}),g},m.clear=function(){S(null),n.each(function(l){dr(l),vt()})},m.zoomTo=function(l){Ce(l,n.node())},m.resetZoom=function(){n.each(function(l){Ce(l,n.node())})},m.onClick=function(l){return arguments.length?(c=l,m):c},m.onHover=function(l){return arguments.length?(h=l,m):h},m.merge=function(l){return n&&(this.resetZoom(),M=null,S(null),n.datum(g=>(gr([g.data],[l]),g.data)),Te(),vt()),m},m.update=function(l){return n&&(l&&(n.datum(l),Te()),vt()),m},m.destroy=function(){return n&&(i&&(i.hide(),typeof i.destroy=="function"&&i.destroy()),n.selectAll("svg").remove()),m},m.setColorMapper=function(l){return arguments.length?(U=g=>{let d=at(g);return l(g,d)},m):(U=at,m)},m.color=m.setColorMapper,m.setColorHue=function(l){return arguments.length?(H=l,m):(H=null,m)},m.minFrameSize=function(l){return arguments.length?(p=l,m):p},m.setDetailsElement=function(l){return arguments.length?(x=l,m):x},m.details=m.setDetailsElement,m.selfValue=function(l){return arguments.length?(k=l,m):k},m.resetHeightOnZoom=function(l){return arguments.length?(T=l,m):T},m.scrollOnZoom=function(l){return arguments.length?(X=l,m):X},m.getName=function(l){return arguments.length?(R=l,m):R},m.getValue=function(l){return arguments.length?(E=l,m):E},m.getChildren=function(l){return arguments.length?(It=l,m):It},m.getLibtype=function(l){return arguments.length?(Ct=l,m):Ct},m.getDelta=function(l){return arguments.length?(xt=l,m):xt},m.setSearchHandler=function(l){return arguments.length?(yt=l,m):(yt=Jt,m)},m.setDetailsHandler=function(l){return arguments.length?(S=l,m):(S=tt,m)},m.setSearchMatch=function(l){return arguments.length?(v=l,m):(v=K,m)},m}var $i=acquireVsCodeApi(),Qt=Pi().height(window.innerHeight-20).width(window.innerWidth-60);Qt.setLabelHandler(function(t){return`${t.data.name} (${(100*(t.x1-t.x0)).toFixed(3)}%, ${t.value.toFixed(3)} ms)`});var _u={name:"root",value:0,children:[]};st("#chart").datum(_u).call(Qt);Qt.onClick(function(t){$i.postMessage({command:"click",name:t.data.name,filename:t.data.filename,line:t.data.line})});window.addEventListener("message",t=>{let e=t.data;switch(e.command){case"update":Qt.update(e.data);break;case"merge":Qt.merge(e.data);break}});$i.postMessage({command:"init"});
|
|
2
|
-
//# sourceMappingURL=Flamegraph.js.map
|