%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/lxd/current/share/lxd-ui/assets/
Upload File :
Create Path :
Current File : //snap/lxd/current/share/lxd-ui/assets/NetworkMap-30a0e19e.js

import{aJ as Kl,aK as Gl,aL as Yl,aM as bi,aN as ks,aO as Sn,aP as Xl,aQ as Ul,aR as Zl,aS as Ql,aT as Jl,aU as Ps,at as Kn,aV as jl,aW as _l,aX as ef,az as no,j as Pe,I as tf,d as ai,m as rf,r as af,f as io,L as nf,Y as of,B as sf,b as uf,q as oo,aD as lf}from"./index-13b2882d.js";import{f as ff}from"./networks-5caac489.js";var vf=Kl,cf=function(){return vf.Date.now()},df=cf,hf=/\s/;function gf(t){for(var e=t.length;e--&&hf.test(t.charAt(e)););return e}var pf=gf,mf=pf,yf=/^\s+/;function bf(t){return t&&t.slice(0,mf(t)+1).replace(yf,"")}var wf=bf,xf=Gl,Ef=Yl,Cf="[object Symbol]";function Sf(t){return typeof t=="symbol"||Ef(t)&&xf(t)==Cf}var Pa=Sf,Tf=wf,so=bi,Df=Pa,uo=0/0,kf=/^[-+]0x[0-9a-f]+$/i,Pf=/^0b[01]+$/i,Bf=/^0o[0-7]+$/i,Lf=parseInt;function Mf(t){if(typeof t=="number")return t;if(Df(t))return uo;if(so(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=so(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Tf(t);var r=Pf.test(t);return r||Bf.test(t)?Lf(t.slice(2),r?2:8):kf.test(t)?uo:+t}var Of=Mf,Af=bi,Gn=df,lo=Of,Rf="Expected a function",If=Math.max,Nf=Math.min;function zf(t,e,r){var a,n,i,o,s,u,l=0,f=!1,v=!1,c=!0;if(typeof t!="function")throw new TypeError(Rf);e=lo(e)||0,Af(r)&&(f=!!r.leading,v="maxWait"in r,i=v?If(lo(r.maxWait)||0,e):i,c="trailing"in r?!!r.trailing:c);function h(C){var x=a,T=n;return a=n=void 0,l=C,o=t.apply(T,x),o}function d(C){return l=C,s=setTimeout(g,e),f?h(C):o}function p(C){var x=C-u,T=C-l,E=e-x;return v?Nf(E,i-T):E}function m(C){var x=C-u,T=C-l;return u===void 0||x>=e||x<0||v&&T>=i}function g(){var C=Gn();if(m(C))return y(C);s=setTimeout(g,p(C))}function y(C){return s=void 0,c&&a?h(C):(a=n=void 0,o)}function b(){s!==void 0&&clearTimeout(s),l=0,a=u=n=s=void 0}function w(){return s===void 0?o:y(Gn())}function S(){var C=Gn(),x=m(C);if(a=arguments,n=this,u=C,x){if(s===void 0)return d(u);if(v)return clearTimeout(s),s=setTimeout(g,e),h(u)}return s===void 0&&(s=setTimeout(g,e)),o}return S.cancel=b,S.flush=w,S}var Ff=zf,Bs={exports:{}};(function(t,e){(function(){var r,a,n,i,o,s,u,l,f,v,c,h,d,p,m;n=Math.floor,v=Math.min,a=function(g,y){return g<y?-1:g>y?1:0},f=function(g,y,b,w,S){var C;if(b==null&&(b=0),S==null&&(S=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=g.length);b<w;)C=n((b+w)/2),S(y,g[C])<0?w=C:b=C+1;return[].splice.apply(g,[b,b-b].concat(y)),y},s=function(g,y,b){return b==null&&(b=a),g.push(y),p(g,0,g.length-1,b)},o=function(g,y){var b,w;return y==null&&(y=a),b=g.pop(),g.length?(w=g[0],g[0]=b,m(g,0,y)):w=b,w},l=function(g,y,b){var w;return b==null&&(b=a),w=g[0],g[0]=y,m(g,0,b),w},u=function(g,y,b){var w;return b==null&&(b=a),g.length&&b(g[0],y)<0&&(w=[g[0],y],y=w[0],g[0]=w[1],m(g,0,b)),y},i=function(g,y){var b,w,S,C,x,T;for(y==null&&(y=a),C=(function(){T=[];for(var E=0,P=n(g.length/2);0<=P?E<P:E>P;0<=P?E++:E--)T.push(E);return T}).apply(this).reverse(),x=[],w=0,S=C.length;w<S;w++)b=C[w],x.push(m(g,b,y));return x},d=function(g,y,b){var w;if(b==null&&(b=a),w=g.indexOf(y),w!==-1)return p(g,0,w,b),m(g,w,b)},c=function(g,y,b){var w,S,C,x,T;if(b==null&&(b=a),S=g.slice(0,y),!S.length)return S;for(i(S,b),T=g.slice(y),C=0,x=T.length;C<x;C++)w=T[C],u(S,w,b);return S.sort(b).reverse()},h=function(g,y,b){var w,S,C,x,T,E,P,B,D;if(b==null&&(b=a),y*10<=g.length){if(C=g.slice(0,y).sort(b),!C.length)return C;for(S=C[C.length-1],P=g.slice(y),x=0,E=P.length;x<E;x++)w=P[x],b(w,S)<0&&(f(C,w,0,null,b),C.pop(),S=C[C.length-1]);return C}for(i(g,b),D=[],T=0,B=v(y,g.length);0<=B?T<B:T>B;0<=B?++T:--T)D.push(o(g,b));return D},p=function(g,y,b,w){var S,C,x;for(w==null&&(w=a),S=g[b];b>y;){if(x=b-1>>1,C=g[x],w(S,C)<0){g[b]=C,b=x;continue}break}return g[b]=S},m=function(g,y,b){var w,S,C,x,T;for(b==null&&(b=a),S=g.length,T=y,C=g[y],w=2*y+1;w<S;)x=w+1,x<S&&!(b(g[w],g[x])<0)&&(w=x),g[y]=g[w],y=w,w=2*y+1;return g[y]=C,p(g,T,y,b)},r=function(){g.push=s,g.pop=o,g.replace=l,g.pushpop=u,g.heapify=i,g.updateItem=d,g.nlargest=c,g.nsmallest=h;function g(y){this.cmp=y??a,this.nodes=[]}return g.prototype.push=function(y){return s(this.nodes,y,this.cmp)},g.prototype.pop=function(){return o(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(y){return this.nodes.indexOf(y)!==-1},g.prototype.replace=function(y){return l(this.nodes,y,this.cmp)},g.prototype.pushpop=function(y){return u(this.nodes,y,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(y){return d(this.nodes,y,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var y;return y=new g,y.nodes=this.nodes.slice(0),y},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g}(),function(g,y){return t.exports=y()}(this,function(){return r})}).call(ks)})(Bs);var Vf=Bs.exports,$f=Vf,qf=Sn,Hf=Pa,Wf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kf=/^\w*$/;function Gf(t,e){if(qf(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Hf(t)?!0:Kf.test(t)||!Wf.test(t)||e!=null&&t in Object(e)}var Yf=Gf,Ls=Xl,Xf="Expected a function";function wi(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Xf);var r=function(){var a=arguments,n=e?e.apply(this,a):a[0],i=r.cache;if(i.has(n))return i.get(n);var o=t.apply(this,a);return r.cache=i.set(n,o)||i,o};return r.cache=new(wi.Cache||Ls),r}wi.Cache=Ls;var Uf=wi,Zf=Uf,Qf=500;function Jf(t){var e=Zf(t,function(a){return r.size===Qf&&r.clear(),a}),r=e.cache;return e}var jf=Jf,_f=jf,ev=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tv=/\\(\\)?/g,rv=_f(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(ev,function(r,a,n,i){e.push(n?i.replace(tv,"$1"):a||r)}),e}),Ms=rv;function av(t,e){for(var r=-1,a=t==null?0:t.length,n=Array(a);++r<a;)n[r]=e(t[r],r,t);return n}var Os=av,fo=Ul,nv=Os,iv=Sn,ov=Pa,sv=1/0,vo=fo?fo.prototype:void 0,co=vo?vo.toString:void 0;function As(t){if(typeof t=="string")return t;if(iv(t))return nv(t,As)+"";if(ov(t))return co?co.call(t):"";var e=t+"";return e=="0"&&1/t==-sv?"-0":e}var uv=As,lv=uv;function fv(t){return t==null?"":lv(t)}var Rs=fv,vv=Sn,cv=Yf,dv=Ms,hv=Rs;function gv(t,e){return vv(t)?t:cv(t,e)?[t]:dv(hv(t))}var Is=gv,pv=Pa,mv=1/0;function yv(t){if(typeof t=="string"||pv(t))return t;var e=t+"";return e=="0"&&1/t==-mv?"-0":e}var xi=yv,bv=Is,wv=xi;function xv(t,e){e=bv(e,t);for(var r=0,a=e.length;t!=null&&r<a;)t=t[wv(e[r++])];return r&&r==a?t:void 0}var Ev=xv,Cv=Ev;function Sv(t,e,r){var a=t==null?void 0:Cv(t,e);return a===void 0?r:a}var Tv=Sv,Dv=Zl,kv=function(){try{var t=Dv(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Pv=kv,ho=Pv;function Bv(t,e,r){e=="__proto__"&&ho?ho(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Lv=Bv,Mv=Lv,Ov=Ql,Av=Object.prototype,Rv=Av.hasOwnProperty;function Iv(t,e,r){var a=t[e];(!(Rv.call(t,e)&&Ov(a,r))||r===void 0&&!(e in t))&&Mv(t,e,r)}var Nv=Iv,zv=Nv,Fv=Is,Vv=Jl,go=bi,$v=xi;function qv(t,e,r,a){if(!go(t))return t;e=Fv(e,t);for(var n=-1,i=e.length,o=i-1,s=t;s!=null&&++n<i;){var u=$v(e[n]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(n!=o){var f=s[u];l=a?a(f,u,s):void 0,l===void 0&&(l=go(f)?f:Vv(e[n+1])?[]:{})}zv(s,u,l),s=s[u]}return t}var Hv=qv,Wv=Hv;function Kv(t,e,r){return t==null?t:Wv(t,e,r)}var Gv=Kv;function Yv(t,e){var r=-1,a=t.length;for(e||(e=Array(a));++r<a;)e[r]=t[r];return e}var Xv=Yv,Uv=Os,Zv=Xv,Qv=Sn,Jv=Pa,jv=Ms,_v=xi,ec=Rs;function tc(t){return Qv(t)?Uv(t,_v):Jv(t)?[t]:Zv(jv(ec(t)))}var rc=tc,ac=Ff,nc=$f,ic=Tv,oc=Gv,sc=rc;function Ba(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var Tn=Ba(ac),La=Ba(nc),uc=Ba(ic),lc=Ba(oc),fc=Ba(sc);function We(t){"@babel/helpers - typeof";return We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},We(t)}function Ei(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function po(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function Ci(t,e,r){return e&&po(t.prototype,e),r&&po(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ns(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $t(t,e){return vc(t)||cc(t,e)||dc(t,e)||hc()}function vc(t){if(Array.isArray(t))return t}function cc(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a=[],n=!0,i=!1,o,s;try{for(r=r.call(t);!(n=(o=r.next()).done)&&(a.push(o.value),!(e&&a.length===e));n=!0);}catch(u){i=!0,s=u}finally{try{!n&&r.return!=null&&r.return()}finally{if(i)throw s}}return a}}function dc(t,e){if(t){if(typeof t=="string")return mo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mo(t,e)}}function mo(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function hc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var qe=typeof window>"u"?null:window,yo=qe?qe.navigator:null;qe&&qe.document;var gc=We(""),zs=We({}),pc=We(function(){}),mc=typeof HTMLElement>"u"?"undefined":We(HTMLElement),Ma=function(e){return e&&e.instanceString&&ze(e.instanceString)?e.instanceString():null},fe=function(e){return e!=null&&We(e)==gc},ze=function(e){return e!=null&&We(e)===pc},Ae=function(e){return!ht(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ce=function(e){return e!=null&&We(e)===zs&&!Ae(e)&&e.constructor===Object},yc=function(e){return e!=null&&We(e)===zs},ne=function(e){return e!=null&&We(e)===We(1)&&!isNaN(e)},bc=function(e){return ne(e)&&Math.floor(e)===e},hn=function(e){if(mc!=="undefined")return e!=null&&e instanceof HTMLElement},ht=function(e){return Oa(e)||Fs(e)},Oa=function(e){return Ma(e)==="collection"&&e._private.single},Fs=function(e){return Ma(e)==="collection"&&!e._private.single},Si=function(e){return Ma(e)==="core"},Vs=function(e){return Ma(e)==="stylesheet"},wc=function(e){return Ma(e)==="event"},er=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},xc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Ec=function(e){return Ce(e)&&ne(e.x1)&&ne(e.x2)&&ne(e.y1)&&ne(e.y2)},Cc=function(e){return yc(e)&&ze(e.then)},Sc=function(){return yo&&yo.userAgent.match(/msie|trident|edge/i)},ya=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var a=function n(){var i=this,o=arguments,s,u=r.apply(i,o),l=n.cache;return(s=l[u])||(s=l[u]=e.apply(i,o)),s};return a.cache={},a},Ti=ya(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Dn=ya(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),$s=ya(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),bo=function(e){return er(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},He="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Tc="rgb[a]?\\(("+He+"[%]?)\\s*,\\s*("+He+"[%]?)\\s*,\\s*("+He+"[%]?)(?:\\s*,\\s*("+He+"))?\\)",Dc="rgb[a]?\\((?:"+He+"[%]?)\\s*,\\s*(?:"+He+"[%]?)\\s*,\\s*(?:"+He+"[%]?)(?:\\s*,\\s*(?:"+He+"))?\\)",kc="hsl[a]?\\(("+He+")\\s*,\\s*("+He+"[%])\\s*,\\s*("+He+"[%])(?:\\s*,\\s*("+He+"))?\\)",Pc="hsl[a]?\\((?:"+He+")\\s*,\\s*(?:"+He+"[%])\\s*,\\s*(?:"+He+"[%])(?:\\s*,\\s*(?:"+He+"))?\\)",Bc="\\#[0-9a-fA-F]{3}",Lc="\\#[0-9a-fA-F]{6}",qs=function(e,r){return e<r?-1:e>r?1:0},Mc=function(e,r){return-1*qs(e,r)},ce=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var o=n[i];t[o]=a[o]}}return t},Oc=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,i,o=16;return r?(a=parseInt(e[1]+e[1],o),n=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(a=parseInt(e[1]+e[2],o),n=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[a,n,i]}},Ac=function(e){var r,a,n,i,o,s,u,l;function f(d,p,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?d+(p-d)*6*m:m<1/2?p:m<2/3?d+(p-d)*(2/3-m)*6:d}var v=new RegExp("^"+kc+"$").exec(e);if(v){if(a=parseInt(v[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(v[2]),n<0||n>100||(n=n/100,i=parseFloat(v[3]),i<0||i>100)||(i=i/100,o=v[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(n===0)s=u=l=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;s=Math.round(255*f(h,c,a+1/3)),u=Math.round(255*f(h,c,a)),l=Math.round(255*f(h,c,a-1/3))}r=[s,u,l,o]}return r},Rc=function(e){var r,a=new RegExp("^"+Tc+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var o=a[i];if(o[o.length-1]==="%"&&(n[i]=!0),o=parseFloat(o),n[i]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(s&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;r.push(l)}}return r},Ic=function(e){return zc[e.toLowerCase()]},Nc=function(e){return(Ae(e)?e:null)||Ic(e)||Oc(e)||Rc(e)||Ac(e)},zc={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Hs=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Ce(o))throw Error("Tried to set map with object key");i<a.length-1?(r[o]==null&&(r[o]={}),r=r[o]):r[o]=e.value}},Ws=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Ce(o))throw Error("Tried to get map with object key");if(r=r[o],r==null)return r}return r},Yn=qe?qe.performance:null,Ks=Yn&&Yn.now?function(){return Yn.now()}:function(){return Date.now()},Fc=function(){if(qe){if(qe.requestAnimationFrame)return function(t){qe.requestAnimationFrame(t)};if(qe.mozRequestAnimationFrame)return function(t){qe.mozRequestAnimationFrame(t)};if(qe.webkitRequestAnimationFrame)return function(t){qe.webkitRequestAnimationFrame(t)};if(qe.msRequestAnimationFrame)return function(t){qe.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Ks())},1e3/60)}}(),gn=function(e){return Fc(e)},qt=Ks,Ar=9261,Gs=65599,fa=5381,Ys=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ar,a=r,n;n=e.next(),!n.done;)a=a*Gs+n.value|0;return a},ba=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ar;return r*Gs+e|0},wa=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fa;return(r<<5)+r+e|0},Vc=function(e,r){return e*2097152+r},Ut=function(e){return e[0]*2097152+e[1]},Wa=function(e,r){return[ba(e[0],r[0]),wa(e[1],r[1])]},$c=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return Ys(o,r)},hr=function(e,r){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return Ys(o,r)},Xs=function(){return qc(arguments)},qc=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=hr(n):r=hr(n,r)}return r},wo=!0,Hc=console.warn!=null,Wc=console.trace!=null,Di=Number.MAX_SAFE_INTEGER||9007199254740991,Us=function(){return!0},pn=function(){return!1},xo=function(){return 0},ki=function(){},Ve=function(e){throw new Error(e)},Zs=function(e){if(e!==void 0)wo=!!e;else return wo},Le=function(e){Zs()&&(Hc?console.warn(e):(console.log(e),Wc&&console.trace()))},Kc=function(e){return ce({},e)},Ot=function(e){return e==null?e:Ae(e)?e.slice():Ce(e)?Kc(e):e},Gc=function(e){return e.slice()},Qs=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},Yc={},Js=function(){return Yc},Je=function(e){var r=Object.keys(e);return function(a){for(var n={},i=0;i<r.length;i++){var o=r[i],s=a==null?void 0:a[o];n[o]=s===void 0?e[o]:s}return n}},tr=function(e,r,a){for(var n=e.length-1;n>=0&&!(e[n]===r&&(e.splice(n,1),a));n--);},Pi=function(e){e.splice(0,e.length)},Xc=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},Bt=function(e,r,a){return a&&(r=$s(a,r)),e[r]},Qt=function(e,r,a,n){a&&(r=$s(a,r)),e[r]=n},Uc=function(){function t(){Ei(this,t),this._obj={}}return Ci(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t}(),At=typeof Map<"u"?Map:Uc,Zc="undefined",Qc=function(){function t(e){if(Ei(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return Ci(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;a[r]!==1&&(a[r]=1,this.size++)}},{key:"delete",value:function(r){var a=this._obj;a[r]===1&&(a[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}]),t}(),Ur=(typeof Set>"u"?"undefined":We(Set))!==Zc?Set:Qc,kn=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!Si(e)){Ve("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){Ve("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new Ur,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var o=r.renderedPosition,s=e.pan(),u=e.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];Ae(r.classes)?l=r.classes:fe(r.classes)&&(l=r.classes.split(/\s+/));for(var f=0,v=l.length;f<v;f++){var c=l[f];!c||c===""||i.classes.add(c)}this.createEmitter();var h=r.style||r.css;h&&(Le("Setting a `style` bypass at element creation should be done only when absolutely necessary.  Try to use the stylesheet instead."),this.style(h)),(a===void 0||a)&&this.restore()},Eo=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var o;Ce(a)&&!ht(a)&&(o=a,a=o.roots||o.root,n=o.visit,i=o.directed),i=arguments.length===2&&!ze(n)?n:i,n=ze(n)?n:function(){};for(var s=this._private.cy,u=a=fe(a)?this.filter(a):a,l=[],f=[],v={},c={},h={},d=0,p,m=this.byGroup(),g=m.nodes,y=m.edges,b=0;b<u.length;b++){var w=u[b],S=w.id();w.isNode()&&(l.unshift(w),e.bfs&&(h[S]=!0,f.push(w)),c[S]=0)}for(var C=function(){var M=e.bfs?l.shift():l.pop(),L=M.id();if(e.dfs){if(h[L])return"continue";h[L]=!0,f.push(M)}var R=c[L],O=v[L],A=O!=null?O.source():null,N=O!=null?O.target():null,F=O==null?void 0:M.same(A)?N[0]:A[0],q=void 0;if(q=n(M,O,F,d++,R),q===!0)return p=M,"break";if(q===!1)return"break";for(var z=M.connectedEdges().filter(function(W){return(!i||W.source().same(M))&&y.has(W)}),$=0;$<z.length;$++){var K=z[$],Y=K.connectedNodes().filter(function(W){return!W.same(M)&&g.has(W)}),H=Y.id();Y.length!==0&&!h[H]&&(Y=Y[0],l.push(Y),e.bfs&&(h[H]=!0,f.push(Y)),v[H]=K,c[H]=c[L]+1)}};l.length!==0;){var x=C();if(x!=="continue"&&x==="break")break}for(var T=s.collection(),E=0;E<f.length;E++){var P=f[E],B=v[P.id()];B!=null&&T.push(B),T.push(P)}return{path:s.collection(T),found:s.collection(p)}}},xa={breadthFirstSearch:Eo({bfs:!0}),depthFirstSearch:Eo({dfs:!0})};xa.bfs=xa.breadthFirstSearch;xa.dfs=xa.depthFirstSearch;var Jc=Je({root:null,weight:function(e){return 1},directed:!1}),jc={dijkstra:function(e){if(!Ce(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=Jc(e),n=a.root,i=a.weight,o=a.directed,s=this,u=i,l=fe(n)?this.filter(n)[0]:n[0],f={},v={},c={},h=this.byGroup(),d=h.nodes,p=h.edges;p.unmergeBy(function(R){return R.isLoop()});for(var m=function(O){return f[O.id()]},g=function(O,A){f[O.id()]=A,y.updateItem(O)},y=new La.default(function(R,O){return m(R)-m(O)}),b=0;b<d.length;b++){var w=d[b];f[w.id()]=w.same(l)?0:1/0,y.push(w)}for(var S=function(O,A){for(var N=(o?O.edgesTo(A):O.edgesWith(A)).intersect(p),F=1/0,q,z=0;z<N.length;z++){var $=N[z],K=u($);(K<F||!q)&&(F=K,q=$)}return{edge:q,dist:F}};y.size()>0;){var C=y.pop(),x=m(C),T=C.id();if(c[T]=x,x!==1/0)for(var E=C.neighborhood().intersect(d),P=0;P<E.length;P++){var B=E[P],D=B.id(),M=S(C,B),L=x+M.dist;L<m(B)&&(g(B,L),v[D]={node:C,edge:M.edge})}}return{distanceTo:function(O){var A=fe(O)?d.filter(O)[0]:O[0];return c[A.id()]},pathTo:function(O){var A=fe(O)?d.filter(O)[0]:O[0],N=[],F=A,q=F.id();if(A.length>0)for(N.unshift(A);v[q];){var z=v[q];N.unshift(z.edge),N.unshift(z.node),F=z.node,q=F.id()}return s.spawn(N)}}}},_c={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,o=new Array(i),s=a,u=function(w){for(var S=0;S<o.length;S++){var C=o[S];if(C.has(w))return S}},l=0;l<i;l++)o[l]=this.spawn(a[l]);for(var f=n.sort(function(b,w){return e(b)-e(w)}),v=0;v<f.length;v++){var c=f[v],h=c.source()[0],d=c.target()[0],p=u(h),m=u(d),g=o[p],y=o[m];p!==m&&(s.merge(c),g.merge(y),o.splice(m,1))}return s}},ed=Je({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),td={aStar:function(e){var r=this.cy(),a=ed(e),n=a.root,i=a.goal,o=a.heuristic,s=a.directed,u=a.weight;n=r.collection(n)[0],i=r.collection(i)[0];var l=n.id(),f=i.id(),v={},c={},h={},d=new La.default(function(q,z){return c[q.id()]-c[z.id()]}),p=new Ur,m={},g={},y=function(z,$){d.push(z),p.add($)},b,w,S=function(){b=d.pop(),w=b.id(),p.delete(w)},C=function(z){return p.has(z)};y(n,l),v[l]=0,c[l]=o(n);for(var x=0;d.size()>0;){if(S(),x++,w===f){for(var T=[],E=i,P=f,B=g[P];T.unshift(E),B!=null&&T.unshift(B),E=m[P],E!=null;)P=E.id(),B=g[P];return{found:!0,distance:v[w],path:this.spawn(T),steps:x}}h[w]=!0;for(var D=b._private.edges,M=0;M<D.length;M++){var L=D[M];if(this.hasElementWithId(L.id())&&!(s&&L.data("source")!==w)){var R=L.source(),O=L.target(),A=R.id()!==w?R:O,N=A.id();if(this.hasElementWithId(N)&&!h[N]){var F=v[w]+u(L);if(!C(N)){v[N]=F,c[N]=F+o(A),y(A,N),m[N]=b,g[N]=L;continue}F<v[N]&&(v[N]=F,c[N]=F+o(A),m[N]=b,g[N]=L)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},rd=Je({weight:function(e){return 1},directed:!1}),ad={floydWarshall:function(e){for(var r=this.cy(),a=rd(e),n=a.weight,i=a.directed,o=n,s=this.byGroup(),u=s.nodes,l=s.edges,f=u.length,v=f*f,c=function(K){return u.indexOf(K)},h=function(K){return u[K]},d=new Array(v),p=0;p<v;p++){var m=p%f,g=(p-m)/f;g===m?d[p]=0:d[p]=1/0}for(var y=new Array(v),b=new Array(v),w=0;w<l.length;w++){var S=l[w],C=S.source()[0],x=S.target()[0];if(C!==x){var T=c(C),E=c(x),P=T*f+E,B=o(S);if(d[P]>B&&(d[P]=B,y[P]=E,b[P]=S),!i){var D=E*f+T;!i&&d[D]>B&&(d[D]=B,y[D]=T,b[D]=S)}}}for(var M=0;M<f;M++)for(var L=0;L<f;L++)for(var R=L*f+M,O=0;O<f;O++){var A=L*f+O,N=M*f+O;d[R]+d[N]<d[A]&&(d[A]=d[R]+d[N],y[A]=y[R])}var F=function(K){return(fe(K)?r.filter(K):K)[0]},q=function(K){return c(F(K))},z={distance:function(K,Y){var H=q(K),W=q(Y);return d[H*f+W]},path:function(K,Y){var H=q(K),W=q(Y),I=h(H);if(H===W)return I.collection();if(y[H*f+W]==null)return r.collection();var G=r.collection(),Z=H,_;for(G.merge(I);H!==W;)Z=H,H=y[H*f+W],_=b[Z*f+H],G.merge(_),G.merge(h(H));return G}};return z}},nd=Je({weight:function(e){return 1},directed:!1,root:null}),id={bellmanFord:function(e){var r=this,a=nd(e),n=a.weight,i=a.directed,o=a.root,s=n,u=this,l=this.cy(),f=this.byGroup(),v=f.edges,c=f.nodes,h=c.length,d=new At,p=!1,m=[];o=l.collection(o)[0],v.unmergeBy(function(ie){return ie.isLoop()});for(var g=v.length,y=function(ae){var ue=d.get(ae.id());return ue||(ue={},d.set(ae.id(),ue)),ue},b=function(ae){return(fe(ae)?l.$(ae):ae)[0]},w=function(ae){return y(b(ae)).dist},S=function(ae){for(var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,ge=b(ae),pe=[],ve=ge;;){if(ve==null)return r.spawn();var xe=y(ve),Q=xe.edge,k=xe.pred;if(pe.unshift(ve[0]),ve.same(ue)&&pe.length>0)break;Q!=null&&pe.unshift(Q),ve=k}return u.spawn(pe)},C=0;C<h;C++){var x=c[C],T=y(x);x.same(o)?T.dist=0:T.dist=1/0,T.pred=null,T.edge=null}for(var E=!1,P=function(ae,ue,ge,pe,ve,xe){var Q=pe.dist+xe;Q<ve.dist&&!ge.same(pe.edge)&&(ve.dist=Q,ve.pred=ae,ve.edge=ge,E=!0)},B=1;B<h;B++){E=!1;for(var D=0;D<g;D++){var M=v[D],L=M.source(),R=M.target(),O=s(M),A=y(L),N=y(R);P(L,R,M,A,N,O),i||P(R,L,M,N,A,O)}if(!E)break}if(E)for(var F=[],q=0;q<g;q++){var z=v[q],$=z.source(),K=z.target(),Y=s(z),H=y($).dist,W=y(K).dist;if(H+Y<W||!i&&W+Y<H)if(p||(Le("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var I=[];H+Y<W&&I.push($),!i&&W+Y<H&&I.push(K);for(var G=I.length,Z=0;Z<G;Z++){var _=I[Z],ee=[_];ee.push(y(_).edge);for(var de=y(_).pred;ee.indexOf(de)===-1;)ee.push(de),ee.push(y(de).edge),de=y(de).pred;ee=ee.slice(ee.indexOf(de));for(var he=ee[0].id(),re=0,te=2;te<ee.length;te+=2)ee[te].id()<he&&(he=ee[te].id(),re=te);ee=ee.slice(re).concat(ee.slice(0,re)),ee.push(ee[0]);var se=ee.map(function(ie){return ie.id()}).join(",");F.indexOf(se)===-1&&(m.push(u.spawn(ee)),F.push(se))}}else break}return{distanceTo:w,pathTo:S,hasNegativeWeightCycle:p,negativeWeightCycles:m}}},od=Math.sqrt(2),sd=function(e,r,a){a.length===0&&Ve("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],o=n[2],s=r[i],u=r[o],l=a,f=l.length-1;f>=0;f--){var v=l[f],c=v[1],h=v[2];(r[c]===s&&r[h]===u||r[c]===u&&r[h]===s)&&l.splice(f,1)}for(var d=0;d<l.length;d++){var p=l[d];p[1]===u?(l[d]=p.slice(),l[d][1]=s):p[2]===u&&(l[d]=p.slice(),l[d][2]=s)}for(var m=0;m<r.length;m++)r[m]===u&&(r[m]=s);return l},Xn=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=sd(i,e,r),a--}return r},ud={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(N){return N.isLoop()});var i=a.length,o=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/od);if(i<2){Ve("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<o;f++){var v=n[f];l.push([f,a.indexOf(v.source()),a.indexOf(v.target())])}for(var c=1/0,h=[],d=new Array(i),p=new Array(i),m=new Array(i),g=function(F,q){for(var z=0;z<i;z++)q[z]=F[z]},y=0;y<=s;y++){for(var b=0;b<i;b++)p[b]=b;var w=Xn(p,l.slice(),i,u),S=w.slice();g(p,m);var C=Xn(p,w,u,2),x=Xn(m,S,u,2);C.length<=x.length&&C.length<c?(c=C.length,h=C,g(p,d)):x.length<=C.length&&x.length<c&&(c=x.length,h=x,g(m,d))}for(var T=this.spawn(h.map(function(N){return n[N[0]]})),E=this.spawn(),P=this.spawn(),B=d[0],D=0;D<d.length;D++){var M=d[D],L=a[D];M===B?E.merge(L):P.merge(L)}var R=function(F){var q=e.spawn();return F.forEach(function(z){q.merge(z),z.connectedEdges().forEach(function($){e.contains($)&&!T.contains($)&&q.merge($)})}),q},O=[R(E),R(P)],A={cut:T,components:O,partition1:E,partition2:P};return A}},ld=function(e){return{x:e.x,y:e.y}},Pn=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},js=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},Rr=function(e){return{x:e[0],y:e[1]}},fd=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.min(o,n))}return n},vd=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.max(o,n))}return n},cd=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,o=r;o<a;o++){var s=e[o];isFinite(s)&&(n+=s,i++)}return n/i},dd=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a<e.length&&e.splice(a,e.length-a),r>0&&e.splice(0,r));for(var s=0,u=e.length-1;u>=0;u--){var l=e[u];o?isFinite(l)||(e[u]=-1/0,s++):e.splice(u,1)}i&&e.sort(function(c,h){return c-h});var f=e.length,v=Math.floor(f/2);return f%2!==0?e[v+1+s]:(e[v-1+s]+e[v+s])/2},hd=function(e){return Math.PI*e/180},Ka=function(e,r){return Math.atan2(r,e)-Math.PI/2},Bi=Math.log2||function(t){return Math.log(t)/Math.log(2)},_s=function(e){return e>0?1:e<0?-1:0},gr=function(e,r){return Math.sqrt(fr(e,r))},fr=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},gd=function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},Ge=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},Nr=function(e,r,a,n){return{x:Ge(e.x,r.x,a.x,n),y:Ge(e.y,r.y,a.y,n)}},pd=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},o=gr(e,r),s={x:i.x/o,y:i.y/o};return a=a??0,n=n??a*o,{x:e.x+s.x*n,y:e.y+s.y*n}},Ea=function(e,r,a){return Math.max(e,Math.min(a,r))},ct=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},md=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},yd=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},bd=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},wd=function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},on=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Un=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,o;if(r.length===1)a=n=i=o=r[0];else if(r.length===2)a=i=r[0],o=n=r[1];else if(r.length===4){var s=$t(r,4);a=s[0],n=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Co=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Li=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},$r=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},xd=function(e,r){return $r(e,r.x,r.y)},eu=function(e,r){return $r(e,r.x1,r.y1)&&$r(e,r.x2,r.y2)},tu=function(e,r,a,n,i,o,s){var u=Aa(i,o),l=i/2,f=o/2,v;{var c=a-l+u-s,h=n-f-s,d=a+l-u+s,p=h;if(v=Jt(e,r,a,n,c,h,d,p,!1),v.length>0)return v}{var m=a+l+s,g=n-f+u-s,y=m,b=n+f-u+s;if(v=Jt(e,r,a,n,m,g,y,b,!1),v.length>0)return v}{var w=a-l+u-s,S=n+f+s,C=a+l-u+s,x=S;if(v=Jt(e,r,a,n,w,S,C,x,!1),v.length>0)return v}{var T=a-l-s,E=n-f+u-s,P=T,B=n+f-u+s;if(v=Jt(e,r,a,n,T,E,P,B,!1),v.length>0)return v}var D;{var M=a-l+u,L=n-f+u;if(D=va(e,r,a,n,M,L,u+s),D.length>0&&D[0]<=M&&D[1]<=L)return[D[0],D[1]]}{var R=a+l-u,O=n-f+u;if(D=va(e,r,a,n,R,O,u+s),D.length>0&&D[0]>=R&&D[1]<=O)return[D[0],D[1]]}{var A=a+l-u,N=n+f-u;if(D=va(e,r,a,n,A,N,u+s),D.length>0&&D[0]>=A&&D[1]>=N)return[D[0],D[1]]}{var F=a-l+u,q=n+f-u;if(D=va(e,r,a,n,F,q,u+s),D.length>0&&D[0]<=F&&D[1]>=q)return[D[0],D[1]]}return[]},Ed=function(e,r,a,n,i,o,s){var u=s,l=Math.min(a,i),f=Math.max(a,i),v=Math.min(n,o),c=Math.max(n,o);return l-u<=e&&e<=f+u&&v-u<=r&&r<=c+u},Cd=function(e,r,a,n,i,o,s,u,l){var f={x1:Math.min(a,s,i)-l,x2:Math.max(a,s,i)+l,y1:Math.min(n,u,o)-l,y2:Math.max(n,u,o)+l};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},Sd=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var o=Math.sqrt(i),s=2*e,u=(-r+o)/s,l=(-r-o)/s;return[u,l]},Td=function(e,r,a,n,i){var o=1e-5;e===0&&(e=o),r/=e,a/=e,n/=e;var s,u,l,f,v,c,h,d;if(u=(3*a-r*r)/9,l=-(27*n)+r*(9*a-2*(r*r)),l/=54,s=u*u*u+l*l,i[1]=0,h=r/3,s>0){v=l+Math.sqrt(s),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),c=l-Math.sqrt(s),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+v+c,h+=(v+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+v)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,s===0){d=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-h+2*d,i[4]=i[2]=-(d+h);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),d=2*Math.sqrt(u),i[0]=-h+d*Math.cos(f/3),i[2]=-h+d*Math.cos((f+2*Math.PI)/3),i[4]=-h+d*Math.cos((f+4*Math.PI)/3)},Dd=function(e,r,a,n,i,o,s,u){var l=1*a*a-4*a*i+2*a*s+4*i*i-4*i*s+s*s+n*n-4*n*o+2*n*u+4*o*o-4*o*u+u*u,f=1*9*a*i-3*a*a-3*a*s-6*i*i+3*i*s+9*n*o-3*n*n-3*n*u-6*o*o+3*o*u,v=1*3*a*a-6*a*i+a*s-a*e+2*i*i+2*i*e-s*e+3*n*n-6*n*o+n*u-n*r+2*o*o+2*o*r-u*r,c=1*a*i-a*a+a*e-i*e+n*o-n*n+n*r-o*r,h=[];Td(l,f,v,c,h);for(var d=1e-7,p=[],m=0;m<6;m+=2)Math.abs(h[m+1])<d&&h[m]>=0&&h[m]<=1&&p.push(h[m]);p.push(1),p.push(0);for(var g=-1,y,b,w,S=0;S<p.length;S++)y=Math.pow(1-p[S],2)*a+2*(1-p[S])*p[S]*i+p[S]*p[S]*s,b=Math.pow(1-p[S],2)*n+2*(1-p[S])*p[S]*o+p[S]*p[S]*u,w=Math.pow(y-e,2)+Math.pow(b-r,2),g>=0?w<g&&(g=w):g=w;return g},kd=function(e,r,a,n,i,o){var s=[e-a,r-n],u=[i-a,o-n],l=u[0]*u[0]+u[1]*u[1],f=s[0]*s[0]+s[1]*s[1],v=s[0]*u[0]+s[1]*u[1],c=v*v/l;return v<0?f:c>l?(e-i)*(e-i)+(r-o)*(r-o):f-c},vt=function(e,r,a){for(var n,i,o,s,u,l=0,f=0;f<a.length/2;f++)if(n=a[f*2],i=a[f*2+1],f+1<a.length/2?(o=a[(f+1)*2],s=a[(f+1)*2+1]):(o=a[(f+1-a.length/2)*2],s=a[(f+1-a.length/2)*2+1]),!(n==e&&o==e))if(n>=e&&e>=o||n<=e&&e<=o)u=(e-n)/(o-n)*(s-i)+i,u>r&&l++;else continue;return l%2!==0},Ht=function(e,r,a,n,i,o,s,u,l){var f=new Array(a.length),v;u[0]!=null?(v=Math.atan(u[1]/u[0]),u[0]<0?v=v+Math.PI/2:v=-v-Math.PI/2):v=u;for(var c=Math.cos(-v),h=Math.sin(-v),d=0;d<f.length/2;d++)f[d*2]=o/2*(a[d*2]*c-a[d*2+1]*h),f[d*2+1]=s/2*(a[d*2+1]*c+a[d*2]*h),f[d*2]+=n,f[d*2+1]+=i;var p;if(l>0){var m=au(f,-l);p=ru(m)}else p=f;return vt(e,r,p)},Pd=function(e,r,a,n,i,o,s){for(var u=new Array(a.length),l=o/2,f=s/2,v=Mi(o,s),c=v*v,h=0;h<a.length/4;h++){var d=void 0,p=void 0;h===0?d=a.length-2:d=h*4-2,p=h*4+2;var m=n+l*a[h*4],g=i+f*a[h*4+1],y=-a[d]*a[p]-a[d+1]*a[p+1],b=v/Math.tan(Math.acos(y)/2),w=m-b*a[d],S=g-b*a[d+1],C=m+b*a[p],x=g+b*a[p+1];u[h*4]=w,u[h*4+1]=S,u[h*4+2]=C,u[h*4+3]=x;var T=a[d+1],E=-a[d],P=T*a[p]+E*a[p+1];P<0&&(T*=-1,E*=-1);var B=w+T*v,D=S+E*v,M=Math.pow(B-e,2)+Math.pow(D-r,2);if(M<=c)return!0}return vt(e,r,u)},ru=function(e){for(var r=new Array(e.length/2),a,n,i,o,s,u,l,f,v=0;v<e.length/4;v++){a=e[v*4],n=e[v*4+1],i=e[v*4+2],o=e[v*4+3],v<e.length/4-1?(s=e[(v+1)*4],u=e[(v+1)*4+1],l=e[(v+1)*4+2],f=e[(v+1)*4+3]):(s=e[0],u=e[1],l=e[2],f=e[3]);var c=Jt(a,n,i,o,s,u,l,f,!0);r[v*2]=c[0],r[v*2+1]=c[1]}return r},au=function(e,r){for(var a=new Array(e.length*2),n,i,o,s,u=0;u<e.length/2;u++){n=e[u*2],i=e[u*2+1],u<e.length/2-1?(o=e[(u+1)*2],s=e[(u+1)*2+1]):(o=e[0],s=e[1]);var l=s-i,f=-(o-n),v=Math.sqrt(l*l+f*f),c=l/v,h=f/v;a[u*4]=n+c*r,a[u*4+1]=i+h*r,a[u*4+2]=o+c*r,a[u*4+3]=s+h*r}return a},Bd=function(e,r,a,n,i,o){var s=a-e,u=n-r;s/=i,u/=o;var l=Math.sqrt(s*s+u*u),f=l-1;if(f<0)return[];var v=f/l;return[(a-e)*v+e,(n-r)*v+r]},cr=function(e,r,a,n,i,o,s){return e-=i,r-=o,e/=a/2+s,r/=n/2+s,e*e+r*r<=1},va=function(e,r,a,n,i,o,s){var u=[a-e,n-r],l=[e-i,r-o],f=u[0]*u[0]+u[1]*u[1],v=2*(l[0]*u[0]+l[1]*u[1]),c=l[0]*l[0]+l[1]*l[1]-s*s,h=v*v-4*f*c;if(h<0)return[];var d=(-v+Math.sqrt(h))/(2*f),p=(-v-Math.sqrt(h))/(2*f),m=Math.min(d,p),g=Math.max(d,p),y=[];if(m>=0&&m<=1&&y.push(m),g>=0&&g<=1&&y.push(g),y.length===0)return[];var b=y[0]*u[0]+e,w=y[0]*u[1]+r;if(y.length>1){if(y[0]==y[1])return[b,w];var S=y[1]*u[0]+e,C=y[1]*u[1]+r;return[b,w,S,C]}else return[b,w]},Zn=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},Jt=function(e,r,a,n,i,o,s,u,l){var f=e-i,v=a-e,c=s-i,h=r-o,d=n-r,p=u-o,m=c*h-p*f,g=v*h-d*f,y=p*v-c*d;if(y!==0){var b=m/y,w=g/y,S=.001,C=0-S,x=1+S;return C<=b&&b<=x&&C<=w&&w<=x?[e+b*v,r+b*d]:l?[e+b*v,r+b*d]:[]}else return m===0||g===0?Zn(e,a,s)===s?[s,u]:Zn(e,a,i)===i?[i,o]:Zn(i,s,a)===a?[a,n]:[]:[]},Ca=function(e,r,a,n,i,o,s,u){var l=[],f,v=new Array(a.length),c=!0;o==null&&(c=!1);var h;if(c){for(var d=0;d<v.length/2;d++)v[d*2]=a[d*2]*o+n,v[d*2+1]=a[d*2+1]*s+i;if(u>0){var p=au(v,-u);h=ru(p)}else h=v}else h=a;for(var m,g,y,b,w=0;w<h.length/2;w++)m=h[w*2],g=h[w*2+1],w<h.length/2-1?(y=h[(w+1)*2],b=h[(w+1)*2+1]):(y=h[0],b=h[1]),f=Jt(e,r,n,i,m,g,y,b),f.length!==0&&l.push(f[0],f[1]);return l},Ld=function(e,r,a,n,i,o,s,u){for(var l=[],f,v=new Array(a.length),c=o/2,h=s/2,d=Mi(o,s),p=0;p<a.length/4;p++){var m=void 0,g=void 0;p===0?m=a.length-2:m=p*4-2,g=p*4+2;var y=n+c*a[p*4],b=i+h*a[p*4+1],w=-a[m]*a[g]-a[m+1]*a[g+1],S=d/Math.tan(Math.acos(w)/2),C=y-S*a[m],x=b-S*a[m+1],T=y+S*a[g],E=b+S*a[g+1];p===0?(v[a.length-2]=C,v[a.length-1]=x):(v[p*4-2]=C,v[p*4-1]=x),v[p*4]=T,v[p*4+1]=E;var P=a[m+1],B=-a[m],D=P*a[g]+B*a[g+1];D<0&&(P*=-1,B*=-1);var M=C+P*d,L=x+B*d;f=va(e,r,n,i,M,L,d),f.length!==0&&l.push(f[0],f[1])}for(var R=0;R<v.length/4;R++)f=Jt(e,r,n,i,v[R*4],v[R*4+1],v[R*4+2],v[R*4+3],!1),f.length!==0&&l.push(f[0],f[1]);if(l.length>2){for(var O=[l[0],l[1]],A=Math.pow(O[0]-e,2)+Math.pow(O[1]-r,2),N=1;N<l.length/2;N++){var F=Math.pow(l[N*2]-e,2)+Math.pow(l[N*2+1]-r,2);F<=A&&(O[0]=l[N*2],O[1]=l[N*2+1],A=F)}return O}return l},Ga=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),o=(i-a)/i;return o<0&&(o=1e-5),[r[0]+o*n[0],r[1]+o*n[1]]},it=function(e,r){var a=ni(e,r);return a=nu(a),a},nu=function(e){for(var r,a,n=e.length/2,i=1/0,o=1/0,s=-1/0,u=-1/0,l=0;l<n;l++)r=e[2*l],a=e[2*l+1],i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);for(var f=2/(s-i),v=2/(u-o),c=0;c<n;c++)r=e[2*c]=e[2*c]*f,a=e[2*c+1]=e[2*c+1]*v,i=Math.min(i,r),s=Math.max(s,r),o=Math.min(o,a),u=Math.max(u,a);if(o<-1)for(var h=0;h<n;h++)a=e[2*h+1]=e[2*h+1]+(-1-o);return e},ni=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*a+n,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Aa=function(e,r){return Math.min(e/4,r/4,8)},Mi=function(e,r){return Math.min(e/10,r/10,8)},iu=function(){return 8},Md=function(e,r,a){return[e-2*r+a,2*(r-e),e]},ii=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Od=Je({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Ad={pageRank:function(e){for(var r=Od(e),a=r.dampingFactor,n=r.precision,i=r.iterations,o=r.weight,s=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,v=l.length,c=v*v,h=f.length,d=new Array(c),p=new Array(v),m=(1-a)/v,g=0;g<v;g++){for(var y=0;y<v;y++){var b=g*v+y;d[b]=0}p[g]=0}for(var w=0;w<h;w++){var S=f[w],C=S.data("source"),x=S.data("target");if(C!==x){var T=l.indexOfId(C),E=l.indexOfId(x),P=o(S),B=E*v+T;d[B]+=P,p[T]+=P}}for(var D=1/v+m,M=0;M<v;M++)if(p[M]===0)for(var L=0;L<v;L++){var R=L*v+M;d[R]=D}else for(var O=0;O<v;O++){var A=O*v+M;d[A]=d[A]/p[M]+m}for(var N=new Array(v),F=new Array(v),q,z=0;z<v;z++)N[z]=1;for(var $=0;$<i;$++){for(var K=0;K<v;K++)F[K]=0;for(var Y=0;Y<v;Y++)for(var H=0;H<v;H++){var W=Y*v+H;F[Y]+=d[W]*N[H]}gd(F),q=N,N=F,F=q;for(var I=0,G=0;G<v;G++){var Z=q[G]-N[G];I+=Z*Z}if(I<n)break}var _={rank:function(de){return de=s.collection(de)[0],N[l.indexOf(de)]}};return _}},So=Je({root:null,weight:function(e){return 1},directed:!1,alpha:0}),zr={degreeCentralityNormalized:function(e){e=So(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},v={},c=0,h=0,d=0;d<n;d++){var p=a[d],m=p.id();e.root=p;var g=this.degreeCentrality(e);c<g.indegree&&(c=g.indegree),h<g.outdegree&&(h=g.outdegree),f[m]=g.indegree,v[m]=g.outdegree}return{indegree:function(b){return c==0?0:(fe(b)&&(b=r.filter(b)),f[b.id()]/c)},outdegree:function(b){return h===0?0:(fe(b)&&(b=r.filter(b)),v[b.id()]/h)}}}else{for(var i={},o=0,s=0;s<n;s++){var u=a[s];e.root=u;var l=this.degreeCentrality(e);o<l.degree&&(o=l.degree),i[u.id()]=l.degree}return{degree:function(b){return o===0?0:(fe(b)&&(b=r.filter(b)),i[b.id()]/o)}}}},degreeCentrality:function(e){e=So(e);var r=this.cy(),a=this,n=e,i=n.root,o=n.weight,s=n.directed,u=n.alpha;if(i=r.collection(i)[0],s){for(var h=i.connectedEdges(),d=h.filter(function(C){return C.target().same(i)&&a.has(C)}),p=h.filter(function(C){return C.source().same(i)&&a.has(C)}),m=d.length,g=p.length,y=0,b=0,w=0;w<d.length;w++)y+=o(d[w]);for(var S=0;S<p.length;S++)b+=o(p[S]);return{indegree:Math.pow(m,1-u)*Math.pow(y,u),outdegree:Math.pow(g,1-u)*Math.pow(b,u)}}else{for(var l=i.connectedEdges().intersection(a),f=l.length,v=0,c=0;c<l.length;c++)v+=o(l[c]);return{degree:Math.pow(f,1-u)*Math.pow(v,u)}}}};zr.dc=zr.degreeCentrality;zr.dcn=zr.degreeCentralityNormalised=zr.degreeCentralityNormalized;var To=Je({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Fr={closenessCentralityNormalized:function(e){for(var r=To(e),a=r.harmonic,n=r.weight,i=r.directed,o=this.cy(),s={},u=0,l=this.nodes(),f=this.floydWarshall({weight:n,directed:i}),v=0;v<l.length;v++){for(var c=0,h=l[v],d=0;d<l.length;d++)if(v!==d){var p=f.distance(h,l[d]);a?c+=1/p:c+=p}a||(c=1/c),u<c&&(u=c),s[h.id()]=c}return{closeness:function(g){return u==0?0:(fe(g)?g=o.filter(g)[0].id():g=g.id(),s[g]/u)}}},closenessCentrality:function(e){var r=To(e),a=r.root,n=r.weight,i=r.directed,o=r.harmonic;a=this.filter(a)[0];for(var s=this.dijkstra({root:a,weight:n,directed:i}),u=0,l=this.nodes(),f=0;f<l.length;f++){var v=l[f];if(!v.same(a)){var c=s.distanceTo(v);o?u+=1/c:u+=c}}return o?u:1/u}};Fr.cc=Fr.closenessCentrality;Fr.ccn=Fr.closenessCentralityNormalised=Fr.closenessCentralityNormalized;var Rd=Je({weight:null,directed:!1}),oi={betweennessCentrality:function(e){for(var r=Rd(e),a=r.directed,n=r.weight,i=n!=null,o=this.cy(),s=this.nodes(),u={},l={},f=0,v={set:function(b,w){l[b]=w,w>f&&(f=w)},get:function(b){return l[b]}},c=0;c<s.length;c++){var h=s[c],d=h.id();a?u[d]=h.outgoers().nodes():u[d]=h.openNeighborhood().nodes(),v.set(d,0)}for(var p=function(b){for(var w=s[b].id(),S=[],C={},x={},T={},E=new La.default(function(H,W){return T[H]-T[W]}),P=0;P<s.length;P++){var B=s[P].id();C[B]=[],x[B]=0,T[B]=1/0}for(x[w]=1,T[w]=0,E.push(w);!E.empty();){var D=E.pop();if(S.push(D),i)for(var M=0;M<u[D].length;M++){var L=u[D][M],R=o.getElementById(D),O=void 0;R.edgesTo(L).length>0?O=R.edgesTo(L)[0]:O=L.edgesTo(R)[0];var A=n(O);L=L.id(),T[L]>T[D]+A&&(T[L]=T[D]+A,E.nodes.indexOf(L)<0?E.push(L):E.updateItem(L),x[L]=0,C[L]=[]),T[L]==T[D]+A&&(x[L]=x[L]+x[D],C[L].push(D))}else for(var N=0;N<u[D].length;N++){var F=u[D][N].id();T[F]==1/0&&(E.push(F),T[F]=T[D]+1),T[F]==T[D]+1&&(x[F]=x[F]+x[D],C[F].push(D))}}for(var q={},z=0;z<s.length;z++)q[s[z].id()]=0;for(;S.length>0;){for(var $=S.pop(),K=0;K<C[$].length;K++){var Y=C[$][K];q[Y]=q[Y]+x[Y]/x[$]*(1+q[$])}$!=s[b].id()&&v.set($,v.get($)+q[$])}},m=0;m<s.length;m++)p(m);var g={betweenness:function(b){var w=o.collection(b).id();return v.get(w)},betweennessNormalized:function(b){if(f==0)return 0;var w=o.collection(b).id();return v.get(w)/f}};return g.betweennessNormalised=g.betweennessNormalized,g}};oi.bc=oi.betweennessCentrality;var Id=Je({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),Nd=function(e){return Id(e)},zd=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},Fd=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},ou=function(e,r){for(var a,n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var o=0;o<r;o++)e[o*r+n]=e[o*r+n]/a}},Vd=function(e,r,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var o=0;o<a;o++)n[i*a+o]=0;for(var s=0;s<a;s++)for(var u=0;u<a;u++)n[i*a+u]+=e[i*a+s]*r[s*a+u]}return n},$d=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=Vd(e,n,r);return e},qd=function(e,r,a){for(var n=new Array(r*r),i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return ou(n,r),n},Hd=function(e,r,a,n){for(var i=0;i<a;i++){var o=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),s=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(o!==s)return!1}return!0},Wd=function(e,r,a,n){for(var i=[],o=0;o<r;o++){for(var s=[],u=0;u<r;u++)Math.round(e[o*r+u]*1e3)/1e3>0&&s.push(a[u]);s.length!==0&&i.push(n.collection(s))}return i},Kd=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},Gd=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&Kd(e[r],e[a])&&e.splice(a,1);return e},Do=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=Nd(e),o={},s=0;s<r.length;s++)o[r[s].id()]=s;for(var u=r.length,l=u*u,f=new Array(l),v,c=0;c<l;c++)f[c]=0;for(var h=0;h<a.length;h++){var d=a[h],p=o[d.source().id()],m=o[d.target().id()],g=zd(d,i.attributes);f[p*u+m]+=g,f[m*u+p]+=g}Fd(f,u,i.multFactor),ou(f,u);for(var y=!0,b=0;y&&b<i.maxIterations;)y=!1,v=$d(f,u,i.expandFactor),f=qd(v,u,i.inflateFactor),Hd(f,v,l,4)||(y=!0),b++;var w=Wd(f,u,r,n);return w=Gd(w),w},Yd={markovClustering:Do,mcl:Do},Xd=function(e){return e},su=function(e,r){return Math.abs(r-e)},ko=function(e,r,a){return e+su(r,a)},Po=function(e,r,a){return e+Math.pow(a-r,2)},Ud=function(e){return Math.sqrt(e)},Zd=function(e,r,a){return Math.max(e,su(r,a))},na=function(e,r,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Xd,s=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),s=i(s,u,l);return o(s)},qr={euclidean:function(e,r,a){return e>=2?na(e,r,a,0,Po,Ud):na(e,r,a,0,ko)},squaredEuclidean:function(e,r,a){return na(e,r,a,0,Po)},manhattan:function(e,r,a){return na(e,r,a,0,ko)},max:function(e,r,a){return na(e,r,a,-1/0,Zd)}};qr["squared-euclidean"]=qr.squaredEuclidean;qr.squaredeuclidean=qr.squaredEuclidean;function Bn(t,e,r,a,n,i){var o;return ze(t)?o=t:o=qr[t]||qr.euclidean,e===0&&ze(t)?o(n,i):o(e,r,a,n,i)}var Qd=Je({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Oi=function(e){return Qd(e)},mn=function(e,r,a,n,i){var o=i!=="kMedoids",s=o?function(v){return a[v]}:function(v){return n[v](a)},u=function(c){return n[c](r)},l=a,f=r;return Bn(e,n.length,s,u,l,f)},Qn=function(e,r,a){for(var n=a.length,i=new Array(n),o=new Array(n),s=new Array(r),u=null,l=0;l<n;l++)i[l]=e.min(a[l]).value,o[l]=e.max(a[l]).value;for(var f=0;f<r;f++){u=[];for(var v=0;v<n;v++)u[v]=Math.random()*(o[v]-i[v])+i[v];s[f]=u}return s},uu=function(e,r,a,n,i){for(var o=1/0,s=0,u=0;u<r.length;u++){var l=mn(a,e,r[u],n,i);l<o&&(o=l,s=u)}return s},lu=function(e,r,a){for(var n=[],i=null,o=0;o<r.length;o++)i=r[o],a[i.id()]===e&&n.push(i);return n},Jd=function(e,r,a){return Math.abs(r-e)<=a},jd=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var o=Math.abs(e[n][i]-r[n][i]);if(o>a)return!1}return!0},_d=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},Bo=function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var i=e[Math.floor(Math.random()*e.length)];_d(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var o=0;o<r;o++)a[o]=e[Math.floor(Math.random()*e.length)];return a},Lo=function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=mn("manhattan",r[i],e,a,"kMedoids");return n},eh=function(e){var r=this.cy(),a=this.nodes(),n=null,i=Oi(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=Qn(a,i.k,i.attributes)):We(i.testCentroids)==="object"?u=i.testCentroids:u=Qn(a,i.k,i.attributes):u=Qn(a,i.k,i.attributes);for(var l=!0,f=0;l&&f<i.maxIterations;){for(var v=0;v<a.length;v++)n=a[v],s[n.id()]=uu(n,u,i.distance,i.attributes,"kMeans");l=!1;for(var c=0;c<i.k;c++){var h=lu(c,a,s);if(h.length!==0){for(var d=i.attributes.length,p=u[c],m=new Array(d),g=new Array(d),y=0;y<d;y++){g[y]=0;for(var b=0;b<h.length;b++)n=h[b],g[y]+=i.attributes[y](n);m[y]=g[y]/h.length,Jd(m[y],p[y],i.sensitivityThreshold)||(l=!0)}u[c]=m,o[c]=r.collection(h)}}f++}return o},th=function(e){var r=this.cy(),a=this.nodes(),n=null,i=Oi(e),o=new Array(i.k),s,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(We(i.testCentroids)==="object"?s=i.testCentroids:s=Bo(a,i.k)):s=Bo(a,i.k);for(var v=!0,c=0;v&&c<i.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],u[n.id()]=uu(n,s,i.distance,i.attributes,"kMedoids");v=!1;for(var d=0;d<s.length;d++){var p=lu(d,a,u);if(p.length!==0){f[d]=Lo(s[d],p,i.attributes);for(var m=0;m<p.length;m++)l=Lo(p[m],p,i.attributes),l<f[d]&&(f[d]=l,s[d]=p[m],v=!0);o[d]=r.collection(p)}}c++}return o},rh=function(e,r,a,n,i){for(var o,s,u=0;u<r.length;u++)for(var l=0;l<e.length;l++)n[u][l]=Math.pow(a[u][l],i.m);for(var f=0;f<e.length;f++)for(var v=0;v<i.attributes.length;v++){o=0,s=0;for(var c=0;c<r.length;c++)o+=n[c][f]*i.attributes[v](r[c]),s+=n[c][f];e[f][v]=o/s}},ah=function(e,r,a,n,i){for(var o=0;o<e.length;o++)r[o]=e[o].slice();for(var s,u,l,f=2/(i.m-1),v=0;v<a.length;v++)for(var c=0;c<n.length;c++){s=0;for(var h=0;h<a.length;h++)u=mn(i.distance,n[c],a[v],i.attributes,"cmeans"),l=mn(i.distance,n[c],a[h],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[c][v]=1/s}},nh=function(e,r,a,n){for(var i=new Array(a.k),o=0;o<i.length;o++)i[o]=[];for(var s,u,l=0;l<r.length;l++){s=-1/0,u=-1;for(var f=0;f<r[0].length;f++)r[l][f]>s&&(s=r[l][f],u=f);i[u].push(e[l])}for(var v=0;v<i.length;v++)i[v]=n.collection(i[v]);return i},Mo=function(e){var r=this.cy(),a=this.nodes(),n=Oi(e),i,o,s,u,l;u=new Array(a.length);for(var f=0;f<a.length;f++)u[f]=new Array(n.k);s=new Array(a.length);for(var v=0;v<a.length;v++)s[v]=new Array(n.k);for(var c=0;c<a.length;c++){for(var h=0,d=0;d<n.k;d++)s[c][d]=Math.random(),h+=s[c][d];for(var p=0;p<n.k;p++)s[c][p]=s[c][p]/h}o=new Array(n.k);for(var m=0;m<n.k;m++)o[m]=new Array(n.attributes.length);l=new Array(a.length);for(var g=0;g<a.length;g++)l[g]=new Array(n.k);for(var y=!0,b=0;y&&b<n.maxIterations;)y=!1,rh(o,a,s,l,n),ah(s,u,o,a,n),jd(s,u,n.sensitivityThreshold)||(y=!0),b++;return i=nh(a,s,n,r),{clusters:i,degreeOfMembership:s}},ih={kMeans:eh,kMedoids:th,fuzzyCMeans:Mo,fcm:Mo},oh=Je({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),sh={single:"min",complete:"max"},uh=function(e){var r=oh(e),a=sh[r.linkage];return a!=null&&(r.linkage=a),r},Oo=function(e,r,a,n,i){for(var o=0,s=1/0,u,l=i.attributes,f=function(E,P){return Bn(i.distance,l.length,function(B){return l[B](E)},function(B){return l[B](P)},E,P)},v=0;v<e.length;v++){var c=e[v].key,h=a[c][n[c]];h<s&&(o=c,s=h)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[o],p=r[n[o]],m;i.mode==="dendrogram"?m={left:d,right:p,key:d.key}:m={value:d.value.concat(p.value),key:d.key},e[d.index]=m,e.splice(p.index,1),r[d.key]=m;for(var g=0;g<e.length;g++){var y=e[g];d.key===y.key?u=1/0:i.linkage==="min"?(u=a[d.key][y.key],a[d.key][y.key]>a[p.key][y.key]&&(u=a[p.key][y.key])):i.linkage==="max"?(u=a[d.key][y.key],a[d.key][y.key]<a[p.key][y.key]&&(u=a[p.key][y.key])):i.linkage==="mean"?u=(a[d.key][y.key]*d.size+a[p.key][y.key]*p.size)/(d.size+p.size):i.mode==="dendrogram"?u=f(y.value,d.value):u=f(y.value[0],d.value[0]),a[d.key][y.key]=a[y.key][d.key]=u}for(var b=0;b<e.length;b++){var w=e[b].key;if(n[w]===d.key||n[w]===p.key){for(var S=w,C=0;C<e.length;C++){var x=e[C].key;a[w][x]<a[w][S]&&(S=x)}n[w]=S}e[b].index=b}return d.key=p.key=d.index=p.index=null,!0},Ya=function t(e,r,a){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},lh=function t(e,r){if(!e)return"";if(e.left&&e.right){var a=t(e.left,r),n=t(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},fh=function t(e,r,a){if(!e)return[];var n=[],i=[],o=[];return r===0?(e.left&&Ya(e.left,n),e.right&&Ya(e.right,i),o=n.concat(i),[a.collection(o)]):r===1?e.value?[a.collection(e.value)]:(e.left&&Ya(e.left,n),e.right&&Ya(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=t(e.left,r-1,a)),e.right&&(i=t(e.right,r-1,a)),n.concat(i))},Ao=function(e){for(var r=this.cy(),a=this.nodes(),n=uh(e),i=n.attributes,o=function(b,w){return Bn(n.distance,i.length,function(S){return i[S](b)},function(S){return i[S](w)},b,w)},s=[],u=[],l=[],f=[],v=0;v<a.length;v++){var c={value:n.mode==="dendrogram"?a[v]:[a[v]],key:v,index:v};s[v]=c,f[v]=c,u[v]=[],l[v]=0}for(var h=0;h<s.length;h++)for(var d=0;d<=h;d++){var p=void 0;n.mode==="dendrogram"?p=h===d?1/0:o(s[h].value,s[d].value):p=h===d?1/0:o(s[h].value[0],s[d].value[0]),u[h][d]=p,u[d][h]=p,p<u[h][l[h]]&&(l[h]=d)}for(var m=Oo(s,f,u,l,n);m;)m=Oo(s,f,u,l,n);var g;return n.mode==="dendrogram"?(g=fh(s[0],n.dendrogramDepth,r),n.addDendrogram&&lh(s[0],r)):(g=new Array(s.length),s.forEach(function(y,b){y.key=y.index=null,g[b]=r.collection(y.value)})),g},vh={hierarchicalClustering:Ao,hca:Ao},ch=Je({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),dh=function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||Ve("Damping must range on [0.5, 1).  Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||ne(a)||Ve("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number.  Got: ").concat(a)),ch(e)},hh=function(e,r,a,n){var i=function(s,u){return n[u](s)};return-Bn(e,n.length,function(o){return i(r,o)},function(o){return i(a,o)},r,a)},gh=function(e,r){var a=null;return r==="median"?a=dd(e):r==="mean"?a=cd(e):r==="min"?a=fd(e):r==="max"?a=vd(e):a=r,a},ph=function(e,r,a){for(var n=[],i=0;i<e;i++)r[i*e+i]+a[i*e+i]>0&&n.push(i);return n},Ro=function(e,r,a){for(var n=[],i=0;i<e;i++){for(var o=-1,s=-1/0,u=0;u<a.length;u++){var l=a[u];r[i*e+l]>s&&(o=l,s=r[i*e+l])}o>0&&n.push(o)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},mh=function(e,r,a){for(var n=Ro(e,r,a),i=0;i<a.length;i++){for(var o=[],s=0;s<n.length;s++)n[s]===a[i]&&o.push(s);for(var u=-1,l=-1/0,f=0;f<o.length;f++){for(var v=0,c=0;c<o.length;c++)v+=r[o[c]*e+o[f]];v>l&&(u=f,l=v)}a[i]=o[u]}return n=Ro(e,r,a),n},Io=function(e){for(var r=this.cy(),a=this.nodes(),n=dh(e),i={},o=0;o<a.length;o++)i[a[o].id()]=o;var s,u,l,f,v,c;s=a.length,u=s*s,l=new Array(u);for(var h=0;h<u;h++)l[h]=-1/0;for(var d=0;d<s;d++)for(var p=0;p<s;p++)d!==p&&(l[d*s+p]=hh(n.distance,a[d],a[p],n.attributes));f=gh(l,n.preference);for(var m=0;m<s;m++)l[m*s+m]=f;v=new Array(u);for(var g=0;g<u;g++)v[g]=0;c=new Array(u);for(var y=0;y<u;y++)c[y]=0;for(var b=new Array(s),w=new Array(s),S=new Array(s),C=0;C<s;C++)b[C]=0,w[C]=0,S[C]=0;for(var x=new Array(s*n.minIterations),T=0;T<x.length;T++)x[T]=0;var E;for(E=0;E<n.maxIterations;E++){for(var P=0;P<s;P++){for(var B=-1/0,D=-1/0,M=-1,L=0,R=0;R<s;R++)b[R]=v[P*s+R],L=c[P*s+R]+l[P*s+R],L>=B?(D=B,B=L,M=R):L>D&&(D=L);for(var O=0;O<s;O++)v[P*s+O]=(1-n.damping)*(l[P*s+O]-B)+n.damping*b[O];v[P*s+M]=(1-n.damping)*(l[P*s+M]-D)+n.damping*b[M]}for(var A=0;A<s;A++){for(var N=0,F=0;F<s;F++)b[F]=c[F*s+A],w[F]=Math.max(0,v[F*s+A]),N+=w[F];N-=w[A],w[A]=v[A*s+A],N+=w[A];for(var q=0;q<s;q++)c[q*s+A]=(1-n.damping)*Math.min(0,N-w[q])+n.damping*b[q];c[A*s+A]=(1-n.damping)*(N-w[A])+n.damping*b[A]}for(var z=0,$=0;$<s;$++){var K=c[$*s+$]+v[$*s+$]>0?1:0;x[E%n.minIterations*s+$]=K,z+=K}if(z>0&&(E>=n.minIterations-1||E==n.maxIterations-1)){for(var Y=0,H=0;H<s;H++){S[H]=0;for(var W=0;W<n.minIterations;W++)S[H]+=x[W*s+H];(S[H]===0||S[H]===n.minIterations)&&Y++}if(Y===s)break}}for(var I=ph(s,v,c),G=mh(s,l,I),Z={},_=0;_<I.length;_++)Z[I[_]]=[];for(var ee=0;ee<a.length;ee++){var de=i[a[ee].id()],he=G[de];he!=null&&Z[he].push(a[ee])}for(var re=new Array(I.length),te=0;te<I.length;te++)re[te]=r.collection(Z[I[te]]);return re},yh={affinityPropagation:Io,ap:Io},bh=Je({root:void 0,directed:!1}),wh={hierholzer:function(e){if(!Ce(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=bh(e),n=a.root,i=a.directed,o=this,s=!1,u,l,f;n&&(f=fe(n)?this.filter(n)[0].id():n[0].id());var v={},c={};i?o.forEach(function(y){var b=y.id();if(y.isNode()){var w=y.indegree(!0),S=y.outdegree(!0),C=w-S,x=S-w;C==1?u?s=!0:u=b:x==1?l?s=!0:l=b:(x>1||C>1)&&(s=!0),v[b]=[],y.outgoers().forEach(function(T){T.isEdge()&&v[b].push(T.id())})}else c[b]=[void 0,y.target().id()]}):o.forEach(function(y){var b=y.id();if(y.isNode()){var w=y.degree(!0);w%2&&(u?l?s=!0:l=b:u=b),v[b]=[],y.connectedEdges().forEach(function(S){return v[b].push(S.id())})}else c[b]=[y.source().id(),y.target().id()]});var h={found:!1,trail:void 0};if(s)return h;if(l&&u)if(i){if(f&&l!=f)return h;f=l}else{if(f&&l!=f&&u!=f)return h;f||(f=l)}else f||(f=o[0].id());var d=function(b){for(var w=b,S=[b],C,x,T;v[w].length;)C=v[w].shift(),x=c[C][0],T=c[C][1],w!=T?(v[T]=v[T].filter(function(E){return E!=C}),w=T):!i&&w!=x&&(v[x]=v[x].filter(function(E){return E!=C}),w=x),S.unshift(C),S.unshift(w);return S},p=[],m=[];for(m=d(f);m.length!=1;)v[m[0]].length==0?(p.unshift(o.getElementById(m.shift())),p.unshift(o.getElementById(m.shift()))):m=d(m.shift()).concat(m);p.unshift(o.getElementById(m.shift()));for(var g in v)if(v[g].length)return h;return h.found=!0,h.trail=this.spawn(p,!0),h}},Xa=function(){var e=this,r={},a=0,n=0,i=[],o=[],s={},u=function(c,h){for(var d=o.length-1,p=[],m=e.spawn();o[d].x!=c||o[d].y!=h;)p.push(o.pop().edge),d--;p.push(o.pop().edge),p.forEach(function(g){var y=g.connectedNodes().intersection(e);m.merge(g),y.forEach(function(b){var w=b.id(),S=b.connectedEdges().intersection(e);m.merge(b),r[w].cutVertex?m.merge(S.filter(function(C){return C.isLoop()})):m.merge(S)})}),i.push(m)},l=function v(c,h,d){c===d&&(n+=1),r[h]={id:a,low:a++,cutVertex:!1};var p=e.getElementById(h).connectedEdges().intersection(e);if(p.size()===0)i.push(e.spawn(e.getElementById(h)));else{var m,g,y,b;p.forEach(function(w){m=w.source().id(),g=w.target().id(),y=m===h?g:m,y!==d&&(b=w.id(),s[b]||(s[b]=!0,o.push({x:h,y,edge:w})),y in r?r[h].low=Math.min(r[h].low,r[y].id):(v(c,y,h),r[h].low=Math.min(r[h].low,r[y].low),r[h].id<=r[y].low&&(r[h].cutVertex=!0,u(h,y))))})}};e.forEach(function(v){if(v.isNode()){var c=v.id();c in r||(n=0,l(c,c),r[c].cutVertex=n>1)}});var f=Object.keys(r).filter(function(v){return r[v].cutVertex}).map(function(v){return e.getElementById(v)});return{cut:e.spawn(f),components:i}},xh={hopcroftTarjanBiconnected:Xa,htbc:Xa,htb:Xa,hopcroftTarjanBiconnectedComponents:Xa},Ua=function(){var e=this,r={},a=0,n=[],i=[],o=e.spawn(e),s=function u(l){i.push(l),r[l]={index:a,low:a++,explored:!1};var f=e.getElementById(l).connectedEdges().intersection(e);if(f.forEach(function(p){var m=p.target().id();m!==l&&(m in r||u(m),r[m].explored||(r[l].low=Math.min(r[l].low,r[m].low)))}),r[l].index===r[l].low){for(var v=e.spawn();;){var c=i.pop();if(v.merge(e.getElementById(c)),r[c].low=r[l].index,r[c].explored=!0,c===l)break}var h=v.edgesWith(v),d=v.merge(h);n.push(d),o=o.difference(d)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in r||s(l)}}),{cut:o,components:n}},Eh={tarjanStronglyConnected:Ua,tsc:Ua,tscc:Ua,tarjanStronglyConnectedComponents:Ua},fu={};[xa,jc,_c,td,ad,id,ud,Ad,zr,Fr,oi,Yd,ih,vh,yh,wh,xh,Eh].forEach(function(t){ce(fu,t)});/*!
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
Licensed under The MIT License (http://opensource.org/licenses/MIT)
*/var vu=0,cu=1,du=2,Wt=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=vu,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Wt.prototype={fulfill:function(e){return No(this,cu,"fulfillValue",e)},reject:function(e){return No(this,du,"rejectReason",e)},then:function(e,r){var a=this,n=new Wt;return a.onFulfilled.push(Fo(e,n,"fulfill")),a.onRejected.push(Fo(r,n,"reject")),hu(a),n.proxy}};var No=function(e,r,a,n){return e.state===vu&&(e.state=r,e[a]=n,hu(e)),e},hu=function(e){e.state===cu?zo(e,"onFulfilled",e.fulfillValue):e.state===du&&zo(e,"onRejected",e.rejectReason)},zo=function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var i=function(){for(var s=0;s<n.length;s++)n[s](a)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Fo=function(e,r,a){return function(n){if(typeof e!="function")r[a].call(r,n);else{var i;try{i=e(n)}catch(o){r.reject(o);return}Ch(r,i)}}},Ch=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(We(r)==="object"&&r!==null||typeof r=="function")try{a=r.then}catch(i){e.reject(i);return}if(typeof a=="function"){var n=!1;try{a.call(r,function(i){n||(n=!0,i===r?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){n||(n=!0,e.reject(i))})}catch(i){n||e.reject(i)}return}e.fulfill(r)};Wt.all=function(t){return new Wt(function(e,r){for(var a=new Array(t.length),n=0,i=function(u,l){a[u]=l,n++,n===t.length&&e(a)},o=0;o<t.length;o++)(function(s){var u=t[s],l=u!=null&&u.then!=null;if(l)u.then(function(v){i(s,v)},function(v){r(v)});else{var f=u;i(s,f)}})(o)})};Wt.resolve=function(t){return new Wt(function(e,r){e(t)})};Wt.reject=function(t){return new Wt(function(e,r){r(t)})};var Zr=typeof Promise<"u"?Promise:Wt,si=function(e,r,a){var n=Si(e),i=!n,o=this._private=ce({duration:1e3},r,a);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&ze(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(n){var u=e.pan();o.startPan={x:u.x,y:u.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},pr=si.prototype;ce(pr,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,a=e.target._private.animation;e.queue?r=a.queue:r=a.current,r.push(this),ht(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,a=r.playing;return e===void 0?r.progress:(a&&this.pause(),r.progress=e,r.started=!1,a&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var a=function(l,f){var v=e[l];v!=null&&(e[l]=e[f],e[f]=v)};if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var i=e.style[n],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[n]=s}return r&&this.play(),this},promise:function(e){var r=this._private,a;switch(e){case"frame":a=r.frames;break;default:case"complete":case"completed":a=r.completes}return new Zr(function(n,i){a.push(function(){n()})})}});pr.complete=pr.completed;pr.run=pr.play;pr.running=pr.playing;var Sh={animated:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=n[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<n.length;o++){var s=n[o];s._private.animation.queue=[]}return this}},delay:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:r,duration:r,complete:a}):this}},delayAnimation:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:r,duration:r,complete:a}):this}},animation:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this,u=!i,l=!u;if(!s.styleEnabled())return this;var f=s.style();r=ce({},r,a);var v=Object.keys(r).length===0;if(v)return new si(o[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(l&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),l&&r.renderedPosition!=null){var c=r.renderedPosition,h=s.pan(),d=s.zoom();r.position=js(c,d,h)}if(u&&r.panBy!=null){var p=r.panBy,m=s.pan();r.pan={x:m.x+p.x,y:m.y+p.y}}var g=r.center||r.centre;if(u&&g!=null){var y=s.getCenterPan(g.eles,r.zoom);y!=null&&(r.pan=y)}if(u&&r.fit!=null){var b=r.fit,w=s.getFitViewport(b.eles||b.boundingBox,b.padding);w!=null&&(r.pan=w.pan,r.zoom=w.zoom)}if(u&&Ce(r.zoom)){var S=s.getZoomedViewport(r.zoom);S!=null?(S.zoomed&&(r.zoom=S.zoom),S.panned&&(r.pan=S.pan)):r.zoom=null}return new si(o[0],r)}},animate:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;a&&(r=ce({},r,a));for(var u=0;u<o.length;u++){var l=o[u],f=l.animated()&&(r.queue===void 0||r.queue),v=l.animation(r,f?{queue:!0}:void 0);v.play()}return this}},stop:function(){return function(r,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var u=0;u<o.length;u++){for(var l=o[u],f=l._private,v=f.animation.current,c=0;c<v.length;c++){var h=v[c],d=h._private;a&&(d.duration=0)}r&&(f.animation.queue=[]),a||(f.animation.current=[])}return s.notify("draw"),this}}},Th={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(n){},beforeSet:function(n,i){},onSet:function(n){},canSet:function(n){return!0}};return e=ce({},r,e),function(n,i){var o=e,s=this,u=s.length!==void 0,l=u?s:[s],f=u?s[0]:s;if(fe(n)){var v=n.indexOf(".")!==-1,c=v&&fc.default(n);if(o.allowGetting&&i===void 0){var h;return f&&(o.beforeGet(f),c&&f._private[o.field][n]===void 0?h=uc.default(f._private[o.field],c):h=f._private[o.field][n]),h}else if(o.allowSetting&&i!==void 0){var d=!o.immutableKeys[n];if(d){var p=Ns({},n,i);o.beforeSet(s,p);for(var m=0,g=l.length;m<g;m++){var y=l[m];o.canSet(y)&&(c&&f._private[o.field][n]===void 0?lc.default(y._private[o.field],c,i):y._private[o.field][n]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&Ce(n)){var b=n,w,S,C=Object.keys(b);o.beforeSet(s,b);for(var x=0;x<C.length;x++){w=C[x],S=b[w];var T=!o.immutableKeys[w];if(T)for(var E=0;E<l.length;E++){var P=l[E];o.canSet(P)&&(P._private[o.field][w]=S)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&ze(n)){var B=n;s.on(o.bindingEvent,B)}else if(o.allowGetting&&n===void 0){var D;return f&&(o.beforeGet(f),D=f._private[o.field]),D}return s}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=ce({},r,e),function(n){var i=e,o=this,s=o.length!==void 0,u=s?o:[o];if(fe(n)){for(var l=n.split(/\s+/),f=l.length,v=0;v<f;v++){var c=l[v];if(!er(c)){var h=!i.immutableKeys[c];if(h)for(var d=0,p=u.length;d<p;d++)u[d]._private[i.field][c]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(n===void 0){for(var m=0,g=u.length;m<g;m++)for(var y=u[m]._private[i.field],b=Object.keys(y),w=0;w<b.length;w++){var S=b[w],C=!i.immutableKeys[S];C&&(y[S]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},Dh={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(a,n){var i=this,o=Array.prototype.slice.call(arguments,0);return new Zr(function(s,u){var l=function(h){i.off.apply(i,v),s(h)},f=o.concat([l]),v=f.concat([]);i.on.apply(i,f)})}}},Be={};[Sh,Th,Dh].forEach(function(t){ce(Be,t)});var kh={animate:Be.animate(),animation:Be.animation(),animated:Be.animated(),clearQueue:Be.clearQueue(),delay:Be.delay(),delayAnimation:Be.delayAnimation(),stop:Be.stop()},sn={classes:function(e){var r=this;if(e===void 0){var a=[];return r[0]._private.classes.forEach(function(d){return a.push(d)}),a}else Ae(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],i=new Ur(e),o=0;o<r.length;o++){for(var s=r[o],u=s._private,l=u.classes,f=!1,v=0;v<e.length;v++){var c=e[v],h=l.has(c);if(!h){f=!0;break}}f||(f=l.size!==e.length),f&&(u.classes=i,n.push(s))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Ae(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,i=[],o=0,s=a.length;o<s;o++)for(var u=a[o],l=u._private.classes,f=!1,v=0;v<e.length;v++){var c=e[v],h=l.has(c),d=!1;r||n&&!h?(l.add(c),d=!0):(!r||n&&h)&&(l.delete(c),d=!0),!f&&d&&(i.push(u),f=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var a=this;if(r==null)r=250;else if(r===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},r),a}};sn.className=sn.classNames=sn.classes;var Ee={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:He,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ee.variable="(?:[\\w-.]|(?:\\\\"+Ee.metaChar+"))+";Ee.className="(?:[\\w-]|(?:\\\\"+Ee.metaChar+"))+";Ee.value=Ee.string+"|"+Ee.number;Ee.id=Ee.variable;(function(){var t,e,r;for(t=Ee.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Ee.comparatorOp+="|@"+e;for(t=Ee.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Ee.comparatorOp+="|\\!"+e)})();var Oe=function(){return{checks:[]}},oe={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},ui=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Mc(t.selector,e.selector)}),Ph=function(){for(var t={},e,r=0;r<ui.length;r++)e=ui[r],t[e.selector]=e.matches;return t}(),Bh=function(e,r){return Ph[e](r)},Lh="("+ui.map(function(t){return t.selector}).join("|")+")",Dr=function(e){return e.replace(new RegExp("\\\\("+Ee.metaChar+")","g"),function(r,a){return a})},Zt=function(e,r,a){e[e.length-1]=a},li=[{name:"group",query:!0,regex:"("+Ee.group+")",populate:function(e,r,a){var n=$t(a,1),i=n[0];r.checks.push({type:oe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Lh,populate:function(e,r,a){var n=$t(a,1),i=n[0];r.checks.push({type:oe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Ee.id+")",populate:function(e,r,a){var n=$t(a,1),i=n[0];r.checks.push({type:oe.ID,value:Dr(i)})}},{name:"className",query:!0,regex:"\\.("+Ee.className+")",populate:function(e,r,a){var n=$t(a,1),i=n[0];r.checks.push({type:oe.CLASS,value:Dr(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ee.variable+")\\s*\\]",populate:function(e,r,a){var n=$t(a,1),i=n[0];r.checks.push({type:oe.DATA_EXIST,field:Dr(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ee.variable+")\\s*("+Ee.comparatorOp+")\\s*("+Ee.value+")\\s*\\]",populate:function(e,r,a){var n=$t(a,3),i=n[0],o=n[1],s=n[2],u=new RegExp("^"+Ee.string+"$").exec(s)!=null;u?s=s.substring(1,s.length-1):s=parseFloat(s),r.checks.push({type:oe.DATA_COMPARE,field:Dr(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ee.boolOp+")\\s*("+Ee.variable+")\\s*\\]",populate:function(e,r,a){var n=$t(a,2),i=n[0],o=n[1];r.checks.push({type:oe.DATA_BOOL,field:Dr(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ee.meta+")\\s*("+Ee.comparatorOp+")\\s*("+Ee.number+")\\s*\\]\\]",populate:function(e,r,a){var n=$t(a,3),i=n[0],o=n[1],s=n[2];r.checks.push({type:oe.META_COMPARE,field:Dr(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:Ee.separator,populate:function(e,r){var a=e.currentSubject,n=e.edgeCount,i=e.compoundCount,o=e[e.length-1];a!=null&&(o.subject=a,e.currentSubject=null),o.edgeCount=n,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=Oe();return s}},{name:"directedEdge",separator:!0,regex:Ee.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Oe(),n=r,i=Oe();return a.checks.push({type:oe.DIRECTED_EDGE,source:n,target:i}),Zt(e,r,a),e.edgeCount++,i}else{var o=Oe(),s=r,u=Oe();return o.checks.push({type:oe.NODE_SOURCE,source:s,target:u}),Zt(e,r,o),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:Ee.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Oe(),n=r,i=Oe();return a.checks.push({type:oe.UNDIRECTED_EDGE,nodes:[n,i]}),Zt(e,r,a),e.edgeCount++,i}else{var o=Oe(),s=r,u=Oe();return o.checks.push({type:oe.NODE_NEIGHBOR,node:s,neighbor:u}),Zt(e,r,o),u}}},{name:"child",separator:!0,regex:Ee.child,populate:function(e,r){if(e.currentSubject==null){var a=Oe(),n=Oe(),i=e[e.length-1];return a.checks.push({type:oe.CHILD,parent:i,child:n}),Zt(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=Oe(),s=e[e.length-1],u=Oe(),l=Oe(),f=Oe(),v=Oe();return o.checks.push({type:oe.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:oe.TRUE}],v.checks.push({type:oe.TRUE}),u.checks.push({type:oe.PARENT,parent:v,child:f}),Zt(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var c=Oe(),h=Oe(),d=[{type:oe.PARENT,parent:c,child:h}];return c.checks=r.checks,r.checks=d,e.compoundCount++,h}}},{name:"descendant",separator:!0,regex:Ee.descendant,populate:function(e,r){if(e.currentSubject==null){var a=Oe(),n=Oe(),i=e[e.length-1];return a.checks.push({type:oe.DESCENDANT,ancestor:i,descendant:n}),Zt(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var o=Oe(),s=e[e.length-1],u=Oe(),l=Oe(),f=Oe(),v=Oe();return o.checks.push({type:oe.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:oe.TRUE}],v.checks.push({type:oe.TRUE}),u.checks.push({type:oe.ANCESTOR,ancestor:v,descendant:f}),Zt(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var c=Oe(),h=Oe(),d=[{type:oe.ANCESTOR,ancestor:c,descendant:h}];return c.checks=r.checks,r.checks=d,e.compoundCount++,h}}},{name:"subject",modifier:!0,regex:Ee.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Le("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var a=e[e.length-1],n=a.checks[0],i=n==null?null:n.type;i===oe.DIRECTED_EDGE?n.type=oe.NODE_TARGET:i===oe.UNDIRECTED_EDGE&&(n.type=oe.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];li.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Mh=function(e){for(var r,a,n,i=0;i<li.length;i++){var o=li[i],s=o.name,u=e.match(o.regexObj);if(u!=null){a=u,r=o,n=s;var l=u[0];e=e.substring(l.length);break}}return{expr:r,match:a,name:n,remaining:e}},Oh=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},Ah=function(e){var r=this,a=r.inputText=e,n=r[0]=Oe();for(r.length=1,a=Oh(a);;){var i=Mh(a);if(i.expr==null)return Le("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(r,n,o);if(s===!1)return!1;if(s!=null&&(n=s),a=i.remaining,a.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var l=0;l<r.length;l++){var f=r[l];if(f.compoundCount>0&&f.edgeCount>0)return Le("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return Le("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&Le("The selector `"+e+"` is deprecated.  Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons.  Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Rh=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return fe(f)?'"'+f+'"':e(f)},a=function(f){return" "+f+" "},n=function(f,v){var c=f.type,h=f.value;switch(c){case oe.GROUP:{var d=e(h);return d.substring(0,d.length-1)}case oe.DATA_COMPARE:{var p=f.field,m=f.operator;return"["+p+a(e(m))+r(h)+"]"}case oe.DATA_BOOL:{var g=f.operator,y=f.field;return"["+e(g)+y+"]"}case oe.DATA_EXIST:{var b=f.field;return"["+b+"]"}case oe.META_COMPARE:{var w=f.operator,S=f.field;return"[["+S+a(e(w))+r(h)+"]]"}case oe.STATE:return h;case oe.ID:return"#"+h;case oe.CLASS:return"."+h;case oe.PARENT:case oe.CHILD:return i(f.parent,v)+a(">")+i(f.child,v);case oe.ANCESTOR:case oe.DESCENDANT:return i(f.ancestor,v)+" "+i(f.descendant,v);case oe.COMPOUND_SPLIT:{var C=i(f.left,v),x=i(f.subject,v),T=i(f.right,v);return C+(C.length>0?" ":"")+x+T}case oe.TRUE:return""}},i=function(f,v){return f.checks.reduce(function(c,h,d){return c+(v===f&&d===0?"$":"")+n(h,v)},"")},o="",s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},Ih={parse:Ah,toString:Rh},gu=function(e,r,a){var n,i=fe(e),o=ne(e),s=fe(a),u,l,f=!1,v=!1,c=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),v=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(i||s||f)&&(u=!i&&!o?"":""+e,l=""+a),f&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),r){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":c=!0,n=e>a;break;case">=":c=!0,n=e>=a;break;case"<":c=!0,n=e<a;break;case"<=":c=!0,n=e<=a;break;default:n=!1;break}return v&&(e!=null||!c)&&(n=!n),n},Nh=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},zh=function(e){return e!==void 0},Ai=function(e,r){return e.data(r)},Fh=function(e,r){return e[r]()},$e=[],Ne=function(e,r){return e.checks.every(function(a){return $e[a.type](a,r)})};$e[oe.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};$e[oe.STATE]=function(t,e){var r=t.value;return Bh(r,e)};$e[oe.ID]=function(t,e){var r=t.value;return e.id()===r};$e[oe.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};$e[oe.META_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return gu(Fh(e,r),a,n)};$e[oe.DATA_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return gu(Ai(e,r),a,n)};$e[oe.DATA_BOOL]=function(t,e){var r=t.field,a=t.operator;return Nh(Ai(e,r),a)};$e[oe.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,zh(Ai(e,r))};$e[oe.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),i=e.target();return Ne(r,n)&&Ne(a,i)||Ne(a,n)&&Ne(r,i)};$e[oe.NODE_NEIGHBOR]=function(t,e){return Ne(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Ne(t.neighbor,r)})};$e[oe.DIRECTED_EDGE]=function(t,e){return Ne(t.source,e.source())&&Ne(t.target,e.target())};$e[oe.NODE_SOURCE]=function(t,e){return Ne(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Ne(t.target,r)})};$e[oe.NODE_TARGET]=function(t,e){return Ne(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Ne(t.source,r)})};$e[oe.CHILD]=function(t,e){return Ne(t.child,e)&&Ne(t.parent,e.parent())};$e[oe.PARENT]=function(t,e){return Ne(t.parent,e)&&e.children().some(function(r){return Ne(t.child,r)})};$e[oe.DESCENDANT]=function(t,e){return Ne(t.descendant,e)&&e.ancestors().some(function(r){return Ne(t.ancestor,r)})};$e[oe.ANCESTOR]=function(t,e){return Ne(t.ancestor,e)&&e.descendants().some(function(r){return Ne(t.descendant,r)})};$e[oe.COMPOUND_SPLIT]=function(t,e){return Ne(t.subject,e)&&Ne(t.left,e)&&Ne(t.right,e)};$e[oe.TRUE]=function(){return!0};$e[oe.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};$e[oe.FILTER]=function(t,e){var r=t.value;return r(e)};var Vh=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===oe.ID)return e.getElementById(r[0].checks[0].value).collection();var a=function(i){for(var o=0;o<r.length;o++){var s=r[o];if(Ne(s,i))return!0}return!1};return r.text()==null&&(a=function(){return!0}),e.filter(a)},$h=function(e){for(var r=this,a=0;a<r.length;a++){var n=r[a];if(Ne(n,e))return!0}return!1},qh={matches:$h,filter:Vh},rr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||fe(e)&&e.match(/^\s*$/)||(ht(e)?this.addQuery({checks:[{type:oe.COLLECTION,value:e.collection()}]}):ze(e)?this.addQuery({checks:[{type:oe.FILTER,value:e}]}):fe(e)?this.parse(e)||(this.invalid=!0):Ve("A selector must be created from a string; found "))},ar=rr.prototype;[Ih,qh].forEach(function(t){return ce(ar,t)});ar.text=function(){return this.inputText};ar.size=function(){return this.length};ar.eq=function(t){return this[t]};ar.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};ar.addQuery=function(t){this[this.length++]=t};ar.selector=ar.toString;var jt={allAre:function(e){var r=new rr(e);return this.every(function(a){return r.matches(a)})},is:function(e){var r=new rr(e);return this.some(function(a){return r.matches(a)})},some:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(n)return!0}return!1},every:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(!n)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,a=e.length;return r!==a?!1:r===1?this[0]===e[0]:this.every(function(n){return e.hasElementWithId(n.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(a){return r.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(a){return r.hasElementWithId(a.id())})}};jt.allAreNeighbours=jt.allAreNeighbors;jt.has=jt.contains;jt.equal=jt.equals=jt.same;var wt=function(e,r){return function(n,i,o,s){var u=n,l=this,f;if(u==null?f="":ht(u)&&u.length===1&&(f=u.id()),l.length===1&&f){var v=l[0]._private,c=v.traversalCache=v.traversalCache||{},h=c[r]=c[r]||[],d=hr(f),p=h[d];return p||(h[d]=e.call(l,n,i,o,s))}else return e.call(l,n,i,o,s)}},Hr={parent:function(e){var r=[];if(this.length===1){var a=this[0]._private.parent;if(a)return a}for(var n=0;n<this.length;n++){var i=this[n],o=i._private.parent;o&&r.push(o)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],a=this.parent();a.nonempty();){for(var n=0;n<a.length;n++){var i=a[n];r.push(i)}a=a.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,a=0;a<this.length;a++){var n=this[a],i=n.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:wt(function(t){for(var e=[],r=0;r<this.length;r++)for(var a=this[r],n=a._private.children,i=0;i<n.length;i++)e.push(n[i]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function a(n){for(var i=0;i<n.length;i++){var o=n[i];r.push(o),o.children().nonempty()&&a(o.children())}}return a(this.children()),this.spawn(r,!0).filter(e)}};function Ri(t,e,r,a){for(var n=[],i=new Ur,o=t.cy(),s=o.hasCompoundNodes(),u=0;u<t.length;u++){var l=t[u];r?n.push(l):s&&a(n,i,l)}for(;n.length>0;){var f=n.shift();e(f),i.add(f.id()),s&&a(n,i,f)}return t}function pu(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n<a.length;n++){var i=a[n];e.has(i.id())||t.push(i)}}Hr.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ri(this,t,e,pu)};function mu(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}Hr.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ri(this,t,e,mu)};function Hh(t,e,r){mu(t,e,r),pu(t,e,r)}Hr.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ri(this,t,e,Hh)};Hr.ancestors=Hr.parents;var Sa,yu;Sa=yu={data:Be.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Be.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Be.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Be.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Be.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Be.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Sa.attr=Sa.data;Sa.removeAttr=Sa.removeData;var Wh=yu,Ln={};function Jn(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var a=0,n=r[0],i=n._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(a+=t(n,s))}return a}else return}}ce(Ln,{degree:Jn(function(t,e){return e.source().same(e.target())?2:1}),indegree:Jn(function(t,e){return e.target().same(t)?1:0}),outdegree:Jn(function(t,e){return e.source().same(t)?1:0})});function kr(t,e){return function(r){for(var a,n=this.nodes(),i=0;i<n.length;i++){var o=n[i],s=o[t](r);s!==void 0&&(a===void 0||e(s,a))&&(a=s)}return a}}ce(Ln,{minDegree:kr("degree",function(t,e){return t<e}),maxDegree:kr("degree",function(t,e){return t>e}),minIndegree:kr("indegree",function(t,e){return t<e}),maxIndegree:kr("indegree",function(t,e){return t>e}),minOutdegree:kr("outdegree",function(t,e){return t<e}),maxOutdegree:kr("outdegree",function(t,e){return t>e})});ce(Ln,{totalDegree:function(e){for(var r=0,a=this.nodes(),n=0;n<a.length;n++)r+=a[n].degree(e);return r}});var Lt,bu,wu=function(e,r,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var o=i._private.position,s={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,a),i.dirtyBoundingBoxCache()}}},Vo={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){wu(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Lt=bu={position:Be.data(Vo),silentPosition:Be.data(ce({},Vo,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){wu(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(Ce(e))r?this.silentPosition(e):this.position(e);else if(ze(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=a(o,i))&&(r?o.silentPosition(s):o.position(s))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,a){var n;if(Ce(e)?(n={x:ne(e.x)?e.x:0,y:ne(e.y)?e.y:0},a=r):fe(e)&&ne(r)&&(n={x:0,y:0},n[e]=r),n!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var u=s.position(),l={x:u.x+n.x,y:u.y+n.y};a?s.silentPosition(l):s.position(l)}}i.endBatch()}return this},silentShift:function(e,r){return Ce(e)?this.shift(e,!0):fe(e)&&ne(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var a=this[0],n=this.cy(),i=n.zoom(),o=n.pan(),s=Ce(e)?e:void 0,u=s!==void 0||r!==void 0&&fe(e);if(a&&a.isNode())if(u)for(var l=0;l<this.length;l++){var f=this[l];r!==void 0?f.position(e,(r-o[e])/i):s!==void 0&&f.position(js(s,i,o))}else{var v=a.position();return s=Pn(v,i,o),e===void 0?s:s[e]}else if(!u)return;return this},relativePosition:function(e,r){var a=this[0],n=this.cy(),i=Ce(e)?e:void 0,o=i!==void 0||r!==void 0&&fe(e),s=n.hasCompoundNodes();if(a&&a.isNode())if(o)for(var u=0;u<this.length;u++){var l=this[u],f=s?l.parent():null,v=f&&f.length>0,c=v;v&&(f=f[0]);var h=c?f.position():{x:0,y:0};r!==void 0?l.position(e,r+h[e]):i!==void 0&&l.position({x:i.x+h.x,y:i.y+h.y})}else{var d=a.position(),p=s?a.parent():null,m=p&&p.length>0,g=m;m&&(p=p[0]);var y=g?p.position():{x:0,y:0};return i={x:d.x-y.x,y:d.y-y.y},e===void 0?i:i[e]}else if(!o)return;return this}};Lt.modelPosition=Lt.point=Lt.position;Lt.modelPositions=Lt.points=Lt.positions;Lt.renderedPoint=Lt.renderedPosition;Lt.relativePoint=Lt.relativePosition;var Kh=bu,Vr,ir;Vr=ir={};ir.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,o=e.x2*a+n.x,s=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};ir.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var a=r._private;a.compoundBoundsClean=!1,a.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};ir.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(o){if(!o.isParent())return;var s=o._private,u=o.children(),l=o.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},v=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),c=s.position;(v.w===0||v.h===0)&&(v={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},v.x1=c.x-v.w/2,v.x2=c.x+v.w/2,v.y1=c.y-v.h/2,v.y2=c.y+v.h/2);function h(E,P,B){var D=0,M=0,L=P+B;return E>0&&L>0&&(D=P/L*E,M=B/L*E),{biasDiff:D,biasComplementDiff:M}}function d(E,P,B,D){if(B.units==="%")switch(D){case"width":return E>0?B.pfValue*E:0;case"height":return P>0?B.pfValue*P:0;case"average":return E>0&&P>0?B.pfValue*(E+P)/2:0;case"min":return E>0&&P>0?E>P?B.pfValue*P:B.pfValue*E:0;case"max":return E>0&&P>0?E>P?B.pfValue*E:B.pfValue*P:0;default:return 0}else return B.units==="px"?B.pfValue:0}var p=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(p=p*100/f.width.val);var m=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(m=m*100/f.width.val);var g=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(g=g*100/f.height.val);var y=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(y=y*100/f.height.val);var b=h(f.width.val-v.w,p,m),w=b.biasDiff,S=b.biasComplementDiff,C=h(f.height.val-v.h,g,y),x=C.biasDiff,T=C.biasComplementDiff;s.autoPadding=d(v.w,v.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(v.w,f.width.val),c.x=(-w+v.x1+v.x2+S)/2,s.autoHeight=Math.max(v.h,f.height.val),c.y=(-x+v.y1+v.y2+T)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;(!i.compoundBoundsClean||t)&&(r(n),e.batching()||(i.compoundBoundsClean=!0))}return this};var bt=function(e){return e===1/0||e===-1/0?0:e},Pt=function(e,r,a,n,i){n-r===0||i-a===0||r==null||a==null||n==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=a<e.y1?a:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},vr=function(e,r){return r==null?e:Pt(e,r.x1,r.y1,r.x2,r.y2)},ia=function(e,r,a){return Bt(e,r,a)},Za=function(e,r,a){if(!r.cy().headless()){var n=r._private,i=n.rstyle,o=i.arrowWidth/2,s=r.pstyle(a+"-arrow-shape").value,u,l;if(s!=="none"){a==="source"?(u=i.srcX,l=i.srcY):a==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var f=n.arrowBounds=n.arrowBounds||{},v=f[a]=f[a]||{};v.x1=u-o,v.y1=l-o,v.x2=u+o,v.y2=l+o,v.w=v.x2-v.x1,v.h=v.y2-v.y1,on(v,1),Pt(e,v.x1,v.y1,v.x2,v.y2)}}},jn=function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var i=r._private,o=i.rstyle,s=r.pstyle(n+"label").strValue;if(s){var u=r.pstyle("text-halign"),l=r.pstyle("text-valign"),f=ia(o,"labelWidth",a),v=ia(o,"labelHeight",a),c=ia(o,"labelX",a),h=ia(o,"labelY",a),d=r.pstyle(n+"text-margin-x").pfValue,p=r.pstyle(n+"text-margin-y").pfValue,m=r.isEdge(),g=r.pstyle(n+"text-rotation"),y=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,S=r.pstyle("text-background-padding").pfValue,C=2,x=v,T=f,E=T/2,P=x/2,B,D,M,L;if(m)B=c-E,D=c+E,M=h-P,L=h+P;else{switch(u.value){case"left":B=c-T,D=c;break;case"center":B=c-E,D=c+E;break;case"right":B=c,D=c+T;break}switch(l.value){case"top":M=h-x,L=h;break;case"center":M=h-P,L=h+P;break;case"bottom":M=h,L=h+x;break}}B+=d-Math.max(y,w)-S-C,D+=d+Math.max(y,w)+S+C,M+=p-Math.max(y,w)-S-C,L+=p+Math.max(y,w)+S+C;var R=a||"main",O=i.labelBounds,A=O[R]=O[R]||{};A.x1=B,A.y1=M,A.x2=D,A.y2=L,A.w=D-B,A.h=L-M;var N=m&&g.strValue==="autorotate",F=g.pfValue!=null&&g.pfValue!==0;if(N||F){var q=N?ia(i.rstyle,"labelAngle",a):g.pfValue,z=Math.cos(q),$=Math.sin(q),K=(B+D)/2,Y=(M+L)/2;if(!m){switch(u.value){case"left":K=D;break;case"right":K=B;break}switch(l.value){case"top":Y=L;break;case"bottom":Y=M;break}}var H=function(he,re){return he=he-K,re=re-Y,{x:he*z-re*$+K,y:he*$+re*z+Y}},W=H(B,M),I=H(B,L),G=H(D,M),Z=H(D,L);B=Math.min(W.x,I.x,G.x,Z.x),D=Math.max(W.x,I.x,G.x,Z.x),M=Math.min(W.y,I.y,G.y,Z.y),L=Math.max(W.y,I.y,G.y,Z.y)}var _=R+"Rot",ee=O[_]=O[_]||{};ee.x1=B,ee.y1=M,ee.x2=D,ee.y2=L,ee.w=D-B,ee.h=L-M,Pt(e,B,M,D,L),Pt(i.labelBounds.all,B,M,D,L)}return e}},Gh=function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),o=ct(),s=e._private,u=e.isNode(),l=e.isEdge(),f,v,c,h,d,p,m=s.rstyle,g=u&&n?e.pstyle("bounds-expansion").pfValue:[0],y=function(se){return se.pstyle("display").value!=="none"},b=!n||y(e)&&(!l||y(e.source())&&y(e.target()));if(b){var w=0,S=0;n&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(S=e.pstyle("overlay-padding").value));var C=0,x=0;n&&r.includeUnderlays&&(C=e.pstyle("underlay-opacity").value,C!==0&&(x=e.pstyle("underlay-padding").value));var T=Math.max(S,x),E=0,P=0;if(n&&(E=e.pstyle("width").pfValue,P=E/2),u&&r.includeNodes){var B=e.position();d=B.x,p=B.y;var D=e.outerWidth(),M=D/2,L=e.outerHeight(),R=L/2;f=d-M,v=d+M,c=p-R,h=p+R,Pt(o,f,c,v,h)}else if(l&&r.includeEdges)if(n&&!i){var O=e.pstyle("curve-style").strValue;if(f=Math.min(m.srcX,m.midX,m.tgtX),v=Math.max(m.srcX,m.midX,m.tgtX),c=Math.min(m.srcY,m.midY,m.tgtY),h=Math.max(m.srcY,m.midY,m.tgtY),f-=P,v+=P,c-=P,h+=P,Pt(o,f,c,v,h),O==="haystack"){var A=m.haystackPts;if(A&&A.length===2){if(f=A[0].x,c=A[0].y,v=A[1].x,h=A[1].y,f>v){var N=f;f=v,v=N}if(c>h){var F=c;c=h,h=F}Pt(o,f-P,c-P,v+P,h+P)}}else if(O==="bezier"||O==="unbundled-bezier"||O==="segments"||O==="taxi"){var q;switch(O){case"bezier":case"unbundled-bezier":q=m.bezierPts;break;case"segments":case"taxi":q=m.linePts;break}if(q!=null)for(var z=0;z<q.length;z++){var $=q[z];f=$.x-P,v=$.x+P,c=$.y-P,h=$.y+P,Pt(o,f,c,v,h)}}}else{var K=e.source(),Y=K.position(),H=e.target(),W=H.position();if(f=Y.x,v=W.x,c=Y.y,h=W.y,f>v){var I=f;f=v,v=I}if(c>h){var G=c;c=h,h=G}f-=P,v+=P,c-=P,h+=P,Pt(o,f,c,v,h)}if(n&&r.includeEdges&&l&&(Za(o,e,"mid-source"),Za(o,e,"mid-target"),Za(o,e,"source"),Za(o,e,"target")),n){var Z=e.pstyle("ghost").value==="yes";if(Z){var _=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;Pt(o,o.x1+_,o.y1+ee,o.x2+_,o.y2+ee)}}var de=s.bodyBounds=s.bodyBounds||{};Co(de,o),Un(de,g),on(de,1),n&&(f=o.x1,v=o.x2,c=o.y1,h=o.y2,Pt(o,f-T,c-T,v+T,h+T));var he=s.overlayBounds=s.overlayBounds||{};Co(he,o),Un(he,g),on(he,1);var re=s.labelBounds=s.labelBounds||{};re.all!=null?yd(re.all):re.all=ct(),n&&r.includeLabels&&(r.includeMainLabels&&jn(o,e,null),l&&(r.includeSourceLabels&&jn(o,e,"source"),r.includeTargetLabels&&jn(o,e,"target")))}return o.x1=bt(o.x1),o.y1=bt(o.y1),o.x2=bt(o.x2),o.y2=bt(o.y2),o.w=bt(o.x2-o.x1),o.h=bt(o.y2-o.y1),o.w>0&&o.h>0&&b&&(Un(o,g),on(o,1)),o},xu=function(e){var r=0,a=function(o){return(o?1:0)<<r++},n=0;return n+=a(e.incudeNodes),n+=a(e.includeEdges),n+=a(e.includeLabels),n+=a(e.includeMainLabels),n+=a(e.includeSourceLabels),n+=a(e.includeTargetLabels),n+=a(e.includeOverlays),n},Eu=function(e){if(e.isEdge()){var r=e.source().position(),a=e.target().position(),n=function(o){return Math.round(o)};return $c([n(r.x),n(r.y),n(a.x),n(a.y)])}else return 0},$o=function(e,r){var a=e._private,n,i=e.isEdge(),o=r==null?qo:xu(r),s=o===qo,u=Eu(e),l=a.bbCachePosKey===u,f=r.useCache&&l,v=function(p){return p._private.bbCache==null||p._private.styleDirty},c=!f||v(e)||i&&v(e.source())||v(e.target());if(c?(l||e.recalculateRenderedStyle(f),n=Gh(e,Ta),a.bbCache=n,a.bbCachePosKey=u):n=a.bbCache,!s){var h=e.isNode();n=ct(),(r.includeNodes&&h||r.includeEdges&&!h)&&(r.includeOverlays?vr(n,a.overlayBounds):vr(n,a.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?vr(n,a.labelBounds.all):(r.includeMainLabels&&vr(n,a.labelBounds.mainRot),r.includeSourceLabels&&vr(n,a.labelBounds.sourceRot),r.includeTargetLabels&&vr(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Ta={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,useCache:!0},qo=xu(Ta),Ho=Je(Ta);ir.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=Ta:t=Ho(t),e=$o(this[0],t);else{e=ct(),t=t||Ta;var r=Ho(t),a=this,n=a.cy(),i=n.styleEnabled();if(i)for(var o=0;o<a.length;o++){var s=a[o],u=s._private,l=Eu(s),f=u.bbCachePosKey===l,v=r.useCache&&f&&!u.styleDirty;s.recalculateRenderedStyle(v)}this.updateCompoundBounds(!t.useCache);for(var c=0;c<a.length;c++){var h=a[c];vr(e,$o(h,r))}}return e.x1=bt(e.x1),e.y1=bt(e.y1),e.x2=bt(e.x2),e.y2=bt(e.y2),e.w=bt(e.x2-e.x1),e.h=bt(e.y2-e.y1),e};ir.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};ir.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a&&(n=e.filter(function(l){return l.isParent()}),e=e.not(n)),Ce(t)){var i=t;t=function(){return i}}var o=function(f,v){return f._private.bbAtOldPos=t(f,v)},s=function(f){return f._private.bbAtOldPos};r.startBatch(),e.forEach(o).silentPositions(t),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var u=md(this.boundingBox({useCache:!1}));return e.silentPositions(s),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),u};Vr.boundingbox=Vr.bb=Vr.boundingBox;Vr.renderedBoundingbox=Vr.renderedBoundingBox;var Yh=ir,ca,Ra;ca=Ra={};var Cu=function(e){e.uppercaseName=bo(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=bo(e.outerName),ca[e.name]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var s=a.pstyle(e.name);switch(s.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},ca["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){var s=a[e.name](),u=a.pstyle("border-width").pfValue,l=2*a.padding();return s+u+l}else return 1},ca["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},ca["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};Cu({name:"width"});Cu({name:"height"});Ra.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};Ra.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};Ra.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var Xh=Ra,Uh=function(e,r){if(e.isEdge())return r(e)},Zh=function(e,r){if(e.isEdge()){var a=e.cy();return Pn(r(e),a.zoom(),a.pan())}},Qh=function(e,r){if(e.isEdge()){var a=e.cy(),n=a.pan(),i=a.zoom();return r(e).map(function(o){return Pn(o,i,n)})}},Jh=function(e){return e.renderer().getControlPoints(e)},jh=function(e){return e.renderer().getSegmentPoints(e)},_h=function(e){return e.renderer().getSourceEndpoint(e)},eg=function(e){return e.renderer().getTargetEndpoint(e)},tg=function(e){return e.renderer().getEdgeMidpoint(e)},Wo={controlPoints:{get:Jh,mult:!0},segmentPoints:{get:jh,mult:!0},sourceEndpoint:{get:_h},targetEndpoint:{get:eg},midpoint:{get:tg}},rg=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},ag=Object.keys(Wo).reduce(function(t,e){var r=Wo[e],a=rg(e);return t[e]=function(){return Uh(this,r.get)},r.mult?t[a]=function(){return Qh(this,r.get)}:t[a]=function(){return Zh(this,r.get)},t},{}),ng=ce({},Kh,Yh,Xh,ag);/*!
Event object based on jQuery events, MIT license

https://jquery.org/license/
https://tldrlegal.com/license/mit-license
https://github.com/jquery/jquery/blob/master/src/event.js
*/var Su=function(e,r){this.recycle(e,r)};function oa(){return!1}function Qa(){return!0}Su.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=oa,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Qa:oa):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var a=this.position,n=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:a.x*n+i.x,y:a.y*n+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Qa;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Qa;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Qa,this.stopPropagation()},isDefaultPrevented:oa,isPropagationStopped:oa,isImmediatePropagationStopped:oa};var Tu=/^([^.]+)(\.(?:[^.]+))?$/,ig=".*",Du={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Ko=Object.keys(Du),og={};function Mn(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:og,e=arguments.length>1?arguments[1]:void 0,r=0;r<Ko.length;r++){var a=Ko[r];this[a]=t[a]||Du[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var nr=Mn.prototype,ku=function(e,r,a,n,i,o,s){ze(n)&&(i=n,n=null),s&&(o==null?o=s:o=ce({},o,s));for(var u=Ae(a)?a:a.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!er(f)){var v=f.match(Tu);if(v){var c=v[1],h=v[2]?v[2]:null,d=r(e,f,c,h,n,i,o);if(d===!1)break}}}},Go=function(e,r){return e.addEventFields(e.context,r),new Su(r.type,r)},sg=function(e,r,a){if(wc(a)){r(e,a);return}else if(Ce(a)){r(e,Go(e,a));return}for(var n=Ae(a)?a:a.split(/\s+/),i=0;i<n.length;i++){var o=n[i];if(!er(o)){var s=o.match(Tu);if(s){var u=s[1],l=s[2]?s[2]:null,f=Go(e,{type:u,namespace:l,target:e.context});r(e,f)}}}};nr.on=nr.addListener=function(t,e,r,a,n){return ku(this,function(i,o,s,u,l,f,v){ze(f)&&i.listeners.push({event:o,callback:f,type:s,namespace:u,qualifier:l,conf:v})},t,e,r,a,n),this};nr.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})};nr.removeListener=nr.off=function(t,e,r,a){var n=this;this.emitting!==0&&(this.listeners=Gc(this.listeners));for(var i=this.listeners,o=function(l){var f=i[l];ku(n,function(v,c,h,d,p,m){if((f.type===h||t==="*")&&(!d&&f.namespace!==".*"||f.namespace===d)&&(!p||v.qualifierCompare(f.qualifier,p))&&(!m||f.callback===m))return i.splice(l,1),!1},t,e,r,a)},s=i.length-1;s>=0;s--)o(s);return this};nr.removeAllListeners=function(){return this.removeListener("*")};nr.emit=nr.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,Ae(e)||(e=[e]),sg(this,function(i,o){r!=null&&(a=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],n=a.length);for(var s=function(f){var v=a[f];if(v.type===o.type&&(!v.namespace||v.namespace===o.namespace||v.namespace===ig)&&i.eventMatches(i.context,v,o)){var c=[o];e!=null&&Xc(c,e),i.beforeEmit(i.context,v,o),v.conf&&v.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==v}));var h=i.callbackContext(i.context,v,o),d=v.callback.apply(h,c);i.afterEmit(i.context,v,o),d===!1&&(o.stopPropagation(),o.preventDefault())}},u=0;u<n;u++)s(u);i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},t),this.emitting--,this};var ug={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&Oa(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Ja=function(e){return fe(e)?new rr(e):e},Pu={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;a.emitter||(a.emitter=new Mn(ug,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){for(var n=Ja(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a)}return this},removeListener:function(e,r,a){for(var n=Ja(r),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,a){for(var n=Ja(r),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,n,a)}return this},once:function(e,r,a){for(var n=Ja(r),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,r){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};Be.eventAliasesOn(Pu);var Bu={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):r.push(n)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(fe(e)||ht(e))return new rr(e).filter(this);if(ze(e)){for(var a=this.spawn(),n=this,i=0;i<n.length;i++){var o=n[i],s=r?e.apply(r,[o,i,n]):e(o,i,n);s&&a.push(o)}return a}return this.spawn()},not:function(e){if(e){fe(e)&&(e=this.filter(e));for(var r=this.spawn(),a=0;a<this.length;a++){var n=this[a],i=e.has(n);i||r.push(n)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(fe(e)){var r=e;return this.filter(r)}for(var a=this.spawn(),n=this,i=e,o=this.length<e.length,s=o?n:i,u=o?i:n,l=0;l<s.length;l++){var f=s[l];u.has(f)&&a.push(f)}return a},xor:function(e){var r=this._private.cy;fe(e)&&(e=r.$(e));var a=this.spawn(),n=this,i=e,o=function(u,l){for(var f=0;f<u.length;f++){var v=u[f],c=v._private.data.id,h=l.hasElementWithId(c);h||a.push(v)}};return o(n,i),o(i,n),a},diff:function(e){var r=this._private.cy;fe(e)&&(e=r.$(e));var a=this.spawn(),n=this.spawn(),i=this.spawn(),o=this,s=e,u=function(f,v,c){for(var h=0;h<f.length;h++){var d=f[h],p=d._private.data.id,m=v.hasElementWithId(p);m?i.merge(d):c.push(d)}};return u(o,s,a),u(s,o,n),{left:a,right:n,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(fe(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&n.push(o)}return n},merge:function(e){var r=this._private,a=r.cy;if(!e)return this;if(e&&fe(e)){var n=e;e=a.mutableElements().filter(n)}for(var i=r.map,o=0;o<e.length;o++){var s=e[o],u=s._private.data.id,l=!i.has(u);if(l){var f=this.length++;this[f]=s,i.set(u,{ele:s,index:f})}}return this},unmergeAt:function(e){var r=this[e],a=r.id(),n=this._private,i=n.map;this[e]=void 0,i.delete(a);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,u=this[s],l=u._private.data.id;this[s]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map,i=n.get(a);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&fe(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var a=this[r];e(a)&&this.unmergeAt(r)}return this},map:function(e,r){for(var a=[],n=this,i=0;i<n.length;i++){var o=n[i],s=r?e.apply(r,[o,i,n]):e(o,i,n);a.push(s)}return a},reduce:function(e,r){for(var a=r,n=this,i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,r){for(var a=-1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u>a&&(a=u,n=s)}return{value:a,ele:n}},min:function(e,r){for(var a=1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],u=r?e.apply(r,[s,o,i]):e(s,o,i);u<a&&(a=u,n=s)}return{value:a,ele:n}}},De=Bu;De.u=De["|"]=De["+"]=De.union=De.or=De.add;De["\\"]=De["!"]=De["-"]=De.difference=De.relativeComplement=De.subtract=De.not;De.n=De["&"]=De["."]=De.and=De.intersection=De.intersect;De["^"]=De["(+)"]=De["(-)"]=De.symmetricDifference=De.symdiff=De.xor;De.fnFilter=De.filterFn=De.stdFilter=De.filter;De.complement=De.abscomp=De.absoluteComplement;var lg={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Lu=function(e,r){var a=e.cy(),n=a.hasCompoundNodes();function i(f){var v=f.pstyle("z-compound-depth");return v.value==="auto"?n?f.zDepth():0:v.value==="bottom"?-1:v.value==="top"?Di:0}var o=i(e)-i(r);if(o!==0)return o;function s(f){var v=f.pstyle("z-index-compare");return v.value==="auto"&&f.isNode()?1:0}var u=s(e)-s(r);if(u!==0)return u;var l=e.pstyle("z-index").value-r.pstyle("z-index").value;return l!==0?l:e.poolIndex()-r.poolIndex()},yn={forEach:function(e,r){if(ze(e))for(var a=this.length,n=0;n<a;n++){var i=this[n],o=r?e.apply(r,[i,n,this]):e(i,n,this);if(o===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var a=[],n=this.length;r==null&&(r=n),e==null&&(e=0),e<0&&(e=n+e),r<0&&(r=n+r);for(var i=e;i>=0&&i<r&&i<n;i++)a.push(this[i]);return this.spawn(a)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!ze(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(Lu)},zDepth:function(){var e=this[0];if(e){var r=e._private,a=r.group;if(a==="nodes"){var n=r.data.parent?e.parents().size():0;return e.isParent()?n:Di-1}else{var i=r.source,o=r.target,s=i.zDepth(),u=o.zDepth();return Math.max(s,u,0)}}}};yn.each=yn.forEach;var fg=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":We(Symbol))!=e&&We(Symbol.iterator)!=e;r&&(yn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,o=this.length;return Ns({next:function(){return i<o?n.value=a[i++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};fg();var vg=Je({nodeDimensionsIncludeLabels:!1}),un={layoutDimensions:function(e){e=vg(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();r={w:a.w,h:a.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,a){var n=this.nodes().filter(function(S){return!S.isParent()}),i=this.cy(),o=r.eles,s=function(C){return C.id()},u=ya(a,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(C,x,T){var E={x:x.x1+x.w/2,y:x.y1+x.h/2},P={x:(T.x-E.x)*C,y:(T.y-E.y)*C};return{x:E.x+P.x,y:E.y+P.y}},f=r.spacingFactor&&r.spacingFactor!==1,v=function(){if(!f)return null;for(var C=ct(),x=0;x<n.length;x++){var T=n[x],E=u(T,x);wd(C,E.x,E.y)}return C},c=v(),h=ya(function(S,C){var x=u(S,C);if(f){var T=Math.abs(r.spacingFactor);x=l(T,c,x)}return r.transform!=null&&(x=r.transform(S,x)),x},s);if(r.animate){for(var d=0;d<n.length;d++){var p=n[d],m=h(p,d),g=r.animateFilter==null||r.animateFilter(p,d);if(g){var y=p.animation({position:m,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(y)}else p.position(m)}if(r.fit){var b=i.animation({fit:{boundingBox:o.boundingBoxAt(h),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else if(r.zoom!==void 0&&r.pan!==void 0){var w=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}e.animations.forEach(function(S){return S.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Zr.all(e.animations.map(function(S){return S.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(h),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(ce({},e,{eles:this}))}};un.createLayout=un.makeLayout=un.layout;function Mu(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],i;return(i=n[t])!=null||(i=n[t]=e(r)),i}function On(t,e){return t=hr(t),function(a){return Mu(t,e,a)}}function An(t,e){t=hr(t);var r=function(n){return e.call(n)};return function(){var n=this[0];if(n)return Mu(t,r,n)}}var Ze={recalculateRenderedStyle:function(e){var r=this.cy(),a=r.renderer(),n=r.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var a;a=this.spawnSelf().merge(this.descendants()).merge(this.parents()),a.merge(a.connectedEdges()),a.forEach(r)}else this.forEach(function(n){r(n),n.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var a=r._private.batchStyleEles;return a.merge(this),this}var n=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),n&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var a=this[r];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){this.cleanStyle();var i=a._private.style[e];return i??(r?n.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var a=r.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=this[0];if(a)return r.style().getRenderedStyle(a,e)},style:function(e,r){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Ce(e)){var o=e;i.applyBypass(this,o,n),this.emitAndNotify("style")}else if(fe(e))if(r===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];n.removeAllBypasses(s,a)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];n.removeBypasses(l,e,a)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!r)return i;var o=n.data.parent?a.parents():null;if(o)for(var s=0;s<o.length;s++){var u=o[s],l=u.pstyle("opacity").value;i=l*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],a=r.cy().hasCompoundNodes();if(r)return a?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function _n(t,e){var r=t._private,a=r.data.parent?t.parents():null;if(a)for(var n=0;n<a.length;n++){var i=a[n];if(!e(i))return!1}return!0}function Ii(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,a=t.parentOk||t.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],o=n.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||_n(i,a);var u=s.source,l=s.target;return r(u)&&(!o||_n(u,r))&&(u===l||r(l)&&(!o||_n(l,r)))}}}var Qr=On("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ze.takesUpSpace=An("takesUpSpace",Ii({ok:Qr}));var cg=On("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Qr(t)}),dg=On("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Qr(t)});Ze.interactive=An("interactive",Ii({ok:cg,parentOk:dg,edgeOkViaNode:Qr}));Ze.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var hg=On("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Qr(t)}),gg=Qr;Ze.visible=An("visible",Ii({ok:hg,edgeOkViaNode:gg}));Ze.hidden=function(){var t=this[0];if(t)return!t.visible()};Ze.isBundledBezier=An("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});Ze.bypass=Ze.css=Ze.style;Ze.renderedCss=Ze.renderedStyle;Ze.removeBypass=Ze.removeCss=Ze.removeStyle;Ze.pstyle=Ze.parsedStyle;var _t={};function Yo(t){return function(){var e=arguments,r=[];if(e.length===2){var a=e[0],n=e[1];this.on(t.event,a,n)}else if(e.length===1&&ze(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Ae(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var u=this[s],l=!t.ableField||u._private[t.ableField],f=u._private[t.field]!=t.value;if(t.overrideAble){var v=t.overrideAble(u);if(v!==void 0&&(l=v,!v))return this}l&&(u._private[t.field]=t.value,f&&r.push(u))}var c=this.spawn(r);c.updateStyle(),c.emit(t.event),o&&c.emit(o)}return this}}function Jr(t){_t[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},_t[t.on]=Yo({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),_t[t.off]=Yo({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Jr({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Jr({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Jr({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Jr({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});_t.deselect=_t.unselect;_t.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Jr({field:"active",on:"activate",off:"unactivate"});Jr({field:"pannable",on:"panify",off:"unpanify"});_t.inactive=function(){var t=this[0];if(t)return!t._private.active};var tt={},Xo=function(e){return function(a){for(var n=this,i=[],o=0;o<n.length;o++){var s=n[o];if(s.isNode()){for(var u=!1,l=s.connectedEdges(),f=0;f<l.length;f++){var v=l[f],c=v.source(),h=v.target();if(e.noIncomingEdges&&h===s&&c!==s||e.noOutgoingEdges&&c===s&&h!==s){u=!0;break}}u||i.push(s)}}return this.spawn(i,!0).filter(a)}},Uo=function(e){return function(r){for(var a=this,n=[],i=0;i<a.length;i++){var o=a[i];if(o.isNode())for(var s=o.connectedEdges(),u=0;u<s.length;u++){var l=s[u],f=l.source(),v=l.target();e.outgoing&&f===o?(n.push(l),n.push(v)):e.incoming&&v===o&&(n.push(l),n.push(f))}}return this.spawn(n,!0).filter(r)}},Zo=function(e){return function(r){for(var a=this,n=[],i={};;){var o=e.outgoing?a.outgoers():a.incomers();if(o.length===0)break;for(var s=!1,u=0;u<o.length;u++){var l=o[u],f=l.id();i[f]||(i[f]=!0,n.push(l),s=!0)}if(!s)break;a=o}return this.spawn(n,!0).filter(r)}};tt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};ce(tt,{roots:Xo({noIncomingEdges:!0}),leaves:Xo({noOutgoingEdges:!0}),outgoers:wt(Uo({outgoing:!0}),"outgoers"),successors:Zo({outgoing:!0}),incomers:wt(Uo({incoming:!0}),"incomers"),predecessors:Zo({incoming:!0})});ce(tt,{neighborhood:wt(function(t){for(var e=[],r=this.nodes(),a=0;a<r.length;a++)for(var n=r[a],i=n.connectedEdges(),o=0;o<i.length;o++){var s=i[o],u=s.source(),l=s.target(),f=n===u?l:u;f.length>0&&e.push(f[0]),e.push(s[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});tt.neighbourhood=tt.neighborhood;tt.closedNeighbourhood=tt.closedNeighborhood;tt.openNeighbourhood=tt.openNeighborhood;ce(tt,{source:wt(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"source"),target:wt(function(e){var r=this[0],a;return r&&(a=r._private.target||r.cy().collection()),a&&e?a.filter(e):a},"target"),sources:Qo({attr:"source"}),targets:Qo({attr:"target"})});function Qo(t){return function(r){for(var a=[],n=0;n<this.length;n++){var i=this[n],o=i._private[t.attr];o&&a.push(o)}return this.spawn(a,!0).filter(r)}}ce(tt,{edgesWith:wt(Jo(),"edgesWith"),edgesTo:wt(Jo({thisIsSrc:!0}),"edgesTo")});function Jo(t){return function(r){var a=[],n=this._private.cy,i=t||{};fe(r)&&(r=n.$(r));for(var o=0;o<r.length;o++)for(var s=r[o]._private.edges,u=0;u<s.length;u++){var l=s[u],f=l._private.data,v=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),c=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),h=v||c;h&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!v||i.thisIsTgt&&!c)||a.push(l))}return this.spawn(a,!0)}}ce(tt,{connectedEdges:wt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];if(n.isNode())for(var i=n._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:wt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:wt(jo(),"parallelEdges"),codirectedEdges:wt(jo({codirected:!0}),"codirectedEdges")});function jo(t){var e={codirected:!1};return t=ce({},e,t),function(a){for(var n=[],i=this.edges(),o=t,s=0;s<i.length;s++)for(var u=i[s],l=u._private,f=l.source,v=f._private.data.id,c=l.data.target,h=f._private.edges,d=0;d<h.length;d++){var p=h[d],m=p._private.data,g=m.target,y=m.source,b=g===c&&y===v,w=v===g&&c===y;(o.codirected&&b||!o.codirected&&(b||w))&&n.push(p)}return this.spawn(n,!0).filter(a)}}ce(tt,{components:function(e){var r=this,a=r.cy(),n=a.collection(),i=e==null?r.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(f,v){n.merge(f),i.unmerge(f),v.merge(f)};if(i.empty())return r.spawn();var u=function(){var f=a.collection();o.push(f);var v=i[0];s(v,f),r.bfs({directed:!1,roots:v,visit:function(h){return s(h,f)}}),f.forEach(function(c){c.connectedEdges().forEach(function(h){r.has(h)&&f.has(h.source())&&f.has(h.target())&&f.merge(h)})})};do u();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});tt.componentsOf=tt.components;var Qe=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Ve("A collection must have a reference to the core");return}var i=new At,o=!1;if(!r)r=[];else if(r.length>0&&Ce(r[0])&&!Oa(r[0])){o=!0;for(var s=[],u=new Ur,l=0,f=r.length;l<f;l++){var v=r[l];v.data==null&&(v.data={});var c=v.data;if(c.id==null)c.id=Qs();else if(e.hasElementWithId(c.id)||u.has(c.id))continue;var h=new kn(e,v,!1);s.push(h),u.add(c.id)}r=s}this.length=0;for(var d=0,p=r.length;d<p;d++){var m=r[d][0];if(m!=null){var g=m._private.data.id;(!a||!i.has(g))&&(a&&i.set(g,{index:this.length,ele:m}),this[this.length]=m,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(y){this.lazyMap=y},rebuildMap:function(){for(var b=this.lazyMap=new At,w=this.eles,S=0;S<w.length;S++){var C=w[S];b.set(C.id(),{index:S,ele:C})}}},a&&(this._private.map=i),o&&!n&&this.restore()},Ie=kn.prototype=Qe.prototype=Object.create(Array.prototype);Ie.instanceString=function(){return"collection"};Ie.spawn=function(t,e){return new Qe(this.cy(),t,e)};Ie.spawnSelf=function(){return this.spawn(this)};Ie.cy=function(){return this._private.cy};Ie.renderer=function(){return this._private.cy.renderer()};Ie.element=function(){return this[0]};Ie.collection=function(){return Fs(this)?this:new Qe(this._private.cy,[this])};Ie.unique=function(){return new Qe(this._private.cy,this,!0)};Ie.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};Ie.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Qe(e)};Ie.$id=Ie.getElementById;Ie.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};Ie.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};Ie.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};Ie.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var a=e._private;if(Ce(t)){if(r.startBatch(),t.data){e.data(t.data);var n=a.data;if(e.isEdge()){var i=!1,o={},s=t.data.source,u=t.data.target;s!=null&&s!=n.source&&(o.source=""+s,i=!0),u!=null&&u!=n.target&&(o.target=""+u,i=!0),i&&(e=e.move(o))}else{var l="parent"in t.data,f=t.data.parent;l&&(f!=null||n.parent!=null)&&f!=n.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var v=function(p,m,g){var y=t[p];y!=null&&y!==a[p]&&(y?e[m]():e[g]())};return v("removed","remove","restore"),v("selected","select","unselect"),v("selectable","selectify","unselectify"),v("locked","lock","unlock"),v("grabbable","grabify","ungrabify"),v("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var c={data:Ot(a.data),position:Ot(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,pannable:a.pannable,classes:null};c.classes="";var h=0;return a.classes.forEach(function(d){return c.classes+=h++===0?d:" "+d}),c}}};Ie.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],a=r.json();t.push(a)}return t};Ie.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var a=this[r],n=a.json(),i=new kn(t,n,!1);e.push(i)}return new Qe(t,e)};Ie.copy=Ie.clone;Ie.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=r.cy(),n=a._private,i=[],o=[],s,u=0,l=r.length;u<l;u++){var f=r[u];e&&!f.removed()||(f.isNode()?i.push(f):o.push(f))}s=i.concat(o);var v,c=function(){s.splice(v,1),v--};for(v=0;v<s.length;v++){var h=s[v],d=h._private,p=d.data;if(h.clearTraversalCache(),!(!e&&!d.removed)){if(p.id===void 0)p.id=Qs();else if(ne(p.id))p.id=""+p.id;else if(er(p.id)||!fe(p.id)){Ve("Can not create element with invalid string ID `"+p.id+"`"),c();continue}else if(a.hasElementWithId(p.id)){Ve("Can not create second element with ID `"+p.id+"`"),c();continue}}var m=p.id;if(h.isNode()){var g=d.position;g.x==null&&(g.x=0),g.y==null&&(g.y=0)}if(h.isEdge()){for(var y=h,b=["source","target"],w=b.length,S=!1,C=0;C<w;C++){var x=b[C],T=p[x];ne(T)&&(T=p[x]=""+p[x]),T==null||T===""?(Ve("Can not create edge `"+m+"` with unspecified "+x),S=!0):a.hasElementWithId(T)||(Ve("Can not create edge `"+m+"` with nonexistant "+x+" `"+T+"`"),S=!0)}if(S){c();continue}var E=a.getElementById(p.source),P=a.getElementById(p.target);E.same(P)?E._private.edges.push(y):(E._private.edges.push(y),P._private.edges.push(y)),y._private.source=E,y._private.target=P}d.map=new At,d.map.set(m,{ele:h,index:0}),d.removed=!1,e&&a.addToPool(h)}for(var B=0;B<i.length;B++){var D=i[B],M=D._private.data;ne(M.parent)&&(M.parent=""+M.parent);var L=M.parent,R=L!=null;if(R||D._private.parent){var O=D._private.parent?a.collection().merge(D._private.parent):a.getElementById(L);if(O.empty())M.parent=void 0;else if(O[0].removed())Le("Node added with missing parent, reference to parent removed"),M.parent=void 0,D._private.parent=null;else{for(var A=!1,N=O;!N.empty();){if(D.same(N)){A=!0,M.parent=void 0;break}N=N.parent()}A||(O[0]._private.children.push(D),D._private.parent=O[0],n.hasCompoundNodes=!0)}}}if(s.length>0){for(var F=s.length===r.length?r:new Qe(a,s),q=0;q<F.length;q++){var z=F[q];z.isNode()||(z.parallelEdges().clearTraversalCache(),z.source().clearTraversalCache(),z.target().clearTraversalCache())}var $;n.hasCompoundNodes?$=a.collection().merge(F).merge(F.connectedNodes()).merge(F.parent()):$=F,$.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?F.emitAndNotify("add"):e&&F.emit("add")}return r};Ie.removed=function(){var t=this[0];return t&&t._private.removed};Ie.inside=function(){var t=this[0];return t&&!t._private.removed};Ie.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},i=r._private.cy;function o(L){for(var R=L._private.edges,O=0;O<R.length;O++)u(R[O])}function s(L){for(var R=L._private.children,O=0;O<R.length;O++)u(R[O])}function u(L){var R=n[L.id()];e&&L.removed()||R||(n[L.id()]=!0,L.isNode()?(a.push(L),o(L),s(L)):a.unshift(L))}for(var l=0,f=r.length;l<f;l++){var v=r[l];u(v)}function c(L,R){var O=L._private.edges;tr(O,R),L.clearTraversalCache()}function h(L){L.clearTraversalCache()}var d=[];d.ids={};function p(L,R){R=R[0],L=L[0];var O=L._private.children,A=L.id();tr(O,R),R._private.parent=null,d.ids[A]||(d.ids[A]=!0,d.push(L))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(a);for(var m=0;m<a.length;m++){var g=a[m];if(g.isEdge()){var y=g.source()[0],b=g.target()[0];c(y,g),c(b,g);for(var w=g.parallelEdges(),S=0;S<w.length;S++){var C=w[S];h(C),C.isBundledBezier()&&C.dirtyBoundingBoxCache()}}else{var x=g.parent();x.length!==0&&p(x,g)}e&&(g._private.removed=!0)}var T=i._private.elements;i._private.hasCompoundNodes=!1;for(var E=0;E<T.length;E++){var P=T[E];if(P.isParent()){i._private.hasCompoundNodes=!0;break}}var B=new Qe(this.cy(),a);B.size()>0&&(t?B.emitAndNotify("remove"):e&&B.emit("remove"));for(var D=0;D<d.length;D++){var M=d[D];(!e||!M.removed())&&M.updateStyle()}return B};Ie.move=function(t){var e=this._private.cy,r=this,a=!1,n=!1,i=function(d){return d==null?d:""+d};if(t.source!==void 0||t.target!==void 0){var o=i(t.source),s=i(t.target),u=o!=null&&e.hasElementWithId(o),l=s!=null&&e.hasElementWithId(s);(u||l)&&(e.batch(function(){r.remove(a,n),r.emitAndNotify("moveout");for(var h=0;h<r.length;h++){var d=r[h],p=d._private.data;d.isEdge()&&(u&&(p.source=o),l&&(p.target=s))}r.restore(a,n)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=i(t.parent),v=f===null||e.hasElementWithId(f);if(v){var c=f===null?void 0:f;e.batch(function(){var h=r.remove(a,n);h.emitAndNotify("moveout");for(var d=0;d<r.length;d++){var p=r[d],m=p._private.data;p.isNode()&&(m.parent=c)}h.restore(a,n)}),r.emitAndNotify("move")}}return this};[fu,kh,sn,jt,Hr,Wh,Ln,ng,Pu,Bu,lg,yn,un,Ze,_t,tt].forEach(function(t){ce(Ie,t)});var pg={add:function(e){var r,a=this;if(ht(e)){var n=e;if(n._private.cy===a)r=n.restore();else{for(var i=[],o=0;o<n.length;o++){var s=n[o];i.push(s.json())}r=new Qe(a,i)}}else if(Ae(e)){var u=e;r=new Qe(a,u)}else if(Ce(e)&&(Ae(e.nodes)||Ae(e.edges))){for(var l=e,f=[],v=["nodes","edges"],c=0,h=v.length;c<h;c++){var d=v[c],p=l[d];if(Ae(p))for(var m=0,g=p.length;m<g;m++){var y=ce({group:d},p[m]);f.push(y)}}r=new Qe(a,f)}else{var b=e;r=new kn(a,b).collection()}return r},remove:function(e){if(!ht(e)){if(fe(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function mg(t,e,r,a){var n=4,i=.001,o=1e-7,s=10,u=11,l=1/(u-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var v=0;v<4;++v)if(typeof arguments[v]!="number"||isNaN(arguments[v])||!isFinite(arguments[v]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var c=f?new Float32Array(u):new Array(u);function h(P,B){return 1-3*B+3*P}function d(P,B){return 3*B-6*P}function p(P){return 3*P}function m(P,B,D){return((h(B,D)*P+d(B,D))*P+p(B))*P}function g(P,B,D){return 3*h(B,D)*P*P+2*d(B,D)*P+p(B)}function y(P,B){for(var D=0;D<n;++D){var M=g(B,t,r);if(M===0)return B;var L=m(B,t,r)-P;B-=L/M}return B}function b(){for(var P=0;P<u;++P)c[P]=m(P*l,t,r)}function w(P,B,D){var M,L,R=0;do L=B+(D-B)/2,M=m(L,t,r)-P,M>0?D=L:B=L;while(Math.abs(M)>o&&++R<s);return L}function S(P){for(var B=0,D=1,M=u-1;D!==M&&c[D]<=P;++D)B+=l;--D;var L=(P-c[D])/(c[D+1]-c[D]),R=B+L*l,O=g(R,t,r);return O>=i?y(P,R):O===0?R:w(P,B,B+l)}var C=!1;function x(){C=!0,(t!==e||r!==a)&&b()}var T=function(B){return C||x(),t===e&&r===a?B:B===0?0:B===1?1:m(S(B),e,a)};T.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var E="generateBezier("+[t,e,r,a]+")";return T.toString=function(){return E},T}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var yg=function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var o={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:o.v,dv:t(o)}}function r(a,n){var i={dx:a.v,dv:t(a)},o=e(a,n*.5,i),s=e(a,n*.5,o),u=e(a,n,s),l=1/6*(i.dx+2*(o.dx+s.dx)+u.dx),f=1/6*(i.dv+2*(o.dv+s.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+f*n,a}return function a(n,i,o){var s={x:-1,v:0,tension:null,friction:null},u=[0],l=0,f=1/1e4,v=16/1e3,c,h,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,o=o||null,s.tension=n,s.friction=i,c=o!==null,c?(l=a(n,i),h=l/o*v):h=v;d=r(d||s,h),u.push(1+d.x),l+=16,Math.abs(d.x)>f&&Math.abs(d.v)>f;);return c?function(p){return u[p*(u.length-1)|0]}:l}}(),Re=function(e,r,a,n){var i=mg(e,r,a,n);return function(o,s,u){return o+(s-o)*i(u)}},ln={linear:function(e,r,a){return e+(r-e)*a},ease:Re(.25,.1,.25,1),"ease-in":Re(.42,0,1,1),"ease-out":Re(0,0,.58,1),"ease-in-out":Re(.42,0,.58,1),"ease-in-sine":Re(.47,0,.745,.715),"ease-out-sine":Re(.39,.575,.565,1),"ease-in-out-sine":Re(.445,.05,.55,.95),"ease-in-quad":Re(.55,.085,.68,.53),"ease-out-quad":Re(.25,.46,.45,.94),"ease-in-out-quad":Re(.455,.03,.515,.955),"ease-in-cubic":Re(.55,.055,.675,.19),"ease-out-cubic":Re(.215,.61,.355,1),"ease-in-out-cubic":Re(.645,.045,.355,1),"ease-in-quart":Re(.895,.03,.685,.22),"ease-out-quart":Re(.165,.84,.44,1),"ease-in-out-quart":Re(.77,0,.175,1),"ease-in-quint":Re(.755,.05,.855,.06),"ease-out-quint":Re(.23,1,.32,1),"ease-in-out-quint":Re(.86,0,.07,1),"ease-in-expo":Re(.95,.05,.795,.035),"ease-out-expo":Re(.19,1,.22,1),"ease-in-out-expo":Re(1,0,0,1),"ease-in-circ":Re(.6,.04,.98,.335),"ease-out-circ":Re(.075,.82,.165,1),"ease-in-out-circ":Re(.785,.135,.15,.86),spring:function(e,r,a){if(a===0)return ln.linear;var n=yg(e,r,a);return function(i,o,s){return i+(o-i)*n(s)}},"cubic-bezier":Re};function _o(t,e,r,a,n){if(a===1||e===r)return r;var i=n(e,r,a);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function es(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Pr(t,e,r,a,n){var i=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var o=es(t,n),s=es(e,n);if(ne(o)&&ne(s))return _o(i,o,s,r,a);if(Ae(o)&&Ae(s)){for(var u=[],l=0;l<s.length;l++){var f=o[l],v=s[l];if(f!=null&&v!=null){var c=_o(i,f,v,r,a);u.push(c)}else u.push(v)}return u}}function bg(t,e,r,a){var n=!a,i=t._private,o=e._private,s=o.easing,u=o.startTime,l=a?t:t.cy(),f=l.style();if(!o.easingImpl)if(s==null)o.easingImpl=ln.linear;else{var v;if(fe(s)){var c=f.parse("transition-timing-function",s);v=c.value}else v=s;var h,d;fe(v)?(h=v,d=[]):(h=v[1],d=v.slice(2).map(function(F){return+F})),d.length>0?(h==="spring"&&d.push(o.duration),o.easingImpl=ln[h].apply(null,d)):o.easingImpl=ln[h]}var p=o.easingImpl,m;if(o.duration===0?m=1:m=(r-u)/o.duration,o.applying&&(m=o.progress),m<0?m=0:m>1&&(m=1),o.delay==null){var g=o.startPosition,y=o.position;if(y&&n&&!t.locked()){var b={};sa(g.x,y.x)&&(b.x=Pr(g.x,y.x,m,p)),sa(g.y,y.y)&&(b.y=Pr(g.y,y.y,m,p)),t.position(b)}var w=o.startPan,S=o.pan,C=i.pan,x=S!=null&&a;x&&(sa(w.x,S.x)&&(C.x=Pr(w.x,S.x,m,p)),sa(w.y,S.y)&&(C.y=Pr(w.y,S.y,m,p)),t.emit("pan"));var T=o.startZoom,E=o.zoom,P=E!=null&&a;P&&(sa(T,E)&&(i.zoom=Ea(i.minZoom,Pr(T,E,m,p),i.maxZoom)),t.emit("zoom")),(x||P)&&t.emit("viewport");var B=o.style;if(B&&B.length>0&&n){for(var D=0;D<B.length;D++){var M=B[D],L=M.name,R=M,O=o.startStyle[L],A=f.properties[O.name],N=Pr(O,R,m,p,A);f.overrideBypass(t,L,N)}t.emit("style")}}return o.progress=m,m}function sa(t,e){return t==null||e==null?!1:ne(t)&&ne(e)?!0:!!(t&&e)}function wg(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}function ts(t,e){var r=e._private.aniEles,a=[];function n(f,v){var c=f._private,h=c.animation.current,d=c.animation.queue,p=!1;if(h.length===0){var m=d.shift();m&&h.push(m)}for(var g=function(C){for(var x=C.length-1;x>=0;x--){var T=C[x];T()}C.splice(0,C.length)},y=h.length-1;y>=0;y--){var b=h[y],w=b._private;if(w.stopped){h.splice(y,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||wg(f,b,t),bg(f,b,t,v),w.applying&&(w.applying=!1),g(w.frames),w.step!=null&&w.step(t),b.completed()&&(h.splice(y,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.completes)),p=!0)}return!v&&h.length===0&&d.length===0&&a.push(f),p}for(var i=!1,o=0;o<r.length;o++){var s=r[o],u=n(s);i=i||u}var l=n(e,!0);(i||l)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}var xg={animate:Be.animate(),animation:Be.animation(),animated:Be.animated(),clearQueue:Be.clearQueue(),delay:Be.delay(),delayAnimation:Be.delayAnimation(),stop:Be.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&gn(function(i){ts(i,e),r()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,o){ts(o,e)},a.beforeRenderPriorities.animations):r()}},Eg={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&Oa(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e}},ja=function(e){return fe(e)?new rr(e):e},Ou={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Mn(Eg,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,a){return this.emitter().on(e,ja(r),a),this},removeListener:function(e,r,a){return this.emitter().removeListener(e,ja(r),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,a){return this.emitter().one(e,ja(r),a),this},once:function(e,r,a){return this.emitter().one(e,ja(r),a),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Be.eventAliasesOn(Ou);var fi={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};fi.jpeg=fi.jpg;var fn={layout:function(e){var r=this;if(e==null){Ve("Layout options must be specified to make a layout");return}if(e.name==null){Ve("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){Ve("No such layout `"+a+"` found.  Did you forget to import it and `cytoscape.use()` it?");return}var i;fe(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var o=new n(ce({},e,{cy:r,eles:i}));return o}};fn.createLayout=fn.makeLayout=fn.layout;var Cg={notify:function(e,r){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();r!=null&&n.merge(r);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?r.notify(a):r.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n<a.length;n++){var i=a[n],o=e[i],s=r.getElementById(i);s.data(o)}})}},Sg=Je({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),vi={renderTo:function(e,r,a,n){var i=this._private.renderer;return i.renderTo(e,r,a,n),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,a=r.extension("renderer",e.name);if(a==null){Ve("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Le("You have set a custom wheel sensitivity.  This will make your app zoom unnaturally when using mainstream mice.  You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=Sg(e);n.cy=r,r._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};vi.invalidateDimensions=vi.resize;var vn={collection:function(e,r){return fe(e)?this.$(e):ht(e)?e.collection():Ae(e)?(r||(r={}),new Qe(this,e,r.unique,r.removed)):new Qe(this)},nodes:function(e){var r=this.$(function(a){return a.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(a){return a.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};vn.elements=vn.filter=vn.$;var at={},ha="t",Tg="f";at.apply=function(t){for(var e=this,r=e._private,a=r.cy,n=a.collection(),i=0;i<t.length;i++){var o=t[i],s=e.getContextMeta(o);if(!s.empty){var u=e.getContextStyle(s),l=e.applyContextStyle(s,u,o);o._private.appliedInitStyle?e.updateTransitions(o,l.diffProps):o._private.appliedInitStyle=!0;var f=e.updateStyleHints(o);f&&n.push(o)}}return n};at.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,i=a[n];if(i)return i;for(var o=[],s={},u=0;u<r.length;u++){var l=r[u],f=t[u]===ha,v=e[u]===ha,c=f!==v,h=l.mappedProperties.length>0;if(c||v&&h){var d=void 0;c&&h||c?d=l.properties:h&&(d=l.mappedProperties);for(var p=0;p<d.length;p++){for(var m=d[p],g=m.name,y=!1,b=u+1;b<r.length;b++){var w=r[b],S=e[b]===ha;if(S&&(y=w.properties[m.name]!=null,y))break}!s[g]&&!y&&(s[g]=!0,o.push(g))}}}return a[n]=o,o};at.getContextMeta=function(t){for(var e=this,r="",a,n=t._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(t);s?r+=ha:r+=Tg}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};at.getContextStyle=function(t){var e=t.key,r=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},i=0;i<r.length;i++){var o=r[i],s=e[i]===ha;if(s)for(var u=0;u<o.properties.length;u++){var l=o.properties[u];n[l.name]=l}}return a[e]=n,n};at.applyContextStyle=function(t,e,r){for(var a=this,n=t.diffPropNames,i={},o=a.types,s=0;s<n.length;s++){var u=n[s],l=e[u],f=r.pstyle(u);if(!l)if(f)f.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(f!==l){if(l.mapped===o.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var v=f.mapping,c=v.fnValue=l.value(r);if(c===v.prevFnValue)continue}var h=i[u]={prev:f};a.applyParsedProperty(r,l),h.next=r.pstyle(u),h.next&&h.next.bypass&&(h.next=h.next.bypassed)}}return{diffProps:i}};at.updateStyleHints=function(t){var e=t._private,r=this,a=r.propertyGroupNames,n=r.propertyGroupKeys,i=function(_,ee,de){return r.getPropertiesHash(_,ee,de)},o=e.styleKey;if(t.removed())return!1;var s=e.group==="nodes",u=t._private.style;a=Object.keys(u);for(var l=0;l<n.length;l++){var f=n[l];e.styleKeys[f]=[Ar,fa]}for(var v=function(_,ee){return e.styleKeys[ee][0]=ba(_,e.styleKeys[ee][0])},c=function(_,ee){return e.styleKeys[ee][1]=wa(_,e.styleKeys[ee][1])},h=function(_,ee){v(_,ee),c(_,ee)},d=function(_,ee){for(var de=0;de<_.length;de++){var he=_.charCodeAt(de);v(he,ee),c(he,ee)}},p=2e9,m=function(_){return-128<_&&_<128&&Math.floor(_)!==_?p-(_*1024|0):_},g=0;g<a.length;g++){var y=a[g],b=u[y];if(b!=null){var w=this.properties[y],S=w.type,C=w.groupKey,x=void 0;w.hashOverride!=null?x=w.hashOverride(t,b):b.pfValue!=null&&(x=b.pfValue);var T=w.enums==null?b.value:null,E=x!=null,P=T!=null,B=E||P,D=b.units;if(S.number&&B&&!S.multiple){var M=E?x:T;h(m(M),C),!E&&D!=null&&d(D,C)}else d(b.strValue,C)}}for(var L=[Ar,fa],R=0;R<n.length;R++){var O=n[R],A=e.styleKeys[O];L[0]=ba(A[0],L[0]),L[1]=wa(A[1],L[1])}e.styleKey=Vc(L[0],L[1]);var N=e.styleKeys;e.labelDimsKey=Ut(N.labelDimensions);var F=i(t,["label"],N.labelDimensions);if(e.labelKey=Ut(F),e.labelStyleKey=Ut(Wa(N.commonLabel,F)),!s){var q=i(t,["source-label"],N.labelDimensions);e.sourceLabelKey=Ut(q),e.sourceLabelStyleKey=Ut(Wa(N.commonLabel,q));var z=i(t,["target-label"],N.labelDimensions);e.targetLabelKey=Ut(z),e.targetLabelStyleKey=Ut(Wa(N.commonLabel,z))}if(s){var $=e.styleKeys,K=$.nodeBody,Y=$.nodeBorder,H=$.backgroundImage,W=$.compound,I=$.pie,G=[K,Y,H,W,I].filter(function(Z){return Z!=null}).reduce(Wa,[Ar,fa]);e.nodeKey=Ut(G),e.hasPie=I!=null&&I[0]!==Ar&&I[1]!==fa}return o!==e.styleKey};at.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null};at.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,i,o=r.types,s=r.properties[a.name].type,u=a.bypass,l=n[a.name],f=l&&l.bypass,v=t._private,c="mapping",h=function(K){return K==null?null:K.pfValue!=null?K.pfValue:K.value},d=function(){var K=h(l),Y=h(a);r.checkTriggers(t,a.name,K,Y)};if(a&&a.name.substr(0,3)==="pie"&&Le("The pie style properties are deprecated.  Create charts using background images instead."),e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(a=e=this.parse(e.name,"bezier",u)),a.delete)return n[a.name]=void 0,d(),!0;if(a.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,d(),!0):!1:(d(),!0);if(a.deleteBypass)return l?l.bypass?(n[a.name]=l.bypassed,d(),!0):!1:(d(),!0);var p=function(){Le("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case o.mapData:{for(var m=a.field.split("."),g=v.data,y=0;y<m.length&&g;y++){var b=m[y];g=g[b]}if(g==null)return p(),!1;var w;if(ne(g)){var S=a.fieldMax-a.fieldMin;S===0?w=0:w=(g-a.fieldMin)/S}else return Le("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+g+"` for `"+t.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),s.color){var C=a.valueMin[0],x=a.valueMax[0],T=a.valueMin[1],E=a.valueMax[1],P=a.valueMin[2],B=a.valueMax[2],D=a.valueMin[3]==null?1:a.valueMin[3],M=a.valueMax[3]==null?1:a.valueMax[3],L=[Math.round(C+(x-C)*w),Math.round(T+(E-T)*w),Math.round(P+(B-P)*w),Math.round(D+(M-D)*w)];i={bypass:a.bypass,name:a.name,value:L,strValue:"rgb("+L[0]+", "+L[1]+", "+L[2]+")"}}else if(s.number){var R=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,R,a.bypass,c)}else return!1;if(!i)return p(),!1;i.mapping=a,a=i;break}case o.data:{for(var O=a.field.split("."),A=v.data,N=0;N<O.length&&A;N++){var F=O[N];A=A[F]}if(A!=null&&(i=this.parse(a.name,A,a.bypass,c)),!i)return p(),!1;i.mapping=a,a=i;break}case o.fn:{var q=a.value,z=a.fnValue!=null?a.fnValue:q(t);if(a.prevFnValue=z,z==null)return Le("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(a.name,z,a.bypass,c),!i)return Le("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=Ot(a),a=i;break}case void 0:break;default:return!1}return u?(f?a.bypassed=l.bypassed:a.bypassed=l,n[a.name]=a):f?l.bypassed=a:n[a.name]=a,d(),!0};at.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var a=t[r];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else for(var n=a._private.style,i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],u=n[s];u!=null&&(u.bypass?u.bypassed=null:n[s]=null)}}};at.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};at.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,o=t.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){for(var s={},u=!1,l=0;l<n.length;l++){var f=n[l],v=t.pstyle(f),c=e[f];if(c){var h=c.prev,d=h,p=c.next!=null?c.next:v,m=!1,g=void 0,y=1e-6;d&&(ne(d.pfValue)&&ne(p.pfValue)?(m=p.pfValue-d.pfValue,g=d.pfValue+y*m):ne(d.value)&&ne(p.value)?(m=p.value-d.value,g=d.value+y*m):Ae(d.value)&&Ae(p.value)&&(m=d.value[0]!==p.value[0]||d.value[1]!==p.value[1]||d.value[2]!==p.value[2],g=d.strValue),m&&(s[f]=p.strValue,this.applyBypass(t,f,g),u=!0))}}if(!u)return;a.transitioning=!0,new Zr(function(b){o>0?t.delayAnimation(o).play().promise().then(b):b()}).then(function(){return t.animation({style:s,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1)};at.checkTrigger=function(t,e,r,a,n,i){var o=this.properties[e],s=n(o);s!=null&&s(r,a)&&i(o)};at.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",t)})};at.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),n.triggersBoundsOfParallelBeziers&&(e==="curve-style"&&(r==="bezier"||a==="bezier")||e==="display"&&(r==="none"||a==="none"))&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()})})};at.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a)};var Ia={};Ia.applyBypass=function(t,e,r,a){var n=this,i=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;s<n.properties.length;s++){var u=n.properties[s],l=u.name,f=this.parse(l,r,!0);f&&i.push(f)}}else if(fe(e)){var v=this.parse(e,r,!0);v&&i.push(v)}else if(Ce(e)){var c=e;a=r;for(var h=Object.keys(c),d=0;d<h.length;d++){var p=h[d],m=c[p];if(m===void 0&&(m=c[Dn(p)]),m!==void 0){var g=this.parse(p,m,!0);g&&i.push(g)}}}else return!1;if(i.length===0)return!1;for(var y=!1,b=0;b<t.length;b++){for(var w=t[b],S={},C=void 0,x=0;x<i.length;x++){var T=i[x];if(a){var E=w.pstyle(T.name);C=S[T.name]={prev:E}}y=this.applyParsedProperty(w,Ot(T))||y,a&&(C.next=w.pstyle(T.name))}y&&this.updateStyleHints(w),a&&this.updateTransitions(w,S,o)}return y};Ia.overrideBypass=function(t,e,r){e=Ti(e);for(var a=0;a<t.length;a++){var n=t[a],i=n._private.style[e],o=this.properties[e].type,s=o.color,u=o.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(n,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),s?i.strValue="rgb("+r.join(",")+")":u?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(n)),this.checkTriggers(n,e,l,r)}};Ia.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};Ia.removeBypasses=function(t,e,r){for(var a=!0,n=0;n<t.length;n++){for(var i=t[n],o={},s=0;s<e.length;s++){var u=e[s],l=this.properties[u],f=i.pstyle(l.name);if(!(!f||!f.bypass)){var v="",c=this.parse(u,v,!0),h=o[l.name]={prev:f};this.applyParsedProperty(i,c),h.next=i.pstyle(l.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,o,a)}};var Ni={};Ni.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};Ni.containerCss=function(t){var e=this._private.cy,r=e.container(),a=e.window();if(a&&r&&a.getComputedStyle)return a.getComputedStyle(r).getPropertyValue(t)};var It={};It.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};It.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var a={},n=0;n<r.properties.length;n++){var i=r.properties[n],o=r.getStylePropertyValue(t,i.name,e);o!=null&&(a[i.name]=o,a[Dn(i.name)]=o)}return a}};It.getIndexedStyle=function(t,e,r,a){var n=t.pstyle(e)[r][a];return n??t.cy().style().getDefaultProperty(e)[r][0]};It.getStylePropertyValue=function(t,e,r){var a=this;if(t=t[0],t){var n=a.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,o=t.pstyle(n.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(r&&i.number&&s!=null&&ne(s)){var f=t.cy().zoom(),v=function(m){return m*f},c=function(m,g){return v(m)+g},h=Ae(s),d=h?u.every(function(p){return p!=null}):u!=null;return d?h?s.map(function(p,m){return c(p,u[m])}).join(" "):c(s,u):h?s.map(function(p){return fe(p)?p:""+v(p)}).join(" "):""+v(s)}else if(l!=null)return l}return null}};It.getAnimationStartStyle=function(t,e){for(var r={},a=0;a<e.length;a++){var n=e[a],i=n.name,o=t.pstyle(i);o!==void 0&&(Ce(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(r[i]=o)}return r};It.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a)for(var i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],u=a[s],l=n[s]||n[Ti(s)],f=this.parse(l.name,u);f&&r.push(f)}return r};It.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,i,o,s,u,l;for(u=0;u<e.length;u++)if(n=e[u],i=t.pstyle(n,!1),i!=null)if(i.pfValue!=null)a[0]=ba(s,a[0]),a[1]=wa(s,a[1]);else for(o=i.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),a[0]=ba(s,a[0]),a[1]=wa(s,a[1]);return a};It.getPropertiesHash=It.getNonDefaultPropertiesHash;var Rn={};Rn.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var a=t[r],n=a.selector,i=a.style||a.css,o=Object.keys(i);e.selector(n);for(var s=0;s<o.length;s++){var u=o[s],l=i[u];e.css(u,l)}}return e};Rn.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Rn.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],a=r.selector,n=r.properties,i={},o=0;o<n.length;o++){var s=n[o];i[s.name]=s.strValue}t.push({selector:a?a.toString():"core",style:i})}return t};var zi={};zi.appendFromString=function(t){var e=this,r=this,a=""+t,n,i,o;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){a.length>n.length?a=a.substr(n.length):a=""}function u(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var l=a.match(/^\s*$/);if(l)break;var f=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){Le("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=f[0];var v=f[1];if(v!=="core"){var c=new rr(v);if(c.invalid){Le("Skipping parsing of block: Invalid selector found in string stylesheet: "+v),s();continue}}var h=f[2],d=!1;i=h;for(var p=[];;){var m=i.match(/^\s*$/);if(m)break;var g=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){Le("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),d=!0;break}o=g[0];var y=g[1],b=g[2],w=e.properties[y];if(!w){Le("Skipping property: Invalid property name in: "+o),u();continue}var S=r.parse(y,b);if(!S){Le("Skipping property: Invalid property definition in: "+o),u();continue}p.push({name:y,val:b}),u()}if(d){s();break}r.selector(v);for(var C=0;C<p.length;C++){var x=p[C];r.css(x.name,x.val)}s()}return r};zi.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Ue={};(function(){var t=He,e=Dc,r=Pc,a=Bc,n=Lc,i=function(G){return"^"+G+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(G){var Z=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+G+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+Z+")\\s*\\,\\s*("+Z+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Ue.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(G,Z){switch(G.length){case 2:return Z[0]!=="deg"&&Z[0]!=="rad"&&Z[1]!=="deg"&&Z[1]!=="rad";case 1:return fe(G[0])||Z[0]==="deg"||Z[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(G){var Z=G.length;return Z===1||Z===2||Z===4}}};var u={zeroNonZero:function(G,Z){return(G==null||Z==null)&&G!==Z||G==0&&Z!=0?!0:G!=0&&Z==0},any:function(G,Z){return G!=Z},emptyNonEmpty:function(G,Z){var _=er(G),ee=er(Z);return _&&!ee||!_&&ee}},l=Ue.types,f=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],v=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],c=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],h=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],d=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification}],p=[{name:"events",type:l.bool},{name:"text-events",type:l.bool}],m=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.nonNegativeInt,triggersZOrder:u.any}],g=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any}],y=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any}],b=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],w=function(G,Z){return Z.value==="label"?-G.poolIndex():Z.pfValue},S=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:w},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],C=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle}],x=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],T=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],E=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],P=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],B=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],D=[];Ue.pieBackgroundN=16,D.push({name:"pie-size",type:l.sizeMaybePercent});for(var M=1;M<=Ue.pieBackgroundN;M++)D.push({name:"pie-"+M+"-background-color",type:l.color}),D.push({name:"pie-"+M+"-background-size",type:l.percent}),D.push({name:"pie-"+M+"-background-opacity",type:l.zeroOneNumber});var L=[],R=Ue.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill}].forEach(function(I){R.forEach(function(G){var Z=G+"-"+I.name,_=I.type,ee=I.triggersBounds;L.push({name:Z,type:_,triggersBounds:ee})})},{});var O=Ue.properties=[].concat(p,b,m,g,y,P,d,h,f,v,c,S,C,x,D,T,E,L,B),A=Ue.propertyGroups={behavior:p,transition:b,visibility:m,overlay:g,underlay:y,ghost:P,commonLabel:d,labelDimensions:h,mainLabel:f,sourceLabel:v,targetLabel:c,nodeBody:S,nodeBorder:C,backgroundImage:x,pie:D,compound:T,edgeLine:E,edgeArrow:L,core:B},N=Ue.propertyGroupNames={},F=Ue.propertyGroupKeys=Object.keys(A);F.forEach(function(I){N[I]=A[I].map(function(G){return G.name}),A[I].forEach(function(G){return G.groupKey=I})});var q=Ue.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Ue.propertyNames=O.map(function(I){return I.name});for(var z=0;z<O.length;z++){var $=O[z];O[$.name]=$}for(var K=0;K<q.length;K++){var Y=q[K],H=O[Y.pointsTo],W={name:Y.name,alias:!0,pointsTo:H};O.push(W),O[Y.name]=W}})();Ue.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};Ue.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=ce({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1,   1, -1,   1, 1,   -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var f=1;f<=Ue.pieBackgroundN;f++){var v=l.name.replace("{{i}}",f),c=l.value;u[v]=c}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce(function(u,l){return Ue.arrowPrefixes.forEach(function(f){var v=f+"-"+l.name,c=l.value;u[v]=c}),u},{})),r={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var i=n.name,o=e[i],s=this.parse(i,o);r[i]=s}}return t.defaultProperties=r,t.defaultProperties};Ue.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var In={};In.parse=function(t,e,r,a){var n=this;if(ze(e))return n.parseImplWarn(t,e,r,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,o=r?"t":"f",s=""+e,u=Xs(t,s,o,i),l=n.propCache=n.propCache||[],f;return(f=l[u])||(f=l[u]=n.parseImplWarn(t,e,r,a)),(r||a==="mapping")&&(f=Ot(f),f&&(f.value=Ot(f.value))),f};In.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);return!n&&e!=null&&Le("The style property `".concat(t,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Le("The style value of `label` is deprecated for `"+n.name+"`"),n};In.parseImpl=function(t,e,r,a){var n=this;t=Ti(t);var i=n.properties[t],o=e,s=n.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var u=fe(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(ze(e))return{name:t,value:e,strValue:"fn",mapped:s.fn,bypass:r};var f,v;if(!(!u||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(s.data.regex).exec(e))){if(r)return!1;var c=s.data;return{name:t,value:f,strValue:""+e,mapped:c,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(v=new RegExp(s.mapData.regex).exec(e))){if(r||l.multiple)return!1;var h=s.mapData;if(!(l.color||l.number))return!1;var d=this.parse(t,v[4]);if(!d||d.mapped)return!1;var p=this.parse(t,v[5]);if(!p||p.mapped)return!1;if(d.pfValue===p.pfValue||d.strValue===p.strValue)return Le("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+d.strValue+"`"),this.parse(t,d.strValue);if(l.color){var m=d.value,g=p.value,y=m[0]===g[0]&&m[1]===g[1]&&m[2]===g[2]&&(m[3]===g[3]||(m[3]==null||m[3]===1)&&(g[3]==null||g[3]===1));if(y)return!1}return{name:t,value:v,strValue:""+e,mapped:h,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:d.value,valueMax:p.value,bypass:r}}}if(l.multiple&&a!=="multiple"){var b;if(u?b=e.split(/\s+/):Ae(e)?b=e:b=[e],l.evenMultiple&&b.length%2!==0)return null;for(var w=[],S=[],C=[],x="",T=!1,E=0;E<b.length;E++){var P=n.parse(t,b[E],r,"multiple");T=T||fe(P.value),w.push(P.value),C.push(P.pfValue!=null?P.pfValue:P.value),S.push(P.units),x+=(E>0?" ":"")+P.strValue}return l.validate&&!l.validate(w,S)?null:l.singleEnum&&T?w.length===1&&fe(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:C,strValue:x,bypass:r,units:S}}var B=function(){for(var Z=0;Z<l.enums.length;Z++){var _=l.enums[Z];if(_===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(l.number){var D,M="px";if(l.units&&(D=l.units),l.implicitUnits&&(M=l.implicitUnits),!l.unitless)if(u){var L="px|em"+(l.allowPercent?"|\\%":"");D&&(L=D);var R=e.match("^("+He+")("+L+")?$");R&&(e=R[1],D=R[2]||M)}else(!D||l.implicitUnits)&&(D=M);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=o,B();if(l.integer&&!bc(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var O={name:t,value:e,strValue:""+e+(D||""),units:D,bypass:r};return l.unitless||D!=="px"&&D!=="em"?O.pfValue=e:O.pfValue=D==="px"||!D?e:this.getEmSizeInPixels()*e,(D==="ms"||D==="s")&&(O.pfValue=D==="ms"?e:1e3*e),(D==="deg"||D==="rad")&&(O.pfValue=D==="rad"?e:hd(e)),D==="%"&&(O.pfValue=e/100),O}else if(l.propList){var A=[],N=""+e;if(N!=="none"){for(var F=N.split(/\s*,\s*|\s+/),q=0;q<F.length;q++){var z=F[q].trim();n.properties[z]?A.push(z):Le("`"+z+"` is not a valid property name")}if(A.length===0)return null}return{name:t,value:A,strValue:A.length===0?"none":A.join(" "),bypass:r}}else if(l.color){var $=Nc(e);return $?{name:t,value:$,pfValue:$,strValue:"rgb("+$[0]+","+$[1]+","+$[2]+")",bypass:r}:null}else if(l.regex||l.regexes){if(l.enums){var K=B();if(K)return K}for(var Y=l.regexes?l.regexes:[l.regex],H=0;H<Y.length;H++){var W=new RegExp(Y[H]),I=W.exec(e);if(I)return{name:t,value:l.singleRegexMatchValue?I[1]:I,strValue:""+e,bypass:r}}return null}else return l.string?{name:t,value:""+e,strValue:""+e,bypass:r}:l.enums?B():null};var et=function t(e){if(!(this instanceof t))return new t(e);if(!Si(e)){Ve("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},rt=et.prototype;rt.instanceString=function(){return"style"};rt.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),a=0;a<this.length;a++)this[a]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(n){var i=n[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this};rt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};rt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};rt.selector=function(t){var e=t==="core"?null:new rr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};rt.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],a=0;a<t.properties.length;a++){var n=t.properties[a],i=r[n.name];i===void 0&&(i=r[Dn(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};rt.style=rt.css;rt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var a=this.length-1;this[a].properties.push(r),this[a].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[a].mappedProperties.push(r);var n=!this[a].selector;n&&(this._private.coreStyle[r.name]=r)}return this};rt.append=function(t){return Vs(t)?t.appendToStyle(this):Ae(t)?this.appendFromJson(t):fe(t)&&this.appendFromString(t),this};et.fromJson=function(t,e){var r=new et(t);return r.fromJson(e),r};et.fromString=function(t,e){return new et(t).fromString(e)};[at,Ia,Ni,It,Rn,zi,Ue,In].forEach(function(t){ce(rt,t)});et.types=rt.types;et.properties=rt.properties;et.propertyGroups=rt.propertyGroups;et.propertyGroupNames=rt.propertyGroupNames;et.propertyGroupKeys=rt.propertyGroupKeys;var Dg={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return Vs(e)?r.style=e.generateStyle(this):Ae(e)?r.style=et.fromJson(this,e):fe(e)?r.style=et.fromString(this,e):r.style=et(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},kg="single",mr={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=kg),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,a,n,i,o,s;switch(e.length){case 0:return r;case 1:if(fe(e[0]))return a=e[0],r[a];if(Ce(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,ne(o)&&(r.x=o),ne(s)&&(r.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&ne(n)&&(r[a]=n),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var a=arguments,n=this._private.pan,i,o,s,u,l;if(!this._private.panningEnabled)return this;switch(a.length){case 1:Ce(e)&&(s=a[0],u=s.x,l=s.y,ne(u)&&(n.x+=u),ne(l)&&(n.y+=l),this.emit("pan viewport"));break;case 2:i=e,o=r,(i==="x"||i==="y")&&ne(o)&&(n[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,r){var a=this.getFitViewport(e,r);if(a){var n=this._private;n.zoom=a.zoom,n.pan=a.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(ne(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(fe(e)){var n=e;e=this.$(n)}else if(Ec(e)){var i=e;a={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},a.w=a.x2-a.x1,a.h=a.y2-a.y1}else ht(e)||(e=this.mutableElements());if(!(ht(e)&&e.empty())){a=a||e.boundingBox();var o=this.width(),s=this.height(),u;if(r=ne(r)?r:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((o-2*r)/a.w,(s-2*r)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(a.x1+a.x2))/2,y:(s-u*(a.y1+a.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}return ne(e)&&ne(r)&&e<=r?(a.minZoom=e,a.maxZoom=r):ne(e)&&r===void 0&&e<=a.maxZoom?a.minZoom=e:ne(r)&&e===void 0&&r>=a.minZoom&&(a.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,a=r.pan,n=r.zoom,i,o,s=!1;if(r.zoomingEnabled||(s=!0),ne(e)?o=e:Ce(e)&&(o=e.level,e.position!=null?i=Pn(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=o<r.minZoom?r.minZoom:o,s||!ne(o)||o===n||i!=null&&(!ne(i.x)||!ne(i.y)))return null;if(i!=null){var u=a,l=n,f=o,v={x:-f/l*(i.x-u.x)+i.x,y:-f/l*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:v}}else return{zoomed:!0,panned:!1,zoom:o,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),a=this._private;return r==null||!r.zoomed?this:(a.zoom=r.zoom,r.panned&&(a.pan.x=r.pan.x,a.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,a=!0,n=!0,i=[],o=!1,s=!1;if(!e)return this;if(ne(e.zoom)||(a=!1),Ce(e.pan)||(n=!1),!a&&!n)return this;if(a){var u=e.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=u,i.push("zoom"))}if(n&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var l=e.pan;ne(l.x)&&(r.pan.x=l.x,s=!1),ne(l.y)&&(r.pan.y=l.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(fe(e)){var a=e;e=this.mutableElements().filter(a)}else ht(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var s={x:(i-r*(n.x1+n.x2))/2,y:(o-r*(n.y1+n.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?function(){var n=a.window().getComputedStyle(r),i=function(s){return parseFloat(n.getPropertyValue(s))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/r,x2:(a.x2-e.x)/r,y1:(a.y1-e.y)/r,y2:(a.y2-e.y)/r};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};mr.centre=mr.center;mr.autolockNodes=mr.autolock;mr.autoungrabifyNodes=mr.autoungrabify;var Da={data:Be.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Be.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Be.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Be.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Da.attr=Da.data;Da.removeAttr=Da.removeData;var ka=function(e){var r=this;e=ce({},e);var a=e.container;a&&!hn(a)&&hn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=r;var o=qe!==void 0&&a!==void 0&&!e.headless,s=e;s.layout=ce({name:o?"grid":"null"},s.layout),s.renderer=ce({name:o?"canvas":"null"},s.renderer);var u=function(d,p,m){return p!==void 0?p:m!==void 0?m:d},l=this._private={container:a,ready:!1,options:s,elements:new Qe(this),listeners:[],aniEles:new Qe(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,s.zoomingEnabled),userZoomingEnabled:u(!0,s.userZoomingEnabled),panningEnabled:u(!0,s.panningEnabled),userPanningEnabled:u(!0,s.userPanningEnabled),boxSelectionEnabled:u(!0,s.boxSelectionEnabled),autolock:u(!1,s.autolock,s.autolockNodes),autoungrabify:u(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:ne(s.zoom)?s.zoom:1,pan:{x:Ce(s.pan)&&ne(s.pan.x)?s.pan.x:0,y:Ce(s.pan)&&ne(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var f=function(d,p){var m=d.some(Cc);if(m)return Zr.all(d).then(p);p(d)};l.styleEnabled&&r.setStyle([]);var v=ce({},s,s.renderer);r.initRenderer(v);var c=function(d,p,m){r.notifications(!1);var g=r.mutableElements();g.length>0&&g.remove(),d!=null&&(Ce(d)||Ae(d))&&r.add(d),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",p),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",m),r.emit("done")});var y=ce({},r._private.options.layout);y.eles=r.elements(),r.layout(y).run()};f([s.style,s.elements],function(h){var d=h[0],p=h[1];l.styleEnabled&&r.style().append(d),c(p,function(){r.startAnimationLoop(),l.ready=!0,ze(s.ready)&&r.on("ready",s.ready);for(var m=0;m<i.length;m++){var g=i[m];r.on("ready",g)}n&&(n.readies=[]),r.emit("ready")},s.done)})},bn=ka.prototype;ce(bn,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return qe;var r=this._private.container.ownerDocument;return r===void 0||r==null?qe:r.defaultView||qe},mount:function(e){if(e!=null){var r=this,a=r._private,n=a.options;return!hn(e)&&hn(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer(ce({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),r.startAnimationLoop(),r.style(n.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Ot(this._private.options)},json:function(e){var r=this,a=r._private,n=r.mutableElements(),i=function(w){return r.getElementById(w.id())};if(Ce(e)){if(r.startBatch(),e.elements){var o={},s=function(w,S){for(var C=[],x=[],T=0;T<w.length;T++){var E=w[T];if(!E.data.id){Le("cy.json() cannot handle elements without an ID attribute");continue}var P=""+E.data.id,B=r.getElementById(P);o[P]=!0,B.length!==0?x.push({ele:B,json:E}):(S&&(E.group=S),C.push(E))}r.add(C);for(var D=0;D<x.length;D++){var M=x[D],L=M.ele,R=M.json;L.json(R)}};if(Ae(e.elements))s(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var f=u[l],v=e.elements[f];Ae(v)&&s(v,f)}var c=r.collection();n.filter(function(b){return!o[b.id()]}).forEach(function(b){b.isParent()?c.merge(b):b.remove()}),c.forEach(function(b){return b.children().move({parent:null})}),c.forEach(function(b){return i(b).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var h=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],d=0;d<h.length;d++){var p=h[d];e[p]!=null&&r[p](e[p])}return r.endBatch(),this}else{var m=!!e,g={};m?g.elements=this.elements().map(function(b){return b.json()}):(g.elements={},n.forEach(function(b){var w=b.group();g.elements[w]||(g.elements[w]=[]),g.elements[w].push(b.json())})),this._private.styleEnabled&&(g.style=r.style().json()),g.data=Ot(r.data());var y=a.options;return g.zoomingEnabled=a.zoomingEnabled,g.userZoomingEnabled=a.userZoomingEnabled,g.zoom=a.zoom,g.minZoom=a.minZoom,g.maxZoom=a.maxZoom,g.panningEnabled=a.panningEnabled,g.userPanningEnabled=a.userPanningEnabled,g.pan=Ot(a.pan),g.boxSelectionEnabled=a.boxSelectionEnabled,g.renderer=Ot(y.renderer),g.hideEdgesOnViewport=y.hideEdgesOnViewport,g.textureOnViewport=y.textureOnViewport,g.wheelSensitivity=y.wheelSensitivity,g.motionBlur=y.motionBlur,g.multiClickDebounceTime=y.multiClickDebounceTime,g}}});bn.$id=bn.getElementById;[pg,xg,Ou,fi,fn,Cg,vi,vn,Dg,mr,Da].forEach(function(t){ce(bn,t)});var Pg={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},Bg={maximal:!1,acyclic:!1},Br=function(e){return e.scratch("breadthfirst")},rs=function(e,r){return e.scratch("breadthfirst",r)};function Au(t){this.options=ce({},Pg,Bg,t)}Au.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().filter(function(re){return!re.isParent()}),i=a,o=e.directed,s=e.acyclic||e.maximal||e.maximalAdjustments>0,u=ct(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l;if(ht(e.roots))l=e.roots;else if(Ae(e.roots)){for(var f=[],v=0;v<e.roots.length;v++){var c=e.roots[v],h=r.getElementById(c);f.push(h)}l=r.collection(f)}else if(fe(e.roots))l=r.$(e.roots);else if(o)l=n.roots();else{var d=a.components();l=r.collection();for(var p=function(te){var se=d[te],ie=se.maxDegree(!1),ae=se.filter(function(ue){return ue.degree(!1)===ie});l=l.add(ae)},m=0;m<d.length;m++)p(m)}var g=[],y={},b=function(te,se){g[se]==null&&(g[se]=[]);var ie=g[se].length;g[se].push(te),rs(te,{index:ie,depth:se})},w=function(te,se){var ie=Br(te),ae=ie.depth,ue=ie.index;g[ae][ue]=null,b(te,se)};i.bfs({roots:l,directed:e.directed,visit:function(te,se,ie,ae,ue){var ge=te[0],pe=ge.id();b(ge,ue),y[pe]=!0}});for(var S=[],C=0;C<n.length;C++){var x=n[C];y[x.id()]||S.push(x)}var T=function(te){for(var se=g[te],ie=0;ie<se.length;ie++){var ae=se[ie];if(ae==null){se.splice(ie,1),ie--;continue}rs(ae,{depth:te,index:ie})}},E=function(){for(var te=0;te<g.length;te++)T(te)},P=function(te,se){for(var ie=Br(te),ae=te.incomers().filter(function(k){return k.isNode()&&a.has(k)}),ue=-1,ge=te.id(),pe=0;pe<ae.length;pe++){var ve=ae[pe],xe=Br(ve);ue=Math.max(ue,xe.depth)}if(ie.depth<=ue){if(!e.acyclic&&se[ge])return null;var Q=ue+1;return w(te,Q),se[ge]=Q,!0}return!1};if(o&&s){var B=[],D={},M=function(te){return B.push(te)},L=function(){return B.shift()};for(n.forEach(function(re){return B.push(re)});B.length>0;){var R=L(),O=P(R,D);if(O)R.outgoers().filter(function(re){return re.isNode()&&a.has(re)}).forEach(M);else if(O===null){Le("Detected double maximal shift for node `"+R.id()+"`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.");break}}}E();var A=0;if(e.avoidOverlap)for(var N=0;N<n.length;N++){var F=n[N],q=F.layoutDimensions(e),z=q.w,$=q.h;A=Math.max(A,z,$)}var K={},Y=function(te){if(K[te.id()])return K[te.id()];for(var se=Br(te).depth,ie=te.neighborhood(),ae=0,ue=0,ge=0;ge<ie.length;ge++){var pe=ie[ge];if(!(pe.isEdge()||pe.isParent()||!n.has(pe))){var ve=Br(pe);if(ve!=null){var xe=ve.index,Q=ve.depth;if(!(xe==null||Q==null)){var k=g[Q].length;Q<se&&(ae+=xe/k,ue++)}}}}return ue=Math.max(1,ue),ae=ae/ue,ue===0&&(ae=0),K[te.id()]=ae,ae},H=function(te,se){var ie=Y(te),ae=Y(se),ue=ie-ae;return ue===0?qs(te.id(),se.id()):ue};e.depthSort!==void 0&&(H=e.depthSort);for(var W=0;W<g.length;W++)g[W].sort(H),T(W);for(var I=[],G=0;G<S.length;G++)I.push(S[G]);g.unshift(I),E();for(var Z=0,_=0;_<g.length;_++)Z=Math.max(g[_].length,Z);var ee={x:u.x1+u.w/2,y:u.x1+u.h/2},de=g.reduce(function(re,te){return Math.max(re,te.length)},0),he=function(te){var se=Br(te),ie=se.depth,ae=se.index,ue=g[ie].length,ge=Math.max(u.w/((e.grid?de:ue)+1),A),pe=Math.max(u.h/(g.length+1),A),ve=Math.min(u.w/2/g.length,u.h/2/g.length);if(ve=Math.max(ve,A),e.circle){var Q=ve*ie+ve-(g.length>0&&g[0].length<=3?ve/2:0),k=2*Math.PI/g[ie].length*ae;return ie===0&&g[0].length===1&&(Q=1),{x:ee.x+Q*Math.cos(k),y:ee.y+Q*Math.sin(k)}}else{var xe={x:ee.x+(ae+1-(ue+1)/2)*ge,y:(ie+1)*pe};return xe}};return a.nodes().layoutPositions(this,e,he),this};var Lg={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Ru(t){this.options=ce({},Lg,t)}Ru.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=ct(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),f,v=0,c=0;c<i.length;c++){var h=i[c],d=h.layoutDimensions(e),p=d.w,m=d.h;v=Math.max(v,p,m)}if(ne(e.radius)?f=e.radius:i.length<=1?f=0:f=Math.min(o.h,o.w)/2-v,i.length>1&&e.avoidOverlap){v*=1.75;var g=Math.cos(l)-Math.cos(0),y=Math.sin(l)-Math.sin(0),b=Math.sqrt(v*v/(g*g+y*y));f=Math.max(b,f)}var w=function(C,x){var T=e.startAngle+x*l*(n?1:-1),E=f*Math.cos(T),P=f*Math.sin(T),B={x:s.x+E,y:s.y+P};return B};return a.nodes().layoutPositions(this,e,w),this};var Mg={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Iu(t){this.options=ce({},Mg,t)}Iu.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=t.cy,n=e.eles,i=n.nodes().not(":parent"),o=ct(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=[],l=0,f=0;f<i.length;f++){var v=i[f],c=void 0;c=e.concentric(v),u.push({value:c,node:v}),v._private.scratch.concentric=c}i.updateStyle();for(var h=0;h<i.length;h++){var d=i[h],p=d.layoutDimensions(e);l=Math.max(l,p.w,p.h)}u.sort(function(re,te){return te.value-re.value});for(var m=e.levelWidth(i),g=[[]],y=g[0],b=0;b<u.length;b++){var w=u[b];if(y.length>0){var S=Math.abs(y[0].value-w.value);S>=m&&(y=[],g.push(y))}y.push(w)}var C=l+e.minNodeSpacing;if(!e.avoidOverlap){var x=g.length>0&&g[0].length>1,T=Math.min(o.w,o.h)/2-C,E=T/(g.length+x?1:0);C=Math.min(C,E)}for(var P=0,B=0;B<g.length;B++){var D=g[B],M=e.sweep===void 0?2*Math.PI-2*Math.PI/D.length:e.sweep,L=D.dTheta=M/Math.max(1,D.length-1);if(D.length>1&&e.avoidOverlap){var R=Math.cos(L)-Math.cos(0),O=Math.sin(L)-Math.sin(0),A=Math.sqrt(C*C/(R*R+O*O));P=Math.max(A,P)}D.r=P,P+=C}if(e.equidistant){for(var N=0,F=0,q=0;q<g.length;q++){var z=g[q],$=z.r-F;N=Math.max(N,$)}F=0;for(var K=0;K<g.length;K++){var Y=g[K];K===0&&(F=Y.r),Y.r=F,F+=N}}for(var H={},W=0;W<g.length;W++)for(var I=g[W],G=I.dTheta,Z=I.r,_=0;_<I.length;_++){var ee=I[_],de=e.startAngle+(r?1:-1)*G*_,he={x:s.x+Z*Math.cos(de),y:s.y+Z*Math.sin(de)};H[ee.node.id()]=he}return n.nodes().layoutPositions(this,e,function(re){var te=re.id();return H[te]}),this};var ei,Og={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Nn(t){this.options=ce({},Og,t),this.options.layout=this}Nn.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?ei=!0:ei=!1;var a=Ag(e,r,t);ei&&Ng(a),t.randomize&&zg(a);var n=qt(),i=function(){Fg(a,e,t),t.fit===!0&&e.fit(t.padding)},o=function(c){return!(r.stopped||c>=t.numIter||(Vg(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp))},s=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var c=t.eles.nodes(),h=Nu(a,t,c);c.layoutPositions(r,t,h)}},u=0,l=!0;if(t.animate===!0){var f=function v(){for(var c=0;l&&c<t.refresh;)l=o(u),u++,c++;if(!l)ns(a,t),s();else{var h=qt();h-n>=t.animationThreshold&&i(),gn(v)}};f()}else{for(;l;)l=o(u),u++;ns(a,t),s()}return this};Nn.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Nn.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Ag=function(e,r,a){for(var n=a.eles.edges(),i=a.eles.nodes(),o=ct(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},u=a.eles.components(),l={},f=0;f<u.length;f++)for(var v=u[f],c=0;c<v.length;c++){var h=v[c];l[h.id()]=f}for(var f=0;f<s.nodeSize;f++){var d=i[f],p=d.layoutDimensions(a),m={};m.isLocked=d.locked(),m.id=d.data("id"),m.parentId=d.data("parent"),m.cmptId=l[d.id()],m.children=[],m.positionX=d.position("x"),m.positionY=d.position("y"),m.offsetX=0,m.offsetY=0,m.height=p.w,m.width=p.h,m.maxX=m.positionX+m.width/2,m.minX=m.positionX-m.width/2,m.maxY=m.positionY+m.height/2,m.minY=m.positionY-m.height/2,m.padLeft=parseFloat(d.style("padding")),m.padRight=parseFloat(d.style("padding")),m.padTop=parseFloat(d.style("padding")),m.padBottom=parseFloat(d.style("padding")),m.nodeRepulsion=ze(a.nodeRepulsion)?a.nodeRepulsion(d):a.nodeRepulsion,s.layoutNodes.push(m),s.idToIndex[m.id]=f}for(var g=[],y=0,b=-1,w=[],f=0;f<s.nodeSize;f++){var d=s.layoutNodes[f],S=d.parentId;S!=null?s.layoutNodes[s.idToIndex[S]].children.push(d.id):(g[++b]=d.id,w.push(d.id))}for(s.graphSet.push(w);y<=b;){var C=g[y++],x=s.idToIndex[C],h=s.layoutNodes[x],T=h.children;if(T.length>0){s.graphSet.push(T);for(var f=0;f<T.length;f++)g[++b]=T[f]}}for(var f=0;f<s.graphSet.length;f++)for(var E=s.graphSet[f],c=0;c<E.length;c++){var P=s.idToIndex[E[c]];s.indexToGraph[P]=f}for(var f=0;f<s.edgeSize;f++){var B=n[f],D={};D.id=B.data("id"),D.sourceId=B.data("source"),D.targetId=B.data("target");var M=ze(a.idealEdgeLength)?a.idealEdgeLength(B):a.idealEdgeLength,L=ze(a.edgeElasticity)?a.edgeElasticity(B):a.edgeElasticity,R=s.idToIndex[D.sourceId],O=s.idToIndex[D.targetId],A=s.indexToGraph[R],N=s.indexToGraph[O];if(A!=N){for(var F=Rg(D.sourceId,D.targetId,s),q=s.graphSet[F],z=0,m=s.layoutNodes[R];q.indexOf(m.id)===-1;)m=s.layoutNodes[s.idToIndex[m.parentId]],z++;for(m=s.layoutNodes[O];q.indexOf(m.id)===-1;)m=s.layoutNodes[s.idToIndex[m.parentId]],z++;M*=z*a.nestingFactor}D.idealLength=M,D.elasticity=L,s.layoutEdges.push(D)}return s},Rg=function(e,r,a){var n=Ig(e,r,0,a);return 2>n.count?0:n.graph},Ig=function t(e,r,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:a};for(var o=0,s=0;s<i.length;s++){var u=i[s],l=n.idToIndex[u],f=n.layoutNodes[l].children;if(f.length!==0){var v=n.indexToGraph[n.idToIndex[f[0]]],c=t(e,r,v,n);if(c.count!==0)if(c.count===1){if(o++,o===2)break}else return c}}return{count:o,graph:a}},Ng,zg=function(e,r){for(var a=e.clientWidth,n=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*a,o.positionY=Math.random()*n)}},Nu=function(e,r,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(a.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var u=e.layoutNodes[e.idToIndex[o.data("id")]];if(r.boundingBox){var l=(u.positionX-i.x1)/i.w,f=(u.positionY-i.y1)/i.h;return{x:n.x1+l*n.w,y:n.y1+f*n.h}}else return{x:u.positionX,y:u.positionY}}},Fg=function(e,r,a){var n=a.layout,i=a.eles.nodes(),o=Nu(e,a,i);i.positions(o),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},Vg=function(e,r,a){$g(e,r),Wg(e),Kg(e,r),Gg(e),Yg(e)},$g=function(e,r){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],i=n.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[n[o]]],u=o+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[n[u]]];qg(s,l,e,r)}},as=function(e){return-e+2*e*Math.random()},qg=function(e,r,a,n){var i=e.cmptId,o=r.cmptId;if(!(i!==o&&!a.isCompound)){var s=r.positionX-e.positionX,u=r.positionY-e.positionY,l=1;s===0&&u===0&&(s=as(l),u=as(l));var f=Hg(e,r,s,u);if(f>0)var v=n.nodeOverlap*f,c=Math.sqrt(s*s+u*u),h=v*s/c,d=v*u/c;else var p=wn(e,s,u),m=wn(r,-1*s,-1*u),g=m.x-p.x,y=m.y-p.y,b=g*g+y*y,c=Math.sqrt(b),v=(e.nodeRepulsion+r.nodeRepulsion)/b,h=v*g/c,d=v*y/c;e.isLocked||(e.offsetX-=h,e.offsetY-=d),r.isLocked||(r.offsetX+=h,r.offsetY+=d)}},Hg=function(e,r,a,n){if(a>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(n>0)var o=e.maxY-r.minY;else var o=r.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},wn=function(e,r,a){var n=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,u=a/r,l=o/s,f={};return r===0&&0<a||r===0&&0>a?(f.x=n,f.y=i+o/2,f):0<r&&-1*l<=u&&u<=l?(f.x=n+s/2,f.y=i+s*a/2/r,f):0>r&&-1*l<=u&&u<=l?(f.x=n-s/2,f.y=i-s*a/2/r,f):0<a&&(u<=-1*l||u>=l)?(f.x=n+o*r/2/a,f.y=i+o/2,f):(0>a&&(u<=-1*l||u>=l)&&(f.x=n-o*r/2/a,f.y=i-o/2),f)},Wg=function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],o=e.layoutNodes[i],s=e.idToIndex[n.targetId],u=e.layoutNodes[s],l=u.positionX-o.positionX,f=u.positionY-o.positionY;if(!(l===0&&f===0)){var v=wn(o,l,f),c=wn(u,-1*l,-1*f),h=c.x-v.x,d=c.y-v.y,p=Math.sqrt(h*h+d*d),m=Math.pow(n.idealLength-p,2)/n.elasticity;if(p!==0)var g=m*h/p,y=m*d/p;else var g=0,y=0;o.isLocked||(o.offsetX+=g,o.offsetY+=y),u.isLocked||(u.offsetX-=g,u.offsetY-=y)}}},Kg=function(e,r){if(r.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],o=i.length;if(n===0)var s=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[l.parentId]],s=f.positionX,u=f.positionY;for(var v=0;v<o;v++){var c=e.layoutNodes[e.idToIndex[i[v]]];if(!c.isLocked){var h=s-c.positionX,d=u-c.positionY,p=Math.sqrt(h*h+d*d);if(p>a){var m=r.gravity*h/p,g=r.gravity*d/p;c.offsetX+=m,c.offsetY+=g}}}}},Gg=function(e,r){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var o=a[n++],s=e.idToIndex[o],u=e.layoutNodes[s],l=u.children;if(0<l.length&&!u.isLocked){for(var f=u.offsetX,v=u.offsetY,c=0;c<l.length;c++){var h=e.layoutNodes[e.idToIndex[l[c]]];h.offsetX+=f,h.offsetY+=v,a[++i]=l[c]}u.offsetX=0,u.offsetY=0}}},Yg=function(e,r){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&(n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0)}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(!(0<n.children.length||n.isLocked)){var i=Xg(n.offsetX,n.offsetY,e.temperature);n.positionX+=i.x,n.positionY+=i.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,Ug(n,e)}}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&!n.isLocked&&(n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY)}},Xg=function(e,r,a){var n=Math.sqrt(e*e+r*r);if(n>a)var i={x:a*e/n,y:a*r/n};else var i={x:e,y:r};return i},Ug=function t(e,r){var a=e.parentId;if(a!=null){var n=r.layoutNodes[r.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,i=!0),(n.maxY==null||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,i=!0),i)return t(n,r)}},ns=function(e,r){for(var a=e.layoutNodes,n=[],i=0;i<a.length;i++){var o=a[i],s=o.cmptId,u=n[s]=n[s]||[];u.push(o)}for(var l=0,i=0;i<n.length;i++){var f=n[i];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var v=0;v<f.length;v++){var c=f[v];f.x1=Math.min(f.x1,c.positionX-c.width/2),f.x2=Math.max(f.x2,c.positionX+c.width/2),f.y1=Math.min(f.y1,c.positionY-c.height/2),f.y2=Math.max(f.y2,c.positionY+c.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,l+=f.w*f.h}}n.sort(function(y,b){return b.w*b.h-y.w*y.h});for(var h=0,d=0,p=0,m=0,g=Math.sqrt(l)*e.clientWidth/e.clientHeight,i=0;i<n.length;i++){var f=n[i];if(f){for(var v=0;v<f.length;v++){var c=f[v];c.isLocked||(c.positionX+=h-f.x1,c.positionY+=d-f.y1)}h+=f.w+r.componentSpacing,p+=f.w+r.componentSpacing,m=Math.max(m,f.h),p>g&&(d+=m+r.componentSpacing,h=0,p=0,m=0)}}},Zg={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function zu(t){this.options=ce({},Zg,t)}zu.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=ct(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(K){return{x:i.x1,y:i.y1}});else{var o=n.size(),s=Math.sqrt(o*i.h/i.w),u=Math.round(s),l=Math.round(i.w/i.h*s),f=function(Y){if(Y==null)return Math.min(u,l);var H=Math.min(u,l);H==u?u=Y:l=Y},v=function(Y){if(Y==null)return Math.max(u,l);var H=Math.max(u,l);H==u?u=Y:l=Y},c=e.rows,h=e.cols!=null?e.cols:e.columns;if(c!=null&&h!=null)u=c,l=h;else if(c!=null&&h==null)u=c,l=Math.ceil(o/u);else if(c==null&&h!=null)l=h,u=Math.ceil(o/l);else if(l*u>o){var d=f(),p=v();(d-1)*p>=o?f(d-1):(p-1)*d>=o&&v(p-1)}else for(;l*u<o;){var m=f(),g=v();(g+1)*m>=o?v(g+1):f(m+1)}var y=i.w/l,b=i.h/u;if(e.condense&&(y=0,b=0),e.avoidOverlap)for(var w=0;w<n.length;w++){var S=n[w],C=S._private.position;(C.x==null||C.y==null)&&(C.x=0,C.y=0);var x=S.layoutDimensions(e),T=e.avoidOverlapPadding,E=x.w+T,P=x.h+T;y=Math.max(y,E),b=Math.max(b,P)}for(var B={},D=function(Y,H){return!!B["c-"+Y+"-"+H]},M=function(Y,H){B["c-"+Y+"-"+H]=!0},L=0,R=0,O=function(){R++,R>=l&&(R=0,L++)},A={},N=0;N<n.length;N++){var F=n[N],q=e.position(F);if(q&&(q.row!==void 0||q.col!==void 0)){var z={row:q.row,col:q.col};if(z.col===void 0)for(z.col=0;D(z.row,z.col);)z.col++;else if(z.row===void 0)for(z.row=0;D(z.row,z.col);)z.row++;A[F.id()]=z,M(z.row,z.col)}}var $=function(Y,H){var W,I;if(Y.locked()||Y.isParent())return!1;var G=A[Y.id()];if(G)W=G.col*y+y/2+i.x1,I=G.row*b+b/2+i.y1;else{for(;D(L,R);)O();W=R*y+y/2+i.x1,I=L*b+b/2+i.y1,M(L,R),O()}return{x:W,y:I}};n.layoutPositions(this,e,$)}return this};var Qg={ready:function(){},stop:function(){}};function Fi(t){this.options=ce({},Qg,t)}Fi.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};Fi.prototype.stop=function(){return this};var Jg={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Fu(t){this.options=ce({},Jg,t)}Fu.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),a=ze(t.positions);function n(i){if(t.positions==null)return ld(i.position());if(a)return t.positions(i);var o=t.positions[i._private.data.id];return o??null}return r.layoutPositions(this,t,function(i,o){var s=n(i);return i.locked()||s==null?!1:s}),this};var jg={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Vu(t){this.options=ce({},jg,t)}Vu.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=ct(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(o,s){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return r.nodes().layoutPositions(this,t,n),this};var _g=[{name:"breadthfirst",impl:Au},{name:"circle",impl:Ru},{name:"concentric",impl:Iu},{name:"cose",impl:Nn},{name:"grid",impl:zu},{name:"null",impl:Fi},{name:"preset",impl:Fu},{name:"random",impl:Vu}];function $u(t){this.options=t,this.notifications=0}var is=function(){},os=function(){throw new Error("A headless instance can not render images")};$u.prototype={recalculateRenderedStyle:is,notify:function(){this.notifications++},init:is,isHeadless:function(){return!0},png:os,jpg:os};var Vi={};Vi.arrowShapeWidth=.3;Vi.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(l,f,v,c,h,d,p){var m=h.x-v/2-p,g=h.x+v/2+p,y=h.y-v/2-p,b=h.y+v/2+p,w=m<=l&&l<=g&&y<=f&&f<=b;return w},a=function(l,f,v,c,h){var d=l*Math.cos(c)-f*Math.sin(c),p=l*Math.sin(c)+f*Math.cos(c),m=d*v,g=p*v,y=m+h.x,b=g+h.y;return{x:y,y:b}},n=function(l,f,v,c){for(var h=[],d=0;d<l.length;d+=2){var p=l[d],m=l[d+1];h.push(a(p,m,f,v,c))}return h},i=function(l){for(var f=[],v=0;v<l.length;v++){var c=l[v];f.push(c.x,c.y)}return f},o=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},s=function(l,f){fe(f)&&(f=t[f]),t[l]=ce({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(c,h,d,p,m,g){var y=i(n(this.points,d+2*g,p,m)),b=vt(c,h,y);return b},roughCollide:r,draw:function(c,h,d,p){var m=n(this.points,h,d,p);e.arrowShapeImpl("polygon")(c,m)},spacing:function(c){return 0},gap:o},f)};s("none",{collide:pn,roughCollide:pn,draw:ki,spacing:xo,gap:xo}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(l,f,v,c,h){var d=n(this.points,f,v,c),p=this.controlPoint,m=a(p[0],p[1],f,v,c);e.arrowShapeImpl(this.name)(l,d,m)},gap:function(l){return o(l)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,f,v,c,h,d,p){var m=i(n(this.points,v+2*p,c,h)),g=i(n(this.pointsTee,v+2*p,c,h)),y=vt(l,f,m)||vt(l,f,g);return y},draw:function(l,f,v,c,h){var d=n(this.points,f,v,c),p=n(this.pointsTee,f,v,c);e.arrowShapeImpl(this.name)(l,d,p)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,f,v,c,h,d,p){var m=h,g=Math.pow(m.x-l,2)+Math.pow(m.y-f,2)<=Math.pow((v+2*p)*this.radius,2),y=i(n(this.points,v+2*p,c,h));return vt(l,f,y)||g},draw:function(l,f,v,c,h){var d=n(this.pointsTr,f,v,c);e.arrowShapeImpl(this.name)(l,d,c.x,c.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(l,f){var v=this.baseCrossLinePts.slice(),c=f/l,h=3,d=5;return v[h]=v[h]-c,v[d]=v[d]-c,v},collide:function(l,f,v,c,h,d,p){var m=i(n(this.points,v+2*p,c,h)),g=i(n(this.crossLinePts(v,d),v+2*p,c,h)),y=vt(l,f,m)||vt(l,f,g);return y},draw:function(l,f,v,c,h){var d=n(this.points,f,v,c),p=n(this.crossLinePts(f,h),f,v,c);e.arrowShapeImpl(this.name)(l,d,p)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return o(l)*.525}}),s("circle",{radius:.15,collide:function(l,f,v,c,h,d,p){var m=h,g=Math.pow(m.x-l,2)+Math.pow(m.y-f,2)<=Math.pow((v+2*p)*this.radius,2);return g},draw:function(l,f,v,c,h){e.arrowShapeImpl(this.name)(l,c.x,c.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(l){return .95*l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}})};var Er={};Er.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],o=a[4],s=r.pan(),u=r.zoom(),l=((t-n)/o-s.x)/u,f=((e-i)/o-s.y)/u;return[l,f]};Er.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),a=function(g){return parseFloat(r.getPropertyValue(g))},n={left:a("padding-left"),right:a("padding-right"),top:a("padding-top"),bottom:a("padding-bottom")},i={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},o=t.clientWidth,s=t.clientHeight,u=n.left+n.right,l=n.top+n.bottom,f=i.left+i.right,v=e.width/(o+f),c=o-u,h=s-l,d=e.left+n.left+i.left,p=e.top+n.top+i.top;return this.containerBB=[d,p,c,h,v]};Er.invalidateContainerClientCoordsCache=function(){this.containerBB=null};Er.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]};Er.findNearestElements=function(t,e,r,a){var n=this,i=this,o=i.getCachedZSortedEles(),s=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),f=(a?24:8)/u,v=(a?8:2)/u,c=(a?8:2)/u,h=1/0,d,p;r&&(o=o.interactive);function m(x,T){if(x.isNode()){if(p)return;p=x,s.push(x)}if(x.isEdge()&&(T==null||T<h))if(d){if(d.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value&&d.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value){for(var E=0;E<s.length;E++)if(s[E].isEdge()){s[E]=x,d=x,h=T??h;break}}}else s.push(x),d=x,h=T??h}function g(x){var T=x.outerWidth()+2*v,E=x.outerHeight()+2*v,P=T/2,B=E/2,D=x.position();if(D.x-P<=t&&t<=D.x+P&&D.y-B<=e&&e<=D.y+B){var M=i.nodeShapes[n.getNodeShape(x)];if(M.checkPoint(t,e,0,T,E,D.x,D.y))return m(x,0),!0}}function y(x){var T=x._private,E=T.rscratch,P=x.pstyle("width").pfValue,B=x.pstyle("arrow-scale").value,D=P/2+f,M=D*D,L=D*2,N=T.source,F=T.target,R;if(E.edgeType==="segments"||E.edgeType==="straight"||E.edgeType==="haystack"){for(var O=E.allpts,A=0;A+3<O.length;A+=2)if(Ed(t,e,O[A],O[A+1],O[A+2],O[A+3],L)&&M>(R=kd(t,e,O[A],O[A+1],O[A+2],O[A+3])))return m(x,R),!0}else if(E.edgeType==="bezier"||E.edgeType==="multibezier"||E.edgeType==="self"||E.edgeType==="compound"){for(var O=E.allpts,A=0;A+5<E.allpts.length;A+=4)if(Cd(t,e,O[A],O[A+1],O[A+2],O[A+3],O[A+4],O[A+5],L)&&M>(R=Dd(t,e,O[A],O[A+1],O[A+2],O[A+3],O[A+4],O[A+5])))return m(x,R),!0}for(var N=N||T.source,F=F||T.target,q=n.getArrowWidth(P,B),z=[{name:"source",x:E.arrowStartX,y:E.arrowStartY,angle:E.srcArrowAngle},{name:"target",x:E.arrowEndX,y:E.arrowEndY,angle:E.tgtArrowAngle},{name:"mid-source",x:E.midX,y:E.midY,angle:E.midsrcArrowAngle},{name:"mid-target",x:E.midX,y:E.midY,angle:E.midtgtArrowAngle}],A=0;A<z.length;A++){var $=z[A],K=i.arrowShapes[x.pstyle($.name+"-arrow-shape").value],Y=x.pstyle("width").pfValue;if(K.roughCollide(t,e,q,$.angle,{x:$.x,y:$.y},Y,f)&&K.collide(t,e,q,$.angle,{x:$.x,y:$.y},Y,f))return m(x),!0}l&&s.length>0&&(g(N),g(F))}function b(x,T,E){return Bt(x,T,E)}function w(x,T){var E=x._private,P=c,B;T?B=T+"-":B="",x.boundingBox();var D=E.labelBounds[T||"main"],M=x.pstyle(B+"label").value,L=x.pstyle("text-events").strValue==="yes";if(!(!L||!M)){var R=b(E.rscratch,"labelX",T),O=b(E.rscratch,"labelY",T),A=b(E.rscratch,"labelAngle",T),N=x.pstyle(B+"text-margin-x").pfValue,F=x.pstyle(B+"text-margin-y").pfValue,q=D.x1-P-N,z=D.x2+P-N,$=D.y1-P-F,K=D.y2+P-F;if(A){var Y=Math.cos(A),H=Math.sin(A),W=function(he,re){return he=he-R,re=re-O,{x:he*Y-re*H+R,y:he*H+re*Y+O}},I=W(q,$),G=W(q,K),Z=W(z,$),_=W(z,K),ee=[I.x+N,I.y+F,Z.x+N,Z.y+F,_.x+N,_.y+F,G.x+N,G.y+F];if(vt(t,e,ee))return m(x),!0}else if($r(D,t,e))return m(x),!0}}for(var S=o.length-1;S>=0;S--){var C=o[S];C.isNode()?g(C)||w(C):y(C)||w(C)||w(C,"source")||w(C,"target")}return s};Er.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=[],o=Math.min(t,r),s=Math.max(t,r),u=Math.min(e,a),l=Math.max(e,a);t=o,r=s,e=u,a=l;for(var f=ct({x1:t,y1:e,x2:r,y2:a}),v=0;v<n.length;v++){var c=n[v];if(c.isNode()){var h=c,d=h.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Li(f,d)&&!eu(d,f)&&i.push(h)}else{var p=c,m=p._private,g=m.rscratch;if(g.startX!=null&&g.startY!=null&&!$r(f,g.startX,g.startY)||g.endX!=null&&g.endY!=null&&!$r(f,g.endX,g.endY))continue;if(g.edgeType==="bezier"||g.edgeType==="multibezier"||g.edgeType==="self"||g.edgeType==="compound"||g.edgeType==="segments"||g.edgeType==="haystack"){for(var y=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,b=!0,w=0;w<y.length;w++)if(!xd(f,y[w])){b=!1;break}b&&i.push(p)}else(g.edgeType==="haystack"||g.edgeType==="straight")&&i.push(p)}}return i};var xn={};xn.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",u,l,f,v,c,h,g,y;if(r?(f=e.haystackPts[0],v=e.haystackPts[1],c=e.haystackPts[2],h=e.haystackPts[3]):(f=e.arrowStartX,v=e.arrowStartY,c=e.arrowEndX,h=e.arrowEndY),g=e.midX,y=e.midY,i)u=f-e.segpts[0],l=v-e.segpts[1];else if(n||o||s||a){var d=e.allpts,p=Ge(d[0],d[2],d[4],.1),m=Ge(d[1],d[3],d[5],.1);u=f-p,l=v-m}else u=f-g,l=v-y;e.srcArrowAngle=Ka(u,l);var g=e.midX,y=e.midY;if(r&&(g=(f+c)/2,y=(v+h)/2),u=c-f,l=h-v,i){var d=e.allpts;if(d.length/2%2===0){var b=d.length/2,w=b-2;u=d[b]-d[w],l=d[b+1]-d[w+1]}else{var b=d.length/2-1,w=b-2,S=b+2;u=d[b]-d[w],l=d[b+1]-d[w+1]}}else if(n||o||s){var d=e.allpts,C=e.ctrlpts,x,T,E,P;if(C.length/2%2===0){var B=d.length/2-1,D=B+2,M=D+2;x=Ge(d[B],d[D],d[M],0),T=Ge(d[B+1],d[D+1],d[M+1],0),E=Ge(d[B],d[D],d[M],1e-4),P=Ge(d[B+1],d[D+1],d[M+1],1e-4)}else{var D=d.length/2-1,B=D-2,M=D+2;x=Ge(d[B],d[D],d[M],.4999),T=Ge(d[B+1],d[D+1],d[M+1],.4999),E=Ge(d[B],d[D],d[M],.5),P=Ge(d[B+1],d[D+1],d[M+1],.5)}u=E-x,l=P-T}if(e.midtgtArrowAngle=Ka(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var d=e.allpts;if(d.length/2%2!==0){var b=d.length/2-1,S=b+2;u=-(d[S]-d[b]),l=-(d[S+1]-d[b+1])}}if(e.midsrcArrowAngle=Ka(u,l),i)u=c-e.segpts[e.segpts.length-2],l=h-e.segpts[e.segpts.length-1];else if(n||o||s||a){var d=e.allpts,L=d.length,p=Ge(d[L-6],d[L-4],d[L-2],.9),m=Ge(d[L-5],d[L-3],d[L-1],.9);u=c-p,l=h-m}else u=c-g,l=h-y;e.tgtArrowAngle=Ka(u,l)};xn.getArrowWidth=xn.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},a=r[t+", "+e];return a||(a=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=a,a)};var ut={};ut.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],a=r._private,n=a.rscratch;if(!n.haystack){var i=Math.random()*2*Math.PI;n.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,n.target={x:Math.cos(i),y:Math.sin(i)}}var o=a.source,s=a.target,u=o.position(),l=s.position(),f=o.width(),v=s.width(),c=o.height(),h=s.height(),d=r.pstyle("haystack-radius").value,p=d/2;n.haystackPts=n.allpts=[n.source.x*f*p+u.x,n.source.y*c*p+u.y,n.target.x*v*p+l.x,n.target.y*h*p+l.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};ut.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,o=t.pstyle("edge-distances").value,s=t.pstyle("segment-weights"),u=t.pstyle("segment-distances"),l=Math.min(s.pfValue.length,u.pfValue.length);r.edgeType="segments",r.segpts=[];for(var f=0;f<l;f++){var v=s.pfValue[f],c=u.pfValue[f],h=1-v,d=v,p=o==="node-position"?a:n,m={x:p.x1*h+p.x2*d,y:p.y1*h+p.y2*d};r.segpts.push(m.x+i.x*c,m.y+i.y*c)}};ut.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,i=e.dirCounts,o=e.srcPos,s=t.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,v=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var c=r,h=v;a&&(c=0,h=u);var d=l-Math.PI/2,p=d-f/2,m=d+f/2,g=l+"_"+f;c=i[g]===void 0?i[g]=0:++i[g],n.ctrlpts=[o.x+Math.cos(p)*1.4*h*(c/3+1),o.y+Math.sin(p)*1.4*h*(c/3+1),o.x+Math.cos(m)*1.4*h*(c/3+1),o.y+Math.sin(m)*1.4*h*(c/3+1)]};ut.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,u=e.srcH,l=e.tgtW,f=e.tgtH,v=t.pstyle("control-point-step-size").pfValue,c=t.pstyle("control-point-distances"),h=c?c.pfValue[0]:void 0,d=r,p=v;a&&(d=0,p=h);var m=50,g={x:i.x-s/2,y:i.y-u/2},y={x:o.x-l/2,y:o.y-f/2},b={x:Math.min(g.x,y.x),y:Math.min(g.y,y.y)},w=.5,S=Math.max(w,Math.log(s*.01)),C=Math.max(w,Math.log(l*.01));n.ctrlpts=[b.x,b.y-(1+Math.pow(m,1.12)/100)*p*(d/3+1)*S,b.x-(1+Math.pow(m,1.12)/100)*p*(d/3+1)*C,b.y]};ut.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};ut.findBezierPoints=function(t,e,r,a,n){var i=t._private.rscratch,o=e.vectorNormInverse,s=e.posPts,u=e.intersectionPts,l=t.pstyle("edge-distances").value,f=t.pstyle("control-point-step-size").pfValue,v=t.pstyle("control-point-distances"),c=t.pstyle("control-point-weights"),h=v&&c?Math.min(v.value.length,c.value.length):1,d=v?v.pfValue[0]:void 0,p=c.value[0],m=a;i.edgeType=m?"multibezier":"bezier",i.ctrlpts=[];for(var g=0;g<h;g++){var y=(.5-e.eles.length/2+r)*f*(n?-1:1),b=void 0,w=_s(y);m&&(d=v?v.pfValue[g]:f,p=c.value[g]),a?b=d:b=d!==void 0?w*d:void 0;var S=b!==void 0?b:y,C=1-p,x=p,T=l==="node-position"?s:u,E={x:T.x1*C+T.x2*x,y:T.y1*C+T.y2*x};i.ctrlpts.push(E.x+o.x*S,E.y+o.y*S)}};ut.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",i="leftward",o="rightward",s="downward",u="upward",l="auto",f=e.posPts,v=e.srcW,c=e.srcH,h=e.tgtW,d=e.tgtH,p=t.pstyle("edge-distances").value,m=p!=="node-position",g=t.pstyle("taxi-direction").value,y=g,b=t.pstyle("taxi-turn"),w=b.units==="%",S=b.pfValue,C=S<0,x=t.pstyle("taxi-turn-min-distance").pfValue,T=m?(v+h)/2:0,E=m?(c+d)/2:0,P=f.x2-f.x1,B=f.y2-f.y1,D=function(j,le){return j>0?Math.max(j-le,0):Math.min(j+le,0)},M=D(P,T),L=D(B,E),R=!1;y===l?g=Math.abs(M)>Math.abs(L)?n:a:y===u||y===s?(g=a,R=!0):(y===i||y===o)&&(g=n,R=!0);var O=g===a,A=O?L:M,N=O?B:P,F=_s(N),q=!1;!(R&&(w||C))&&(y===s&&N<0||y===u&&N>0||y===i&&N>0||y===o&&N<0)&&(F*=-1,A=F*Math.abs(A),q=!0);var z;if(w){var $=S<0?1+S:S;z=$*A}else{var K=S<0?A:0;z=K+S*F}var Y=function(j){return Math.abs(j)<x||Math.abs(j)>=Math.abs(A)},H=Y(z),W=Y(Math.abs(A)-Math.abs(z)),I=H||W;if(I&&!q)if(O){var G=Math.abs(N)<=c/2,Z=Math.abs(P)<=h/2;if(G){var _=(f.x1+f.x2)/2,ee=f.y1,de=f.y2;r.segpts=[_,ee,_,de]}else if(Z){var he=(f.y1+f.y2)/2,re=f.x1,te=f.x2;r.segpts=[re,he,te,he]}else r.segpts=[f.x1,f.y2]}else{var se=Math.abs(N)<=v/2,ie=Math.abs(B)<=d/2;if(se){var ae=(f.y1+f.y2)/2,ue=f.x1,ge=f.x2;r.segpts=[ue,ae,ge,ae]}else if(ie){var pe=(f.x1+f.x2)/2,ve=f.y1,xe=f.y2;r.segpts=[pe,ve,pe,xe]}else r.segpts=[f.x2,f.y1]}else if(O){var Q=f.y1+z+(m?c/2*F:0),k=f.x1,V=f.x2;r.segpts=[k,Q,V,Q]}else{var J=f.x1+z+(m?v/2*F:0),X=f.y1,U=f.y2;r.segpts=[J,X,J,U]}};ut.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,u=e.tgtH,l=e.srcShape,f=e.tgtShape,v=!ne(r.startX)||!ne(r.startY),c=!ne(r.arrowStartX)||!ne(r.arrowStartY),h=!ne(r.endX)||!ne(r.endY),d=!ne(r.arrowEndX)||!ne(r.arrowEndY),p=3,m=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,g=p*m,y=gr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),b=y<g,w=gr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),S=w<g,C=!1;if(v||c||b){C=!0;var x={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},T=Math.sqrt(x.x*x.x+x.y*x.y),E={x:x.x/T,y:x.y/T},P=Math.max(i,o),B={x:r.ctrlpts[0]+E.x*2*P,y:r.ctrlpts[1]+E.y*2*P},D=l.intersectLine(a.x,a.y,i,o,B.x,B.y,0);b?(r.ctrlpts[0]=r.ctrlpts[0]+E.x*(g-y),r.ctrlpts[1]=r.ctrlpts[1]+E.y*(g-y)):(r.ctrlpts[0]=D[0]+E.x*g,r.ctrlpts[1]=D[1]+E.y*g)}if(h||d||S){C=!0;var M={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},L=Math.sqrt(M.x*M.x+M.y*M.y),R={x:M.x/L,y:M.y/L},O=Math.max(i,o),A={x:r.ctrlpts[0]+R.x*2*O,y:r.ctrlpts[1]+R.y*2*O},N=f.intersectLine(n.x,n.y,s,u,A.x,A.y,0);S?(r.ctrlpts[0]=r.ctrlpts[0]+R.x*(g-w),r.ctrlpts[1]=r.ctrlpts[1]+R.y*(g-w)):(r.ctrlpts[0]=N[0]+R.x*g,r.ctrlpts[1]=N[1]+R.y*g)}C&&this.findEndpoints(t)}};ut.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var a,n;e.ctrlpts.length/2%2===0?(a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1]):(a=e.allpts.length/2-3,n=.5,e.midX=Ge(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=Ge(e.allpts[a+1],e.allpts[a+3],e.allpts[a+5],n))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments")if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.segpts.length%4===0){var i=e.segpts.length/2,o=i-2;e.midX=(e.segpts[o]+e.segpts[i])/2,e.midY=(e.segpts[o+1]+e.segpts[i+1])/2}else{var s=e.segpts.length/2-1;e.midX=e.segpts[s],e.midY=e.segpts[s+1]}};ut.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||ne(e.startX)&&ne(e.startY)&&ne(e.endX)&&ne(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Le("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw.  Adjust your edge style (e.g. control points) accordingly or use an alternative edge type.  This is expected behaviour when the source node and the target node overlap."))};ut.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,a=r.cy,n=a.hasCompoundNodes(),i={map:new At,get:function(x){var T=this.map.get(x[0]);return T!=null?T.get(x[1]):null},set:function(x,T){var E=this.map.get(x[0]);E==null&&(E=new At,this.map.set(x[0],E)),E.set(x[1],T)}},o=[],s=[],u=0;u<t.length;u++){var l=t[u],f=l._private,v=l.pstyle("curve-style").value;if(!(l.removed()||!l.takesUpSpace())){if(v==="haystack"){s.push(l);continue}var c=v==="unbundled-bezier"||v==="segments"||v==="straight"||v==="straight-triangle"||v==="taxi",h=v==="unbundled-bezier"||v==="bezier",d=f.source,p=f.target,m=d.poolIndex(),g=p.poolIndex(),y=[m,g].sort(),b=i.get(y);b==null&&(b={eles:[]},i.set(y,b),o.push(y)),b.eles.push(l),c&&(b.hasUnbundled=!0),h&&(b.hasBezier=!0)}}for(var w=function(x){var T=o[x],E=i.get(T),P=void 0;if(!E.hasUnbundled){var B=E.eles[0].parallelEdges().filter(function(xe){return xe.isBundledBezier()});Pi(E.eles),B.forEach(function(xe){return E.eles.push(xe)}),E.eles.sort(function(xe,Q){return xe.poolIndex()-Q.poolIndex()})}var D=E.eles[0],M=D.source(),L=D.target();if(M.poolIndex()>L.poolIndex()){var R=M;M=L,L=R}var O=E.srcPos=M.position(),A=E.tgtPos=L.position(),N=E.srcW=M.outerWidth(),F=E.srcH=M.outerHeight(),q=E.tgtW=L.outerWidth(),z=E.tgtH=L.outerHeight(),$=E.srcShape=r.nodeShapes[e.getNodeShape(M)],K=E.tgtShape=r.nodeShapes[e.getNodeShape(L)];E.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Y=0;Y<E.eles.length;Y++){var H=E.eles[Y],W=H[0]._private.rscratch,I=H.pstyle("curve-style").value,G=I==="unbundled-bezier"||I==="segments"||I==="taxi",Z=!M.same(H.source());if(!E.calculatedIntersection&&M!==L&&(E.hasBezier||E.hasUnbundled)){E.calculatedIntersection=!0;var _=$.intersectLine(O.x,O.y,N,F,A.x,A.y,0),ee=E.srcIntn=_,de=K.intersectLine(A.x,A.y,q,z,O.x,O.y,0),he=E.tgtIntn=de,re=E.intersectionPts={x1:_[0],x2:de[0],y1:_[1],y2:de[1]},te=E.posPts={x1:O.x,x2:A.x,y1:O.y,y2:A.y},se=de[1]-_[1],ie=de[0]-_[0],ae=Math.sqrt(ie*ie+se*se),ue=E.vector={x:ie,y:se},ge=E.vectorNorm={x:ue.x/ae,y:ue.y/ae},pe={x:-ge.y,y:ge.x};E.nodesOverlap=!ne(ae)||K.checkPoint(_[0],_[1],0,q,z,A.x,A.y)||$.checkPoint(de[0],de[1],0,N,F,O.x,O.y),E.vectorNormInverse=pe,P={nodesOverlap:E.nodesOverlap,dirCounts:E.dirCounts,calculatedIntersection:!0,hasBezier:E.hasBezier,hasUnbundled:E.hasUnbundled,eles:E.eles,srcPos:A,tgtPos:O,srcW:q,srcH:z,tgtW:N,tgtH:F,srcIntn:he,tgtIntn:ee,srcShape:K,tgtShape:$,posPts:{x1:te.x2,y1:te.y2,x2:te.x1,y2:te.y1},intersectionPts:{x1:re.x2,y1:re.y2,x2:re.x1,y2:re.y1},vector:{x:-ue.x,y:-ue.y},vectorNorm:{x:-ge.x,y:-ge.y},vectorNormInverse:{x:-pe.x,y:-pe.y}}}var ve=Z?P:E;W.nodesOverlap=ve.nodesOverlap,W.srcIntn=ve.srcIntn,W.tgtIntn=ve.tgtIntn,n&&(M.isParent()||M.isChild()||L.isParent()||L.isChild())&&(M.parents().anySame(L)||L.parents().anySame(M)||M.same(L)&&M.isParent())?e.findCompoundLoopPoints(H,ve,Y,G):M===L?e.findLoopPoints(H,ve,Y,G):I==="segments"?e.findSegmentsPoints(H,ve):I==="taxi"?e.findTaxiPoints(H,ve):I==="straight"||!G&&E.eles.length%2===1&&Y===Math.floor(E.eles.length/2)?e.findStraightEdgePoints(H):e.findBezierPoints(H,ve,Y,G,Z),e.findEndpoints(H),e.tryToCorrectInvalidPoints(H,ve),e.checkForInvalidEdgeWarning(H),e.storeAllpts(H),e.storeEdgeProjections(H),e.calculateArrowAngles(H),e.recalculateEdgeLabelProjections(H),e.calculateLabelAngles(H)}},S=0;S<o.length;S++)w(S);this.findHaystackPoints(s)}};function qu(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];e.push({x:a,y:n})}return e}}ut.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),qu(e.segpts)};ut.getControlPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return this.recalculateRenderedStyle(t),qu(e.ctrlpts)};ut.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Na={};Na.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),i=t.outerHeight();if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*n),e.units[1]==="%"&&(o[1]=o[1]*i),o[0]+=a.x,o[1]+=a.y,o}else{var s=e.pfValue[0];s=-Math.PI/2+s;var u=2*Math.max(n,i),l=[a.x+Math.cos(s)*u,a.y+Math.sin(s)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(a.x,a.y,n,i,l[0],l[1],0)}};Na.findEndpoints=function(t){var e=this,r,a=t.source()[0],n=t.target()[0],i=a.position(),o=n.position(),s=t.pstyle("target-arrow-shape").value,u=t.pstyle("source-arrow-shape").value,l=t.pstyle("target-distance-from-node").pfValue,f=t.pstyle("source-distance-from-node").pfValue,v=t.pstyle("curve-style").value,c=t._private.rscratch,h=c.edgeType,d=v==="taxi",p=h==="self"||h==="compound",m=h==="bezier"||h==="multibezier"||p,g=h!=="bezier",y=h==="straight"||h==="segments",b=h==="segments",w=m||g||y,S=p||d,C=t.pstyle("source-endpoint"),x=S?"outside-to-node":C.value,T=t.pstyle("target-endpoint"),E=S?"outside-to-node":T.value;c.srcManEndpt=C,c.tgtManEndpt=T;var P,B,D,M;if(m){var L=[c.ctrlpts[0],c.ctrlpts[1]],R=g?[c.ctrlpts[c.ctrlpts.length-2],c.ctrlpts[c.ctrlpts.length-1]]:L;P=R,B=L}else if(y){var O=b?c.segpts.slice(0,2):[o.x,o.y],A=b?c.segpts.slice(c.segpts.length-2):[i.x,i.y];P=A,B=O}if(E==="inside-to-node")r=[o.x,o.y];else if(T.units)r=this.manualEndptToPx(n,T);else if(E==="outside-to-line")r=c.tgtIntn;else if(E==="outside-to-node"||E==="outside-to-node-or-label"?D=P:(E==="outside-to-line"||E==="outside-to-line-or-label")&&(D=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(o.x,o.y,n.outerWidth(),n.outerHeight(),D[0],D[1],0),E==="outside-to-node-or-label"||E==="outside-to-line-or-label"){var N=n._private.rscratch,F=N.labelWidth,q=N.labelHeight,z=N.labelX,$=N.labelY,K=F/2,Y=q/2,H=n.pstyle("text-valign").value;H==="top"?$-=Y:H==="bottom"&&($+=Y);var W=n.pstyle("text-halign").value;W==="left"?z-=K:W==="right"&&(z+=K);var I=Ca(D[0],D[1],[z-K,$-Y,z+K,$-Y,z+K,$+Y,z-K,$+Y],o.x,o.y);if(I.length>0){var G=i,Z=fr(G,Rr(r)),_=fr(G,Rr(I)),ee=Z;if(_<Z&&(r=I,ee=_),I.length>2){var de=fr(G,{x:I[2],y:I[3]});de<ee&&(r=[I[2],I[3]])}}}var he=Ga(r,P,e.arrowShapes[s].spacing(t)+l),re=Ga(r,P,e.arrowShapes[s].gap(t)+l);if(c.endX=re[0],c.endY=re[1],c.arrowEndX=he[0],c.arrowEndY=he[1],x==="inside-to-node")r=[i.x,i.y];else if(C.units)r=this.manualEndptToPx(a,C);else if(x==="outside-to-line")r=c.srcIntn;else if(x==="outside-to-node"||x==="outside-to-node-or-label"?M=B:(x==="outside-to-line"||x==="outside-to-line-or-label")&&(M=[o.x,o.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(i.x,i.y,a.outerWidth(),a.outerHeight(),M[0],M[1],0),x==="outside-to-node-or-label"||x==="outside-to-line-or-label"){var te=a._private.rscratch,se=te.labelWidth,ie=te.labelHeight,ae=te.labelX,ue=te.labelY,ge=se/2,pe=ie/2,ve=a.pstyle("text-valign").value;ve==="top"?ue-=pe:ve==="bottom"&&(ue+=pe);var xe=a.pstyle("text-halign").value;xe==="left"?ae-=ge:xe==="right"&&(ae+=ge);var Q=Ca(M[0],M[1],[ae-ge,ue-pe,ae+ge,ue-pe,ae+ge,ue+pe,ae-ge,ue+pe],i.x,i.y);if(Q.length>0){var k=o,V=fr(k,Rr(r)),J=fr(k,Rr(Q)),X=V;if(J<V&&(r=[Q[0],Q[1]],X=J),Q.length>2){var U=fr(k,{x:Q[2],y:Q[3]});U<X&&(r=[Q[2],Q[3]])}}}var me=Ga(r,B,e.arrowShapes[u].spacing(t)+f),j=Ga(r,B,e.arrowShapes[u].gap(t)+f);c.startX=j[0],c.startY=j[1],c.arrowStartX=me[0],c.arrowStartY=me[1],w&&(!ne(c.startX)||!ne(c.startY)||!ne(c.endX)||!ne(c.endY)?c.badLine=!0:c.badLine=!1)};Na.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};Na.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var $i={};function ep(t,e,r){for(var a=function(l,f,v,c){return Ge(l,f,v,c)},n=e._private,i=n.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var s=t.bezierProjPcts[o];i.push({x:a(r[0],r[2],r[4],s),y:a(r[1],r[3],r[5],s)})}}$i.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,a=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,a==="multibezier"||a==="bezier"||a==="self"||a==="compound"){e.rstyle.bezierPts=[];for(var n=0;n+5<r.allpts.length;n+=4)ep(this,t,r.allpts.slice(n,n+6))}else if(a==="segments")for(var i=e.rstyle.linePts=[],n=0;n+1<r.allpts.length;n+=2)i.push({x:r.allpts[n],y:r.allpts[n+1]});else if(a==="haystack"){var o=r.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};$i.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var zt={};zt.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!er(e)){var r,a,n=t._private,i=t.width(),o=t.height(),s=t.padding(),u=t.position(),l=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,v=n.rscratch,c=n.rstyle;switch(l){case"left":r=u.x-i/2-s;break;case"right":r=u.x+i/2+s;break;default:r=u.x}switch(f){case"top":a=u.y-o/2-s;break;case"bottom":a=u.y+o/2+s;break;default:a=u.y}v.labelX=r,v.labelY=a,c.labelX=r,c.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var Hu=function(e,r){var a=Math.atan(r/e);return e===0&&a<0&&(a=a*-1),a},Wu=function(e,r){var a=r.x-e.x,n=r.y-e.y;return Hu(a,n)},tp=function(e,r,a,n){var i=Ea(0,n-.001,1),o=Ea(0,n+.001,1),s=Nr(e,r,a,i),u=Nr(e,r,a,o);return Wu(s,u)};zt.recalculateEdgeLabelProjections=function(t){var e,r=t._private,a=r.rscratch,n=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:a.midX,y:a.midY};var o=function(v,c,h){Qt(r.rscratch,v,c,h),Qt(r.rstyle,v,c,h)};o("labelX",null,e.x),o("labelY",null,e.y);var s=Hu(a.midDispX,a.midDispY);o("labelAutoAngle",null,s);var u=function f(){if(f.cache)return f.cache;for(var v=[],c=0;c+5<a.allpts.length;c+=4){var h={x:a.allpts[c],y:a.allpts[c+1]},d={x:a.allpts[c+2],y:a.allpts[c+3]},p={x:a.allpts[c+4],y:a.allpts[c+5]};v.push({p0:h,p1:d,p2:p,startDist:0,length:0,segments:[]})}var m=r.rstyle.bezierPts,g=n.bezierProjPcts.length;function y(x,T,E,P,B){var D=gr(T,E),M=x.segments[x.segments.length-1],L={p0:T,p1:E,t0:P,t1:B,startDist:M?M.startDist+M.length:0,length:D};x.segments.push(L),x.length+=D}for(var b=0;b<v.length;b++){var w=v[b],S=v[b-1];S&&(w.startDist=S.startDist+S.length),y(w,w.p0,m[b*g],0,n.bezierProjPcts[0]);for(var C=0;C<g-1;C++)y(w,m[b*g+C],m[b*g+C+1],n.bezierProjPcts[C],n.bezierProjPcts[C+1]);y(w,m[b*g+g-1],w.p2,n.bezierProjPcts[g-1],1)}return f.cache=v},l=function(v){var c,h=v==="source";if(i[v]){var d=t.pstyle(v+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var p=u(),m,g=0,y=0,b=0;b<p.length;b++){for(var w=p[h?b:p.length-1-b],S=0;S<w.segments.length;S++){var C=w.segments[h?S:w.segments.length-1-S],x=b===p.length-1&&S===w.segments.length-1;if(g=y,y+=C.length,y>=d||x){m={cp:w,segment:C};break}}if(m)break}var T=m.cp,E=m.segment,P=(d-g)/E.length,B=E.t1-E.t0,D=h?E.t0+B*P:E.t1-B*P;D=Ea(0,D,1),e=Nr(T.p0,T.p1,T.p2,D),c=tp(T.p0,T.p1,T.p2,D);break}case"straight":case"segments":case"haystack":{for(var M=0,L,R,O,A,N=a.allpts.length,F=0;F+3<N&&(h?(O={x:a.allpts[F],y:a.allpts[F+1]},A={x:a.allpts[F+2],y:a.allpts[F+3]}):(O={x:a.allpts[N-2-F],y:a.allpts[N-1-F]},A={x:a.allpts[N-4-F],y:a.allpts[N-3-F]}),L=gr(O,A),R=M,M+=L,!(M>=d));F+=2);var q=d-R,z=q/L;z=Ea(0,z,1),e=pd(O,A,z),c=Wu(O,A);break}}o("labelX",v,e.x),o("labelY",v,e.y),o("labelAutoAngle",v,c)}};l("source"),l("target"),this.applyLabelDimensions(t)}};zt.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};zt.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=this.calculateLabelDimensions(t,a),i=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,s=Bt(r.rscratch,"labelWrapCachedLines",e)||[],u=o!=="wrap"?1:Math.max(s.length,1),l=n.height/u,f=l*i,v=n.width,c=n.height+(u-1)*(i-1)*l;Qt(r.rstyle,"labelWidth",e,v),Qt(r.rscratch,"labelWidth",e,v),Qt(r.rstyle,"labelHeight",e,c),Qt(r.rscratch,"labelHeight",e,c),Qt(r.rscratch,"labelLineHeight",e,f)};zt.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,o=function(q,z){return z?(Qt(r.rscratch,q,e,z),z):Bt(r.rscratch,q,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l="​",f=n.split(`
`),v=t.pstyle("text-max-width").pfValue,c=t.pstyle("text-overflow-wrap").value,h=c==="anywhere",d=[],p=/[\s\u200b]+/,m=h?"":" ",g=0;g<f.length;g++){var y=f[g],b=this.calculateLabelDimensions(t,y),w=b.width;if(h){var S=y.split("").join(l);y=S}if(w>v){for(var C=y.split(p),x="",T=0;T<C.length;T++){var E=C[T],P=x.length===0?E:x+m+E,B=this.calculateLabelDimensions(t,P),D=B.width;D<=v?x+=E+m:(x&&d.push(x),x=E+m)}x.match(/^[\s\u200b]+$/)||d.push(x)}else d.push(y)}o("labelWrapCachedLines",d),n=o("labelWrapCachedText",d.join(`
`)),o("labelWrapKey",u)}else if(s==="ellipsis"){var M=t.pstyle("text-max-width").pfValue,L="",R="…",O=!1;if(this.calculateLabelDimensions(t,n).width<M)return n;for(var A=0;A<n.length;A++){var N=this.calculateLabelDimensions(t,L+n[A]+R).width;if(N>M)break;L+=n[A],A===n.length-1&&(O=!0)}return O||(L+=R),L}return n};zt.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};zt.calculateLabelDimensions=function(t,e){var r=this,a=hr(e,t._private.labelDimsKey),n=r.labelDimCache||(r.labelDimCache=[]),i=n[a];if(i!=null)return i;var o=0,s=t.pstyle("font-style").strValue,u=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,f=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=v.getContext("2d");var h=v.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}c.font="".concat(s," ").concat(f," ").concat(u,"px ").concat(l);for(var d=0,p=0,m=e.split(`
`),g=0;g<m.length;g++){var y=m[g],b=c.measureText(y),w=Math.ceil(b.width),S=u;d=Math.max(w,d),p+=S}return d+=o,p+=o,n[a]={width:d,height:p}};zt.calculateLabelAngle=function(t,e){var r=t._private,a=r.rscratch,n=t.isEdge(),i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:n&&s==="autorotate"?a.labelAutoAngle:s==="autorotate"?0:o.pfValue};zt.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),a=t._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(t),r&&(n.sourceLabelAngle=e.calculateLabelAngle(t,"source"),n.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var Ku={},ss=28,us=!1;Ku.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<ss||t.height()<ss))return us||(Le("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),us=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var a=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return r};var zn={};zn.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,a=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var u=0;u<o.length;u++){var l=o[u],f=l._private,v=f.rstyle;v.clean=!1,v.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(o){var s=o.target;a(s)}).on("style.* background.*",function(o){var s=o.target;a(s,!1)});var n=function(o){if(o){var s=r.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],f=l._private.rstyle;l.isNode()&&!f.cleanConnected&&(a(l.connectedEdges()),f.cleanConnected=!0)}if(s)for(var v=0;v<s.length;v++){var c=s[v];c(o,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){n(!0)},r.beforeRender(n,r.beforeRenderPriorities.eleCalcs)};zn.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};zn.recalculateRenderedStyle=function(t,e){var r=function(w){return w._private.rstyle.cleanConnected},a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var o=t[i],s=o._private,u=s.rstyle;o.isEdge()&&(!r(o.source())||!r(o.target()))&&(u.clean=!1),!(e&&u.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?n.push(o):a.push(o),u.clean=!0)}for(var l=0;l<n.length;l++){var f=n[l],v=f._private,c=v.rstyle,h=f.position();this.recalculateNodeLabelProjection(f),c.nodeX=h.x,c.nodeY=h.y,c.nodeW=f.pstyle("width").pfValue,c.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var p=a[d],m=p._private,g=m.rstyle,y=m.rscratch;g.srcX=y.arrowStartX,g.srcY=y.arrowStartY,g.tgtX=y.arrowEndX,g.tgtY=y.arrowEndY,g.midX=y.midX,g.midY=y.midY,g.labelAngle=y.labelAngle,g.sourceLabelAngle=y.sourceLabelAngle,g.targetLabelAngle=y.targetLabelAngle}}};var Fn={};Fn.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var a=t[r],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?t.drag.push(a):t.nondrag.push(a)}for(var r=0;r<e.length;r++){var a=e[r];t.drag.push(a)}}};Fn.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Fn.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Lu),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Gu={};[Er,xn,ut,Na,$i,zt,Ku,zn,Fn].forEach(function(t){ce(Gu,t)});var Yu={};Yu.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},i=n[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=n[t]=n[t]||{};var o=i.image=new Image;o.addEventListener("load",r),o.addEventListener("error",function(){o.error=!0});var s="data:",u=t.substring(0,s.length).toLowerCase()===s;return u||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var jr={};jr.registerBinding=function(t,e,r,a){var n=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,n)};jr.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||xc(t);if(e.supportsPassiveEvents==null){var n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return n=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=n}var o=function(u,l,f){var v=Array.prototype.slice.call(arguments);return a&&e.supportsPassiveEvents&&(v[2]={capture:f??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:v}),(t.addEventListener||t.on).apply(t,v),this};return{on:o,addEventListener:o,addListener:o,bind:o}};jr.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};jr.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};jr.load=function(){var t=this,e=t.cy.window(),r=function(k){return k.selected()},a=function(k,V,J,X){k==null&&(k=t.cy);for(var U=0;U<V.length;U++){var me=V[U];k.emit({originalEvent:J,type:me,position:X})}},n=function(k){return k.shiftKey||k.metaKey||k.ctrlKey},i=function(k,V){var J=!0;if(t.cy.hasCompoundNodes()&&k&&k.pannable())for(var X=0;V&&X<V.length;X++){var k=V[X];if(k.isNode()&&k.isParent()&&!k.pannable()){J=!1;break}}else J=!0;return J},o=function(k){k[0]._private.grabbed=!0},s=function(k){k[0]._private.grabbed=!1},u=function(k){k[0]._private.rscratch.inDragLayer=!0},l=function(k){k[0]._private.rscratch.inDragLayer=!1},f=function(k){k[0]._private.rscratch.isGrabTarget=!0},v=function(k){k[0]._private.rscratch.isGrabTarget=!1},c=function(k,V){var J=V.addToList,X=J.has(k);!X&&k.grabbable()&&!k.locked()&&(J.merge(k),o(k))},h=function(k,V){if(k.cy().hasCompoundNodes()&&!(V.inDragLayer==null&&V.addToList==null)){var J=k.descendants();V.inDragLayer&&(J.forEach(u),J.connectedEdges().forEach(u)),V.addToList&&c(J,V)}},d=function(k,V){V=V||{};var J=k.cy().hasCompoundNodes();V.inDragLayer&&(k.forEach(u),k.neighborhood().stdFilter(function(X){return!J||X.isEdge()}).forEach(u)),V.addToList&&k.forEach(function(X){c(X,V)}),h(k,V),g(k,{inDragLayer:V.inDragLayer}),t.updateCachedGrabbedEles()},p=d,m=function(k){k&&(t.getCachedZSortedEles().forEach(function(V){s(V),l(V),v(V)}),t.updateCachedGrabbedEles())},g=function(k,V){if(!(V.inDragLayer==null&&V.addToList==null)&&k.cy().hasCompoundNodes()){var J=k.ancestors().orphans();if(!J.same(k)){var X=J.descendants().spawnSelf().merge(J).unmerge(k).unmerge(k.descendants()),U=X.connectedEdges();V.inDragLayer&&(U.forEach(u),X.forEach(u)),V.addToList&&X.forEach(function(me){c(me,V)})}}},y=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},b=typeof MutationObserver<"u",w=typeof ResizeObserver<"u";b?(t.removeObserver=new MutationObserver(function(Q){for(var k=0;k<Q.length;k++){var V=Q[k],J=V.removedNodes;if(J)for(var X=0;X<J.length;X++){var U=J[X];if(U===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(Q){t.destroy()});var S=Tn.default(function(){t.cy.resize()},100);b&&(t.styleObserver=new MutationObserver(S),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",S),w&&(t.resizeObserver=new ResizeObserver(S),t.resizeObserver.observe(t.container));var C=function(k,V){for(;k!=null;)V(k),k=k.parentNode},x=function(){t.invalidateContainerClientCoordsCache()};C(t.container,function(Q){t.registerBinding(Q,"transitionend",x),t.registerBinding(Q,"animationend",x),t.registerBinding(Q,"scroll",x)}),t.registerBinding(t.container,"contextmenu",function(Q){Q.preventDefault()});var T=function(){return t.selection[4]!==0},E=function(k){for(var V=t.findContainerClientCoords(),J=V[0],X=V[1],U=V[2],me=V[3],j=k.touches?k.touches:[k],le=!1,Se=0;Se<j.length;Se++){var Me=j[Se];if(J<=Me.clientX&&Me.clientX<=J+U&&X<=Me.clientY&&Me.clientY<=X+me){le=!0;break}}if(!le)return!1;for(var be=t.container,ke=k.target,ye=ke.parentNode,we=!1;ye;){if(ye===be){we=!0;break}ye=ye.parentNode}return!!we};t.registerBinding(t.container,"mousedown",function(k){if(E(k)){k.preventDefault(),y(),t.hoverData.capture=!0,t.hoverData.which=k.which;var V=t.cy,J=[k.clientX,k.clientY],X=t.projectIntoViewport(J[0],J[1]),U=t.selection,me=t.findNearestElements(X[0],X[1],!0,!1),j=me[0],le=t.dragData.possibleDragElements;t.hoverData.mdownPos=X,t.hoverData.mdownGPos=J;var Se=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Fe=t.hoverData.down;Fe?Fe.emit({originalEvent:k,type:"taphold",position:{x:X[0],y:X[1]}}):V.emit({originalEvent:k,type:"taphold",position:{x:X[0],y:X[1]}})}},t.tapholdDuration)};if(k.which==3){t.hoverData.cxtStarted=!0;var Me={originalEvent:k,type:"cxttapstart",position:{x:X[0],y:X[1]}};j?(j.activate(),j.emit(Me),t.hoverData.down=j):V.emit(Me),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(k.which==1){j&&j.activate();{if(j!=null&&t.nodeIsGrabbable(j)){var be=function(Fe){return{originalEvent:k,type:Fe,position:{x:X[0],y:X[1]}}},ke=function(Fe){Fe.emit(be("grab"))};if(f(j),!j.selected())le=t.dragData.possibleDragElements=V.collection(),p(j,{addToList:le}),j.emit(be("grabon")).emit(be("grab"));else{le=t.dragData.possibleDragElements=V.collection();var ye=V.$(function(we){return we.isNode()&&we.selected()&&t.nodeIsGrabbable(we)});d(ye,{addToList:le}),j.emit(be("grabon")),ye.forEach(ke)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=j,t.hoverData.downs=me,t.hoverData.downTime=new Date().getTime()}a(j,["mousedown","tapstart","vmousedown"],k,{x:X[0],y:X[1]}),j==null?(U[4]=1,t.data.bgActivePosistion={x:X[0],y:X[1]},t.redrawHint("select",!0),t.redraw()):j.pannable()&&(U[4]=1),Se()}U[0]=U[2]=X[0],U[1]=U[3]=X[1]}},!1),t.registerBinding(e,"mousemove",function(k){var V=t.hoverData.capture;if(!(!V&&!E(k))){var J=!1,X=t.cy,U=X.zoom(),me=[k.clientX,k.clientY],j=t.projectIntoViewport(me[0],me[1]),le=t.hoverData.mdownPos,Se=t.hoverData.mdownGPos,Me=t.selection,be=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(be=t.findNearestElement(j[0],j[1],!0,!1));var ke=t.hoverData.last,ye=t.hoverData.down,we=[j[0]-Me[2],j[1]-Me[3]],Fe=t.dragData.possibleDragElements,Ye;if(Se){var Ct=me[0]-Se[0],St=Ct*Ct,Xe=me[1]-Se[1],yt=Xe*Xe,nt=St+yt;t.hoverData.isOverThresholdDrag=Ye=nt>=t.desktopTapThreshold2}var Vt=n(k);Ye&&(t.hoverData.tapholdCancelled=!0);var Xt=function(){var Mt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Mt.length===0?(Mt.push(we[0]),Mt.push(we[1])):(Mt[0]+=we[0],Mt[1]+=we[1])};J=!0,a(be,["mousemove","vmousemove","tapdrag"],k,{x:j[0],y:j[1]});var Sr=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||X.emit({originalEvent:k,type:"boxstart",position:{x:j[0],y:j[1]}}),Me[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Ye){var ur={originalEvent:k,type:"cxtdrag",position:{x:j[0],y:j[1]}};ye?ye.emit(ur):X.emit(ur),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||be!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:k,type:"cxtdragout",position:{x:j[0],y:j[1]}}),t.hoverData.cxtOver=be,be&&be.emit({originalEvent:k,type:"cxtdragover",position:{x:j[0],y:j[1]}}))}}else if(t.hoverData.dragging){if(J=!0,X.panningEnabled()&&X.userPanningEnabled()){var Tr;if(t.hoverData.justStartedPan){var $a=t.hoverData.mdownPos;Tr={x:(j[0]-$a[0])*U,y:(j[1]-$a[1])*U},t.hoverData.justStartedPan=!1}else Tr={x:we[0]*U,y:we[1]*U};X.panBy(Tr),X.emit("dragpan"),t.hoverData.dragged=!0}j=t.projectIntoViewport(k.clientX,k.clientY)}else if(Me[4]==1&&(ye==null||ye.pannable())){if(Ye){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(Vt||!X.panningEnabled()||!X.userPanningEnabled()))Sr();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var lr=i(ye,t.hoverData.downs);lr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Me[4]=0,t.data.bgActivePosistion=Rr(le),t.redrawHint("select",!0),t.redraw())}ye&&ye.pannable()&&ye.active()&&ye.unactivate()}}else{if(ye&&ye.pannable()&&ye.active()&&ye.unactivate(),(!ye||!ye.grabbed())&&be!=ke&&(ke&&a(ke,["mouseout","tapdragout"],k,{x:j[0],y:j[1]}),be&&a(be,["mouseover","tapdragover"],k,{x:j[0],y:j[1]}),t.hoverData.last=be),ye)if(Ye){if(X.boxSelectionEnabled()&&Vt)ye&&ye.grabbed()&&(m(Fe),ye.emit("freeon"),Fe.emit("free"),t.dragData.didDrag&&(ye.emit("dragfreeon"),Fe.emit("dragfree"))),Sr();else if(ye&&ye.grabbed()&&t.nodeIsDraggable(ye)){var lt=!t.dragData.didDrag;lt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||d(Fe,{inDragLayer:!0});var _e={x:0,y:0};if(ne(we[0])&&ne(we[1])&&(_e.x+=we[0],_e.y+=we[1],lt)){var ft=t.hoverData.dragDelta;ft&&ne(ft[0])&&ne(ft[1])&&(_e.x+=ft[0],_e.y+=ft[1])}t.hoverData.draggingEles=!0,Fe.silentShift(_e).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Xt();J=!0}if(Me[2]=j[0],Me[3]=j[1],J)return k.stopPropagation&&k.stopPropagation(),k.preventDefault&&k.preventDefault(),!1}},!1);var P,B,D;t.registerBinding(e,"mouseup",function(k){var V=t.hoverData.capture;if(V){t.hoverData.capture=!1;var J=t.cy,X=t.projectIntoViewport(k.clientX,k.clientY),U=t.selection,me=t.findNearestElement(X[0],X[1],!0,!1),j=t.dragData.possibleDragElements,le=t.hoverData.down,Se=n(k);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,le&&le.unactivate(),t.hoverData.which===3){var Me={originalEvent:k,type:"cxttapend",position:{x:X[0],y:X[1]}};if(le?le.emit(Me):J.emit(Me),!t.hoverData.cxtDragged){var be={originalEvent:k,type:"cxttap",position:{x:X[0],y:X[1]}};le?le.emit(be):J.emit(be)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(me,["mouseup","tapend","vmouseup"],k,{x:X[0],y:X[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(le,["click","tap","vclick"],k,{x:X[0],y:X[1]}),B=!1,k.timeStamp-D<=J.multiClickDebounceTime()?(P&&clearTimeout(P),B=!0,D=null,a(le,["dblclick","dbltap","vdblclick"],k,{x:X[0],y:X[1]})):(P=setTimeout(function(){B||a(le,["oneclick","onetap","voneclick"],k,{x:X[0],y:X[1]})},J.multiClickDebounceTime()),D=k.timeStamp)),le==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!n(k)&&(J.$(r).unselect(["tapunselect"]),j.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=j=J.collection()),me==le&&!t.dragData.didDrag&&!t.hoverData.selecting&&me!=null&&me._private.selectable&&(t.hoverData.dragging||(J.selectionType()==="additive"||Se?me.selected()?me.unselect(["tapunselect"]):me.select(["tapselect"]):Se||(J.$(r).unmerge(me).unselect(["tapunselect"]),me.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var ke=J.collection(t.getAllInBox(U[0],U[1],U[2],U[3]));t.redrawHint("select",!0),ke.length>0&&t.redrawHint("eles",!0),J.emit({type:"boxend",originalEvent:k,position:{x:X[0],y:X[1]}});var ye=function(Ye){return Ye.selectable()&&!Ye.selected()};J.selectionType()==="additive"||Se||J.$(r).unmerge(ke).unselect(),ke.emit("box").stdFilter(ye).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!U[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var we=le&&le.grabbed();m(j),we&&(le.emit("freeon"),j.emit("free"),t.dragData.didDrag&&(le.emit("dragfreeon"),j.emit("dragfree")))}}U[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null}},!1);var M=function(k){if(!t.scrollingPage){var V=t.cy,J=V.zoom(),X=V.pan(),U=t.projectIntoViewport(k.clientX,k.clientY),me=[U[0]*J+X.x,U[1]*J+X.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||T()){k.preventDefault();return}if(V.panningEnabled()&&V.userPanningEnabled()&&V.zoomingEnabled()&&V.userZoomingEnabled()){k.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var j;k.deltaY!=null?j=k.deltaY/-250:k.wheelDeltaY!=null?j=k.wheelDeltaY/1e3:j=k.wheelDelta/1e3,j=j*t.wheelSensitivity;var le=k.deltaMode===1;le&&(j*=33);var Se=V.zoom()*Math.pow(10,j);k.type==="gesturechange"&&(Se=t.gestureStartZoom*k.scale),V.zoom({level:Se,renderedPosition:{x:me[0],y:me[1]}}),V.emit(k.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",M,!0),t.registerBinding(e,"scroll",function(k){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(k){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||k.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(Q){t.hasTouchStarted||M(Q)},!0),t.registerBinding(t.container,"mouseout",function(k){var V=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseout",position:{x:V[0],y:V[1]}})},!1),t.registerBinding(t.container,"mouseover",function(k){var V=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseover",position:{x:V[0],y:V[1]}})},!1);var L,R,O,A,N,F,q,z,$,K,Y,H,W,I=function(k,V,J,X){return Math.sqrt((J-k)*(J-k)+(X-V)*(X-V))},G=function(k,V,J,X){return(J-k)*(J-k)+(X-V)*(X-V)},Z;t.registerBinding(t.container,"touchstart",Z=function(k){if(t.hasTouchStarted=!0,!!E(k)){y(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var V=t.cy,J=t.touchData.now,X=t.touchData.earlier;if(k.touches[0]){var U=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);J[0]=U[0],J[1]=U[1]}if(k.touches[1]){var U=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);J[2]=U[0],J[3]=U[1]}if(k.touches[2]){var U=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);J[4]=U[0],J[5]=U[1]}if(k.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var me=t.findContainerClientCoords();$=me[0],K=me[1],Y=me[2],H=me[3],L=k.touches[0].clientX-$,R=k.touches[0].clientY-K,O=k.touches[1].clientX-$,A=k.touches[1].clientY-K,W=0<=L&&L<=Y&&0<=O&&O<=Y&&0<=R&&R<=H&&0<=A&&A<=H;var j=V.pan(),le=V.zoom();N=I(L,R,O,A),F=G(L,R,O,A),q=[(L+O)/2,(R+A)/2],z=[(q[0]-j.x)/le,(q[1]-j.y)/le];var Se=200,Me=Se*Se;if(F<Me&&!k.touches[2]){var be=t.findNearestElement(J[0],J[1],!0,!0),ke=t.findNearestElement(J[2],J[3],!0,!0);be&&be.isNode()?(be.activate().emit({originalEvent:k,type:"cxttapstart",position:{x:J[0],y:J[1]}}),t.touchData.start=be):ke&&ke.isNode()?(ke.activate().emit({originalEvent:k,type:"cxttapstart",position:{x:J[0],y:J[1]}}),t.touchData.start=ke):V.emit({originalEvent:k,type:"cxttapstart",position:{x:J[0],y:J[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(k.touches[2])V.boxSelectionEnabled()&&k.preventDefault();else if(!k.touches[1]){if(k.touches[0]){var ye=t.findNearestElements(J[0],J[1],!0,!0),we=ye[0];if(we!=null&&(we.activate(),t.touchData.start=we,t.touchData.starts=ye,t.nodeIsGrabbable(we))){var Fe=t.dragData.touchDragEles=V.collection(),Ye=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),we.selected()?(Ye=V.$(function(nt){return nt.selected()&&t.nodeIsGrabbable(nt)}),d(Ye,{addToList:Fe})):p(we,{addToList:Fe}),f(we);var Ct=function(Vt){return{originalEvent:k,type:Vt,position:{x:J[0],y:J[1]}}};we.emit(Ct("grabon")),Ye?Ye.forEach(function(nt){nt.emit(Ct("grab"))}):we.emit(Ct("grab"))}a(we,["touchstart","tapstart","vmousedown"],k,{x:J[0],y:J[1]}),we==null&&(t.data.bgActivePosistion={x:U[0],y:U[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&a(t.touchData.start,["taphold"],k,{x:J[0],y:J[1]})},t.tapholdDuration)}}if(k.touches.length>=1){for(var St=t.touchData.startPosition=[null,null,null,null,null,null],Xe=0;Xe<J.length;Xe++)St[Xe]=X[Xe]=J[Xe];var yt=k.touches[0];t.touchData.startGPosition=[yt.clientX,yt.clientY]}}},!1);var _;t.registerBinding(window,"touchmove",_=function(k){var V=t.touchData.capture;if(!(!V&&!E(k))){var J=t.selection,X=t.cy,U=t.touchData.now,me=t.touchData.earlier,j=X.zoom();if(k.touches[0]){var le=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);U[0]=le[0],U[1]=le[1]}if(k.touches[1]){var le=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);U[2]=le[0],U[3]=le[1]}if(k.touches[2]){var le=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);U[4]=le[0],U[5]=le[1]}var Se=t.touchData.startGPosition,Me;if(V&&k.touches[0]&&Se){for(var be=[],ke=0;ke<U.length;ke++)be[ke]=U[ke]-me[ke];var ye=k.touches[0].clientX-Se[0],we=ye*ye,Fe=k.touches[0].clientY-Se[1],Ye=Fe*Fe,Ct=we+Ye;Me=Ct>=t.touchTapThreshold2}if(V&&t.touchData.cxt){k.preventDefault();var St=k.touches[0].clientX-$,Xe=k.touches[0].clientY-K,yt=k.touches[1].clientX-$,nt=k.touches[1].clientY-K,Vt=G(St,Xe,yt,nt),Xt=Vt/F,Sr=150,ur=Sr*Sr,Tr=1.5,$a=Tr*Tr;if(Xt>=$a||Vt>=ur){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var lr={originalEvent:k,type:"cxttapend",position:{x:U[0],y:U[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(lr),t.touchData.start=null):X.emit(lr)}}if(V&&t.touchData.cxt){var lr={originalEvent:k,type:"cxtdrag",position:{x:U[0],y:U[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(lr):X.emit(lr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var lt=t.findNearestElement(U[0],U[1],!0,!0);(!t.touchData.cxtOver||lt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:k,type:"cxtdragout",position:{x:U[0],y:U[1]}}),t.touchData.cxtOver=lt,lt&&lt.emit({originalEvent:k,type:"cxtdragover",position:{x:U[0],y:U[1]}}))}else if(V&&k.touches[2]&&X.boxSelectionEnabled())k.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||X.emit({originalEvent:k,type:"boxstart",position:{x:U[0],y:U[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,J[4]=1,!J||J.length===0||J[0]===void 0?(J[0]=(U[0]+U[2]+U[4])/3,J[1]=(U[1]+U[3]+U[5])/3,J[2]=(U[0]+U[2]+U[4])/3+1,J[3]=(U[1]+U[3]+U[5])/3+1):(J[2]=(U[0]+U[2]+U[4])/3,J[3]=(U[1]+U[3]+U[5])/3),t.redrawHint("select",!0),t.redraw();else if(V&&k.touches[1]&&!t.touchData.didSelect&&X.zoomingEnabled()&&X.panningEnabled()&&X.userZoomingEnabled()&&X.userPanningEnabled()){k.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var _e=t.dragData.touchDragEles;if(_e){t.redrawHint("drag",!0);for(var ft=0;ft<_e.length;ft++){var qa=_e[ft]._private;qa.grabbed=!1,qa.rscratch.inDragLayer=!1}}var Mt=t.touchData.start,St=k.touches[0].clientX-$,Xe=k.touches[0].clientY-K,yt=k.touches[1].clientX-$,nt=k.touches[1].clientY-K,eo=I(St,Xe,yt,nt),Il=eo/N;if(W){var Nl=St-L,zl=Xe-R,Fl=yt-O,Vl=nt-A,$l=(Nl+Fl)/2,ql=(zl+Vl)/2,ra=X.zoom(),Hn=ra*Il,Ha=X.pan(),to=z[0]*ra+Ha.x,ro=z[1]*ra+Ha.y,Hl={x:-Hn/ra*(to-Ha.x-$l)+to,y:-Hn/ra*(ro-Ha.y-ql)+ro};if(Mt&&Mt.active()){var _e=t.dragData.touchDragEles;m(_e),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Mt.unactivate().emit("freeon"),_e.emit("free"),t.dragData.didDrag&&(Mt.emit("dragfreeon"),_e.emit("dragfree"))}X.viewport({zoom:Hn,pan:Hl,cancelOnFailedZoom:!0}),X.emit("pinchzoom"),N=eo,L=St,R=Xe,O=yt,A=nt,t.pinching=!0}if(k.touches[0]){var le=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);U[0]=le[0],U[1]=le[1]}if(k.touches[1]){var le=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);U[2]=le[0],U[3]=le[1]}if(k.touches[2]){var le=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);U[4]=le[0],U[5]=le[1]}}else if(k.touches[0]&&!t.touchData.didSelect){var Tt=t.touchData.start,Wn=t.touchData.last,lt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(lt=t.findNearestElement(U[0],U[1],!0,!0)),V&&Tt!=null&&k.preventDefault(),V&&Tt!=null&&t.nodeIsDraggable(Tt))if(Me){var _e=t.dragData.touchDragEles,ao=!t.dragData.didDrag;ao&&d(_e,{inDragLayer:!0}),t.dragData.didDrag=!0;var aa={x:0,y:0};if(ne(be[0])&&ne(be[1])&&(aa.x+=be[0],aa.y+=be[1],ao)){t.redrawHint("eles",!0);var Dt=t.touchData.dragDelta;Dt&&ne(Dt[0])&&ne(Dt[1])&&(aa.x+=Dt[0],aa.y+=Dt[1])}t.hoverData.draggingEles=!0,_e.silentShift(aa).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==me[0]&&t.touchData.startPosition[1]==me[1]&&t.redrawHint("eles",!0),t.redraw()}else{var Dt=t.touchData.dragDelta=t.touchData.dragDelta||[];Dt.length===0?(Dt.push(be[0]),Dt.push(be[1])):(Dt[0]+=be[0],Dt[1]+=be[1])}if(a(Tt||lt,["touchmove","tapdrag","vmousemove"],k,{x:U[0],y:U[1]}),(!Tt||!Tt.grabbed())&&lt!=Wn&&(Wn&&Wn.emit({originalEvent:k,type:"tapdragout",position:{x:U[0],y:U[1]}}),lt&&lt.emit({originalEvent:k,type:"tapdragover",position:{x:U[0],y:U[1]}})),t.touchData.last=lt,V)for(var ft=0;ft<U.length;ft++)U[ft]&&t.touchData.startPosition[ft]&&Me&&(t.touchData.singleTouchMoved=!0);if(V&&(Tt==null||Tt.pannable())&&X.panningEnabled()&&X.userPanningEnabled()){var Wl=i(Tt,t.touchData.starts);Wl&&(k.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Rr(t.touchData.startPosition)),t.swipePanning?(X.panBy({x:be[0]*j,y:be[1]*j}),X.emit("dragpan")):Me&&(t.swipePanning=!0,X.panBy({x:ye*j,y:Fe*j}),X.emit("dragpan"),Tt&&(Tt.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var le=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);U[0]=le[0],U[1]=le[1]}}for(var ke=0;ke<U.length;ke++)me[ke]=U[ke];V&&k.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var ee;t.registerBinding(e,"touchcancel",ee=function(k){var V=t.touchData.start;t.touchData.capture=!1,V&&V.unactivate()});var de,he,re,te;if(t.registerBinding(e,"touchend",de=function(k){var V=t.touchData.start,J=t.touchData.capture;if(J)k.touches.length===0&&(t.touchData.capture=!1),k.preventDefault();else return;var X=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var U=t.cy,me=U.zoom(),j=t.touchData.now,le=t.touchData.earlier;if(k.touches[0]){var Se=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);j[0]=Se[0],j[1]=Se[1]}if(k.touches[1]){var Se=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);j[2]=Se[0],j[3]=Se[1]}if(k.touches[2]){var Se=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);j[4]=Se[0],j[5]=Se[1]}V&&V.unactivate();var Me;if(t.touchData.cxt){if(Me={originalEvent:k,type:"cxttapend",position:{x:j[0],y:j[1]}},V?V.emit(Me):U.emit(Me),!t.touchData.cxtDragged){var be={originalEvent:k,type:"cxttap",position:{x:j[0],y:j[1]}};V?V.emit(be):U.emit(be)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!k.touches[2]&&U.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var ke=U.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));X[0]=void 0,X[1]=void 0,X[2]=void 0,X[3]=void 0,X[4]=0,t.redrawHint("select",!0),U.emit({type:"boxend",originalEvent:k,position:{x:j[0],y:j[1]}});var ye=function(ur){return ur.selectable()&&!ur.selected()};ke.emit("box").stdFilter(ye).select().emit("boxselect"),ke.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(V!=null&&V.unactivate(),k.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!k.touches[1]){if(!k.touches[0]){if(!k.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var we=t.dragData.touchDragEles;if(V!=null){var Fe=V._private.grabbed;m(we),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Fe&&(V.emit("freeon"),we.emit("free"),t.dragData.didDrag&&(V.emit("dragfreeon"),we.emit("dragfree"))),a(V,["touchend","tapend","vmouseup","tapdragout"],k,{x:j[0],y:j[1]}),V.unactivate(),t.touchData.start=null}else{var Ye=t.findNearestElement(j[0],j[1],!0,!0);a(Ye,["touchend","tapend","vmouseup","tapdragout"],k,{x:j[0],y:j[1]})}var Ct=t.touchData.startPosition[0]-j[0],St=Ct*Ct,Xe=t.touchData.startPosition[1]-j[1],yt=Xe*Xe,nt=St+yt,Vt=nt*me*me;t.touchData.singleTouchMoved||(V||U.$(":selected").unselect(["tapunselect"]),a(V,["tap","vclick"],k,{x:j[0],y:j[1]}),he=!1,k.timeStamp-te<=U.multiClickDebounceTime()?(re&&clearTimeout(re),he=!0,te=null,a(V,["dbltap","vdblclick"],k,{x:j[0],y:j[1]})):(re=setTimeout(function(){he||a(V,["onetap","voneclick"],k,{x:j[0],y:j[1]})},U.multiClickDebounceTime()),te=k.timeStamp)),V!=null&&!t.dragData.didDrag&&V._private.selectable&&Vt<t.touchTapThreshold2&&!t.pinching&&(U.selectionType()==="single"?(U.$(r).unmerge(V).unselect(["tapunselect"]),V.select(["tapselect"])):V.selected()?V.unselect(["tapunselect"]):V.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Xt=0;Xt<j.length;Xt++)le[Xt]=j[Xt];t.dragData.didDrag=!1,k.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),k.touches.length<2&&(k.touches.length===1&&(t.touchData.startGPosition=[k.touches[0].clientX,k.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var se=[],ie=function(k){return{clientX:k.clientX,clientY:k.clientY,force:1,identifier:k.pointerId,pageX:k.pageX,pageY:k.pageY,radiusX:k.width/2,radiusY:k.height/2,screenX:k.screenX,screenY:k.screenY,target:k.target}},ae=function(k){return{event:k,touch:ie(k)}},ue=function(k){se.push(ae(k))},ge=function(k){for(var V=0;V<se.length;V++){var J=se[V];if(J.event.pointerId===k.pointerId){se.splice(V,1);return}}},pe=function(k){var V=se.filter(function(J){return J.event.pointerId===k.pointerId})[0];V.event=k,V.touch=ie(k)},ve=function(k){k.touches=se.map(function(V){return V.touch})},xe=function(k){return k.pointerType==="mouse"||k.pointerType===4};t.registerBinding(t.container,"pointerdown",function(Q){xe(Q)||(Q.preventDefault(),ue(Q),ve(Q),Z(Q))}),t.registerBinding(t.container,"pointerup",function(Q){xe(Q)||(ge(Q),ve(Q),de(Q))}),t.registerBinding(t.container,"pointercancel",function(Q){xe(Q)||(ge(Q),ve(Q),ee(Q))}),t.registerBinding(t.container,"pointermove",function(Q){xe(Q)||(Q.preventDefault(),pe(Q),ve(Q),_(Q))})}};var Gt={};Gt.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(a,n,i,o,s){this.renderer.nodeShapeImpl("polygon",a,n,i,o,s,this.points)},intersectLine:function(a,n,i,o,s,u,l){return Ca(s,u,this.points,a,n,i/2,o/2,l)},checkPoint:function(a,n,i,o,s,u,l){return Ht(a,n,this.points,u,l,o,s,[0,-1],i)}}};Gt.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,a,n,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s){return Bd(i,o,e,r,a/2+s,n/2+s)},checkPoint:function(e,r,a,n,i,o,s){return cr(e,r,n,i,o,s,a)}}};Gt.generateRoundPolygon=function(t,e){for(var r=new Array(e.length*2),a=0;a<e.length/2;a++){var n=a*2,i=void 0;a<e.length/2-1?i=(a+1)*2:i=0,r[a*4]=e[n],r[a*4+1]=e[n+1];var o=e[i]-e[n],s=e[i+1]-e[n+1],u=Math.sqrt(o*o+s*s);r[a*4+2]=o/u,r[a*4+3]=s/u}return this.nodeShapes[t]={renderer:this,name:t,points:r,draw:function(f,v,c,h,d){this.renderer.nodeShapeImpl("round-polygon",f,v,c,h,d,this.points)},intersectLine:function(f,v,c,h,d,p,m){return Ld(d,p,this.points,f,v,c,h)},checkPoint:function(f,v,c,h,d,p,m){return Pd(f,v,this.points,p,m,h,d)}}};Gt.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:it(4,0),draw:function(e,r,a,n,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s){return tu(i,o,e,r,a,n,s)},checkPoint:function(e,r,a,n,i,o,s){var u=Aa(n,i),l=u*2;return!!(Ht(e,r,this.points,o,s,n,i-l,[0,-1],a)||Ht(e,r,this.points,o,s,n-l,i,[0,-1],a)||cr(e,r,l,l,o-n/2+u,s-i/2+u,a)||cr(e,r,l,l,o+n/2-u,s-i/2+u,a)||cr(e,r,l,l,o+n/2-u,s+i/2-u,a)||cr(e,r,l,l,o-n/2+u,s+i/2-u,a))}}};Gt.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:iu(),points:it(4,0),draw:function(e,r,a,n,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},generateCutTrianglePts:function(e,r,a,n){var i=this.cornerLength,o=r/2,s=e/2,u=a-s,l=a+s,f=n-o,v=n+o;return{topLeft:[u,f+i,u+i,f,u+i,f+i],topRight:[l-i,f,l,f+i,l-i,f+i],bottomRight:[l,v-i,l-i,v,l-i,v-i],bottomLeft:[u+i,v,u,v-i,u+i,v-i]}},intersectLine:function(e,r,a,n,i,o,s){var u=this.generateCutTrianglePts(a+2*s,n+2*s,e,r),l=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return Ca(i,o,l,e,r)},checkPoint:function(e,r,a,n,i,o,s){if(Ht(e,r,this.points,o,s,n,i-2*this.cornerLength,[0,-1],a)||Ht(e,r,this.points,o,s,n-2*this.cornerLength,i,[0,-1],a))return!0;var u=this.generateCutTrianglePts(n,i,o,s);return vt(e,r,u.topLeft)||vt(e,r,u.topRight)||vt(e,r,u.bottomRight)||vt(e,r,u.bottomLeft)}}};Gt.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:it(4,0),draw:function(e,r,a,n,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s){var u=.15,l=.5,f=.85,v=this.generateBarrelBezierPts(a+2*s,n+2*s,e,r),c=function(p){var m=Nr({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},u),g=Nr({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},l),y=Nr({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},f);return[p[0],p[1],m.x,m.y,g.x,g.y,y.x,y.y,p[4],p[5]]},h=[].concat(c(v.topLeft),c(v.topRight),c(v.bottomRight),c(v.bottomLeft));return Ca(i,o,h,e,r)},generateBarrelBezierPts:function(e,r,a,n){var i=r/2,o=e/2,s=a-o,u=a+o,l=n-i,f=n+i,v=ii(e,r),c=v.heightOffset,h=v.widthOffset,d=v.ctrlPtOffsetPct*e,p={topLeft:[s,l+c,s+d,l,s+h,l],topRight:[u-h,l,u-d,l,u,l+c],bottomRight:[u,f-c,u-d,f,u-h,f],bottomLeft:[s+h,f,s+d,f,s,f-c]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,r,a,n,i,o,s){var u=ii(n,i),l=u.heightOffset,f=u.widthOffset;if(Ht(e,r,this.points,o,s,n,i-2*l,[0,-1],a)||Ht(e,r,this.points,o,s,n-2*f,i,[0,-1],a))return!0;for(var v=this.generateBarrelBezierPts(n,i,o,s),c=function(x,T,E){var P=E[4],B=E[2],D=E[0],M=E[5],L=E[1],R=Math.min(P,D),O=Math.max(P,D),A=Math.min(M,L),N=Math.max(M,L);if(R<=x&&x<=O&&A<=T&&T<=N){var F=Md(P,B,D),q=Sd(F[0],F[1],F[2],x),z=q.filter(function($){return 0<=$&&$<=1});if(z.length>0)return z[0]}return null},h=Object.keys(v),d=0;d<h.length;d++){var p=h[d],m=v[p],g=c(e,r,m);if(g!=null){var y=m[5],b=m[3],w=m[1],S=Ge(y,b,w,g);if(m.isTop&&S<=r||m.isBottom&&r<=S)return!0}}return!1}}};Gt.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:it(4,0),draw:function(e,r,a,n,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,i)},intersectLine:function(e,r,a,n,i,o,s){var u=e-(a/2+s),l=r-(n/2+s),f=l,v=e+(a/2+s),c=Jt(i,o,e,r,u,l,v,f,!1);return c.length>0?c:tu(i,o,e,r,a,n,s)},checkPoint:function(e,r,a,n,i,o,s){var u=Aa(n,i),l=2*u;if(Ht(e,r,this.points,o,s,n,i-l,[0,-1],a)||Ht(e,r,this.points,o,s,n-l,i,[0,-1],a))return!0;var f=n/2+2*a,v=i/2+2*a,c=[o-f,s-v,o-f,s,o+f,s,o+f,s-v];return!!(vt(e,r,c)||cr(e,r,l,l,o+n/2-u,s+i/2-u,a)||cr(e,r,l,l,o-n/2+u,s+i/2-u,a))}}};Gt.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",it(3,0)),this.generateRoundPolygon("round-triangle",it(3,0)),this.generatePolygon("rectangle",it(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",it(5,0)),this.generateRoundPolygon("round-pentagon",it(5,0)),this.generatePolygon("hexagon",it(6,0)),this.generateRoundPolygon("round-hexagon",it(6,0)),this.generatePolygon("heptagon",it(7,0)),this.generateRoundPolygon("round-heptagon",it(7,0)),this.generatePolygon("octagon",it(8,0)),this.generateRoundPolygon("round-octagon",it(8,0));var a=new Array(20);{var n=ni(5,0),i=ni(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)a[s*4]=n[s*2],a[s*4+1]=n[s*2+1],a[s*4+2]=i[s*2],a[s*4+3]=i[s*2+1]}a=nu(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}t.makePolygon=function(l){var f=l.join("$"),v="polygon-"+f,c;return(c=this[v])?c:e.generatePolygon(v,l)}};var za={};za.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};za.redraw=function(t){t=t||Js();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};za.beforeRender=function(t,e){if(!this.destroyed){e==null&&Ve("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(a,n){return n.priority-a.priority})}};var ls=function(e,r,a){for(var n=e.beforeRenderCallbacks,i=0;i<n.length;i++)n[i].fn(r,a)};za.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function a(n){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){ls(t,!0,n);var i=qt();t.render(t.renderOptions);var o=t.lastDrawTime=qt();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var s=o-i;t.redrawTotalTime+=s,t.lastRedrawTime=s,t.averageRedrawTime=t.averageRedrawTime/2+s/2,t.requestedFrame=!1}else ls(t,!1,n);t.skipFrame=!1,gn(a)}};gn(r)}};var rp=function(e){this.init(e)},Xu=rp,_r=Xu.prototype;_r.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];_r.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),a=e.cy.window();if(a){var n=a.document,i=n.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",u=n.getElementById(o)!=null;if(r.className.indexOf(s)<0&&(r.className=(r.className||"")+" "+s),!u){var l=n.createElement("style");l.id=o,l.textContent="."+s+" { position: relative; }",i.insertBefore(l,i.children[0])}var f=a.getComputedStyle(r),v=f.getPropertyValue("position");v==="static"&&Le("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=ne(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};_r.notify=function(t,e){var r=this,a=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&a.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};_r.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],a=r,n=a.target;(n.off||n.removeEventListener).apply(n,a.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};_r.isHeadless=function(){return!1};[Vi,Gu,Yu,jr,Gt,za].forEach(function(t){ce(_r,t)});var ti=1e3/60,Uu={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var i=Tn.default(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=function(l,f){var v=qt(),c=n.averageRedrawTime,h=n.lastRedrawTime,d=[],p=n.cy.extent(),m=n.getPixelRatio();for(l||n.flushRenderedStyleQueue();;){var g=qt(),y=g-v,b=g-f;if(h<ti){var w=ti-(l?c:0);if(b>=e.deqFastCost*w)break}else if(l){if(y>=e.deqCost*h||y>=e.deqAvgCost*c)break}else if(b>=e.deqNoDrawCost*ti)break;var S=e.deq(a,m,p);if(S.length>0)for(var C=0;C<S.length;C++)d.push(S[C]);else break}d.length>0&&(e.onDeqd(a,d),!l&&e.shouldRedraw(a,d,m,p)&&i())},s=e.priority||ki;n.beforeRender(o,s(a))}}}},ap=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pn;Ei(this,t),this.idsByKey=new At,this.keyForId=new At,this.cachesByLvl=new At,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Ci(t,[{key:"getIdsFor",value:function(r){r==null&&Ve("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new Ur,a.set(r,n)),n}},{key:"addIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).add(a)}},{key:"deleteIdForKey",value:function(r,a){r!=null&&this.getIdsFor(r).delete(a)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);return n!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var a=this.cachesByLvl,n=this.lvls,i=a.get(r);return i||(i=new At,a.set(r,i),n.push(r)),i}},{key:"getCache",value:function(r,a){return this.getCachesAt(a).get(r)}},{key:"get",value:function(r,a){var n=this.getKey(r),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,a){var n=this.keyForId.get(r.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(r,a){return this.getCachesAt(a).has(r)}},{key:"has",value:function(r,a){var n=this.getKey(r);return this.hasCache(n,a)}},{key:"setCache",value:function(r,a,n){n.key=r,this.getCachesAt(a).set(r,n)}},{key:"set",value:function(r,a,n){var i=this.getKey(r);this.setCache(i,a,n),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,a){this.getCachesAt(a).delete(r)}},{key:"delete",value:function(r,a){var n=this.getKey(r);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(r){var a=this;this.lvls.forEach(function(n){return a.deleteCache(r,n)})}},{key:"invalidate",value:function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}]),t}(),fs=25,_a=50,cn=-4,ci=3,np=7.99,ip=8,op=1024,sp=1024,up=1024,lp=.2,fp=.8,vp=10,cp=.15,dp=.1,hp=.9,gp=.9,pp=100,mp=1,Ir={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},yp=Je({getKey:null,doesEleInvalidateKey:pn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Us,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),da=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=yp(r);ce(a,n),a.lookup=new ap(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},Ke=da.prototype;Ke.reasons=Ir;Ke.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};Ke.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};Ke.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new La.default(function(r,a){return a.reqs-r.reqs});return e};Ke.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};Ke.getElement=function(t,e,r,a,n){var i=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(a==null&&(a=Math.ceil(Bi(s*r))),a<cn)a=cn;else if(s>=np||a>ci)return null;var l=Math.pow(2,a),f=e.h*l,v=e.w*l,c=o.eleTextBiggerThanMin(t,l);if(!this.isVisible(t,c))return null;var h=u.get(t,a);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;var d;if(f<=fs?d=fs:f<=_a?d=_a:d=Math.ceil(f/_a)*_a,f>up||v>sp)return null;var p=i.getTextureQueue(d),m=p[p.length-2],g=function(){return i.recycleTexture(d,v)||i.addTexture(d,v)};m||(m=p[p.length-1]),m||(m=g()),m.width-m.usedWidth<v&&(m=g());for(var y=function(O){return O&&O.scaledLabelShown===c},b=n&&n===Ir.dequeue,w=n&&n===Ir.highQuality,S=n&&n===Ir.downscale,C,x=a+1;x<=ci;x++){var T=u.get(t,x);if(T){C=T;break}}var E=C&&C.level===a+1?C:null,P=function(){m.context.drawImage(E.texture.canvas,E.x,0,E.width,E.height,m.usedWidth,0,v,f)};if(m.context.setTransform(1,0,0,1,0,0),m.context.clearRect(m.usedWidth,0,v,d),y(E))P();else if(y(C))if(w){for(var B=C.level;B>a;B--)E=i.getElement(t,e,r,B,Ir.downscale);P()}else return i.queueElement(t,C.level-1),C;else{var D;if(!b&&!w&&!S)for(var M=a-1;M>=cn;M--){var L=u.get(t,M);if(L){D=L;break}}if(y(D))return i.queueElement(t,a),D;m.context.translate(m.usedWidth,0),m.context.scale(l,l),this.drawElement(m.context,t,e,c,!1),m.context.scale(1/l,1/l),m.context.translate(-m.usedWidth,0)}return h={x:m.usedWidth,texture:m,level:a,scale:l,width:v,height:f,scaledLabelShown:c},m.usedWidth+=Math.ceil(v+ip),m.eleCaches.push(h),u.set(t,a,h),i.checkTextureFullness(m),h};Ke.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};Ke.invalidateElement=function(t){var e=this,r=e.lookup,a=[],n=r.isInvalid(t);if(n){for(var i=cn;i<=ci;i++){var o=r.getForCachedKey(t,i);o&&a.push(o)}var s=r.invalidate(t);if(s)for(var u=0;u<a.length;u++){var l=a[u],f=l.texture;f.invalidatedWidth+=l.width,l.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(t)}};Ke.checkTextureUtility=function(t){t.invalidatedWidth>=lp*t.width&&this.retireTexture(t)};Ke.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>fp&&t.fullnessChecks>=vp?tr(r,t):t.fullnessChecks++};Ke.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;tr(a,t),t.retired=!0;for(var i=t.eleCaches,o=0;o<i.length;o++){var s=i[o];n.deleteCache(s.key,s.level)}Pi(i);var u=e.getRetiredTextureQueue(r);u.push(t)};Ke.addTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n={};return a.push(n),n.eleCaches=[],n.height=t,n.width=Math.max(op,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=r.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};Ke.recycleTexture=function(t,e){for(var r=this,a=r.getTextureQueue(t),n=r.getRetiredTextureQueue(t),i=0;i<n.length;i++){var o=n[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Pi(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),tr(n,o),a.push(o),o}};Ke.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),o=n[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,a.updateItem(o);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(s),n[i]=s}};Ke.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,o=0;o<mp&&r.size()>0;o++){var s=r.pop(),u=s.key,l=s.eles[0],f=i.hasCache(l,s.level);if(a[u]=null,f)continue;n.push(s);var v=e.getBoundingBox(l);e.getElement(l,v,t,s.level,Ir.dequeue)}return n};Ke.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Di,r.updateItem(i),r.pop(),a[n]=null):i.eles.unmerge(t))};Ke.onDequeue=function(t){this.onDequeues.push(t)};Ke.offDequeue=function(t){tr(this.onDequeues,t)};Ke.setupDequeueing=Uu.setupDequeueing({deqRedrawThreshold:pp,deqCost:cp,deqAvgCost:dp,deqNoDrawCost:hp,deqFastCost:gp,deq:function(e,r,a){return e.dequeue(r,a)},onDeqd:function(e,r){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(r)}},shouldRedraw:function(e,r,a,n){for(var i=0;i<r.length;i++)for(var o=r[i].eles,s=0;s<o.length;s++){var u=o[s].boundingBox();if(Li(u,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var bp=1,ga=-4,En=2,wp=3.99,xp=50,Ep=50,Cp=.15,Sp=.1,Tp=.9,Dp=.9,kp=1,vs=250,Pp=4e3*4e3,Bp=!0,Zu=function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=qt()-2*vs,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=Tn.default(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},Ep),a.beforeRender(function(o,s){s-r.lastInvalidationTime<=vs?r.skipping=!0:r.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var i=function(s,u){return u.reqs-s.reqs};r.layersQueue=new La.default(i),r.setupDequeueing()},je=Zu.prototype,cs=0,Lp=Math.pow(2,53)-1;je.makeLayer=function(t,e){var r=Math.pow(2,e),a=Math.ceil(t.w*r),n=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(a,n),o={id:cs=++cs%Lp,bb:t,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,u=-o.bb.x1,l=-o.bb.y1;return s.scale(r,r),s.translate(u,l),o};je.getLayers=function(t,e,r){var a=this,n=a.renderer,i=n.cy,o=i.zoom(),s=a.firstGet;if(a.firstGet=!1,r==null){if(r=Math.ceil(Bi(o*e)),r<ga)r=ga;else if(o>=wp||r>En)return null}a.validateLayersElesOrdering(r,t);var u=a.layersByLevel,l=Math.pow(2,r),f=u[r]=u[r]||[],v,c=a.levelIsComplete(r,t),h,d=function(){var P=function(R){if(a.validateLayersElesOrdering(R,t),a.levelIsComplete(R,t))return h=u[R],!0},B=function(R){if(!h)for(var O=r+R;ga<=O&&O<=En&&!P(O);O+=R);};B(1),B(-1);for(var D=f.length-1;D>=0;D--){var M=f[D];M.invalid&&tr(f,M)}};if(!c)d();else return f;var p=function(){if(!v){v=ct();for(var P=0;P<t.length;P++)bd(v,t[P].boundingBox())}return v},m=function(P){P=P||{};var B=P.after;p();var D=v.w*l*(v.h*l);if(D>Pp)return null;var M=a.makeLayer(v,r);if(B!=null){var L=f.indexOf(B)+1;f.splice(L,0,M)}else(P.insert===void 0||P.insert)&&f.unshift(M);return M};if(a.skipping&&!s)return null;for(var g=null,y=t.length/bp,b=!s,w=0;w<t.length;w++){var S=t[w],C=S._private.rscratch,x=C.imgLayerCaches=C.imgLayerCaches||{},T=x[r];if(T){g=T;continue}if((!g||g.eles.length>=y||!eu(g.bb,S.boundingBox()))&&(g=m({insert:!0,after:g}),!g))return null;h||b?a.queueLayer(g,S):a.drawEleInLayer(g,S,r,e),g.eles.push(S),x[r]=g}return h||(b?null:f)};je.getEleLevelForLayerLevel=function(t,e){return t};je.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,o=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,r,Bp),i.setImgSmoothing(o,!0))};je.levelIsComplete=function(t,e){var r=this,a=r.layersByLevel[t];if(!a||a.length===0)return!1;for(var n=0,i=0;i<a.length;i++){var o=a[i];if(o.reqs>0||o.invalid)return!1;n+=o.eles.length}return n===e.length};je.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var a=0;a<r.length;a++){for(var n=r[a],i=-1,o=0;o<e.length;o++)if(n.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(n);continue}for(var s=i,o=0;o<n.eles.length;o++)if(n.eles[o]!==e[s+o]){this.invalidateLayer(n);break}}};je.updateElementsInLayers=function(t,e){for(var r=this,a=Oa(t[0]),n=0;n<t.length;n++)for(var i=a?null:t[n],o=a?t[n]:t[n].ele,s=o._private.rscratch,u=s.imgLayerCaches=s.imgLayerCaches||{},l=ga;l<=En;l++){var f=u[l];f&&(i&&r.getEleLevelForLayerLevel(f.level)!==i.level||e(f,o,i))}};je.haveLayers=function(){for(var t=this,e=!1,r=ga;r<=En;r++){var a=t.layersByLevel[r];if(a&&a.length>0){e=!0;break}}return e};je.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=qt(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(a,n,i){e.invalidateLayer(a)}))};je.invalidateLayer=function(t){if(this.lastInvalidationTime=qt(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];tr(a,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var n=0;n<r.length;n++){var i=r[n]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}};je.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(a,n,i){var o=a.replacement;if(o||(o=a.replacement=e.makeLayer(a.bb,a.level),o.replaces=a,o.eles=a.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};je.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};je.queueLayer=function(t,e){var r=this,a=r.layersQueue,n=t.elesQueue,i=n.hasId=n.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,a.updateItem(t)):(t.reqs=1,a.push(t))}};je.dequeue=function(t){for(var e=this,r=e.layersQueue,a=[],n=0;n<kp&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,t),n++),a.length===0&&a.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return a};je.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],a=t.replaces,n=r.indexOf(a);if(!(n<0||a.invalid)){r[n]=t;for(var i=0;i<t.eles.length;i++){var o=t.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[t.level]=t)}e.requestRedraw()}};je.requestRedraw=Tn.default(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);je.setupDequeueing=Uu.setupDequeueing({deqRedrawThreshold:xp,deqCost:Cp,deqAvgCost:Sp,deqNoDrawCost:Tp,deqFastCost:Dp,deq:function(e,r){return e.dequeue(r)},onDeqd:ki,shouldRedraw:Us,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Qu={},ds;function Mp(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}function Op(t,e,r){for(var a,n=0;n<e.length;n++){var i=e[n];n===0&&(a=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,a.x,a.y)}function hs(t,e,r){t.beginPath&&t.beginPath();for(var a=e,n=0;n<a.length;n++){var i=a[n];t.lineTo(i.x,i.y)}var o=r,s=r[0];t.moveTo(s.x,s.y);for(var n=1;n<o.length;n++){var i=o[n];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function Ap(t,e,r,a,n){t.beginPath&&t.beginPath(),t.arc(r,a,n,0,Math.PI*2,!1);var i=e,o=i[0];t.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function Rp(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}Qu.arrowShapeImpl=function(t){return(ds||(ds={polygon:Mp,"triangle-backcurve":Op,"triangle-tee":hs,"circle-triangle":Ap,"triangle-cross":hs,circle:Rp}))[t]};var Ft={};Ft.drawElement=function(t,e,r,a,n,i){var o=this;e.isNode()?o.drawNode(t,e,r,a,n,i):o.drawEdge(t,e,r,a,n,i)};Ft.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};Ft.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};Ft.drawCachedElementPortion=function(t,e,r,a,n,i,o,s){var u=this,l=r.getBoundingBox(e);if(!(l.w===0||l.h===0)){var f=r.getElement(e,l,a,n,i);if(f!=null){var v=s(u,e);if(v===0)return;var c=o(u,e),h=l.x1,d=l.y1,p=l.w,m=l.h,g,y,b,w,S;if(c!==0){var C=r.getRotationPoint(e);b=C.x,w=C.y,t.translate(b,w),t.rotate(c),S=u.getImgSmoothing(t),S||u.setImgSmoothing(t,!0);var x=r.getRotationOffset(e);g=x.x,y=x.y}else g=h,y=d;var T;v!==1&&(T=t.globalAlpha,t.globalAlpha=T*v),t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,g,y,p,m),v!==1&&(t.globalAlpha=T),c!==0&&(t.rotate(-c),t.translate(-b,-w),S||u.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var Ip=function(){return 0},Np=function(e,r){return e.getTextAngle(r,null)},zp=function(e,r){return e.getTextAngle(r,"source")},Fp=function(e,r){return e.getTextAngle(r,"target")},Vp=function(e,r){return r.effectiveOpacity()},ri=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Ft.drawCachedElement=function(t,e,r,a,n,i){var o=this,s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,f=s.slbTxrCache,v=s.tlbTxrCache,c=e.boundingBox(),h=i===!0?u.reasons.highQuality:null;if(!(c.w===0||c.h===0||!e.visible())&&(!a||Li(c,a))){var d=e.isEdge(),p=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,u,r,n,h,Ip,Vp),(!d||!p)&&o.drawCachedElementPortion(t,e,l,r,n,h,Np,ri),d&&!p&&(o.drawCachedElementPortion(t,e,f,r,n,h,zp,ri),o.drawCachedElementPortion(t,e,v,r,n,h,Fp,ri)),o.drawElementOverlay(t,e)}};Ft.drawElements=function(t,e){for(var r=this,a=0;a<e.length;a++){var n=e[a];r.drawElement(t,n)}};Ft.drawCachedElements=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];n.drawCachedElement(t,o,r,a)}};Ft.drawCachedNodes=function(t,e,r,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&n.drawCachedElement(t,o,r,a)}};Ft.drawLayeredElements=function(t,e,r,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,r);if(i)for(var o=0;o<i.length;o++){var s=i[o],u=s.bb;u.w===0||u.h===0||t.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}else n.drawCachedElements(t,e,r,a)};var Yt={};Yt.drawEdge=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var u;r&&(u=r,t.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,v=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,p=l*f,m=l*f,g=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;v==="straight-triangle"?(o.eleStrokeStyle(t,e,D),o.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=h,t.lineCap=d,o.eleStrokeStyle(t,e,D),o.drawEdgePath(e,t,s.allpts,c),t.lineCap="butt")},y=function(){n&&o.drawEdgeOverlay(t,e)},b=function(){n&&o.drawEdgeUnderlay(t,e)},w=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;o.drawArrowheads(t,e,D)},S=function(){o.drawElementText(t,e,null,a)};t.lineJoin="round";var C=e.pstyle("ghost").value==="yes";if(C){var x=e.pstyle("ghost-offset-x").pfValue,T=e.pstyle("ghost-offset-y").pfValue,E=e.pstyle("ghost-opacity").value,P=p*E;t.translate(x,T),g(P),w(P),t.translate(-x,-T)}b(),g(),w(),y(),S(),r&&t.translate(u.x1,u.y1)}};var Ju=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,o=i.usePaths(),s=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,f=a.pstyle("".concat(e,"-color")).value;r.lineWidth=l,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,f[0],f[1],f[2],n),i.drawEdgePath(a,r,s.allpts,"solid")}}}};Yt.drawEdgeOverlay=Ju("overlay");Yt.drawEdgeUnderlay=Ju("underlay");Yt.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,o,s=!1,u=this.usePaths(),l=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(u){var v=r.join("$"),c=n.pathCacheKey&&n.pathCacheKey===v;c?(o=e=n.pathCache,s=!0):(o=e=new Path2D,n.pathCacheKey=v,n.pathCache=o)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!s&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<r.length;h+=4)e.quadraticCurveTo(r[h],r[h+1],r[h+2],r[h+3]);break;case"straight":case"segments":case"haystack":for(var d=2;d+1<r.length;d+=2)e.lineTo(r[d],r[d+1]);break}e=i,u?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};Yt.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var a=t.pstyle("width").pfValue,n=0;n+1<r.length;n+=2){var i=[r[n+2]-r[n],r[n+3]-r[n+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],u=[s[0]*a/2,s[1]*a/2];e.beginPath(),e.moveTo(r[n]-u[0],r[n+1]-u[1]),e.lineTo(r[n]+u[0],r[n+1]+u[1]),e.lineTo(r[n+2],r[n+3]),e.closePath(),e.fill()}};Yt.drawArrowheads=function(t,e,r){var a=e._private.rscratch,n=a.edgeType==="haystack";n||this.drawArrowhead(t,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,r),n||this.drawArrowhead(t,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,r)};Yt.drawArrowhead=function(t,e,r,a,n,i,o){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)){var s=this,u=e.pstyle(r+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,v=e.pstyle("width").pfValue,c=e.pstyle("opacity").value;o===void 0&&(o=c);var h=t.globalCompositeOperation;(o!==1||f==="hollow")&&(t.globalCompositeOperation="destination-out",s.colorFillStyle(t,255,255,255,1),s.colorStrokeStyle(t,255,255,255,1),s.drawArrowShape(e,t,l,v,u,a,n,i),t.globalCompositeOperation=h);var d=e.pstyle(r+"-arrow-color").value;s.colorFillStyle(t,d[0],d[1],d[2],o),s.colorStrokeStyle(t,d[0],d[1],d[2],o),s.drawArrowShape(e,t,f,v,u,a,n,i)}}};Yt.drawArrowShape=function(t,e,r,a,n,i,o,s){var u=this,l=this.usePaths()&&n!=="triangle-cross",f=!1,v,c=e,h={x:i,y:o},d=t.pstyle("arrow-scale").value,p=this.getArrowWidth(a,d),m=u.arrowShapes[n];if(l){var g=u.arrowPathCache=u.arrowPathCache||[],y=hr(n),b=g[y];b!=null?(v=e=b,f=!0):(v=e=new Path2D,g[y]=v)}f||(e.beginPath&&e.beginPath(),l?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,p,s,h,a),e.closePath&&e.closePath()),e=c,l&&(e.translate(i,o),e.rotate(s),e.scale(p,p)),(r==="filled"||r==="both")&&(l?e.fill(v):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=(m.matchEdgeWidth?a:1)/(l?p:1),e.lineJoin="miter",l?e.stroke(v):e.stroke()),l&&(e.scale(1/p,1/p),e.rotate(-s),e.translate(-i,-o))};var qi={};qi.safeDrawImage=function(t,e,r,a,n,i,o,s,u,l){if(!(n<=0||i<=0||u<=0||l<=0))try{t.drawImage(e,r,a,n,i,o,s,u,l)}catch(f){Le(f)}};qi.drawInscribedImage=function(t,e,r,a,n){var i=this,o=r.position(),s=o.x,u=o.y,l=r.cy().style(),f=l.getIndexedStyle.bind(l),v=f(r,"background-fit","value",a),c=f(r,"background-repeat","value",a),h=r.width(),d=r.height(),p=r.padding()*2,m=h+(f(r,"background-width-relative-to","value",a)==="inner"?0:p),g=d+(f(r,"background-height-relative-to","value",a)==="inner"?0:p),y=r._private.rscratch,b=f(r,"background-clip","value",a),w=b==="node",S=f(r,"background-image-opacity","value",a)*n,C=f(r,"background-image-smoothing","value",a),x=e.width||e.cachedW,T=e.height||e.cachedH;(x==null||T==null)&&(document.body.appendChild(e),x=e.cachedW=e.width||e.offsetWidth,T=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var E=x,P=T;if(f(r,"background-width","value",a)!=="auto"&&(f(r,"background-width","units",a)==="%"?E=f(r,"background-width","pfValue",a)*m:E=f(r,"background-width","pfValue",a)),f(r,"background-height","value",a)!=="auto"&&(f(r,"background-height","units",a)==="%"?P=f(r,"background-height","pfValue",a)*g:P=f(r,"background-height","pfValue",a)),!(E===0||P===0)){if(v==="contain"){var B=Math.min(m/E,g/P);E*=B,P*=B}else if(v==="cover"){var B=Math.max(m/E,g/P);E*=B,P*=B}var D=s-m/2,M=f(r,"background-position-x","units",a),L=f(r,"background-position-x","pfValue",a);M==="%"?D+=(m-E)*L:D+=L;var R=f(r,"background-offset-x","units",a),O=f(r,"background-offset-x","pfValue",a);R==="%"?D+=(m-E)*O:D+=O;var A=u-g/2,N=f(r,"background-position-y","units",a),F=f(r,"background-position-y","pfValue",a);N==="%"?A+=(g-P)*F:A+=F;var q=f(r,"background-offset-y","units",a),z=f(r,"background-offset-y","pfValue",a);q==="%"?A+=(g-P)*z:A+=z,y.pathCache&&(D-=s,A-=u,s=0,u=0);var $=t.globalAlpha;t.globalAlpha=S;var K=i.getImgSmoothing(t),Y=!1;if(C==="no"&&K?(i.setImgSmoothing(t,!1),Y=!0):C==="yes"&&!K&&(i.setImgSmoothing(t,!0),Y=!0),c==="no-repeat")w&&(t.save(),y.pathCache?t.clip(y.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,m,g),t.clip())),i.safeDrawImage(t,e,0,0,x,T,D,A,E,P),w&&t.restore();else{var H=t.createPattern(e,c);t.fillStyle=H,i.nodeShapes[i.getNodeShape(r)].draw(t,s,u,m,g),t.translate(D,A),t.fill(),t.translate(-D,-A)}t.globalAlpha=$,Y&&i.setImgSmoothing(t,K)}};var Cr={};Cr.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(Bi(r*a));e=Math.pow(2,n)}var i=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};Cr.drawElementText=function(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(a==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var u=o.getLabelJustification(e);t.textAlign=u,t.textBaseline="bottom"}else{var l=e.element()._private.rscratch.badLine,f=e.pstyle("label"),v=e.pstyle("source-label"),c=e.pstyle("target-label");if(l||(!f||!f.value)&&(!v||!v.value)&&(!c||!c.value))return;t.textAlign="center",t.textBaseline="bottom"}var h=!r,d;r&&(d=r,t.translate(-d.x1,-d.y1)),n==null?(o.drawText(t,e,null,h,i),e.isEdge()&&(o.drawText(t,e,"source",h,i),o.drawText(t,e,"target",h,i))):o.drawText(t,e,n,h,i),r&&t.translate(d.x1,d.y1)};Cr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Cr.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*s,l=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+o+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,l[0],l[1],l[2],s),this.colorStrokeStyle(t,f[0],f[1],f[2],u)};function $p(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5;t.beginPath(),t.moveTo(e+i,r),t.lineTo(e+a-i,r),t.quadraticCurveTo(e+a,r,e+a,r+i),t.lineTo(e+a,r+n-i),t.quadraticCurveTo(e+a,r+n,e+a-i,r+n),t.lineTo(e+i,r+n),t.quadraticCurveTo(e,r+n,e,r+n-i),t.lineTo(e,r+i),t.quadraticCurveTo(e,r,e+i,r),t.closePath(),t.fill()}Cr.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,i=e?e+"-":"",o=t.pstyle(i+"text-rotation"),s=Bt(n,"labelAngle",e);return o.strValue==="autorotate"?r=t.isEdge()?s:0:o.strValue==="none"?r=0:r=o.pfValue,r};Cr.drawText=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=n?e.effectiveOpacity():1;if(!(n&&(s===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var u=Bt(o,"labelX",r),l=Bt(o,"labelY",r),f,v,c=this.getLabelText(e,r);if(c!=null&&c!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(t,e,n);var h=r?r+"-":"",d=Bt(o,"labelWidth",r),p=Bt(o,"labelHeight",r),m=e.pstyle(h+"text-margin-x").pfValue,g=e.pstyle(h+"text-margin-y").pfValue,y=e.isEdge(),b=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;y&&(b="center",w="center"),u+=m,l+=g;var S;switch(a?S=this.getTextAngle(e,r):S=0,S!==0&&(f=u,v=l,t.translate(f,v),t.rotate(S),u=0,l=0),w){case"top":break;case"center":l+=p/2;break;case"bottom":l+=p;break}var C=e.pstyle("text-background-opacity").value,x=e.pstyle("text-border-opacity").value,T=e.pstyle("text-border-width").pfValue,E=e.pstyle("text-background-padding").pfValue;if(C>0||T>0&&x>0){var P=u-E;switch(b){case"left":P-=d;break;case"center":P-=d/2;break}var B=l-p-E,D=d+2*E,M=p+2*E;if(C>0){var L=t.fillStyle,R=e.pstyle("text-background-color").value;t.fillStyle="rgba("+R[0]+","+R[1]+","+R[2]+","+C*s+")";var O=e.pstyle("text-background-shape").strValue;O.indexOf("round")===0?$p(t,P,B,D,M,2):t.fillRect(P,B,D,M),t.fillStyle=L}if(T>0&&x>0){var A=t.strokeStyle,N=t.lineWidth,F=e.pstyle("text-border-color").value,q=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+F[0]+","+F[1]+","+F[2]+","+x*s+")",t.lineWidth=T,t.setLineDash)switch(q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=T/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(t.strokeRect(P,B,D,M),q==="double"){var z=T/2;t.strokeRect(P+z,B+z,D-z*2,M-z*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=N,t.strokeStyle=A}}var $=2*e.pstyle("text-outline-width").pfValue;if($>0&&(t.lineWidth=$),e.pstyle("text-wrap").value==="wrap"){var K=Bt(o,"labelWrapCachedLines",r),Y=Bt(o,"labelLineHeight",r),H=d/2,W=this.getLabelJustification(e);switch(W==="auto"||(b==="left"?W==="left"?u+=-d:W==="center"&&(u+=-H):b==="center"?W==="left"?u+=-H:W==="right"&&(u+=H):b==="right"&&(W==="center"?u+=H:W==="right"&&(u+=d))),w){case"top":l-=(K.length-1)*Y;break;case"center":case"bottom":l-=(K.length-1)*Y;break}for(var I=0;I<K.length;I++)$>0&&t.strokeText(K[I],u,l),t.fillText(K[I],u,l),l+=Y}else $>0&&t.strokeText(c,u,l),t.fillText(c,u,l);S!==0&&(t.rotate(-S),t.translate(-f,-v))}}};var ea={};ea.drawNode=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,u,l=e._private,f=l.rscratch,v=e.position();if(!(!ne(v.x)||!ne(v.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,h=o.usePaths(),d,p=!1,m=e.padding();s=e.width()+2*m,u=e.height()+2*m;var g;r&&(g=r,t.translate(-g.x1,-g.y1));for(var y=e.pstyle("background-image"),b=y.value,w=new Array(b.length),S=new Array(b.length),C=0,x=0;x<b.length;x++){var T=b[x],E=w[x]=T!=null&&T!=="none";if(E){var P=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",x);C++,S[x]=o.getCachedImage(T,P,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var B=e.pstyle("background-blacken").value,D=e.pstyle("border-width").pfValue,M=e.pstyle("background-opacity").value*c,L=e.pstyle("border-color").value,R=e.pstyle("border-style").value,O=e.pstyle("border-opacity").value*c;t.lineJoin="miter";var A=function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M;o.eleFillStyle(t,e,ae)},N=function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O;o.colorStrokeStyle(t,L[0],L[1],L[2],ae)},F=e.pstyle("shape").strValue,q=e.pstyle("shape-polygon-points").pfValue;if(h){t.translate(v.x,v.y);var z=o.nodePathCache=o.nodePathCache||[],$=Xs(F==="polygon"?F+","+q.join(","):F,""+u,""+s),K=z[$];K!=null?(d=K,p=!0,f.pathCache=d):(d=new Path2D,z[$]=f.pathCache=d)}var Y=function(){if(!p){var ae=v;h&&(ae={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(d||t,ae.x,ae.y,s,u)}h?t.fill(d):t.fill()},H=function(){for(var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ge=l.backgrounding,pe=0,ve=0;ve<S.length;ve++){var xe=e.cy().style().getIndexedStyle(e,"background-image-containment","value",ve);if(ue&&xe==="over"||!ue&&xe==="inside"){pe++;continue}w[ve]&&S[ve].complete&&!S[ve].error&&(pe++,o.drawInscribedImage(t,S[ve],e,ve,ae))}l.backgrounding=pe!==C,ge!==l.backgrounding&&e.updateStyle(!1)},W=function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;o.hasPie(e)&&(o.drawPie(t,e,ue),ae&&(h||o.nodeShapes[o.getNodeShape(e)].draw(t,v.x,v.y,s,u)))},I=function(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,ue=(B>0?B:-B)*ae,ge=B>0?0:255;B!==0&&(o.colorFillStyle(t,ge,ge,ge,ue),h?t.fill(d):t.fill())},G=function(){if(D>0){if(t.lineWidth=D,t.lineCap="butt",t.setLineDash)switch(R){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}if(h?t.stroke(d):t.stroke(),R==="double"){t.lineWidth=D/3;var ae=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",h?t.stroke(d):t.stroke(),t.globalCompositeOperation=ae}t.setLineDash&&t.setLineDash([])}},Z=function(){n&&o.drawNodeOverlay(t,e,v,s,u)},_=function(){n&&o.drawNodeUnderlay(t,e,v,s,u)},ee=function(){o.drawElementText(t,e,null,a)},de=e.pstyle("ghost").value==="yes";if(de){var he=e.pstyle("ghost-offset-x").pfValue,re=e.pstyle("ghost-offset-y").pfValue,te=e.pstyle("ghost-opacity").value,se=te*c;t.translate(he,re),A(te*M),Y(),H(se,!0),N(te*O),G(),W(B!==0||D!==0),H(se,!1),I(se),t.translate(-he,-re)}h&&t.translate(-v.x,-v.y),_(),h&&t.translate(v.x,v.y),A(),Y(),H(c,!0),N(),G(),W(B!==0||D!==0),H(c,!1),I(),h&&t.translate(-v.x,-v.y),ee(),Z(),r&&t.translate(g.x1,g.y1)}};var ju=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a,n,i,o){var s=this;if(a.visible()){var u=a.pstyle("".concat(e,"-padding")).pfValue,l=a.pstyle("".concat(e,"-opacity")).value,f=a.pstyle("".concat(e,"-color")).value,v=a.pstyle("".concat(e,"-shape")).value;if(l>0){if(n=n||a.position(),i==null||o==null){var c=a.padding();i=a.width()+2*c,o=a.height()+2*c}s.colorFillStyle(r,f[0],f[1],f[2],l),s.nodeShapes[v].draw(r,n.x,n.y,i+u*2,o+u*2),r.fill()}}}};ea.drawNodeOverlay=ju("overlay");ea.drawNodeUnderlay=ju("underlay");ea.hasPie=function(t){return t=t[0],t._private.hasPie};ea.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),o=a.x,s=a.y,u=e.width(),l=e.height(),f=Math.min(u,l)/2,v=0,c=this.usePaths();c&&(o=0,s=0),i.units==="%"?f=f*i.pfValue:i.pfValue!==void 0&&(f=i.pfValue/2);for(var h=1;h<=n.pieBackgroundN;h++){var d=e.pstyle("pie-"+h+"-background-size").value,p=e.pstyle("pie-"+h+"-background-color").value,m=e.pstyle("pie-"+h+"-background-opacity").value*r,g=d/100;g+v>1&&(g=1-v);var y=1.5*Math.PI+2*Math.PI*v,b=2*Math.PI*g,w=y+b;d===0||v>=1||v+g>1||(t.beginPath(),t.moveTo(o,s),t.arc(o,s,f,y,w),t.closePath(),this.colorFillStyle(t,p[0],p[1],p[2],m),t.fill(),v+=g)}};var mt={},qp=100;mt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e};mt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,a,n=0;n<e.length;n++)if(a=e[n],a.context===t){r=!1;break}return r&&(a={context:t},e.push(a)),a};mt.createGradientStyleFor=function(t,e,r,a,n){var i,o=this.usePaths(),s=r.pstyle(e+"-gradient-stop-colors").value,u=r.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(r.isEdge()){var l=r.sourceEndpoint(),f=r.targetEndpoint(),v=r.midpoint(),c=gr(l,v),h=gr(f,v);i=t.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(c,h))}else{var d=o?{x:0,y:0}:r.position(),p=r.paddedWidth(),m=r.paddedHeight();i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(p,m))}else if(r.isEdge()){var g=r.sourceEndpoint(),y=r.targetEndpoint();i=t.createLinearGradient(g.x,g.y,y.x,y.y)}else{var b=o?{x:0,y:0}:r.position(),w=r.paddedWidth(),S=r.paddedHeight(),C=w/2,x=S/2,T=r.pstyle("background-gradient-direction").value;switch(T){case"to-bottom":i=t.createLinearGradient(b.x,b.y-x,b.x,b.y+x);break;case"to-top":i=t.createLinearGradient(b.x,b.y+x,b.x,b.y-x);break;case"to-left":i=t.createLinearGradient(b.x+C,b.y,b.x-C,b.y);break;case"to-right":i=t.createLinearGradient(b.x-C,b.y,b.x+C,b.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(b.x-C,b.y-x,b.x+C,b.y+x);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(b.x-C,b.y+x,b.x+C,b.y-x);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(b.x+C,b.y-x,b.x-C,b.y+x);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(b.x+C,b.y+x,b.x-C,b.y-x);break}}if(!i)return null;for(var E=u.length===s.length,P=s.length,B=0;B<P;B++)i.addColorStop(E?u[B]:B/(P-1),"rgba("+s[B][0]+","+s[B][1]+","+s[B][2]+","+n+")");return i};mt.gradientFillStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"background",e,r,a);if(!n)return null;t.fillStyle=n};mt.colorFillStyle=function(t,e,r,a,n){t.fillStyle="rgba("+e+","+r+","+a+","+n+")"};mt.eleFillStyle=function(t,e,r){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(t,e,a,r);else{var n=e.pstyle("background-color").value;this.colorFillStyle(t,n[0],n[1],n[2],r)}};mt.gradientStrokeStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"line",e,r,a);if(!n)return null;t.strokeStyle=n};mt.colorStrokeStyle=function(t,e,r,a,n){t.strokeStyle="rgba("+e+","+r+","+a+","+n+")"};mt.eleStrokeStyle=function(t,e,r){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(t,e,a,r);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(t,n[0],n[1],n[2],r)}};mt.matchCanvasSize=function(t){var e=this,r=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var u=n*o,l=i*o,f;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var v=r.canvasContainer;v.style.width=n+"px",v.style.height=i+"px";for(var c=0;c<e.CANVAS_LAYERS;c++)f=r.canvases[c],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";for(var c=0;c<e.BUFFER_COUNT;c++)f=r.bufferCanvases[c],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=i+"px";e.textureMult=1,o<=1&&(f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=u*e.textureMult,f.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l}};mt.renderTo=function(t,e,r,a){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:a})};mt.render=function(t){t=t||Js();var e=t.forcedContext,r=t.drawAllLayers,a=t.drawOnlyNodeLayer,n=t.forcedZoom,i=t.forcedPan,o=this,s=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=o.cy,l=o.data,f=l.canvasNeedsRedraw,v=o.textureOnViewport&&!e&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),c=t.motionBlur!==void 0?t.motionBlur:o.motionBlur,h=o.motionBlurPxRatio,d=u.hasCompoundNodes(),p=o.hoverData.draggingEles,m=!!(o.hoverData.selecting||o.touchData.selecting);c=c&&!e&&o.motionBlurEnabled&&!m;var g=c;e||(o.prevPxRatio!==s&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=s),!e&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),c&&(o.mbFrames==null&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(g=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!v&&(f[o.NODE]=!0,f[o.SELECT_BOX]=!0);var y=u.style(),b=u.zoom(),w=n!==void 0?n:b,S=u.pan(),C={x:S.x,y:S.y},x={zoom:b,pan:{x:S.x,y:S.y}},T=o.prevViewport,E=T===void 0||x.zoom!==T.zoom||x.pan.x!==T.pan.x||x.pan.y!==T.pan.y;!E&&!(p&&!d)&&(o.motionBlurPxRatio=1),i&&(C=i),w*=s,C.x*=s,C.y*=s;var P=o.getCachedZSortedEles();function B(re,te,se,ie,ae){var ue=re.globalCompositeOperation;re.globalCompositeOperation="destination-out",o.colorFillStyle(re,255,255,255,o.motionBlurTransparency),re.fillRect(te,se,ie,ae),re.globalCompositeOperation=ue}function D(re,te){var se,ie,ae,ue;!o.clearingMotionBlur&&(re===l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||re===l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])?(se={x:S.x*h,y:S.y*h},ie=b*h,ae=o.canvasWidth*h,ue=o.canvasHeight*h):(se=C,ie=w,ae=o.canvasWidth,ue=o.canvasHeight),re.setTransform(1,0,0,1,0,0),te==="motionBlur"?B(re,0,0,ae,ue):!e&&(te===void 0||te)&&re.clearRect(0,0,ae,ue),r||(re.translate(se.x,se.y),re.scale(ie,ie)),i&&re.translate(i.x,i.y),n&&re.scale(n,n)}if(v||(o.textureDrawLastFrame=!1),v){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=u.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var M=o.data.bufferContexts[o.TEXTURE_BUFFER];M.setTransform(1,0,0,1,0,0),M.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:M,drawOnlyNodeLayer:!0,forcedPxRatio:s*o.textureMult});var x=o.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:o.canvasWidth,height:o.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}f[o.DRAG]=!1,f[o.NODE]=!1;var L=l.contexts[o.NODE],R=o.textureCache.texture,x=o.textureCache.viewport;L.setTransform(1,0,0,1,0,0),c?B(L,0,0,x.width,x.height):L.clearRect(0,0,x.width,x.height);var O=y.core("outside-texture-bg-color").value,A=y.core("outside-texture-bg-opacity").value;o.colorFillStyle(L,O[0],O[1],O[2],A),L.fillRect(0,0,x.width,x.height);var b=u.zoom();D(L,!1),L.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/s,x.height/x.zoom/s),L.drawImage(R,x.mpan.x,x.mpan.y,x.width/x.zoom/s,x.height/x.zoom/s)}else o.textureOnViewport&&!e&&(o.textureCache=null);var N=u.extent(),F=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),q=o.hideEdgesOnViewport&&F,z=[];if(z[o.NODE]=!f[o.NODE]&&c&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,z[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),z[o.DRAG]=!f[o.DRAG]&&c&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,z[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),f[o.NODE]||r||a||z[o.NODE]){var $=c&&!z[o.NODE]&&h!==1,L=e||($?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:l.contexts[o.NODE]),K=c&&!$?"motionBlur":void 0;D(L,K),q?o.drawCachedNodes(L,P.nondrag,s,N):o.drawLayeredElements(L,P.nondrag,s,N),o.debug&&o.drawDebugPoints(L,P.nondrag),!r&&!c&&(f[o.NODE]=!1)}if(!a&&(f[o.DRAG]||r||z[o.DRAG])){var $=c&&!z[o.DRAG]&&h!==1,L=e||($?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:l.contexts[o.DRAG]);D(L,c&&!$?"motionBlur":void 0),q?o.drawCachedNodes(L,P.drag,s,N):o.drawCachedElements(L,P.drag,s,N),o.debug&&o.drawDebugPoints(L,P.drag),!r&&!c&&(f[o.DRAG]=!1)}if(o.showFps||!a&&f[o.SELECT_BOX]&&!r){var L=e||l.contexts[o.SELECT_BOX];if(D(L),o.selection[4]==1&&(o.hoverData.selecting||o.touchData.selecting)){var b=o.cy.zoom(),Y=y.core("selection-box-border-width").value/b;L.lineWidth=Y,L.fillStyle="rgba("+y.core("selection-box-color").value[0]+","+y.core("selection-box-color").value[1]+","+y.core("selection-box-color").value[2]+","+y.core("selection-box-opacity").value+")",L.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),Y>0&&(L.strokeStyle="rgba("+y.core("selection-box-border-color").value[0]+","+y.core("selection-box-border-color").value[1]+","+y.core("selection-box-border-color").value[2]+","+y.core("selection-box-opacity").value+")",L.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(l.bgActivePosistion&&!o.hoverData.selecting){var b=o.cy.zoom(),H=l.bgActivePosistion;L.fillStyle="rgba("+y.core("active-bg-color").value[0]+","+y.core("active-bg-color").value[1]+","+y.core("active-bg-color").value[2]+","+y.core("active-bg-opacity").value+")",L.beginPath(),L.arc(H.x,H.y,y.core("active-bg-size").pfValue/b,0,2*Math.PI),L.fill()}var W=o.lastRedrawTime;if(o.showFps&&W){W=Math.round(W);var I=Math.round(1e3/W);L.setTransform(1,0,0,1,0,0),L.fillStyle="rgba(255, 0, 0, 0.75)",L.strokeStyle="rgba(255, 0, 0, 0.75)",L.lineWidth=1,L.fillText("1 frame = "+W+" ms = "+I+" fps",0,20);var G=60;L.strokeRect(0,30,250,20),L.fillRect(0,30,250*Math.min(I/G,1),20)}r||(f[o.SELECT_BOX]=!1)}if(c&&h!==1){var Z=l.contexts[o.NODE],_=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],ee=l.contexts[o.DRAG],de=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],he=function(te,se,ie){te.setTransform(1,0,0,1,0,0),ie||!g?te.clearRect(0,0,o.canvasWidth,o.canvasHeight):B(te,0,0,o.canvasWidth,o.canvasHeight);var ae=h;te.drawImage(se,0,0,o.canvasWidth*ae,o.canvasHeight*ae,0,0,o.canvasWidth,o.canvasHeight)};(f[o.NODE]||z[o.NODE])&&(he(Z,_,z[o.NODE]),f[o.NODE]=!1),(f[o.DRAG]||z[o.DRAG])&&(he(ee,de,z[o.DRAG]),f[o.DRAG]=!1)}o.prevViewport=x,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),c&&(o.motionBlurTimeout=setTimeout(function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!v,o.mbFrames=0,f[o.NODE]=!0,f[o.DRAG]=!0,o.redraw()},qp)),e||u.emit("render")};var or={};or.drawPolygonPath=function(t,e,r,a,n,i){var o=a/2,s=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*i[0],r+s*i[1]);for(var u=1;u<i.length/2;u++)t.lineTo(e+o*i[u*2],r+s*i[u*2+1]);t.closePath()};or.drawRoundPolygonPath=function(t,e,r,a,n,i){var o=a/2,s=n/2,u=Mi(a,n);t.beginPath&&t.beginPath();for(var l=0;l<i.length/4;l++){var f=void 0,v=void 0;l===0?f=i.length-2:f=l*4-2,v=l*4+2;var c=e+o*i[l*4],h=r+s*i[l*4+1],d=-i[f]*i[v]-i[f+1]*i[v+1],p=u/Math.tan(Math.acos(d)/2),m=c-p*i[f],g=h-p*i[f+1],y=c+p*i[v],b=h+p*i[v+1];l===0?t.moveTo(m,g):t.lineTo(m,g),t.arcTo(c,h,y,b,u)}t.closePath()};or.drawRoundRectanglePath=function(t,e,r,a,n){var i=a/2,o=n/2,s=Aa(a,n);t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.arcTo(e+i,r-o,e+i,r,s),t.arcTo(e+i,r+o,e,r+o,s),t.arcTo(e-i,r+o,e-i,r,s),t.arcTo(e-i,r-o,e,r-o,s),t.lineTo(e,r-o),t.closePath()};or.drawBottomRoundRectanglePath=function(t,e,r,a,n){var i=a/2,o=n/2,s=Aa(a,n);t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.lineTo(e+i,r-o),t.lineTo(e+i,r),t.arcTo(e+i,r+o,e,r+o,s),t.arcTo(e-i,r+o,e-i,r,s),t.lineTo(e-i,r-o),t.lineTo(e,r-o),t.closePath()};or.drawCutRectanglePath=function(t,e,r,a,n){var i=a/2,o=n/2,s=iu();t.beginPath&&t.beginPath(),t.moveTo(e-i+s,r-o),t.lineTo(e+i-s,r-o),t.lineTo(e+i,r-o+s),t.lineTo(e+i,r+o-s),t.lineTo(e+i-s,r+o),t.lineTo(e-i+s,r+o),t.lineTo(e-i,r+o-s),t.lineTo(e-i,r-o+s),t.closePath()};or.drawBarrelPath=function(t,e,r,a,n){var i=a/2,o=n/2,s=e-i,u=e+i,l=r-o,f=r+o,v=ii(a,n),c=v.widthOffset,h=v.heightOffset,d=v.ctrlPtOffsetPct*c;t.beginPath&&t.beginPath(),t.moveTo(s,l+h),t.lineTo(s,f-h),t.quadraticCurveTo(s+d,f,s+c,f),t.lineTo(u-c,f),t.quadraticCurveTo(u-d,f,u,f-h),t.lineTo(u,l+h),t.quadraticCurveTo(u-d,l,u-c,l),t.lineTo(s+c,l),t.quadraticCurveTo(s+d,l,s,l+h),t.closePath()};var gs=Math.sin(0),ps=Math.cos(0),di={},hi={},_u=Math.PI/40;for(var Lr=0*Math.PI;Lr<2*Math.PI;Lr+=_u)di[Lr]=Math.sin(Lr),hi[Lr]=Math.cos(Lr);or.drawEllipsePath=function(t,e,r,a,n){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,a/2,n/2,0,0,2*Math.PI);else for(var i,o,s=a/2,u=n/2,l=0*Math.PI;l<2*Math.PI;l+=_u)i=e-s*di[l]*gs+s*hi[l]*ps,o=r+u*hi[l]*gs+u*di[l]*ps,l===0?t.moveTo(i,o):t.lineTo(i,o);t.closePath()};var Fa={};Fa.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};Fa.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),a=r.boundingBox(),n=this.findContainerClientCoords(),i=t.full?Math.ceil(a.w):n[2],o=t.full?Math.ceil(a.h):n[3],s=ne(t.maxWidth)||ne(t.maxHeight),u=this.getPixelRatio(),l=1;if(t.scale!==void 0)i*=t.scale,o*=t.scale,l=t.scale;else if(s){var f=1/0,v=1/0;ne(t.maxWidth)&&(f=l*t.maxWidth/i),ne(t.maxHeight)&&(v=l*t.maxHeight/o),l=Math.min(f,v),i*=l,o*=l}s||(i*=u,o*=u,l*=u);var c=document.createElement("canvas");c.width=i,c.height=o,c.style.width=i+"px",c.style.height=o+"px";var h=c.getContext("2d");if(i>0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(t.full)h.translate(-a.x1*l,-a.y1*l),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(a.x1*l,a.y1*l);else{var p=e.pan(),m={x:p.x*l,y:p.y*l};l*=e.zoom(),h.translate(m.x,m.y),h.scale(l,l),this.drawElements(h,d),h.scale(1/l,1/l),h.translate(-m.x,-m.y)}t.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=t.bg,h.rect(0,0,i,o),h.fill())}return c};function Hp(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return new Blob([a],{type:e})}function ms(t){var e=t.indexOf(",");return t.substr(e+1)}function el(t,e,r){var a=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Zr(function(n,i){try{e.toBlob(function(o){o!=null?n(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(o){i(o)}});case"blob":return Hp(ms(a()),r);case"base64":return ms(a());case"base64uri":default:return a()}}Fa.png=function(t){return el(t,this.bufferCanvasImage(t),"image/png")};Fa.jpg=function(t){return el(t,this.bufferCanvasImage(t),"image/jpeg")};var tl={};tl.nodeShapeImpl=function(t,e,r,a,n,i,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,a,n,i);case"polygon":return this.drawPolygonPath(e,r,a,n,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,r,a,n,i,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,a,n,i);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,a,n,i);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,a,n,i);case"barrel":return this.drawBarrelPath(e,r,a,n,i)}};var Wp=rl,Te=rl.prototype;Te.CANVAS_LAYERS=3;Te.SELECT_BOX=0;Te.DRAG=1;Te.NODE=2;Te.BUFFER_COUNT=3;Te.TEXTURE_BUFFER=0;Te.MOTIONBLUR_BUFFER_NODE=1;Te.MOTIONBLUR_BUFFER_DRAG=2;function rl(t){var e=this;e.data={canvases:new Array(Te.CANVAS_LAYERS),contexts:new Array(Te.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Te.CANVAS_LAYERS),bufferCanvases:new Array(Te.BUFFER_COUNT),bufferContexts:new Array(Te.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",a="rgba(0,0,0,0)";e.data.canvasContainer=document.createElement("div");var n=e.data.canvasContainer.style;e.data.canvasContainer.style[r]=a,n.position="relative",n.zIndex="0",n.overflow="hidden";var i=t.cy.container();i.appendChild(e.data.canvasContainer),i.style[r]=a;var o={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Sc()&&(o["-ms-touch-action"]="none",o["touch-action"]="none");for(var s=0;s<Te.CANVAS_LAYERS;s++){var u=e.data.canvases[s]=document.createElement("canvas");e.data.contexts[s]=u.getContext("2d"),Object.keys(o).forEach(function(W){u.style[W]=o[W]}),u.style.position="absolute",u.setAttribute("data-id","layer"+s),u.style.zIndex=String(Te.CANVAS_LAYERS-s),e.data.canvasContainer.appendChild(u),e.data.canvasNeedsRedraw[s]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Te.NODE].setAttribute("data-id","layer"+Te.NODE+"-node"),e.data.canvases[Te.SELECT_BOX].setAttribute("data-id","layer"+Te.SELECT_BOX+"-selectbox"),e.data.canvases[Te.DRAG].setAttribute("data-id","layer"+Te.DRAG+"-drag");for(var s=0;s<Te.BUFFER_COUNT;s++)e.data.bufferCanvases[s]=document.createElement("canvas"),e.data.bufferContexts[s]=e.data.bufferCanvases[s].getContext("2d"),e.data.bufferCanvases[s].style.position="absolute",e.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),e.data.bufferCanvases[s].style.zIndex=String(-s-1),e.data.bufferCanvases[s].style.visibility="hidden";e.pathsEnabled=!0;var l=ct(),f=function(I){return{x:(I.x1+I.x2)/2,y:(I.y1+I.y2)/2}},v=function(I){return{x:-I.w/2,y:-I.h/2}},c=function(I){var G=I[0]._private,Z=G.oldBackgroundTimestamp===G.backgroundTimestamp;return!Z},h=function(I){return I[0]._private.nodeKey},d=function(I){return I[0]._private.labelStyleKey},p=function(I){return I[0]._private.sourceLabelStyleKey},m=function(I){return I[0]._private.targetLabelStyleKey},g=function(I,G,Z,_,ee){return e.drawElement(I,G,Z,!1,!1,ee)},y=function(I,G,Z,_,ee){return e.drawElementText(I,G,Z,_,"main",ee)},b=function(I,G,Z,_,ee){return e.drawElementText(I,G,Z,_,"source",ee)},w=function(I,G,Z,_,ee){return e.drawElementText(I,G,Z,_,"target",ee)},S=function(I){return I.boundingBox(),I[0]._private.bodyBounds},C=function(I){return I.boundingBox(),I[0]._private.labelBounds.main||l},x=function(I){return I.boundingBox(),I[0]._private.labelBounds.source||l},T=function(I){return I.boundingBox(),I[0]._private.labelBounds.target||l},E=function(I,G){return G},P=function(I){return f(S(I))},B=function(I,G,Z){var _=I?I+"-":"";return{x:G.x+Z.pstyle(_+"text-margin-x").pfValue,y:G.y+Z.pstyle(_+"text-margin-y").pfValue}},D=function(I,G,Z){var _=I[0]._private.rscratch;return{x:_[G],y:_[Z]}},M=function(I){return B("",D(I,"labelX","labelY"),I)},L=function(I){return B("source",D(I,"sourceLabelX","sourceLabelY"),I)},R=function(I){return B("target",D(I,"targetLabelX","targetLabelY"),I)},O=function(I){return v(S(I))},A=function(I){return v(x(I))},N=function(I){return v(T(I))},F=function(I){var G=C(I),Z=v(C(I));if(I.isNode()){switch(I.pstyle("text-halign").value){case"left":Z.x=-G.w;break;case"right":Z.x=0;break}switch(I.pstyle("text-valign").value){case"top":Z.y=-G.h;break;case"bottom":Z.y=0;break}}return Z},q=e.data.eleTxrCache=new da(e,{getKey:h,doesEleInvalidateKey:c,drawElement:g,getBoundingBox:S,getRotationPoint:P,getRotationOffset:O,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),z=e.data.lblTxrCache=new da(e,{getKey:d,drawElement:y,getBoundingBox:C,getRotationPoint:M,getRotationOffset:F,isVisible:E}),$=e.data.slbTxrCache=new da(e,{getKey:p,drawElement:b,getBoundingBox:x,getRotationPoint:L,getRotationOffset:A,isVisible:E}),K=e.data.tlbTxrCache=new da(e,{getKey:m,drawElement:w,getBoundingBox:T,getRotationPoint:R,getRotationOffset:N,isVisible:E}),Y=e.data.lyrTxrCache=new Zu(e);e.onUpdateEleCalcs(function(I,G){q.invalidateElements(G),z.invalidateElements(G),$.invalidateElements(G),K.invalidateElements(G),Y.invalidateElements(G);for(var Z=0;Z<G.length;Z++){var _=G[Z]._private;_.oldBackgroundTimestamp=_.backgroundTimestamp}});var H=function(I){for(var G=0;G<I.length;G++)Y.enqueueElementRefinement(I[G].ele)};q.onDequeue(H),z.onDequeue(H),$.onDequeue(H),K.onDequeue(H)}Te.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Te.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Te.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Te.SELECT_BOX]=e;break}};var Kp=typeof Path2D<"u";Te.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Te.usePaths=function(){return Kp&&this.pathsEnabled};Te.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Te.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Te.makeOffscreenCanvas=function(t,e){var r;return(typeof OffscreenCanvas>"u"?"undefined":We(OffscreenCanvas))!=="undefined"?r=new OffscreenCanvas(t,e):(r=document.createElement("canvas"),r.width=t,r.height=e),r};[Qu,Ft,Yt,qi,Cr,ea,mt,or,Fa,tl].forEach(function(t){ce(Te,t)});var Gp=[{name:"null",impl:$u},{name:"base",impl:Xu},{name:"canvas",impl:Wp}],Yp=[{type:"layout",extensions:_g},{type:"renderer",extensions:Gp}],al={},nl={};function il(t,e,r){var a=r,n=function(T){Le("Can not register `"+e+"` for `"+t+"` since `"+T+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(ka.prototype[e])return n(e);ka.prototype[e]=r}else if(t==="collection"){if(Qe.prototype[e])return n(e);Qe.prototype[e]=r}else if(t==="layout"){for(var i=function(T){this.options=T,r.call(this,T),Ce(this._private)||(this._private={}),this._private.cy=T.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(r.prototype),s=[],u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var f=r.prototype.stop;o.stop=function(){var x=this.options;if(x&&x.animate){var T=this.animations;if(T)for(var E=0;E<T.length;E++)T[E].stop()}return f?f.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var v=function(T){return T._private.cy},c={addEventFields:function(T,E){E.layout=T,E.cy=v(T),E.target=T},bubble:function(){return!0},parent:function(T){return v(T)}};ce(o,{createEmitter:function(){return this._private.emitter=new Mn(c,this),this},emitter:function(){return this._private.emitter},on:function(T,E){return this.emitter().on(T,E),this},one:function(T,E){return this.emitter().one(T,E),this},once:function(T,E){return this.emitter().one(T,E),this},removeListener:function(T,E){return this.emitter().removeListener(T,E),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(T,E){return this.emitter().emit(T,E),this}}),Be.eventAliasesOn(o),a=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var h=ol("renderer","base"),d=h.prototype,p=r,m=r.prototype,g=function(){h.apply(this,arguments),p.apply(this,arguments)},y=g.prototype;for(var b in d){var w=d[b],S=m[b]!=null;if(S)return n(b);y[b]=w}for(var C in m)y[C]=m[C];d.clientFunctions.forEach(function(x){y[x]=y[x]||function(){Ve("Renderer does not implement `renderer."+x+"()` on its prototype")}}),a=g}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Ve(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Hs({map:al,keys:[t,e],value:a})}function ol(t,e){return Ws({map:al,keys:[t,e]})}function Xp(t,e,r,a,n){return Hs({map:nl,keys:[t,e,r,a],value:n})}function Up(t,e,r,a){return Ws({map:nl,keys:[t,e,r,a]})}var gi=function(){if(arguments.length===2)return ol.apply(null,arguments);if(arguments.length===3)return il.apply(null,arguments);if(arguments.length===4)return Up.apply(null,arguments);if(arguments.length===5)return Xp.apply(null,arguments);Ve("Invalid extension access syntax")};ka.prototype.extension=gi;Yp.forEach(function(t){t.extensions.forEach(function(e){il(t.type,e.name,e.impl)})});var sl=function t(){if(!(this instanceof t))return new t;this.length=0},yr=sl.prototype;yr.instanceString=function(){return"stylesheet"};yr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};yr.css=function(t,e){var r=this.length-1;if(fe(t))this[r].properties.push({name:t,value:e});else if(Ce(t))for(var a=t,n=Object.keys(a),i=0;i<n.length;i++){var o=n[i],s=a[o];if(s!=null){var u=et.properties[o]||et.properties[Dn(o)];if(u!=null){var l=u.name,f=s;this[r].properties.push({name:l,value:f})}}}return this};yr.style=yr.css;yr.generateStyle=function(t){var e=new et(t);return this.appendToStyle(e)};yr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],a=r.selector,n=r.properties;t.selector(a);for(var i=0;i<n.length;i++){var o=n[i];t.css(o.name,o.value)}}return t};var Zp="3.26.0",br=function(e){if(e===void 0&&(e={}),Ce(e))return new ka(e);if(fe(e))return gi.apply(gi,arguments)};br.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(br),t.apply(null,e),this};br.warnings=function(t){return Zs(t)};br.version=Zp;br.stylesheet=br.Stylesheet=sl;var Qp=br;const ul=Ps(Qp),{string:en,array:ys,object:tn,number:ua,bool:dt,oneOfType:Mr,any:rn,func:la}=jl,Jp={id:en,className:en,style:Mr([en,tn]),elements:Mr([ys,rn]),stylesheet:Mr([ys,rn]),layout:Mr([tn,rn]),pan:Mr([tn,rn]),zoom:ua,panningEnabled:dt,userPanningEnabled:dt,minZoom:ua,maxZoom:ua,zoomingEnabled:dt,userZoomingEnabled:dt,boxSelectionEnabled:dt,autoungrabify:dt,autolock:dt,autounselectify:dt,get:la,toJson:la,diff:la,forEach:la,cy:la,headless:dt,styleEnabled:dt,hideEdgesOnViewport:dt,textureOnViewport:dt,motionBlur:dt,motionBlurOpacity:ua,wheelSensitivity:ua,pixelRatio:Mr([en,tn])},ll=(t,e)=>{if(((i,o)=>i==null||o==null)(t,e)&&(t!=null||e!=null))return!0;if(t===e)return!1;if(typeof t!="object"||typeof e!="object")return t!==e;const r=Object.keys(t),a=Object.keys(e),n=i=>t[i]!==e[i];return r.length!==a.length||!(!r.some(n)&&!a.some(n))},kt=(t,e)=>t!=null?t[e]:null,jp={diff:ll,get:kt,toJson:t=>t,forEach:(t,e)=>t.forEach(e),elements:[{data:{id:"a",label:"Example node A"}},{data:{id:"b",label:"Example node B"}},{data:{id:"e",source:"a",target:"b"}}],stylesheet:[{selector:"node",style:{label:"data(label)"}}],zoom:1,pan:{x:0,y:0}},an=(t,e,r,a)=>r(kt(t,a),kt(e,a)),_p=(t,e,r,a,n,i,o)=>{t.batch(()=>{(a===ll||an(e,r,a,"elements"))&&am(t,kt(e,"elements"),kt(r,"elements"),n,i,o,a),an(e,r,a,"stylesheet")&&rm(t,kt(e,"stylesheet"),kt(r,"stylesheet"),n),["zoom","minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","pan","panningEnabled","userPanningEnabled","boxSelectionEnabled","autoungrabify","autolock","autounselectify"].forEach(s=>{an(e,r,a,s)&&em(t,s,kt(e,s),kt(r,s),n)})}),an(e,r,a,"layout")&&tm(t,kt(e,"layout"),kt(r,"layout"),n)},em=(t,e,r,a,n)=>{t[e](n(a))},tm=(t,e,r,a)=>{const n=a(r);n!=null&&t.layout(n).run()},rm=(t,e,r,a)=>{const n=t.style();n!=null&&n.fromJson(a(r)).update()},am=(t,e,r,a,n,i,o)=>{const s=[],u=t.collection(),l=[],f={},v={},c=h=>n(n(h,"data"),"id");i(r,h=>{const d=c(h);v[d]=h}),e!=null&&i(e,h=>{const d=c(h);f[d]=h,(p=>v[p]!=null)(d)||u.merge(t.getElementById(d))}),i(r,h=>{const d=c(h),p=(m=>f[m])(d);(m=>f[m]!=null)(d)?l.push({ele1:p,ele2:h}):s.push(a(h))}),u.length>0&&t.remove(u),s.length>0&&t.add(s),l.forEach(({ele1:h,ele2:d})=>nm(t,h,d,a,n,o))},nm=(t,e,r,a,n,i)=>{const o=n(n(r,"data"),"id"),s=t.getElementById(o),u={};["data","position","selected","selectable","locked","grabbable","classes"].forEach(f=>{const v=n(r,f);i(v,n(e,f))&&(u[f]=a(v))});const l=n(r,"scratch");i(l,n(e,"scratch"))&&s.scratch(a(l)),Object.keys(u).length>0&&s.json(u)};class im extends Kn.Component{static get propTypes(){return Jp}static get defaultProps(){return jp}static normalizeElements(e){if(e.length!=null)return e;{let{nodes:r,edges:a}=e;return r==null&&(r=[]),a==null&&(a=[]),r.concat(a)}}constructor(e){super(e),this.displayName="CytoscapeComponent",this.containerRef=Kn.createRef()}componentDidMount(){const e=this.containerRef.current,{global:r,headless:a,styleEnabled:n,hideEdgesOnViewport:i,textureOnViewport:o,motionBlur:s,motionBlurOpacity:u,wheelSensitivity:l,pixelRatio:f}=this.props,v=this._cy=new ul({container:e,headless:a,styleEnabled:n,hideEdgesOnViewport:i,textureOnViewport:o,motionBlur:s,motionBlurOpacity:u,wheelSensitivity:l,pixelRatio:f});r&&(window[r]=v),this.updateCytoscape(null,this.props)}updateCytoscape(e,r){const a=this._cy,{diff:n,toJson:i,get:o,forEach:s}=r;_p(a,e,r,n,i,o,s),r.cy!=null&&r.cy(a)}componentDidUpdate(e){this.updateCytoscape(e,this.props)}componentWillUnmount(){this._cy.destroy()}render(){const{id:e,className:r,style:a}=this.props;return Kn.createElement("div",{ref:this.containerRef,id:e,className:r,style:a})}}var fl={exports:{}},ot="top",gt="bottom",pt="right",st="left",Vn="auto",ta=[ot,gt,pt,st],wr="start",Wr="end",vl="clippingParents",Hi="viewport",Or="popper",cl="reference",pi=ta.reduce(function(t,e){return t.concat([e+"-"+wr,e+"-"+Wr])},[]),Wi=[].concat(ta,[Vn]).reduce(function(t,e){return t.concat([e,e+"-"+wr,e+"-"+Wr])},[]),dl="beforeRead",hl="read",gl="afterRead",pl="beforeMain",ml="main",yl="afterMain",bl="beforeWrite",wl="write",xl="afterWrite",El=[dl,hl,gl,pl,ml,yl,bl,wl,xl];function Nt(t){return t?(t.nodeName||"").toLowerCase():null}function Et(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function xr(t){var e=Et(t).Element;return t instanceof e||t instanceof Element}function xt(t){var e=Et(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Ki(t){if(typeof ShadowRoot>"u")return!1;var e=Et(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function om(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var a=e.styles[r]||{},n=e.attributes[r]||{},i=e.elements[r];!xt(i)||!Nt(i)||(Object.assign(i.style,a),Object.keys(n).forEach(function(o){var s=n[o];s===!1?i.removeAttribute(o):i.setAttribute(o,s===!0?"":s)}))})}function sm(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(a){var n=e.elements[a],i=e.attributes[a]||{},o=Object.keys(e.styles.hasOwnProperty(a)?e.styles[a]:r[a]),s=o.reduce(function(u,l){return u[l]="",u},{});!xt(n)||!Nt(n)||(Object.assign(n.style,s),Object.keys(i).forEach(function(u){n.removeAttribute(u)}))})}}const Gi={name:"applyStyles",enabled:!0,phase:"write",fn:om,effect:sm,requires:["computeStyles"]};function Rt(t){return t.split("-")[0]}var dr=Math.max,Cn=Math.min,Kr=Math.round;function mi(){var t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Cl(){return!/^((?!chrome|android).)*safari/i.test(mi())}function Gr(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var a=t.getBoundingClientRect(),n=1,i=1;e&&xt(t)&&(n=t.offsetWidth>0&&Kr(a.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Kr(a.height)/t.offsetHeight||1);var o=xr(t)?Et(t):window,s=o.visualViewport,u=!Cl()&&r,l=(a.left+(u&&s?s.offsetLeft:0))/n,f=(a.top+(u&&s?s.offsetTop:0))/i,v=a.width/n,c=a.height/i;return{width:v,height:c,top:f,right:l+v,bottom:f+c,left:l,x:l,y:f}}function Yi(t){var e=Gr(t),r=t.offsetWidth,a=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-a)<=1&&(a=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:a}}function Sl(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Ki(r)){var a=e;do{if(a&&t.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function Kt(t){return Et(t).getComputedStyle(t)}function um(t){return["table","td","th"].indexOf(Nt(t))>=0}function sr(t){return((xr(t)?t.ownerDocument:t.document)||window.document).documentElement}function $n(t){return Nt(t)==="html"?t:t.assignedSlot||t.parentNode||(Ki(t)?t.host:null)||sr(t)}function bs(t){return!xt(t)||Kt(t).position==="fixed"?null:t.offsetParent}function lm(t){var e=/firefox/i.test(mi()),r=/Trident/i.test(mi());if(r&&xt(t)){var a=Kt(t);if(a.position==="fixed")return null}var n=$n(t);for(Ki(n)&&(n=n.host);xt(n)&&["html","body"].indexOf(Nt(n))<0;){var i=Kt(n);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return n;n=n.parentNode}return null}function Va(t){for(var e=Et(t),r=bs(t);r&&um(r)&&Kt(r).position==="static";)r=bs(r);return r&&(Nt(r)==="html"||Nt(r)==="body"&&Kt(r).position==="static")?e:r||lm(t)||e}function Xi(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function pa(t,e,r){return dr(t,Cn(e,r))}function fm(t,e,r){var a=pa(t,e,r);return a>r?r:a}function Tl(){return{top:0,right:0,bottom:0,left:0}}function Dl(t){return Object.assign({},Tl(),t)}function kl(t,e){return e.reduce(function(r,a){return r[a]=t,r},{})}var vm=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,Dl(typeof e!="number"?e:kl(e,ta))};function cm(t){var e,r=t.state,a=t.name,n=t.options,i=r.elements.arrow,o=r.modifiersData.popperOffsets,s=Rt(r.placement),u=Xi(s),l=[st,pt].indexOf(s)>=0,f=l?"height":"width";if(!(!i||!o)){var v=vm(n.padding,r),c=Yi(i),h=u==="y"?ot:st,d=u==="y"?gt:pt,p=r.rects.reference[f]+r.rects.reference[u]-o[u]-r.rects.popper[f],m=o[u]-r.rects.reference[u],g=Va(i),y=g?u==="y"?g.clientHeight||0:g.clientWidth||0:0,b=p/2-m/2,w=v[h],S=y-c[f]-v[d],C=y/2-c[f]/2+b,x=pa(w,C,S),T=u;r.modifiersData[a]=(e={},e[T]=x,e.centerOffset=x-C,e)}}function dm(t){var e=t.state,r=t.options,a=r.element,n=a===void 0?"[data-popper-arrow]":a;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Sl(e.elements.popper,n)&&(e.elements.arrow=n))}const Pl={name:"arrow",enabled:!0,phase:"main",fn:cm,effect:dm,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Yr(t){return t.split("-")[1]}var hm={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gm(t){var e=t.x,r=t.y,a=window,n=a.devicePixelRatio||1;return{x:Kr(e*n)/n||0,y:Kr(r*n)/n||0}}function ws(t){var e,r=t.popper,a=t.popperRect,n=t.placement,i=t.variation,o=t.offsets,s=t.position,u=t.gpuAcceleration,l=t.adaptive,f=t.roundOffsets,v=t.isFixed,c=o.x,h=c===void 0?0:c,d=o.y,p=d===void 0?0:d,m=typeof f=="function"?f({x:h,y:p}):{x:h,y:p};h=m.x,p=m.y;var g=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=st,w=ot,S=window;if(l){var C=Va(r),x="clientHeight",T="clientWidth";if(C===Et(r)&&(C=sr(r),Kt(C).position!=="static"&&s==="absolute"&&(x="scrollHeight",T="scrollWidth")),C=C,n===ot||(n===st||n===pt)&&i===Wr){w=gt;var E=v&&C===S&&S.visualViewport?S.visualViewport.height:C[x];p-=E-a.height,p*=u?1:-1}if(n===st||(n===ot||n===gt)&&i===Wr){b=pt;var P=v&&C===S&&S.visualViewport?S.visualViewport.width:C[T];h-=P-a.width,h*=u?1:-1}}var B=Object.assign({position:s},l&&hm),D=f===!0?gm({x:h,y:p}):{x:h,y:p};if(h=D.x,p=D.y,u){var M;return Object.assign({},B,(M={},M[w]=y?"0":"",M[b]=g?"0":"",M.transform=(S.devicePixelRatio||1)<=1?"translate("+h+"px, "+p+"px)":"translate3d("+h+"px, "+p+"px, 0)",M))}return Object.assign({},B,(e={},e[w]=y?p+"px":"",e[b]=g?h+"px":"",e.transform="",e))}function pm(t){var e=t.state,r=t.options,a=r.gpuAcceleration,n=a===void 0?!0:a,i=r.adaptive,o=i===void 0?!0:i,s=r.roundOffsets,u=s===void 0?!0:s,l={placement:Rt(e.placement),variation:Yr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ws(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ws(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Ui={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pm,data:{}};var nn={passive:!0};function mm(t){var e=t.state,r=t.instance,a=t.options,n=a.scroll,i=n===void 0?!0:n,o=a.resize,s=o===void 0?!0:o,u=Et(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&l.forEach(function(f){f.addEventListener("scroll",r.update,nn)}),s&&u.addEventListener("resize",r.update,nn),function(){i&&l.forEach(function(f){f.removeEventListener("scroll",r.update,nn)}),s&&u.removeEventListener("resize",r.update,nn)}}const Zi={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:mm,data:{}};var ym={left:"right",right:"left",bottom:"top",top:"bottom"};function dn(t){return t.replace(/left|right|bottom|top/g,function(e){return ym[e]})}var bm={start:"end",end:"start"};function xs(t){return t.replace(/start|end/g,function(e){return bm[e]})}function Qi(t){var e=Et(t),r=e.pageXOffset,a=e.pageYOffset;return{scrollLeft:r,scrollTop:a}}function Ji(t){return Gr(sr(t)).left+Qi(t).scrollLeft}function wm(t,e){var r=Et(t),a=sr(t),n=r.visualViewport,i=a.clientWidth,o=a.clientHeight,s=0,u=0;if(n){i=n.width,o=n.height;var l=Cl();(l||!l&&e==="fixed")&&(s=n.offsetLeft,u=n.offsetTop)}return{width:i,height:o,x:s+Ji(t),y:u}}function xm(t){var e,r=sr(t),a=Qi(t),n=(e=t.ownerDocument)==null?void 0:e.body,i=dr(r.scrollWidth,r.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=dr(r.scrollHeight,r.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-a.scrollLeft+Ji(t),u=-a.scrollTop;return Kt(n||r).direction==="rtl"&&(s+=dr(r.clientWidth,n?n.clientWidth:0)-i),{width:i,height:o,x:s,y:u}}function ji(t){var e=Kt(t),r=e.overflow,a=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+n+a)}function Bl(t){return["html","body","#document"].indexOf(Nt(t))>=0?t.ownerDocument.body:xt(t)&&ji(t)?t:Bl($n(t))}function ma(t,e){var r;e===void 0&&(e=[]);var a=Bl(t),n=a===((r=t.ownerDocument)==null?void 0:r.body),i=Et(a),o=n?[i].concat(i.visualViewport||[],ji(a)?a:[]):a,s=e.concat(o);return n?s:s.concat(ma($n(o)))}function yi(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Em(t,e){var r=Gr(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function Es(t,e,r){return e===Hi?yi(wm(t,r)):xr(e)?Em(e,r):yi(xm(sr(t)))}function Cm(t){var e=ma($n(t)),r=["absolute","fixed"].indexOf(Kt(t).position)>=0,a=r&&xt(t)?Va(t):t;return xr(a)?e.filter(function(n){return xr(n)&&Sl(n,a)&&Nt(n)!=="body"}):[]}function Sm(t,e,r,a){var n=e==="clippingParents"?Cm(t):[].concat(e),i=[].concat(n,[r]),o=i[0],s=i.reduce(function(u,l){var f=Es(t,l,a);return u.top=dr(f.top,u.top),u.right=Cn(f.right,u.right),u.bottom=Cn(f.bottom,u.bottom),u.left=dr(f.left,u.left),u},Es(t,o,a));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Ll(t){var e=t.reference,r=t.element,a=t.placement,n=a?Rt(a):null,i=a?Yr(a):null,o=e.x+e.width/2-r.width/2,s=e.y+e.height/2-r.height/2,u;switch(n){case ot:u={x:o,y:e.y-r.height};break;case gt:u={x:o,y:e.y+e.height};break;case pt:u={x:e.x+e.width,y:s};break;case st:u={x:e.x-r.width,y:s};break;default:u={x:e.x,y:e.y}}var l=n?Xi(n):null;if(l!=null){var f=l==="y"?"height":"width";switch(i){case wr:u[l]=u[l]-(e[f]/2-r[f]/2);break;case Wr:u[l]=u[l]+(e[f]/2-r[f]/2);break}}return u}function Xr(t,e){e===void 0&&(e={});var r=e,a=r.placement,n=a===void 0?t.placement:a,i=r.strategy,o=i===void 0?t.strategy:i,s=r.boundary,u=s===void 0?vl:s,l=r.rootBoundary,f=l===void 0?Hi:l,v=r.elementContext,c=v===void 0?Or:v,h=r.altBoundary,d=h===void 0?!1:h,p=r.padding,m=p===void 0?0:p,g=Dl(typeof m!="number"?m:kl(m,ta)),y=c===Or?cl:Or,b=t.rects.popper,w=t.elements[d?y:c],S=Sm(xr(w)?w:w.contextElement||sr(t.elements.popper),u,f,o),C=Gr(t.elements.reference),x=Ll({reference:C,element:b,strategy:"absolute",placement:n}),T=yi(Object.assign({},b,x)),E=c===Or?T:C,P={top:S.top-E.top+g.top,bottom:E.bottom-S.bottom+g.bottom,left:S.left-E.left+g.left,right:E.right-S.right+g.right},B=t.modifiersData.offset;if(c===Or&&B){var D=B[n];Object.keys(P).forEach(function(M){var L=[pt,gt].indexOf(M)>=0?1:-1,R=[ot,gt].indexOf(M)>=0?"y":"x";P[M]+=D[R]*L})}return P}function Tm(t,e){e===void 0&&(e={});var r=e,a=r.placement,n=r.boundary,i=r.rootBoundary,o=r.padding,s=r.flipVariations,u=r.allowedAutoPlacements,l=u===void 0?Wi:u,f=Yr(a),v=f?s?pi:pi.filter(function(d){return Yr(d)===f}):ta,c=v.filter(function(d){return l.indexOf(d)>=0});c.length===0&&(c=v);var h=c.reduce(function(d,p){return d[p]=Xr(t,{placement:p,boundary:n,rootBoundary:i,padding:o})[Rt(p)],d},{});return Object.keys(h).sort(function(d,p){return h[d]-h[p]})}function Dm(t){if(Rt(t)===Vn)return[];var e=dn(t);return[xs(t),e,xs(e)]}function km(t){var e=t.state,r=t.options,a=t.name;if(!e.modifiersData[a]._skip){for(var n=r.mainAxis,i=n===void 0?!0:n,o=r.altAxis,s=o===void 0?!0:o,u=r.fallbackPlacements,l=r.padding,f=r.boundary,v=r.rootBoundary,c=r.altBoundary,h=r.flipVariations,d=h===void 0?!0:h,p=r.allowedAutoPlacements,m=e.options.placement,g=Rt(m),y=g===m,b=u||(y||!d?[dn(m)]:Dm(m)),w=[m].concat(b).reduce(function(Y,H){return Y.concat(Rt(H)===Vn?Tm(e,{placement:H,boundary:f,rootBoundary:v,padding:l,flipVariations:d,allowedAutoPlacements:p}):H)},[]),S=e.rects.reference,C=e.rects.popper,x=new Map,T=!0,E=w[0],P=0;P<w.length;P++){var B=w[P],D=Rt(B),M=Yr(B)===wr,L=[ot,gt].indexOf(D)>=0,R=L?"width":"height",O=Xr(e,{placement:B,boundary:f,rootBoundary:v,altBoundary:c,padding:l}),A=L?M?pt:st:M?gt:ot;S[R]>C[R]&&(A=dn(A));var N=dn(A),F=[];if(i&&F.push(O[D]<=0),s&&F.push(O[A]<=0,O[N]<=0),F.every(function(Y){return Y})){E=B,T=!1;break}x.set(B,F)}if(T)for(var q=d?3:1,z=function(H){var W=w.find(function(I){var G=x.get(I);if(G)return G.slice(0,H).every(function(Z){return Z})});if(W)return E=W,"break"},$=q;$>0;$--){var K=z($);if(K==="break")break}e.placement!==E&&(e.modifiersData[a]._skip=!0,e.placement=E,e.reset=!0)}}const Ml={name:"flip",enabled:!0,phase:"main",fn:km,requiresIfExists:["offset"],data:{_skip:!1}};function Cs(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function Ss(t){return[ot,pt,gt,st].some(function(e){return t[e]>=0})}function Pm(t){var e=t.state,r=t.name,a=e.rects.reference,n=e.rects.popper,i=e.modifiersData.preventOverflow,o=Xr(e,{elementContext:"reference"}),s=Xr(e,{altBoundary:!0}),u=Cs(o,a),l=Cs(s,n,i),f=Ss(u),v=Ss(l);e.modifiersData[r]={referenceClippingOffsets:u,popperEscapeOffsets:l,isReferenceHidden:f,hasPopperEscaped:v},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":v})}const Ol={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Pm};function Bm(t,e,r){var a=Rt(t),n=[st,ot].indexOf(a)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=i[0],s=i[1];return o=o||0,s=(s||0)*n,[st,pt].indexOf(a)>=0?{x:s,y:o}:{x:o,y:s}}function Lm(t){var e=t.state,r=t.options,a=t.name,n=r.offset,i=n===void 0?[0,0]:n,o=Wi.reduce(function(f,v){return f[v]=Bm(v,e.rects,i),f},{}),s=o[e.placement],u=s.x,l=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=l),e.modifiersData[a]=o}const Al={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Lm};function Mm(t){var e=t.state,r=t.name;e.modifiersData[r]=Ll({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const _i={name:"popperOffsets",enabled:!0,phase:"read",fn:Mm,data:{}};function Om(t){return t==="x"?"y":"x"}function Am(t){var e=t.state,r=t.options,a=t.name,n=r.mainAxis,i=n===void 0?!0:n,o=r.altAxis,s=o===void 0?!1:o,u=r.boundary,l=r.rootBoundary,f=r.altBoundary,v=r.padding,c=r.tether,h=c===void 0?!0:c,d=r.tetherOffset,p=d===void 0?0:d,m=Xr(e,{boundary:u,rootBoundary:l,padding:v,altBoundary:f}),g=Rt(e.placement),y=Yr(e.placement),b=!y,w=Xi(g),S=Om(w),C=e.modifiersData.popperOffsets,x=e.rects.reference,T=e.rects.popper,E=typeof p=="function"?p(Object.assign({},e.rects,{placement:e.placement})):p,P=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),B=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(C){if(i){var M,L=w==="y"?ot:st,R=w==="y"?gt:pt,O=w==="y"?"height":"width",A=C[w],N=A+m[L],F=A-m[R],q=h?-T[O]/2:0,z=y===wr?x[O]:T[O],$=y===wr?-T[O]:-x[O],K=e.elements.arrow,Y=h&&K?Yi(K):{width:0,height:0},H=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Tl(),W=H[L],I=H[R],G=pa(0,x[O],Y[O]),Z=b?x[O]/2-q-G-W-P.mainAxis:z-G-W-P.mainAxis,_=b?-x[O]/2+q+G+I+P.mainAxis:$+G+I+P.mainAxis,ee=e.elements.arrow&&Va(e.elements.arrow),de=ee?w==="y"?ee.clientTop||0:ee.clientLeft||0:0,he=(M=B==null?void 0:B[w])!=null?M:0,re=A+Z-he-de,te=A+_-he,se=pa(h?Cn(N,re):N,A,h?dr(F,te):F);C[w]=se,D[w]=se-A}if(s){var ie,ae=w==="x"?ot:st,ue=w==="x"?gt:pt,ge=C[S],pe=S==="y"?"height":"width",ve=ge+m[ae],xe=ge-m[ue],Q=[ot,st].indexOf(g)!==-1,k=(ie=B==null?void 0:B[S])!=null?ie:0,V=Q?ve:ge-x[pe]-T[pe]-k+P.altAxis,J=Q?ge+x[pe]+T[pe]-k-P.altAxis:xe,X=h&&Q?fm(V,ge,J):pa(h?V:ve,ge,h?J:xe);C[S]=X,D[S]=X-ge}e.modifiersData[a]=D}}const Rl={name:"preventOverflow",enabled:!0,phase:"main",fn:Am,requiresIfExists:["offset"]};function Rm(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Im(t){return t===Et(t)||!xt(t)?Qi(t):Rm(t)}function Nm(t){var e=t.getBoundingClientRect(),r=Kr(e.width)/t.offsetWidth||1,a=Kr(e.height)/t.offsetHeight||1;return r!==1||a!==1}function zm(t,e,r){r===void 0&&(r=!1);var a=xt(e),n=xt(e)&&Nm(e),i=sr(e),o=Gr(t,n,r),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&((Nt(e)!=="body"||ji(i))&&(s=Im(e)),xt(e)?(u=Gr(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):i&&(u.x=Ji(i))),{x:o.left+s.scrollLeft-u.x,y:o.top+s.scrollTop-u.y,width:o.width,height:o.height}}function Fm(t){var e=new Map,r=new Set,a=[];t.forEach(function(i){e.set(i.name,i)});function n(i){r.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(s){if(!r.has(s)){var u=e.get(s);u&&n(u)}}),a.push(i)}return t.forEach(function(i){r.has(i.name)||n(i)}),a}function Vm(t){var e=Fm(t);return El.reduce(function(r,a){return r.concat(e.filter(function(n){return n.phase===a}))},[])}function $m(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function qm(t){var e=t.reduce(function(r,a){var n=r[a.name];return r[a.name]=n?Object.assign({},n,a,{options:Object.assign({},n.options,a.options),data:Object.assign({},n.data,a.data)}):a,r},{});return Object.keys(e).map(function(r){return e[r]})}var Ts={placement:"bottom",modifiers:[],strategy:"absolute"};function Ds(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function qn(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,a=r===void 0?[]:r,n=e.defaultOptions,i=n===void 0?Ts:n;return function(s,u,l){l===void 0&&(l=i);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ts,i),modifiersData:{},elements:{reference:s,popper:u},attributes:{},styles:{}},v=[],c=!1,h={state:f,setOptions:function(g){var y=typeof g=="function"?g(f.options):g;p(),f.options=Object.assign({},i,f.options,y),f.scrollParents={reference:xr(s)?ma(s):s.contextElement?ma(s.contextElement):[],popper:ma(u)};var b=Vm(qm([].concat(a,f.options.modifiers)));return f.orderedModifiers=b.filter(function(w){return w.enabled}),d(),h.update()},forceUpdate:function(){if(!c){var g=f.elements,y=g.reference,b=g.popper;if(Ds(y,b)){f.rects={reference:zm(y,Va(b),f.options.strategy==="fixed"),popper:Yi(b)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(P){return f.modifiersData[P.name]=Object.assign({},P.data)});for(var w=0;w<f.orderedModifiers.length;w++){if(f.reset===!0){f.reset=!1,w=-1;continue}var S=f.orderedModifiers[w],C=S.fn,x=S.options,T=x===void 0?{}:x,E=S.name;typeof C=="function"&&(f=C({state:f,options:T,name:E,instance:h})||f)}}}},update:$m(function(){return new Promise(function(m){h.forceUpdate(),m(f)})}),destroy:function(){p(),c=!0}};if(!Ds(s,u))return h;h.setOptions(l).then(function(m){!c&&l.onFirstUpdate&&l.onFirstUpdate(m)});function d(){f.orderedModifiers.forEach(function(m){var g=m.name,y=m.options,b=y===void 0?{}:y,w=m.effect;if(typeof w=="function"){var S=w({state:f,name:g,instance:h,options:b}),C=function(){};v.push(S||C)}})}function p(){v.forEach(function(m){return m()}),v=[]}return h}}var Hm=qn(),Wm=[Zi,_i,Ui,Gi],Km=qn({defaultModifiers:Wm}),Gm=[Zi,_i,Ui,Gi,Al,Ml,Rl,Pl,Ol],Ym=qn({defaultModifiers:Gm});const Xm=Object.freeze(Object.defineProperty({__proto__:null,afterMain:yl,afterRead:gl,afterWrite:xl,applyStyles:Gi,arrow:Pl,auto:Vn,basePlacements:ta,beforeMain:pl,beforeRead:dl,beforeWrite:bl,bottom:gt,clippingParents:vl,computeStyles:Ui,createPopper:Ym,createPopperBase:Hm,createPopperLite:Km,detectOverflow:Xr,end:Wr,eventListeners:Zi,flip:Ml,hide:Ol,left:st,main:ml,modifierPhases:El,offset:Al,placements:Wi,popper:Or,popperGenerator:qn,popperOffsets:_i,preventOverflow:Rl,read:hl,reference:cl,right:pt,start:wr,top:ot,variationPlacements:pi,viewport:Hi,write:wl},Symbol.toStringTag,{value:"Module"})),Um=_l(Xm);(function(t,e){(function(a,n){t.exports=n(Um)})(ks,function(r){return function(a){var n={};function i(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return a[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=a,i.c=n,i.i=function(o){return o},i.d=function(o,s,u){i.o(o,s)||Object.defineProperty(o,s,{configurable:!1,enumerable:!0,get:u})},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=7)}([function(a,n,i){a.exports=Object.assign!=null?Object.assign.bind(Object):function(o){for(var s=arguments.length,u=Array(s>1?s-1:0),l=1;l<s;l++)u[l-1]=arguments[l];return u.forEach(function(f){f!=null&&Object.keys(f).forEach(function(v){return o[v]=f[v]})}),o}},function(a,n,i){var o=i(5),s=o.getBoundingBox;function u(l,f){var v={getBoundingClientRect:function(){return s(l,f)}};return v}a.exports={getRef:u}},function(a,n,i){var o=i(0),s=i(1),u=s.getRef,l=i(6),f=l.getContent,v={},c=i(8),h=c.createPopper;function d(p,m){var g=u(p,m),y=f(p,m.content),b=o({},v,m.popper);return h(g,y,b)}a.exports={getPopper:d}},function(a,n,i){var o=i(0),s=i(2),u=s.getPopper,l=i(1),f=l.getRef;function v(g){return m(this),u(this[0],h(this[0],g))}function c(g){return m(this),f(this[0],h(this[0],g))}function h(g,y){var b=function(E){return E.isNode()?{w:E.renderedWidth(),h:E.renderedHeight()}:{w:3,h:3}},w=function(E){return E.isNode()?d(E,b):p(E)},S={},C=g.cy(),x={renderedDimensions:b,renderedPosition:w,popper:S,cy:C};return o({},x,y)}function d(g,y){var b=g.renderedPosition(),w=y(g),S=w.w/2,C=w.h/2;return{x:b.x-S,y:b.y-C}}function p(g){var y=g.midpoint(),b=g.cy().pan(),w=g.cy().zoom();return{x:y.x*w+b.x,y:y.y*w+b.y}}function m(g){g.length>1&&(console.warn("Popper.js Extension should only be used on one element."),console.warn("Ignoring all subsequent elements"))}a.exports={popper:v,popperRef:c}},function(a,n,i){var o=i(0),s=i(2),u=s.getPopper,l=i(1),f=l.getRef;function v(d){return u(this,h(this,d))}function c(d){return f(this,h(this,d))}function h(d,p){var m={boundingBox:{top:0,left:0,right:0,bottom:0,w:3,h:3},renderedDimensions:function(){return{w:3,h:3}},renderedPosition:function(){return{x:0,y:0}},popper:{},cy:d};return o({},m,p)}a.exports={popper:v,popperRef:c}},function(a,n,i){function o(s,u){var l=u.renderedPosition,f=u.cy,v=u.renderedDimensions,c=f.container().getBoundingClientRect(),h=v(s),d=l(s);return{top:d.y+c.top,left:d.x+c.left,right:d.x+h.w+c.left,bottom:d.y+h.h+c.top,width:h.w,height:h.h}}a.exports={getBoundingBox:o}},function(a,n,i){function o(s,u){var l=null;if(typeof u=="function")l=u(s);else{if(u instanceof HTMLElement)return u;throw new Error("Can not create popper from 'target' with unknown type")}if(l===null)throw new Error("No 'target' specified to create popper");return l}a.exports={getContent:o}},function(a,n,i){var o=i(4),s=i(3),u=function(f){f&&(f("core","popper",o.popper),f("collection","popper",s.popper),f("core","popperRef",o.popperRef),f("collection","popperRef",s.popperRef))};typeof cytoscape<"u"&&u(cytoscape),a.exports=u},function(a,n){a.exports=r}])})})(fl);var Zm=fl.exports;const Qm=Ps(Zm),Jm=t=>{var a;const e=document.createElement("div");return e.className="map-tooltip",ef(e).render(t),(a=document.getElementById("network-map"))==null||a.appendChild(e),e},jm=({item:t,type:e})=>{if(e==="instance"){const r=t,a=no(r,"inet").concat(no(r,"inet6")).map(n=>Pe.jsxs("li",{className:"p-list__item",children:[n.address," (",n.iface,")"]},n.address));return Pe.jsxs("div",{className:"p-text--small tooltip",children:[Pe.jsx("a",{href:`/ui/project/${r.project}/instances/detail/${r.name}`,children:Pe.jsx(tf,{item:r})}),Pe.jsx("br",{}),"Status: ",Pe.jsx("i",{children:r.status}),Pe.jsx("br",{}),"IPs:"," ",Pe.jsx("ul",{className:"p-list u-no-margin--bottom",children:a.length>0?a:Pe.jsx("li",{children:"None"})})]})}if(e==="network"){const r=t;return Pe.jsxs("div",{className:"p-text--small tooltip",children:[r.name,Pe.jsx("br",{}),"Status: ",Pe.jsx("i",{children:r.status!==""?r.status:"None"}),Pe.jsx("br",{}),"Type: ",r.type]})}return null},_m=()=>Pe.jsx(ai.List,{className:"legend",items:[Pe.jsxs("div",{style:{display:"inline-flex"},children:[Pe.jsx("span",{className:"legend-item instance other"}),"Instance (running)"]},"instance"),Pe.jsxs("div",{style:{display:"inline-flex"},children:[Pe.jsx("span",{className:"legend-item instance running"}),"Instance (other status)"]},"instance"),Pe.jsxs("div",{style:{display:"inline-flex"},children:[Pe.jsx("span",{className:"legend-item network"}),"Network"]},"network")]});ul.use(Qm);const ry=()=>{const{project:t}=rf(),e=af.useRef(null),{data:r=[],isLoading:a}=io({queryKey:[oo.instances,t],queryFn:()=>lf(t??""),enabled:!!t}),{data:n=[],isLoading:i}=io({queryKey:[oo.networks],queryFn:()=>ff(t??""),enabled:!!t});if(!t)return Pe.jsx(Pe.Fragment,{children:"Missing project"});if(a||i)return Pe.jsx(nf,{});const o=v=>{switch(v.status){case"Running":return"#0E8420";default:return"#D9D9D9"}},s=r.map(v=>({data:{id:v.name,label:v.name,details:{type:"instance",item:v}},style:{backgroundColor:o(v),"text-background-opacity":1,"text-background-color":"#FFF"}})),u=n.map(v=>({data:{id:v.name,label:v.name,details:{type:"network",item:v}},style:{shape:"square",backgroundColor:"#06C","text-background-opacity":1,"text-background-color":"#FFF"}})),l=[];r.map(v=>Object.values(v.expanded_devices??{}).filter(of).map(c=>{l.push({data:{source:v.name,target:c.network,label:""},style:{lineColor:"#D9D9D9"}})}));const f=[...u,...s,...l];return Pe.jsxs(sf,{title:"Network map (beta)",children:[Pe.jsx(uf,{}),Pe.jsx(ai.Row,{children:Pe.jsxs(ai.Col,{size:12,id:"network-map",className:"network-map",children:[Pe.jsx(_m,{}),Pe.jsx(im,{className:"canvas",elements:f,layout:{name:"cose",nodeDimensionsIncludeLabels:!0,animate:!1},cy:v=>{v.nodes().on("mouseover",c=>{e.current=c.target.popper({content:Jm(Pe.jsx(jm,{...c.target.data().details})),popper:{placement:"right",removeOnDestroy:!0}})}),v.nodes().on("mouseout",()=>{var c;if(e.current){e.current.destroy();const h=document.getElementsByClassName("map-tooltip");(c=h[0].parentNode)==null||c.removeChild(h[0])}})}})]})})]})};export{ry as default};

Zerion Mini Shell 1.0