if("function"==typeof importScripts){let e,t,o;importScripts("https://d157l7jdn8e5sf.cloudfront.net/v7.2.0/webworker.js","./tinycolor.js"),addEventListener("message",onMessage),isDrawing=!1;let n=0,a=[],r=[],i=0,l=[],c=[],d=[],s=[],u=[],g={x:0,y:0},p=new Float32Array(0),h=0,f=0,y={background:2302755,link:11184810,node:13421772,outline:11184810,text:16777215,accent:4203434},S=-1,x=-1,v=-1,m=!1,w=[],b=-1,C=1,k=1;function toScreenSpace(e,t,o=!0){return o?{x:Math.floor(e*C+g.x),y:Math.floor(t*C+g.y)}:{x:e*C+g.x,y:t*C+g.y}}function vecToScreenSpace({x:e,y:t},o=!0){return toScreenSpace(e,t,o)}function toWorldspace(e,t){return{x:(e-g.x)/C,y:(t-g.y)/C}}function vecToWorldspace({x:e,y:t}){return toWorldspace(e,t)}function setCameraCenterWorldspace({x:e,y:t}){g.x=canvas.width/2-e*C,g.y=canvas.height/2-t*C}function getCameraCenterWorldspace(){return toWorldspace(canvas.width/2,canvas.height/2)}function getNodeScreenRadius(e){return e*k}function getNodeWorldspaceRadius(e){return e/k}function getPosition(e){return{x:p[2*e],y:p[2*e+1]}}function mixColors(e,t,o){return tinycolor.mix(tinycolor(e.toString(16)),tinycolor(t.toString(16)),o).toHexNumber()}function darkenColor(e,t){return tinycolor(e.toString(16)).darken(t).toHexNumber()}function lightenColor(e,t){return tinycolor(e.toString(16)).lighten(t).toHexNumber()}function invertColor(e,t){for(e=e.toString(16);e.length<6;)e="0"+e;if(0===e.indexOf("#")&&(e=e.slice(1)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6!==e.length)throw new Error("Invalid HEX color:"+e);var o=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),a=parseInt(e.slice(4,6),16);return t?.299*o+.587*n+.114*a>186?"#000000":"#FFFFFF":(o=(255-o).toString(16),n=(255-n).toString(16),a=(255-a).toString(16),"#"+padZero(o)+padZero(n)+padZero(a))}function clamp(e,t,o){return Math.min(Math.max(e,t),o)}function lerp(e,t,o){return e+(t-e)*o}let N=0,T=.2,F=15,M=12,P=F/M;function showLabel(e,t,o=!1){let n=u[e];if(!n)return;if(d[e]=t,!(t>.01))return void hideLabel(e);n.visible=!0,n.style.fontSize=o?F:M;let a=vecToScreenSpace(getPosition(e)),r=s[e]*(o?P:1)/2;n.x=a.x-r,n.y=a.y+getNodeScreenRadius(l[e])+9,n.alpha=t}function hideLabel(e){u[e].visible=!1}function draw(){o.clear();let e=[];m&&(w=[]),N=-1!=S||-1!=v?Math.min(1,N+T):Math.max(0,N-T),o.lineStyle(1,mixColors(y.link,y.background,50*N),.7);for(let t=0;t2){showLabel(e,lerp(0,(t-4)/8-1/k/6*.9,Math.max(1-N,.2)))}else hideLabel(e);if(S==e||x==e&&0!=N||-1!=S&&w.includes(e))continue;let n=vecToScreenSpace(getPosition(e));o.drawCircle(n.x,n.y,t)}o.endFill(),t=.7*N,o.lineStyle(1,mixColors(mixColors(y.link,y.accent,100*N),y.background,20),t);for(let t=0;t