@hpcc-js/graph 2.86.0 → 2.87.0

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.
@@ -31,14 +31,14 @@ export interface Options {
31
31
 
32
32
  export function forceDirected(data: Data, options: Options) {
33
33
  // eslint-disable-next-line quotes
34
- const workerCode = `var forceDirected=function(t){"use strict";function n(t){return function(){return t}}function e(){return 1e-6*(Math.random()-.5)}function r(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,s,u,a,c,f,l,h,v=t._root,y={data:r},p=t._x0,_=t._y0,d=t._x1,g=t._y1;if(!v)return t._root=y,t;for(;v.length;)if((c=n>=(o=(p+d)/2))?p=o:d=o,(f=e>=(s=(_+g)/2))?_=s:g=s,i=v,!(v=v[l=f<<1|c]))return i[l]=y,t;if(u=+t._x.call(null,v.data),a=+t._y.call(null,v.data),n===u&&e===a)return y.next=v,i?i[l]=y:t._root=y,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=n>=(o=(p+d)/2))?p=o:d=o,(f=e>=(s=(_+g)/2))?_=s:g=s}while((l=f<<1|c)==(h=(a>=s)<<1|u>=o));return i[h]=v,i[l]=y,t}function i(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function o(t){return t[0]}function s(t){return t[1]}function u(t,n,e){var r=new a(null==n?o:n,null==e?s:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function a(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function c(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var f=u.prototype=a.prototype;f.copy=function(){var t,n,e=new a(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=c(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=c(n));return e},f.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return r(this.cover(n,e),n,e,t)},f.addAll=function(t){var n,e,i,o,s=t.length,u=new Array(s),a=new Array(s),c=1/0,f=1/0,l=-1/0,h=-1/0;for(e=0;e<s;++e)isNaN(i=+this._x.call(null,n=t[e]))||isNaN(o=+this._y.call(null,n))||(u[e]=i,a[e]=o,i<c&&(c=i),i>l&&(l=i),o<f&&(f=o),o>h&&(h=o));if(c>l||f>h)return this;for(this.cover(c,f).cover(l,h),e=0;e<s;++e)r(this,u[e],a[e],t[e]);return this},f.cover=function(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{for(var s,u,a=i-e,c=this._root;e>t||t>=i||r>n||n>=o;)switch(u=(n<r)<<1|t<e,(s=new Array(4))[u]=c,c=s,a*=2,u){case 0:i=e+a,o=r+a;break;case 1:e=i-a,o=r+a;break;case 2:i=e+a,r=o-a;break;case 3:e=i-a,r=o-a}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},f.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},f.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},f.find=function(t,n,e){var r,o,s,u,a,c,f,l=this._x0,h=this._y0,v=this._x1,y=this._y1,p=[],_=this._root;for(_&&p.push(new i(_,l,h,v,y)),null==e?e=1/0:(l=t-e,h=n-e,v=t+e,y=n+e,e*=e);c=p.pop();)if(!(!(_=c.node)||(o=c.x0)>v||(s=c.y0)>y||(u=c.x1)<l||(a=c.y1)<h))if(_.length){var d=(o+u)/2,g=(s+a)/2;p.push(new i(_[3],d,g,u,a),new i(_[2],o,g,d,a),new i(_[1],d,s,u,g),new i(_[0],o,s,d,g)),(f=(n>=g)<<1|t>=d)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var x=t-+this._x.call(null,_.data),w=n-+this._y.call(null,_.data),m=x*x+w*w;if(m<e){var b=Math.sqrt(e=m);l=t-b,h=n-b,v=t+b,y=n+b,r=_.data}}return r},f.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(s=+this._y.call(null,t)))return this;var n,e,r,i,o,s,u,a,c,f,l,h,v=this._root,y=this._x0,p=this._y0,_=this._x1,d=this._y1;if(!v)return this;if(v.length)for(;;){if((c=o>=(u=(y+_)/2))?y=u:_=u,(f=s>=(a=(p+d)/2))?p=a:d=a,n=v,!(v=v[l=f<<1|c]))return this;if(!v.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;v.data!==t;)if(r=v,!(v=v.next))return this;return(i=v.next)&&delete v.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(v=n[0]||n[1]||n[2]||n[3])&&v===(n[3]||n[2]||n[1]||n[0])&&!v.length&&(e?e[h]=v:this._root=v),this):(this._root=i,this)},f.removeAll=function(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this},f.root=function(){return this._root},f.size=function(){var t=0;return this.visit((function(n){if(!n.length)do{++t}while(n=n.next)})),t},f.visit=function(t){var n,e,r,o,s,u,a=[],c=this._root;for(c&&a.push(new i(c,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(c=n.node,r=n.x0,o=n.y0,s=n.x1,u=n.y1)&&c.length){var f=(r+s)/2,l=(o+u)/2;(e=c[3])&&a.push(new i(e,f,l,s,u)),(e=c[2])&&a.push(new i(e,r,l,f,u)),(e=c[1])&&a.push(new i(e,f,o,s,l)),(e=c[0])&&a.push(new i(e,r,o,f,l))}return this},f.visitAfter=function(t){var n,e=[],r=[];for(this._root&&e.push(new i(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var o=n.node;if(o.length){var s,u=n.x0,a=n.y0,c=n.x1,f=n.y1,l=(u+c)/2,h=(a+f)/2;(s=o[0])&&e.push(new i(s,u,a,l,h)),(s=o[1])&&e.push(new i(s,l,a,c,h)),(s=o[2])&&e.push(new i(s,u,h,l,f)),(s=o[3])&&e.push(new i(s,l,h,c,f))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},f.x=function(t){return arguments.length?(this._x=t,this):this._x},f.y=function(t){return arguments.length?(this._y=t,this):this._y};var l="\$";function h(){}function v(t,n){var e=new h;if(t instanceof h)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var s in t)e.set(s,t[s]);return e}function y(){}h.prototype=v.prototype={constructor:h,has:function(t){return l+t in this},get:function(t){return this[l+t]},set:function(t,n){return this[l+t]=n,this},remove:function(t){var n=l+t;return n in this&&delete this[n]},clear:function(){for(var t in this)t[0]===l&&delete this[t]},keys:function(){var t=[];for(var n in this)n[0]===l&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)n[0]===l&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)n[0]===l&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)n[0]===l&&++t;return t},empty:function(){for(var t in this)if(t[0]===l)return!1;return!0},each:function(t){for(var n in this)n[0]===l&&t(this[n],n.slice(1),this)}};var p=v.prototype;function _(t){return t.index}function d(t,n){var e=t.get(n);if(!e)throw new Error("missing: "+n);return e}y.prototype={constructor:y,has:p.has,add:function(t){return this[l+(t+="")]=t,this},remove:p.remove,clear:p.clear,values:p.keys,size:p.size,empty:p.empty,each:p.each};var g={value:function(){}};function x(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new w(r)}function w(t){this._=t}function m(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function b(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=g,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}w.prototype=x.prototype={constructor:w,on:function(t,n){var e,r,i=this._,o=(r=i,(t+"").trim().split(/^|\\s+/).map((function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),s=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<u;)if(e=(t=o[s]).type)i[e]=b(i[e],t.name,n);else if(null==n)for(e in i)i[e]=b(i[e],t.name,null);return this}for(;++s<u;)if((e=(t=o[s]).type)&&(e=m(i[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new w(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var A,N,M=0,k=0,E=0,j=1e3,T=0,S=0,q=0,D="object"==typeof performance&&performance.now?performance:Date,O="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function P(){return S||(O(z),S=D.now()+q)}function z(){S=0}function C(){this._call=this._time=this._next=null}function F(t,n,e){var r=new C;return r.restart(t,n,e),r}function I(){S=(T=D.now())+q,M=k=0;try{!function(){P(),++M;for(var t,n=A;n;)(t=S-n._time)>=0&&n._call.call(null,t),n=n._next;--M}()}finally{M=0,function(){var t,n,e=A,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:A=n);N=t,K(r)}(),S=0}}function Y(){var t=D.now(),n=t-T;n>j&&(q-=n,T=t)}function K(t){M||(k&&(k=clearTimeout(k)),t-S>24?(t<1/0&&(k=setTimeout(I,t-D.now()-q)),E&&(E=clearInterval(E))):(E||(T=D.now(),E=setInterval(Y,j)),M=1,O(I)))}function L(t){return t.x}function U(t){return t.y}C.prototype=F.prototype={constructor:C,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?P():+e)+(null==n?0:+n),this._next||N===this||(N?N._next=this:A=this,N=this),this._call=t,this._time=e,K()},stop:function(){this._call&&(this._call=null,this._time=1/0,K())}};var W=10,\$=Math.PI*(3-Math.sqrt(5));var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var G={exports:{}};
34
+ const workerCode = `var forceDirected=function(t){"use strict";function n(t){return function(){return t}}function e(){return 1e-6*(Math.random()-.5)}function r(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,s,u,a,c,f,l,h,v=t._root,y={data:r},p=t._x0,_=t._y0,d=t._x1,g=t._y1;if(!v)return t._root=y,t;for(;v.length;)if((c=n>=(o=(p+d)/2))?p=o:d=o,(f=e>=(s=(_+g)/2))?_=s:g=s,i=v,!(v=v[l=f<<1|c]))return i[l]=y,t;if(u=+t._x.call(null,v.data),a=+t._y.call(null,v.data),n===u&&e===a)return y.next=v,i?i[l]=y:t._root=y,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=n>=(o=(p+d)/2))?p=o:d=o,(f=e>=(s=(_+g)/2))?_=s:g=s}while((l=f<<1|c)==(h=(a>=s)<<1|u>=o));return i[h]=v,i[l]=y,t}function i(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function o(t){return t[0]}function s(t){return t[1]}function u(t,n,e){var r=new a(null==n?o:n,null==e?s:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function a(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function c(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var f=u.prototype=a.prototype;f.copy=function(){var t,n,e=new a(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=c(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=c(n));return e},f.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return r(this.cover(n,e),n,e,t)},f.addAll=function(t){var n,e,i,o,s=t.length,u=new Array(s),a=new Array(s),c=1/0,f=1/0,l=-1/0,h=-1/0;for(e=0;e<s;++e)isNaN(i=+this._x.call(null,n=t[e]))||isNaN(o=+this._y.call(null,n))||(u[e]=i,a[e]=o,i<c&&(c=i),i>l&&(l=i),o<f&&(f=o),o>h&&(h=o));if(c>l||f>h)return this;for(this.cover(c,f).cover(l,h),e=0;e<s;++e)r(this,u[e],a[e],t[e]);return this},f.cover=function(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{for(var s,u,a=i-e,c=this._root;e>t||t>=i||r>n||n>=o;)switch(u=(n<r)<<1|t<e,(s=new Array(4))[u]=c,c=s,a*=2,u){case 0:i=e+a,o=r+a;break;case 1:e=i-a,o=r+a;break;case 2:i=e+a,r=o-a;break;case 3:e=i-a,r=o-a}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},f.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},f.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},f.find=function(t,n,e){var r,o,s,u,a,c,f,l=this._x0,h=this._y0,v=this._x1,y=this._y1,p=[],_=this._root;for(_&&p.push(new i(_,l,h,v,y)),null==e?e=1/0:(l=t-e,h=n-e,v=t+e,y=n+e,e*=e);c=p.pop();)if(!(!(_=c.node)||(o=c.x0)>v||(s=c.y0)>y||(u=c.x1)<l||(a=c.y1)<h))if(_.length){var d=(o+u)/2,g=(s+a)/2;p.push(new i(_[3],d,g,u,a),new i(_[2],o,g,d,a),new i(_[1],d,s,u,g),new i(_[0],o,s,d,g)),(f=(n>=g)<<1|t>=d)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var x=t-+this._x.call(null,_.data),w=n-+this._y.call(null,_.data),m=x*x+w*w;if(m<e){var b=Math.sqrt(e=m);l=t-b,h=n-b,v=t+b,y=n+b,r=_.data}}return r},f.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(s=+this._y.call(null,t)))return this;var n,e,r,i,o,s,u,a,c,f,l,h,v=this._root,y=this._x0,p=this._y0,_=this._x1,d=this._y1;if(!v)return this;if(v.length)for(;;){if((c=o>=(u=(y+_)/2))?y=u:_=u,(f=s>=(a=(p+d)/2))?p=a:d=a,n=v,!(v=v[l=f<<1|c]))return this;if(!v.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;v.data!==t;)if(r=v,!(v=v.next))return this;return(i=v.next)&&delete v.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(v=n[0]||n[1]||n[2]||n[3])&&v===(n[3]||n[2]||n[1]||n[0])&&!v.length&&(e?e[h]=v:this._root=v),this):(this._root=i,this)},f.removeAll=function(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this},f.root=function(){return this._root},f.size=function(){var t=0;return this.visit((function(n){if(!n.length)do{++t}while(n=n.next)})),t},f.visit=function(t){var n,e,r,o,s,u,a=[],c=this._root;for(c&&a.push(new i(c,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(c=n.node,r=n.x0,o=n.y0,s=n.x1,u=n.y1)&&c.length){var f=(r+s)/2,l=(o+u)/2;(e=c[3])&&a.push(new i(e,f,l,s,u)),(e=c[2])&&a.push(new i(e,r,l,f,u)),(e=c[1])&&a.push(new i(e,f,o,s,l)),(e=c[0])&&a.push(new i(e,r,o,f,l))}return this},f.visitAfter=function(t){var n,e=[],r=[];for(this._root&&e.push(new i(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var o=n.node;if(o.length){var s,u=n.x0,a=n.y0,c=n.x1,f=n.y1,l=(u+c)/2,h=(a+f)/2;(s=o[0])&&e.push(new i(s,u,a,l,h)),(s=o[1])&&e.push(new i(s,l,a,c,h)),(s=o[2])&&e.push(new i(s,u,h,l,f)),(s=o[3])&&e.push(new i(s,l,h,c,f))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},f.x=function(t){return arguments.length?(this._x=t,this):this._x},f.y=function(t){return arguments.length?(this._y=t,this):this._y};var l="\$";function h(){}function v(t,n){var e=new h;if(t instanceof h)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var s in t)e.set(s,t[s]);return e}function y(){}h.prototype=v.prototype={constructor:h,has:function(t){return l+t in this},get:function(t){return this[l+t]},set:function(t,n){return this[l+t]=n,this},remove:function(t){var n=l+t;return n in this&&delete this[n]},clear:function(){for(var t in this)t[0]===l&&delete this[t]},keys:function(){var t=[];for(var n in this)n[0]===l&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)n[0]===l&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)n[0]===l&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)n[0]===l&&++t;return t},empty:function(){for(var t in this)if(t[0]===l)return!1;return!0},each:function(t){for(var n in this)n[0]===l&&t(this[n],n.slice(1),this)}};var p=v.prototype;function _(t){return t.index}function d(t,n){var e=t.get(n);if(!e)throw new Error("missing: "+n);return e}y.prototype={constructor:y,has:p.has,add:function(t){return this[l+(t+="")]=t,this},remove:p.remove,clear:p.clear,values:p.keys,size:p.size,empty:p.empty,each:p.each};var g={value:function(){}};function x(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new w(r)}function w(t){this._=t}function m(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function b(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=g,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}w.prototype=x.prototype={constructor:w,on:function(t,n){var e,r,i=this._,o=(r=i,(t+"").trim().split(/^|\\s+/).map((function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),s=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<u;)if(e=(t=o[s]).type)i[e]=b(i[e],t.name,n);else if(null==n)for(e in i)i[e]=b(i[e],t.name,null);return this}for(;++s<u;)if((e=(t=o[s]).type)&&(e=m(i[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new w(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var A,N,M=0,k=0,E=0,T=0,j=0,S=0,q="object"==typeof performance&&performance.now?performance:Date,D="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function O(){return j||(D(P),j=q.now()+S)}function P(){j=0}function z(){this._call=this._time=this._next=null}function C(t,n,e){var r=new z;return r.restart(t,n,e),r}function F(){j=(T=q.now())+S,M=k=0;try{!function(){O(),++M;for(var t,n=A;n;)(t=j-n._time)>=0&&n._call.call(null,t),n=n._next;--M}()}finally{M=0,function(){var t,n,e=A,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:A=n);N=t,Y(r)}(),j=0}}function I(){var t=q.now(),n=t-T;n>1e3&&(S-=n,T=t)}function Y(t){M||(k&&(k=clearTimeout(k)),t-j>24?(t<1/0&&(k=setTimeout(F,t-q.now()-S)),E&&(E=clearInterval(E))):(E||(T=q.now(),E=setInterval(I,1e3)),M=1,D(F)))}function K(t){return t.x}function L(t){return t.y}z.prototype=C.prototype={constructor:z,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?O():+e)+(null==n?0:+n),this._next||N===this||(N?N._next=this:A=this,N=this),this._call=t,this._time=e,Y()},stop:function(){this._call&&(this._call=null,this._time=1/0,Y())}};var U=Math.PI*(3-Math.sqrt(5));var W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var \$={exports:{}};
35
35
  /*!
36
36
  * @overview es6-promise - a tiny implementation of Promises/A+.
37
37
  * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
38
38
  * @license Licensed under MIT license
39
39
  * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
40
40
  * @version v4.2.8+1e68dce6
41
- */function H(t,r){var i=t.nodes,o=t.links,s=function(t){var r,i,o,s,u,a=_,c=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},f=n(30),l=1;function h(n){for(var o=0,s=t.length;o<l;++o)for(var a,c,f,h,v,y,p,_=0;_<s;++_)c=(a=t[_]).source,h=(f=a.target).x+f.vx-c.x-c.vx||e(),v=f.y+f.vy-c.y-c.vy||e(),h*=y=((y=Math.sqrt(h*h+v*v))-i[_])/y*n*r[_],v*=y,f.vx-=h*(p=u[_]),f.vy-=v*p,c.vx+=h*(p=1-p),c.vy+=v*p}function y(){if(o){var n,e,c=o.length,f=t.length,l=v(o,a);for(n=0,s=new Array(c);n<f;++n)(e=t[n]).index=n,"object"!=typeof e.source&&(e.source=d(l,e.source)),"object"!=typeof e.target&&(e.target=d(l,e.target)),s[e.source.index]=(s[e.source.index]||0)+1,s[e.target.index]=(s[e.target.index]||0)+1;for(n=0,u=new Array(f);n<f;++n)e=t[n],u[n]=s[e.source.index]/(s[e.source.index]+s[e.target.index]);r=new Array(f),p(),i=new Array(f),g()}}function p(){if(o)for(var n=0,e=t.length;n<e;++n)r[n]=+c(t[n],n,t)}function g(){if(o)for(var n=0,e=t.length;n<e;++n)i[n]=+f(t[n],n,t)}return null==t&&(t=[]),h.initialize=function(t){o=t,y()},h.links=function(n){return arguments.length?(t=n,y(),h):t},h.id=function(t){return arguments.length?(a=t,h):a},h.iterations=function(t){return arguments.length?(l=+t,h):l},h.strength=function(t){return arguments.length?(c="function"==typeof t?t:n(+t),p(),h):c},h.distance=function(t){return arguments.length?(f="function"==typeof t?t:n(+t),g(),h):f},h}(o).id((function(t){return t.id})).distance(r.linkDistance).strength(r.linkStrength),a=function(){var t,r,i,o,s=n(-30),a=1,c=1/0,f=.81;function l(n){var e,o=t.length,s=u(t,L,U).visitAfter(v);for(i=n,e=0;e<o;++e)r=t[e],s.visit(y)}function h(){if(t){var n,e,r=t.length;for(o=new Array(r),n=0;n<r;++n)e=t[n],o[e.index]=+s(e,n,t)}}function v(t){var n,e,r,i,s,u=0,a=0;if(t.length){for(r=i=s=0;s<4;++s)(n=t[s])&&(e=Math.abs(n.value))&&(u+=n.value,a+=e,r+=e*n.x,i+=e*n.y);t.x=r/a,t.y=i/a}else{(n=t).x=n.data.x,n.y=n.data.y;do{u+=o[n.data.index]}while(n=n.next)}t.value=u}function y(t,n,s,u){if(!t.value)return!0;var l=t.x-r.x,h=t.y-r.y,v=u-n,y=l*l+h*h;if(v*v/f<y)return y<c&&(0===l&&(y+=(l=e())*l),0===h&&(y+=(h=e())*h),y<a&&(y=Math.sqrt(a*y)),r.vx+=l*t.value*i/y,r.vy+=h*t.value*i/y),!0;if(!(t.length||y>=c)){(t.data!==r||t.next)&&(0===l&&(y+=(l=e())*l),0===h&&(y+=(h=e())*h),y<a&&(y=Math.sqrt(a*y)));do{t.data!==r&&(v=o[t.data.index]*i/y,r.vx+=l*v,r.vy+=h*v)}while(t=t.next)}}return l.initialize=function(n){t=n,h()},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),h(),l):s},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(c=t*t,l):Math.sqrt(c)},l.theta=function(t){return arguments.length?(f=t*t,l):Math.sqrt(f)},l}().strength(r.repulsionStrength);return function(t){var n,e=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,u=v(),a=F(f),c=x("tick","end");function f(){l(),c.call("tick",n),e<r&&(a.stop(),c.call("end",n))}function l(r){var a,c,f=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(e+=(o-e)*i,u.each((function(t){t(e)})),a=0;a<f;++a)null==(c=t[a]).fx?c.x+=c.vx*=s:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=s:(c.y=c.fy,c.vy=0);return n}function h(){for(var n,e=0,r=t.length;e<r;++e){if((n=t[e]).index=e,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),isNaN(n.x)||isNaN(n.y)){var i=W*Math.sqrt(e),o=e*\$;n.x=i*Math.cos(o),n.y=i*Math.sin(o)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function y(n){return n.initialize&&n.initialize(t),n}return null==t&&(t=[]),h(),n={tick:l,restart:function(){return a.restart(f),n},stop:function(){return a.stop(),n},nodes:function(e){return arguments.length?(t=e,h(),u.each(y),n):t},alpha:function(t){return arguments.length?(e=+t,n):e},alphaMin:function(t){return arguments.length?(r=+t,n):r},alphaDecay:function(t){return arguments.length?(i=+t,n):+i},alphaTarget:function(t){return arguments.length?(o=+t,n):o},velocityDecay:function(t){return arguments.length?(s=1-t,n):1-s},force:function(t,e){return arguments.length>1?(null==e?u.remove(t):u.set(t,y(e)),n):u.get(t)},find:function(n,e,r){var i,o,s,u,a,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(s=(i=n-(u=t[c]).x)*i+(o=e-u.y)*o)<r&&(a=u,r=s);return a},on:function(t,e){return arguments.length>1?(c.on(t,e),n):c.on(t)}}}(i).force("link",s).force("charge",a).force("center",function(t,n){var e;function r(){var r,i,o=e.length,s=0,u=0;for(r=0;r<o;++r)s+=(i=e[r]).x,u+=i.y;for(s=s/o-t,u=u/o-n,r=0;r<o;++r)(i=e[r]).x-=s,i.y-=u}return null==t&&(t=0),null==n&&(n=0),r.initialize=function(t){e=t},r.x=function(n){return arguments.length?(t=+n,r):t},r.y=function(t){return arguments.length?(n=+t,r):n},r}()).alpha(r.alpha).alphaMin(r.alphaMin).alphaDecay(r.alphaDecay).velocityDecay(r.velocityDecay).stop().tick(r.iterations),{nodes:i,links:o}}return G.exports=function(){function t(t){var n=typeof t;return null!==t&&("object"===n||"function"===n)}function n(t){return"function"==typeof t}var e=void 0;e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var r=e,i=0,o=void 0,s=void 0,u=function(t,n){w[i]=t,w[i+1]=n,2===(i+=2)&&(s?s(m):A())};function a(t){s=t}function c(t){u=t}var f="undefined"!=typeof window?window:void 0,l=f||{},h=l.MutationObserver||l.WebKitMutationObserver,v="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),y="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){return function(){return process.nextTick(m)}}function _(){return void 0!==o?function(){o(m)}:x()}function d(){var t=0,n=new h(m),e=document.createTextNode("");return n.observe(e,{characterData:!0}),function(){e.data=t=++t%2}}function g(){var t=new MessageChannel;return t.port1.onmessage=m,function(){return t.port2.postMessage(0)}}function x(){var t=setTimeout;return function(){return t(m,1)}}var w=new Array(1e3);function m(){for(var t=0;t<i;t+=2)(0,w[t])(w[t+1]),w[t]=void 0,w[t+1]=void 0;i=0}function b(){try{var t=Function("return this")().require("vertx");return o=t.runOnLoop||t.runOnContext,_()}catch(t){return x()}}var A=void 0;function N(t,n){var e=this,r=new this.constructor(E);void 0===r[k]&&J(r);var i=e._state;if(i){var o=arguments[i-1];u((function(){return W(i,r,o,e._result)}))}else L(e,r,t,n);return r}function M(t){var n=this;if(t&&"object"==typeof t&&t.constructor===n)return t;var e=new n(E);return F(e,t),e}A=v?p():h?d():y?g():void 0===f?b():x();var k=Math.random().toString(36).substring(2);function E(){}var j=void 0,T=1,S=2;function q(){return new TypeError("You cannot resolve a promise with itself")}function D(){return new TypeError("A promises callback cannot return that same promise.")}function O(t,n,e,r){try{t.call(n,e,r)}catch(t){return t}}function P(t,n,e){u((function(t){var r=!1,i=O(e,n,(function(e){r||(r=!0,n!==e?F(t,e):Y(t,e))}),(function(n){r||(r=!0,K(t,n))}),"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,K(t,i))}),t)}function z(t,n){n._state===T?Y(t,n._result):n._state===S?K(t,n._result):L(n,void 0,(function(n){return F(t,n)}),(function(n){return K(t,n)}))}function C(t,e,r){e.constructor===t.constructor&&r===N&&e.constructor.resolve===M?z(t,e):void 0===r?Y(t,e):n(r)?P(t,e,r):Y(t,e)}function F(n,e){if(n===e)K(n,q());else if(t(e)){var r=void 0;try{r=e.then}catch(t){return void K(n,t)}C(n,e,r)}else Y(n,e)}function I(t){t._onerror&&t._onerror(t._result),U(t)}function Y(t,n){t._state===j&&(t._result=n,t._state=T,0!==t._subscribers.length&&u(U,t))}function K(t,n){t._state===j&&(t._state=S,t._result=n,u(I,t))}function L(t,n,e,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=n,i[o+T]=e,i[o+S]=r,0===o&&t._state&&u(U,t)}function U(t){var n=t._subscribers,e=t._state;if(0!==n.length){for(var r=void 0,i=void 0,o=t._result,s=0;s<n.length;s+=3)r=n[s],i=n[s+e],r?W(e,r,i,o):i(o);t._subscribers.length=0}}function W(t,e,r,i){var o=n(r),s=void 0,u=void 0,a=!0;if(o){try{s=r(i)}catch(t){a=!1,u=t}if(e===s)return void K(e,D())}else s=i;e._state!==j||(o&&a?F(e,s):!1===a?K(e,u):t===T?Y(e,s):t===S&&K(e,s))}function \$(t,n){try{n((function(n){F(t,n)}),(function(n){K(t,n)}))}catch(n){K(t,n)}}var G=0;function H(){return G++}function J(t){t[k]=G++,t._state=void 0,t._result=void 0,t._subscribers=[]}function Q(){return new Error("Array Methods must be provided an Array")}var R=function(){function t(t,n){this._instanceConstructor=t,this.promise=new t(E),this.promise[k]||J(this.promise),r(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?Y(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&Y(this.promise,this._result))):K(this.promise,Q())}return t.prototype._enumerate=function(t){for(var n=0;this._state===j&&n<t.length;n++)this._eachEntry(t[n],n)},t.prototype._eachEntry=function(t,n){var e=this._instanceConstructor,r=e.resolve;if(r===M){var i=void 0,o=void 0,s=!1;try{i=t.then}catch(t){s=!0,o=t}if(i===N&&t._state!==j)this._settledAt(t._state,n,t._result);else if("function"!=typeof i)this._remaining--,this._result[n]=t;else if(e===et){var u=new e(E);s?K(u,o):C(u,t,i),this._willSettleAt(u,n)}else this._willSettleAt(new e((function(n){return n(t)})),n)}else this._willSettleAt(r(t),n)},t.prototype._settledAt=function(t,n,e){var r=this.promise;r._state===j&&(this._remaining--,t===S?K(r,e):this._result[n]=e),0===this._remaining&&Y(r,this._result)},t.prototype._willSettleAt=function(t,n){var e=this;L(t,void 0,(function(t){return e._settledAt(T,n,t)}),(function(t){return e._settledAt(S,n,t)}))},t}();function V(t){return new R(this,t).promise}function X(t){var n=this;return r(t)?new n((function(e,r){for(var i=t.length,o=0;o<i;o++)n.resolve(t[o]).then(e,r)})):new n((function(t,n){return n(new TypeError("You must pass an array to race."))}))}function Z(t){var n=new this(E);return K(n,t),n}function tt(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function nt(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var et=function(){function t(n){this[k]=H(),this._result=this._state=void 0,this._subscribers=[],E!==n&&("function"!=typeof n&&tt(),this instanceof t?\$(this,n):nt())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this,r=e.constructor;return n(t)?e.then((function(n){return r.resolve(t()).then((function(){return n}))}),(function(n){return r.resolve(t()).then((function(){throw n}))})):e.then(t,t)},t}();function rt(){var t=void 0;if(void 0!==B)t=B;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var e=null;try{e=Object.prototype.toString.call(n.resolve())}catch(t){}if("[object Promise]"===e&&!n.cast)return}t.Promise=et}return et.prototype.then=N,et.all=V,et.race=X,et.resolve=M,et.reject=Z,et._setScheduler=a,et._setAsap=c,et._asap=u,et.polyfill=rt,et.Promise=et,et}(),G.exports.polyfill(),self.onmessage=function(t){var n=H.apply(void 0,t.data);self.postMessage(n)},t.forceDirected=H,Object.defineProperty(t,"__esModule",{value:!0}),t}({});`;
41
+ */function B(t,r){var i=t.nodes,o=t.links,s=function(t){var r,i,o,s,u,a=_,c=function(t){return 1/Math.min(s[t.source.index],s[t.target.index])},f=n(30),l=1;function h(n){for(var o=0,s=t.length;o<l;++o)for(var a,c,f,h,v,y,p,_=0;_<s;++_)c=(a=t[_]).source,h=(f=a.target).x+f.vx-c.x-c.vx||e(),v=f.y+f.vy-c.y-c.vy||e(),h*=y=((y=Math.sqrt(h*h+v*v))-i[_])/y*n*r[_],v*=y,f.vx-=h*(p=u[_]),f.vy-=v*p,c.vx+=h*(p=1-p),c.vy+=v*p}function y(){if(o){var n,e,c=o.length,f=t.length,l=v(o,a);for(n=0,s=new Array(c);n<f;++n)(e=t[n]).index=n,"object"!=typeof e.source&&(e.source=d(l,e.source)),"object"!=typeof e.target&&(e.target=d(l,e.target)),s[e.source.index]=(s[e.source.index]||0)+1,s[e.target.index]=(s[e.target.index]||0)+1;for(n=0,u=new Array(f);n<f;++n)e=t[n],u[n]=s[e.source.index]/(s[e.source.index]+s[e.target.index]);r=new Array(f),p(),i=new Array(f),g()}}function p(){if(o)for(var n=0,e=t.length;n<e;++n)r[n]=+c(t[n],n,t)}function g(){if(o)for(var n=0,e=t.length;n<e;++n)i[n]=+f(t[n],n,t)}return null==t&&(t=[]),h.initialize=function(t){o=t,y()},h.links=function(n){return arguments.length?(t=n,y(),h):t},h.id=function(t){return arguments.length?(a=t,h):a},h.iterations=function(t){return arguments.length?(l=+t,h):l},h.strength=function(t){return arguments.length?(c="function"==typeof t?t:n(+t),p(),h):c},h.distance=function(t){return arguments.length?(f="function"==typeof t?t:n(+t),g(),h):f},h}(o).id((function(t){return t.id})).distance(r.linkDistance).strength(r.linkStrength),a=function(){var t,r,i,o,s=n(-30),a=1,c=1/0,f=.81;function l(n){var e,o=t.length,s=u(t,K,L).visitAfter(v);for(i=n,e=0;e<o;++e)r=t[e],s.visit(y)}function h(){if(t){var n,e,r=t.length;for(o=new Array(r),n=0;n<r;++n)e=t[n],o[e.index]=+s(e,n,t)}}function v(t){var n,e,r,i,s,u=0,a=0;if(t.length){for(r=i=s=0;s<4;++s)(n=t[s])&&(e=Math.abs(n.value))&&(u+=n.value,a+=e,r+=e*n.x,i+=e*n.y);t.x=r/a,t.y=i/a}else{(n=t).x=n.data.x,n.y=n.data.y;do{u+=o[n.data.index]}while(n=n.next)}t.value=u}function y(t,n,s,u){if(!t.value)return!0;var l=t.x-r.x,h=t.y-r.y,v=u-n,y=l*l+h*h;if(v*v/f<y)return y<c&&(0===l&&(y+=(l=e())*l),0===h&&(y+=(h=e())*h),y<a&&(y=Math.sqrt(a*y)),r.vx+=l*t.value*i/y,r.vy+=h*t.value*i/y),!0;if(!(t.length||y>=c)){(t.data!==r||t.next)&&(0===l&&(y+=(l=e())*l),0===h&&(y+=(h=e())*h),y<a&&(y=Math.sqrt(a*y)));do{t.data!==r&&(v=o[t.data.index]*i/y,r.vx+=l*v,r.vy+=h*v)}while(t=t.next)}}return l.initialize=function(n){t=n,h()},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),h(),l):s},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(c=t*t,l):Math.sqrt(c)},l.theta=function(t){return arguments.length?(f=t*t,l):Math.sqrt(f)},l}().strength(r.repulsionStrength);return function(t){var n,e=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,u=v(),a=C(f),c=x("tick","end");function f(){l(),c.call("tick",n),e<r&&(a.stop(),c.call("end",n))}function l(r){var a,c,f=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(e+=(o-e)*i,u.each((function(t){t(e)})),a=0;a<f;++a)null==(c=t[a]).fx?c.x+=c.vx*=s:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=s:(c.y=c.fy,c.vy=0);return n}function h(){for(var n,e=0,r=t.length;e<r;++e){if((n=t[e]).index=e,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),isNaN(n.x)||isNaN(n.y)){var i=10*Math.sqrt(e),o=e*U;n.x=i*Math.cos(o),n.y=i*Math.sin(o)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function y(n){return n.initialize&&n.initialize(t),n}return null==t&&(t=[]),h(),n={tick:l,restart:function(){return a.restart(f),n},stop:function(){return a.stop(),n},nodes:function(e){return arguments.length?(t=e,h(),u.each(y),n):t},alpha:function(t){return arguments.length?(e=+t,n):e},alphaMin:function(t){return arguments.length?(r=+t,n):r},alphaDecay:function(t){return arguments.length?(i=+t,n):+i},alphaTarget:function(t){return arguments.length?(o=+t,n):o},velocityDecay:function(t){return arguments.length?(s=1-t,n):1-s},force:function(t,e){return arguments.length>1?(null==e?u.remove(t):u.set(t,y(e)),n):u.get(t)},find:function(n,e,r){var i,o,s,u,a,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(s=(i=n-(u=t[c]).x)*i+(o=e-u.y)*o)<r&&(a=u,r=s);return a},on:function(t,e){return arguments.length>1?(c.on(t,e),n):c.on(t)}}}(i).force("link",s).force("charge",a).force("center",function(t,n){var e;function r(){var r,i,o=e.length,s=0,u=0;for(r=0;r<o;++r)s+=(i=e[r]).x,u+=i.y;for(s=s/o-t,u=u/o-n,r=0;r<o;++r)(i=e[r]).x-=s,i.y-=u}return null==t&&(t=0),null==n&&(n=0),r.initialize=function(t){e=t},r.x=function(n){return arguments.length?(t=+n,r):t},r.y=function(t){return arguments.length?(n=+t,r):n},r}()).alpha(r.alpha).alphaMin(r.alphaMin).alphaDecay(r.alphaDecay).velocityDecay(r.velocityDecay).stop().tick(r.iterations),{nodes:i,links:o}}return \$.exports=function(){function t(t){var n=typeof t;return null!==t&&("object"===n||"function"===n)}function n(t){return"function"==typeof t}var e=void 0;e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var r=e,i=0,o=void 0,s=void 0,u=function(t,n){w[i]=t,w[i+1]=n,2===(i+=2)&&(s?s(m):A())};function a(t){s=t}function c(t){u=t}var f="undefined"!=typeof window?window:void 0,l=f||{},h=l.MutationObserver||l.WebKitMutationObserver,v="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),y="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){return function(){return process.nextTick(m)}}function _(){return void 0!==o?function(){o(m)}:x()}function d(){var t=0,n=new h(m),e=document.createTextNode("");return n.observe(e,{characterData:!0}),function(){e.data=t=++t%2}}function g(){var t=new MessageChannel;return t.port1.onmessage=m,function(){return t.port2.postMessage(0)}}function x(){var t=setTimeout;return function(){return t(m,1)}}var w=new Array(1e3);function m(){for(var t=0;t<i;t+=2)(0,w[t])(w[t+1]),w[t]=void 0,w[t+1]=void 0;i=0}function b(){try{var t=Function("return this")().require("vertx");return o=t.runOnLoop||t.runOnContext,_()}catch(t){return x()}}var A=void 0;function N(t,n){var e=this,r=new this.constructor(E);void 0===r[k]&&J(r);var i=e._state;if(i){var o=arguments[i-1];u((function(){return \$(i,r,o,e._result)}))}else L(e,r,t,n);return r}function M(t){var n=this;if(t&&"object"==typeof t&&t.constructor===n)return t;var e=new n(E);return F(e,t),e}A=v?p():h?d():y?g():void 0===f?b():x();var k=Math.random().toString(36).substring(2);function E(){}var T=void 0,j=1,S=2;function q(){return new TypeError("You cannot resolve a promise with itself")}function D(){return new TypeError("A promises callback cannot return that same promise.")}function O(t,n,e,r){try{t.call(n,e,r)}catch(t){return t}}function P(t,n,e){u((function(t){var r=!1,i=O(e,n,(function(e){r||(r=!0,n!==e?F(t,e):Y(t,e))}),(function(n){r||(r=!0,K(t,n))}),"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,K(t,i))}),t)}function z(t,n){n._state===j?Y(t,n._result):n._state===S?K(t,n._result):L(n,void 0,(function(n){return F(t,n)}),(function(n){return K(t,n)}))}function C(t,e,r){e.constructor===t.constructor&&r===N&&e.constructor.resolve===M?z(t,e):void 0===r?Y(t,e):n(r)?P(t,e,r):Y(t,e)}function F(n,e){if(n===e)K(n,q());else if(t(e)){var r=void 0;try{r=e.then}catch(t){return void K(n,t)}C(n,e,r)}else Y(n,e)}function I(t){t._onerror&&t._onerror(t._result),U(t)}function Y(t,n){t._state===T&&(t._result=n,t._state=j,0!==t._subscribers.length&&u(U,t))}function K(t,n){t._state===T&&(t._state=S,t._result=n,u(I,t))}function L(t,n,e,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=n,i[o+j]=e,i[o+S]=r,0===o&&t._state&&u(U,t)}function U(t){var n=t._subscribers,e=t._state;if(0!==n.length){for(var r=void 0,i=void 0,o=t._result,s=0;s<n.length;s+=3)r=n[s],i=n[s+e],r?\$(e,r,i,o):i(o);t._subscribers.length=0}}function \$(t,e,r,i){var o=n(r),s=void 0,u=void 0,a=!0;if(o){try{s=r(i)}catch(t){a=!1,u=t}if(e===s)return void K(e,D())}else s=i;e._state!==T||(o&&a?F(e,s):!1===a?K(e,u):t===j?Y(e,s):t===S&&K(e,s))}function B(t,n){try{n((function(n){F(t,n)}),(function(n){K(t,n)}))}catch(n){K(t,n)}}var G=0;function H(){return G++}function J(t){t[k]=G++,t._state=void 0,t._result=void 0,t._subscribers=[]}function Q(){return new Error("Array Methods must be provided an Array")}var R=function(){function t(t,n){this._instanceConstructor=t,this.promise=new t(E),this.promise[k]||J(this.promise),r(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?Y(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&Y(this.promise,this._result))):K(this.promise,Q())}return t.prototype._enumerate=function(t){for(var n=0;this._state===T&&n<t.length;n++)this._eachEntry(t[n],n)},t.prototype._eachEntry=function(t,n){var e=this._instanceConstructor,r=e.resolve;if(r===M){var i=void 0,o=void 0,s=!1;try{i=t.then}catch(t){s=!0,o=t}if(i===N&&t._state!==T)this._settledAt(t._state,n,t._result);else if("function"!=typeof i)this._remaining--,this._result[n]=t;else if(e===et){var u=new e(E);s?K(u,o):C(u,t,i),this._willSettleAt(u,n)}else this._willSettleAt(new e((function(n){return n(t)})),n)}else this._willSettleAt(r(t),n)},t.prototype._settledAt=function(t,n,e){var r=this.promise;r._state===T&&(this._remaining--,t===S?K(r,e):this._result[n]=e),0===this._remaining&&Y(r,this._result)},t.prototype._willSettleAt=function(t,n){var e=this;L(t,void 0,(function(t){return e._settledAt(j,n,t)}),(function(t){return e._settledAt(S,n,t)}))},t}();function V(t){return new R(this,t).promise}function X(t){var n=this;return r(t)?new n((function(e,r){for(var i=t.length,o=0;o<i;o++)n.resolve(t[o]).then(e,r)})):new n((function(t,n){return n(new TypeError("You must pass an array to race."))}))}function Z(t){var n=new this(E);return K(n,t),n}function tt(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function nt(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var et=function(){function t(n){this[k]=H(),this._result=this._state=void 0,this._subscribers=[],E!==n&&("function"!=typeof n&&tt(),this instanceof t?B(this,n):nt())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this,r=e.constructor;return n(t)?e.then((function(n){return r.resolve(t()).then((function(){return n}))}),(function(n){return r.resolve(t()).then((function(){throw n}))})):e.then(t,t)},t}();function rt(){var t=void 0;if(void 0!==W)t=W;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var e=null;try{e=Object.prototype.toString.call(n.resolve())}catch(t){}if("[object Promise]"===e&&!n.cast)return}t.Promise=et}return et.prototype.then=N,et.all=V,et.race=X,et.resolve=M,et.reject=Z,et._setScheduler=a,et._setAsap=c,et._asap=u,et.polyfill=rt,et.Promise=et,et}(),\$.exports.polyfill(),self.onmessage=function(t){var n=B.apply(void 0,t.data);self.postMessage(n)},t.forceDirected=B,t}({});`;
42
42
 
43
43
  const workerBlob = new Blob([workerCode], { type: "application/javascript" });
44
44
  const workerUrl = URL.createObjectURL(workerBlob);