md/assets/mindmap-definition-6NGNQFMS-DPBfZ7Jl.js
2024-08-28 04:50:22 +00:00

111 lines
469 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{aI as Hi,aJ as hi,aK as lu,_ as de,l as wr,j as uu,U as vu,L as fu,d as ci,E as hu,O as cu,z as en,i as tn,$ as du,a0 as gu,a1 as pu}from"./index-tOBB4d1H.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 yu(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&&yu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ls(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 mu(t)||bu(t,e)||us(t,e)||Eu()}function mu(t){if(Array.isArray(t))return t}function bu(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a=[],n=!0,o=!1,i,s;try{for(r=r.call(t);!(n=(i=r.next()).done)&&(a.push(i.value),!(e&&a.length===e));n=!0);}catch(l){o=!0,s=l}finally{try{!n&&r.return!=null&&r.return()}finally{if(o)throw s}}return a}}function us(t,e){if(t){if(typeof t=="string")return Xi(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 Xi(t,e)}}function Xi(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 Eu(){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 vs(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=us(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(l){throw l},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 o=!0,i=!1,s;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){i=!0,s=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(i)throw s}}}}var Ye=typeof window>"u"?null:window,qi=Ye?Ye.navigator:null;Ye&&Ye.document;var wu=qe(""),fs=qe({}),xu=qe(function(){}),Tu=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)==wu},ze=function(e){return e!=null&&qe(e)===xu},ke=function(e){return!yt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},De=function(e){return e!=null&&qe(e)===fs&&!ke(e)&&e.constructor===Object},Cu=function(e){return e!=null&&qe(e)===fs},oe=function(e){return e!=null&&qe(e)===qe(1)&&!isNaN(e)},Du=function(e){return oe(e)&&Math.floor(e)===e},rn=function(e){if(Tu!=="undefined")return e!=null&&e instanceof HTMLElement},yt=function(e){return Ca(e)||hs(e)},Ca=function(e){return Ta(e)==="collection"&&e._private.single},hs=function(e){return Ta(e)==="collection"&&!e._private.single},pi=function(e){return Ta(e)==="core"},cs=function(e){return Ta(e)==="stylesheet"},Su=function(e){return Ta(e)==="event"},er=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Lu=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Au=function(e){return De(e)&&oe(e.x1)&&oe(e.x2)&&oe(e.y1)&&oe(e.y2)},Ou=function(e){return Cu(e)&&ze(e.then)},Nu=function(){return qi&&qi.userAgent.match(/msie|trident|edge/i)},ha=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);return o.join("$")});var a=function n(){var o=this,i=arguments,s,l=r.apply(o,i),u=n.cache;return(s=u[l])||(s=u[l]=e.apply(o,i)),s};return a.cache={},a},yi=ha(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),dn=ha(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),ds=ha(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Wi=function(e){return er(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Xe="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Iu="rgb[a]?\\(("+Xe+"[%]?)\\s*,\\s*("+Xe+"[%]?)\\s*,\\s*("+Xe+"[%]?)(?:\\s*,\\s*("+Xe+"))?\\)",Mu="rgb[a]?\\((?:"+Xe+"[%]?)\\s*,\\s*(?:"+Xe+"[%]?)\\s*,\\s*(?:"+Xe+"[%]?)(?:\\s*,\\s*(?:"+Xe+"))?\\)",Ru="hsl[a]?\\(("+Xe+")\\s*,\\s*("+Xe+"[%])\\s*,\\s*("+Xe+"[%])(?:\\s*,\\s*("+Xe+"))?\\)",ku="hsl[a]?\\((?:"+Xe+")\\s*,\\s*(?:"+Xe+"[%])\\s*,\\s*(?:"+Xe+"[%])(?:\\s*,\\s*(?:"+Xe+"))?\\)",Pu="\\#[0-9a-fA-F]{3}",Bu="\\#[0-9a-fA-F]{6}",gs=function(e,r){return e<r?-1:e>r?1:0},Fu=function(e,r){return-1*gs(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),o=0;o<n.length;o++){var i=n[o];t[i]=a[i]}}return t},Gu=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,o,i=16;return r?(a=parseInt(e[1]+e[1],i),n=parseInt(e[2]+e[2],i),o=parseInt(e[3]+e[3],i)):(a=parseInt(e[1]+e[2],i),n=parseInt(e[3]+e[4],i),o=parseInt(e[5]+e[6],i)),[a,n,o]}},zu=function(e){var r,a,n,o,i,s,l,u;function v(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 f=new RegExp("^"+Ru+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,o=parseFloat(f[3]),o<0||o>100)||(o=o/100,i=f[4],i!==void 0&&(i=parseFloat(i),i<0||i>1)))return;if(n===0)s=l=u=Math.round(o*255);else{var d=o<.5?o*(1+n):o+n-o*n,h=2*o-d;s=Math.round(255*v(h,d,a+1/3)),l=Math.round(255*v(h,d,a)),u=Math.round(255*v(h,d,a-1/3))}r=[s,l,u,i]}return r},Vu=function(e){var r,a=new RegExp("^"+Iu+"$").exec(e);if(a){r=[];for(var n=[],o=1;o<=3;o++){var i=a[o];if(i[i.length-1]==="%"&&(n[o]=!0),i=parseFloat(i),n[o]&&(i=i/100*255),i<0||i>255)return;r.push(Math.floor(i))}var s=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(s&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},Uu=function(e){return _u[e.toLowerCase()]},$u=function(e){return(ke(e)?e:null)||Uu(e)||Gu(e)||Vu(e)||zu(e)},_u={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]},ps=function(e){for(var r=e.map,a=e.keys,n=a.length,o=0;o<n;o++){var i=a[o];if(De(i))throw Error("Tried to set map with object key");o<a.length-1?(r[i]==null&&(r[i]={}),r=r[i]):r[i]=e.value}},ys=function(e){for(var r=e.map,a=e.keys,n=a.length,o=0;o<n;o++){var i=a[o];if(De(i))throw Error("Tried to get map with object key");if(r=r[i],r==null)return r}return r};function Yu(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var dr=Yu,ia=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Hi<"u"?Hi:typeof self<"u"?self:{};function Hu(t,e){return e={exports:{}},t(e,e.exports),e.exports}var Xu=typeof ia=="object"&&ia&&ia.Object===Object&&ia,qu=Xu,Wu=typeof self=="object"&&self&&self.Object===Object&&self,Ku=qu||Wu||Function("return this")(),gn=Ku,Zu=function(){return gn.Date.now()},kn=Zu,Qu=/\s/;function Ju(t){for(var e=t.length;e--&&Qu.test(t.charAt(e)););return e}var ju=Ju,ev=/^\s+/;function tv(t){return t&&t.slice(0,ju(t)+1).replace(ev,"")}var rv=tv,av=gn.Symbol,Gr=av,ms=Object.prototype,nv=ms.hasOwnProperty,iv=ms.toString,ea=Gr?Gr.toStringTag:void 0;function ov(t){var e=nv.call(t,ea),r=t[ea];try{t[ea]=void 0;var a=!0}catch{}var n=iv.call(t);return a&&(e?t[ea]=r:delete t[ea]),n}var sv=ov,lv=Object.prototype,uv=lv.toString;function vv(t){return uv.call(t)}var fv=vv,hv="[object Null]",cv="[object Undefined]",Ki=Gr?Gr.toStringTag:void 0;function dv(t){return t==null?t===void 0?cv:hv:Ki&&Ki in Object(t)?sv(t):fv(t)}var bs=dv;function gv(t){return t!=null&&typeof t=="object"}var pv=gv,yv="[object Symbol]";function mv(t){return typeof t=="symbol"||pv(t)&&bs(t)==yv}var Da=mv,Zi=NaN,bv=/^[-+]0x[0-9a-f]+$/i,Ev=/^0b[01]+$/i,wv=/^0o[0-7]+$/i,xv=parseInt;function Tv(t){if(typeof t=="number")return t;if(Da(t))return Zi;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=rv(t);var r=Ev.test(t);return r||wv.test(t)?xv(t.slice(2),r?2:8):bv.test(t)?Zi:+t}var Qi=Tv,Cv="Expected a function",Dv=Math.max,Sv=Math.min;function Lv(t,e,r){var a,n,o,i,s,l,u=0,v=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(Cv);e=Qi(e)||0,dr(r)&&(v=!!r.leading,f="maxWait"in r,o=f?Dv(Qi(r.maxWait)||0,e):o,d="trailing"in r?!!r.trailing:d);function h(S){var E=a,x=n;return a=n=void 0,u=S,i=t.apply(x,E),i}function c(S){return u=S,s=setTimeout(y,e),v?h(S):i}function p(S){var E=S-l,x=S-u,w=e-E;return f?Sv(w,o-x):w}function g(S){var E=S-l,x=S-u;return l===void 0||E>=e||E<0||f&&x>=o}function y(){var S=kn();if(g(S))return b(S);s=setTimeout(y,p(S))}function b(S){return s=void 0,d&&a?h(S):(a=n=void 0,i)}function m(){s!==void 0&&clearTimeout(s),u=0,a=l=n=s=void 0}function T(){return s===void 0?i:b(kn())}function C(){var S=kn(),E=g(S);if(a=arguments,n=this,l=S,E){if(s===void 0)return c(l);if(f)return clearTimeout(s),s=setTimeout(y,e),h(l)}return s===void 0&&(s=setTimeout(y,e)),i}return C.cancel=m,C.flush=T,C}var pn=Lv,Pn=Ye?Ye.performance:null,Es=Pn&&Pn.now?function(){return Pn.now()}:function(){return Date.now()},Av=function(){if(Ye){if(Ye.requestAnimationFrame)return function(t){Ye.requestAnimationFrame(t)};if(Ye.mozRequestAnimationFrame)return function(t){Ye.mozRequestAnimationFrame(t)};if(Ye.webkitRequestAnimationFrame)return function(t){Ye.webkitRequestAnimationFrame(t)};if(Ye.msRequestAnimationFrame)return function(t){Ye.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Es())},1e3/60)}}(),an=function(e){return Av(e)},_t=Es,Ir=9261,ws=65599,oa=5381,xs=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*ws+n.value|0;return a},ca=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ir;return r*ws+e|0},da=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oa;return(r<<5)+r+e|0},Ov=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])]},Nv=function(e,r){var a={value:0,done:!1},n=0,o=e.length,i={next:function(){return n<o?a.value=e[n++]:a.done=!0,a}};return xs(i,r)},gr=function(e,r){var a={value:0,done:!1},n=0,o=e.length,i={next:function(){return n<o?a.value=e.charCodeAt(n++):a.done=!0,a}};return xs(i,r)},Ts=function(){return Iv(arguments)},Iv=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},Ji=!0,Mv=console.warn!=null,Rv=console.trace!=null,mi=Number.MAX_SAFE_INTEGER||9007199254740991,Cs=function(){return!0},nn=function(){return!1},ji=function(){return 0},bi=function(){},Ve=function(e){throw new Error(e)},Ds=function(e){if(e!==void 0)Ji=!!e;else return Ji},Ie=function(e){Ds()&&(Mv?console.warn(e):(console.log(e),Rv&&console.trace()))},kv=function(e){return Ee({},e)},Bt=function(e){return e==null?e:ke(e)?e.slice():De(e)?kv(e):e},Pv=function(e){return e.slice()},Ss=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},Bv={},Ls=function(){return Bv},rt=function(e){var r=Object.keys(e);return function(a){for(var n={},o=0;o<r.length;o++){var i=r[o],s=a==null?void 0:a[i];n[i]=s===void 0?e[i]:s}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)},Fv=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=ds(a,r)),e[r]},Zt=function(e,r,a,n){a&&(r=ds(a,r)),e[r]=n},Gv=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:Gv,zv="undefined",Vv=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))!==zv?Set:Vv,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 o=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(o.position.x==null&&(o.position.x=0),o.position.y==null&&(o.position.y=0),r.renderedPosition){var i=r.renderedPosition,s=e.pan(),l=e.zoom();o.position={x:(i.x-s.x)/l,y:(i.y-s.y)/l}}var u=[];ke(r.classes)?u=r.classes:ge(r.classes)&&(u=r.classes.split(/\s+/));for(var v=0,f=u.length;v<f;v++){var d=u[v];!d||d===""||o.classes.add(d)}this.createEmitter();var h=r.style||r.css;h&&(Ie("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h)),(a===void 0||a)&&this.restore()},eo=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,o){var i;De(a)&&!yt(a)&&(i=a,a=i.roots||i.root,n=i.visit,o=i.directed),o=arguments.length===2&&!ze(n)?n:o,n=ze(n)?n:function(){};for(var s=this._private.cy,l=a=ge(a)?this.filter(a):a,u=[],v=[],f={},d={},h={},c=0,p,g=this.byGroup(),y=g.nodes,b=g.edges,m=0;m<l.length;m++){var T=l[m],C=T.id();T.isNode()&&(u.unshift(T),e.bfs&&(h[C]=!0,v.push(T)),d[C]=0)}for(var S=function(){var N=e.bfs?u.shift():u.pop(),O=N.id();if(e.dfs){if(h[O])return"continue";h[O]=!0,v.push(N)}var M=d[O],R=f[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(!o||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)}),_=H.id();H.length!==0&&!h[_]&&(H=H[0],u.push(H),e.bfs&&(h[_]=!0,v.push(H)),f[_]=U,d[_]=d[O]+1)}};u.length!==0;){var E=S();if(E!=="continue"&&E==="break")break}for(var x=s.collection(),w=0;w<v.length;w++){var D=v[w],L=f[D.id()];L!=null&&x.push(L),x.push(D)}return{path:s.collection(x),found:s.collection(p)}}},ga={breadthFirstSearch:eo({bfs:!0}),depthFirstSearch:eo({dfs:!0})};ga.bfs=ga.breadthFirstSearch;ga.dfs=ga.depthFirstSearch;var Uv=Hu(function(t,e){(function(){var r,a,n,o,i,s,l,u,v,f,d,h,c,p,g;n=Math.floor,f=Math.min,a=function(y,b){return y<b?-1:y>b?1:0},v=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},s=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},u=function(y,b,m){var T;return m==null&&(m=a),T=y[0],y[0]=b,g(y,0,m),T},l=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},o=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(o(C,m),x=y.slice(b),S=0,E=x.length;S<E;S++)T=x[S],l(C,T,m);return C.sort(m).reverse()},h=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&&(v(S,T,0,null,m),S.pop(),C=S[S.length-1]);return S}for(o(y,m),A=[],x=0,L=f(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=s,y.pop=i,y.replace=u,y.pushpop=l,y.heapify=o,y.updateItem=c,y.nlargest=d,y.nsmallest=h;function y(b){this.cmp=b??a,this.nodes=[]}return y.prototype.push=function(b){return s(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 u(this.nodes,b,this.cmp)},y.prototype.pushpop=function(b){return l(this.nodes,b,this.cmp)},y.prototype.heapify=function(){return o(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=Uv,$v=rt({root:null,weight:function(e){return 1},directed:!1}),_v={dijkstra:function(e){if(!De(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=$v(e),n=a.root,o=a.weight,i=a.directed,s=this,l=o,u=ge(n)?this.filter(n)[0]:n[0],v={},f={},d={},h=this.byGroup(),c=h.nodes,p=h.edges;p.unmergeBy(function(M){return M.isLoop()});for(var g=function(R){return v[R.id()]},y=function(R,k){v[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];v[T.id()]=T.same(u)?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=l(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),f[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);f[z];){var G=f[z];P.unshift(G.edge),P.unshift(G.node),B=G.node,z=B.id()}return s.spawn(P)}}}},Yv={kruskal:function(e){e=e||function(m){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,o=a.length,i=new Array(o),s=a,l=function(T){for(var C=0;C<i.length;C++){var S=i[C];if(S.has(T))return C}},u=0;u<o;u++)i[u]=this.spawn(a[u]);for(var v=n.sort(function(m,T){return e(m)-e(T)}),f=0;f<v.length;f++){var d=v[f],h=d.source()[0],c=d.target()[0],p=l(h),g=l(c),y=i[p],b=i[g];p!==g&&(s.merge(d),y.merge(b),i.splice(g,1))}return s}},Hv=rt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Xv={aStar:function(e){var r=this.cy(),a=Hv(e),n=a.root,o=a.goal,i=a.heuristic,s=a.directed,l=a.weight;n=r.collection(n)[0],o=r.collection(o)[0];var u=n.id(),v=o.id(),f={},d={},h={},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,u),f[u]=0,d[u]=i(n);for(var E=0;c.size()>0;){if(C(),E++,T===v){for(var x=[],w=o,D=v,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:f[T],path:this.spawn(x),steps:E}}h[T]=!0;for(var A=m._private.edges,N=0;N<A.length;N++){var O=A[N];if(this.hasElementWithId(O.id())&&!(s&&O.data("source")!==T)){var M=O.source(),R=O.target(),k=M.id()!==T?M:R,P=k.id();if(this.hasElementWithId(P)&&!h[P]){var B=f[T]+l(O);if(!S(P)){f[P]=B,d[P]=B+i(k),b(k,P),g[P]=m,y[P]=O;continue}B<f[P]&&(f[P]=B,d[P]=B+i(k),g[P]=m,y[P]=O)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},qv=rt({weight:function(e){return 1},directed:!1}),Wv={floydWarshall:function(e){for(var r=this.cy(),a=qv(e),n=a.weight,o=a.directed,i=n,s=this.byGroup(),l=s.nodes,u=s.edges,v=l.length,f=v*v,d=function(U){return l.indexOf(U)},h=function(U){return l[U]},c=new Array(f),p=0;p<f;p++){var g=p%v,y=(p-g)/v;y===g?c[p]=0:c[p]=1/0}for(var b=new Array(f),m=new Array(f),T=0;T<u.length;T++){var C=u[T],S=C.source()[0],E=C.target()[0];if(S!==E){var x=d(S),w=d(E),D=x*v+w,L=i(C);if(c[D]>L&&(c[D]=L,b[D]=w,m[D]=C),!o){var A=w*v+x;!o&&c[A]>L&&(c[A]=L,b[A]=x,m[A]=C)}}}for(var N=0;N<v;N++)for(var O=0;O<v;O++)for(var M=O*v+N,R=0;R<v;R++){var k=O*v+R,P=N*v+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 _=z(U),Q=z(H);return c[_*v+Q]},path:function(U,H){var _=z(U),Q=z(H),J=h(_);if(_===Q)return J.collection();if(b[_*v+Q]==null)return r.collection();var q=r.collection(),V=_,Z;for(q.merge(J);_!==Q;)V=_,_=b[_*v+Q],Z=m[V*v+_],q.merge(Z),q.merge(h(_));return q}};return G}},Kv=rt({weight:function(e){return 1},directed:!1,root:null}),Zv={bellmanFord:function(e){var r=this,a=Kv(e),n=a.weight,o=a.directed,i=a.root,s=n,l=this,u=this.cy(),v=this.byGroup(),f=v.edges,d=v.nodes,h=d.length,c=new Ft,p=!1,g=[];i=u.collection(i)[0],f.unmergeBy(function(ce){return ce.isLoop()});for(var y=f.length,b=function(ve){var ye=c.get(ve.id());return ye||(ye={},c.set(ve.id(),ye)),ye},m=function(ve){return(ge(ve)?u.$(ve):ve)[0]},T=function(ve){return b(m(ve)).dist},C=function(ve){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i,Oe=m(ve),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 l.spawn(Te)},S=0;S<h;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(ve,ye,Oe,Te,xe,Se){var ee=Te.dist+Se;ee<xe.dist&&!Oe.same(Te.edge)&&(xe.dist=ee,xe.pred=ve,xe.edge=Oe,w=!0)},L=1;L<h;L++){w=!1;for(var A=0;A<y;A++){var N=f[A],O=N.source(),M=N.target(),R=s(N),k=b(O),P=b(M);D(O,M,N,k,P,R),o||D(M,O,N,P,k,R)}if(!w)break}if(w)for(var B=[],z=0;z<y;z++){var G=f[z],F=G.source(),U=G.target(),H=s(G),_=b(F).dist,Q=b(U).dist;if(_+H<Q||!o&&Q+H<_)if(p||(Ie("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var J=[];_+H<Q&&J.push(F),!o&&Q+H<_&&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 he=K[0].id(),ae=0,te=2;te<K.length;te+=2)K[te].id()<he&&(he=K[te].id(),ae=te);K=K.slice(ae).concat(K.slice(0,ae)),K.push(K[0]);var le=K.map(function(ce){return ce.id()}).join(",");B.indexOf(le)===-1&&(g.push(l.spawn(K)),B.push(le))}}else break}return{distanceTo:T,pathTo:C,hasNegativeWeightCycle:p,negativeWeightCycles:g}}},Qv=Math.sqrt(2),Jv=function(e,r,a){a.length===0&&Ve("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],o=n[1],i=n[2],s=r[o],l=r[i],u=a,v=u.length-1;v>=0;v--){var f=u[v],d=f[1],h=f[2];(r[d]===s&&r[h]===l||r[d]===l&&r[h]===s)&&u.splice(v,1)}for(var c=0;c<u.length;c++){var p=u[c];p[1]===l?(u[c]=p.slice(),u[c][1]=s):p[2]===l&&(u[c]=p.slice(),u[c][2]=s)}for(var g=0;g<r.length;g++)r[g]===l&&(r[g]=s);return u},Bn=function(e,r,a,n){for(;a>n;){var o=Math.floor(Math.random()*r.length);r=Jv(o,e,r),a--}return r},jv={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(P){return P.isLoop()});var o=a.length,i=n.length,s=Math.ceil(Math.pow(Math.log(o)/Math.LN2,2)),l=Math.floor(o/Qv);if(o<2){Ve("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],v=0;v<i;v++){var f=n[v];u.push([v,a.indexOf(f.source()),a.indexOf(f.target())])}for(var d=1/0,h=[],c=new Array(o),p=new Array(o),g=new Array(o),y=function(B,z){for(var G=0;G<o;G++)z[G]=B[G]},b=0;b<=s;b++){for(var m=0;m<o;m++)p[m]=m;var T=Bn(p,u.slice(),o,l),C=T.slice();y(p,g);var S=Bn(p,T,l,2),E=Bn(g,C,l,2);S.length<=E.length&&S.length<d?(d=S.length,h=S,y(p,c)):E.length<=S.length&&E.length<d&&(d=E.length,h=E,y(g,c))}for(var x=this.spawn(h.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}},ef=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}},As=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]}},tf=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,o=r;o<a;o++){var i=e[o];isFinite(i)&&(n=Math.min(i,n))}return n},rf=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,o=r;o<a;o++){var i=e[o];isFinite(i)&&(n=Math.max(i,n))}return n},af=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,o=0,i=r;i<a;i++){var s=e[i];isFinite(s)&&(n+=s,o++)}return n/o},nf=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,o=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 s=0,l=e.length-1;l>=0;l--){var u=e[l];i?isFinite(u)||(e[l]=-1/0,s++):e.splice(l,1)}o&&e.sort(function(d,h){return d-h});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+s]:(e[f-1+s]+e[f+s])/2},of=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)},Os=function(e){return e>0?1:e<0?-1:0},pr=function(e,r){return Math.sqrt(ur(e,r))},ur=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},sf=function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var o=0;o<r;o++)e[o]=e[o]/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)}},lf=function(e,r,a,n){var o={x:r.x-e.x,y:r.y-e.y},i=pr(e,r),s={x:o.x/i,y:o.y/i};return a=a??0,n=n??a*i,{x:e.x+s.x*n,y:e.y+s.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}}},uf=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},vf=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},ff=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}},Ns=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},hf=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,o,i;if(r.length===1)a=n=o=i=r[0];else if(r.length===2)a=o=r[0],i=n=r[1];else if(r.length===4){var s=Lt(r,4);a=s[0],n=s[1],o=s[2],i=s[3]}return e.x1-=i,e.x2+=n,e.y1-=a,e.y2+=o,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},to=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},cf=function(e,r){return zr(e,r.x,r.y)},Is=function(e,r){return zr(e,r.x1,r.y1)&&zr(e,r.x2,r.y2)},Ms=function(e,r,a,n,o,i,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?yr(o,i):l,v=o/2,f=i/2;u=Math.min(u,v,f);var d=u!==v,h=u!==f,c;if(d){var p=a-v+u-s,g=n-f-s,y=a+v-u+s,b=g;if(c=Qt(e,r,a,n,p,g,y,b,!1),c.length>0)return c}if(h){var m=a+v+s,T=n-f+u-s,C=m,S=n+f-u+s;if(c=Qt(e,r,a,n,m,T,C,S,!1),c.length>0)return c}if(d){var E=a-v+u-s,x=n+f+s,w=a+v-u+s,D=x;if(c=Qt(e,r,a,n,E,x,w,D,!1),c.length>0)return c}if(h){var L=a-v-s,A=n-f+u-s,N=L,O=n+f-u+s;if(c=Qt(e,r,a,n,L,A,N,O,!1),c.length>0)return c}var M;{var R=a-v+u,k=n-f+u;if(M=sa(e,r,a,n,R,k,u+s),M.length>0&&M[0]<=R&&M[1]<=k)return[M[0],M[1]]}{var P=a+v-u,B=n-f+u;if(M=sa(e,r,a,n,P,B,u+s),M.length>0&&M[0]>=P&&M[1]<=B)return[M[0],M[1]]}{var z=a+v-u,G=n+f-u;if(M=sa(e,r,a,n,z,G,u+s),M.length>0&&M[0]>=z&&M[1]>=G)return[M[0],M[1]]}{var F=a-v+u,U=n+f-u;if(M=sa(e,r,a,n,F,U,u+s),M.length>0&&M[0]<=F&&M[1]>=U)return[M[0],M[1]]}return[]},df=function(e,r,a,n,o,i,s){var l=s,u=Math.min(a,o),v=Math.max(a,o),f=Math.min(n,i),d=Math.max(n,i);return u-l<=e&&e<=v+l&&f-l<=r&&r<=d+l},gf=function(e,r,a,n,o,i,s,l,u){var v={x1:Math.min(a,s,o)-u,x2:Math.max(a,s,o)+u,y1:Math.min(n,l,i)-u,y2:Math.max(n,l,i)+u};return!(e<v.x1||e>v.x2||r<v.y1||r>v.y2)},pf=function(e,r,a,n){a-=n;var o=r*r-4*e*a;if(o<0)return[];var i=Math.sqrt(o),s=2*e,l=(-r+i)/s,u=(-r-i)/s;return[l,u]},yf=function(e,r,a,n,o){var i=1e-5;e===0&&(e=i),r/=e,a/=e,n/=e;var s,l,u,v,f,d,h,c;if(l=(3*a-r*r)/9,u=-(27*n)+r*(9*a-2*(r*r)),u/=54,s=l*l*l+u*u,o[1]=0,h=r/3,s>0){f=u+Math.sqrt(s),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),d=u-Math.sqrt(s),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),o[0]=-h+f+d,h+=(f+d)/2,o[4]=o[2]=-h,h=Math.sqrt(3)*(-d+f)/2,o[3]=h,o[5]=-h;return}if(o[5]=o[3]=0,s===0){c=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),o[0]=-h+2*c,o[4]=o[2]=-(c+h);return}l=-l,v=l*l*l,v=Math.acos(u/Math.sqrt(v)),c=2*Math.sqrt(l),o[0]=-h+c*Math.cos(v/3),o[2]=-h+c*Math.cos((v+2*Math.PI)/3),o[4]=-h+c*Math.cos((v+4*Math.PI)/3)},mf=function(e,r,a,n,o,i,s,l){var u=1*a*a-4*a*o+2*a*s+4*o*o-4*o*s+s*s+n*n-4*n*i+2*n*l+4*i*i-4*i*l+l*l,v=1*9*a*o-3*a*a-3*a*s-6*o*o+3*o*s+9*n*i-3*n*n-3*n*l-6*i*i+3*i*l,f=1*3*a*a-6*a*o+a*s-a*e+2*o*o+2*o*e-s*e+3*n*n-6*n*i+n*l-n*r+2*i*i+2*i*r-l*r,d=1*a*o-a*a+a*e-o*e+n*i-n*n+n*r-i*r,h=[];yf(u,v,f,d,h);for(var c=1e-7,p=[],g=0;g<6;g+=2)Math.abs(h[g+1])<c&&h[g]>=0&&h[g]<=1&&p.push(h[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]*o+p[C]*p[C]*s,m=Math.pow(1-p[C],2)*n+2*(1-p[C])*p[C]*i+p[C]*p[C]*l,T=Math.pow(b-e,2)+Math.pow(m-r,2),y>=0?T<y&&(y=T):y=T;return y},bf=function(e,r,a,n,o,i){var s=[e-a,r-n],l=[o-a,i-n],u=l[0]*l[0]+l[1]*l[1],v=s[0]*s[0]+s[1]*s[1],f=s[0]*l[0]+s[1]*l[1],d=f*f/u;return f<0?v:d>u?(e-o)*(e-o)+(r-i)*(r-i):v-d},gt=function(e,r,a){for(var n,o,i,s,l,u=0,v=0;v<a.length/2;v++)if(n=a[v*2],o=a[v*2+1],v+1<a.length/2?(i=a[(v+1)*2],s=a[(v+1)*2+1]):(i=a[(v+1-a.length/2)*2],s=a[(v+1-a.length/2)*2+1]),!(n==e&&i==e))if(n>=e&&e>=i||n<=e&&e<=i)l=(e-n)/(i-n)*(s-o)+o,l>r&&u++;else continue;return u%2!==0},Yt=function(e,r,a,n,o,i,s,l,u){var v=new Array(a.length),f;l[0]!=null?(f=Math.atan(l[1]/l[0]),l[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=l;for(var d=Math.cos(-f),h=Math.sin(-f),c=0;c<v.length/2;c++)v[c*2]=i/2*(a[c*2]*d-a[c*2+1]*h),v[c*2+1]=s/2*(a[c*2+1]*d+a[c*2]*h),v[c*2]+=n,v[c*2+1]+=o;var p;if(u>0){var g=sn(v,-u);p=on(g)}else p=v;return gt(e,r,p)},Ef=function(e,r,a,n,o,i,s,l){for(var u=new Array(a.length*2),v=0;v<l.length;v++){var f=l[v];u[v*4+0]=f.startX,u[v*4+1]=f.startY,u[v*4+2]=f.stopX,u[v*4+3]=f.stopY;var d=Math.pow(f.cx-e,2)+Math.pow(f.cy-r,2);if(d<=Math.pow(f.radius,2))return!0}return gt(e,r,u)},on=function(e){for(var r=new Array(e.length/2),a,n,o,i,s,l,u,v,f=0;f<e.length/4;f++){a=e[f*4],n=e[f*4+1],o=e[f*4+2],i=e[f*4+3],f<e.length/4-1?(s=e[(f+1)*4],l=e[(f+1)*4+1],u=e[(f+1)*4+2],v=e[(f+1)*4+3]):(s=e[0],l=e[1],u=e[2],v=e[3]);var d=Qt(a,n,o,i,s,l,u,v,!0);r[f*2]=d[0],r[f*2+1]=d[1]}return r},sn=function(e,r){for(var a=new Array(e.length*2),n,o,i,s,l=0;l<e.length/2;l++){n=e[l*2],o=e[l*2+1],l<e.length/2-1?(i=e[(l+1)*2],s=e[(l+1)*2+1]):(i=e[0],s=e[1]);var u=s-o,v=-(i-n),f=Math.sqrt(u*u+v*v),d=u/f,h=v/f;a[l*4]=n+d*r,a[l*4+1]=o+h*r,a[l*4+2]=i+d*r,a[l*4+3]=s+h*r}return a},wf=function(e,r,a,n,o,i){var s=a-e,l=n-r;s/=o,l/=i;var u=Math.sqrt(s*s+l*l),v=u-1;if(v<0)return[];var f=v/u;return[(a-e)*f+e,(n-r)*f+r]},cr=function(e,r,a,n,o,i,s){return e-=o,r-=i,e/=a/2+s,r/=n/2+s,e*e+r*r<=1},sa=function(e,r,a,n,o,i,s){var l=[a-e,n-r],u=[e-o,r-i],v=l[0]*l[0]+l[1]*l[1],f=2*(u[0]*l[0]+u[1]*l[1]),d=u[0]*u[0]+u[1]*u[1]-s*s,h=f*f-4*v*d;if(h<0)return[];var c=(-f+Math.sqrt(h))/(2*v),p=(-f-Math.sqrt(h))/(2*v),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]*l[0]+e,T=b[0]*l[1]+r;if(b.length>1){if(b[0]==b[1])return[m,T];var C=b[1]*l[0]+e,S=b[1]*l[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,o,i,s,l,u){var v=e-o,f=a-e,d=s-o,h=r-i,c=n-r,p=l-i,g=d*h-p*v,y=f*h-c*v,b=p*f-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*f,r+m*c]:u?[e+m*f,r+m*c]:[]}else return g===0||y===0?Fn(e,a,s)===s?[s,l]:Fn(e,a,o)===o?[o,i]:Fn(o,s,a)===a?[a,n]:[]:[]},ya=function(e,r,a,n,o,i,s,l){var u=[],v,f=new Array(a.length),d=!0;i==null&&(d=!1);var h;if(d){for(var c=0;c<f.length/2;c++)f[c*2]=a[c*2]*i+n,f[c*2+1]=a[c*2+1]*s+o;if(l>0){var p=sn(f,-l);h=on(p)}else h=f}else h=a;for(var g,y,b,m,T=0;T<h.length/2;T++)g=h[T*2],y=h[T*2+1],T<h.length/2-1?(b=h[(T+1)*2],m=h[(T+1)*2+1]):(b=h[0],m=h[1]),v=Qt(e,r,n,o,g,y,b,m),v.length!==0&&u.push(v[0],v[1]);return u},xf=function(e,r,a,n,o,i,s,l,u){var v=[],f,d=new Array(a.length*2);u.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,f=sa(e,r,n,o,b.cx,b.cy,b.radius),f.length!==0&&v.push(f[0],f[1])});for(var h=0;h<d.length/4;h++)f=Qt(e,r,n,o,d[h*4],d[h*4+1],d[h*4+2],d[h*4+3],!1),f.length!==0&&v.push(f[0],f[1]);if(v.length>2){for(var c=[v[0],v[1]],p=Math.pow(c[0]-e,2)+Math.pow(c[1]-r,2),g=1;g<v.length/2;g++){var y=Math.pow(v[g*2]-e,2)+Math.pow(v[g*2+1]-r,2);y<=p&&(c[0]=v[g*2],c[1]=v[g*2+1],p=y)}return c}return v},Pa=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],o=Math.sqrt(n[0]*n[0]+n[1]*n[1]),i=(o-a)/o;return i<0&&(i=1e-5),[r[0]+i*n[0],r[1]+i*n[1]]},ht=function(e,r){var a=Kn(e,r);return a=Rs(a),a},Rs=function(e){for(var r,a,n=e.length/2,o=1/0,i=1/0,s=-1/0,l=-1/0,u=0;u<n;u++)r=e[2*u],a=e[2*u+1],o=Math.min(o,r),s=Math.max(s,r),i=Math.min(i,a),l=Math.max(l,a);for(var v=2/(s-o),f=2/(l-i),d=0;d<n;d++)r=e[2*d]=e[2*d]*v,a=e[2*d+1]=e[2*d+1]*f,o=Math.min(o,r),s=Math.max(s,r),i=Math.min(i,a),l=Math.max(l,a);if(i<-1)for(var h=0;h<n;h++)a=e[2*h+1]=e[2*h+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 o=new Array(e*2),i,s=0;s<e;s++)i=s*a+n,o[2*s]=Math.cos(i),o[2*s+1]=Math.sin(-i);return o},yr=function(e,r){return Math.min(e/4,r/4,8)},ks=function(e,r){return Math.min(e/10,r/10,8)},Ti=function(){return 8},Tf=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}},Cf=rt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Df={pageRank:function(e){for(var r=Cf(e),a=r.dampingFactor,n=r.precision,o=r.iterations,i=r.weight,s=this._private.cy,l=this.byGroup(),u=l.nodes,v=l.edges,f=u.length,d=f*f,h=v.length,c=new Array(d),p=new Array(f),g=(1-a)/f,y=0;y<f;y++){for(var b=0;b<f;b++){var m=y*f+b;c[m]=0}p[y]=0}for(var T=0;T<h;T++){var C=v[T],S=C.data("source"),E=C.data("target");if(S!==E){var x=u.indexOfId(S),w=u.indexOfId(E),D=i(C),L=w*f+x;c[L]+=D,p[x]+=D}}for(var A=1/f+g,N=0;N<f;N++)if(p[N]===0)for(var O=0;O<f;O++){var M=O*f+N;c[M]=A}else for(var R=0;R<f;R++){var k=R*f+N;c[k]=c[k]/p[N]+g}for(var P=new Array(f),B=new Array(f),z,G=0;G<f;G++)P[G]=1;for(var F=0;F<o;F++){for(var U=0;U<f;U++)B[U]=0;for(var H=0;H<f;H++)for(var _=0;_<f;_++){var Q=H*f+_;B[H]+=c[Q]*P[_]}sf(B),z=P,P=B,B=z;for(var J=0,q=0;q<f;q++){var V=z[q]-P[q];J+=V*V}if(J<n)break}var Z={rank:function(ie){return ie=s.collection(ie)[0],P[u.indexOf(ie)]}};return Z}},ro=rt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Pr={degreeCentralityNormalized:function(e){e=ro(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var v={},f={},d=0,h=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),h<y.outdegree&&(h=y.outdegree),v[g]=y.indegree,f[g]=y.outdegree}return{indegree:function(m){return d==0?0:(ge(m)&&(m=r.filter(m)),v[m.id()]/d)},outdegree:function(m){return h===0?0:(ge(m)&&(m=r.filter(m)),f[m.id()]/h)}}}else{for(var o={},i=0,s=0;s<n;s++){var l=a[s];e.root=l;var u=this.degreeCentrality(e);i<u.degree&&(i=u.degree),o[l.id()]=u.degree}return{degree:function(m){return i===0?0:(ge(m)&&(m=r.filter(m)),o[m.id()]/i)}}}},degreeCentrality:function(e){e=ro(e);var r=this.cy(),a=this,n=e,o=n.root,i=n.weight,s=n.directed,l=n.alpha;if(o=r.collection(o)[0],s){for(var h=o.connectedEdges(),c=h.filter(function(S){return S.target().same(o)&&a.has(S)}),p=h.filter(function(S){return S.source().same(o)&&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-l)*Math.pow(b,l),outdegree:Math.pow(y,1-l)*Math.pow(m,l)}}else{for(var u=o.connectedEdges().intersection(a),v=u.length,f=0,d=0;d<u.length;d++)f+=i(u[d]);return{degree:Math.pow(v,1-l)*Math.pow(f,l)}}}};Pr.dc=Pr.degreeCentrality;Pr.dcn=Pr.degreeCentralityNormalised=Pr.degreeCentralityNormalized;var ao=rt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Br={closenessCentralityNormalized:function(e){for(var r=ao(e),a=r.harmonic,n=r.weight,o=r.directed,i=this.cy(),s={},l=0,u=this.nodes(),v=this.floydWarshall({weight:n,directed:o}),f=0;f<u.length;f++){for(var d=0,h=u[f],c=0;c<u.length;c++)if(f!==c){var p=v.distance(h,u[c]);a?d+=1/p:d+=p}a||(d=1/d),l<d&&(l=d),s[h.id()]=d}return{closeness:function(y){return l==0?0:(ge(y)?y=i.filter(y)[0].id():y=y.id(),s[y]/l)}}},closenessCentrality:function(e){var r=ao(e),a=r.root,n=r.weight,o=r.directed,i=r.harmonic;a=this.filter(a)[0];for(var s=this.dijkstra({root:a,weight:n,directed:o}),l=0,u=this.nodes(),v=0;v<u.length;v++){var f=u[v];if(!f.same(a)){var d=s.distanceTo(f);i?l+=1/d:l+=d}}return i?l:1/l}};Br.cc=Br.closenessCentrality;Br.ccn=Br.closenessCentralityNormalised=Br.closenessCentralityNormalized;var Sf=rt({weight:null,directed:!1}),Qn={betweennessCentrality:function(e){for(var r=Sf(e),a=r.directed,n=r.weight,o=n!=null,i=this.cy(),s=this.nodes(),l={},u={},v=0,f={set:function(m,T){u[m]=T,T>v&&(v=T)},get:function(m){return u[m]}},d=0;d<s.length;d++){var h=s[d],c=h.id();a?l[c]=h.outgoers().nodes():l[c]=h.openNeighborhood().nodes(),f.set(c,0)}for(var p=function(m){for(var T=s[m].id(),C=[],S={},E={},x={},w=new Sa(function(_,Q){return x[_]-x[Q]}),D=0;D<s.length;D++){var L=s[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),o)for(var N=0;N<l[A].length;N++){var O=l[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<l[A].length;P++){var B=l[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<s.length;G++)z[s[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!=s[m].id()&&f.set(F,f.get(F)+z[F])}},g=0;g<s.length;g++)p(g);var y={betweenness:function(m){var T=i.collection(m).id();return f.get(T)},betweennessNormalized:function(m){if(v==0)return 0;var T=i.collection(m).id();return f.get(T)/v}};return y.betweennessNormalised=y.betweennessNormalized,y}};Qn.bc=Qn.betweennessCentrality;var Lf=rt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),Af=function(e){return Lf(e)},Of=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},Nf=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},Ps=function(e,r){for(var a,n=0;n<r;n++){a=0;for(var o=0;o<r;o++)a+=e[o*r+n];for(var i=0;i<r;i++)e[i*r+n]=e[i*r+n]/a}},If=function(e,r,a){for(var n=new Array(a*a),o=0;o<a;o++){for(var i=0;i<a;i++)n[o*a+i]=0;for(var s=0;s<a;s++)for(var l=0;l<a;l++)n[o*a+l]+=e[o*a+s]*r[s*a+l]}return n},Mf=function(e,r,a){for(var n=e.slice(0),o=1;o<a;o++)e=If(e,n,r);return e},Rf=function(e,r,a){for(var n=new Array(r*r),o=0;o<r*r;o++)n[o]=Math.pow(e[o],a);return Ps(n,r),n},kf=function(e,r,a,n){for(var o=0;o<a;o++){var i=Math.round(e[o]*Math.pow(10,n))/Math.pow(10,n),s=Math.round(r[o]*Math.pow(10,n))/Math.pow(10,n);if(i!==s)return!1}return!0},Pf=function(e,r,a,n){for(var o=[],i=0;i<r;i++){for(var s=[],l=0;l<r;l++)Math.round(e[i*r+l]*1e3)/1e3>0&&s.push(a[l]);s.length!==0&&o.push(n.collection(s))}return o},Bf=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},Ff=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&Bf(e[r],e[a])&&e.splice(a,1);return e},no=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),o=Af(e),i={},s=0;s<r.length;s++)i[r[s].id()]=s;for(var l=r.length,u=l*l,v=new Array(u),f,d=0;d<u;d++)v[d]=0;for(var h=0;h<a.length;h++){var c=a[h],p=i[c.source().id()],g=i[c.target().id()],y=Of(c,o.attributes);v[p*l+g]+=y,v[g*l+p]+=y}Nf(v,l,o.multFactor),Ps(v,l);for(var b=!0,m=0;b&&m<o.maxIterations;)b=!1,f=Mf(v,l,o.expandFactor),v=Rf(f,l,o.inflateFactor),kf(v,f,u,4)||(b=!0),m++;var T=Pf(v,l,r,n);return T=Ff(T),T},Gf={markovClustering:no,mcl:no},zf=function(e){return e},Bs=function(e,r){return Math.abs(r-e)},io=function(e,r,a){return e+Bs(r,a)},oo=function(e,r,a){return e+Math.pow(a-r,2)},Vf=function(e){return Math.sqrt(e)},Uf=function(e,r,a){return Math.max(e,Bs(r,a))},ta=function(e,r,a,n,o){for(var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:zf,s=n,l,u,v=0;v<e;v++)l=r(v),u=a(v),s=o(s,l,u);return i(s)},Vr={euclidean:function(e,r,a){return e>=2?ta(e,r,a,0,oo,Vf):ta(e,r,a,0,io)},squaredEuclidean:function(e,r,a){return ta(e,r,a,0,oo)},manhattan:function(e,r,a){return ta(e,r,a,0,io)},max:function(e,r,a){return ta(e,r,a,-1/0,Uf)}};Vr["squared-euclidean"]=Vr.squaredEuclidean;Vr.squaredeuclidean=Vr.squaredEuclidean;function bn(t,e,r,a,n,o){var i;return ze(t)?i=t:i=Vr[t]||Vr.euclidean,e===0&&ze(t)?i(n,o):i(e,r,a,n,o)}var $f=rt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Ci=function(e){return $f(e)},ln=function(e,r,a,n,o){var i=o!=="kMedoids",s=i?function(f){return a[f]}:function(f){return n[f](a)},l=function(d){return n[d](r)},u=a,v=r;return bn(e,n.length,s,l,u,v)},Gn=function(e,r,a){for(var n=a.length,o=new Array(n),i=new Array(n),s=new Array(r),l=null,u=0;u<n;u++)o[u]=e.min(a[u]).value,i[u]=e.max(a[u]).value;for(var v=0;v<r;v++){l=[];for(var f=0;f<n;f++)l[f]=Math.random()*(i[f]-o[f])+o[f];s[v]=l}return s},Fs=function(e,r,a,n,o){for(var i=1/0,s=0,l=0;l<r.length;l++){var u=ln(a,e,r[l],n,o);u<i&&(i=u,s=l)}return s},Gs=function(e,r,a){for(var n=[],o=null,i=0;i<r.length;i++)o=r[i],a[o.id()]===e&&n.push(o);return n},_f=function(e,r,a){return Math.abs(r-e)<=a},Yf=function(e,r,a){for(var n=0;n<e.length;n++)for(var o=0;o<e[n].length;o++){var i=Math.abs(e[n][o]-r[n][o]);if(i>a)return!1}return!0},Hf=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},so=function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var o=e[Math.floor(Math.random()*e.length)];Hf(o,a,n);)o=e[Math.floor(Math.random()*e.length)];a[n]=o}else for(var i=0;i<r;i++)a[i]=e[Math.floor(Math.random()*e.length)];return a},lo=function(e,r,a){for(var n=0,o=0;o<r.length;o++)n+=ln("manhattan",r[o],e,a,"kMedoids");return n},Xf=function(e){var r=this.cy(),a=this.nodes(),n=null,o=Ci(e),i=new Array(o.k),s={},l;o.testMode?typeof o.testCentroids=="number"?(o.testCentroids,l=Gn(a,o.k,o.attributes)):qe(o.testCentroids)==="object"?l=o.testCentroids:l=Gn(a,o.k,o.attributes):l=Gn(a,o.k,o.attributes);for(var u=!0,v=0;u&&v<o.maxIterations;){for(var f=0;f<a.length;f++)n=a[f],s[n.id()]=Fs(n,l,o.distance,o.attributes,"kMeans");u=!1;for(var d=0;d<o.k;d++){var h=Gs(d,a,s);if(h.length!==0){for(var c=o.attributes.length,p=l[d],g=new Array(c),y=new Array(c),b=0;b<c;b++){y[b]=0;for(var m=0;m<h.length;m++)n=h[m],y[b]+=o.attributes[b](n);g[b]=y[b]/h.length,_f(g[b],p[b],o.sensitivityThreshold)||(u=!0)}l[d]=g,i[d]=r.collection(h)}}v++}return i},qf=function(e){var r=this.cy(),a=this.nodes(),n=null,o=Ci(e),i=new Array(o.k),s,l={},u,v=new Array(o.k);o.testMode?typeof o.testCentroids=="number"||(qe(o.testCentroids)==="object"?s=o.testCentroids:s=so(a,o.k)):s=so(a,o.k);for(var f=!0,d=0;f&&d<o.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],l[n.id()]=Fs(n,s,o.distance,o.attributes,"kMedoids");f=!1;for(var c=0;c<s.length;c++){var p=Gs(c,a,l);if(p.length!==0){v[c]=lo(s[c],p,o.attributes);for(var g=0;g<p.length;g++)u=lo(p[g],p,o.attributes),u<v[c]&&(v[c]=u,s[c]=p[g],f=!0);i[c]=r.collection(p)}}d++}return i},Wf=function(e,r,a,n,o){for(var i,s,l=0;l<r.length;l++)for(var u=0;u<e.length;u++)n[l][u]=Math.pow(a[l][u],o.m);for(var v=0;v<e.length;v++)for(var f=0;f<o.attributes.length;f++){i=0,s=0;for(var d=0;d<r.length;d++)i+=n[d][v]*o.attributes[f](r[d]),s+=n[d][v];e[v][f]=i/s}},Kf=function(e,r,a,n,o){for(var i=0;i<e.length;i++)r[i]=e[i].slice();for(var s,l,u,v=2/(o.m-1),f=0;f<a.length;f++)for(var d=0;d<n.length;d++){s=0;for(var h=0;h<a.length;h++)l=ln(o.distance,n[d],a[f],o.attributes,"cmeans"),u=ln(o.distance,n[d],a[h],o.attributes,"cmeans"),s+=Math.pow(l/u,v);e[d][f]=1/s}},Zf=function(e,r,a,n){for(var o=new Array(a.k),i=0;i<o.length;i++)o[i]=[];for(var s,l,u=0;u<r.length;u++){s=-1/0,l=-1;for(var v=0;v<r[0].length;v++)r[u][v]>s&&(s=r[u][v],l=v);o[l].push(e[u])}for(var f=0;f<o.length;f++)o[f]=n.collection(o[f]);return o},uo=function(e){var r=this.cy(),a=this.nodes(),n=Ci(e),o,i,s,l,u;l=new Array(a.length);for(var v=0;v<a.length;v++)l[v]=new Array(n.k);s=new Array(a.length);for(var f=0;f<a.length;f++)s[f]=new Array(n.k);for(var d=0;d<a.length;d++){for(var h=0,c=0;c<n.k;c++)s[d][c]=Math.random(),h+=s[d][c];for(var p=0;p<n.k;p++)s[d][p]=s[d][p]/h}i=new Array(n.k);for(var g=0;g<n.k;g++)i[g]=new Array(n.attributes.length);u=new Array(a.length);for(var y=0;y<a.length;y++)u[y]=new Array(n.k);for(var b=!0,m=0;b&&m<n.maxIterations;)b=!1,Wf(i,a,s,u,n),Kf(s,l,i,a,n),Yf(s,l,n.sensitivityThreshold)||(b=!0),m++;return o=Zf(a,s,n,r),{clusters:o,degreeOfMembership:s}},Qf={kMeans:Xf,kMedoids:qf,fuzzyCMeans:uo,fcm:uo},Jf=rt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),jf={single:"min",complete:"max"},eh=function(e){var r=Jf(e),a=jf[r.linkage];return a!=null&&(r.linkage=a),r},vo=function(e,r,a,n,o){for(var i=0,s=1/0,l,u=o.attributes,v=function(w,D){return bn(o.distance,u.length,function(L){return u[L](w)},function(L){return u[L](D)},w,D)},f=0;f<e.length;f++){var d=e[f].key,h=a[d][n[d]];h<s&&(i=d,s=h)}if(o.mode==="threshold"&&s>=o.threshold||o.mode==="dendrogram"&&e.length===1)return!1;var c=r[i],p=r[n[i]],g;o.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?l=1/0:o.linkage==="min"?(l=a[c.key][b.key],a[c.key][b.key]>a[p.key][b.key]&&(l=a[p.key][b.key])):o.linkage==="max"?(l=a[c.key][b.key],a[c.key][b.key]<a[p.key][b.key]&&(l=a[p.key][b.key])):o.linkage==="mean"?l=(a[c.key][b.key]*c.size+a[p.key][b.key]*p.size)/(c.size+p.size):o.mode==="dendrogram"?l=v(b.value,c.value):l=v(b.value[0],c.value[0]),a[c.key][b.key]=a[b.key][c.key]=l}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)))},th=function t(e,r){if(!e)return"";if(e.left&&e.right){var a=t(e.left,r),n=t(e.right,r),o=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:o.id()}}),r.add({group:"edges",data:{source:n,target:o.id()}}),o.id()}else if(e.value)return e.value.id()},rh=function t(e,r,a){if(!e)return[];var n=[],o=[],i=[];return r===0?(e.left&&Ba(e.left,n),e.right&&Ba(e.right,o),i=n.concat(o),[a.collection(i)]):r===1?e.value?[a.collection(e.value)]:(e.left&&Ba(e.left,n),e.right&&Ba(e.right,o),[a.collection(n),a.collection(o)]):e.value?[a.collection(e.value)]:(e.left&&(n=t(e.left,r-1,a)),e.right&&(o=t(e.right,r-1,a)),n.concat(o))},fo=function(e){for(var r=this.cy(),a=this.nodes(),n=eh(e),o=n.attributes,i=function(m,T){return bn(n.distance,o.length,function(C){return o[C](m)},function(C){return o[C](T)},m,T)},s=[],l=[],u=[],v=[],f=0;f<a.length;f++){var d={value:n.mode==="dendrogram"?a[f]:[a[f]],key:f,index:f};s[f]=d,v[f]=d,l[f]=[],u[f]=0}for(var h=0;h<s.length;h++)for(var c=0;c<=h;c++){var p=void 0;n.mode==="dendrogram"?p=h===c?1/0:i(s[h].value,s[c].value):p=h===c?1/0:i(s[h].value[0],s[c].value[0]),l[h][c]=p,l[c][h]=p,p<l[h][u[h]]&&(u[h]=c)}for(var g=vo(s,v,l,u,n);g;)g=vo(s,v,l,u,n);var y;return n.mode==="dendrogram"?(y=rh(s[0],n.dendrogramDepth,r),n.addDendrogram&&th(s[0],r)):(y=new Array(s.length),s.forEach(function(b,m){b.key=b.index=null,y[m]=r.collection(b.value)})),y},ah={hierarchicalClustering:fo,hca:fo},nh=rt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),ih=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(o){return o===a})||oe(a)||Ve("Preference must be one of [".concat(n.map(function(o){return"'".concat(o,"'")}).join(", "),"] or a number. Got: ").concat(a)),nh(e)},oh=function(e,r,a,n){var o=function(s,l){return n[l](s)};return-bn(e,n.length,function(i){return o(r,i)},function(i){return o(a,i)},r,a)},sh=function(e,r){var a=null;return r==="median"?a=nf(e):r==="mean"?a=af(e):r==="min"?a=tf(e):r==="max"?a=rf(e):a=r,a},lh=function(e,r,a){for(var n=[],o=0;o<e;o++)r[o*e+o]+a[o*e+o]>0&&n.push(o);return n},ho=function(e,r,a){for(var n=[],o=0;o<e;o++){for(var i=-1,s=-1/0,l=0;l<a.length;l++){var u=a[l];r[o*e+u]>s&&(i=u,s=r[o*e+u])}i>0&&n.push(i)}for(var v=0;v<a.length;v++)n[a[v]]=a[v];return n},uh=function(e,r,a){for(var n=ho(e,r,a),o=0;o<a.length;o++){for(var i=[],s=0;s<n.length;s++)n[s]===a[o]&&i.push(s);for(var l=-1,u=-1/0,v=0;v<i.length;v++){for(var f=0,d=0;d<i.length;d++)f+=r[i[d]*e+i[v]];f>u&&(l=v,u=f)}a[o]=i[l]}return n=ho(e,r,a),n},co=function(e){for(var r=this.cy(),a=this.nodes(),n=ih(e),o={},i=0;i<a.length;i++)o[a[i].id()]=i;var s,l,u,v,f,d;s=a.length,l=s*s,u=new Array(l);for(var h=0;h<l;h++)u[h]=-1/0;for(var c=0;c<s;c++)for(var p=0;p<s;p++)c!==p&&(u[c*s+p]=oh(n.distance,a[c],a[p],n.attributes));v=sh(u,n.preference);for(var g=0;g<s;g++)u[g*s+g]=v;f=new Array(l);for(var y=0;y<l;y++)f[y]=0;d=new Array(l);for(var b=0;b<l;b++)d[b]=0;for(var m=new Array(s),T=new Array(s),C=new Array(s),S=0;S<s;S++)m[S]=0,T[S]=0,C[S]=0;for(var E=new Array(s*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<s;D++){for(var L=-1/0,A=-1/0,N=-1,O=0,M=0;M<s;M++)m[M]=f[D*s+M],O=d[D*s+M]+u[D*s+M],O>=L?(A=L,L=O,N=M):O>A&&(A=O);for(var R=0;R<s;R++)f[D*s+R]=(1-n.damping)*(u[D*s+R]-L)+n.damping*m[R];f[D*s+N]=(1-n.damping)*(u[D*s+N]-A)+n.damping*m[N]}for(var k=0;k<s;k++){for(var P=0,B=0;B<s;B++)m[B]=d[B*s+k],T[B]=Math.max(0,f[B*s+k]),P+=T[B];P-=T[k],T[k]=f[k*s+k],P+=T[k];for(var z=0;z<s;z++)d[z*s+k]=(1-n.damping)*Math.min(0,P-T[z])+n.damping*m[z];d[k*s+k]=(1-n.damping)*(P-T[k])+n.damping*m[k]}for(var G=0,F=0;F<s;F++){var U=d[F*s+F]+f[F*s+F]>0?1:0;E[w%n.minIterations*s+F]=U,G+=U}if(G>0&&(w>=n.minIterations-1||w==n.maxIterations-1)){for(var H=0,_=0;_<s;_++){C[_]=0;for(var Q=0;Q<n.minIterations;Q++)C[_]+=E[Q*s+_];(C[_]===0||C[_]===n.minIterations)&&H++}if(H===s)break}}for(var J=lh(s,f,d),q=uh(s,u,J),V={},Z=0;Z<J.length;Z++)V[J[Z]]=[];for(var K=0;K<a.length;K++){var ie=o[a[K].id()],he=q[ie];he!=null&&V[he].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},vh={affinityPropagation:co,ap:co},fh=rt({root:void 0,directed:!1}),hh={hierholzer:function(e){if(!De(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=fh(e),n=a.root,o=a.directed,i=this,s=!1,l,u,v;n&&(v=ge(n)?this.filter(n)[0].id():n[0].id());var f={},d={};o?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?l?s=!0:l=m:E==1?u?s=!0:u=m:(E>1||S>1)&&(s=!0),f[m]=[],b.outgoers().forEach(function(x){x.isEdge()&&f[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&&(l?u?s=!0:u=m:l=m),f[m]=[],b.connectedEdges().forEach(function(C){return f[m].push(C.id())})}else d[m]=[b.source().id(),b.target().id()]});var h={found:!1,trail:void 0};if(s)return h;if(u&&l)if(o){if(v&&u!=v)return h;v=u}else{if(v&&u!=v&&l!=v)return h;v||(v=u)}else v||(v=i[0].id());var c=function(m){for(var T=m,C=[m],S,E,x;f[T].length;)S=f[T].shift(),E=d[S][0],x=d[S][1],T!=x?(f[x]=f[x].filter(function(w){return w!=S}),T=x):!o&&T!=E&&(f[E]=f[E].filter(function(w){return w!=S}),T=E),C.unshift(S),C.unshift(T);return C},p=[],g=[];for(g=c(v);g.length!=1;)f[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 f)if(f[y].length)return h;return h.found=!0,h.trail=this.spawn(p,!0),h}},Fa=function(){var e=this,r={},a=0,n=0,o=[],i=[],s={},l=function(d,h){for(var c=i.length-1,p=[],g=e.spawn();i[c].x!=d||i[c].y!=h;)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)})}),o.push(g)},u=function f(d,h,c){d===c&&(n+=1),r[h]={id:a,low:a++,cutVertex:!1};var p=e.getElementById(h).connectedEdges().intersection(e);if(p.size()===0)o.push(e.spawn(e.getElementById(h)));else{var g,y,b,m;p.forEach(function(T){g=T.source().id(),y=T.target().id(),b=g===h?y:g,b!==c&&(m=T.id(),s[m]||(s[m]=!0,i.push({x:h,y:b,edge:T})),b in r?r[h].low=Math.min(r[h].low,r[b].id):(f(d,b,h),r[h].low=Math.min(r[h].low,r[b].low),r[h].id<=r[b].low&&(r[h].cutVertex=!0,l(h,b))))})}};e.forEach(function(f){if(f.isNode()){var d=f.id();d in r||(n=0,u(d,d),r[d].cutVertex=n>1)}});var v=Object.keys(r).filter(function(f){return r[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(v),components:o}},ch={hopcroftTarjanBiconnected:Fa,htbc:Fa,htb:Fa,hopcroftTarjanBiconnectedComponents:Fa},Ga=function(){var e=this,r={},a=0,n=[],o=[],i=e.spawn(e),s=function l(u){o.push(u),r[u]={index:a,low:a++,explored:!1};var v=e.getElementById(u).connectedEdges().intersection(e);if(v.forEach(function(p){var g=p.target().id();g!==u&&(g in r||l(g),r[g].explored||(r[u].low=Math.min(r[u].low,r[g].low)))}),r[u].index===r[u].low){for(var f=e.spawn();;){var d=o.pop();if(f.merge(e.getElementById(d)),r[d].low=r[u].index,r[d].explored=!0,d===u)break}var h=f.edgesWith(f),c=f.merge(h);n.push(c),i=i.difference(c)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||s(u)}}),{cut:i,components:n}},dh={tarjanStronglyConnected:Ga,tsc:Ga,tscc:Ga,tarjanStronglyConnectedComponents:Ga},zs={};[ga,_v,Yv,Xv,Wv,Zv,jv,Df,Pr,Br,Qn,Gf,Qf,ah,vh,hh,ch,dh].forEach(function(t){Ee(zs,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 Vs=0,Us=1,$s=2,Ht=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=Vs,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 go(this,Us,"fulfillValue",e)},reject:function(e){return go(this,$s,"rejectReason",e)},then:function(e,r){var a=this,n=new Ht;return a.onFulfilled.push(yo(e,n,"fulfill")),a.onRejected.push(yo(r,n,"reject")),_s(a),n.proxy}};var go=function(e,r,a,n){return e.state===Vs&&(e.state=r,e[a]=n,_s(e)),e},_s=function(e){e.state===Us?po(e,"onFulfilled",e.fulfillValue):e.state===$s&&po(e,"onRejected",e.rejectReason)},po=function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var o=function(){for(var s=0;s<n.length;s++)n[s](a)};typeof setImmediate=="function"?setImmediate(o):setTimeout(o,0)}},yo=function(e,r,a){return function(n){if(typeof e!="function")r[a].call(r,n);else{var o;try{o=e(n)}catch(i){r.reject(i);return}gh(r,o)}}},gh=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(o){e.reject(o);return}if(typeof a=="function"){var n=!1;try{a.call(r,function(o){n||(n=!0,o===r?e.reject(new TypeError("circular thenable chain")):t(e,o))},function(o){n||(n=!0,e.reject(o))})}catch(o){n||e.reject(o)}return}e.fulfill(r)};Ht.all=function(t){return new Ht(function(e,r){for(var a=new Array(t.length),n=0,o=function(l,u){a[l]=u,n++,n===t.length&&e(a)},i=0;i<t.length;i++)(function(s){var l=t[s],u=l!=null&&l.then!=null;if(u)l.then(function(f){o(s,f)},function(f){r(f)});else{var v=l;o(s,v)}})(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 _r=typeof Promise<"u"?Promise:Ht,Jn=function(e,r,a){var n=pi(e),o=!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),o){var s=e.position();i.startPosition=i.startPosition||{x:s.x,y:s.y},i.startStyle=i.startStyle||e.cy().style().getAnimationStartStyle(e,i.style)}if(n){var l=e.pan();i.startPan={x:l.x,y:l.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(u,v){var f=e[u];f!=null&&(e[u]=e[v],e[v]=f)};if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var o=e.style[n],i=o.name,s=e.startStyle[i];e.startStyle[i]=o,e.style[n]=s}return r&&this.play(),this},promise:function(e){var r=this._private,a;switch(e){case"frame":a=r.frames;break;default:case"complete":case"completed":a=r.completes}return new _r(function(n,o){a.push(function(){n()})})}});mr.complete=mr.completed;mr.run=mr.play;mr.running=mr.playing;var ph={animated:function(){return function(){var r=this,a=r.length!==void 0,n=a?r:[r],o=this._private.cy||this;if(!o.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],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var i=0;i<n.length;i++){var s=n[i];s._private.animation.queue=[]}return this}},delay:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:r,duration:r,complete:a}):this}},delayAnimation:function(){return function(r,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:r,duration:r,complete:a}):this}},animation:function(){return function(r,a){var n=this,o=n.length!==void 0,i=o?n:[n],s=this._private.cy||this,l=!o,u=!l;if(!s.styleEnabled())return this;var v=s.style();r=Ee({},r,a);var f=Object.keys(r).length===0;if(f)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(u&&(r.style=v.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var d=r.renderedPosition,h=s.pan(),c=s.zoom();r.position=As(d,c,h)}if(l&&r.panBy!=null){var p=r.panBy,g=s.pan();r.pan={x:g.x+p.x,y:g.y+p.y}}var y=r.center||r.centre;if(l&&y!=null){var b=s.getCenterPan(y.eles,r.zoom);b!=null&&(r.pan=b)}if(l&&r.fit!=null){var m=r.fit,T=s.getFitViewport(m.eles||m.boundingBox,m.padding);T!=null&&(r.pan=T.pan,r.zoom=T.zoom)}if(l&&De(r.zoom)){var C=s.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,o=n.length!==void 0,i=o?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;a&&(r=Ee({},r,a));for(var l=0;l<i.length;l++){var u=i[l],v=u.animated()&&(r.queue===void 0||r.queue),f=u.animation(r,v?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(r,a){var n=this,o=n.length!==void 0,i=o?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var l=0;l<i.length;l++){for(var u=i[l],v=u._private,f=v.animation.current,d=0;d<f.length;d++){var h=f[d],c=h._private;a&&(c.duration=0)}r&&(v.animation.queue=[]),a||(v.animation.current=[])}return s.notify("draw"),this}}},yh=Array.isArray,En=yh,mh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bh=/^\w*$/;function Eh(t,e){if(En(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Da(t)?!0:bh.test(t)||!mh.test(t)||e!=null&&t in Object(e)}var wh=Eh,xh="[object AsyncFunction]",Th="[object Function]",Ch="[object GeneratorFunction]",Dh="[object Proxy]";function Sh(t){if(!dr(t))return!1;var e=bs(t);return e==Th||e==Ch||e==xh||e==Dh}var Lh=Sh,Ah=gn["__core-js_shared__"],zn=Ah,mo=function(){var t=/[^.]+$/.exec(zn&&zn.keys&&zn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Oh(t){return!!mo&&mo in t}var Nh=Oh,Ih=Function.prototype,Mh=Ih.toString;function Rh(t){if(t!=null){try{return Mh.call(t)}catch{}try{return t+""}catch{}}return""}var kh=Rh,Ph=/[\\^$.*+?()[\]{}|]/g,Bh=/^\[object .+?Constructor\]$/,Fh=Function.prototype,Gh=Object.prototype,zh=Fh.toString,Vh=Gh.hasOwnProperty,Uh=RegExp("^"+zh.call(Vh).replace(Ph,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $h(t){if(!dr(t)||Nh(t))return!1;var e=Lh(t)?Uh:Bh;return e.test(kh(t))}var _h=$h;function Yh(t,e){return t==null?void 0:t[e]}var Hh=Yh;function Xh(t,e){var r=Hh(t,e);return _h(r)?r:void 0}var Di=Xh,qh=Di(Object,"create"),ma=qh;function Wh(){this.__data__=ma?ma(null):{},this.size=0}var Kh=Wh;function Zh(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Qh=Zh,Jh="__lodash_hash_undefined__",jh=Object.prototype,ec=jh.hasOwnProperty;function tc(t){var e=this.__data__;if(ma){var r=e[t];return r===Jh?void 0:r}return ec.call(e,t)?e[t]:void 0}var rc=tc,ac=Object.prototype,nc=ac.hasOwnProperty;function ic(t){var e=this.__data__;return ma?e[t]!==void 0:nc.call(e,t)}var oc=ic,sc="__lodash_hash_undefined__";function lc(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=lc;function Yr(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])}}Yr.prototype.clear=Kh;Yr.prototype.delete=Qh;Yr.prototype.get=rc;Yr.prototype.has=oc;Yr.prototype.set=uc;var bo=Yr;function vc(){this.__data__=[],this.size=0}var fc=vc;function hc(t,e){return t===e||t!==t&&e!==e}var Ys=hc;function cc(t,e){for(var r=t.length;r--;)if(Ys(t[r][0],e))return r;return-1}var wn=cc,dc=Array.prototype,gc=dc.splice;function pc(t){var e=this.__data__,r=wn(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():gc.call(e,r,1),--this.size,!0}var yc=pc;function mc(t){var e=this.__data__,r=wn(e,t);return r<0?void 0:e[r][1]}var bc=mc;function Ec(t){return wn(this.__data__,t)>-1}var wc=Ec;function xc(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 Tc=xc;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=yc;Hr.prototype.get=bc;Hr.prototype.has=wc;Hr.prototype.set=Tc;var Cc=Hr,Dc=Di(gn,"Map"),Sc=Dc;function Lc(){this.size=0,this.__data__={hash:new bo,map:new(Sc||Cc),string:new bo}}var Ac=Lc;function Oc(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Nc=Oc;function Ic(t,e){var r=t.__data__;return Nc(e)?r[typeof e=="string"?"string":"hash"]:r.map}var xn=Ic;function Mc(t){var e=xn(this,t).delete(t);return this.size-=e?1:0,e}var Rc=Mc;function kc(t){return xn(this,t).get(t)}var Pc=kc;function Bc(t){return xn(this,t).has(t)}var Fc=Bc;function Gc(t,e){var r=xn(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}var zc=Gc;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=Ac;Xr.prototype.delete=Rc;Xr.prototype.get=Pc;Xr.prototype.has=Fc;Xr.prototype.set=zc;var Hs=Xr,Vc="Expected a function";function Si(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Vc);var r=function(){var a=arguments,n=e?e.apply(this,a):a[0],o=r.cache;if(o.has(n))return o.get(n);var i=t.apply(this,a);return r.cache=o.set(n,i)||o,i};return r.cache=new(Si.Cache||Hs),r}Si.Cache=Hs;var Uc=Si,$c=500;function _c(t){var e=Uc(t,function(a){return r.size===$c&&r.clear(),a}),r=e.cache;return e}var Yc=_c,Hc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xc=/\\(\\)?/g,qc=Yc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Hc,function(r,a,n,o){e.push(n?o.replace(Xc,"$1"):a||r)}),e}),Xs=qc;function Wc(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 qs=Wc,Kc=1/0,Eo=Gr?Gr.prototype:void 0,wo=Eo?Eo.toString:void 0;function Ws(t){if(typeof t=="string")return t;if(En(t))return qs(t,Ws)+"";if(Da(t))return wo?wo.call(t):"";var e=t+"";return e=="0"&&1/t==-Kc?"-0":e}var Zc=Ws;function Qc(t){return t==null?"":Zc(t)}var Ks=Qc;function Jc(t,e){return En(t)?t:wh(t,e)?[t]:Xs(Ks(t))}var Zs=Jc,jc=1/0;function ed(t){if(typeof t=="string"||Da(t))return t;var e=t+"";return e=="0"&&1/t==-jc?"-0":e}var Li=ed;function td(t,e){e=Zs(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 rd=td;function ad(t,e,r){var a=t==null?void 0:rd(t,e);return a===void 0?r:a}var nd=ad,id=function(){try{var t=Di(Object,"defineProperty");return t({},"",{}),t}catch{}}(),xo=id;function od(t,e,r){e=="__proto__"&&xo?xo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var sd=od,ld=Object.prototype,ud=ld.hasOwnProperty;function vd(t,e,r){var a=t[e];(!(ud.call(t,e)&&Ys(a,r))||r===void 0&&!(e in t))&&sd(t,e,r)}var fd=vd,hd=9007199254740991,cd=/^(?:0|[1-9]\d*)$/;function dd(t,e){var r=typeof t;return e=e??hd,!!e&&(r=="number"||r!="symbol"&&cd.test(t))&&t>-1&&t%1==0&&t<e}var gd=dd;function pd(t,e,r,a){if(!dr(t))return t;e=Zs(e,t);for(var n=-1,o=e.length,i=o-1,s=t;s!=null&&++n<o;){var l=Li(e[n]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(n!=i){var v=s[l];u=a?a(v,l,s):void 0,u===void 0&&(u=dr(v)?v:gd(e[n+1])?[]:{})}fd(s,l,u),s=s[l]}return t}var yd=pd;function md(t,e,r){return t==null?t:yd(t,e,r)}var bd=md;function Ed(t,e){var r=-1,a=t.length;for(e||(e=Array(a));++r<a;)e[r]=t[r];return e}var wd=Ed;function xd(t){return En(t)?qs(t,Li):Da(t)?[t]:wd(Xs(Ks(t)))}var Td=xd,Cd={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,o){},onSet:function(n){},canSet:function(n){return!0}};return e=Ee({},r,e),function(n,o){var i=e,s=this,l=s.length!==void 0,u=l?s:[s],v=l?s[0]:s;if(ge(n)){var f=n.indexOf(".")!==-1,d=f&&Td(n);if(i.allowGetting&&o===void 0){var h;return v&&(i.beforeGet(v),d&&v._private[i.field][n]===void 0?h=nd(v._private[i.field],d):h=v._private[i.field][n]),h}else if(i.allowSetting&&o!==void 0){var c=!i.immutableKeys[n];if(c){var p=ls({},n,o);i.beforeSet(s,p);for(var g=0,y=u.length;g<y;g++){var b=u[g];i.canSet(b)&&(d&&v._private[i.field][n]===void 0?bd(b._private[i.field],d,o):b._private[i.field][n]=o)}i.updateStyle&&s.updateStyle(),i.onSet(s),i.settingTriggersEvent&&s[i.triggerFnName](i.settingEvent)}}}else if(i.allowSetting&&De(n)){var m=n,T,C,S=Object.keys(m);i.beforeSet(s,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<u.length;w++){var D=u[w];i.canSet(D)&&(D._private[i.field][T]=C)}}i.updateStyle&&s.updateStyle(),i.onSet(s),i.settingTriggersEvent&&s[i.triggerFnName](i.settingEvent)}else if(i.allowBinding&&ze(n)){var L=n;s.on(i.bindingEvent,L)}else if(i.allowGetting&&n===void 0){var A;return v&&(i.beforeGet(v),A=v._private[i.field]),A}return s}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Ee({},r,e),function(n){var o=e,i=this,s=i.length!==void 0,l=s?i:[i];if(ge(n)){for(var u=n.split(/\s+/),v=u.length,f=0;f<v;f++){var d=u[f];if(!er(d)){var h=!o.immutableKeys[d];if(h)for(var c=0,p=l.length;c<p;c++)l[c]._private[o.field][d]=void 0}}o.triggerEvent&&i[o.triggerFnName](o.event)}else if(n===void 0){for(var g=0,y=l.length;g<y;g++)for(var b=l[g]._private[o.field],m=Object.keys(b),T=0;T<m.length;T++){var C=m[T],S=!o.immutableKeys[C];S&&(b[C]=void 0)}o.triggerEvent&&i[o.triggerFnName](o.event)}return i}}},Dd={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 o=this,i=Array.prototype.slice.call(arguments,0);return new _r(function(s,l){var u=function(h){o.off.apply(o,f),s(h)},v=i.concat([u]),f=v.concat([]);o.on.apply(o,v)})}}},Ne={};[ph,Cd,Dd].forEach(function(t){Ee(Ne,t)});var Sd={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=[],o=new $r(e),i=0;i<r.length;i++){for(var s=r[i],l=s._private,u=l.classes,v=!1,f=0;f<e.length;f++){var d=e[f],h=u.has(d);if(!h){v=!0;break}}v||(v=u.size!==e.length),v&&(l.classes=o,n.push(s))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){ke(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,o=[],i=0,s=a.length;i<s;i++)for(var l=a[i],u=l._private.classes,v=!1,f=0;f<e.length;f++){var d=e[f],h=u.has(d),c=!1;r||n&&!h?(u.add(d),c=!0):(!r||n&&h)&&(u.delete(d),c=!0),!v&&c&&(o.push(l),v=!0)}return o.length>0&&this.spawn(o).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:[]}},se={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},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 Fu(t.selector,e.selector)}),Ld=function(){for(var t={},e,r=0;r<jn.length;r++)e=jn[r],t[e.selector]=e.matches;return t}(),Ad=function(e,r){return Ld[e](r)},Od="("+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),o=n[0];r.checks.push({type:se.GROUP,value:o==="*"?o:o+"s"})}},{name:"state",query:!0,regex:Od,populate:function(e,r,a){var n=Lt(a,1),o=n[0];r.checks.push({type:se.STATE,value:o})}},{name:"id",query:!0,regex:"\\#("+Ce.id+")",populate:function(e,r,a){var n=Lt(a,1),o=n[0];r.checks.push({type:se.ID,value:Dr(o)})}},{name:"className",query:!0,regex:"\\.("+Ce.className+")",populate:function(e,r,a){var n=Lt(a,1),o=n[0];r.checks.push({type:se.CLASS,value:Dr(o)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ce.variable+")\\s*\\]",populate:function(e,r,a){var n=Lt(a,1),o=n[0];r.checks.push({type:se.DATA_EXIST,field:Dr(o)})}},{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),o=n[0],i=n[1],s=n[2],l=new RegExp("^"+Ce.string+"$").exec(s)!=null;l?s=s.substring(1,s.length-1):s=parseFloat(s),r.checks.push({type:se.DATA_COMPARE,field:Dr(o),operator:i,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ce.boolOp+")\\s*("+Ce.variable+")\\s*\\]",populate:function(e,r,a){var n=Lt(a,2),o=n[0],i=n[1];r.checks.push({type:se.DATA_BOOL,field:Dr(i),operator:o})}},{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),o=n[0],i=n[1],s=n[2];r.checks.push({type:se.META_COMPARE,field:Dr(o),operator:i,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:Ce.separator,populate:function(e,r){var a=e.currentSubject,n=e.edgeCount,o=e.compoundCount,i=e[e.length-1];a!=null&&(i.subject=a,e.currentSubject=null),i.edgeCount=n,i.compoundCount=o,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=Me();return s}},{name:"directedEdge",separator:!0,regex:Ce.directedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Me(),n=r,o=Me();return a.checks.push({type:se.DIRECTED_EDGE,source:n,target:o}),Kt(e,r,a),e.edgeCount++,o}else{var i=Me(),s=r,l=Me();return i.checks.push({type:se.NODE_SOURCE,source:s,target:l}),Kt(e,r,i),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:Ce.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var a=Me(),n=r,o=Me();return a.checks.push({type:se.UNDIRECTED_EDGE,nodes:[n,o]}),Kt(e,r,a),e.edgeCount++,o}else{var i=Me(),s=r,l=Me();return i.checks.push({type:se.NODE_NEIGHBOR,node:s,neighbor:l}),Kt(e,r,i),l}}},{name:"child",separator:!0,regex:Ce.child,populate:function(e,r){if(e.currentSubject==null){var a=Me(),n=Me(),o=e[e.length-1];return a.checks.push({type:se.CHILD,parent:o,child:n}),Kt(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var i=Me(),s=e[e.length-1],l=Me(),u=Me(),v=Me(),f=Me();return i.checks.push({type:se.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:se.TRUE}],f.checks.push({type:se.TRUE}),l.checks.push({type:se.PARENT,parent:f,child:v}),Kt(e,s,i),e.currentSubject=u,e.compoundCount++,v}else{var d=Me(),h=Me(),c=[{type:se.PARENT,parent:d,child:h}];return d.checks=r.checks,r.checks=c,e.compoundCount++,h}}},{name:"descendant",separator:!0,regex:Ce.descendant,populate:function(e,r){if(e.currentSubject==null){var a=Me(),n=Me(),o=e[e.length-1];return a.checks.push({type:se.DESCENDANT,ancestor:o,descendant:n}),Kt(e,r,a),e.compoundCount++,n}else if(e.currentSubject===r){var i=Me(),s=e[e.length-1],l=Me(),u=Me(),v=Me(),f=Me();return i.checks.push({type:se.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:se.TRUE}],f.checks.push({type:se.TRUE}),l.checks.push({type:se.ANCESTOR,ancestor:f,descendant:v}),Kt(e,s,i),e.currentSubject=u,e.compoundCount++,v}else{var d=Me(),h=Me(),c=[{type:se.ANCESTOR,ancestor:d,descendant:h}];return d.checks=r.checks,r.checks=c,e.compoundCount++,h}}},{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],o=n==null?null:n.type;o===se.DIRECTED_EDGE?n.type=se.NODE_TARGET:o===se.UNDIRECTED_EDGE&&(n.type=se.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 Nd=function(e){for(var r,a,n,o=0;o<ei.length;o++){var i=ei[o],s=i.name,l=e.match(i.regexObj);if(l!=null){a=l,r=i,n=s;var u=l[0];e=e.substring(u.length);break}}return{expr:r,match:a,name:n,remaining:e}},Id=function(e){var r=e.match(/^\s+/);if(r){var a=r[0];e=e.substring(a.length)}return e},Md=function(e){var r=this,a=r.inputText=e,n=r[0]=Me();for(r.length=1,a=Id(a);;){var o=Nd(a);if(o.expr==null)return Ie("The selector `"+e+"`is invalid"),!1;var i=o.match.slice(1),s=o.expr.populate(r,n,i);if(s===!1)return!1;if(s!=null&&(n=s),a=o.remaining,a.match(/^\s*$/))break}var l=r[r.length-1];r.currentSubject!=null&&(l.subject=r.currentSubject),l.edgeCount=r.edgeCount,l.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var v=r[u];if(v.compoundCount>0&&v.edgeCount>0)return Ie("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(v.edgeCount>1)return Ie("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;v.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},Rd=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(v){return v??""},r=function(v){return ge(v)?'"'+v+'"':e(v)},a=function(v){return" "+v+" "},n=function(v,f){var d=v.type,h=v.value;switch(d){case se.GROUP:{var c=e(h);return c.substring(0,c.length-1)}case se.DATA_COMPARE:{var p=v.field,g=v.operator;return"["+p+a(e(g))+r(h)+"]"}case se.DATA_BOOL:{var y=v.operator,b=v.field;return"["+e(y)+b+"]"}case se.DATA_EXIST:{var m=v.field;return"["+m+"]"}case se.META_COMPARE:{var T=v.operator,C=v.field;return"[["+C+a(e(T))+r(h)+"]]"}case se.STATE:return h;case se.ID:return"#"+h;case se.CLASS:return"."+h;case se.PARENT:case se.CHILD:return o(v.parent,f)+a(">")+o(v.child,f);case se.ANCESTOR:case se.DESCENDANT:return o(v.ancestor,f)+" "+o(v.descendant,f);case se.COMPOUND_SPLIT:{var S=o(v.left,f),E=o(v.subject,f),x=o(v.right,f);return S+(S.length>0?" ":"")+E+x}case se.TRUE:return""}},o=function(v,f){return v.checks.reduce(function(d,h,c){return d+(f===v&&c===0?"$":"")+n(h,f)},"")},i="",s=0;s<this.length;s++){var l=this[s];i+=o(l,l.subject),this.length>1&&s<this.length-1&&(i+=", ")}return this.toStringCache=i,i},kd={parse:Md,toString:Rd},Qs=function(e,r,a){var n,o=ge(e),i=oe(e),s=ge(a),l,u,v=!1,f=!1,d=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),f=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),v=!0),(o||s||v)&&(l=!o&&!i?"":""+e,u=""+a),v&&(e=l=l.toLowerCase(),a=u=u.toLowerCase()),r){case"*=":n=l.indexOf(u)>=0;break;case"$=":n=l.indexOf(u,l.length-u.length)>=0;break;case"^=":n=l.indexOf(u)===0;break;case"=":n=e===a;break;case">":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 f&&(e!=null||!d)&&(n=!n),n},Pd=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Bd=function(e){return e!==void 0},Ai=function(e,r){return e.data(r)},Fd=function(e,r){return e[r]()},Ue=[],Fe=function(e,r){return e.checks.every(function(a){return Ue[a.type](a,r)})};Ue[se.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};Ue[se.STATE]=function(t,e){var r=t.value;return Ad(r,e)};Ue[se.ID]=function(t,e){var r=t.value;return e.id()===r};Ue[se.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};Ue[se.META_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return Qs(Fd(e,r),a,n)};Ue[se.DATA_COMPARE]=function(t,e){var r=t.field,a=t.operator,n=t.value;return Qs(Ai(e,r),a,n)};Ue[se.DATA_BOOL]=function(t,e){var r=t.field,a=t.operator;return Pd(Ai(e,r),a)};Ue[se.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Bd(Ai(e,r))};Ue[se.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],a=t.nodes[1],n=e.source(),o=e.target();return Fe(r,n)&&Fe(a,o)||Fe(a,n)&&Fe(r,o)};Ue[se.NODE_NEIGHBOR]=function(t,e){return Fe(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Fe(t.neighbor,r)})};Ue[se.DIRECTED_EDGE]=function(t,e){return Fe(t.source,e.source())&&Fe(t.target,e.target())};Ue[se.NODE_SOURCE]=function(t,e){return Fe(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Fe(t.target,r)})};Ue[se.NODE_TARGET]=function(t,e){return Fe(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Fe(t.source,r)})};Ue[se.CHILD]=function(t,e){return Fe(t.child,e)&&Fe(t.parent,e.parent())};Ue[se.PARENT]=function(t,e){return Fe(t.parent,e)&&e.children().some(function(r){return Fe(t.child,r)})};Ue[se.DESCENDANT]=function(t,e){return Fe(t.descendant,e)&&e.ancestors().some(function(r){return Fe(t.ancestor,r)})};Ue[se.ANCESTOR]=function(t,e){return Fe(t.ancestor,e)&&e.descendants().some(function(r){return Fe(t.descendant,r)})};Ue[se.COMPOUND_SPLIT]=function(t,e){return Fe(t.subject,e)&&Fe(t.left,e)&&Fe(t.right,e)};Ue[se.TRUE]=function(){return!0};Ue[se.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};Ue[se.FILTER]=function(t,e){var r=t.value;return r(e)};var Gd=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===se.ID)return e.getElementById(r[0].checks[0].value).collection();var a=function(o){for(var i=0;i<r.length;i++){var s=r[i];if(Fe(s,o))return!0}return!1};return r.text()==null&&(a=function(){return!0}),e.filter(a)},zd=function(e){for(var r=this,a=0;a<r.length;a++){var n=r[a];if(Fe(n,e))return!0}return!1},Vd={matches:zd,filter:Gd},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:se.COLLECTION,value:e.collection()}]}):ze(e)?this.addQuery({checks:[{type:se.FILTER,value:e}]}):ge(e)?this.parse(e)||(this.invalid=!0):Ve("A selector must be created from a string; found "))},ar=rr.prototype;[kd,Vd].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,o,i,s){var l=n,u=this,v;if(l==null?v="":yt(l)&&l.length===1&&(v=l.id()),u.length===1&&v){var f=u[0]._private,d=f.traversalCache=f.traversalCache||{},h=d[r]=d[r]||[],c=gr(v),p=h[c];return p||(h[c]=e.call(u,n,o,i,s))}else return e.call(u,n,o,i,s)}},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 o=this[n],i=o._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 o=a[n];r.push(o)}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],o=n.parents();r=r||o,r=r.intersect(o)}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,o=0;o<n.length;o++)e.push(n[o]);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 o=0;o<n.length;o++){var i=n[o];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=[],o=new $r,i=t.cy(),s=i.hasCompoundNodes(),l=0;l<t.length;l++){var u=t[l];r?n.push(u):s&&a(n,o,u)}for(;n.length>0;){var v=n.shift();e(v),o.add(v.id()),s&&a(n,o,v)}return t}function Js(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n<a.length;n++){var o=a[n];e.has(o.id())||t.push(o)}}Ur.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Oi(this,t,e,Js)};function js(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,js)};function Ud(t,e,r){js(t,e,r),Js(t,e,r)}Ur.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Oi(this,t,e,Ud)};Ur.ancestors=Ur.parents;var ba,el;ba=el={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 $d=el,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],o=n._private.edges,i=0;i<o.length;i++){var s=o[i];!e&&s.isLoop()||(a+=t(n,s))}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(),o=0;o<n.length;o++){var i=n[o],s=i[t](r);s!==void 0&&(a===void 0||e(s,a))&&(a=s)}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,tl,rl=function(e,r,a){for(var n=0;n<e.length;n++){var o=e[n];if(!o.locked()){var i=o._private.position,s={x:r.x!=null?r.x-i.x:0,y:r.y!=null?r.y-i.y:0};o.isParent()&&!(s.x===0&&s.y===0)&&o.children().shift(s,a),o.dirtyBoundingBoxCache()}}},To={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){rl(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Nt=tl={position:Ne.data(To),silentPosition:Ne.data(Ee({},To,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){rl(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 o=0;o<this.length;o++){var i=this[o],s=void 0;(s=a(i,o))&&(r?i.silentPosition(s):i.position(s))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,a){var n;if(De(e)?(n={x:oe(e.x)?e.x:0,y:oe(e.y)?e.y:0},a=r):ge(e)&&oe(r)&&(n={x:0,y:0},n[e]=r),n!=null){var o=this.cy();o.startBatch();for(var i=0;i<this.length;i++){var s=this[i];if(!(o.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var l=s.position(),u={x:l.x+n.x,y:l.y+n.y};a?s.silentPosition(u):s.position(u)}}o.endBatch()}return this},silentShift:function(e,r){return De(e)?this.shift(e,!0):ge(e)&&oe(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var a=this[0],n=this.cy(),o=n.zoom(),i=n.pan(),s=De(e)?e:void 0,l=s!==void 0||r!==void 0&&ge(e);if(a&&a.isNode())if(l)for(var u=0;u<this.length;u++){var v=this[u];r!==void 0?v.position(e,(r-i[e])/o):s!==void 0&&v.position(As(s,o,i))}else{var f=a.position();return s=mn(f,o,i),e===void 0?s:s[e]}else if(!l)return;return this},relativePosition:function(e,r){var a=this[0],n=this.cy(),o=De(e)?e:void 0,i=o!==void 0||r!==void 0&&ge(e),s=n.hasCompoundNodes();if(a&&a.isNode())if(i)for(var l=0;l<this.length;l++){var u=this[l],v=s?u.parent():null,f=v&&v.length>0,d=f;f&&(v=v[0]);var h=d?v.position():{x:0,y:0};r!==void 0?u.position(e,r+h[e]):o!==void 0&&u.position({x:o.x+h.x,y:o.y+h.y})}else{var c=a.position(),p=s?a.parent():null,g=p&&p.length>0,y=g;g&&(p=p[0]);var b=y?p.position():{x:0,y:0};return o={x:c.x-b.x,y:c.y-b.y},e===void 0?o:o[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=tl,Fr,or;Fr=or={};or.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),o=e.x1*a+n.x,i=e.x2*a+n.x,s=e.y1*a+n.y,l=e.y2*a+n.y;return{x1:o,x2:i,y1:s,y2:l,w:i-o,h:l-s}};or.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)};or.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 s=i._private,l=i.children(),u=i.pstyle("compound-sizing-wrt-labels").value==="include",v={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")}},f=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),d=s.position;(f.w===0||f.h===0)&&(f={w:i.pstyle("width").pfValue,h:i.pstyle("height").pfValue},f.x1=d.x-f.w/2,f.x2=d.x+f.w/2,f.y1=d.y-f.h/2,f.y2=d.y+f.h/2);function h(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=v.width.left.value;v.width.left.units==="px"&&v.width.val>0&&(p=p*100/v.width.val);var g=v.width.right.value;v.width.right.units==="px"&&v.width.val>0&&(g=g*100/v.width.val);var y=v.height.top.value;v.height.top.units==="px"&&v.height.val>0&&(y=y*100/v.height.val);var b=v.height.bottom.value;v.height.bottom.units==="px"&&v.height.val>0&&(b=b*100/v.height.val);var m=h(v.width.val-f.w,p,g),T=m.biasDiff,C=m.biasComplementDiff,S=h(v.height.val-f.h,y,b),E=S.biasDiff,x=S.biasComplementDiff;s.autoPadding=c(f.w,f.h,i.pstyle("padding"),i.pstyle("padding-relative-to").value),s.autoWidth=Math.max(f.w,v.width.val),d.x=(-T+f.x1+f.x2+C)/2,s.autoHeight=Math.max(f.h,v.height.val),d.y=(-E+f.y1+f.y2+x)/2}for(var a=0;a<this.length;a++){var n=this[a],o=n._private;(!o.compoundBoundsClean||t)&&(r(n),e.batching()||(o.compoundBoundsClean=!0))}return this};var wt=function(e){return e===1/0||e===-1/0?0:e},At=function(e,r,a,n,o){n-r===0||o-a===0||r==null||a==null||n==null||o==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=o>e.y2?o:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},vr=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,o=n.rstyle,i=o.arrowWidth/2,s=r.pstyle(a+"-arrow-shape").value,l,u;if(s!=="none"){a==="source"?(l=o.srcX,u=o.srcY):a==="target"?(l=o.tgtX,u=o.tgtY):(l=o.midX,u=o.midY);var v=n.arrowBounds=n.arrowBounds||{},f=v[a]=v[a]||{};f.x1=l-i,f.y1=u-i,f.x2=l+i,f.y2=u+i,f.w=f.x2-f.x1,f.h=f.y2-f.y1,Ha(f,1),At(e,f.x1,f.y1,f.x2,f.y2)}}},Un=function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var o=r._private,i=o.rstyle,s=r.pstyle(n+"label").strValue;if(s){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),v=ra(i,"labelWidth",a),f=ra(i,"labelHeight",a),d=ra(i,"labelX",a),h=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=f,x=v,w=x/2,D=E/2,L,A,N,O;if(g)L=d-w,A=d+w,N=h-D,O=h+D;else{switch(l.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(u.value){case"top":N=h-E,O=h;break;case"center":N=h-D,O=h+D;break;case"bottom":N=h,O=h+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=o.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(o.rstyle,"labelAngle",a):y.pfValue,G=Math.cos(z),F=Math.sin(z),U=(L+A)/2,H=(N+O)/2;if(!g){switch(l.value){case"left":U=A;break;case"right":U=L;break}switch(u.value){case"top":H=O;break;case"bottom":H=N;break}}var _=function(he,ae){return he=he-U,ae=ae-H,{x:he*G-ae*F+U,y:he*F+ae*G+H}},Q=_(L,N),J=_(L,O),q=_(A,N),V=_(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(o.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 o=r.pstyle("outline-offset").value,i=r.pstyle("shape").value,s=n+o,l=(e.w+s*2)/e.w,u=(e.h+s*2)/e.h,v=0,f=0;["diamond","pentagon","round-triangle"].includes(i)?(l=(e.w+s*2.4)/e.w,f=-s/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(i)?l=(e.w+s*2.4)/e.w:i==="star"?(l=(e.w+s*2.8)/e.w,u=(e.h+s*2.6)/e.h,f=-s/3.8):i==="triangle"?(l=(e.w+s*2.8)/e.w,u=(e.h+s*2.4)/e.h,f=-s/1.4):i==="vee"&&(l=(e.w+s*4.4)/e.w,u=(e.h+s*3.8)/e.h,f=-s*.5);var d=e.h*u-e.h,h=e.w*l-e.w;if(Xa(e,[Math.ceil(d/2),Math.ceil(h/2)]),v!=0||f!==0){var c=ff(e,v,f);Ns(e,c)}}}},Hd=function(e,r){var a=e._private.cy,n=a.styleEnabled(),o=a.headless(),i=pt(),s=e._private,l=e.isNode(),u=e.isEdge(),v,f,d,h,c,p,g=s.rstyle,y=l&&n?e.pstyle("bounds-expansion").pfValue:[0],b=function(le){return le.pstyle("display").value!=="none"},m=!n||b(e)&&(!u||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),l&&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;v=c-N,f=c+N,d=p-M,h=p+M,At(i,v,d,f,h),n&&r.includeOutlines&&Yd(i,e)}else if(u&&r.includeEdges)if(n&&!o){var R=e.pstyle("curve-style").strValue;if(v=Math.min(g.srcX,g.midX,g.tgtX),f=Math.max(g.srcX,g.midX,g.tgtX),d=Math.min(g.srcY,g.midY,g.tgtY),h=Math.max(g.srcY,g.midY,g.tgtY),v-=D,f+=D,d-=D,h+=D,At(i,v,d,f,h),R==="haystack"){var k=g.haystackPts;if(k&&k.length===2){if(v=k[0].x,d=k[0].y,f=k[1].x,h=k[1].y,v>f){var P=v;v=f,f=P}if(d>h){var B=d;d=h,h=B}At(i,v-D,d-D,f+D,h+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];v=F.x-D,f=F.x+D,d=F.y-D,h=F.y+D,At(i,v,d,f,h)}}}else{var U=e.source(),H=U.position(),_=e.target(),Q=_.position();if(v=H.x,f=Q.x,d=H.y,h=Q.y,v>f){var J=v;v=f,f=J}if(d>h){var q=d;d=h,h=q}v-=D,f+=D,d-=D,h+=D,At(i,v,d,f,h)}if(n&&r.includeEdges&&u&&(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=s.bodyBounds=s.bodyBounds||{};to(ie,i),Xa(ie,y),Ha(ie,1),n&&(v=i.x1,f=i.x2,d=i.y1,h=i.y2,At(i,v-x,d-x,f+x,h+x));var he=s.overlayBounds=s.overlayBounds||{};to(he,i),Xa(he,y),Ha(he,1);var ae=s.labelBounds=s.labelBounds||{};ae.all!=null?vf(ae.all):ae.all=pt(),n&&r.includeLabels&&(r.includeMainLabels&&Un(i,e,null),u&&(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},al=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},nl=function(e){if(e.isEdge()){var r=e.source().position(),a=e.target().position(),n=function(i){return Math.round(i)};return Nv([n(r.x),n(r.y),n(a.x),n(a.y)])}else return 0},Co=function(e,r){var a=e._private,n,o=e.isEdge(),i=r==null?Do:al(r),s=i===Do,l=nl(e),u=a.bbCachePosKey===l,v=r.useCache&&u,f=function(p){return p._private.bbCache==null||p._private.styleDirty},d=!v||f(e)||o&&f(e.source())||f(e.target());if(d?(u||e.recalculateRenderedStyle(v),n=Hd(e,Ea),a.bbCache=n,a.bbCachePosKey=l):n=a.bbCache,!s){var h=e.isNode();n=pt(),(r.includeNodes&&h||r.includeEdges&&!h)&&(r.includeOverlays?vr(n,a.overlayBounds):vr(n,a.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!o||r.includeSourceLabels&&r.includeTargetLabels)?vr(n,a.labelBounds.all):(r.includeMainLabels&&vr(n,a.labelBounds.mainRot),r.includeSourceLabels&&vr(n,a.labelBounds.sourceRot),r.includeTargetLabels&&vr(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Ea={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Do=al(Ea),So=rt(Ea);or.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=So(t),e=Co(this[0],t);else{e=pt(),t=t||Ea;var r=So(t),a=this,n=a.cy(),o=n.styleEnabled();if(o)for(var i=0;i<a.length;i++){var s=a[i],l=s._private,u=nl(s),v=l.bbCachePosKey===u,f=r.useCache&&v&&!l.styleDirty;s.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var d=0;d<a.length;d++){var h=a[d];vr(e,Co(h,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};or.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};or.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),a=r.hasCompoundNodes(),n=r.collection();if(a&&(n=e.filter(function(u){return u.isParent()}),e=e.not(n)),De(t)){var o=t;t=function(){return o}}var i=function(v,f){return v._private.bbAtOldPos=t(v,f)},s=function(v){return v._private.bbAtOldPos};r.startBatch(),e.forEach(i).silentPositions(t),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var l=uf(this.boundingBox({useCache:!1}));return e.silentPositions(s),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),r.endBatch(),l};Fr.boundingbox=Fr.bb=Fr.boundingBox;Fr.renderedBoundingbox=Fr.renderedBoundingBox;var Xd=or,la,La;la=La={};var il=function(e){e.uppercaseName=Wi(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Wi(e.outerName),la[e.name]=function(){var a=this[0],n=a._private,o=n.cy,i=o._private.styleEnabled;if(a)if(i){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var s=a.pstyle(e.name);switch(s.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},la["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,o=n.cy,i=o._private.styleEnabled;if(a)if(i){var s=a[e.name](),l=a.pstyle("border-width").pfValue,u=2*a.padding();return s+l+u}else return 1},la["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},la["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};il({name:"width"});il({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 qd=La,Wd=function(e,r){if(e.isEdge())return r(e)},Kd=function(e,r){if(e.isEdge()){var a=e.cy();return mn(r(e),a.zoom(),a.pan())}},Zd=function(e,r){if(e.isEdge()){var a=e.cy(),n=a.pan(),o=a.zoom();return r(e).map(function(i){return mn(i,o,n)})}},Qd=function(e){return e.renderer().getControlPoints(e)},Jd=function(e){return e.renderer().getSegmentPoints(e)},jd=function(e){return e.renderer().getSourceEndpoint(e)},eg=function(e){return e.renderer().getTargetEndpoint(e)},tg=function(e){return e.renderer().getEdgeMidpoint(e)},Lo={controlPoints:{get:Qd,mult:!0},segmentPoints:{get:Jd,mult:!0},sourceEndpoint:{get:jd},targetEndpoint:{get:eg},midpoint:{get:tg}},rg=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},ag=Object.keys(Lo).reduce(function(t,e){var r=Lo[e],a=rg(e);return t[e]=function(){return Wd(this,r.get)},r.mult?t[a]=function(){return Zd(this,r.get)}:t[a]=function(){return Kd(this,r.get)},t},{}),ng=Ee({},_d,Xd,qd,ag);/*!
Event object based on jQuery events, MIT license
https://jquery.org/license/
https://tldrlegal.com/license/mit-license
https://github.com/jquery/jquery/blob/master/src/event.js
*/var ol=function(e,r){this.recycle(e,r)};function aa(){return!1}function Va(){return!0}ol.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(),o=this.cy.pan();this.renderedPosition={x:a.x*n+o.x,y:a.y*n+o.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 sl=/^([^.]+)(\.(?:[^.]+))?$/,ig=".*",ll={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},Ao=Object.keys(ll),og={};function Cn(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:og,e=arguments.length>1?arguments[1]:void 0,r=0;r<Ao.length;r++){var a=Ao[r];this[a]=t[a]||ll[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var nr=Cn.prototype,ul=function(e,r,a,n,o,i,s){ze(n)&&(o=n,n=null),s&&(i==null?i=s:i=Ee({},i,s));for(var l=ke(a)?a:a.split(/\s+/),u=0;u<l.length;u++){var v=l[u];if(!er(v)){var f=v.match(sl);if(f){var d=f[1],h=f[2]?f[2]:null,c=r(e,v,d,h,n,o,i);if(c===!1)break}}}},Oo=function(e,r){return e.addEventFields(e.context,r),new ol(r.type,r)},sg=function(e,r,a){if(Su(a)){r(e,a);return}else if(De(a)){r(e,Oo(e,a));return}for(var n=ke(a)?a:a.split(/\s+/),o=0;o<n.length;o++){var i=n[o];if(!er(i)){var s=i.match(sl);if(s){var l=s[1],u=s[2]?s[2]:null,v=Oo(e,{type:l,namespace:u,target:e.context});r(e,v)}}}};nr.on=nr.addListener=function(t,e,r,a,n){return ul(this,function(o,i,s,l,u,v,f){ze(v)&&o.listeners.push({event:i,callback:v,type:s,namespace:l,qualifier:u,conf:f})},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=Pv(this.listeners));for(var o=this.listeners,i=function(u){var v=o[u];ul(n,function(f,d,h,c,p,g){if((v.type===h||t==="*")&&(!c&&v.namespace!==".*"||v.namespace===c)&&(!p||f.qualifierCompare(v.qualifier,p))&&(!g||v.callback===g))return o.splice(u,1),!1},t,e,r,a)},s=o.length-1;s>=0;s--)i(s);return this};nr.removeAllListeners=function(){return this.removeListener("*")};nr.emit=nr.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,ke(e)||(e=[e]),sg(this,function(o,i){r!=null&&(a=[{event:i.event,type:i.type,namespace:i.namespace,callback:r}],n=a.length);for(var s=function(v){var f=a[v];if(f.type===i.type&&(!f.namespace||f.namespace===i.namespace||f.namespace===ig)&&o.eventMatches(o.context,f,i)){var d=[i];e!=null&&Fv(d,e),o.beforeEmit(o.context,f,i),f.conf&&f.conf.one&&(o.listeners=o.listeners.filter(function(p){return p!==f}));var h=o.callbackContext(o.context,f,i),c=f.callback.apply(h,d);o.afterEmit(o.context,f,i),c===!1&&(i.stopPropagation(),i.preventDefault())}},l=0;l<n;l++)s(l);o.bubble(o.context)&&!i.isPropagationStopped()&&o.parent(o.context).emit(i,e)},t),this.emitting--,this};var lg={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},vl={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],a=r._private;a.emitter||(a.emitter=new Cn(lg,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,a){for(var n=Ua(r),o=0;o<this.length;o++){var i=this[o];i.emitter().on(e,n,a)}return this},removeListener:function(e,r,a){for(var n=Ua(r),o=0;o<this.length;o++){var i=this[o];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),o=0;o<this.length;o++){var i=this[o];i.emitter().one(e,n,a)}return this},once:function(e,r,a){for(var n=Ua(r),o=0;o<this.length;o++){var i=this[o];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(vl);var fl={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,o=0;o<n.length;o++){var i=n[o],s=r?e.apply(r,[i,o,n]):e(i,o,n);s&&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],o=e.has(n);o||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,o=e,i=this.length<e.length,s=i?n:o,l=i?o:n,u=0;u<s.length;u++){var v=s[u];l.has(v)&&a.push(v)}return a},xor:function(e){var r=this._private.cy;ge(e)&&(e=r.$(e));var a=this.spawn(),n=this,o=e,i=function(l,u){for(var v=0;v<l.length;v++){var f=l[v],d=f._private.data.id,h=u.hasElementWithId(d);h||a.push(f)}};return i(n,o),i(o,n),a},diff:function(e){var r=this._private.cy;ge(e)&&(e=r.$(e));var a=this.spawn(),n=this.spawn(),o=this.spawn(),i=this,s=e,l=function(v,f,d){for(var h=0;h<v.length;h++){var c=v[h],p=c._private.data.id,g=f.hasElementWithId(p);g?o.merge(c):d.push(c)}};return l(i,s,a),l(s,i,n),{left:a,right:n,both:o}},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(),o=0;o<e.length;o++){var i=e[o],s=!this.has(i);s&&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 o=r.map,i=0;i<e.length;i++){var s=e[i],l=s._private.data.id,u=!o.has(l);if(u){var v=this.length++;this[v]=s,o.set(l,{ele:s,index:v})}}return this},unmergeAt:function(e){var r=this[e],a=r.id(),n=this._private,o=n.map;this[e]=void 0,o.delete(a);var i=e===this.length-1;if(this.length>1&&!i){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[e]=l,o.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map,o=n.get(a);if(!o)return this;var i=o.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,o=0;o<n.length;o++){var i=n[o],s=r?e.apply(r,[i,o,n]):e(i,o,n);a.push(s)}return a},reduce:function(e,r){for(var a=r,n=this,o=0;o<n.length;o++)a=e(a,n[o],o,n);return a},max:function(e,r){for(var a=-1/0,n,o=this,i=0;i<o.length;i++){var s=o[i],l=r?e.apply(r,[s,i,o]):e(s,i,o);l>a&&(a=l,n=s)}return{value:a,ele:n}},min:function(e,r){for(var a=1/0,n,o=this,i=0;i<o.length;i++){var s=o[i],l=r?e.apply(r,[s,i,o]):e(s,i,o);l<a&&(a=l,n=s)}return{value:a,ele:n}}},Ae=fl;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}},hl=function(e,r){var a=e.cy(),n=a.hasCompoundNodes();function o(v){var f=v.pstyle("z-compound-depth");return f.value==="auto"?n?v.zDepth():0:f.value==="bottom"?-1:f.value==="top"?mi:0}var i=o(e)-o(r);if(i!==0)return i;function s(v){var f=v.pstyle("z-index-compare");return f.value==="auto"&&v.isNode()?1:0}var l=s(e)-s(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},un={forEach:function(e,r){if(ze(e))for(var a=this.length,n=0;n<a;n++){var o=this[n],i=r?e.apply(r,[o,n,this]):e(o,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 o=e;o>=0&&o<r&&o<n;o++)a.push(this[o]);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(hl)},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 o=r.source,i=r.target,s=o.zDepth(),l=i.zDepth();return Math.max(s,l,0)}}}};un.each=un.forEach;var vg=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":qe(Symbol))!=e&&qe(Symbol.iterator)!=e;r&&(un[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},o=0,i=this.length;return ls({next:function(){return o<i?n.value=a[o++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};vg();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()}),o=this.cy(),i=r.eles,s=function(S){return S.id()},l=ha(a,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=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}},v=r.spacingFactor&&r.spacingFactor!==1,f=function(){if(!v)return null;for(var S=pt(),E=0;E<n.length;E++){var x=n[E],w=l(x,E);hf(S,w.x,w.y)}return S},d=f(),h=ha(function(C,S){var E=l(C,S);if(v){var x=Math.abs(r.spacingFactor);E=u(x,d,E)}return r.transform!=null&&(E=r.transform(C,E)),E},s);if(r.animate){for(var c=0;c<n.length;c++){var p=n[c],g=h(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=o.animation({fit:{boundingBox:i.boundingBoxAt(h),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=o.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}),_r.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(h),r.fit&&o.fit(r.eles,r.padding),r.zoom!=null&&o.zoom(r.zoom),r.pan&&o.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 cl(t,e,r){var a=r._private,n=a.styleCache=a.styleCache||[],o;return(o=n[t])!=null||(o=n[t]=e(r)),o}function Dn(t,e){return t=gr(t),function(a){return cl(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 cl(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(o){return o._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(),o=this;e=!!(e||e===void 0),n&&(o=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=o;return e?i.emitAndNotify("style"):i.emit("style"),o.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var a=this[r];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){this.cleanStyle();var o=a._private.style[e];return o??(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,o=a.style();if(De(e)){var i=e;o.applyBypass(this,i,n),this.emitAndNotify("style")}else if(ge(e))if(r===void 0){var s=this[0];return s?o.getStylePropertyValue(s,e):void 0}else o.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?o.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),o=this;if(e===void 0)for(var i=0;i<o.length;i++){var s=o[i];n.removeAllBypasses(s,a)}else{e=e.split(/\s+/);for(var l=0;l<o.length;l++){var u=o[l];n.removeBypasses(u,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,o=a.pstyle("opacity").value;if(!r)return o;var i=n.data.parent?a.parents():null;if(i)for(var s=0;s<i.length;s++){var l=i[s],u=l.pstyle("opacity").value;o=u*o}return o}},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 o=a[n];if(!e(o))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 o=this[0],i=n.hasCompoundNodes();if(o){var s=o._private;if(!e(o))return!1;if(o.isNode())return!i||$n(o,a);var l=s.source,u=s.target;return r(l)&&(!i||$n(l,r))&&(l===u||r(u)&&(!i||$n(u,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)}),cg=Dn("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&qr(t)});et.interactive=Sn("interactive",Ni({ok:hg,parentOk:cg,edgeOkViaNode:qr}));et.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var dg=Dn("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&qr(t)}),gg=qr;et.visible=Sn("visible",Ni({ok:dg,edgeOkViaNode:gg}));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 No(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 o=e[0];this.on(t.event,o)}else if(e.length===0||e.length===1&&ke(e[0])){for(var i=e.length===1?e[0]:null,s=0;s<this.length;s++){var l=this[s],u=!t.ableField||l._private[t.ableField],v=l._private[t.field]!=t.value;if(t.overrideAble){var f=t.overrideAble(l);if(f!==void 0&&(u=f,!f))return this}u&&(l._private[t.field]=t.value,v&&r.push(l))}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]=No({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),jt[t.off]=No({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 ot={},Io=function(e){return function(a){for(var n=this,o=[],i=0;i<n.length;i++){var s=n[i];if(s.isNode()){for(var l=!1,u=s.connectedEdges(),v=0;v<u.length;v++){var f=u[v],d=f.source(),h=f.target();if(e.noIncomingEdges&&h===s&&d!==s||e.noOutgoingEdges&&d===s&&h!==s){l=!0;break}}l||o.push(s)}}return this.spawn(o,!0).filter(a)}},Mo=function(e){return function(r){for(var a=this,n=[],o=0;o<a.length;o++){var i=a[o];if(i.isNode())for(var s=i.connectedEdges(),l=0;l<s.length;l++){var u=s[l],v=u.source(),f=u.target();e.outgoing&&v===i?(n.push(u),n.push(f)):e.incoming&&f===i&&(n.push(u),n.push(v))}}return this.spawn(n,!0).filter(r)}},Ro=function(e){return function(r){for(var a=this,n=[],o={};;){var i=e.outgoing?a.outgoers():a.incomers();if(i.length===0)break;for(var s=!1,l=0;l<i.length;l++){var u=i[l],v=u.id();o[v]||(o[v]=!0,n.push(u),s=!0)}if(!s)break;a=i}return this.spawn(n,!0).filter(r)}};ot.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Ee(ot,{roots:Io({noIncomingEdges:!0}),leaves:Io({noOutgoingEdges:!0}),outgoers:xt(Mo({outgoing:!0}),"outgoers"),successors:Ro({outgoing:!0}),incomers:xt(Mo({incoming:!0}),"incomers"),predecessors:Ro({incoming:!0})});Ee(ot,{neighborhood:xt(function(t){for(var e=[],r=this.nodes(),a=0;a<r.length;a++)for(var n=r[a],o=n.connectedEdges(),i=0;i<o.length;i++){var s=o[i],l=s.source(),u=s.target(),v=n===l?u:l;v.length>0&&e.push(v[0]),e.push(s[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});ot.neighbourhood=ot.neighborhood;ot.closedNeighbourhood=ot.closedNeighborhood;ot.openNeighbourhood=ot.openNeighborhood;Ee(ot,{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:ko({attr:"source"}),targets:ko({attr:"target"})});function ko(t){return function(r){for(var a=[],n=0;n<this.length;n++){var o=this[n],i=o._private[t.attr];i&&a.push(i)}return this.spawn(a,!0).filter(r)}}Ee(ot,{edgesWith:xt(Po(),"edgesWith"),edgesTo:xt(Po({thisIsSrc:!0}),"edgesTo")});function Po(t){return function(r){var a=[],n=this._private.cy,o=t||{};ge(r)&&(r=n.$(r));for(var i=0;i<r.length;i++)for(var s=r[i]._private.edges,l=0;l<s.length;l++){var u=s[l],v=u._private.data,f=this.hasElementWithId(v.source)&&r.hasElementWithId(v.target),d=r.hasElementWithId(v.source)&&this.hasElementWithId(v.target),h=f||d;h&&((o.thisIsSrc||o.thisIsTgt)&&(o.thisIsSrc&&!f||o.thisIsTgt&&!d)||a.push(u))}return this.spawn(a,!0)}}Ee(ot,{connectedEdges:xt(function(t){for(var e=[],r=this,a=0;a<r.length;a++){var n=r[a];if(n.isNode())for(var o=n._private.edges,i=0;i<o.length;i++){var s=o[i];e.push(s)}}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(Bo(),"parallelEdges"),codirectedEdges:xt(Bo({codirected:!0}),"codirectedEdges")});function Bo(t){var e={codirected:!1};return t=Ee({},e,t),function(a){for(var n=[],o=this.edges(),i=t,s=0;s<o.length;s++)for(var l=o[s],u=l._private,v=u.source,f=v._private.data.id,d=u.data.target,h=v._private.edges,c=0;c<h.length;c++){var p=h[c],g=p._private.data,y=g.target,b=g.source,m=y===d&&b===f,T=f===y&&d===b;(i.codirected&&m||!i.codirected&&(m||T))&&n.push(p)}return this.spawn(n,!0).filter(a)}}Ee(ot,{components:function(e){var r=this,a=r.cy(),n=a.collection(),o=e==null?r.nodes():e.nodes(),i=[];e!=null&&o.empty()&&(o=e.sources());var s=function(v,f){n.merge(v),o.unmerge(v),f.merge(v)};if(o.empty())return r.spawn();var l=function(){var v=a.collection();i.push(v);var f=o[0];s(f,v),r.bfs({directed:!1,roots:f,visit:function(h){return s(h,v)}}),v.forEach(function(d){d.connectedEdges().forEach(function(h){r.has(h)&&v.has(h.source())&&v.has(h.target())&&v.merge(h)})})};do l();while(o.length>0);return i},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});ot.componentsOf=ot.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 o=new Ft,i=!1;if(!r)r=[];else if(r.length>0&&De(r[0])&&!Ca(r[0])){i=!0;for(var s=[],l=new $r,u=0,v=r.length;u<v;u++){var f=r[u];f.data==null&&(f.data={});var d=f.data;if(d.id==null)d.id=Ss();else if(e.hasElementWithId(d.id)||l.has(d.id))continue;var h=new yn(e,f,!1);s.push(h),l.add(d.id)}r=s}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||!o.has(y))&&(a&&o.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=o),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 hs(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 o=!1,i={},s=t.data.source,l=t.data.target;s!=null&&s!=n.source&&(i.source=""+s,o=!0),l!=null&&l!=n.target&&(i.target=""+l,o=!0),o&&(e=e.move(i))}else{var u="parent"in t.data,v=t.data.parent;u&&(v!=null||n.parent!=null)&&v!=n.parent&&(v===void 0&&(v=null),v!=null&&(v=""+v),e=e.move({parent:v}))}}t.position&&e.position(t.position);var f=function(p,g,y){var b=t[p];b!=null&&b!==a[p]&&(b?e[g]():e[y]())};return f("removed","remove","restore"),f("selected","select","unselect"),f("selectable","selectify","unselectify"),f("locked","lock","unlock"),f("grabbable","grabify","ungrabify"),f("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 h=0;return a.classes.forEach(function(c){return d.classes+=h++===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(),o=new yn(t,n,!1);e.push(o)}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,o=[],i=[],s,l=0,u=r.length;l<u;l++){var v=r[l];e&&!v.removed()||(v.isNode()?o.push(v):i.push(v))}s=o.concat(i);var f,d=function(){s.splice(f,1),f--};for(f=0;f<s.length;f++){var h=s[f],c=h._private,p=c.data;if(h.clearTraversalCache(),!(!e&&!c.removed)){if(p.id===void 0)p.id=Ss();else if(oe(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(h.isNode()){var y=c.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(h.isEdge()){for(var b=h,m=["source","target"],T=m.length,C=!1,S=0;S<T;S++){var E=m[S],x=p[E];oe(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:h,index:0}),c.removed=!1,e&&a.addToPool(h)}for(var L=0;L<o.length;L++){var A=o[L],N=A._private.data;oe(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(s.length>0){for(var B=s.length===r.length?r:new tt(a,s),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={},o=r._private.cy;function i(O){for(var M=O._private.edges,R=0;R<M.length;R++)l(M[R])}function s(O){for(var M=O._private.children,R=0;R<M.length;R++)l(M[R])}function l(O){var M=n[O.id()];e&&O.removed()||M||(n[O.id()]=!0,O.isNode()?(a.push(O),i(O),s(O)):a.unshift(O))}for(var u=0,v=r.length;u<v;u++){var f=r[u];l(f)}function d(O,M){var R=O._private.edges;tr(R,M),O.clearTraversalCache()}function h(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&&o.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];h(S),S.isBundledBezier()&&S.dirtyBoundingBoxCache()}}else{var E=y.parent();E.length!==0&&p(E,y)}e&&(y._private.removed=!0)}var x=o._private.elements;o._private.hasCompoundNodes=!1;for(var w=0;w<x.length;w++){var D=x[w];if(D.isParent()){o._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,o=function(c){return c==null?c:""+c};if(t.source!==void 0||t.target!==void 0){var i=o(t.source),s=o(t.target),l=i!=null&&e.hasElementWithId(i),u=s!=null&&e.hasElementWithId(s);(l||u)&&(e.batch(function(){r.remove(a,n),r.emitAndNotify("moveout");for(var h=0;h<r.length;h++){var c=r[h],p=c._private.data;c.isEdge()&&(l&&(p.source=i),u&&(p.target=s))}r.restore(a,n)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var v=o(t.parent),f=v===null||e.hasElementWithId(v);if(f){var d=v===null?void 0:v;e.batch(function(){var h=r.remove(a,n);h.emitAndNotify("moveout");for(var c=0;c<r.length;c++){var p=r[c],g=p._private.data;p.isNode()&&(g.parent=d)}h.restore(a,n)}),r.emitAndNotify("move")}}return this};[zs,Sd,qa,Jt,Ur,$d,Tn,ng,vl,fl,ug,un,Wa,et,jt,ot].forEach(function(t){Ee(Be,t)});var pg={add:function(e){var r,a=this;if(yt(e)){var n=e;if(n._private.cy===a)r=n.restore();else{for(var o=[],i=0;i<n.length;i++){var s=n[i];o.push(s.json())}r=new tt(a,o)}}else if(ke(e)){var l=e;r=new tt(a,l)}else if(De(e)&&(ke(e.nodes)||ke(e.edges))){for(var u=e,v=[],f=["nodes","edges"],d=0,h=f.length;d<h;d++){var c=f[d],p=u[c];if(ke(p))for(var g=0,y=p.length;g<y;g++){var b=Ee({group:c},p[g]);v.push(b)}}r=new tt(a,v)}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 yg(t,e,r,a){var n=4,o=.001,i=1e-7,s=10,l=11,u=1/(l-1),v=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var f=0;f<4;++f)if(typeof arguments[f]!="number"||isNaN(arguments[f])||!isFinite(arguments[f]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var d=v?new Float32Array(l):new Array(l);function h(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((h(L,A)*D+c(L,A))*D+p(L))*D}function y(D,L,A){return 3*h(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<l;++D)d[D]=g(D*u,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<s);return O}function C(D){for(var L=0,A=1,N=l-1;A!==N&&d[A]<=D;++A)L+=u;--A;var O=(D-d[A])/(d[A+1]-d[A]),M=L+O*u,R=y(M,t,r);return R>=o?b(D,M):R===0?M:T(D,L,L+u)}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 mg=function(){function t(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,o){var i={x:a.x+o.dx*n,v:a.v+o.dv*n,tension:a.tension,friction:a.friction};return{dx:i.v,dv:t(i)}}function r(a,n){var o={dx:a.v,dv:t(a)},i=e(a,n*.5,o),s=e(a,n*.5,i),l=e(a,n,s),u=1/6*(o.dx+2*(i.dx+s.dx)+l.dx),v=1/6*(o.dv+2*(i.dv+s.dv)+l.dv);return a.x=a.x+u*n,a.v=a.v+v*n,a}return function a(n,o,i){var s={x:-1,v:0,tension:null,friction:null},l=[0],u=0,v=1/1e4,f=16/1e3,d,h,c;for(n=parseFloat(n)||500,o=parseFloat(o)||20,i=i||null,s.tension=n,s.friction=o,d=i!==null,d?(u=a(n,o),h=u/i*f):h=f;c=r(c||s,h),l.push(1+c.x),u+=16,Math.abs(c.x)>v&&Math.abs(c.v)>v;);return d?function(p){return l[p*(l.length-1)|0]}:u}}(),Pe=function(e,r,a,n){var o=yg(e,r,a,n);return function(i,s,l){return i+(s-i)*o(l)}},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=mg(e,r,a);return function(o,i,s){return o+(i-o)*n(s)}},"cubic-bezier":Pe};function Fo(t,e,r,a,n){if(a===1||e===r)return r;var o=n(e,r,a);return t==null||((t.roundValue||t.color)&&(o=Math.round(o)),t.min!==void 0&&(o=Math.max(o,t.min)),t.max!==void 0&&(o=Math.min(o,t.max))),o}function Go(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 o=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var i=Go(t,n),s=Go(e,n);if(oe(i)&&oe(s))return Fo(o,i,s,r,a);if(ke(i)&&ke(s)){for(var l=[],u=0;u<s.length;u++){var v=i[u],f=s[u];if(v!=null&&f!=null){var d=Fo(o,v,f,r,a);l.push(d)}else l.push(f)}return l}}function bg(t,e,r,a){var n=!a,o=t._private,i=e._private,s=i.easing,l=i.startTime,u=a?t:t.cy(),v=u.style();if(!i.easingImpl)if(s==null)i.easingImpl=Ka.linear;else{var f;if(ge(s)){var d=v.parse("transition-timing-function",s);f=d.value}else f=s;var h,c;ge(f)?(h=f,c=[]):(h=f[1],c=f.slice(2).map(function(B){return+B})),c.length>0?(h==="spring"&&c.push(i.duration),i.easingImpl=Ka[h].apply(null,c)):i.easingImpl=Ka[h]}var p=i.easingImpl,g;if(i.duration===0?g=1:g=(r-l)/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=o.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)&&(o.zoom=pa(o.minZoom,Lr(x,w,g,p),o.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=v.properties[R.name],P=Lr(R,M,g,p,k);v.overrideBypass(t,O,P)}t.emit("style")}}return i.progress=g,g}function na(t,e){return t==null||e==null?!1:oe(t)&&oe(e)?!0:!!(t&&e)}function Eg(t,e,r,a){var n=e._private;n.started=!0,n.startTime=r-n.progress*n.duration}function zo(t,e){var r=e._private.aniEles,a=[];function n(v,f){var d=v._private,h=d.animation.current,c=d.animation.queue,p=!1;if(h.length===0){var g=c.shift();g&&h.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=h.length-1;b>=0;b--){var m=h[b],T=m._private;if(T.stopped){h.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||Eg(v,m,t),bg(v,m,t,f),T.applying&&(T.applying=!1),y(T.frames),T.step!=null&&T.step(t),m.completed()&&(h.splice(b,1),T.hooked=!1,T.playing=!1,T.started=!1,y(T.completes)),p=!0)}return!f&&h.length===0&&c.length===0&&a.push(v),p}for(var o=!1,i=0;i<r.length;i++){var s=r[i],l=n(s);o=o||l}var u=n(e,!0);(o||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}var wg={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(o){zo(o,e),r()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(o,i){zo(i,e)},a.beforeRenderPriorities.animations):r()}},xg={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},dl={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Cn(xg,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(dl);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 o;ge(e.eles)?o=r.$(e.eles):o=e.eles!=null?e.eles:r.$();var i=new n(Ee({},e,{cy:r,eles:o}));return i}};Za.createLayout=Za.makeLayout=Za.layout;var Tg={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 o=this.renderer();this.destroyed()||!o||o.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 o=a[n],i=e[o],s=r.getElementById(o);s.data(i)}})}},Cg=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 o=this._private.renderer;return o.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=Cg(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 lt={},va="t",Dg="f";lt.apply=function(t){for(var e=this,r=e._private,a=r.cy,n=a.collection(),o=0;o<t.length;o++){var i=t[o],s=e.getContextMeta(i);if(!s.empty){var l=e.getContextStyle(s),u=e.applyContextStyle(s,l,i);i._private.appliedInitStyle?e.updateTransitions(i,u.diffProps):i._private.appliedInitStyle=!0;var v=e.updateStyleHints(i);v&&n.push(i)}}return n};lt.getPropertiesDiff=function(t,e){var r=this,a=r._private.propDiffs=r._private.propDiffs||{},n=t+"-"+e,o=a[n];if(o)return o;for(var i=[],s={},l=0;l<r.length;l++){var u=r[l],v=t[l]===va,f=e[l]===va,d=v!==f,h=u.mappedProperties.length>0;if(d||f&&h){var c=void 0;d&&h||d?c=u.properties:h&&(c=u.mappedProperties);for(var p=0;p<c.length;p++){for(var g=c[p],y=g.name,b=!1,m=l+1;m<r.length;m++){var T=r[m],C=e[m]===va;if(C&&(b=T.properties[g.name]!=null,b))break}!s[y]&&!b&&(s[y]=!0,i.push(y))}}}return a[n]=i,i};lt.getContextMeta=function(t){for(var e=this,r="",a,n=t._private.styleCxtKey||"",o=0;o<e.length;o++){var i=e[o],s=i.selector&&i.selector.matches(t);s?r+=va:r+=Dg}return a=e.getPropertiesDiff(n,r),t._private.styleCxtKey=r,{key:r,diffPropNames:a,empty:a.length===0}};lt.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}},o=0;o<r.length;o++){var i=r[o],s=e[o]===va;if(s)for(var l=0;l<i.properties.length;l++){var u=i.properties[l];n[u.name]=u}}return a[e]=n,n};lt.applyContextStyle=function(t,e,r){for(var a=this,n=t.diffPropNames,o={},i=a.types,s=0;s<n.length;s++){var l=n[s],u=e[l],v=r.pstyle(l);if(!u)if(v)v.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(v!==u){if(u.mapped===i.fn&&v!=null&&v.mapping!=null&&v.mapping.value===u.value){var f=v.mapping,d=f.fnValue=u.value(r);if(d===f.prevFnValue)continue}var h=o[l]={prev:v};a.applyParsedProperty(r,u),h.next=r.pstyle(l),h.next&&h.next.bypass&&(h.next=h.next.bypassed)}}return{diffProps:o}};lt.updateStyleHints=function(t){var e=t._private,r=this,a=r.propertyGroupNames,n=r.propertyGroupKeys,o=function(K,ie,he){return r.getPropertiesHash(K,ie,he)},i=e.styleKey;if(t.removed())return!1;var s=e.group==="nodes",l=t._private.style;a=Object.keys(l);for(var u=0;u<n.length;u++){var v=n[u];e.styleKeys[v]=[Ir,oa]}for(var f=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])},h=function(K,ie){f(K,ie),d(K,ie)},c=function(K,ie){for(var he=0;he<K.length;he++){var ae=K.charCodeAt(he);f(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=l[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;h(g(N),S),!w&&A!=null&&c(A,S)}else c(m.strValue,S)}}for(var O=[Ir,oa],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=Ov(O[0],O[1]);var P=e.styleKeys;e.labelDimsKey=Wt(P.labelDimensions);var B=o(t,["label"],P.labelDimensions);if(e.labelKey=Wt(B),e.labelStyleKey=Wt(Ra(P.commonLabel,B)),!s){var z=o(t,["source-label"],P.labelDimensions);e.sourceLabelKey=Wt(z),e.sourceLabelStyleKey=Wt(Ra(P.commonLabel,z));var G=o(t,["target-label"],P.labelDimensions);e.targetLabelKey=Wt(G),e.targetLabelStyleKey=Wt(Ra(P.commonLabel,G))}if(s){var F=e.styleKeys,U=F.nodeBody,H=F.nodeBorder,_=F.nodeOutline,Q=F.backgroundImage,J=F.compound,q=F.pie,V=[U,H,_,Q,J,q].filter(function(Z){return Z!=null}).reduce(Ra,[Ir,oa]);e.nodeKey=Wt(V),e.hasPie=q!=null&&q[0]!==Ir&&q[1]!==oa}return i!==e.styleKey};lt.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};lt.applyParsedProperty=function(t,e){var r=this,a=e,n=t._private.style,o,i=r.types,s=r.properties[a.name].type,l=a.bypass,u=n[a.name],v=u&&u.bypass,f=t._private,d="mapping",h=function(U){return U==null?null:U.pfValue!=null?U.pfValue:U.value},c=function(){var U=h(u),H=h(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",l)),a.delete)return n[a.name]=void 0,c(),!0;if(a.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,c(),!0):!1:(c(),!0);if(a.deleteBypass)return u?u.bypass?(n[a.name]=u.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=f.data,b=0;b<g.length&&y;b++){var m=g[b];y=y[m]}if(y==null)return p(),!1;var T;if(oe(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),s.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)];o={bypass:a.bypass,name:a.name,value:O,strValue:"rgb("+O[0]+", "+O[1]+", "+O[2]+")"}}else if(s.number){var M=a.valueMin+(a.valueMax-a.valueMin)*T;o=this.parse(a.name,M,a.bypass,d)}else return!1;if(!o)return p(),!1;o.mapping=a,a=o;break}case i.data:{for(var R=a.field.split("."),k=f.data,P=0;P<R.length&&k;P++){var B=R[P];k=k[B]}if(k!=null&&(o=this.parse(a.name,k,a.bypass,d)),!o)return p(),!1;o.mapping=a,a=o;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(o=this.parse(a.name,G,a.bypass,d),!o)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;o.mapping=Bt(a),a=o;break}case void 0:break;default:return!1}return l?(v?a.bypassed=u.bypassed:a.bypassed=u,n[a.name]=a):v?u.bypassed=a:n[a.name]=a,c(),!0};lt.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,o=Object.keys(n),i=0;i<o.length;i++){var s=o[i],l=n[s];l!=null&&(l.bypass?l.bypassed=null:n[s]=null)}}};lt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};lt.updateTransitions=function(t,e){var r=this,a=t._private,n=t.pstyle("transition-property").value,o=t.pstyle("transition-duration").pfValue,i=t.pstyle("transition-delay").pfValue;if(n.length>0&&o>0){for(var s={},l=!1,u=0;u<n.length;u++){var v=n[u],f=t.pstyle(v),d=e[v];if(d){var h=d.prev,c=h,p=d.next!=null?d.next:f,g=!1,y=void 0,b=1e-6;c&&(oe(c.pfValue)&&oe(p.pfValue)?(g=p.pfValue-c.pfValue,y=c.pfValue+b*g):oe(c.value)&&oe(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&&(s[v]=p.strValue,this.applyBypass(t,v,y),l=!0))}}if(!l)return;a.transitioning=!0,new _r(function(m){i>0?t.delayAnimation(i).play().promise().then(m):m()}).then(function(){return t.animation({style:s,duration:o,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)};lt.checkTrigger=function(t,e,r,a,n,o){var i=this.properties[e],s=n(i);s!=null&&s(r,a)&&o(i)};lt.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(o){return o.triggersZOrder},function(){n._private.cy.notify("zorder",t)})};lt.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(o){o.isBundledBezier()&&o.dirtyBoundingBoxCache()}),n.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||a==="none")&&t.connectedEdges().forEach(function(o){o.dirtyBoundingBoxCache()})})};lt.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,o=[],i=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;s<n.properties.length;s++){var l=n.properties[s],u=l.name,v=this.parse(u,r,!0);v&&o.push(v)}}else if(ge(e)){var f=this.parse(e,r,!0);f&&o.push(f)}else if(De(e)){var d=e;a=r;for(var h=Object.keys(d),c=0;c<h.length;c++){var p=h[c],g=d[p];if(g===void 0&&(g=d[dn(p)]),g!==void 0){var y=this.parse(p,g,!0);y&&o.push(y)}}}else return!1;if(o.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<o.length;E++){var x=o[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],o=n._private.style[e],i=this.properties[e].type,s=i.color,l=i.mutiple,u=o?o.pfValue!=null?o.pfValue:o.value:null;!o||!o.bypass?this.applyBypass(n,e,r):(o.value=r,o.pfValue!=null&&(o.pfValue=r),s?o.strValue="rgb("+r.join(",")+")":l?o.strValue=r.join(" "):o.strValue=""+r,this.updateStyleHints(n)),this.checkTriggers(n,e,u,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 o=t[n],i={},s=0;s<e.length;s++){var l=e[s],u=this.properties[l],v=o.pstyle(u.name);if(!(!v||!v.bypass)){var f="",d=this.parse(l,f,!0),h=i[u.name]={prev:v};this.applyParsedProperty(o,d),h.next=o.pstyle(u.name)}}this.updateStyleHints(o),r&&this.updateTransitions(o,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 o=r.properties[n],i=r.getStylePropertyValue(t,o.name,e);i!=null&&(a[o.name]=i,a[dn(o.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 o=n.type,i=t.pstyle(n.name);if(i){var s=i.value,l=i.units,u=i.strValue;if(r&&o.number&&s!=null&&oe(s)){var v=t.cy().zoom(),f=function(g){return g*v},d=function(g,y){return f(g)+y},h=ke(s),c=h?l.every(function(p){return p!=null}):l!=null;return c?h?s.map(function(p,g){return d(p,l[g])}).join(" "):d(s,l):h?s.map(function(p){return ge(p)?p:""+f(p)}).join(" "):""+f(s)}else if(u!=null)return u}return null}};Gt.getAnimationStartStyle=function(t,e){for(var r={},a=0;a<e.length;a++){var n=e[a],o=n.name,i=t.pstyle(o);i!==void 0&&(De(i)?i=this.parse(o,i.strValue):i=this.parse(o,i)),i&&(r[o]=i)}return r};Gt.getPropsList=function(t){var e=this,r=[],a=t,n=e.properties;if(a)for(var o=Object.keys(a),i=0;i<o.length;i++){var s=o[i],l=a[s],u=n[s]||n[yi(s)],v=this.parse(u.name,l);v&&r.push(v)}return r};Gt.getNonDefaultPropertiesHash=function(t,e,r){var a=r.slice(),n,o,i,s,l,u;for(l=0;l<e.length;l++)if(n=e[l],o=t.pstyle(n,!1),o!=null)if(o.pfValue!=null)a[0]=ca(s,a[0]),a[1]=da(s,a[1]);else for(i=o.strValue,u=0;u<i.length;u++)s=i.charCodeAt(u),a[0]=ca(s,a[0]),a[1]=da(s,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,o=a.style||a.css,i=Object.keys(o);e.selector(n);for(var s=0;s<i.length;s++){var l=i[s],u=o[l];e.css(l,u)}}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,o={},i=0;i<n.length;i++){var s=n[i];o[s.name]=s.strValue}t.push({selector:a?a.toString():"core",style:o})}return t};var Mi={};Mi.appendFromString=function(t){var e=this,r=this,a=""+t,n,o,i;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){a.length>n.length?a=a.substr(n.length):a=""}function l(){o.length>i.length?o=o.substr(i.length):o=""}for(;;){var u=a.match(/^\s*$/);if(u)break;var v=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!v){Ie("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=v[0];var f=v[1];if(f!=="core"){var d=new rr(f);if(d.invalid){Ie("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),s();continue}}var h=v[2],c=!1;o=h;for(var p=[];;){var g=o.match(/^\s*$/);if(g)break;var y=o.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){Ie("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),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),l();continue}var C=r.parse(b,m);if(!C){Ie("Skipping property: Invalid property definition in: "+i),l();continue}p.push({name:b,val:m}),l()}if(c){s();break}r.selector(f);for(var S=0;S<p.length;S++){var E=p[S];r.css(E.name,E.val)}s()}return r};Mi.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var je={};(function(){var t=Xe,e=Mu,r=ku,a=Pu,n=Bu,o=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+")\\)$"},s=[`^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:o("data")},layoutData:{mapping:!0,regex:o("layoutData")},scratch:{mapping:!0,regex:o("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:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","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 l={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}},u=je.types,v=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],f=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],d=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],c=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification}],p=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any}],g=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],y=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],b=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],m=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],T=function(V,Z){return Z.value==="label"?-V.poolIndex():Z.pfValue},C=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:T},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:T},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],S=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],E=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],x=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],w=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],D=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],L=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],A=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],N=[];je.pieBackgroundN=16,N.push({name:"pie-size",type:u.sizeMaybePercent});for(var O=1;O<=je.pieBackgroundN;O++)N.push({name:"pie-"+O+"-background-color",type:u.color}),N.push({name:"pie-"+O+"-background-size",type:u.percent}),N.push({name:"pie-"+O+"-background-opacity",type:u.zeroOneNumber});var M=[],R=je.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.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,h,v,f,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:h,mainLabel:v,sourceLabel:f,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 _=G[H],Q=k[_.pointsTo],J={name:_.name,alias:!0,pointsTo:Q};k.push(J),k[_.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(l,u){for(var v=1;v<=je.pieBackgroundN;v++){var f=u.name.replace("{{i}}",v),d=u.value;l[f]=d}return l},{}),{"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(l,u){return je.arrowPrefixes.forEach(function(v){var f=v+"-"+u.name,d=u.value;l[f]=d}),l},{})),r={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var o=n.name,i=e[o],s=this.parse(o,i);r[o]=s}}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 o=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,i=r?"t":"f",s=""+e,l=Ts(t,s,i,o),u=n.propCache=n.propCache||[],v;return(v=u[l])||(v=u[l]=n.parseImplWarn(t,e,r,a)),(r||a==="mapping")&&(v=Bt(v),v&&(v.value=Bt(v.value))),v};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 o=n.properties[t],i=e,s=n.types;if(!o||e===void 0)return null;o.alias&&(o=o.pointsTo,t=o.name);var l=ge(e);l&&(e=e.trim());var u=o.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(ze(e))return{name:t,value:e,strValue:"fn",mapped:s.fn,bypass:r};var v,f;if(!(!l||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(v=new RegExp(s.data.regex).exec(e))){if(r)return!1;var d=s.data;return{name:t,value:v,strValue:""+e,mapped:d,field:v[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(s.mapData.regex).exec(e))){if(r||u.multiple)return!1;var h=s.mapData;if(!(u.color||u.number))return!1;var c=this.parse(t,f[4]);if(!c||c.mapped)return!1;var p=this.parse(t,f[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(u.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:f,strValue:""+e,mapped:h,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:c.value,valueMax:p.value,bypass:r}}}if(u.multiple&&a!=="multiple"){var m;if(l?m=e.split(/\s+/):ke(e)?m=e:m=[e],u.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 u.validate&&!u.validate(T,C)?null:u.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<u.enums.length;V++){var Z=u.enums[V];if(Z===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var A,N="px";if(u.units&&(A=u.units),u.implicitUnits&&(N=u.implicitUnits),!u.unitless)if(l){var O="px|em"+(u.allowPercent?"|\\%":"");A&&(O=A);var M=e.match("^("+Xe+")("+O+")?$");M&&(e=M[1],A=M[2]||N)}else(!A||u.implicitUnits)&&(A=N);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=i,L();if(u.integer&&!Du(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var R={name:t,value:e,strValue:""+e+(A||""),units:A,bypass:r};return u.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:of(e)),A==="%"&&(R.pfValue=e/100),R}else if(u.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(u.color){var F=$u(e);return F?{name:t,value:F,pfValue:F,strValue:"rgb("+F[0]+","+F[1]+","+F[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var U=L();if(U)return U}for(var H=u.regexes?u.regexes:[u.regex],_=0;_<H.length;_++){var Q=new RegExp(H[_]),J=Q.exec(e);if(J)return{name:t,value:u.singleRegexMatchValue?J[1]:J,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.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()},st=it.prototype;st.instanceString=function(){return"style"};st.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 o=n[0]._private;o.styleDirty=!0,o.appliedInitStyle=!1}),this};st.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};st.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};st.selector=function(t){var e=t==="core"?null:new rr(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};st.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],o=r[n.name];o===void 0&&(o=r[dn(n.name)]),o!==void 0&&this.cssRule(n.name,o)}else e.length===2&&this.cssRule(e[0],e[1]);return this};st.style=st.css;st.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};st.append=function(t){return cs(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)};[lt,Aa,Ii,Gt,Ln,Mi,je,An].forEach(function(t){Ee(st,t)});it.types=st.types;it.properties=st.properties;it.propertyGroups=st.propertyGroups;it.propertyGroupNames=st.propertyGroupNames;it.propertyGroupKeys=st.propertyGroupKeys;var Sg={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return cs(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()}},Lg="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=Lg),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,o,i,s;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;o=e[0],i=o.x,s=o.y,oe(i)&&(r.x=i),oe(s)&&(r.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&oe(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,o,i,s,l,u;if(!this._private.panningEnabled)return this;switch(a.length){case 1:De(e)&&(s=a[0],l=s.x,u=s.y,oe(l)&&(n.x+=l),oe(u)&&(n.y+=u),this.emit("pan viewport"));break;case 2:o=e,i=r,(o==="x"||o==="y")&&oe(i)&&(n[o]+=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(oe(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(Au(e)){var o=e;a={x1:o.x1,y1:o.y1,x2:o.x2,y2:o.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(),s=this.height(),l;if(r=oe(r)?r:0,!isNaN(i)&&!isNaN(s)&&i>0&&s>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){l=Math.min((i-2*r)/a.w,(s-2*r)/a.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(i-l*(a.x1+a.x2))/2,y:(s-l*(a.y1+a.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,r){var a=this._private;if(r==null){var n=e;e=n.min,r=n.max}return oe(e)&&oe(r)&&e<=r?(a.minZoom=e,a.maxZoom=r):oe(e)&&r===void 0&&e<=a.maxZoom?a.minZoom=e:oe(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,o,i,s=!1;if(r.zoomingEnabled||(s=!0),oe(e)?i=e:De(e)&&(i=e.level,e.position!=null?o=mn(e.position,n,a):e.renderedPosition!=null&&(o=e.renderedPosition),o!=null&&!r.panningEnabled&&(s=!0)),i=i>r.maxZoom?r.maxZoom:i,i=i<r.minZoom?r.minZoom:i,s||!oe(i)||i===n||o!=null&&(!oe(o.x)||!oe(o.y)))return null;if(o!=null){var l=a,u=n,v=i,f={x:-v/u*(o.x-l.x)+o.x,y:-v/u*(o.y-l.y)+o.y};return{zoomed:!0,panned:!0,zoom:v,pan:f}}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,o=[],i=!1,s=!1;if(!e)return this;if(oe(e.zoom)||(a=!1),De(e.pan)||(n=!1),!a&&!n)return this;if(a){var l=e.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?i=!0:(r.zoom=l,o.push("zoom"))}if(n&&(!i||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;oe(u.x)&&(r.pan.x=u.x,s=!1),oe(u.y)&&(r.pan.y=u.y,s=!1),s||o.push("pan")}return o.length>0&&(o.push("viewport"),this.emit(o.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(),o=this.width(),i=this.height();r=r===void 0?this._private.zoom:r;var s={x:(o-r*(n.x1+n.x2))/2,y:(i-r*(n.y1+n.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?function(){var n=a.window().getComputedStyle(r),o=function(s){return parseFloat(n.getPropertyValue(s))};return{width:r.clientWidth-o("padding-left")-o("padding-right"),height:r.clientHeight-o("padding-top")-o("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 o=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=r;var i=Ye!==void 0&&a!==void 0&&!e.headless,s=e;s.layout=Ee({name:i?"grid":"null"},s.layout),s.renderer=Ee({name:i?"canvas":"null"},s.renderer);var l=function(c,p,g){return p!==void 0?p:g!==void 0?g:c},u=this._private={container:a,ready:!1,options:s,elements:new tt(this),listeners:[],aniEles:new tt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?i:s.styleEnabled,zoom:oe(s.zoom)?s.zoom:1,pan:{x:De(s.pan)&&oe(s.pan.x)?s.pan.x:0,y:De(s.pan)&&oe(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var v=function(c,p){var g=c.some(Ou);if(g)return _r.all(c).then(p);p(c)};u.styleEnabled&&r.setStyle([]);var f=Ee({},s,s.renderer);r.initRenderer(f);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()};v([s.style,s.elements],function(h){var c=h[0],p=h[1];u.styleEnabled&&r.style().append(c),d(p,function(){r.startAnimationLoop(),u.ready=!0,ze(s.ready)&&r.on("ready",s.ready);for(var g=0;g<o.length;g++){var y=o[g];r.on("ready",y)}n&&(n.readies=[]),r.emit("ready")},s.done)})},vn=xa.prototype;Ee(vn,{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 Ye;var r=this._private.container.ownerDocument;return r===void 0||r==null?Ye:r.defaultView||Ye},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(),o=function(T){return r.getElementById(T.id())};if(De(e)){if(r.startBatch(),e.elements){var i={},s=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))s(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var v=l[u],f=e.elements[v];ke(f)&&s(f,v)}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 o(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 h=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],c=0;c<h.length;c++){var p=h[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}}});vn.$id=vn.getElementById;[pg,wg,dl,ti,Za,Tg,ri,Qa,Sg,br,wa].forEach(function(t){Ee(vn,t)});var Ag={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}},Og={maximal:!1,acyclic:!1},Ar=function(e){return e.scratch("breadthfirst")},Vo=function(e,r){return e.scratch("breadthfirst",r)};function gl(t){this.options=Ee({},Ag,Og,t)}gl.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().filter(function(ae){return!ae.isParent()}),o=a,i=e.directed,s=e.acyclic||e.maximal||e.maximalAdjustments>0,l=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(yt(e.roots))u=e.roots;else if(ke(e.roots)){for(var v=[],f=0;f<e.roots.length;f++){var d=e.roots[f],h=r.getElementById(d);v.push(h)}u=r.collection(v)}else if(ge(e.roots))u=r.$(e.roots);else if(i)u=n.roots();else{var c=a.components();u=r.collection();for(var p=function(te){var le=c[te],ce=le.maxDegree(!1),ve=le.filter(function(ye){return ye.degree(!1)===ce});u=u.add(ve)},g=0;g<c.length;g++)p(g)}var y=[],b={},m=function(te,le){y[le]==null&&(y[le]=[]);var ce=y[le].length;y[le].push(te),Vo(te,{index:ce,depth:le})},T=function(te,le){var ce=Ar(te),ve=ce.depth,ye=ce.index;y[ve][ye]=null,m(te,le)};o.bfs({roots:u,directed:e.directed,visit:function(te,le,ce,ve,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 le=y[te],ce=0;ce<le.length;ce++){var ve=le[ce];if(ve==null){le.splice(ce,1),ce--;continue}Vo(ve,{depth:te,index:ce})}},w=function(){for(var te=0;te<y.length;te++)x(te)},D=function(te,le){for(var ce=Ar(te),ve=te.incomers().filter(function(I){return I.isNode()&&a.has(I)}),ye=-1,Oe=te.id(),Te=0;Te<ve.length;Te++){var xe=ve[Te],Se=Ar(xe);ye=Math.max(ye,Se.depth)}if(ce.depth<=ye){if(!e.acyclic&&le[Oe])return null;var ee=ye+1;return T(te,ee),le[Oe]=ee,!0}return!1};if(i&&s){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 le=Ar(te).depth,ce=te.neighborhood(),ve=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<le&&(ve+=Se/I,ye++)}}}}return ye=Math.max(1,ye),ve=ve/ye,ye===0&&(ve=0),U[te.id()]=ve,ve},_=function(te,le){var ce=H(te),ve=H(le),ye=ce-ve;return ye===0?gs(te.id(),le.id()):ye};e.depthSort!==void 0&&(_=e.depthSort);for(var Q=0;Q<y.length;Q++)y[Q].sort(_),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:l.x1+l.w/2,y:l.x1+l.h/2},ie=y.reduce(function(ae,te){return Math.max(ae,te.length)},0),he=function(te){var le=Ar(te),ce=le.depth,ve=le.index,ye=y[ce].length,Oe=Math.max(l.w/((e.grid?ie:ye)+1),k),Te=Math.max(l.h/(y.length+1),k),xe=Math.min(l.w/2/y.length,l.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*ve;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+(ve+1-(ye+1)/2)*Oe,y:(ce+1)*Te};return Se}};return a.nodes().layoutPositions(this,e,he),this};var Ng={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 pl(t){this.options=Ee({},Ng,t)}pl.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,o=a.nodes().not(":parent");e.sort&&(o=o.sort(e.sort));for(var i=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:i.x1+i.w/2,y:i.y1+i.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/o.length:e.sweep,u=l/Math.max(1,o.length-1),v,f=0,d=0;d<o.length;d++){var h=o[d],c=h.layoutDimensions(e),p=c.w,g=c.h;f=Math.max(f,p,g)}if(oe(e.radius)?v=e.radius:o.length<=1?v=0:v=Math.min(i.h,i.w)/2-f,o.length>1&&e.avoidOverlap){f*=1.75;var y=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),m=Math.sqrt(f*f/(y*y+b*b));v=Math.max(m,v)}var T=function(S,E){var x=e.startAngle+E*u*(n?1:-1),w=v*Math.cos(x),D=v*Math.sin(x),L={x:s.x+w,y:s.y+D};return L};return a.nodes().layoutPositions(this,e,T),this};var Ig={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 yl(t){this.options=Ee({},Ig,t)}yl.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,o=n.nodes().not(":parent"),i=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),s={x:i.x1+i.w/2,y:i.y1+i.h/2},l=[],u=0,v=0;v<o.length;v++){var f=o[v],d=void 0;d=e.concentric(f),l.push({value:d,node:f}),f._private.scratch.concentric=d}o.updateStyle();for(var h=0;h<o.length;h++){var c=o[h],p=c.layoutDimensions(e);u=Math.max(u,p.w,p.h)}l.sort(function(ae,te){return te.value-ae.value});for(var g=e.levelWidth(o),y=[[]],b=y[0],m=0;m<l.length;m++){var T=l[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=u+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 _={},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,he={x:s.x+V*Math.cos(ie),y:s.y+V*Math.sin(ie)};_[K.node.id()]=he}return n.nodes().layoutPositions(this,e,function(ae){var te=ae.id();return _[te]}),this};var _n,Mg={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({},Mg,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),a=r.filter(function(n){var o=n.source().data("id"),i=n.target().data("id"),s=e.some(function(u){return u.data("id")===o}),l=e.some(function(u){return u.data("id")===i});return!s||!l});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?_n=!0:_n=!1;var a=Rg(e,r,t);_n&&Bg(a),t.randomize&&Fg(a);var n=_t(),o=function(){Gg(a,e,t),t.fit===!0&&e.fit(t.padding)},i=function(d){return!(r.stopped||d>=t.numIter||(zg(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature<t.minTemp))},s=function(){if(t.animate===!0||t.animate===!1)o(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var d=t.eles.nodes(),h=ml(a,t,d);d.layoutPositions(r,t,h)}},l=0,u=!0;if(t.animate===!0){var v=function f(){for(var d=0;u&&d<t.refresh;)u=i(l),l++,d++;if(!u)$o(a,t),s();else{var h=_t();h-n>=t.animationThreshold&&o(),an(f)}};v()}else{for(;u;)u=i(l),l++;$o(a,t),s()}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 Rg=function(e,r,a){for(var n=a.eles.edges(),o=a.eles.nodes(),i=pt(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:o.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:i.w,clientHeight:i.h,boundingBox:i},l=a.eles.components(),u={},v=0;v<l.length;v++)for(var f=l[v],d=0;d<f.length;d++){var h=f[d];u[h.id()]=v}for(var v=0;v<s.nodeSize;v++){var c=o[v],p=c.layoutDimensions(a),g={};g.isLocked=c.locked(),g.id=c.data("id"),g.parentId=c.data("parent"),g.cmptId=u[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,s.layoutNodes.push(g),s.idToIndex[g.id]=v}for(var y=[],b=0,m=-1,T=[],v=0;v<s.nodeSize;v++){var c=s.layoutNodes[v],C=c.parentId;C!=null?s.layoutNodes[s.idToIndex[C]].children.push(c.id):(y[++m]=c.id,T.push(c.id))}for(s.graphSet.push(T);b<=m;){var S=y[b++],E=s.idToIndex[S],h=s.layoutNodes[E],x=h.children;if(x.length>0){s.graphSet.push(x);for(var v=0;v<x.length;v++)y[++m]=x[v]}}for(var v=0;v<s.graphSet.length;v++)for(var w=s.graphSet[v],d=0;d<w.length;d++){var D=s.idToIndex[w[d]];s.indexToGraph[D]=v}for(var v=0;v<s.edgeSize;v++){var L=n[v],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=s.idToIndex[A.sourceId],R=s.idToIndex[A.targetId],k=s.indexToGraph[M],P=s.indexToGraph[R];if(k!=P){for(var B=kg(A.sourceId,A.targetId,s),z=s.graphSet[B],G=0,g=s.layoutNodes[M];z.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],G++;for(g=s.layoutNodes[R];z.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],G++;N*=G*a.nestingFactor}A.idealLength=N,A.elasticity=O,s.layoutEdges.push(A)}return s},kg=function(e,r,a){var n=Pg(e,r,0,a);return 2>n.count?0:n.graph},Pg=function t(e,r,a,n){var o=n.graphSet[a];if(-1<o.indexOf(e)&&-1<o.indexOf(r))return{count:2,graph:a};for(var i=0,s=0;s<o.length;s++){var l=o[s],u=n.idToIndex[l],v=n.layoutNodes[u].children;if(v.length!==0){var f=n.indexToGraph[n.idToIndex[v[0]]],d=t(e,r,f,n);if(d.count!==0)if(d.count===1){if(i++,i===2)break}else return d}}return{count:i,graph:a}},Bg,Fg=function(e,r){for(var a=e.clientWidth,n=e.clientHeight,o=0;o<e.nodeSize;o++){var i=e.layoutNodes[o];i.children.length===0&&!i.isLocked&&(i.positionX=Math.random()*a,i.positionY=Math.random()*n)}},ml=function(e,r,a){var n=e.boundingBox,o={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(a.forEach(function(i){var s=e.layoutNodes[e.idToIndex[i.data("id")]];o.x1=Math.min(o.x1,s.positionX),o.x2=Math.max(o.x2,s.positionX),o.y1=Math.min(o.y1,s.positionY),o.y2=Math.max(o.y2,s.positionY)}),o.w=o.x2-o.x1,o.h=o.y2-o.y1),function(i,s){var l=e.layoutNodes[e.idToIndex[i.data("id")]];if(r.boundingBox){var u=(l.positionX-o.x1)/o.w,v=(l.positionY-o.y1)/o.h;return{x:n.x1+u*n.w,y:n.y1+v*n.h}}else return{x:l.positionX,y:l.positionY}}},Gg=function(e,r,a){var n=a.layout,o=a.eles.nodes(),i=ml(e,a,o);o.positions(i),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},zg=function(e,r,a){Vg(e,r),_g(e),Yg(e,r),Hg(e),Xg(e)},Vg=function(e,r){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],o=n.length,i=0;i<o;i++)for(var s=e.layoutNodes[e.idToIndex[n[i]]],l=i+1;l<o;l++){var u=e.layoutNodes[e.idToIndex[n[l]]];Ug(s,u,e,r)}},Uo=function(e){return-e+2*e*Math.random()},Ug=function(e,r,a,n){var o=e.cmptId,i=r.cmptId;if(!(o!==i&&!a.isCompound)){var s=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;s===0&&l===0&&(s=Uo(u),l=Uo(u));var v=$g(e,r,s,l);if(v>0)var f=n.nodeOverlap*v,d=Math.sqrt(s*s+l*l),h=f*s/d,c=f*l/d;else var p=fn(e,s,l),g=fn(r,-1*s,-1*l),y=g.x-p.x,b=g.y-p.y,m=y*y+b*b,d=Math.sqrt(m),f=(e.nodeRepulsion+r.nodeRepulsion)/m,h=f*y/d,c=f*b/d;e.isLocked||(e.offsetX-=h,e.offsetY-=c),r.isLocked||(r.offsetX+=h,r.offsetY+=c)}},$g=function(e,r,a,n){if(a>0)var o=e.maxX-r.minX;else var o=r.maxX-e.minX;if(n>0)var i=e.maxY-r.minY;else var i=r.maxY-e.minY;return o>=0&&i>=0?Math.sqrt(o*o+i*i):0},fn=function(e,r,a){var n=e.positionX,o=e.positionY,i=e.height||1,s=e.width||1,l=a/r,u=i/s,v={};return r===0&&0<a||r===0&&0>a?(v.x=n,v.y=o+i/2,v):0<r&&-1*u<=l&&l<=u?(v.x=n+s/2,v.y=o+s*a/2/r,v):0>r&&-1*u<=l&&l<=u?(v.x=n-s/2,v.y=o-s*a/2/r,v):0<a&&(l<=-1*u||l>=u)?(v.x=n+i*r/2/a,v.y=o+i/2,v):(0>a&&(l<=-1*u||l>=u)&&(v.x=n-i*r/2/a,v.y=o-i/2),v)},_g=function(e,r){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],o=e.idToIndex[n.sourceId],i=e.layoutNodes[o],s=e.idToIndex[n.targetId],l=e.layoutNodes[s],u=l.positionX-i.positionX,v=l.positionY-i.positionY;if(!(u===0&&v===0)){var f=fn(i,u,v),d=fn(l,-1*u,-1*v),h=d.x-f.x,c=d.y-f.y,p=Math.sqrt(h*h+c*c),g=Math.pow(n.idealLength-p,2)/n.elasticity;if(p!==0)var y=g*h/p,b=g*c/p;else var y=0,b=0;i.isLocked||(i.offsetX+=y,i.offsetY+=b),l.isLocked||(l.offsetX-=y,l.offsetY-=b)}}},Yg=function(e,r){if(r.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var o=e.graphSet[n],i=o.length;if(n===0)var s=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[o[0]]],v=e.layoutNodes[e.idToIndex[u.parentId]],s=v.positionX,l=v.positionY;for(var f=0;f<i;f++){var d=e.layoutNodes[e.idToIndex[o[f]]];if(!d.isLocked){var h=s-d.positionX,c=l-d.positionY,p=Math.sqrt(h*h+c*c);if(p>a){var g=r.gravity*h/p,y=r.gravity*c/p;d.offsetX+=g,d.offsetY+=y}}}}},Hg=function(e,r){var a=[],n=0,o=-1;for(a.push.apply(a,e.graphSet[0]),o+=e.graphSet[0].length;n<=o;){var i=a[n++],s=e.idToIndex[i],l=e.layoutNodes[s],u=l.children;if(0<u.length&&!l.isLocked){for(var v=l.offsetX,f=l.offsetY,d=0;d<u.length;d++){var h=e.layoutNodes[e.idToIndex[u[d]]];h.offsetX+=v,h.offsetY+=f,a[++o]=u[d]}l.offsetX=0,l.offsetY=0}}},Xg=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 o=qg(n.offsetX,n.offsetY,e.temperature);n.positionX+=o.x,n.positionY+=o.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,Wg(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)}},qg=function(e,r,a){var n=Math.sqrt(e*e+r*r);if(n>a)var o={x:a*e/n,y:a*r/n};else var o={x:e,y:r};return o},Wg=function t(e,r){var a=e.parentId;if(a!=null){var n=r.layoutNodes[r.idToIndex[a]],o=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,o=!0),(n.minX==null||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,o=!0),(n.maxY==null||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,o=!0),(n.minY==null||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,o=!0),o)return t(n,r)}},$o=function(e,r){for(var a=e.layoutNodes,n=[],o=0;o<a.length;o++){var i=a[o],s=i.cmptId,l=n[s]=n[s]||[];l.push(i)}for(var u=0,o=0;o<n.length;o++){var v=n[o];if(v){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var f=0;f<v.length;f++){var d=v[f];v.x1=Math.min(v.x1,d.positionX-d.width/2),v.x2=Math.max(v.x2,d.positionX+d.width/2),v.y1=Math.min(v.y1,d.positionY-d.height/2),v.y2=Math.max(v.y2,d.positionY+d.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,u+=v.w*v.h}}n.sort(function(b,m){return m.w*m.h-b.w*b.h});for(var h=0,c=0,p=0,g=0,y=Math.sqrt(u)*e.clientWidth/e.clientHeight,o=0;o<n.length;o++){var v=n[o];if(v){for(var f=0;f<v.length;f++){var d=v[f];d.isLocked||(d.positionX+=h-v.x1,d.positionY+=c-v.y1)}h+=v.w+r.componentSpacing,p+=v.w+r.componentSpacing,g=Math.max(g,v.h),p>y&&(c+=g+r.componentSpacing,h=0,p=0,g=0)}}},Kg={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 bl(t){this.options=Ee({},Kg,t)}bl.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 o=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(o.h===0||o.w===0)a.nodes().layoutPositions(this,e,function(U){return{x:o.x1,y:o.y1}});else{var i=n.size(),s=Math.sqrt(i*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),v=function(H){if(H==null)return Math.min(l,u);var _=Math.min(l,u);_==l?l=H:u=H},f=function(H){if(H==null)return Math.max(l,u);var _=Math.max(l,u);_==l?l=H:u=H},d=e.rows,h=e.cols!=null?e.cols:e.columns;if(d!=null&&h!=null)l=d,u=h;else if(d!=null&&h==null)l=d,u=Math.ceil(i/l);else if(d==null&&h!=null)u=h,l=Math.ceil(i/u);else if(u*l>i){var c=v(),p=f();(c-1)*p>=i?v(c-1):(p-1)*c>=i&&f(p-1)}else for(;u*l<i;){var g=v(),y=f();(y+1)*g>=i?f(y+1):v(g+1)}var b=o.w/u,m=o.h/l;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,_){return!!L["c-"+H+"-"+_]},N=function(H,_){L["c-"+H+"-"+_]=!0},O=0,M=0,R=function(){M++,M>=u&&(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,_){var Q,J;if(H.locked()||H.isParent())return!1;var q=k[H.id()];if(q)Q=q.col*b+b/2+o.x1,J=q.row*m+m/2+o.y1;else{for(;A(O,M);)R();Q=M*b+b/2+o.x1,J=O*m+m/2+o.y1,N(O,M),R()}return{x:Q,y:J}};n.layoutPositions(this,e,F)}return this};var Zg={ready:function(){},stop:function(){}};function Ri(t){this.options=Ee({},Zg,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 Qg={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 El(t){this.options=Ee({},Qg,t)}El.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),a=ze(t.positions);function n(o){if(t.positions==null)return ef(o.position());if(a)return t.positions(o);var i=t.positions[o._private.data.id];return i??null}return r.layoutPositions(this,t,function(o,i){var s=n(o);return o.locked()||s==null?!1:s}),this};var Jg={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function wl(t){this.options=Ee({},Jg,t)}wl.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,s){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return r.nodes().layoutPositions(this,t,n),this};var jg=[{name:"breadthfirst",impl:gl},{name:"circle",impl:pl},{name:"concentric",impl:yl},{name:"cose",impl:On},{name:"grid",impl:bl},{name:"null",impl:Ri},{name:"preset",impl:El},{name:"random",impl:wl}];function xl(t){this.options=t,this.notifications=0}var _o=function(){},Yo=function(){throw new Error("A headless instance can not render images")};xl.prototype={recalculateRenderedStyle:_o,notify:function(){this.notifications++},init:_o,isHeadless:function(){return!0},png:Yo,jpg:Yo};var ki={};ki.arrowShapeWidth=.3;ki.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,v,f,d,h,c,p){var g=h.x-f/2-p,y=h.x+f/2+p,b=h.y-f/2-p,m=h.y+f/2+p,T=g<=u&&u<=y&&b<=v&&v<=m;return T},a=function(u,v,f,d,h){var c=u*Math.cos(d)-v*Math.sin(d),p=u*Math.sin(d)+v*Math.cos(d),g=c*f,y=p*f,b=g+h.x,m=y+h.y;return{x:b,y:m}},n=function(u,v,f,d){for(var h=[],c=0;c<u.length;c+=2){var p=u[c],g=u[c+1];h.push(a(p,g,v,f,d))}return h},o=function(u){for(var v=[],f=0;f<u.length;f++){var d=u[f];v.push(d.x,d.y)}return v},i=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},s=function(u,v){ge(v)&&(v=t[v]),t[u]=Ee({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(d,h,c,p,g,y){var b=o(n(this.points,c+2*y,p,g)),m=gt(d,h,b);return m},roughCollide:r,draw:function(d,h,c,p){var g=n(this.points,h,c,p);e.arrowShapeImpl("polygon")(d,g)},spacing:function(d){return 0},gap:i},v)};s("none",{collide:nn,roughCollide:nn,draw:bi,spacing:ji,gap:ji}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,v,f,d,h){var c=n(this.points,v,f,d),p=this.controlPoint,g=a(p[0],p[1],v,f,d);e.arrowShapeImpl(this.name)(u,c,g)},gap:function(u){return i(u)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,v,f,d,h,c,p){var g=o(n(this.points,f+2*p,d,h)),y=o(n(this.pointsTee,f+2*p,d,h)),b=gt(u,v,g)||gt(u,v,y);return b},draw:function(u,v,f,d,h){var c=n(this.points,v,f,d),p=n(this.pointsTee,v,f,d);e.arrowShapeImpl(this.name)(u,c,p)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,v,f,d,h,c,p){var g=h,y=Math.pow(g.x-u,2)+Math.pow(g.y-v,2)<=Math.pow((f+2*p)*this.radius,2),b=o(n(this.points,f+2*p,d,h));return gt(u,v,b)||y},draw:function(u,v,f,d,h){var c=n(this.pointsTr,v,f,d);e.arrowShapeImpl(this.name)(u,c,d.x,d.y,this.radius*v)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,v){var f=this.baseCrossLinePts.slice(),d=v/u,h=3,c=5;return f[h]=f[h]-d,f[c]=f[c]-d,f},collide:function(u,v,f,d,h,c,p){var g=o(n(this.points,f+2*p,d,h)),y=o(n(this.crossLinePts(f,c),f+2*p,d,h)),b=gt(u,v,g)||gt(u,v,y);return b},draw:function(u,v,f,d,h){var c=n(this.points,v,f,d),p=n(this.crossLinePts(v,h),v,f,d);e.arrowShapeImpl(this.name)(u,c,p)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return i(u)*.525}}),s("circle",{radius:.15,collide:function(u,v,f,d,h,c,p){var g=h,y=Math.pow(g.x-u,2)+Math.pow(g.y-v,2)<=Math.pow((f+2*p)*this.radius,2);return y},draw:function(u,v,f,d,h){e.arrowShapeImpl(this.name)(u,d.x,d.y,this.radius*v)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var xr={};xr.projectIntoViewport=function(t,e){var r=this.cy,a=this.findContainerClientCoords(),n=a[0],o=a[1],i=a[4],s=r.pan(),l=r.zoom(),u=((t-n)/i-s.x)/l,v=((e-o)/i-s.y)/l;return[u,v]};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")},o={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},i=t.clientWidth,s=t.clientHeight,l=n.left+n.right,u=n.top+n.bottom,v=o.left+o.right,f=e.width/(i+v),d=i-l,h=s-u,c=e.left+n.left+o.left,p=e.top+n.top+o.top;return this.containerBB=[c,p,d,h,f]};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,o=this,i=o.getCachedZSortedEles(),s=[],l=o.cy.zoom(),u=o.cy.hasCompoundNodes(),v=(a?24:8)/l,f=(a?8:2)/l,d=(a?8:2)/l,h=1/0,c,p;r&&(i=i.interactive);function g(E,x){if(E.isNode()){if(p)return;p=E,s.push(E)}if(E.isEdge()&&(x==null||x<h))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<s.length;w++)if(s[w].isEdge()){s[w]=E,c=E,h=x??h;break}}}else s.push(E),c=E,h=x??h}function y(E){var x=E.outerWidth()+2*f,w=E.outerHeight()+2*f,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=o.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+v,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(df(t,e,R[k],R[k+1],R[k+2],R[k+3],O)&&N>(M=bf(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(gf(t,e,R[k],R[k+1],R[k+2],R[k+3],R[k+4],R[k+5],O)&&N>(M=mf(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=o.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,v)&&U.collide(t,e,z,F.angle,{x:F.x,y:F.y},H,v))return g(E),!0}u&&s.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),_=Math.sin(k),Q=function(he,ae){return he=he-M,ae=ae-R,{x:he*H-ae*_+M,y:he*_+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 s};xr.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,o=[],i=Math.min(t,r),s=Math.max(t,r),l=Math.min(e,a),u=Math.max(e,a);t=i,r=s,e=l,a=u;for(var v=pt({x1:t,y1:e,x2:r,y2:a}),f=0;f<n.length;f++){var d=n[f];if(d.isNode()){var h=d,c=h.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});xi(v,c)&&!Is(c,v)&&o.push(h)}else{var p=d,g=p._private,y=g.rscratch;if(y.startX!=null&&y.startY!=null&&!zr(v,y.startX,y.startY)||y.endX!=null&&y.endY!=null&&!zr(v,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(!cf(v,b[T])){m=!1;break}m&&o.push(p)}else(y.edgeType==="haystack"||y.edgeType==="straight")&&o.push(p)}}return o};var hn={};hn.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",o=e.edgeType==="segments",i=e.edgeType==="compound",s=e.edgeType==="self",l,u,v,f,d,h,y,b;if(r?(v=e.haystackPts[0],f=e.haystackPts[1],d=e.haystackPts[2],h=e.haystackPts[3]):(v=e.arrowStartX,f=e.arrowStartY,d=e.arrowEndX,h=e.arrowEndY),y=e.midX,b=e.midY,o)l=v-e.segpts[0],u=f-e.segpts[1];else if(n||i||s||a){var c=e.allpts,p=Ze(c[0],c[2],c[4],.1),g=Ze(c[1],c[3],c[5],.1);l=v-p,u=f-g}else l=v-y,u=f-b;e.srcArrowAngle=ka(l,u);var y=e.midX,b=e.midY;if(r&&(y=(v+d)/2,b=(f+h)/2),l=d-v,u=h-f,o){var c=e.allpts;if(c.length/2%2===0){var m=c.length/2,T=m-2;l=c[m]-c[T],u=c[m+1]-c[T+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var m=c.length/2-1,T=m-2;l=c[m]-c[T],u=c[m+1]-c[T+1]}}else if(n||i||s){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)}l=x-S,u=w-E}if(e.midtgtArrowAngle=ka(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,o){var c=e.allpts;if(c.length/2%2!==0){if(!e.isRound){var m=c.length/2-1,N=m+2;l=-(c[N]-c[m]),u=-(c[N+1]-c[m+1])}}}if(e.midsrcArrowAngle=ka(l,u),o)l=d-e.segpts[e.segpts.length-2],u=h-e.segpts[e.segpts.length-1];else if(n||i||s||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);l=d-p,u=h-g}else l=d-y,u=h-b;e.tgtArrowAngle=ka(l,u)};hn.getArrowWidth=hn.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={},Ho,Xo,hr,Ja,$t,lr,fr,kt,Or,_a,Tl,Cl,ii,oi,qo,Wo=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)},ep=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},tp=function(e,r,a,n,o){if(e!==qo?Wo(r,e,Pt):ep(Et,Pt),Wo(r,a,Et),Ho=Pt.nx*Et.ny-Pt.ny*Et.nx,Xo=Pt.nx*Et.nx-Pt.ny*-Et.ny,$t=Math.asin(Math.max(-1,Math.min(1,Ho))),Math.abs($t)<1e-6){ai=r.x,ni=r.y,fr=Or=0;return}hr=1,Ja=!1,Xo<0?$t<0?$t=Math.PI+$t:($t=Math.PI-$t,hr=-1,Ja=!0):$t>0&&(hr=-1,Ja=!0),r.radius!==void 0?Or=r.radius:Or=n,lr=$t/2,_a=Math.min(Pt.len/2,Et.len/2),o?(kt=Math.abs(Math.cos(lr)*Or/Math.sin(lr)),kt>_a?(kt=_a,fr=Math.abs(kt*Math.sin(lr)/Math.cos(lr))):fr=Or):(kt=Math.min(_a,Or),fr=Math.abs(kt*Math.sin(lr)/Math.cos(lr))),ii=r.x+Et.nx*kt,oi=r.y+Et.ny*kt,ai=ii-Et.ny*fr*hr,ni=oi+Et.nx*fr*hr,Tl=r.x+Pt.nx*kt,Cl=r.y+Pt.ny*kt,qo=r};function Dl(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}:(tp(t,e,r,a,n),{cx:ai,cy:ni,radius:fr,startX:Tl,startY:Cl,stopX:ii,stopY:oi,startAngle:Pt.ang+Math.PI/2*hr,endAngle:Et.ang-Math.PI/2*hr,counterClockwise:Ja})}var ut={};ut.findMidptPtsEtc=function(t,e){var r=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,o,i=t.pstyle("source-endpoint"),s=t.pstyle("target-endpoint"),l=i.units!=null&&s.units!=null,u=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}},v=t.pstyle("edge-distances").value;switch(v){case"node-position":o=r;break;case"intersection":o=a;break;case"endpoints":{if(l){var f=this.manualEndptToPx(t.source()[0],i),d=Lt(f,2),h=d[0],c=d[1],p=this.manualEndptToPx(t.target()[0],s),g=Lt(p,2),y=g[0],b=g[1],m={x1:h,y1:c,x2:y,y2:b};n=u(h,c,y,b),o=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).")),o=a;break}}return{midptPts:o,vectorNormInverse:n}};ut.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],a=r._private,n=a.rscratch;if(!n.haystack){var o=Math.random()*2*Math.PI;n.source={x:Math.cos(o),y:Math.sin(o)},o=Math.random()*2*Math.PI,n.target={x:Math.cos(o),y:Math.sin(o)}}var i=a.source,s=a.target,l=i.position(),u=s.position(),v=i.width(),f=s.width(),d=i.height(),h=s.height(),c=r.pstyle("haystack-radius").value,p=c/2;n.haystackPts=n.allpts=[n.source.x*v*p+l.x,n.source.y*d*p+l.y,n.target.x*f*p+u.x,n.target.y*h*p+u.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};ut.findSegmentsPoints=function(t,e){var r=t._private.rscratch,a=t.pstyle("segment-weights"),n=t.pstyle("segment-distances"),o=t.pstyle("segment-radii"),i=t.pstyle("radius-type"),s=Math.min(a.pfValue.length,n.pfValue.length),l=o.pfValue[o.pfValue.length-1],u=i.pfValue[i.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var v=0;v<s;v++){var f=a.pfValue[v],d=n.pfValue[v],h=1-f,c=f,p=this.findMidptPtsEtc(t,e),g=p.midptPts,y=p.vectorNormInverse,b={x:g.x1*h+g.x2*c,y:g.y1*h+g.y2*c};r.segpts.push(b.x+y.x*d,b.y+y.y*d),r.radii.push(o.pfValue[v]!==void 0?o.pfValue[v]:l),r.isArcRadius.push((i.pfValue[v]!==void 0?i.pfValue[v]:u)==="arc-radius")}};ut.findLoopPoints=function(t,e,r,a){var n=t._private.rscratch,o=e.dirCounts,i=e.srcPos,s=t.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,v=t.pstyle("loop-sweep").pfValue,f=t.pstyle("control-point-step-size").pfValue;n.edgeType="self";var d=r,h=f;a&&(d=0,h=l);var c=u-Math.PI/2,p=c-v/2,g=c+v/2,y=u+"_"+v;d=o[y]===void 0?o[y]=0:++o[y],n.ctrlpts=[i.x+Math.cos(p)*1.4*h*(d/3+1),i.y+Math.sin(p)*1.4*h*(d/3+1),i.x+Math.cos(g)*1.4*h*(d/3+1),i.y+Math.sin(g)*1.4*h*(d/3+1)]};ut.findCompoundLoopPoints=function(t,e,r,a){var n=t._private.rscratch;n.edgeType="compound";var o=e.srcPos,i=e.tgtPos,s=e.srcW,l=e.srcH,u=e.tgtW,v=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,d=t.pstyle("control-point-distances"),h=d?d.pfValue[0]:void 0,c=r,p=f;a&&(c=0,p=h);var g=50,y={x:o.x-s/2,y:o.y-l/2},b={x:i.x-u/2,y:i.y-v/2},m={x:Math.min(y.x,b.x),y:Math.min(y.y,b.y)},T=.5,C=Math.max(T,Math.log(s*.01)),S=Math.max(T,Math.log(u*.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]};ut.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};ut.findBezierPoints=function(t,e,r,a,n){var o=t._private.rscratch,i=t.pstyle("control-point-step-size").pfValue,s=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),u=s&&l?Math.min(s.value.length,l.value.length):1,v=s?s.pfValue[0]:void 0,f=l.value[0],d=a;o.edgeType=d?"multibezier":"bezier",o.ctrlpts=[];for(var h=0;h<u;h++){var c=(.5-e.eles.length/2+r)*i*(n?-1:1),p=void 0,g=Os(c);d&&(v=s?s.pfValue[h]:i,f=l.value[h]),a?p=v:p=v!==void 0?g*v:void 0;var y=p!==void 0?p:c,b=1-f,m=f,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};o.ctrlpts.push(E.x+S.x*y,E.y+S.y*y)}};ut.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var a="vertical",n="horizontal",o="leftward",i="rightward",s="downward",l="upward",u="auto",v=e.posPts,f=e.srcW,d=e.srcH,h=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?(f+h)/2:0,w=g?(d+c)/2:0,D=v.x2-v.x1,L=v.y2-v.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===u?y=Math.abs(N)>Math.abs(O)?n:a:b===l||b===s?(y=a,M=!0):(b===o||b===i)&&(y=n,M=!0);var R=y===a,k=R?O:N,P=R?L:D,B=Os(P),z=!1;!(M&&(T||S))&&(b===s&&P<0||b===l&&P>0||b===o&&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)},_=H(G),Q=H(Math.abs(k)-Math.abs(G)),J=_||Q;if(J&&!z)if(R){var q=Math.abs(P)<=d/2,V=Math.abs(D)<=h/2;if(q){var Z=(v.x1+v.x2)/2,K=v.y1,ie=v.y2;r.segpts=[Z,K,Z,ie]}else if(V){var he=(v.y1+v.y2)/2,ae=v.x1,te=v.x2;r.segpts=[ae,he,te,he]}else r.segpts=[v.x1,v.y2]}else{var le=Math.abs(P)<=f/2,ce=Math.abs(L)<=c/2;if(le){var ve=(v.y1+v.y2)/2,ye=v.x1,Oe=v.x2;r.segpts=[ye,ve,Oe,ve]}else if(ce){var Te=(v.x1+v.x2)/2,xe=v.y1,Se=v.y2;r.segpts=[Te,xe,Te,Se]}else r.segpts=[v.x2,v.y1]}else if(R){var ee=v.y1+G+(g?d/2*B:0),I=v.x1,$=v.x2;r.segpts=[I,ee,$,ee]}else{var j=v.x1+G+(g?f/2*B:0),X=v.y1,Y=v.y2;r.segpts=[j,X,j,Y]}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)}};ut.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,o=e.srcW,i=e.srcH,s=e.tgtW,l=e.tgtH,u=e.srcShape,v=e.tgtShape,f=e.srcCornerRadius,d=e.tgtCornerRadius,h=e.srcRs,c=e.tgtRs,p=!oe(r.startX)||!oe(r.startY),g=!oe(r.arrowStartX)||!oe(r.arrowStartY),y=!oe(r.endX)||!oe(r.endY),b=!oe(r.arrowEndX)||!oe(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(o,i),M={x:r.ctrlpts[0]+N.x*2*O,y:r.ctrlpts[1]+N.y*2*O},R=u.intersectLine(a.x,a.y,o,i,M.x,M.y,0,f,h);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(o,i),G={x:r.ctrlpts[0]+B.x*2*z,y:r.ctrlpts[1]+B.y*2*z},F=v.intersectLine(n.x,n.y,s,l,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)}};ut.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var a,n;e.ctrlpts.length/2%2===0?(a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1]):(a=e.allpts.length/2-3,n=.5,e.midX=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 o=2;o+3<e.allpts.length;o+=2){var i=e.radii[o/2-1],s=e.isArcRadius[o/2-1];e.roundCorners.push(Pi({x:e.allpts[o-2],y:e.allpts[o-1]},{x:e.allpts[o],y:e.allpts[o+1],radius:i},{x:e.allpts[o+2],y:e.allpts[o+3]},i,s))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var v=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[v],e.midY=e.segpts[v+1];else{var f={x:e.segpts[v],y:e.segpts[v+1]},d=e.roundCorners[v/2],h=[f.x-d.cx,f.y-d.cy],c=d.radius/Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2));h=h.map(function(p){return p*c}),e.midX=d.cx+h[0],e.midY=d.cy+h[1],e.midVector=h}}}};ut.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||oe(e.startX)&&oe(e.startY)&&oe(e.endX)&&oe(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."))};ut.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,a=r.cy,n=a.hasCompoundNodes(),o={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=[],s=[],l=0;l<t.length;l++){var u=t[l],v=u._private,f=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(f==="haystack"){s.push(u);continue}var d=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),h=f==="unbundled-bezier"||f==="bezier",c=v.source,p=v.target,g=c.poolIndex(),y=p.poolIndex(),b=[g,y].sort(),m=o.get(b);m==null&&(m={eles:[]},o.set(b,m),i.push(b)),m.eles.push(u),d&&(m.hasUnbundled=!0),h&&(m.hasBezier=!0)}}for(var T=function(E){var x=i[E],w=o.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,_=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"),he=!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,le=U.intersectLine(k.x,k.y,z,G,R.x,R.y,0,_,Q),ce=w.tgtIntn=le,ve=w.intersectionPts={x1:ae[0],x2:le[0],y1:ae[1],y2:le[1]},ye=w.posPts={x1:R.x,x2:k.x,y1:R.y,y2:k.y},Oe=le[1]-ae[1],Te=le[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=!oe(xe)||U.checkPoint(ae[0],ae[1],0,z,G,k.x,k.y,_,Q)||F.checkPoint(le[0],le[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:ve.x2,y1:ve.y2,x2:ve.x1,y2:ve.y1},vector:{x:-Se.x,y:-Se.y},vectorNorm:{x:-ee.x,y:-ee.y},vectorNormInverse:{x:-I.x,y:-I.y}}}var $=he?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,he),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(s)}};function Sl(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var a=t[r],n=t[r+1];e.push({x:a,y:n})}return e}}ut.getSegmentPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="segments")return this.recalculateRenderedStyle(t),Sl(e.segpts)};ut.getControlPoints=function(t){var e=t[0]._private.rscratch,r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return this.recalculateRenderedStyle(t),Sl(e.ctrlpts)};ut.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(),o=t.outerHeight(),i=t._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*n),e.units[1]==="%"&&(s[1]=s[1]*o),s[0]+=a.x,s[1]+=a.y,s}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(n,o),v=[a.x+Math.cos(l)*u,a.y+Math.sin(l)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(a.x,a.y,n,o,v[0],v[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],o=a.position(),i=n.position(),s=t.pstyle("target-arrow-shape").value,l=t.pstyle("source-arrow-shape").value,u=t.pstyle("target-distance-from-node").pfValue,v=t.pstyle("source-distance-from-node").pfValue,f=a._private.rscratch,d=n._private.rscratch,h=t.pstyle("curve-style").value,c=t._private.rscratch,p=c.edgeType,g=h==="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):[o.x,o.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=[o.x,o.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,_=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"?_-=J:Z==="right"&&(_+=J);var K=ya(R[0],R[1],[_-J,Q-q,_+J,Q-q,_+J,Q+q,_-J,Q+q],i.x,i.y);if(K.length>0){var ie=o,he=ur(ie,Mr(r)),ae=ur(ie,Mr(K)),te=he;if(ae<he&&(r=K,te=ae),K.length>2){var le=ur(ie,{x:K[2],y:K[3]});le<te&&(r=[K[2],K[3]])}}}var ce=Pa(r,O,e.arrowShapes[s].spacing(t)+u),ve=Pa(r,O,e.arrowShapes[s].gap(t)+u);if(c.endX=ve[0],c.endY=ve[1],c.arrowEndX=ce[0],c.arrowEndY=ce[1],w==="inside-to-node")r=[o.x,o.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(o.x,o.y,a.outerWidth(),a.outerHeight(),k[0],k[1],0,D,f),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],o.x,o.y);if(X.length>0){var Y=i,ne=ur(Y,Mr(r)),W=ur(Y,Mr(X)),re=ne;if(W<ne&&(r=[X[0],X[1]],re=W),X.length>2){var me=ur(Y,{x:X[2],y:X[3]});me<re&&(r=[X[2],X[3]])}}}var be=Pa(r,M,e.arrowShapes[l].spacing(t)+v),fe=Pa(r,M,e.arrowShapes[l].gap(t)+v);c.startX=fe[0],c.startY=fe[1],c.arrowStartX=be[0],c.arrowStartY=be[1],S&&(!oe(c.startX)||!oe(c.startY)||!oe(c.endX)||!oe(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 rp(t,e,r){for(var a=function(u,v,f,d){return Ze(u,v,f,d)},n=e._private,o=n.rstyle.bezierPts,i=0;i<t.bezierProjPcts.length;i++){var s=t.bezierProjPcts[i];o.push({x:a(r[0],r[2],r[4],s),y:a(r[1],r[3],r[5],s)})}}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)rp(this,t,r.allpts.slice(n,n+6))}else if(a==="segments")for(var o=e.rstyle.linePts=[],n=0;n+1<r.allpts.length;n+=2)o.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,o=t.width(),i=t.height(),s=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,v=t.pstyle("text-valign").strValue,f=n.rscratch,d=n.rstyle;switch(u){case"left":r=l.x-o/2-s;break;case"right":r=l.x+o/2+s;break;default:r=l.x}switch(v){case"top":a=l.y-i/2-s;break;case"bottom":a=l.y+i/2+s;break;default:a=l.y}f.labelX=r,f.labelY=a,d.labelX=r,d.labelY=a,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var Ll=function(e,r){var a=Math.atan(r/e);return e===0&&a<0&&(a=a*-1),a},Al=function(e,r){var a=r.x-e.x,n=r.y-e.y;return Ll(a,n)},ap=function(e,r,a,n){var o=pa(0,n-.001,1),i=pa(0,n+.001,1),s=kr(e,r,a,o),l=kr(e,r,a,i);return Al(s,l)};zt.recalculateEdgeLabelProjections=function(t){var e,r=t._private,a=r.rscratch,n=this,o={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(o.mid||o.source||o.target){e={x:a.midX,y:a.midY};var i=function(f,d,h){Zt(r.rscratch,f,d,h),Zt(r.rstyle,f,d,h)};i("labelX",null,e.x),i("labelY",null,e.y);var s=Ll(a.midDispX,a.midDispY);i("labelAutoAngle",null,s);var l=function v(){if(v.cache)return v.cache;for(var f=[],d=0;d+5<a.allpts.length;d+=4){var h={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]};f.push({p0:h,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<f.length;m++){var T=f[m],C=f[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 v.cache=f},u=function(f){var d,h=f==="source";if(o[f]){var c=t.pstyle(f+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var p=l(),g,y=0,b=0,m=0;m<p.length;m++){for(var T=p[h?m:p.length-1-m],C=0;C<T.segments.length;C++){var S=T.segments[h?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=h?w.t0+L*D:w.t1-L*D;A=pa(0,A,1),e=kr(x.p0,x.p1,x.p2,A),d=ap(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&&(h?(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=lf(R,k,G),d=Al(R,k);break}}i("labelX",f,e.x),i("labelY",f,e.y),i("labelAutoAngle",f,d)}};u("source"),u("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),o=t.pstyle("line-height").pfValue,i=t.pstyle("text-wrap").strValue,s=Ot(r.rscratch,"labelWrapCachedLines",e)||[],l=i!=="wrap"?1:Math.max(s.length,1),u=n.height/l,v=u*o,f=n.width,d=n.height+(l-1)*(o-1)*u;Zt(r.rstyle,"labelWidth",e,f),Zt(r.rscratch,"labelWidth",e,f),Zt(r.rstyle,"labelHeight",e,d),Zt(r.rscratch,"labelHeight",e,d),Zt(r.rscratch,"labelLineHeight",e,v)};zt.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,o=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"";o=="none"||(o=="uppercase"?n=n.toUpperCase():o=="lowercase"&&(n=n.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var l=i("labelKey");if(l!=null&&i("labelWrapKey")===l)return i("labelWrapCachedText");for(var u="",v=n.split(`
`),f=t.pstyle("text-max-width").pfValue,d=t.pstyle("text-overflow-wrap").value,h=d==="anywhere",c=[],p=/[\s\u200b]+|$/g,g=0;g<v.length;g++){var y=v[g],b=this.calculateLabelDimensions(t,y),m=b.width;if(h){var T=y.split("").join(u);y=T}if(m>f){var C=y.matchAll(p),S="",E=0,x=vs(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<=f?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",l)}else if(s==="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,o=gr(e,t._private.labelDimsKey),i=r.labelDimCache||(r.labelDimCache=[]),s=i[o];if(s!=null)return s;var l=0,u=t.pstyle("font-style").strValue,v=t.pstyle("font-size").pfValue,f=t.pstyle("font-family").strValue,d=t.pstyle("font-weight").strValue,h=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=n.createElement("canvas"),c=this.labelCalcCanvasContext=h.getContext("2d");var p=h.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}c.font="".concat(u," ").concat(d," ").concat(v,"px ").concat(f);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=v;g=Math.max(S,g),y+=E}return g+=l,y+=l,i[o]={width:g,height:y}};zt.calculateLabelAngle=function(t,e){var r=t._private,a=r.rscratch,n=t.isEdge(),o=e?e+"-":"",i=t.pstyle(o+"text-rotation"),s=i.strValue;return s==="none"?0:n&&s==="autorotate"?a.labelAutoAngle:s==="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 Ol={},Ko=28,Zo=!1;Ol.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Ko||t.height()<Ko))return Zo||(Ie("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Zo=!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 s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(i),s)for(var l=0;l<i.length;l++){var u=i[l],v=u._private,f=v.rstyle;f.clean=!1,f.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(i){var s=i.target;a(s)}).on("style.* background.*",function(i){var s=i.target;a(s,!1)});var n=function(i){if(i){var s=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],v=u._private.rstyle;u.isNode()&&!v.cleanConnected&&(a(u.connectedEdges()),v.cleanConnected=!0)}if(s)for(var f=0;f<s.length;f++){var d=s[f];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 o=0;o<t.length;o++){var i=t[o],s=i._private,l=s.rstyle;i.isEdge()&&(!r(i.source())||!r(i.target()))&&(l.clean=!1),!(e&&l.clean||i.removed())&&i.pstyle("display").value!=="none"&&(s.group==="nodes"?n.push(i):a.push(i),l.clean=!0)}for(var u=0;u<n.length;u++){var v=n[u],f=v._private,d=f.rstyle,h=v.position();this.recalculateNodeLabelProjection(v),d.nodeX=h.x,d.nodeY=h.y,d.nodeW=v.pstyle("width").pfValue,d.nodeH=v.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(hl),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Nl={};[xr,hn,ut,Oa,Bi,zt,Ol,Nn,In].forEach(function(t){Ee(Nl,t)});var Il={};Il.getCachedImage=function(t,e,r){var a=this,n=a.imageCache=a.imageCache||{},o=n[t];if(o)return o.image.complete||o.image.addEventListener("load",r),o.image;o=n[t]=n[t]||{};var i=o.image=new Image;i.addEventListener("load",r),i.addEventListener("error",function(){i.error=!0});var s="data:",l=t.substring(0,s.length).toLowerCase()===s;return l||(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]),o=this.binder(t);return o.on.apply(o,n)};Kr.binder=function(t){var e=this,r=e.cy.window(),a=t===r||t===r.document||t===r.document.body||Lu(t);if(e.supportsPassiveEvents==null){var n=!1;try{var o=Object.defineProperty({},"passive",{get:function(){return n=!0,!0}});r.addEventListener("test",null,o)}catch{}e.supportsPassiveEvents=n}var i=function(l,u,v){var f=Array.prototype.slice.call(arguments);return a&&e.supportsPassiveEvents&&(f[2]={capture:v??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:f}),(t.addEventListener||t.on).apply(t,f),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 Y=0;Y<$.length;Y++){var ne=$[Y];I.emit({originalEvent:j,type:ne,position:X})}},n=function(I){return I.shiftKey||I.metaKey||I.ctrlKey},o=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},s=function(I){I[0]._private.grabbed=!1},l=function(I){I[0]._private.rscratch.inDragLayer=!0},u=function(I){I[0]._private.rscratch.inDragLayer=!1},v=function(I){I[0]._private.rscratch.isGrabTarget=!0},f=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))},h=function(I,$){if(I.cy().hasCompoundNodes()&&!($.inDragLayer==null&&$.addToList==null)){var j=I.descendants();$.inDragLayer&&(j.forEach(l),j.connectedEdges().forEach(l)),$.addToList&&d(j,$)}},c=function(I,$){$=$||{};var j=I.cy().hasCompoundNodes();$.inDragLayer&&(I.forEach(l),I.neighborhood().stdFilter(function(X){return!j||X.isEdge()}).forEach(l)),$.addToList&&I.forEach(function(X){d(X,$)}),h(I,$),y(I,{inDragLayer:$.inDragLayer}),t.updateCachedGrabbedEles()},p=c,g=function(I){I&&(t.getCachedZSortedEles().forEach(function($){s($),u($),f($)}),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()),Y=X.connectedEdges();$.inDragLayer&&(Y.forEach(l),X.forEach(l)),$.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 Y=j[X];if(Y===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],Y=$[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+Y&&X<=be.clientY&&be.clientY<=X+ne){re=!0;break}}if(!re)return!1;for(var fe=t.container,we=I.target,ue=we.parentNode,pe=!1;ue;){if(ue===fe){pe=!0;break}ue=ue.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]),Y=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 fe=function(Ge){return{originalEvent:I,type:Ge,position:{x:X[0],y:X[1]}}},we=function(Ge){Ge.emit(fe("grab"))};if(v(W),!W.selected())re=t.dragData.possibleDragElements=$.collection(),p(W,{addToList:re}),W.emit(fe("grabon")).emit(fe("grab"));else{re=t.dragData.possibleDragElements=$.collection();var ue=$.$(function(pe){return pe.isNode()&&pe.selected()&&t.nodeIsGrabbable(pe)});c(ue,{addToList:re}),W.emit(fe("grabon")),ue.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?(Y[4]=1,t.data.bgActivePosistion={x:X[0],y:X[1]},t.redrawHint("select",!0),t.redraw()):W.pannable()&&(Y[4]=1),me()}Y[0]=Y[2]=X[0],Y[1]=Y[3]=X[1]}},!1),t.registerBinding(e,"mousemove",function(I){var $=t.hoverData.capture;if(!(!$&&!w(I))){var j=!1,X=t.cy,Y=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,fe=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(fe=t.findNearestElement(W[0],W[1],!0,!1));var we=t.hoverData.last,ue=t.hoverData.down,pe=[W[0]-be[2],W[1]-be[3]],Ge=t.dragData.possibleDragElements,Re;if(me){var vt=ne[0]-me[0],Qe=vt*vt,$e=ne[1]-me[1],ct=$e*$e,Je=Qe+ct;t.hoverData.isOverThresholdDrag=Re=Je>=t.desktopTapThreshold2}var ft=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(fe,["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]}};ue?ue.emit(dt):X.emit(dt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||fe!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:W[0],y:W[1]}}),t.hoverData.cxtOver=fe,fe&&fe.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,y:(W[1]-Ut[1])*Y},t.hoverData.justStartedPan=!1}else Mt={x:pe[0]*Y,y:pe[1]*Y};X.panBy(Mt),X.emit("dragpan"),t.hoverData.dragged=!0}W=t.projectIntoViewport(I.clientX,I.clientY)}else if(be[4]==1&&(ue==null||ue.pannable())){if(Re){if(!t.hoverData.dragging&&X.boxSelectionEnabled()&&(ft||!X.panningEnabled()||!X.userPanningEnabled()))bt();else if(!t.hoverData.selecting&&X.panningEnabled()&&X.userPanningEnabled()){var Ct=o(ue,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())}ue&&ue.pannable()&&ue.active()&&ue.unactivate()}}else{if(ue&&ue.pannable()&&ue.active()&&ue.unactivate(),(!ue||!ue.grabbed())&&fe!=we&&(we&&a(we,["mouseout","tapdragout"],I,{x:W[0],y:W[1]}),fe&&a(fe,["mouseover","tapdragover"],I,{x:W[0],y:W[1]}),t.hoverData.last=fe),ue)if(Re){if(X.boxSelectionEnabled()&&ft)ue&&ue.grabbed()&&(g(Ge),ue.emit("freeon"),Ge.emit("free"),t.dragData.didDrag&&(ue.emit("dragfreeon"),Ge.emit("dragfree"))),bt();else if(ue&&ue.grabbed()&&t.nodeIsDraggable(ue)){var _e=!t.dragData.didDrag;_e&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||c(Ge,{inDragLayer:!0});var Ke={x:0,y:0};if(oe(pe[0])&&oe(pe[1])&&(Ke.x+=pe[0],Ke.y+=pe[1],_e)){var nt=t.hoverData.dragDelta;nt&&oe(nt[0])&&oe(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),Y=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 fe={originalEvent:I,type:"cxttap",position:{x:X[0],y:X[1]}};re?re.emit(fe):j.emit(fe)}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(Y[0],Y[1],Y[2],Y[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 ue=function(Re){return Re.selectable()&&!Re.selected()};j.selectionType()==="additive"||me||j.$(r).unmerge(we).unselect(),we.emit("box").stdFilter(ue).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!Y[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")))}}Y[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(),Y=t.projectIntoViewport(I.clientX,I.clientY),ne=[Y[0]*j+X.x,Y[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,_,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 Y=t.projectIntoViewport(I.touches[0].clientX,I.touches[0].clientY);j[0]=Y[0],j[1]=Y[1]}if(I.touches[1]){var Y=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);j[2]=Y[0],j[3]=Y[1]}if(I.touches[2]){var Y=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);j[4]=Y[0],j[5]=Y[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],_=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<=_&&0<=k&&k<=_;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 fe=t.findNearestElement(j[0],j[1],!0,!0),we=t.findNearestElement(j[2],j[3],!0,!0);fe&&fe.isNode()?(fe.activate().emit({originalEvent:I,type:"cxttapstart",position:{x:j[0],y:j[1]}}),t.touchData.start=fe):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 ue=t.findNearestElements(j[0],j[1],!0,!0),pe=ue[0];if(pe!=null&&(pe.activate(),t.touchData.start=pe,t.touchData.starts=ue,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}),v(pe);var vt=function(ft){return{originalEvent:I,type:ft,position:{x:j[0],y:j[1]}}};pe.emit(vt("grabon")),Re?Re.forEach(function(Je){Je.emit(vt("grab"))}):pe.emit(vt("grab"))}a(pe,["touchstart","tapstart","vmousedown"],I,{x:j[0],y:j[1]}),pe==null&&(t.data.bgActivePosistion={x:Y[0],y: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,Y=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);Y[0]=re[0],Y[1]=re[1]}if(I.touches[1]){var re=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);Y[2]=re[0],Y[3]=re[1]}if(I.touches[2]){var re=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);Y[4]=re[0],Y[5]=re[1]}var me=t.touchData.startGPosition,be;if($&&I.touches[0]&&me){for(var fe=[],we=0;we<Y.length;we++)fe[we]=Y[we]-ne[we];var ue=I.touches[0].clientX-me[0],pe=ue*ue,Ge=I.touches[0].clientY-me[1],Re=Ge*Ge,vt=pe+Re;be=vt>=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,ft=q(Qe,$e,ct,Je),Tt=ft/B,bt=150,dt=bt*bt,Mt=1.5,Ut=Mt*Mt;if(Tt>=Ut||ft>=dt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ct={originalEvent:I,type:"cxttapend",position:{x:Y[0],y: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:Y[0],y: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 _e=t.findNearestElement(Y[0],Y[1],!0,!0);(!t.touchData.cxtOver||_e!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:I,type:"cxtdragout",position:{x:Y[0],y:Y[1]}}),t.touchData.cxtOver=_e,_e&&_e.emit({originalEvent:I,type:"cxtdragover",position:{x:Y[0],y: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:Y[0],y:Y[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,j[4]=1,!j||j.length===0||j[0]===void 0?(j[0]=(Y[0]+Y[2]+Y[4])/3,j[1]=(Y[1]+Y[3]+Y[5])/3,j[2]=(Y[0]+Y[2]+Y[4])/3+1,j[3]=(Y[1]+Y[3]+Y[5])/3+1):(j[2]=(Y[0]+Y[2]+Y[4])/3,j[3]=(Y[1]+Y[3]+Y[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),jl=Ui/P;if(Q){var eu=Qe-O,tu=$e-M,ru=ct-R,au=Je-k,nu=(eu+ru)/2,iu=(tu+au)/2,Jr=X.zoom(),Mn=Jr*jl,Ma=X.pan(),$i=G[0]*Jr+Ma.x,_i=G[1]*Jr+Ma.y,ou={x:-Mn/Jr*($i-Ma.x-nu)+$i,y:-Mn/Jr*(_i-Ma.y-iu)+_i};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:ou,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);Y[0]=re[0],Y[1]=re[1]}if(I.touches[1]){var re=t.projectIntoViewport(I.touches[1].clientX,I.touches[1].clientY);Y[2]=re[0],Y[3]=re[1]}if(I.touches[2]){var re=t.projectIntoViewport(I.touches[2].clientX,I.touches[2].clientY);Y[4]=re[0],Y[5]=re[1]}}else if(I.touches[0]&&!t.touchData.didSelect){var Dt=t.touchData.start,Rn=t.touchData.last,_e;if(!t.hoverData.draggingEles&&!t.swipePanning&&(_e=t.findNearestElement(Y[0],Y[1],!0,!0)),$&&Dt!=null&&I.preventDefault(),$&&Dt!=null&&t.nodeIsDraggable(Dt))if(be){var Ke=t.dragData.touchDragEles,Yi=!t.dragData.didDrag;Yi&&c(Ke,{inDragLayer:!0}),t.dragData.didDrag=!0;var jr={x:0,y:0};if(oe(fe[0])&&oe(fe[1])&&(jr.x+=fe[0],jr.y+=fe[1],Yi)){t.redrawHint("eles",!0);var St=t.touchData.dragDelta;St&&oe(St[0])&&oe(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(fe[0]),St.push(fe[1])):(St[0]+=fe[0],St[1]+=fe[1])}if(a(Dt||_e,["touchmove","tapdrag","vmousemove"],I,{x:Y[0],y:Y[1]}),(!Dt||!Dt.grabbed())&&_e!=Rn&&(Rn&&Rn.emit({originalEvent:I,type:"tapdragout",position:{x:Y[0],y:Y[1]}}),_e&&_e.emit({originalEvent:I,type:"tapdragover",position:{x:Y[0],y:Y[1]}})),t.touchData.last=_e,$)for(var nt=0;nt<Y.length;nt++)Y[nt]&&t.touchData.startPosition[nt]&&be&&(t.touchData.singleTouchMoved=!0);if($&&(Dt==null||Dt.pannable())&&X.panningEnabled()&&X.userPanningEnabled()){var su=o(Dt,t.touchData.starts);su&&(I.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Mr(t.touchData.startPosition)),t.swipePanning?(X.panBy({x:fe[0]*W,y:fe[1]*W}),X.emit("dragpan")):be&&(t.swipePanning=!0,X.panBy({x:ue*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);Y[0]=re[0],Y[1]=re[1]}}for(var we=0;we<Y.length;we++)ne[we]=Y[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,he,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 Y=t.cy,ne=Y.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):Y.emit(be),!t.touchData.cxtDragged){var fe={originalEvent:I,type:"cxttap",position:{x:W[0],y:W[1]}};$?$.emit(fe):Y.emit(fe)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!I.touches[2]&&Y.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var we=Y.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),Y.emit({type:"boxend",originalEvent:I,position:{x:W[0],y:W[1]}});var ue=function(dt){return dt.selectable()&&!dt.selected()};we.emit("box").stdFilter(ue).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 vt=t.touchData.startPosition[0]-W[0],Qe=vt*vt,$e=t.touchData.startPosition[1]-W[1],ct=$e*$e,Je=Qe+ct,ft=Je*ne*ne;t.touchData.singleTouchMoved||($||Y.$(":selected").unselect(["tapunselect"]),a($,["tap","vclick"],I,{x:W[0],y:W[1]}),he=!1,I.timeStamp-te<=Y.multiClickDebounceTime()?(ae&&clearTimeout(ae),he=!0,te=null,a($,["dbltap","vdblclick"],I,{x:W[0],y:W[1]})):(ae=setTimeout(function(){he||a($,["onetap","voneclick"],I,{x:W[0],y:W[1]})},Y.multiClickDebounceTime()),te=I.timeStamp)),$!=null&&!t.dragData.didDrag&&$._private.selectable&&ft<t.touchTapThreshold2&&!t.pinching&&(Y.selectionType()==="single"?(Y.$(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 le=[],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}},ve=function(I){return{event:I,touch:ce(I)}},ye=function(I){le.push(ve(I))},Oe=function(I){for(var $=0;$<le.length;$++){var j=le[$];if(j.event.pointerId===I.pointerId){le.splice($,1);return}}},Te=function(I){var $=le.filter(function(j){return j.event.pointerId===I.pointerId})[0];$.event=I,$.touch=ce(I)},xe=function(I){I.touches=le.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,o,i,s,l){this.renderer.nodeShapeImpl("polygon",a,n,o,i,s,this.points)},intersectLine:function(a,n,o,i,s,l,u,v){return ya(s,l,this.points,a,n,o/2,i/2,u)},checkPoint:function(a,n,o,i,s,l,u,v){return Yt(a,n,this.points,l,u,i,s,[0,-1],o)}}};Xt.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,a,n,o,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,o)},intersectLine:function(e,r,a,n,o,i,s,l){return wf(o,i,e,r,a/2+s,n/2+s)},checkPoint:function(e,r,a,n,o,i,s,l){return cr(e,r,n,o,i,s,a)}}};Xt.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(a,n,o,i,s,l,u){if(l[u]!==void 0&&l[u+"-cx"]===a&&l[u+"-cy"]===n)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=a,l[u+"-cy"]=n;var v=o/2,f=i/2;s=s==="auto"?ks(o,i):s;for(var d=new Array(e.length/2),h=0;h<e.length/2;h++)d[h]={x:a+v*e[h*2],y:n+f*e[h*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],l[u][c]=Pi(p,g,y,s),p=g,g=y;return l[u]},draw:function(a,n,o,i,s,l,u){this.renderer.nodeShapeImpl("round-polygon",a,n,o,i,s,this.points,this.getOrCreateCorners(n,o,i,s,l,u,"drawCorners"))},intersectLine:function(a,n,o,i,s,l,u,v,f){return xf(s,l,this.points,a,n,o,i,u,this.getOrCreateCorners(a,n,o,i,v,f,"corners"))},checkPoint:function(a,n,o,i,s,l,u,v,f){return Ef(a,n,this.points,l,u,i,s,this.getOrCreateCorners(l,u,i,s,v,f,"corners"))}}};Xt.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:ht(4,0),draw:function(e,r,a,n,o,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,o,this.points,i)},intersectLine:function(e,r,a,n,o,i,s,l){return Ms(o,i,e,r,a,n,s,l)},checkPoint:function(e,r,a,n,o,i,s,l){var u=n/2,v=o/2;l=l==="auto"?yr(n,o):l,l=Math.min(u,v,l);var f=l*2;return!!(Yt(e,r,this.points,i,s,n,o-f,[0,-1],a)||Yt(e,r,this.points,i,s,n-f,o,[0,-1],a)||cr(e,r,f,f,i-u+l,s-v+l,a)||cr(e,r,f,f,i+u-l,s-v+l,a)||cr(e,r,f,f,i+u-l,s+v-l,a)||cr(e,r,f,f,i-u+l,s+v-l,a))}}};Xt.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Ti(),points:ht(4,0),draw:function(e,r,a,n,o,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,o,null,i)},generateCutTrianglePts:function(e,r,a,n,o){var i=o==="auto"?this.cornerLength:o,s=r/2,l=e/2,u=a-l,v=a+l,f=n-s,d=n+s;return{topLeft:[u,f+i,u+i,f,u+i,f+i],topRight:[v-i,f,v,f+i,v-i,f+i],bottomRight:[v,d-i,v-i,d,v-i,d-i],bottomLeft:[u+i,d,u,d-i,u+i,d-i]}},intersectLine:function(e,r,a,n,o,i,s,l){var u=this.generateCutTrianglePts(a+2*s,n+2*s,e,r,l),v=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return ya(o,i,v,e,r)},checkPoint:function(e,r,a,n,o,i,s,l){var u=l==="auto"?this.cornerLength:l;if(Yt(e,r,this.points,i,s,n,o-2*u,[0,-1],a)||Yt(e,r,this.points,i,s,n-2*u,o,[0,-1],a))return!0;var v=this.generateCutTrianglePts(n,o,i,s);return gt(e,r,v.topLeft)||gt(e,r,v.topRight)||gt(e,r,v.bottomRight)||gt(e,r,v.bottomLeft)}}};Xt.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:ht(4,0),draw:function(e,r,a,n,o,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,o)},intersectLine:function(e,r,a,n,o,i,s,l){var u=.15,v=.5,f=.85,d=this.generateBarrelBezierPts(a+2*s,n+2*s,e,r),h=function(g){var y=kr({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},u),b=kr({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},v),m=kr({x:g[0],y:g[1]},{x:g[2],y:g[3]},{x:g[4],y:g[5]},f);return[g[0],g[1],y.x,y.y,b.x,b.y,m.x,m.y,g[4],g[5]]},c=[].concat(h(d.topLeft),h(d.topRight),h(d.bottomRight),h(d.bottomLeft));return ya(o,i,c,e,r)},generateBarrelBezierPts:function(e,r,a,n){var o=r/2,i=e/2,s=a-i,l=a+i,u=n-o,v=n+o,f=Zn(e,r),d=f.heightOffset,h=f.widthOffset,c=f.ctrlPtOffsetPct*e,p={topLeft:[s,u+d,s+c,u,s+h,u],topRight:[l-h,u,l-c,u,l,u+d],bottomRight:[l,v-d,l-c,v,l-h,v],bottomLeft:[s+h,v,s+c,v,s,v-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,o,i,s,l){var u=Zn(n,o),v=u.heightOffset,f=u.widthOffset;if(Yt(e,r,this.points,i,s,n,o-2*v,[0,-1],a)||Yt(e,r,this.points,i,s,n-2*f,o,[0,-1],a))return!0;for(var d=this.generateBarrelBezierPts(n,o,i,s),h=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=Tf(L,A,N),G=pf(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=h(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:ht(4,0),draw:function(e,r,a,n,o,i){this.renderer.nodeShapeImpl(this.name,e,r,a,n,o,this.points,i)},intersectLine:function(e,r,a,n,o,i,s,l){var u=e-(a/2+s),v=r-(n/2+s),f=v,d=e+(a/2+s),h=Qt(o,i,e,r,u,v,d,f,!1);return h.length>0?h:Ms(o,i,e,r,a,n,s,l)},checkPoint:function(e,r,a,n,o,i,s,l){l=l==="auto"?yr(n,o):l;var u=2*l;if(Yt(e,r,this.points,i,s,n,o-u,[0,-1],a)||Yt(e,r,this.points,i,s,n-u,o,[0,-1],a))return!0;var v=n/2+2*a,f=o/2+2*a,d=[i-v,s-f,i-v,s,i+v,s,i+v,s-f];return!!(gt(e,r,d)||cr(e,r,u,u,i+n/2-l,s+o/2-l,a)||cr(e,r,u,u,i-n/2+l,s+o/2-l,a))}}};Xt.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ht(3,0)),this.generateRoundPolygon("round-triangle",ht(3,0)),this.generatePolygon("rectangle",ht(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",ht(5,0)),this.generateRoundPolygon("round-pentagon",ht(5,0)),this.generatePolygon("hexagon",ht(6,0)),this.generateRoundPolygon("round-hexagon",ht(6,0)),this.generatePolygon("heptagon",ht(7,0)),this.generateRoundPolygon("round-heptagon",ht(7,0)),this.generatePolygon("octagon",ht(8,0)),this.generateRoundPolygon("round-octagon",ht(8,0));var a=new Array(20);{var n=Kn(5,0),o=Kn(5,Math.PI/5),i=.5*(3-Math.sqrt(5));i*=1.57;for(var s=0;s<o.length/2;s++)o[s*2]*=i,o[s*2+1]*=i;for(var s=0;s<20/4;s++)a[s*4]=n[s*2],a[s*4+1]=n[s*2+1],a[s*4+2]=o[s*2],a[s*4+3]=o[s*2+1]}a=Rs(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 l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}t.makePolygon=function(u){var v=u.join("$"),f="polygon-"+v,d;return(d=this[f])?d:e.generatePolygon(f,u)}};var Na={};Na.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Na.redraw=function(t){t=t||Ls();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 Qo=function(e,r,a){for(var n=e.beforeRenderCallbacks,o=0;o<n.length;o++)n[o].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){Qo(t,!0,n);var o=_t();t.render(t.renderOptions);var i=t.lastDrawTime=_t();t.averageRedrawTime===void 0&&(t.averageRedrawTime=i-o),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var s=i-o;t.redrawTotalTime+=s,t.lastRedrawTime=s,t.averageRedrawTime=t.averageRedrawTime/2+s/2,t.requestedFrame=!1}else Qo(t,!1,n);t.skipFrame=!1,an(a)}};an(r)}};var np=function(e){this.init(e)},Ml=np,Zr=Ml.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,o=n.head,i="__________cytoscape_stylesheet",s="__________cytoscape_container",l=n.getElementById(i)!=null;if(r.className.indexOf(s)<0&&(r.className=(r.className||"")+" "+s),!l){var u=n.createElement("style");u.id=i,u.textContent="."+s+" { position: relative; }",o.insertBefore(u,o.children[0])}var v=a.getComputedStyle(r),f=v.getPropertyValue("position");f==="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=oe(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,Nl,Il,Kr,Xt,Na].forEach(function(t){Ee(Zr,t)});var Yn=1e3/60,Rl={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var o=pn(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),i=function(u,v){var f=_t(),d=n.averageRedrawTime,h=n.lastRedrawTime,c=[],p=n.cy.extent(),g=n.getPixelRatio();for(u||n.flushRenderedStyleQueue();;){var y=_t(),b=y-f,m=y-v;if(h<Yn){var T=Yn-(u?d:0);if(m>=e.deqFastCost*T)break}else if(u){if(b>=e.deqCost*h||b>=e.deqAvgCost*d)break}else if(m>=e.deqNoDrawCost*Yn)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),!u&&e.shouldRedraw(a,c,g,p)&&o())},s=e.priority||bi;n.beforeRender(i,s(a))}}}},ip=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),o=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(o,a),this.keyForId.set(a,o)}},{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),o=this.getKey(r);return n!==o}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var a=this.cachesByLvl,n=this.lvls,o=a.get(r);return o||(o=new Ft,a.set(r,o),n.push(r)),o}},{key:"getCache",value:function(r,a){return this.getCachesAt(a).get(r)}},{key:"get",value:function(r,a){var n=this.getKey(r),o=this.getCache(n,a);return o!=null&&this.updateKeyMappingFor(r),o}},{key:"getForCachedKey",value:function(r,a){var n=this.keyForId.get(r.id()),o=this.getCache(n,a);return o}},{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 o=this.getKey(r);this.setCache(o,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 o=this.doesEleInvalidateKey(r);return o&&this.invalidateKey(n),o||this.getNumberOfIdsForKey(n)===0}}]),t}(),Jo=25,Ya=50,ja=-4,si=3,op=7.99,sp=8,lp=1024,up=1024,vp=1024,fp=.2,hp=.8,cp=10,dp=.15,gp=.1,pp=.9,yp=.9,mp=100,bp=1,Rr={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Ep=rt({getKey:null,doesEleInvalidateKey:nn,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Cs,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ua=function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=Ep(r);Ee(a,n),a.lookup=new ip(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},We=ua.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 o=this,i=this.renderer,s=i.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!o.allowEdgeTxrCaching&&t.isEdge()||!o.allowParentTxrCaching&&t.isParent())return null;if(a==null&&(a=Math.ceil(wi(s*r))),a<ja)a=ja;else if(s>=op||a>si)return null;var u=Math.pow(2,a),v=e.h*u,f=e.w*u,d=i.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,d))return null;var h=l.get(t,a);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;var c;if(v<=Jo?c=Jo:v<=Ya?c=Ya:c=Math.ceil(v/Ya)*Ya,v>vp||f>up)return null;var p=o.getTextureQueue(c),g=p[p.length-2],y=function(){return o.recycleTexture(c,f)||o.addTexture(c,f)};g||(g=p[p.length-1]),g||(g=y()),g.width-g.usedWidth<f&&(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<=si;E++){var x=l.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,f,v)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,f,c),b(w))D();else if(b(S))if(T){for(var L=S.level;L>a;L--)w=o.getElement(t,e,r,L,Rr.downscale);D()}else return o.queueElement(t,S.level-1),S;else{var A;if(!m&&!T&&!C)for(var N=a-1;N>=ja;N--){var O=l.get(t,N);if(O){A=O;break}}if(b(A))return o.queueElement(t,a),A;g.context.translate(g.usedWidth,0),g.context.scale(u,u),this.drawElement(g.context,t,e,d,!1),g.context.scale(1/u,1/u),g.context.translate(-g.usedWidth,0)}return h={x:g.usedWidth,texture:g,level:a,scale:u,width:f,height:v,scaledLabelShown:d},g.usedWidth+=Math.ceil(f+sp),g.eleCaches.push(h),l.set(t,a,h),o.checkTextureFullness(g),h};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 o=ja;o<=si;o++){var i=r.getForCachedKey(t,o);i&&a.push(i)}var s=r.invalidate(t);if(s)for(var l=0;l<a.length;l++){var u=a[l],v=u.texture;v.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(v)}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>=cp?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 o=t.eleCaches,i=0;i<o.length;i++){var s=o[i];n.deleteCache(s.key,s.level)}Ei(o);var l=e.getRetiredTextureQueue(r);l.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(lp,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),o=0;o<n.length;o++){var i=n[o];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(),o=this.getKey(t),i=n[o];if(i)i.level=Math.max(i.level,e),i.eles.merge(t),i.reqs++,a.updateItem(i);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:o};a.push(s),n[o]=s}};We.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],o=e.lookup,i=0;i<bp&&r.size()>0;i++){var s=r.pop(),l=s.key,u=s.eles[0],v=o.hasCache(u,s.level);if(a[l]=null,v)continue;n.push(s);var f=e.getBoundingBox(u);e.getElement(u,f,t,s.level,Rr.dequeue)}return n};We.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),o=a[n];o!=null&&(o.eles.length===1?(o.reqs=mi,r.updateItem(o),r.pop(),a[n]=null):o.eles.unmerge(t))};We.onDequeue=function(t){this.onDequeues.push(t)};We.offDequeue=function(t){tr(this.onDequeues,t)};We.setupDequeueing=Rl.setupDequeueing({deqRedrawThreshold:mp,deqCost:dp,deqAvgCost:gp,deqNoDrawCost:pp,deqFastCost:yp,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 o=0;o<r.length;o++)for(var i=r[o].eles,s=0;s<i.length;s++){var l=i[s].boundingBox();if(xi(l,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var wp=1,fa=-4,cn=2,xp=3.99,Tp=50,Cp=50,Dp=.15,Sp=.1,Lp=.9,Ap=.9,Op=1,jo=250,Np=4e3*4e3,Ip=!0,kl=function(e){var r=this,a=r.renderer=e,n=a.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=_t()-2*jo,r.skipping=!1,r.eleTxrDeqs=n.collection(),r.scheduleElementRefinement=pn(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},Cp),a.beforeRender(function(i,s){s-r.lastInvalidationTime<=jo?r.skipping=!0:r.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var o=function(s,l){return l.reqs-s.reqs};r.layersQueue=new Sa(o),r.setupDequeueing()},at=kl.prototype,es=0,Mp=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),o=this.renderer.makeOffscreenCanvas(a,n),i={id:es=++es%Mp,bb:t,level:e,width:a,height:n,canvas:o,context:o.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=i.context,l=-i.bb.x1,u=-i.bb.y1;return s.scale(r,r),s.translate(l,u),i};at.getLayers=function(t,e,r){var a=this,n=a.renderer,o=n.cy,i=o.zoom(),s=a.firstGet;if(a.firstGet=!1,r==null){if(r=Math.ceil(wi(i*e)),r<fa)r=fa;else if(i>=xp||r>cn)return null}a.validateLayersElesOrdering(r,t);var l=a.layersByLevel,u=Math.pow(2,r),v=l[r]=l[r]||[],f,d=a.levelIsComplete(r,t),h,c=function(){var D=function(M){if(a.validateLayersElesOrdering(M,t),a.levelIsComplete(M,t))return h=l[M],!0},L=function(M){if(!h)for(var R=r+M;fa<=R&&R<=cn&&!D(R);R+=M);};L(1),L(-1);for(var A=v.length-1;A>=0;A--){var N=v[A];N.invalid&&tr(v,N)}};if(!d)c();else return v;var p=function(){if(!f){f=pt();for(var D=0;D<t.length;D++)Ns(f,t[D].boundingBox())}return f},g=function(D){D=D||{};var L=D.after;p();var A=f.w*u*(f.h*u);if(A>Np)return null;var N=a.makeLayer(f,r);if(L!=null){var O=v.indexOf(L)+1;v.splice(O,0,N)}else(D.insert===void 0||D.insert)&&v.unshift(N);return N};if(a.skipping&&!s)return null;for(var y=null,b=t.length/wp,m=!s,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||!Is(y.bb,C.boundingBox()))&&(y=g({insert:!0,after:y}),!y))return null;h||m?a.queueLayer(y,C):a.drawEleInLayer(y,C,r,e),y.eles.push(C),E[r]=y}return h||(m?null:v)};at.getEleLevelForLayerLevel=function(t,e){return t};at.drawEleInLayer=function(t,e,r,a){var n=this,o=this.renderer,i=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),o.setImgSmoothing(i,!1),o.drawCachedElement(i,e,null,null,r,Ip),o.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,o=0;o<a.length;o++){var i=a[o];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],o=-1,i=0;i<e.length;i++)if(n.eles[0]===e[i]){o=i;break}if(o<0){this.invalidateLayer(n);continue}for(var s=o,i=0;i<n.eles.length;i++)if(n.eles[i]!==e[s+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 o=a?null:t[n],i=a?t[n]:t[n].ele,s=i._private.rscratch,l=s.imgLayerCaches=s.imgLayerCaches||{},u=fa;u<=cn;u++){var v=l[u];v&&(o&&r.getEleLevelForLayerLevel(v.level)!==o.level||e(v,i,o))}};at.haveLayers=function(){for(var t=this,e=!1,r=fa;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=_t(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(a,n,o){e.invalidateLayer(a)}))};at.invalidateLayer=function(t){if(this.lastInvalidationTime=_t(),!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 o=r[n]._private.rscratch.imgLayerCaches;o&&(o[e]=null)}}};at.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(a,n,o){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 s=0;s<i.eles.length;s++)e.queueLayer(i,i.eles[s])})};at.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};at.queueLayer=function(t,e){var r=this,a=r.layersQueue,n=t.elesQueue,o=n.hasId=n.hasId||{};if(!t.replacement){if(e){if(o[e.id()])return;n.push(e),o[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<Op&&r.size()!==0;){var o=r.peek();if(o.replacement){r.pop();continue}if(o.replaces&&o!==o.replaces.replacement){r.pop();continue}if(o.invalid){r.pop();continue}var i=o.elesQueue.shift();i&&(e.drawEleInLayer(o,i,o.level,t),n++),a.length===0&&a.push(!0),o.elesQueue.length===0&&(r.pop(),o.reqs=0,o.replaces&&e.applyLayerReplacement(o),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 o=0;o<t.eles.length;o++){var i=t.eles[o]._private,s=i.imgLayerCaches=i.imgLayerCaches||{};s&&(s[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=Rl.setupDequeueing({deqRedrawThreshold:Tp,deqCost:Dp,deqAvgCost:Sp,deqNoDrawCost:Lp,deqFastCost:Ap,deq:function(e,r){return e.dequeue(r)},onDeqd:bi,shouldRedraw:Cs,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Pl={},ts;function Rp(t,e){for(var r=0;r<e.length;r++){var a=e[r];t.lineTo(a.x,a.y)}}function kp(t,e,r){for(var a,n=0;n<e.length;n++){var o=e[n];n===0&&(a=o),t.lineTo(o.x,o.y)}t.quadraticCurveTo(r.x,r.y,a.x,a.y)}function rs(t,e,r){t.beginPath&&t.beginPath();for(var a=e,n=0;n<a.length;n++){var o=a[n];t.lineTo(o.x,o.y)}var i=r,s=r[0];t.moveTo(s.x,s.y);for(var n=1;n<i.length;n++){var o=i[n];t.lineTo(o.x,o.y)}t.closePath&&t.closePath()}function Pp(t,e,r,a,n){t.beginPath&&t.beginPath(),t.arc(r,a,n,0,Math.PI*2,!1);var o=e,i=o[0];t.moveTo(i.x,i.y);for(var s=0;s<o.length;s++){var l=o[s];t.lineTo(l.x,l.y)}t.closePath&&t.closePath()}function Bp(t,e,r,a){t.arc(e,r,a,0,Math.PI*2,!1)}Pl.arrowShapeImpl=function(t){return(ts||(ts={polygon:Rp,"triangle-backcurve":kp,"triangle-tee":rs,"circle-triangle":Pp,"triangle-cross":rs,circle:Bp}))[t]};var Vt={};Vt.drawElement=function(t,e,r,a,n,o){var i=this;e.isNode()?i.drawNode(t,e,r,a,n,o):i.drawEdge(t,e,r,a,n,o)};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,o,i,s){var l=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var v=r.getElement(e,u,a,n,o);if(v!=null){var f=s(l,e);if(f===0)return;var d=i(l,e),h=u.x1,c=u.y1,p=u.w,g=u.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=l.getImgSmoothing(t),C||l.setImgSmoothing(t,!0);var E=r.getRotationOffset(e);y=E.x,b=E.y}else y=h,b=c;var x;f!==1&&(x=t.globalAlpha,t.globalAlpha=x*f),t.drawImage(v.texture.canvas,v.x,0,v.width,v.height,y,b,p,g),f!==1&&(t.globalAlpha=x),d!==0&&(t.rotate(-d),t.translate(-m,-T),C||l.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var Fp=function(){return 0},Gp=function(e,r){return e.getTextAngle(r,null)},zp=function(e,r){return e.getTextAngle(r,"source")},Vp=function(e,r){return e.getTextAngle(r,"target")},Up=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,o){var i=this,s=i.data,l=s.eleTxrCache,u=s.lblTxrCache,v=s.slbTxrCache,f=s.tlbTxrCache,d=e.boundingBox(),h=o===!0?l.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,l,r,n,h,Fp,Up),(!c||!p)&&i.drawCachedElementPortion(t,e,u,r,n,h,Gp,Hn),c&&!p&&(i.drawCachedElementPortion(t,e,v,r,n,h,zp,Hn),i.drawCachedElementPortion(t,e,f,r,n,h,Vp,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,o=0;o<e.length;o++){var i=e[o];n.drawCachedElement(t,i,r,a)}};Vt.drawCachedNodes=function(t,e,r,a){for(var n=this,o=0;o<e.length;o++){var i=e[o];i.isNode()&&n.drawCachedElement(t,i,r,a)}};Vt.drawLayeredElements=function(t,e,r,a){var n=this,o=n.data.lyrTxrCache.getLayers(e,r);if(o)for(var i=0;i<o.length;i++){var s=o[i],l=s.bb;l.w===0||l.h===0||t.drawImage(s.canvas,l.x1,l.y1,l.w,l.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,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,i=this,s=e._private.rscratch;if(!(o&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=o?e.pstyle("opacity").value:1,v=o?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,d=e.pstyle("line-style").value,h=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=u*v,b=u*v,m=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;f==="straight-triangle"?(i.eleStrokeStyle(t,e,M),i.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=h,t.lineCap=c,i.eleStrokeStyle(t,e,M),i.drawEdgePath(e,t,s.allpts,d),t.lineCap="butt")},T=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(t.lineWidth=h+p,t.lineCap=c,p>0)i.colorStrokeStyle(t,g[0],g[1],g[2],M);else{t.lineCap="butt";return}f==="straight-triangle"?i.drawEdgeTrianglePath(e,t,s.allpts):(i.drawEdgePath(e,t,s.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(l.x1,l.y1)}};var Bl=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 o=this,i=o.usePaths(),s=a._private.rscratch,l=a.pstyle("".concat(e,"-padding")).pfValue,u=2*l,v=a.pstyle("".concat(e,"-color")).value;r.lineWidth=u,s.edgeType==="self"&&!i?r.lineCap="butt":r.lineCap="round",o.colorStrokeStyle(r,v[0],v[1],v[2],n),o.drawEdgePath(a,r,s.allpts,"solid")}}}};qt.drawEdgeOverlay=Bl("overlay");qt.drawEdgeUnderlay=Bl("underlay");qt.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,o=e,i,s=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,v=t.pstyle("line-dash-offset").pfValue;if(l){var f=r.join("$"),d=n.pathCacheKey&&n.pathCacheKey===f;d?(i=e=n.pathCache,s=!0):(i=e=new Path2D,n.pathCacheKey=f,n.pathCache=i)}if(o.setLineDash)switch(a){case"dotted":o.setLineDash([1,1]);break;case"dashed":o.setLineDash(u),o.lineDashOffset=v;break;case"solid":o.setLineDash([]);break}if(!s&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<r.length;h+=4)e.quadraticCurveTo(r[h],r[h+1],r[h+2],r[h+3]);break;case"straight":case"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=vs(n.roundCorners),g;try{for(p.s();!(g=p.n()).done;){var y=g.value;Dl(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=o,l?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 o=[r[n+2]-r[n],r[n+3]-r[n+1]],i=Math.sqrt(o[0]*o[0]+o[1]*o[1]),s=[o[1]/i,-o[0]/i],l=[s[0]*a/2,s[1]*a/2];e.beginPath(),e.moveTo(r[n]-l[0],r[n+1]-l[1]),e.lineTo(r[n]+l[0],r[n+1]+l[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,o,i){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(o)||o==null)){var s=this,l=e.pstyle(r+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",v=e.pstyle(r+"-arrow-fill").value,f=e.pstyle("width").pfValue,d=e.pstyle(r+"-arrow-width"),h=d.value==="match-line"?f:d.pfValue;d.units==="%"&&(h*=f);var c=e.pstyle("opacity").value;i===void 0&&(i=c);var p=t.globalCompositeOperation;(i!==1||v==="hollow")&&(t.globalCompositeOperation="destination-out",s.colorFillStyle(t,255,255,255,1),s.colorStrokeStyle(t,255,255,255,1),s.drawArrowShape(e,t,u,f,l,h,a,n,o),t.globalCompositeOperation=p);var g=e.pstyle(r+"-arrow-color").value;s.colorFillStyle(t,g[0],g[1],g[2],i),s.colorStrokeStyle(t,g[0],g[1],g[2],i),s.drawArrowShape(e,t,v,f,l,h,a,n,o)}}};qt.drawArrowShape=function(t,e,r,a,n,o,i,s,l){var u=this,v=this.usePaths()&&n!=="triangle-cross",f=!1,d,h=e,c={x:i,y:s},p=t.pstyle("arrow-scale").value,g=this.getArrowWidth(a,p),y=u.arrowShapes[n];if(v){var b=u.arrowPathCache=u.arrowPathCache||[],m=gr(n),T=b[m];T!=null?(d=e=T,f=!0):(d=e=new Path2D,b[m]=d)}f||(e.beginPath&&e.beginPath(),v?y.draw(e,1,0,{x:0,y:0},1):y.draw(e,g,l,c,a),e.closePath&&e.closePath()),e=h,v&&(e.translate(i,s),e.rotate(l),e.scale(g,g)),(r==="filled"||r==="both")&&(v?e.fill(d):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=o/(v?g:1),e.lineJoin="miter",v?e.stroke(d):e.stroke()),v&&(e.scale(1/g,1/g),e.rotate(-l),e.translate(-i,-s))};var Fi={};Fi.safeDrawImage=function(t,e,r,a,n,o,i,s,l,u){if(!(n<=0||o<=0||l<=0||u<=0))try{t.drawImage(e,r,a,n,o,i,s,l,u)}catch(v){Ie(v)}};Fi.drawInscribedImage=function(t,e,r,a,n){var o=this,i=r.position(),s=i.x,l=i.y,u=r.cy().style(),v=u.getIndexedStyle.bind(u),f=v(r,"background-fit","value",a),d=v(r,"background-repeat","value",a),h=r.width(),c=r.height(),p=r.padding()*2,g=h+(v(r,"background-width-relative-to","value",a)==="inner"?0:p),y=c+(v(r,"background-height-relative-to","value",a)==="inner"?0:p),b=r._private.rscratch,m=v(r,"background-clip","value",a),T=m==="node",C=v(r,"background-image-opacity","value",a)*n,S=v(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(v(r,"background-width","value",a)!=="auto"&&(v(r,"background-width","units",a)==="%"?D=v(r,"background-width","pfValue",a)*g:D=v(r,"background-width","pfValue",a)),v(r,"background-height","value",a)!=="auto"&&(v(r,"background-height","units",a)==="%"?L=v(r,"background-height","pfValue",a)*y:L=v(r,"background-height","pfValue",a)),!(D===0||L===0)){if(f==="contain"){var A=Math.min(g/D,y/L);D*=A,L*=A}else if(f==="cover"){var A=Math.max(g/D,y/L);D*=A,L*=A}var N=s-g/2,O=v(r,"background-position-x","units",a),M=v(r,"background-position-x","pfValue",a);O==="%"?N+=(g-D)*M:N+=M;var R=v(r,"background-offset-x","units",a),k=v(r,"background-offset-x","pfValue",a);R==="%"?N+=(g-D)*k:N+=k;var P=l-y/2,B=v(r,"background-position-y","units",a),z=v(r,"background-position-y","pfValue",a);B==="%"?P+=(y-L)*z:P+=z;var G=v(r,"background-offset-y","units",a),F=v(r,"background-offset-y","pfValue",a);G==="%"?P+=(y-L)*F:P+=F,b.pathCache&&(N-=s,P-=l,s=0,l=0);var U=t.globalAlpha;t.globalAlpha=C;var H=o.getImgSmoothing(t),_=!1;if(S==="no"&&H?(o.setImgSmoothing(t,!1),_=!0):S==="yes"&&!H&&(o.setImgSmoothing(t,!0),_=!0),d==="no-repeat")T&&(t.save(),b.pathCache?t.clip(b.pathCache):(o.nodeShapes[o.getNodeShape(r)].draw(t,s,l,g,y,E,b),t.clip())),o.safeDrawImage(t,e,0,0,x,w,N,P,D,L),T&&t.restore();else{var Q=t.createPattern(e,d);t.fillStyle=Q,o.nodeShapes[o.getNodeShape(r)].draw(t,s,l,g,y,E,b),t.translate(N,P),t.fill(),t.translate(-N,-P)}t.globalAlpha=U,_&&o.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 o=t.pstyle("font-size").pfValue*e,i=t.pstyle("min-zoomed-font-size").pfValue;return!(o<i)};Tr.drawElementText=function(t,e,r,a,n){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,i=this;if(a==null){if(o&&!i.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var l=i.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,v=e.pstyle("label"),f=e.pstyle("source-label"),d=e.pstyle("target-label");if(u||(!v||!v.value)&&(!f||!f.value)&&(!d||!d.value))return;t.textAlign="center",t.textBaseline="bottom"}var h=!r,c;r&&(c=r,t.translate(-c.x1,-c.y1)),n==null?(i.drawText(t,e,null,h,o),e.isEdge()&&(i.drawText(t,e,"source",h,o),i.drawText(t,e,"target",h,o))):i.drawText(t,e,n,h,o),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",o=e.pstyle("font-family").strValue,i=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*s,u=e.pstyle("color").value,v=e.pstyle("text-outline-color").value;t.font=a+" "+i+" "+n+" "+o,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],s),this.colorStrokeStyle(t,v[0],v[1],v[2],l)};function Xn(t,e,r,a,n){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,i=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+o,r),t.lineTo(e+a-o,r),t.quadraticCurveTo(e+a,r,e+a,r+o),t.lineTo(e+a,r+n-o),t.quadraticCurveTo(e+a,r+n,e+a-o,r+n),t.lineTo(e+o,r+n),t.quadraticCurveTo(e,r+n,e,r+n-o),t.lineTo(e,r+o),t.quadraticCurveTo(e,r,e+o,r),t.closePath(),i?t.stroke():t.fill()}Tr.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,o=e?e+"-":"",i=t.pstyle(o+"text-rotation"),s=Ot(n,"labelAngle",e);return i.strValue==="autorotate"?r=t.isEdge()?s: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,o=e._private,i=o.rscratch,s=n?e.effectiveOpacity():1;if(!(n&&(s===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Ot(i,"labelX",r),u=Ot(i,"labelY",r),v,f,d=this.getLabelText(e,r);if(d!=null&&d!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,n);var h=r?r+"-":"",c=Ot(i,"labelWidth",r),p=Ot(i,"labelHeight",r),g=e.pstyle(h+"text-margin-x").pfValue,y=e.pstyle(h+"text-margin-y").pfValue,b=e.isEdge(),m=e.pstyle("text-halign").value,T=e.pstyle("text-valign").value;b&&(m="center",T="center"),l+=g,u+=y;var C;switch(a?C=this.getTextAngle(e,r):C=0,C!==0&&(v=l,f=u,t.translate(v,f),t.rotate(C),l=0,u=0),T){case"top":break;case"center":u+=p/2;break;case"bottom":u+=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=l-w;switch(m){case"left":N-=c;break;case"center":N-=c/2;break}var O=u-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*s+")",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*s+")",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 _=Ot(i,"labelWrapCachedLines",r),Q=Ot(i,"labelLineHeight",r),J=c/2,q=this.getLabelJustification(e);switch(q==="auto"||(m==="left"?q==="left"?l+=-c:q==="center"&&(l+=-J):m==="center"?q==="left"?l+=-J:q==="right"&&(l+=J):m==="right"&&(q==="center"?l+=J:q==="right"&&(l+=c))),T){case"top":u-=(_.length-1)*Q;break;case"center":case"bottom":u-=(_.length-1)*Q;break}for(var V=0;V<_.length;V++)H>0&&t.strokeText(_[V],l,u),t.fillText(_[V],l,u),u+=Q}else H>0&&t.strokeText(d,l,u),t.fillText(d,l,u);C!==0&&(t.rotate(-C),t.translate(-v,-f))}}};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,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,i=this,s,l,u=e._private,v=u.rscratch,f=e.position();if(!(!oe(f.x)||!oe(f.y))&&!(o&&!e.visible())){var d=o?e.effectiveOpacity():1,h=i.usePaths(),c,p=!1,g=e.padding();s=e.width()+2*g,l=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(){u.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,_=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]:_;i.colorStrokeStyle(t,U[0],U[1],U[2],ne)},K=function(ne,W,re,me){var be=i.nodePathCache=i.nodePathCache||[],fe=Ts(re==="polygon"?re+","+me.join(","):re,""+W,""+ne,""+J),we=be[fe],ue,pe=!1;return we!=null?(ue=we,pe=!0,v.pathCache=ue):(ue=new Path2D,be[fe]=v.pathCache=ue),{path:ue,cacheHit:pe}},ie=e.pstyle("shape").strValue,he=e.pstyle("shape-polygon-points").pfValue;if(h){t.translate(f.x,f.y);var ae=K(s,l,ie,he);c=ae.path,p=ae.cacheHit}var te=function(){if(!p){var ne=f;h&&(ne={x:0,y:0}),i.nodeShapes[i.getNodeShape(e)].draw(c||t,ne.x,ne.y,s,l,J,v)}h?t.fill(c):t.fill()},le=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=u.backgrounding,me=0,be=0;be<C.length;be++){var fe=e.cy().style().getIndexedStyle(e,"background-image-containment","value",be);if(W&&fe==="over"||!W&&fe==="inside"){me++;continue}T[be]&&C[be].complete&&!C[be].error&&(me++,i.drawInscribedImage(t,C[be],e,be,ne))}u.backgrounding=me!==S,re!==u.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&&(h||i.nodeShapes[i.getNodeShape(e)].draw(t,f.x,f.y,s,l,J,v)))},ve=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),h?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")h?t.clip(c):t.clip();else{var ne=new Path2D;ne.rect(-s/2-A,-l/2-A,s+2*A,l+2*A),ne.addPath(c),t.clip(ne,"evenodd")}h?t.stroke(c):t.stroke(),t.restore()}else h?t.stroke(c):t.stroke();if(M==="double"){t.lineWidth=A/3;var W=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",h?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=f;h&&(ne={x:0,y:0});var W=i.getNodeShape(e),re=A;P==="inside"&&(re=0),P==="outside"&&(re*=2);var me=(s+re+(F+Q))/s,be=(l+re+(F+Q))/l,fe=s*me,we=l*be,ue=i.nodeShapes[W].points,pe;if(h){var Ge=K(fe,we,W,ue);pe=Ge.path}if(W==="ellipse")i.drawEllipsePath(pe||t,ne.x,ne.y,fe,we);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(W)){var Re=0,vt=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,vt=(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=(s+Re)/s,fe=s*me,["round-hexagon","round-tag"].includes(W)||(be=(l+Re)/l,we=l*be)),J=J==="auto"?ks(fe,we):J;for(var $e=fe/2,ct=we/2,Je=J+(re+F+Q)/2,ft=new Array(ue.length/2),Tt=new Array(ue.length/2),bt=0;bt<ue.length/2;bt++)ft[bt]={x:ne.x+vt+$e*ue[bt*2],y:ne.y+Qe+ct*ue[bt*2+1]};var dt,Mt,Ut,Ct,_e=ft.length;for(Mt=ft[_e-1],dt=0;dt<_e;dt++)Ut=ft[dt%_e],Ct=ft[(dt+1)%_e],Tt[dt]=Pi(Mt,Ut,Ct,Je),Mt=Ut,Ut=Ct;i.drawRoundPolygonPath(pe||t,ne.x+vt,ne.y+Qe,s*me,l*be,ue,Tt)}else if(["roundrectangle","round-rectangle"].includes(W))J=J==="auto"?yr(fe,we):J,i.drawRoundRectanglePath(pe||t,ne.x,ne.y,fe,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,fe,we,null,J+(re+F+Q)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(W))J=J==="auto"?yr(fe,we):J,i.drawBottomRoundRectanglePath(pe||t,ne.x,ne.y,fe,we,J+(re+F+Q)/2);else if(W==="barrel")i.drawBarrelPath(pe||t,ne.x,ne.y,fe,we);else if(W.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(W)){var Ke=(re+F+Q)/s;ue=on(sn(ue,Ke)),i.drawPolygonPath(pe||t,ne.x,ne.y,s,l,ue)}else{var nt=(re+F+Q)/s;ue=on(sn(ue,-nt)),i.drawPolygonPath(pe||t,ne.x,ne.y,s,l,ue)}if(h?t.stroke(pe):t.stroke(),H==="double"){t.lineWidth=re/3;var Cr=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",h?t.stroke(pe):t.stroke(),t.globalCompositeOperation=Cr}t.setLineDash&&t.setLineDash([])}},Te=function(){n&&i.drawNodeOverlay(t,e,f,s,l)},xe=function(){n&&i.drawNodeUnderlay(t,e,f,s,l)},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(),le(X,!0),V(j*G),ye(),ce(L!==0||A!==0),le(X,!1),ve(X),t.translate(-I,-$)}h&&t.translate(-f.x,-f.y),xe(),h&&t.translate(f.x,f.y),Z(),Oe(),q(),te(),le(d,!0),V(),ye(),ce(L!==0||A!==0),le(d,!1),ve(),h&&t.translate(-f.x,-f.y),Se(),Te(),r&&t.translate(y.x1,y.y1)}};var Fl=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a,n,o,i){var s=this;if(a.visible()){var l=a.pstyle("".concat(e,"-padding")).pfValue,u=a.pstyle("".concat(e,"-opacity")).value,v=a.pstyle("".concat(e,"-color")).value,f=a.pstyle("".concat(e,"-shape")).value,d=a.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(n=n||a.position(),o==null||i==null){var h=a.padding();o=a.width()+2*h,i=a.height()+2*h}s.colorFillStyle(r,v[0],v[1],v[2],u),s.nodeShapes[f].draw(r,n.x,n.y,o+l*2,i+l*2,d),r.fill()}}}};Qr.drawNodeOverlay=Fl("overlay");Qr.drawNodeUnderlay=Fl("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(),o=e.pstyle("pie-size"),i=a.x,s=a.y,l=e.width(),u=e.height(),v=Math.min(l,u)/2,f=0,d=this.usePaths();d&&(i=0,s=0),o.units==="%"?v=v*o.pfValue:o.pfValue!==void 0&&(v=o.pfValue/2);for(var h=1;h<=n.pieBackgroundN;h++){var c=e.pstyle("pie-"+h+"-background-size").value,p=e.pstyle("pie-"+h+"-background-color").value,g=e.pstyle("pie-"+h+"-background-opacity").value*r,y=c/100;y+f>1&&(y=1-f);var b=1.5*Math.PI+2*Math.PI*f,m=2*Math.PI*y,T=b+m;c===0||f>=1||f+y>1||(t.beginPath(),t.moveTo(i,s),t.arc(i,s,v,b,T),t.closePath(),this.colorFillStyle(t,p[0],p[1],p[2],g),t.fill(),f+=y)}};var mt={},$p=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 o,i=this.usePaths(),s=r.pstyle(e+"-gradient-stop-colors").value,l=r.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),v=r.targetEndpoint(),f=r.midpoint(),d=pr(u,f),h=pr(v,f);o=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(d,h))}else{var c=i?{x:0,y:0}:r.position(),p=r.paddedWidth(),g=r.paddedHeight();o=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();o=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":o=t.createLinearGradient(m.x,m.y-E,m.x,m.y+E);break;case"to-top":o=t.createLinearGradient(m.x,m.y+E,m.x,m.y-E);break;case"to-left":o=t.createLinearGradient(m.x+S,m.y,m.x-S,m.y);break;case"to-right":o=t.createLinearGradient(m.x-S,m.y,m.x+S,m.y);break;case"to-bottom-right":case"to-right-bottom":o=t.createLinearGradient(m.x-S,m.y-E,m.x+S,m.y+E);break;case"to-top-right":case"to-right-top":o=t.createLinearGradient(m.x-S,m.y+E,m.x+S,m.y-E);break;case"to-bottom-left":case"to-left-bottom":o=t.createLinearGradient(m.x+S,m.y-E,m.x-S,m.y+E);break;case"to-top-left":case"to-left-top":o=t.createLinearGradient(m.x+S,m.y+E,m.x-S,m.y-E);break}}if(!o)return null;for(var w=l.length===s.length,D=s.length,L=0;L<D;L++)o.addColorStop(w?l[L]:L/(D-1),"rgba("+s[L][0]+","+s[L][1]+","+s[L][2]+","+n+")");return o};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],o=a[3],i=e.getPixelRatio(),s=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(i=s);var l=n*i,u=o*i,v;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var f=r.canvasContainer;f.style.width=n+"px",f.style.height=o+"px";for(var d=0;d<e.CANVAS_LAYERS;d++)v=r.canvases[d],v.width=l,v.height=u,v.style.width=n+"px",v.style.height=o+"px";for(var d=0;d<e.BUFFER_COUNT;d++)v=r.bufferCanvases[d],v.width=l,v.height=u,v.style.width=n+"px",v.style.height=o+"px";e.textureMult=1,i<=1&&(v=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,v.width=l*e.textureMult,v.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u}};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||Ls();var e=t.forcedContext,r=t.drawAllLayers,a=t.drawOnlyNodeLayer,n=t.forcedZoom,o=t.forcedPan,i=this,s=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,l=i.cy,u=i.data,v=u.canvasNeedsRedraw,f=i.textureOnViewport&&!e&&(i.pinching||i.hoverData.dragging||i.swipePanning||i.data.wheelZooming),d=t.motionBlur!==void 0?t.motionBlur:i.motionBlur,h=i.motionBlurPxRatio,c=l.hasCompoundNodes(),p=i.hoverData.draggingEles,g=!!(i.hoverData.selecting||i.touchData.selecting);d=d&&!e&&i.motionBlurEnabled&&!g;var y=d;e||(i.prevPxRatio!==s&&(i.invalidateContainerClientCoordsCache(),i.matchCanvasSize(i.container),i.redrawHint("eles",!0),i.redrawHint("drag",!0)),i.prevPxRatio=s),!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&&!f&&(v[i.NODE]=!0,v[i.SELECT_BOX]=!0);var b=l.style(),m=l.zoom(),T=n!==void 0?n:m,C=l.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),o&&(S=o),T*=s,S.x*=s,S.y*=s;var D=i.getCachedZSortedEles();function L(ae,te,le,ce,ve){var ye=ae.globalCompositeOperation;ae.globalCompositeOperation="destination-out",i.colorFillStyle(ae,255,255,255,i.motionBlurTransparency),ae.fillRect(te,le,ce,ve),ae.globalCompositeOperation=ye}function A(ae,te){var le,ce,ve,ye;!i.clearingMotionBlur&&(ae===u.bufferContexts[i.MOTIONBLUR_BUFFER_NODE]||ae===u.bufferContexts[i.MOTIONBLUR_BUFFER_DRAG])?(le={x:C.x*h,y:C.y*h},ce=m*h,ve=i.canvasWidth*h,ye=i.canvasHeight*h):(le=S,ce=T,ve=i.canvasWidth,ye=i.canvasHeight),ae.setTransform(1,0,0,1,0,0),te==="motionBlur"?L(ae,0,0,ve,ye):!e&&(te===void 0||te)&&ae.clearRect(0,0,ve,ye),r||(ae.translate(le.x,le.y),ae.scale(ce,ce)),o&&ae.translate(o.x,o.y),n&&ae.scale(n,n)}if(f||(i.textureDrawLastFrame=!1),f){if(i.textureDrawLastFrame=!0,!i.textureCache){i.textureCache={},i.textureCache.bb=l.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:s*i.textureMult});var E=i.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:i.canvasWidth,height:i.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}v[i.DRAG]=!1,v[i.NODE]=!1;var O=u.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=l.zoom();A(O,!1),O.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s),O.drawImage(M,E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s)}else i.textureOnViewport&&!e&&(i.textureCache=null);var P=l.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]=!v[i.NODE]&&d&&!i.clearedForMotionBlur[i.NODE]||i.clearingMotionBlur,G[i.NODE]&&(i.clearedForMotionBlur[i.NODE]=!0),G[i.DRAG]=!v[i.DRAG]&&d&&!i.clearedForMotionBlur[i.DRAG]||i.clearingMotionBlur,G[i.DRAG]&&(i.clearedForMotionBlur[i.DRAG]=!0),v[i.NODE]||r||a||G[i.NODE]){var F=d&&!G[i.NODE]&&h!==1,O=e||(F?i.data.bufferContexts[i.MOTIONBLUR_BUFFER_NODE]:u.contexts[i.NODE]),U=d&&!F?"motionBlur":void 0;A(O,U),z?i.drawCachedNodes(O,D.nondrag,s,P):i.drawLayeredElements(O,D.nondrag,s,P),i.debug&&i.drawDebugPoints(O,D.nondrag),!r&&!d&&(v[i.NODE]=!1)}if(!a&&(v[i.DRAG]||r||G[i.DRAG])){var F=d&&!G[i.DRAG]&&h!==1,O=e||(F?i.data.bufferContexts[i.MOTIONBLUR_BUFFER_DRAG]:u.contexts[i.DRAG]);A(O,d&&!F?"motionBlur":void 0),z?i.drawCachedNodes(O,D.drag,s,P):i.drawCachedElements(O,D.drag,s,P),i.debug&&i.drawDebugPoints(O,D.drag),!r&&!d&&(v[i.DRAG]=!1)}if(i.showFps||!a&&v[i.SELECT_BOX]&&!r){var O=e||u.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(u.bgActivePosistion&&!i.hoverData.selecting){var m=i.cy.zoom(),_=u.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(_.x,_.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||(v[i.SELECT_BOX]=!1)}if(d&&h!==1){var V=u.contexts[i.NODE],Z=i.data.bufferCanvases[i.MOTIONBLUR_BUFFER_NODE],K=u.contexts[i.DRAG],ie=i.data.bufferCanvases[i.MOTIONBLUR_BUFFER_DRAG],he=function(te,le,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 ve=h;te.drawImage(le,0,0,i.canvasWidth*ve,i.canvasHeight*ve,0,0,i.canvasWidth,i.canvasHeight)};(v[i.NODE]||G[i.NODE])&&(he(V,Z,G[i.NODE]),v[i.NODE]=!1),(v[i.DRAG]||G[i.DRAG])&&(he(K,ie,G[i.DRAG]),v[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=!f,i.mbFrames=0,v[i.NODE]=!0,v[i.DRAG]=!0,i.redraw()},$p)),e||l.emit("render")};var sr={};sr.drawPolygonPath=function(t,e,r,a,n,o){var i=a/2,s=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+i*o[0],r+s*o[1]);for(var l=1;l<o.length/2;l++)t.lineTo(e+i*o[l*2],r+s*o[l*2+1]);t.closePath()};sr.drawRoundPolygonPath=function(t,e,r,a,n,o,i){i.forEach(function(s){return Dl(t,s)}),t.closePath()};sr.drawRoundRectanglePath=function(t,e,r,a,n,o){var i=a/2,s=n/2,l=o==="auto"?yr(a,n):Math.min(o,s,i);t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.arcTo(e+i,r-s,e+i,r,l),t.arcTo(e+i,r+s,e,r+s,l),t.arcTo(e-i,r+s,e-i,r,l),t.arcTo(e-i,r-s,e,r-s,l),t.lineTo(e,r-s),t.closePath()};sr.drawBottomRoundRectanglePath=function(t,e,r,a,n,o){var i=a/2,s=n/2,l=o==="auto"?yr(a,n):o;t.beginPath&&t.beginPath(),t.moveTo(e,r-s),t.lineTo(e+i,r-s),t.lineTo(e+i,r),t.arcTo(e+i,r+s,e,r+s,l),t.arcTo(e-i,r+s,e-i,r,l),t.lineTo(e-i,r-s),t.lineTo(e,r-s),t.closePath()};sr.drawCutRectanglePath=function(t,e,r,a,n,o,i){var s=a/2,l=n/2,u=i==="auto"?Ti():i;t.beginPath&&t.beginPath(),t.moveTo(e-s+u,r-l),t.lineTo(e+s-u,r-l),t.lineTo(e+s,r-l+u),t.lineTo(e+s,r+l-u),t.lineTo(e+s-u,r+l),t.lineTo(e-s+u,r+l),t.lineTo(e-s,r+l-u),t.lineTo(e-s,r-l+u),t.closePath()};sr.drawBarrelPath=function(t,e,r,a,n){var o=a/2,i=n/2,s=e-o,l=e+o,u=r-i,v=r+i,f=Zn(a,n),d=f.widthOffset,h=f.heightOffset,c=f.ctrlPtOffsetPct*d;t.beginPath&&t.beginPath(),t.moveTo(s,u+h),t.lineTo(s,v-h),t.quadraticCurveTo(s+c,v,s+d,v),t.lineTo(l-d,v),t.quadraticCurveTo(l-c,v,l,v-h),t.lineTo(l,u+h),t.quadraticCurveTo(l-c,u,l-d,u),t.lineTo(s+d,u),t.quadraticCurveTo(s+c,u,s,u+h),t.closePath()};var as=Math.sin(0),ns=Math.cos(0),li={},ui={},Gl=Math.PI/40;for(var Nr=0*Math.PI;Nr<2*Math.PI;Nr+=Gl)li[Nr]=Math.sin(Nr),ui[Nr]=Math.cos(Nr);sr.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 o,i,s=a/2,l=n/2,u=0*Math.PI;u<2*Math.PI;u+=Gl)o=e-s*li[u]*as+s*ui[u]*ns,i=r+l*ui[u]*as+l*li[u]*ns,u===0?t.moveTo(o,i):t.lineTo(o,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(),o=t.full?Math.ceil(a.w):n[2],i=t.full?Math.ceil(a.h):n[3],s=oe(t.maxWidth)||oe(t.maxHeight),l=this.getPixelRatio(),u=1;if(t.scale!==void 0)o*=t.scale,i*=t.scale,u=t.scale;else if(s){var v=1/0,f=1/0;oe(t.maxWidth)&&(v=u*t.maxWidth/o),oe(t.maxHeight)&&(f=u*t.maxHeight/i),u=Math.min(v,f),o*=u,i*=u}s||(o*=l,i*=l,u*=l);var d=document.createElement("canvas");d.width=o,d.height=i,d.style.width=o+"px",d.style.height=i+"px";var h=d.getContext("2d");if(o>0&&i>0){h.clearRect(0,0,o,i),h.globalCompositeOperation="source-over";var c=this.getCachedZSortedEles();if(t.full)h.translate(-a.x1*u,-a.y1*u),h.scale(u,u),this.drawElements(h,c),h.scale(1/u,1/u),h.translate(a.x1*u,a.y1*u);else{var p=e.pan(),g={x:p.x*u,y:p.y*u};u*=e.zoom(),h.translate(g.x,g.y),h.scale(u,u),this.drawElements(h,c),h.scale(1/u,1/u),h.translate(-g.x,-g.y)}t.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=t.bg,h.rect(0,0,o,i),h.fill())}return d};function _p(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return new Blob([a],{type:e})}function is(t){var e=t.indexOf(",");return t.substr(e+1)}function zl(t,e,r){var a=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new _r(function(n,o){try{e.toBlob(function(i){i!=null?n(i):o(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(i){o(i)}});case"blob":return _p(is(a()),r);case"base64":return is(a());case"base64uri":default:return a()}}Ia.png=function(t){return zl(t,this.bufferCanvasImage(t),"image/png")};Ia.jpg=function(t){return zl(t,this.bufferCanvasImage(t),"image/jpeg")};var Vl={};Vl.nodeShapeImpl=function(t,e,r,a,n,o,i,s){switch(t){case"ellipse":return this.drawEllipsePath(e,r,a,n,o);case"polygon":return this.drawPolygonPath(e,r,a,n,o,i);case"round-polygon":return this.drawRoundPolygonPath(e,r,a,n,o,i,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,a,n,o,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,a,n,o,i,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,a,n,o,s);case"barrel":return this.drawBarrelPath(e,r,a,n,o)}};var Yp=Ul,Le=Ul.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 Ul(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",o="rgba(0,0,0,0)";e.data.canvasContainer=a.createElement("div");var i=e.data.canvasContainer.style;e.data.canvasContainer.style[n]=o,i.position="relative",i.zIndex="0",i.overflow="hidden";var s=t.cy.container();s.appendChild(e.data.canvasContainer),s.style[n]=o;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Nu()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<Le.CANVAS_LAYERS;u++){var v=e.data.canvases[u]=a.createElement("canvas");e.data.contexts[u]=v.getContext("2d"),Object.keys(l).forEach(function(q){v.style[q]=l[q]}),v.style.position="absolute",v.setAttribute("data-id","layer"+u),v.style.zIndex=String(Le.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(v),e.data.canvasNeedsRedraw[u]=!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 u=0;u<Le.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=a.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=pt(),d=function(V){return{x:(V.x1+V.x2)/2,y:(V.y1+V.y2)/2}},h=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,he){return e.drawElement(V,Z,K,!1,!1,he)},T=function(V,Z,K,ie,he){return e.drawElementText(V,Z,K,ie,"main",he)},C=function(V,Z,K,ie,he){return e.drawElementText(V,Z,K,ie,"source",he)},S=function(V,Z,K,ie,he){return e.drawElementText(V,Z,K,ie,"target",he)},E=function(V){return V.boundingBox(),V[0]._private.bodyBounds},x=function(V){return V.boundingBox(),V[0]._private.labelBounds.main||f},w=function(V){return V.boundingBox(),V[0]._private.labelBounds.source||f},D=function(V){return V.boundingBox(),V[0]._private.labelBounds.target||f},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 h(E(V))},B=function(V){return h(w(V))},z=function(V){return h(D(V))},G=function(V){var Z=x(V),K=h(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 ua(e,{getKey:p,doesEleInvalidateKey:c,drawElement:m,getBoundingBox:E,getRotationPoint:A,getRotationOffset:P,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),U=e.data.lblTxrCache=new ua(e,{getKey:g,drawElement:T,getBoundingBox:x,getRotationPoint:M,getRotationOffset:G,isVisible:L}),H=e.data.slbTxrCache=new ua(e,{getKey:y,drawElement:C,getBoundingBox:w,getRotationPoint:R,getRotationOffset:B,isVisible:L}),_=e.data.tlbTxrCache=new ua(e,{getKey:b,drawElement:S,getBoundingBox:D,getRotationPoint:k,getRotationOffset:z,isVisible:L}),Q=e.data.lyrTxrCache=new kl(e);e.onUpdateEleCalcs(function(V,Z){F.invalidateElements(Z),U.invalidateElements(Z),H.invalidateElements(Z),_.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),_.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 Hp=typeof Path2D<"u";Le.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Le.usePaths=function(){return Hp&&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};[Pl,Vt,qt,Fi,Tr,Qr,mt,sr,Ia,Vl].forEach(function(t){Ee(Le,t)});var Xp=[{name:"null",impl:xl},{name:"base",impl:Ml},{name:"canvas",impl:Yp}],qp=[{type:"layout",extensions:jg},{type:"renderer",extensions:Xp}],$l={},_l={};function Yl(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 o=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=o.prototype=Object.create(r.prototype),s=[],l=0;l<s.length;l++){var u=s[l];i[u]=i[u]||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 v=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 v?v.call(this):this.emit("layoutstop"),this},i.destroy||(i.destroy=function(){return this}),i.cy=function(){return this._private.cy};var f=function(x){return x._private.cy},d={addEventFields:function(x,w){w.layout=x,w.cy=f(x),w.target=x},bubble:function(){return!0},parent:function(x){return f(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=o}else if(t==="renderer"&&e!=="null"&&e!=="base"){var h=Hl("renderer","base"),c=h.prototype,p=r,g=r.prototype,y=function(){h.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 ps({map:$l,keys:[t,e],value:a})}function Hl(t,e){return ys({map:$l,keys:[t,e]})}function Wp(t,e,r,a,n){return ps({map:_l,keys:[t,e,r,a],value:n})}function Kp(t,e,r,a){return ys({map:_l,keys:[t,e,r,a]})}var vi=function(){if(arguments.length===2)return Hl.apply(null,arguments);if(arguments.length===3)return Yl.apply(null,arguments);if(arguments.length===4)return Kp.apply(null,arguments);if(arguments.length===5)return Wp.apply(null,arguments);Ve("Invalid extension access syntax")};xa.prototype.extension=vi;qp.forEach(function(t){t.extensions.forEach(function(e){Yl(t.type,e.name,e.impl)})});var Xl=function t(){if(!(this instanceof t))return new t;this.length=0},Er=Xl.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),o=0;o<n.length;o++){var i=n[o],s=a[i];if(s!=null){var l=it.properties[i]||it.properties[dn(i)];if(l!=null){var u=l.name,v=s;this[r].properties.push({name:u,value:v})}}}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 o=0;o<n.length;o++){var i=n[o];t.css(i.name,i.value)}}return t};var Zp="3.30.2",ir=function(e){if(e===void 0&&(e={}),De(e))return new xa(e);if(ge(e))return vi.apply(vi,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 Ds(t)};ir.version=Zp;ir.stylesheet=ir.Stylesheet=Xl;var ql={exports:{}},qn={exports:{}},Wn={exports:{}},os;function Qp(){return os||(os=1,function(t,e){(function(a,n){t.exports=n()})(hi,function(){return function(r){var a={};function n(o){if(a[o])return a[o].exports;var i=a[o]={i:o,l:!1,exports:{}};return r[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=r,n.c=a,n.i=function(o){return o},n.d=function(o,i,s){n.o(o,i)||Object.defineProperty(o,i,{configurable:!1,enumerable:!0,get:s})},n.n=function(o){var i=o&&o.__esModule?function(){return o.default}:function(){return o};return n.d(i,"a",i),i},n.o=function(o,i){return Object.prototype.hasOwnProperty.call(o,i)},n.p="",n(n.s=26)}([function(r,a,n){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,r.exports=o},function(r,a,n){var o=n(2),i=n(8),s=n(9);function l(v,f,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=v,this.target=f}l.prototype=Object.create(o.prototype);for(var u in o)l[u]=o[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(v){if(this.source===v)return this.target;if(this.target===v)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(v,f){for(var d=this.getOtherEnd(v),h=f.getGraphManager().getRoot();;){if(d.getOwner()==f)return d;if(d.getOwner()==h)break;d=d.getOwner().getParent()}return null},l.prototype.updateLength=function(){var v=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),v),this.isOverlapingSourceAndTarget||(this.lengthX=v[0]-v[2],this.lengthY=v[1]-v[3],Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.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=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,a,n){function o(i){this.vGraphObject=i}r.exports=o},function(r,a,n){var o=n(2),i=n(10),s=n(13),l=n(0),u=n(16),v=n(4);function f(h,c,p,g){p==null&&g==null&&(g=c),o.call(this,g),h.graphManager!=null&&(h=h.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=h,p!=null&&c!=null?this.rect=new s(c.x,c.y,p.width,p.height):this.rect=new s}f.prototype=Object.create(o.prototype);for(var d in o)f[d]=o[d];f.prototype.getEdges=function(){return this.edges},f.prototype.getChild=function(){return this.child},f.prototype.getOwner=function(){return this.owner},f.prototype.getWidth=function(){return this.rect.width},f.prototype.setWidth=function(h){this.rect.width=h},f.prototype.getHeight=function(){return this.rect.height},f.prototype.setHeight=function(h){this.rect.height=h},f.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},f.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},f.prototype.getCenter=function(){return new v(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},f.prototype.getLocation=function(){return new v(this.rect.x,this.rect.y)},f.prototype.getRect=function(){return this.rect},f.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},f.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},f.prototype.setRect=function(h,c){this.rect.x=h.x,this.rect.y=h.y,this.rect.width=c.width,this.rect.height=c.height},f.prototype.setCenter=function(h,c){this.rect.x=h-this.rect.width/2,this.rect.y=c-this.rect.height/2},f.prototype.setLocation=function(h,c){this.rect.x=h,this.rect.y=c},f.prototype.moveBy=function(h,c){this.rect.x+=h,this.rect.y+=c},f.prototype.getEdgeListToNode=function(h){var c=[],p=this;return p.edges.forEach(function(g){if(g.target==h){if(g.source!=p)throw"Incorrect edge source!";c.push(g)}}),c},f.prototype.getEdgesBetween=function(h){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==h||g.source==h)&&c.push(g)}),c},f.prototype.getNeighborsList=function(){var h=new Set,c=this;return c.edges.forEach(function(p){if(p.source==c)h.add(p.target);else{if(p.target!=c)throw"Incorrect incidency!";h.add(p.source)}}),h},f.prototype.withChildren=function(){var h=new Set,c,p;if(h.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){h.add(b)});return h},f.prototype.getNoOfChildren=function(){var h=0,c;if(this.child==null)h=1;else for(var p=this.child.getNodes(),g=0;g<p.length;g++)c=p[g],h+=c.getNoOfChildren();return h==0&&(h=1),h},f.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},f.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)},f.prototype.scatter=function(){var h,c,p=-l.INITIAL_WORLD_BOUNDARY,g=l.INITIAL_WORLD_BOUNDARY;h=l.WORLD_CENTER_X+u.nextDouble()*(g-p)+p;var y=-l.INITIAL_WORLD_BOUNDARY,b=l.INITIAL_WORLD_BOUNDARY;c=l.WORLD_CENTER_Y+u.nextDouble()*(b-y)+y,this.rect.x=h,this.rect.y=c},f.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var h=this.getChild();if(h.updateBounds(!0),this.rect.x=h.getLeft(),this.rect.y=h.getTop(),this.setWidth(h.getRight()-h.getLeft()),this.setHeight(h.getBottom()-h.getTop()),l.NODE_DIMENSIONS_INCLUDE_LABELS){var c=h.getRight()-h.getLeft(),p=h.getBottom()-h.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))}}},f.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},f.prototype.transform=function(h){var c=this.rect.x;c>l.WORLD_BOUNDARY?c=l.WORLD_BOUNDARY:c<-l.WORLD_BOUNDARY&&(c=-l.WORLD_BOUNDARY);var p=this.rect.y;p>l.WORLD_BOUNDARY?p=l.WORLD_BOUNDARY:p<-l.WORLD_BOUNDARY&&(p=-l.WORLD_BOUNDARY);var g=new v(c,p),y=h.inverseTransformPoint(g);this.setLocation(y.x,y.y)},f.prototype.getLeft=function(){return this.rect.x},f.prototype.getRight=function(){return this.rect.x+this.rect.width},f.prototype.getTop=function(){return this.rect.y},f.prototype.getBottom=function(){return this.rect.y+this.rect.height},f.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=f},function(r,a,n){function o(i,s){i==null&&s==null?(this.x=0,this.y=0):(this.x=i,this.y=s)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(i){this.x=i},o.prototype.setY=function(i){this.y=i},o.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(i){return this.x+=i.width,this.y+=i.height,this},r.exports=o},function(r,a,n){var o=n(2),i=n(10),s=n(0),l=n(6),u=n(3),v=n(1),f=n(13),d=n(12),h=n(11);function c(g,y,b){o.call(this,b),this.estimatedSize=i.MIN_VALUE,this.margin=s.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,y!=null&&y instanceof l?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}c.prototype=Object.create(o.prototype);for(var p in o)c[p]=o[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 u){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 v){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 f(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 f(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=s.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 h,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 o,i=n(1);function s(l){o=n(5),this.layout=l,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),v=this.add(l,u);return this.setRootGraph(v),this.rootGraph},s.prototype.add=function(l,u,v,f,d){if(v==null&&f==null&&d==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{d=v,f=u,v=l;var h=f.getOwner(),c=d.getOwner();if(!(h!=null&&h.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(c!=null&&c.getGraphManager()==this))throw"Target not in this graph mgr!";if(h==c)return v.isInterGraph=!1,h.add(v,f,d);if(v.isInterGraph=!0,v.source=f,v.target=d,this.edges.indexOf(v)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(v),!(v.source!=null&&v.target!=null))throw"Edge source and/or target is null!";if(!(v.source.edges.indexOf(v)==-1&&v.target.edges.indexOf(v)==-1))throw"Edge already in source and/or target incidency list!";return v.source.edges.push(v),v.target.edges.push(v),v}},s.prototype.remove=function(l){if(l instanceof o){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var v=[];v=v.concat(u.getEdges());for(var f,d=v.length,h=0;h<d;h++)f=v[h],u.remove(f);var c=[];c=c.concat(u.getNodes());var p;d=c.length;for(var h=0;h<d;h++)p=c[h],u.remove(p);u==this.rootGraph&&this.setRootGraph(null);var g=this.graphs.indexOf(u);this.graphs.splice(g,1),u.parent=null}else if(l instanceof i){if(f=l,f==null)throw"Edge is null!";if(!f.isInterGraph)throw"Not an inter-graph edge!";if(!(f.source!=null&&f.target!=null))throw"Source and/or target is null!";if(!(f.source.edges.indexOf(f)!=-1&&f.target.edges.indexOf(f)!=-1))throw"Source and/or target doesn't know this edge!";var g=f.source.edges.indexOf(f);if(f.source.edges.splice(g,1),g=f.target.edges.indexOf(f),f.target.edges.splice(g,1),!(f.source.owner!=null&&f.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(f.source.owner.getGraphManager().edges.indexOf(f)==-1)throw"Not in owner graph manager's edge list!";var g=f.source.owner.getGraphManager().edges.indexOf(f);f.source.owner.getGraphManager().edges.splice(g,1)}},s.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},s.prototype.getGraphs=function(){return this.graphs},s.prototype.getAllNodes=function(){if(this.allNodes==null){for(var l=[],u=this.getGraphs(),v=u.length,f=0;f<v;f++)l=l.concat(u[f].getNodes());this.allNodes=l}return this.allNodes},s.prototype.resetAllNodes=function(){this.allNodes=null},s.prototype.resetAllEdges=function(){this.allEdges=null},s.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},s.prototype.getAllEdges=function(){if(this.allEdges==null){var l=[],u=this.getGraphs();u.length;for(var v=0;v<u.length;v++)l=l.concat(u[v].getEdges());l=l.concat(this.edges),this.allEdges=l}return this.allEdges},s.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},s.prototype.setAllNodesToApplyGravitation=function(l){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=l},s.prototype.getRoot=function(){return this.rootGraph},s.prototype.setRootGraph=function(l){if(l.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=l,l.parent==null&&(l.parent=this.layout.newNode("Root node"))},s.prototype.getLayout=function(){return this.layout},s.prototype.isOneAncestorOfOther=function(l,u){if(!(l!=null&&u!=null))throw"assert failed";if(l==u)return!0;var v=l.getOwner(),f;do{if(f=v.getParent(),f==null)break;if(f==u)return!0;if(v=f.getOwner(),v==null)break}while(!0);v=u.getOwner();do{if(f=v.getParent(),f==null)break;if(f==l)return!0;if(v=f.getOwner(),v==null)break}while(!0);return!1},s.prototype.calcLowestCommonAncestors=function(){for(var l,u,v,f,d,h=this.getAllEdges(),c=h.length,p=0;p<c;p++){if(l=h[p],u=l.source,v=l.target,l.lca=null,l.sourceInLca=u,l.targetInLca=v,u==v){l.lca=u.getOwner();continue}for(f=u.getOwner();l.lca==null;){for(l.targetInLca=v,d=v.getOwner();l.lca==null;){if(d==f){l.lca=d;break}if(d==this.rootGraph)break;if(l.lca!=null)throw"assert failed";l.targetInLca=d.getParent(),d=l.targetInLca.getOwner()}if(f==this.rootGraph)break;l.lca==null&&(l.sourceInLca=f.getParent(),f=l.sourceInLca.getOwner())}if(l.lca==null)throw"assert failed"}},s.prototype.calcLowestCommonAncestor=function(l,u){if(l==u)return l.getOwner();var v=l.getOwner();do{if(v==null)break;var f=u.getOwner();do{if(f==null)break;if(f==v)return f;f=f.getParent().getOwner()}while(!0);v=v.getParent().getOwner()}while(!0);return v},s.prototype.calcInclusionTreeDepths=function(l,u){l==null&&u==null&&(l=this.rootGraph,u=1);for(var v,f=l.getNodes(),d=f.length,h=0;h<d;h++)v=f[h],v.inclusionTreeDepth=u,v.child!=null&&this.calcInclusionTreeDepths(v.child,u+1)},s.prototype.includesInvalidEdge=function(){for(var l,u=this.edges.length,v=0;v<u;v++)if(l=this.edges[v],this.isOneAncestorOfOther(l.source,l.target))return!0;return!1},r.exports=s},function(r,a,n){var o=n(0);function i(){}for(var s in o)i[s]=o[s];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 o=n(12);function i(){}i.calcSeparationAmount=function(s,l,u,v){if(!s.intersects(l))throw"assert failed";var f=new Array(2);this.decideDirectionsForOverlappingNodes(s,l,f),u[0]=Math.min(s.getRight(),l.getRight())-Math.max(s.x,l.x),u[1]=Math.min(s.getBottom(),l.getBottom())-Math.max(s.y,l.y),s.getX()<=l.getX()&&s.getRight()>=l.getRight()?u[0]+=Math.min(l.getX()-s.getX(),s.getRight()-l.getRight()):l.getX()<=s.getX()&&l.getRight()>=s.getRight()&&(u[0]+=Math.min(s.getX()-l.getX(),l.getRight()-s.getRight())),s.getY()<=l.getY()&&s.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-s.getY(),s.getBottom()-l.getBottom()):l.getY()<=s.getY()&&l.getBottom()>=s.getBottom()&&(u[1]+=Math.min(s.getY()-l.getY(),l.getBottom()-s.getBottom()));var d=Math.abs((l.getCenterY()-s.getCenterY())/(l.getCenterX()-s.getCenterX()));l.getCenterY()===s.getCenterY()&&l.getCenterX()===s.getCenterX()&&(d=1);var h=d*u[0],c=u[1]/d;u[0]<c?c=u[0]:h=u[1],u[0]=-1*f[0]*(c/2+v),u[1]=-1*f[1]*(h/2+v)},i.decideDirectionsForOverlappingNodes=function(s,l,u){s.getCenterX()<l.getCenterX()?u[0]=-1:u[0]=1,s.getCenterY()<l.getCenterY()?u[1]=-1:u[1]=1},i.getIntersection2=function(s,l,u){var v=s.getCenterX(),f=s.getCenterY(),d=l.getCenterX(),h=l.getCenterY();if(s.intersects(l))return u[0]=v,u[1]=f,u[2]=d,u[3]=h,!0;var c=s.getX(),p=s.getY(),g=s.getRight(),y=s.getX(),b=s.getBottom(),m=s.getRight(),T=s.getWidthHalf(),C=s.getHeightHalf(),S=l.getX(),E=l.getY(),x=l.getRight(),w=l.getX(),D=l.getBottom(),L=l.getRight(),A=l.getWidthHalf(),N=l.getHeightHalf(),O=!1,M=!1;if(v===d){if(f>h)return u[0]=v,u[1]=p,u[2]=d,u[3]=D,!1;if(f<h)return u[0]=v,u[1]=b,u[2]=d,u[3]=E,!1}else if(f===h){if(v>d)return u[0]=c,u[1]=f,u[2]=x,u[3]=h,!1;if(v<d)return u[0]=g,u[1]=f,u[2]=S,u[3]=h,!1}else{var R=s.height/s.width,k=l.height/l.width,P=(h-f)/(d-v),B=void 0,z=void 0,G=void 0,F=void 0,U=void 0,H=void 0;if(-R===P?v>d?(u[0]=y,u[1]=b,O=!0):(u[0]=g,u[1]=p,O=!0):R===P&&(v>d?(u[0]=c,u[1]=p,O=!0):(u[0]=m,u[1]=b,O=!0)),-k===P?d>v?(u[2]=w,u[3]=D,M=!0):(u[2]=x,u[3]=E,M=!0):k===P&&(d>v?(u[2]=S,u[3]=E,M=!0):(u[2]=L,u[3]=D,M=!0)),O&&M)return!1;if(v>d?f>h?(B=this.getCardinalDirection(R,P,4),z=this.getCardinalDirection(k,P,2)):(B=this.getCardinalDirection(-R,P,3),z=this.getCardinalDirection(-k,P,1)):f>h?(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=v+-C/P,u[0]=G,u[1]=F;break;case 2:G=m,F=f+T*P,u[0]=G,u[1]=F;break;case 3:F=b,G=v+C/P,u[0]=G,u[1]=F;break;case 4:G=y,F=f+-T*P,u[0]=G,u[1]=F;break}if(!M)switch(z){case 1:H=E,U=d+-N/P,u[2]=U,u[3]=H;break;case 2:U=L,H=h+A*P,u[2]=U,u[3]=H;break;case 3:H=D,U=d+N/P,u[2]=U,u[3]=H;break;case 4:U=w,H=h+-A*P,u[2]=U,u[3]=H;break}}return!1},i.getCardinalDirection=function(s,l,u){return s>l?u:1+u%4},i.getIntersection=function(s,l,u,v){if(v==null)return this.getIntersection2(s,l,u);var f=s.x,d=s.y,h=l.x,c=l.y,p=u.x,g=u.y,y=v.x,b=v.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=f-h,w=h*d-f*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 o(m,T))},i.angleOfVector=function(s,l,u,v){var f=void 0;return s!==u?(f=Math.atan((v-l)/(u-s)),u<s?f+=Math.PI:v<l&&(f+=this.TWO_PI)):v<l?f=this.ONE_AND_HALF_PI:f=this.HALF_PI,f},i.doIntersect=function(s,l,u,v){var f=s.x,d=s.y,h=l.x,c=l.y,p=u.x,g=u.y,y=v.x,b=v.y,m=(h-f)*(b-g)-(y-p)*(c-d);if(m===0)return!1;var T=((b-g)*(y-f)+(p-y)*(b-d))/m,C=((d-c)*(y-f)+(h-f)*(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 o(){}o.sign=function(i){return i>0?1:i<0?-1:0},o.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)},o.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)},r.exports=o},function(r,a,n){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,r.exports=o},function(r,a,n){var o=function(){function f(d,h){for(var c=0;c<h.length;c++){var p=h[c];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(d,p.key,p)}}return function(d,h,c){return h&&f(d.prototype,h),c&&f(d,c),d}}();function i(f,d){if(!(f instanceof d))throw new TypeError("Cannot call a class as a function")}var s=function(d){return{value:d,next:null,prev:null}},l=function(d,h,c,p){return d!==null?d.next=h:p.head=h,c!==null?c.prev=h:p.tail=h,h.prev=d,h.next=c,p.length++,h},u=function(d,h){var c=d.prev,p=d.next;return c!==null?c.next=p:h.head=p,p!==null?p.prev=c:h.tail=c,d.prev=d.next=null,h.length--,d},v=function(){function f(d){var h=this;i(this,f),this.length=0,this.head=null,this.tail=null,d!=null&&d.forEach(function(c){return h.push(c)})}return o(f,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(h,c){return l(c.prev,s(h),c,this)}},{key:"insertAfter",value:function(h,c){return l(c,s(h),c.next,this)}},{key:"insertNodeBefore",value:function(h,c){return l(c.prev,h,c,this)}},{key:"insertNodeAfter",value:function(h,c){return l(c,h,c.next,this)}},{key:"push",value:function(h){return l(this.tail,s(h),null,this)}},{key:"unshift",value:function(h){return l(null,s(h),this.head,this)}},{key:"remove",value:function(h){return u(h,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(h){if(h<=this.length()){for(var c=1,p=this.head;c<h;)p=p.next,c++;return p.value}}},{key:"set_object_at",value:function(h,c){if(h<=this.length()){for(var p=1,g=this.head;p<h;)g=g.next,p++;g.value=c}}}]),f}();r.exports=v},function(r,a,n){function o(i,s,l){this.x=null,this.y=null,i==null&&s==null&&l==null?(this.x=0,this.y=0):typeof i=="number"&&typeof s=="number"&&l==null?(this.x=i,this.y=s):i.constructor.name=="Point"&&s==null&&l==null&&(l=i,this.x=l.x,this.y=l.y)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.getLocation=function(){return new o(this.x,this.y)},o.prototype.setLocation=function(i,s,l){i.constructor.name=="Point"&&s==null&&l==null?(l=i,this.setLocation(l.x,l.y)):typeof i=="number"&&typeof s=="number"&&l==null&&(parseInt(i)==i&&parseInt(s)==s?this.move(i,s):(this.x=Math.floor(i+.5),this.y=Math.floor(s+.5)))},o.prototype.move=function(i,s){this.x=i,this.y=s},o.prototype.translate=function(i,s){this.x+=i,this.y+=s},o.prototype.equals=function(i){if(i.constructor.name=="Point"){var s=i;return this.x==s.x&&this.y==s.y}return this==i},o.prototype.toString=function(){return new o().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=o},function(r,a,n){function o(i,s,l,u){this.x=0,this.y=0,this.width=0,this.height=0,i!=null&&s!=null&&l!=null&&u!=null&&(this.x=i,this.y=s,this.width=l,this.height=u)}o.prototype.getX=function(){return this.x},o.prototype.setX=function(i){this.x=i},o.prototype.getY=function(){return this.y},o.prototype.setY=function(i){this.y=i},o.prototype.getWidth=function(){return this.width},o.prototype.setWidth=function(i){this.width=i},o.prototype.getHeight=function(){return this.height},o.prototype.setHeight=function(i){this.height=i},o.prototype.getRight=function(){return this.x+this.width},o.prototype.getBottom=function(){return this.y+this.height},o.prototype.intersects=function(i){return!(this.getRight()<i.x||this.getBottom()<i.y||i.getRight()<this.x||i.getBottom()<this.y)},o.prototype.getCenterX=function(){return this.x+this.width/2},o.prototype.getMinX=function(){return this.getX()},o.prototype.getMaxX=function(){return this.getX()+this.width},o.prototype.getCenterY=function(){return this.y+this.height/2},o.prototype.getMinY=function(){return this.getY()},o.prototype.getMaxY=function(){return this.getY()+this.height},o.prototype.getWidthHalf=function(){return this.width/2},o.prototype.getHeightHalf=function(){return this.height/2},r.exports=o},function(r,a,n){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function i(){}i.lastID=0,i.createID=function(s){return i.isPrimitive(s)?s:(s.uniqueID!=null||(s.uniqueID=i.getString(),i.lastID++),s.uniqueID)},i.getString=function(s){return s==null&&(s=i.lastID),"Object#"+s},i.isPrimitive=function(s){var l=typeof s>"u"?"undefined":o(s);return s==null||l!="object"&&l!="function"},r.exports=i},function(r,a,n){function o(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),s=n(6),l=n(3),u=n(1),v=n(5),f=n(4),d=n(17),h=n(27);function c(p){h.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 s(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,p!=null&&(this.isRemoteUse=p)}c.RANDOM_SEED=1,c.prototype=Object.create(h.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 s(this);return this.graphManager=p,p},c.prototype.newGraph=function(p){return new v(null,this.graphManager,p)},c.prototype.newNode=function(p){return new l(this.graphManager,p)},c.prototype.newEdge=function(p){return new u(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 l){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 u){var T=p;if(T.vGraphObject!=null){var C=T.vGraphObject;C.update(T)}}else if(p instanceof v){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 f(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(o(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(o(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 f(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 o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},r.exports=o},function(r,a,n){var o=n(4);function i(s,l){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(s){this.lworldOrgX=s},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(s){this.lworldExtX=s},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(s){this.lworldExtY=s},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},i.prototype.transformX=function(s){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/u),l},i.prototype.transformY=function(s){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/u),l},i.prototype.inverseTransformX=function(s){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/u),l},i.prototype.inverseTransformY=function(s){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/u),l},i.prototype.inverseTransformPoint=function(s){var l=new o(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return l},r.exports=i},function(r,a,n){function o(h){if(Array.isArray(h)){for(var c=0,p=Array(h.length);c<h.length;c++)p[c]=h[c];return p}else return Array.from(h)}var i=n(15),s=n(7),l=n(0),u=n(8),v=n(9);function f(){i.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=s.DEFAULT_EDGE_LENGTH,this.springConstant=s.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=s.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}f.prototype=Object.create(i.prototype);for(var d in i)f[d]=i[d];f.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},f.prototype.calcIdealEdgeLengths=function(){for(var h,c,p,g,y,b,m=this.getGraphManager().getAllEdges(),T=0;T<m.length;T++)h=m[T],h.idealLength=this.idealEdgeLength,h.isInterGraph&&(p=h.getSource(),g=h.getTarget(),y=h.getSourceInLca().getEstimatedSize(),b=h.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(h.idealLength+=y+b-2*l.SIMPLE_NODE_SIZE),c=h.getLca().getInclusionTreeDepth(),h.idealLength+=s.DEFAULT_EDGE_LENGTH*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(p.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*c))},f.prototype.initSpringEmbedder=function(){var h=this.getAllNodes().length;this.incremental?(h>s.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(h-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(h>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(h-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},f.prototype.calcSpringForces=function(){for(var h=this.getAllEdges(),c,p=0;p<h.length;p++)c=h[p],this.calcSpringForce(c,c.idealLength)},f.prototype.calcRepulsionForces=function(){var h=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%s.GRID_CALCULATION_CHECK_PERIOD==1&&h&&this.updateGrid(),T=new Set,p=0;p<m.length;p++)y=m[p],this.calculateRepulsionForceOfANode(y,T,h,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)},f.prototype.calcGravitationalForces=function(){for(var h,c=this.getAllNodesToApplyGravitation(),p=0;p<c.length;p++)h=c[p],this.calcGravitationalForce(h)},f.prototype.moveNodes=function(){for(var h=this.getAllNodes(),c,p=0;p<h.length;p++)c=h[p],c.move()},f.prototype.calcSpringForce=function(h,c){var p=h.getSource(),g=h.getTarget(),y,b,m,T;if(this.uniformLeafNodeSizes&&p.getChild()==null&&g.getChild()==null)h.updateLengthSimple();else if(h.updateLength(),h.isOverlapingSourceAndTarget)return;y=h.getLength(),y!=0&&(b=this.springConstant*(y-c),m=b*(h.lengthX/y),T=b*(h.lengthY/y),p.springForceX+=m,p.springForceY+=T,g.springForceX-=m,g.springForceY-=T)},f.prototype.calcRepulsionForce=function(h,c){var p=h.getRect(),g=c.getRect(),y=new Array(2),b=new Array(4),m,T,C,S,E,x,w;if(p.intersects(g)){u.calcSeparationAmount(p,g,y,s.DEFAULT_EDGE_LENGTH/2),x=2*y[0],w=2*y[1];var D=h.noOfChildren*c.noOfChildren/(h.noOfChildren+c.noOfChildren);h.repulsionForceX-=D*x,h.repulsionForceY-=D*w,c.repulsionForceX+=D*x,c.repulsionForceY+=D*w}else this.uniformLeafNodeSizes&&h.getChild()==null&&c.getChild()==null?(m=g.getCenterX()-p.getCenterX(),T=g.getCenterY()-p.getCenterY()):(u.getIntersection(p,g,b),m=b[2]-b[0],T=b[3]-b[1]),Math.abs(m)<s.MIN_REPULSION_DIST&&(m=v.sign(m)*s.MIN_REPULSION_DIST),Math.abs(T)<s.MIN_REPULSION_DIST&&(T=v.sign(T)*s.MIN_REPULSION_DIST),C=m*m+T*T,S=Math.sqrt(C),E=this.repulsionConstant*h.noOfChildren*c.noOfChildren/C,x=E*m/S,w=E*T/S,h.repulsionForceX-=x,h.repulsionForceY-=w,c.repulsionForceX+=x,c.repulsionForceY+=w},f.prototype.calcGravitationalForce=function(h){var c,p,g,y,b,m,T,C;c=h.getOwner(),p=(c.getRight()+c.getLeft())/2,g=(c.getTop()+c.getBottom())/2,y=h.getCenterX()-p,b=h.getCenterY()-g,m=Math.abs(y)+h.getWidth()/2,T=Math.abs(b)+h.getHeight()/2,h.getOwner()==this.graphManager.getRoot()?(C=c.getEstimatedSize()*this.gravityRangeFactor,(m>C||T>C)&&(h.gravitationForceX=-this.gravityConstant*y,h.gravitationForceY=-this.gravityConstant*b)):(C=c.getEstimatedSize()*this.compoundGravityRangeFactor,(m>C||T>C)&&(h.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,h.gravitationForceY=-this.gravityConstant*b*this.compoundGravityConstant))},f.prototype.isConverged=function(){var h,c=!1;return this.totalIterations>this.maxIterations/3&&(c=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),h=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,h||c},f.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},f.prototype.calcNoOfChildrenForAllNodes=function(){for(var h,c=this.graphManager.getAllNodes(),p=0;p<c.length;p++)h=c[p],h.noOfChildren=h.getNoOfChildren()},f.prototype.calcGrid=function(h){var c=0,p=0;c=parseInt(Math.ceil((h.getRight()-h.getLeft())/this.repulsionRange)),p=parseInt(Math.ceil((h.getBottom()-h.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},f.prototype.addNodeToGrid=function(h,c,p){var g=0,y=0,b=0,m=0;g=parseInt(Math.floor((h.getRect().x-c)/this.repulsionRange)),y=parseInt(Math.floor((h.getRect().width+h.getRect().x-c)/this.repulsionRange)),b=parseInt(Math.floor((h.getRect().y-p)/this.repulsionRange)),m=parseInt(Math.floor((h.getRect().height+h.getRect().y-p)/this.repulsionRange));for(var T=g;T<=y;T++)for(var C=b;C<=m;C++)this.grid[T][C].push(h),h.setGridCoordinates(g,y,b,m)},f.prototype.updateGrid=function(){var h,c,p=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),h=0;h<p.length;h++)c=p[h],this.addNodeToGrid(c,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},f.prototype.calculateRepulsionForceOfANode=function(h,c,p,g){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&p||g){var y=new Set;h.surrounding=new Array;for(var b,m=this.grid,T=h.startX-1;T<h.finishX+2;T++)for(var C=h.startY-1;C<h.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],!(h.getOwner()!=b.getOwner()||h==b)&&!c.has(b)&&!y.has(b)){var E=Math.abs(h.getCenterX()-b.getCenterX())-(h.getWidth()/2+b.getWidth()/2),x=Math.abs(h.getCenterY()-b.getCenterY())-(h.getHeight()/2+b.getHeight()/2);E<=this.repulsionRange&&x<=this.repulsionRange&&y.add(b)}}h.surrounding=[].concat(o(y))}for(T=0;T<h.surrounding.length;T++)this.calcRepulsionForce(h,h.surrounding[T])},f.prototype.calcRepulsionRange=function(){return 0},r.exports=f},function(r,a,n){var o=n(1),i=n(7);function s(u,v,f){o.call(this,u,v,f),this.idealLength=i.DEFAULT_EDGE_LENGTH}s.prototype=Object.create(o.prototype);for(var l in o)s[l]=o[l];r.exports=s},function(r,a,n){var o=n(3);function i(l,u,v,f){o.call(this,l,u,v,f),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(o.prototype);for(var s in o)i[s]=o[s];i.prototype.setGridCoordinates=function(l,u,v,f){this.startX=l,this.finishX=u,this.startY=v,this.finishY=f},r.exports=i},function(r,a,n){function o(i,s){this.width=0,this.height=0,i!==null&&s!==null&&(this.height=s,this.width=i)}o.prototype.getWidth=function(){return this.width},o.prototype.setWidth=function(i){this.width=i},o.prototype.getHeight=function(){return this.height},o.prototype.setHeight=function(i){this.height=i},r.exports=o},function(r,a,n){var o=n(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(s,l){var u=o.createID(s);this.contains(u)||(this.map[u]=l,this.keys.push(s))},i.prototype.contains=function(s){return o.createID(s),this.map[s]!=null},i.prototype.get=function(s){var l=o.createID(s);return this.map[l]},i.prototype.keySet=function(){return this.keys},r.exports=i},function(r,a,n){var o=n(14);function i(){this.set={}}i.prototype.add=function(s){var l=o.createID(s);this.contains(l)||(this.set[l]=s)},i.prototype.remove=function(s){delete this.set[o.createID(s)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(s){return this.set[o.createID(s)]==s},i.prototype.isEmpty=function(){return this.size()===0},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(s){for(var l=Object.keys(this.set),u=l.length,v=0;v<u;v++)s.push(this.set[l[v]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(s){for(var l=s.length,u=0;u<l;u++){var v=s[u];this.add(v)}},r.exports=i},function(r,a,n){var o=function(){function u(v,f){for(var d=0;d<f.length;d++){var h=f[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(v,h.key,h)}}return function(v,f,d){return f&&u(v.prototype,f),d&&u(v,d),v}}();function i(u,v){if(!(u instanceof v))throw new TypeError("Cannot call a class as a function")}var s=n(11),l=function(){function u(v,f){i(this,u),(f!==null||f!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var d=void 0;v instanceof s?d=v.size():d=v.length,this._quicksort(v,0,d-1)}return o(u,[{key:"_quicksort",value:function(f,d,h){if(d<h){var c=this._partition(f,d,h);this._quicksort(f,d,c),this._quicksort(f,c+1,h)}}},{key:"_partition",value:function(f,d,h){for(var c=this._get(f,d),p=d,g=h;;){for(;this.compareFunction(c,this._get(f,g));)g--;for(;this.compareFunction(this._get(f,p),c);)p++;if(p<g)this._swap(f,p,g),p++,g--;else return g}}},{key:"_get",value:function(f,d){return f instanceof s?f.get_object_at(d):f[d]}},{key:"_set",value:function(f,d,h){f instanceof s?f.set_object_at(d,h):f[d]=h}},{key:"_swap",value:function(f,d,h){var c=this._get(f,d);this._set(f,d,this._get(f,h)),this._set(f,h,c)}},{key:"_defaultCompareFunction",value:function(f,d){return d>f}}]),u}();r.exports=l},function(r,a,n){var o=function(){function l(u,v){for(var f=0;f<v.length;f++){var d=v[f];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(u,d.key,d)}}return function(u,v,f){return v&&l(u.prototype,v),f&&l(u,f),u}}();function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var s=function(){function l(u,v){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,h=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,l),this.sequence1=u,this.sequence2=v,this.match_score=f,this.mismatch_penalty=d,this.gap_penalty=h,this.iMax=u.length+1,this.jMax=v.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 o(l,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var v=1;v<this.jMax;v++)this.grid[0][v]=this.grid[0][v-1]+this.gap_penalty,this.tracebackGrid[0][v]=[!1,!1,!0];for(var f=1;f<this.iMax;f++)this.grid[f][0]=this.grid[f-1][0]+this.gap_penalty,this.tracebackGrid[f][0]=[!1,!0,!1];for(var d=1;d<this.iMax;d++)for(var h=1;h<this.jMax;h++){var c=void 0;this.sequence1[d-1]===this.sequence2[h-1]?c=this.grid[d-1][h-1]+this.match_score:c=this.grid[d-1][h-1]+this.mismatch_penalty;var p=this.grid[d-1][h]+this.gap_penalty,g=this.grid[d][h-1]+this.gap_penalty,y=[c,p,g],b=this.arrayAllMaxIndexes(y);this.grid[d][h]=y[b[0]],this.tracebackGrid[d][h]=[b.includes(0),b.includes(1),b.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var v=[];for(v.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});v[0];){var f=v[0],d=this.tracebackGrid[f.pos[0]][f.pos[1]];d[0]&&v.push({pos:[f.pos[0]-1,f.pos[1]-1],seq1:this.sequence1[f.pos[0]-1]+f.seq1,seq2:this.sequence2[f.pos[1]-1]+f.seq2}),d[1]&&v.push({pos:[f.pos[0]-1,f.pos[1]],seq1:this.sequence1[f.pos[0]-1]+f.seq1,seq2:"-"+f.seq2}),d[2]&&v.push({pos:[f.pos[0],f.pos[1]-1],seq1:"-"+f.seq1,seq2:this.sequence2[f.pos[1]-1]+f.seq2}),f.pos[0]===0&&f.pos[1]===0&&this.alignments.push({sequence1:f.seq1,sequence2:f.seq2}),v.shift()}return this.alignments}},{key:"getAllIndexes",value:function(v,f){for(var d=[],h=-1;(h=v.indexOf(f,h+1))!==-1;)d.push(h);return d}},{key:"arrayAllMaxIndexes",value:function(v){return this.getAllIndexes(v,Math.max.apply(null,v))}}]),l}();r.exports=s},function(r,a,n){var o=function(){};o.FDLayout=n(18),o.FDLayoutConstants=n(7),o.FDLayoutEdge=n(19),o.FDLayoutNode=n(20),o.DimensionD=n(21),o.HashMap=n(22),o.HashSet=n(23),o.IGeometry=n(8),o.IMath=n(9),o.Integer=n(10),o.Point=n(12),o.PointD=n(4),o.RandomSeed=n(16),o.RectangleD=n(13),o.Transform=n(17),o.UniqueIDGeneretor=n(14),o.Quicksort=n(24),o.LinkedList=n(11),o.LGraphObject=n(2),o.LGraph=n(5),o.LEdge=n(1),o.LGraphManager=n(6),o.LNode=n(3),o.Layout=n(15),o.LayoutConstants=n(0),o.NeedlemanWunsch=n(25),r.exports=o},function(r,a,n){function o(){this.listeners=[]}var i=o.prototype;i.addListener=function(s,l){this.listeners.push({event:s,callback:l})},i.removeListener=function(s,l){for(var u=this.listeners.length;u>=0;u--){var v=this.listeners[u];v.event===s&&v.callback===l&&this.listeners.splice(u,1)}},i.emit=function(s,l){for(var u=0;u<this.listeners.length;u++){var v=this.listeners[u];s===v.event&&v.callback(l)}},r.exports=o}])})}(Wn)),Wn.exports}var ss;function Jp(){return ss||(ss=1,function(t,e){(function(a,n){t.exports=n(Qp())})(hi,function(r){return function(a){var n={};function o(i){if(n[i])return n[i].exports;var s=n[i]={i,l:!1,exports:{}};return a[i].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=a,o.c=n,o.i=function(i){return i},o.d=function(i,s,l){o.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:l})},o.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(s,"a",s),s},o.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},o.p="",o(o.s=7)}([function(a,n){a.exports=r},function(a,n,o){var i=o(0).FDLayoutConstants;function s(){}for(var l in i)s[l]=i[l];s.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,s.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,s.DEFAULT_COMPONENT_SEPERATION=60,s.TILE=!0,s.TILING_PADDING_VERTICAL=10,s.TILING_PADDING_HORIZONTAL=10,s.TREE_REDUCTION_ON_INCREMENTAL=!1,a.exports=s},function(a,n,o){var i=o(0).FDLayoutEdge;function s(u,v,f){i.call(this,u,v,f)}s.prototype=Object.create(i.prototype);for(var l in i)s[l]=i[l];a.exports=s},function(a,n,o){var i=o(0).LGraph;function s(u,v,f){i.call(this,u,v,f)}s.prototype=Object.create(i.prototype);for(var l in i)s[l]=i[l];a.exports=s},function(a,n,o){var i=o(0).LGraphManager;function s(u){i.call(this,u)}s.prototype=Object.create(i.prototype);for(var l in i)s[l]=i[l];a.exports=s},function(a,n,o){var i=o(0).FDLayoutNode,s=o(0).IMath;function l(v,f,d,h){i.call(this,v,f,d,h)}l.prototype=Object.create(i.prototype);for(var u in i)l[u]=i[u];l.prototype.move=function(){var v=this.graphManager.getLayout();this.displacementX=v.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=v.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>v.coolingFactor*v.maxNodeDisplacement&&(this.displacementX=v.coolingFactor*v.maxNodeDisplacement*s.sign(this.displacementX)),Math.abs(this.displacementY)>v.coolingFactor*v.maxNodeDisplacement&&(this.displacementY=v.coolingFactor*v.maxNodeDisplacement*s.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),v.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},l.prototype.propogateDisplacementToChildren=function(v,f){for(var d=this.getChild().getNodes(),h,c=0;c<d.length;c++)h=d[c],h.getChild()==null?(h.moveBy(v,f),h.displacementX+=v,h.displacementY+=f):h.propogateDisplacementToChildren(v,f)},l.prototype.setPred1=function(v){this.pred1=v},l.prototype.getPred1=function(){return pred1},l.prototype.getPred2=function(){return pred2},l.prototype.setNext=function(v){this.next=v},l.prototype.getNext=function(){return next},l.prototype.setProcessed=function(v){this.processed=v},l.prototype.isProcessed=function(){return processed},a.exports=l},function(a,n,o){var i=o(0).FDLayout,s=o(4),l=o(3),u=o(5),v=o(2),f=o(1),d=o(0).FDLayoutConstants,h=o(0).LayoutConstants,c=o(0).Point,p=o(0).PointD,g=o(0).Layout,y=o(0).Integer,b=o(0).IGeometry,m=o(0).LGraph,T=o(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 s(this);return this.graphManager=E,E},C.prototype.newGraph=function(E){return new l(null,this.graphManager,E)},C.prototype.newNode=function(E){return new u(this.graphManager,E)},C.prototype.newEdge=function(E){return new v(null,null,E)},C.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.isSubLayout||(f.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=f.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=f.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=h.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(f.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+=f.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+f.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(h.WORLD_CENTER_X-N.x/2,h.WORLD_CENTER_Y-N.y/2))},C.radialLayout=function(E,x,w){var D=Math.max(this.maxDiagonalInTree(E),f.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 _=P.indexOf(H);_>=0&&P.splice(_,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 u(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=f.TILING_PADDING_VERTICAL,D=f.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(){f.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},C.prototype.tilingPostLayout=function(){f.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 _=Math.floor(Math.random()*2);B[0]==0&&B[1]==0?_==0?x=0:x=1:B[0]==0&&B[2]==0?_==0?x=0:x=2:B[0]==0&&B[3]==0?_==0?x=0:x=3:B[1]==0&&B[2]==0?_==0?x=1:x=2:B[1]==0&&B[3]==0?_==0?x=1:x=3:_==0?x=2:x=3}else if(F==4&&G==0){var _=Math.floor(Math.random()*4);x=_}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,o){var i={};i.layoutBase=o(0),i.CoSEConstants=o(1),i.CoSEEdge=o(2),i.CoSEGraph=o(3),i.CoSEGraphManager=o(4),i.CoSELayout=o(6),i.CoSENode=o(5),a.exports=i}])})}(qn)),qn.exports}(function(t,e){(function(a,n){t.exports=n(Jp())})(hi,function(r){return function(a){var n={};function o(i){if(n[i])return n[i].exports;var s=n[i]={i,l:!1,exports:{}};return a[i].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=a,o.c=n,o.i=function(i){return i},o.d=function(i,s,l){o.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:l})},o.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(s,"a",s),s},o.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},o.p="",o(o.s=1)}([function(a,n){a.exports=r},function(a,n,o){var i=o(0).layoutBase.LayoutConstants,s=o(0).layoutBase.FDLayoutConstants,l=o(0).CoSEConstants,u=o(0).CoSELayout,v=o(0).CoSENode,f=o(0).layoutBase.PointD,d=o(0).layoutBase.DimensionD,h={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function c(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(h,b),g(this.options)}var g=function(m){m.nodeRepulsion!=null&&(l.DEFAULT_REPULSION_STRENGTH=s.DEFAULT_REPULSION_STRENGTH=m.nodeRepulsion),m.idealEdgeLength!=null&&(l.DEFAULT_EDGE_LENGTH=s.DEFAULT_EDGE_LENGTH=m.idealEdgeLength),m.edgeElasticity!=null&&(l.DEFAULT_SPRING_STRENGTH=s.DEFAULT_SPRING_STRENGTH=m.edgeElasticity),m.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=m.nestingFactor),m.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=s.DEFAULT_GRAVITY_STRENGTH=m.gravity),m.numIter!=null&&(l.MAX_ITERATIONS=s.MAX_ITERATIONS=m.numIter),m.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=s.DEFAULT_GRAVITY_RANGE_FACTOR=m.gravityRange),m.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=m.gravityCompound),m.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=m.gravityRangeCompound),m.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=s.DEFAULT_COOLING_FACTOR_INCREMENTAL=m.initialEnergyOnIncremental),m.quality=="draft"?i.QUALITY=0:m.quality=="proof"?i.QUALITY=2:i.QUALITY=1,l.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=m.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!m.randomize,l.ANIMATE=s.ANIMATE=i.ANIMATE=m.animate,l.TILE=m.tile,l.TILING_PADDING_VERTICAL=typeof m.tilingPaddingVertical=="function"?m.tilingPaddingVertical.call():m.tilingPaddingVertical,l.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 u,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 _=U.id(),Q=F[_],J=U;Q==null&&(Q=F[J.data("parent")]||F["DummyCompound_"+J.data("parent")],F[_]=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 v(T.graphManager,new f(E.position("x")-D.w/2,E.position("y")-D.h/2),new d(parseFloat(D.w),parseFloat(D.h)))):w=b.add(new v(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}])})})(ql);var jp=ql.exports;const ey=lu(jp);var fi=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],o=[1,16],i=[1,20],s=[1,19],l=[6,7,8],u=[1,26],v=[1,24],f=[1,25],d=[6,7,11],h=[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:o,17:17,18:18,19:i,22:s},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:a,14:14,15:n,16:o,17:17,18:18,19:i,22:s},{6:r,9:22,12:11,13:a,14:14,15:n,16:o,17:17,18:18,19:i,22:s},{6:u,7:v,10:23,11:f},t(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:i,22:s}),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:u,7:v,10:32,11:f},{1:[2,7],6:r,12:21,13:a,14:14,15:n,16:o,17:17,18:18,19:i,22:s},t(h,[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(h,[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 _,Q,J,q,V={},Z,K,ie,he;;){if(Q=E[E.length-1],this.defaultActions[Q]?J=this.defaultActions[Q]:((_===null||typeof _>"u")&&(_=H()),J=L[Q]&&L[Q][_]),typeof J>"u"||!J.length||!J[0]){var ae="";he=[];for(Z in L[Q])this.terminals_[Z]&&Z>M&&he.push("'"+this.terminals_[Z]+"'");P.showPosition?ae="Parse error on line "+(N+1)+`:
`+P.showPosition()+`
Expecting `+he.join(", ")+", got '"+(this.terminals_[_]||_)+"'":ae="Parse error on line "+(N+1)+": Unexpected "+(_==R?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(ae,{text:P.match,token:this.terminals_[_]||_,line:P.yylineno,loc:G,expected:he})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+_);switch(J[0]){case 1:E.push(_),w.push(P.yytext),D.push(P.yylloc),E.push(J[1]),_=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}();fi.parser=fi;var ty=fi,It=[],Wl=0,Gi={},ry=de(()=>{It=[],Wl=0,Gi={}},"clear"),ay=de(function(t){for(let e=It.length-1;e>=0;e--)if(It[e].level<t)return It[e];return null},"getParent"),ny=de(()=>It.length>0?It[0]:null,"getMindmap"),iy=de((t,e,r,a)=>{var l,u;wr.info("addNode",t,e,r,a);const n=ci();let o=((l=n.mindmap)==null?void 0:l.padding)??en.mindmap.padding;switch(a){case He.ROUNDED_RECT:case He.RECT:case He.HEXAGON:o*=2}const i={id:Wl++,nodeId:tn(e,n),level:t,descr:tn(r,n),type:a,children:[],width:((u=n.mindmap)==null?void 0:u.maxNodeWidth)??en.mindmap.maxNodeWidth,padding:o},s=ay(t);if(s)s.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},oy=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"),ly=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"),vy=de(()=>wr,"getLogger"),fy=de(t=>Gi[t],"getElementById"),hy={clear:ry,addNode:iy,getMindmap:ny,nodeType:He,getType:oy,setElementForId:sy,decorateNode:ly,type2Str:uy,getLogger:vy,getElementById:fy},cy=hy,dy=12,gy=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"),py=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"),yy=de(function(t,e,r){const a=r.width,n=r.height,o=.15*a,i=.25*a,s=.35*a,l=.2*a;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${o},${o} 0 0,1 ${a*.25},${-1*a*.1}
a${s},${s} 1 0,1 ${a*.4},${-1*a*.1}
a${i},${i} 1 0,1 ${a*.35},${1*a*.2}
a${o},${o} 1 0,1 ${a*.15},${1*n*.35}
a${l},${l} 1 0,1 ${-1*a*.15},${1*n*.65}
a${i},${o} 1 0,1 ${-1*a*.25},${a*.15}
a${s},${s} 1 0,1 ${-1*a*.5},0
a${o},${o} 1 0,1 ${-1*a*.25},${-1*a*.15}
a${o},${o} 1 0,1 ${-1*a*.1},${-1*n*.35}
a${l},${l} 1 0,1 ${a*.1},${-1*n*.65}
H0 V0 Z`)},"cloudBkg"),my=de(function(t,e,r){const a=r.width,n=r.height,o=.15*a;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${o},${o} 1 0,0 ${a*.25},${-1*n*.1}
a${o},${o} 1 0,0 ${a*.25},0
a${o},${o} 1 0,0 ${a*.25},0
a${o},${o} 1 0,0 ${a*.25},${1*n*.1}
a${o},${o} 1 0,0 ${a*.15},${1*n*.33}
a${o*.8},${o*.8} 1 0,0 0,${1*n*.34}
a${o},${o} 1 0,0 ${-1*a*.15},${1*n*.33}
a${o},${o} 1 0,0 ${-1*a*.25},${n*.15}
a${o},${o} 1 0,0 ${-1*a*.25},0
a${o},${o} 1 0,0 ${-1*a*.25},0
a${o},${o} 1 0,0 ${-1*a*.25},${-1*n*.15}
a${o},${o} 1 0,0 ${-1*a*.1},${-1*n*.33}
a${o*.8},${o*.8} 1 0,0 0,${-1*n*.34}
a${o},${o} 1 0,0 ${a*.1},${-1*n*.33}
H0 V0 Z`)},"bangBkg"),by=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 Kl(t,e,r,a,n){return t.insert("polygon",":first-child").attr("points",a.map(function(o){return o.x+","+o.y}).join(" ")).attr("transform","translate("+(n.width-e)/2+", "+r+")")}de(Kl,"insertPolygonShape");var Ey=de(function(t,e,r){const a=r.height,o=a/4,i=r.width-r.padding+2*o,s=[{x:o,y:0},{x:i-o,y:0},{x:i,y:-a/2},{x:i-o,y:-a},{x:o,y:-a},{x:0,y:-a/2}];Kl(e,i,a,s,r)},"hexagonBkg"),wy=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"),xy=de(async function(t,e,r,a,n){const o=n.htmlLabels,i=a%(dy-1),s=e.append("g");r.section=i;let l="section-"+i;i<0&&(l+=" section-root"),s.attr("class",(r.class?r.class+" ":"")+"mindmap-node "+l);const u=s.append("g"),v=s.append("g"),f=r.descr.replace(/(<br\/*>)/g,`
`);await vu(v,f,{useHtmlLabels:o,width:r.width,classes:"mindmap-node-label"},n),o||v.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const d=v.node().getBBox(),[h]=fu(n.fontSize);if(r.height=d.height+h*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,s.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),v.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);s.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),v.attr("transform","translate("+(25+r.width/2)+", "+(p/2+r.padding/2)+")")}else if(o){const c=(r.width-d.width)/2,p=(r.height-d.height)/2;v.attr("transform","translate("+c+", "+p+")")}else{const c=r.width/2,p=r.padding/2;v.attr("transform","translate("+c+", "+p+")")}switch(r.type){case t.nodeType.DEFAULT:gy(t,u,r,i);break;case t.nodeType.ROUNDED_RECT:wy(t,u,r,i);break;case t.nodeType.RECT:py(t,u,r,i);break;case t.nodeType.CIRCLE:u.attr("transform","translate("+r.width/2+", "+ +r.height/2+")"),by(t,u,r,i);break;case t.nodeType.CLOUD:yy(t,u,r,i);break;case t.nodeType.BANG:my(t,u,r,i);break;case t.nodeType.HEXAGON:Ey(t,u,r,i);break}return t.setElementForId(r.id,s),r.height},"drawNode"),Ty=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(ey);async function zi(t,e,r,a,n){await xy(t,e,r,a,n),r.children&&await Promise.all(r.children.map((o,i)=>zi(t,e,o,a<0?i:a,n)))}de(zi,"drawNodes");function Zl(t,e){e.edges().map((r,a)=>{const n=r.data();if(r[0]._private.bodyBounds){const o=r[0]._private.rscratch;wr.trace("Edge: ",a,n),t.insert("path").attr("d",`M ${o.startX},${o.startY} L ${o.midX},${o.midY} L${o.endX},${o.endY} `).attr("class","edge section-edge-"+n.section+" edge-depth-"+n.depth)}})}de(Zl,"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 Ql(t,e){return new Promise(r=>{const a=uu("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(o){o.layoutDimensions=()=>{const i=o.data();return{w:i.width,h:i.height}}}),n.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),n.ready(o=>{wr.info("Ready",o),r(n)})})}de(Ql,"layoutMindmap");function Jl(t,e){e.nodes().map((r,a)=>{const n=r.data();n.x=r.position().x,n.y=r.position().y,Ty(t,n);const o=t.getElementById(n.nodeId);wr.info("Id:",a,"Position: (",r.position().x,", ",r.position().y,")",n),o.attr("transform",`translate(${r.position().x-n.width/2}, ${r.position().y-n.height/2})`),o.attr("attr",`apa-${a})`)})}de(Jl,"positionNodes");var Cy=de(async(t,e,r,a)=>{var f,d;wr.debug(`Rendering mindmap diagram
`+t);const n=a.db,o=n.getMindmap();if(!o)return;const i=ci();i.htmlLabels=!1;const s=hu(e),l=s.append("g");l.attr("class","mindmap-edges");const u=s.append("g");u.attr("class","mindmap-nodes"),await zi(n,u,o,-1,i);const v=await Ql(o,i);Zl(l,v),Jl(n,v),cu(void 0,s,((f=i.mindmap)==null?void 0:f.padding)??en.mindmap.padding,((d=i.mindmap)==null?void 0:d.useMaxWidth)??en.mindmap.useMaxWidth)},"draw"),Dy={draw:Cy},Sy=de(t=>{let e="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++)t["lineColor"+r]=t["lineColor"+r]||t["cScaleInv"+r],du(t["lineColor"+r])?t["lineColor"+r]=gu(t["lineColor"+r],20):t["lineColor"+r]=pu(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"),Ly=de(t=>`
.edge {
stroke-width: 3;
}
${Sy(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"),Ay=Ly,Ny={db:cy,renderer:Dy,parser:ty,styles:Ay};export{Ny as diagram};