import{b as Xi}from"./chunk-EA6H37XC.min.js";import{Ga as zt,Ia as Hr,J as ph,M as Yi,N as Hi,O as $i,Qa as $r,_a as _i,b as dh,c as gh,eb as Wi,h as Ui,nb as ka,rb as Ki}from"./chunk-VMREMWJS.min.js";import{b as ne,d as Yr}from"./chunk-P42HNYSU.min.js";var gr=ne((E1,Zi)=>{function yh(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}Zi.exports=yh});var Ji=ne((w1,Qi)=>{var mh=typeof global=="object"&&global&&global.Object===Object&&global;Qi.exports=mh});var Xr=ne((x1,ji)=>{var bh=Ji(),Eh=typeof self=="object"&&self&&self.Object===Object&&self,wh=bh||Eh||Function("return this")();ji.exports=wh});var ts=ne((T1,es)=>{var xh=Xr(),Th=function(){return xh.Date.now()};es.exports=Th});var as=ne((C1,rs)=>{var Ch=/\s/;function Dh(t){for(var e=t.length;e--&&Ch.test(t.charAt(e)););return e}rs.exports=Dh});var is=ne((D1,ns)=>{var Sh=as(),Lh=/^\s+/;function Ah(t){return t&&t.slice(0,Sh(t)+1).replace(Lh,"")}ns.exports=Ah});var Pa=ne((S1,ss)=>{var Oh=Xr(),Nh=Oh.Symbol;ss.exports=Nh});var fs=ne((L1,ls)=>{var os=Pa(),us=Object.prototype,Ih=us.hasOwnProperty,Mh=us.toString,_r=os?os.toStringTag:void 0;function Rh(t){var e=Ih.call(t,_r),r=t[_r];try{t[_r]=void 0;var a=!0}catch{}var n=Mh.call(t);return a&&(e?t[_r]=r:delete t[_r]),n}ls.exports=Rh});var cs=ne((A1,hs)=>{var kh=Object.prototype,Ph=kh.toString;function Bh(t){return Ph.call(t)}hs.exports=Bh});var In=ne((O1,gs)=>{var vs=Pa(),Fh=fs(),Gh=cs(),zh="[object Null]",qh="[object Undefined]",ds=vs?vs.toStringTag:void 0;function Vh(t){return t==null?t===void 0?qh:zh:ds&&ds in Object(t)?Fh(t):Gh(t)}gs.exports=Vh});var ys=ne((N1,ps)=>{function Uh(t){return t!=null&&typeof t=="object"}ps.exports=Uh});var pr=ne((I1,ms)=>{var Yh=In(),Hh=ys(),$h="[object Symbol]";function Xh(t){return typeof t=="symbol"||Hh(t)&&Yh(t)==$h}ms.exports=Xh});var xs=ne((M1,ws)=>{var _h=is(),bs=gr(),Wh=pr(),Es=NaN,Kh=/^[-+]0x[0-9a-f]+$/i,Zh=/^0b[01]+$/i,Qh=/^0o[0-7]+$/i,Jh=parseInt;function jh(t){if(typeof t=="number")return t;if(Wh(t))return Es;if(bs(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=bs(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=_h(t);var r=Zh.test(t);return r||Qh.test(t)?Jh(t.slice(2),r?2:8):Kh.test(t)?Es:+t}ws.exports=jh});var Ds=ne((R1,Cs)=>{var ec=gr(),Mn=ts(),Ts=xs(),tc="Expected a function",rc=Math.max,ac=Math.min;function nc(t,e,r){var a,n,i,s,o,l,u=0,f=!1,h=!1,c=!0;if(typeof t!="function")throw new TypeError(tc);e=Ts(e)||0,ec(r)&&(f=!!r.leading,h="maxWait"in r,i=h?rc(Ts(r.maxWait)||0,e):i,c="trailing"in r?!!r.trailing:c);function v(x){var E=a,C=n;return a=n=void 0,u=x,s=t.apply(C,E),s}function d(x){return u=x,o=setTimeout(y,e),f?v(x):s}function g(x){var E=x-l,C=x-u,T=e-E;return h?ac(T,i-C):T}function p(x){var E=x-l,C=x-u;return l===void 0||E>=e||E<0||h&&C>=i}function y(){var x=Mn();if(p(x))return b(x);o=setTimeout(y,g(x))}function b(x){return o=void 0,c&&a?v(x):(a=n=void 0,s)}function w(){o!==void 0&&clearTimeout(o),u=0,a=l=n=o=void 0}function D(){return o===void 0?s:b(Mn())}function m(){var x=Mn(),E=p(x);if(a=arguments,n=this,l=x,E){if(o===void 0)return d(l);if(h)return clearTimeout(o),o=setTimeout(y,e),v(l)}return o===void 0&&(o=setTimeout(y,e)),s}return m.cancel=w,m.flush=D,m}Cs.exports=nc});var Ls=ne((Rn,Ss)=>{(function(){var t,e,r,a,n,i,s,o,l,u,f,h,c,v,d;r=Math.floor,u=Math.min,e=function(g,p){return gp?1:0},l=function(g,p,y,b,w){var D;if(y==null&&(y=0),w==null&&(w=e),y<0)throw new Error("lo must be non-negative");for(b==null&&(b=g.length);yL;0<=L?T++:T--)C.push(T);return C}.apply(this).reverse(),E=[],b=0,D=x.length;bL;w=0<=L?++E:--E)A.push(n(g,y));return A},v=function(g,p,y,b){var w,D,m;for(b==null&&(b=e),w=g[y];y>p;){if(m=y-1>>1,D=g[m],b(w,D)<0){g[y]=D,y=m;continue}break}return g[y]=w},d=function(g,p,y){var b,w,D,m,x;for(y==null&&(y=e),w=g.length,x=p,D=g[p],b=2*p+1;b{As.exports=Ls()});var Wr=ne((P1,Ns)=>{var ic=Array.isArray;Ns.exports=ic});var Ms=ne((B1,Is)=>{var sc=Wr(),oc=pr(),uc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lc=/^\w*$/;function fc(t,e){if(sc(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||oc(t)?!0:lc.test(t)||!uc.test(t)||e!=null&&t in Object(e)}Is.exports=fc});var ks=ne((F1,Rs)=>{var hc=In(),cc=gr(),vc="[object AsyncFunction]",dc="[object Function]",gc="[object GeneratorFunction]",pc="[object Proxy]";function yc(t){if(!cc(t))return!1;var e=hc(t);return e==dc||e==gc||e==vc||e==pc}Rs.exports=yc});var Bs=ne((G1,Ps)=>{var mc=Xr(),bc=mc["__core-js_shared__"];Ps.exports=bc});var zs=ne((z1,Gs)=>{var kn=Bs(),Fs=function(){var t=/[^.]+$/.exec(kn&&kn.keys&&kn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ec(t){return!!Fs&&Fs in t}Gs.exports=Ec});var Vs=ne((q1,qs)=>{var wc=Function.prototype,xc=wc.toString;function Tc(t){if(t!=null){try{return xc.call(t)}catch{}try{return t+""}catch{}}return""}qs.exports=Tc});var Ys=ne((V1,Us)=>{var Cc=ks(),Dc=zs(),Sc=gr(),Lc=Vs(),Ac=/[\\^$.*+?()[\]{}|]/g,Oc=/^\[object .+?Constructor\]$/,Nc=Function.prototype,Ic=Object.prototype,Mc=Nc.toString,Rc=Ic.hasOwnProperty,kc=RegExp("^"+Mc.call(Rc).replace(Ac,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Pc(t){if(!Sc(t)||Dc(t))return!1;var e=Cc(t)?kc:Oc;return e.test(Lc(t))}Us.exports=Pc});var $s=ne((U1,Hs)=>{function Bc(t,e){return t?.[e]}Hs.exports=Bc});var Ba=ne((Y1,Xs)=>{var Fc=Ys(),Gc=$s();function zc(t,e){var r=Gc(t,e);return Fc(r)?r:void 0}Xs.exports=zc});var Kr=ne((H1,_s)=>{var qc=Ba(),Vc=qc(Object,"create");_s.exports=Vc});var Zs=ne(($1,Ks)=>{var Ws=Kr();function Uc(){this.__data__=Ws?Ws(null):{},this.size=0}Ks.exports=Uc});var Js=ne((X1,Qs)=>{function Yc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}Qs.exports=Yc});var eo=ne((_1,js)=>{var Hc=Kr(),$c="__lodash_hash_undefined__",Xc=Object.prototype,_c=Xc.hasOwnProperty;function Wc(t){var e=this.__data__;if(Hc){var r=e[t];return r===$c?void 0:r}return _c.call(e,t)?e[t]:void 0}js.exports=Wc});var ro=ne((W1,to)=>{var Kc=Kr(),Zc=Object.prototype,Qc=Zc.hasOwnProperty;function Jc(t){var e=this.__data__;return Kc?e[t]!==void 0:Qc.call(e,t)}to.exports=Jc});var no=ne((K1,ao)=>{var jc=Kr(),ev="__lodash_hash_undefined__";function tv(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=jc&&e===void 0?ev:e,this}ao.exports=tv});var so=ne((Z1,io)=>{var rv=Zs(),av=Js(),nv=eo(),iv=ro(),sv=no();function yr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{function ov(){this.__data__=[],this.size=0}oo.exports=ov});var Pn=ne((J1,lo)=>{function uv(t,e){return t===e||t!==t&&e!==e}lo.exports=uv});var Zr=ne((j1,fo)=>{var lv=Pn();function fv(t,e){for(var r=t.length;r--;)if(lv(t[r][0],e))return r;return-1}fo.exports=fv});var co=ne((eb,ho)=>{var hv=Zr(),cv=Array.prototype,vv=cv.splice;function dv(t){var e=this.__data__,r=hv(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():vv.call(e,r,1),--this.size,!0}ho.exports=dv});var go=ne((tb,vo)=>{var gv=Zr();function pv(t){var e=this.__data__,r=gv(e,t);return r<0?void 0:e[r][1]}vo.exports=pv});var yo=ne((rb,po)=>{var yv=Zr();function mv(t){return yv(this.__data__,t)>-1}po.exports=mv});var bo=ne((ab,mo)=>{var bv=Zr();function Ev(t,e){var r=this.__data__,a=bv(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}mo.exports=Ev});var wo=ne((nb,Eo)=>{var wv=uo(),xv=co(),Tv=go(),Cv=yo(),Dv=bo();function mr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{var Sv=Ba(),Lv=Xr(),Av=Sv(Lv,"Map");xo.exports=Av});var So=ne((sb,Do)=>{var Co=so(),Ov=wo(),Nv=To();function Iv(){this.size=0,this.__data__={hash:new Co,map:new(Nv||Ov),string:new Co}}Do.exports=Iv});var Ao=ne((ob,Lo)=>{function Mv(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}Lo.exports=Mv});var Qr=ne((ub,Oo)=>{var Rv=Ao();function kv(t,e){var r=t.__data__;return Rv(e)?r[typeof e=="string"?"string":"hash"]:r.map}Oo.exports=kv});var Io=ne((lb,No)=>{var Pv=Qr();function Bv(t){var e=Pv(this,t).delete(t);return this.size-=e?1:0,e}No.exports=Bv});var Ro=ne((fb,Mo)=>{var Fv=Qr();function Gv(t){return Fv(this,t).get(t)}Mo.exports=Gv});var Po=ne((hb,ko)=>{var zv=Qr();function qv(t){return zv(this,t).has(t)}ko.exports=qv});var Fo=ne((cb,Bo)=>{var Vv=Qr();function Uv(t,e){var r=Vv(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}Bo.exports=Uv});var zo=ne((vb,Go)=>{var Yv=So(),Hv=Io(),$v=Ro(),Xv=Po(),_v=Fo();function br(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{var qo=zo(),Wv="Expected a function";function Bn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Wv);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 s=t.apply(this,a);return r.cache=i.set(n,s)||i,s};return r.cache=new(Bn.Cache||qo),r}Bn.Cache=qo;Vo.exports=Bn});var Ho=ne((gb,Yo)=>{var Kv=Uo(),Zv=500;function Qv(t){var e=Kv(t,function(a){return r.size===Zv&&r.clear(),a}),r=e.cache;return e}Yo.exports=Qv});var Fn=ne((pb,$o)=>{var Jv=Ho(),jv=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ed=/\\(\\)?/g,td=Jv(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(jv,function(r,a,n,i){e.push(n?i.replace(ed,"$1"):a||r)}),e});$o.exports=td});var Gn=ne((yb,Xo)=>{function rd(t,e){for(var r=-1,a=t==null?0:t.length,n=Array(a);++r{var _o=Pa(),ad=Gn(),nd=Wr(),id=pr(),sd=1/0,Wo=_o?_o.prototype:void 0,Ko=Wo?Wo.toString:void 0;function Zo(t){if(typeof t=="string")return t;if(nd(t))return ad(t,Zo)+"";if(id(t))return Ko?Ko.call(t):"";var e=t+"";return e=="0"&&1/t==-sd?"-0":e}Qo.exports=Zo});var zn=ne((bb,jo)=>{var od=Jo();function ud(t){return t==null?"":od(t)}jo.exports=ud});var qn=ne((Eb,eu)=>{var ld=Wr(),fd=Ms(),hd=Fn(),cd=zn();function vd(t,e){return ld(t)?t:fd(t,e)?[t]:hd(cd(t))}eu.exports=vd});var Fa=ne((wb,tu)=>{var dd=pr(),gd=1/0;function pd(t){if(typeof t=="string"||dd(t))return t;var e=t+"";return e=="0"&&1/t==-gd?"-0":e}tu.exports=pd});var au=ne((xb,ru)=>{var yd=qn(),md=Fa();function bd(t,e){e=yd(e,t);for(var r=0,a=e.length;t!=null&&r{var Ed=au();function wd(t,e,r){var a=t==null?void 0:Ed(t,e);return a===void 0?r:a}nu.exports=wd});var ou=ne((Cb,su)=>{var xd=Ba(),Td=function(){try{var t=xd(Object,"defineProperty");return t({},"",{}),t}catch{}}();su.exports=Td});var fu=ne((Db,lu)=>{var uu=ou();function Cd(t,e,r){e=="__proto__"&&uu?uu(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}lu.exports=Cd});var cu=ne((Sb,hu)=>{var Dd=fu(),Sd=Pn(),Ld=Object.prototype,Ad=Ld.hasOwnProperty;function Od(t,e,r){var a=t[e];(!(Ad.call(t,e)&&Sd(a,r))||r===void 0&&!(e in t))&&Dd(t,e,r)}hu.exports=Od});var du=ne((Lb,vu)=>{var Nd=9007199254740991,Id=/^(?:0|[1-9]\d*)$/;function Md(t,e){var r=typeof t;return e=e??Nd,!!e&&(r=="number"||r!="symbol"&&Id.test(t))&&t>-1&&t%1==0&&t{var Rd=cu(),kd=qn(),Pd=du(),gu=gr(),Bd=Fa();function Fd(t,e,r,a){if(!gu(t))return t;e=kd(e,t);for(var n=-1,i=e.length,s=i-1,o=t;o!=null&&++n{var Gd=yu();function zd(t,e,r){return t==null?t:Gd(t,e,r)}mu.exports=zd});var wu=ne((Nb,Eu)=>{function qd(t,e){var r=-1,a=t.length;for(e||(e=Array(a));++r{var Vd=Gn(),Ud=wu(),Yd=Wr(),Hd=pr(),$d=Fn(),Xd=Fa(),_d=zn();function Wd(t){return Yd(t)?Vd(t,Xd):Hd(t)?[t]:Ud($d(_d(t)))}xu.exports=Wd});var jf=ne((Mb,Jf)=>{"use strict";var Kd=Ds(),Zd=Os(),Qd=iu(),Jd=bu(),jd=Tu();function ma(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var gn=ma(Kd),ba=ma(Zd),eg=ma(Qd),tg=ma(Jd),rg=ma(jd);function Ye(t){"@babel/helpers - typeof";return Ye=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},Ye(t)}function fi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cu(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,a=new Array(e);r"u"?null:window,Su=Ve?Ve.navigator:null;Ve&&Ve.document;var og=Ye(""),Ll=Ye({}),ug=Ye(function(){}),lg=typeof HTMLElement>"u"?"undefined":Ye(HTMLElement),Ea=function(e){return e&&e.instanceString&&Fe(e.instanceString)?e.instanceString():null},ve=function(e){return e!=null&&Ye(e)==og},Fe=function(e){return e!=null&&Ye(e)===ug},Re=function(e){return!ct(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Se=function(e){return e!=null&&Ye(e)===Ll&&!Re(e)&&e.constructor===Object},fg=function(e){return e!=null&&Ye(e)===Ll},ae=function(e){return e!=null&&Ye(e)===Ye(1)&&!isNaN(e)},hg=function(e){return ae(e)&&Math.floor(e)===e},an=function(e){if(lg!=="undefined")return e!=null&&e instanceof HTMLElement},ct=function(e){return wa(e)||Al(e)},wa=function(e){return Ea(e)==="collection"&&e._private.single},Al=function(e){return Ea(e)==="collection"&&!e._private.single},ci=function(e){return Ea(e)==="core"},Ol=function(e){return Ea(e)==="stylesheet"},cg=function(e){return Ea(e)==="event"},Xt=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},vg=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},dg=function(e){return Se(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},gg=function(e){return fg(e)&&Fe(e.then)},pg=function(){return Su&&Su.userAgent.match(/msie|trident|edge/i)},ua=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;sr?1:0},Tg=function(e,r){return-1*Il(e,r)},ge=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(p-=1),p<1/6?d+(g-d)*6*p:p<1/2?g:p<2/3?d+(g-d)*(2/3-p)*6:d}var h=new RegExp("^"+bg+"$").exec(e);if(h){if(a=parseInt(h[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(h[2]),n<0||n>100||(n=n/100,i=parseFloat(h[3]),i<0||i>100)||(i=i/100,s=h[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=l=u=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,v=2*i-c;o=Math.round(255*f(v,c,a+1/3)),l=Math.round(255*f(v,c,a)),u=Math.round(255*f(v,c,a-1/3))}r=[o,l,u,s]}return r},Sg=function(e){var r,a=new RegExp("^"+yg+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},Lg=function(e){return Og[e.toLowerCase()]},Ag=function(e){return(Re(e)?e:null)||Lg(e)||Cg(e)||Sg(e)||Dg(e)},Og={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]},Ml=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:Cr,a=r,n;n=e.next(),!n.done;)a=a*Pl+n.value|0;return a},la=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cr;return r*Pl+e|0},fa=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ra;return(r<<5)+r+e|0},Ig=function(e,r){return e*2097152+r},qt=function(e){return e[0]*2097152+e[1]},Ga=function(e,r){return[la(e[0],r[0]),fa(e[1],r[1])]},Mg=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n=0&&!(e[n]===r&&(e.splice(n,1),a));n--);},pi=function(e){e.splice(0,e.length)},zg=function(e,r){for(var a=0;a"u"?"undefined":Ye(Set))!==Vg?Set:Ug,yn=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!ci(e)){ze("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"){ze("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 kr,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 s=r.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Re(r.classes)?u=r.classes:ve(r.classes)&&(u=r.classes.split(/\s+/));for(var f=0,h=u.length;f0;){var x=b.pop(),E=p(x),C=x.id();if(c[C]=E,E!==1/0)for(var T=x.neighborhood().intersect(d),L=0;L0)for(k.unshift(I);h[z];){var B=h[z];k.unshift(B.edge),k.unshift(B.node),F=B.node,z=F.id()}return o.spawn(k)}}}},$g={kruskal:function(e){e=e||function(w){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,s=new Array(i),o=a,l=function(D){for(var m=0;m0;){if(m(),E++,D===f){for(var C=[],T=i,L=f,A=y[L];C.unshift(T),A!=null&&C.unshift(A),T=p[L],T!=null;)L=T.id(),A=y[L];return{found:!0,distance:h[D],path:this.spawn(C),steps:E}}v[D]=!0;for(var S=w._private.edges,M=0;MA&&(d[L]=A,b[L]=T,w[L]=m),!i){var S=T*f+C;!i&&d[S]>A&&(d[S]=A,b[S]=C,w[S]=m)}}}for(var M=0;M1&&arguments[1]!==void 0?arguments[1]:s,Te=w(oe),we=[],pe=Te;;){if(pe==null)return r.spawn();var xe=b(pe),U=xe.edge,O=xe.pred;if(we.unshift(pe[0]),pe.same(he)&&we.length>0)break;U!=null&&we.unshift(U),pe=O}return l.spawn(we)},x=0;x=0;f--){var h=u[f],c=h[1],v=h[2];(r[c]===o&&r[v]===l||r[c]===l&&r[v]===o)&&u.splice(f,1)}for(var d=0;dn;){var i=Math.floor(Math.random()*r.length);r=jg(i,e,r),a--}return r},ep={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(k){return k.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/Jg);if(i<2){ze("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],f=0;f1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=r;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=r;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=r;s1&&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,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}i&&e.sort(function(c,v){return c-v});var f=e.length,h=Math.floor(f/2);return f%2!==0?e[h+1+o]:(e[h-1+o]+e[h+o])/2},sp=function(e){return Math.PI*e/180},za=function(e,r){return Math.atan2(r,e)-Math.PI/2},yi=Math.log2||function(t){return Math.log(t)/Math.log(2)},Yl=function(e){return e>0?1:e<0?-1:0},sr=function(e,r){return Math.sqrt(rr(e,r))},rr=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},op=function(e){for(var r=e.length,a=0,n=0;n=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}}},lp=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},fp=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},hp=function(e,r,a){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+a,y2:e.y2+a,w:e.w,h:e.h}},Hl=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},cp=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},Ka=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},Za=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(r.length===1)a=n=i=s=r[0];else if(r.length===2)a=i=r[0],s=n=r[1];else if(r.length===4){var o=wt(r,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Iu=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},mi=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Ir=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},vp=function(e,r){return Ir(e,r.x,r.y)},$l=function(e,r){return Ir(e,r.x1,r.y1)&&Ir(e,r.x2,r.y2)},Xl=function(e,r,a,n,i,s,o){var l=xa(i,s),u=i/2,f=s/2,h;{var c=a-u+l-o,v=n-f-o,d=a+u-l+o,g=v;if(h=Yt(e,r,a,n,c,v,d,g,!1),h.length>0)return h}{var p=a+u+o,y=n-f+l-o,b=p,w=n+f-l+o;if(h=Yt(e,r,a,n,p,y,b,w,!1),h.length>0)return h}{var D=a-u+l-o,m=n+f+o,x=a+u-l+o,E=m;if(h=Yt(e,r,a,n,D,m,x,E,!1),h.length>0)return h}{var C=a-u-o,T=n-f+l-o,L=C,A=n+f-l+o;if(h=Yt(e,r,a,n,C,T,L,A,!1),h.length>0)return h}var S;{var M=a-u+l,N=n-f+l;if(S=aa(e,r,a,n,M,N,l+o),S.length>0&&S[0]<=M&&S[1]<=N)return[S[0],S[1]]}{var P=a+u-l,R=n-f+l;if(S=aa(e,r,a,n,P,R,l+o),S.length>0&&S[0]>=P&&S[1]<=R)return[S[0],S[1]]}{var I=a+u-l,k=n+f-l;if(S=aa(e,r,a,n,I,k,l+o),S.length>0&&S[0]>=I&&S[1]>=k)return[S[0],S[1]]}{var F=a-u+l,z=n+f-l;if(S=aa(e,r,a,n,F,z,l+o),S.length>0&&S[0]<=F&&S[1]>=z)return[S[0],S[1]]}return[]},dp=function(e,r,a,n,i,s,o){var l=o,u=Math.min(a,i),f=Math.max(a,i),h=Math.min(n,s),c=Math.max(n,s);return u-l<=e&&e<=f+l&&h-l<=r&&r<=c+l},gp=function(e,r,a,n,i,s,o,l,u){var f={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};return!(ef.x2||rf.y2)},pp=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},yp=function(e,r,a,n,i){var s=1e-5;e===0&&(e=s),r/=e,a/=e,n/=e;var o,l,u,f,h,c,v,d;if(l=(3*a-r*r)/9,u=-(27*n)+r*(9*a-2*(r*r)),u/=54,o=l*l*l+u*u,i[1]=0,v=r/3,o>0){h=u+Math.sqrt(o),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),c=u-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-v+h+c,v+=(h+c)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-c+h)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,o===0){d=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-v+2*d,i[4]=i[2]=-(d+v);return}l=-l,f=l*l*l,f=Math.acos(u/Math.sqrt(f)),d=2*Math.sqrt(l),i[0]=-v+d*Math.cos(f/3),i[2]=-v+d*Math.cos((f+2*Math.PI)/3),i[4]=-v+d*Math.cos((f+4*Math.PI)/3)},mp=function(e,r,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,f=1*9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,h=1*3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*r+2*s*s+2*s*r-l*r,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*r-s*r,v=[];yp(u,f,h,c,v);for(var d=1e-7,g=[],p=0;p<6;p+=2)Math.abs(v[p+1])=0&&v[p]<=1&&g.push(v[p]);g.push(1),g.push(0);for(var y=-1,b,w,D,m=0;m=0?Du?(e-i)*(e-i)+(r-s)*(r-s):f-c},ft=function(e,r,a){for(var n,i,s,o,l,u=0,f=0;f=e&&e>=s||n<=e&&e<=s)l=(e-n)/(s-n)*(o-i)+i,l>r&&u++;else continue;return u%2!==0},kt=function(e,r,a,n,i,s,o,l,u){var f=new Array(a.length),h;l[0]!=null?(h=Math.atan(l[1]/l[0]),l[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=l;for(var c=Math.cos(-h),v=Math.sin(-h),d=0;d0){var p=un(f,-u);g=on(p)}else g=f;return ft(e,r,g)},Ep=function(e,r,a,n,i,s,o){for(var l=new Array(a.length),u=s/2,f=o/2,h=bi(s,o),c=h*h,v=0;v=0&&p<=1&&b.push(p),y>=0&&y<=1&&b.push(y),b.length===0)return[];var w=b[0]*l[0]+e,D=b[0]*l[1]+r;if(b.length>1){if(b[0]==b[1])return[w,D];var m=b[1]*l[0]+e,x=b[1]*l[1]+r;return[w,D,m,x]}else return[w,D]},Yn=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},Yt=function(e,r,a,n,i,s,o,l,u){var f=e-i,h=a-e,c=o-i,v=r-s,d=n-r,g=l-s,p=c*v-g*f,y=h*v-d*f,b=g*h-c*d;if(b!==0){var w=p/b,D=y/b,m=.001,x=0-m,E=1+m;return x<=w&&w<=E&&x<=D&&D<=E?[e+w*h,r+w*d]:u?[e+w*h,r+w*d]:[]}else return p===0||y===0?Yn(e,a,o)===o?[o,l]:Yn(e,a,i)===i?[i,s]:Yn(i,o,a)===a?[a,n]:[]:[]},va=function(e,r,a,n,i,s,o,l){var u=[],f,h=new Array(a.length),c=!0;s==null&&(c=!1);var v;if(c){for(var d=0;d0){var g=un(h,-l);v=on(g)}else v=h}else v=a;for(var p,y,b,w,D=0;D2){for(var R=[u[0],u[1]],I=Math.pow(R[0]-e,2)+Math.pow(R[1]-r,2),k=1;kf&&(f=D)},get:function(w){return u[w]}},c=0;c0?R=P.edgesTo(N)[0]:R=N.edgesTo(P)[0];var I=n(R);N=N.id(),C[N]>C[S]+I&&(C[N]=C[S]+I,T.nodes.indexOf(N)<0?T.push(N):T.updateItem(N),E[N]=0,x[N]=[]),C[N]==C[S]+I&&(E[N]=E[N]+E[S],x[N].push(S))}else for(var k=0;k0;){for(var G=m.pop(),$=0;$0&&o.push(a[l]);o.length!==0&&i.push(n.collection(o))}return i},Bp=function(e,r){for(var a=0;a5&&arguments[5]!==void 0?arguments[5]:zp,o=n,l,u,f=0;f=2?Jr(e,r,a,0,Bu,qp):Jr(e,r,a,0,Pu)},squaredEuclidean:function(e,r,a){return Jr(e,r,a,0,Bu)},manhattan:function(e,r,a){return Jr(e,r,a,0,Pu)},max:function(e,r,a){return Jr(e,r,a,-1/0,Vp)}};Mr["squared-euclidean"]=Mr.squaredEuclidean;Mr.squaredeuclidean=Mr.squaredEuclidean;function bn(t,e,r,a,n,i){var s;return Fe(t)?s=t:s=Mr[t]||Mr.euclidean,e===0&&Fe(t)?s(n,i):s(e,r,a,n,i)}var Up=Je({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Ei=function(e){return Up(e)},ln=function(e,r,a,n,i){var s=i!=="kMedoids",o=s?function(h){return a[h]}:function(h){return n[h](a)},l=function(c){return n[c](r)},u=a,f=r;return bn(e,n.length,o,l,u,f)},Hn=function(e,r,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(r),l=null,u=0;ua)return!1}return!0},$p=function(e,r,a){for(var n=0;no&&(o=r[u][f],l=f);i[l].push(e[u])}for(var h=0;h=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[s],g=r[n[s]],p;i.mode==="dendrogram"?p={left:d,right:g,key:d.key}:p={value:d.value.concat(g.value),key:d.key},e[d.index]=p,e.splice(g.index,1),r[d.key]=p;for(var y=0;ya[g.key][b.key]&&(l=a[g.key][b.key])):i.linkage==="max"?(l=a[d.key][b.key],a[d.key][b.key]0&&n.push(i);return n},Uu=function(e,r,a){for(var n=[],i=0;io&&(s=u,o=r[i*e+u])}s>0&&n.push(s)}for(var f=0;fu&&(l=f,u=h)}a[i]=s[l]}return n=Uu(e,r,a),n},Yu=function(e){for(var r=this.cy(),a=this.nodes(),n=iy(e),i={},s=0;s=A?(S=A,A=N,M=P):N>S&&(S=N);for(var R=0;R0?1:0;E[T%n.minIterations*o+G]=$,B+=$}if(B>0&&(T>=n.minIterations-1||T==n.maxIterations-1)){for(var X=0,Y=0;Y1||x>1)&&(o=!0),h[w]=[],b.outgoers().forEach(function(C){C.isEdge()&&h[w].push(C.id())})}else c[w]=[void 0,b.target().id()]}):s.forEach(function(b){var w=b.id();if(b.isNode()){var D=b.degree(!0);D%2&&(l?u?o=!0:u=w:l=w),h[w]=[],b.connectedEdges().forEach(function(m){return h[w].push(m.id())})}else c[w]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(o)return v;if(u&&l)if(i){if(f&&u!=f)return v;f=u}else{if(f&&u!=f&&l!=f)return v;f||(f=u)}else f||(f=s[0].id());var d=function(w){for(var D=w,m=[w],x,E,C;h[D].length;)x=h[D].shift(),E=c[x][0],C=c[x][1],D!=C?(h[C]=h[C].filter(function(T){return T!=x}),D=C):!i&&D!=E&&(h[E]=h[E].filter(function(T){return T!=x}),D=E),m.unshift(x),m.unshift(D);return m},g=[],p=[];for(p=d(f);p.length!=1;)h[p[0]].length==0?(g.unshift(s.getElementById(p.shift())),g.unshift(s.getElementById(p.shift()))):p=d(p.shift()).concat(p);g.unshift(s.getElementById(p.shift()));for(var y in h)if(h[y].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Ua=function(){var e=this,r={},a=0,n=0,i=[],s=[],o={},l=function(c,v){for(var d=s.length-1,g=[],p=e.spawn();s[d].x!=c||s[d].y!=v;)g.push(s.pop().edge),d--;g.push(s.pop().edge),g.forEach(function(y){var b=y.connectedNodes().intersection(e);p.merge(y),b.forEach(function(w){var D=w.id(),m=w.connectedEdges().intersection(e);p.merge(w),r[D].cutVertex?p.merge(m.filter(function(x){return x.isLoop()})):p.merge(m)})}),i.push(p)},u=function h(c,v,d){c===d&&(n+=1),r[v]={id:a,low:a++,cutVertex:!1};var g=e.getElementById(v).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(v)));else{var p,y,b,w;g.forEach(function(D){p=D.source().id(),y=D.target().id(),b=p===v?y:p,b!==d&&(w=D.id(),o[w]||(o[w]=!0,s.push({x:v,y:b,edge:D})),b in r?r[v].low=Math.min(r[v].low,r[b].id):(h(c,b,v),r[v].low=Math.min(r[v].low,r[b].low),r[v].id<=r[b].low&&(r[v].cutVertex=!0,l(v,b))))})}};e.forEach(function(h){if(h.isNode()){var c=h.id();c in r||(n=0,u(c,c),r[c].cutVertex=n>1)}});var f=Object.keys(r).filter(function(h){return r[h].cutVertex}).map(function(h){return e.getElementById(h)});return{cut:e.spawn(f),components:i}},vy={hopcroftTarjanBiconnected:Ua,htbc:Ua,htb:Ua,hopcroftTarjanBiconnectedComponents:Ua},Ya=function(){var e=this,r={},a=0,n=[],i=[],s=e.spawn(e),o=function l(u){i.push(u),r[u]={index:a,low:a++,explored:!1};var f=e.getElementById(u).connectedEdges().intersection(e);if(f.forEach(function(g){var p=g.target().id();p!==u&&(p in r||l(p),r[p].explored||(r[u].low=Math.min(r[u].low,r[p].low)))}),r[u].index===r[u].low){for(var h=e.spawn();;){var c=i.pop();if(h.merge(e.getElementById(c)),r[c].low=r[u].index,r[c].explored=!0,c===u)break}var v=h.edgesWith(h),d=h.merge(v);n.push(d),s=s.difference(d)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:n}},dy={tarjanStronglyConnected:Ya,tsc:Ya,tscc:Ya,tarjanStronglyConnectedComponents:Ya},jl={};[ha,Hg,$g,_g,Kg,Qg,ep,Dp,Ar,Or,ei,Gp,Qp,ay,fy,cy,vy,dy].forEach(function(t){ge(jl,t)});var ef=0,tf=1,rf=2,Pt=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=ef,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))};Pt.prototype={fulfill:function(e){return Hu(this,tf,"fulfillValue",e)},reject:function(e){return Hu(this,rf,"rejectReason",e)},then:function(e,r){var a=this,n=new Pt;return a.onFulfilled.push(Xu(e,n,"fulfill")),a.onRejected.push(Xu(r,n,"reject")),af(a),n.proxy}};var Hu=function(e,r,a,n){return e.state===ef&&(e.state=r,e[a]=n,af(e)),e},af=function(e){e.state===tf?$u(e,"onFulfilled",e.fulfillValue):e.state===rf&&$u(e,"onRejected",e.rejectReason)},$u=function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var i=function(){for(var o=0;o0}},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 s=0;s0&&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){Re(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,i=[],s=0,o=a.length;s0&&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}};Qa.className=Qa.classNames=Qa.classes;var De={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Ue,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};De.variable="(?:[\\w-.]|(?:\\\\"+De.metaChar+"))+";De.className="(?:[\\w-]|(?:\\\\"+De.metaChar+"))+";De.value=De.string+"|"+De.number;De.id=De.variable;(function(){var t,e,r;for(t=De.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(De.comparatorOp+="|\\!"+e)})();var Me=function(){return{checks:[]}},se={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},ri=[{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 Tg(t.selector,e.selector)}),Ey=function(){for(var t={},e,r=0;r0&&f.edgeCount>0)return Ie("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return Ie("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&Ie("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},Sy=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return ve(f)?'"'+f+'"':e(f)},a=function(f){return" "+f+" "},n=function(f,h){var c=f.type,v=f.value;switch(c){case se.GROUP:{var d=e(v);return d.substring(0,d.length-1)}case se.DATA_COMPARE:{var g=f.field,p=f.operator;return"["+g+a(e(p))+r(v)+"]"}case se.DATA_BOOL:{var y=f.operator,b=f.field;return"["+e(y)+b+"]"}case se.DATA_EXIST:{var w=f.field;return"["+w+"]"}case se.META_COMPARE:{var D=f.operator,m=f.field;return"[["+m+a(e(D))+r(v)+"]]"}case se.STATE:return v;case se.ID:return"#"+v;case se.CLASS:return"."+v;case se.PARENT:case se.CHILD:return i(f.parent,h)+a(">")+i(f.child,h);case se.ANCESTOR:case se.DESCENDANT:return i(f.ancestor,h)+" "+i(f.descendant,h);case se.COMPOUND_SPLIT:{var x=i(f.left,h),E=i(f.subject,h),C=i(f.right,h);return x+(x.length>0?" ":"")+E+C}case se.TRUE:return""}},i=function(f,h){return f.checks.reduce(function(c,v,d){return c+(h===f&&d===0?"$":"")+n(v,h)},"")},s="",o=0;o1&&o=0&&(r=r.replace("!",""),h=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(i||o||f)&&(l=!i&&!s?"":""+e,u=""+a),f&&(e=l=l.toLowerCase(),a=u=u.toLowerCase()),r){case"*=":n=l.indexOf(u)>=0;break;case"$=":n=l.indexOf(u,l.length-u.length)>=0;break;case"^=":n=l.indexOf(u)===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=e0;){var f=n.shift();e(f),i.add(f.id()),o&&a(n,i,f)}return t}function sf(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return xi(this,t,e,sf)};function of(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}Rr.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return xi(this,t,e,of)};function ky(t,e,r){of(t,e,r),sf(t,e,r)}Rr.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return xi(this,t,e,ky)};Rr.ancestors=Rr.parents;var da,uf;da=uf={data:Ne.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:Ne.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ne.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ne.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ne.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ne.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};da.attr=da.data;da.removeAttr=da.removeData;var Py=uf,En={};function $n(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,s=0;se}),minIndegree:wr("indegree",function(t,e){return te}),minOutdegree:wr("outdegree",function(t,e){return te})});ge(En,{totalDegree:function(e){for(var r=0,a=this.nodes(),n=0;n0,c=h;h&&(f=f[0]);var v=c?f.position():{x:0,y:0};r!==void 0?u.position(e,r+v[e]):i!==void 0&&u.position({x:i.x+v.x,y:i.y+v.y})}else{var d=a.position(),g=o?a.parent():null,p=g&&g.length>0,y=p;p&&(g=g[0]);var b=y?g.position():{x:0,y:0};return i={x:d.x-b.x,y:d.y-b.y},e===void 0?i:i[e]}else if(!s)return;return this}};Ct.modelPosition=Ct.point=Ct.position;Ct.modelPositions=Ct.points=Ct.positions;Ct.renderedPoint=Ct.renderedPosition;Ct.relativePoint=Ct.relativePosition;var By=lf,Nr,Qt;Nr=Qt={};Qt.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,l=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}};Qt.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)};Qt.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(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},h=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),c=o.position;(h.w===0||h.h===0)&&(h={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},h.x1=c.x-h.w/2,h.x2=c.x+h.w/2,h.y1=c.y-h.h/2,h.y2=c.y+h.h/2);function v(T,L,A){var S=0,M=0,N=L+A;return T>0&&N>0&&(S=L/N*T,M=A/N*T),{biasDiff:S,biasComplementDiff:M}}function d(T,L,A,S){if(A.units==="%")switch(S){case"width":return T>0?A.pfValue*T:0;case"height":return L>0?A.pfValue*L:0;case"average":return T>0&&L>0?A.pfValue*(T+L)/2:0;case"min":return T>0&&L>0?T>L?A.pfValue*L:A.pfValue*T:0;case"max":return T>0&&L>0?T>L?A.pfValue*T:A.pfValue*L:0;default:return 0}else return A.units==="px"?A.pfValue:0}var g=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(g=g*100/f.width.val);var p=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(p=p*100/f.width.val);var y=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(y=y*100/f.height.val);var b=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(b=b*100/f.height.val);var w=v(f.width.val-h.w,g,p),D=w.biasDiff,m=w.biasComplementDiff,x=v(f.height.val-h.h,y,b),E=x.biasDiff,C=x.biasComplementDiff;o.autoPadding=d(h.w,h.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(h.w,f.width.val),c.x=(-D+h.x1+h.x2+m)/2,o.autoHeight=Math.max(h.h,f.height.val),c.y=(-E+h.y1+h.y2+C)/2}for(var a=0;ae.x2?n:e.x2,e.y1=ae.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ar=function(e,r){return r==null?e:xt(e,r.x1,r.y1,r.x2,r.y2)},jr=function(e,r,a){return Tt(e,r,a)},Ha=function(e,r,a){if(!r.cy().headless()){var n=r._private,i=n.rstyle,s=i.arrowWidth/2,o=r.pstyle(a+"-arrow-shape").value,l,u;if(o!=="none"){a==="source"?(l=i.srcX,u=i.srcY):a==="target"?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var f=n.arrowBounds=n.arrowBounds||{},h=f[a]=f[a]||{};h.x1=l-s,h.y1=u-s,h.x2=l+s,h.y2=u+s,h.w=h.x2-h.x1,h.h=h.y2-h.y1,Ka(h,1),xt(e,h.x1,h.y1,h.x2,h.y2)}}},Xn=function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var i=r._private,s=i.rstyle,o=r.pstyle(n+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),f=jr(s,"labelWidth",a),h=jr(s,"labelHeight",a),c=jr(s,"labelX",a),v=jr(s,"labelY",a),d=r.pstyle(n+"text-margin-x").pfValue,g=r.pstyle(n+"text-margin-y").pfValue,p=r.isEdge(),y=r.pstyle(n+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,w=r.pstyle("text-border-width").pfValue,D=w/2,m=r.pstyle("text-background-padding").pfValue,x=2,E=h,C=f,T=C/2,L=E/2,A,S,M,N;if(p)A=c-T,S=c+T,M=v-L,N=v+L;else{switch(l.value){case"left":A=c-C,S=c;break;case"center":A=c-T,S=c+T;break;case"right":A=c,S=c+C;break}switch(u.value){case"top":M=v-E,N=v;break;case"center":M=v-L,N=v+L;break;case"bottom":M=v,N=v+E;break}}A+=d-Math.max(b,D)-m-x,S+=d+Math.max(b,D)+m+x,M+=g-Math.max(b,D)-m-x,N+=g+Math.max(b,D)+m+x;var P=a||"main",R=i.labelBounds,I=R[P]=R[P]||{};I.x1=A,I.y1=M,I.x2=S,I.y2=N,I.w=S-A,I.h=N-M;var k=p&&y.strValue==="autorotate",F=y.pfValue!=null&&y.pfValue!==0;if(k||F){var z=k?jr(i.rstyle,"labelAngle",a):y.pfValue,B=Math.cos(z),G=Math.sin(z),$=(A+S)/2,X=(M+N)/2;if(!p){switch(l.value){case"left":$=S;break;case"right":$=A;break}switch(u.value){case"top":X=N;break;case"bottom":X=M;break}}var Y=function(de,te){return de=de-$,te=te-X,{x:de*B-te*G+$,y:de*G+te*B+X}},_=Y(A,M),q=Y(A,N),K=Y(S,M),j=Y(S,N);A=Math.min(_.x,q.x,K.x,j.x),S=Math.max(_.x,q.x,K.x,j.x),M=Math.min(_.y,q.y,K.y,j.y),N=Math.max(_.y,q.y,K.y,j.y)}var Q=P+"Rot",ee=R[Q]=R[Q]||{};ee.x1=A,ee.y1=M,ee.x2=S,ee.y2=N,ee.w=S-A,ee.h=N-M,xt(e,A,M,S,N),xt(i.labelBounds.all,A,M,S,N)}return e}},Fy=function(e,r){if(!r.cy().headless()){var a=r.pstyle("outline-opacity").value,n=r.pstyle("outline-width").value;if(a>0&&n>0){var i=r.pstyle("outline-offset").value,s=r.pstyle("shape").value,o=n+i,l=(e.w+o*2)/e.w,u=(e.h+o*2)/e.h,f=0,h=0;["diamond","pentagon","round-triangle"].includes(s)?(l=(e.w+o*2.4)/e.w,h=-o/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?l=(e.w+o*2.4)/e.w:s==="star"?(l=(e.w+o*2.8)/e.w,u=(e.h+o*2.6)/e.h,h=-o/3.8):s==="triangle"?(l=(e.w+o*2.8)/e.w,u=(e.h+o*2.4)/e.h,h=-o/1.4):s==="vee"&&(l=(e.w+o*4.4)/e.w,u=(e.h+o*3.8)/e.h,h=-o*.5);var c=e.h*u-e.h,v=e.w*l-e.w;if(Za(e,[Math.ceil(c/2),Math.ceil(v/2)]),f!=0||h!==0){var d=hp(e,f,h);Hl(e,d)}}}},Gy=function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=ht(),o=e._private,l=e.isNode(),u=e.isEdge(),f,h,c,v,d,g,p=o.rstyle,y=l&&n?e.pstyle("bounds-expansion").pfValue:[0],b=function(fe){return fe.pstyle("display").value!=="none"},w=!n||b(e)&&(!u||b(e.source())&&b(e.target()));if(w){var D=0,m=0;n&&r.includeOverlays&&(D=e.pstyle("overlay-opacity").value,D!==0&&(m=e.pstyle("overlay-padding").value));var x=0,E=0;n&&r.includeUnderlays&&(x=e.pstyle("underlay-opacity").value,x!==0&&(E=e.pstyle("underlay-padding").value));var C=Math.max(m,E),T=0,L=0;if(n&&(T=e.pstyle("width").pfValue,L=T/2),l&&r.includeNodes){var A=e.position();d=A.x,g=A.y;var S=e.outerWidth(),M=S/2,N=e.outerHeight(),P=N/2;f=d-M,h=d+M,c=g-P,v=g+P,xt(s,f,c,h,v),n&&r.includeOutlines&&Fy(s,e)}else if(u&&r.includeEdges)if(n&&!i){var R=e.pstyle("curve-style").strValue;if(f=Math.min(p.srcX,p.midX,p.tgtX),h=Math.max(p.srcX,p.midX,p.tgtX),c=Math.min(p.srcY,p.midY,p.tgtY),v=Math.max(p.srcY,p.midY,p.tgtY),f-=L,h+=L,c-=L,v+=L,xt(s,f,c,h,v),R==="haystack"){var I=p.haystackPts;if(I&&I.length===2){if(f=I[0].x,c=I[0].y,h=I[1].x,v=I[1].y,f>h){var k=f;f=h,h=k}if(c>v){var F=c;c=v,v=F}xt(s,f-L,c-L,h+L,v+L)}}else if(R==="bezier"||R==="unbundled-bezier"||R==="segments"||R==="taxi"){var z;switch(R){case"bezier":case"unbundled-bezier":z=p.bezierPts;break;case"segments":case"taxi":z=p.linePts;break}if(z!=null)for(var B=0;Bh){var q=f;f=h,h=q}if(c>v){var K=c;c=v,v=K}f-=L,h+=L,c-=L,v+=L,xt(s,f,c,h,v)}if(n&&r.includeEdges&&u&&(Ha(s,e,"mid-source"),Ha(s,e,"mid-target"),Ha(s,e,"source"),Ha(s,e,"target")),n){var j=e.pstyle("ghost").value==="yes";if(j){var Q=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;xt(s,s.x1+Q,s.y1+ee,s.x2+Q,s.y2+ee)}}var ie=o.bodyBounds=o.bodyBounds||{};Iu(ie,s),Za(ie,y),Ka(ie,1),n&&(f=s.x1,h=s.x2,c=s.y1,v=s.y2,xt(s,f-C,c-C,h+C,v+C));var de=o.overlayBounds=o.overlayBounds||{};Iu(de,s),Za(de,y),Ka(de,1);var te=o.labelBounds=o.labelBounds||{};te.all!=null?fp(te.all):te.all=ht(),n&&r.includeLabels&&(r.includeMainLabels&&Xn(s,e,null),u&&(r.includeSourceLabels&&Xn(s,e,"source"),r.includeTargetLabels&&Xn(s,e,"target")))}return s.x1=gt(s.x1),s.y1=gt(s.y1),s.x2=gt(s.x2),s.y2=gt(s.y2),s.w=gt(s.x2-s.x1),s.h=gt(s.y2-s.y1),s.w>0&&s.h>0&&w&&(Za(s,y),Ka(s,1)),s},hf=function(e){var r=0,a=function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:jy,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this};Zt.removeAllListeners=function(){return this.removeListener("*")};Zt.emit=Zt.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,Re(e)||(e=[e]),em(this,function(i,s){r!=null&&(a=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],n=a.length);for(var o=function(f){var h=a[f];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===Jy)&&i.eventMatches(i.context,h,s)){var c=[s];e!=null&&zg(c,e),i.beforeEmit(i.context,h,s),h.conf&&h.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==h}));var v=i.callbackContext(i.context,h,s),d=h.callback.apply(v,c);i.afterEmit(i.context,h,s),d===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,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 s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&ve(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n=0;r--){var a=this[r];e(a)&&this.unmergeAt(r)}return this},map:function(e,r){for(var a=[],n=this,i=0;ia&&(a=l,n=o)}return{value:a,ele:n}},min:function(e,r){for(var a=1/0,n,i=this,s=0;s=0&&i"u"?"undefined":Ye(Symbol))!=e&&Ye(Symbol.iterator)!=e;r&&(fn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return Sl({next:function(){return i1&&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(Se(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(ve(e))if(r===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?i.getRawStyle(l):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 s=0;s0&&e.push(f[0]),e.push(o[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)}});rt.neighbourhood=rt.neighborhood;rt.closedNeighbourhood=rt.closedNeighborhood;rt.openNeighbourhood=rt.openNeighborhood;ge(rt,{source:pt(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"source"),target:pt(function(e){var r=this[0],a;return r&&(a=r._private.target||r.cy().collection()),a&&e?a.filter(e):a},"target"),sources:nl({attr:"source"}),targets:nl({attr:"target"})});function nl(t){return function(r){for(var a=[],n=0;n0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});rt.componentsOf=rt.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){ze("A collection must have a reference to the core");return}var i=new At,s=!1;if(!r)r=[];else if(r.length>0&&Se(r[0])&&!wa(r[0])){s=!0;for(var o=[],l=new kr,u=0,f=r.length;u0&&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=[],s=[],o,l=0,u=r.length;l0){for(var F=o.length===r.length?r:new Qe(a,o),z=0;z0&&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 s(N){for(var P=N._private.edges,R=0;R0&&(t?A.emitAndNotify("remove"):e&&A.emit("remove"));for(var S=0;S0?S=N:A=N;while(Math.abs(M)>s&&++P=i?b(L,P):R===0?P:D(L,A,A+u)}var x=!1;function E(){x=!0,(t!==e||r!==a)&&w()}var C=function(A){return x||E(),t===e&&r===a?A:A===0?0:A===1?1:p(m(A),e,a)};C.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var T="generateBezier("+[t,e,r,a]+")";return C.toString=function(){return T},C}var hm=function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:t(s)}}function r(a,n){var i={dx:a.v,dv:t(a)},s=e(a,n*.5,i),o=e(a,n*.5,s),l=e(a,n,o),u=1/6*(i.dx+2*(s.dx+o.dx)+l.dx),f=1/6*(i.dv+2*(s.dv+o.dv)+l.dv);return a.x=a.x+u*n,a.v=a.v+f*n,a}return function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,f=1/1e4,h=16/1e3,c,v,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,c=s!==null,c?(u=a(n,i),v=u/s*h):v=h;d=r(d||o,v),l.push(1+d.x),u+=16,Math.abs(d.x)>f&&Math.abs(d.v)>f;);return c?function(g){return l[g*(l.length-1)|0]}:u}}(),ke=function(e,r,a,n){var i=fm(e,r,a,n);return function(s,o,l){return s+(o-s)*i(l)}},ja={linear:function(e,r,a){return e+(r-e)*a},ease:ke(.25,.1,.25,1),"ease-in":ke(.42,0,1,1),"ease-out":ke(0,0,.58,1),"ease-in-out":ke(.42,0,.58,1),"ease-in-sine":ke(.47,0,.745,.715),"ease-out-sine":ke(.39,.575,.565,1),"ease-in-out-sine":ke(.445,.05,.55,.95),"ease-in-quad":ke(.55,.085,.68,.53),"ease-out-quad":ke(.25,.46,.45,.94),"ease-in-out-quad":ke(.455,.03,.515,.955),"ease-in-cubic":ke(.55,.055,.675,.19),"ease-out-cubic":ke(.215,.61,.355,1),"ease-in-out-cubic":ke(.645,.045,.355,1),"ease-in-quart":ke(.895,.03,.685,.22),"ease-out-quart":ke(.165,.84,.44,1),"ease-in-out-quart":ke(.77,0,.175,1),"ease-in-quint":ke(.755,.05,.855,.06),"ease-out-quint":ke(.23,1,.32,1),"ease-in-out-quint":ke(.86,0,.07,1),"ease-in-expo":ke(.95,.05,.795,.035),"ease-out-expo":ke(.19,1,.22,1),"ease-in-out-expo":ke(1,0,0,1),"ease-in-circ":ke(.6,.04,.98,.335),"ease-out-circ":ke(.075,.82,.165,1),"ease-in-out-circ":ke(.785,.135,.15,.86),spring:function(e,r,a){if(a===0)return ja.linear;var n=hm(e,r,a);return function(i,s,o){return i+(s-i)*n(o)}},"cubic-bezier":ke};function ol(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 ul(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function xr(t,e,r,a,n){var i=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var s=ul(t,n),o=ul(e,n);if(ae(s)&&ae(o))return ol(i,s,o,r,a);if(Re(s)&&Re(o)){for(var l=[],u=0;u0?(v==="spring"&&d.push(s.duration),s.easingImpl=ja[v].apply(null,d)):s.easingImpl=ja[v]}var g=s.easingImpl,p;if(s.duration===0?p=1:p=(r-l)/s.duration,s.applying&&(p=s.progress),p<0?p=0:p>1&&(p=1),s.delay==null){var y=s.startPosition,b=s.position;if(b&&n&&!t.locked()){var w={};ta(y.x,b.x)&&(w.x=xr(y.x,b.x,p,g)),ta(y.y,b.y)&&(w.y=xr(y.y,b.y,p,g)),t.position(w)}var D=s.startPan,m=s.pan,x=i.pan,E=m!=null&&a;E&&(ta(D.x,m.x)&&(x.x=xr(D.x,m.x,p,g)),ta(D.y,m.y)&&(x.y=xr(D.y,m.y,p,g)),t.emit("pan"));var C=s.startZoom,T=s.zoom,L=T!=null&&a;L&&(ta(C,T)&&(i.zoom=ca(i.minZoom,xr(C,T,p,g),i.maxZoom)),t.emit("zoom")),(E||L)&&t.emit("viewport");var A=s.style;if(A&&A.length>0&&n){for(var S=0;S=0;E--){var C=x[E];C()}x.splice(0,x.length)},b=v.length-1;b>=0;b--){var w=v[b],D=w._private;if(D.stopped){v.splice(b,1),D.hooked=!1,D.playing=!1,D.started=!1,y(D.frames);continue}!D.playing&&!D.applying||(D.playing&&D.applying&&(D.applying=!1),D.started||vm(f,w,t),cm(f,w,t,h),D.applying&&(D.applying=!1),y(D.frames),D.step!=null&&D.step(t),w.completed()&&(v.splice(b,1),D.hooked=!1,D.playing=!1,D.started=!1,y(D.completes)),g=!0)}return!h&&v.length===0&&d.length===0&&a.push(f),g}for(var i=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}var dm={animate:Ne.animate(),animation:Ne.animation(),animated:Ne.animated(),clearQueue:Ne.clearQueue(),delay:Ne.delay(),delayAnimation:Ne.delayAnimation(),stop:Ne.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&&nn(function(i){ll(i,e),r()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,s){ll(s,e)},a.beforeRenderPriorities.animations):r()}},gm={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&&wa(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}},_a=function(e){return ve(e)?new Wt(e):e},xf={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new wn(gm,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,a){return this.emitter().on(e,_a(r),a),this},removeListener:function(e,r,a){return this.emitter().removeListener(e,_a(r),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,a){return this.emitter().one(e,_a(r),a),this},once:function(e,r,a){return this.emitter().one(e,_a(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}};Ne.eventAliasesOn(xf);var ni={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)}};ni.jpeg=ni.jpg;var en={layout:function(e){var r=this;if(e==null){ze("Layout options must be specified to make a layout");return}if(e.name==null){ze("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){ze("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;ve(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var s=new n(ge({},e,{cy:r,eles:i}));return s}};en.createLayout=en.makeLayout=en.layout;var pm={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;n0;)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)}};ii.invalidateDimensions=ii.resize;var tn={collection:function(e,r){return ve(e)?this.$(e):ct(e)?e.collection():Re(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}};tn.elements=tn.filter=tn.$;var nt={},sa="t",mm="f";nt.apply=function(t){for(var e=this,r=e._private,a=r.cy,n=a.collection(),i=0;i0;if(c||h&&v){var d=void 0;c&&v||c?d=u.properties:v&&(d=u.mappedProperties);for(var g=0;g1&&(D=1),o.color){var x=a.valueMin[0],E=a.valueMax[0],C=a.valueMin[1],T=a.valueMax[1],L=a.valueMin[2],A=a.valueMax[2],S=a.valueMin[3]==null?1:a.valueMin[3],M=a.valueMax[3]==null?1:a.valueMax[3],N=[Math.round(x+(E-x)*D),Math.round(C+(T-C)*D),Math.round(L+(A-L)*D),Math.round(S+(M-S)*D)];i={bypass:a.bypass,name:a.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else if(o.number){var P=a.valueMin+(a.valueMax-a.valueMin)*D;i=this.parse(a.name,P,a.bypass,c)}else return!1;if(!i)return g(),!1;i.mapping=a,a=i;break}case s.data:{for(var R=a.field.split("."),I=h.data,k=0;k0&&i>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(w):w()}).then(function(){return t.animation({style:o,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)};nt.checkTrigger=function(t,e,r,a,n,i){var s=this.properties[e],o=n(s);o!=null&&o(r,a)&&i(s)};nt.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)})};nt.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")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),n.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||a==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};nt.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a)};var Ca={};Ca.applyBypass=function(t,e,r,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;on.length?a=a.substr(n.length):a=""}function l(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var u=a.match(/^\s*$/);if(u)break;var f=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){Ie("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=f[0];var h=f[1];if(h!=="core"){var c=new Wt(h);if(c.invalid){Ie("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),o();continue}}var v=f[2],d=!1;i=v;for(var g=[];;){var p=i.match(/^\s*$/);if(p)break;var y=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){Ie("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),d=!0;break}s=y[0];var b=y[1],w=y[2],D=e.properties[b];if(!D){Ie("Skipping property: Invalid property name in: "+s),l();continue}var m=r.parse(b,w);if(!m){Ie("Skipping property: Invalid property definition in: "+s),l();continue}g.push({name:b,val:w}),l()}if(d){o();break}r.selector(h);for(var x=0;x=7&&e[0]==="d"&&(f=new RegExp(o.data.regex).exec(e))){if(r)return!1;var c=o.data;return{name:t,value:f,strValue:""+e,mapped:c,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(h=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var v=o.mapData;if(!(u.color||u.number))return!1;var d=this.parse(t,h[4]);if(!d||d.mapped)return!1;var g=this.parse(t,h[5]);if(!g||g.mapped)return!1;if(d.pfValue===g.pfValue||d.strValue===g.strValue)return Ie("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+d.strValue+"`"),this.parse(t,d.strValue);if(u.color){var p=d.value,y=g.value,b=p[0]===y[0]&&p[1]===y[1]&&p[2]===y[2]&&(p[3]===y[3]||(p[3]==null||p[3]===1)&&(y[3]==null||y[3]===1));if(b)return!1}return{name:t,value:h,strValue:""+e,mapped:v,field:h[1],fieldMin:parseFloat(h[2]),fieldMax:parseFloat(h[3]),valueMin:d.value,valueMax:g.value,bypass:r}}}if(u.multiple&&a!=="multiple"){var w;if(l?w=e.split(/\s+/):Re(e)?w=e:w=[e],u.evenMultiple&&w.length%2!==0)return null;for(var D=[],m=[],x=[],E="",C=!1,T=0;T0?" ":"")+L.strValue}return u.validate&&!u.validate(D,m)?null:u.singleEnum&&C?D.length===1&&ve(D[0])?{name:t,value:D[0],strValue:D[0],bypass:r}:null:{name:t,value:D,pfValue:x,strValue:E,bypass:r,units:m}}var A=function(){for(var j=0;ju.max||u.strictMax&&e===u.max))return null;var R={name:t,value:e,strValue:""+e+(S||""),units:S,bypass:r};return u.unitless||S!=="px"&&S!=="em"?R.pfValue=e:R.pfValue=S==="px"||!S?e:this.getEmSizeInPixels()*e,(S==="ms"||S==="s")&&(R.pfValue=S==="ms"?e:1e3*e),(S==="deg"||S==="rad")&&(R.pfValue=S==="rad"?e:sp(e)),S==="%"&&(R.pfValue=e/100),R}else if(u.propList){var I=[],k=""+e;if(k!=="none"){for(var F=k.split(/\s*,\s*|\s+/),z=0;z0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){l=Math.min((s-2*r)/a.w,(o-2*r)/a.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=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,s,o=!1;if(r.zoomingEnabled||(o=!0),ae(e)?s=e:Se(e)&&(s=e.level,e.position!=null?i=mn(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,i.push("zoom"))}if(n&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;ae(u.x)&&(r.pan.x=u.x,o=!1),ae(u.y)&&(r.pan.y=u.y,o=!1),o||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(ve(e)){var a=e;e=this.mutableElements().filter(a)}else ct(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(i-r*(n.x1+n.x2))/2,y:(s-r*(n.y1+n.y2))/2};return o}}},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(o){return parseFloat(n.getPropertyValue(o))};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}};ur.centre=ur.center;ur.autolockNodes=ur.autolock;ur.autoungrabifyNodes=ur.autoungrabify;var pa={data:Ne.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ne.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ne.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ne.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};pa.attr=pa.data;pa.removeAttr=pa.removeData;var ya=function(e){var r=this;e=ge({},e);var a=e.container;a&&!an(a)&&an(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 s=Ve!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=ge({name:s?"grid":"null"},o.layout),o.renderer=ge({name:s?"canvas":"null"},o.renderer);var l=function(d,g,p){return g!==void 0?g:p!==void 0?p:d},u=this._private={container:a,ready:!1,options:o,elements:new Qe(this),listeners:[],aniEles:new Qe(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:ae(o.zoom)?o.zoom:1,pan:{x:Se(o.pan)&&ae(o.pan.x)?o.pan.x:0,y:Se(o.pan)&&ae(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var f=function(d,g){var p=d.some(gg);if(p)return Pr.all(d).then(g);g(d)};u.styleEnabled&&r.setStyle([]);var h=ge({},o,o.renderer);r.initRenderer(h);var c=function(d,g,p){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),d!=null&&(Se(d)||Re(d))&&r.add(d),r.one("layoutready",function(w){r.notifications(!0),r.emit(w),r.one("load",g),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",p),r.emit("done")});var b=ge({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};f([o.style,o.elements],function(v){var d=v[0],g=v[1];u.styleEnabled&&r.style().append(d),c(g,function(){r.startAnimationLoop(),u.ready=!0,Fe(o.ready)&&r.on("ready",o.ready);for(var p=0;p0,l=ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(ct(e.roots))u=e.roots;else if(Re(e.roots)){for(var f=[],h=0;h0;){var P=N(),R=L(P,S);if(R)P.outgoers().filter(function(te){return te.isNode()&&a.has(te)}).forEach(M);else if(R===null){Ie("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}T();var I=0;if(e.avoidOverlap)for(var k=0;k0&&y[0].length<=3?pe/2:0),O=2*Math.PI/y[le].length*oe;return le===0&&y[0].length===1&&(U=1),{x:ee.x+U*Math.cos(O),y:ee.y+U*Math.sin(O)}}else{var xe={x:ee.x+(oe+1-(he+1)/2)*Te,y:(le+1)*we};return xe}};return a.nodes().layoutPositions(this,e,de),this};var Tm={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 Cf(t){this.options=ge({},Tm,t)}Cf.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 s=ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),f,h=0,c=0;c1&&e.avoidOverlap){h*=1.75;var y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(h*h/(y*y+b*b));f=Math.max(w,f)}var D=function(x,E){var C=e.startAngle+E*u*(n?1:-1),T=f*Math.cos(C),L=f*Math.sin(C),A={x:o.x+T,y:o.y+L};return A};return a.nodes().layoutPositions(this,e,D),this};var Cm={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 Df(t){this.options=ge({},Cm,t)}Df.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"),s=ht(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,f=0;f0){var m=Math.abs(b[0].value-D.value);m>=p&&(b=[],y.push(b))}b.push(D)}var x=u+e.minNodeSpacing;if(!e.avoidOverlap){var E=y.length>0&&y[0].length>1,C=Math.min(s.w,s.h)/2-x,T=C/(y.length+E?1:0);x=Math.min(x,T)}for(var L=0,A=0;A1&&e.avoidOverlap){var P=Math.cos(N)-Math.cos(0),R=Math.sin(N)-Math.sin(0),I=Math.sqrt(x*x/(P*P+R*R));L=Math.max(I,L)}S.r=L,L+=x}if(e.equidistant){for(var k=0,F=0,z=0;z=t.numIter||(Mm(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature=t.animationThreshold&&i(),nn(h)}};f()}else{for(;u;)u=s(l),l++;cl(a,t),o()}return this};Sn.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Sn.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Sm=function(e,r,a){for(var n=a.eles.edges(),i=a.eles.nodes(),s=ht(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=a.eles.components(),u={},f=0;f0){o.graphSet.push(C);for(var f=0;fn.count?0:n.graph},Am=function t(e,r,a,n){var i=n.graphSet[a];if(-10)var h=n.nodeOverlap*f,c=Math.sqrt(o*o+l*l),v=h*o/c,d=h*l/c;else var g=cn(e,o,l),p=cn(r,-1*o,-1*l),y=p.x-g.x,b=p.y-g.y,w=y*y+b*b,c=Math.sqrt(w),h=(e.nodeRepulsion+r.nodeRepulsion)/w,v=h*y/c,d=h*b/c;e.isLocked||(e.offsetX-=v,e.offsetY-=d),r.isLocked||(r.offsetX+=v,r.offsetY+=d)}},Pm=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 s=e.maxY-r.minY;else var s=r.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},cn=function(e,r,a){var n=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,l=a/r,u=s/o,f={};return r===0&&0a?(f.x=n,f.y=i+s/2,f):0r&&-1*u<=l&&l<=u?(f.x=n-o/2,f.y=i-o*a/2/r,f):0=u)?(f.x=n+s*r/2/a,f.y=i+s/2,f):(0>a&&(l<=-1*u||l>=u)&&(f.x=n-s*r/2/a,f.y=i-s/2),f)},Bm=function(e,r){for(var a=0;aa){var p=r.gravity*v/g,y=r.gravity*d/g;c.offsetX+=p,c.offsetY+=y}}}}},Gm=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 s=a[n++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0a)var i={x:a*e/n,y:a*r/n};else var i={x:e,y:r};return i},Vm=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.padLeftn.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTopy&&(d+=p+r.componentSpacing,v=0,g=0,p=0)}}},Um={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 Lf(t){this.options=ge({},Um,t)}Lf.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=ht(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($){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),f=function(X){if(X==null)return Math.min(l,u);var Y=Math.min(l,u);Y==l?l=X:u=X},h=function(X){if(X==null)return Math.max(l,u);var Y=Math.max(l,u);Y==l?l=X:u=X},c=e.rows,v=e.cols!=null?e.cols:e.columns;if(c!=null&&v!=null)l=c,u=v;else if(c!=null&&v==null)l=c,u=Math.ceil(s/l);else if(c==null&&v!=null)u=v,l=Math.ceil(s/u);else if(u*l>s){var d=f(),g=h();(d-1)*g>=s?f(d-1):(g-1)*d>=s&&h(g-1)}else for(;u*l=s?h(y+1):f(p+1)}var b=i.w/u,w=i.h/l;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var D=0;D=u&&(P=0,N++)},I={},k=0;k(P=bp(t,e,R[I],R[I+1],R[I+2],R[I+3])))return p(E,P),!0}else if(T.edgeType==="bezier"||T.edgeType==="multibezier"||T.edgeType==="self"||T.edgeType==="compound"){for(var R=T.allpts,I=0;I+5(P=mp(t,e,R[I],R[I+1],R[I+2],R[I+3],R[I+4],R[I+5])))return p(E,P),!0}for(var k=k||C.source,F=F||C.target,z=n.getArrowWidth(L,A),B=[{name:"source",x:T.arrowStartX,y:T.arrowStartY,angle:T.srcArrowAngle},{name:"target",x:T.arrowEndX,y:T.arrowEndY,angle:T.tgtArrowAngle},{name:"mid-source",x:T.midX,y:T.midY,angle:T.midsrcArrowAngle},{name:"mid-target",x:T.midX,y:T.midY,angle:T.midtgtArrowAngle}],I=0;I0&&(y(k),y(F))}function w(E,C,T){return Tt(E,C,T)}function D(E,C){var T=E._private,L=c,A;C?A=C+"-":A="",E.boundingBox();var S=T.labelBounds[C||"main"],M=E.pstyle(A+"label").value,N=E.pstyle("text-events").strValue==="yes";if(!(!N||!M)){var P=w(T.rscratch,"labelX",C),R=w(T.rscratch,"labelY",C),I=w(T.rscratch,"labelAngle",C),k=E.pstyle(A+"text-margin-x").pfValue,F=E.pstyle(A+"text-margin-y").pfValue,z=S.x1-L-k,B=S.x2+L-k,G=S.y1-L-F,$=S.y2+L-F;if(I){var X=Math.cos(I),Y=Math.sin(I),_=function(de,te){return de=de-P,te=te-R,{x:de*X-te*Y+P,y:de*Y+te*X+R}},q=_(z,G),K=_(z,$),j=_(B,G),Q=_(B,$),ee=[q.x+k,q.y+F,j.x+k,j.y+F,Q.x+k,Q.y+F,K.x+k,K.y+F];if(ft(t,e,ee))return p(E),!0}else if(Ir(S,t,e))return p(E),!0}}for(var m=s.length-1;m>=0;m--){var x=s[m];x.isNode()?y(x)||D(x):b(x)||D(x)||D(x,"source")||D(x,"target")}return o};hr.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,r),o=Math.max(t,r),l=Math.min(e,a),u=Math.max(e,a);t=s,r=o,e=l,a=u;for(var f=ht({x1:t,y1:e,x2:r,y2:a}),h=0;h0?Math.max(Z-ue,0):Math.min(Z+ue,0)},M=S(L,C),N=S(A,T),P=!1;b===u?y=Math.abs(M)>Math.abs(N)?n:a:b===l||b===o?(y=a,P=!0):(b===i||b===s)&&(y=n,P=!0);var R=y===a,I=R?N:M,k=R?A:L,F=Yl(k),z=!1;!(P&&(D||x))&&(b===o&&k<0||b===l&&k>0||b===i&&k>0||b===s&&k<0)&&(F*=-1,I=F*Math.abs(I),z=!0);var B;if(D){var G=m<0?1+m:m;B=G*I}else{var $=m<0?I:0;B=$+m*F}var X=function(Z){return Math.abs(Z)=Math.abs(I)},Y=X(B),_=X(Math.abs(I)-Math.abs(B)),q=Y||_;if(q&&!z)if(R){var K=Math.abs(k)<=c/2,j=Math.abs(L)<=v/2;if(K){var Q=(f.x1+f.x2)/2,ee=f.y1,ie=f.y2;r.segpts=[Q,ee,Q,ie]}else if(j){var de=(f.y1+f.y2)/2,te=f.x1,re=f.x2;r.segpts=[te,de,re,de]}else r.segpts=[f.x1,f.y2]}else{var fe=Math.abs(k)<=h/2,le=Math.abs(A)<=d/2;if(fe){var oe=(f.y1+f.y2)/2,he=f.x1,Te=f.x2;r.segpts=[he,oe,Te,oe]}else if(le){var we=(f.x1+f.x2)/2,pe=f.y1,xe=f.y2;r.segpts=[we,pe,we,xe]}else r.segpts=[f.x2,f.y1]}else if(R){var U=f.y1+B+(p?c/2*F:0),O=f.x1,V=f.x2;r.segpts=[O,U,V,U]}else{var J=f.x1+B+(p?h/2*F:0),H=f.y1,W=f.y2;r.segpts=[J,H,J,W]}};it.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,f=e.tgtShape,h=!ae(r.startX)||!ae(r.startY),c=!ae(r.arrowStartX)||!ae(r.arrowStartY),v=!ae(r.endX)||!ae(r.endY),d=!ae(r.arrowEndX)||!ae(r.arrowEndY),g=3,p=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,y=g*p,b=sr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),w=bN.poolIndex()){var P=M;M=N,N=P}var R=T.srcPos=M.position(),I=T.tgtPos=N.position(),k=T.srcW=M.outerWidth(),F=T.srcH=M.outerHeight(),z=T.tgtW=N.outerWidth(),B=T.tgtH=N.outerHeight(),G=T.srcShape=r.nodeShapes[e.getNodeShape(M)],$=T.tgtShape=r.nodeShapes[e.getNodeShape(N)];T.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var X=0;X0){var K=i,j=rr(K,Dr(r)),Q=rr(K,Dr(q)),ee=j;if(Q2){var ie=rr(K,{x:q[2],y:q[3]});ie0){var O=s,V=rr(O,Dr(r)),J=rr(O,Dr(U)),H=V;if(J2){var W=rr(O,{x:U[2],y:U[3]});W=d||E){p={cp:D,segment:x};break}}if(p)break}var C=p.cp,T=p.segment,L=(d-y)/T.length,A=T.t1-T.t0,S=v?T.t0+A*L:T.t1-A*L;S=ca(0,S,1),e=Lr(C.p0,C.p1,C.p2,S),c=Wm(C.p0,C.p1,C.p2,S);break}case"straight":case"segments":case"haystack":{for(var M=0,N,P,R,I,k=a.allpts.length,F=0;F+3=d));F+=2);var z=d-P,B=z/N;B=ca(0,B,1),e=up(R,I,B),c=Rf(R,I);break}}s("labelX",h,e.x),s("labelY",h,e.y),s("labelAutoAngle",h,c)}};u("source"),u("target"),this.applyLabelDimensions(t)}};Nt.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Nt.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=this.calculateLabelDimensions(t,a),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,o=Tt(r.rscratch,"labelWrapCachedLines",e)||[],l=s!=="wrap"?1:Math.max(o.length,1),u=n.height/l,f=u*i,h=n.width,c=n.height+(l-1)*(i-1)*u;Ut(r.rstyle,"labelWidth",e,h),Ut(r.rscratch,"labelWidth",e,h),Ut(r.rstyle,"labelHeight",e,c),Ut(r.rscratch,"labelHeight",e,c),Ut(r.rscratch,"labelLineHeight",e,f)};Nt.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,s=function(z,B){return B?(Ut(r.rscratch,z,e,B),B):Tt(r.rscratch,z,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="\u200B",f=n.split(` `),h=t.pstyle("text-max-width").pfValue,c=t.pstyle("text-overflow-wrap").value,v=c==="anywhere",d=[],g=/[\s\u200b]+/,p=v?"":" ",y=0;yh){for(var x=b.split(g),E="",C=0;CM)break;N+=n[I],I===n.length-1&&(R=!0)}return R||(N+=P),N}return n};Nt.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};Nt.calculateLabelDimensions=function(t,e){var r=this,a=ir(e,t._private.labelDimsKey),n=r.labelDimCache||(r.labelDimCache=[]),i=n[a];if(i!=null)return i;var s=0,o=t.pstyle("font-style").strValue,l=t.pstyle("font-size").pfValue,u=t.pstyle("font-family").strValue,f=t.pstyle("font-weight").strValue,h=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=h.getContext("2d");var v=h.style;v.position="absolute",v.left="-9999px",v.top="-9999px",v.zIndex="-1",v.visibility="hidden",v.pointerEvents="none"}c.font="".concat(o," ").concat(f," ").concat(l,"px ").concat(u);for(var d=0,g=0,p=e.split(` `),y=0;y1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var Mt=n(O);_e&&(t.hoverData.tapholdCancelled=!0);var Gt=function(){var St=t.hoverData.dragDelta=t.hoverData.dragDelta||[];St.length===0?(St.push(Ee[0]),St.push(Ee[1])):(St[0]+=Ee[0],St[1]+=Ee[1])};J=!0,a(ye,["mousemove","vmousemove","tapdrag"],O,{x:Z[0],y:Z[1]});var vr=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||H.emit({originalEvent:O,type:"boxstart",position:{x:Z[0],y:Z[1]}}),Le[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(_e){var jt={originalEvent:O,type:"cxtdrag",position:{x:Z[0],y:Z[1]}};me?me.emit(jt):H.emit(jt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ye!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:O,type:"cxtdragout",position:{x:Z[0],y:Z[1]}}),t.hoverData.cxtOver=ye,ye&&ye.emit({originalEvent:O,type:"cxtdragover",position:{x:Z[0],y:Z[1]}}))}}else if(t.hoverData.dragging){if(J=!0,H.panningEnabled()&&H.userPanningEnabled()){var dr;if(t.hoverData.justStartedPan){var Ia=t.hoverData.mdownPos;dr={x:(Z[0]-Ia[0])*W,y:(Z[1]-Ia[1])*W},t.hoverData.justStartedPan=!1}else dr={x:Ee[0]*W,y:Ee[1]*W};H.panBy(dr),H.emit("dragpan"),t.hoverData.dragged=!0}Z=t.projectIntoViewport(O.clientX,O.clientY)}else if(Le[4]==1&&(me==null||me.pannable())){if(_e){if(!t.hoverData.dragging&&H.boxSelectionEnabled()&&(Mt||!H.panningEnabled()||!H.userPanningEnabled()))vr();else if(!t.hoverData.selecting&&H.panningEnabled()&&H.userPanningEnabled()){var er=i(me,t.hoverData.downs);er&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Le[4]=0,t.data.bgActivePosistion=Dr(ue),t.redrawHint("select",!0),t.redraw())}me&&me.pannable()&&me.active()&&me.unactivate()}}else{if(me&&me.pannable()&&me.active()&&me.unactivate(),(!me||!me.grabbed())&&ye!=Ce&&(Ce&&a(Ce,["mouseout","tapdragout"],O,{x:Z[0],y:Z[1]}),ye&&a(ye,["mouseover","tapdragover"],O,{x:Z[0],y:Z[1]}),t.hoverData.last=ye),me)if(_e){if(H.boxSelectionEnabled()&&Mt)me&&me.grabbed()&&(p(Ge),me.emit("freeon"),Ge.emit("free"),t.dragData.didDrag&&(me.emit("dragfreeon"),Ge.emit("dragfree"))),vr();else if(me&&me.grabbed()&&t.nodeIsDraggable(me)){var ut=!t.dragData.didDrag;ut&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||d(Ge,{inDragLayer:!0});var et={x:0,y:0};if(ae(Ee[0])&&ae(Ee[1])&&(et.x+=Ee[0],et.y+=Ee[1],ut)){var lt=t.hoverData.dragDelta;lt&&ae(lt[0])&&ae(lt[1])&&(et.x+=lt[0],et.y+=lt[1])}t.hoverData.draggingEles=!0,Ge.silentShift(et).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Gt();J=!0}if(Le[2]=Z[0],Le[3]=Z[1],J)return O.stopPropagation&&O.stopPropagation(),O.preventDefault&&O.preventDefault(),!1}},!1);var L,A,S;t.registerBinding(e,"mouseup",function(O){var V=t.hoverData.capture;if(V){t.hoverData.capture=!1;var J=t.cy,H=t.projectIntoViewport(O.clientX,O.clientY),W=t.selection,ce=t.findNearestElement(H[0],H[1],!0,!1),Z=t.dragData.possibleDragElements,ue=t.hoverData.down,be=n(O);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ue&&ue.unactivate(),t.hoverData.which===3){var Le={originalEvent:O,type:"cxttapend",position:{x:H[0],y:H[1]}};if(ue?ue.emit(Le):J.emit(Le),!t.hoverData.cxtDragged){var ye={originalEvent:O,type:"cxttap",position:{x:H[0],y:H[1]}};ue?ue.emit(ye):J.emit(ye)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(ce,["mouseup","tapend","vmouseup"],O,{x:H[0],y:H[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(ue,["click","tap","vclick"],O,{x:H[0],y:H[1]}),A=!1,O.timeStamp-S<=J.multiClickDebounceTime()?(L&&clearTimeout(L),A=!0,S=null,a(ue,["dblclick","dbltap","vdblclick"],O,{x:H[0],y:H[1]})):(L=setTimeout(function(){A||a(ue,["oneclick","onetap","voneclick"],O,{x:H[0],y:H[1]})},J.multiClickDebounceTime()),S=O.timeStamp)),ue==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!n(O)&&(J.$(r).unselect(["tapunselect"]),Z.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Z=J.collection()),ce==ue&&!t.dragData.didDrag&&!t.hoverData.selecting&&ce!=null&&ce._private.selectable&&(t.hoverData.dragging||(J.selectionType()==="additive"||be?ce.selected()?ce.unselect(["tapunselect"]):ce.select(["tapselect"]):be||(J.$(r).unmerge(ce).unselect(["tapunselect"]),ce.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ce=J.collection(t.getAllInBox(W[0],W[1],W[2],W[3]));t.redrawHint("select",!0),Ce.length>0&&t.redrawHint("eles",!0),J.emit({type:"boxend",originalEvent:O,position:{x:H[0],y:H[1]}});var me=function(_e){return _e.selectable()&&!_e.selected()};J.selectionType()==="additive"||be||J.$(r).unmerge(Ce).unselect(),Ce.emit("box").stdFilter(me).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!W[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ee=ue&&ue.grabbed();p(Z),Ee&&(ue.emit("freeon"),Z.emit("free"),t.dragData.didDrag&&(ue.emit("dragfreeon"),Z.emit("dragfree")))}}W[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(O){if(!t.scrollingPage){var V=t.cy,J=V.zoom(),H=V.pan(),W=t.projectIntoViewport(O.clientX,O.clientY),ce=[W[0]*J+H.x,W[1]*J+H.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||C()){O.preventDefault();return}if(V.panningEnabled()&&V.userPanningEnabled()&&V.zoomingEnabled()&&V.userZoomingEnabled()){O.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 Z;O.deltaY!=null?Z=O.deltaY/-250:O.wheelDeltaY!=null?Z=O.wheelDeltaY/1e3:Z=O.wheelDelta/1e3,Z=Z*t.wheelSensitivity;var ue=O.deltaMode===1;ue&&(Z*=33);var be=V.zoom()*Math.pow(10,Z);O.type==="gesturechange"&&(be=t.gestureStartZoom*O.scale),V.zoom({level:be,renderedPosition:{x:ce[0],y:ce[1]}}),V.emit(O.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",M,!0),t.registerBinding(e,"scroll",function(O){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(O){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||O.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(U){t.hasTouchStarted||M(U)},!0),t.registerBinding(t.container,"mouseout",function(O){var V=t.projectIntoViewport(O.clientX,O.clientY);t.cy.emit({originalEvent:O,type:"mouseout",position:{x:V[0],y:V[1]}})},!1),t.registerBinding(t.container,"mouseover",function(O){var V=t.projectIntoViewport(O.clientX,O.clientY);t.cy.emit({originalEvent:O,type:"mouseover",position:{x:V[0],y:V[1]}})},!1);var N,P,R,I,k,F,z,B,G,$,X,Y,_,q=function(O,V,J,H){return Math.sqrt((J-O)*(J-O)+(H-V)*(H-V))},K=function(O,V,J,H){return(J-O)*(J-O)+(H-V)*(H-V)},j;t.registerBinding(t.container,"touchstart",j=function(O){if(t.hasTouchStarted=!0,!!T(O)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var V=t.cy,J=t.touchData.now,H=t.touchData.earlier;if(O.touches[0]){var W=t.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);J[0]=W[0],J[1]=W[1]}if(O.touches[1]){var W=t.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);J[2]=W[0],J[3]=W[1]}if(O.touches[2]){var W=t.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);J[4]=W[0],J[5]=W[1]}if(O.touches[1]){t.touchData.singleTouchMoved=!0,p(t.dragData.touchDragEles);var ce=t.findContainerClientCoords();G=ce[0],$=ce[1],X=ce[2],Y=ce[3],N=O.touches[0].clientX-G,P=O.touches[0].clientY-$,R=O.touches[1].clientX-G,I=O.touches[1].clientY-$,_=0<=N&&N<=X&&0<=R&&R<=X&&0<=P&&P<=Y&&0<=I&&I<=Y;var Z=V.pan(),ue=V.zoom();k=q(N,P,R,I),F=K(N,P,R,I),z=[(N+R)/2,(P+I)/2],B=[(z[0]-Z.x)/ue,(z[1]-Z.y)/ue];var be=200,Le=be*be;if(F=1){for(var mt=t.touchData.startPosition=[null,null,null,null,null,null],We=0;We=t.touchTapThreshold2}if(V&&t.touchData.cxt){O.preventDefault();var mt=O.touches[0].clientX-G,We=O.touches[0].clientY-$,dt=O.touches[1].clientX-G,st=O.touches[1].clientY-$,Mt=K(mt,We,dt,st),Gt=Mt/F,vr=150,jt=vr*vr,dr=1.5,Ia=dr*dr;if(Gt>=Ia||Mt>=jt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var er={originalEvent:O,type:"cxttapend",position:{x:W[0],y:W[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(er),t.touchData.start=null):H.emit(er)}}if(V&&t.touchData.cxt){var er={originalEvent:O,type:"cxtdrag",position:{x:W[0],y:W[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(er):H.emit(er),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var ut=t.findNearestElement(W[0],W[1],!0,!0);(!t.touchData.cxtOver||ut!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:O,type:"cxtdragout",position:{x:W[0],y:W[1]}}),t.touchData.cxtOver=ut,ut&&ut.emit({originalEvent:O,type:"cxtdragover",position:{x:W[0],y:W[1]}}))}else if(V&&O.touches[2]&&H.boxSelectionEnabled())O.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||H.emit({originalEvent:O,type:"boxstart",position:{x:W[0],y:W[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,J[4]=1,!J||J.length===0||J[0]===void 0?(J[0]=(W[0]+W[2]+W[4])/3,J[1]=(W[1]+W[3]+W[5])/3,J[2]=(W[0]+W[2]+W[4])/3+1,J[3]=(W[1]+W[3]+W[5])/3+1):(J[2]=(W[0]+W[2]+W[4])/3,J[3]=(W[1]+W[3]+W[5])/3),t.redrawHint("select",!0),t.redraw();else if(V&&O.touches[1]&&!t.touchData.didSelect&&H.zoomingEnabled()&&H.panningEnabled()&&H.userZoomingEnabled()&&H.userPanningEnabled()){O.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var et=t.dragData.touchDragEles;if(et){t.redrawHint("drag",!0);for(var lt=0;lt0&&!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(O){var V=t.touchData.start;t.touchData.capture=!1,V&&V.unactivate()});var ie,de,te,re;if(t.registerBinding(e,"touchend",ie=function(O){var V=t.touchData.start,J=t.touchData.capture;if(J)O.touches.length===0&&(t.touchData.capture=!1),O.preventDefault();else return;var H=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var W=t.cy,ce=W.zoom(),Z=t.touchData.now,ue=t.touchData.earlier;if(O.touches[0]){var be=t.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);Z[0]=be[0],Z[1]=be[1]}if(O.touches[1]){var be=t.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);Z[2]=be[0],Z[3]=be[1]}if(O.touches[2]){var be=t.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);Z[4]=be[0],Z[5]=be[1]}V&&V.unactivate();var Le;if(t.touchData.cxt){if(Le={originalEvent:O,type:"cxttapend",position:{x:Z[0],y:Z[1]}},V?V.emit(Le):W.emit(Le),!t.touchData.cxtDragged){var ye={originalEvent:O,type:"cxttap",position:{x:Z[0],y:Z[1]}};V?V.emit(ye):W.emit(ye)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!O.touches[2]&&W.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ce=W.collection(t.getAllInBox(H[0],H[1],H[2],H[3]));H[0]=void 0,H[1]=void 0,H[2]=void 0,H[3]=void 0,H[4]=0,t.redrawHint("select",!0),W.emit({type:"boxend",originalEvent:O,position:{x:Z[0],y:Z[1]}});var me=function(jt){return jt.selectable()&&!jt.selected()};Ce.emit("box").stdFilter(me).select().emit("boxselect"),Ce.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(V?.unactivate(),O.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!O.touches[1]){if(!O.touches[0]){if(!O.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ee=t.dragData.touchDragEles;if(V!=null){var Ge=V._private.grabbed;p(Ee),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ge&&(V.emit("freeon"),Ee.emit("free"),t.dragData.didDrag&&(V.emit("dragfreeon"),Ee.emit("dragfree"))),a(V,["touchend","tapend","vmouseup","tapdragout"],O,{x:Z[0],y:Z[1]}),V.unactivate(),t.touchData.start=null}else{var _e=t.findNearestElement(Z[0],Z[1],!0,!0);a(_e,["touchend","tapend","vmouseup","tapdragout"],O,{x:Z[0],y:Z[1]})}var yt=t.touchData.startPosition[0]-Z[0],mt=yt*yt,We=t.touchData.startPosition[1]-Z[1],dt=We*We,st=mt+dt,Mt=st*ce*ce;t.touchData.singleTouchMoved||(V||W.$(":selected").unselect(["tapunselect"]),a(V,["tap","vclick"],O,{x:Z[0],y:Z[1]}),de=!1,O.timeStamp-re<=W.multiClickDebounceTime()?(te&&clearTimeout(te),de=!0,re=null,a(V,["dbltap","vdblclick"],O,{x:Z[0],y:Z[1]})):(te=setTimeout(function(){de||a(V,["onetap","voneclick"],O,{x:Z[0],y:Z[1]})},W.multiClickDebounceTime()),re=O.timeStamp)),V!=null&&!t.dragData.didDrag&&V._private.selectable&&Mt"u"){var fe=[],le=function(O){return{clientX:O.clientX,clientY:O.clientY,force:1,identifier:O.pointerId,pageX:O.pageX,pageY:O.pageY,radiusX:O.width/2,radiusY:O.height/2,screenX:O.screenX,screenY:O.screenY,target:O.target}},oe=function(O){return{event:O,touch:le(O)}},he=function(O){fe.push(oe(O))},Te=function(O){for(var V=0;V0)return B[0]}return null},v=Object.keys(h),d=0;d0?c:Xl(i,s,e,r,a,n,o)},checkPoint:function(e,r,a,n,i,s,o){var l=xa(n,i),u=2*l;if(kt(e,r,this.points,s,o,n,i-u,[0,-1],a)||kt(e,r,this.points,s,o,n-u,i,[0,-1],a))return!0;var f=n/2+2*a,h=i/2+2*a,c=[s-f,o-h,s-f,o,s+f,o,s+f,o-h];return!!(ft(e,r,c)||nr(e,r,u,u,s+n/2-l,o+i/2-l,a)||nr(e,r,u,u,s-n/2+l,o+i/2-l,a))}}};Bt.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ot(3,0)),this.generateRoundPolygon("round-triangle",ot(3,0)),this.generatePolygon("rectangle",ot(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",ot(5,0)),this.generateRoundPolygon("round-pentagon",ot(5,0)),this.generatePolygon("hexagon",ot(6,0)),this.generateRoundPolygon("round-hexagon",ot(6,0)),this.generatePolygon("heptagon",ot(7,0)),this.generateRoundPolygon("round-heptagon",ot(7,0)),this.generatePolygon("octagon",ot(8,0)),this.generateRoundPolygon("round-octagon",ot(8,0));var a=new Array(20);{var n=Jn(5,0),i=Jn(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*D)break}else if(u){if(b>=e.deqCost*v||b>=e.deqAvgCost*c)break}else if(w>=e.deqNoDrawCost*Kn)break;var m=e.deq(a,p,g);if(m.length>0)for(var x=0;x0&&(e.onDeqd(a,d),!u&&e.shouldRedraw(a,d,p,g)&&i())},o=e.priority||gi;n.beforeRender(s,o(a))}}}},Zm=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sn;fi(this,t),this.idsByKey=new At,this.keyForId=new At,this.cachesByLvl=new At,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return hi(t,[{key:"getIdsFor",value:function(r){r==null&&ze("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new kr,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}(),ml=25,Wa=50,rn=-4,si=3,Qm=7.99,Jm=8,jm=1024,e0=1024,t0=1024,r0=.2,a0=.8,n0=10,i0=.15,s0=.1,o0=.9,u0=.9,l0=100,f0=1,Sr={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},h0=Je({getKey:null,doesEleInvalidateKey:sn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Gl,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ia=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=h0(r);ge(a,n),a.lookup=new Zm(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},He=ia.prototype;He.reasons=Sr;He.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};He.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};He.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new ba.default(function(r,a){return a.reqs-r.reqs});return e};He.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};He.getElement=function(t,e,r,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),l=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(yi(o*r))),a=Qm||a>si)return null;var u=Math.pow(2,a),f=e.h*u,h=e.w*u,c=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,c))return null;var v=l.get(t,a);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var d;if(f<=ml?d=ml:f<=Wa?d=Wa:d=Math.ceil(f/Wa)*Wa,f>t0||h>e0)return null;var g=i.getTextureQueue(d),p=g[g.length-2],y=function(){return i.recycleTexture(d,h)||i.addTexture(d,h)};p||(p=g[g.length-1]),p||(p=y()),p.width-p.usedWidtha;A--)T=i.getElement(t,e,r,A,Sr.downscale);L()}else return i.queueElement(t,x.level-1),x;else{var S;if(!w&&!D&&!m)for(var M=a-1;M>=rn;M--){var N=l.get(t,M);if(N){S=N;break}}if(b(S))return i.queueElement(t,a),S;p.context.translate(p.usedWidth,0),p.context.scale(u,u),this.drawElement(p.context,t,e,c,!1),p.context.scale(1/u,1/u),p.context.translate(-p.usedWidth,0)}return v={x:p.usedWidth,texture:p,level:a,scale:u,width:h,height:f,scaledLabelShown:c},p.usedWidth+=Math.ceil(h+Jm),p.eleCaches.push(v),l.set(t,a,v),i.checkTextureFullness(p),v};He.invalidateElements=function(t){for(var e=0;e=r0*t.width&&this.retireTexture(t)};He.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>a0&&t.fullnessChecks>=n0?_t(r,t):t.fullnessChecks++};He.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;_t(a,t),t.retired=!0;for(var i=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,pi(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),_t(n,s),a.push(s),s}};He.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,a.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(o),n[i]=o}};He.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],f=i.hasCache(u,o.level);if(a[l]=null,f)continue;n.push(o);var h=e.getBoundingBox(u);e.getElement(u,h,t,o.level,Sr.dequeue)}return n};He.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))};He.onDequeue=function(t){this.onDequeues.push(t)};He.offDequeue=function(t){_t(this.onDequeues,t)};He.setupDequeueing=Gf.setupDequeueing({deqRedrawThreshold:l0,deqCost:i0,deqAvgCost:s0,deqNoDrawCost:o0,deqFastCost:u0,deq:function(e,r,a){return e.dequeue(r,a)},onDeqd:function(e,r){for(var a=0;a=v0||r>dn)return null}a.validateLayersElesOrdering(r,t);var l=a.layersByLevel,u=Math.pow(2,r),f=l[r]=l[r]||[],h,c=a.levelIsComplete(r,t),v,d=function(){var L=function(P){if(a.validateLayersElesOrdering(P,t),a.levelIsComplete(P,t))return v=l[P],!0},A=function(P){if(!v)for(var R=r+P;oa<=R&&R<=dn&&!L(R);R+=P);};A(1),A(-1);for(var S=f.length-1;S>=0;S--){var M=f[S];M.invalid&&_t(f,M)}};if(!c)d();else return f;var g=function(){if(!h){h=ht();for(var L=0;Lw0)return null;var M=a.makeLayer(h,r);if(A!=null){var N=f.indexOf(A)+1;f.splice(N,0,M)}else(L.insert===void 0||L.insert)&&f.unshift(M);return M};if(a.skipping&&!o)return null;for(var y=null,b=t.length/c0,w=!o,D=0;D=b||!$l(y.bb,m.boundingBox()))&&(y=p({insert:!0,after:y}),!y))return null;v||w?a.queueLayer(y,m):a.drawEleInLayer(y,m,r,e),y.eles.push(m),E[r]=y}return v||(w?null:f)};je.getEleLevelForLayerLevel=function(t,e){return t};je.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,x0),i.setImgSmoothing(s,!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;i0||s.invalid)return!1;n+=s.eles.length}return n===e.length};je.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var a=0;a0){e=!0;break}}return e};je.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Rt(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(a,n,i){e.invalidateLayer(a)}))};je.invalidateLayer=function(t){if(this.lastInvalidationTime=Rt(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];_t(a,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var n=0;n3&&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,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,h=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,g=u*f,p=u*f,y=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g;h==="straight-triangle"?(s.eleStrokeStyle(t,e,S),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=v,t.lineCap=d,s.eleStrokeStyle(t,e,S),s.drawEdgePath(e,t,o.allpts,c),t.lineCap="butt")},b=function(){n&&s.drawEdgeOverlay(t,e)},w=function(){n&&s.drawEdgeUnderlay(t,e)},D=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;s.drawArrowheads(t,e,S)},m=function(){s.drawElementText(t,e,null,a)};t.lineJoin="round";var x=e.pstyle("ghost").value==="yes";if(x){var E=e.pstyle("ghost-offset-x").pfValue,C=e.pstyle("ghost-offset-y").pfValue,T=e.pstyle("ghost-opacity").value,L=g*T;t.translate(E,C),y(L),D(L),t.translate(-E,-C)}w(),y(),D(),b(),m(),r&&t.translate(l.x1,l.y1)}};var Vf=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,s=i.usePaths(),o=a._private.rscratch,l=a.pstyle("".concat(e,"-padding")).pfValue,u=2*l,f=a.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,f[0],f[1],f[2],n),i.drawEdgePath(a,r,o.allpts,"solid")}}}};Ft.drawEdgeOverlay=Vf("overlay");Ft.drawEdgeUnderlay=Vf("underlay");Ft.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(l){var h=r.join("$"),c=n.pathCacheKey&&n.pathCacheKey===h;c?(s=e=n.pathCache,o=!0):(s=e=new Path2D,n.pathCacheKey=h,n.pathCache=s)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!o&&!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 v=2;v+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,f=e.pstyle("label"),h=e.pstyle("source-label"),c=e.pstyle("target-label");if(u||(!f||!f.value)&&(!h||!h.value)&&(!c||!c.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,d;r&&(d=r,t.translate(-d.x1,-d.y1)),n==null?(s.drawText(t,e,null,v,i),e.isEdge()&&(s.drawText(t,e,"source",v,i),s.drawText(t,e,"target",v,i))):s.drawText(t,e,n,v,i),r&&t.translate(d.x1,d.y1)};cr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&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,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+s+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,f[0],f[1],f[2],l)};function Qn(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;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(),s?t.stroke():t.fill()}cr.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),o=Tt(n,"labelAngle",e);return s.strValue==="autorotate"?r=t.isEdge()?o:0:s.strValue==="none"?r=0:r=s.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,s=i.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Tt(s,"labelX",r),u=Tt(s,"labelY",r),f,h,c=this.getLabelText(e,r);if(c!=null&&c!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,n);var v=r?r+"-":"",d=Tt(s,"labelWidth",r),g=Tt(s,"labelHeight",r),p=e.pstyle(v+"text-margin-x").pfValue,y=e.pstyle(v+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,D=e.pstyle("text-valign").value;b&&(w="center",D="center"),l+=p,u+=y;var m;switch(a?m=this.getTextAngle(e,r):m=0,m!==0&&(f=l,h=u,t.translate(f,h),t.rotate(m),l=0,u=0),D){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var x=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,C=e.pstyle("text-border-width").pfValue,T=e.pstyle("text-background-padding").pfValue,L=e.pstyle("text-background-shape").strValue,A=L.indexOf("round")===0,S=2;if(x>0||C>0&&E>0){var M=l-T;switch(w){case"left":M-=d;break;case"center":M-=d/2;break}var N=u-g-T,P=d+2*T,R=g+2*T;if(x>0){var I=t.fillStyle,k=e.pstyle("text-background-color").value;t.fillStyle="rgba("+k[0]+","+k[1]+","+k[2]+","+x*o+")",A?Qn(t,M,N,P,R,S):t.fillRect(M,N,P,R),t.fillStyle=I}if(C>0&&E>0){var F=t.strokeStyle,z=t.lineWidth,B=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+E*o+")",t.lineWidth=C,t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=C/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(A?Qn(t,M,N,P,R,S,"stroke"):t.strokeRect(M,N,P,R),G==="double"){var $=C/2;A?Qn(t,M+$,N+$,P-$*2,R-$*2,S,"stroke"):t.strokeRect(M+$,N+$,P-$*2,R-$*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=z,t.strokeStyle=F}}var X=2*e.pstyle("text-outline-width").pfValue;if(X>0&&(t.lineWidth=X),e.pstyle("text-wrap").value==="wrap"){var Y=Tt(s,"labelWrapCachedLines",r),_=Tt(s,"labelLineHeight",r),q=d/2,K=this.getLabelJustification(e);switch(K==="auto"||(w==="left"?K==="left"?l+=-d:K==="center"&&(l+=-q):w==="center"?K==="left"?l+=-q:K==="right"&&(l+=q):w==="right"&&(K==="center"?l+=q:K==="right"&&(l+=d))),D){case"top":u-=(Y.length-1)*_;break;case"center":case"bottom":u-=(Y.length-1)*_;break}for(var j=0;j0&&t.strokeText(Y[j],l,u),t.fillText(Y[j],l,u),u+=_}else X>0&&t.strokeText(c,l,u),t.fillText(c,l,u);m!==0&&(t.rotate(-m),t.translate(-f,-h))}}};var qr={};qr.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,s=this,o,l,u=e._private,f=u.rscratch,h=e.position();if(!(!ae(h.x)||!ae(h.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,v=s.usePaths(),d,g=!1,p=e.padding();o=e.width()+2*p,l=e.height()+2*p;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),w=b.value,D=new Array(w.length),m=new Array(w.length),x=0,E=0;E0&&arguments[0]!==void 0?arguments[0]:M;s.eleFillStyle(t,e,U)},$=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R;s.colorStrokeStyle(t,N[0],N[1],N[2],U)},X=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;s.colorStrokeStyle(t,k[0],k[1],k[2],U)},Y=function(U,O,V,J){var H=s.nodePathCache=s.nodePathCache||[],W=Fl(V==="polygon"?V+","+J.join(","):V,""+O,""+U),ce=H[W],Z,ue=!1;return ce!=null?(Z=ce,ue=!0,f.pathCache=Z):(Z=new Path2D,H[W]=f.pathCache=Z),{path:Z,cacheHit:ue}},_=e.pstyle("shape").strValue,q=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(h.x,h.y);var K=Y(o,l,_,q);d=K.path,g=K.cacheHit}var j=function(){if(!g){var U=h;v&&(U={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(d||t,U.x,U.y,o,l)}v?t.fill(d):t.fill()},Q=function(){for(var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,V=u.backgrounding,J=0,H=0;H0&&arguments[0]!==void 0?arguments[0]:!1,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;s.hasPie(e)&&(s.drawPie(t,e,O),U&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,h.x,h.y,o,l)))},ie=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,O=(A>0?A:-A)*U,V=A>0?0:255;A!==0&&(s.colorFillStyle(t,V,V,V,O),v?t.fill(d):t.fill())},de=function(){if(S>0){if(t.lineWidth=S,t.lineCap="butt",t.setLineDash)switch(P){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}if(v?t.stroke(d):t.stroke(),P==="double"){t.lineWidth=S/3;var U=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(d):t.stroke(),t.globalCompositeOperation=U}t.setLineDash&&t.setLineDash([])}},te=function(){if(I>0){if(t.lineWidth=I,t.lineCap="butt",t.setLineDash)switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var U=h;v&&(U={x:0,y:0});var O=s.getNodeShape(e),V=(o+S+(I+B))/o,J=(l+S+(I+B))/l,H=o*V,W=l*J,ce=s.nodeShapes[O].points,Z;if(v){var ue=Y(H,W,O,ce);Z=ue.path}if(O==="ellipse")s.drawEllipsePath(Z||t,U.x,U.y,H,W);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(O)){var be=0,Le=0,ye=0;O==="round-diamond"?be=(S+B+I)*1.4:O==="round-heptagon"?(be=(S+B+I)*1.075,ye=-(S/2+B+I)/35):O==="round-hexagon"?be=(S+B+I)*1.12:O==="round-pentagon"?(be=(S+B+I)*1.13,ye=-(S/2+B+I)/15):O==="round-tag"?(be=(S+B+I)*1.12,Le=(S/2+I+B)*.07):O==="round-triangle"&&(be=(S+B+I)*(Math.PI/2),ye=-(S+B/2+I)/Math.PI),be!==0&&(V=(o+be)/o,J=(l+be)/l),s.drawRoundPolygonPath(Z||t,U.x+Le,U.y+ye,o*V,l*J,ce)}else if(["roundrectangle","round-rectangle"].includes(O))s.drawRoundRectanglePath(Z||t,U.x,U.y,H,W);else if(["cutrectangle","cut-rectangle"].includes(O))s.drawCutRectanglePath(Z||t,U.x,U.y,H,W);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(O))s.drawBottomRoundRectanglePath(Z||t,U.x,U.y,H,W);else if(O==="barrel")s.drawBarrelPath(Z||t,U.x,U.y,H,W);else if(O.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(O)){var Ce=(S+I+B)/o;ce=on(un(ce,Ce)),s.drawPolygonPath(Z||t,U.x,U.y,o,l,ce)}else{var me=(S+I+B)/o;ce=on(un(ce,-me)),s.drawPolygonPath(Z||t,U.x,U.y,o,l,ce)}if(v?t.stroke(Z):t.stroke(),F==="double"){t.lineWidth=S/3;var Ee=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(Z):t.stroke(),t.globalCompositeOperation=Ee}t.setLineDash&&t.setLineDash([])}},re=function(){n&&s.drawNodeOverlay(t,e,h,o,l)},fe=function(){n&&s.drawNodeUnderlay(t,e,h,o,l)},le=function(){s.drawElementText(t,e,null,a)},oe=e.pstyle("ghost").value==="yes";if(oe){var he=e.pstyle("ghost-offset-x").pfValue,Te=e.pstyle("ghost-offset-y").pfValue,we=e.pstyle("ghost-opacity").value,pe=we*c;t.translate(he,Te),X(),te(),G(we*M),j(),Q(pe,!0),$(we*R),de(),ee(A!==0||S!==0),Q(pe,!1),ie(pe),t.translate(-he,-Te)}v&&t.translate(-h.x,-h.y),fe(),v&&t.translate(h.x,h.y),X(),te(),G(),j(),Q(c,!0),$(),de(),ee(A!==0||S!==0),Q(c,!1),ie(),v&&t.translate(-h.x,-h.y),le(),re(),r&&t.translate(y.x1,y.y1)}};var Uf=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a,n,i,s){var o=this;if(a.visible()){var l=a.pstyle("".concat(e,"-padding")).pfValue,u=a.pstyle("".concat(e,"-opacity")).value,f=a.pstyle("".concat(e,"-color")).value,h=a.pstyle("".concat(e,"-shape")).value;if(u>0){if(n=n||a.position(),i==null||s==null){var c=a.padding();i=a.width()+2*c,s=a.height()+2*c}o.colorFillStyle(r,f[0],f[1],f[2],u),o.nodeShapes[h].draw(r,n.x,n.y,i+l*2,s+l*2),r.fill()}}}};qr.drawNodeOverlay=Uf("overlay");qr.drawNodeUnderlay=Uf("underlay");qr.hasPie=function(t){return t=t[0],t._private.hasPie};qr.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=a.x,o=a.y,l=e.width(),u=e.height(),f=Math.min(l,u)/2,h=0,c=this.usePaths();c&&(s=0,o=0),i.units==="%"?f=f*i.pfValue:i.pfValue!==void 0&&(f=i.pfValue/2);for(var v=1;v<=n.pieBackgroundN;v++){var d=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,p=e.pstyle("pie-"+v+"-background-opacity").value*r,y=d/100;y+h>1&&(y=1-h);var b=1.5*Math.PI+2*Math.PI*h,w=2*Math.PI*y,D=b+w;d===0||h>=1||h+y>1||(t.beginPath(),t.moveTo(s,o),t.arc(s,o,f,b,D),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],p),t.fill(),h+=y)}};var vt={},R0=100;vt.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};vt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,a,n=0;ns.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!h&&(f[s.NODE]=!0,f[s.SELECT_BOX]=!0);var b=l.style(),w=l.zoom(),D=n!==void 0?n:w,m=l.pan(),x={x:m.x,y:m.y},E={zoom:w,pan:{x:m.x,y:m.y}},C=s.prevViewport,T=C===void 0||E.zoom!==C.zoom||E.pan.x!==C.pan.x||E.pan.y!==C.pan.y;!T&&!(g&&!d)&&(s.motionBlurPxRatio=1),i&&(x=i),D*=o,x.x*=o,x.y*=o;var L=s.getCachedZSortedEles();function A(te,re,fe,le,oe){var he=te.globalCompositeOperation;te.globalCompositeOperation="destination-out",s.colorFillStyle(te,255,255,255,s.motionBlurTransparency),te.fillRect(re,fe,le,oe),te.globalCompositeOperation=he}function S(te,re){var fe,le,oe,he;!s.clearingMotionBlur&&(te===u.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||te===u.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(fe={x:m.x*v,y:m.y*v},le=w*v,oe=s.canvasWidth*v,he=s.canvasHeight*v):(fe=x,le=D,oe=s.canvasWidth,he=s.canvasHeight),te.setTransform(1,0,0,1,0,0),re==="motionBlur"?A(te,0,0,oe,he):!e&&(re===void 0||re)&&te.clearRect(0,0,oe,he),r||(te.translate(fe.x,fe.y),te.scale(le,le)),i&&te.translate(i.x,i.y),n&&te.scale(n,n)}if(h||(s.textureDrawLastFrame=!1),h){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=l.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var M=s.data.bufferContexts[s.TEXTURE_BUFFER];M.setTransform(1,0,0,1,0,0),M.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:M,drawOnlyNodeLayer:!0,forcedPxRatio:o*s.textureMult});var E=s.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:s.canvasWidth,height:s.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}f[s.DRAG]=!1,f[s.NODE]=!1;var N=u.contexts[s.NODE],P=s.textureCache.texture,E=s.textureCache.viewport;N.setTransform(1,0,0,1,0,0),c?A(N,0,0,E.width,E.height):N.clearRect(0,0,E.width,E.height);var R=b.core("outside-texture-bg-color").value,I=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(N,R[0],R[1],R[2],I),N.fillRect(0,0,E.width,E.height);var w=l.zoom();S(N,!1),N.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/o,E.height/E.zoom/o),N.drawImage(P,E.mpan.x,E.mpan.y,E.width/E.zoom/o,E.height/E.zoom/o)}else s.textureOnViewport&&!e&&(s.textureCache=null);var k=l.extent(),F=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),z=s.hideEdgesOnViewport&&F,B=[];if(B[s.NODE]=!f[s.NODE]&&c&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,B[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),B[s.DRAG]=!f[s.DRAG]&&c&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,B[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),f[s.NODE]||r||a||B[s.NODE]){var G=c&&!B[s.NODE]&&v!==1,N=e||(G?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:u.contexts[s.NODE]),$=c&&!G?"motionBlur":void 0;S(N,$),z?s.drawCachedNodes(N,L.nondrag,o,k):s.drawLayeredElements(N,L.nondrag,o,k),s.debug&&s.drawDebugPoints(N,L.nondrag),!r&&!c&&(f[s.NODE]=!1)}if(!a&&(f[s.DRAG]||r||B[s.DRAG])){var G=c&&!B[s.DRAG]&&v!==1,N=e||(G?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:u.contexts[s.DRAG]);S(N,c&&!G?"motionBlur":void 0),z?s.drawCachedNodes(N,L.drag,o,k):s.drawCachedElements(N,L.drag,o,k),s.debug&&s.drawDebugPoints(N,L.drag),!r&&!c&&(f[s.DRAG]=!1)}if(s.showFps||!a&&f[s.SELECT_BOX]&&!r){var N=e||u.contexts[s.SELECT_BOX];if(S(N),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var w=s.cy.zoom(),X=b.core("selection-box-border-width").value/w;N.lineWidth=X,N.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",N.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),X>0&&(N.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",N.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(u.bgActivePosistion&&!s.hoverData.selecting){var w=s.cy.zoom(),Y=u.bgActivePosistion;N.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",N.beginPath(),N.arc(Y.x,Y.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),N.fill()}var _=s.lastRedrawTime;if(s.showFps&&_){_=Math.round(_);var q=Math.round(1e3/_);N.setTransform(1,0,0,1,0,0),N.fillStyle="rgba(255, 0, 0, 0.75)",N.strokeStyle="rgba(255, 0, 0, 0.75)",N.lineWidth=1,N.fillText("1 frame = "+_+" ms = "+q+" fps",0,20);var K=60;N.strokeRect(0,30,250,20),N.fillRect(0,30,250*Math.min(q/K,1),20)}r||(f[s.SELECT_BOX]=!1)}if(c&&v!==1){var j=u.contexts[s.NODE],Q=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],ee=u.contexts[s.DRAG],ie=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],de=function(re,fe,le){re.setTransform(1,0,0,1,0,0),le||!y?re.clearRect(0,0,s.canvasWidth,s.canvasHeight):A(re,0,0,s.canvasWidth,s.canvasHeight);var oe=v;re.drawImage(fe,0,0,s.canvasWidth*oe,s.canvasHeight*oe,0,0,s.canvasWidth,s.canvasHeight)};(f[s.NODE]||B[s.NODE])&&(de(j,Q,B[s.NODE]),f[s.NODE]=!1),(f[s.DRAG]||B[s.DRAG])&&(de(ee,ie,B[s.DRAG]),f[s.DRAG]=!1)}s.prevViewport=E,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),c&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!h,s.mbFrames=0,f[s.NODE]=!0,f[s.DRAG]=!0,s.redraw()},R0)),e||l.emit("render")};var Jt={};Jt.drawPolygonPath=function(t,e,r,a,n,i){var s=a/2,o=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],r+o*i[1]);for(var l=1;l0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(t.full)v.translate(-a.x1*u,-a.y1*u),v.scale(u,u),this.drawElements(v,d),v.scale(1/u,1/u),v.translate(a.x1*u,a.y1*u);else{var g=e.pan(),p={x:g.x*u,y:g.y*u};u*=e.zoom(),v.translate(p.x,p.y),v.scale(u,u),this.drawElements(v,d),v.scale(1/u,1/u),v.translate(-p.x,-p.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,s),v.fill())}return c};function k0(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),i=0;i"u"?"undefined":Ye(OffscreenCanvas))!=="undefined"?r=new OffscreenCanvas(t,e):(r=document.createElement("canvas"),r.width=t,r.height=e),r};[qf,It,Ft,Oi,cr,qr,vt,Jt,La,$f].forEach(function(t){ge(Ae,t)});var F0=[{name:"null",impl:Nf},{name:"base",impl:Ff},{name:"canvas",impl:P0}],G0=[{type:"layout",extensions:Xm},{type:"renderer",extensions:F0}],_f={},Wf={};function Kf(t,e,r){var a=r,n=function(C){Ie("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(ya.prototype[e])return n(e);ya.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(C){this.options=C,r.call(this,C),Se(this._private)||(this._private={}),this._private.cy=C.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(r.prototype),o=[],l=0;l{(function(e,r){typeof Aa=="object"&&typeof Ni=="object"?Ni.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Aa=="object"?Aa.layoutBase=r():e.layoutBase=r()})(Aa,function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.i=function(a){return a},r.d=function(a,n,i){r.o(a,n)||Object.defineProperty(a,n,{configurable:!1,enumerable:!0,get:i})},r.n=function(a){var n=a&&a.__esModule?function(){return a.default}:function(){return a};return r.d(n,"a",n),n},r.o=function(a,n){return Object.prototype.hasOwnProperty.call(a,n)},r.p="",r(r.s=26)}([function(t,e,r){"use strict";function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,t.exports=a},function(t,e,r){"use strict";var a=r(2),n=r(8),i=r(9);function s(l,u,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=l,this.target=u}s.prototype=Object.create(a.prototype);for(var o in a)s[o]=a[o];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(l){if(this.source===l)return this.target;if(this.target===l)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(l,u){for(var f=this.getOtherEnd(l),h=u.getGraphManager().getRoot();;){if(f.getOwner()==u)return f;if(f.getOwner()==h)break;f=f.getOwner().getParent()}return null},s.prototype.updateLength=function(){var l=new Array(4);this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),l),this.isOverlapingSourceAndTarget||(this.lengthX=l[0]-l[2],this.lengthY=l[1]-l[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){"use strict";function a(n){this.vGraphObject=n}t.exports=a},function(t,e,r){"use strict";var a=r(2),n=r(10),i=r(13),s=r(0),o=r(16),l=r(4);function u(h,c,v,d){v==null&&d==null&&(d=c),a.call(this,d),h.graphManager!=null&&(h=h.graphManager),this.estimatedSize=n.MIN_VALUE,this.inclusionTreeDepth=n.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=h,v!=null&&c!=null?this.rect=new i(c.x,c.y,v.width,v.height):this.rect=new i}u.prototype=Object.create(a.prototype);for(var f in a)u[f]=a[f];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(h){this.rect.width=h},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(h){this.rect.height=h},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(h,c){this.rect.x=h.x,this.rect.y=h.y,this.rect.width=c.width,this.rect.height=c.height},u.prototype.setCenter=function(h,c){this.rect.x=h-this.rect.width/2,this.rect.y=c-this.rect.height/2},u.prototype.setLocation=function(h,c){this.rect.x=h,this.rect.y=c},u.prototype.moveBy=function(h,c){this.rect.x+=h,this.rect.y+=c},u.prototype.getEdgeListToNode=function(h){var c=[],v,d=this;return d.edges.forEach(function(g){if(g.target==h){if(g.source!=d)throw"Incorrect edge source!";c.push(g)}}),c},u.prototype.getEdgesBetween=function(h){var c=[],v,d=this;return d.edges.forEach(function(g){if(!(g.source==d||g.target==d))throw"Incorrect edge source and/or target";(g.target==h||g.source==h)&&c.push(g)}),c},u.prototype.getNeighborsList=function(){var h=new Set,c=this;return c.edges.forEach(function(v){if(v.source==c)h.add(v.target);else{if(v.target!=c)throw"Incorrect incidency!";h.add(v.source)}}),h},u.prototype.withChildren=function(){var h=new Set,c,v;if(h.add(this),this.child!=null)for(var d=this.child.getNodes(),g=0;gc&&(this.rect.x-=(this.labelWidth-c)/2,this.setWidth(this.labelWidth)),this.labelHeight>v&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-v)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-v),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(h){var c=this.rect.x;c>s.WORLD_BOUNDARY?c=s.WORLD_BOUNDARY:c<-s.WORLD_BOUNDARY&&(c=-s.WORLD_BOUNDARY);var v=this.rect.y;v>s.WORLD_BOUNDARY?v=s.WORLD_BOUNDARY:v<-s.WORLD_BOUNDARY&&(v=-s.WORLD_BOUNDARY);var d=new l(c,v),g=h.inverseTransformPoint(d);this.setLocation(g.x,g.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},t.exports=u},function(t,e,r){"use strict";function a(n,i){n==null&&i==null?(this.x=0,this.y=0):(this.x=n,this.y=i)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(n){this.x=n},a.prototype.setY=function(n){this.y=n},a.prototype.getDifference=function(n){return new DimensionD(this.x-n.x,this.y-n.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(n){return this.x+=n.width,this.y+=n.height,this},t.exports=a},function(t,e,r){"use strict";var a=r(2),n=r(10),i=r(0),s=r(6),o=r(3),l=r(1),u=r(13),f=r(12),h=r(11);function c(d,g,p){a.call(this,p),this.estimatedSize=n.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,g!=null&&g instanceof s?this.graphManager=g:g!=null&&g instanceof Layout&&(this.graphManager=g.graphManager)}c.prototype=Object.create(a.prototype);for(var v in a)c[v]=a[v];c.prototype.getNodes=function(){return this.nodes},c.prototype.getEdges=function(){return this.edges},c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getParent=function(){return this.parent},c.prototype.getLeft=function(){return this.left},c.prototype.getRight=function(){return this.right},c.prototype.getTop=function(){return this.top},c.prototype.getBottom=function(){return this.bottom},c.prototype.isConnected=function(){return this.isConnected},c.prototype.add=function(d,g,p){if(g==null&&p==null){var y=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(y)>-1)throw"Node already in graph!";return y.owner=this,this.getNodes().push(y),y}else{var b=d;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(p)>-1))throw"Source or target not in graph!";if(!(g.owner==p.owner&&g.owner==this))throw"Both owners must be this graph!";return g.owner!=p.owner?null:(b.source=g,b.target=p,b.isInterGraph=!1,this.getEdges().push(b),g.edges.push(b),p!=g&&p.edges.push(b),b)}},c.prototype.remove=function(d){var g=d;if(d instanceof o){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var p=g.edges.slice(),y,b=p.length,w=0;w-1&&x>-1))throw"Source and/or target doesn't know this edge!";y.source.edges.splice(m,1),y.target!=y.source&&y.target.edges.splice(x,1);var D=y.source.owner.getEdges().indexOf(y);if(D==-1)throw"Not in owner's edge list!";y.source.owner.getEdges().splice(D,1)}},c.prototype.updateLeftTop=function(){for(var d=n.MAX_VALUE,g=n.MAX_VALUE,p,y,b,w=this.getNodes(),D=w.length,m=0;mp&&(d=p),g>y&&(g=y)}return d==n.MAX_VALUE?null:(w[0].getParent().paddingLeft!=null?b=w[0].getParent().paddingLeft:b=this.margin,this.left=g-b,this.top=d-b,new f(this.left,this.top))},c.prototype.updateBounds=function(d){for(var g=n.MAX_VALUE,p=-n.MAX_VALUE,y=n.MAX_VALUE,b=-n.MAX_VALUE,w,D,m,x,E,C=this.nodes,T=C.length,L=0;Lw&&(g=w),pm&&(y=m),bw&&(g=w),pm&&(y=m),b=this.nodes.length){var T=0;p.forEach(function(L){L.owner==d&&T++}),T==this.nodes.length&&(this.isConnected=!0)}},t.exports=c},function(t,e,r){"use strict";var a,n=r(1);function i(s){a=r(5),this.layout=s,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var s=this.layout.newGraph(),o=this.layout.newNode(null),l=this.add(s,o);return this.setRootGraph(l),this.rootGraph},i.prototype.add=function(s,o,l,u,f){if(l==null&&u==null&&f==null){if(s==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return s.parent=o,o.child=s,s}else{f=l,u=o,l=s;var h=u.getOwner(),c=f.getOwner();if(!(h!=null&&h.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(c!=null&&c.getGraphManager()==this))throw"Target not in this graph mgr!";if(h==c)return l.isInterGraph=!1,h.add(l,u,f);if(l.isInterGraph=!0,l.source=u,l.target=f,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}},i.prototype.remove=function(s){if(s instanceof a){var o=s;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(o.getEdges());for(var u,f=l.length,h=0;h=s.getRight()?o[0]+=Math.min(s.getX()-i.getX(),i.getRight()-s.getRight()):s.getX()<=i.getX()&&s.getRight()>=i.getRight()&&(o[0]+=Math.min(i.getX()-s.getX(),s.getRight()-i.getRight())),i.getY()<=s.getY()&&i.getBottom()>=s.getBottom()?o[1]+=Math.min(s.getY()-i.getY(),i.getBottom()-s.getBottom()):s.getY()<=i.getY()&&s.getBottom()>=i.getBottom()&&(o[1]+=Math.min(i.getY()-s.getY(),s.getBottom()-i.getBottom()));var f=Math.abs((s.getCenterY()-i.getCenterY())/(s.getCenterX()-i.getCenterX()));s.getCenterY()===i.getCenterY()&&s.getCenterX()===i.getCenterX()&&(f=1);var h=f*o[0],c=o[1]/f;o[0]h)return o[0]=l,o[1]=v,o[2]=f,o[3]=C,!1;if(uf)return o[0]=c,o[1]=u,o[2]=x,o[3]=h,!1;if(lf?(o[0]=g,o[1]=p,S=!0):(o[0]=d,o[1]=v,S=!0):N===R&&(l>f?(o[0]=c,o[1]=v,S=!0):(o[0]=y,o[1]=p,S=!0)),-P===R?f>l?(o[2]=E,o[3]=C,M=!0):(o[2]=x,o[3]=m,M=!0):P===R&&(f>l?(o[2]=D,o[3]=m,M=!0):(o[2]=T,o[3]=C,M=!0)),S&&M)return!1;if(l>f?u>h?(I=this.getCardinalDirection(N,R,4),k=this.getCardinalDirection(P,R,2)):(I=this.getCardinalDirection(-N,R,3),k=this.getCardinalDirection(-P,R,1)):u>h?(I=this.getCardinalDirection(-N,R,1),k=this.getCardinalDirection(-P,R,3)):(I=this.getCardinalDirection(N,R,2),k=this.getCardinalDirection(P,R,4)),!S)switch(I){case 1:z=v,F=l+-w/R,o[0]=F,o[1]=z;break;case 2:F=y,z=u+b*R,o[0]=F,o[1]=z;break;case 3:z=p,F=l+w/R,o[0]=F,o[1]=z;break;case 4:F=g,z=u+-b*R,o[0]=F,o[1]=z;break}if(!M)switch(k){case 1:G=m,B=f+-A/R,o[2]=B,o[3]=G;break;case 2:B=T,G=h+L*R,o[2]=B,o[3]=G;break;case 3:G=C,B=f+A/R,o[2]=B,o[3]=G;break;case 4:B=E,G=h+-L*R,o[2]=B,o[3]=G;break}}return!1},n.getCardinalDirection=function(i,s,o){return i>s?o:1+o%4},n.getIntersection=function(i,s,o,l){if(l==null)return this.getIntersection2(i,s,o);var u=i.x,f=i.y,h=s.x,c=s.y,v=o.x,d=o.y,g=l.x,p=l.y,y=void 0,b=void 0,w=void 0,D=void 0,m=void 0,x=void 0,E=void 0,C=void 0,T=void 0;return w=c-f,m=u-h,E=h*f-u*c,D=p-d,x=v-g,C=g*d-v*p,T=w*x-D*m,T===0?null:(y=(m*C-x*E)/T,b=(D*E-w*C)/T,new a(y,b))},n.angleOfVector=function(i,s,o,l){var u=void 0;return i!==o?(u=Math.atan((l-s)/(o-i)),o0?1:n<0?-1:0},a.floor=function(n){return n<0?Math.ceil(n):Math.floor(n)},a.ceil=function(n){return n<0?Math.floor(n):Math.ceil(n)},t.exports=a},function(t,e,r){"use strict";function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,t.exports=a},function(t,e,r){"use strict";var a=function(){function u(f,h){for(var c=0;c"u"?"undefined":a(i);return i==null||s!="object"&&s!="function"},t.exports=n},function(t,e,r){"use strict";function a(v){if(Array.isArray(v)){for(var d=0,g=Array(v.length);d0&&d;){for(w.push(m[0]);w.length>0&&d;){var x=w[0];w.splice(0,1),b.add(x);for(var E=x.getEdges(),y=0;y-1&&m.splice(A,1)}b=new Set,D=new Map}}return v},c.prototype.createDummyNodesForBendpoints=function(v){for(var d=[],g=v.source,p=this.graphManager.calcLowestCommonAncestor(v.source,v.target),y=0;y0){for(var p=this.edgeToDummyNodes.get(g),y=0;y=0&&d.splice(C,1);var T=D.getNeighborsList();T.forEach(function(S){if(g.indexOf(S)<0){var M=p.get(S),N=M-1;N==1&&x.push(S),p.set(S,N)}})}g=g.concat(x),(d.length==1||d.length==2)&&(y=!0,b=d[0])}return b},c.prototype.setGraphManager=function(v){this.graphManager=v},t.exports=c},function(t,e,r){"use strict";function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},t.exports=a},function(t,e,r){"use strict";var a=r(4);function n(i,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX},n.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},n.prototype.getWorldOrgY=function(){return this.lworldOrgY},n.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},n.prototype.getWorldExtX=function(){return this.lworldExtX},n.prototype.setWorldExtX=function(i){this.lworldExtX=i},n.prototype.getWorldExtY=function(){return this.lworldExtY},n.prototype.setWorldExtY=function(i){this.lworldExtY=i},n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},n.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},n.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},n.prototype.getDeviceExtX=function(){return this.ldeviceExtX},n.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},n.prototype.getDeviceExtY=function(){return this.ldeviceExtY},n.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},n.prototype.transformX=function(i){var s=0,o=this.lworldExtX;return o!=0&&(s=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/o),s},n.prototype.transformY=function(i){var s=0,o=this.lworldExtY;return o!=0&&(s=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/o),s},n.prototype.inverseTransformX=function(i){var s=0,o=this.ldeviceExtX;return o!=0&&(s=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/o),s},n.prototype.inverseTransformY=function(i){var s=0,o=this.ldeviceExtY;return o!=0&&(s=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/o),s},n.prototype.inverseTransformPoint=function(i){var s=new a(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return s},t.exports=n},function(t,e,r){"use strict";function a(h){if(Array.isArray(h)){for(var c=0,v=Array(h.length);ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(h-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(h>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(h-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var h=this.getAllEdges(),c,v=0;v0&&arguments[0]!==void 0?arguments[0]:!0,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v,d,g,p,y=this.getAllNodes(),b;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&h&&this.updateGrid(),b=new Set,v=0;vw||b>w)&&(h.gravitationForceX=-this.gravityConstant*g,h.gravitationForceY=-this.gravityConstant*p)):(w=c.getEstimatedSize()*this.compoundGravityRangeFactor,(y>w||b>w)&&(h.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,h.gravitationForceY=-this.gravityConstant*p*this.compoundGravityConstant))},u.prototype.isConverged=function(){var h,c=!1;return this.totalIterations>this.maxIterations/3&&(c=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),h=this.totalDisplacement=y.length||w>=y[0].length)){for(var D=0;Du}}]),o}();t.exports=s},function(t,e,r){"use strict";var a=function(){function s(o,l){for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,h=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;n(this,s),this.sequence1=o,this.sequence2=l,this.match_score=u,this.mismatch_penalty=f,this.gap_penalty=h,this.iMax=o.length+1,this.jMax=l.length+1,this.grid=new Array(this.iMax);for(var c=0;c=0;o--){var l=this.listeners[o];l.event===i&&l.callback===s&&this.listeners.splice(o,1)}},n.emit=function(i,s){for(var o=0;o{(function(e,r){typeof Oa=="object"&&typeof Mi=="object"?Mi.exports=r(Ii()):typeof define=="function"&&define.amd?define(["layout-base"],r):typeof Oa=="object"?Oa.coseBase=r(Ii()):e.coseBase=r(e.layoutBase)})(Oa,function(t){return function(e){var r={};function a(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=r,a.i=function(n){return n},a.d=function(n,i,s){a.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:s})},a.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return a.d(i,"a",i),i},a.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},a.p="",a(a.s=7)}([function(e,r){e.exports=t},function(e,r,a){"use strict";var n=a(0).FDLayoutConstants;function i(){}for(var s in n)i[s]=n[s];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=n.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i},function(e,r,a){"use strict";var n=a(0).FDLayoutEdge;function i(o,l,u){n.call(this,o,l,u)}i.prototype=Object.create(n.prototype);for(var s in n)i[s]=n[s];e.exports=i},function(e,r,a){"use strict";var n=a(0).LGraph;function i(o,l,u){n.call(this,o,l,u)}i.prototype=Object.create(n.prototype);for(var s in n)i[s]=n[s];e.exports=i},function(e,r,a){"use strict";var n=a(0).LGraphManager;function i(o){n.call(this,o)}i.prototype=Object.create(n.prototype);for(var s in n)i[s]=n[s];e.exports=i},function(e,r,a){"use strict";var n=a(0).FDLayoutNode,i=a(0).IMath;function s(l,u,f,h){n.call(this,l,u,f,h)}s.prototype=Object.create(n.prototype);for(var o in n)s[o]=n[o];s.prototype.move=function(){var l=this.graphManager.getLayout();this.displacementX=l.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=l.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>l.coolingFactor*l.maxNodeDisplacement&&(this.displacementX=l.coolingFactor*l.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>l.coolingFactor*l.maxNodeDisplacement&&(this.displacementY=l.coolingFactor*l.maxNodeDisplacement*i.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),l.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},s.prototype.propogateDisplacementToChildren=function(l,u){for(var f=this.getChild().getNodes(),h,c=0;c0)this.positionNodesRadially(m);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(C){return x.has(C)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),x=this.nodesWithGravity.filter(function(T){return m.has(T)});this.graphManager.setAllNodesToApplyGravitation(x),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var E=!this.isTreeGrowing&&!this.isGrowthFinished,C=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(E,C),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var m=this.graphManager.getAllNodes(),x={},E=0;E1){var S;for(S=0;SC&&(C=Math.floor(A.y)),L=Math.floor(A.x+u.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(h.WORLD_CENTER_X-A.x/2,h.WORLD_CENTER_Y-A.y/2))},w.radialLayout=function(m,x,E){var C=Math.max(this.maxDiagonalInTree(m),u.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(x,null,0,359,0,C);var T=y.calculateBounds(m),L=new b;L.setDeviceOrgX(T.getMinX()),L.setDeviceOrgY(T.getMinY()),L.setWorldOrgX(E.x),L.setWorldOrgY(E.y);for(var A=0;A1;){var $=G[0];G.splice(0,1);var X=I.indexOf($);X>=0&&I.splice(X,1),z--,k--}x!=null?B=(I.indexOf(G[0])+1)%z:B=0;for(var Y=Math.abs(C-E)/k,_=B;F!=k;_=++_%z){var q=I[_].getOtherEnd(m);if(q!=x){var K=(E+F*Y)%360,j=(K+Y)%360;w.branchRadialLayout(q,m,K,j,T+L,L),F++}}},w.maxDiagonalInTree=function(m){for(var x=g.MIN_VALUE,E=0;Ex&&(x=T)}return x},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var m=this,x={};this.memberGroups={},this.idToDummyNode={};for(var E=[],C=this.graphManager.getAllNodes(),T=0;T"u"&&(x[S]=[]),x[S]=x[S].concat(L)}Object.keys(x).forEach(function(M){if(x[M].length>1){var N="DummyCompound_"+M;m.memberGroups[N]=x[M];var P=x[M][0].getParent(),R=new o(m.graphManager);R.id=N,R.paddingLeft=P.paddingLeft||0,R.paddingRight=P.paddingRight||0,R.paddingBottom=P.paddingBottom||0,R.paddingTop=P.paddingTop||0,m.idToDummyNode[N]=R;var I=m.getGraphManager().add(m.newGraph(),R),k=P.getChild();k.add(R);for(var F=0;F=0;m--){var x=this.compoundOrder[m],E=x.id,C=x.paddingLeft,T=x.paddingTop;this.adjustLocations(this.tiledMemberPack[E],x.rect.x,x.rect.y,C,T)}},w.prototype.repopulateZeroDegreeMembers=function(){var m=this,x=this.tiledZeroDegreePack;Object.keys(x).forEach(function(E){var C=m.idToDummyNode[E],T=C.paddingLeft,L=C.paddingTop;m.adjustLocations(x[E],C.rect.x,C.rect.y,T,L)})},w.prototype.getToBeTiled=function(m){var x=m.id;if(this.toBeTiled[x]!=null)return this.toBeTiled[x];var E=m.getChild();if(E==null)return this.toBeTiled[x]=!1,!1;for(var C=E.getNodes(),T=0;T0)return this.toBeTiled[x]=!1,!1;if(L.getChild()==null){this.toBeTiled[L.id]=!1;continue}if(!this.getToBeTiled(L))return this.toBeTiled[x]=!1,!1}return this.toBeTiled[x]=!0,!0},w.prototype.getNodeDegree=function(m){for(var x=m.id,E=m.getEdges(),C=0,T=0;TM&&(M=P.rect.height)}E+=M+m.verticalPadding}},w.prototype.tileCompoundMembers=function(m,x){var E=this;this.tiledMemberPack=[],Object.keys(m).forEach(function(C){var T=x[C];E.tiledMemberPack[C]=E.tileNodes(m[C],T.paddingLeft+T.paddingRight),T.rect.width=E.tiledMemberPack[C].width,T.rect.height=E.tiledMemberPack[C].height})},w.prototype.tileNodes=function(m,x){var E=u.TILING_PADDING_VERTICAL,C=u.TILING_PADDING_HORIZONTAL,T={rows:[],rowWidth:[],rowHeight:[],width:0,height:x,verticalPadding:E,horizontalPadding:C};m.sort(function(S,M){return S.rect.width*S.rect.height>M.rect.width*M.rect.height?-1:S.rect.width*S.rect.height0&&(A+=m.horizontalPadding),m.rowWidth[E]=A,m.width0&&(S+=m.verticalPadding);var M=0;S>m.rowHeight[E]&&(M=m.rowHeight[E],m.rowHeight[E]=S,M=m.rowHeight[E]-M),m.height+=M,m.rows[E].push(x)},w.prototype.getShortestRowIndex=function(m){for(var x=-1,E=Number.MAX_VALUE,C=0;CE&&(x=C,E=m.rowWidth[C]);return x},w.prototype.canAddHorizontal=function(m,x,E){var C=this.getShortestRowIndex(m);if(C<0)return!0;var T=m.rowWidth[C];if(T+m.horizontalPadding+x<=m.width)return!0;var L=0;m.rowHeight[C]0&&(L=E+m.verticalPadding-m.rowHeight[C]);var A;m.width-T>=x+m.horizontalPadding?A=(m.height+L)/(T+x+m.horizontalPadding):A=(m.height+L)/m.width,L=E+m.verticalPadding;var S;return m.widthL&&x!=E){C.splice(-1,1),m.rows[E].push(T),m.rowWidth[x]=m.rowWidth[x]-L,m.rowWidth[E]=m.rowWidth[E]+L,m.width=m.rowWidth[instance.getLongestRowIndex(m)];for(var A=Number.MIN_VALUE,S=0;SA&&(A=C[S].height);x>0&&(A+=m.verticalPadding);var M=m.rowHeight[x]+m.rowHeight[E];m.rowHeight[x]=A,m.rowHeight[E]0)for(var k=T;k<=L;k++)I[0]+=this.grid[k][A-1].length+this.grid[k][A].length-1;if(L0)for(var k=A;k<=S;k++)I[3]+=this.grid[T-1][k].length+this.grid[T][k].length-1;for(var F=g.MAX_VALUE,z,B,G=0;G{(function(e,r){typeof Na=="object"&&typeof ki=="object"?ki.exports=r(Ri()):typeof define=="function"&&define.amd?define(["cose-base"],r):typeof Na=="object"?Na.cytoscapeCoseBilkent=r(Ri()):e.cytoscapeCoseBilkent=r(e.coseBase)})(Na,function(t){return function(e){var r={};function a(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=r,a.i=function(n){return n},a.d=function(n,i,s){a.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:s})},a.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return a.d(i,"a",i),i},a.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},a.p="",a(a.s=1)}([function(e,r){e.exports=t},function(e,r,a){"use strict";var n=a(0).layoutBase.LayoutConstants,i=a(0).layoutBase.FDLayoutConstants,s=a(0).CoSEConstants,o=a(0).CoSELayout,l=a(0).CoSENode,u=a(0).layoutBase.PointD,f=a(0).layoutBase.DimensionD,h={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function c(p,y){var b={};for(var w in p)b[w]=p[w];for(var w in y)b[w]=y[w];return b}function v(p){this.options=c(h,p),d(this.options)}var d=function(y){y.nodeRepulsion!=null&&(s.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=y.nodeRepulsion),y.idealEdgeLength!=null&&(s.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=y.idealEdgeLength),y.edgeElasticity!=null&&(s.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=y.edgeElasticity),y.nestingFactor!=null&&(s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(s.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(s.MAX_ITERATIONS=i.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(s.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(s.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.quality=="draft"?n.QUALITY=0:y.quality=="proof"?n.QUALITY=2:n.QUALITY=1,s.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=n.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,s.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=n.DEFAULT_INCREMENTAL=!y.randomize,s.ANIMATE=i.ANIMATE=n.ANIMATE=y.animate,s.TILE=y.tile,s.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,s.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal};v.prototype.run=function(){var p,y,b=this.options,w=this.idToLNode={},D=this.layout=new o,m=this;m.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var x=D.newGraphManager();this.gm=x;var E=this.options.eles.nodes(),C=this.options.eles.edges();this.root=x.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(E),D);for(var T=0;T0){var S;S=b.getGraphManager().add(b.newGraph(),E),this.processChildrenList(S,x,b)}}},v.prototype.stop=function(){return this.stopped=!0,this};var g=function(y){y("layout","cose-bilkent",v)};typeof cytoscape<"u"&&g(cytoscape),e.exports=g}])})});var Bi=Yr(jf(),1),th=Yr(eh(),1);var Gb=Yr(dh(),1),zb=Yr(gh(),1),qb=Yr(ph(),1);var Pi=function(){var t=function(D,m,x,E){for(x=x||{},E=D.length;E--;x[D[E]]=m);return x},e=[1,4],r=[1,13],a=[1,12],n=[1,15],i=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],f=[1,24],h=[1,25],c=[6,7,11],v=[1,6,13,15,16,19,22],d=[1,33],g=[1,34],p=[1,6,7,11,13,15,16,19,22],y={trace:function(){},yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:function(m,x,E,C,T,L,A){var S=L.length-1;switch(T){case 6:case 7:return C;case 8:C.getLogger().trace("Stop NL ");break;case 9:C.getLogger().trace("Stop EOF ");break;case 11:C.getLogger().trace("Stop NL2 ");break;case 12:C.getLogger().trace("Stop EOF2 ");break;case 15:C.getLogger().info("Node: ",L[S].id),C.addNode(L[S-1].length,L[S].id,L[S].descr,L[S].type);break;case 16:C.getLogger().trace("Icon: ",L[S]),C.decorateNode({icon:L[S]});break;case 17:case 21:C.decorateNode({class:L[S]});break;case 18:C.getLogger().trace("SPACELIST");break;case 19:C.getLogger().trace("Node: ",L[S].id),C.addNode(0,L[S].id,L[S].descr,L[S].type);break;case 20:C.decorateNode({icon:L[S]});break;case 25:C.getLogger().trace("node found ..",L[S-2]),this.$={id:L[S-1],descr:L[S-1],type:C.getType(L[S-2],L[S])};break;case 26:this.$={id:L[S],descr:L[S],type:C.nodeType.DEFAULT};break;case 27:C.getLogger().trace("node found ..",L[S-3]),this.$={id:L[S-3],descr:L[S-1],type:C.getType(L[S-2],L[S])};break}},table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},{6:u,7:f,10:23,11:h},t(c,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(c,[2,18]),t(c,[2,19]),t(c,[2,20]),t(c,[2,21]),t(c,[2,23]),t(c,[2,24]),t(c,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:f,10:32,11:h},{1:[2,7],6:r,12:21,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},t(v,[2,14],{7:d,11:g}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(c,[2,15]),t(c,[2,16]),t(c,[2,17]),{20:[1,35]},{21:[1,36]},t(v,[2,13],{7:d,11:g}),t(p,[2,11]),t(p,[2,12]),{21:[1,37]},t(c,[2,25]),t(c,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:function(m,x){if(x.recoverable)this.trace(m);else{var E=new Error(m);throw E.hash=x,E}},parse:function(m){var x=this,E=[0],C=[],T=[null],L=[],A=this.table,S="",M=0,N=0,P=2,R=1,I=L.slice.call(arguments,1),k=Object.create(this.lexer),F={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(F.yy[z]=this.yy[z]);k.setInput(m,F.yy),F.yy.lexer=k,F.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var B=k.yylloc;L.push(B);var G=k.options&&k.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $(){var te;return te=C.pop()||k.lex()||R,typeof te!="number"&&(te instanceof Array&&(C=te,te=C.pop()),te=x.symbols_[te]||te),te}for(var X,Y,_,q,K={},j,Q,ee,ie;;){if(Y=E[E.length-1],this.defaultActions[Y]?_=this.defaultActions[Y]:((X===null||typeof X>"u")&&(X=$()),_=A[Y]&&A[Y][X]),typeof _>"u"||!_.length||!_[0]){var de="";ie=[];for(j in A[Y])this.terminals_[j]&&j>P&&ie.push("'"+this.terminals_[j]+"'");k.showPosition?de="Parse error on line "+(M+1)+`: `+k.showPosition()+` Expecting `+ie.join(", ")+", got '"+(this.terminals_[X]||X)+"'":de="Parse error on line "+(M+1)+": Unexpected "+(X==R?"end of input":"'"+(this.terminals_[X]||X)+"'"),this.parseError(de,{text:k.match,token:this.terminals_[X]||X,line:k.yylineno,loc:B,expected:ie})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Y+", token: "+X);switch(_[0]){case 1:E.push(X),T.push(k.yytext),L.push(k.yylloc),E.push(_[1]),X=null,N=k.yyleng,S=k.yytext,M=k.yylineno,B=k.yylloc;break;case 2:if(Q=this.productions_[_[1]][1],K.$=T[T.length-Q],K._$={first_line:L[L.length-(Q||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(Q||1)].first_column,last_column:L[L.length-1].last_column},G&&(K._$.range=[L[L.length-(Q||1)].range[0],L[L.length-1].range[1]]),q=this.performAction.apply(K,[S,N,M,F.yy,_[1],T,L].concat(I)),typeof q<"u")return q;Q&&(E=E.slice(0,-1*Q*2),T=T.slice(0,-1*Q),L=L.slice(0,-1*Q)),E.push(this.productions_[_[1]][0]),T.push(K.$),L.push(K._$),ee=A[E[E.length-2]][E[E.length-1]],E.push(ee);break;case 3:return!0}}return!0}},b=function(){var D={EOF:1,parseError:function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},setInput:function(m,x){return this.yy=x||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var x=m.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},unput:function(m){var x=m.length,E=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var T=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===C.length?this.yylloc.first_column:0)+C[C.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[T[0],T[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(m){this.unput(this.match.slice(m))},pastInput:function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var m=this.pastInput(),x=new Array(m.length+1).join("-");return m+this.upcomingInput()+` `+x+"^"},test_match:function(m,x){var E,C,T;if(this.options.backtrack_lexer&&(T={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(T.yylloc.range=this.yylloc.range.slice(0))),C=m[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(m[0].length),this.matched+=m[0],E=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var L in T)this[L]=T[L];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,x,E,C;this._more||(this.yytext="",this.match="");for(var T=this._currentRules(),L=0;Lx[0].length)){if(x=E,C=L,this.options.backtrack_lexer){if(m=this.test_match(E,T[L]),m!==!1)return m;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(m=this.test_match(x,T[C]),m!==!1?m:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var x=this.next();return x||this.lex()},begin:function(x){this.conditionStack.push(x)},popState:function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},pushState:function(x){this.begin(x)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(x,E,C,T){switch(C){case 0:return x.getLogger().trace("Found comment",E.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:x.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return x.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:x.getLogger().trace("end icon"),this.popState();break;case 10:return x.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return x.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return x.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return x.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:x.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return x.getLogger().trace("description:",E.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),x.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),x.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),x.getLogger().trace("node end ...",E.yytext),"NODE_DEND";case 30:return this.popState(),x.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),x.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),x.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),x.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),x.getLogger().trace("node end (("),"NODE_DEND";case 35:return x.getLogger().trace("Long description:",E.yytext),20;case 36:return x.getLogger().trace("Long description:",E.yytext),20}},rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return D}();y.lexer=b;function w(){this.yy={}}return w.prototype=y,y.Parser=w,new w}();Pi.parser=Pi;var U0=Pi,Dt=[],rh=0,Fi={},Y0=()=>{Dt=[],rh=0,Fi={}},H0=function(t){for(let e=Dt.length-1;e>=0;e--)if(Dt[e].levelDt.length>0?Dt[0]:null,X0=(t,e,r,a)=>{var n,i;zt.info("addNode",t,e,r,a);let s=ka(),o=((n=s.mindmap)==null?void 0:n.padding)??$r.mindmap.padding;switch(a){case $e.ROUNDED_RECT:case $e.RECT:case $e.HEXAGON:o*=2}let l={id:rh++,nodeId:Hr(e,s),level:t,descr:Hr(r,s),type:a,children:[],width:((i=s.mindmap)==null?void 0:i.maxNodeWidth)??$r.mindmap.maxNodeWidth,padding:o},u=H0(t);if(u)u.children.push(l),Dt.push(l);else if(Dt.length===0)Dt.push(l);else throw new Error('There can be only one root. No parent could be found for ("'+l.descr+'")')},$e={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},_0=(t,e)=>{switch(zt.debug("In get type",t,e),t){case"[":return $e.RECT;case"(":return e===")"?$e.ROUNDED_RECT:$e.CLOUD;case"((":return $e.CIRCLE;case")":return $e.CLOUD;case"))":return $e.BANG;case"{{":return $e.HEXAGON;default:return $e.DEFAULT}},W0=(t,e)=>{Fi[t]=e},K0=t=>{if(!t)return;let e=ka(),r=Dt[Dt.length-1];t.icon&&(r.icon=Hr(t.icon,e)),t.class&&(r.class=Hr(t.class,e))},Z0=t=>{switch(t){case $e.DEFAULT:return"no-border";case $e.RECT:return"rect";case $e.ROUNDED_RECT:return"rounded-rect";case $e.CIRCLE:return"circle";case $e.CLOUD:return"cloud";case $e.BANG:return"bang";case $e.HEXAGON:return"hexgon";default:return"no-border"}},Q0=()=>zt,J0=t=>Fi[t],j0={clear:Y0,addNode:X0,getMindmap:$0,nodeType:$e,getType:_0,setElementForId:W0,decorateNode:K0,type2Str:Z0,getLogger:Q0,getElementById:J0},e1=j0,t1=12,r1=function(t,e,r,a){e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 ${r.height-5} v${-r.height+2*5} q0,-5 5,-5 h${r.width-2*5} q5,0 5,5 v${r.height-5} H0 Z`),e.append("line").attr("class","node-line-"+a).attr("x1",0).attr("y1",r.height).attr("x2",r.width).attr("y2",r.height)},a1=function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("width",r.width)},n1=function(t,e,r){let a=r.width,n=r.height,i=.15*a,s=.25*a,o=.35*a,l=.2*a;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${i},${i} 0 0,1 ${a*.25},${-1*a*.1} a${o},${o} 1 0,1 ${a*.4},${-1*a*.1} a${s},${s} 1 0,1 ${a*.35},${1*a*.2} a${i},${i} 1 0,1 ${a*.15},${1*n*.35} a${l},${l} 1 0,1 ${-1*a*.15},${1*n*.65} a${s},${i} 1 0,1 ${-1*a*.25},${a*.15} a${o},${o} 1 0,1 ${-1*a*.5},0 a${i},${i} 1 0,1 ${-1*a*.25},${-1*a*.15} a${i},${i} 1 0,1 ${-1*a*.1},${-1*n*.35} a${l},${l} 1 0,1 ${a*.1},${-1*n*.65} H0 V0 Z`)},i1=function(t,e,r){let a=r.width,n=r.height,i=.15*a;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${i},${i} 1 0,0 ${a*.25},${-1*n*.1} a${i},${i} 1 0,0 ${a*.25},0 a${i},${i} 1 0,0 ${a*.25},0 a${i},${i} 1 0,0 ${a*.25},${1*n*.1} a${i},${i} 1 0,0 ${a*.15},${1*n*.33} a${i*.8},${i*.8} 1 0,0 0,${1*n*.34} a${i},${i} 1 0,0 ${-1*a*.15},${1*n*.33} a${i},${i} 1 0,0 ${-1*a*.25},${n*.15} a${i},${i} 1 0,0 ${-1*a*.25},0 a${i},${i} 1 0,0 ${-1*a*.25},0 a${i},${i} 1 0,0 ${-1*a*.25},${-1*n*.15} a${i},${i} 1 0,0 ${-1*a*.1},${-1*n*.33} a${i*.8},${i*.8} 1 0,0 0,${-1*n*.34} a${i},${i} 1 0,0 ${a*.1},${-1*n*.33} H0 V0 Z`)},s1=function(t,e,r){e.append("circle").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("r",r.width/2)};function o1(t,e,r,a,n){return t.insert("polygon",":first-child").attr("points",a.map(function(i){return i.x+","+i.y}).join(" ")).attr("transform","translate("+(n.width-e)/2+", "+r+")")}var u1=function(t,e,r){let a=r.height,i=a/4,s=r.width-r.padding+2*i,o=[{x:i,y:0},{x:s-i,y:0},{x:s,y:-a/2},{x:s-i,y:-a},{x:i,y:-a},{x:0,y:-a/2}];o1(e,s,a,o,r)},l1=function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("rx",r.padding).attr("ry",r.padding).attr("width",r.width)},f1=function(t,e,r,a,n){let i=n.htmlLabels,s=a%(t1-1),o=e.append("g");r.section=s;let l="section-"+s;s<0&&(l+=" section-root"),o.attr("class",(r.class?r.class+" ":"")+"mindmap-node "+l);let u=o.append("g"),f=o.append("g"),h=r.descr.replace(/()/g,` `);Xi(f,h,{useHtmlLabels:i,width:r.width,classes:"mindmap-node-label"}),i||f.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");let c=f.node().getBBox(),[v]=_i(n.fontSize);if(r.height=c.height+v*1.1*.5+r.padding,r.width=c.width+2*r.padding,r.icon)if(r.type===t.nodeType.CIRCLE)r.height+=50,r.width+=50,o.append("foreignObject").attr("height","50px").attr("width",r.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),f.attr("transform","translate("+r.width/2+", "+(r.height/2-1.5*r.padding)+")");else{r.width+=50;let d=r.height;r.height=Math.max(d,60);let g=Math.abs(r.height-d);o.append("foreignObject").attr("width","60px").attr("height",r.height).attr("style","text-align: center;margin-top:"+g/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),f.attr("transform","translate("+(25+r.width/2)+", "+(g/2+r.padding/2)+")")}else if(i){let d=(r.width-c.width)/2,g=(r.height-c.height)/2;f.attr("transform","translate("+d+", "+g+")")}else{let d=r.width/2,g=r.padding/2;f.attr("transform","translate("+d+", "+g+")")}switch(r.type){case t.nodeType.DEFAULT:r1(t,u,r,s);break;case t.nodeType.ROUNDED_RECT:l1(t,u,r);break;case t.nodeType.RECT:a1(t,u,r);break;case t.nodeType.CIRCLE:u.attr("transform","translate("+r.width/2+", "+ +r.height/2+")"),s1(t,u,r);break;case t.nodeType.CLOUD:n1(t,u,r);break;case t.nodeType.BANG:i1(t,u,r);break;case t.nodeType.HEXAGON:u1(t,u,r);break}return t.setElementForId(r.id,o),r.height},h1=function(t,e){let r=t.getElementById(e.id),a=e.x||0,n=e.y||0;r.attr("transform","translate("+a+","+n+")")};Bi.default.use(th.default);function ah(t,e,r,a,n){f1(t,e,r,a,n),r.children&&r.children.forEach((i,s)=>{ah(t,e,i,a<0?s:a,n)})}function c1(t,e){e.edges().map((r,a)=>{let n=r.data();if(r[0]._private.bodyBounds){let i=r[0]._private.rscratch;zt.trace("Edge: ",a,n),t.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+n.section+" edge-depth-"+n.depth)}})}function nh(t,e,r,a){e.add({group:"nodes",data:{id:t.id.toString(),labelText:t.descr,height:t.height,width:t.width,level:a,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach(n=>{nh(n,e,r,a+1),e.add({group:"edges",data:{id:`${t.id}_${n.id}`,source:t.id,target:n.id,depth:a,section:n.section}})})}function v1(t,e){return new Promise(r=>{let a=Ui("body").append("div").attr("id","cy").attr("style","display:none"),n=(0,Bi.default)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});a.remove(),nh(t,n,e,0),n.nodes().forEach(function(i){i.layoutDimensions=()=>{let s=i.data();return{w:s.width,h:s.height}}}),n.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),n.ready(i=>{zt.info("Ready",i),r(n)})})}function d1(t,e){e.nodes().map((r,a)=>{let n=r.data();n.x=r.position().x,n.y=r.position().y,h1(t,n);let i=t.getElementById(n.nodeId);zt.info("Id:",a,"Position: (",r.position().x,", ",r.position().y,")",n),i.attr("transform",`translate(${r.position().x-n.width/2}, ${r.position().y-n.height/2})`),i.attr("attr",`apa-${a})`)})}var g1=async(t,e,r,a)=>{var n,i;zt.debug(`Rendering mindmap diagram `+t);let s=a.db,o=s.getMindmap();if(!o)return;let l=ka();l.htmlLabels=!1;let u=Ki(e),f=u.append("g");f.attr("class","mindmap-edges");let h=u.append("g");h.attr("class","mindmap-nodes"),ah(s,h,o,-1,l);let c=await v1(o,l);c1(f,c),d1(s,c),Wi(void 0,u,((n=l.mindmap)==null?void 0:n.padding)??$r.mindmap.padding,((i=l.mindmap)==null?void 0:i.useMaxWidth)??$r.mindmap.useMaxWidth)},p1={draw:g1},y1=t=>{let e="";for(let r=0;r` .edge { stroke-width: 3; } ${y1(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } .section-root text { fill: ${t.gitBranchLabel0}; } .icon-container { height:100%; display: flex; justify-content: center; align-items: center; } .edge { fill: none; } .mindmap-node-label { dy: 1em; alignment-baseline: middle; text-anchor: middle; dominant-baseline: middle; text-align: center; } `,b1=m1,Vb={db:e1,renderer:p1,parser:U0,styles:b1};export{Vb as diagram}; /*! Bundled license information: cytoscape/dist/cytoscape.cjs.js: (*! 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) *) (*! 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 *) (*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *) (*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *) */ //# sourceMappingURL=mindmap-definition-f354de21-HIP27OGE.min.js.map