111 lines
469 KiB
JavaScript
111 lines
469 KiB
JavaScript
import{aK as vi,aL as ol,_ as de,n as wr,m as ul,Y as ll,P as fl,e as ci,I as hl,S as vl,D as en,k as tn,a3 as cl,a4 as dl,a5 as gl}from"./state.Bw4wwf0I.js";function qe(t){"@babel/helpers - typeof";return qe=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},qe(t)}function di(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pl(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function gi(t,e,r){return e&&pl(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function so(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lt(t,e){return yl(t)||ml(t,e)||oo(t,e)||bl()}function yl(t){if(Array.isArray(t))return t}function ml(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a=[],n=!0,s=!1,i,o;try{for(r=r.call(t);!(n=(i=r.next()).done)&&(a.push(i.value),!(e&&a.length===e));n=!0);}catch(u){s=!0,o=u}finally{try{!n&&r.return!=null&&r.return()}finally{if(s)throw o}}return a}}function oo(t,e){if(t){if(typeof t=="string")return Hi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hi(t,e)}}function Hi(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function bl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uo(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=oo(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,i=!1,o;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return s=u.done,u},e:function(u){i=!0,o=u},f:function(){try{!s&&r.return!=null&&r.return()}finally{if(i)throw o}}}}var _e=typeof window>"u"?null:window,Xi=_e?_e.navigator:null;_e&&_e.document;var El=qe(""),lo=qe({}),wl=qe(function(){}),xl=typeof HTMLElement>"u"?"undefined":qe(HTMLElement),Ta=function(e){return e&&e.instanceString&&ze(e.instanceString)?e.instanceString():null},ge=function(e){return e!=null&&qe(e)==El},ze=function(e){return e!=null&&qe(e)===wl},ke=function(e){return!yt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},De=function(e){return e!=null&&qe(e)===lo&&!ke(e)&&e.constructor===Object},Tl=function(e){return e!=null&&qe(e)===lo},se=function(e){return e!=null&&qe(e)===qe(1)&&!isNaN(e)},Cl=function(e){return se(e)&&Math.floor(e)===e},rn=function(e){if(xl!=="undefined")return e!=null&&e instanceof HTMLElement},yt=function(e){return Ca(e)||fo(e)},Ca=function(e){return Ta(e)==="collection"&&e._private.single},fo=function(e){return Ta(e)==="collection"&&!e._private.single},pi=function(e){return Ta(e)==="core"},ho=function(e){return Ta(e)==="stylesheet"},Dl=function(e){return Ta(e)==="event"},er=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Sl=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Ll=function(e){return De(e)&&se(e.x1)&&se(e.x2)&&se(e.y1)&&se(e.y2)},Al=function(e){return Tl(e)&&ze(e.then)},Ol=function(){return Xi&&Xi.userAgent.match(/msie|trident|edge/i)},va=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var s=[],i=0;i<arguments.length;i++)s.push(arguments[i]);return s.join("$")});var a=function n(){var s=this,i=arguments,o,u=r.apply(s,i),l=n.cache;return(o=l[u])||(o=l[u]=e.apply(s,i)),o};return a.cache={},a},yi=va(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),dn=va(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),vo=va(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),qi=function(e){return er(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Xe="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Nl="rgb[a]?\\(("+Xe+"[%]?)\\s*,\\s*("+Xe+"[%]?)\\s*,\\s*("+Xe+"[%]?)(?:\\s*,\\s*("+Xe+"))?\\)",Il="rgb[a]?\\((?:"+Xe+"[%]?)\\s*,\\s*(?:"+Xe+"[%]?)\\s*,\\s*(?:"+Xe+"[%]?)(?:\\s*,\\s*(?:"+Xe+"))?\\)",Ml="hsl[a]?\\(("+Xe+")\\s*,\\s*("+Xe+"[%])\\s*,\\s*("+Xe+"[%])(?:\\s*,\\s*("+Xe+"))?\\)",Rl="hsl[a]?\\((?:"+Xe+")\\s*,\\s*(?:"+Xe+"[%])\\s*,\\s*(?:"+Xe+"[%])(?:\\s*,\\s*(?:"+Xe+"))?\\)",kl="\\#[0-9a-fA-F]{3}",Pl="\\#[0-9a-fA-F]{6}",co=function(e,r){return e<r?-1:e>r?1:0},Bl=function(e,r){return-1*co(e,r)},Ee=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),s=0;s<n.length;s++){var i=n[s];t[i]=a[i]}}return t},Fl=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,s,i=16;return r?(a=parseInt(e[1]+e[1],i),n=parseInt(e[2]+e[2],i),s=parseInt(e[3]+e[3],i)):(a=parseInt(e[1]+e[2],i),n=parseInt(e[3]+e[4],i),s=parseInt(e[5]+e[6],i)),[a,n,s]}},Gl=function(e){var r,a,n,s,i,o,u,l;function f(c,p,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?c+(p-c)*6*g:g<1/2?p:g<2/3?c+(p-c)*(2/3-g)*6:c}var h=new RegExp("^"+Ml+"$").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,s=parseFloat(h[3]),s<0||s>100)||(s=s/100,i=h[4],i!==void 0&&(i=parseFloat(i),i<0||i>1)))return;if(n===0)o=u=l=Math.round(s*255);else{var d=s<.5?s*(1+n):s+n-s*n,v=2*s-d;o=Math.round(255*f(v,d,a+1/3)),u=Math.round(255*f(v,d,a)),l=Math.round(255*f(v,d,a-1/3))}r=[o,u,l,i]}return r},zl=function(e){var r,a=new RegExp("^"+Nl+"$").exec(e);if(a){r=[];for(var n=[],s=1;s<=3;s++){var i=a[s];if(i[i.length-1]==="%"&&(n[s]=!0),i=parseFloat(i),n[s]&&(i=i/100*255),i<0||i>255)return;r.push(Math.floor(i))}var o=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(o&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;r.push(l)}}return r},Vl=function(e){return $l[e.toLowerCase()]},Ul=function(e){return(ke(e)?e:null)||Vl(e)||Fl(e)||zl(e)||Gl(e)},$l={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]},go=function(e){for(var r=e.map,a=e.keys,n=a.length,s=0;s<n;s++){var i=a[s];if(De(i))throw Error("Tried to set map with object key");s<a.length-1?(r[i]==null&&(r[i]={}),r=r[i]):r[i]=e.value}},po=function(e){for(var r=e.map,a=e.keys,n=a.length,s=0;s<n;s++){var i=a[s];if(De(i))throw Error("Tried to get map with object key");if(r=r[i],r==null)return r}return r};function Yl(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var dr=Yl,ia=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _l(t,e){return e={exports:{}},t(e,e.exports),e.exports}var Hl=typeof ia=="object"&&ia&&ia.Object===Object&&ia,Xl=Hl,ql=typeof self=="object"&&self&&self.Object===Object&&self,Wl=Xl||ql||Function("return this")(),gn=Wl,Kl=function(){return gn.Date.now()},kn=Kl,Zl=/\s/;function Ql(t){for(var e=t.length;e--&&Zl.test(t.charAt(e)););return e}var Jl=Ql,jl=/^\s+/;function ef(t){return t&&t.slice(0,Jl(t)+1).replace(jl,"")}var tf=ef,rf=gn.Symbol,Gr=rf,yo=Object.prototype,af=yo.hasOwnProperty,nf=yo.toString,ea=Gr?Gr.toStringTag:void 0;function sf(t){var e=af.call(t,ea),r=t[ea];try{t[ea]=void 0;var a=!0}catch{}var n=nf.call(t);return a&&(e?t[ea]=r:delete t[ea]),n}var of=sf,uf=Object.prototype,lf=uf.toString;function ff(t){return lf.call(t)}var hf=ff,vf="[object Null]",cf="[object Undefined]",Wi=Gr?Gr.toStringTag:void 0;function df(t){return t==null?t===void 0?cf:vf:Wi&&Wi in Object(t)?of(t):hf(t)}var mo=df;function gf(t){return t!=null&&typeof t=="object"}var pf=gf,yf="[object Symbol]";function mf(t){return typeof t=="symbol"||pf(t)&&mo(t)==yf}var Da=mf,Ki=NaN,bf=/^[-+]0x[0-9a-f]+$/i,Ef=/^0b[01]+$/i,wf=/^0o[0-7]+$/i,xf=parseInt;function Tf(t){if(typeof t=="number")return t;if(Da(t))return Ki;if(dr(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=dr(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=tf(t);var r=Ef.test(t);return r||wf.test(t)?xf(t.slice(2),r?2:8):bf.test(t)?Ki:+t}var Zi=Tf,Cf="Expected a function",Df=Math.max,Sf=Math.min;function Lf(t,e,r){var a,n,s,i,o,u,l=0,f=!1,h=!1,d=!0;if(typeof t!="function")throw new TypeError(Cf);e=Zi(e)||0,dr(r)&&(f=!!r.leading,h="maxWait"in r,s=h?Df(Zi(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d);function v(S){var E=a,x=n;return a=n=void 0,l=S,i=t.apply(x,E),i}function c(S){return l=S,o=setTimeout(y,e),f?v(S):i}function p(S){var E=S-u,x=S-l,w=e-E;return h?Sf(w,s-x):w}function g(S){var E=S-u,x=S-l;return u===void 0||E>=e||E<0||h&&x>=s}function y(){var S=kn();if(g(S))return b(S);o=setTimeout(y,p(S))}function b(S){return o=void 0,d&&a?v(S):(a=n=void 0,i)}function m(){o!==void 0&&clearTimeout(o),l=0,a=u=n=o=void 0}function T(){return o===void 0?i:b(kn())}function C(){var S=kn(),E=g(S);if(a=arguments,n=this,u=S,E){if(o===void 0)return c(u);if(h)return clearTimeout(o),o=setTimeout(y,e),v(u)}return o===void 0&&(o=setTimeout(y,e)),i}return C.cancel=m,C.flush=T,C}var pn=Lf,Pn=_e?_e.performance:null,bo=Pn&&Pn.now?function(){return Pn.now()}:function(){return Date.now()},Af=function(){if(_e){if(_e.requestAnimationFrame)return function(t){_e.requestAnimationFrame(t)};if(_e.mozRequestAnimationFrame)return function(t){_e.mozRequestAnimationFrame(t)};if(_e.webkitRequestAnimationFrame)return function(t){_e.webkitRequestAnimationFrame(t)};if(_e.msRequestAnimationFrame)return function(t){_e.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(bo())},1e3/60)}}(),an=function(e){return Af(e)},Yt=bo,Ir=9261,Eo=65599,sa=5381,wo=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ir,a=r,n;n=e.next(),!n.done;)a=a*Eo+n.value|0;return a},ca=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ir;return r*Eo+e|0},da=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sa;return(r<<5)+r+e|0},Of=function(e,r){return e*2097152+r},Wt=function(e){return e[0]*2097152+e[1]},Ra=function(e,r){return[ca(e[0],r[0]),da(e[1],r[1])]},Nf=function(e,r){var a={value:0,done:!1},n=0,s=e.length,i={next:function(){return n<s?a.value=e[n++]:a.done=!0,a}};return wo(i,r)},gr=function(e,r){var a={value:0,done:!1},n=0,s=e.length,i={next:function(){return n<s?a.value=e.charCodeAt(n++):a.done=!0,a}};return wo(i,r)},xo=function(){return If(arguments)},If=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=gr(n):r=gr(n,r)}return r},Qi=!0,Mf=console.warn!=null,Rf=console.trace!=null,mi=Number.MAX_SAFE_INTEGER||9007199254740991,To=function(){return!0},nn=function(){return!1},Ji=function(){return 0},bi=function(){},Ve=function(e){throw new Error(e)},Co=function(e){if(e!==void 0)Qi=!!e;else return Qi},Ie=function(e){Co()&&(Mf?console.warn(e):(console.log(e),Rf&&console.trace()))},kf=function(e){return Ee({},e)},Bt=function(e){return e==null?e:ke(e)?e.slice():De(e)?kf(e):e},Pf=function(e){return e.slice()},Do=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},Bf={},So=function(){return Bf},rt=function(e){var r=Object.keys(e);return function(a){for(var n={},s=0;s<r.length;s++){var i=r[s],o=a==null?void 0:a[i];n[i]=o===void 0?e[i]:o}return n}},tr=function(e,r,a){for(var n=e.length-1;n>=0;n--)e[n]===r&&e.splice(n,1)},Ei=function(e){e.splice(0,e.length)},Ff=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},Ot=function(e,r,a){return a&&(r=vo(a,r)),e[r]},Zt=function(e,r,a,n){a&&(r=vo(a,r)),e[r]=n},Gf=function(){function t(){di(this,t),this._obj={}}return gi(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t}(),Ft=typeof Map<"u"?Map:Gf,zf="undefined",Vf=function(){function t(e){if(di(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return gi(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;a[r]!==1&&(a[r]=1,this.size++)}},{key:"delete",value:function(r){var a=this._obj;a[r]===1&&(a[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}]),t}(),$r=(typeof Set>"u"?"undefined":qe(Set))!==zf?Set:Vf,yn=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!pi(e)){Ve("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){Ve("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var s=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 $r,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(s.position.x==null&&(s.position.x=0),s.position.y==null&&(s.position.y=0),r.renderedPosition){var i=r.renderedPosition,o=e.pan(),u=e.zoom();s.position={x:(i.x-o.x)/u,y:(i.y-o.y)/u}}var l=[];ke(r.classes)?l=r.classes:ge(r.classes)&&(l=r.classes.split(/\s+/));for(var f=0,h=l.length;f<h;f++){var d=l[f];!d||d===""||s.classes.add(d)}this.createEmitter();var v=r.style||r.css;v&&(Ie("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(a===void 0||a)&&this.restore()},ji=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,s){var i;De(a)&&!yt(a)&&(i=a,a=i.roots||i.root,n=i.visit,s=i.directed),s=arguments.length===2&&!ze(n)?n:s,n=ze(n)?n:function(){};for(var o=this._private.cy,u=a=ge(a)?this.filter(a):a,l=[],f=[],h={},d={},v={},c=0,p,g=this.byGroup(),y=g.nodes,b=g.edges,m=0;m<u.length;m++){var T=u[m],C=T.id();T.isNode()&&(l.unshift(T),e.bfs&&(v[C]=!0,f.push(T)),d[C]=0)}for(var S=function(){var N=e.bfs?l.shift():l.pop(),O=N.id();if(e.dfs){if(v[O])return"continue";v[O]=!0,f.push(N)}var M=d[O],R=h[O],k=R!=null?R.source():null,P=R!=null?R.target():null,B=R==null?void 0:N.same(k)?P[0]:k[0],z=void 0;if(z=n(N,R,B,c++,M),z===!0)return p=N,"break";if(z===!1)return"break";for(var G=N.connectedEdges().filter(function(Q){return(!s||Q.source().same(N))&&b.has(Q)}),F=0;F<G.length;F++){var U=G[F],H=U.connectedNodes().filter(function(Q){return!Q.same(N)&&y.has(Q)}),Y=H.id();H.length!==0&&!v[Y]&&(H=H[0],l.push(H),e.bfs&&(v[Y]=!0,f.push(H)),h[Y]=U,d[Y]=d[O]+1)}};l.length!==0;){var E=S();if(E!=="continue"&&E==="break")break}for(var x=o.collection(),w=0;w<f.length;w++){var D=f[w],L=h[D.id()];L!=null&&x.push(L),x.push(D)}return{path:o.collection(x),found:o.collection(p)}}},ga={breadthFirstSearch:ji({bfs:!0}),depthFirstSearch:ji({dfs:!0})};ga.bfs=ga.breadthFirstSearch;ga.dfs=ga.depthFirstSearch;var Uf=_l(function(t,e){(function(){var r,a,n,s,i,o,u,l,f,h,d,v,c,p,g;n=Math.floor,h=Math.min,a=function(y,b){return y<b?-1:y>b?1:0},f=function(y,b,m,T,C){var S;if(m==null&&(m=0),C==null&&(C=a),m<0)throw new Error("lo must be non-negative");for(T==null&&(T=y.length);m<T;)S=n((m+T)/2),C(b,y[S])<0?T=S:m=S+1;return[].splice.apply(y,[m,m-m].concat(b)),b},o=function(y,b,m){return m==null&&(m=a),y.push(b),p(y,0,y.length-1,m)},i=function(y,b){var m,T;return b==null&&(b=a),m=y.pop(),y.length?(T=y[0],y[0]=m,g(y,0,b)):T=m,T},l=function(y,b,m){var T;return m==null&&(m=a),T=y[0],y[0]=b,g(y,0,m),T},u=function(y,b,m){var T;return m==null&&(m=a),y.length&&m(y[0],b)<0&&(T=[y[0],b],b=T[0],y[0]=T[1],g(y,0,m)),b},s=function(y,b){var m,T,C,S,E,x;for(b==null&&(b=a),S=(function(){x=[];for(var w=0,D=n(y.length/2);0<=D?w<D:w>D;0<=D?w++:w--)x.push(w);return x}).apply(this).reverse(),E=[],T=0,C=S.length;T<C;T++)m=S[T],E.push(g(y,m,b));return E},c=function(y,b,m){var T;if(m==null&&(m=a),T=y.indexOf(b),T!==-1)return p(y,0,T,m),g(y,T,m)},d=function(y,b,m){var T,C,S,E,x;if(m==null&&(m=a),C=y.slice(0,b),!C.length)return C;for(s(C,m),x=y.slice(b),S=0,E=x.length;S<E;S++)T=x[S],u(C,T,m);return C.sort(m).reverse()},v=function(y,b,m){var T,C,S,E,x,w,D,L,A;if(m==null&&(m=a),b*10<=y.length){if(S=y.slice(0,b).sort(m),!S.length)return S;for(C=S[S.length-1],D=y.slice(b),E=0,w=D.length;E<w;E++)T=D[E],m(T,C)<0&&(f(S,T,0,null,m),S.pop(),C=S[S.length-1]);return S}for(s(y,m),A=[],x=0,L=h(b,y.length);0<=L?x<L:x>L;0<=L?++x:--x)A.push(i(y,m));return A},p=function(y,b,m,T){var C,S,E;for(T==null&&(T=a),C=y[m];m>b;){if(E=m-1>>1,S=y[E],T(C,S)<0){y[m]=S,m=E;continue}break}return y[m]=C},g=function(y,b,m){var T,C,S,E,x;for(m==null&&(m=a),C=y.length,x=b,S=y[b],T=2*b+1;T<C;)E=T+1,E<C&&!(m(y[T],y[E])<0)&&(T=E),y[b]=y[T],b=T,T=2*b+1;return y[b]=S,p(y,x,b,m)},r=function(){y.push=o,y.pop=i,y.replace=l,y.pushpop=u,y.heapify=s,y.updateItem=c,y.nlargest=d,y.nsmallest=v;function y(b){this.cmp=b??a,this.nodes=[]}return y.prototype.push=function(b){return o(this.nodes,b,this.cmp)},y.prototype.pop=function(){return i(this.nodes,this.cmp)},y.prototype.peek=function(){return this.nodes[0]},y.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},y.prototype.replace=function(b){return l(this.nodes,b,this.cmp)},y.prototype.pushpop=function(b){return u(this.nodes,b,this.cmp)},y.prototype.heapify=function(){return s(this.nodes,this.cmp)},y.prototype.updateItem=function(b){return c(this.nodes,b,this.cmp)},y.prototype.clear=function(){return this.nodes=[]},y.prototype.empty=function(){return this.nodes.length===0},y.prototype.size=function(){return this.nodes.length},y.prototype.clone=function(){var b;return b=new y,b.nodes=this.nodes.slice(0),b},y.prototype.toArray=function(){return this.nodes.slice(0)},y.prototype.insert=y.prototype.push,y.prototype.top=y.prototype.peek,y.prototype.front=y.prototype.peek,y.prototype.has=y.prototype.contains,y.prototype.copy=y.prototype.clone,y}(),function(y,b){return t.exports=b()}(this,function(){return r})}).call(ia)}),Sa=Uf,$f=rt({root:null,weight:function(e){return 1},directed:!1}),Yf={dijkstra:function(e){if(!De(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=$f(e),n=a.root,s=a.weight,i=a.directed,o=this,u=s,l=ge(n)?this.filter(n)[0]:n[0],f={},h={},d={},v=this.byGroup(),c=v.nodes,p=v.edges;p.unmergeBy(function(M){return M.isLoop()});for(var g=function(R){return f[R.id()]},y=function(R,k){f[R.id()]=k,b.updateItem(R)},b=new Sa(function(M,R){return g(M)-g(R)}),m=0;m<c.length;m++){var T=c[m];f[T.id()]=T.same(l)?0:1/0,b.push(T)}for(var C=function(R,k){for(var P=(i?R.edgesTo(k):R.edgesWith(k)).intersect(p),B=1/0,z,G=0;G<P.length;G++){var F=P[G],U=u(F);(U<B||!z)&&(B=U,z=F)}return{edge:z,dist:B}};b.size()>0;){var S=b.pop(),E=g(S),x=S.id();if(d[x]=E,E!==1/0)for(var w=S.neighborhood().intersect(c),D=0;D<w.length;D++){var L=w[D],A=L.id(),N=C(S,L),O=E+N.dist;O<g(L)&&(y(L,O),h[A]={node:S,edge:N.edge})}}return{distanceTo:function(R){var k=ge(R)?c.filter(R)[0]:R[0];return d[k.id()]},pathTo:function(R){var k=ge(R)?c.filter(R)[0]:R[0],P=[],B=k,z=B.id();if(k.length>0)for(P.unshift(k);h[z];){var G=h[z];P.unshift(G.edge),P.unshift(G.node),B=G.node,z=B.id()}return o.spawn(P)}}}},_f={kruskal:function(e){e=e||function(m){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,s=a.length,i=new Array(s),o=a,u=function(T){for(var C=0;C<i.length;C++){var S=i[C];if(S.has(T))return C}},l=0;l<s;l++)i[l]=this.spawn(a[l]);for(var f=n.sort(function(m,T){return e(m)-e(T)}),h=0;h<f.length;h++){var d=f[h],v=d.source()[0],c=d.target()[0],p=u(v),g=u(c),y=i[p],b=i[g];p!==g&&(o.merge(d),y.merge(b),i.splice(g,1))}return o}},Hf=rt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Xf={aStar:function(e){var r=this.cy(),a=Hf(e),n=a.root,s=a.goal,i=a.heuristic,o=a.directed,u=a.weight;n=r.collection(n)[0],s=r.collection(s)[0];var l=n.id(),f=s.id(),h={},d={},v={},c=new Sa(function(z,G){return d[z.id()]-d[G.id()]}),p=new $r,g={},y={},b=function(G,F){c.push(G),p.add(F)},m,T,C=function(){m=c.pop(),T=m.id(),p.delete(T)},S=function(G){return p.has(G)};b(n,l),h[l]=0,d[l]=i(n);for(var E=0;c.size()>0;){if(C(),E++,T===f){for(var x=[],w=s,D=f,L=y[D];x.unshift(w),L!=null&&x.unshift(L),w=g[D],w!=null;)D=w.id(),L=y[D];return{found:!0,distance:h[T],path:this.spawn(x),steps:E}}v[T]=!0;for(var A=m._private.edges,N=0;N<A.length;N++){var O=A[N];if(this.hasElementWithId(O.id())&&!(o&&O.data("source")!==T)){var M=O.source(),R=O.target(),k=M.id()!==T?M:R,P=k.id();if(this.hasElementWithId(P)&&!v[P]){var B=h[T]+u(O);if(!S(P)){h[P]=B,d[P]=B+i(k),b(k,P),g[P]=m,y[P]=O;continue}B<h[P]&&(h[P]=B,d[P]=B+i(k),g[P]=m,y[P]=O)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},qf=rt({weight:function(e){return 1},directed:!1}),Wf={floydWarshall:function(e){for(var r=this.cy(),a=qf(e),n=a.weight,s=a.directed,i=n,o=this.byGroup(),u=o.nodes,l=o.edges,f=u.length,h=f*f,d=function(U){return u.indexOf(U)},v=function(U){return u[U]},c=new Array(h),p=0;p<h;p++){var g=p%f,y=(p-g)/f;y===g?c[p]=0:c[p]=1/0}for(var b=new Array(h),m=new Array(h),T=0;T<l.length;T++){var C=l[T],S=C.source()[0],E=C.target()[0];if(S!==E){var x=d(S),w=d(E),D=x*f+w,L=i(C);if(c[D]>L&&(c[D]=L,b[D]=w,m[D]=C),!s){var A=w*f+x;!s&&c[A]>L&&(c[A]=L,b[A]=x,m[A]=C)}}}for(var N=0;N<f;N++)for(var O=0;O<f;O++)for(var M=O*f+N,R=0;R<f;R++){var k=O*f+R,P=N*f+R;c[M]+c[P]<c[k]&&(c[k]=c[M]+c[P],b[k]=b[M])}var B=function(U){return(ge(U)?r.filter(U):U)[0]},z=function(U){return d(B(U))},G={distance:function(U,H){var Y=z(U),Q=z(H);return c[Y*f+Q]},path:function(U,H){var Y=z(U),Q=z(H),J=v(Y);if(Y===Q)return J.collection();if(b[Y*f+Q]==null)return r.collection();var q=r.collection(),V=Y,Z;for(q.merge(J);Y!==Q;)V=Y,Y=b[Y*f+Q],Z=m[V*f+Y],q.merge(Z),q.merge(v(Y));return q}};return G}},Kf=rt({weight:function(e){return 1},directed:!1,root:null}),Zf={bellmanFord:function(e){var r=this,a=Kf(e),n=a.weight,s=a.directed,i=a.root,o=n,u=this,l=this.cy(),f=this.byGroup(),h=f.edges,d=f.nodes,v=d.length,c=new Ft,p=!1,g=[];i=l.collection(i)[0],h.unmergeBy(function(ce){return ce.isLoop()});for(var y=h.length,b=function(fe){var ye=c.get(fe.id());return ye||(ye={},c.set(fe.id(),ye)),ye},m=function(fe){return(ge(fe)?l.$(fe):fe)[0]},T=function(fe){return b(m(fe)).dist},C=function(fe){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i,Oe=m(fe),Te=[],xe=Oe;;){if(xe==null)return r.spawn();var Se=b(xe),ee=Se.edge,I=Se.pred;if(Te.unshift(xe[0]),xe.same(ye)&&Te.length>0)break;ee!=null&&Te.unshift(ee),xe=I}return u.spawn(Te)},S=0;S<v;S++){var E=d[S],x=b(E);E.same(i)?x.dist=0:x.dist=1/0,x.pred=null,x.edge=null}for(var w=!1,D=function(fe,ye,Oe,Te,xe,Se){var ee=Te.dist+Se;ee<xe.dist&&!Oe.same(Te.edge)&&(xe.dist=ee,xe.pred=fe,xe.edge=Oe,w=!0)},L=1;L<v;L++){w=!1;for(var A=0;A<y;A++){var N=h[A],O=N.source(),M=N.target(),R=o(N),k=b(O),P=b(M);D(O,M,N,k,P,R),s||D(M,O,N,P,k,R)}if(!w)break}if(w)for(var B=[],z=0;z<y;z++){var G=h[z],F=G.source(),U=G.target(),H=o(G),Y=b(F).dist,Q=b(U).dist;if(Y+H<Q||!s&&Q+H<Y)if(p||(Ie("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var J=[];Y+H<Q&&J.push(F),!s&&Q+H<Y&&J.push(U);for(var q=J.length,V=0;V<q;V++){var Z=J[V],K=[Z];K.push(b(Z).edge);for(var ie=b(Z).pred;K.indexOf(ie)===-1;)K.push(ie),K.push(b(ie).edge),ie=b(ie).pred;K=K.slice(K.indexOf(ie));for(var ve=K[0].id(),ae=0,te=2;te<K.length;te+=2)K[te].id()<ve&&(ve=K[te].id(),ae=te);K=K.slice(ae).concat(K.slice(0,ae)),K.push(K[0]);var ue=K.map(function(ce){return ce.id()}).join(",");B.indexOf(ue)===-1&&(g.push(u.spawn(K)),B.push(ue))}}else break}return{distanceTo:T,pathTo:C,hasNegativeWeightCycle:p,negativeWeightCycles:g}}},Qf=Math.sqrt(2),Jf=function(e,r,a){a.length===0&&Ve("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],s=n[1],i=n[2],o=r[s],u=r[i],l=a,f=l.length-1;f>=0;f--){var h=l[f],d=h[1],v=h[2];(r[d]===o&&r[v]===u||r[d]===u&&r[v]===o)&&l.splice(f,1)}for(var c=0;c<l.length;c++){var p=l[c];p[1]===u?(l[c]=p.slice(),l[c][1]=o):p[2]===u&&(l[c]=p.slice(),l[c][2]=o)}for(var g=0;g<r.length;g++)r[g]===u&&(r[g]=o);return l},Bn=function(e,r,a,n){for(;a>n;){var s=Math.floor(Math.random()*r.length);r=Jf(s,e,r),a--}return r},jf={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(P){return P.isLoop()});var s=a.length,i=n.length,o=Math.ceil(Math.pow(Math.log(s)/Math.LN2,2)),u=Math.floor(s/Qf);if(s<2){Ve("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<i;f++){var h=n[f];l.push([f,a.indexOf(h.source()),a.indexOf(h.target())])}for(var d=1/0,v=[],c=new Array(s),p=new Array(s),g=new Array(s),y=function(B,z){for(var G=0;G<s;G++)z[G]=B[G]},b=0;b<=o;b++){for(var m=0;m<s;m++)p[m]=m;var T=Bn(p,l.slice(),s,u),C=T.slice();y(p,g);var S=Bn(p,T,u,2),E=Bn(g,C,u,2);S.length<=E.length&&S.length<d?(d=S.length,v=S,y(p,c)):E.length<=S.length&&E.length<d&&(d=E.length,v=E,y(g,c))}for(var x=this.spawn(v.map(function(P){return n[P[0]]})),w=this.spawn(),D=this.spawn(),L=c[0],A=0;A<c.length;A++){var N=c[A],O=a[A];N===L?w.merge(O):D.merge(O)}var M=function(B){var z=e.spawn();return B.forEach(function(G){z.merge(G),G.connectedEdges().forEach(function(F){e.contains(F)&&!x.contains(F)&&z.merge(F)})}),z},R=[M(w),M(D)],k={cut:x,components:R,partition1:w,partition2:D};return k}},eh=function(e){return{x:e.x,y:e.y}},mn=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},Lo=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},Mr=function(e){return{x:e[0],y:e[1]}},th=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,s=r;s<a;s++){var i=e[s];isFinite(i)&&(n=Math.min(i,n))}return n},rh=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,s=r;s<a;s++){var i=e[s];isFinite(i)&&(n=Math.max(i,n))}return n},ah=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,s=0,i=r;i<a;i++){var o=e[i];isFinite(o)&&(n+=o,s++)}return n/s},nh=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a<e.length&&e.splice(a,e.length-a),r>0&&e.splice(0,r));for(var o=0,u=e.length-1;u>=0;u--){var l=e[u];i?isFinite(l)||(e[u]=-1/0,o++):e.splice(u,1)}s&&e.sort(function(d,v){return d-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},ih=function(e){return Math.PI*e/180},ka=function(e,r){return Math.atan2(r,e)-Math.PI/2},wi=Math.log2||function(t){return Math.log(t)/Math.log(2)},Ao=function(e){return e>0?1:e<0?-1:0},pr=function(e,r){return Math.sqrt(lr(e,r))},lr=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},sh=function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var s=0;s<r;s++)e[s]=e[s]/a;return e},Ze=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},kr=function(e,r,a,n){return{x:Ze(e.x,r.x,a.x,n),y:Ze(e.y,r.y,a.y,n)}},oh=function(e,r,a,n){var s={x:r.x-e.x,y:r.y-e.y},i=pr(e,r),o={x:s.x/i,y:s.y/i};return a=a??0,n=n??a*i,{x:e.x+o.x*n,y:e.y+o.y*n}},pa=function(e,r,a){return Math.max(e,Math.min(a,r))},pt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},uh=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},lh=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},fh=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}},Oo=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},hh=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},Ha=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},Xa=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,s,i;if(r.length===1)a=n=s=i=r[0];else if(r.length===2)a=s=r[0],i=n=r[1];else if(r.length===4){var o=Lt(r,4);a=o[0],n=o[1],s=o[2],i=o[3]}return e.x1-=i,e.x2+=n,e.y1-=a,e.y2+=s,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},es=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},xi=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},zr=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},vh=function(e,r){return zr(e,r.x,r.y)},No=function(e,r){return zr(e,r.x1,r.y1)&&zr(e,r.x2,r.y2)},Io=function(e,r,a,n,s,i,o){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?yr(s,i):u,f=s/2,h=i/2;l=Math.min(l,f,h);var d=l!==f,v=l!==h,c;if(d){var p=a-f+l-o,g=n-h-o,y=a+f-l+o,b=g;if(c=Qt(e,r,a,n,p,g,y,b,!1),c.length>0)return c}if(v){var m=a+f+o,T=n-h+l-o,C=m,S=n+h-l+o;if(c=Qt(e,r,a,n,m,T,C,S,!1),c.length>0)return c}if(d){var E=a-f+l-o,x=n+h+o,w=a+f-l+o,D=x;if(c=Qt(e,r,a,n,E,x,w,D,!1),c.length>0)return c}if(v){var L=a-f-o,A=n-h+l-o,N=L,O=n+h-l+o;if(c=Qt(e,r,a,n,L,A,N,O,!1),c.length>0)return c}var M;{var R=a-f+l,k=n-h+l;if(M=oa(e,r,a,n,R,k,l+o),M.length>0&&M[0]<=R&&M[1]<=k)return[M[0],M[1]]}{var P=a+f-l,B=n-h+l;if(M=oa(e,r,a,n,P,B,l+o),M.length>0&&M[0]>=P&&M[1]<=B)return[M[0],M[1]]}{var z=a+f-l,G=n+h-l;if(M=oa(e,r,a,n,z,G,l+o),M.length>0&&M[0]>=z&&M[1]>=G)return[M[0],M[1]]}{var F=a-f+l,U=n+h-l;if(M=oa(e,r,a,n,F,U,l+o),M.length>0&&M[0]<=F&&M[1]>=U)return[M[0],M[1]]}return[]},ch=function(e,r,a,n,s,i,o){var u=o,l=Math.min(a,s),f=Math.max(a,s),h=Math.min(n,i),d=Math.max(n,i);return l-u<=e&&e<=f+u&&h-u<=r&&r<=d+u},dh=function(e,r,a,n,s,i,o,u,l){var f={x1:Math.min(a,o,s)-l,x2:Math.max(a,o,s)+l,y1:Math.min(n,u,i)-l,y2:Math.max(n,u,i)+l};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},gh=function(e,r,a,n){a-=n;var s=r*r-4*e*a;if(s<0)return[];var i=Math.sqrt(s),o=2*e,u=(-r+i)/o,l=(-r-i)/o;return[u,l]},ph=function(e,r,a,n,s){var i=1e-5;e===0&&(e=i),r/=e,a/=e,n/=e;var o,u,l,f,h,d,v,c;if(u=(3*a-r*r)/9,l=-(27*n)+r*(9*a-2*(r*r)),l/=54,o=u*u*u+l*l,s[1]=0,v=r/3,o>0){h=l+Math.sqrt(o),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),d=l-Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),s[0]=-v+h+d,v+=(h+d)/2,s[4]=s[2]=-v,v=Math.sqrt(3)*(-d+h)/2,s[3]=v,s[5]=-v;return}if(s[5]=s[3]=0,o===0){c=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),s[0]=-v+2*c,s[4]=s[2]=-(c+v);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),c=2*Math.sqrt(u),s[0]=-v+c*Math.cos(f/3),s[2]=-v+c*Math.cos((f+2*Math.PI)/3),s[4]=-v+c*Math.cos((f+4*Math.PI)/3)},yh=function(e,r,a,n,s,i,o,u){var l=1*a*a-4*a*s+2*a*o+4*s*s-4*s*o+o*o+n*n-4*n*i+2*n*u+4*i*i-4*i*u+u*u,f=1*9*a*s-3*a*a-3*a*o-6*s*s+3*s*o+9*n*i-3*n*n-3*n*u-6*i*i+3*i*u,h=1*3*a*a-6*a*s+a*o-a*e+2*s*s+2*s*e-o*e+3*n*n-6*n*i+n*u-n*r+2*i*i+2*i*r-u*r,d=1*a*s-a*a+a*e-s*e+n*i-n*n+n*r-i*r,v=[];ph(l,f,h,d,v);for(var c=1e-7,p=[],g=0;g<6;g+=2)Math.abs(v[g+1])<c&&v[g]>=0&&v[g]<=1&&p.push(v[g]);p.push(1),p.push(0);for(var y=-1,b,m,T,C=0;C<p.length;C++)b=Math.pow(1-p[C],2)*a+2*(1-p[C])*p[C]*s+p[C]*p[C]*o,m=Math.pow(1-p[C],2)*n+2*(1-p[C])*p[C]*i+p[C]*p[C]*u,T=Math.pow(b-e,2)+Math.pow(m-r,2),y>=0?T<y&&(y=T):y=T;return y},mh=function(e,r,a,n,s,i){var o=[e-a,r-n],u=[s-a,i-n],l=u[0]*u[0]+u[1]*u[1],f=o[0]*o[0]+o[1]*o[1],h=o[0]*u[0]+o[1]*u[1],d=h*h/l;return h<0?f:d>l?(e-s)*(e-s)+(r-i)*(r-i):f-d},gt=function(e,r,a){for(var n,s,i,o,u,l=0,f=0;f<a.length/2;f++)if(n=a[f*2],s=a[f*2+1],f+1<a.length/2?(i=a[(f+1)*2],o=a[(f+1)*2+1]):(i=a[(f+1-a.length/2)*2],o=a[(f+1-a.length/2)*2+1]),!(n==e&&i==e))if(n>=e&&e>=i||n<=e&&e<=i)u=(e-n)/(i-n)*(o-s)+s,u>r&&l++;else continue;return l%2!==0},_t=function(e,r,a,n,s,i,o,u,l){var f=new Array(a.length),h;u[0]!=null?(h=Math.atan(u[1]/u[0]),u[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=u;for(var d=Math.cos(-h),v=Math.sin(-h),c=0;c<f.length/2;c++)f[c*2]=i/2*(a[c*2]*d-a[c*2+1]*v),f[c*2+1]=o/2*(a[c*2+1]*d+a[c*2]*v),f[c*2]+=n,f[c*2+1]+=s;var p;if(l>0){var g=on(f,-l);p=sn(g)}else p=f;return gt(e,r,p)},bh=function(e,r,a,n,s,i,o,u){for(var l=new Array(a.length*2),f=0;f<u.length;f++){var h=u[f];l[f*4+0]=h.startX,l[f*4+1]=h.startY,l[f*4+2]=h.stopX,l[f*4+3]=h.stopY;var d=Math.pow(h.cx-e,2)+Math.pow(h.cy-r,2);if(d<=Math.pow(h.radius,2))return!0}return gt(e,r,l)},sn=function(e){for(var r=new Array(e.length/2),a,n,s,i,o,u,l,f,h=0;h<e.length/4;h++){a=e[h*4],n=e[h*4+1],s=e[h*4+2],i=e[h*4+3],h<e.length/4-1?(o=e[(h+1)*4],u=e[(h+1)*4+1],l=e[(h+1)*4+2],f=e[(h+1)*4+3]):(o=e[0],u=e[1],l=e[2],f=e[3]);var d=Qt(a,n,s,i,o,u,l,f,!0);r[h*2]=d[0],r[h*2+1]=d[1]}return r},on=function(e,r){for(var a=new Array(e.length*2),n,s,i,o,u=0;u<e.length/2;u++){n=e[u*2],s=e[u*2+1],u<e.length/2-1?(i=e[(u+1)*2],o=e[(u+1)*2+1]):(i=e[0],o=e[1]);var l=o-s,f=-(i-n),h=Math.sqrt(l*l+f*f),d=l/h,v=f/h;a[u*4]=n+d*r,a[u*4+1]=s+v*r,a[u*4+2]=i+d*r,a[u*4+3]=o+v*r}return a},Eh=function(e,r,a,n,s,i){var o=a-e,u=n-r;o/=s,u/=i;var l=Math.sqrt(o*o+u*u),f=l-1;if(f<0)return[];var h=f/l;return[(a-e)*h+e,(n-r)*h+r]},cr=function(e,r,a,n,s,i,o){return e-=s,r-=i,e/=a/2+o,r/=n/2+o,e*e+r*r<=1},oa=function(e,r,a,n,s,i,o){var u=[a-e,n-r],l=[e-s,r-i],f=u[0]*u[0]+u[1]*u[1],h=2*(l[0]*u[0]+l[1]*u[1]),d=l[0]*l[0]+l[1]*l[1]-o*o,v=h*h-4*f*d;if(v<0)return[];var c=(-h+Math.sqrt(v))/(2*f),p=(-h-Math.sqrt(v))/(2*f),g=Math.min(c,p),y=Math.max(c,p),b=[];if(g>=0&&g<=1&&b.push(g),y>=0&&y<=1&&b.push(y),b.length===0)return[];var m=b[0]*u[0]+e,T=b[0]*u[1]+r;if(b.length>1){if(b[0]==b[1])return[m,T];var C=b[1]*u[0]+e,S=b[1]*u[1]+r;return[m,T,C,S]}else return[m,T]},Fn=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},Qt=function(e,r,a,n,s,i,o,u,l){var f=e-s,h=a-e,d=o-s,v=r-i,c=n-r,p=u-i,g=d*v-p*f,y=h*v-c*f,b=p*h-d*c;if(b!==0){var m=g/b,T=y/b,C=.001,S=0-C,E=1+C;return S<=m&&m<=E&&S<=T&&T<=E?[e+m*h,r+m*c]:l?[e+m*h,r+m*c]:[]}else return g===0||y===0?Fn(e,a,o)===o?[o,u]:Fn(e,a,s)===s?[s,i]:Fn(s,o,a)===a?[a,n]:[]:[]},ya=function(e,r,a,n,s,i,o,u){var l=[],f,h=new Array(a.length),d=!0;i==null&&(d=!1);var v;if(d){for(var c=0;c<h.length/2;c++)h[c*2]=a[c*2]*i+n,h[c*2+1]=a[c*2+1]*o+s;if(u>0){var p=on(h,-u);v=sn(p)}else v=h}else v=a;for(var g,y,b,m,T=0;T<v.length/2;T++)g=v[T*2],y=v[T*2+1],T<v.length/2-1?(b=v[(T+1)*2],m=v[(T+1)*2+1]):(b=v[0],m=v[1]),f=Qt(e,r,n,s,g,y,b,m),f.length!==0&&l.push(f[0],f[1]);return l},wh=function(e,r,a,n,s,i,o,u,l){var f=[],h,d=new Array(a.length*2);l.forEach(function(b,m){m===0?(d[d.length-2]=b.startX,d[d.length-1]=b.startY):(d[m*4-2]=b.startX,d[m*4-1]=b.startY),d[m*4]=b.stopX,d[m*4+1]=b.stopY,h=oa(e,r,n,s,b.cx,b.cy,b.radius),h.length!==0&&f.push(h[0],h[1])});for(var v=0;v<d.length/4;v++)h=Qt(e,r,n,s,d[v*4],d[v*4+1],d[v*4+2],d[v*4+3],!1),h.length!==0&&f.push(h[0],h[1]);if(f.length>2){for(var c=[f[0],f[1]],p=Math.pow(c[0]-e,2)+Math.pow(c[1]-r,2),g=1;g<f.length/2;g++){var y=Math.pow(f[g*2]-e,2)+Math.pow(f[g*2+1]-r,2);y<=p&&(c[0]=f[g*2],c[1]=f[g*2+1],p=y)}return c}return f},Pa=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],s=Math.sqrt(n[0]*n[0]+n[1]*n[1]),i=(s-a)/s;return i<0&&(i=1e-5),[r[0]+i*n[0],r[1]+i*n[1]]},vt=function(e,r){var a=Kn(e,r);return a=Mo(a),a},Mo=function(e){for(var r,a,n=e.length/2,s=1/0,i=1/0,o=-1/0,u=-1/0,l=0;l<n;l++)r=e[2*l],a=e[2*l+1],s=Math.min(s,r),o=Math.max(o,r),i=Math.min(i,a),u=Math.max(u,a);for(var f=2/(o-s),h=2/(u-i),d=0;d<n;d++)r=e[2*d]=e[2*d]*f,a=e[2*d+1]=e[2*d+1]*h,s=Math.min(s,r),o=Math.max(o,r),i=Math.min(i,a),u=Math.max(u,a);if(i<-1)for(var v=0;v<n;v++)a=e[2*v+1]=e[2*v+1]+(-1-i);return e},Kn=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;for(var s=new Array(e*2),i,o=0;o<e;o++)i=o*a+n,s[2*o]=Math.cos(i),s[2*o+1]=Math.sin(-i);return s},yr=function(e,r){return Math.min(e/4,r/4,8)},Ro=function(e,r){return Math.min(e/10,r/10,8)},Ti=function(){return 8},xh=function(e,r,a){return[e-2*r+a,2*(r-e),e]},Zn=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Th=rt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Ch={pageRank:function(e){for(var r=Th(e),a=r.dampingFactor,n=r.precision,s=r.iterations,i=r.weight,o=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,h=l.length,d=h*h,v=f.length,c=new Array(d),p=new Array(h),g=(1-a)/h,y=0;y<h;y++){for(var b=0;b<h;b++){var m=y*h+b;c[m]=0}p[y]=0}for(var T=0;T<v;T++){var C=f[T],S=C.data("source"),E=C.data("target");if(S!==E){var x=l.indexOfId(S),w=l.indexOfId(E),D=i(C),L=w*h+x;c[L]+=D,p[x]+=D}}for(var A=1/h+g,N=0;N<h;N++)if(p[N]===0)for(var O=0;O<h;O++){var M=O*h+N;c[M]=A}else for(var R=0;R<h;R++){var k=R*h+N;c[k]=c[k]/p[N]+g}for(var P=new Array(h),B=new Array(h),z,G=0;G<h;G++)P[G]=1;for(var F=0;F<s;F++){for(var U=0;U<h;U++)B[U]=0;for(var H=0;H<h;H++)for(var Y=0;Y<h;Y++){var Q=H*h+Y;B[H]+=c[Q]*P[Y]}sh(B),z=P,P=B,B=z;for(var J=0,q=0;q<h;q++){var V=z[q]-P[q];J+=V*V}if(J<n)break}var Z={rank:function(ie){return ie=o.collection(ie)[0],P[l.indexOf(ie)]}};return Z}},ts=rt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Pr={degreeCentralityNormalized:function(e){e=ts(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},h={},d=0,v=0,c=0;c<n;c++){var p=a[c],g=p.id();e.root=p;var y=this.degreeCentrality(e);d<y.indegree&&(d=y.indegree),v<y.outdegree&&(v=y.outdegree),f[g]=y.indegree,h[g]=y.outdegree}return{indegree:function(m){return d==0?0:(ge(m)&&(m=r.filter(m)),f[m.id()]/d)},outdegree:function(m){return v===0?0:(ge(m)&&(m=r.filter(m)),h[m.id()]/v)}}}else{for(var s={},i=0,o=0;o<n;o++){var u=a[o];e.root=u;var l=this.degreeCentrality(e);i<l.degree&&(i=l.degree),s[u.id()]=l.degree}return{degree:function(m){return i===0?0:(ge(m)&&(m=r.filter(m)),s[m.id()]/i)}}}},degreeCentrality:function(e){e=ts(e);var r=this.cy(),a=this,n=e,s=n.root,i=n.weight,o=n.directed,u=n.alpha;if(s=r.collection(s)[0],o){for(var v=s.connectedEdges(),c=v.filter(function(S){return S.target().same(s)&&a.has(S)}),p=v.filter(function(S){return S.source().same(s)&&a.has(S)}),g=c.length,y=p.length,b=0,m=0,T=0;T<c.length;T++)b+=i(c[T]);for(var C=0;C<p.length;C++)m+=i(p[C]);return{indegree:Math.pow(g,1-u)*Math.pow(b,u),outdegree:Math.pow(y,1-u)*Math.pow(m,u)}}else{for(var l=s.connectedEdges().intersection(a),f=l.length,h=0,d=0;d<l.length;d++)h+=i(l[d]);return{degree:Math.pow(f,1-u)*Math.pow(h,u)}}}};Pr.dc=Pr.degreeCentrality;Pr.dcn=Pr.degreeCentralityNormalised=Pr.degreeCentralityNormalized;var rs=rt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Br={closenessCentralityNormalized:function(e){for(var r=rs(e),a=r.harmonic,n=r.weight,s=r.directed,i=this.cy(),o={},u=0,l=this.nodes(),f=this.floydWarshall({weight:n,directed:s}),h=0;h<l.length;h++){for(var d=0,v=l[h],c=0;c<l.length;c++)if(h!==c){var p=f.distance(v,l[c]);a?d+=1/p:d+=p}a||(d=1/d),u<d&&(u=d),o[v.id()]=d}return{closeness:function(y){return u==0?0:(ge(y)?y=i.filter(y)[0].id():y=y.id(),o[y]/u)}}},closenessCentrality:function(e){var r=rs(e),a=r.root,n=r.weight,s=r.directed,i=r.harmonic;a=this.filter(a)[0];for(var o=this.dijkstra({root:a,weight:n,directed:s}),u=0,l=this.nodes(),f=0;f<l.length;f++){var h=l[f];if(!h.same(a)){var d=o.distanceTo(h);i?u+=1/d:u+=d}}return i?u:1/u}};Br.cc=Br.closenessCentrality;Br.ccn=Br.closenessCentralityNormalised=Br.closenessCentralityNormalized;var Dh=rt({weight:null,directed:!1}),Qn={betweennessCentrality:function(e){for(var r=Dh(e),a=r.directed,n=r.weight,s=n!=null,i=this.cy(),o=this.nodes(),u={},l={},f=0,h={set:function(m,T){l[m]=T,T>f&&(f=T)},get:function(m){return l[m]}},d=0;d<o.length;d++){var v=o[d],c=v.id();a?u[c]=v.outgoers().nodes():u[c]=v.openNeighborhood().nodes(),h.set(c,0)}for(var p=function(m){for(var T=o[m].id(),C=[],S={},E={},x={},w=new Sa(function(Y,Q){return x[Y]-x[Q]}),D=0;D<o.length;D++){var L=o[D].id();S[L]=[],E[L]=0,x[L]=1/0}for(E[T]=1,x[T]=0,w.push(T);!w.empty();){var A=w.pop();if(C.push(A),s)for(var N=0;N<u[A].length;N++){var O=u[A][N],M=i.getElementById(A),R=void 0;M.edgesTo(O).length>0?R=M.edgesTo(O)[0]:R=O.edgesTo(M)[0];var k=n(R);O=O.id(),x[O]>x[A]+k&&(x[O]=x[A]+k,w.nodes.indexOf(O)<0?w.push(O):w.updateItem(O),E[O]=0,S[O]=[]),x[O]==x[A]+k&&(E[O]=E[O]+E[A],S[O].push(A))}else for(var P=0;P<u[A].length;P++){var B=u[A][P].id();x[B]==1/0&&(w.push(B),x[B]=x[A]+1),x[B]==x[A]+1&&(E[B]=E[B]+E[A],S[B].push(A))}}for(var z={},G=0;G<o.length;G++)z[o[G].id()]=0;for(;C.length>0;){for(var F=C.pop(),U=0;U<S[F].length;U++){var H=S[F][U];z[H]=z[H]+E[H]/E[F]*(1+z[F])}F!=o[m].id()&&h.set(F,h.get(F)+z[F])}},g=0;g<o.length;g++)p(g);var y={betweenness:function(m){var T=i.collection(m).id();return h.get(T)},betweennessNormalized:function(m){if(f==0)return 0;var T=i.collection(m).id();return h.get(T)/f}};return y.betweennessNormalised=y.betweennessNormalized,y}};Qn.bc=Qn.betweennessCentrality;var Sh=rt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),Lh=function(e){return Sh(e)},Ah=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},Oh=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},ko=function(e,r){for(var a,n=0;n<r;n++){a=0;for(var s=0;s<r;s++)a+=e[s*r+n];for(var i=0;i<r;i++)e[i*r+n]=e[i*r+n]/a}},Nh=function(e,r,a){for(var n=new Array(a*a),s=0;s<a;s++){for(var i=0;i<a;i++)n[s*a+i]=0;for(var o=0;o<a;o++)for(var u=0;u<a;u++)n[s*a+u]+=e[s*a+o]*r[o*a+u]}return n},Ih=function(e,r,a){for(var n=e.slice(0),s=1;s<a;s++)e=Nh(e,n,r);return e},Mh=function(e,r,a){for(var n=new Array(r*r),s=0;s<r*r;s++)n[s]=Math.pow(e[s],a);return ko(n,r),n},Rh=function(e,r,a,n){for(var s=0;s<a;s++){var i=Math.round(e[s]*Math.pow(10,n))/Math.pow(10,n),o=Math.round(r[s]*Math.pow(10,n))/Math.pow(10,n);if(i!==o)return!1}return!0},kh=function(e,r,a,n){for(var s=[],i=0;i<r;i++){for(var o=[],u=0;u<r;u++)Math.round(e[i*r+u]*1e3)/1e3>0&&o.push(a[u]);o.length!==0&&s.push(n.collection(o))}return s},Ph=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},Bh=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&Ph(e[r],e[a])&&e.splice(a,1);return e},as=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),s=Lh(e),i={},o=0;o<r.length;o++)i[r[o].id()]=o;for(var u=r.length,l=u*u,f=new Array(l),h,d=0;d<l;d++)f[d]=0;for(var v=0;v<a.length;v++){var c=a[v],p=i[c.source().id()],g=i[c.target().id()],y=Ah(c,s.attributes);f[p*u+g]+=y,f[g*u+p]+=y}Oh(f,u,s.multFactor),ko(f,u);for(var b=!0,m=0;b&&m<s.maxIterations;)b=!1,h=Ih(f,u,s.expandFactor),f=Mh(h,u,s.inflateFactor),Rh(f,h,l,4)||(b=!0),m++;var T=kh(f,u,r,n);return T=Bh(T),T},Fh={markovClustering:as,mcl:as},Gh=function(e){return e},Po=function(e,r){return Math.abs(r-e)},ns=function(e,r,a){return e+Po(r,a)},is=function(e,r,a){return e+Math.pow(a-r,2)},zh=function(e){return Math.sqrt(e)},Vh=function(e,r,a){return Math.max(e,Po(r,a))},ta=function(e,r,a,n,s){for(var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Gh,o=n,u,l,f=0;f<e;f++)u=r(f),l=a(f),o=s(o,u,l);return i(o)},Vr={euclidean:function(e,r,a){return e>=2?ta(e,r,a,0,is,zh):ta(e,r,a,0,ns)},squaredEuclidean:function(e,r,a){return ta(e,r,a,0,is)},manhattan:function(e,r,a){return ta(e,r,a,0,ns)},max:function(e,r,a){return ta(e,r,a,-1/0,Vh)}};Vr["squared-euclidean"]=Vr.squaredEuclidean;Vr.squaredeuclidean=Vr.squaredEuclidean;function bn(t,e,r,a,n,s){var i;return ze(t)?i=t:i=Vr[t]||Vr.euclidean,e===0&&ze(t)?i(n,s):i(e,r,a,n,s)}var Uh=rt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Ci=function(e){return Uh(e)},un=function(e,r,a,n,s){var i=s!=="kMedoids",o=i?function(h){return a[h]}:function(h){return n[h](a)},u=function(d){return n[d](r)},l=a,f=r;return bn(e,n.length,o,u,l,f)},Gn=function(e,r,a){for(var n=a.length,s=new Array(n),i=new Array(n),o=new Array(r),u=null,l=0;l<n;l++)s[l]=e.min(a[l]).value,i[l]=e.max(a[l]).value;for(var f=0;f<r;f++){u=[];for(var h=0;h<n;h++)u[h]=Math.random()*(i[h]-s[h])+s[h];o[f]=u}return o},Bo=function(e,r,a,n,s){for(var i=1/0,o=0,u=0;u<r.length;u++){var l=un(a,e,r[u],n,s);l<i&&(i=l,o=u)}return o},Fo=function(e,r,a){for(var n=[],s=null,i=0;i<r.length;i++)s=r[i],a[s.id()]===e&&n.push(s);return n},$h=function(e,r,a){return Math.abs(r-e)<=a},Yh=function(e,r,a){for(var n=0;n<e.length;n++)for(var s=0;s<e[n].length;s++){var i=Math.abs(e[n][s]-r[n][s]);if(i>a)return!1}return!0},_h=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},ss=function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var s=e[Math.floor(Math.random()*e.length)];_h(s,a,n);)s=e[Math.floor(Math.random()*e.length)];a[n]=s}else for(var i=0;i<r;i++)a[i]=e[Math.floor(Math.random()*e.length)];return a},os=function(e,r,a){for(var n=0,s=0;s<r.length;s++)n+=un("manhattan",r[s],e,a,"kMedoids");return n},Hh=function(e){var r=this.cy(),a=this.nodes(),n=null,s=Ci(e),i=new Array(s.k),o={},u;s.testMode?typeof s.testCentroids=="number"?(s.testCentroids,u=Gn(a,s.k,s.attributes)):qe(s.testCentroids)==="object"?u=s.testCentroids:u=Gn(a,s.k,s.attributes):u=Gn(a,s.k,s.attributes);for(var l=!0,f=0;l&&f<s.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],o[n.id()]=Bo(n,u,s.distance,s.attributes,"kMeans");l=!1;for(var d=0;d<s.k;d++){var v=Fo(d,a,o);if(v.length!==0){for(var c=s.attributes.length,p=u[d],g=new Array(c),y=new Array(c),b=0;b<c;b++){y[b]=0;for(var m=0;m<v.length;m++)n=v[m],y[b]+=s.attributes[b](n);g[b]=y[b]/v.length,$h(g[b],p[b],s.sensitivityThreshold)||(l=!0)}u[d]=g,i[d]=r.collection(v)}}f++}return i},Xh=function(e){var r=this.cy(),a=this.nodes(),n=null,s=Ci(e),i=new Array(s.k),o,u={},l,f=new Array(s.k);s.testMode?typeof s.testCentroids=="number"||(qe(s.testCentroids)==="object"?o=s.testCentroids:o=ss(a,s.k)):o=ss(a,s.k);for(var h=!0,d=0;h&&d<s.maxIterations;){for(var v=0;v<a.length;v++)n=a[v],u[n.id()]=Bo(n,o,s.distance,s.attributes,"kMedoids");h=!1;for(var c=0;c<o.length;c++){var p=Fo(c,a,u);if(p.length!==0){f[c]=os(o[c],p,s.attributes);for(var g=0;g<p.length;g++)l=os(p[g],p,s.attributes),l<f[c]&&(f[c]=l,o[c]=p[g],h=!0);i[c]=r.collection(p)}}d++}return i},qh=function(e,r,a,n,s){for(var i,o,u=0;u<r.length;u++)for(var l=0;l<e.length;l++)n[u][l]=Math.pow(a[u][l],s.m);for(var f=0;f<e.length;f++)for(var h=0;h<s.attributes.length;h++){i=0,o=0;for(var d=0;d<r.length;d++)i+=n[d][f]*s.attributes[h](r[d]),o+=n[d][f];e[f][h]=i/o}},Wh=function(e,r,a,n,s){for(var i=0;i<e.length;i++)r[i]=e[i].slice();for(var o,u,l,f=2/(s.m-1),h=0;h<a.length;h++)for(var d=0;d<n.length;d++){o=0;for(var v=0;v<a.length;v++)u=un(s.distance,n[d],a[h],s.attributes,"cmeans"),l=un(s.distance,n[d],a[v],s.attributes,"cmeans"),o+=Math.pow(u/l,f);e[d][h]=1/o}},Kh=function(e,r,a,n){for(var s=new Array(a.k),i=0;i<s.length;i++)s[i]=[];for(var o,u,l=0;l<r.length;l++){o=-1/0,u=-1;for(var f=0;f<r[0].length;f++)r[l][f]>o&&(o=r[l][f],u=f);s[u].push(e[l])}for(var h=0;h<s.length;h++)s[h]=n.collection(s[h]);return s},us=function(e){var r=this.cy(),a=this.nodes(),n=Ci(e),s,i,o,u,l;u=new Array(a.length);for(var f=0;f<a.length;f++)u[f]=new Array(n.k);o=new Array(a.length);for(var h=0;h<a.length;h++)o[h]=new Array(n.k);for(var d=0;d<a.length;d++){for(var v=0,c=0;c<n.k;c++)o[d][c]=Math.random(),v+=o[d][c];for(var p=0;p<n.k;p++)o[d][p]=o[d][p]/v}i=new Array(n.k);for(var g=0;g<n.k;g++)i[g]=new Array(n.attributes.length);l=new Array(a.length);for(var y=0;y<a.length;y++)l[y]=new Array(n.k);for(var b=!0,m=0;b&&m<n.maxIterations;)b=!1,qh(i,a,o,l,n),Wh(o,u,i,a,n),Yh(o,u,n.sensitivityThreshold)||(b=!0),m++;return s=Kh(a,o,n,r),{clusters:s,degreeOfMembership:o}},Zh={kMeans:Hh,kMedoids:Xh,fuzzyCMeans:us,fcm:us},Qh=rt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Jh={single:"min",complete:"max"},jh=function(e){var r=Qh(e),a=Jh[r.linkage];return a!=null&&(r.linkage=a),r},ls=function(e,r,a,n,s){for(var i=0,o=1/0,u,l=s.attributes,f=function(w,D){return bn(s.distance,l.length,function(L){return l[L](w)},function(L){return l[L](D)},w,D)},h=0;h<e.length;h++){var d=e[h].key,v=a[d][n[d]];v<o&&(i=d,o=v)}if(s.mode==="threshold"&&o>=s.threshold||s.mode==="dendrogram"&&e.length===1)return!1;var c=r[i],p=r[n[i]],g;s.mode==="dendrogram"?g={left:c,right:p,key:c.key}:g={value:c.value.concat(p.value),key:c.key},e[c.index]=g,e.splice(p.index,1),r[c.key]=g;for(var y=0;y<e.length;y++){var b=e[y];c.key===b.key?u=1/0:s.linkage==="min"?(u=a[c.key][b.key],a[c.key][b.key]>a[p.key][b.key]&&(u=a[p.key][b.key])):s.linkage==="max"?(u=a[c.key][b.key],a[c.key][b.key]<a[p.key][b.key]&&(u=a[p.key][b.key])):s.linkage==="mean"?u=(a[c.key][b.key]*c.size+a[p.key][b.key]*p.size)/(c.size+p.size):s.mode==="dendrogram"?u=f(b.value,c.value):u=f(b.value[0],c.value[0]),a[c.key][b.key]=a[b.key][c.key]=u}for(var m=0;m<e.length;m++){var T=e[m].key;if(n[T]===c.key||n[T]===p.key){for(var C=T,S=0;S<e.length;S++){var E=e[S].key;a[T][E]<a[T][C]&&(C=E)}n[T]=C}e[m].index=m}return c.key=p.key=c.index=p.index=null,!0},Ba=function t(e,r,a){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},ev=function t(e,r){if(!e)return"";if(e.left&&e.right){var a=t(e.left,r),n=t(e.right,r),s=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:s.id()}}),r.add({group:"edges",data:{source:n,target:s.id()}}),s.id()}else if(e.value)return e.value.id()},tv=function t(e,r,a){if(!e)return[];var n=[],s=[],i=[];return r===0?(e.left&&Ba(e.left,n),e.right&&Ba(e.right,s),i=n.concat(s),[a.collection(i)]):r===1?e.value?[a.collection(e.value)]:(e.left&&Ba(e.left,n),e.right&&Ba(e.right,s),[a.collection(n),a.collection(s)]):e.value?[a.collection(e.value)]:(e.left&&(n=t(e.left,r-1,a)),e.right&&(s=t(e.right,r-1,a)),n.concat(s))},fs=function(e){for(var r=this.cy(),a=this.nodes(),n=jh(e),s=n.attributes,i=function(m,T){return bn(n.distance,s.length,function(C){return s[C](m)},function(C){return s[C](T)},m,T)},o=[],u=[],l=[],f=[],h=0;h<a.length;h++){var d={value:n.mode==="dendrogram"?a[h]:[a[h]],key:h,index:h};o[h]=d,f[h]=d,u[h]=[],l[h]=0}for(var v=0;v<o.length;v++)for(var c=0;c<=v;c++){var p=void 0;n.mode==="dendrogram"?p=v===c?1/0:i(o[v].value,o[c].value):p=v===c?1/0:i(o[v].value[0],o[c].value[0]),u[v][c]=p,u[c][v]=p,p<u[v][l[v]]&&(l[v]=c)}for(var g=ls(o,f,u,l,n);g;)g=ls(o,f,u,l,n);var y;return n.mode==="dendrogram"?(y=tv(o[0],n.dendrogramDepth,r),n.addDendrogram&&ev(o[0],r)):(y=new Array(o.length),o.forEach(function(b,m){b.key=b.index=null,y[m]=r.collection(b.value)})),y},rv={hierarchicalClustering:fs,hca:fs},av=rt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),nv=function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||Ve("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(s){return s===a})||se(a)||Ve("Preference must be one of [".concat(n.map(function(s){return"'".concat(s,"'")}).join(", "),"] or a number. Got: ").concat(a)),av(e)},iv=function(e,r,a,n){var s=function(o,u){return n[u](o)};return-bn(e,n.length,function(i){return s(r,i)},function(i){return s(a,i)},r,a)},sv=function(e,r){var a=null;return r==="median"?a=nh(e):r==="mean"?a=ah(e):r==="min"?a=th(e):r==="max"?a=rh(e):a=r,a},ov=function(e,r,a){for(var n=[],s=0;s<e;s++)r[s*e+s]+a[s*e+s]>0&&n.push(s);return n},hs=function(e,r,a){for(var n=[],s=0;s<e;s++){for(var i=-1,o=-1/0,u=0;u<a.length;u++){var l=a[u];r[s*e+l]>o&&(i=l,o=r[s*e+l])}i>0&&n.push(i)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},uv=function(e,r,a){for(var n=hs(e,r,a),s=0;s<a.length;s++){for(var i=[],o=0;o<n.length;o++)n[o]===a[s]&&i.push(o);for(var u=-1,l=-1/0,f=0;f<i.length;f++){for(var h=0,d=0;d<i.length;d++)h+=r[i[d]*e+i[f]];h>l&&(u=f,l=h)}a[s]=i[u]}return n=hs(e,r,a),n},vs=function(e){for(var r=this.cy(),a=this.nodes(),n=nv(e),s={},i=0;i<a.length;i++)s[a[i].id()]=i;var o,u,l,f,h,d;o=a.length,u=o*o,l=new Array(u);for(var v=0;v<u;v++)l[v]=-1/0;for(var c=0;c<o;c++)for(var p=0;p<o;p++)c!==p&&(l[c*o+p]=iv(n.distance,a[c],a[p],n.attributes));f=sv(l,n.preference);for(var g=0;g<o;g++)l[g*o+g]=f;h=new Array(u);for(var y=0;y<u;y++)h[y]=0;d=new Array(u);for(var b=0;b<u;b++)d[b]=0;for(var m=new Array(o),T=new Array(o),C=new Array(o),S=0;S<o;S++)m[S]=0,T[S]=0,C[S]=0;for(var E=new Array(o*n.minIterations),x=0;x<E.length;x++)E[x]=0;var w;for(w=0;w<n.maxIterations;w++){for(var D=0;D<o;D++){for(var L=-1/0,A=-1/0,N=-1,O=0,M=0;M<o;M++)m[M]=h[D*o+M],O=d[D*o+M]+l[D*o+M],O>=L?(A=L,L=O,N=M):O>A&&(A=O);for(var R=0;R<o;R++)h[D*o+R]=(1-n.damping)*(l[D*o+R]-L)+n.damping*m[R];h[D*o+N]=(1-n.damping)*(l[D*o+N]-A)+n.damping*m[N]}for(var k=0;k<o;k++){for(var P=0,B=0;B<o;B++)m[B]=d[B*o+k],T[B]=Math.max(0,h[B*o+k]),P+=T[B];P-=T[k],T[k]=h[k*o+k],P+=T[k];for(var z=0;z<o;z++)d[z*o+k]=(1-n.damping)*Math.min(0,P-T[z])+n.damping*m[z];d[k*o+k]=(1-n.damping)*(P-T[k])+n.damping*m[k]}for(var G=0,F=0;F<o;F++){var U=d[F*o+F]+h[F*o+F]>0?1:0;E[w%n.minIterations*o+F]=U,G+=U}if(G>0&&(w>=n.minIterations-1||w==n.maxIterations-1)){for(var H=0,Y=0;Y<o;Y++){C[Y]=0;for(var Q=0;Q<n.minIterations;Q++)C[Y]+=E[Q*o+Y];(C[Y]===0||C[Y]===n.minIterations)&&H++}if(H===o)break}}for(var J=ov(o,h,d),q=uv(o,l,J),V={},Z=0;Z<J.length;Z++)V[J[Z]]=[];for(var K=0;K<a.length;K++){var ie=s[a[K].id()],ve=q[ie];ve!=null&&V[ve].push(a[K])}for(var ae=new Array(J.length),te=0;te<J.length;te++)ae[te]=r.collection(V[J[te]]);return ae},lv={affinityPropagation:vs,ap:vs},fv=rt({root:void 0,directed:!1}),hv={hierholzer:function(e){if(!De(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=fv(e),n=a.root,s=a.directed,i=this,o=!1,u,l,f;n&&(f=ge(n)?this.filter(n)[0].id():n[0].id());var h={},d={};s?i.forEach(function(b){var m=b.id();if(b.isNode()){var T=b.indegree(!0),C=b.outdegree(!0),S=T-C,E=C-T;S==1?u?o=!0:u=m:E==1?l?o=!0:l=m:(E>1||S>1)&&(o=!0),h[m]=[],b.outgoers().forEach(function(x){x.isEdge()&&h[m].push(x.id())})}else d[m]=[void 0,b.target().id()]}):i.forEach(function(b){var m=b.id();if(b.isNode()){var T=b.degree(!0);T%2&&(u?l?o=!0:l=m:u=m),h[m]=[],b.connectedEdges().forEach(function(C){return h[m].push(C.id())})}else d[m]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(o)return v;if(l&&u)if(s){if(f&&l!=f)return v;f=l}else{if(f&&l!=f&&u!=f)return v;f||(f=l)}else f||(f=i[0].id());var c=function(m){for(var T=m,C=[m],S,E,x;h[T].length;)S=h[T].shift(),E=d[S][0],x=d[S][1],T!=x?(h[x]=h[x].filter(function(w){return w!=S}),T=x):!s&&T!=E&&(h[E]=h[E].filter(function(w){return w!=S}),T=E),C.unshift(S),C.unshift(T);return C},p=[],g=[];for(g=c(f);g.length!=1;)h[g[0]].length==0?(p.unshift(i.getElementById(g.shift())),p.unshift(i.getElementById(g.shift()))):g=c(g.shift()).concat(g);p.unshift(i.getElementById(g.shift()));for(var y in h)if(h[y].length)return v;return v.found=!0,v.trail=this.spawn(p,!0),v}},Fa=function(){var e=this,r={},a=0,n=0,s=[],i=[],o={},u=function(d,v){for(var c=i.length-1,p=[],g=e.spawn();i[c].x!=d||i[c].y!=v;)p.push(i.pop().edge),c--;p.push(i.pop().edge),p.forEach(function(y){var b=y.connectedNodes().intersection(e);g.merge(y),b.forEach(function(m){var T=m.id(),C=m.connectedEdges().intersection(e);g.merge(m),r[T].cutVertex?g.merge(C.filter(function(S){return S.isLoop()})):g.merge(C)})}),s.push(g)},l=function h(d,v,c){d===c&&(n+=1),r[v]={id:a,low:a++,cutVertex:!1};var p=e.getElementById(v).connectedEdges().intersection(e);if(p.size()===0)s.push(e.spawn(e.getElementById(v)));else{var g,y,b,m;p.forEach(function(T){g=T.source().id(),y=T.target().id(),b=g===v?y:g,b!==c&&(m=T.id(),o[m]||(o[m]=!0,i.push({x:v,y:b,edge:T})),b in r?r[v].low=Math.min(r[v].low,r[b].id):(h(d,b,v),r[v].low=Math.min(r[v].low,r[b].low),r[v].id<=r[b].low&&(r[v].cutVertex=!0,u(v,b))))})}};e.forEach(function(h){if(h.isNode()){var d=h.id();d in r||(n=0,l(d,d),r[d].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:s}},vv={hopcroftTarjanBiconnected:Fa,htbc:Fa,htb:Fa,hopcroftTarjanBiconnectedComponents:Fa},Ga=function(){var e=this,r={},a=0,n=[],s=[],i=e.spawn(e),o=function u(l){s.push(l),r[l]={index:a,low:a++,explored:!1};var f=e.getElementById(l).connectedEdges().intersection(e);if(f.forEach(function(p){var g=p.target().id();g!==l&&(g in r||u(g),r[g].explored||(r[l].low=Math.min(r[l].low,r[g].low)))}),r[l].index===r[l].low){for(var h=e.spawn();;){var d=s.pop();if(h.merge(e.getElementById(d)),r[d].low=r[l].index,r[d].explored=!0,d===l)break}var v=h.edgesWith(h),c=h.merge(v);n.push(c),i=i.difference(c)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in r||o(l)}}),{cut:i,components:n}},cv={tarjanStronglyConnected:Ga,tsc:Ga,tscc:Ga,tarjanStronglyConnectedComponents:Ga},Go={};[ga,Yf,_f,Xf,Wf,Zf,jf,Ch,Pr,Br,Qn,Fh,Zh,rv,lv,hv,vv,cv].forEach(function(t){Ee(Go,t)});/*!
|
||
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
||
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
||
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
||
*/var zo=0,Vo=1,Uo=2,Ht=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=zo,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))};Ht.prototype={fulfill:function(e){return cs(this,Vo,"fulfillValue",e)},reject:function(e){return cs(this,Uo,"rejectReason",e)},then:function(e,r){var a=this,n=new Ht;return a.onFulfilled.push(gs(e,n,"fulfill")),a.onRejected.push(gs(r,n,"reject")),$o(a),n.proxy}};var cs=function(e,r,a,n){return e.state===zo&&(e.state=r,e[a]=n,$o(e)),e},$o=function(e){e.state===Vo?ds(e,"onFulfilled",e.fulfillValue):e.state===Uo&&ds(e,"onRejected",e.rejectReason)},ds=function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var s=function(){for(var o=0;o<n.length;o++)n[o](a)};typeof setImmediate=="function"?setImmediate(s):setTimeout(s,0)}},gs=function(e,r,a){return function(n){if(typeof e!="function")r[a].call(r,n);else{var s;try{s=e(n)}catch(i){r.reject(i);return}dv(r,s)}}},dv=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(qe(r)==="object"&&r!==null||typeof r=="function")try{a=r.then}catch(s){e.reject(s);return}if(typeof a=="function"){var n=!1;try{a.call(r,function(s){n||(n=!0,s===r?e.reject(new TypeError("circular thenable chain")):t(e,s))},function(s){n||(n=!0,e.reject(s))})}catch(s){n||e.reject(s)}return}e.fulfill(r)};Ht.all=function(t){return new Ht(function(e,r){for(var a=new Array(t.length),n=0,s=function(u,l){a[u]=l,n++,n===t.length&&e(a)},i=0;i<t.length;i++)(function(o){var u=t[o],l=u!=null&&u.then!=null;if(l)u.then(function(h){s(o,h)},function(h){r(h)});else{var f=u;s(o,f)}})(i)})};Ht.resolve=function(t){return new Ht(function(e,r){e(t)})};Ht.reject=function(t){return new Ht(function(e,r){r(t)})};var Yr=typeof Promise<"u"?Promise:Ht,Jn=function(e,r,a){var n=pi(e),s=!n,i=this._private=Ee({duration:1e3},r,a);if(i.target=e,i.style=i.style||i.css,i.started=!1,i.playing=!1,i.hooked=!1,i.applying=!1,i.progress=0,i.completes=[],i.frames=[],i.complete&&ze(i.complete)&&i.completes.push(i.complete),s){var o=e.position();i.startPosition=i.startPosition||{x:o.x,y:o.y},i.startStyle=i.startStyle||e.cy().style().getAnimationStartStyle(e,i.style)}if(n){var u=e.pan();i.startPan={x:u.x,y:u.y},i.startZoom=e.zoom()}this.length=1,this[0]=this},mr=Jn.prototype;Ee(mr,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,a=e.target._private.animation;e.queue?r=a.queue:r=a.current,r.push(this),yt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,a=r.playing;return e===void 0?r.progress:(a&&this.pause(),r.progress=e,r.started=!1,a&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var a=function(l,f){var h=e[l];h!=null&&(e[l]=e[f],e[f]=h)};if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var s=e.style[n],i=s.name,o=e.startStyle[i];e.startStyle[i]=s,e.style[n]=o}return r&&this.play(),this},promise:function(e){var r=this._private,a;switch(e){case"frame":a=r.frames;break;default:case"complete":case"completed":a=r.completes}return new Yr(function(n,s){a.push(function(){n()})})}});mr.complete=mr.completed;mr.run=mr.play;mr.running=mr.playing;var gv={animated:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],s=this._private.cy||this;if(!s.styleEnabled())return!1;var i=n[0];if(i)return i._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var i=0;i<n.length;i++){var o=n[i];o._private.animation.queue=[]}return this}},delay:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:r,duration:r,complete:a}):this}},delayAnimation:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:r,duration:r,complete:a}):this}},animation:function(){return function(r,a){var n=this,s=n.length!==void 0,i=s?n:[n],o=this._private.cy||this,u=!s,l=!u;if(!o.styleEnabled())return this;var f=o.style();r=Ee({},r,a);var h=Object.keys(r).length===0;if(h)return new Jn(i[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(l&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),l&&r.renderedPosition!=null){var d=r.renderedPosition,v=o.pan(),c=o.zoom();r.position=Lo(d,c,v)}if(u&&r.panBy!=null){var p=r.panBy,g=o.pan();r.pan={x:g.x+p.x,y:g.y+p.y}}var y=r.center||r.centre;if(u&&y!=null){var b=o.getCenterPan(y.eles,r.zoom);b!=null&&(r.pan=b)}if(u&&r.fit!=null){var m=r.fit,T=o.getFitViewport(m.eles||m.boundingBox,m.padding);T!=null&&(r.pan=T.pan,r.zoom=T.zoom)}if(u&&De(r.zoom)){var C=o.getZoomedViewport(r.zoom);C!=null?(C.zoomed&&(r.zoom=C.zoom),C.panned&&(r.pan=C.pan)):r.zoom=null}return new Jn(i[0],r)}},animate:function(){return function(r,a){var n=this,s=n.length!==void 0,i=s?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;a&&(r=Ee({},r,a));for(var u=0;u<i.length;u++){var l=i[u],f=l.animated()&&(r.queue===void 0||r.queue),h=l.animation(r,f?{queue:!0}:void 0);h.play()}return this}},stop:function(){return function(r,a){var n=this,s=n.length!==void 0,i=s?n:[n],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var u=0;u<i.length;u++){for(var l=i[u],f=l._private,h=f.animation.current,d=0;d<h.length;d++){var v=h[d],c=v._private;a&&(c.duration=0)}r&&(f.animation.queue=[]),a||(f.animation.current=[])}return o.notify("draw"),this}}},pv=Array.isArray,En=pv,yv=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mv=/^\w*$/;function bv(t,e){if(En(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Da(t)?!0:mv.test(t)||!yv.test(t)||e!=null&&t in Object(e)}var Ev=bv,wv="[object AsyncFunction]",xv="[object Function]",Tv="[object GeneratorFunction]",Cv="[object Proxy]";function Dv(t){if(!dr(t))return!1;var e=mo(t);return e==xv||e==Tv||e==wv||e==Cv}var Sv=Dv,Lv=gn["__core-js_shared__"],zn=Lv,ps=function(){var t=/[^.]+$/.exec(zn&&zn.keys&&zn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Av(t){return!!ps&&ps in t}var Ov=Av,Nv=Function.prototype,Iv=Nv.toString;function Mv(t){if(t!=null){try{return Iv.call(t)}catch{}try{return t+""}catch{}}return""}var Rv=Mv,kv=/[\\^$.*+?()[\]{}|]/g,Pv=/^\[object .+?Constructor\]$/,Bv=Function.prototype,Fv=Object.prototype,Gv=Bv.toString,zv=Fv.hasOwnProperty,Vv=RegExp("^"+Gv.call(zv).replace(kv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Uv(t){if(!dr(t)||Ov(t))return!1;var e=Sv(t)?Vv:Pv;return e.test(Rv(t))}var $v=Uv;function Yv(t,e){return t==null?void 0:t[e]}var _v=Yv;function Hv(t,e){var r=_v(t,e);return $v(r)?r:void 0}var Di=Hv,Xv=Di(Object,"create"),ma=Xv;function qv(){this.__data__=ma?ma(null):{},this.size=0}var Wv=qv;function Kv(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Zv=Kv,Qv="__lodash_hash_undefined__",Jv=Object.prototype,jv=Jv.hasOwnProperty;function ec(t){var e=this.__data__;if(ma){var r=e[t];return r===Qv?void 0:r}return jv.call(e,t)?e[t]:void 0}var tc=ec,rc=Object.prototype,ac=rc.hasOwnProperty;function nc(t){var e=this.__data__;return ma?e[t]!==void 0:ac.call(e,t)}var ic=nc,sc="__lodash_hash_undefined__";function oc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ma&&e===void 0?sc:e,this}var uc=oc;function _r(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}_r.prototype.clear=Wv;_r.prototype.delete=Zv;_r.prototype.get=tc;_r.prototype.has=ic;_r.prototype.set=uc;var ys=_r;function lc(){this.__data__=[],this.size=0}var fc=lc;function hc(t,e){return t===e||t!==t&&e!==e}var Yo=hc;function vc(t,e){for(var r=t.length;r--;)if(Yo(t[r][0],e))return r;return-1}var wn=vc,cc=Array.prototype,dc=cc.splice;function gc(t){var e=this.__data__,r=wn(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():dc.call(e,r,1),--this.size,!0}var pc=gc;function yc(t){var e=this.__data__,r=wn(e,t);return r<0?void 0:e[r][1]}var mc=yc;function bc(t){return wn(this.__data__,t)>-1}var Ec=bc;function wc(t,e){var r=this.__data__,a=wn(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}var xc=wc;function Hr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}Hr.prototype.clear=fc;Hr.prototype.delete=pc;Hr.prototype.get=mc;Hr.prototype.has=Ec;Hr.prototype.set=xc;var Tc=Hr,Cc=Di(gn,"Map"),Dc=Cc;function Sc(){this.size=0,this.__data__={hash:new ys,map:new(Dc||Tc),string:new ys}}var Lc=Sc;function Ac(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Oc=Ac;function Nc(t,e){var r=t.__data__;return Oc(e)?r[typeof e=="string"?"string":"hash"]:r.map}var xn=Nc;function Ic(t){var e=xn(this,t).delete(t);return this.size-=e?1:0,e}var Mc=Ic;function Rc(t){return xn(this,t).get(t)}var kc=Rc;function Pc(t){return xn(this,t).has(t)}var Bc=Pc;function Fc(t,e){var r=xn(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}var Gc=Fc;function Xr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}Xr.prototype.clear=Lc;Xr.prototype.delete=Mc;Xr.prototype.get=kc;Xr.prototype.has=Bc;Xr.prototype.set=Gc;var _o=Xr,zc="Expected a function";function Si(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(zc);var r=function(){var a=arguments,n=e?e.apply(this,a):a[0],s=r.cache;if(s.has(n))return s.get(n);var i=t.apply(this,a);return r.cache=s.set(n,i)||s,i};return r.cache=new(Si.Cache||_o),r}Si.Cache=_o;var Vc=Si,Uc=500;function $c(t){var e=Vc(t,function(a){return r.size===Uc&&r.clear(),a}),r=e.cache;return e}var Yc=$c,_c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hc=/\\(\\)?/g,Xc=Yc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(_c,function(r,a,n,s){e.push(n?s.replace(Hc,"$1"):a||r)}),e}),Ho=Xc;function qc(t,e){for(var r=-1,a=t==null?0:t.length,n=Array(a);++r<a;)n[r]=e(t[r],r,t);return n}var Xo=qc,Wc=1/0,ms=Gr?Gr.prototype:void 0,bs=ms?ms.toString:void 0;function qo(t){if(typeof t=="string")return t;if(En(t))return Xo(t,qo)+"";if(Da(t))return bs?bs.call(t):"";var e=t+"";return e=="0"&&1/t==-Wc?"-0":e}var Kc=qo;function Zc(t){return t==null?"":Kc(t)}var Wo=Zc;function Qc(t,e){return En(t)?t:Ev(t,e)?[t]:Ho(Wo(t))}var Ko=Qc,Jc=1/0;function jc(t){if(typeof t=="string"||Da(t))return t;var e=t+"";return e=="0"&&1/t==-Jc?"-0":e}var Li=jc;function ed(t,e){e=Ko(e,t);for(var r=0,a=e.length;t!=null&&r<a;)t=t[Li(e[r++])];return r&&r==a?t:void 0}var td=ed;function rd(t,e,r){var a=t==null?void 0:td(t,e);return a===void 0?r:a}var ad=rd,nd=function(){try{var t=Di(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Es=nd;function id(t,e,r){e=="__proto__"&&Es?Es(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var sd=id,od=Object.prototype,ud=od.hasOwnProperty;function ld(t,e,r){var a=t[e];(!(ud.call(t,e)&&Yo(a,r))||r===void 0&&!(e in t))&&sd(t,e,r)}var fd=ld,hd=9007199254740991,vd=/^(?:0|[1-9]\d*)$/;function cd(t,e){var r=typeof t;return e=e??hd,!!e&&(r=="number"||r!="symbol"&&vd.test(t))&&t>-1&&t%1==0&&t<e}var dd=cd;function gd(t,e,r,a){if(!dr(t))return t;e=Ko(e,t);for(var n=-1,s=e.length,i=s-1,o=t;o!=null&&++n<s;){var u=Li(e[n]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(n!=i){var f=o[u];l=a?a(f,u,o):void 0,l===void 0&&(l=dr(f)?f:dd(e[n+1])?[]:{})}fd(o,u,l),o=o[u]}return t}var pd=gd;function yd(t,e,r){return t==null?t:pd(t,e,r)}var md=yd;function bd(t,e){var r=-1,a=t.length;for(e||(e=Array(a));++r<a;)e[r]=t[r];return e}var Ed=bd;function wd(t){return En(t)?Xo(t,Li):Da(t)?[t]:Ed(Ho(Wo(t)))}var xd=wd,Td={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(n){},beforeSet:function(n,s){},onSet:function(n){},canSet:function(n){return!0}};return e=Ee({},r,e),function(n,s){var i=e,o=this,u=o.length!==void 0,l=u?o:[o],f=u?o[0]:o;if(ge(n)){var h=n.indexOf(".")!==-1,d=h&&xd(n);if(i.allowGetting&&s===void 0){var v;return f&&(i.beforeGet(f),d&&f._private[i.field][n]===void 0?v=ad(f._private[i.field],d):v=f._private[i.field][n]),v}else if(i.allowSetting&&s!==void 0){var c=!i.immutableKeys[n];if(c){var p=so({},n,s);i.beforeSet(o,p);for(var g=0,y=l.length;g<y;g++){var b=l[g];i.canSet(b)&&(d&&f._private[i.field][n]===void 0?md(b._private[i.field],d,s):b._private[i.field][n]=s)}i.updateStyle&&o.updateStyle(),i.onSet(o),i.settingTriggersEvent&&o[i.triggerFnName](i.settingEvent)}}}else if(i.allowSetting&&De(n)){var m=n,T,C,S=Object.keys(m);i.beforeSet(o,m);for(var E=0;E<S.length;E++){T=S[E],C=m[T];var x=!i.immutableKeys[T];if(x)for(var w=0;w<l.length;w++){var D=l[w];i.canSet(D)&&(D._private[i.field][T]=C)}}i.updateStyle&&o.updateStyle(),i.onSet(o),i.settingTriggersEvent&&o[i.triggerFnName](i.settingEvent)}else if(i.allowBinding&&ze(n)){var L=n;o.on(i.bindingEvent,L)}else if(i.allowGetting&&n===void 0){var A;return f&&(i.beforeGet(f),A=f._private[i.field]),A}return o}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Ee({},r,e),function(n){var s=e,i=this,o=i.length!==void 0,u=o?i:[i];if(ge(n)){for(var l=n.split(/\s+/),f=l.length,h=0;h<f;h++){var d=l[h];if(!er(d)){var v=!s.immutableKeys[d];if(v)for(var c=0,p=u.length;c<p;c++)u[c]._private[s.field][d]=void 0}}s.triggerEvent&&i[s.triggerFnName](s.event)}else if(n===void 0){for(var g=0,y=u.length;g<y;g++)for(var b=u[g]._private[s.field],m=Object.keys(b),T=0;T<m.length;T++){var C=m[T],S=!s.immutableKeys[C];S&&(b[C]=void 0)}s.triggerEvent&&i[s.triggerFnName](s.event)}return i}}},Cd={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(a,n){var s=this,i=Array.prototype.slice.call(arguments,0);return new Yr(function(o,u){var l=function(v){s.off.apply(s,h),o(v)},f=i.concat([l]),h=f.concat([]);s.on.apply(s,f)})}}},Ne={};[gv,Td,Cd].forEach(function(t){Ee(Ne,t)});var Dd={animate:Ne.animate(),animation:Ne.animation(),animated:Ne.animated(),clearQueue:Ne.clearQueue(),delay:Ne.delay(),delayAnimation:Ne.delayAnimation(),stop:Ne.stop()},qa={classes:function(e){var r=this;if(e===void 0){var a=[];return r[0]._private.classes.forEach(function(c){return a.push(c)}),a}else ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],s=new $r(e),i=0;i<r.length;i++){for(var o=r[i],u=o._private,l=u.classes,f=!1,h=0;h<e.length;h++){var d=e[h],v=l.has(d);if(!v){f=!0;break}}f||(f=l.size!==e.length),f&&(u.classes=s,n.push(o))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){ke(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,s=[],i=0,o=a.length;i<o;i++)for(var u=a[i],l=u._private.classes,f=!1,h=0;h<e.length;h++){var d=e[h],v=l.has(d),c=!1;r||n&&!v?(l.add(d),c=!0):(!r||n&&v)&&(l.delete(d),c=!0),!f&&c&&(s.push(u),f=!0)}return s.length>0&&this.spawn(s).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 Ce={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Xe,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ce.variable="(?:[\\w-.]|(?:\\\\"+Ce.metaChar+"))+";Ce.className="(?:[\\w-]|(?:\\\\"+Ce.metaChar+"))+";Ce.value=Ce.string+"|"+Ce.number;Ce.id=Ce.variable;(function(){var t,e,r;for(t=Ce.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],Ce.comparatorOp+="|@"+e;for(t=Ce.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(Ce.comparatorOp+="|\\!"+e)})();var Me=function(){return{checks:[]}},oe={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},jn=[{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 Bl(t.selector,e.selector)}),Sd=function(){for(var t={},e,r=0;r<jn.length;r++)e=jn[r],t[e.selector]=e.matches;return t}(),Ld=function(e,r){return Sd[e](r)},Ad="("+jn.map(function(t){return t.selector}).join("|")+")",Dr=function(e){return e.replace(new RegExp("\\\\("+Ce.metaChar+")","g"),function(r,a){return a})},Kt=function(e,r,a){e[e.length-1]=a},ei=[{name:"group",query:!0,regex:"("+Ce.group+")",populate:function(e,r,a){var n=Lt(a,1),s=n[0];r.checks.push({type:oe.GROUP,value:s==="*"?s:s+"s"})}},{name:"state",query:!0,regex:Ad,populate:function(e,r,a){var n=Lt(a,1),s=n[0];r.checks.push({type:oe.STATE,value:s})}},{name:"id",query:!0,regex:"\\#("+Ce.id+")",populate:function(e,r,a){var n=Lt(a,1),s=n[0];r.checks.push({type:oe.ID,value:Dr(s)})}},{name:"className",query:!0,regex:"\\.("+Ce.className+")",populate:function(e,r,a){var n=Lt(a,1),s=n[0];r.checks.push({type:oe.CLASS,value:Dr(s)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ce.variable+")\\s*\\]",populate:function(e,r,a){var n=Lt(a,1),s=n[0];r.checks.push({type:oe.DATA_EXIST,field:Dr(s)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ce.variable+")\\s*("+Ce.comparatorOp+")\\s*("+Ce.value+")\\s*\\]",populate:function(e,r,a){var n=Lt(a,3),s=n[0],i=n[1],o=n[2],u=new RegExp("^"+Ce.string+"$").exec(o)!=null;u?o=o.substring(1,o.length-1):o=parseFloat(o),r.checks.push({type:oe.DATA_COMPARE,field:Dr(s),operator:i,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ce.boolOp+")\\s*("+Ce.variable+")\\s*\\]",populate:function(e,r,a){var n=Lt(a,2),s=n[0],i=n[1];r.checks.push({type:oe.DATA_BOOL,field:Dr(i),operator:s})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ce.meta+")\\s*("+Ce.comparatorOp+")\\s*("+Ce.number+")\\s*\\]\\]",populate:function(e,r,a){var n=Lt(a,3),s=n[0],i=n[1],o=n[2];r.checks.push({type:oe.META_COMPARE,field:Dr(s),operator:i,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Ce.separator,populate:function(e,r){var a=e.currentSubject,n=e.edgeCount,s=e.compoundCount,i=e[e.length-1];a!=null&&(i.subject=a,e.currentSubject=null),i.edgeCount=n,i.compoundCount=s,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=Me();return o}},{name:"directedEdge",separator:!0,regex:Ce.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Me(),n=r,s=Me();return a.checks.push({type:oe.DIRECTED_EDGE,source:n,target:s}),Kt(e,r,a),e.edgeCount++,s}else{var i=Me(),o=r,u=Me();return i.checks.push({type:oe.NODE_SOURCE,source:o,target:u}),Kt(e,r,i),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:Ce.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Me(),n=r,s=Me();return a.checks.push({type:oe.UNDIRECTED_EDGE,nodes:[n,s]}),Kt(e,r,a),e.edgeCount++,s}else{var i=Me(),o=r,u=Me();return i.checks.push({type:oe.NODE_NEIGHBOR,node:o,neighbor:u}),Kt(e,r,i),u}}},{name:"child",separator:!0,regex:Ce.child,populate:function(e,r){if(e.currentSubject==null){var a=Me(),n=Me(),s=e[e.length-1];return a.checks.push({type:oe.CHILD,parent:s,child:n}),Kt(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var i=Me(),o=e[e.length-1],u=Me(),l=Me(),f=Me(),h=Me();return i.checks.push({type:oe.COMPOUND_SPLIT,left:o,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:oe.TRUE}],h.checks.push({type:oe.TRUE}),u.checks.push({type:oe.PARENT,parent:h,child:f}),Kt(e,o,i),e.currentSubject=l,e.compoundCount++,f}else{var d=Me(),v=Me(),c=[{type:oe.PARENT,parent:d,child:v}];return d.checks=r.checks,r.checks=c,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Ce.descendant,populate:function(e,r){if(e.currentSubject==null){var a=Me(),n=Me(),s=e[e.length-1];return a.checks.push({type:oe.DESCENDANT,ancestor:s,descendant:n}),Kt(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var i=Me(),o=e[e.length-1],u=Me(),l=Me(),f=Me(),h=Me();return i.checks.push({type:oe.COMPOUND_SPLIT,left:o,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:oe.TRUE}],h.checks.push({type:oe.TRUE}),u.checks.push({type:oe.ANCESTOR,ancestor:h,descendant:f}),Kt(e,o,i),e.currentSubject=l,e.compoundCount++,f}else{var d=Me(),v=Me(),c=[{type:oe.ANCESTOR,ancestor:d,descendant:v}];return d.checks=r.checks,r.checks=c,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Ce.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Ie("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var a=e[e.length-1],n=a.checks[0],s=n==null?null:n.type;s===oe.DIRECTED_EDGE?n.type=oe.NODE_TARGET:s===oe.UNDIRECTED_EDGE&&(n.type=oe.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];ei.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var Od=function(e){for(var r,a,n,s=0;s<ei.length;s++){var i=ei[s],o=i.name,u=e.match(i.regexObj);if(u!=null){a=u,r=i,n=o;var l=u[0];e=e.substring(l.length);break}}return{expr:r,match:a,name:n,remaining:e}},Nd=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},Id=function(e){var r=this,a=r.inputText=e,n=r[0]=Me();for(r.length=1,a=Nd(a);;){var s=Od(a);if(s.expr==null)return Ie("The selector `"+e+"`is invalid"),!1;var i=s.match.slice(1),o=s.expr.populate(r,n,i);if(o===!1)return!1;if(o!=null&&(n=o),a=s.remaining,a.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var l=0;l<r.length;l++){var f=r[l];if(f.compoundCount>0&&f.edgeCount>0)return 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},Md=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return ge(f)?'"'+f+'"':e(f)},a=function(f){return" "+f+" "},n=function(f,h){var d=f.type,v=f.value;switch(d){case oe.GROUP:{var c=e(v);return c.substring(0,c.length-1)}case oe.DATA_COMPARE:{var p=f.field,g=f.operator;return"["+p+a(e(g))+r(v)+"]"}case oe.DATA_BOOL:{var y=f.operator,b=f.field;return"["+e(y)+b+"]"}case oe.DATA_EXIST:{var m=f.field;return"["+m+"]"}case oe.META_COMPARE:{var T=f.operator,C=f.field;return"[["+C+a(e(T))+r(v)+"]]"}case oe.STATE:return v;case oe.ID:return"#"+v;case oe.CLASS:return"."+v;case oe.PARENT:case oe.CHILD:return s(f.parent,h)+a(">")+s(f.child,h);case oe.ANCESTOR:case oe.DESCENDANT:return s(f.ancestor,h)+" "+s(f.descendant,h);case oe.COMPOUND_SPLIT:{var S=s(f.left,h),E=s(f.subject,h),x=s(f.right,h);return S+(S.length>0?" ":"")+E+x}case oe.TRUE:return""}},s=function(f,h){return f.checks.reduce(function(d,v,c){return d+(h===f&&c===0?"$":"")+n(v,h)},"")},i="",o=0;o<this.length;o++){var u=this[o];i+=s(u,u.subject),this.length>1&&o<this.length-1&&(i+=", ")}return this.toStringCache=i,i},Rd={parse:Id,toString:Md},Zo=function(e,r,a){var n,s=ge(e),i=se(e),o=ge(a),u,l,f=!1,h=!1,d=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),h=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(s||o||f)&&(u=!s&&!i?"":""+e,l=""+a),f&&(e=u=u.toLowerCase(),a=l=l.toLowerCase()),r){case"*=":n=u.indexOf(l)>=0;break;case"$=":n=u.indexOf(l,u.length-l.length)>=0;break;case"^=":n=u.indexOf(l)===0;break;case"=":n=e===a;break;case">":d=!0,n=e>a;break;case">=":d=!0,n=e>=a;break;case"<":d=!0,n=e<a;break;case"<=":d=!0,n=e<=a;break;default:n=!1;break}return h&&(e!=null||!d)&&(n=!n),n},kd=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Pd=function(e){return e!==void 0},Ai=function(e,r){return e.data(r)},Bd=function(e,r){return e[r]()},Ue=[],Fe=function(e,r){return e.checks.every(function(a){return Ue[a.type](a,r)})};Ue[oe.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};Ue[oe.STATE]=function(t,e){var r=t.value;return Ld(r,e)};Ue[oe.ID]=function(t,e){var r=t.value;return e.id()===r};Ue[oe.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};Ue[oe.META_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return Zo(Bd(e,r),a,n)};Ue[oe.DATA_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return Zo(Ai(e,r),a,n)};Ue[oe.DATA_BOOL]=function(t,e){var r=t.field,a=t.operator;return kd(Ai(e,r),a)};Ue[oe.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Pd(Ai(e,r))};Ue[oe.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),s=e.target();return Fe(r,n)&&Fe(a,s)||Fe(a,n)&&Fe(r,s)};Ue[oe.NODE_NEIGHBOR]=function(t,e){return Fe(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Fe(t.neighbor,r)})};Ue[oe.DIRECTED_EDGE]=function(t,e){return Fe(t.source,e.source())&&Fe(t.target,e.target())};Ue[oe.NODE_SOURCE]=function(t,e){return Fe(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Fe(t.target,r)})};Ue[oe.NODE_TARGET]=function(t,e){return Fe(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Fe(t.source,r)})};Ue[oe.CHILD]=function(t,e){return Fe(t.child,e)&&Fe(t.parent,e.parent())};Ue[oe.PARENT]=function(t,e){return Fe(t.parent,e)&&e.children().some(function(r){return Fe(t.child,r)})};Ue[oe.DESCENDANT]=function(t,e){return Fe(t.descendant,e)&&e.ancestors().some(function(r){return Fe(t.ancestor,r)})};Ue[oe.ANCESTOR]=function(t,e){return Fe(t.ancestor,e)&&e.descendants().some(function(r){return Fe(t.descendant,r)})};Ue[oe.COMPOUND_SPLIT]=function(t,e){return Fe(t.subject,e)&&Fe(t.left,e)&&Fe(t.right,e)};Ue[oe.TRUE]=function(){return!0};Ue[oe.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};Ue[oe.FILTER]=function(t,e){var r=t.value;return r(e)};var Fd=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===oe.ID)return e.getElementById(r[0].checks[0].value).collection();var a=function(s){for(var i=0;i<r.length;i++){var o=r[i];if(Fe(o,s))return!0}return!1};return r.text()==null&&(a=function(){return!0}),e.filter(a)},Gd=function(e){for(var r=this,a=0;a<r.length;a++){var n=r[a];if(Fe(n,e))return!0}return!1},zd={matches:Gd,filter:Fd},rr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||ge(e)&&e.match(/^\s*$/)||(yt(e)?this.addQuery({checks:[{type:oe.COLLECTION,value:e.collection()}]}):ze(e)?this.addQuery({checks:[{type:oe.FILTER,value:e}]}):ge(e)?this.parse(e)||(this.invalid=!0):Ve("A selector must be created from a string; found "))},ar=rr.prototype;[Rd,zd].forEach(function(t){return Ee(ar,t)});ar.text=function(){return this.inputText};ar.size=function(){return this.length};ar.eq=function(t){return this[t]};ar.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};ar.addQuery=function(t){this[this.length++]=t};ar.selector=ar.toString;var Jt={allAre:function(e){var r=new rr(e);return this.every(function(a){return r.matches(a)})},is:function(e){var r=new rr(e);return this.some(function(a){return r.matches(a)})},some:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(n)return!0}return!1},every:function(e,r){for(var a=0;a<this.length;a++){var n=r?e.apply(r,[this[a],a,this]):e(this[a],a,this);if(!n)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,a=e.length;return r!==a?!1:r===1?this[0]===e[0]:this.every(function(n){return e.hasElementWithId(n.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(a){return r.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(a){return r.hasElementWithId(a.id())})}};Jt.allAreNeighbours=Jt.allAreNeighbors;Jt.has=Jt.contains;Jt.equal=Jt.equals=Jt.same;var xt=function(e,r){return function(n,s,i,o){var u=n,l=this,f;if(u==null?f="":yt(u)&&u.length===1&&(f=u.id()),l.length===1&&f){var h=l[0]._private,d=h.traversalCache=h.traversalCache||{},v=d[r]=d[r]||[],c=gr(f),p=v[c];return p||(v[c]=e.call(l,n,s,i,o))}else return e.call(l,n,s,i,o)}},Ur={parent:function(e){var r=[];if(this.length===1){var a=this[0]._private.parent;if(a)return a}for(var n=0;n<this.length;n++){var s=this[n],i=s._private.parent;i&&r.push(i)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],a=this.parent();a.nonempty();){for(var n=0;n<a.length;n++){var s=a[n];r.push(s)}a=a.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,a=0;a<this.length;a++){var n=this[a],s=n.parents();r=r||s,r=r.intersect(s)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:xt(function(t){for(var e=[],r=0;r<this.length;r++)for(var a=this[r],n=a._private.children,s=0;s<n.length;s++)e.push(n[s]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function a(n){for(var s=0;s<n.length;s++){var i=n[s];r.push(i),i.children().nonempty()&&a(i.children())}}return a(this.children()),this.spawn(r,!0).filter(e)}};function Oi(t,e,r,a){for(var n=[],s=new $r,i=t.cy(),o=i.hasCompoundNodes(),u=0;u<t.length;u++){var l=t[u];r?n.push(l):o&&a(n,s,l)}for(;n.length>0;){var f=n.shift();e(f),s.add(f.id()),o&&a(n,s,f)}return t}function Qo(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n<a.length;n++){var s=a[n];e.has(s.id())||t.push(s)}}Ur.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Oi(this,t,e,Qo)};function Jo(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}Ur.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Oi(this,t,e,Jo)};function Vd(t,e,r){Jo(t,e,r),Qo(t,e,r)}Ur.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Oi(this,t,e,Vd)};Ur.ancestors=Ur.parents;var ba,jo;ba=jo={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}};ba.attr=ba.data;ba.removeAttr=ba.removeData;var Ud=jo,Tn={};function Vn(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],s=n._private.edges,i=0;i<s.length;i++){var o=s[i];!e&&o.isLoop()||(a+=t(n,o))}return a}else return}}Ee(Tn,{degree:Vn(function(t,e){return e.source().same(e.target())?2:1}),indegree:Vn(function(t,e){return e.target().same(t)?1:0}),outdegree:Vn(function(t,e){return e.source().same(t)?1:0})});function Sr(t,e){return function(r){for(var a,n=this.nodes(),s=0;s<n.length;s++){var i=n[s],o=i[t](r);o!==void 0&&(a===void 0||e(o,a))&&(a=o)}return a}}Ee(Tn,{minDegree:Sr("degree",function(t,e){return t<e}),maxDegree:Sr("degree",function(t,e){return t>e}),minIndegree:Sr("indegree",function(t,e){return t<e}),maxIndegree:Sr("indegree",function(t,e){return t>e}),minOutdegree:Sr("outdegree",function(t,e){return t<e}),maxOutdegree:Sr("outdegree",function(t,e){return t>e})});Ee(Tn,{totalDegree:function(e){for(var r=0,a=this.nodes(),n=0;n<a.length;n++)r+=a[n].degree(e);return r}});var Nt,eu,tu=function(e,r,a){for(var n=0;n<e.length;n++){var s=e[n];if(!s.locked()){var i=s._private.position,o={x:r.x!=null?r.x-i.x:0,y:r.y!=null?r.y-i.y:0};s.isParent()&&!(o.x===0&&o.y===0)&&s.children().shift(o,a),s.dirtyBoundingBoxCache()}}},ws={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){tu(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Nt=eu={position:Ne.data(ws),silentPosition:Ne.data(Ee({},ws,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){tu(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(De(e))r?this.silentPosition(e):this.position(e);else if(ze(e)){var a=e,n=this.cy();n.startBatch();for(var s=0;s<this.length;s++){var i=this[s],o=void 0;(o=a(i,s))&&(r?i.silentPosition(o):i.position(o))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,a){var n;if(De(e)?(n={x:se(e.x)?e.x:0,y:se(e.y)?e.y:0},a=r):ge(e)&&se(r)&&(n={x:0,y:0},n[e]=r),n!=null){var s=this.cy();s.startBatch();for(var i=0;i<this.length;i++){var o=this[i];if(!(s.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var u=o.position(),l={x:u.x+n.x,y:u.y+n.y};a?o.silentPosition(l):o.position(l)}}s.endBatch()}return this},silentShift:function(e,r){return De(e)?this.shift(e,!0):ge(e)&&se(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var a=this[0],n=this.cy(),s=n.zoom(),i=n.pan(),o=De(e)?e:void 0,u=o!==void 0||r!==void 0&&ge(e);if(a&&a.isNode())if(u)for(var l=0;l<this.length;l++){var f=this[l];r!==void 0?f.position(e,(r-i[e])/s):o!==void 0&&f.position(Lo(o,s,i))}else{var h=a.position();return o=mn(h,s,i),e===void 0?o:o[e]}else if(!u)return;return this},relativePosition:function(e,r){var a=this[0],n=this.cy(),s=De(e)?e:void 0,i=s!==void 0||r!==void 0&&ge(e),o=n.hasCompoundNodes();if(a&&a.isNode())if(i)for(var u=0;u<this.length;u++){var l=this[u],f=o?l.parent():null,h=f&&f.length>0,d=h;h&&(f=f[0]);var v=d?f.position():{x:0,y:0};r!==void 0?l.position(e,r+v[e]):s!==void 0&&l.position({x:s.x+v.x,y:s.y+v.y})}else{var c=a.position(),p=o?a.parent():null,g=p&&p.length>0,y=g;g&&(p=p[0]);var b=y?p.position():{x:0,y:0};return s={x:c.x-b.x,y:c.y-b.y},e===void 0?s:s[e]}else if(!i)return;return this}};Nt.modelPosition=Nt.point=Nt.position;Nt.modelPositions=Nt.points=Nt.positions;Nt.renderedPoint=Nt.renderedPosition;Nt.relativePoint=Nt.relativePosition;var $d=eu,Fr,sr;Fr=sr={};sr.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),s=e.x1*a+n.x,i=e.x2*a+n.x,o=e.y1*a+n.y,u=e.y2*a+n.y;return{x1:s,x2:i,y1:o,y2:u,w:i-s,h:u-o}};sr.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)};sr.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(i){if(!i.isParent())return;var o=i._private,u=i.children(),l=i.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:i.pstyle("min-width").pfValue,left:i.pstyle("min-width-bias-left"),right:i.pstyle("min-width-bias-right")},height:{val:i.pstyle("min-height").pfValue,top:i.pstyle("min-height-bias-top"),bottom:i.pstyle("min-height-bias-bottom")}},h=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),d=o.position;(h.w===0||h.h===0)&&(h={w:i.pstyle("width").pfValue,h:i.pstyle("height").pfValue},h.x1=d.x-h.w/2,h.x2=d.x+h.w/2,h.y1=d.y-h.h/2,h.y2=d.y+h.h/2);function v(w,D,L){var A=0,N=0,O=D+L;return w>0&&O>0&&(A=D/O*w,N=L/O*w),{biasDiff:A,biasComplementDiff:N}}function c(w,D,L,A){if(L.units==="%")switch(A){case"width":return w>0?L.pfValue*w:0;case"height":return D>0?L.pfValue*D:0;case"average":return w>0&&D>0?L.pfValue*(w+D)/2:0;case"min":return w>0&&D>0?w>D?L.pfValue*D:L.pfValue*w:0;case"max":return w>0&&D>0?w>D?L.pfValue*w:L.pfValue*D:0;default:return 0}else return L.units==="px"?L.pfValue:0}var p=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(p=p*100/f.width.val);var g=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(g=g*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 m=v(f.width.val-h.w,p,g),T=m.biasDiff,C=m.biasComplementDiff,S=v(f.height.val-h.h,y,b),E=S.biasDiff,x=S.biasComplementDiff;o.autoPadding=c(h.w,h.h,i.pstyle("padding"),i.pstyle("padding-relative-to").value),o.autoWidth=Math.max(h.w,f.width.val),d.x=(-T+h.x1+h.x2+C)/2,o.autoHeight=Math.max(h.h,f.height.val),d.y=(-E+h.y1+h.y2+x)/2}for(var a=0;a<this.length;a++){var n=this[a],s=n._private;(!s.compoundBoundsClean||t)&&(r(n),e.batching()||(s.compoundBoundsClean=!0))}return this};var wt=function(e){return e===1/0||e===-1/0?0:e},At=function(e,r,a,n,s){n-r===0||s-a===0||r==null||a==null||n==null||s==null||(e.x1=r<e.x1?r:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=a<e.y1?a:e.y1,e.y2=s>e.y2?s:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},fr=function(e,r){return r==null?e:At(e,r.x1,r.y1,r.x2,r.y2)},ra=function(e,r,a){return Ot(e,r,a)},za=function(e,r,a){if(!r.cy().headless()){var n=r._private,s=n.rstyle,i=s.arrowWidth/2,o=r.pstyle(a+"-arrow-shape").value,u,l;if(o!=="none"){a==="source"?(u=s.srcX,l=s.srcY):a==="target"?(u=s.tgtX,l=s.tgtY):(u=s.midX,l=s.midY);var f=n.arrowBounds=n.arrowBounds||{},h=f[a]=f[a]||{};h.x1=u-i,h.y1=l-i,h.x2=u+i,h.y2=l+i,h.w=h.x2-h.x1,h.h=h.y2-h.y1,Ha(h,1),At(e,h.x1,h.y1,h.x2,h.y2)}}},Un=function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var s=r._private,i=s.rstyle,o=r.pstyle(n+"label").strValue;if(o){var u=r.pstyle("text-halign"),l=r.pstyle("text-valign"),f=ra(i,"labelWidth",a),h=ra(i,"labelHeight",a),d=ra(i,"labelX",a),v=ra(i,"labelY",a),c=r.pstyle(n+"text-margin-x").pfValue,p=r.pstyle(n+"text-margin-y").pfValue,g=r.isEdge(),y=r.pstyle(n+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,m=r.pstyle("text-border-width").pfValue,T=m/2,C=r.pstyle("text-background-padding").pfValue,S=2,E=h,x=f,w=x/2,D=E/2,L,A,N,O;if(g)L=d-w,A=d+w,N=v-D,O=v+D;else{switch(u.value){case"left":L=d-x,A=d;break;case"center":L=d-w,A=d+w;break;case"right":L=d,A=d+x;break}switch(l.value){case"top":N=v-E,O=v;break;case"center":N=v-D,O=v+D;break;case"bottom":N=v,O=v+E;break}}L+=c-Math.max(b,T)-C-S,A+=c+Math.max(b,T)+C+S,N+=p-Math.max(b,T)-C-S,O+=p+Math.max(b,T)+C+S;var M=a||"main",R=s.labelBounds,k=R[M]=R[M]||{};k.x1=L,k.y1=N,k.x2=A,k.y2=O,k.w=A-L,k.h=O-N;var P=g&&y.strValue==="autorotate",B=y.pfValue!=null&&y.pfValue!==0;if(P||B){var z=P?ra(s.rstyle,"labelAngle",a):y.pfValue,G=Math.cos(z),F=Math.sin(z),U=(L+A)/2,H=(N+O)/2;if(!g){switch(u.value){case"left":U=A;break;case"right":U=L;break}switch(l.value){case"top":H=O;break;case"bottom":H=N;break}}var Y=function(ve,ae){return ve=ve-U,ae=ae-H,{x:ve*G-ae*F+U,y:ve*F+ae*G+H}},Q=Y(L,N),J=Y(L,O),q=Y(A,N),V=Y(A,O);L=Math.min(Q.x,J.x,q.x,V.x),A=Math.max(Q.x,J.x,q.x,V.x),N=Math.min(Q.y,J.y,q.y,V.y),O=Math.max(Q.y,J.y,q.y,V.y)}var Z=M+"Rot",K=R[Z]=R[Z]||{};K.x1=L,K.y1=N,K.x2=A,K.y2=O,K.w=A-L,K.h=O-N,At(e,L,N,A,O),At(s.labelBounds.all,L,N,A,O)}return e}},Yd=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 s=r.pstyle("outline-offset").value,i=r.pstyle("shape").value,o=n+s,u=(e.w+o*2)/e.w,l=(e.h+o*2)/e.h,f=0,h=0;["diamond","pentagon","round-triangle"].includes(i)?(u=(e.w+o*2.4)/e.w,h=-o/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(i)?u=(e.w+o*2.4)/e.w:i==="star"?(u=(e.w+o*2.8)/e.w,l=(e.h+o*2.6)/e.h,h=-o/3.8):i==="triangle"?(u=(e.w+o*2.8)/e.w,l=(e.h+o*2.4)/e.h,h=-o/1.4):i==="vee"&&(u=(e.w+o*4.4)/e.w,l=(e.h+o*3.8)/e.h,h=-o*.5);var d=e.h*l-e.h,v=e.w*u-e.w;if(Xa(e,[Math.ceil(d/2),Math.ceil(v/2)]),f!=0||h!==0){var c=fh(e,f,h);Oo(e,c)}}}},_d=function(e,r){var a=e._private.cy,n=a.styleEnabled(),s=a.headless(),i=pt(),o=e._private,u=e.isNode(),l=e.isEdge(),f,h,d,v,c,p,g=o.rstyle,y=u&&n?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.pstyle("display").value!=="none"},m=!n||b(e)&&(!l||b(e.source())&&b(e.target()));if(m){var T=0,C=0;n&&r.includeOverlays&&(T=e.pstyle("overlay-opacity").value,T!==0&&(C=e.pstyle("overlay-padding").value));var S=0,E=0;n&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(E=e.pstyle("underlay-padding").value));var x=Math.max(C,E),w=0,D=0;if(n&&(w=e.pstyle("width").pfValue,D=w/2),u&&r.includeNodes){var L=e.position();c=L.x,p=L.y;var A=e.outerWidth(),N=A/2,O=e.outerHeight(),M=O/2;f=c-N,h=c+N,d=p-M,v=p+M,At(i,f,d,h,v),n&&r.includeOutlines&&Yd(i,e)}else if(l&&r.includeEdges)if(n&&!s){var R=e.pstyle("curve-style").strValue;if(f=Math.min(g.srcX,g.midX,g.tgtX),h=Math.max(g.srcX,g.midX,g.tgtX),d=Math.min(g.srcY,g.midY,g.tgtY),v=Math.max(g.srcY,g.midY,g.tgtY),f-=D,h+=D,d-=D,v+=D,At(i,f,d,h,v),R==="haystack"){var k=g.haystackPts;if(k&&k.length===2){if(f=k[0].x,d=k[0].y,h=k[1].x,v=k[1].y,f>h){var P=f;f=h,h=P}if(d>v){var B=d;d=v,v=B}At(i,f-D,d-D,h+D,v+D)}}else if(R==="bezier"||R==="unbundled-bezier"||R.endsWith("segments")||R.endsWith("taxi")){var z;switch(R){case"bezier":case"unbundled-bezier":z=g.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=g.linePts;break}if(z!=null)for(var G=0;G<z.length;G++){var F=z[G];f=F.x-D,h=F.x+D,d=F.y-D,v=F.y+D,At(i,f,d,h,v)}}}else{var U=e.source(),H=U.position(),Y=e.target(),Q=Y.position();if(f=H.x,h=Q.x,d=H.y,v=Q.y,f>h){var J=f;f=h,h=J}if(d>v){var q=d;d=v,v=q}f-=D,h+=D,d-=D,v+=D,At(i,f,d,h,v)}if(n&&r.includeEdges&&l&&(za(i,e,"mid-source"),za(i,e,"mid-target"),za(i,e,"source"),za(i,e,"target")),n){var V=e.pstyle("ghost").value==="yes";if(V){var Z=e.pstyle("ghost-offset-x").pfValue,K=e.pstyle("ghost-offset-y").pfValue;At(i,i.x1+Z,i.y1+K,i.x2+Z,i.y2+K)}}var ie=o.bodyBounds=o.bodyBounds||{};es(ie,i),Xa(ie,y),Ha(ie,1),n&&(f=i.x1,h=i.x2,d=i.y1,v=i.y2,At(i,f-x,d-x,h+x,v+x));var ve=o.overlayBounds=o.overlayBounds||{};es(ve,i),Xa(ve,y),Ha(ve,1);var ae=o.labelBounds=o.labelBounds||{};ae.all!=null?lh(ae.all):ae.all=pt(),n&&r.includeLabels&&(r.includeMainLabels&&Un(i,e,null),l&&(r.includeSourceLabels&&Un(i,e,"source"),r.includeTargetLabels&&Un(i,e,"target")))}return i.x1=wt(i.x1),i.y1=wt(i.y1),i.x2=wt(i.x2),i.y2=wt(i.y2),i.w=wt(i.x2-i.x1),i.h=wt(i.y2-i.y1),i.w>0&&i.h>0&&m&&(Xa(i,y),Ha(i,1)),i},ru=function(e){var r=0,a=function(i){return(i?1:0)<<r++},n=0;return n+=a(e.incudeNodes),n+=a(e.includeEdges),n+=a(e.includeLabels),n+=a(e.includeMainLabels),n+=a(e.includeSourceLabels),n+=a(e.includeTargetLabels),n+=a(e.includeOverlays),n+=a(e.includeOutlines),n},au=function(e){if(e.isEdge()){var r=e.source().position(),a=e.target().position(),n=function(i){return Math.round(i)};return Nf([n(r.x),n(r.y),n(a.x),n(a.y)])}else return 0},xs=function(e,r){var a=e._private,n,s=e.isEdge(),i=r==null?Ts:ru(r),o=i===Ts,u=au(e),l=a.bbCachePosKey===u,f=r.useCache&&l,h=function(p){return p._private.bbCache==null||p._private.styleDirty},d=!f||h(e)||s&&h(e.source())||h(e.target());if(d?(l||e.recalculateRenderedStyle(f),n=_d(e,Ea),a.bbCache=n,a.bbCachePosKey=u):n=a.bbCache,!o){var v=e.isNode();n=pt(),(r.includeNodes&&v||r.includeEdges&&!v)&&(r.includeOverlays?fr(n,a.overlayBounds):fr(n,a.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!s||r.includeSourceLabels&&r.includeTargetLabels)?fr(n,a.labelBounds.all):(r.includeMainLabels&&fr(n,a.labelBounds.mainRot),r.includeSourceLabels&&fr(n,a.labelBounds.sourceRot),r.includeTargetLabels&&fr(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Ea={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Ts=ru(Ea),Cs=rt(Ea);sr.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=Ea:t=Cs(t),e=xs(this[0],t);else{e=pt(),t=t||Ea;var r=Cs(t),a=this,n=a.cy(),s=n.styleEnabled();if(s)for(var i=0;i<a.length;i++){var o=a[i],u=o._private,l=au(o),f=u.bbCachePosKey===l,h=r.useCache&&f&&!u.styleDirty;o.recalculateRenderedStyle(h)}this.updateCompoundBounds(!t.useCache);for(var d=0;d<a.length;d++){var v=a[d];fr(e,xs(v,r))}}return e.x1=wt(e.x1),e.y1=wt(e.y1),e.x2=wt(e.x2),e.y2=wt(e.y2),e.w=wt(e.x2-e.x1),e.h=wt(e.y2-e.y1),e};sr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};sr.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a&&(n=e.filter(function(l){return l.isParent()}),e=e.not(n)),De(t)){var s=t;t=function(){return s}}var i=function(f,h){return f._private.bbAtOldPos=t(f,h)},o=function(f){return f._private.bbAtOldPos};r.startBatch(),e.forEach(i).silentPositions(t),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var u=uh(this.boundingBox({useCache:!1}));return e.silentPositions(o),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),u};Fr.boundingbox=Fr.bb=Fr.boundingBox;Fr.renderedBoundingbox=Fr.renderedBoundingBox;var Hd=sr,ua,La;ua=La={};var nu=function(e){e.uppercaseName=qi(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=qi(e.outerName),ua[e.name]=function(){var a=this[0],n=a._private,s=n.cy,i=s._private.styleEnabled;if(a)if(i){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var o=a.pstyle(e.name);switch(o.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},ua["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,s=n.cy,i=s._private.styleEnabled;if(a)if(i){var o=a[e.name](),u=a.pstyle("border-width").pfValue,l=2*a.padding();return o+u+l}else return 1},ua["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},ua["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};nu({name:"width"});nu({name:"height"});La.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};La.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};La.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var Xd=La,qd=function(e,r){if(e.isEdge())return r(e)},Wd=function(e,r){if(e.isEdge()){var a=e.cy();return mn(r(e),a.zoom(),a.pan())}},Kd=function(e,r){if(e.isEdge()){var a=e.cy(),n=a.pan(),s=a.zoom();return r(e).map(function(i){return mn(i,s,n)})}},Zd=function(e){return e.renderer().getControlPoints(e)},Qd=function(e){return e.renderer().getSegmentPoints(e)},Jd=function(e){return e.renderer().getSourceEndpoint(e)},jd=function(e){return e.renderer().getTargetEndpoint(e)},eg=function(e){return e.renderer().getEdgeMidpoint(e)},Ds={controlPoints:{get:Zd,mult:!0},segmentPoints:{get:Qd,mult:!0},sourceEndpoint:{get:Jd},targetEndpoint:{get:jd},midpoint:{get:eg}},tg=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},rg=Object.keys(Ds).reduce(function(t,e){var r=Ds[e],a=tg(e);return t[e]=function(){return qd(this,r.get)},r.mult?t[a]=function(){return Kd(this,r.get)}:t[a]=function(){return Wd(this,r.get)},t},{}),ag=Ee({},$d,Hd,Xd,rg);/*!
|
||
Event object based on jQuery events, MIT license
|
||
|
||
https://jquery.org/license/
|
||
https://tldrlegal.com/license/mit-license
|
||
https://github.com/jquery/jquery/blob/master/src/event.js
|
||
*/var iu=function(e,r){this.recycle(e,r)};function aa(){return!1}function Va(){return!0}iu.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=aa,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Va:aa):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var a=this.position,n=this.cy.zoom(),s=this.cy.pan();this.renderedPosition={x:a.x*n+s.x,y:a.y*n+s.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Va;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Va;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Va,this.stopPropagation()},isDefaultPrevented:aa,isPropagationStopped:aa,isImmediatePropagationStopped:aa};var su=/^([^.]+)(\.(?:[^.]+))?$/,ng=".*",ou={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Ss=Object.keys(ou),ig={};function Cn(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ig,e=arguments.length>1?arguments[1]:void 0,r=0;r<Ss.length;r++){var a=Ss[r];this[a]=t[a]||ou[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var nr=Cn.prototype,uu=function(e,r,a,n,s,i,o){ze(n)&&(s=n,n=null),o&&(i==null?i=o:i=Ee({},i,o));for(var u=ke(a)?a:a.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!er(f)){var h=f.match(su);if(h){var d=h[1],v=h[2]?h[2]:null,c=r(e,f,d,v,n,s,i);if(c===!1)break}}}},Ls=function(e,r){return e.addEventFields(e.context,r),new iu(r.type,r)},sg=function(e,r,a){if(Dl(a)){r(e,a);return}else if(De(a)){r(e,Ls(e,a));return}for(var n=ke(a)?a:a.split(/\s+/),s=0;s<n.length;s++){var i=n[s];if(!er(i)){var o=i.match(su);if(o){var u=o[1],l=o[2]?o[2]:null,f=Ls(e,{type:u,namespace:l,target:e.context});r(e,f)}}}};nr.on=nr.addListener=function(t,e,r,a,n){return uu(this,function(s,i,o,u,l,f,h){ze(f)&&s.listeners.push({event:i,callback:f,type:o,namespace:u,qualifier:l,conf:h})},t,e,r,a,n),this};nr.one=function(t,e,r,a){return this.on(t,e,r,a,{one:!0})};nr.removeListener=nr.off=function(t,e,r,a){var n=this;this.emitting!==0&&(this.listeners=Pf(this.listeners));for(var s=this.listeners,i=function(l){var f=s[l];uu(n,function(h,d,v,c,p,g){if((f.type===v||t==="*")&&(!c&&f.namespace!==".*"||f.namespace===c)&&(!p||h.qualifierCompare(f.qualifier,p))&&(!g||f.callback===g))return s.splice(l,1),!1},t,e,r,a)},o=s.length-1;o>=0;o--)i(o);return this};nr.removeAllListeners=function(){return this.removeListener("*")};nr.emit=nr.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,ke(e)||(e=[e]),sg(this,function(s,i){r!=null&&(a=[{event:i.event,type:i.type,namespace:i.namespace,callback:r}],n=a.length);for(var o=function(f){var h=a[f];if(h.type===i.type&&(!h.namespace||h.namespace===i.namespace||h.namespace===ng)&&s.eventMatches(s.context,h,i)){var d=[i];e!=null&&Ff(d,e),s.beforeEmit(s.context,h,i),h.conf&&h.conf.one&&(s.listeners=s.listeners.filter(function(p){return p!==h}));var v=s.callbackContext(s.context,h,i),c=h.callback.apply(v,d);s.afterEmit(s.context,h,i),c===!1&&(i.stopPropagation(),i.preventDefault())}},u=0;u<n;u++)o(u);s.bubble(s.context)&&!i.isPropagationStopped()&&s.parent(s.context).emit(i,e)},t),this.emitting--,this};var og={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&&Ca(a.target)&&n.matches(a.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,a){return r.qualifier!=null?a.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Ua=function(e){return ge(e)?new rr(e):e},lu={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;a.emitter||(a.emitter=new Cn(og,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){for(var n=Ua(r),s=0;s<this.length;s++){var i=this[s];i.emitter().on(e,n,a)}return this},removeListener:function(e,r,a){for(var n=Ua(r),s=0;s<this.length;s++){var i=this[s];i.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,a){for(var n=Ua(r),s=0;s<this.length;s++){var i=this[s];i.emitter().one(e,n,a)}return this},once:function(e,r,a){for(var n=Ua(r),s=0;s<this.length;s++){var i=this[s];i.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,r){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};Ne.eventAliasesOn(lu);var fu={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):r.push(n)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(ge(e)||yt(e))return new rr(e).filter(this);if(ze(e)){for(var a=this.spawn(),n=this,s=0;s<n.length;s++){var i=n[s],o=r?e.apply(r,[i,s,n]):e(i,s,n);o&&a.push(i)}return a}return this.spawn()},not:function(e){if(e){ge(e)&&(e=this.filter(e));for(var r=this.spawn(),a=0;a<this.length;a++){var n=this[a],s=e.has(n);s||r.push(n)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(ge(e)){var r=e;return this.filter(r)}for(var a=this.spawn(),n=this,s=e,i=this.length<e.length,o=i?n:s,u=i?s:n,l=0;l<o.length;l++){var f=o[l];u.has(f)&&a.push(f)}return a},xor:function(e){var r=this._private.cy;ge(e)&&(e=r.$(e));var a=this.spawn(),n=this,s=e,i=function(u,l){for(var f=0;f<u.length;f++){var h=u[f],d=h._private.data.id,v=l.hasElementWithId(d);v||a.push(h)}};return i(n,s),i(s,n),a},diff:function(e){var r=this._private.cy;ge(e)&&(e=r.$(e));var a=this.spawn(),n=this.spawn(),s=this.spawn(),i=this,o=e,u=function(f,h,d){for(var v=0;v<f.length;v++){var c=f[v],p=c._private.data.id,g=h.hasElementWithId(p);g?s.merge(c):d.push(c)}};return u(i,o,a),u(o,i,n),{left:a,right:n,both:s}},add:function(e){var r=this._private.cy;if(!e)return this;if(ge(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=this.spawnSelf(),s=0;s<e.length;s++){var i=e[s],o=!this.has(i);o&&n.push(i)}return n},merge:function(e){var r=this._private,a=r.cy;if(!e)return this;if(e&&ge(e)){var n=e;e=a.mutableElements().filter(n)}for(var s=r.map,i=0;i<e.length;i++){var o=e[i],u=o._private.data.id,l=!s.has(u);if(l){var f=this.length++;this[f]=o,s.set(u,{ele:o,index:f})}}return this},unmergeAt:function(e){var r=this[e],a=r.id(),n=this._private,s=n.map;this[e]=void 0,s.delete(a);var i=e===this.length-1;if(this.length>1&&!i){var o=this.length-1,u=this[o],l=u._private.data.id;this[o]=void 0,this[e]=u,s.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map,s=n.get(a);if(!s)return this;var i=s.index;return this.unmergeAt(i),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&ge(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var a=this[r];e(a)&&this.unmergeAt(r)}return this},map:function(e,r){for(var a=[],n=this,s=0;s<n.length;s++){var i=n[s],o=r?e.apply(r,[i,s,n]):e(i,s,n);a.push(o)}return a},reduce:function(e,r){for(var a=r,n=this,s=0;s<n.length;s++)a=e(a,n[s],s,n);return a},max:function(e,r){for(var a=-1/0,n,s=this,i=0;i<s.length;i++){var o=s[i],u=r?e.apply(r,[o,i,s]):e(o,i,s);u>a&&(a=u,n=o)}return{value:a,ele:n}},min:function(e,r){for(var a=1/0,n,s=this,i=0;i<s.length;i++){var o=s[i],u=r?e.apply(r,[o,i,s]):e(o,i,s);u<a&&(a=u,n=o)}return{value:a,ele:n}}},Ae=fu;Ae.u=Ae["|"]=Ae["+"]=Ae.union=Ae.or=Ae.add;Ae["\\"]=Ae["!"]=Ae["-"]=Ae.difference=Ae.relativeComplement=Ae.subtract=Ae.not;Ae.n=Ae["&"]=Ae["."]=Ae.and=Ae.intersection=Ae.intersect;Ae["^"]=Ae["(+)"]=Ae["(-)"]=Ae.symmetricDifference=Ae.symdiff=Ae.xor;Ae.fnFilter=Ae.filterFn=Ae.stdFilter=Ae.filter;Ae.complement=Ae.abscomp=Ae.absoluteComplement;var ug={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},hu=function(e,r){var a=e.cy(),n=a.hasCompoundNodes();function s(f){var h=f.pstyle("z-compound-depth");return h.value==="auto"?n?f.zDepth():0:h.value==="bottom"?-1:h.value==="top"?mi:0}var i=s(e)-s(r);if(i!==0)return i;function o(f){var h=f.pstyle("z-index-compare");return h.value==="auto"&&f.isNode()?1:0}var u=o(e)-o(r);if(u!==0)return u;var l=e.pstyle("z-index").value-r.pstyle("z-index").value;return l!==0?l:e.poolIndex()-r.poolIndex()},ln={forEach:function(e,r){if(ze(e))for(var a=this.length,n=0;n<a;n++){var s=this[n],i=r?e.apply(r,[s,n,this]):e(s,n,this);if(i===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var a=[],n=this.length;r==null&&(r=n),e==null&&(e=0),e<0&&(e=n+e),r<0&&(r=n+r);for(var s=e;s>=0&&s<r&&s<n;s++)a.push(this[s]);return this.spawn(a)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!ze(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(hu)},zDepth:function(){var e=this[0];if(e){var r=e._private,a=r.group;if(a==="nodes"){var n=r.data.parent?e.parents().size():0;return e.isParent()?n:mi-1}else{var s=r.source,i=r.target,o=s.zDepth(),u=i.zDepth();return Math.max(o,u,0)}}}};ln.each=ln.forEach;var lg=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":qe(Symbol))!=e&&qe(Symbol.iterator)!=e;r&&(ln[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},s=0,i=this.length;return so({next:function(){return s<i?n.value=a[s++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};lg();var fg=rt({nodeDimensionsIncludeLabels:!1}),Wa={layoutDimensions:function(e){e=fg(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();r={w:a.w,h:a.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,a){var n=this.nodes().filter(function(C){return!C.isParent()}),s=this.cy(),i=r.eles,o=function(S){return S.id()},u=va(a,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(S,E,x){var w={x:E.x1+E.w/2,y:E.y1+E.h/2},D={x:(x.x-w.x)*S,y:(x.y-w.y)*S};return{x:w.x+D.x,y:w.y+D.y}},f=r.spacingFactor&&r.spacingFactor!==1,h=function(){if(!f)return null;for(var S=pt(),E=0;E<n.length;E++){var x=n[E],w=u(x,E);hh(S,w.x,w.y)}return S},d=h(),v=va(function(C,S){var E=u(C,S);if(f){var x=Math.abs(r.spacingFactor);E=l(x,d,E)}return r.transform!=null&&(E=r.transform(C,E)),E},o);if(r.animate){for(var c=0;c<n.length;c++){var p=n[c],g=v(p,c),y=r.animateFilter==null||r.animateFilter(p,c);if(y){var b=p.animation({position:g,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else p.position(g)}if(r.fit){var m=s.animation({fit:{boundingBox:i.boundingBoxAt(v),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(m)}else if(r.zoom!==void 0&&r.pan!==void 0){var T=s.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(T)}e.animations.forEach(function(C){return C.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Yr.all(e.animations.map(function(C){return C.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(v),r.fit&&s.fit(r.eles,r.padding),r.zoom!=null&&s.zoom(r.zoom),r.pan&&s.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(Ee({},e,{eles:this}))}};Wa.createLayout=Wa.makeLayout=Wa.layout;function vu(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],s;return(s=n[t])!=null||(s=n[t]=e(r)),s}function Dn(t,e){return t=gr(t),function(a){return vu(t,e,a)}}function Sn(t,e){t=gr(t);var r=function(n){return e.call(n)};return function(){var n=this[0];if(n)return vu(t,r,n)}}var et={recalculateRenderedStyle:function(e){var r=this.cy(),a=r.renderer(),n=r.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(s){return s._private.styleCache=null};if(e.hasCompoundNodes()){var a;a=this.spawnSelf().merge(this.descendants()).merge(this.parents()),a.merge(a.connectedEdges()),a.forEach(r)}else this.forEach(function(n){r(n),n.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var a=r._private.batchStyleEles;return a.merge(this),this}var n=r.hasCompoundNodes(),s=this;e=!!(e||e===void 0),n&&(s=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=s;return e?i.emitAndNotify("style"):i.emit("style"),s.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var a=this[r];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){this.cleanStyle();var s=a._private.style[e];return s??(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,s=a.style();if(De(e)){var i=e;s.applyBypass(this,i,n),this.emitAndNotify("style")}else if(ge(e))if(r===void 0){var o=this[0];return o?s.getStylePropertyValue(o,e):void 0}else s.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?s.getRawStyle(u):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),s=this;if(e===void 0)for(var i=0;i<s.length;i++){var o=s[i];n.removeAllBypasses(o,a)}else{e=e.split(/\s+/);for(var u=0;u<s.length;u++){var l=s[u];n.removeBypasses(l,e,a)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,s=a.pstyle("opacity").value;if(!r)return s;var i=n.data.parent?a.parents():null;if(i)for(var o=0;o<i.length;o++){var u=i[o],l=u.pstyle("opacity").value;s=l*s}return s}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],a=r.cy().hasCompoundNodes();if(r)return a?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function $n(t,e){var r=t._private,a=r.data.parent?t.parents():null;if(a)for(var n=0;n<a.length;n++){var s=a[n];if(!e(s))return!1}return!0}function Ni(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,a=t.parentOk||t.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var s=this[0],i=n.hasCompoundNodes();if(s){var o=s._private;if(!e(s))return!1;if(s.isNode())return!i||$n(s,a);var u=o.source,l=o.target;return r(u)&&(!i||$n(u,r))&&(u===l||r(l)&&(!i||$n(l,r)))}}}var qr=Dn("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});et.takesUpSpace=Sn("takesUpSpace",Ni({ok:qr}));var hg=Dn("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&qr(t)}),vg=Dn("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&qr(t)});et.interactive=Sn("interactive",Ni({ok:hg,parentOk:vg,edgeOkViaNode:qr}));et.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var cg=Dn("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&qr(t)}),dg=qr;et.visible=Sn("visible",Ni({ok:cg,edgeOkViaNode:dg}));et.hidden=function(){var t=this[0];if(t)return!t.visible()};et.isBundledBezier=Sn("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});et.bypass=et.css=et.style;et.renderedCss=et.renderedStyle;et.removeBypass=et.removeCss=et.removeStyle;et.pstyle=et.parsedStyle;var jt={};function As(t){return function(){var e=arguments,r=[];if(e.length===2){var a=e[0],n=e[1];this.on(t.event,a,n)}else if(e.length===1&&ze(e[0])){var s=e[0];this.on(t.event,s)}else if(e.length===0||e.length===1&&ke(e[0])){for(var i=e.length===1?e[0]:null,o=0;o<this.length;o++){var u=this[o],l=!t.ableField||u._private[t.ableField],f=u._private[t.field]!=t.value;if(t.overrideAble){var h=t.overrideAble(u);if(h!==void 0&&(l=h,!h))return this}l&&(u._private[t.field]=t.value,f&&r.push(u))}var d=this.spawn(r);d.updateStyle(),d.emit(t.event),i&&d.emit(i)}return this}}function Wr(t){jt[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},jt[t.on]=As({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),jt[t.off]=As({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Wr({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Wr({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Wr({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Wr({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});jt.deselect=jt.unselect;jt.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Wr({field:"active",on:"activate",off:"unactivate"});Wr({field:"pannable",on:"panify",off:"unpanify"});jt.inactive=function(){var t=this[0];if(t)return!t._private.active};var st={},Os=function(e){return function(a){for(var n=this,s=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode()){for(var u=!1,l=o.connectedEdges(),f=0;f<l.length;f++){var h=l[f],d=h.source(),v=h.target();if(e.noIncomingEdges&&v===o&&d!==o||e.noOutgoingEdges&&d===o&&v!==o){u=!0;break}}u||s.push(o)}}return this.spawn(s,!0).filter(a)}},Ns=function(e){return function(r){for(var a=this,n=[],s=0;s<a.length;s++){var i=a[s];if(i.isNode())for(var o=i.connectedEdges(),u=0;u<o.length;u++){var l=o[u],f=l.source(),h=l.target();e.outgoing&&f===i?(n.push(l),n.push(h)):e.incoming&&h===i&&(n.push(l),n.push(f))}}return this.spawn(n,!0).filter(r)}},Is=function(e){return function(r){for(var a=this,n=[],s={};;){var i=e.outgoing?a.outgoers():a.incomers();if(i.length===0)break;for(var o=!1,u=0;u<i.length;u++){var l=i[u],f=l.id();s[f]||(s[f]=!0,n.push(l),o=!0)}if(!o)break;a=i}return this.spawn(n,!0).filter(r)}};st.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Ee(st,{roots:Os({noIncomingEdges:!0}),leaves:Os({noOutgoingEdges:!0}),outgoers:xt(Ns({outgoing:!0}),"outgoers"),successors:Is({outgoing:!0}),incomers:xt(Ns({incoming:!0}),"incomers"),predecessors:Is({incoming:!0})});Ee(st,{neighborhood:xt(function(t){for(var e=[],r=this.nodes(),a=0;a<r.length;a++)for(var n=r[a],s=n.connectedEdges(),i=0;i<s.length;i++){var o=s[i],u=o.source(),l=o.target(),f=n===u?l:u;f.length>0&&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)}});st.neighbourhood=st.neighborhood;st.closedNeighbourhood=st.closedNeighborhood;st.openNeighbourhood=st.openNeighborhood;Ee(st,{source:xt(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"source"),target:xt(function(e){var r=this[0],a;return r&&(a=r._private.target||r.cy().collection()),a&&e?a.filter(e):a},"target"),sources:Ms({attr:"source"}),targets:Ms({attr:"target"})});function Ms(t){return function(r){for(var a=[],n=0;n<this.length;n++){var s=this[n],i=s._private[t.attr];i&&a.push(i)}return this.spawn(a,!0).filter(r)}}Ee(st,{edgesWith:xt(Rs(),"edgesWith"),edgesTo:xt(Rs({thisIsSrc:!0}),"edgesTo")});function Rs(t){return function(r){var a=[],n=this._private.cy,s=t||{};ge(r)&&(r=n.$(r));for(var i=0;i<r.length;i++)for(var o=r[i]._private.edges,u=0;u<o.length;u++){var l=o[u],f=l._private.data,h=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),d=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),v=h||d;v&&((s.thisIsSrc||s.thisIsTgt)&&(s.thisIsSrc&&!h||s.thisIsTgt&&!d)||a.push(l))}return this.spawn(a,!0)}}Ee(st,{connectedEdges:xt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];if(n.isNode())for(var s=n._private.edges,i=0;i<s.length;i++){var o=s[i];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:xt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:xt(ks(),"parallelEdges"),codirectedEdges:xt(ks({codirected:!0}),"codirectedEdges")});function ks(t){var e={codirected:!1};return t=Ee({},e,t),function(a){for(var n=[],s=this.edges(),i=t,o=0;o<s.length;o++)for(var u=s[o],l=u._private,f=l.source,h=f._private.data.id,d=l.data.target,v=f._private.edges,c=0;c<v.length;c++){var p=v[c],g=p._private.data,y=g.target,b=g.source,m=y===d&&b===h,T=h===y&&d===b;(i.codirected&&m||!i.codirected&&(m||T))&&n.push(p)}return this.spawn(n,!0).filter(a)}}Ee(st,{components:function(e){var r=this,a=r.cy(),n=a.collection(),s=e==null?r.nodes():e.nodes(),i=[];e!=null&&s.empty()&&(s=e.sources());var o=function(f,h){n.merge(f),s.unmerge(f),h.merge(f)};if(s.empty())return r.spawn();var u=function(){var f=a.collection();i.push(f);var h=s[0];o(h,f),r.bfs({directed:!1,roots:h,visit:function(v){return o(v,f)}}),f.forEach(function(d){d.connectedEdges().forEach(function(v){r.has(v)&&f.has(v.source())&&f.has(v.target())&&f.merge(v)})})};do u();while(s.length>0);return i},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});st.componentsOf=st.components;var tt=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Ve("A collection must have a reference to the core");return}var s=new Ft,i=!1;if(!r)r=[];else if(r.length>0&&De(r[0])&&!Ca(r[0])){i=!0;for(var o=[],u=new $r,l=0,f=r.length;l<f;l++){var h=r[l];h.data==null&&(h.data={});var d=h.data;if(d.id==null)d.id=Do();else if(e.hasElementWithId(d.id)||u.has(d.id))continue;var v=new yn(e,h,!1);o.push(v),u.add(d.id)}r=o}this.length=0;for(var c=0,p=r.length;c<p;c++){var g=r[c][0];if(g!=null){var y=g._private.data.id;(!a||!s.has(y))&&(a&&s.set(y,{index:this.length,ele:g}),this[this.length]=g,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var m=this.lazyMap=new Ft,T=this.eles,C=0;C<T.length;C++){var S=T[C];m.set(S.id(),{index:C,ele:S})}}},a&&(this._private.map=s),i&&!n&&this.restore()},Be=yn.prototype=tt.prototype=Object.create(Array.prototype);Be.instanceString=function(){return"collection"};Be.spawn=function(t,e){return new tt(this.cy(),t,e)};Be.spawnSelf=function(){return this.spawn(this)};Be.cy=function(){return this._private.cy};Be.renderer=function(){return this._private.cy.renderer()};Be.element=function(){return this[0]};Be.collection=function(){return fo(this)?this:new tt(this._private.cy,[this])};Be.unique=function(){return new tt(this._private.cy,this,!0)};Be.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};Be.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new tt(e)};Be.$id=Be.getElementById;Be.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};Be.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};Be.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};Be.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var a=e._private;if(De(t)){if(r.startBatch(),t.data){e.data(t.data);var n=a.data;if(e.isEdge()){var s=!1,i={},o=t.data.source,u=t.data.target;o!=null&&o!=n.source&&(i.source=""+o,s=!0),u!=null&&u!=n.target&&(i.target=""+u,s=!0),s&&(e=e.move(i))}else{var l="parent"in t.data,f=t.data.parent;l&&(f!=null||n.parent!=null)&&f!=n.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var h=function(p,g,y){var b=t[p];b!=null&&b!==a[p]&&(b?e[g]():e[y]())};return h("removed","remove","restore"),h("selected","select","unselect"),h("selectable","selectify","unselectify"),h("locked","lock","unlock"),h("grabbable","grabify","ungrabify"),h("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var d={data:Bt(a.data),position:Bt(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,pannable:a.pannable,classes:null};d.classes="";var v=0;return a.classes.forEach(function(c){return d.classes+=v++===0?c:" "+c}),d}}};Be.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],a=r.json();t.push(a)}return t};Be.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var a=this[r],n=a.json(),s=new yn(t,n,!1);e.push(s)}return new tt(t,e)};Be.copy=Be.clone;Be.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=r.cy(),n=a._private,s=[],i=[],o,u=0,l=r.length;u<l;u++){var f=r[u];e&&!f.removed()||(f.isNode()?s.push(f):i.push(f))}o=s.concat(i);var h,d=function(){o.splice(h,1),h--};for(h=0;h<o.length;h++){var v=o[h],c=v._private,p=c.data;if(v.clearTraversalCache(),!(!e&&!c.removed)){if(p.id===void 0)p.id=Do();else if(se(p.id))p.id=""+p.id;else if(er(p.id)||!ge(p.id)){Ve("Can not create element with invalid string ID `"+p.id+"`"),d();continue}else if(a.hasElementWithId(p.id)){Ve("Can not create second element with ID `"+p.id+"`"),d();continue}}var g=p.id;if(v.isNode()){var y=c.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(v.isEdge()){for(var b=v,m=["source","target"],T=m.length,C=!1,S=0;S<T;S++){var E=m[S],x=p[E];se(x)&&(x=p[E]=""+p[E]),x==null||x===""?(Ve("Can not create edge `"+g+"` with unspecified "+E),C=!0):a.hasElementWithId(x)||(Ve("Can not create edge `"+g+"` with nonexistant "+E+" `"+x+"`"),C=!0)}if(C){d();continue}var w=a.getElementById(p.source),D=a.getElementById(p.target);w.same(D)?w._private.edges.push(b):(w._private.edges.push(b),D._private.edges.push(b)),b._private.source=w,b._private.target=D}c.map=new Ft,c.map.set(g,{ele:v,index:0}),c.removed=!1,e&&a.addToPool(v)}for(var L=0;L<s.length;L++){var A=s[L],N=A._private.data;se(N.parent)&&(N.parent=""+N.parent);var O=N.parent,M=O!=null;if(M||A._private.parent){var R=A._private.parent?a.collection().merge(A._private.parent):a.getElementById(O);if(R.empty())N.parent=void 0;else if(R[0].removed())Ie("Node added with missing parent, reference to parent removed"),N.parent=void 0,A._private.parent=null;else{for(var k=!1,P=R;!P.empty();){if(A.same(P)){k=!0,N.parent=void 0;break}P=P.parent()}k||(R[0]._private.children.push(A),A._private.parent=R[0],n.hasCompoundNodes=!0)}}}if(o.length>0){for(var B=o.length===r.length?r:new tt(a,o),z=0;z<B.length;z++){var G=B[z];G.isNode()||(G.parallelEdges().clearTraversalCache(),G.source().clearTraversalCache(),G.target().clearTraversalCache())}var F;n.hasCompoundNodes?F=a.collection().merge(B).merge(B.connectedNodes()).merge(B.parent()):F=B,F.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?B.emitAndNotify("add"):e&&B.emit("add")}return r};Be.removed=function(){var t=this[0];return t&&t._private.removed};Be.inside=function(){var t=this[0];return t&&!t._private.removed};Be.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},s=r._private.cy;function i(O){for(var M=O._private.edges,R=0;R<M.length;R++)u(M[R])}function o(O){for(var M=O._private.children,R=0;R<M.length;R++)u(M[R])}function u(O){var M=n[O.id()];e&&O.removed()||M||(n[O.id()]=!0,O.isNode()?(a.push(O),i(O),o(O)):a.unshift(O))}for(var l=0,f=r.length;l<f;l++){var h=r[l];u(h)}function d(O,M){var R=O._private.edges;tr(R,M),O.clearTraversalCache()}function v(O){O.clearTraversalCache()}var c=[];c.ids={};function p(O,M){M=M[0],O=O[0];var R=O._private.children,k=O.id();tr(R,M),M._private.parent=null,c.ids[k]||(c.ids[k]=!0,c.push(O))}r.dirtyCompoundBoundsCache(),e&&s.removeFromPool(a);for(var g=0;g<a.length;g++){var y=a[g];if(y.isEdge()){var b=y.source()[0],m=y.target()[0];d(b,y),d(m,y);for(var T=y.parallelEdges(),C=0;C<T.length;C++){var S=T[C];v(S),S.isBundledBezier()&&S.dirtyBoundingBoxCache()}}else{var E=y.parent();E.length!==0&&p(E,y)}e&&(y._private.removed=!0)}var x=s._private.elements;s._private.hasCompoundNodes=!1;for(var w=0;w<x.length;w++){var D=x[w];if(D.isParent()){s._private.hasCompoundNodes=!0;break}}var L=new tt(this.cy(),a);L.size()>0&&(t?L.emitAndNotify("remove"):e&&L.emit("remove"));for(var A=0;A<c.length;A++){var N=c[A];(!e||!N.removed())&&N.updateStyle()}return L};Be.move=function(t){var e=this._private.cy,r=this,a=!1,n=!1,s=function(c){return c==null?c:""+c};if(t.source!==void 0||t.target!==void 0){var i=s(t.source),o=s(t.target),u=i!=null&&e.hasElementWithId(i),l=o!=null&&e.hasElementWithId(o);(u||l)&&(e.batch(function(){r.remove(a,n),r.emitAndNotify("moveout");for(var v=0;v<r.length;v++){var c=r[v],p=c._private.data;c.isEdge()&&(u&&(p.source=i),l&&(p.target=o))}r.restore(a,n)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=s(t.parent),h=f===null||e.hasElementWithId(f);if(h){var d=f===null?void 0:f;e.batch(function(){var v=r.remove(a,n);v.emitAndNotify("moveout");for(var c=0;c<r.length;c++){var p=r[c],g=p._private.data;p.isNode()&&(g.parent=d)}v.restore(a,n)}),r.emitAndNotify("move")}}return this};[Go,Dd,qa,Jt,Ur,Ud,Tn,ag,lu,fu,ug,ln,Wa,et,jt,st].forEach(function(t){Ee(Be,t)});var gg={add:function(e){var r,a=this;if(yt(e)){var n=e;if(n._private.cy===a)r=n.restore();else{for(var s=[],i=0;i<n.length;i++){var o=n[i];s.push(o.json())}r=new tt(a,s)}}else if(ke(e)){var u=e;r=new tt(a,u)}else if(De(e)&&(ke(e.nodes)||ke(e.edges))){for(var l=e,f=[],h=["nodes","edges"],d=0,v=h.length;d<v;d++){var c=h[d],p=l[c];if(ke(p))for(var g=0,y=p.length;g<y;g++){var b=Ee({group:c},p[g]);f.push(b)}}r=new tt(a,f)}else{var m=e;r=new yn(a,m).collection()}return r},remove:function(e){if(!yt(e)){if(ge(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function pg(t,e,r,a){var n=4,s=.001,i=1e-7,o=10,u=11,l=1/(u-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var h=0;h<4;++h)if(typeof arguments[h]!="number"||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var d=f?new Float32Array(u):new Array(u);function v(D,L){return 1-3*L+3*D}function c(D,L){return 3*L-6*D}function p(D){return 3*D}function g(D,L,A){return((v(L,A)*D+c(L,A))*D+p(L))*D}function y(D,L,A){return 3*v(L,A)*D*D+2*c(L,A)*D+p(L)}function b(D,L){for(var A=0;A<n;++A){var N=y(L,t,r);if(N===0)return L;var O=g(L,t,r)-D;L-=O/N}return L}function m(){for(var D=0;D<u;++D)d[D]=g(D*l,t,r)}function T(D,L,A){var N,O,M=0;do O=L+(A-L)/2,N=g(O,t,r)-D,N>0?A=O:L=O;while(Math.abs(N)>i&&++M<o);return O}function C(D){for(var L=0,A=1,N=u-1;A!==N&&d[A]<=D;++A)L+=l;--A;var O=(D-d[A])/(d[A+1]-d[A]),M=L+O*l,R=y(M,t,r);return R>=s?b(D,M):R===0?M:T(D,L,L+l)}var S=!1;function E(){S=!0,(t!==e||r!==a)&&m()}var x=function(L){return S||E(),t===e&&r===a?L:L===0?0:L===1?1:g(C(L),e,a)};x.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var w="generateBezier("+[t,e,r,a]+")";return x.toString=function(){return w},x}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var yg=function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,s){var i={x:a.x+s.dx*n,v:a.v+s.dv*n,tension:a.tension,friction:a.friction};return{dx:i.v,dv:t(i)}}function r(a,n){var s={dx:a.v,dv:t(a)},i=e(a,n*.5,s),o=e(a,n*.5,i),u=e(a,n,o),l=1/6*(s.dx+2*(i.dx+o.dx)+u.dx),f=1/6*(s.dv+2*(i.dv+o.dv)+u.dv);return a.x=a.x+l*n,a.v=a.v+f*n,a}return function a(n,s,i){var o={x:-1,v:0,tension:null,friction:null},u=[0],l=0,f=1/1e4,h=16/1e3,d,v,c;for(n=parseFloat(n)||500,s=parseFloat(s)||20,i=i||null,o.tension=n,o.friction=s,d=i!==null,d?(l=a(n,s),v=l/i*h):v=h;c=r(c||o,v),u.push(1+c.x),l+=16,Math.abs(c.x)>f&&Math.abs(c.v)>f;);return d?function(p){return u[p*(u.length-1)|0]}:l}}(),Pe=function(e,r,a,n){var s=pg(e,r,a,n);return function(i,o,u){return i+(o-i)*s(u)}},Ka={linear:function(e,r,a){return e+(r-e)*a},ease:Pe(.25,.1,.25,1),"ease-in":Pe(.42,0,1,1),"ease-out":Pe(0,0,.58,1),"ease-in-out":Pe(.42,0,.58,1),"ease-in-sine":Pe(.47,0,.745,.715),"ease-out-sine":Pe(.39,.575,.565,1),"ease-in-out-sine":Pe(.445,.05,.55,.95),"ease-in-quad":Pe(.55,.085,.68,.53),"ease-out-quad":Pe(.25,.46,.45,.94),"ease-in-out-quad":Pe(.455,.03,.515,.955),"ease-in-cubic":Pe(.55,.055,.675,.19),"ease-out-cubic":Pe(.215,.61,.355,1),"ease-in-out-cubic":Pe(.645,.045,.355,1),"ease-in-quart":Pe(.895,.03,.685,.22),"ease-out-quart":Pe(.165,.84,.44,1),"ease-in-out-quart":Pe(.77,0,.175,1),"ease-in-quint":Pe(.755,.05,.855,.06),"ease-out-quint":Pe(.23,1,.32,1),"ease-in-out-quint":Pe(.86,0,.07,1),"ease-in-expo":Pe(.95,.05,.795,.035),"ease-out-expo":Pe(.19,1,.22,1),"ease-in-out-expo":Pe(1,0,0,1),"ease-in-circ":Pe(.6,.04,.98,.335),"ease-out-circ":Pe(.075,.82,.165,1),"ease-in-out-circ":Pe(.785,.135,.15,.86),spring:function(e,r,a){if(a===0)return Ka.linear;var n=yg(e,r,a);return function(s,i,o){return s+(i-s)*n(o)}},"cubic-bezier":Pe};function Ps(t,e,r,a,n){if(a===1||e===r)return r;var s=n(e,r,a);return t==null||((t.roundValue||t.color)&&(s=Math.round(s)),t.min!==void 0&&(s=Math.max(s,t.min)),t.max!==void 0&&(s=Math.min(s,t.max))),s}function Bs(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Lr(t,e,r,a,n){var s=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var i=Bs(t,n),o=Bs(e,n);if(se(i)&&se(o))return Ps(s,i,o,r,a);if(ke(i)&&ke(o)){for(var u=[],l=0;l<o.length;l++){var f=i[l],h=o[l];if(f!=null&&h!=null){var d=Ps(s,f,h,r,a);u.push(d)}else u.push(h)}return u}}function mg(t,e,r,a){var n=!a,s=t._private,i=e._private,o=i.easing,u=i.startTime,l=a?t:t.cy(),f=l.style();if(!i.easingImpl)if(o==null)i.easingImpl=Ka.linear;else{var h;if(ge(o)){var d=f.parse("transition-timing-function",o);h=d.value}else h=o;var v,c;ge(h)?(v=h,c=[]):(v=h[1],c=h.slice(2).map(function(B){return+B})),c.length>0?(v==="spring"&&c.push(i.duration),i.easingImpl=Ka[v].apply(null,c)):i.easingImpl=Ka[v]}var p=i.easingImpl,g;if(i.duration===0?g=1:g=(r-u)/i.duration,i.applying&&(g=i.progress),g<0?g=0:g>1&&(g=1),i.delay==null){var y=i.startPosition,b=i.position;if(b&&n&&!t.locked()){var m={};na(y.x,b.x)&&(m.x=Lr(y.x,b.x,g,p)),na(y.y,b.y)&&(m.y=Lr(y.y,b.y,g,p)),t.position(m)}var T=i.startPan,C=i.pan,S=s.pan,E=C!=null&&a;E&&(na(T.x,C.x)&&(S.x=Lr(T.x,C.x,g,p)),na(T.y,C.y)&&(S.y=Lr(T.y,C.y,g,p)),t.emit("pan"));var x=i.startZoom,w=i.zoom,D=w!=null&&a;D&&(na(x,w)&&(s.zoom=pa(s.minZoom,Lr(x,w,g,p),s.maxZoom)),t.emit("zoom")),(E||D)&&t.emit("viewport");var L=i.style;if(L&&L.length>0&&n){for(var A=0;A<L.length;A++){var N=L[A],O=N.name,M=N,R=i.startStyle[O],k=f.properties[R.name],P=Lr(R,M,g,p,k);f.overrideBypass(t,O,P)}t.emit("style")}}return i.progress=g,g}function na(t,e){return t==null||e==null?!1:se(t)&&se(e)?!0:!!(t&&e)}function bg(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}function Fs(t,e){var r=e._private.aniEles,a=[];function n(f,h){var d=f._private,v=d.animation.current,c=d.animation.queue,p=!1;if(v.length===0){var g=c.shift();g&&v.push(g)}for(var y=function(S){for(var E=S.length-1;E>=0;E--){var x=S[E];x()}S.splice(0,S.length)},b=v.length-1;b>=0;b--){var m=v[b],T=m._private;if(T.stopped){v.splice(b,1),T.hooked=!1,T.playing=!1,T.started=!1,y(T.frames);continue}!T.playing&&!T.applying||(T.playing&&T.applying&&(T.applying=!1),T.started||bg(f,m,t),mg(f,m,t,h),T.applying&&(T.applying=!1),y(T.frames),T.step!=null&&T.step(t),m.completed()&&(v.splice(b,1),T.hooked=!1,T.playing=!1,T.started=!1,y(T.completes)),p=!0)}return!h&&v.length===0&&c.length===0&&a.push(f),p}for(var s=!1,i=0;i<r.length;i++){var o=r[i],u=n(o);s=s||u}var l=n(e,!0);(s||l)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}var Eg={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&&an(function(s){Fs(s,e),r()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(s,i){Fs(i,e)},a.beforeRenderPriorities.animations):r()}},wg={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&&Ca(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 ge(e)?new rr(e):e},cu={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Cn(wg,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(cu);var ti={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)}};ti.jpeg=ti.jpg;var Za={layout:function(e){var r=this;if(e==null){Ve("Layout options must be specified to make a layout");return}if(e.name==null){Ve("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){Ve("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var s;ge(e.eles)?s=r.$(e.eles):s=e.eles!=null?e.eles:r.$();var i=new n(Ee({},e,{cy:r,eles:s}));return i}};Za.createLayout=Za.makeLayout=Za.layout;var xg={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 s=this.renderer();this.destroyed()||!s||s.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?r.notify(a):r.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n<a.length;n++){var s=a[n],i=e[s],o=r.getElementById(s);o.data(i)}})}},Tg=rt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),ri={renderTo:function(e,r,a,n){var s=this._private.renderer;return s.renderTo(e,r,a,n),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,a=r.extension("renderer",e.name);if(a==null){Ve("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Ie("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=Tg(e);n.cy=r,r._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ri.invalidateDimensions=ri.resize;var Qa={collection:function(e,r){return ge(e)?this.$(e):yt(e)?e.collection():ke(e)?(r||(r={}),new tt(this,e,r.unique,r.removed)):new tt(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}};Qa.elements=Qa.filter=Qa.$;var ut={},fa="t",Cg="f";ut.apply=function(t){for(var e=this,r=e._private,a=r.cy,n=a.collection(),s=0;s<t.length;s++){var i=t[s],o=e.getContextMeta(i);if(!o.empty){var u=e.getContextStyle(o),l=e.applyContextStyle(o,u,i);i._private.appliedInitStyle?e.updateTransitions(i,l.diffProps):i._private.appliedInitStyle=!0;var f=e.updateStyleHints(i);f&&n.push(i)}}return n};ut.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,s=a[n];if(s)return s;for(var i=[],o={},u=0;u<r.length;u++){var l=r[u],f=t[u]===fa,h=e[u]===fa,d=f!==h,v=l.mappedProperties.length>0;if(d||h&&v){var c=void 0;d&&v||d?c=l.properties:v&&(c=l.mappedProperties);for(var p=0;p<c.length;p++){for(var g=c[p],y=g.name,b=!1,m=u+1;m<r.length;m++){var T=r[m],C=e[m]===fa;if(C&&(b=T.properties[g.name]!=null,b))break}!o[y]&&!b&&(o[y]=!0,i.push(y))}}}return a[n]=i,i};ut.getContextMeta=function(t){for(var e=this,r="",a,n=t._private.styleCxtKey||"",s=0;s<e.length;s++){var i=e[s],o=i.selector&&i.selector.matches(t);o?r+=fa:r+=Cg}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};ut.getContextStyle=function(t){var e=t.key,r=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},s=0;s<r.length;s++){var i=r[s],o=e[s]===fa;if(o)for(var u=0;u<i.properties.length;u++){var l=i.properties[u];n[l.name]=l}}return a[e]=n,n};ut.applyContextStyle=function(t,e,r){for(var a=this,n=t.diffPropNames,s={},i=a.types,o=0;o<n.length;o++){var u=n[o],l=e[u],f=r.pstyle(u);if(!l)if(f)f.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(f!==l){if(l.mapped===i.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var h=f.mapping,d=h.fnValue=l.value(r);if(d===h.prevFnValue)continue}var v=s[u]={prev:f};a.applyParsedProperty(r,l),v.next=r.pstyle(u),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:s}};ut.updateStyleHints=function(t){var e=t._private,r=this,a=r.propertyGroupNames,n=r.propertyGroupKeys,s=function(K,ie,ve){return r.getPropertiesHash(K,ie,ve)},i=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",u=t._private.style;a=Object.keys(u);for(var l=0;l<n.length;l++){var f=n[l];e.styleKeys[f]=[Ir,sa]}for(var h=function(K,ie){return e.styleKeys[ie][0]=ca(K,e.styleKeys[ie][0])},d=function(K,ie){return e.styleKeys[ie][1]=da(K,e.styleKeys[ie][1])},v=function(K,ie){h(K,ie),d(K,ie)},c=function(K,ie){for(var ve=0;ve<K.length;ve++){var ae=K.charCodeAt(ve);h(ae,ie),d(ae,ie)}},p=2e9,g=function(K){return-128<K&&K<128&&Math.floor(K)!==K?p-(K*1024|0):K},y=0;y<a.length;y++){var b=a[y],m=u[b];if(m!=null){var T=this.properties[b],C=T.type,S=T.groupKey,E=void 0;T.hashOverride!=null?E=T.hashOverride(t,m):m.pfValue!=null&&(E=m.pfValue);var x=T.enums==null?m.value:null,w=E!=null,D=x!=null,L=w||D,A=m.units;if(C.number&&L&&!C.multiple){var N=w?E:x;v(g(N),S),!w&&A!=null&&c(A,S)}else c(m.strValue,S)}}for(var O=[Ir,sa],M=0;M<n.length;M++){var R=n[M],k=e.styleKeys[R];O[0]=ca(k[0],O[0]),O[1]=da(k[1],O[1])}e.styleKey=Of(O[0],O[1]);var P=e.styleKeys;e.labelDimsKey=Wt(P.labelDimensions);var B=s(t,["label"],P.labelDimensions);if(e.labelKey=Wt(B),e.labelStyleKey=Wt(Ra(P.commonLabel,B)),!o){var z=s(t,["source-label"],P.labelDimensions);e.sourceLabelKey=Wt(z),e.sourceLabelStyleKey=Wt(Ra(P.commonLabel,z));var G=s(t,["target-label"],P.labelDimensions);e.targetLabelKey=Wt(G),e.targetLabelStyleKey=Wt(Ra(P.commonLabel,G))}if(o){var F=e.styleKeys,U=F.nodeBody,H=F.nodeBorder,Y=F.nodeOutline,Q=F.backgroundImage,J=F.compound,q=F.pie,V=[U,H,Y,Q,J,q].filter(function(Z){return Z!=null}).reduce(Ra,[Ir,sa]);e.nodeKey=Wt(V),e.hasPie=q!=null&&q[0]!==Ir&&q[1]!==sa}return i!==e.styleKey};ut.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null};ut.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,s,i=r.types,o=r.properties[a.name].type,u=a.bypass,l=n[a.name],f=l&&l.bypass,h=t._private,d="mapping",v=function(U){return U==null?null:U.pfValue!=null?U.pfValue:U.value},c=function(){var U=v(l),H=v(a);r.checkTriggers(t,a.name,U,H)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(a=e=this.parse(e.name,"bezier",u)),a.delete)return n[a.name]=void 0,c(),!0;if(a.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,c(),!0):!1:(c(),!0);if(a.deleteBypass)return l?l.bypass?(n[a.name]=l.bypassed,c(),!0):!1:(c(),!0);var p=function(){Ie("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case i.mapData:{for(var g=a.field.split("."),y=h.data,b=0;b<g.length&&y;b++){var m=g[b];y=y[m]}if(y==null)return p(),!1;var T;if(se(y)){var C=a.fieldMax-a.fieldMin;C===0?T=0:T=(y-a.fieldMin)/C}else return Ie("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+y+"` for `"+t.id()+"` is non-numeric)"),!1;if(T<0?T=0:T>1&&(T=1),o.color){var S=a.valueMin[0],E=a.valueMax[0],x=a.valueMin[1],w=a.valueMax[1],D=a.valueMin[2],L=a.valueMax[2],A=a.valueMin[3]==null?1:a.valueMin[3],N=a.valueMax[3]==null?1:a.valueMax[3],O=[Math.round(S+(E-S)*T),Math.round(x+(w-x)*T),Math.round(D+(L-D)*T),Math.round(A+(N-A)*T)];s={bypass:a.bypass,name:a.name,value:O,strValue:"rgb("+O[0]+", "+O[1]+", "+O[2]+")"}}else if(o.number){var M=a.valueMin+(a.valueMax-a.valueMin)*T;s=this.parse(a.name,M,a.bypass,d)}else return!1;if(!s)return p(),!1;s.mapping=a,a=s;break}case i.data:{for(var R=a.field.split("."),k=h.data,P=0;P<R.length&&k;P++){var B=R[P];k=k[B]}if(k!=null&&(s=this.parse(a.name,k,a.bypass,d)),!s)return p(),!1;s.mapping=a,a=s;break}case i.fn:{var z=a.value,G=a.fnValue!=null?a.fnValue:z(t);if(a.prevFnValue=G,G==null)return Ie("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+t.id()+"` is null)"),!1;if(s=this.parse(a.name,G,a.bypass,d),!s)return Ie("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+t.id()+"` is invalid)"),!1;s.mapping=Bt(a),a=s;break}case void 0:break;default:return!1}return u?(f?a.bypassed=l.bypassed:a.bypassed=l,n[a.name]=a):f?l.bypassed=a:n[a.name]=a,c(),!0};ut.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var a=t[r];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else for(var n=a._private.style,s=Object.keys(n),i=0;i<s.length;i++){var o=s[i],u=n[o];u!=null&&(u.bypass?u.bypassed=null:n[o]=null)}}};ut.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};ut.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,s=t.pstyle("transition-duration").pfValue,i=t.pstyle("transition-delay").pfValue;if(n.length>0&&s>0){for(var o={},u=!1,l=0;l<n.length;l++){var f=n[l],h=t.pstyle(f),d=e[f];if(d){var v=d.prev,c=v,p=d.next!=null?d.next:h,g=!1,y=void 0,b=1e-6;c&&(se(c.pfValue)&&se(p.pfValue)?(g=p.pfValue-c.pfValue,y=c.pfValue+b*g):se(c.value)&&se(p.value)?(g=p.value-c.value,y=c.value+b*g):ke(c.value)&&ke(p.value)&&(g=c.value[0]!==p.value[0]||c.value[1]!==p.value[1]||c.value[2]!==p.value[2],y=c.strValue),g&&(o[f]=p.strValue,this.applyBypass(t,f,y),u=!0))}}if(!u)return;a.transitioning=!0,new Yr(function(m){i>0?t.delayAnimation(i).play().promise().then(m):m()}).then(function(){return t.animation({style:o,duration:s,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)};ut.checkTrigger=function(t,e,r,a,n,s){var i=this.properties[e],o=n(i);o!=null&&o(r,a)&&s(i)};ut.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(s){return s.triggersZOrder},function(){n._private.cy.notify("zorder",t)})};ut.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(s){s.isBundledBezier()&&s.dirtyBoundingBoxCache()}),n.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||a==="none")&&t.connectedEdges().forEach(function(s){s.dirtyBoundingBoxCache()})})};ut.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a)};var Aa={};Aa.applyBypass=function(t,e,r,a){var n=this,s=[],i=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<n.properties.length;o++){var u=n.properties[o],l=u.name,f=this.parse(l,r,!0);f&&s.push(f)}}else if(ge(e)){var h=this.parse(e,r,!0);h&&s.push(h)}else if(De(e)){var d=e;a=r;for(var v=Object.keys(d),c=0;c<v.length;c++){var p=v[c],g=d[p];if(g===void 0&&(g=d[dn(p)]),g!==void 0){var y=this.parse(p,g,!0);y&&s.push(y)}}}else return!1;if(s.length===0)return!1;for(var b=!1,m=0;m<t.length;m++){for(var T=t[m],C={},S=void 0,E=0;E<s.length;E++){var x=s[E];if(a){var w=T.pstyle(x.name);S=C[x.name]={prev:w}}b=this.applyParsedProperty(T,Bt(x))||b,a&&(S.next=T.pstyle(x.name))}b&&this.updateStyleHints(T),a&&this.updateTransitions(T,C,i)}return b};Aa.overrideBypass=function(t,e,r){e=yi(e);for(var a=0;a<t.length;a++){var n=t[a],s=n._private.style[e],i=this.properties[e].type,o=i.color,u=i.mutiple,l=s?s.pfValue!=null?s.pfValue:s.value:null;!s||!s.bypass?this.applyBypass(n,e,r):(s.value=r,s.pfValue!=null&&(s.pfValue=r),o?s.strValue="rgb("+r.join(",")+")":u?s.strValue=r.join(" "):s.strValue=""+r,this.updateStyleHints(n)),this.checkTriggers(n,e,l,r)}};Aa.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};Aa.removeBypasses=function(t,e,r){for(var a=!0,n=0;n<t.length;n++){for(var s=t[n],i={},o=0;o<e.length;o++){var u=e[o],l=this.properties[u],f=s.pstyle(l.name);if(!(!f||!f.bypass)){var h="",d=this.parse(u,h,!0),v=i[l.name]={prev:f};this.applyParsedProperty(s,d),v.next=s.pstyle(l.name)}}this.updateStyleHints(s),r&&this.updateTransitions(s,i,a)}};var Ii={};Ii.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};Ii.containerCss=function(t){var e=this._private.cy,r=e.container(),a=e.window();if(a&&r&&a.getComputedStyle)return a.getComputedStyle(r).getPropertyValue(t)};var Gt={};Gt.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};Gt.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var a={},n=0;n<r.properties.length;n++){var s=r.properties[n],i=r.getStylePropertyValue(t,s.name,e);i!=null&&(a[s.name]=i,a[dn(s.name)]=i)}return a}};Gt.getIndexedStyle=function(t,e,r,a){var n=t.pstyle(e)[r][a];return n??t.cy().style().getDefaultProperty(e)[r][0]};Gt.getStylePropertyValue=function(t,e,r){var a=this;if(t=t[0],t){var n=a.properties[e];n.alias&&(n=n.pointsTo);var s=n.type,i=t.pstyle(n.name);if(i){var o=i.value,u=i.units,l=i.strValue;if(r&&s.number&&o!=null&&se(o)){var f=t.cy().zoom(),h=function(g){return g*f},d=function(g,y){return h(g)+y},v=ke(o),c=v?u.every(function(p){return p!=null}):u!=null;return c?v?o.map(function(p,g){return d(p,u[g])}).join(" "):d(o,u):v?o.map(function(p){return ge(p)?p:""+h(p)}).join(" "):""+h(o)}else if(l!=null)return l}return null}};Gt.getAnimationStartStyle=function(t,e){for(var r={},a=0;a<e.length;a++){var n=e[a],s=n.name,i=t.pstyle(s);i!==void 0&&(De(i)?i=this.parse(s,i.strValue):i=this.parse(s,i)),i&&(r[s]=i)}return r};Gt.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a)for(var s=Object.keys(a),i=0;i<s.length;i++){var o=s[i],u=a[o],l=n[o]||n[yi(o)],f=this.parse(l.name,u);f&&r.push(f)}return r};Gt.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,s,i,o,u,l;for(u=0;u<e.length;u++)if(n=e[u],s=t.pstyle(n,!1),s!=null)if(s.pfValue!=null)a[0]=ca(o,a[0]),a[1]=da(o,a[1]);else for(i=s.strValue,l=0;l<i.length;l++)o=i.charCodeAt(l),a[0]=ca(o,a[0]),a[1]=da(o,a[1]);return a};Gt.getPropertiesHash=Gt.getNonDefaultPropertiesHash;var Ln={};Ln.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var a=t[r],n=a.selector,s=a.style||a.css,i=Object.keys(s);e.selector(n);for(var o=0;o<i.length;o++){var u=i[o],l=s[u];e.css(u,l)}}return e};Ln.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Ln.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],a=r.selector,n=r.properties,s={},i=0;i<n.length;i++){var o=n[i];s[o.name]=o.strValue}t.push({selector:a?a.toString():"core",style:s})}return t};var Mi={};Mi.appendFromString=function(t){var e=this,r=this,a=""+t,n,s,i;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){a.length>n.length?a=a.substr(n.length):a=""}function u(){s.length>i.length?s=s.substr(i.length):s=""}for(;;){var l=a.match(/^\s*$/);if(l)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 d=new rr(h);if(d.invalid){Ie("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),o();continue}}var v=f[2],c=!1;s=v;for(var p=[];;){var g=s.match(/^\s*$/);if(g)break;var y=s.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){Ie("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),c=!0;break}i=y[0];var b=y[1],m=y[2],T=e.properties[b];if(!T){Ie("Skipping property: Invalid property name in: "+i),u();continue}var C=r.parse(b,m);if(!C){Ie("Skipping property: Invalid property definition in: "+i),u();continue}p.push({name:b,val:m}),u()}if(c){o();break}r.selector(h);for(var S=0;S<p.length;S++){var E=p[S];r.css(E.name,E.val)}o()}return r};Mi.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var je={};(function(){var t=Xe,e=Il,r=Rl,a=kl,n=Pl,s=function(V){return"^"+V+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},i=function(V){var Z=t+"|\\w+|"+e+"|"+r+"|"+a+"|"+n;return"^"+V+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+Z+")\\s*\\,\\s*("+Z+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];je.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:s("data")},layoutData:{mapping:!0,regex:s("layoutData")},scratch:{mapping:!0,regex:s("scratch")},mapData:{mapping:!0,regex:i("mapData")},mapLayoutData:{mapping:!0,regex:i("mapLayoutData")},mapScratch:{mapping:!0,regex:i("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(V,Z){switch(V.length){case 2:return Z[0]!=="deg"&&Z[0]!=="rad"&&Z[1]!=="deg"&&Z[1]!=="rad";case 1:return ge(V[0])||Z[0]==="deg"||Z[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(V){var Z=V.length;return Z===1||Z===2||Z===4}}};var u={zeroNonZero:function(V,Z){return(V==null||Z==null)&&V!==Z||V==0&&Z!=0?!0:V!=0&&Z==0},any:function(V,Z){return V!=Z},emptyNonEmpty:function(V,Z){var K=er(V),ie=er(Z);return K&&!ie||!K&&ie}},l=je.types,f=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],h=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],d=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],v=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],c=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification}],p=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any}],g=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}],y=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:l.cornerRadius}],b=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:l.cornerRadius}],m=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],T=function(V,Z){return Z.value==="label"?-V.poolIndex():Z.pfValue},C=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:T},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:T},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:l.cornerRadius},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],S=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle},{name:"border-cap",type:l.lineCap},{name:"border-join",type:l.lineJoin},{name:"border-dash-pattern",type:l.numbers},{name:"border-dash-offset",type:l.number},{name:"border-position",type:l.linePosition}],E=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}],x=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],w=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],D=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-outline-width",type:l.size},{name:"line-outline-color",type:l.color},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-radii",type:l.numbers,triggersBounds:u.any},{name:"radius-type",type:l.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:l.number,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],L=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],A=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],N=[];je.pieBackgroundN=16,N.push({name:"pie-size",type:l.sizeMaybePercent});for(var O=1;O<=je.pieBackgroundN;O++)N.push({name:"pie-"+O+"-background-color",type:l.color}),N.push({name:"pie-"+O+"-background-size",type:l.percent}),N.push({name:"pie-"+O+"-background-opacity",type:l.zeroOneNumber});var M=[],R=je.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth}].forEach(function(q){R.forEach(function(V){var Z=V+"-"+q.name,K=q.type,ie=q.triggersBounds;M.push({name:Z,type:K,triggersBounds:ie})})},{});var k=je.properties=[].concat(p,m,g,y,b,L,c,v,f,h,d,C,S,E,x,N,w,D,M,A),P=je.propertyGroups={behavior:p,transition:m,visibility:g,overlay:y,underlay:b,ghost:L,commonLabel:c,labelDimensions:v,mainLabel:f,sourceLabel:h,targetLabel:d,nodeBody:C,nodeBorder:S,nodeOutline:E,backgroundImage:x,pie:N,compound:w,edgeLine:D,edgeArrow:M,core:A},B=je.propertyGroupNames={},z=je.propertyGroupKeys=Object.keys(P);z.forEach(function(q){B[q]=P[q].map(function(V){return V.name}),P[q].forEach(function(V){return V.groupKey=q})});var G=je.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];je.propertyNames=k.map(function(q){return q.name});for(var F=0;F<k.length;F++){var U=k[F];k[U.name]=U}for(var H=0;H<G.length;H++){var Y=G[H],Q=k[Y.pointsTo],J={name:Y.name,alias:!0,pointsTo:Q};k.push(J),k[Y.name]=J}})();je.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};je.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Ee({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(u,l){for(var f=1;f<=je.pieBackgroundN;f++){var h=l.name.replace("{{i}}",f),d=l.value;u[h]=d}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(u,l){return je.arrowPrefixes.forEach(function(f){var h=f+"-"+l.name,d=l.value;u[h]=d}),u},{})),r={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var s=n.name,i=e[s],o=this.parse(s,i);r[s]=o}}return t.defaultProperties=r,t.defaultProperties};je.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var An={};An.parse=function(t,e,r,a){var n=this;if(ze(e))return n.parseImplWarn(t,e,r,a);var s=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,i=r?"t":"f",o=""+e,u=xo(t,o,i,s),l=n.propCache=n.propCache||[],f;return(f=l[u])||(f=l[u]=n.parseImplWarn(t,e,r,a)),(r||a==="mapping")&&(f=Bt(f),f&&(f.value=Bt(f.value))),f};An.parseImplWarn=function(t,e,r,a){var n=this.parseImpl(t,e,r,a);return!n&&e!=null&&Ie("The style property `".concat(t,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Ie("The style value of `label` is deprecated for `"+n.name+"`"),n};An.parseImpl=function(t,e,r,a){var n=this;t=yi(t);var s=n.properties[t],i=e,o=n.types;if(!s||e===void 0)return null;s.alias&&(s=s.pointsTo,t=s.name);var u=ge(e);u&&(e=e.trim());var l=s.type;if(!l)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(ze(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var f,h;if(!(!u||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(o.data.regex).exec(e))){if(r)return!1;var d=o.data;return{name:t,value:f,strValue:""+e,mapped:d,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(h=new RegExp(o.mapData.regex).exec(e))){if(r||l.multiple)return!1;var v=o.mapData;if(!(l.color||l.number))return!1;var c=this.parse(t,h[4]);if(!c||c.mapped)return!1;var p=this.parse(t,h[5]);if(!p||p.mapped)return!1;if(c.pfValue===p.pfValue||c.strValue===p.strValue)return Ie("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+c.strValue+"`"),this.parse(t,c.strValue);if(l.color){var g=c.value,y=p.value,b=g[0]===y[0]&&g[1]===y[1]&&g[2]===y[2]&&(g[3]===y[3]||(g[3]==null||g[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:c.value,valueMax:p.value,bypass:r}}}if(l.multiple&&a!=="multiple"){var m;if(u?m=e.split(/\s+/):ke(e)?m=e:m=[e],l.evenMultiple&&m.length%2!==0)return null;for(var T=[],C=[],S=[],E="",x=!1,w=0;w<m.length;w++){var D=n.parse(t,m[w],r,"multiple");x=x||ge(D.value),T.push(D.value),S.push(D.pfValue!=null?D.pfValue:D.value),C.push(D.units),E+=(w>0?" ":"")+D.strValue}return l.validate&&!l.validate(T,C)?null:l.singleEnum&&x?T.length===1&&ge(T[0])?{name:t,value:T[0],strValue:T[0],bypass:r}:null:{name:t,value:T,pfValue:S,strValue:E,bypass:r,units:C}}var L=function(){for(var V=0;V<l.enums.length;V++){var Z=l.enums[V];if(Z===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(l.number){var A,N="px";if(l.units&&(A=l.units),l.implicitUnits&&(N=l.implicitUnits),!l.unitless)if(u){var O="px|em"+(l.allowPercent?"|\\%":"");A&&(O=A);var M=e.match("^("+Xe+")("+O+")?$");M&&(e=M[1],A=M[2]||N)}else(!A||l.implicitUnits)&&(A=N);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=i,L();if(l.integer&&!Cl(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var R={name:t,value:e,strValue:""+e+(A||""),units:A,bypass:r};return l.unitless||A!=="px"&&A!=="em"?R.pfValue=e:R.pfValue=A==="px"||!A?e:this.getEmSizeInPixels()*e,(A==="ms"||A==="s")&&(R.pfValue=A==="ms"?e:1e3*e),(A==="deg"||A==="rad")&&(R.pfValue=A==="rad"?e:ih(e)),A==="%"&&(R.pfValue=e/100),R}else if(l.propList){var k=[],P=""+e;if(P!=="none"){for(var B=P.split(/\s*,\s*|\s+/),z=0;z<B.length;z++){var G=B[z].trim();n.properties[G]?k.push(G):Ie("`"+G+"` is not a valid property name")}if(k.length===0)return null}return{name:t,value:k,strValue:k.length===0?"none":k.join(" "),bypass:r}}else if(l.color){var F=Ul(e);return F?{name:t,value:F,pfValue:F,strValue:"rgb("+F[0]+","+F[1]+","+F[2]+")",bypass:r}:null}else if(l.regex||l.regexes){if(l.enums){var U=L();if(U)return U}for(var H=l.regexes?l.regexes:[l.regex],Y=0;Y<H.length;Y++){var Q=new RegExp(H[Y]),J=Q.exec(e);if(J)return{name:t,value:l.singleRegexMatchValue?J[1]:J,strValue:""+e,bypass:r}}return null}else return l.string?{name:t,value:""+e,strValue:""+e,bypass:r}:l.enums?L():null};var it=function t(e){if(!(this instanceof t))return new t(e);if(!pi(e)){Ve("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},ot=it.prototype;ot.instanceString=function(){return"style"};ot.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),a=0;a<this.length;a++)this[a]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(n){var s=n[0]._private;s.styleDirty=!0,s.appliedInitStyle=!1}),this};ot.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};ot.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};ot.selector=function(t){var e=t==="core"?null:new rr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};ot.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],a=0;a<t.properties.length;a++){var n=t.properties[a],s=r[n.name];s===void 0&&(s=r[dn(n.name)]),s!==void 0&&this.cssRule(n.name,s)}else e.length===2&&this.cssRule(e[0],e[1]);return this};ot.style=ot.css;ot.cssRule=function(t,e){var r=this.parse(t,e);if(r){var a=this.length-1;this[a].properties.push(r),this[a].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[a].mappedProperties.push(r);var n=!this[a].selector;n&&(this._private.coreStyle[r.name]=r)}return this};ot.append=function(t){return ho(t)?t.appendToStyle(this):ke(t)?this.appendFromJson(t):ge(t)&&this.appendFromString(t),this};it.fromJson=function(t,e){var r=new it(t);return r.fromJson(e),r};it.fromString=function(t,e){return new it(t).fromString(e)};[ut,Aa,Ii,Gt,Ln,Mi,je,An].forEach(function(t){Ee(ot,t)});it.types=ot.types;it.properties=ot.properties;it.propertyGroups=ot.propertyGroups;it.propertyGroupNames=ot.propertyGroupNames;it.propertyGroupKeys=ot.propertyGroupKeys;var Dg={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return ho(e)?r.style=e.generateStyle(this):ke(e)?r.style=it.fromJson(this,e):ge(e)?r.style=it.fromString(this,e):r.style=it(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},Sg="single",br={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=Sg),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,a,n,s,i,o;switch(e.length){case 0:return r;case 1:if(ge(e[0]))return a=e[0],r[a];if(De(e[0])){if(!this._private.panningEnabled)return this;s=e[0],i=s.x,o=s.y,se(i)&&(r.x=i),se(o)&&(r.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&se(n)&&(r[a]=n),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var a=arguments,n=this._private.pan,s,i,o,u,l;if(!this._private.panningEnabled)return this;switch(a.length){case 1:De(e)&&(o=a[0],u=o.x,l=o.y,se(u)&&(n.x+=u),se(l)&&(n.y+=l),this.emit("pan viewport"));break;case 2:s=e,i=r,(s==="x"||s==="y")&&se(i)&&(n[s]+=i),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,r){var a=this.getFitViewport(e,r);if(a){var n=this._private;n.zoom=a.zoom,n.pan=a.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(se(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(ge(e)){var n=e;e=this.$(n)}else if(Ll(e)){var s=e;a={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2},a.w=a.x2-a.x1,a.h=a.y2-a.y1}else yt(e)||(e=this.mutableElements());if(!(yt(e)&&e.empty())){a=a||e.boundingBox();var i=this.width(),o=this.height(),u;if(r=se(r)?r:0,!isNaN(i)&&!isNaN(o)&&i>0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){u=Math.min((i-2*r)/a.w,(o-2*r)/a.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(i-u*(a.x1+a.x2))/2,y:(o-u*(a.y1+a.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}return se(e)&&se(r)&&e<=r?(a.minZoom=e,a.maxZoom=r):se(e)&&r===void 0&&e<=a.maxZoom?a.minZoom=e:se(r)&&e===void 0&&r>=a.minZoom&&(a.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,a=r.pan,n=r.zoom,s,i,o=!1;if(r.zoomingEnabled||(o=!0),se(e)?i=e:De(e)&&(i=e.level,e.position!=null?s=mn(e.position,n,a):e.renderedPosition!=null&&(s=e.renderedPosition),s!=null&&!r.panningEnabled&&(o=!0)),i=i>r.maxZoom?r.maxZoom:i,i=i<r.minZoom?r.minZoom:i,o||!se(i)||i===n||s!=null&&(!se(s.x)||!se(s.y)))return null;if(s!=null){var u=a,l=n,f=i,h={x:-f/l*(s.x-u.x)+s.x,y:-f/l*(s.y-u.y)+s.y};return{zoomed:!0,panned:!0,zoom:f,pan:h}}else return{zoomed:!0,panned:!1,zoom:i,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),a=this._private;return r==null||!r.zoomed?this:(a.zoom=r.zoom,r.panned&&(a.pan.x=r.pan.x,a.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,a=!0,n=!0,s=[],i=!1,o=!1;if(!e)return this;if(se(e.zoom)||(a=!1),De(e.pan)||(n=!1),!a&&!n)return this;if(a){var u=e.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?i=!0:(r.zoom=u,s.push("zoom"))}if(n&&(!i||!e.cancelOnFailedZoom)&&r.panningEnabled){var l=e.pan;se(l.x)&&(r.pan.x=l.x,o=!1),se(l.y)&&(r.pan.y=l.y,o=!1),o||s.push("pan")}return s.length>0&&(s.push("viewport"),this.emit(s.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(ge(e)){var a=e;e=this.mutableElements().filter(a)}else yt(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),s=this.width(),i=this.height();r=r===void 0?this._private.zoom:r;var o={x:(s-r*(n.x1+n.x2))/2,y:(i-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),s=function(o){return parseFloat(n.getPropertyValue(o))};return{width:r.clientWidth-s("padding-left")-s("padding-right"),height:r.clientHeight-s("padding-top")-s("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}};br.centre=br.center;br.autolockNodes=br.autolock;br.autoungrabifyNodes=br.autoungrabify;var wa={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})};wa.attr=wa.data;wa.removeAttr=wa.removeData;var xa=function(e){var r=this;e=Ee({},e);var a=e.container;a&&!rn(a)&&rn(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var s=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=r;var i=_e!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=Ee({name:i?"grid":"null"},o.layout),o.renderer=Ee({name:i?"canvas":"null"},o.renderer);var u=function(c,p,g){return p!==void 0?p:g!==void 0?g:c},l=this._private={container:a,ready:!1,options:o,elements:new tt(this),listeners:[],aniEles:new tt(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,o.zoomingEnabled),userZoomingEnabled:u(!0,o.userZoomingEnabled),panningEnabled:u(!0,o.panningEnabled),userPanningEnabled:u(!0,o.userPanningEnabled),boxSelectionEnabled:u(!0,o.boxSelectionEnabled),autolock:u(!1,o.autolock,o.autolockNodes),autoungrabify:u(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:u(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?i:o.styleEnabled,zoom:se(o.zoom)?o.zoom:1,pan:{x:De(o.pan)&&se(o.pan.x)?o.pan.x:0,y:De(o.pan)&&se(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var f=function(c,p){var g=c.some(Al);if(g)return Yr.all(c).then(p);p(c)};l.styleEnabled&&r.setStyle([]);var h=Ee({},o,o.renderer);r.initRenderer(h);var d=function(c,p,g){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),c!=null&&(De(c)||ke(c))&&r.add(c),r.one("layoutready",function(m){r.notifications(!0),r.emit(m),r.one("load",p),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",g),r.emit("done")});var b=Ee({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};f([o.style,o.elements],function(v){var c=v[0],p=v[1];l.styleEnabled&&r.style().append(c),d(p,function(){r.startAnimationLoop(),l.ready=!0,ze(o.ready)&&r.on("ready",o.ready);for(var g=0;g<s.length;g++){var y=s[g];r.on("ready",y)}n&&(n.readies=[]),r.emit("ready")},o.done)})},fn=xa.prototype;Ee(fn,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return _e;var r=this._private.container.ownerDocument;return r===void 0||r==null?_e:r.defaultView||_e},mount:function(e){if(e!=null){var r=this,a=r._private,n=a.options;return!rn(e)&&rn(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),a.container=e,a.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Ee({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),r.startAnimationLoop(),r.style(n.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Bt(this._private.options)},json:function(e){var r=this,a=r._private,n=r.mutableElements(),s=function(T){return r.getElementById(T.id())};if(De(e)){if(r.startBatch(),e.elements){var i={},o=function(T,C){for(var S=[],E=[],x=0;x<T.length;x++){var w=T[x];if(!w.data.id){Ie("cy.json() cannot handle elements without an ID attribute");continue}var D=""+w.data.id,L=r.getElementById(D);i[D]=!0,L.length!==0?E.push({ele:L,json:w}):(C&&(w.group=C),S.push(w))}r.add(S);for(var A=0;A<E.length;A++){var N=E[A],O=N.ele,M=N.json;O.json(M)}};if(ke(e.elements))o(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var f=u[l],h=e.elements[f];ke(h)&&o(h,f)}var d=r.collection();n.filter(function(m){return!i[m.id()]}).forEach(function(m){m.isParent()?d.merge(m):m.remove()}),d.forEach(function(m){return m.children().move({parent:null})}),d.forEach(function(m){return s(m).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],c=0;c<v.length;c++){var p=v[c];e[p]!=null&&r[p](e[p])}return r.endBatch(),this}else{var g=!!e,y={};g?y.elements=this.elements().map(function(m){return m.json()}):(y.elements={},n.forEach(function(m){var T=m.group();y.elements[T]||(y.elements[T]=[]),y.elements[T].push(m.json())})),this._private.styleEnabled&&(y.style=r.style().json()),y.data=Bt(r.data());var b=a.options;return y.zoomingEnabled=a.zoomingEnabled,y.userZoomingEnabled=a.userZoomingEnabled,y.zoom=a.zoom,y.minZoom=a.minZoom,y.maxZoom=a.maxZoom,y.panningEnabled=a.panningEnabled,y.userPanningEnabled=a.userPanningEnabled,y.pan=Bt(a.pan),y.boxSelectionEnabled=a.boxSelectionEnabled,y.renderer=Bt(b.renderer),y.hideEdgesOnViewport=b.hideEdgesOnViewport,y.textureOnViewport=b.textureOnViewport,y.wheelSensitivity=b.wheelSensitivity,y.motionBlur=b.motionBlur,y.multiClickDebounceTime=b.multiClickDebounceTime,y}}});fn.$id=fn.getElementById;[gg,Eg,cu,ti,Za,xg,ri,Qa,Dg,br,wa].forEach(function(t){Ee(fn,t)});var Lg={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},Ag={maximal:!1,acyclic:!1},Ar=function(e){return e.scratch("breadthfirst")},Gs=function(e,r){return e.scratch("breadthfirst",r)};function du(t){this.options=Ee({},Lg,Ag,t)}du.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().filter(function(ae){return!ae.isParent()}),s=a,i=e.directed,o=e.acyclic||e.maximal||e.maximalAdjustments>0,u=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l;if(yt(e.roots))l=e.roots;else if(ke(e.roots)){for(var f=[],h=0;h<e.roots.length;h++){var d=e.roots[h],v=r.getElementById(d);f.push(v)}l=r.collection(f)}else if(ge(e.roots))l=r.$(e.roots);else if(i)l=n.roots();else{var c=a.components();l=r.collection();for(var p=function(te){var ue=c[te],ce=ue.maxDegree(!1),fe=ue.filter(function(ye){return ye.degree(!1)===ce});l=l.add(fe)},g=0;g<c.length;g++)p(g)}var y=[],b={},m=function(te,ue){y[ue]==null&&(y[ue]=[]);var ce=y[ue].length;y[ue].push(te),Gs(te,{index:ce,depth:ue})},T=function(te,ue){var ce=Ar(te),fe=ce.depth,ye=ce.index;y[fe][ye]=null,m(te,ue)};s.bfs({roots:l,directed:e.directed,visit:function(te,ue,ce,fe,ye){var Oe=te[0],Te=Oe.id();m(Oe,ye),b[Te]=!0}});for(var C=[],S=0;S<n.length;S++){var E=n[S];b[E.id()]||C.push(E)}var x=function(te){for(var ue=y[te],ce=0;ce<ue.length;ce++){var fe=ue[ce];if(fe==null){ue.splice(ce,1),ce--;continue}Gs(fe,{depth:te,index:ce})}},w=function(){for(var te=0;te<y.length;te++)x(te)},D=function(te,ue){for(var ce=Ar(te),fe=te.incomers().filter(function(I){return I.isNode()&&a.has(I)}),ye=-1,Oe=te.id(),Te=0;Te<fe.length;Te++){var xe=fe[Te],Se=Ar(xe);ye=Math.max(ye,Se.depth)}if(ce.depth<=ye){if(!e.acyclic&&ue[Oe])return null;var ee=ye+1;return T(te,ee),ue[Oe]=ee,!0}return!1};if(i&&o){var L=[],A={},N=function(te){return L.push(te)},O=function(){return L.shift()};for(n.forEach(function(ae){return L.push(ae)});L.length>0;){var M=O(),R=D(M,A);if(R)M.outgoers().filter(function(ae){return ae.isNode()&&a.has(ae)}).forEach(N);else if(R===null){Ie("Detected double maximal shift for node `"+M.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}w();var k=0;if(e.avoidOverlap)for(var P=0;P<n.length;P++){var B=n[P],z=B.layoutDimensions(e),G=z.w,F=z.h;k=Math.max(k,G,F)}var U={},H=function(te){if(U[te.id()])return U[te.id()];for(var ue=Ar(te).depth,ce=te.neighborhood(),fe=0,ye=0,Oe=0;Oe<ce.length;Oe++){var Te=ce[Oe];if(!(Te.isEdge()||Te.isParent()||!n.has(Te))){var xe=Ar(Te);if(xe!=null){var Se=xe.index,ee=xe.depth;if(!(Se==null||ee==null)){var I=y[ee].length;ee<ue&&(fe+=Se/I,ye++)}}}}return ye=Math.max(1,ye),fe=fe/ye,ye===0&&(fe=0),U[te.id()]=fe,fe},Y=function(te,ue){var ce=H(te),fe=H(ue),ye=ce-fe;return ye===0?co(te.id(),ue.id()):ye};e.depthSort!==void 0&&(Y=e.depthSort);for(var Q=0;Q<y.length;Q++)y[Q].sort(Y),x(Q);for(var J=[],q=0;q<C.length;q++)J.push(C[q]);y.unshift(J),w();for(var V=0,Z=0;Z<y.length;Z++)V=Math.max(y[Z].length,V);var K={x:u.x1+u.w/2,y:u.x1+u.h/2},ie=y.reduce(function(ae,te){return Math.max(ae,te.length)},0),ve=function(te){var ue=Ar(te),ce=ue.depth,fe=ue.index,ye=y[ce].length,Oe=Math.max(u.w/((e.grid?ie:ye)+1),k),Te=Math.max(u.h/(y.length+1),k),xe=Math.min(u.w/2/y.length,u.h/2/y.length);if(xe=Math.max(xe,k),e.circle){var ee=xe*ce+xe-(y.length>0&&y[0].length<=3?xe/2:0),I=2*Math.PI/y[ce].length*fe;return ce===0&&y[0].length===1&&(ee=1),{x:K.x+ee*Math.cos(I),y:K.y+ee*Math.sin(I)}}else{var Se={x:K.x+(fe+1-(ye+1)/2)*Oe,y:(ce+1)*Te};return Se}};return a.nodes().layoutPositions(this,e,ve),this};var Og={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 gu(t){this.options=Ee({},Og,t)}gu.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,s=a.nodes().not(":parent");e.sort&&(s=s.sort(e.sort));for(var i=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:i.x1+i.w/2,y:i.y1+i.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/s.length:e.sweep,l=u/Math.max(1,s.length-1),f,h=0,d=0;d<s.length;d++){var v=s[d],c=v.layoutDimensions(e),p=c.w,g=c.h;h=Math.max(h,p,g)}if(se(e.radius)?f=e.radius:s.length<=1?f=0:f=Math.min(i.h,i.w)/2-h,s.length>1&&e.avoidOverlap){h*=1.75;var y=Math.cos(l)-Math.cos(0),b=Math.sin(l)-Math.sin(0),m=Math.sqrt(h*h/(y*y+b*b));f=Math.max(m,f)}var T=function(S,E){var x=e.startAngle+E*l*(n?1:-1),w=f*Math.cos(x),D=f*Math.sin(x),L={x:o.x+w,y:o.y+D};return L};return a.nodes().layoutPositions(this,e,T),this};var Ng={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 pu(t){this.options=Ee({},Ng,t)}pu.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,s=n.nodes().not(":parent"),i=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:i.x1+i.w/2,y:i.y1+i.h/2},u=[],l=0,f=0;f<s.length;f++){var h=s[f],d=void 0;d=e.concentric(h),u.push({value:d,node:h}),h._private.scratch.concentric=d}s.updateStyle();for(var v=0;v<s.length;v++){var c=s[v],p=c.layoutDimensions(e);l=Math.max(l,p.w,p.h)}u.sort(function(ae,te){return te.value-ae.value});for(var g=e.levelWidth(s),y=[[]],b=y[0],m=0;m<u.length;m++){var T=u[m];if(b.length>0){var C=Math.abs(b[0].value-T.value);C>=g&&(b=[],y.push(b))}b.push(T)}var S=l+e.minNodeSpacing;if(!e.avoidOverlap){var E=y.length>0&&y[0].length>1,x=Math.min(i.w,i.h)/2-S,w=x/(y.length+E?1:0);S=Math.min(S,w)}for(var D=0,L=0;L<y.length;L++){var A=y[L],N=e.sweep===void 0?2*Math.PI-2*Math.PI/A.length:e.sweep,O=A.dTheta=N/Math.max(1,A.length-1);if(A.length>1&&e.avoidOverlap){var M=Math.cos(O)-Math.cos(0),R=Math.sin(O)-Math.sin(0),k=Math.sqrt(S*S/(M*M+R*R));D=Math.max(k,D)}A.r=D,D+=S}if(e.equidistant){for(var P=0,B=0,z=0;z<y.length;z++){var G=y[z],F=G.r-B;P=Math.max(P,F)}B=0;for(var U=0;U<y.length;U++){var H=y[U];U===0&&(B=H.r),H.r=B,B+=P}}for(var Y={},Q=0;Q<y.length;Q++)for(var J=y[Q],q=J.dTheta,V=J.r,Z=0;Z<J.length;Z++){var K=J[Z],ie=e.startAngle+(r?1:-1)*q*Z,ve={x:o.x+V*Math.cos(ie),y:o.y+V*Math.sin(ie)};Y[K.node.id()]=ve}return n.nodes().layoutPositions(this,e,function(ae){var te=ae.id();return Y[te]}),this};var Yn,Ig={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function On(t){this.options=Ee({},Ig,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),a=r.filter(function(n){var s=n.source().data("id"),i=n.target().data("id"),o=e.some(function(l){return l.data("id")===s}),u=e.some(function(l){return l.data("id")===i});return!o||!u});this.options.eles=this.options.eles.not(a)}On.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?Yn=!0:Yn=!1;var a=Mg(e,r,t);Yn&&Pg(a),t.randomize&&Bg(a);var n=Yt(),s=function(){Fg(a,e,t),t.fit===!0&&e.fit(t.padding)},i=function(d){return!(r.stopped||d>=t.numIter||(Gg(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp))},o=function(){if(t.animate===!0||t.animate===!1)s(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var d=t.eles.nodes(),v=yu(a,t,d);d.layoutPositions(r,t,v)}},u=0,l=!0;if(t.animate===!0){var f=function h(){for(var d=0;l&&d<t.refresh;)l=i(u),u++,d++;if(!l)Vs(a,t),o();else{var v=Yt();v-n>=t.animationThreshold&&s(),an(h)}};f()}else{for(;l;)l=i(u),u++;Vs(a,t),o()}return this};On.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};On.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Mg=function(e,r,a){for(var n=a.eles.edges(),s=a.eles.nodes(),i=pt(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:s.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:i.w,clientHeight:i.h,boundingBox:i},u=a.eles.components(),l={},f=0;f<u.length;f++)for(var h=u[f],d=0;d<h.length;d++){var v=h[d];l[v.id()]=f}for(var f=0;f<o.nodeSize;f++){var c=s[f],p=c.layoutDimensions(a),g={};g.isLocked=c.locked(),g.id=c.data("id"),g.parentId=c.data("parent"),g.cmptId=l[c.id()],g.children=[],g.positionX=c.position("x"),g.positionY=c.position("y"),g.offsetX=0,g.offsetY=0,g.height=p.w,g.width=p.h,g.maxX=g.positionX+g.width/2,g.minX=g.positionX-g.width/2,g.maxY=g.positionY+g.height/2,g.minY=g.positionY-g.height/2,g.padLeft=parseFloat(c.style("padding")),g.padRight=parseFloat(c.style("padding")),g.padTop=parseFloat(c.style("padding")),g.padBottom=parseFloat(c.style("padding")),g.nodeRepulsion=ze(a.nodeRepulsion)?a.nodeRepulsion(c):a.nodeRepulsion,o.layoutNodes.push(g),o.idToIndex[g.id]=f}for(var y=[],b=0,m=-1,T=[],f=0;f<o.nodeSize;f++){var c=o.layoutNodes[f],C=c.parentId;C!=null?o.layoutNodes[o.idToIndex[C]].children.push(c.id):(y[++m]=c.id,T.push(c.id))}for(o.graphSet.push(T);b<=m;){var S=y[b++],E=o.idToIndex[S],v=o.layoutNodes[E],x=v.children;if(x.length>0){o.graphSet.push(x);for(var f=0;f<x.length;f++)y[++m]=x[f]}}for(var f=0;f<o.graphSet.length;f++)for(var w=o.graphSet[f],d=0;d<w.length;d++){var D=o.idToIndex[w[d]];o.indexToGraph[D]=f}for(var f=0;f<o.edgeSize;f++){var L=n[f],A={};A.id=L.data("id"),A.sourceId=L.data("source"),A.targetId=L.data("target");var N=ze(a.idealEdgeLength)?a.idealEdgeLength(L):a.idealEdgeLength,O=ze(a.edgeElasticity)?a.edgeElasticity(L):a.edgeElasticity,M=o.idToIndex[A.sourceId],R=o.idToIndex[A.targetId],k=o.indexToGraph[M],P=o.indexToGraph[R];if(k!=P){for(var B=Rg(A.sourceId,A.targetId,o),z=o.graphSet[B],G=0,g=o.layoutNodes[M];z.indexOf(g.id)===-1;)g=o.layoutNodes[o.idToIndex[g.parentId]],G++;for(g=o.layoutNodes[R];z.indexOf(g.id)===-1;)g=o.layoutNodes[o.idToIndex[g.parentId]],G++;N*=G*a.nestingFactor}A.idealLength=N,A.elasticity=O,o.layoutEdges.push(A)}return o},Rg=function(e,r,a){var n=kg(e,r,0,a);return 2>n.count?0:n.graph},kg=function t(e,r,a,n){var s=n.graphSet[a];if(-1<s.indexOf(e)&&-1<s.indexOf(r))return{count:2,graph:a};for(var i=0,o=0;o<s.length;o++){var u=s[o],l=n.idToIndex[u],f=n.layoutNodes[l].children;if(f.length!==0){var h=n.indexToGraph[n.idToIndex[f[0]]],d=t(e,r,h,n);if(d.count!==0)if(d.count===1){if(i++,i===2)break}else return d}}return{count:i,graph:a}},Pg,Bg=function(e,r){for(var a=e.clientWidth,n=e.clientHeight,s=0;s<e.nodeSize;s++){var i=e.layoutNodes[s];i.children.length===0&&!i.isLocked&&(i.positionX=Math.random()*a,i.positionY=Math.random()*n)}},yu=function(e,r,a){var n=e.boundingBox,s={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(a.forEach(function(i){var o=e.layoutNodes[e.idToIndex[i.data("id")]];s.x1=Math.min(s.x1,o.positionX),s.x2=Math.max(s.x2,o.positionX),s.y1=Math.min(s.y1,o.positionY),s.y2=Math.max(s.y2,o.positionY)}),s.w=s.x2-s.x1,s.h=s.y2-s.y1),function(i,o){var u=e.layoutNodes[e.idToIndex[i.data("id")]];if(r.boundingBox){var l=(u.positionX-s.x1)/s.w,f=(u.positionY-s.y1)/s.h;return{x:n.x1+l*n.w,y:n.y1+f*n.h}}else return{x:u.positionX,y:u.positionY}}},Fg=function(e,r,a){var n=a.layout,s=a.eles.nodes(),i=yu(e,a,s);s.positions(i),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},Gg=function(e,r,a){zg(e,r),$g(e),Yg(e,r),_g(e),Hg(e)},zg=function(e,r){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],s=n.length,i=0;i<s;i++)for(var o=e.layoutNodes[e.idToIndex[n[i]]],u=i+1;u<s;u++){var l=e.layoutNodes[e.idToIndex[n[u]]];Vg(o,l,e,r)}},zs=function(e){return-e+2*e*Math.random()},Vg=function(e,r,a,n){var s=e.cmptId,i=r.cmptId;if(!(s!==i&&!a.isCompound)){var o=r.positionX-e.positionX,u=r.positionY-e.positionY,l=1;o===0&&u===0&&(o=zs(l),u=zs(l));var f=Ug(e,r,o,u);if(f>0)var h=n.nodeOverlap*f,d=Math.sqrt(o*o+u*u),v=h*o/d,c=h*u/d;else var p=hn(e,o,u),g=hn(r,-1*o,-1*u),y=g.x-p.x,b=g.y-p.y,m=y*y+b*b,d=Math.sqrt(m),h=(e.nodeRepulsion+r.nodeRepulsion)/m,v=h*y/d,c=h*b/d;e.isLocked||(e.offsetX-=v,e.offsetY-=c),r.isLocked||(r.offsetX+=v,r.offsetY+=c)}},Ug=function(e,r,a,n){if(a>0)var s=e.maxX-r.minX;else var s=r.maxX-e.minX;if(n>0)var i=e.maxY-r.minY;else var i=r.maxY-e.minY;return s>=0&&i>=0?Math.sqrt(s*s+i*i):0},hn=function(e,r,a){var n=e.positionX,s=e.positionY,i=e.height||1,o=e.width||1,u=a/r,l=i/o,f={};return r===0&&0<a||r===0&&0>a?(f.x=n,f.y=s+i/2,f):0<r&&-1*l<=u&&u<=l?(f.x=n+o/2,f.y=s+o*a/2/r,f):0>r&&-1*l<=u&&u<=l?(f.x=n-o/2,f.y=s-o*a/2/r,f):0<a&&(u<=-1*l||u>=l)?(f.x=n+i*r/2/a,f.y=s+i/2,f):(0>a&&(u<=-1*l||u>=l)&&(f.x=n-i*r/2/a,f.y=s-i/2),f)},$g=function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],s=e.idToIndex[n.sourceId],i=e.layoutNodes[s],o=e.idToIndex[n.targetId],u=e.layoutNodes[o],l=u.positionX-i.positionX,f=u.positionY-i.positionY;if(!(l===0&&f===0)){var h=hn(i,l,f),d=hn(u,-1*l,-1*f),v=d.x-h.x,c=d.y-h.y,p=Math.sqrt(v*v+c*c),g=Math.pow(n.idealLength-p,2)/n.elasticity;if(p!==0)var y=g*v/p,b=g*c/p;else var y=0,b=0;i.isLocked||(i.offsetX+=y,i.offsetY+=b),u.isLocked||(u.offsetX-=y,u.offsetY-=b)}}},Yg=function(e,r){if(r.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var s=e.graphSet[n],i=s.length;if(n===0)var o=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[s[0]]],f=e.layoutNodes[e.idToIndex[l.parentId]],o=f.positionX,u=f.positionY;for(var h=0;h<i;h++){var d=e.layoutNodes[e.idToIndex[s[h]]];if(!d.isLocked){var v=o-d.positionX,c=u-d.positionY,p=Math.sqrt(v*v+c*c);if(p>a){var g=r.gravity*v/p,y=r.gravity*c/p;d.offsetX+=g,d.offsetY+=y}}}}},_g=function(e,r){var a=[],n=0,s=-1;for(a.push.apply(a,e.graphSet[0]),s+=e.graphSet[0].length;n<=s;){var i=a[n++],o=e.idToIndex[i],u=e.layoutNodes[o],l=u.children;if(0<l.length&&!u.isLocked){for(var f=u.offsetX,h=u.offsetY,d=0;d<l.length;d++){var v=e.layoutNodes[e.idToIndex[l[d]]];v.offsetX+=f,v.offsetY+=h,a[++s]=l[d]}u.offsetX=0,u.offsetY=0}}},Hg=function(e,r){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&(n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0)}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(!(0<n.children.length||n.isLocked)){var s=Xg(n.offsetX,n.offsetY,e.temperature);n.positionX+=s.x,n.positionY+=s.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,qg(n,e)}}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&!n.isLocked&&(n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY)}},Xg=function(e,r,a){var n=Math.sqrt(e*e+r*r);if(n>a)var s={x:a*e/n,y:a*r/n};else var s={x:e,y:r};return s},qg=function t(e,r){var a=e.parentId;if(a!=null){var n=r.layoutNodes[r.idToIndex[a]],s=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,s=!0),(n.minX==null||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,s=!0),(n.maxY==null||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,s=!0),(n.minY==null||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,s=!0),s)return t(n,r)}},Vs=function(e,r){for(var a=e.layoutNodes,n=[],s=0;s<a.length;s++){var i=a[s],o=i.cmptId,u=n[o]=n[o]||[];u.push(i)}for(var l=0,s=0;s<n.length;s++){var f=n[s];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var h=0;h<f.length;h++){var d=f[h];f.x1=Math.min(f.x1,d.positionX-d.width/2),f.x2=Math.max(f.x2,d.positionX+d.width/2),f.y1=Math.min(f.y1,d.positionY-d.height/2),f.y2=Math.max(f.y2,d.positionY+d.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,l+=f.w*f.h}}n.sort(function(b,m){return m.w*m.h-b.w*b.h});for(var v=0,c=0,p=0,g=0,y=Math.sqrt(l)*e.clientWidth/e.clientHeight,s=0;s<n.length;s++){var f=n[s];if(f){for(var h=0;h<f.length;h++){var d=f[h];d.isLocked||(d.positionX+=v-f.x1,d.positionY+=c-f.y1)}v+=f.w+r.componentSpacing,p+=f.w+r.componentSpacing,g=Math.max(g,f.h),p>y&&(c+=g+r.componentSpacing,v=0,p=0,g=0)}}},Wg={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 mu(t){this.options=Ee({},Wg,t)}mu.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 s=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(s.h===0||s.w===0)a.nodes().layoutPositions(this,e,function(U){return{x:s.x1,y:s.y1}});else{var i=n.size(),o=Math.sqrt(i*s.h/s.w),u=Math.round(o),l=Math.round(s.w/s.h*o),f=function(H){if(H==null)return Math.min(u,l);var Y=Math.min(u,l);Y==u?u=H:l=H},h=function(H){if(H==null)return Math.max(u,l);var Y=Math.max(u,l);Y==u?u=H:l=H},d=e.rows,v=e.cols!=null?e.cols:e.columns;if(d!=null&&v!=null)u=d,l=v;else if(d!=null&&v==null)u=d,l=Math.ceil(i/u);else if(d==null&&v!=null)l=v,u=Math.ceil(i/l);else if(l*u>i){var c=f(),p=h();(c-1)*p>=i?f(c-1):(p-1)*c>=i&&h(p-1)}else for(;l*u<i;){var g=f(),y=h();(y+1)*g>=i?h(y+1):f(g+1)}var b=s.w/l,m=s.h/u;if(e.condense&&(b=0,m=0),e.avoidOverlap)for(var T=0;T<n.length;T++){var C=n[T],S=C._private.position;(S.x==null||S.y==null)&&(S.x=0,S.y=0);var E=C.layoutDimensions(e),x=e.avoidOverlapPadding,w=E.w+x,D=E.h+x;b=Math.max(b,w),m=Math.max(m,D)}for(var L={},A=function(H,Y){return!!L["c-"+H+"-"+Y]},N=function(H,Y){L["c-"+H+"-"+Y]=!0},O=0,M=0,R=function(){M++,M>=l&&(M=0,O++)},k={},P=0;P<n.length;P++){var B=n[P],z=e.position(B);if(z&&(z.row!==void 0||z.col!==void 0)){var G={row:z.row,col:z.col};if(G.col===void 0)for(G.col=0;A(G.row,G.col);)G.col++;else if(G.row===void 0)for(G.row=0;A(G.row,G.col);)G.row++;k[B.id()]=G,N(G.row,G.col)}}var F=function(H,Y){var Q,J;if(H.locked()||H.isParent())return!1;var q=k[H.id()];if(q)Q=q.col*b+b/2+s.x1,J=q.row*m+m/2+s.y1;else{for(;A(O,M);)R();Q=M*b+b/2+s.x1,J=O*m+m/2+s.y1,N(O,M),R()}return{x:Q,y:J}};n.layoutPositions(this,e,F)}return this};var Kg={ready:function(){},stop:function(){}};function Ri(t){this.options=Ee({},Kg,t)}Ri.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};Ri.prototype.stop=function(){return this};var Zg={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor: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 bu(t){this.options=Ee({},Zg,t)}bu.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),a=ze(t.positions);function n(s){if(t.positions==null)return eh(s.position());if(a)return t.positions(s);var i=t.positions[s._private.data.id];return i??null}return r.layoutPositions(this,t,function(s,i){var o=n(s);return s.locked()||o==null?!1:o}),this};var Qg={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Eu(t){this.options=Ee({},Qg,t)}Eu.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,a=pt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(i,o){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return r.nodes().layoutPositions(this,t,n),this};var Jg=[{name:"breadthfirst",impl:du},{name:"circle",impl:gu},{name:"concentric",impl:pu},{name:"cose",impl:On},{name:"grid",impl:mu},{name:"null",impl:Ri},{name:"preset",impl:bu},{name:"random",impl:Eu}];function wu(t){this.options=t,this.notifications=0}var Us=function(){},$s=function(){throw new Error("A headless instance can not render images")};wu.prototype={recalculateRenderedStyle:Us,notify:function(){this.notifications++},init:Us,isHeadless:function(){return!0},png:$s,jpg:$s};var ki={};ki.arrowShapeWidth=.3;ki.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(l,f,h,d,v,c,p){var g=v.x-h/2-p,y=v.x+h/2+p,b=v.y-h/2-p,m=v.y+h/2+p,T=g<=l&&l<=y&&b<=f&&f<=m;return T},a=function(l,f,h,d,v){var c=l*Math.cos(d)-f*Math.sin(d),p=l*Math.sin(d)+f*Math.cos(d),g=c*h,y=p*h,b=g+v.x,m=y+v.y;return{x:b,y:m}},n=function(l,f,h,d){for(var v=[],c=0;c<l.length;c+=2){var p=l[c],g=l[c+1];v.push(a(p,g,f,h,d))}return v},s=function(l){for(var f=[],h=0;h<l.length;h++){var d=l[h];f.push(d.x,d.y)}return f},i=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},o=function(l,f){ge(f)&&(f=t[f]),t[l]=Ee({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(d,v,c,p,g,y){var b=s(n(this.points,c+2*y,p,g)),m=gt(d,v,b);return m},roughCollide:r,draw:function(d,v,c,p){var g=n(this.points,v,c,p);e.arrowShapeImpl("polygon")(d,g)},spacing:function(d){return 0},gap:i},f)};o("none",{collide:nn,roughCollide:nn,draw:bi,spacing:Ji,gap:Ji}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(l,f,h,d,v){var c=n(this.points,f,h,d),p=this.controlPoint,g=a(p[0],p[1],f,h,d);e.arrowShapeImpl(this.name)(l,c,g)},gap:function(l){return i(l)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,f,h,d,v,c,p){var g=s(n(this.points,h+2*p,d,v)),y=s(n(this.pointsTee,h+2*p,d,v)),b=gt(l,f,g)||gt(l,f,y);return b},draw:function(l,f,h,d,v){var c=n(this.points,f,h,d),p=n(this.pointsTee,f,h,d);e.arrowShapeImpl(this.name)(l,c,p)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,f,h,d,v,c,p){var g=v,y=Math.pow(g.x-l,2)+Math.pow(g.y-f,2)<=Math.pow((h+2*p)*this.radius,2),b=s(n(this.points,h+2*p,d,v));return gt(l,f,b)||y},draw:function(l,f,h,d,v){var c=n(this.pointsTr,f,h,d);e.arrowShapeImpl(this.name)(l,c,d.x,d.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(l,f){var h=this.baseCrossLinePts.slice(),d=f/l,v=3,c=5;return h[v]=h[v]-d,h[c]=h[c]-d,h},collide:function(l,f,h,d,v,c,p){var g=s(n(this.points,h+2*p,d,v)),y=s(n(this.crossLinePts(h,c),h+2*p,d,v)),b=gt(l,f,g)||gt(l,f,y);return b},draw:function(l,f,h,d,v){var c=n(this.points,f,h,d),p=n(this.crossLinePts(f,v),f,h,d);e.arrowShapeImpl(this.name)(l,c,p)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return i(l)*.525}}),o("circle",{radius:.15,collide:function(l,f,h,d,v,c,p){var g=v,y=Math.pow(g.x-l,2)+Math.pow(g.y-f,2)<=Math.pow((h+2*p)*this.radius,2);return y},draw:function(l,f,h,d,v){e.arrowShapeImpl(this.name)(l,d.x,d.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(l){return .95*l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}})};var xr={};xr.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],s=a[1],i=a[4],o=r.pan(),u=r.zoom(),l=((t-n)/i-o.x)/u,f=((e-s)/i-o.y)/u;return[l,f]};xr.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),a=function(y){return parseFloat(r.getPropertyValue(y))},n={left:a("padding-left"),right:a("padding-right"),top:a("padding-top"),bottom:a("padding-bottom")},s={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},i=t.clientWidth,o=t.clientHeight,u=n.left+n.right,l=n.top+n.bottom,f=s.left+s.right,h=e.width/(i+f),d=i-u,v=o-l,c=e.left+n.left+s.left,p=e.top+n.top+s.top;return this.containerBB=[c,p,d,v,h]};xr.invalidateContainerClientCoordsCache=function(){this.containerBB=null};xr.findNearestElement=function(t,e,r,a){return this.findNearestElements(t,e,r,a)[0]};xr.findNearestElements=function(t,e,r,a){var n=this,s=this,i=s.getCachedZSortedEles(),o=[],u=s.cy.zoom(),l=s.cy.hasCompoundNodes(),f=(a?24:8)/u,h=(a?8:2)/u,d=(a?8:2)/u,v=1/0,c,p;r&&(i=i.interactive);function g(E,x){if(E.isNode()){if(p)return;p=E,o.push(E)}if(E.isEdge()&&(x==null||x<v))if(c){if(c.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&c.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var w=0;w<o.length;w++)if(o[w].isEdge()){o[w]=E,c=E,v=x??v;break}}}else o.push(E),c=E,v=x??v}function y(E){var x=E.outerWidth()+2*h,w=E.outerHeight()+2*h,D=x/2,L=w/2,A=E.position(),N=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,O=E._private.rscratch;if(A.x-D<=t&&t<=A.x+D&&A.y-L<=e&&e<=A.y+L){var M=s.nodeShapes[n.getNodeShape(E)];if(M.checkPoint(t,e,0,x,w,A.x,A.y,N,O))return g(E,0),!0}}function b(E){var x=E._private,w=x.rscratch,D=E.pstyle("width").pfValue,L=E.pstyle("arrow-scale").value,A=D/2+f,N=A*A,O=A*2,P=x.source,B=x.target,M;if(w.edgeType==="segments"||w.edgeType==="straight"||w.edgeType==="haystack"){for(var R=w.allpts,k=0;k+3<R.length;k+=2)if(ch(t,e,R[k],R[k+1],R[k+2],R[k+3],O)&&N>(M=mh(t,e,R[k],R[k+1],R[k+2],R[k+3])))return g(E,M),!0}else if(w.edgeType==="bezier"||w.edgeType==="multibezier"||w.edgeType==="self"||w.edgeType==="compound"){for(var R=w.allpts,k=0;k+5<w.allpts.length;k+=4)if(dh(t,e,R[k],R[k+1],R[k+2],R[k+3],R[k+4],R[k+5],O)&&N>(M=yh(t,e,R[k],R[k+1],R[k+2],R[k+3],R[k+4],R[k+5])))return g(E,M),!0}for(var P=P||x.source,B=B||x.target,z=n.getArrowWidth(D,L),G=[{name:"source",x:w.arrowStartX,y:w.arrowStartY,angle:w.srcArrowAngle},{name:"target",x:w.arrowEndX,y:w.arrowEndY,angle:w.tgtArrowAngle},{name:"mid-source",x:w.midX,y:w.midY,angle:w.midsrcArrowAngle},{name:"mid-target",x:w.midX,y:w.midY,angle:w.midtgtArrowAngle}],k=0;k<G.length;k++){var F=G[k],U=s.arrowShapes[E.pstyle(F.name+"-arrow-shape").value],H=E.pstyle("width").pfValue;if(U.roughCollide(t,e,z,F.angle,{x:F.x,y:F.y},H,f)&&U.collide(t,e,z,F.angle,{x:F.x,y:F.y},H,f))return g(E),!0}l&&o.length>0&&(y(P),y(B))}function m(E,x,w){return Ot(E,x,w)}function T(E,x){var w=E._private,D=d,L;x?L=x+"-":L="",E.boundingBox();var A=w.labelBounds[x||"main"],N=E.pstyle(L+"label").value,O=E.pstyle("text-events").strValue==="yes";if(!(!O||!N)){var M=m(w.rscratch,"labelX",x),R=m(w.rscratch,"labelY",x),k=m(w.rscratch,"labelAngle",x),P=E.pstyle(L+"text-margin-x").pfValue,B=E.pstyle(L+"text-margin-y").pfValue,z=A.x1-D-P,G=A.x2+D-P,F=A.y1-D-B,U=A.y2+D-B;if(k){var H=Math.cos(k),Y=Math.sin(k),Q=function(ve,ae){return ve=ve-M,ae=ae-R,{x:ve*H-ae*Y+M,y:ve*Y+ae*H+R}},J=Q(z,F),q=Q(z,U),V=Q(G,F),Z=Q(G,U),K=[J.x+P,J.y+B,V.x+P,V.y+B,Z.x+P,Z.y+B,q.x+P,q.y+B];if(gt(t,e,K))return g(E),!0}else if(zr(A,t,e))return g(E),!0}}for(var C=i.length-1;C>=0;C--){var S=i[C];S.isNode()?y(S)||T(S):b(S)||T(S)||T(S,"source")||T(S,"target")}return o};xr.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,s=[],i=Math.min(t,r),o=Math.max(t,r),u=Math.min(e,a),l=Math.max(e,a);t=i,r=o,e=u,a=l;for(var f=pt({x1:t,y1:e,x2:r,y2:a}),h=0;h<n.length;h++){var d=n[h];if(d.isNode()){var v=d,c=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});xi(f,c)&&!No(c,f)&&s.push(v)}else{var p=d,g=p._private,y=g.rscratch;if(y.startX!=null&&y.startY!=null&&!zr(f,y.startX,y.startY)||y.endX!=null&&y.endY!=null&&!zr(f,y.endX,y.endY))continue;if(y.edgeType==="bezier"||y.edgeType==="multibezier"||y.edgeType==="self"||y.edgeType==="compound"||y.edgeType==="segments"||y.edgeType==="haystack"){for(var b=g.rstyle.bezierPts||g.rstyle.linePts||g.rstyle.haystackPts,m=!0,T=0;T<b.length;T++)if(!vh(f,b[T])){m=!1;break}m&&s.push(p)}else(y.edgeType==="haystack"||y.edgeType==="straight")&&s.push(p)}}return s};var vn={};vn.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",s=e.edgeType==="segments",i=e.edgeType==="compound",o=e.edgeType==="self",u,l,f,h,d,v,y,b;if(r?(f=e.haystackPts[0],h=e.haystackPts[1],d=e.haystackPts[2],v=e.haystackPts[3]):(f=e.arrowStartX,h=e.arrowStartY,d=e.arrowEndX,v=e.arrowEndY),y=e.midX,b=e.midY,s)u=f-e.segpts[0],l=h-e.segpts[1];else if(n||i||o||a){var c=e.allpts,p=Ze(c[0],c[2],c[4],.1),g=Ze(c[1],c[3],c[5],.1);u=f-p,l=h-g}else u=f-y,l=h-b;e.srcArrowAngle=ka(u,l);var y=e.midX,b=e.midY;if(r&&(y=(f+d)/2,b=(h+v)/2),u=d-f,l=v-h,s){var c=e.allpts;if(c.length/2%2===0){var m=c.length/2,T=m-2;u=c[m]-c[T],l=c[m+1]-c[T+1]}else if(e.isRound)u=e.midVector[1],l=-e.midVector[0];else{var m=c.length/2-1,T=m-2;u=c[m]-c[T],l=c[m+1]-c[T+1]}}else if(n||i||o){var c=e.allpts,C=e.ctrlpts,S,E,x,w;if(C.length/2%2===0){var D=c.length/2-1,L=D+2,A=L+2;S=Ze(c[D],c[L],c[A],0),E=Ze(c[D+1],c[L+1],c[A+1],0),x=Ze(c[D],c[L],c[A],1e-4),w=Ze(c[D+1],c[L+1],c[A+1],1e-4)}else{var L=c.length/2-1,D=L-2,A=L+2;S=Ze(c[D],c[L],c[A],.4999),E=Ze(c[D+1],c[L+1],c[A+1],.4999),x=Ze(c[D],c[L],c[A],.5),w=Ze(c[D+1],c[L+1],c[A+1],.5)}u=x-S,l=w-E}if(e.midtgtArrowAngle=ka(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,s){var c=e.allpts;if(c.length/2%2!==0){if(!e.isRound){var m=c.length/2-1,N=m+2;u=-(c[N]-c[m]),l=-(c[N+1]-c[m+1])}}}if(e.midsrcArrowAngle=ka(u,l),s)u=d-e.segpts[e.segpts.length-2],l=v-e.segpts[e.segpts.length-1];else if(n||i||o||a){var c=e.allpts,O=c.length,p=Ze(c[O-6],c[O-4],c[O-2],.9),g=Ze(c[O-5],c[O-3],c[O-1],.9);u=d-p,l=v-g}else u=d-y,l=v-b;e.tgtArrowAngle=ka(u,l)};vn.getArrowWidth=vn.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},a=r[t+", "+e];return a||(a=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=a,a)};var ai,ni,Pt={},Et={},Ys,_s,vr,Ja,$t,ur,hr,kt,Or,Ya,xu,Tu,ii,si,Hs,Xs=function(e,r,a){a.x=r.x-e.x,a.y=r.y-e.y,a.len=Math.sqrt(a.x*a.x+a.y*a.y),a.nx=a.x/a.len,a.ny=a.y/a.len,a.ang=Math.atan2(a.ny,a.nx)},jg=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},ep=function(e,r,a,n,s){if(e!==Hs?Xs(r,e,Pt):jg(Et,Pt),Xs(r,a,Et),Ys=Pt.nx*Et.ny-Pt.ny*Et.nx,_s=Pt.nx*Et.nx-Pt.ny*-Et.ny,$t=Math.asin(Math.max(-1,Math.min(1,Ys))),Math.abs($t)<1e-6){ai=r.x,ni=r.y,hr=Or=0;return}vr=1,Ja=!1,_s<0?$t<0?$t=Math.PI+$t:($t=Math.PI-$t,vr=-1,Ja=!0):$t>0&&(vr=-1,Ja=!0),r.radius!==void 0?Or=r.radius:Or=n,ur=$t/2,Ya=Math.min(Pt.len/2,Et.len/2),s?(kt=Math.abs(Math.cos(ur)*Or/Math.sin(ur)),kt>Ya?(kt=Ya,hr=Math.abs(kt*Math.sin(ur)/Math.cos(ur))):hr=Or):(kt=Math.min(Ya,Or),hr=Math.abs(kt*Math.sin(ur)/Math.cos(ur))),ii=r.x+Et.nx*kt,si=r.y+Et.ny*kt,ai=ii-Et.ny*hr*vr,ni=si+Et.nx*hr*vr,xu=r.x+Pt.nx*kt,Tu=r.y+Pt.ny*kt,Hs=r};function Cu(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Pi(t,e,r,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(ep(t,e,r,a,n),{cx:ai,cy:ni,radius:hr,startX:xu,startY:Tu,stopX:ii,stopY:si,startAngle:Pt.ang+Math.PI/2*vr,endAngle:Et.ang-Math.PI/2*vr,counterClockwise:Ja})}var lt={};lt.findMidptPtsEtc=function(t,e){var r=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,s,i=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),u=i.units!=null&&o.units!=null,l=function(C,S,E,x){var w=x-S,D=E-C,L=Math.sqrt(D*D+w*w);return{x:-w/L,y:D/L}},f=t.pstyle("edge-distances").value;switch(f){case"node-position":s=r;break;case"intersection":s=a;break;case"endpoints":{if(u){var h=this.manualEndptToPx(t.source()[0],i),d=Lt(h,2),v=d[0],c=d[1],p=this.manualEndptToPx(t.target()[0],o),g=Lt(p,2),y=g[0],b=g[1],m={x1:v,y1:c,x2:y,y2:b};n=l(v,c,y,b),s=m}else Ie("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),s=a;break}}return{midptPts:s,vectorNormInverse:n}};lt.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],a=r._private,n=a.rscratch;if(!n.haystack){var s=Math.random()*2*Math.PI;n.source={x:Math.cos(s),y:Math.sin(s)},s=Math.random()*2*Math.PI,n.target={x:Math.cos(s),y:Math.sin(s)}}var i=a.source,o=a.target,u=i.position(),l=o.position(),f=i.width(),h=o.width(),d=i.height(),v=o.height(),c=r.pstyle("haystack-radius").value,p=c/2;n.haystackPts=n.allpts=[n.source.x*f*p+u.x,n.source.y*d*p+u.y,n.target.x*h*p+l.x,n.target.y*v*p+l.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};lt.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=t.pstyle("segment-weights"),n=t.pstyle("segment-distances"),s=t.pstyle("segment-radii"),i=t.pstyle("radius-type"),o=Math.min(a.pfValue.length,n.pfValue.length),u=s.pfValue[s.pfValue.length-1],l=i.pfValue[i.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<o;f++){var h=a.pfValue[f],d=n.pfValue[f],v=1-h,c=h,p=this.findMidptPtsEtc(t,e),g=p.midptPts,y=p.vectorNormInverse,b={x:g.x1*v+g.x2*c,y:g.y1*v+g.y2*c};r.segpts.push(b.x+y.x*d,b.y+y.y*d),r.radii.push(s.pfValue[f]!==void 0?s.pfValue[f]:u),r.isArcRadius.push((i.pfValue[f]!==void 0?i.pfValue[f]:l)==="arc-radius")}};lt.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,s=e.dirCounts,i=e.srcPos,o=t.pstyle("control-point-distances"),u=o?o.pfValue[0]:void 0,l=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,h=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var d=r,v=h;a&&(d=0,v=u);var c=l-Math.PI/2,p=c-f/2,g=c+f/2,y=l+"_"+f;d=s[y]===void 0?s[y]=0:++s[y],n.ctrlpts=[i.x+Math.cos(p)*1.4*v*(d/3+1),i.y+Math.sin(p)*1.4*v*(d/3+1),i.x+Math.cos(g)*1.4*v*(d/3+1),i.y+Math.sin(g)*1.4*v*(d/3+1)]};lt.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var s=e.srcPos,i=e.tgtPos,o=e.srcW,u=e.srcH,l=e.tgtW,f=e.tgtH,h=t.pstyle("control-point-step-size").pfValue,d=t.pstyle("control-point-distances"),v=d?d.pfValue[0]:void 0,c=r,p=h;a&&(c=0,p=v);var g=50,y={x:s.x-o/2,y:s.y-u/2},b={x:i.x-l/2,y:i.y-f/2},m={x:Math.min(y.x,b.x),y:Math.min(y.y,b.y)},T=.5,C=Math.max(T,Math.log(o*.01)),S=Math.max(T,Math.log(l*.01));n.ctrlpts=[m.x,m.y-(1+Math.pow(g,1.12)/100)*p*(c/3+1)*C,m.x-(1+Math.pow(g,1.12)/100)*p*(c/3+1)*S,m.y]};lt.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};lt.findBezierPoints=function(t,e,r,a,n){var s=t._private.rscratch,i=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),l=o&&u?Math.min(o.value.length,u.value.length):1,f=o?o.pfValue[0]:void 0,h=u.value[0],d=a;s.edgeType=d?"multibezier":"bezier",s.ctrlpts=[];for(var v=0;v<l;v++){var c=(.5-e.eles.length/2+r)*i*(n?-1:1),p=void 0,g=Ao(c);d&&(f=o?o.pfValue[v]:i,h=u.value[v]),a?p=f:p=f!==void 0?g*f:void 0;var y=p!==void 0?p:c,b=1-h,m=h,T=this.findMidptPtsEtc(t,e),C=T.midptPts,S=T.vectorNormInverse,E={x:C.x1*b+C.x2*m,y:C.y1*b+C.y2*m};s.ctrlpts.push(E.x+S.x*y,E.y+S.y*y)}};lt.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",s="leftward",i="rightward",o="downward",u="upward",l="auto",f=e.posPts,h=e.srcW,d=e.srcH,v=e.tgtW,c=e.tgtH,p=t.pstyle("edge-distances").value,g=p!=="node-position",y=t.pstyle("taxi-direction").value,b=y,m=t.pstyle("taxi-turn"),T=m.units==="%",C=m.pfValue,S=C<0,E=t.pstyle("taxi-turn-min-distance").pfValue,x=g?(h+v)/2:0,w=g?(d+c)/2:0,D=f.x2-f.x1,L=f.y2-f.y1,A=function(me,be){return me>0?Math.max(me-be,0):Math.min(me+be,0)},N=A(D,x),O=A(L,w),M=!1;b===l?y=Math.abs(N)>Math.abs(O)?n:a:b===u||b===o?(y=a,M=!0):(b===s||b===i)&&(y=n,M=!0);var R=y===a,k=R?O:N,P=R?L:D,B=Ao(P),z=!1;!(M&&(T||S))&&(b===o&&P<0||b===u&&P>0||b===s&&P>0||b===i&&P<0)&&(B*=-1,k=B*Math.abs(k),z=!0);var G;if(T){var F=C<0?1+C:C;G=F*k}else{var U=C<0?k:0;G=U+C*B}var H=function(me){return Math.abs(me)<E||Math.abs(me)>=Math.abs(k)},Y=H(G),Q=H(Math.abs(k)-Math.abs(G)),J=Y||Q;if(J&&!z)if(R){var q=Math.abs(P)<=d/2,V=Math.abs(D)<=v/2;if(q){var Z=(f.x1+f.x2)/2,K=f.y1,ie=f.y2;r.segpts=[Z,K,Z,ie]}else if(V){var ve=(f.y1+f.y2)/2,ae=f.x1,te=f.x2;r.segpts=[ae,ve,te,ve]}else r.segpts=[f.x1,f.y2]}else{var ue=Math.abs(P)<=h/2,ce=Math.abs(L)<=c/2;if(ue){var fe=(f.y1+f.y2)/2,ye=f.x1,Oe=f.x2;r.segpts=[ye,fe,Oe,fe]}else if(ce){var Te=(f.x1+f.x2)/2,xe=f.y1,Se=f.y2;r.segpts=[Te,xe,Te,Se]}else r.segpts=[f.x2,f.y1]}else if(R){var ee=f.y1+G+(g?d/2*B:0),I=f.x1,$=f.x2;r.segpts=[I,ee,$,ee]}else{var j=f.x1+G+(g?h/2*B:0),X=f.y1,_=f.y2;r.segpts=[j,X,j,_]}if(r.isRound){var ne=t.pstyle("taxi-radius").value,W=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ne),r.isArcRadius=new Array(r.segpts.length/2).fill(W)}};lt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,s=e.srcW,i=e.srcH,o=e.tgtW,u=e.tgtH,l=e.srcShape,f=e.tgtShape,h=e.srcCornerRadius,d=e.tgtCornerRadius,v=e.srcRs,c=e.tgtRs,p=!se(r.startX)||!se(r.startY),g=!se(r.arrowStartX)||!se(r.arrowStartY),y=!se(r.endX)||!se(r.endY),b=!se(r.arrowEndX)||!se(r.arrowEndY),m=3,T=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=m*T,S=pr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),E=S<C,x=pr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),w=x<C,D=!1;if(p||g||E){D=!0;var L={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},A=Math.sqrt(L.x*L.x+L.y*L.y),N={x:L.x/A,y:L.y/A},O=Math.max(s,i),M={x:r.ctrlpts[0]+N.x*2*O,y:r.ctrlpts[1]+N.y*2*O},R=l.intersectLine(a.x,a.y,s,i,M.x,M.y,0,h,v);E?(r.ctrlpts[0]=r.ctrlpts[0]+N.x*(C-S),r.ctrlpts[1]=r.ctrlpts[1]+N.y*(C-S)):(r.ctrlpts[0]=R[0]+N.x*C,r.ctrlpts[1]=R[1]+N.y*C)}if(y||b||w){D=!0;var k={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},P=Math.sqrt(k.x*k.x+k.y*k.y),B={x:k.x/P,y:k.y/P},z=Math.max(s,i),G={x:r.ctrlpts[0]+B.x*2*z,y:r.ctrlpts[1]+B.y*2*z},F=f.intersectLine(n.x,n.y,o,u,G.x,G.y,0,d,c);w?(r.ctrlpts[0]=r.ctrlpts[0]+B.x*(C-x),r.ctrlpts[1]=r.ctrlpts[1]+B.y*(C-x)):(r.ctrlpts[0]=F[0]+B.x*C,r.ctrlpts[1]=F[1]+B.y*C)}D&&this.findEndpoints(t)}};lt.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var a,n;e.ctrlpts.length/2%2===0?(a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1]):(a=e.allpts.length/2-3,n=.5,e.midX=Ze(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=Ze(e.allpts[a+1],e.allpts[a+3],e.allpts[a+5],n))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var s=2;s+3<e.allpts.length;s+=2){var i=e.radii[s/2-1],o=e.isArcRadius[s/2-1];e.roundCorners.push(Pi({x:e.allpts[s-2],y:e.allpts[s-1]},{x:e.allpts[s],y:e.allpts[s+1],radius:i},{x:e.allpts[s+2],y:e.allpts[s+3]},i,o))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,l=u-2;e.midX=(e.segpts[l]+e.segpts[u])/2,e.midY=(e.segpts[l+1]+e.segpts[u+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var h={x:e.segpts[f],y:e.segpts[f+1]},d=e.roundCorners[f/2],v=[h.x-d.cx,h.y-d.cy],c=d.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(p){return p*c}),e.midX=d.cx+v[0],e.midY=d.cy+v[1],e.midVector=v}}}};lt.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||se(e.startX)&&se(e.startY)&&se(e.endX)&&se(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ie("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};lt.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,a=r.cy,n=a.hasCompoundNodes(),s={map:new Ft,get:function(E){var x=this.map.get(E[0]);return x!=null?x.get(E[1]):null},set:function(E,x){var w=this.map.get(E[0]);w==null&&(w=new Ft,this.map.set(E[0],w)),w.set(E[1],x)}},i=[],o=[],u=0;u<t.length;u++){var l=t[u],f=l._private,h=l.pstyle("curve-style").value;if(!(l.removed()||!l.takesUpSpace())){if(h==="haystack"){o.push(l);continue}var d=h==="unbundled-bezier"||h.endsWith("segments")||h==="straight"||h==="straight-triangle"||h.endsWith("taxi"),v=h==="unbundled-bezier"||h==="bezier",c=f.source,p=f.target,g=c.poolIndex(),y=p.poolIndex(),b=[g,y].sort(),m=s.get(b);m==null&&(m={eles:[]},s.set(b,m),i.push(b)),m.eles.push(l),d&&(m.hasUnbundled=!0),v&&(m.hasBezier=!0)}}for(var T=function(E){var x=i[E],w=s.get(x),D=void 0;if(!w.hasUnbundled){var L=w.eles[0].parallelEdges().filter(function(j){return j.isBundledBezier()});Ei(w.eles),L.forEach(function(j){return w.eles.push(j)}),w.eles.sort(function(j,X){return j.poolIndex()-X.poolIndex()})}var A=w.eles[0],N=A.source(),O=A.target();if(N.poolIndex()>O.poolIndex()){var M=N;N=O,O=M}var R=w.srcPos=N.position(),k=w.tgtPos=O.position(),P=w.srcW=N.outerWidth(),B=w.srcH=N.outerHeight(),z=w.tgtW=O.outerWidth(),G=w.tgtH=O.outerHeight(),F=w.srcShape=r.nodeShapes[e.getNodeShape(N)],U=w.tgtShape=r.nodeShapes[e.getNodeShape(O)],H=w.srcCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,Y=w.tgtCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,Q=w.tgtRs=O._private.rscratch,J=w.srcRs=N._private.rscratch;w.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var q=0;q<w.eles.length;q++){var V=w.eles[q],Z=V[0]._private.rscratch,K=V.pstyle("curve-style").value,ie=K==="unbundled-bezier"||K.endsWith("segments")||K.endsWith("taxi"),ve=!N.same(V.source());if(!w.calculatedIntersection&&N!==O&&(w.hasBezier||w.hasUnbundled)){w.calculatedIntersection=!0;var ae=F.intersectLine(R.x,R.y,P,B,k.x,k.y,0,H,J),te=w.srcIntn=ae,ue=U.intersectLine(k.x,k.y,z,G,R.x,R.y,0,Y,Q),ce=w.tgtIntn=ue,fe=w.intersectionPts={x1:ae[0],x2:ue[0],y1:ae[1],y2:ue[1]},ye=w.posPts={x1:R.x,x2:k.x,y1:R.y,y2:k.y},Oe=ue[1]-ae[1],Te=ue[0]-ae[0],xe=Math.sqrt(Te*Te+Oe*Oe),Se=w.vector={x:Te,y:Oe},ee=w.vectorNorm={x:Se.x/xe,y:Se.y/xe},I={x:-ee.y,y:ee.x};w.nodesOverlap=!se(xe)||U.checkPoint(ae[0],ae[1],0,z,G,k.x,k.y,Y,Q)||F.checkPoint(ue[0],ue[1],0,P,B,R.x,R.y,H,J),w.vectorNormInverse=I,D={nodesOverlap:w.nodesOverlap,dirCounts:w.dirCounts,calculatedIntersection:!0,hasBezier:w.hasBezier,hasUnbundled:w.hasUnbundled,eles:w.eles,srcPos:k,tgtPos:R,srcW:z,srcH:G,tgtW:P,tgtH:B,srcIntn:ce,tgtIntn:te,srcShape:U,tgtShape:F,posPts:{x1:ye.x2,y1:ye.y2,x2:ye.x1,y2:ye.y1},intersectionPts:{x1:fe.x2,y1:fe.y2,x2:fe.x1,y2:fe.y1},vector:{x:-Se.x,y:-Se.y},vectorNorm:{x:-ee.x,y:-ee.y},vectorNormInverse:{x:-I.x,y:-I.y}}}var $=ve?D:w;Z.nodesOverlap=$.nodesOverlap,Z.srcIntn=$.srcIntn,Z.tgtIntn=$.tgtIntn,Z.isRound=K.startsWith("round"),n&&(N.isParent()||N.isChild()||O.isParent()||O.isChild())&&(N.parents().anySame(O)||O.parents().anySame(N)||N.same(O)&&N.isParent())?e.findCompoundLoopPoints(V,$,q,ie):N===O?e.findLoopPoints(V,$,q,ie):K.endsWith("segments")?e.findSegmentsPoints(V,$):K.endsWith("taxi")?e.findTaxiPoints(V,$):K==="straight"||!ie&&w.eles.length%2===1&&q===Math.floor(w.eles.length/2)?e.findStraightEdgePoints(V):e.findBezierPoints(V,$,q,ie,ve),e.findEndpoints(V),e.tryToCorrectInvalidPoints(V,$),e.checkForInvalidEdgeWarning(V),e.storeAllpts(V),e.storeEdgeProjections(V),e.calculateArrowAngles(V),e.recalculateEdgeLabelProjections(V),e.calculateLabelAngles(V)}},C=0;C<i.length;C++)T(C);this.findHaystackPoints(o)}};function Du(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];e.push({x:a,y:n})}return e}}lt.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),Du(e.segpts)};lt.getControlPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return this.recalculateRenderedStyle(t),Du(e.ctrlpts)};lt.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Oa={};Oa.manualEndptToPx=function(t,e){var r=this,a=t.position(),n=t.outerWidth(),s=t.outerHeight(),i=t._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*n),e.units[1]==="%"&&(o[1]=o[1]*s),o[0]+=a.x,o[1]+=a.y,o}else{var u=e.pfValue[0];u=-Math.PI/2+u;var l=2*Math.max(n,s),f=[a.x+Math.cos(u)*l,a.y+Math.sin(u)*l];return r.nodeShapes[this.getNodeShape(t)].intersectLine(a.x,a.y,n,s,f[0],f[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,i)}};Oa.findEndpoints=function(t){var e=this,r,a=t.source()[0],n=t.target()[0],s=a.position(),i=n.position(),o=t.pstyle("target-arrow-shape").value,u=t.pstyle("source-arrow-shape").value,l=t.pstyle("target-distance-from-node").pfValue,f=t.pstyle("source-distance-from-node").pfValue,h=a._private.rscratch,d=n._private.rscratch,v=t.pstyle("curve-style").value,c=t._private.rscratch,p=c.edgeType,g=v==="taxi",y=p==="self"||p==="compound",b=p==="bezier"||p==="multibezier"||y,m=p!=="bezier",T=p==="straight"||p==="segments",C=p==="segments",S=b||m||T,E=y||g,x=t.pstyle("source-endpoint"),w=E?"outside-to-node":x.value,D=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue,L=t.pstyle("target-endpoint"),A=E?"outside-to-node":L.value,N=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue;c.srcManEndpt=x,c.tgtManEndpt=L;var O,M,R,k;if(b){var P=[c.ctrlpts[0],c.ctrlpts[1]],B=m?[c.ctrlpts[c.ctrlpts.length-2],c.ctrlpts[c.ctrlpts.length-1]]:P;O=B,M=P}else if(T){var z=C?c.segpts.slice(0,2):[i.x,i.y],G=C?c.segpts.slice(c.segpts.length-2):[s.x,s.y];O=G,M=z}if(A==="inside-to-node")r=[i.x,i.y];else if(L.units)r=this.manualEndptToPx(n,L);else if(A==="outside-to-line")r=c.tgtIntn;else if(A==="outside-to-node"||A==="outside-to-node-or-label"?R=O:(A==="outside-to-line"||A==="outside-to-line-or-label")&&(R=[s.x,s.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),R[0],R[1],0,N,d),A==="outside-to-node-or-label"||A==="outside-to-line-or-label"){var F=n._private.rscratch,U=F.labelWidth,H=F.labelHeight,Y=F.labelX,Q=F.labelY,J=U/2,q=H/2,V=n.pstyle("text-valign").value;V==="top"?Q-=q:V==="bottom"&&(Q+=q);var Z=n.pstyle("text-halign").value;Z==="left"?Y-=J:Z==="right"&&(Y+=J);var K=ya(R[0],R[1],[Y-J,Q-q,Y+J,Q-q,Y+J,Q+q,Y-J,Q+q],i.x,i.y);if(K.length>0){var ie=s,ve=lr(ie,Mr(r)),ae=lr(ie,Mr(K)),te=ve;if(ae<ve&&(r=K,te=ae),K.length>2){var ue=lr(ie,{x:K[2],y:K[3]});ue<te&&(r=[K[2],K[3]])}}}var ce=Pa(r,O,e.arrowShapes[o].spacing(t)+l),fe=Pa(r,O,e.arrowShapes[o].gap(t)+l);if(c.endX=fe[0],c.endY=fe[1],c.arrowEndX=ce[0],c.arrowEndY=ce[1],w==="inside-to-node")r=[s.x,s.y];else if(x.units)r=this.manualEndptToPx(a,x);else if(w==="outside-to-line")r=c.srcIntn;else if(w==="outside-to-node"||w==="outside-to-node-or-label"?k=M:(w==="outside-to-line"||w==="outside-to-line-or-label")&&(k=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),k[0],k[1],0,D,h),w==="outside-to-node-or-label"||w==="outside-to-line-or-label"){var ye=a._private.rscratch,Oe=ye.labelWidth,Te=ye.labelHeight,xe=ye.labelX,Se=ye.labelY,ee=Oe/2,I=Te/2,$=a.pstyle("text-valign").value;$==="top"?Se-=I:$==="bottom"&&(Se+=I);var j=a.pstyle("text-halign").value;j==="left"?xe-=ee:j==="right"&&(xe+=ee);var X=ya(k[0],k[1],[xe-ee,Se-I,xe+ee,Se-I,xe+ee,Se+I,xe-ee,Se+I],s.x,s.y);if(X.length>0){var _=i,ne=lr(_,Mr(r)),W=lr(_,Mr(X)),re=ne;if(W<ne&&(r=[X[0],X[1]],re=W),X.length>2){var me=lr(_,{x:X[2],y:X[3]});me<re&&(r=[X[2],X[3]])}}}var be=Pa(r,M,e.arrowShapes[u].spacing(t)+f),he=Pa(r,M,e.arrowShapes[u].gap(t)+f);c.startX=he[0],c.startY=he[1],c.arrowStartX=be[0],c.arrowStartY=be[1],S&&(!se(c.startX)||!se(c.startY)||!se(c.endX)||!se(c.endY)?c.badLine=!0:c.badLine=!1)};Oa.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};Oa.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Bi={};function tp(t,e,r){for(var a=function(l,f,h,d){return Ze(l,f,h,d)},n=e._private,s=n.rstyle.bezierPts,i=0;i<t.bezierProjPcts.length;i++){var o=t.bezierProjPcts[i];s.push({x:a(r[0],r[2],r[4],o),y:a(r[1],r[3],r[5],o)})}}Bi.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,a=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,a==="multibezier"||a==="bezier"||a==="self"||a==="compound"){e.rstyle.bezierPts=[];for(var n=0;n+5<r.allpts.length;n+=4)tp(this,t,r.allpts.slice(n,n+6))}else if(a==="segments")for(var s=e.rstyle.linePts=[],n=0;n+1<r.allpts.length;n+=2)s.push({x:r.allpts[n],y:r.allpts[n+1]});else if(a==="haystack"){var i=r.haystackPts;e.rstyle.haystackPts=[{x:i[0],y:i[1]},{x:i[2],y:i[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};Bi.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var zt={};zt.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!er(e)){var r,a,n=t._private,s=t.width(),i=t.height(),o=t.padding(),u=t.position(),l=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,h=n.rscratch,d=n.rstyle;switch(l){case"left":r=u.x-s/2-o;break;case"right":r=u.x+s/2+o;break;default:r=u.x}switch(f){case"top":a=u.y-i/2-o;break;case"bottom":a=u.y+i/2+o;break;default:a=u.y}h.labelX=r,h.labelY=a,d.labelX=r,d.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var Su=function(e,r){var a=Math.atan(r/e);return e===0&&a<0&&(a=a*-1),a},Lu=function(e,r){var a=r.x-e.x,n=r.y-e.y;return Su(a,n)},rp=function(e,r,a,n){var s=pa(0,n-.001,1),i=pa(0,n+.001,1),o=kr(e,r,a,s),u=kr(e,r,a,i);return Lu(o,u)};zt.recalculateEdgeLabelProjections=function(t){var e,r=t._private,a=r.rscratch,n=this,s={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(s.mid||s.source||s.target){e={x:a.midX,y:a.midY};var i=function(h,d,v){Zt(r.rscratch,h,d,v),Zt(r.rstyle,h,d,v)};i("labelX",null,e.x),i("labelY",null,e.y);var o=Su(a.midDispX,a.midDispY);i("labelAutoAngle",null,o);var u=function f(){if(f.cache)return f.cache;for(var h=[],d=0;d+5<a.allpts.length;d+=4){var v={x:a.allpts[d],y:a.allpts[d+1]},c={x:a.allpts[d+2],y:a.allpts[d+3]},p={x:a.allpts[d+4],y:a.allpts[d+5]};h.push({p0:v,p1:c,p2:p,startDist:0,length:0,segments:[]})}var g=r.rstyle.bezierPts,y=n.bezierProjPcts.length;function b(E,x,w,D,L){var A=pr(x,w),N=E.segments[E.segments.length-1],O={p0:x,p1:w,t0:D,t1:L,startDist:N?N.startDist+N.length:0,length:A};E.segments.push(O),E.length+=A}for(var m=0;m<h.length;m++){var T=h[m],C=h[m-1];C&&(T.startDist=C.startDist+C.length),b(T,T.p0,g[m*y],0,n.bezierProjPcts[0]);for(var S=0;S<y-1;S++)b(T,g[m*y+S],g[m*y+S+1],n.bezierProjPcts[S],n.bezierProjPcts[S+1]);b(T,g[m*y+y-1],T.p2,n.bezierProjPcts[y-1],1)}return f.cache=h},l=function(h){var d,v=h==="source";if(s[h]){var c=t.pstyle(h+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var p=u(),g,y=0,b=0,m=0;m<p.length;m++){for(var T=p[v?m:p.length-1-m],C=0;C<T.segments.length;C++){var S=T.segments[v?C:T.segments.length-1-C],E=m===p.length-1&&C===T.segments.length-1;if(y=b,b+=S.length,b>=c||E){g={cp:T,segment:S};break}}if(g)break}var x=g.cp,w=g.segment,D=(c-y)/w.length,L=w.t1-w.t0,A=v?w.t0+L*D:w.t1-L*D;A=pa(0,A,1),e=kr(x.p0,x.p1,x.p2,A),d=rp(x.p0,x.p1,x.p2,A);break}case"straight":case"segments":case"haystack":{for(var N=0,O,M,R,k,P=a.allpts.length,B=0;B+3<P&&(v?(R={x:a.allpts[B],y:a.allpts[B+1]},k={x:a.allpts[B+2],y:a.allpts[B+3]}):(R={x:a.allpts[P-2-B],y:a.allpts[P-1-B]},k={x:a.allpts[P-4-B],y:a.allpts[P-3-B]}),O=pr(R,k),M=N,N+=O,!(N>=c));B+=2);var z=c-M,G=z/O;G=pa(0,G,1),e=oh(R,k,G),d=Lu(R,k);break}}i("labelX",h,e.x),i("labelY",h,e.y),i("labelAutoAngle",h,d)}};l("source"),l("target"),this.applyLabelDimensions(t)}};zt.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};zt.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=this.calculateLabelDimensions(t,a),s=t.pstyle("line-height").pfValue,i=t.pstyle("text-wrap").strValue,o=Ot(r.rscratch,"labelWrapCachedLines",e)||[],u=i!=="wrap"?1:Math.max(o.length,1),l=n.height/u,f=l*s,h=n.width,d=n.height+(u-1)*(s-1)*l;Zt(r.rstyle,"labelWidth",e,h),Zt(r.rscratch,"labelWidth",e,h),Zt(r.rstyle,"labelHeight",e,d),Zt(r.rscratch,"labelHeight",e,d),Zt(r.rscratch,"labelLineHeight",e,f)};zt.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,s=t.pstyle("text-transform").value,i=function(U,H){return H?(Zt(r.rscratch,U,e,H),H):Ot(r.rscratch,U,e)};if(!n)return"";s=="none"||(s=="uppercase"?n=n.toUpperCase():s=="lowercase"&&(n=n.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var u=i("labelKey");if(u!=null&&i("labelWrapKey")===u)return i("labelWrapCachedText");for(var l="",f=n.split(`
|
||
`),h=t.pstyle("text-max-width").pfValue,d=t.pstyle("text-overflow-wrap").value,v=d==="anywhere",c=[],p=/[\s\u200b]+|$/g,g=0;g<f.length;g++){var y=f[g],b=this.calculateLabelDimensions(t,y),m=b.width;if(v){var T=y.split("").join(l);y=T}if(m>h){var C=y.matchAll(p),S="",E=0,x=uo(C),w;try{for(x.s();!(w=x.n()).done;){var D=w.value,L=D[0],A=y.substring(E,D.index);E=D.index+L.length;var N=S.length===0?A:S+A+L,O=this.calculateLabelDimensions(t,N),M=O.width;M<=h?S+=A+L:(S&&c.push(S),S=A+L)}}catch(F){x.e(F)}finally{x.f()}S.match(/^[\s\u200b]+$/)||c.push(S)}else c.push(y)}i("labelWrapCachedLines",c),n=i("labelWrapCachedText",c.join(`
|
||
`)),i("labelWrapKey",u)}else if(o==="ellipsis"){var R=t.pstyle("text-max-width").pfValue,k="",P="…",B=!1;if(this.calculateLabelDimensions(t,n).width<R)return n;for(var z=0;z<n.length;z++){var G=this.calculateLabelDimensions(t,k+n[z]+P).width;if(G>R)break;k+=n[z],z===n.length-1&&(B=!0)}return B||(k+=P),k}return n};zt.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};zt.calculateLabelDimensions=function(t,e){var r=this,a=r.cy.window(),n=a.document,s=gr(e,t._private.labelDimsKey),i=r.labelDimCache||(r.labelDimCache=[]),o=i[s];if(o!=null)return o;var u=0,l=t.pstyle("font-style").strValue,f=t.pstyle("font-size").pfValue,h=t.pstyle("font-family").strValue,d=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=n.createElement("canvas"),c=this.labelCalcCanvasContext=v.getContext("2d");var p=v.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}c.font="".concat(l," ").concat(d," ").concat(f,"px ").concat(h);for(var g=0,y=0,b=e.split(`
|
||
`),m=0;m<b.length;m++){var T=b[m],C=c.measureText(T),S=Math.ceil(C.width),E=f;g=Math.max(S,g),y+=E}return g+=u,y+=u,i[s]={width:g,height:y}};zt.calculateLabelAngle=function(t,e){var r=t._private,a=r.rscratch,n=t.isEdge(),s=e?e+"-":"",i=t.pstyle(s+"text-rotation"),o=i.strValue;return o==="none"?0:n&&o==="autorotate"?a.labelAutoAngle:o==="autorotate"?0:i.pfValue};zt.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),a=t._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(t),r&&(n.sourceLabelAngle=e.calculateLabelAngle(t,"source"),n.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var Au={},qs=28,Ws=!1;Au.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<qs||t.height()<qs))return Ws||(Ie("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Ws=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var a=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return r};var Nn={};Nn.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,a=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(i),o)for(var u=0;u<i.length;u++){var l=i[u],f=l._private,h=f.rstyle;h.clean=!1,h.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(i){var o=i.target;a(o)}).on("style.* background.*",function(i){var o=i.target;a(o,!1)});var n=function(i){if(i){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],f=l._private.rstyle;l.isNode()&&!f.cleanConnected&&(a(l.connectedEdges()),f.cleanConnected=!0)}if(o)for(var h=0;h<o.length;h++){var d=o[h];d(i,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){n(!0)},r.beforeRender(n,r.beforeRenderPriorities.eleCalcs)};Nn.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};Nn.recalculateRenderedStyle=function(t,e){var r=function(T){return T._private.rstyle.cleanConnected},a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var s=0;s<t.length;s++){var i=t[s],o=i._private,u=o.rstyle;i.isEdge()&&(!r(i.source())||!r(i.target()))&&(u.clean=!1),!(e&&u.clean||i.removed())&&i.pstyle("display").value!=="none"&&(o.group==="nodes"?n.push(i):a.push(i),u.clean=!0)}for(var l=0;l<n.length;l++){var f=n[l],h=f._private,d=h.rstyle,v=f.position();this.recalculateNodeLabelProjection(f),d.nodeX=v.x,d.nodeY=v.y,d.nodeW=f.pstyle("width").pfValue,d.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var c=0;c<a.length;c++){var p=a[c],g=p._private,y=g.rstyle,b=g.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}};var In={};In.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var a=t[r],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?t.drag.push(a):t.nondrag.push(a)}for(var r=0;r<e.length;r++){var a=e[r];t.drag.push(a)}}};In.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};In.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(hu),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Ou={};[xr,vn,lt,Oa,Bi,zt,Au,Nn,In].forEach(function(t){Ee(Ou,t)});var Nu={};Nu.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},s=n[t];if(s)return s.image.complete||s.image.addEventListener("load",r),s.image;s=n[t]=n[t]||{};var i=s.image=new Image;i.addEventListener("load",r),i.addEventListener("error",function(){i.error=!0});var o="data:",u=t.substring(0,o.length).toLowerCase()===o;return u||(e=e==="null"?null:e,i.crossOrigin=e),i.src=t,i};var Kr={};Kr.registerBinding=function(t,e,r,a){var n=Array.prototype.slice.apply(arguments,[1]),s=this.binder(t);return s.on.apply(s,n)};Kr.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||Sl(t);if(e.supportsPassiveEvents==null){var n=!1;try{var s=Object.defineProperty({},"passive",{get:function(){return n=!0,!0}});r.addEventListener("test",null,s)}catch{}e.supportsPassiveEvents=n}var i=function(u,l,f){var h=Array.prototype.slice.call(arguments);return a&&e.supportsPassiveEvents&&(h[2]={capture:f??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:h}),(t.addEventListener||t.on).apply(t,h),this};return{on:i,addEventListener:i,addListener:i,bind:i}};Kr.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Kr.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Kr.load=function(){var t=this,e=t.cy.window(),r=function(I){return I.selected()},a=function(I,$,j,X){I==null&&(I=t.cy);for(var _=0;_<$.length;_++){var ne=$[_];I.emit({originalEvent:j,type:ne,position:X})}},n=function(I){return I.shiftKey||I.metaKey||I.ctrlKey},s=function(I,$){var j=!0;if(t.cy.hasCompoundNodes()&&I&&I.pannable())for(var X=0;$&&X<$.length;X++){var I=$[X];if(I.isNode()&&I.isParent()&&!I.pannable()){j=!1;break}}else j=!0;return j},i=function(I){I[0]._private.grabbed=!0},o=function(I){I[0]._private.grabbed=!1},u=function(I){I[0]._private.rscratch.inDragLayer=!0},l=function(I){I[0]._private.rscratch.inDragLayer=!1},f=function(I){I[0]._private.rscratch.isGrabTarget=!0},h=function(I){I[0]._private.rscratch.isGrabTarget=!1},d=function(I,$){var j=$.addToList,X=j.has(I);!X&&I.grabbable()&&!I.locked()&&(j.merge(I),i(I))},v=function(I,$){if(I.cy().hasCompoundNodes()&&!($.inDragLayer==null&&$.addToList==null)){var j=I.descendants();$.inDragLayer&&(j.forEach(u),j.connectedEdges().forEach(u)),$.addToList&&d(j,$)}},c=function(I,$){$=$||{};var j=I.cy().hasCompoundNodes();$.inDragLayer&&(I.forEach(u),I.neighborhood().stdFilter(function(X){return!j||X.isEdge()}).forEach(u)),$.addToList&&I.forEach(function(X){d(X,$)}),v(I,$),y(I,{inDragLayer:$.inDragLayer}),t.updateCachedGrabbedEles()},p=c,g=function(I){I&&(t.getCachedZSortedEles().forEach(function($){o($),l($),h($)}),t.updateCachedGrabbedEles())},y=function(I,$){if(!($.inDragLayer==null&&$.addToList==null)&&I.cy().hasCompoundNodes()){var j=I.ancestors().orphans();if(!j.same(I)){var X=j.descendants().spawnSelf().merge(j).unmerge(I).unmerge(I.descendants()),_=X.connectedEdges();$.inDragLayer&&(_.forEach(u),X.forEach(u)),$.addToList&&X.forEach(function(ne){d(ne,$)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},m=typeof MutationObserver<"u",T=typeof ResizeObserver<"u";m?(t.removeObserver=new MutationObserver(function(ee){for(var I=0;I<ee.length;I++){var $=ee[I],j=$.removedNodes;if(j)for(var X=0;X<j.length;X++){var _=j[X];if(_===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(ee){t.destroy()});var C=pn(function(){t.cy.resize()},100);m&&(t.styleObserver=new MutationObserver(C),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",C),T&&(t.resizeObserver=new ResizeObserver(C),t.resizeObserver.observe(t.container));var S=function(I,$){for(;I!=null;)$(I),I=I.parentNode},E=function(){t.invalidateContainerClientCoordsCache()};S(t.container,function(ee){t.registerBinding(ee,"transitionend",E),t.registerBinding(ee,"animationend",E),t.registerBinding(ee,"scroll",E)}),t.registerBinding(t.container,"contextmenu",function(ee){ee.preventDefault()});var x=function(){return t.selection[4]!==0},w=function(I){for(var $=t.findContainerClientCoords(),j=$[0],X=$[1],_=$[2],ne=$[3],W=I.touches?I.touches:[I],re=!1,me=0;me<W.length;me++){var be=W[me];if(j<=be.clientX&&be.clientX<=j+_&&X<=be.clientY&&be.clientY<=X+ne){re=!0;break}}if(!re)return!1;for(var he=t.container,we=I.target,le=we.parentNode,pe=!1;le;){if(le===he){pe=!0;break}le=le.parentNode}return!!pe};t.registerBinding(t.container,"mousedown",function(I){if(w(I)&&!(t.hoverData.which===1&&I.which!==1)){I.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=I.which;var $=t.cy,j=[I.clientX,I.clientY],X=t.projectIntoViewport(j[0],j[1]),_=t.selection,ne=t.findNearestElements(X[0],X[1],!0,!1),W=ne[0],re=t.dragData.possibleDragElements;t.hoverData.mdownPos=X,t.hoverData.mdownGPos=j;var me=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Ge=t.hoverData.down;Ge?Ge.emit({originalEvent:I,type:"taphold",position:{x:X[0],y:X[1]}}):$.emit({originalEvent:I,type:"taphold",position:{x:X[0],y:X[1]}})}},t.tapholdDuration)};if(I.which==3){t.hoverData.cxtStarted=!0;var be={originalEvent:I,type:"cxttapstart",position:{x:X[0],y:X[1]}};W?(W.activate(),W.emit(be),t.hoverData.down=W):$.emit(be),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(I.which==1){W&&W.activate();{if(W!=null&&t.nodeIsGrabbable(W)){var he=function(Ge){return{originalEvent:I,type:Ge,position:{x:X[0],y:X[1]}}},we=function(Ge){Ge.emit(he("grab"))};if(f(W),!W.selected())re=t.dragData.possibleDragElements=$.collection(),p(W,{addToList:re}),W.emit(he("grabon")).emit(he("grab"));else{re=t.dragData.possibleDragElements=$.collection();var le=$.$(function(pe){return pe.isNode()&&pe.selected()&&t.nodeIsGrabbable(pe)});c(le,{addToList:re}),W.emit(he("grabon")),le.forEach(we)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=W,t.hoverData.downs=ne,t.hoverData.downTime=new Date().getTime()}a(W,["mousedown","tapstart","vmousedown"],I,{x:X[0],y:X[1]}),W==null?(_[4]=1,t.data.bgActivePosistion={x:X[0],y:X[1]},t.redrawHint("select",!0),t.redraw()):W.pannable()&&(_[4]=1),me()}_[0]=_[2]=X[0],_[1]=_[3]=X[1]}},!1),t.registerBinding(e,"mousemove",function(I){var $=t.hoverData.capture;if(!(!$&&!w(I))){var j=!1,X=t.cy,_=X.zoom(),ne=[I.clientX,I.clientY],W=t.projectIntoViewport(ne[0],ne[1]),re=t.hoverData.mdownPos,me=t.hoverData.mdownGPos,be=t.selection,he=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(he=t.findNearestElement(W[0],W[1],!0,!1));var we=t.hoverData.last,le=t.hoverData.down,pe=[W[0]-be[2],W[1]-be[3]],Ge=t.dragData.possibleDragElements,Re;if(me){var ft=ne[0]-me[0],Qe=ft*ft,$e=ne[1]-me[1],ct=$e*$e,Je=Qe+ct;t.hoverData.isOverThresholdDrag=Re=Je>=t.desktopTapThreshold2}var ht=n(I);Re&&(t.hoverData.tapholdCancelled=!0);var Tt=function(){var Rt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Rt.length===0?(Rt.push(pe[0]),Rt.push(pe[1])):(Rt[0]+=pe[0],Rt[1]+=pe[1])};j=!0,a(he,["mousemove","vmousemove","tapdrag"],I,{x:W[0],y:W[1]});var bt=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||X.emit({originalEvent:I,type:"boxstart",position:{x:W[0],y:W[1]}}),be[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Re){var dt={originalEvent:I,type:"cxtdrag",position:{x:W[0],y:W[1]}};le?le.emit(dt):X.emit(dt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||he!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:W[0],y:W[1]}}),t.hoverData.cxtOver=he,he&&he.emit({originalEvent:I,type:"cxtdragover",position:{x:W[0],y:W[1]}}))}}else if(t.hoverData.dragging){if(j=!0,X.panningEnabled()&&X.userPanningEnabled()){var Mt;if(t.hoverData.justStartedPan){var Ut=t.hoverData.mdownPos;Mt={x:(W[0]-Ut[0])*_,y:(W[1]-Ut[1])*_},t.hoverData.justStartedPan=!1}else Mt={x:pe[0]*_,y:pe[1]*_};X.panBy(Mt),X.emit("dragpan"),t.hoverData.dragged=!0}W=t.projectIntoViewport(I.clientX,I.clientY)}else if(be[4]==1&&(le==null||le.pannable())){if(Re){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(ht||!X.panningEnabled()||!X.userPanningEnabled()))bt();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var Ct=s(le,t.hoverData.downs);Ct&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,be[4]=0,t.data.bgActivePosistion=Mr(re),t.redrawHint("select",!0),t.redraw())}le&&le.pannable()&&le.active()&&le.unactivate()}}else{if(le&&le.pannable()&&le.active()&&le.unactivate(),(!le||!le.grabbed())&&he!=we&&(we&&a(we,["mouseout","tapdragout"],I,{x:W[0],y:W[1]}),he&&a(he,["mouseover","tapdragover"],I,{x:W[0],y:W[1]}),t.hoverData.last=he),le)if(Re){if(X.boxSelectionEnabled()&&ht)le&&le.grabbed()&&(g(Ge),le.emit("freeon"),Ge.emit("free"),t.dragData.didDrag&&(le.emit("dragfreeon"),Ge.emit("dragfree"))),bt();else if(le&&le.grabbed()&&t.nodeIsDraggable(le)){var Ye=!t.dragData.didDrag;Ye&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||c(Ge,{inDragLayer:!0});var Ke={x:0,y:0};if(se(pe[0])&&se(pe[1])&&(Ke.x+=pe[0],Ke.y+=pe[1],Ye)){var nt=t.hoverData.dragDelta;nt&&se(nt[0])&&se(nt[1])&&(Ke.x+=nt[0],Ke.y+=nt[1])}t.hoverData.draggingEles=!0,Ge.silentShift(Ke).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Tt();j=!0}if(be[2]=W[0],be[3]=W[1],j)return I.stopPropagation&&I.stopPropagation(),I.preventDefault&&I.preventDefault(),!1}},!1);var D,L,A;t.registerBinding(e,"mouseup",function(I){if(!(t.hoverData.which===1&&I.which!==1&&t.hoverData.capture)){var $=t.hoverData.capture;if($){t.hoverData.capture=!1;var j=t.cy,X=t.projectIntoViewport(I.clientX,I.clientY),_=t.selection,ne=t.findNearestElement(X[0],X[1],!0,!1),W=t.dragData.possibleDragElements,re=t.hoverData.down,me=n(I);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,re&&re.unactivate(),t.hoverData.which===3){var be={originalEvent:I,type:"cxttapend",position:{x:X[0],y:X[1]}};if(re?re.emit(be):j.emit(be),!t.hoverData.cxtDragged){var he={originalEvent:I,type:"cxttap",position:{x:X[0],y:X[1]}};re?re.emit(he):j.emit(he)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(ne,["mouseup","tapend","vmouseup"],I,{x:X[0],y:X[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(re,["click","tap","vclick"],I,{x:X[0],y:X[1]}),L=!1,I.timeStamp-A<=j.multiClickDebounceTime()?(D&&clearTimeout(D),L=!0,A=null,a(re,["dblclick","dbltap","vdblclick"],I,{x:X[0],y:X[1]})):(D=setTimeout(function(){L||a(re,["oneclick","onetap","voneclick"],I,{x:X[0],y:X[1]})},j.multiClickDebounceTime()),A=I.timeStamp)),re==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!n(I)&&(j.$(r).unselect(["tapunselect"]),W.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=W=j.collection()),ne==re&&!t.dragData.didDrag&&!t.hoverData.selecting&&ne!=null&&ne._private.selectable&&(t.hoverData.dragging||(j.selectionType()==="additive"||me?ne.selected()?ne.unselect(["tapunselect"]):ne.select(["tapselect"]):me||(j.$(r).unmerge(ne).unselect(["tapunselect"]),ne.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var we=j.collection(t.getAllInBox(_[0],_[1],_[2],_[3]));t.redrawHint("select",!0),we.length>0&&t.redrawHint("eles",!0),j.emit({type:"boxend",originalEvent:I,position:{x:X[0],y:X[1]}});var le=function(Re){return Re.selectable()&&!Re.selected()};j.selectionType()==="additive"||me||j.$(r).unmerge(we).unselect(),we.emit("box").stdFilter(le).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!_[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var pe=re&&re.grabbed();g(W),pe&&(re.emit("freeon"),W.emit("free"),t.dragData.didDrag&&(re.emit("dragfreeon"),W.emit("dragfree")))}}_[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,t.hoverData.which=null}}},!1);var N=function(I){if(!t.scrollingPage){var $=t.cy,j=$.zoom(),X=$.pan(),_=t.projectIntoViewport(I.clientX,I.clientY),ne=[_[0]*j+X.x,_[1]*j+X.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||x()){I.preventDefault();return}if($.panningEnabled()&&$.userPanningEnabled()&&$.zoomingEnabled()&&$.userZoomingEnabled()){I.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 W;I.deltaY!=null?W=I.deltaY/-250:I.wheelDeltaY!=null?W=I.wheelDeltaY/1e3:W=I.wheelDelta/1e3,W=W*t.wheelSensitivity;var re=I.deltaMode===1;re&&(W*=33);var me=$.zoom()*Math.pow(10,W);I.type==="gesturechange"&&(me=t.gestureStartZoom*I.scale),$.zoom({level:me,renderedPosition:{x:ne[0],y:ne[1]}}),$.emit(I.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",N,!0),t.registerBinding(e,"scroll",function(I){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(I){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||I.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ee){t.hasTouchStarted||N(ee)},!0),t.registerBinding(t.container,"mouseout",function(I){var $=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseout",position:{x:$[0],y:$[1]}})},!1),t.registerBinding(t.container,"mouseover",function(I){var $=t.projectIntoViewport(I.clientX,I.clientY);t.cy.emit({originalEvent:I,type:"mouseover",position:{x:$[0],y:$[1]}})},!1);var O,M,R,k,P,B,z,G,F,U,H,Y,Q,J=function(I,$,j,X){return Math.sqrt((j-I)*(j-I)+(X-$)*(X-$))},q=function(I,$,j,X){return(j-I)*(j-I)+(X-$)*(X-$)},V;t.registerBinding(t.container,"touchstart",V=function(I){if(t.hasTouchStarted=!0,!!w(I)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var $=t.cy,j=t.touchData.now,X=t.touchData.earlier;if(I.touches[0]){var _=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);j[0]=_[0],j[1]=_[1]}if(I.touches[1]){var _=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);j[2]=_[0],j[3]=_[1]}if(I.touches[2]){var _=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);j[4]=_[0],j[5]=_[1]}if(I.touches[1]){t.touchData.singleTouchMoved=!0,g(t.dragData.touchDragEles);var ne=t.findContainerClientCoords();F=ne[0],U=ne[1],H=ne[2],Y=ne[3],O=I.touches[0].clientX-F,M=I.touches[0].clientY-U,R=I.touches[1].clientX-F,k=I.touches[1].clientY-U,Q=0<=O&&O<=H&&0<=R&&R<=H&&0<=M&&M<=Y&&0<=k&&k<=Y;var W=$.pan(),re=$.zoom();P=J(O,M,R,k),B=q(O,M,R,k),z=[(O+R)/2,(M+k)/2],G=[(z[0]-W.x)/re,(z[1]-W.y)/re];var me=200,be=me*me;if(B<be&&!I.touches[2]){var he=t.findNearestElement(j[0],j[1],!0,!0),we=t.findNearestElement(j[2],j[3],!0,!0);he&&he.isNode()?(he.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:j[0],y:j[1]}}),t.touchData.start=he):we&&we.isNode()?(we.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:j[0],y:j[1]}}),t.touchData.start=we):$.emit({originalEvent:I,type:"cxttapstart",position:{x:j[0],y:j[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(I.touches[2])$.boxSelectionEnabled()&&I.preventDefault();else if(!I.touches[1]){if(I.touches[0]){var le=t.findNearestElements(j[0],j[1],!0,!0),pe=le[0];if(pe!=null&&(pe.activate(),t.touchData.start=pe,t.touchData.starts=le,t.nodeIsGrabbable(pe))){var Ge=t.dragData.touchDragEles=$.collection(),Re=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),pe.selected()?(Re=$.$(function(Je){return Je.selected()&&t.nodeIsGrabbable(Je)}),c(Re,{addToList:Ge})):p(pe,{addToList:Ge}),f(pe);var ft=function(ht){return{originalEvent:I,type:ht,position:{x:j[0],y:j[1]}}};pe.emit(ft("grabon")),Re?Re.forEach(function(Je){Je.emit(ft("grab"))}):pe.emit(ft("grab"))}a(pe,["touchstart","tapstart","vmousedown"],I,{x:j[0],y:j[1]}),pe==null&&(t.data.bgActivePosistion={x:_[0],y:_[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&a(t.touchData.start,["taphold"],I,{x:j[0],y:j[1]})},t.tapholdDuration)}}if(I.touches.length>=1){for(var Qe=t.touchData.startPosition=[null,null,null,null,null,null],$e=0;$e<j.length;$e++)Qe[$e]=X[$e]=j[$e];var ct=I.touches[0];t.touchData.startGPosition=[ct.clientX,ct.clientY]}}},!1);var Z;t.registerBinding(e,"touchmove",Z=function(I){var $=t.touchData.capture;if(!(!$&&!w(I))){var j=t.selection,X=t.cy,_=t.touchData.now,ne=t.touchData.earlier,W=X.zoom();if(I.touches[0]){var re=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);_[0]=re[0],_[1]=re[1]}if(I.touches[1]){var re=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);_[2]=re[0],_[3]=re[1]}if(I.touches[2]){var re=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);_[4]=re[0],_[5]=re[1]}var me=t.touchData.startGPosition,be;if($&&I.touches[0]&&me){for(var he=[],we=0;we<_.length;we++)he[we]=_[we]-ne[we];var le=I.touches[0].clientX-me[0],pe=le*le,Ge=I.touches[0].clientY-me[1],Re=Ge*Ge,ft=pe+Re;be=ft>=t.touchTapThreshold2}if($&&t.touchData.cxt){I.preventDefault();var Qe=I.touches[0].clientX-F,$e=I.touches[0].clientY-U,ct=I.touches[1].clientX-F,Je=I.touches[1].clientY-U,ht=q(Qe,$e,ct,Je),Tt=ht/B,bt=150,dt=bt*bt,Mt=1.5,Ut=Mt*Mt;if(Tt>=Ut||ht>=dt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ct={originalEvent:I,type:"cxttapend",position:{x:_[0],y:_[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(Ct),t.touchData.start=null):X.emit(Ct)}}if($&&t.touchData.cxt){var Ct={originalEvent:I,type:"cxtdrag",position:{x:_[0],y:_[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Ct):X.emit(Ct),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Ye=t.findNearestElement(_[0],_[1],!0,!0);(!t.touchData.cxtOver||Ye!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:_[0],y:_[1]}}),t.touchData.cxtOver=Ye,Ye&&Ye.emit({originalEvent:I,type:"cxtdragover",position:{x:_[0],y:_[1]}}))}else if($&&I.touches[2]&&X.boxSelectionEnabled())I.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||X.emit({originalEvent:I,type:"boxstart",position:{x:_[0],y:_[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,j[4]=1,!j||j.length===0||j[0]===void 0?(j[0]=(_[0]+_[2]+_[4])/3,j[1]=(_[1]+_[3]+_[5])/3,j[2]=(_[0]+_[2]+_[4])/3+1,j[3]=(_[1]+_[3]+_[5])/3+1):(j[2]=(_[0]+_[2]+_[4])/3,j[3]=(_[1]+_[3]+_[5])/3),t.redrawHint("select",!0),t.redraw();else if($&&I.touches[1]&&!t.touchData.didSelect&&X.zoomingEnabled()&&X.panningEnabled()&&X.userZoomingEnabled()&&X.userPanningEnabled()){I.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ke=t.dragData.touchDragEles;if(Ke){t.redrawHint("drag",!0);for(var nt=0;nt<Ke.length;nt++){var Cr=Ke[nt]._private;Cr.grabbed=!1,Cr.rscratch.inDragLayer=!1}}var Rt=t.touchData.start,Qe=I.touches[0].clientX-F,$e=I.touches[0].clientY-U,ct=I.touches[1].clientX-F,Je=I.touches[1].clientY-U,Ui=J(Qe,$e,ct,Je),Ju=Ui/P;if(Q){var ju=Qe-O,el=$e-M,tl=ct-R,rl=Je-k,al=(ju+tl)/2,nl=(el+rl)/2,Jr=X.zoom(),Mn=Jr*Ju,Ma=X.pan(),$i=G[0]*Jr+Ma.x,Yi=G[1]*Jr+Ma.y,il={x:-Mn/Jr*($i-Ma.x-al)+$i,y:-Mn/Jr*(Yi-Ma.y-nl)+Yi};if(Rt&&Rt.active()){var Ke=t.dragData.touchDragEles;g(Ke),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Rt.unactivate().emit("freeon"),Ke.emit("free"),t.dragData.didDrag&&(Rt.emit("dragfreeon"),Ke.emit("dragfree"))}X.viewport({zoom:Mn,pan:il,cancelOnFailedZoom:!0}),X.emit("pinchzoom"),P=Ui,O=Qe,M=$e,R=ct,k=Je,t.pinching=!0}if(I.touches[0]){var re=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);_[0]=re[0],_[1]=re[1]}if(I.touches[1]){var re=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);_[2]=re[0],_[3]=re[1]}if(I.touches[2]){var re=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);_[4]=re[0],_[5]=re[1]}}else if(I.touches[0]&&!t.touchData.didSelect){var Dt=t.touchData.start,Rn=t.touchData.last,Ye;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Ye=t.findNearestElement(_[0],_[1],!0,!0)),$&&Dt!=null&&I.preventDefault(),$&&Dt!=null&&t.nodeIsDraggable(Dt))if(be){var Ke=t.dragData.touchDragEles,_i=!t.dragData.didDrag;_i&&c(Ke,{inDragLayer:!0}),t.dragData.didDrag=!0;var jr={x:0,y:0};if(se(he[0])&&se(he[1])&&(jr.x+=he[0],jr.y+=he[1],_i)){t.redrawHint("eles",!0);var St=t.touchData.dragDelta;St&&se(St[0])&&se(St[1])&&(jr.x+=St[0],jr.y+=St[1])}t.hoverData.draggingEles=!0,Ke.silentShift(jr).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ne[0]&&t.touchData.startPosition[1]==ne[1]&&t.redrawHint("eles",!0),t.redraw()}else{var St=t.touchData.dragDelta=t.touchData.dragDelta||[];St.length===0?(St.push(he[0]),St.push(he[1])):(St[0]+=he[0],St[1]+=he[1])}if(a(Dt||Ye,["touchmove","tapdrag","vmousemove"],I,{x:_[0],y:_[1]}),(!Dt||!Dt.grabbed())&&Ye!=Rn&&(Rn&&Rn.emit({originalEvent:I,type:"tapdragout",position:{x:_[0],y:_[1]}}),Ye&&Ye.emit({originalEvent:I,type:"tapdragover",position:{x:_[0],y:_[1]}})),t.touchData.last=Ye,$)for(var nt=0;nt<_.length;nt++)_[nt]&&t.touchData.startPosition[nt]&&be&&(t.touchData.singleTouchMoved=!0);if($&&(Dt==null||Dt.pannable())&&X.panningEnabled()&&X.userPanningEnabled()){var sl=s(Dt,t.touchData.starts);sl&&(I.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Mr(t.touchData.startPosition)),t.swipePanning?(X.panBy({x:he[0]*W,y:he[1]*W}),X.emit("dragpan")):be&&(t.swipePanning=!0,X.panBy({x:le*W,y:Ge*W}),X.emit("dragpan"),Dt&&(Dt.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var re=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);_[0]=re[0],_[1]=re[1]}}for(var we=0;we<_.length;we++)ne[we]=_[we];$&&I.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var K;t.registerBinding(e,"touchcancel",K=function(I){var $=t.touchData.start;t.touchData.capture=!1,$&&$.unactivate()});var ie,ve,ae,te;if(t.registerBinding(e,"touchend",ie=function(I){var $=t.touchData.start,j=t.touchData.capture;if(j)I.touches.length===0&&(t.touchData.capture=!1),I.preventDefault();else return;var X=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var _=t.cy,ne=_.zoom(),W=t.touchData.now,re=t.touchData.earlier;if(I.touches[0]){var me=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);W[0]=me[0],W[1]=me[1]}if(I.touches[1]){var me=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);W[2]=me[0],W[3]=me[1]}if(I.touches[2]){var me=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);W[4]=me[0],W[5]=me[1]}$&&$.unactivate();var be;if(t.touchData.cxt){if(be={originalEvent:I,type:"cxttapend",position:{x:W[0],y:W[1]}},$?$.emit(be):_.emit(be),!t.touchData.cxtDragged){var he={originalEvent:I,type:"cxttap",position:{x:W[0],y:W[1]}};$?$.emit(he):_.emit(he)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!I.touches[2]&&_.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var we=_.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));X[0]=void 0,X[1]=void 0,X[2]=void 0,X[3]=void 0,X[4]=0,t.redrawHint("select",!0),_.emit({type:"boxend",originalEvent:I,position:{x:W[0],y:W[1]}});var le=function(dt){return dt.selectable()&&!dt.selected()};we.emit("box").stdFilter(le).select().emit("boxselect"),we.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if($!=null&&$.unactivate(),I.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!I.touches[1]){if(!I.touches[0]){if(!I.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var pe=t.dragData.touchDragEles;if($!=null){var Ge=$._private.grabbed;g(pe),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ge&&($.emit("freeon"),pe.emit("free"),t.dragData.didDrag&&($.emit("dragfreeon"),pe.emit("dragfree"))),a($,["touchend","tapend","vmouseup","tapdragout"],I,{x:W[0],y:W[1]}),$.unactivate(),t.touchData.start=null}else{var Re=t.findNearestElement(W[0],W[1],!0,!0);a(Re,["touchend","tapend","vmouseup","tapdragout"],I,{x:W[0],y:W[1]})}var ft=t.touchData.startPosition[0]-W[0],Qe=ft*ft,$e=t.touchData.startPosition[1]-W[1],ct=$e*$e,Je=Qe+ct,ht=Je*ne*ne;t.touchData.singleTouchMoved||($||_.$(":selected").unselect(["tapunselect"]),a($,["tap","vclick"],I,{x:W[0],y:W[1]}),ve=!1,I.timeStamp-te<=_.multiClickDebounceTime()?(ae&&clearTimeout(ae),ve=!0,te=null,a($,["dbltap","vdblclick"],I,{x:W[0],y:W[1]})):(ae=setTimeout(function(){ve||a($,["onetap","voneclick"],I,{x:W[0],y:W[1]})},_.multiClickDebounceTime()),te=I.timeStamp)),$!=null&&!t.dragData.didDrag&&$._private.selectable&&ht<t.touchTapThreshold2&&!t.pinching&&(_.selectionType()==="single"?(_.$(r).unmerge($).unselect(["tapunselect"]),$.select(["tapselect"])):$.selected()?$.unselect(["tapunselect"]):$.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Tt=0;Tt<W.length;Tt++)re[Tt]=W[Tt];t.dragData.didDrag=!1,I.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),I.touches.length<2&&(I.touches.length===1&&(t.touchData.startGPosition=[I.touches[0].clientX,I.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ue=[],ce=function(I){return{clientX:I.clientX,clientY:I.clientY,force:1,identifier:I.pointerId,pageX:I.pageX,pageY:I.pageY,radiusX:I.width/2,radiusY:I.height/2,screenX:I.screenX,screenY:I.screenY,target:I.target}},fe=function(I){return{event:I,touch:ce(I)}},ye=function(I){ue.push(fe(I))},Oe=function(I){for(var $=0;$<ue.length;$++){var j=ue[$];if(j.event.pointerId===I.pointerId){ue.splice($,1);return}}},Te=function(I){var $=ue.filter(function(j){return j.event.pointerId===I.pointerId})[0];$.event=I,$.touch=ce(I)},xe=function(I){I.touches=ue.map(function($){return $.touch})},Se=function(I){return I.pointerType==="mouse"||I.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ee){Se(ee)||(ee.preventDefault(),ye(ee),xe(ee),V(ee))}),t.registerBinding(t.container,"pointerup",function(ee){Se(ee)||(Oe(ee),xe(ee),ie(ee))}),t.registerBinding(t.container,"pointercancel",function(ee){Se(ee)||(Oe(ee),xe(ee),K(ee))}),t.registerBinding(t.container,"pointermove",function(ee){Se(ee)||(ee.preventDefault(),Te(ee),xe(ee),Z(ee))})}};var Xt={};Xt.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(a,n,s,i,o,u){this.renderer.nodeShapeImpl("polygon",a,n,s,i,o,this.points)},intersectLine:function(a,n,s,i,o,u,l,f){return ya(o,u,this.points,a,n,s/2,i/2,l)},checkPoint:function(a,n,s,i,o,u,l,f){return _t(a,n,this.points,u,l,i,o,[0,-1],s)}}};Xt.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,a,n,s,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,s)},intersectLine:function(e,r,a,n,s,i,o,u){return Eh(s,i,e,r,a/2+o,n/2+o)},checkPoint:function(e,r,a,n,s,i,o,u){return cr(e,r,n,s,i,o,a)}}};Xt.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(a,n,s,i,o,u,l){if(u[l]!==void 0&&u[l+"-cx"]===a&&u[l+"-cy"]===n)return u[l];u[l]=new Array(e.length/2),u[l+"-cx"]=a,u[l+"-cy"]=n;var f=s/2,h=i/2;o=o==="auto"?Ro(s,i):o;for(var d=new Array(e.length/2),v=0;v<e.length/2;v++)d[v]={x:a+f*e[v*2],y:n+h*e[v*2+1]};var c,p,g,y,b=d.length;for(p=d[b-1],c=0;c<b;c++)g=d[c%b],y=d[(c+1)%b],u[l][c]=Pi(p,g,y,o),p=g,g=y;return u[l]},draw:function(a,n,s,i,o,u,l){this.renderer.nodeShapeImpl("round-polygon",a,n,s,i,o,this.points,this.getOrCreateCorners(n,s,i,o,u,l,"drawCorners"))},intersectLine:function(a,n,s,i,o,u,l,f,h){return wh(o,u,this.points,a,n,s,i,l,this.getOrCreateCorners(a,n,s,i,f,h,"corners"))},checkPoint:function(a,n,s,i,o,u,l,f,h){return bh(a,n,this.points,u,l,i,o,this.getOrCreateCorners(u,l,i,o,f,h,"corners"))}}};Xt.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:vt(4,0),draw:function(e,r,a,n,s,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,s,this.points,i)},intersectLine:function(e,r,a,n,s,i,o,u){return Io(s,i,e,r,a,n,o,u)},checkPoint:function(e,r,a,n,s,i,o,u){var l=n/2,f=s/2;u=u==="auto"?yr(n,s):u,u=Math.min(l,f,u);var h=u*2;return!!(_t(e,r,this.points,i,o,n,s-h,[0,-1],a)||_t(e,r,this.points,i,o,n-h,s,[0,-1],a)||cr(e,r,h,h,i-l+u,o-f+u,a)||cr(e,r,h,h,i+l-u,o-f+u,a)||cr(e,r,h,h,i+l-u,o+f-u,a)||cr(e,r,h,h,i-l+u,o+f-u,a))}}};Xt.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Ti(),points:vt(4,0),draw:function(e,r,a,n,s,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,s,null,i)},generateCutTrianglePts:function(e,r,a,n,s){var i=s==="auto"?this.cornerLength:s,o=r/2,u=e/2,l=a-u,f=a+u,h=n-o,d=n+o;return{topLeft:[l,h+i,l+i,h,l+i,h+i],topRight:[f-i,h,f,h+i,f-i,h+i],bottomRight:[f,d-i,f-i,d,f-i,d-i],bottomLeft:[l+i,d,l,d-i,l+i,d-i]}},intersectLine:function(e,r,a,n,s,i,o,u){var l=this.generateCutTrianglePts(a+2*o,n+2*o,e,r,u),f=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return ya(s,i,f,e,r)},checkPoint:function(e,r,a,n,s,i,o,u){var l=u==="auto"?this.cornerLength:u;if(_t(e,r,this.points,i,o,n,s-2*l,[0,-1],a)||_t(e,r,this.points,i,o,n-2*l,s,[0,-1],a))return!0;var f=this.generateCutTrianglePts(n,s,i,o);return gt(e,r,f.topLeft)||gt(e,r,f.topRight)||gt(e,r,f.bottomRight)||gt(e,r,f.bottomLeft)}}};Xt.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:vt(4,0),draw:function(e,r,a,n,s,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,s)},intersectLine:function(e,r,a,n,s,i,o,u){var l=.15,f=.5,h=.85,d=this.generateBarrelBezierPts(a+2*o,n+2*o,e,r),v=function(g){var y=kr({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},l),b=kr({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},f),m=kr({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},h);return[g[0],g[1],y.x,y.y,b.x,b.y,m.x,m.y,g[4],g[5]]},c=[].concat(v(d.topLeft),v(d.topRight),v(d.bottomRight),v(d.bottomLeft));return ya(s,i,c,e,r)},generateBarrelBezierPts:function(e,r,a,n){var s=r/2,i=e/2,o=a-i,u=a+i,l=n-s,f=n+s,h=Zn(e,r),d=h.heightOffset,v=h.widthOffset,c=h.ctrlPtOffsetPct*e,p={topLeft:[o,l+d,o+c,l,o+v,l],topRight:[u-v,l,u-c,l,u,l+d],bottomRight:[u,f-d,u-c,f,u-v,f],bottomLeft:[o+v,f,o+c,f,o,f-d]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,r,a,n,s,i,o,u){var l=Zn(n,s),f=l.heightOffset,h=l.widthOffset;if(_t(e,r,this.points,i,o,n,s-2*f,[0,-1],a)||_t(e,r,this.points,i,o,n-2*h,s,[0,-1],a))return!0;for(var d=this.generateBarrelBezierPts(n,s,i,o),v=function(x,w,D){var L=D[4],A=D[2],N=D[0],O=D[5],M=D[1],R=Math.min(L,N),k=Math.max(L,N),P=Math.min(O,M),B=Math.max(O,M);if(R<=x&&x<=k&&P<=w&&w<=B){var z=xh(L,A,N),G=gh(z[0],z[1],z[2],x),F=G.filter(function(U){return 0<=U&&U<=1});if(F.length>0)return F[0]}return null},c=Object.keys(d),p=0;p<c.length;p++){var g=c[p],y=d[g],b=v(e,r,y);if(b!=null){var m=y[5],T=y[3],C=y[1],S=Ze(m,T,C,b);if(y.isTop&&S<=r||y.isBottom&&r<=S)return!0}}return!1}}};Xt.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:vt(4,0),draw:function(e,r,a,n,s,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,s,this.points,i)},intersectLine:function(e,r,a,n,s,i,o,u){var l=e-(a/2+o),f=r-(n/2+o),h=f,d=e+(a/2+o),v=Qt(s,i,e,r,l,f,d,h,!1);return v.length>0?v:Io(s,i,e,r,a,n,o,u)},checkPoint:function(e,r,a,n,s,i,o,u){u=u==="auto"?yr(n,s):u;var l=2*u;if(_t(e,r,this.points,i,o,n,s-l,[0,-1],a)||_t(e,r,this.points,i,o,n-l,s,[0,-1],a))return!0;var f=n/2+2*a,h=s/2+2*a,d=[i-f,o-h,i-f,o,i+f,o,i+f,o-h];return!!(gt(e,r,d)||cr(e,r,l,l,i+n/2-u,o+s/2-u,a)||cr(e,r,l,l,i-n/2+u,o+s/2-u,a))}}};Xt.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",vt(3,0)),this.generateRoundPolygon("round-triangle",vt(3,0)),this.generatePolygon("rectangle",vt(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",vt(5,0)),this.generateRoundPolygon("round-pentagon",vt(5,0)),this.generatePolygon("hexagon",vt(6,0)),this.generateRoundPolygon("round-hexagon",vt(6,0)),this.generatePolygon("heptagon",vt(7,0)),this.generateRoundPolygon("round-heptagon",vt(7,0)),this.generatePolygon("octagon",vt(8,0)),this.generateRoundPolygon("round-octagon",vt(8,0));var a=new Array(20);{var n=Kn(5,0),s=Kn(5,Math.PI/5),i=.5*(3-Math.sqrt(5));i*=1.57;for(var o=0;o<s.length/2;o++)s[o*2]*=i,s[o*2+1]*=i;for(var o=0;o<20/4;o++)a[o*4]=n[o*2],a[o*4+1]=n[o*2+1],a[o*4+2]=s[o*2],a[o*4+3]=s[o*2+1]}a=Mo(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}t.makePolygon=function(l){var f=l.join("$"),h="polygon-"+f,d;return(d=this[h])?d:e.generatePolygon(h,l)}};var Na={};Na.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Na.redraw=function(t){t=t||So();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};Na.beforeRender=function(t,e){if(!this.destroyed){e==null&&Ve("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(a,n){return n.priority-a.priority})}};var Ks=function(e,r,a){for(var n=e.beforeRenderCallbacks,s=0;s<n.length;s++)n[s].fn(r,a)};Na.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function a(n){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){Ks(t,!0,n);var s=Yt();t.render(t.renderOptions);var i=t.lastDrawTime=Yt();t.averageRedrawTime===void 0&&(t.averageRedrawTime=i-s),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var o=i-s;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else Ks(t,!1,n);t.skipFrame=!1,an(a)}};an(r)}};var ap=function(e){this.init(e)},Iu=ap,Zr=Iu.prototype;Zr.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Zr.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),a=e.cy.window();if(a){var n=a.document,s=n.head,i="__________cytoscape_stylesheet",o="__________cytoscape_container",u=n.getElementById(i)!=null;if(r.className.indexOf(o)<0&&(r.className=(r.className||"")+" "+o),!u){var l=n.createElement("style");l.id=i,l.textContent="."+o+" { position: relative; }",s.insertBefore(l,s.children[0])}var f=a.getComputedStyle(r),h=f.getPropertyValue("position");h==="static"&&Ie("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=se(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};Zr.notify=function(t,e){var r=this,a=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&a.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Zr.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],a=r,n=a.target;(n.off||n.removeEventListener).apply(n,a.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};Zr.isHeadless=function(){return!1};[ki,Ou,Nu,Kr,Xt,Na].forEach(function(t){Ee(Zr,t)});var _n=1e3/60,Mu={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var s=pn(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),i=function(l,f){var h=Yt(),d=n.averageRedrawTime,v=n.lastRedrawTime,c=[],p=n.cy.extent(),g=n.getPixelRatio();for(l||n.flushRenderedStyleQueue();;){var y=Yt(),b=y-h,m=y-f;if(v<_n){var T=_n-(l?d:0);if(m>=e.deqFastCost*T)break}else if(l){if(b>=e.deqCost*v||b>=e.deqAvgCost*d)break}else if(m>=e.deqNoDrawCost*_n)break;var C=e.deq(a,g,p);if(C.length>0)for(var S=0;S<C.length;S++)c.push(C[S]);else break}c.length>0&&(e.onDeqd(a,c),!l&&e.shouldRedraw(a,c,g,p)&&s())},o=e.priority||bi;n.beforeRender(i,o(a))}}}},np=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nn;di(this,t),this.idsByKey=new Ft,this.keyForId=new Ft,this.cachesByLvl=new Ft,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return gi(t,[{key:"getIdsFor",value:function(r){r==null&&Ve("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new $r,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),s=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(s,a),this.keyForId.set(a,s)}},{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),s=this.getKey(r);return n!==s}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var a=this.cachesByLvl,n=this.lvls,s=a.get(r);return s||(s=new Ft,a.set(r,s),n.push(r)),s}},{key:"getCache",value:function(r,a){return this.getCachesAt(a).get(r)}},{key:"get",value:function(r,a){var n=this.getKey(r),s=this.getCache(n,a);return s!=null&&this.updateKeyMappingFor(r),s}},{key:"getForCachedKey",value:function(r,a){var n=this.keyForId.get(r.id()),s=this.getCache(n,a);return s}},{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 s=this.getKey(r);this.setCache(s,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 s=this.doesEleInvalidateKey(r);return s&&this.invalidateKey(n),s||this.getNumberOfIdsForKey(n)===0}}]),t}(),Zs=25,_a=50,ja=-4,oi=3,ip=7.99,sp=8,op=1024,up=1024,lp=1024,fp=.2,hp=.8,vp=10,cp=.15,dp=.1,gp=.9,pp=.9,yp=100,mp=1,Rr={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},bp=rt({getKey:null,doesEleInvalidateKey:nn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:To,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),la=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=bp(r);Ee(a,n),a.lookup=new np(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},We=la.prototype;We.reasons=Rr;We.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};We.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};We.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Sa(function(r,a){return a.reqs-r.reqs});return e};We.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};We.getElement=function(t,e,r,a,n){var s=this,i=this.renderer,o=i.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!s.allowEdgeTxrCaching&&t.isEdge()||!s.allowParentTxrCaching&&t.isParent())return null;if(a==null&&(a=Math.ceil(wi(o*r))),a<ja)a=ja;else if(o>=ip||a>oi)return null;var l=Math.pow(2,a),f=e.h*l,h=e.w*l,d=i.eleTextBiggerThanMin(t,l);if(!this.isVisible(t,d))return null;var v=u.get(t,a);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var c;if(f<=Zs?c=Zs:f<=_a?c=_a:c=Math.ceil(f/_a)*_a,f>lp||h>up)return null;var p=s.getTextureQueue(c),g=p[p.length-2],y=function(){return s.recycleTexture(c,h)||s.addTexture(c,h)};g||(g=p[p.length-1]),g||(g=y()),g.width-g.usedWidth<h&&(g=y());for(var b=function(R){return R&&R.scaledLabelShown===d},m=n&&n===Rr.dequeue,T=n&&n===Rr.highQuality,C=n&&n===Rr.downscale,S,E=a+1;E<=oi;E++){var x=u.get(t,E);if(x){S=x;break}}var w=S&&S.level===a+1?S:null,D=function(){g.context.drawImage(w.texture.canvas,w.x,0,w.width,w.height,g.usedWidth,0,h,f)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,h,c),b(w))D();else if(b(S))if(T){for(var L=S.level;L>a;L--)w=s.getElement(t,e,r,L,Rr.downscale);D()}else return s.queueElement(t,S.level-1),S;else{var A;if(!m&&!T&&!C)for(var N=a-1;N>=ja;N--){var O=u.get(t,N);if(O){A=O;break}}if(b(A))return s.queueElement(t,a),A;g.context.translate(g.usedWidth,0),g.context.scale(l,l),this.drawElement(g.context,t,e,d,!1),g.context.scale(1/l,1/l),g.context.translate(-g.usedWidth,0)}return v={x:g.usedWidth,texture:g,level:a,scale:l,width:h,height:f,scaledLabelShown:d},g.usedWidth+=Math.ceil(h+sp),g.eleCaches.push(v),u.set(t,a,v),s.checkTextureFullness(g),v};We.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};We.invalidateElement=function(t){var e=this,r=e.lookup,a=[],n=r.isInvalid(t);if(n){for(var s=ja;s<=oi;s++){var i=r.getForCachedKey(t,s);i&&a.push(i)}var o=r.invalidate(t);if(o)for(var u=0;u<a.length;u++){var l=a[u],f=l.texture;f.invalidatedWidth+=l.width,l.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(t)}};We.checkTextureUtility=function(t){t.invalidatedWidth>=fp*t.width&&this.retireTexture(t)};We.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>hp&&t.fullnessChecks>=vp?tr(r,t):t.fullnessChecks++};We.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;tr(a,t),t.retired=!0;for(var s=t.eleCaches,i=0;i<s.length;i++){var o=s[i];n.deleteCache(o.key,o.level)}Ei(s);var u=e.getRetiredTextureQueue(r);u.push(t)};We.addTexture=function(t,e){var r=this,a=r.getTextureQueue(t),n={};return a.push(n),n.eleCaches=[],n.height=t,n.width=Math.max(op,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=r.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n};We.recycleTexture=function(t,e){for(var r=this,a=r.getTextureQueue(t),n=r.getRetiredTextureQueue(t),s=0;s<n.length;s++){var i=n[s];if(i.width>=e)return i.retired=!1,i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,Ei(i.eleCaches),i.context.setTransform(1,0,0,1,0,0),i.context.clearRect(0,0,i.width,i.height),tr(n,i),a.push(i),i}};We.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),s=this.getKey(t),i=n[s];if(i)i.level=Math.max(i.level,e),i.eles.merge(t),i.reqs++,a.updateItem(i);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:s};a.push(o),n[s]=o}};We.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],s=e.lookup,i=0;i<mp&&r.size()>0;i++){var o=r.pop(),u=o.key,l=o.eles[0],f=s.hasCache(l,o.level);if(a[u]=null,f)continue;n.push(o);var h=e.getBoundingBox(l);e.getElement(l,h,t,o.level,Rr.dequeue)}return n};We.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),s=a[n];s!=null&&(s.eles.length===1?(s.reqs=mi,r.updateItem(s),r.pop(),a[n]=null):s.eles.unmerge(t))};We.onDequeue=function(t){this.onDequeues.push(t)};We.offDequeue=function(t){tr(this.onDequeues,t)};We.setupDequeueing=Mu.setupDequeueing({deqRedrawThreshold:yp,deqCost:cp,deqAvgCost:dp,deqNoDrawCost:gp,deqFastCost:pp,deq:function(e,r,a){return e.dequeue(r,a)},onDeqd:function(e,r){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(r)}},shouldRedraw:function(e,r,a,n){for(var s=0;s<r.length;s++)for(var i=r[s].eles,o=0;o<i.length;o++){var u=i[o].boundingBox();if(xi(u,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Ep=1,ha=-4,cn=2,wp=3.99,xp=50,Tp=50,Cp=.15,Dp=.1,Sp=.9,Lp=.9,Ap=1,Qs=250,Op=4e3*4e3,Np=!0,Ru=function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Yt()-2*Qs,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=pn(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},Tp),a.beforeRender(function(i,o){o-r.lastInvalidationTime<=Qs?r.skipping=!0:r.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var s=function(o,u){return u.reqs-o.reqs};r.layersQueue=new Sa(s),r.setupDequeueing()},at=Ru.prototype,Js=0,Ip=Math.pow(2,53)-1;at.makeLayer=function(t,e){var r=Math.pow(2,e),a=Math.ceil(t.w*r),n=Math.ceil(t.h*r),s=this.renderer.makeOffscreenCanvas(a,n),i={id:Js=++Js%Ip,bb:t,level:e,width:a,height:n,canvas:s,context:s.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=i.context,u=-i.bb.x1,l=-i.bb.y1;return o.scale(r,r),o.translate(u,l),i};at.getLayers=function(t,e,r){var a=this,n=a.renderer,s=n.cy,i=s.zoom(),o=a.firstGet;if(a.firstGet=!1,r==null){if(r=Math.ceil(wi(i*e)),r<ha)r=ha;else if(i>=wp||r>cn)return null}a.validateLayersElesOrdering(r,t);var u=a.layersByLevel,l=Math.pow(2,r),f=u[r]=u[r]||[],h,d=a.levelIsComplete(r,t),v,c=function(){var D=function(M){if(a.validateLayersElesOrdering(M,t),a.levelIsComplete(M,t))return v=u[M],!0},L=function(M){if(!v)for(var R=r+M;ha<=R&&R<=cn&&!D(R);R+=M);};L(1),L(-1);for(var A=f.length-1;A>=0;A--){var N=f[A];N.invalid&&tr(f,N)}};if(!d)c();else return f;var p=function(){if(!h){h=pt();for(var D=0;D<t.length;D++)Oo(h,t[D].boundingBox())}return h},g=function(D){D=D||{};var L=D.after;p();var A=h.w*l*(h.h*l);if(A>Op)return null;var N=a.makeLayer(h,r);if(L!=null){var O=f.indexOf(L)+1;f.splice(O,0,N)}else(D.insert===void 0||D.insert)&&f.unshift(N);return N};if(a.skipping&&!o)return null;for(var y=null,b=t.length/Ep,m=!o,T=0;T<t.length;T++){var C=t[T],S=C._private.rscratch,E=S.imgLayerCaches=S.imgLayerCaches||{},x=E[r];if(x){y=x;continue}if((!y||y.eles.length>=b||!No(y.bb,C.boundingBox()))&&(y=g({insert:!0,after:y}),!y))return null;v||m?a.queueLayer(y,C):a.drawEleInLayer(y,C,r,e),y.eles.push(C),E[r]=y}return v||(m?null:f)};at.getEleLevelForLayerLevel=function(t,e){return t};at.drawEleInLayer=function(t,e,r,a){var n=this,s=this.renderer,i=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),s.setImgSmoothing(i,!1),s.drawCachedElement(i,e,null,null,r,Np),s.setImgSmoothing(i,!0))};at.levelIsComplete=function(t,e){var r=this,a=r.layersByLevel[t];if(!a||a.length===0)return!1;for(var n=0,s=0;s<a.length;s++){var i=a[s];if(i.reqs>0||i.invalid)return!1;n+=i.eles.length}return n===e.length};at.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var a=0;a<r.length;a++){for(var n=r[a],s=-1,i=0;i<e.length;i++)if(n.eles[0]===e[i]){s=i;break}if(s<0){this.invalidateLayer(n);continue}for(var o=s,i=0;i<n.eles.length;i++)if(n.eles[i]!==e[o+i]){this.invalidateLayer(n);break}}};at.updateElementsInLayers=function(t,e){for(var r=this,a=Ca(t[0]),n=0;n<t.length;n++)for(var s=a?null:t[n],i=a?t[n]:t[n].ele,o=i._private.rscratch,u=o.imgLayerCaches=o.imgLayerCaches||{},l=ha;l<=cn;l++){var f=u[l];f&&(s&&r.getEleLevelForLayerLevel(f.level)!==s.level||e(f,i,s))}};at.haveLayers=function(){for(var t=this,e=!1,r=ha;r<=cn;r++){var a=t.layersByLevel[r];if(a&&a.length>0){e=!0;break}}return e};at.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Yt(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(a,n,s){e.invalidateLayer(a)}))};at.invalidateLayer=function(t){if(this.lastInvalidationTime=Yt(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];tr(a,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var n=0;n<r.length;n++){var s=r[n]._private.rscratch.imgLayerCaches;s&&(s[e]=null)}}};at.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(a,n,s){var i=a.replacement;if(i||(i=a.replacement=e.makeLayer(a.bb,a.level),i.replaces=a,i.eles=a.eles),!i.reqs)for(var o=0;o<i.eles.length;o++)e.queueLayer(i,i.eles[o])})};at.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};at.queueLayer=function(t,e){var r=this,a=r.layersQueue,n=t.elesQueue,s=n.hasId=n.hasId||{};if(!t.replacement){if(e){if(s[e.id()])return;n.push(e),s[e.id()]=!0}t.reqs?(t.reqs++,a.updateItem(t)):(t.reqs=1,a.push(t))}};at.dequeue=function(t){for(var e=this,r=e.layersQueue,a=[],n=0;n<Ap&&r.size()!==0;){var s=r.peek();if(s.replacement){r.pop();continue}if(s.replaces&&s!==s.replaces.replacement){r.pop();continue}if(s.invalid){r.pop();continue}var i=s.elesQueue.shift();i&&(e.drawEleInLayer(s,i,s.level,t),n++),a.length===0&&a.push(!0),s.elesQueue.length===0&&(r.pop(),s.reqs=0,s.replaces&&e.applyLayerReplacement(s),e.requestRedraw())}return a};at.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],a=t.replaces,n=r.indexOf(a);if(!(n<0||a.invalid)){r[n]=t;for(var s=0;s<t.eles.length;s++){var i=t.eles[s]._private,o=i.imgLayerCaches=i.imgLayerCaches||{};o&&(o[t.level]=t)}e.requestRedraw()}};at.requestRedraw=pn(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);at.setupDequeueing=Mu.setupDequeueing({deqRedrawThreshold:xp,deqCost:Cp,deqAvgCost:Dp,deqNoDrawCost:Sp,deqFastCost:Lp,deq:function(e,r){return e.dequeue(r)},onDeqd:bi,shouldRedraw:To,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var ku={},js;function Mp(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}function Rp(t,e,r){for(var a,n=0;n<e.length;n++){var s=e[n];n===0&&(a=s),t.lineTo(s.x,s.y)}t.quadraticCurveTo(r.x,r.y,a.x,a.y)}function eo(t,e,r){t.beginPath&&t.beginPath();for(var a=e,n=0;n<a.length;n++){var s=a[n];t.lineTo(s.x,s.y)}var i=r,o=r[0];t.moveTo(o.x,o.y);for(var n=1;n<i.length;n++){var s=i[n];t.lineTo(s.x,s.y)}t.closePath&&t.closePath()}function kp(t,e,r,a,n){t.beginPath&&t.beginPath(),t.arc(r,a,n,0,Math.PI*2,!1);var s=e,i=s[0];t.moveTo(i.x,i.y);for(var o=0;o<s.length;o++){var u=s[o];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function Pp(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}ku.arrowShapeImpl=function(t){return(js||(js={polygon:Mp,"triangle-backcurve":Rp,"triangle-tee":eo,"circle-triangle":kp,"triangle-cross":eo,circle:Pp}))[t]};var Vt={};Vt.drawElement=function(t,e,r,a,n,s){var i=this;e.isNode()?i.drawNode(t,e,r,a,n,s):i.drawEdge(t,e,r,a,n,s)};Vt.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};Vt.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};Vt.drawCachedElementPortion=function(t,e,r,a,n,s,i,o){var u=this,l=r.getBoundingBox(e);if(!(l.w===0||l.h===0)){var f=r.getElement(e,l,a,n,s);if(f!=null){var h=o(u,e);if(h===0)return;var d=i(u,e),v=l.x1,c=l.y1,p=l.w,g=l.h,y,b,m,T,C;if(d!==0){var S=r.getRotationPoint(e);m=S.x,T=S.y,t.translate(m,T),t.rotate(d),C=u.getImgSmoothing(t),C||u.setImgSmoothing(t,!0);var E=r.getRotationOffset(e);y=E.x,b=E.y}else y=v,b=c;var x;h!==1&&(x=t.globalAlpha,t.globalAlpha=x*h),t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,y,b,p,g),h!==1&&(t.globalAlpha=x),d!==0&&(t.rotate(-d),t.translate(-m,-T),C||u.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var Bp=function(){return 0},Fp=function(e,r){return e.getTextAngle(r,null)},Gp=function(e,r){return e.getTextAngle(r,"source")},zp=function(e,r){return e.getTextAngle(r,"target")},Vp=function(e,r){return r.effectiveOpacity()},Hn=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Vt.drawCachedElement=function(t,e,r,a,n,s){var i=this,o=i.data,u=o.eleTxrCache,l=o.lblTxrCache,f=o.slbTxrCache,h=o.tlbTxrCache,d=e.boundingBox(),v=s===!0?u.reasons.highQuality:null;if(!(d.w===0||d.h===0||!e.visible())&&(!a||xi(d,a))){var c=e.isEdge(),p=e.element()._private.rscratch.badLine;i.drawElementUnderlay(t,e),i.drawCachedElementPortion(t,e,u,r,n,v,Bp,Vp),(!c||!p)&&i.drawCachedElementPortion(t,e,l,r,n,v,Fp,Hn),c&&!p&&(i.drawCachedElementPortion(t,e,f,r,n,v,Gp,Hn),i.drawCachedElementPortion(t,e,h,r,n,v,zp,Hn)),i.drawElementOverlay(t,e)}};Vt.drawElements=function(t,e){for(var r=this,a=0;a<e.length;a++){var n=e[a];r.drawElement(t,n)}};Vt.drawCachedElements=function(t,e,r,a){for(var n=this,s=0;s<e.length;s++){var i=e[s];n.drawCachedElement(t,i,r,a)}};Vt.drawCachedNodes=function(t,e,r,a){for(var n=this,s=0;s<e.length;s++){var i=e[s];i.isNode()&&n.drawCachedElement(t,i,r,a)}};Vt.drawLayeredElements=function(t,e,r,a){var n=this,s=n.data.lyrTxrCache.getLayers(e,r);if(s)for(var i=0;i<s.length;i++){var o=s[i],u=o.bb;u.w===0||u.h===0||t.drawImage(o.canvas,u.x1,u.y1,u.w,u.h)}else n.drawCachedElements(t,e,r,a)};var qt={};qt.drawEdge=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,i=this,o=e._private.rscratch;if(!(s&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var u;r&&(u=r,t.translate(-u.x1,-u.y1));var l=s?e.pstyle("opacity").value:1,f=s?e.pstyle("line-opacity").value:1,h=e.pstyle("curve-style").value,d=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,c=e.pstyle("line-cap").value,p=e.pstyle("line-outline-width").value,g=e.pstyle("line-outline-color").value,y=l*f,b=l*f,m=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;h==="straight-triangle"?(i.eleStrokeStyle(t,e,M),i.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=v,t.lineCap=c,i.eleStrokeStyle(t,e,M),i.drawEdgePath(e,t,o.allpts,d),t.lineCap="butt")},T=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=v+p,t.lineCap=c,p>0)i.colorStrokeStyle(t,g[0],g[1],g[2],M);else{t.lineCap="butt";return}h==="straight-triangle"?i.drawEdgeTrianglePath(e,t,o.allpts):(i.drawEdgePath(e,t,o.allpts,d),t.lineCap="butt")},C=function(){n&&i.drawEdgeOverlay(t,e)},S=function(){n&&i.drawEdgeUnderlay(t,e)},E=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;i.drawArrowheads(t,e,M)},x=function(){i.drawElementText(t,e,null,a)};t.lineJoin="round";var w=e.pstyle("ghost").value==="yes";if(w){var D=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue,A=e.pstyle("ghost-opacity").value,N=y*A;t.translate(D,L),m(N),E(N),t.translate(-D,-L)}else T();S(),m(),E(),C(),x(),r&&t.translate(u.x1,u.y1)}};var Pu=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 s=this,i=s.usePaths(),o=a._private.rscratch,u=a.pstyle("".concat(e,"-padding")).pfValue,l=2*u,f=a.pstyle("".concat(e,"-color")).value;r.lineWidth=l,o.edgeType==="self"&&!i?r.lineCap="butt":r.lineCap="round",s.colorStrokeStyle(r,f[0],f[1],f[2],n),s.drawEdgePath(a,r,o.allpts,"solid")}}}};qt.drawEdgeOverlay=Pu("overlay");qt.drawEdgeUnderlay=Pu("underlay");qt.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,s=e,i,o=!1,u=this.usePaths(),l=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(u){var h=r.join("$"),d=n.pathCacheKey&&n.pathCacheKey===h;d?(i=e=n.pathCache,o=!0):(i=e=new Path2D,n.pathCacheKey=h,n.pathCache=i)}if(s.setLineDash)switch(a){case"dotted":s.setLineDash([1,1]);break;case"dashed":s.setLineDash(l),s.lineDashOffset=f;break;case"solid":s.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+3<r.length;v+=4)e.quadraticCurveTo(r[v],r[v+1],r[v+2],r[v+3]);break;case"straight":case"haystack":for(var c=2;c+1<r.length;c+=2)e.lineTo(r[c],r[c+1]);break;case"segments":if(n.isRound){var p=uo(n.roundCorners),g;try{for(p.s();!(g=p.n()).done;){var y=g.value;Cu(e,y)}}catch(m){p.e(m)}finally{p.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var b=2;b+1<r.length;b+=2)e.lineTo(r[b],r[b+1]);break}e=s,u?e.stroke(i):e.stroke(),e.setLineDash&&e.setLineDash([])};qt.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var a=t.pstyle("width").pfValue,n=0;n+1<r.length;n+=2){var s=[r[n+2]-r[n],r[n+3]-r[n+1]],i=Math.sqrt(s[0]*s[0]+s[1]*s[1]),o=[s[1]/i,-s[0]/i],u=[o[0]*a/2,o[1]*a/2];e.beginPath(),e.moveTo(r[n]-u[0],r[n+1]-u[1]),e.lineTo(r[n]+u[0],r[n+1]+u[1]),e.lineTo(r[n+2],r[n+3]),e.closePath(),e.fill()}};qt.drawArrowheads=function(t,e,r){var a=e._private.rscratch,n=a.edgeType==="haystack";n||this.drawArrowhead(t,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,r),n||this.drawArrowhead(t,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,r)};qt.drawArrowhead=function(t,e,r,a,n,s,i){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(s)||s==null)){var o=this,u=e.pstyle(r+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,h=e.pstyle("width").pfValue,d=e.pstyle(r+"-arrow-width"),v=d.value==="match-line"?h:d.pfValue;d.units==="%"&&(v*=h);var c=e.pstyle("opacity").value;i===void 0&&(i=c);var p=t.globalCompositeOperation;(i!==1||f==="hollow")&&(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,l,h,u,v,a,n,s),t.globalCompositeOperation=p);var g=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,g[0],g[1],g[2],i),o.colorStrokeStyle(t,g[0],g[1],g[2],i),o.drawArrowShape(e,t,f,h,u,v,a,n,s)}}};qt.drawArrowShape=function(t,e,r,a,n,s,i,o,u){var l=this,f=this.usePaths()&&n!=="triangle-cross",h=!1,d,v=e,c={x:i,y:o},p=t.pstyle("arrow-scale").value,g=this.getArrowWidth(a,p),y=l.arrowShapes[n];if(f){var b=l.arrowPathCache=l.arrowPathCache||[],m=gr(n),T=b[m];T!=null?(d=e=T,h=!0):(d=e=new Path2D,b[m]=d)}h||(e.beginPath&&e.beginPath(),f?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,g,u,c,a),e.closePath&&e.closePath()),e=v,f&&(e.translate(i,o),e.rotate(u),e.scale(g,g)),(r==="filled"||r==="both")&&(f?e.fill(d):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=s/(f?g:1),e.lineJoin="miter",f?e.stroke(d):e.stroke()),f&&(e.scale(1/g,1/g),e.rotate(-u),e.translate(-i,-o))};var Fi={};Fi.safeDrawImage=function(t,e,r,a,n,s,i,o,u,l){if(!(n<=0||s<=0||u<=0||l<=0))try{t.drawImage(e,r,a,n,s,i,o,u,l)}catch(f){Ie(f)}};Fi.drawInscribedImage=function(t,e,r,a,n){var s=this,i=r.position(),o=i.x,u=i.y,l=r.cy().style(),f=l.getIndexedStyle.bind(l),h=f(r,"background-fit","value",a),d=f(r,"background-repeat","value",a),v=r.width(),c=r.height(),p=r.padding()*2,g=v+(f(r,"background-width-relative-to","value",a)==="inner"?0:p),y=c+(f(r,"background-height-relative-to","value",a)==="inner"?0:p),b=r._private.rscratch,m=f(r,"background-clip","value",a),T=m==="node",C=f(r,"background-image-opacity","value",a)*n,S=f(r,"background-image-smoothing","value",a),E=r.pstyle("corner-radius").value;E!=="auto"&&(E=r.pstyle("corner-radius").pfValue);var x=e.width||e.cachedW,w=e.height||e.cachedH;(x==null||w==null)&&(document.body.appendChild(e),x=e.cachedW=e.width||e.offsetWidth,w=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var D=x,L=w;if(f(r,"background-width","value",a)!=="auto"&&(f(r,"background-width","units",a)==="%"?D=f(r,"background-width","pfValue",a)*g:D=f(r,"background-width","pfValue",a)),f(r,"background-height","value",a)!=="auto"&&(f(r,"background-height","units",a)==="%"?L=f(r,"background-height","pfValue",a)*y:L=f(r,"background-height","pfValue",a)),!(D===0||L===0)){if(h==="contain"){var A=Math.min(g/D,y/L);D*=A,L*=A}else if(h==="cover"){var A=Math.max(g/D,y/L);D*=A,L*=A}var N=o-g/2,O=f(r,"background-position-x","units",a),M=f(r,"background-position-x","pfValue",a);O==="%"?N+=(g-D)*M:N+=M;var R=f(r,"background-offset-x","units",a),k=f(r,"background-offset-x","pfValue",a);R==="%"?N+=(g-D)*k:N+=k;var P=u-y/2,B=f(r,"background-position-y","units",a),z=f(r,"background-position-y","pfValue",a);B==="%"?P+=(y-L)*z:P+=z;var G=f(r,"background-offset-y","units",a),F=f(r,"background-offset-y","pfValue",a);G==="%"?P+=(y-L)*F:P+=F,b.pathCache&&(N-=o,P-=u,o=0,u=0);var U=t.globalAlpha;t.globalAlpha=C;var H=s.getImgSmoothing(t),Y=!1;if(S==="no"&&H?(s.setImgSmoothing(t,!1),Y=!0):S==="yes"&&!H&&(s.setImgSmoothing(t,!0),Y=!0),d==="no-repeat")T&&(t.save(),b.pathCache?t.clip(b.pathCache):(s.nodeShapes[s.getNodeShape(r)].draw(t,o,u,g,y,E,b),t.clip())),s.safeDrawImage(t,e,0,0,x,w,N,P,D,L),T&&t.restore();else{var Q=t.createPattern(e,d);t.fillStyle=Q,s.nodeShapes[s.getNodeShape(r)].draw(t,o,u,g,y,E,b),t.translate(N,P),t.fill(),t.translate(-N,-P)}t.globalAlpha=U,Y&&s.setImgSmoothing(t,H)}};var Tr={};Tr.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(wi(r*a));e=Math.pow(2,n)}var s=t.pstyle("font-size").pfValue*e,i=t.pstyle("min-zoomed-font-size").pfValue;return!(s<i)};Tr.drawElementText=function(t,e,r,a,n){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,i=this;if(a==null){if(s&&!i.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var u=i.getLabelJustification(e);t.textAlign=u,t.textBaseline="bottom"}else{var l=e.element()._private.rscratch.badLine,f=e.pstyle("label"),h=e.pstyle("source-label"),d=e.pstyle("target-label");if(l||(!f||!f.value)&&(!h||!h.value)&&(!d||!d.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!r,c;r&&(c=r,t.translate(-c.x1,-c.y1)),n==null?(i.drawText(t,e,null,v,s),e.isEdge()&&(i.drawText(t,e,"source",v,s),i.drawText(t,e,"target",v,s))):i.drawText(t,e,n,v,s),r&&t.translate(c.x1,c.y1)};Tr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Tr.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",s=e.pstyle("font-family").strValue,i=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*o,l=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=a+" "+i+" "+n+" "+s,t.lineJoin="round",this.colorFillStyle(t,l[0],l[1],l[2],o),this.colorStrokeStyle(t,f[0],f[1],f[2],u)};function Xn(t,e,r,a,n){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,i=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+a-s,r),t.quadraticCurveTo(e+a,r,e+a,r+s),t.lineTo(e+a,r+n-s),t.quadraticCurveTo(e+a,r+n,e+a-s,r+n),t.lineTo(e+s,r+n),t.quadraticCurveTo(e,r+n,e,r+n-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath(),i?t.stroke():t.fill()}Tr.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,s=e?e+"-":"",i=t.pstyle(s+"text-rotation"),o=Ot(n,"labelAngle",e);return i.strValue==="autorotate"?r=t.isEdge()?o:0:i.strValue==="none"?r=0:r=i.pfValue,r};Tr.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,s=e._private,i=s.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var u=Ot(i,"labelX",r),l=Ot(i,"labelY",r),f,h,d=this.getLabelText(e,r);if(d!=null&&d!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(t,e,n);var v=r?r+"-":"",c=Ot(i,"labelWidth",r),p=Ot(i,"labelHeight",r),g=e.pstyle(v+"text-margin-x").pfValue,y=e.pstyle(v+"text-margin-y").pfValue,b=e.isEdge(),m=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;b&&(m="center",T="center"),u+=g,l+=y;var C;switch(a?C=this.getTextAngle(e,r):C=0,C!==0&&(f=u,h=l,t.translate(f,h),t.rotate(C),u=0,l=0),T){case"top":break;case"center":l+=p/2;break;case"bottom":l+=p;break}var S=e.pstyle("text-background-opacity").value,E=e.pstyle("text-border-opacity").value,x=e.pstyle("text-border-width").pfValue,w=e.pstyle("text-background-padding").pfValue,D=e.pstyle("text-background-shape").strValue,L=D.indexOf("round")===0,A=2;if(S>0||x>0&&E>0){var N=u-w;switch(m){case"left":N-=c;break;case"center":N-=c/2;break}var O=l-p-w,M=c+2*w,R=p+2*w;if(S>0){var k=t.fillStyle,P=e.pstyle("text-background-color").value;t.fillStyle="rgba("+P[0]+","+P[1]+","+P[2]+","+S*o+")",L?Xn(t,N,O,M,R,A):t.fillRect(N,O,M,R),t.fillStyle=k}if(x>0&&E>0){var B=t.strokeStyle,z=t.lineWidth,G=e.pstyle("text-border-color").value,F=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+G[0]+","+G[1]+","+G[2]+","+E*o+")",t.lineWidth=x,t.setLineDash)switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=x/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(L?Xn(t,N,O,M,R,A,"stroke"):t.strokeRect(N,O,M,R),F==="double"){var U=x/2;L?Xn(t,N+U,O+U,M-U*2,R-U*2,A,"stroke"):t.strokeRect(N+U,O+U,M-U*2,R-U*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=z,t.strokeStyle=B}}var H=2*e.pstyle("text-outline-width").pfValue;if(H>0&&(t.lineWidth=H),e.pstyle("text-wrap").value==="wrap"){var Y=Ot(i,"labelWrapCachedLines",r),Q=Ot(i,"labelLineHeight",r),J=c/2,q=this.getLabelJustification(e);switch(q==="auto"||(m==="left"?q==="left"?u+=-c:q==="center"&&(u+=-J):m==="center"?q==="left"?u+=-J:q==="right"&&(u+=J):m==="right"&&(q==="center"?u+=J:q==="right"&&(u+=c))),T){case"top":l-=(Y.length-1)*Q;break;case"center":case"bottom":l-=(Y.length-1)*Q;break}for(var V=0;V<Y.length;V++)H>0&&t.strokeText(Y[V],u,l),t.fillText(Y[V],u,l),l+=Q}else H>0&&t.strokeText(d,u,l),t.fillText(d,u,l);C!==0&&(t.rotate(-C),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,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,i=this,o,u,l=e._private,f=l.rscratch,h=e.position();if(!(!se(h.x)||!se(h.y))&&!(s&&!e.visible())){var d=s?e.effectiveOpacity():1,v=i.usePaths(),c,p=!1,g=e.padding();o=e.width()+2*g,u=e.height()+2*g;var y;r&&(y=r,t.translate(-y.x1,-y.y1));for(var b=e.pstyle("background-image"),m=b.value,T=new Array(m.length),C=new Array(m.length),S=0,E=0;E<m.length;E++){var x=m[E],w=T[E]=x!=null&&x!=="none";if(w){var D=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",E);S++,C[E]=i.getCachedImage(x,D,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var L=e.pstyle("background-blacken").value,A=e.pstyle("border-width").pfValue,N=e.pstyle("background-opacity").value*d,O=e.pstyle("border-color").value,M=e.pstyle("border-style").value,R=e.pstyle("border-join").value,k=e.pstyle("border-cap").value,P=e.pstyle("border-position").value,B=e.pstyle("border-dash-pattern").pfValue,z=e.pstyle("border-dash-offset").pfValue,G=e.pstyle("border-opacity").value*d,F=e.pstyle("outline-width").pfValue,U=e.pstyle("outline-color").value,H=e.pstyle("outline-style").value,Y=e.pstyle("outline-opacity").value*d,Q=e.pstyle("outline-offset").value,J=e.pstyle("corner-radius").value;J!=="auto"&&(J=e.pstyle("corner-radius").pfValue);var q=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;i.eleFillStyle(t,e,ne)},V=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;i.colorStrokeStyle(t,O[0],O[1],O[2],ne)},Z=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Y;i.colorStrokeStyle(t,U[0],U[1],U[2],ne)},K=function(ne,W,re,me){var be=i.nodePathCache=i.nodePathCache||[],he=xo(re==="polygon"?re+","+me.join(","):re,""+W,""+ne,""+J),we=be[he],le,pe=!1;return we!=null?(le=we,pe=!0,f.pathCache=le):(le=new Path2D,be[he]=f.pathCache=le),{path:le,cacheHit:pe}},ie=e.pstyle("shape").strValue,ve=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(h.x,h.y);var ae=K(o,u,ie,ve);c=ae.path,p=ae.cacheHit}var te=function(){if(!p){var ne=h;v&&(ne={x:0,y:0}),i.nodeShapes[i.getNodeShape(e)].draw(c||t,ne.x,ne.y,o,u,J,f)}v?t.fill(c):t.fill()},ue=function(){for(var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,re=l.backgrounding,me=0,be=0;be<C.length;be++){var he=e.cy().style().getIndexedStyle(e,"background-image-containment","value",be);if(W&&he==="over"||!W&&he==="inside"){me++;continue}T[be]&&C[be].complete&&!C[be].error&&(me++,i.drawInscribedImage(t,C[be],e,be,ne))}l.backgrounding=me!==S,re!==l.backgrounding&&e.updateStyle(!1)},ce=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d;i.hasPie(e)&&(i.drawPie(t,e,W),ne&&(v||i.nodeShapes[i.getNodeShape(e)].draw(t,h.x,h.y,o,u,J,f)))},fe=function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d,W=(L>0?L:-L)*ne,re=L>0?0:255;L!==0&&(i.colorFillStyle(t,re,re,re,W),v?t.fill(c):t.fill())},ye=function(){if(A>0){if(t.lineWidth=A,t.lineCap=k,t.lineJoin=R,t.setLineDash)switch(M){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(B),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(P!=="center"){if(t.save(),t.lineWidth*=2,P==="inside")v?t.clip(c):t.clip();else{var ne=new Path2D;ne.rect(-o/2-A,-u/2-A,o+2*A,u+2*A),ne.addPath(c),t.clip(ne,"evenodd")}v?t.stroke(c):t.stroke(),t.restore()}else v?t.stroke(c):t.stroke();if(M==="double"){t.lineWidth=A/3;var W=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(c):t.stroke(),t.globalCompositeOperation=W}t.setLineDash&&t.setLineDash([])}},Oe=function(){if(F>0){if(t.lineWidth=F,t.lineCap="butt",t.setLineDash)switch(H){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ne=h;v&&(ne={x:0,y:0});var W=i.getNodeShape(e),re=A;P==="inside"&&(re=0),P==="outside"&&(re*=2);var me=(o+re+(F+Q))/o,be=(u+re+(F+Q))/u,he=o*me,we=u*be,le=i.nodeShapes[W].points,pe;if(v){var Ge=K(he,we,W,le);pe=Ge.path}if(W==="ellipse")i.drawEllipsePath(pe||t,ne.x,ne.y,he,we);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(W)){var Re=0,ft=0,Qe=0;W==="round-diamond"?Re=(re+Q+F)*1.4:W==="round-heptagon"?(Re=(re+Q+F)*1.075,Qe=-(re/2+Q+F)/35):W==="round-hexagon"?Re=(re+Q+F)*1.12:W==="round-pentagon"?(Re=(re+Q+F)*1.13,Qe=-(re/2+Q+F)/15):W==="round-tag"?(Re=(re+Q+F)*1.12,ft=(re/2+F+Q)*.07):W==="round-triangle"&&(Re=(re+Q+F)*(Math.PI/2),Qe=-(re+Q/2+F)/Math.PI),Re!==0&&(me=(o+Re)/o,he=o*me,["round-hexagon","round-tag"].includes(W)||(be=(u+Re)/u,we=u*be)),J=J==="auto"?Ro(he,we):J;for(var $e=he/2,ct=we/2,Je=J+(re+F+Q)/2,ht=new Array(le.length/2),Tt=new Array(le.length/2),bt=0;bt<le.length/2;bt++)ht[bt]={x:ne.x+ft+$e*le[bt*2],y:ne.y+Qe+ct*le[bt*2+1]};var dt,Mt,Ut,Ct,Ye=ht.length;for(Mt=ht[Ye-1],dt=0;dt<Ye;dt++)Ut=ht[dt%Ye],Ct=ht[(dt+1)%Ye],Tt[dt]=Pi(Mt,Ut,Ct,Je),Mt=Ut,Ut=Ct;i.drawRoundPolygonPath(pe||t,ne.x+ft,ne.y+Qe,o*me,u*be,le,Tt)}else if(["roundrectangle","round-rectangle"].includes(W))J=J==="auto"?yr(he,we):J,i.drawRoundRectanglePath(pe||t,ne.x,ne.y,he,we,J+(re+F+Q)/2);else if(["cutrectangle","cut-rectangle"].includes(W))J=J==="auto"?Ti():J,i.drawCutRectanglePath(pe||t,ne.x,ne.y,he,we,null,J+(re+F+Q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(W))J=J==="auto"?yr(he,we):J,i.drawBottomRoundRectanglePath(pe||t,ne.x,ne.y,he,we,J+(re+F+Q)/2);else if(W==="barrel")i.drawBarrelPath(pe||t,ne.x,ne.y,he,we);else if(W.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(W)){var Ke=(re+F+Q)/o;le=sn(on(le,Ke)),i.drawPolygonPath(pe||t,ne.x,ne.y,o,u,le)}else{var nt=(re+F+Q)/o;le=sn(on(le,-nt)),i.drawPolygonPath(pe||t,ne.x,ne.y,o,u,le)}if(v?t.stroke(pe):t.stroke(),H==="double"){t.lineWidth=re/3;var Cr=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(pe):t.stroke(),t.globalCompositeOperation=Cr}t.setLineDash&&t.setLineDash([])}},Te=function(){n&&i.drawNodeOverlay(t,e,h,o,u)},xe=function(){n&&i.drawNodeUnderlay(t,e,h,o,u)},Se=function(){i.drawElementText(t,e,null,a)},ee=e.pstyle("ghost").value==="yes";if(ee){var I=e.pstyle("ghost-offset-x").pfValue,$=e.pstyle("ghost-offset-y").pfValue,j=e.pstyle("ghost-opacity").value,X=j*d;t.translate(I,$),Z(),Oe(),q(j*N),te(),ue(X,!0),V(j*G),ye(),ce(L!==0||A!==0),ue(X,!1),fe(X),t.translate(-I,-$)}v&&t.translate(-h.x,-h.y),xe(),v&&t.translate(h.x,h.y),Z(),Oe(),q(),te(),ue(d,!0),V(),ye(),ce(L!==0||A!==0),ue(d,!1),fe(),v&&t.translate(-h.x,-h.y),Se(),Te(),r&&t.translate(y.x1,y.y1)}};var Bu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a,n,s,i){var o=this;if(a.visible()){var u=a.pstyle("".concat(e,"-padding")).pfValue,l=a.pstyle("".concat(e,"-opacity")).value,f=a.pstyle("".concat(e,"-color")).value,h=a.pstyle("".concat(e,"-shape")).value,d=a.pstyle("".concat(e,"-corner-radius")).value;if(l>0){if(n=n||a.position(),s==null||i==null){var v=a.padding();s=a.width()+2*v,i=a.height()+2*v}o.colorFillStyle(r,f[0],f[1],f[2],l),o.nodeShapes[h].draw(r,n.x,n.y,s+u*2,i+u*2,d),r.fill()}}}};Qr.drawNodeOverlay=Bu("overlay");Qr.drawNodeUnderlay=Bu("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(),s=e.pstyle("pie-size"),i=a.x,o=a.y,u=e.width(),l=e.height(),f=Math.min(u,l)/2,h=0,d=this.usePaths();d&&(i=0,o=0),s.units==="%"?f=f*s.pfValue:s.pfValue!==void 0&&(f=s.pfValue/2);for(var v=1;v<=n.pieBackgroundN;v++){var c=e.pstyle("pie-"+v+"-background-size").value,p=e.pstyle("pie-"+v+"-background-color").value,g=e.pstyle("pie-"+v+"-background-opacity").value*r,y=c/100;y+h>1&&(y=1-h);var b=1.5*Math.PI+2*Math.PI*h,m=2*Math.PI*y,T=b+m;c===0||h>=1||h+y>1||(t.beginPath(),t.moveTo(i,o),t.arc(i,o,f,b,T),t.closePath(),this.colorFillStyle(t,p[0],p[1],p[2],g),t.fill(),h+=y)}};var mt={},Up=100;mt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};mt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,a,n=0;n<e.length;n++)if(a=e[n],a.context===t){r=!1;break}return r&&(a={context:t},e.push(a)),a};mt.createGradientStyleFor=function(t,e,r,a,n){var s,i=this.usePaths(),o=r.pstyle(e+"-gradient-stop-colors").value,u=r.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(r.isEdge()){var l=r.sourceEndpoint(),f=r.targetEndpoint(),h=r.midpoint(),d=pr(l,h),v=pr(f,h);s=t.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(d,v))}else{var c=i?{x:0,y:0}:r.position(),p=r.paddedWidth(),g=r.paddedHeight();s=t.createRadialGradient(c.x,c.y,0,c.x,c.y,Math.max(p,g))}else if(r.isEdge()){var y=r.sourceEndpoint(),b=r.targetEndpoint();s=t.createLinearGradient(y.x,y.y,b.x,b.y)}else{var m=i?{x:0,y:0}:r.position(),T=r.paddedWidth(),C=r.paddedHeight(),S=T/2,E=C/2,x=r.pstyle("background-gradient-direction").value;switch(x){case"to-bottom":s=t.createLinearGradient(m.x,m.y-E,m.x,m.y+E);break;case"to-top":s=t.createLinearGradient(m.x,m.y+E,m.x,m.y-E);break;case"to-left":s=t.createLinearGradient(m.x+S,m.y,m.x-S,m.y);break;case"to-right":s=t.createLinearGradient(m.x-S,m.y,m.x+S,m.y);break;case"to-bottom-right":case"to-right-bottom":s=t.createLinearGradient(m.x-S,m.y-E,m.x+S,m.y+E);break;case"to-top-right":case"to-right-top":s=t.createLinearGradient(m.x-S,m.y+E,m.x+S,m.y-E);break;case"to-bottom-left":case"to-left-bottom":s=t.createLinearGradient(m.x+S,m.y-E,m.x-S,m.y+E);break;case"to-top-left":case"to-left-top":s=t.createLinearGradient(m.x+S,m.y+E,m.x-S,m.y-E);break}}if(!s)return null;for(var w=u.length===o.length,D=o.length,L=0;L<D;L++)s.addColorStop(w?u[L]:L/(D-1),"rgba("+o[L][0]+","+o[L][1]+","+o[L][2]+","+n+")");return s};mt.gradientFillStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"background",e,r,a);if(!n)return null;t.fillStyle=n};mt.colorFillStyle=function(t,e,r,a,n){t.fillStyle="rgba("+e+","+r+","+a+","+n+")"};mt.eleFillStyle=function(t,e,r){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(t,e,a,r);else{var n=e.pstyle("background-color").value;this.colorFillStyle(t,n[0],n[1],n[2],r)}};mt.gradientStrokeStyle=function(t,e,r,a){var n=this.createGradientStyleFor(t,"line",e,r,a);if(!n)return null;t.strokeStyle=n};mt.colorStrokeStyle=function(t,e,r,a,n){t.strokeStyle="rgba("+e+","+r+","+a+","+n+")"};mt.eleStrokeStyle=function(t,e,r){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(t,e,a,r);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(t,n[0],n[1],n[2],r)}};mt.matchCanvasSize=function(t){var e=this,r=e.data,a=e.findContainerClientCoords(),n=a[2],s=a[3],i=e.getPixelRatio(),o=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(i=o);var u=n*i,l=s*i,f;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var h=r.canvasContainer;h.style.width=n+"px",h.style.height=s+"px";for(var d=0;d<e.CANVAS_LAYERS;d++)f=r.canvases[d],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=s+"px";for(var d=0;d<e.BUFFER_COUNT;d++)f=r.bufferCanvases[d],f.width=u,f.height=l,f.style.width=n+"px",f.style.height=s+"px";e.textureMult=1,i<=1&&(f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=u*e.textureMult,f.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l}};mt.renderTo=function(t,e,r,a){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:a})};mt.render=function(t){t=t||So();var e=t.forcedContext,r=t.drawAllLayers,a=t.drawOnlyNodeLayer,n=t.forcedZoom,s=t.forcedPan,i=this,o=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=i.cy,l=i.data,f=l.canvasNeedsRedraw,h=i.textureOnViewport&&!e&&(i.pinching||i.hoverData.dragging||i.swipePanning||i.data.wheelZooming),d=t.motionBlur!==void 0?t.motionBlur:i.motionBlur,v=i.motionBlurPxRatio,c=u.hasCompoundNodes(),p=i.hoverData.draggingEles,g=!!(i.hoverData.selecting||i.touchData.selecting);d=d&&!e&&i.motionBlurEnabled&&!g;var y=d;e||(i.prevPxRatio!==o&&(i.invalidateContainerClientCoordsCache(),i.matchCanvasSize(i.container),i.redrawHint("eles",!0),i.redrawHint("drag",!0)),i.prevPxRatio=o),!e&&i.motionBlurTimeout&&clearTimeout(i.motionBlurTimeout),d&&(i.mbFrames==null&&(i.mbFrames=0),i.mbFrames++,i.mbFrames<3&&(y=!1),i.mbFrames>i.minMbLowQualFrames&&(i.motionBlurPxRatio=i.mbPxRBlurry)),i.clearingMotionBlur&&(i.motionBlurPxRatio=1),i.textureDrawLastFrame&&!h&&(f[i.NODE]=!0,f[i.SELECT_BOX]=!0);var b=u.style(),m=u.zoom(),T=n!==void 0?n:m,C=u.pan(),S={x:C.x,y:C.y},E={zoom:m,pan:{x:C.x,y:C.y}},x=i.prevViewport,w=x===void 0||E.zoom!==x.zoom||E.pan.x!==x.pan.x||E.pan.y!==x.pan.y;!w&&!(p&&!c)&&(i.motionBlurPxRatio=1),s&&(S=s),T*=o,S.x*=o,S.y*=o;var D=i.getCachedZSortedEles();function L(ae,te,ue,ce,fe){var ye=ae.globalCompositeOperation;ae.globalCompositeOperation="destination-out",i.colorFillStyle(ae,255,255,255,i.motionBlurTransparency),ae.fillRect(te,ue,ce,fe),ae.globalCompositeOperation=ye}function A(ae,te){var ue,ce,fe,ye;!i.clearingMotionBlur&&(ae===l.bufferContexts[i.MOTIONBLUR_BUFFER_NODE]||ae===l.bufferContexts[i.MOTIONBLUR_BUFFER_DRAG])?(ue={x:C.x*v,y:C.y*v},ce=m*v,fe=i.canvasWidth*v,ye=i.canvasHeight*v):(ue=S,ce=T,fe=i.canvasWidth,ye=i.canvasHeight),ae.setTransform(1,0,0,1,0,0),te==="motionBlur"?L(ae,0,0,fe,ye):!e&&(te===void 0||te)&&ae.clearRect(0,0,fe,ye),r||(ae.translate(ue.x,ue.y),ae.scale(ce,ce)),s&&ae.translate(s.x,s.y),n&&ae.scale(n,n)}if(h||(i.textureDrawLastFrame=!1),h){if(i.textureDrawLastFrame=!0,!i.textureCache){i.textureCache={},i.textureCache.bb=u.mutableElements().boundingBox(),i.textureCache.texture=i.data.bufferCanvases[i.TEXTURE_BUFFER];var N=i.data.bufferContexts[i.TEXTURE_BUFFER];N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,i.canvasWidth*i.textureMult,i.canvasHeight*i.textureMult),i.render({forcedContext:N,drawOnlyNodeLayer:!0,forcedPxRatio:o*i.textureMult});var E=i.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:i.canvasWidth,height:i.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}f[i.DRAG]=!1,f[i.NODE]=!1;var O=l.contexts[i.NODE],M=i.textureCache.texture,E=i.textureCache.viewport;O.setTransform(1,0,0,1,0,0),d?L(O,0,0,E.width,E.height):O.clearRect(0,0,E.width,E.height);var R=b.core("outside-texture-bg-color").value,k=b.core("outside-texture-bg-opacity").value;i.colorFillStyle(O,R[0],R[1],R[2],k),O.fillRect(0,0,E.width,E.height);var m=u.zoom();A(O,!1),O.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/o,E.height/E.zoom/o),O.drawImage(M,E.mpan.x,E.mpan.y,E.width/E.zoom/o,E.height/E.zoom/o)}else i.textureOnViewport&&!e&&(i.textureCache=null);var P=u.extent(),B=i.pinching||i.hoverData.dragging||i.swipePanning||i.data.wheelZooming||i.hoverData.draggingEles||i.cy.animated(),z=i.hideEdgesOnViewport&&B,G=[];if(G[i.NODE]=!f[i.NODE]&&d&&!i.clearedForMotionBlur[i.NODE]||i.clearingMotionBlur,G[i.NODE]&&(i.clearedForMotionBlur[i.NODE]=!0),G[i.DRAG]=!f[i.DRAG]&&d&&!i.clearedForMotionBlur[i.DRAG]||i.clearingMotionBlur,G[i.DRAG]&&(i.clearedForMotionBlur[i.DRAG]=!0),f[i.NODE]||r||a||G[i.NODE]){var F=d&&!G[i.NODE]&&v!==1,O=e||(F?i.data.bufferContexts[i.MOTIONBLUR_BUFFER_NODE]:l.contexts[i.NODE]),U=d&&!F?"motionBlur":void 0;A(O,U),z?i.drawCachedNodes(O,D.nondrag,o,P):i.drawLayeredElements(O,D.nondrag,o,P),i.debug&&i.drawDebugPoints(O,D.nondrag),!r&&!d&&(f[i.NODE]=!1)}if(!a&&(f[i.DRAG]||r||G[i.DRAG])){var F=d&&!G[i.DRAG]&&v!==1,O=e||(F?i.data.bufferContexts[i.MOTIONBLUR_BUFFER_DRAG]:l.contexts[i.DRAG]);A(O,d&&!F?"motionBlur":void 0),z?i.drawCachedNodes(O,D.drag,o,P):i.drawCachedElements(O,D.drag,o,P),i.debug&&i.drawDebugPoints(O,D.drag),!r&&!d&&(f[i.DRAG]=!1)}if(i.showFps||!a&&f[i.SELECT_BOX]&&!r){var O=e||l.contexts[i.SELECT_BOX];if(A(O),i.selection[4]==1&&(i.hoverData.selecting||i.touchData.selecting)){var m=i.cy.zoom(),H=b.core("selection-box-border-width").value/m;O.lineWidth=H,O.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+")",O.fillRect(i.selection[0],i.selection[1],i.selection[2]-i.selection[0],i.selection[3]-i.selection[1]),H>0&&(O.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+")",O.strokeRect(i.selection[0],i.selection[1],i.selection[2]-i.selection[0],i.selection[3]-i.selection[1]))}if(l.bgActivePosistion&&!i.hoverData.selecting){var m=i.cy.zoom(),Y=l.bgActivePosistion;O.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+")",O.beginPath(),O.arc(Y.x,Y.y,b.core("active-bg-size").pfValue/m,0,2*Math.PI),O.fill()}var Q=i.lastRedrawTime;if(i.showFps&&Q){Q=Math.round(Q);var J=Math.round(1e3/Q);O.setTransform(1,0,0,1,0,0),O.fillStyle="rgba(255, 0, 0, 0.75)",O.strokeStyle="rgba(255, 0, 0, 0.75)",O.lineWidth=1,O.fillText("1 frame = "+Q+" ms = "+J+" fps",0,20);var q=60;O.strokeRect(0,30,250,20),O.fillRect(0,30,250*Math.min(J/q,1),20)}r||(f[i.SELECT_BOX]=!1)}if(d&&v!==1){var V=l.contexts[i.NODE],Z=i.data.bufferCanvases[i.MOTIONBLUR_BUFFER_NODE],K=l.contexts[i.DRAG],ie=i.data.bufferCanvases[i.MOTIONBLUR_BUFFER_DRAG],ve=function(te,ue,ce){te.setTransform(1,0,0,1,0,0),ce||!y?te.clearRect(0,0,i.canvasWidth,i.canvasHeight):L(te,0,0,i.canvasWidth,i.canvasHeight);var fe=v;te.drawImage(ue,0,0,i.canvasWidth*fe,i.canvasHeight*fe,0,0,i.canvasWidth,i.canvasHeight)};(f[i.NODE]||G[i.NODE])&&(ve(V,Z,G[i.NODE]),f[i.NODE]=!1),(f[i.DRAG]||G[i.DRAG])&&(ve(K,ie,G[i.DRAG]),f[i.DRAG]=!1)}i.prevViewport=E,i.clearingMotionBlur&&(i.clearingMotionBlur=!1,i.motionBlurCleared=!0,i.motionBlur=!0),d&&(i.motionBlurTimeout=setTimeout(function(){i.motionBlurTimeout=null,i.clearedForMotionBlur[i.NODE]=!1,i.clearedForMotionBlur[i.DRAG]=!1,i.motionBlur=!1,i.clearingMotionBlur=!h,i.mbFrames=0,f[i.NODE]=!0,f[i.DRAG]=!0,i.redraw()},Up)),e||u.emit("render")};var or={};or.drawPolygonPath=function(t,e,r,a,n,s){var i=a/2,o=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+i*s[0],r+o*s[1]);for(var u=1;u<s.length/2;u++)t.lineTo(e+i*s[u*2],r+o*s[u*2+1]);t.closePath()};or.drawRoundPolygonPath=function(t,e,r,a,n,s,i){i.forEach(function(o){return Cu(t,o)}),t.closePath()};or.drawRoundRectanglePath=function(t,e,r,a,n,s){var i=a/2,o=n/2,u=s==="auto"?yr(a,n):Math.min(s,o,i);t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.arcTo(e+i,r-o,e+i,r,u),t.arcTo(e+i,r+o,e,r+o,u),t.arcTo(e-i,r+o,e-i,r,u),t.arcTo(e-i,r-o,e,r-o,u),t.lineTo(e,r-o),t.closePath()};or.drawBottomRoundRectanglePath=function(t,e,r,a,n,s){var i=a/2,o=n/2,u=s==="auto"?yr(a,n):s;t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.lineTo(e+i,r-o),t.lineTo(e+i,r),t.arcTo(e+i,r+o,e,r+o,u),t.arcTo(e-i,r+o,e-i,r,u),t.lineTo(e-i,r-o),t.lineTo(e,r-o),t.closePath()};or.drawCutRectanglePath=function(t,e,r,a,n,s,i){var o=a/2,u=n/2,l=i==="auto"?Ti():i;t.beginPath&&t.beginPath(),t.moveTo(e-o+l,r-u),t.lineTo(e+o-l,r-u),t.lineTo(e+o,r-u+l),t.lineTo(e+o,r+u-l),t.lineTo(e+o-l,r+u),t.lineTo(e-o+l,r+u),t.lineTo(e-o,r+u-l),t.lineTo(e-o,r-u+l),t.closePath()};or.drawBarrelPath=function(t,e,r,a,n){var s=a/2,i=n/2,o=e-s,u=e+s,l=r-i,f=r+i,h=Zn(a,n),d=h.widthOffset,v=h.heightOffset,c=h.ctrlPtOffsetPct*d;t.beginPath&&t.beginPath(),t.moveTo(o,l+v),t.lineTo(o,f-v),t.quadraticCurveTo(o+c,f,o+d,f),t.lineTo(u-d,f),t.quadraticCurveTo(u-c,f,u,f-v),t.lineTo(u,l+v),t.quadraticCurveTo(u-c,l,u-d,l),t.lineTo(o+d,l),t.quadraticCurveTo(o+c,l,o,l+v),t.closePath()};var to=Math.sin(0),ro=Math.cos(0),ui={},li={},Fu=Math.PI/40;for(var Nr=0*Math.PI;Nr<2*Math.PI;Nr+=Fu)ui[Nr]=Math.sin(Nr),li[Nr]=Math.cos(Nr);or.drawEllipsePath=function(t,e,r,a,n){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,a/2,n/2,0,0,2*Math.PI);else for(var s,i,o=a/2,u=n/2,l=0*Math.PI;l<2*Math.PI;l+=Fu)s=e-o*ui[l]*to+o*li[l]*ro,i=r+u*li[l]*to+u*ui[l]*ro,l===0?t.moveTo(s,i):t.lineTo(s,i);t.closePath()};var Ia={};Ia.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};Ia.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),a=r.boundingBox(),n=this.findContainerClientCoords(),s=t.full?Math.ceil(a.w):n[2],i=t.full?Math.ceil(a.h):n[3],o=se(t.maxWidth)||se(t.maxHeight),u=this.getPixelRatio(),l=1;if(t.scale!==void 0)s*=t.scale,i*=t.scale,l=t.scale;else if(o){var f=1/0,h=1/0;se(t.maxWidth)&&(f=l*t.maxWidth/s),se(t.maxHeight)&&(h=l*t.maxHeight/i),l=Math.min(f,h),s*=l,i*=l}o||(s*=u,i*=u,l*=u);var d=document.createElement("canvas");d.width=s,d.height=i,d.style.width=s+"px",d.style.height=i+"px";var v=d.getContext("2d");if(s>0&&i>0){v.clearRect(0,0,s,i),v.globalCompositeOperation="source-over";var c=this.getCachedZSortedEles();if(t.full)v.translate(-a.x1*l,-a.y1*l),v.scale(l,l),this.drawElements(v,c),v.scale(1/l,1/l),v.translate(a.x1*l,a.y1*l);else{var p=e.pan(),g={x:p.x*l,y:p.y*l};l*=e.zoom(),v.translate(g.x,g.y),v.scale(l,l),this.drawElements(v,c),v.scale(1/l,1/l),v.translate(-g.x,-g.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,s,i),v.fill())}return d};function $p(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),s=0;s<r.length;s++)n[s]=r.charCodeAt(s);return new Blob([a],{type:e})}function ao(t){var e=t.indexOf(",");return t.substr(e+1)}function Gu(t,e,r){var a=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Yr(function(n,s){try{e.toBlob(function(i){i!=null?n(i):s(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(i){s(i)}});case"blob":return $p(ao(a()),r);case"base64":return ao(a());case"base64uri":default:return a()}}Ia.png=function(t){return Gu(t,this.bufferCanvasImage(t),"image/png")};Ia.jpg=function(t){return Gu(t,this.bufferCanvasImage(t),"image/jpeg")};var zu={};zu.nodeShapeImpl=function(t,e,r,a,n,s,i,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,a,n,s);case"polygon":return this.drawPolygonPath(e,r,a,n,s,i);case"round-polygon":return this.drawRoundPolygonPath(e,r,a,n,s,i,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,a,n,s,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,a,n,s,i,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,a,n,s,o);case"barrel":return this.drawBarrelPath(e,r,a,n,s)}};var Yp=Vu,Le=Vu.prototype;Le.CANVAS_LAYERS=3;Le.SELECT_BOX=0;Le.DRAG=1;Le.NODE=2;Le.BUFFER_COUNT=3;Le.TEXTURE_BUFFER=0;Le.MOTIONBLUR_BUFFER_NODE=1;Le.MOTIONBLUR_BUFFER_DRAG=2;function Vu(t){var e=this,r=e.cy.window(),a=r.document;e.data={canvases:new Array(Le.CANVAS_LAYERS),contexts:new Array(Le.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Le.CANVAS_LAYERS),bufferCanvases:new Array(Le.BUFFER_COUNT),bufferContexts:new Array(Le.CANVAS_LAYERS)};var n="-webkit-tap-highlight-color",s="rgba(0,0,0,0)";e.data.canvasContainer=a.createElement("div");var i=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=s,i.position="relative",i.zIndex="0",i.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[n]=s;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Ol()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var l=0;l<Le.CANVAS_LAYERS;l++){var f=e.data.canvases[l]=a.createElement("canvas");e.data.contexts[l]=f.getContext("2d"),Object.keys(u).forEach(function(q){f.style[q]=u[q]}),f.style.position="absolute",f.setAttribute("data-id","layer"+l),f.style.zIndex=String(Le.CANVAS_LAYERS-l),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[l]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Le.NODE].setAttribute("data-id","layer"+Le.NODE+"-node"),e.data.canvases[Le.SELECT_BOX].setAttribute("data-id","layer"+Le.SELECT_BOX+"-selectbox"),e.data.canvases[Le.DRAG].setAttribute("data-id","layer"+Le.DRAG+"-drag");for(var l=0;l<Le.BUFFER_COUNT;l++)e.data.bufferCanvases[l]=a.createElement("canvas"),e.data.bufferContexts[l]=e.data.bufferCanvases[l].getContext("2d"),e.data.bufferCanvases[l].style.position="absolute",e.data.bufferCanvases[l].setAttribute("data-id","buffer"+l),e.data.bufferCanvases[l].style.zIndex=String(-l-1),e.data.bufferCanvases[l].style.visibility="hidden";e.pathsEnabled=!0;var h=pt(),d=function(V){return{x:(V.x1+V.x2)/2,y:(V.y1+V.y2)/2}},v=function(V){return{x:-V.w/2,y:-V.h/2}},c=function(V){var Z=V[0]._private,K=Z.oldBackgroundTimestamp===Z.backgroundTimestamp;return!K},p=function(V){return V[0]._private.nodeKey},g=function(V){return V[0]._private.labelStyleKey},y=function(V){return V[0]._private.sourceLabelStyleKey},b=function(V){return V[0]._private.targetLabelStyleKey},m=function(V,Z,K,ie,ve){return e.drawElement(V,Z,K,!1,!1,ve)},T=function(V,Z,K,ie,ve){return e.drawElementText(V,Z,K,ie,"main",ve)},C=function(V,Z,K,ie,ve){return e.drawElementText(V,Z,K,ie,"source",ve)},S=function(V,Z,K,ie,ve){return e.drawElementText(V,Z,K,ie,"target",ve)},E=function(V){return V.boundingBox(),V[0]._private.bodyBounds},x=function(V){return V.boundingBox(),V[0]._private.labelBounds.main||h},w=function(V){return V.boundingBox(),V[0]._private.labelBounds.source||h},D=function(V){return V.boundingBox(),V[0]._private.labelBounds.target||h},L=function(V,Z){return Z},A=function(V){return d(E(V))},N=function(V,Z,K){var ie=V?V+"-":"";return{x:Z.x+K.pstyle(ie+"text-margin-x").pfValue,y:Z.y+K.pstyle(ie+"text-margin-y").pfValue}},O=function(V,Z,K){var ie=V[0]._private.rscratch;return{x:ie[Z],y:ie[K]}},M=function(V){return N("",O(V,"labelX","labelY"),V)},R=function(V){return N("source",O(V,"sourceLabelX","sourceLabelY"),V)},k=function(V){return N("target",O(V,"targetLabelX","targetLabelY"),V)},P=function(V){return v(E(V))},B=function(V){return v(w(V))},z=function(V){return v(D(V))},G=function(V){var Z=x(V),K=v(x(V));if(V.isNode()){switch(V.pstyle("text-halign").value){case"left":K.x=-Z.w;break;case"right":K.x=0;break}switch(V.pstyle("text-valign").value){case"top":K.y=-Z.h;break;case"bottom":K.y=0;break}}return K},F=e.data.eleTxrCache=new la(e,{getKey:p,doesEleInvalidateKey:c,drawElement:m,getBoundingBox:E,getRotationPoint:A,getRotationOffset:P,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),U=e.data.lblTxrCache=new la(e,{getKey:g,drawElement:T,getBoundingBox:x,getRotationPoint:M,getRotationOffset:G,isVisible:L}),H=e.data.slbTxrCache=new la(e,{getKey:y,drawElement:C,getBoundingBox:w,getRotationPoint:R,getRotationOffset:B,isVisible:L}),Y=e.data.tlbTxrCache=new la(e,{getKey:b,drawElement:S,getBoundingBox:D,getRotationPoint:k,getRotationOffset:z,isVisible:L}),Q=e.data.lyrTxrCache=new Ru(e);e.onUpdateEleCalcs(function(V,Z){F.invalidateElements(Z),U.invalidateElements(Z),H.invalidateElements(Z),Y.invalidateElements(Z),Q.invalidateElements(Z);for(var K=0;K<Z.length;K++){var ie=Z[K]._private;ie.oldBackgroundTimestamp=ie.backgroundTimestamp}});var J=function(V){for(var Z=0;Z<V.length;Z++)Q.enqueueElementRefinement(V[Z].ele)};F.onDequeue(J),U.onDequeue(J),H.onDequeue(J),Y.onDequeue(J)}Le.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[Le.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[Le.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[Le.SELECT_BOX]=e;break}};var _p=typeof Path2D<"u";Le.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Le.usePaths=function(){return _p&&this.pathsEnabled};Le.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Le.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Le.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":qe(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var a=this.cy.window(),n=a.document;r=n.createElement("canvas"),r.width=t,r.height=e}return r};[ku,Vt,qt,Fi,Tr,Qr,mt,or,Ia,zu].forEach(function(t){Ee(Le,t)});var Hp=[{name:"null",impl:wu},{name:"base",impl:Iu},{name:"canvas",impl:Yp}],Xp=[{type:"layout",extensions:Jg},{type:"renderer",extensions:Hp}],Uu={},$u={};function Yu(t,e,r){var a=r,n=function(x){Ie("Can not register `"+e+"` for `"+t+"` since `"+x+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(xa.prototype[e])return n(e);xa.prototype[e]=r}else if(t==="collection"){if(tt.prototype[e])return n(e);tt.prototype[e]=r}else if(t==="layout"){for(var s=function(x){this.options=x,r.call(this,x),De(this._private)||(this._private={}),this._private.cy=x.cy,this._private.listeners=[],this.createEmitter()},i=s.prototype=Object.create(r.prototype),o=[],u=0;u<o.length;u++){var l=o[u];i[l]=i[l]||function(){return this}}i.start&&!i.run?i.run=function(){return this.start(),this}:!i.start&&i.run&&(i.start=function(){return this.run(),this});var f=r.prototype.stop;i.stop=function(){var E=this.options;if(E&&E.animate){var x=this.animations;if(x)for(var w=0;w<x.length;w++)x[w].stop()}return f?f.call(this):this.emit("layoutstop"),this},i.destroy||(i.destroy=function(){return this}),i.cy=function(){return this._private.cy};var h=function(x){return x._private.cy},d={addEventFields:function(x,w){w.layout=x,w.cy=h(x),w.target=x},bubble:function(){return!0},parent:function(x){return h(x)}};Ee(i,{createEmitter:function(){return this._private.emitter=new Cn(d,this),this},emitter:function(){return this._private.emitter},on:function(x,w){return this.emitter().on(x,w),this},one:function(x,w){return this.emitter().one(x,w),this},once:function(x,w){return this.emitter().one(x,w),this},removeListener:function(x,w){return this.emitter().removeListener(x,w),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(x,w){return this.emitter().emit(x,w),this}}),Ne.eventAliasesOn(i),a=s}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=_u("renderer","base"),c=v.prototype,p=r,g=r.prototype,y=function(){v.apply(this,arguments),p.apply(this,arguments)},b=y.prototype;for(var m in c){var T=c[m],C=g[m]!=null;if(C)return n(m);b[m]=T}for(var S in g)b[S]=g[S];c.clientFunctions.forEach(function(E){b[E]=b[E]||function(){Ve("Renderer does not implement `renderer."+E+"()` on its prototype")}}),a=y}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Ve(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return go({map:Uu,keys:[t,e],value:a})}function _u(t,e){return po({map:Uu,keys:[t,e]})}function qp(t,e,r,a,n){return go({map:$u,keys:[t,e,r,a],value:n})}function Wp(t,e,r,a){return po({map:$u,keys:[t,e,r,a]})}var fi=function(){if(arguments.length===2)return _u.apply(null,arguments);if(arguments.length===3)return Yu.apply(null,arguments);if(arguments.length===4)return Wp.apply(null,arguments);if(arguments.length===5)return qp.apply(null,arguments);Ve("Invalid extension access syntax")};xa.prototype.extension=fi;Xp.forEach(function(t){t.extensions.forEach(function(e){Yu(t.type,e.name,e.impl)})});var Hu=function t(){if(!(this instanceof t))return new t;this.length=0},Er=Hu.prototype;Er.instanceString=function(){return"stylesheet"};Er.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Er.css=function(t,e){var r=this.length-1;if(ge(t))this[r].properties.push({name:t,value:e});else if(De(t))for(var a=t,n=Object.keys(a),s=0;s<n.length;s++){var i=n[s],o=a[i];if(o!=null){var u=it.properties[i]||it.properties[dn(i)];if(u!=null){var l=u.name,f=o;this[r].properties.push({name:l,value:f})}}}return this};Er.style=Er.css;Er.generateStyle=function(t){var e=new it(t);return this.appendToStyle(e)};Er.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],a=r.selector,n=r.properties;t.selector(a);for(var s=0;s<n.length;s++){var i=n[s];t.css(i.name,i.value)}}return t};var Kp="3.30.2",ir=function(e){if(e===void 0&&(e={}),De(e))return new xa(e);if(ge(e))return fi.apply(fi,arguments)};ir.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(ir),t.apply(null,e),this};ir.warnings=function(t){return Co(t)};ir.version=Kp;ir.stylesheet=ir.Stylesheet=Hu;var Xu={exports:{}},qn={exports:{}},Wn={exports:{}},no;function Zp(){return no||(no=1,function(t,e){(function(a,n){t.exports=n()})(vi,function(){return function(r){var a={};function n(s){if(a[s])return a[s].exports;var i=a[s]={i:s,l:!1,exports:{}};return r[s].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=r,n.c=a,n.i=function(s){return s},n.d=function(s,i,o){n.o(s,i)||Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:o})},n.n=function(s){var i=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(i,"a",i),i},n.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)},n.p="",n(n.s=26)}([function(r,a,n){function s(){}s.QUALITY=1,s.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,s.DEFAULT_INCREMENTAL=!1,s.DEFAULT_ANIMATION_ON_LAYOUT=!0,s.DEFAULT_ANIMATION_DURING_LAYOUT=!1,s.DEFAULT_ANIMATION_PERIOD=50,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,s.DEFAULT_GRAPH_MARGIN=15,s.NODE_DIMENSIONS_INCLUDE_LABELS=!1,s.SIMPLE_NODE_SIZE=40,s.SIMPLE_NODE_HALF_SIZE=s.SIMPLE_NODE_SIZE/2,s.EMPTY_COMPOUND_NODE_SIZE=40,s.MIN_EDGE_LENGTH=1,s.WORLD_BOUNDARY=1e6,s.INITIAL_WORLD_BOUNDARY=s.WORLD_BOUNDARY/1e3,s.WORLD_CENTER_X=1200,s.WORLD_CENTER_Y=900,r.exports=s},function(r,a,n){var s=n(2),i=n(8),o=n(9);function u(f,h,d){s.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=f,this.target=h}u.prototype=Object.create(s.prototype);for(var l in s)u[l]=s[l];u.prototype.getSource=function(){return this.source},u.prototype.getTarget=function(){return this.target},u.prototype.isInterGraph=function(){return this.isInterGraph},u.prototype.getLength=function(){return this.length},u.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},u.prototype.getBendpoints=function(){return this.bendpoints},u.prototype.getLca=function(){return this.lca},u.prototype.getSourceInLca=function(){return this.sourceInLca},u.prototype.getTargetInLca=function(){return this.targetInLca},u.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},u.prototype.getOtherEndInGraph=function(f,h){for(var d=this.getOtherEnd(f),v=h.getGraphManager().getRoot();;){if(d.getOwner()==h)return d;if(d.getOwner()==v)break;d=d.getOwner().getParent()}return null},u.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},u.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=u},function(r,a,n){function s(i){this.vGraphObject=i}r.exports=s},function(r,a,n){var s=n(2),i=n(10),o=n(13),u=n(0),l=n(16),f=n(4);function h(v,c,p,g){p==null&&g==null&&(g=c),s.call(this,g),v.graphManager!=null&&(v=v.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=v,p!=null&&c!=null?this.rect=new o(c.x,c.y,p.width,p.height):this.rect=new o}h.prototype=Object.create(s.prototype);for(var d in s)h[d]=s[d];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(v){this.rect.width=v},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(v){this.rect.height=v},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(v,c){this.rect.x=v.x,this.rect.y=v.y,this.rect.width=c.width,this.rect.height=c.height},h.prototype.setCenter=function(v,c){this.rect.x=v-this.rect.width/2,this.rect.y=c-this.rect.height/2},h.prototype.setLocation=function(v,c){this.rect.x=v,this.rect.y=c},h.prototype.moveBy=function(v,c){this.rect.x+=v,this.rect.y+=c},h.prototype.getEdgeListToNode=function(v){var c=[],p=this;return p.edges.forEach(function(g){if(g.target==v){if(g.source!=p)throw"Incorrect edge source!";c.push(g)}}),c},h.prototype.getEdgesBetween=function(v){var c=[],p=this;return p.edges.forEach(function(g){if(!(g.source==p||g.target==p))throw"Incorrect edge source and/or target";(g.target==v||g.source==v)&&c.push(g)}),c},h.prototype.getNeighborsList=function(){var v=new Set,c=this;return c.edges.forEach(function(p){if(p.source==c)v.add(p.target);else{if(p.target!=c)throw"Incorrect incidency!";v.add(p.source)}}),v},h.prototype.withChildren=function(){var v=new Set,c,p;if(v.add(this),this.child!=null)for(var g=this.child.getNodes(),y=0;y<g.length;y++)c=g[y],p=c.withChildren(),p.forEach(function(b){v.add(b)});return v},h.prototype.getNoOfChildren=function(){var v=0,c;if(this.child==null)v=1;else for(var p=this.child.getNodes(),g=0;g<p.length;g++)c=p[g],v+=c.getNoOfChildren();return v==0&&(v=1),v},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},h.prototype.scatter=function(){var v,c,p=-u.INITIAL_WORLD_BOUNDARY,g=u.INITIAL_WORLD_BOUNDARY;v=u.WORLD_CENTER_X+l.nextDouble()*(g-p)+p;var y=-u.INITIAL_WORLD_BOUNDARY,b=u.INITIAL_WORLD_BOUNDARY;c=u.WORLD_CENTER_Y+l.nextDouble()*(b-y)+y,this.rect.x=v,this.rect.y=c},h.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var v=this.getChild();if(v.updateBounds(!0),this.rect.x=v.getLeft(),this.rect.y=v.getTop(),this.setWidth(v.getRight()-v.getLeft()),this.setHeight(v.getBottom()-v.getTop()),u.NODE_DIMENSIONS_INCLUDE_LABELS){var c=v.getRight()-v.getLeft(),p=v.getBottom()-v.getTop();this.labelWidth>c&&(this.rect.x-=(this.labelWidth-c)/2,this.setWidth(this.labelWidth)),this.labelHeight>p&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-p)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-p),this.setHeight(this.labelHeight))}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(v){var c=this.rect.x;c>u.WORLD_BOUNDARY?c=u.WORLD_BOUNDARY:c<-u.WORLD_BOUNDARY&&(c=-u.WORLD_BOUNDARY);var p=this.rect.y;p>u.WORLD_BOUNDARY?p=u.WORLD_BOUNDARY:p<-u.WORLD_BOUNDARY&&(p=-u.WORLD_BOUNDARY);var g=new f(c,p),y=v.inverseTransformPoint(g);this.setLocation(y.x,y.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=h},function(r,a,n){function s(i,o){i==null&&o==null?(this.x=0,this.y=0):(this.x=i,this.y=o)}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.setX=function(i){this.x=i},s.prototype.setY=function(i){this.y=i},s.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)},s.prototype.getCopy=function(){return new s(this.x,this.y)},s.prototype.translate=function(i){return this.x+=i.width,this.y+=i.height,this},r.exports=s},function(r,a,n){var s=n(2),i=n(10),o=n(0),u=n(6),l=n(3),f=n(1),h=n(13),d=n(12),v=n(11);function c(g,y,b){s.call(this,b),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,y!=null&&y instanceof u?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}c.prototype=Object.create(s.prototype);for(var p in s)c[p]=s[p];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(g,y,b){if(y==null&&b==null){var m=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(m)>-1)throw"Node already in graph!";return m.owner=this,this.getNodes().push(m),m}else{var T=g;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(b)>-1))throw"Source or target not in graph!";if(!(y.owner==b.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=b.owner?null:(T.source=y,T.target=b,T.isInterGraph=!1,this.getEdges().push(T),y.edges.push(T),b!=y&&b.edges.push(T),T)}},c.prototype.remove=function(g){var y=g;if(g instanceof l){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var b=y.edges.slice(),m,T=b.length,C=0;C<T;C++)m=b[C],m.isInterGraph?this.graphManager.remove(m):m.source.owner.remove(m);var S=this.nodes.indexOf(y);if(S==-1)throw"Node not in owner node list!";this.nodes.splice(S,1)}else if(g instanceof f){var m=g;if(m==null)throw"Edge is null!";if(!(m.source!=null&&m.target!=null))throw"Source and/or target is null!";if(!(m.source.owner!=null&&m.target.owner!=null&&m.source.owner==this&&m.target.owner==this))throw"Source and/or target owner is invalid!";var E=m.source.edges.indexOf(m),x=m.target.edges.indexOf(m);if(!(E>-1&&x>-1))throw"Source and/or target doesn't know this edge!";m.source.edges.splice(E,1),m.target!=m.source&&m.target.edges.splice(x,1);var S=m.source.owner.getEdges().indexOf(m);if(S==-1)throw"Not in owner's edge list!";m.source.owner.getEdges().splice(S,1)}},c.prototype.updateLeftTop=function(){for(var g=i.MAX_VALUE,y=i.MAX_VALUE,b,m,T,C=this.getNodes(),S=C.length,E=0;E<S;E++){var x=C[E];b=x.getTop(),m=x.getLeft(),g>b&&(g=b),y>m&&(y=m)}return g==i.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?T=C[0].getParent().paddingLeft:T=this.margin,this.left=y-T,this.top=g-T,new d(this.left,this.top))},c.prototype.updateBounds=function(g){for(var y=i.MAX_VALUE,b=-i.MAX_VALUE,m=i.MAX_VALUE,T=-i.MAX_VALUE,C,S,E,x,w,D=this.nodes,L=D.length,A=0;A<L;A++){var N=D[A];g&&N.child!=null&&N.updateBounds(),C=N.getLeft(),S=N.getRight(),E=N.getTop(),x=N.getBottom(),y>C&&(y=C),b<S&&(b=S),m>E&&(m=E),T<x&&(T=x)}var O=new h(y,m,b-y,T-m);y==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),D[0].getParent().paddingLeft!=null?w=D[0].getParent().paddingLeft:w=this.margin,this.left=O.x-w,this.right=O.x+O.width+w,this.top=O.y-w,this.bottom=O.y+O.height+w},c.calculateBounds=function(g){for(var y=i.MAX_VALUE,b=-i.MAX_VALUE,m=i.MAX_VALUE,T=-i.MAX_VALUE,C,S,E,x,w=g.length,D=0;D<w;D++){var L=g[D];C=L.getLeft(),S=L.getRight(),E=L.getTop(),x=L.getBottom(),y>C&&(y=C),b<S&&(b=S),m>E&&(m=E),T<x&&(T=x)}var A=new h(y,m,b-y,T-m);return A},c.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},c.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},c.prototype.calcEstimatedSize=function(){for(var g=0,y=this.nodes,b=y.length,m=0;m<b;m++){var T=y[m];g+=T.calcEstimatedSize()}return g==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=g/Math.sqrt(this.nodes.length),this.estimatedSize},c.prototype.updateConnected=function(){var g=this;if(this.nodes.length==0){this.isConnected=!0;return}var y=new v,b=new Set,m=this.nodes[0],T,C,S=m.withChildren();for(S.forEach(function(A){y.push(A),b.add(A)});y.length!==0;){m=y.shift(),T=m.getEdges();for(var E=T.length,x=0;x<E;x++){var w=T[x];if(C=w.getOtherEndInGraph(m,this),C!=null&&!b.has(C)){var D=C.withChildren();D.forEach(function(A){y.push(A),b.add(A)})}}}if(this.isConnected=!1,b.size>=this.nodes.length){var L=0;b.forEach(function(A){A.owner==g&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},r.exports=c},function(r,a,n){var s,i=n(1);function o(u){s=n(5),this.layout=u,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var u=this.layout.newGraph(),l=this.layout.newNode(null),f=this.add(u,l);return this.setRootGraph(f),this.rootGraph},o.prototype.add=function(u,l,f,h,d){if(f==null&&h==null&&d==null){if(u==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(u)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(u),u.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return u.parent=l,l.child=u,u}else{d=f,h=l,f=u;var v=h.getOwner(),c=d.getOwner();if(!(v!=null&&v.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(c!=null&&c.getGraphManager()==this))throw"Target not in this graph mgr!";if(v==c)return f.isInterGraph=!1,v.add(f,h,d);if(f.isInterGraph=!0,f.source=h,f.target=d,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},o.prototype.remove=function(u){if(u instanceof s){var l=u;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(l.getEdges());for(var h,d=f.length,v=0;v<d;v++)h=f[v],l.remove(h);var c=[];c=c.concat(l.getNodes());var p;d=c.length;for(var v=0;v<d;v++)p=c[v],l.remove(p);l==this.rootGraph&&this.setRootGraph(null);var g=this.graphs.indexOf(l);this.graphs.splice(g,1),l.parent=null}else if(u instanceof i){if(h=u,h==null)throw"Edge is null!";if(!h.isInterGraph)throw"Not an inter-graph edge!";if(!(h.source!=null&&h.target!=null))throw"Source and/or target is null!";if(!(h.source.edges.indexOf(h)!=-1&&h.target.edges.indexOf(h)!=-1))throw"Source and/or target doesn't know this edge!";var g=h.source.edges.indexOf(h);if(h.source.edges.splice(g,1),g=h.target.edges.indexOf(h),h.target.edges.splice(g,1),!(h.source.owner!=null&&h.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(h.source.owner.getGraphManager().edges.indexOf(h)==-1)throw"Not in owner graph manager's edge list!";var g=h.source.owner.getGraphManager().edges.indexOf(h);h.source.owner.getGraphManager().edges.splice(g,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var u=[],l=this.getGraphs(),f=l.length,h=0;h<f;h++)u=u.concat(l[h].getNodes());this.allNodes=u}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var u=[],l=this.getGraphs();l.length;for(var f=0;f<l.length;f++)u=u.concat(l[f].getEdges());u=u.concat(this.edges),this.allEdges=u}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(u){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=u},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(u){if(u.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=u,u.parent==null&&(u.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(u,l){if(!(u!=null&&l!=null))throw"assert failed";if(u==l)return!0;var f=u.getOwner(),h;do{if(h=f.getParent(),h==null)break;if(h==l)return!0;if(f=h.getOwner(),f==null)break}while(!0);f=l.getOwner();do{if(h=f.getParent(),h==null)break;if(h==u)return!0;if(f=h.getOwner(),f==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var u,l,f,h,d,v=this.getAllEdges(),c=v.length,p=0;p<c;p++){if(u=v[p],l=u.source,f=u.target,u.lca=null,u.sourceInLca=l,u.targetInLca=f,l==f){u.lca=l.getOwner();continue}for(h=l.getOwner();u.lca==null;){for(u.targetInLca=f,d=f.getOwner();u.lca==null;){if(d==h){u.lca=d;break}if(d==this.rootGraph)break;if(u.lca!=null)throw"assert failed";u.targetInLca=d.getParent(),d=u.targetInLca.getOwner()}if(h==this.rootGraph)break;u.lca==null&&(u.sourceInLca=h.getParent(),h=u.sourceInLca.getOwner())}if(u.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(u,l){if(u==l)return u.getOwner();var f=u.getOwner();do{if(f==null)break;var h=l.getOwner();do{if(h==null)break;if(h==f)return h;h=h.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},o.prototype.calcInclusionTreeDepths=function(u,l){u==null&&l==null&&(u=this.rootGraph,l=1);for(var f,h=u.getNodes(),d=h.length,v=0;v<d;v++)f=h[v],f.inclusionTreeDepth=l,f.child!=null&&this.calcInclusionTreeDepths(f.child,l+1)},o.prototype.includesInvalidEdge=function(){for(var u,l=this.edges.length,f=0;f<l;f++)if(u=this.edges[f],this.isOneAncestorOfOther(u.source,u.target))return!0;return!1},r.exports=o},function(r,a,n){var s=n(0);function i(){}for(var o in s)i[o]=s[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=i},function(r,a,n){var s=n(12);function i(){}i.calcSeparationAmount=function(o,u,l,f){if(!o.intersects(u))throw"assert failed";var h=new Array(2);this.decideDirectionsForOverlappingNodes(o,u,h),l[0]=Math.min(o.getRight(),u.getRight())-Math.max(o.x,u.x),l[1]=Math.min(o.getBottom(),u.getBottom())-Math.max(o.y,u.y),o.getX()<=u.getX()&&o.getRight()>=u.getRight()?l[0]+=Math.min(u.getX()-o.getX(),o.getRight()-u.getRight()):u.getX()<=o.getX()&&u.getRight()>=o.getRight()&&(l[0]+=Math.min(o.getX()-u.getX(),u.getRight()-o.getRight())),o.getY()<=u.getY()&&o.getBottom()>=u.getBottom()?l[1]+=Math.min(u.getY()-o.getY(),o.getBottom()-u.getBottom()):u.getY()<=o.getY()&&u.getBottom()>=o.getBottom()&&(l[1]+=Math.min(o.getY()-u.getY(),u.getBottom()-o.getBottom()));var d=Math.abs((u.getCenterY()-o.getCenterY())/(u.getCenterX()-o.getCenterX()));u.getCenterY()===o.getCenterY()&&u.getCenterX()===o.getCenterX()&&(d=1);var v=d*l[0],c=l[1]/d;l[0]<c?c=l[0]:v=l[1],l[0]=-1*h[0]*(c/2+f),l[1]=-1*h[1]*(v/2+f)},i.decideDirectionsForOverlappingNodes=function(o,u,l){o.getCenterX()<u.getCenterX()?l[0]=-1:l[0]=1,o.getCenterY()<u.getCenterY()?l[1]=-1:l[1]=1},i.getIntersection2=function(o,u,l){var f=o.getCenterX(),h=o.getCenterY(),d=u.getCenterX(),v=u.getCenterY();if(o.intersects(u))return l[0]=f,l[1]=h,l[2]=d,l[3]=v,!0;var c=o.getX(),p=o.getY(),g=o.getRight(),y=o.getX(),b=o.getBottom(),m=o.getRight(),T=o.getWidthHalf(),C=o.getHeightHalf(),S=u.getX(),E=u.getY(),x=u.getRight(),w=u.getX(),D=u.getBottom(),L=u.getRight(),A=u.getWidthHalf(),N=u.getHeightHalf(),O=!1,M=!1;if(f===d){if(h>v)return l[0]=f,l[1]=p,l[2]=d,l[3]=D,!1;if(h<v)return l[0]=f,l[1]=b,l[2]=d,l[3]=E,!1}else if(h===v){if(f>d)return l[0]=c,l[1]=h,l[2]=x,l[3]=v,!1;if(f<d)return l[0]=g,l[1]=h,l[2]=S,l[3]=v,!1}else{var R=o.height/o.width,k=u.height/u.width,P=(v-h)/(d-f),B=void 0,z=void 0,G=void 0,F=void 0,U=void 0,H=void 0;if(-R===P?f>d?(l[0]=y,l[1]=b,O=!0):(l[0]=g,l[1]=p,O=!0):R===P&&(f>d?(l[0]=c,l[1]=p,O=!0):(l[0]=m,l[1]=b,O=!0)),-k===P?d>f?(l[2]=w,l[3]=D,M=!0):(l[2]=x,l[3]=E,M=!0):k===P&&(d>f?(l[2]=S,l[3]=E,M=!0):(l[2]=L,l[3]=D,M=!0)),O&&M)return!1;if(f>d?h>v?(B=this.getCardinalDirection(R,P,4),z=this.getCardinalDirection(k,P,2)):(B=this.getCardinalDirection(-R,P,3),z=this.getCardinalDirection(-k,P,1)):h>v?(B=this.getCardinalDirection(-R,P,1),z=this.getCardinalDirection(-k,P,3)):(B=this.getCardinalDirection(R,P,2),z=this.getCardinalDirection(k,P,4)),!O)switch(B){case 1:F=p,G=f+-C/P,l[0]=G,l[1]=F;break;case 2:G=m,F=h+T*P,l[0]=G,l[1]=F;break;case 3:F=b,G=f+C/P,l[0]=G,l[1]=F;break;case 4:G=y,F=h+-T*P,l[0]=G,l[1]=F;break}if(!M)switch(z){case 1:H=E,U=d+-N/P,l[2]=U,l[3]=H;break;case 2:U=L,H=v+A*P,l[2]=U,l[3]=H;break;case 3:H=D,U=d+N/P,l[2]=U,l[3]=H;break;case 4:U=w,H=v+-A*P,l[2]=U,l[3]=H;break}}return!1},i.getCardinalDirection=function(o,u,l){return o>u?l:1+l%4},i.getIntersection=function(o,u,l,f){if(f==null)return this.getIntersection2(o,u,l);var h=o.x,d=o.y,v=u.x,c=u.y,p=l.x,g=l.y,y=f.x,b=f.y,m=void 0,T=void 0,C=void 0,S=void 0,E=void 0,x=void 0,w=void 0,D=void 0,L=void 0;return C=c-d,E=h-v,w=v*d-h*c,S=b-g,x=p-y,D=y*g-p*b,L=C*x-S*E,L===0?null:(m=(E*D-x*w)/L,T=(S*w-C*D)/L,new s(m,T))},i.angleOfVector=function(o,u,l,f){var h=void 0;return o!==l?(h=Math.atan((f-u)/(l-o)),l<o?h+=Math.PI:f<u&&(h+=this.TWO_PI)):f<u?h=this.ONE_AND_HALF_PI:h=this.HALF_PI,h},i.doIntersect=function(o,u,l,f){var h=o.x,d=o.y,v=u.x,c=u.y,p=l.x,g=l.y,y=f.x,b=f.y,m=(v-h)*(b-g)-(y-p)*(c-d);if(m===0)return!1;var T=((b-g)*(y-h)+(p-y)*(b-d))/m,C=((d-c)*(y-h)+(v-h)*(b-d))/m;return 0<T&&T<1&&0<C&&C<1},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,r.exports=i},function(r,a,n){function s(){}s.sign=function(i){return i>0?1:i<0?-1:0},s.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)},s.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)},r.exports=s},function(r,a,n){function s(){}s.MAX_VALUE=2147483647,s.MIN_VALUE=-2147483648,r.exports=s},function(r,a,n){var s=function(){function h(d,v){for(var c=0;c<v.length;c++){var p=v[c];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(d,p.key,p)}}return function(d,v,c){return v&&h(d.prototype,v),c&&h(d,c),d}}();function i(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")}var o=function(d){return{value:d,next:null,prev:null}},u=function(d,v,c,p){return d!==null?d.next=v:p.head=v,c!==null?c.prev=v:p.tail=v,v.prev=d,v.next=c,p.length++,v},l=function(d,v){var c=d.prev,p=d.next;return c!==null?c.next=p:v.head=p,p!==null?p.prev=c:v.tail=c,d.prev=d.next=null,v.length--,d},f=function(){function h(d){var v=this;i(this,h),this.length=0,this.head=null,this.tail=null,d!=null&&d.forEach(function(c){return v.push(c)})}return s(h,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(v,c){return u(c.prev,o(v),c,this)}},{key:"insertAfter",value:function(v,c){return u(c,o(v),c.next,this)}},{key:"insertNodeBefore",value:function(v,c){return u(c.prev,v,c,this)}},{key:"insertNodeAfter",value:function(v,c){return u(c,v,c.next,this)}},{key:"push",value:function(v){return u(this.tail,o(v),null,this)}},{key:"unshift",value:function(v){return u(null,o(v),this.head,this)}},{key:"remove",value:function(v){return l(v,this)}},{key:"pop",value:function(){return l(this.tail,this).value}},{key:"popNode",value:function(){return l(this.tail,this)}},{key:"shift",value:function(){return l(this.head,this).value}},{key:"shiftNode",value:function(){return l(this.head,this)}},{key:"get_object_at",value:function(v){if(v<=this.length()){for(var c=1,p=this.head;c<v;)p=p.next,c++;return p.value}}},{key:"set_object_at",value:function(v,c){if(v<=this.length()){for(var p=1,g=this.head;p<v;)g=g.next,p++;g.value=c}}}]),h}();r.exports=f},function(r,a,n){function s(i,o,u){this.x=null,this.y=null,i==null&&o==null&&u==null?(this.x=0,this.y=0):typeof i=="number"&&typeof o=="number"&&u==null?(this.x=i,this.y=o):i.constructor.name=="Point"&&o==null&&u==null&&(u=i,this.x=u.x,this.y=u.y)}s.prototype.getX=function(){return this.x},s.prototype.getY=function(){return this.y},s.prototype.getLocation=function(){return new s(this.x,this.y)},s.prototype.setLocation=function(i,o,u){i.constructor.name=="Point"&&o==null&&u==null?(u=i,this.setLocation(u.x,u.y)):typeof i=="number"&&typeof o=="number"&&u==null&&(parseInt(i)==i&&parseInt(o)==o?this.move(i,o):(this.x=Math.floor(i+.5),this.y=Math.floor(o+.5)))},s.prototype.move=function(i,o){this.x=i,this.y=o},s.prototype.translate=function(i,o){this.x+=i,this.y+=o},s.prototype.equals=function(i){if(i.constructor.name=="Point"){var o=i;return this.x==o.x&&this.y==o.y}return this==i},s.prototype.toString=function(){return new s().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=s},function(r,a,n){function s(i,o,u,l){this.x=0,this.y=0,this.width=0,this.height=0,i!=null&&o!=null&&u!=null&&l!=null&&(this.x=i,this.y=o,this.width=u,this.height=l)}s.prototype.getX=function(){return this.x},s.prototype.setX=function(i){this.x=i},s.prototype.getY=function(){return this.y},s.prototype.setY=function(i){this.y=i},s.prototype.getWidth=function(){return this.width},s.prototype.setWidth=function(i){this.width=i},s.prototype.getHeight=function(){return this.height},s.prototype.setHeight=function(i){this.height=i},s.prototype.getRight=function(){return this.x+this.width},s.prototype.getBottom=function(){return this.y+this.height},s.prototype.intersects=function(i){return!(this.getRight()<i.x||this.getBottom()<i.y||i.getRight()<this.x||i.getBottom()<this.y)},s.prototype.getCenterX=function(){return this.x+this.width/2},s.prototype.getMinX=function(){return this.getX()},s.prototype.getMaxX=function(){return this.getX()+this.width},s.prototype.getCenterY=function(){return this.y+this.height/2},s.prototype.getMinY=function(){return this.getY()},s.prototype.getMaxY=function(){return this.getY()+this.height},s.prototype.getWidthHalf=function(){return this.width/2},s.prototype.getHeightHalf=function(){return this.height/2},r.exports=s},function(r,a,n){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function i(){}i.lastID=0,i.createID=function(o){return i.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=i.getString(),i.lastID++),o.uniqueID)},i.getString=function(o){return o==null&&(o=i.lastID),"Object#"+o},i.isPrimitive=function(o){var u=typeof o>"u"?"undefined":s(o);return o==null||u!="object"&&u!="function"},r.exports=i},function(r,a,n){function s(p){if(Array.isArray(p)){for(var g=0,y=Array(p.length);g<p.length;g++)y[g]=p[g];return y}else return Array.from(p)}var i=n(0),o=n(6),u=n(3),l=n(1),f=n(5),h=n(4),d=n(17),v=n(27);function c(p){v.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,p!=null&&(this.isRemoteUse=p)}c.RANDOM_SEED=1,c.prototype=Object.create(v.prototype),c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},c.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},c.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},c.prototype.newGraphManager=function(){var p=new o(this);return this.graphManager=p,p},c.prototype.newGraph=function(p){return new f(null,this.graphManager,p)},c.prototype.newNode=function(p){return new u(this.graphManager,p)},c.prototype.newEdge=function(p){return new l(null,null,p)},c.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},c.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var p;return this.checkLayoutSuccess()?p=!1:p=this.layout(),i.ANIMATE==="during"?!1:(p&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,p)},c.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},c.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var p=this.graphManager.getAllEdges(),g=0;g<p.length;g++)p[g];for(var y=this.graphManager.getRoot().getNodes(),g=0;g<y.length;g++)y[g];this.update(this.graphManager.getRoot())}},c.prototype.update=function(p){if(p==null)this.update2();else if(p instanceof u){var g=p;if(g.getChild()!=null)for(var y=g.getChild().getNodes(),b=0;b<y.length;b++)update(y[b]);if(g.vGraphObject!=null){var m=g.vGraphObject;m.update(g)}}else if(p instanceof l){var T=p;if(T.vGraphObject!=null){var C=T.vGraphObject;C.update(T)}}else if(p instanceof f){var S=p;if(S.vGraphObject!=null){var E=S.vGraphObject;E.update(S)}}},c.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},c.prototype.transform=function(p){if(p==null)this.transform(new h(0,0));else{var g=new d,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){g.setWorldOrgX(p.x),g.setWorldOrgY(p.y),g.setDeviceOrgX(y.x),g.setDeviceOrgY(y.y);for(var b=this.getAllNodes(),m,T=0;T<b.length;T++)m=b[T],m.transform(g)}}},c.prototype.positionNodesRandomly=function(p){if(p==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var g,y,b=p.getNodes(),m=0;m<b.length;m++)g=b[m],y=g.getChild(),y==null||y.getNodes().length==0?g.scatter():(this.positionNodesRandomly(y),g.updateBounds())},c.prototype.getFlatForest=function(){for(var p=[],g=!0,y=this.graphManager.getRoot().getNodes(),b=!0,m=0;m<y.length;m++)y[m].getChild()!=null&&(b=!1);if(!b)return p;var T=new Set,C=[],S=new Map,E=[];for(E=E.concat(y);E.length>0&&g;){for(C.push(E[0]);C.length>0&&g;){var x=C[0];C.splice(0,1),T.add(x);for(var w=x.getEdges(),m=0;m<w.length;m++){var D=w[m].getOtherEnd(x);if(S.get(x)!=D)if(!T.has(D))C.push(D),S.set(D,x);else{g=!1;break}}}if(!g)p=[];else{var L=[].concat(s(T));p.push(L);for(var m=0;m<L.length;m++){var A=L[m],N=E.indexOf(A);N>-1&&E.splice(N,1)}T=new Set,S=new Map}}return p},c.prototype.createDummyNodesForBendpoints=function(p){for(var g=[],y=p.source,b=this.graphManager.calcLowestCommonAncestor(p.source,p.target),m=0;m<p.bendpoints.length;m++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),b.add(T);var C=this.newEdge(null);this.graphManager.add(C,y,T),g.add(T),y=T}var C=this.newEdge(null);return this.graphManager.add(C,y,p.target),this.edgeToDummyNodes.set(p,g),p.isInterGraph()?this.graphManager.remove(p):b.remove(p),g},c.prototype.createBendpointsFromDummyNodes=function(){var p=[];p=p.concat(this.graphManager.getAllEdges()),p=[].concat(s(this.edgeToDummyNodes.keys())).concat(p);for(var g=0;g<p.length;g++){var y=p[g];if(y.bendpoints.length>0){for(var b=this.edgeToDummyNodes.get(y),m=0;m<b.length;m++){var T=b[m],C=new h(T.getCenterX(),T.getCenterY()),S=y.bendpoints.get(m);S.x=C.x,S.y=C.y,T.getOwner().remove(T)}this.graphManager.add(y,y.source,y.target)}}},c.transform=function(p,g,y,b){if(y!=null&&b!=null){var m=g;if(p<=50){var T=g/y;m-=(g-T)/50*(50-p)}else{var C=g*b;m+=(C-g)/50*(p-50)}return m}else{var S,E;return p<=50?(S=9*g/500,E=g/10):(S=9*g/50,E=-8*g),S*p+E}},c.findCenterOfTree=function(p){var g=[];g=g.concat(p);var y=[],b=new Map,m=!1,T=null;(g.length==1||g.length==2)&&(m=!0,T=g[0]);for(var C=0;C<g.length;C++){var S=g[C],E=S.getNeighborsList().size;b.set(S,S.getNeighborsList().size),E==1&&y.push(S)}var x=[];for(x=x.concat(y);!m;){var w=[];w=w.concat(x),x=[];for(var C=0;C<g.length;C++){var S=g[C],D=g.indexOf(S);D>=0&&g.splice(D,1);var L=S.getNeighborsList();L.forEach(function(O){if(y.indexOf(O)<0){var M=b.get(O),R=M-1;R==1&&x.push(O),b.set(O,R)}})}y=y.concat(x),(g.length==1||g.length==2)&&(m=!0,T=g[0])}return T},c.prototype.setGraphManager=function(p){this.graphManager=p},r.exports=c},function(r,a,n){function s(){}s.seed=1,s.x=0,s.nextDouble=function(){return s.x=Math.sin(s.seed++)*1e4,s.x-Math.floor(s.x)},r.exports=s},function(r,a,n){var s=n(4);function i(o,u){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(o){this.lworldExtX=o},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(o){this.lworldExtY=o},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},i.prototype.transformX=function(o){var u=0,l=this.lworldExtX;return l!=0&&(u=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/l),u},i.prototype.transformY=function(o){var u=0,l=this.lworldExtY;return l!=0&&(u=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/l),u},i.prototype.inverseTransformX=function(o){var u=0,l=this.ldeviceExtX;return l!=0&&(u=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/l),u},i.prototype.inverseTransformY=function(o){var u=0,l=this.ldeviceExtY;return l!=0&&(u=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/l),u},i.prototype.inverseTransformPoint=function(o){var u=new s(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return u},r.exports=i},function(r,a,n){function s(v){if(Array.isArray(v)){for(var c=0,p=Array(v.length);c<v.length;c++)p[c]=v[c];return p}else return Array.from(v)}var i=n(15),o=n(7),u=n(0),l=n(8),f=n(9);function h(){i.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.springConstant=o.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=o.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}h.prototype=Object.create(i.prototype);for(var d in i)h[d]=i[d];h.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var v,c,p,g,y,b,m=this.getGraphManager().getAllEdges(),T=0;T<m.length;T++)v=m[T],v.idealLength=this.idealEdgeLength,v.isInterGraph&&(p=v.getSource(),g=v.getTarget(),y=v.getSourceInLca().getEstimatedSize(),b=v.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(v.idealLength+=y+b-2*u.SIMPLE_NODE_SIZE),c=v.getLca().getInclusionTreeDepth(),v.idealLength+=o.DEFAULT_EDGE_LENGTH*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(p.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*c))},h.prototype.initSpringEmbedder=function(){var v=this.getAllNodes().length;this.incremental?(v>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(v-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(v>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(v-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var v=this.getAllEdges(),c,p=0;p<v.length;p++)c=v[p],this.calcSpringForce(c,c.idealLength)},h.prototype.calcRepulsionForces=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p,g,y,b,m=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&v&&this.updateGrid(),T=new Set,p=0;p<m.length;p++)y=m[p],this.calculateRepulsionForceOfANode(y,T,v,c),T.add(y);else for(p=0;p<m.length;p++)for(y=m[p],g=p+1;g<m.length;g++)b=m[g],y.getOwner()==b.getOwner()&&this.calcRepulsionForce(y,b)},h.prototype.calcGravitationalForces=function(){for(var v,c=this.getAllNodesToApplyGravitation(),p=0;p<c.length;p++)v=c[p],this.calcGravitationalForce(v)},h.prototype.moveNodes=function(){for(var v=this.getAllNodes(),c,p=0;p<v.length;p++)c=v[p],c.move()},h.prototype.calcSpringForce=function(v,c){var p=v.getSource(),g=v.getTarget(),y,b,m,T;if(this.uniformLeafNodeSizes&&p.getChild()==null&&g.getChild()==null)v.updateLengthSimple();else if(v.updateLength(),v.isOverlapingSourceAndTarget)return;y=v.getLength(),y!=0&&(b=this.springConstant*(y-c),m=b*(v.lengthX/y),T=b*(v.lengthY/y),p.springForceX+=m,p.springForceY+=T,g.springForceX-=m,g.springForceY-=T)},h.prototype.calcRepulsionForce=function(v,c){var p=v.getRect(),g=c.getRect(),y=new Array(2),b=new Array(4),m,T,C,S,E,x,w;if(p.intersects(g)){l.calcSeparationAmount(p,g,y,o.DEFAULT_EDGE_LENGTH/2),x=2*y[0],w=2*y[1];var D=v.noOfChildren*c.noOfChildren/(v.noOfChildren+c.noOfChildren);v.repulsionForceX-=D*x,v.repulsionForceY-=D*w,c.repulsionForceX+=D*x,c.repulsionForceY+=D*w}else this.uniformLeafNodeSizes&&v.getChild()==null&&c.getChild()==null?(m=g.getCenterX()-p.getCenterX(),T=g.getCenterY()-p.getCenterY()):(l.getIntersection(p,g,b),m=b[2]-b[0],T=b[3]-b[1]),Math.abs(m)<o.MIN_REPULSION_DIST&&(m=f.sign(m)*o.MIN_REPULSION_DIST),Math.abs(T)<o.MIN_REPULSION_DIST&&(T=f.sign(T)*o.MIN_REPULSION_DIST),C=m*m+T*T,S=Math.sqrt(C),E=this.repulsionConstant*v.noOfChildren*c.noOfChildren/C,x=E*m/S,w=E*T/S,v.repulsionForceX-=x,v.repulsionForceY-=w,c.repulsionForceX+=x,c.repulsionForceY+=w},h.prototype.calcGravitationalForce=function(v){var c,p,g,y,b,m,T,C;c=v.getOwner(),p=(c.getRight()+c.getLeft())/2,g=(c.getTop()+c.getBottom())/2,y=v.getCenterX()-p,b=v.getCenterY()-g,m=Math.abs(y)+v.getWidth()/2,T=Math.abs(b)+v.getHeight()/2,v.getOwner()==this.graphManager.getRoot()?(C=c.getEstimatedSize()*this.gravityRangeFactor,(m>C||T>C)&&(v.gravitationForceX=-this.gravityConstant*y,v.gravitationForceY=-this.gravityConstant*b)):(C=c.getEstimatedSize()*this.compoundGravityRangeFactor,(m>C||T>C)&&(v.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,v.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},h.prototype.isConverged=function(){var v,c=!1;return this.totalIterations>this.maxIterations/3&&(c=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),v=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,v||c},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var v,c=this.graphManager.getAllNodes(),p=0;p<c.length;p++)v=c[p],v.noOfChildren=v.getNoOfChildren()},h.prototype.calcGrid=function(v){var c=0,p=0;c=parseInt(Math.ceil((v.getRight()-v.getLeft())/this.repulsionRange)),p=parseInt(Math.ceil((v.getBottom()-v.getTop())/this.repulsionRange));for(var g=new Array(c),y=0;y<c;y++)g[y]=new Array(p);for(var y=0;y<c;y++)for(var b=0;b<p;b++)g[y][b]=new Array;return g},h.prototype.addNodeToGrid=function(v,c,p){var g=0,y=0,b=0,m=0;g=parseInt(Math.floor((v.getRect().x-c)/this.repulsionRange)),y=parseInt(Math.floor((v.getRect().width+v.getRect().x-c)/this.repulsionRange)),b=parseInt(Math.floor((v.getRect().y-p)/this.repulsionRange)),m=parseInt(Math.floor((v.getRect().height+v.getRect().y-p)/this.repulsionRange));for(var T=g;T<=y;T++)for(var C=b;C<=m;C++)this.grid[T][C].push(v),v.setGridCoordinates(g,y,b,m)},h.prototype.updateGrid=function(){var v,c,p=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),v=0;v<p.length;v++)c=p[v],this.addNodeToGrid(c,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(v,c,p,g){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p||g){var y=new Set;v.surrounding=new Array;for(var b,m=this.grid,T=v.startX-1;T<v.finishX+2;T++)for(var C=v.startY-1;C<v.finishY+2;C++)if(!(T<0||C<0||T>=m.length||C>=m[0].length)){for(var S=0;S<m[T][C].length;S++)if(b=m[T][C][S],!(v.getOwner()!=b.getOwner()||v==b)&&!c.has(b)&&!y.has(b)){var E=Math.abs(v.getCenterX()-b.getCenterX())-(v.getWidth()/2+b.getWidth()/2),x=Math.abs(v.getCenterY()-b.getCenterY())-(v.getHeight()/2+b.getHeight()/2);E<=this.repulsionRange&&x<=this.repulsionRange&&y.add(b)}}v.surrounding=[].concat(s(y))}for(T=0;T<v.surrounding.length;T++)this.calcRepulsionForce(v,v.surrounding[T])},h.prototype.calcRepulsionRange=function(){return 0},r.exports=h},function(r,a,n){var s=n(1),i=n(7);function o(l,f,h){s.call(this,l,f,h),this.idealLength=i.DEFAULT_EDGE_LENGTH}o.prototype=Object.create(s.prototype);for(var u in s)o[u]=s[u];r.exports=o},function(r,a,n){var s=n(3);function i(u,l,f,h){s.call(this,u,l,f,h),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}i.prototype=Object.create(s.prototype);for(var o in s)i[o]=s[o];i.prototype.setGridCoordinates=function(u,l,f,h){this.startX=u,this.finishX=l,this.startY=f,this.finishY=h},r.exports=i},function(r,a,n){function s(i,o){this.width=0,this.height=0,i!==null&&o!==null&&(this.height=o,this.width=i)}s.prototype.getWidth=function(){return this.width},s.prototype.setWidth=function(i){this.width=i},s.prototype.getHeight=function(){return this.height},s.prototype.setHeight=function(i){this.height=i},r.exports=s},function(r,a,n){var s=n(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(o,u){var l=s.createID(o);this.contains(l)||(this.map[l]=u,this.keys.push(o))},i.prototype.contains=function(o){return s.createID(o),this.map[o]!=null},i.prototype.get=function(o){var u=s.createID(o);return this.map[u]},i.prototype.keySet=function(){return this.keys},r.exports=i},function(r,a,n){var s=n(14);function i(){this.set={}}i.prototype.add=function(o){var u=s.createID(o);this.contains(u)||(this.set[u]=o)},i.prototype.remove=function(o){delete this.set[s.createID(o)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(o){return this.set[s.createID(o)]==o},i.prototype.isEmpty=function(){return this.size()===0},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(o){for(var u=Object.keys(this.set),l=u.length,f=0;f<l;f++)o.push(this.set[u[f]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(o){for(var u=o.length,l=0;l<u;l++){var f=o[l];this.add(f)}},r.exports=i},function(r,a,n){var s=function(){function l(f,h){for(var d=0;d<h.length;d++){var v=h[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}return function(f,h,d){return h&&l(f.prototype,h),d&&l(f,d),f}}();function i(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")}var o=n(11),u=function(){function l(f,h){i(this,l),(h!==null||h!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var d=void 0;f instanceof o?d=f.size():d=f.length,this._quicksort(f,0,d-1)}return s(l,[{key:"_quicksort",value:function(h,d,v){if(d<v){var c=this._partition(h,d,v);this._quicksort(h,d,c),this._quicksort(h,c+1,v)}}},{key:"_partition",value:function(h,d,v){for(var c=this._get(h,d),p=d,g=v;;){for(;this.compareFunction(c,this._get(h,g));)g--;for(;this.compareFunction(this._get(h,p),c);)p++;if(p<g)this._swap(h,p,g),p++,g--;else return g}}},{key:"_get",value:function(h,d){return h instanceof o?h.get_object_at(d):h[d]}},{key:"_set",value:function(h,d,v){h instanceof o?h.set_object_at(d,v):h[d]=v}},{key:"_swap",value:function(h,d,v){var c=this._get(h,d);this._set(h,d,this._get(h,v)),this._set(h,v,c)}},{key:"_defaultCompareFunction",value:function(h,d){return d>h}}]),l}();r.exports=u},function(r,a,n){var s=function(){function u(l,f){for(var h=0;h<f.length;h++){var d=f[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}return function(l,f,h){return f&&u(l.prototype,f),h&&u(l,h),l}}();function i(u,l){if(!(u instanceof l))throw new TypeError("Cannot call a class as a function")}var o=function(){function u(l,f){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,u),this.sequence1=l,this.sequence2=f,this.match_score=h,this.mismatch_penalty=d,this.gap_penalty=v,this.iMax=l.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.grid[c]=new Array(this.jMax);for(var p=0;p<this.jMax;p++)this.grid[c][p]=0}this.tracebackGrid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.tracebackGrid[g]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.tracebackGrid[g][y]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return s(u,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var h=1;h<this.iMax;h++)this.grid[h][0]=this.grid[h-1][0]+this.gap_penalty,this.tracebackGrid[h][0]=[!1,!0,!1];for(var d=1;d<this.iMax;d++)for(var v=1;v<this.jMax;v++){var c=void 0;this.sequence1[d-1]===this.sequence2[v-1]?c=this.grid[d-1][v-1]+this.match_score:c=this.grid[d-1][v-1]+this.mismatch_penalty;var p=this.grid[d-1][v]+this.gap_penalty,g=this.grid[d][v-1]+this.gap_penalty,y=[c,p,g],b=this.arrayAllMaxIndexes(y);this.grid[d][v]=y[b[0]],this.tracebackGrid[d][v]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var h=f[0],d=this.tracebackGrid[h.pos[0]][h.pos[1]];d[0]&&f.push({pos:[h.pos[0]-1,h.pos[1]-1],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),d[1]&&f.push({pos:[h.pos[0]-1,h.pos[1]],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:"-"+h.seq2}),d[2]&&f.push({pos:[h.pos[0],h.pos[1]-1],seq1:"-"+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2}),h.pos[0]===0&&h.pos[1]===0&&this.alignments.push({sequence1:h.seq1,sequence2:h.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,h){for(var d=[],v=-1;(v=f.indexOf(h,v+1))!==-1;)d.push(v);return d}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),u}();r.exports=o},function(r,a,n){var s=function(){};s.FDLayout=n(18),s.FDLayoutConstants=n(7),s.FDLayoutEdge=n(19),s.FDLayoutNode=n(20),s.DimensionD=n(21),s.HashMap=n(22),s.HashSet=n(23),s.IGeometry=n(8),s.IMath=n(9),s.Integer=n(10),s.Point=n(12),s.PointD=n(4),s.RandomSeed=n(16),s.RectangleD=n(13),s.Transform=n(17),s.UniqueIDGeneretor=n(14),s.Quicksort=n(24),s.LinkedList=n(11),s.LGraphObject=n(2),s.LGraph=n(5),s.LEdge=n(1),s.LGraphManager=n(6),s.LNode=n(3),s.Layout=n(15),s.LayoutConstants=n(0),s.NeedlemanWunsch=n(25),r.exports=s},function(r,a,n){function s(){this.listeners=[]}var i=s.prototype;i.addListener=function(o,u){this.listeners.push({event:o,callback:u})},i.removeListener=function(o,u){for(var l=this.listeners.length;l>=0;l--){var f=this.listeners[l];f.event===o&&f.callback===u&&this.listeners.splice(l,1)}},i.emit=function(o,u){for(var l=0;l<this.listeners.length;l++){var f=this.listeners[l];o===f.event&&f.callback(u)}},r.exports=s}])})}(Wn)),Wn.exports}var io;function Qp(){return io||(io=1,function(t,e){(function(a,n){t.exports=n(Zp())})(vi,function(r){return function(a){var n={};function s(i){if(n[i])return n[i].exports;var o=n[i]={i,l:!1,exports:{}};return a[i].call(o.exports,o,o.exports,s),o.l=!0,o.exports}return s.m=a,s.c=n,s.i=function(i){return i},s.d=function(i,o,u){s.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:u})},s.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return s.d(o,"a",o),o},s.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},s.p="",s(s.s=7)}([function(a,n){a.exports=r},function(a,n,s){var i=s(0).FDLayoutConstants;function o(){}for(var u in i)o[u]=i[u];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TREE_REDUCTION_ON_INCREMENTAL=!1,a.exports=o},function(a,n,s){var i=s(0).FDLayoutEdge;function o(l,f,h){i.call(this,l,f,h)}o.prototype=Object.create(i.prototype);for(var u in i)o[u]=i[u];a.exports=o},function(a,n,s){var i=s(0).LGraph;function o(l,f,h){i.call(this,l,f,h)}o.prototype=Object.create(i.prototype);for(var u in i)o[u]=i[u];a.exports=o},function(a,n,s){var i=s(0).LGraphManager;function o(l){i.call(this,l)}o.prototype=Object.create(i.prototype);for(var u in i)o[u]=i[u];a.exports=o},function(a,n,s){var i=s(0).FDLayoutNode,o=s(0).IMath;function u(f,h,d,v){i.call(this,f,h,d,v)}u.prototype=Object.create(i.prototype);for(var l in i)u[l]=i[l];u.prototype.move=function(){var f=this.graphManager.getLayout();this.displacementX=f.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=f.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>f.coolingFactor*f.maxNodeDisplacement&&(this.displacementX=f.coolingFactor*f.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>f.coolingFactor*f.maxNodeDisplacement&&(this.displacementY=f.coolingFactor*f.maxNodeDisplacement*o.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),f.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},u.prototype.propogateDisplacementToChildren=function(f,h){for(var d=this.getChild().getNodes(),v,c=0;c<d.length;c++)v=d[c],v.getChild()==null?(v.moveBy(f,h),v.displacementX+=f,v.displacementY+=h):v.propogateDisplacementToChildren(f,h)},u.prototype.setPred1=function(f){this.pred1=f},u.prototype.getPred1=function(){return pred1},u.prototype.getPred2=function(){return pred2},u.prototype.setNext=function(f){this.next=f},u.prototype.getNext=function(){return next},u.prototype.setProcessed=function(f){this.processed=f},u.prototype.isProcessed=function(){return processed},a.exports=u},function(a,n,s){var i=s(0).FDLayout,o=s(4),u=s(3),l=s(5),f=s(2),h=s(1),d=s(0).FDLayoutConstants,v=s(0).LayoutConstants,c=s(0).Point,p=s(0).PointD,g=s(0).Layout,y=s(0).Integer,b=s(0).IGeometry,m=s(0).LGraph,T=s(0).Transform;function C(){i.call(this),this.toBeTiled={}}C.prototype=Object.create(i.prototype);for(var S in i)C[S]=i[S];C.prototype.newGraphManager=function(){var E=new o(this);return this.graphManager=E,E},C.prototype.newGraph=function(E){return new u(null,this.graphManager,E)},C.prototype.newNode=function(E){return new l(this.graphManager,E)},C.prototype.newEdge=function(E){return new f(null,null,E)},C.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=d.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=d.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=d.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},C.prototype.layout=function(){var E=v.DEFAULT_CREATE_BENDS_AS_NEEDED;return E&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},C.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(A){return x.has(A)});this.graphManager.setAllNodesToApplyGravitation(w)}}else{var E=this.getFlatForest();if(E.length>0)this.positionNodesRadially(E);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(D){return x.has(D)});this.graphManager.setAllNodesToApplyGravitation(w),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.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%d.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 E=new Set(this.getAllNodes()),x=this.nodesWithGravity.filter(function(L){return E.has(L)});this.graphManager.setAllNodesToApplyGravitation(x),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.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=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var w=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(w,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var E=this.graphManager.getAllNodes(),x={},w=0;w<E.length;w++){var D=E[w].rect,L=E[w].id;x[L]={id:L,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return x},C.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var E=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!E;)E=this.tick();this.graphManager.updateBounds()}},C.prototype.calculateNodesToApplyGravitationTo=function(){var E=[],x,w=this.graphManager.getGraphs(),D=w.length,L;for(L=0;L<D;L++)x=w[L],x.updateConnected(),x.isConnected||(E=E.concat(x.getNodes()));return E},C.prototype.createBendpoints=function(){var E=[];E=E.concat(this.graphManager.getAllEdges());var x=new Set,w;for(w=0;w<E.length;w++){var D=E[w];if(!x.has(D)){var L=D.getSource(),A=D.getTarget();if(L==A)D.getBendpoints().push(new p),D.getBendpoints().push(new p),this.createDummyNodesForBendpoints(D),x.add(D);else{var N=[];if(N=N.concat(L.getEdgeListToNode(A)),N=N.concat(A.getEdgeListToNode(L)),!x.has(N[0])){if(N.length>1){var O;for(O=0;O<N.length;O++){var M=N[O];M.getBendpoints().push(new p),this.createDummyNodesForBendpoints(M)}}N.forEach(function(R){x.add(R)})}}}if(x.size==E.length)break}},C.prototype.positionNodesRadially=function(E){for(var x=new c(0,0),w=Math.ceil(Math.sqrt(E.length)),D=0,L=0,A=0,N=new p(0,0),O=0;O<E.length;O++){O%w==0&&(A=0,L=D,O!=0&&(L+=h.DEFAULT_COMPONENT_SEPERATION),D=0);var M=E[O],R=g.findCenterOfTree(M);x.x=A,x.y=L,N=C.radialLayout(M,R,x),N.y>D&&(D=Math.floor(N.y)),A=Math.floor(N.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(v.WORLD_CENTER_X-N.x/2,v.WORLD_CENTER_Y-N.y/2))},C.radialLayout=function(E,x,w){var D=Math.max(this.maxDiagonalInTree(E),h.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(x,null,0,359,0,D);var L=m.calculateBounds(E),A=new T;A.setDeviceOrgX(L.getMinX()),A.setDeviceOrgY(L.getMinY()),A.setWorldOrgX(w.x),A.setWorldOrgY(w.y);for(var N=0;N<E.length;N++){var O=E[N];O.transform(A)}var M=new p(L.getMaxX(),L.getMaxY());return A.inverseTransformPoint(M)},C.branchRadialLayout=function(E,x,w,D,L,A){var N=(D-w+1)/2;N<0&&(N+=180);var O=(N+w)%360,M=O*b.TWO_PI/360,R=L*Math.cos(M),k=L*Math.sin(M);E.setCenter(R,k);var P=[];P=P.concat(E.getEdges());var B=P.length;x!=null&&B--;for(var z=0,G=P.length,F,U=E.getEdgesBetween(x);U.length>1;){var H=U[0];U.splice(0,1);var Y=P.indexOf(H);Y>=0&&P.splice(Y,1),G--,B--}x!=null?F=(P.indexOf(U[0])+1)%G:F=0;for(var Q=Math.abs(D-w)/B,J=F;z!=B;J=++J%G){var q=P[J].getOtherEnd(E);if(q!=x){var V=(w+z*Q)%360,Z=(V+Q)%360;C.branchRadialLayout(q,E,V,Z,L+A,A),z++}}},C.maxDiagonalInTree=function(E){for(var x=y.MIN_VALUE,w=0;w<E.length;w++){var D=E[w],L=D.getDiagonal();L>x&&(x=L)}return x},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var E=this,x={};this.memberGroups={},this.idToDummyNode={};for(var w=[],D=this.graphManager.getAllNodes(),L=0;L<D.length;L++){var A=D[L],N=A.getParent();this.getNodeDegreeWithChildren(A)===0&&(N.id==null||!this.getToBeTiled(N))&&w.push(A)}for(var L=0;L<w.length;L++){var A=w[L],O=A.getParent().id;typeof x[O]>"u"&&(x[O]=[]),x[O]=x[O].concat(A)}Object.keys(x).forEach(function(M){if(x[M].length>1){var R="DummyCompound_"+M;E.memberGroups[R]=x[M];var k=x[M][0].getParent(),P=new l(E.graphManager);P.id=R,P.paddingLeft=k.paddingLeft||0,P.paddingRight=k.paddingRight||0,P.paddingBottom=k.paddingBottom||0,P.paddingTop=k.paddingTop||0,E.idToDummyNode[R]=P;var B=E.getGraphManager().add(E.newGraph(),P),z=k.getChild();z.add(P);for(var G=0;G<x[M].length;G++){var F=x[M][G];z.remove(F),B.add(F)}}})},C.prototype.clearCompounds=function(){var E={},x={};this.performDFSOnCompounds();for(var w=0;w<this.compoundOrder.length;w++)x[this.compoundOrder[w].id]=this.compoundOrder[w],E[this.compoundOrder[w].id]=[].concat(this.compoundOrder[w].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[w].getChild()),this.compoundOrder[w].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(E,x)},C.prototype.clearZeroDegreeMembers=function(){var E=this,x=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(w){var D=E.idToDummyNode[w];x[w]=E.tileNodes(E.memberGroups[w],D.paddingLeft+D.paddingRight),D.rect.width=x[w].width,D.rect.height=x[w].height})},C.prototype.repopulateCompounds=function(){for(var E=this.compoundOrder.length-1;E>=0;E--){var x=this.compoundOrder[E],w=x.id,D=x.paddingLeft,L=x.paddingTop;this.adjustLocations(this.tiledMemberPack[w],x.rect.x,x.rect.y,D,L)}},C.prototype.repopulateZeroDegreeMembers=function(){var E=this,x=this.tiledZeroDegreePack;Object.keys(x).forEach(function(w){var D=E.idToDummyNode[w],L=D.paddingLeft,A=D.paddingTop;E.adjustLocations(x[w],D.rect.x,D.rect.y,L,A)})},C.prototype.getToBeTiled=function(E){var x=E.id;if(this.toBeTiled[x]!=null)return this.toBeTiled[x];var w=E.getChild();if(w==null)return this.toBeTiled[x]=!1,!1;for(var D=w.getNodes(),L=0;L<D.length;L++){var A=D[L];if(this.getNodeDegree(A)>0)return this.toBeTiled[x]=!1,!1;if(A.getChild()==null){this.toBeTiled[A.id]=!1;continue}if(!this.getToBeTiled(A))return this.toBeTiled[x]=!1,!1}return this.toBeTiled[x]=!0,!0},C.prototype.getNodeDegree=function(E){E.id;for(var x=E.getEdges(),w=0,D=0;D<x.length;D++){var L=x[D];L.getSource().id!==L.getTarget().id&&(w=w+1)}return w},C.prototype.getNodeDegreeWithChildren=function(E){var x=this.getNodeDegree(E);if(E.getChild()==null)return x;for(var w=E.getChild().getNodes(),D=0;D<w.length;D++){var L=w[D];x+=this.getNodeDegreeWithChildren(L)}return x},C.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},C.prototype.fillCompexOrderByDFS=function(E){for(var x=0;x<E.length;x++){var w=E[x];w.getChild()!=null&&this.fillCompexOrderByDFS(w.getChild().getNodes()),this.getToBeTiled(w)&&this.compoundOrder.push(w)}},C.prototype.adjustLocations=function(E,x,w,D,L){x+=D,w+=L;for(var A=x,N=0;N<E.rows.length;N++){var O=E.rows[N];x=A;for(var M=0,R=0;R<O.length;R++){var k=O[R];k.rect.x=x,k.rect.y=w,x+=k.rect.width+E.horizontalPadding,k.rect.height>M&&(M=k.rect.height)}w+=M+E.verticalPadding}},C.prototype.tileCompoundMembers=function(E,x){var w=this;this.tiledMemberPack=[],Object.keys(E).forEach(function(D){var L=x[D];w.tiledMemberPack[D]=w.tileNodes(E[D],L.paddingLeft+L.paddingRight),L.rect.width=w.tiledMemberPack[D].width,L.rect.height=w.tiledMemberPack[D].height})},C.prototype.tileNodes=function(E,x){var w=h.TILING_PADDING_VERTICAL,D=h.TILING_PADDING_HORIZONTAL,L={rows:[],rowWidth:[],rowHeight:[],width:0,height:x,verticalPadding:w,horizontalPadding:D};E.sort(function(O,M){return O.rect.width*O.rect.height>M.rect.width*M.rect.height?-1:O.rect.width*O.rect.height<M.rect.width*M.rect.height?1:0});for(var A=0;A<E.length;A++){var N=E[A];L.rows.length==0?this.insertNodeToRow(L,N,0,x):this.canAddHorizontal(L,N.rect.width,N.rect.height)?this.insertNodeToRow(L,N,this.getShortestRowIndex(L),x):this.insertNodeToRow(L,N,L.rows.length,x),this.shiftToLastRow(L)}return L},C.prototype.insertNodeToRow=function(E,x,w,D){var L=D;if(w==E.rows.length){var A=[];E.rows.push(A),E.rowWidth.push(L),E.rowHeight.push(0)}var N=E.rowWidth[w]+x.rect.width;E.rows[w].length>0&&(N+=E.horizontalPadding),E.rowWidth[w]=N,E.width<N&&(E.width=N);var O=x.rect.height;w>0&&(O+=E.verticalPadding);var M=0;O>E.rowHeight[w]&&(M=E.rowHeight[w],E.rowHeight[w]=O,M=E.rowHeight[w]-M),E.height+=M,E.rows[w].push(x)},C.prototype.getShortestRowIndex=function(E){for(var x=-1,w=Number.MAX_VALUE,D=0;D<E.rows.length;D++)E.rowWidth[D]<w&&(x=D,w=E.rowWidth[D]);return x},C.prototype.getLongestRowIndex=function(E){for(var x=-1,w=Number.MIN_VALUE,D=0;D<E.rows.length;D++)E.rowWidth[D]>w&&(x=D,w=E.rowWidth[D]);return x},C.prototype.canAddHorizontal=function(E,x,w){var D=this.getShortestRowIndex(E);if(D<0)return!0;var L=E.rowWidth[D];if(L+E.horizontalPadding+x<=E.width)return!0;var A=0;E.rowHeight[D]<w&&D>0&&(A=w+E.verticalPadding-E.rowHeight[D]);var N;E.width-L>=x+E.horizontalPadding?N=(E.height+A)/(L+x+E.horizontalPadding):N=(E.height+A)/E.width,A=w+E.verticalPadding;var O;return E.width<x?O=(E.height+A)/x:O=(E.height+A)/E.width,O<1&&(O=1/O),N<1&&(N=1/N),N<O},C.prototype.shiftToLastRow=function(E){var x=this.getLongestRowIndex(E),w=E.rowWidth.length-1,D=E.rows[x],L=D[D.length-1],A=L.width+E.horizontalPadding;if(E.width-E.rowWidth[w]>A&&x!=w){D.splice(-1,1),E.rows[w].push(L),E.rowWidth[x]=E.rowWidth[x]-A,E.rowWidth[w]=E.rowWidth[w]+A,E.width=E.rowWidth[instance.getLongestRowIndex(E)];for(var N=Number.MIN_VALUE,O=0;O<D.length;O++)D[O].height>N&&(N=D[O].height);x>0&&(N+=E.verticalPadding);var M=E.rowHeight[x]+E.rowHeight[w];E.rowHeight[x]=N,E.rowHeight[w]<L.height+E.verticalPadding&&(E.rowHeight[w]=L.height+E.verticalPadding);var R=E.rowHeight[x]+E.rowHeight[w];E.height+=R-M,this.shiftToLastRow(E)}},C.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},C.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},C.prototype.reduceTrees=function(){for(var E=[],x=!0,w;x;){var D=this.graphManager.getAllNodes(),L=[];x=!1;for(var A=0;A<D.length;A++)w=D[A],w.getEdges().length==1&&!w.getEdges()[0].isInterGraph&&w.getChild()==null&&(L.push([w,w.getEdges()[0],w.getOwner()]),x=!0);if(x==!0){for(var N=[],O=0;O<L.length;O++)L[O][0].getEdges().length==1&&(N.push(L[O]),L[O][0].getOwner().remove(L[O][0]));E.push(N),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=E},C.prototype.growTree=function(E){for(var x=E.length,w=E[x-1],D,L=0;L<w.length;L++)D=w[L],this.findPlaceforPrunedNode(D),D[2].add(D[0]),D[2].add(D[1],D[1].source,D[1].target);E.splice(E.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},C.prototype.findPlaceforPrunedNode=function(E){var x,w,D=E[0];D==E[1].source?w=E[1].target:w=E[1].source;var L=w.startX,A=w.finishX,N=w.startY,O=w.finishY,M=0,R=0,k=0,P=0,B=[M,k,R,P];if(N>0)for(var z=L;z<=A;z++)B[0]+=this.grid[z][N-1].length+this.grid[z][N].length-1;if(A<this.grid.length-1)for(var z=N;z<=O;z++)B[1]+=this.grid[A+1][z].length+this.grid[A][z].length-1;if(O<this.grid[0].length-1)for(var z=L;z<=A;z++)B[2]+=this.grid[z][O+1].length+this.grid[z][O].length-1;if(L>0)for(var z=N;z<=O;z++)B[3]+=this.grid[L-1][z].length+this.grid[L][z].length-1;for(var G=y.MAX_VALUE,F,U,H=0;H<B.length;H++)B[H]<G?(G=B[H],F=1,U=H):B[H]==G&&F++;if(F==3&&G==0)B[0]==0&&B[1]==0&&B[2]==0?x=1:B[0]==0&&B[1]==0&&B[3]==0?x=0:B[0]==0&&B[2]==0&&B[3]==0?x=3:B[1]==0&&B[2]==0&&B[3]==0&&(x=2);else if(F==2&&G==0){var Y=Math.floor(Math.random()*2);B[0]==0&&B[1]==0?Y==0?x=0:x=1:B[0]==0&&B[2]==0?Y==0?x=0:x=2:B[0]==0&&B[3]==0?Y==0?x=0:x=3:B[1]==0&&B[2]==0?Y==0?x=1:x=2:B[1]==0&&B[3]==0?Y==0?x=1:x=3:Y==0?x=2:x=3}else if(F==4&&G==0){var Y=Math.floor(Math.random()*4);x=Y}else x=U;x==0?D.setCenter(w.getCenterX(),w.getCenterY()-w.getHeight()/2-d.DEFAULT_EDGE_LENGTH-D.getHeight()/2):x==1?D.setCenter(w.getCenterX()+w.getWidth()/2+d.DEFAULT_EDGE_LENGTH+D.getWidth()/2,w.getCenterY()):x==2?D.setCenter(w.getCenterX(),w.getCenterY()+w.getHeight()/2+d.DEFAULT_EDGE_LENGTH+D.getHeight()/2):D.setCenter(w.getCenterX()-w.getWidth()/2-d.DEFAULT_EDGE_LENGTH-D.getWidth()/2,w.getCenterY())},a.exports=C},function(a,n,s){var i={};i.layoutBase=s(0),i.CoSEConstants=s(1),i.CoSEEdge=s(2),i.CoSEGraph=s(3),i.CoSEGraphManager=s(4),i.CoSELayout=s(6),i.CoSENode=s(5),a.exports=i}])})}(qn)),qn.exports}(function(t,e){(function(a,n){t.exports=n(Qp())})(vi,function(r){return function(a){var n={};function s(i){if(n[i])return n[i].exports;var o=n[i]={i,l:!1,exports:{}};return a[i].call(o.exports,o,o.exports,s),o.l=!0,o.exports}return s.m=a,s.c=n,s.i=function(i){return i},s.d=function(i,o,u){s.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:u})},s.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return s.d(o,"a",o),o},s.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},s.p="",s(s.s=1)}([function(a,n){a.exports=r},function(a,n,s){var i=s(0).layoutBase.LayoutConstants,o=s(0).layoutBase.FDLayoutConstants,u=s(0).CoSEConstants,l=s(0).CoSELayout,f=s(0).CoSENode,h=s(0).layoutBase.PointD,d=s(0).layoutBase.DimensionD,v={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(b,m){var T={};for(var C in b)T[C]=b[C];for(var C in m)T[C]=m[C];return T}function p(b){this.options=c(v,b),g(this.options)}var g=function(m){m.nodeRepulsion!=null&&(u.DEFAULT_REPULSION_STRENGTH=o.DEFAULT_REPULSION_STRENGTH=m.nodeRepulsion),m.idealEdgeLength!=null&&(u.DEFAULT_EDGE_LENGTH=o.DEFAULT_EDGE_LENGTH=m.idealEdgeLength),m.edgeElasticity!=null&&(u.DEFAULT_SPRING_STRENGTH=o.DEFAULT_SPRING_STRENGTH=m.edgeElasticity),m.nestingFactor!=null&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=m.nestingFactor),m.gravity!=null&&(u.DEFAULT_GRAVITY_STRENGTH=o.DEFAULT_GRAVITY_STRENGTH=m.gravity),m.numIter!=null&&(u.MAX_ITERATIONS=o.MAX_ITERATIONS=m.numIter),m.gravityRange!=null&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=o.DEFAULT_GRAVITY_RANGE_FACTOR=m.gravityRange),m.gravityCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=m.gravityCompound),m.gravityRangeCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=m.gravityRangeCompound),m.initialEnergyOnIncremental!=null&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.DEFAULT_COOLING_FACTOR_INCREMENTAL=m.initialEnergyOnIncremental),m.quality=="draft"?i.QUALITY=0:m.quality=="proof"?i.QUALITY=2:i.QUALITY=1,u.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=m.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!m.randomize,u.ANIMATE=o.ANIMATE=i.ANIMATE=m.animate,u.TILE=m.tile,u.TILING_PADDING_VERTICAL=typeof m.tilingPaddingVertical=="function"?m.tilingPaddingVertical.call():m.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL=typeof m.tilingPaddingHorizontal=="function"?m.tilingPaddingHorizontal.call():m.tilingPaddingHorizontal};p.prototype.run=function(){var b,m,T=this.options;this.idToLNode={};var C=this.layout=new l,S=this;S.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var E=C.newGraphManager();this.gm=E;var x=this.options.eles.nodes(),w=this.options.eles.edges();this.root=E.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(x),C);for(var D=0;D<w.length;D++){var L=w[D],A=this.idToLNode[L.data("source")],N=this.idToLNode[L.data("target")];if(A!==N&&A.getEdgesBetween(N).length==0){var O=E.add(C.newEdge(),A,N);O.id=L.id()}}var M=function(P,B){typeof P=="number"&&(P=B);var z=P.data("id"),G=S.idToLNode[z];return{x:G.getRect().getCenterX(),y:G.getRect().getCenterY()}},R=function k(){for(var P=function(){T.fit&&T.cy.fit(T.eles,T.padding),b||(b=!0,S.cy.one("layoutready",T.ready),S.cy.trigger({type:"layoutready",layout:S}))},B=S.options.refresh,z,G=0;G<B&&!z;G++)z=S.stopped||S.layout.tick();if(z){C.checkLayoutSuccess()&&!C.isSubLayout&&C.doPostLayout(),C.tilingPostLayout&&C.tilingPostLayout(),C.isLayoutFinished=!0,S.options.eles.nodes().positions(M),P(),S.cy.one("layoutstop",S.options.stop),S.cy.trigger({type:"layoutstop",layout:S}),m&&cancelAnimationFrame(m),b=!1;return}var F=S.layout.getPositionsData();T.eles.nodes().positions(function(U,H){if(typeof U=="number"&&(U=H),!U.isParent()){for(var Y=U.id(),Q=F[Y],J=U;Q==null&&(Q=F[J.data("parent")]||F["DummyCompound_"+J.data("parent")],F[Y]=Q,J=J.parent()[0],J!=null););return Q!=null?{x:Q.x,y:Q.y}:{x:U.position("x"),y:U.position("y")}}}),P(),m=requestAnimationFrame(k)};return C.addListener("layoutstarted",function(){S.options.animate==="during"&&(m=requestAnimationFrame(R))}),C.runLayout(),this.options.animate!=="during"&&(S.options.eles.nodes().not(":parent").layoutPositions(S,S.options,M),b=!1),this},p.prototype.getTopMostNodes=function(b){for(var m={},T=0;T<b.length;T++)m[b[T].id()]=!0;var C=b.filter(function(S,E){typeof S=="number"&&(S=E);for(var x=S.parent()[0];x!=null;){if(m[x.id()])return!1;x=x.parent()[0]}return!0});return C},p.prototype.processChildrenList=function(b,m,T){for(var C=m.length,S=0;S<C;S++){var E=m[S],x=E.children(),w,D=E.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(E.outerWidth()!=null&&E.outerHeight()!=null?w=b.add(new f(T.graphManager,new h(E.position("x")-D.w/2,E.position("y")-D.h/2),new d(parseFloat(D.w),parseFloat(D.h)))):w=b.add(new f(this.graphManager)),w.id=E.data("id"),w.paddingLeft=parseInt(E.css("padding")),w.paddingTop=parseInt(E.css("padding")),w.paddingRight=parseInt(E.css("padding")),w.paddingBottom=parseInt(E.css("padding")),this.options.nodeDimensionsIncludeLabels&&E.isParent()){var L=E.boundingBox({includeLabels:!0,includeNodes:!1}).w,A=E.boundingBox({includeLabels:!0,includeNodes:!1}).h,N=E.css("text-halign");w.labelWidth=L,w.labelHeight=A,w.labelPos=N}if(this.idToLNode[E.data("id")]=w,isNaN(w.rect.x)&&(w.rect.x=0),isNaN(w.rect.y)&&(w.rect.y=0),x!=null&&x.length>0){var O;O=T.getGraphManager().add(T.newGraph(),w),this.processChildrenList(O,x,T)}}},p.prototype.stop=function(){return this.stopped=!0,this};var y=function(m){m("layout","cose-bilkent",p)};typeof cytoscape<"u"&&y(cytoscape),a.exports=y}])})})(Xu);var Jp=Xu.exports;const jp=ol(Jp);var hi=function(){var t=de(function(T,C,S,E){for(S=S||{},E=T.length;E--;S[T[E]]=C);return S},"o"),e=[1,4],r=[1,13],a=[1,12],n=[1,15],s=[1,16],i=[1,20],o=[1,19],u=[6,7,8],l=[1,26],f=[1,24],h=[1,25],d=[6,7,11],v=[1,6,13,15,16,19,22],c=[1,33],p=[1,34],g=[1,6,7,11,13,15,16,19,22],y={trace:de(function(){},"trace"),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:de(function(C,S,E,x,w,D,L){var A=D.length-1;switch(w){case 6:case 7:return x;case 8:x.getLogger().trace("Stop NL ");break;case 9:x.getLogger().trace("Stop EOF ");break;case 11:x.getLogger().trace("Stop NL2 ");break;case 12:x.getLogger().trace("Stop EOF2 ");break;case 15:x.getLogger().info("Node: ",D[A].id),x.addNode(D[A-1].length,D[A].id,D[A].descr,D[A].type);break;case 16:x.getLogger().trace("Icon: ",D[A]),x.decorateNode({icon:D[A]});break;case 17:case 21:x.decorateNode({class:D[A]});break;case 18:x.getLogger().trace("SPACELIST");break;case 19:x.getLogger().trace("Node: ",D[A].id),x.addNode(0,D[A].id,D[A].descr,D[A].type);break;case 20:x.decorateNode({icon:D[A]});break;case 25:x.getLogger().trace("node found ..",D[A-2]),this.$={id:D[A-1],descr:D[A-1],type:x.getType(D[A-2],D[A])};break;case 26:this.$={id:D[A],descr:D[A],type:x.nodeType.DEFAULT};break;case 27:x.getLogger().trace("node found ..",D[A-3]),this.$={id:D[A-3],descr:D[A-1],type:x.getType(D[A-2],D[A])};break}},"anonymous"),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:s,17:17,18:18,19:i,22:o},t(u,[2,3]),{1:[2,2]},t(u,[2,4]),t(u,[2,5]),{1:[2,6],6:r,12:21,13:a,14:14,15:n,16:s,17:17,18:18,19:i,22:o},{6:r,9:22,12:11,13:a,14:14,15:n,16:s,17:17,18:18,19:i,22:o},{6:l,7:f,10:23,11:h},t(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:i,22:o}),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,23]),t(d,[2,24]),t(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:l,7:f,10:32,11:h},{1:[2,7],6:r,12:21,13:a,14:14,15:n,16:s,17:17,18:18,19:i,22:o},t(v,[2,14],{7:c,11:p}),t(g,[2,8]),t(g,[2,9]),t(g,[2,10]),t(d,[2,15]),t(d,[2,16]),t(d,[2,17]),{20:[1,35]},{21:[1,36]},t(v,[2,13],{7:c,11:p}),t(g,[2,11]),t(g,[2,12]),{21:[1,37]},t(d,[2,25]),t(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:de(function(C,S){if(S.recoverable)this.trace(C);else{var E=new Error(C);throw E.hash=S,E}},"parseError"),parse:de(function(C){var S=this,E=[0],x=[],w=[null],D=[],L=this.table,A="",N=0,O=0,M=2,R=1,k=D.slice.call(arguments,1),P=Object.create(this.lexer),B={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(B.yy[z]=this.yy[z]);P.setInput(C,B.yy),B.yy.lexer=P,B.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var G=P.yylloc;D.push(G);var F=P.options&&P.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function U(te){E.length=E.length-2*te,w.length=w.length-te,D.length=D.length-te}de(U,"popStack");function H(){var te;return te=x.pop()||P.lex()||R,typeof te!="number"&&(te instanceof Array&&(x=te,te=x.pop()),te=S.symbols_[te]||te),te}de(H,"lex");for(var Y,Q,J,q,V={},Z,K,ie,ve;;){if(Q=E[E.length-1],this.defaultActions[Q]?J=this.defaultActions[Q]:((Y===null||typeof Y>"u")&&(Y=H()),J=L[Q]&&L[Q][Y]),typeof J>"u"||!J.length||!J[0]){var ae="";ve=[];for(Z in L[Q])this.terminals_[Z]&&Z>M&&ve.push("'"+this.terminals_[Z]+"'");P.showPosition?ae="Parse error on line "+(N+1)+`:
|
||
`+P.showPosition()+`
|
||
Expecting `+ve.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ae="Parse error on line "+(N+1)+": Unexpected "+(Y==R?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(ae,{text:P.match,token:this.terminals_[Y]||Y,line:P.yylineno,loc:G,expected:ve})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+Y);switch(J[0]){case 1:E.push(Y),w.push(P.yytext),D.push(P.yylloc),E.push(J[1]),Y=null,O=P.yyleng,A=P.yytext,N=P.yylineno,G=P.yylloc;break;case 2:if(K=this.productions_[J[1]][1],V.$=w[w.length-K],V._$={first_line:D[D.length-(K||1)].first_line,last_line:D[D.length-1].last_line,first_column:D[D.length-(K||1)].first_column,last_column:D[D.length-1].last_column},F&&(V._$.range=[D[D.length-(K||1)].range[0],D[D.length-1].range[1]]),q=this.performAction.apply(V,[A,O,N,B.yy,J[1],w,D].concat(k)),typeof q<"u")return q;K&&(E=E.slice(0,-1*K*2),w=w.slice(0,-1*K),D=D.slice(0,-1*K)),E.push(this.productions_[J[1]][0]),w.push(V.$),D.push(V._$),ie=L[E[E.length-2]][E[E.length-1]],E.push(ie);break;case 3:return!0}}return!0},"parse")},b=function(){var T={EOF:1,parseError:de(function(S,E){if(this.yy.parser)this.yy.parser.parseError(S,E);else throw new Error(S)},"parseError"),setInput:de(function(C,S){return this.yy=S||this.yy||{},this._input=C,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},"setInput"),input:de(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var S=C.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:de(function(C){var S=C.length,E=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var x=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 w=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===x.length?this.yylloc.first_column:0)+x[x.length-E.length].length-E[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:de(function(){return this._more=!0,this},"more"),reject:de(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},"reject"),less:de(function(C){this.unput(this.match.slice(C))},"less"),pastInput:de(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:de(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:de(function(){var C=this.pastInput(),S=new Array(C.length+1).join("-");return C+this.upcomingInput()+`
|
||
`+S+"^"},"showPosition"),test_match:de(function(C,S){var E,x,w;if(this.options.backtrack_lexer&&(w={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&&(w.yylloc.range=this.yylloc.range.slice(0))),x=C[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,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(C[0].length),this.matched+=C[0],E=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var D in w)this[D]=w[D];return!1}return!1},"test_match"),next:de(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,S,E,x;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),D=0;D<w.length;D++)if(E=this._input.match(this.rules[w[D]]),E&&(!S||E[0].length>S[0].length)){if(S=E,x=D,this.options.backtrack_lexer){if(C=this.test_match(E,w[D]),C!==!1)return C;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(C=this.test_match(S,w[x]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
||
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:de(function(){var S=this.next();return S||this.lex()},"lex"),begin:de(function(S){this.conditionStack.push(S)},"begin"),popState:de(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:de(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:de(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:de(function(S){this.begin(S)},"pushState"),stateStackSize:de(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:de(function(S,E,x,w){switch(x){case 0:return S.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:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.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:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",E.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",E.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",E.yytext),20;case 36:return S.getLogger().trace("Long description:",E.yytext),20}},"anonymous"),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 T}();y.lexer=b;function m(){this.yy={}}return de(m,"Parser"),m.prototype=y,y.Parser=m,new m}();hi.parser=hi;var ey=hi,It=[],qu=0,Gi={},ty=de(()=>{It=[],qu=0,Gi={}},"clear"),ry=de(function(t){for(let e=It.length-1;e>=0;e--)if(It[e].level<t)return It[e];return null},"getParent"),ay=de(()=>It.length>0?It[0]:null,"getMindmap"),ny=de((t,e,r,a)=>{var u,l;wr.info("addNode",t,e,r,a);const n=ci();let s=((u=n.mindmap)==null?void 0:u.padding)??en.mindmap.padding;switch(a){case He.ROUNDED_RECT:case He.RECT:case He.HEXAGON:s*=2}const i={id:qu++,nodeId:tn(e,n),level:t,descr:tn(r,n),type:a,children:[],width:((l=n.mindmap)==null?void 0:l.maxNodeWidth)??en.mindmap.maxNodeWidth,padding:s},o=ry(t);if(o)o.children.push(i),It.push(i);else if(It.length===0)It.push(i);else throw new Error('There can be only one root. No parent could be found for ("'+i.descr+'")')},"addNode"),He={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},iy=de((t,e)=>{switch(wr.debug("In get type",t,e),t){case"[":return He.RECT;case"(":return e===")"?He.ROUNDED_RECT:He.CLOUD;case"((":return He.CIRCLE;case")":return He.CLOUD;case"))":return He.BANG;case"{{":return He.HEXAGON;default:return He.DEFAULT}},"getType"),sy=de((t,e)=>{Gi[t]=e},"setElementForId"),oy=de(t=>{if(!t)return;const e=ci(),r=It[It.length-1];t.icon&&(r.icon=tn(t.icon,e)),t.class&&(r.class=tn(t.class,e))},"decorateNode"),uy=de(t=>{switch(t){case He.DEFAULT:return"no-border";case He.RECT:return"rect";case He.ROUNDED_RECT:return"rounded-rect";case He.CIRCLE:return"circle";case He.CLOUD:return"cloud";case He.BANG:return"bang";case He.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),ly=de(()=>wr,"getLogger"),fy=de(t=>Gi[t],"getElementById"),hy={clear:ty,addNode:ny,getMindmap:ay,nodeType:He,getType:iy,setElementForId:sy,decorateNode:oy,type2Str:uy,getLogger:ly,getElementById:fy},vy=hy,cy=12,dy=de(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)},"defaultBkg"),gy=de(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)},"rectBkg"),py=de(function(t,e,r){const a=r.width,n=r.height,s=.15*a,i=.25*a,o=.35*a,u=.2*a;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${s},${s} 0 0,1 ${a*.25},${-1*a*.1}
|
||
a${o},${o} 1 0,1 ${a*.4},${-1*a*.1}
|
||
a${i},${i} 1 0,1 ${a*.35},${1*a*.2}
|
||
|
||
a${s},${s} 1 0,1 ${a*.15},${1*n*.35}
|
||
a${u},${u} 1 0,1 ${-1*a*.15},${1*n*.65}
|
||
|
||
a${i},${s} 1 0,1 ${-1*a*.25},${a*.15}
|
||
a${o},${o} 1 0,1 ${-1*a*.5},0
|
||
a${s},${s} 1 0,1 ${-1*a*.25},${-1*a*.15}
|
||
|
||
a${s},${s} 1 0,1 ${-1*a*.1},${-1*n*.35}
|
||
a${u},${u} 1 0,1 ${a*.1},${-1*n*.65}
|
||
|
||
H0 V0 Z`)},"cloudBkg"),yy=de(function(t,e,r){const a=r.width,n=r.height,s=.15*a;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${s},${s} 1 0,0 ${a*.25},${-1*n*.1}
|
||
a${s},${s} 1 0,0 ${a*.25},0
|
||
a${s},${s} 1 0,0 ${a*.25},0
|
||
a${s},${s} 1 0,0 ${a*.25},${1*n*.1}
|
||
|
||
a${s},${s} 1 0,0 ${a*.15},${1*n*.33}
|
||
a${s*.8},${s*.8} 1 0,0 0,${1*n*.34}
|
||
a${s},${s} 1 0,0 ${-1*a*.15},${1*n*.33}
|
||
|
||
a${s},${s} 1 0,0 ${-1*a*.25},${n*.15}
|
||
a${s},${s} 1 0,0 ${-1*a*.25},0
|
||
a${s},${s} 1 0,0 ${-1*a*.25},0
|
||
a${s},${s} 1 0,0 ${-1*a*.25},${-1*n*.15}
|
||
|
||
a${s},${s} 1 0,0 ${-1*a*.1},${-1*n*.33}
|
||
a${s*.8},${s*.8} 1 0,0 0,${-1*n*.34}
|
||
a${s},${s} 1 0,0 ${a*.1},${-1*n*.33}
|
||
|
||
H0 V0 Z`)},"bangBkg"),my=de(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)},"circleBkg");function Wu(t,e,r,a,n){return t.insert("polygon",":first-child").attr("points",a.map(function(s){return s.x+","+s.y}).join(" ")).attr("transform","translate("+(n.width-e)/2+", "+r+")")}de(Wu,"insertPolygonShape");var by=de(function(t,e,r){const a=r.height,s=a/4,i=r.width-r.padding+2*s,o=[{x:s,y:0},{x:i-s,y:0},{x:i,y:-a/2},{x:i-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}];Wu(e,i,a,o,r)},"hexagonBkg"),Ey=de(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)},"roundedRectBkg"),wy=de(async function(t,e,r,a,n){const s=n.htmlLabels,i=a%(cy-1),o=e.append("g");r.section=i;let u="section-"+i;i<0&&(u+=" section-root"),o.attr("class",(r.class?r.class+" ":"")+"mindmap-node "+u);const l=o.append("g"),f=o.append("g"),h=r.descr.replace(/(<br\/*>)/g,`
|
||
`);await ll(f,h,{useHtmlLabels:s,width:r.width,classes:"mindmap-node-label"},n),s||f.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const d=f.node().getBBox(),[v]=fl(n.fontSize);if(r.height=d.height+v*1.1*.5+r.padding,r.width=d.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-"+i+" "+r.icon),f.attr("transform","translate("+r.width/2+", "+(r.height/2-1.5*r.padding)+")");else{r.width+=50;const c=r.height;r.height=Math.max(c,60);const p=Math.abs(r.height-c);o.append("foreignObject").attr("width","60px").attr("height",r.height).attr("style","text-align: center;margin-top:"+p/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+i+" "+r.icon),f.attr("transform","translate("+(25+r.width/2)+", "+(p/2+r.padding/2)+")")}else if(s){const c=(r.width-d.width)/2,p=(r.height-d.height)/2;f.attr("transform","translate("+c+", "+p+")")}else{const c=r.width/2,p=r.padding/2;f.attr("transform","translate("+c+", "+p+")")}switch(r.type){case t.nodeType.DEFAULT:dy(t,l,r,i);break;case t.nodeType.ROUNDED_RECT:Ey(t,l,r,i);break;case t.nodeType.RECT:gy(t,l,r,i);break;case t.nodeType.CIRCLE:l.attr("transform","translate("+r.width/2+", "+ +r.height/2+")"),my(t,l,r,i);break;case t.nodeType.CLOUD:py(t,l,r,i);break;case t.nodeType.BANG:yy(t,l,r,i);break;case t.nodeType.HEXAGON:by(t,l,r,i);break}return t.setElementForId(r.id,o),r.height},"drawNode"),xy=de(function(t,e){const r=t.getElementById(e.id),a=e.x||0,n=e.y||0;r.attr("transform","translate("+a+","+n+")")},"positionNode");ir.use(jp);async function zi(t,e,r,a,n){await wy(t,e,r,a,n),r.children&&await Promise.all(r.children.map((s,i)=>zi(t,e,s,a<0?i:a,n)))}de(zi,"drawNodes");function Ku(t,e){e.edges().map((r,a)=>{const n=r.data();if(r[0]._private.bodyBounds){const s=r[0]._private.rscratch;wr.trace("Edge: ",a,n),t.insert("path").attr("d",`M ${s.startX},${s.startY} L ${s.midX},${s.midY} L${s.endX},${s.endY} `).attr("class","edge section-edge-"+n.section+" edge-depth-"+n.depth)}})}de(Ku,"drawEdges");function Vi(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=>{Vi(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}})})}de(Vi,"addNodes");function Zu(t,e){return new Promise(r=>{const a=ul("body").append("div").attr("id","cy").attr("style","display:none"),n=ir({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});a.remove(),Vi(t,n,e,0),n.nodes().forEach(function(s){s.layoutDimensions=()=>{const i=s.data();return{w:i.width,h:i.height}}}),n.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),n.ready(s=>{wr.info("Ready",s),r(n)})})}de(Zu,"layoutMindmap");function Qu(t,e){e.nodes().map((r,a)=>{const n=r.data();n.x=r.position().x,n.y=r.position().y,xy(t,n);const s=t.getElementById(n.nodeId);wr.info("Id:",a,"Position: (",r.position().x,", ",r.position().y,")",n),s.attr("transform",`translate(${r.position().x-n.width/2}, ${r.position().y-n.height/2})`),s.attr("attr",`apa-${a})`)})}de(Qu,"positionNodes");var Ty=de(async(t,e,r,a)=>{var h,d;wr.debug(`Rendering mindmap diagram
|
||
`+t);const n=a.db,s=n.getMindmap();if(!s)return;const i=ci();i.htmlLabels=!1;const o=hl(e),u=o.append("g");u.attr("class","mindmap-edges");const l=o.append("g");l.attr("class","mindmap-nodes"),await zi(n,l,s,-1,i);const f=await Zu(s,i);Ku(u,f),Qu(n,f),vl(void 0,o,((h=i.mindmap)==null?void 0:h.padding)??en.mindmap.padding,((d=i.mindmap)==null?void 0:d.useMaxWidth)??en.mindmap.useMaxWidth)},"draw"),Cy={draw:Ty},Dy=de(t=>{let e="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++)t["lineColor"+r]=t["lineColor"+r]||t["cScaleInv"+r],cl(t["lineColor"+r])?t["lineColor"+r]=dl(t["lineColor"+r],20):t["lineColor"+r]=gl(t["lineColor"+r],20);for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const a=""+(17-3*r);e+=`
|
||
.section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} polygon, .section-${r-1} path {
|
||
fill: ${t["cScale"+r]};
|
||
}
|
||
.section-${r-1} text {
|
||
fill: ${t["cScaleLabel"+r]};
|
||
}
|
||
.node-icon-${r-1} {
|
||
font-size: 40px;
|
||
color: ${t["cScaleLabel"+r]};
|
||
}
|
||
.section-edge-${r-1}{
|
||
stroke: ${t["cScale"+r]};
|
||
}
|
||
.edge-depth-${r-1}{
|
||
stroke-width: ${a};
|
||
}
|
||
.section-${r-1} line {
|
||
stroke: ${t["cScaleInv"+r]} ;
|
||
stroke-width: 3;
|
||
}
|
||
|
||
.disabled, .disabled circle, .disabled text {
|
||
fill: lightgray;
|
||
}
|
||
.disabled text {
|
||
fill: #efefef;
|
||
}
|
||
`}return e},"genSections"),Sy=de(t=>`
|
||
.edge {
|
||
stroke-width: 3;
|
||
}
|
||
${Dy(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;
|
||
}
|
||
`,"getStyles"),Ly=Sy,Oy={db:vy,renderer:Cy,parser:ey,styles:Ly};export{Oy as diagram};
|