text: /*! For license information please see module.js.LICENSE.txt */
  define(["lodash","react","@grafana/data","@grafana/ui","@grafana/runtime"],(function(e,t,n,r,i){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=58)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function s(e){for(var t=-1,n=0;n<o.length;n++)if(o[n].identifier===e){t=n;break}return t}function u(e,t){for(var n={},r=[],i=0;i<e.length;i++){var a=e[i],u=t.base?a[0]+t.base:a[0],l=n[u]||0,c="".concat(u," ").concat(l);n[u]=l+1;var h=s(c),d={css:a[1],media:a[2],sourceMap:a[3]};-1!==h?(o[h].references++,o[h].updater(d)):o.push({identifier:c,updater:v(d,t),references:1}),r.push(c)}return r}function l(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var o=a(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var c,h=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function d(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=h(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function p(e,t,n){var r=n.css,i=n.media,a=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,g=0;function v(e,t){var n,r,i;if(t.singleton){var a=g++;n=f||(f=l(t)),r=d.bind(null,n,a,!1),i=d.bind(null,n,a,!0)}else n=l(t),r=p.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=u(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=s(n[r]);o[i].references--}for(var a=u(e,t),l=0;l<n.length;l++){var c=s(n[l]);0===o[c].references&&(o[c].updater(),o.splice(c,1))}n=a}}}},function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=function(e){var t=r(e,4),n=t[1],i=t[3];if(!i)return n;if("function"==typeof btoa){var a=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),s="/*# ".concat(o," */"),u=i.sources.map((function(e){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(e," */")}));return[n].concat(u).concat([s]).join("\n")}return[n].join("\n")}},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var a=0;a<this.length;a++){var o=this[a][0];null!=o&&(i[o]=!0)}for(var s=0;s<e.length;s++){var u=[].concat(e[s]);r&&i[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),t.push(u))}},t}},function(e,t){e.exports=r},function(e,t){e.exports=i},function(e,t,n){var r,i,a;i=[],void 0===(a="function"==typeof(r=function(){"use strict";function e(e,t){var n,r,i;for(n=1,r=arguments.length;n<r;++n)if(null!=(t=arguments[n]))for(i in t)a(t,i)&&(e[i]=t[i]);return e}function t(e,t){return t.length-e.length}function n(e,t){return e.factor-t.factor}function r(e,t){var n;for(n in e)a(e,n)&&t(e[n],n)}var i,a=(i=Object.prototype.hasOwnProperty,function(e,t){return null!=e&&i.call(e,t)});function o(e,t){for(;"string"==typeof t;)t=e[t];return t}function s(e){this._prefixes=e;var i=[],o=[];r(e,(function(e,t){i.push(t.replace(/([.*+?=^!:${}()|[\]/\\])/g,"\\$1")),o.push({factor:e,prefix:t})}));var s=this._lcPrefixes={};r(e,(function(t,n){var r=n.toLowerCase();a(e,r)||(s[r]=n)})),o.sort(n),this._list=o,i.sort(t),this._regexp=new RegExp("^\\s*(-)?\\s*(\\d+(?:\\.\\d+)?)\\s*("+i.join("|")+")\\s*(.*)\\s*?$","i")}s.create=function(e,t,n){var r={};return void 0===n&&(n=0),function(e,t){var n,r;for(n=0,r=e.length;n<r;++n)t(e[n],n)}(e,(function(e,i){r[e]=Math.pow(t,i+n)})),new s(r)},s.prototype.findPrefix=function(e){for(var t,n=this._list,r=0,i=n.length-1;r!==i;)n[t=r+i+1>>1].factor>e?i=t-1:r=t;return n[r]},s.prototype.parse=function(e,t){var n=e.match(this._regexp);if(null!==n){var r,i=n[3];if(a(this._prefixes,i))r=this._prefixes[i];else{if(t||(i=i.toLowerCase(),!a(this._lcPrefixes,i)))return;i=this._lcPrefixes[i],r=this._prefixes[i]}var o=+n[2];return void 0!==n[1]&&(o=-o),{factor:r,prefix:i,unit:n[4],value:o}}};var u={binary:s.create(",Ki,Mi,Gi,Ti,Pi,Ei,Zi,Yi".split(","),1024),SI:s.create("y,z,a,f,p,n,µ,m,,k,M,G,T,P,E,Z,Y".split(","),1e3,-8)},l={decimals:2,separator:" ",unit:""},c={scale:"SI",strict:!1};function h(t,n){var r=g(t,n=e({},l,n));t=String(r.value);var i=r.prefix+n.unit;return""===i?t:t+n.separator+i}var d={scale:"binary",unit:"B"};function p(e,t){var n=f(e,t);return n.value*n.factor}function f(t,n){if("string"!=typeof t)throw new TypeError("str must be a string");n=e({},c,n);var r=o(u,n.scale);if(void 0===r)throw new Error("missing scale");var i=r.parse(t,n.strict);if(void 0===i)throw new Error("cannot parse str");return i}function g(t,n){if(0===t)return{value:0,prefix:""};if(t<0){var r=g(-t,n);return r.value=-r.value,r}if("number"!=typeof t||Number.isNaN(t))throw new TypeError("value must be a number");n=e({},c,n);var i,s=o(u,n.scale);if(void 0===s)throw new Error("missing scale");var l=n.decimals;void 0!==l&&(i=Math.pow(10,l));var h,d=n.prefix;if(void 0!==d){if(!a(s._prefixes,d))throw new Error("invalid prefix");h=s._prefixes[d]}else{var p=s.findPrefix(t);if(void 0!==i)do{var f=(h=p.factor)/i;t=Math.round(t/f)*f}while((p=s.findPrefix(t)).factor!==h);else h=p.factor;d=p.prefix}return{prefix:d,value:void 0===i?t/h:Math.round(t*i/h)/i}}return h.bytes=function(t,n){return h(t,void 0===n?d:e({},d,n))},h.parse=p,p.raw=f,h.raw=g,h.Scale=s,h})?r.apply(t,i):r)||(e.exports=a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(24),a=n(15),o=n(16),s=n(10),u=n(12),l=n(27),c=n(28);function h(e){return void 0!==e.leaves||void 0!==e.groups}!function(e){e[e.start=0]="start",e[e.tick=1]="tick",e[e.end=2]="end"}(r=t.EventType||(t.EventType={}));var d=function(){function e(){var t=this;this._canvasSize=[1,1],this._linkDistance=20,this._defaultNodeSize=10,this._linkLengthCalculator=null,this._linkType=null,this._avoidOverlaps=!1,this._handleDisconnected=!0,this._running=!1,this._nodes=[],this._groups=[],this._rootGroup=null,this._links=[],this._constraints=[],this._distanceMatrix=null,this._descent=null,this._directedLinkConstraints=null,this._threshold=.01,this._visibilityGraph=null,this._groupCompactness=1e-6,this.event=null,this.linkAccessor={getSourceIndex:e.getSourceIndex,getTargetIndex:e.getTargetIndex,setLength:e.setLinkLength,getType:function(e){return"function"==typeof t._linkType?t._linkType(e):0}}}return e.prototype.on=function(e,t){return this.event||(this.event={}),"string"==typeof e?this.event[r[e]]=t:this.event[e]=t,this},e.prototype.trigger=function(e){this.event&&void 0!==this.event[e.type]&&this.event[e.type](e)},e.prototype.kick=function(){for(;!this.tick(););},e.prototype.tick=function(){if(this._alpha<this._threshold)return this._running=!1,this.trigger({type:r.end,alpha:this._alpha=0,stress:this._lastStress}),!0;var e,t,n=this._nodes.length;this._links.length;for(this._descent.locks.clear(),t=0;t<n;++t)if((e=this._nodes[t]).fixed){void 0!==e.px&&void 0!==e.py||(e.px=e.x,e.py=e.y);var i=[e.px,e.py];this._descent.locks.add(t,i)}var a=this._descent.rungeKutta();return 0===a?this._alpha=0:void 0!==this._lastStress&&(this._alpha=a),this._lastStress=a,this.updateNodePositions(),this.trigger({type:r.tick,alpha:this._alpha,stress:this._lastStress}),!1},e.prototype.updateNodePositions=function(){for(var e,t=this._descent.x[0],n=this._descent.x[1],r=this._nodes.length;r--;)(e=this._nodes[r]).x=t[r],e.y=n[r]},e.prototype.nodes=function(e){if(!e){if(0===this._nodes.length&&this._links.length>0){var t=0;this._links.forEach((function(e){t=Math.max(t,e.source,e.target)})),this._nodes=new Array(++t);for(var n=0;n<t;++n)this._nodes[n]={}}return this._nodes}return this._nodes=e,this},e.prototype.groups=function(e){var t=this;return e?(this._groups=e,this._rootGroup={},this._groups.forEach((function(e){void 0===e.padding&&(e.padding=1),void 0!==e.leaves&&e.leaves.forEach((function(n,r){"number"==typeof n&&((e.leaves[r]=t._nodes[n]).parent=e)})),void 0!==e.groups&&e.groups.forEach((function(n,r){"number"==typeof n&&((e.groups[r]=t._groups[n]).parent=e)}))})),this._rootGroup.leaves=this._nodes.filter((function(e){return void 0===e.parent})),this._rootGroup.groups=this._groups.filter((function(e){return void 0===e.parent})),this):this._groups},e.prototype.powerGraphGroups=function(e){var t=i.getGroups(this._nodes,this._links,this.linkAccessor,this._rootGroup);return this.groups(t.groups),e(t),this},e.prototype.avoidOverlaps=function(e){return arguments.length?(this._avoidOverlaps=e,this):this._avoidOverlaps},e.prototype.handleDisconnected=function(e){return arguments.length?(this._handleDisconnected=e,this):this._handleDisconnected},e.prototype.flowLayout=function(e,t){return arguments.length||(e="y"),this._directedLinkConstraints={axis:e,getMinSeparation:"number"==typeof t?function(){return t}:t},this},e.prototype.links=function(e){return arguments.length?(this._links=e,this):this._links},e.prototype.constraints=function(e){return arguments.length?(this._constraints=e,this):this._constraints},e.prototype.distanceMatrix=function(e){return arguments.length?(this._distanceMatrix=e,this):this._distanceMatrix},e.prototype.size=function(e){return e?(this._canvasSize=e,this):this._canvasSize},e.prototype.defaultNodeSize=function(e){return e?(this._defaultNodeSize=e,this):this._defaultNodeSize},e.prototype.groupCompactness=function(e){return e?(this._groupCompactness=e,this):this._groupCompactness},e.prototype.linkDistance=function(e){return e?(this._linkDistance="function"==typeof e?e:+e,this._linkLengthCalculator=null,this):this._linkDistance},e.prototype.linkType=function(e){return this._linkType=e,this},e.prototype.convergenceThreshold=function(e){return e?(this._threshold="function"==typeof e?e:+e,this):this._threshold},e.prototype.alpha=function(e){return arguments.length?(e=+e,this._alpha?this._alpha=e>0?e:0:e>0&&(this._running||(this._running=!0,this.trigger({type:r.start,alpha:this._alpha=e}),this.kick())),this):this._alpha},e.prototype.getLinkLength=function(e){return"function"==typeof this._linkDistance?+this._linkDistance(e):this._linkDistance},e.setLinkLength=function(e,t){e.length=t},e.prototype.getLinkType=function(e){return"function"==typeof this._linkType?this._linkType(e):0},e.prototype.symmetricDiffLinkLengths=function(e,t){var n=this;return void 0===t&&(t=1),this.linkDistance((function(t){return e*t.length})),this._linkLengthCalculator=function(){return a.symmetricDiffLinkLengths(n._links,n.linkAccessor,t)},this},e.prototype.jaccardLinkLengths=function(e,t){var n=this;return void 0===t&&(t=1),this.linkDistance((function(t){return e*t.length})),this._linkLengthCalculator=function(){return a.jaccardLinkLengths(n._links,n.linkAccessor,t)},this},e.prototype.start=function(t,n,r,i,l,c){var h=this;void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===l&&(l=!0),void 0===c&&(c=!0);var d,p=this.nodes().length,f=p+2*this._groups.length,g=(this._links.length,this._canvasSize[0]),v=this._canvasSize[1],y=new Array(f),m=new Array(f),b=null,x=this._avoidOverlaps;this._nodes.forEach((function(e,t){e.index=t,void 0===e.x&&(e.x=g/2,e.y=v/2),y[t]=e.x,m[t]=e.y})),this._linkLengthCalculator&&this._linkLengthCalculator(),this._distanceMatrix?d=this._distanceMatrix:(d=new u.Calculator(f,this._links,e.getSourceIndex,e.getTargetIndex,(function(e){return h.getLinkLength(e)})).DistanceMatrix(),b=o.Descent.createSquareMatrix(f,(function(){return 2})),this._links.forEach((function(e){"number"==typeof e.source&&(e.source=h._nodes[e.source]),"number"==typeof e.target&&(e.target=h._nodes[e.target])})),this._links.forEach((function(t){var n=e.getSourceIndex(t),r=e.getTargetIndex(t);b[n][r]=b[r][n]=t.weight||1})));var w=o.Descent.createSquareMatrix(f,(function(e,t){return d[e][t]}));if(this._rootGroup&&void 0!==this._rootGroup.groups){var E=p;this._groups.forEach((function(e){!function(e,t,n,r){b[e][t]=b[t][e]=n,w[e][t]=w[t][e]=r}(E,E+1,h._groupCompactness,.1),y[E]=0,m[E++]=0,y[E]=0,m[E++]=0}))}else this._rootGroup={leaves:this._nodes,groups:[]};var C=this._constraints||[];this._directedLinkConstraints&&(this.linkAccessor.getMinSeparation=this._directedLinkConstraints.getMinSeparation,C=C.concat(a.generateDirectedEdgeConstraints(p,this._links,this._directedLinkConstraints.axis,this.linkAccessor))),this.avoidOverlaps(!1),this._descent=new o.Descent([y,m],w),this._descent.locks.clear();for(E=0;E<p;++E){var S=this._nodes[E];if(S.fixed){S.px=S.x,S.py=S.y;var _=[S.x,S.y];this._descent.locks.add(E,_)}}if(this._descent.threshold=this._threshold,this.initialLayout(t,y,m),C.length>0&&(this._descent.project=new s.Projection(this._nodes,this._groups,this._rootGroup,C).projectFunctions()),this._descent.run(n),this.separateOverlappingComponents(g,v,c),this.avoidOverlaps(x),x&&(this._nodes.forEach((function(e,t){e.x=y[t],e.y=m[t]})),this._descent.project=new s.Projection(this._nodes,this._groups,this._rootGroup,C,!0).projectFunctions(),this._nodes.forEach((function(e,t){y[t]=e.x,m[t]=e.y}))),this._descent.G=b,this._descent.run(r),i){this._descent.snapStrength=1e3,this._descent.snapGridSize=this._nodes[0].width,this._descent.numGridSnapNodes=p,this._descent.scaleSnapByMaxH=p!=f;var k=o.Descent.createSquareMatrix(f,(function(e,t){return e>=p||t>=p?b[e][t]:0}));this._descent.G=k,this._descent.run(i)}return this.updateNodePositions(),this.separateOverlappingComponents(g,v,c),l?this.resume():this},e.prototype.initialLayout=function(t,n,r){if(this._groups.length>0&&t>0){var i=this._nodes.length,a=this._links.map((function(e){return{source:e.source.index,target:e.target.index}})),o=this._nodes.map((function(e){return{index:e.index}}));this._groups.forEach((function(e,t){o.push({index:e.index=i+t})})),this._groups.forEach((function(e,t){void 0!==e.leaves&&e.leaves.forEach((function(t){return a.push({source:e.index,target:t.index})})),void 0!==e.groups&&e.groups.forEach((function(t){return a.push({source:e.index,target:t.index})}))})),(new e).size(this.size()).nodes(o).links(a).avoidOverlaps(!1).linkDistance(this.linkDistance()).symmetricDiffLinkLengths(5).convergenceThreshold(1e-4).start(t,0,0,0,!1),this._nodes.forEach((function(e){n[e.index]=o[e.index].x,r[e.index]=o[e.index].y}))}else this._descent.run(t)},e.prototype.separateOverlappingComponents=function(e,t,n){var r=this;if(void 0===n&&(n=!0),!this._distanceMatrix&&this._handleDisconnected){var i=this._descent.x[0],a=this._descent.x[1];this._nodes.forEach((function(e,t){e.x=i[t],e.y=a[t]}));var o=c.separateGraphs(this._nodes,this._links);c.applyPacking(o,e,t,this._defaultNodeSize,1,n),this._nodes.forEach((function(e,t){r._descent.x[0][t]=e.x,r._descent.x[1][t]=e.y,e.bounds&&(e.bounds.setXCentre(e.x),e.bounds.setYCentre(e.y))}))}},e.prototype.resume=function(){return this.alpha(.1)},e.prototype.stop=function(){return this.alpha(0)},e.prototype.prepareEdgeRouting=function(e){void 0===e&&(e=0),this._visibilityGraph=new l.TangentVisibilityGraph(this._nodes.map((function(t){return t.bounds.inflate(-e).vertices()})))},e.prototype.routeEdge=function(e,t,n){void 0===t&&(t=5);var r=[],i=new l.TangentVisibilityGraph(this._visibilityGraph.P,{V:this._visibilityGraph.V,E:this._visibilityGraph.E}),a={x:e.source.x,y:e.source.y},o={x:e.target.x,y:e.target.y},c=i.addPoint(a,e.source.index),h=i.addPoint(o,e.target.index);i.addEdgeIfVisible(a,o,e.source.index,e.target.index),void 0!==n&&n(i);var d=new u.Calculator(i.V.length,i.E,(function(e){return e.source.id}),(function(e){return e.target.id}),(function(e){return e.length()})).PathFromNodeToNode(c.id,h.id);if(1===d.length||d.length===i.V.length){var p=s.makeEdgeBetween(e.source.innerBounds,e.target.innerBounds,t);r=[p.sourceIntersection,p.arrowStart]}else{for(var f=d.length-2,g=i.V[d[f]].p,v=i.V[d[0]].p,y=(r=[e.source.innerBounds.rayIntersection(g.x,g.y)],f);y>=0;--y)r.push(i.V[d[y]].p);r.push(s.makeEdgeTo(v,e.target.innerBounds,t))}return r},e.getSourceIndex=function(e){return"number"==typeof e.source?e.source:e.source.index},e.getTargetIndex=function(e){return"number"==typeof e.target?e.target:e.target.index},e.linkId=function(t){return e.getSourceIndex(t)+"-"+e.getTargetIndex(t)},e.dragStart=function(t){h(t)?e.storeOffset(t,e.dragOrigin(t)):(e.stopNode(t),t.fixed|=2)},e.stopNode=function(e){e.px=e.x,e.py=e.y},e.storeOffset=function(t,n){void 0!==t.leaves&&t.leaves.forEach((function(t){t.fixed|=2,e.stopNode(t),t._dragGroupOffsetX=t.x-n.x,t._dragGroupOffsetY=t.y-n.y})),void 0!==t.groups&&t.groups.forEach((function(t){return e.storeOffset(t,n)}))},e.dragOrigin=function(e){return h(e)?{x:e.bounds.cx(),y:e.bounds.cy()}:e},e.drag=function(t,n){h(t)?(void 0!==t.leaves&&t.leaves.forEach((function(e){t.bounds.setXCentre(n.x),t.bounds.setYCentre(n.y),e.px=e._dragGroupOffsetX+n.x,e.py=e._dragGroupOffsetY+n.y})),void 0!==t.groups&&t.groups.forEach((function(t){return e.drag(t,n)}))):(t.px=n.x,t.py=n.y)},e.dragEnd=function(t){h(t)?(void 0!==t.leaves&&t.leaves.forEach((function(t){e.dragEnd(t),delete t._dragGroupOffsetX,delete t._dragGroupOffsetY})),void 0!==t.groups&&t.groups.forEach(e.dragEnd)):t.fixed&=-7},e.mouseOver=function(e){e.fixed|=4,e.px=e.x,e.py=e.y},e.mouseOut=function(e){e.fixed&=-5},e}();t.Layout=d},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(17),o=n(25);function s(e){return e.bounds=void 0!==e.leaves?e.leaves.reduce((function(e,t){return t.bounds.union(e)}),u.empty()):u.empty(),void 0!==e.groups&&(e.bounds=e.groups.reduce((function(e,t){return s(t).union(e)}),e.bounds)),e.bounds=e.bounds.inflate(e.padding),e.bounds}t.computeGroupBounds=s;var u=function(){function e(e,t,n,r){this.x=e,this.X=t,this.y=n,this.Y=r}return e.empty=function(){return new e(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)},e.prototype.cx=function(){return(this.x+this.X)/2},e.prototype.cy=function(){return(this.y+this.Y)/2},e.prototype.overlapX=function(e){var t=this.cx(),n=e.cx();return t<=n&&e.x<this.X?this.X-e.x:n<=t&&this.x<e.X?e.X-this.x:0},e.prototype.overlapY=function(e){var t=this.cy(),n=e.cy();return t<=n&&e.y<this.Y?this.Y-e.y:n<=t&&this.y<e.Y?e.Y-this.y:0},e.prototype.setXCentre=function(e){var t=e-this.cx();this.x+=t,this.X+=t},e.prototype.setYCentre=function(e){var t=e-this.cy();this.y+=t,this.Y+=t},e.prototype.width=function(){return this.X-this.x},e.prototype.height=function(){return this.Y-this.y},e.prototype.union=function(t){return new e(Math.min(this.x,t.x),Math.max(this.X,t.X),Math.min(this.y,t.y),Math.max(this.Y,t.Y))},e.prototype.lineIntersections=function(t,n,r,i){for(var a=[[this.x,this.y,this.X,this.y],[this.X,this.y,this.X,this.Y],[this.X,this.Y,this.x,this.Y],[this.x,this.Y,this.x,this.y]],o=[],s=0;s<4;++s){var u=e.lineIntersection(t,n,r,i,a[s][0],a[s][1],a[s][2],a[s][3]);null!==u&&o.push({x:u.x,y:u.y})}return o},e.prototype.rayIntersection=function(e,t){var n=this.lineIntersections(this.cx(),this.cy(),e,t);return n.length>0?n[0]:null},e.prototype.vertices=function(){return[{x:this.x,y:this.y},{x:this.X,y:this.y},{x:this.X,y:this.Y},{x:this.x,y:this.Y}]},e.lineIntersection=function(e,t,n,r,i,a,o,s){var u=n-e,l=o-i,c=r-t,h=s-a,d=h*u-l*c;if(0==d)return null;var p=e-i,f=t-a,g=(l*f-h*p)/d,v=(u*f-c*p)/d;return g>=0&&g<=1&&v>=0&&v<=1?{x:e+g*u,y:t+g*c}:null},e.prototype.inflate=function(t){return new e(this.x-t,this.X+t,this.y-t,this.Y+t)},e}();t.Rectangle=u,t.makeEdgeBetween=function(e,t,n){var r=e.rayIntersection(t.cx(),t.cy())||{x:e.cx(),y:e.cy()},i=t.rayIntersection(e.cx(),e.cy())||{x:t.cx(),y:t.cy()},a=i.x-r.x,o=i.y-r.y,s=Math.sqrt(a*a+o*o),u=s-n;return{sourceIntersection:r,targetIntersection:i,arrowStart:{x:r.x+u*a/s,y:r.y+u*o/s}}},t.makeEdgeTo=function(e,t,n){var r=t.rayIntersection(e.x,e.y);r||(r={x:t.cx(),y:t.cy()});var i=r.x-e.x,a=r.y-e.y,o=Math.sqrt(i*i+a*a);return{x:r.x-n*i/o,y:r.y-n*a/o}};var l=function(e,t,n){this.v=e,this.r=t,this.pos=n,this.prev=d(),this.next=d()},c=function(e,t,n){this.isOpen=e,this.v=t,this.pos=n};function h(e,t){return e.pos>t.pos?1:e.pos<t.pos||e.isOpen?-1:t.isOpen?1:0}function d(){return new o.RBTree((function(e,t){return e.pos-t.pos}))}var p={getCentre:function(e){return e.cx()},getOpen:function(e){return e.y},getClose:function(e){return e.Y},getSize:function(e){return e.width()},makeRect:function(e,t,n,r){return new u(n-r/2,n+r/2,e,t)},findNeighbours:function(e,t){var n=function(n,r){for(var i,a=t.findIter(e);null!==(i=a[n]());){var o=i.r.overlapX(e.r);if((o<=0||o<=i.r.overlapY(e.r))&&(e[n].insert(i),i[r].insert(e)),o<=0)break}};n("next","prev"),n("prev","next")}},f={getCentre:function(e){return e.cy()},getOpen:function(e){return e.x},getClose:function(e){return e.X},getSize:function(e){return e.height()},makeRect:function(e,t,n,r){return new u(e,t,n-r/2,n+r/2)},findNeighbours:function(e,t){var n=function(n,r){var i=t.findIter(e)[n]();null!==i&&i.r.overlapX(e.r)>0&&(e[n].insert(i),i[r].insert(e))};n("next","prev"),n("prev","next")}};function g(e,t,n,r){void 0===r&&(r=!1);var i=e.padding,a=void 0!==e.groups?e.groups.length:0,o=void 0!==e.leaves?e.leaves.length:0,s=a?e.groups.reduce((function(e,r){return e.concat(g(r,t,n,!0))}),[]):[],u=(r?2:0)+o+a,l=new Array(u),c=new Array(u),h=0,d=function(e,t){c[h]=e,l[h++]=t};if(r){var p=e.bounds,f=t.getCentre(p),y=t.getSize(p)/2,m=t.getOpen(p),b=t.getClose(p),x=f-y+i/2,w=f+y-i/2;e.minVar.desiredPosition=x,d(t.makeRect(m,b,x,i),e.minVar),e.maxVar.desiredPosition=w,d(t.makeRect(m,b,w,i),e.maxVar)}o&&e.leaves.forEach((function(e){return d(e.bounds,e.variable)})),a&&e.groups.forEach((function(e){var n=e.bounds;d(t.makeRect(t.getOpen(n),t.getClose(n),t.getCentre(n),t.getSize(n)),e.minVar)}));var E=v(c,l,t,n);return a&&(l.forEach((function(e){e.cOut=[],e.cIn=[]})),E.forEach((function(e){e.left.cOut.push(e),e.right.cIn.push(e)})),e.groups.forEach((function(e){var n=(e.padding-t.getSize(e.bounds))/2;e.minVar.cIn.forEach((function(e){return e.gap+=n})),e.minVar.cOut.forEach((function(t){t.left=e.maxVar,t.gap+=n}))}))),s.concat(E)}function v(e,t,n,r){var i,o=e.length,s=2*o,u=new Array(s);for(i=0;i<o;++i){var p=e[i],f=new l(t[i],p,n.getCentre(p));u[i]=new c(!0,f,n.getOpen(p)),u[i+o]=new c(!1,f,n.getClose(p))}u.sort(h);var g=new Array,v=d();for(i=0;i<s;++i){var y=u[i];f=y.v;if(y.isOpen)v.insert(f),n.findNeighbours(f,v);else{v.remove(f);var m=function(e,t){var i=(n.getSize(e.r)+n.getSize(t.r))/2+r;g.push(new a.Constraint(e.v,t.v,i))},b=function(e,t,n){for(var r,i=f[e].iterator();null!==(r=i[e]());)n(r,f),r[t].remove(f)};b("prev","next",(function(e,t){return m(e,t)})),b("next","prev",(function(e,t){return m(t,e)}))}}return g}function y(e,t){return v(e,t,p,1e-6)}function m(e,t){return v(e,t,f,1e-6)}function b(e){return g(e,p,1e-6)}function x(e){return g(e,f,1e-6)}t.generateXConstraints=y,t.generateYConstraints=m,t.generateXGroupConstraints=b,t.generateYGroupConstraints=x,t.removeOverlaps=function(e){var t=e.map((function(e){return new a.Variable(e.cx())})),n=y(e,t),r=new a.Solver(t,n);r.solve(),t.forEach((function(t,n){return e[n].setXCentre(t.position())})),t=e.map((function(e){return new a.Variable(e.cy())})),n=m(e,t),(r=new a.Solver(t,n)).solve(),t.forEach((function(t,n){return e[n].setYCentre(t.position())}))};var w=function(e){function t(t,n){var r=e.call(this,0,n)||this;return r.index=t,r}return i(t,e),t}(a.Variable);t.IndexedVariable=w;var E=function(){function e(e,t,n,r,i){var a=this;if(void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=!1),this.nodes=e,this.groups=t,this.rootGroup=n,this.avoidOverlaps=i,this.variables=e.map((function(e,t){return e.variable=new w(t,1)})),r&&this.createConstraints(r),i&&n&&void 0!==n.groups){e.forEach((function(e){if(e.width&&e.height){var t=e.width/2,n=e.height/2;e.bounds=new u(e.x-t,e.x+t,e.y-n,e.y+n)}else e.bounds=new u(e.x,e.x,e.y,e.y)})),s(n);var o=e.length;t.forEach((function(e){a.variables[o]=e.minVar=new w(o++,void 0!==e.stiffness?e.stiffness:.01),a.variables[o]=e.maxVar=new w(o++,void 0!==e.stiffness?e.stiffness:.01)}))}}return e.prototype.createSeparation=function(e){return new a.Constraint(this.nodes[e.left].variable,this.nodes[e.right].variable,e.gap,void 0!==e.equality&&e.equality)},e.prototype.makeFeasible=function(e){var t=this;if(this.avoidOverlaps){var n="x",r="width";"x"===e.axis&&(n="y",r="height");var i=e.offsets.map((function(e){return t.nodes[e.node]})).sort((function(e,t){return e[n]-t[n]})),a=null;i.forEach((function(e){if(a){var t=a[n]+a[r];t>e[n]&&(e[n]=t)}a=e}))}},e.prototype.createAlignment=function(e){var t=this,n=this.nodes[e.offsets[0].node].variable;this.makeFeasible(e);var r="x"===e.axis?this.xConstraints:this.yConstraints;e.offsets.slice(1).forEach((function(e){var i=t.nodes[e.node].variable;r.push(new a.Constraint(n,i,e.offset,!0))}))},e.prototype.createConstraints=function(e){var t=this,n=function(e){return void 0===e.type||"separation"===e.type};this.xConstraints=e.filter((function(e){return"x"===e.axis&&n(e)})).map((function(e){return t.createSeparation(e)})),this.yConstraints=e.filter((function(e){return"y"===e.axis&&n(e)})).map((function(e){return t.createSeparation(e)})),e.filter((function(e){return"alignment"===e.type})).forEach((function(e){return t.createAlignment(e)}))},e.prototype.setupVariablesAndBounds=function(e,t,n,r){this.nodes.forEach((function(i,a){i.fixed?(i.variable.weight=i.fixedWeight?i.fixedWeight:1e3,n[a]=r(i)):i.variable.weight=1;var o=(i.width||0)/2,s=(i.height||0)/2,l=e[a],c=t[a];i.bounds=new u(l-o,l+o,c-s,c+s)}))},e.prototype.xProject=function(e,t,n){(this.rootGroup||this.avoidOverlaps||this.xConstraints)&&this.project(e,t,e,n,(function(e){return e.px}),this.xConstraints,b,(function(e){return e.bounds.setXCentre(n[e.variable.index]=e.variable.position())}),(function(e){var t=n[e.minVar.index]=e.minVar.position(),r=n[e.maxVar.index]=e.maxVar.position(),i=e.padding/2;e.bounds.x=t-i,e.bounds.X=r+i}))},e.prototype.yProject=function(e,t,n){(this.rootGroup||this.yConstraints)&&this.project(e,t,t,n,(function(e){return e.py}),this.yConstraints,x,(function(e){return e.bounds.setYCentre(n[e.variable.index]=e.variable.position())}),(function(e){var t=n[e.minVar.index]=e.minVar.position(),r=n[e.maxVar.index]=e.maxVar.position(),i=e.padding/2;e.bounds.y=t-i,e.bounds.Y=r+i}))},e.prototype.projectFunctions=function(){var e=this;return[function(t,n,r){return e.xProject(t,n,r)},function(t,n,r){return e.yProject(t,n,r)}]},e.prototype.project=function(e,t,n,r,i,a,o,u,l){this.setupVariablesAndBounds(e,t,r,i),this.rootGroup&&this.avoidOverlaps&&(s(this.rootGroup),a=a.concat(o(this.rootGroup))),this.solve(this.variables,a,n,r),this.nodes.forEach(u),this.rootGroup&&this.avoidOverlaps&&(this.groups.forEach(l),s(this.rootGroup))},e.prototype.solve=function(e,t,n,r){var i=new a.Solver(e,t);i.setStartingPositions(n),i.setDesiredPositions(r),i.solve()},e}();t.Projection=E},function(e,t,n){e.exports=n(47)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(26),i=function(e,t){this.id=e,this.distance=t},a=function(e){this.id=e,this.neighbours=[]},o=function(e,t,n){this.node=e,this.prev=t,this.d=n},s=function(){function e(e,t,n,r,o){this.n=e,this.es=t,this.neighbours=new Array(this.n);for(var s=this.n;s--;)this.neighbours[s]=new a(s);for(s=this.es.length;s--;){var u=this.es[s],l=n(u),c=r(u),h=o(u);this.neighbours[l].neighbours.push(new i(c,h)),this.neighbours[c].neighbours.push(new i(l,h))}}return e.prototype.DistanceMatrix=function(){for(var e=new Array(this.n),t=0;t<this.n;++t)e[t]=this.dijkstraNeighbours(t);return e},e.prototype.DistancesFromNode=function(e){return this.dijkstraNeighbours(e)},e.prototype.PathFromNodeToNode=function(e,t){return this.dijkstraNeighbours(e,t)},e.prototype.PathFromNodeToNodeWithPrevCost=function(e,t,n){var i=new r.PriorityQueue((function(e,t){return e.d<=t.d})),a=this.neighbours[e],s=new o(a,null,0),u={};for(i.push(s);!i.empty()&&(a=(s=i.pop()).node).id!==t;)for(var l=a.neighbours.length;l--;){var c=a.neighbours[l],h=this.neighbours[c.id];if(!s.prev||h.id!==s.prev.node.id){var d=h.id+","+a.id;if(!(d in u&&u[d]<=s.d)){var p=s.prev?n(s.prev.node.id,a.id,h.id):0,f=s.d+c.distance+p;u[d]=f,i.push(new o(h,s,f))}}}for(var g=[];s.prev;)s=s.prev,g.push(s.node.id);return g},e.prototype.dijkstraNeighbours=function(e,t){void 0===t&&(t=-1);for(var n=new r.PriorityQueue((function(e,t){return e.d<=t.d})),i=this.neighbours.length,a=new Array(i);i--;){var o=this.neighbours[i];o.d=i===e?0:Number.POSITIVE_INFINITY,o.q=n.push(o)}for(;!n.empty();){var s=n.pop();if(a[s.id]=s.d,s.id===t){for(var u=[],l=s;void 0!==l.prev;)u.push(l.prev.id),l=l.prev;return u}for(i=s.neighbours.length;i--;){var c=s.neighbours[i],h=(l=this.neighbours[c.id],s.d+c.distance);s.d!==Number.MAX_VALUE&&l.d>h&&(l.d=h,l.prev=s,n.reduceKey(l.q,l,(function(e,t){return e.q=t})))}}return a},e}();t.Calculator=s},function(e,t,n){"use strict";(function(t){function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i=r(n(36)),a=r(n(37));function o(e){return(o="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 s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var d="undefined"==typeof window?null:window,p=d?d.navigator:null,f=(d&&d.document,o("")),g=o({}),v=o((function(){})),y="undefined"==typeof HTMLElement?"undefined":o(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&o(e)==f},x=function(e){return null!=e&&o(e)===v},w=function(e){return!_(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&o(e)===g&&!w(e)&&e.constructor===Object},C=function(e){return null!=e&&o(e)===o(1)&&!isNaN(e)},S=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},_=function(e){return k(e)||A(e)},k=function(e){return"collection"===m(e)&&e._private.single},A=function(e){return"collection"===m(e)&&!e._private.single},T=function(e){return"core"===m(e)},P=function(e){return"stylesheet"===m(e)},M=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},D=function(e){return function(e){return null!=e&&o(e)===g}(e)&&x(e.then)},I=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,i=this,a=arguments,o=t.apply(i,a),s=n.cache;return(r=s[o])||(r=s[o]=e.apply(i,a)),r};return n.cache={},n},O=I((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),B=I((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),N=I((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),L=function(e){return M(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},R="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",j=function(e,t){return e<t?-1:e>t?1:0},z=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];e[o]=r[o]}}return e},V=function(e){return(w(e)?e:null)||function(e){return F[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r;return 4===e.length?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):(t=parseInt(e[1]+e[2],16),n=parseInt(e[3]+e[4],16),r=parseInt(e[5]+e[6],16)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^rgb[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var u=n[4];if(void 0!==u){if((u=parseFloat(u))<0||u>1)return;t.push(u)}}return t}(e)||function(e){var t,n,r,i,a,o,s,u;function l(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(a=c[4])&&((a=parseFloat(a))<0||a>1))return;if(0===r)o=s=u=Math.round(255*i);else{var h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;o=Math.round(255*l(d,h,n+1/3)),s=Math.round(255*l(d,h,n)),u=Math.round(255*l(d,h,n-1/3))}t=[o,s,u,a]}return t}(e)},F={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]},q=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(E(a))throw Error("Tried to set map with object key");i<n.length-1?(null==t[a]&&(t[a]={}),t=t[a]):t[a]=e.value}},X=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(E(a))throw Error("Tried to get map with object key");if(null==(t=t[a]))return t}return t},Y=d?d.performance:null,W=Y&&Y.now?function(){return Y.now()}:function(){return Date.now()},H=function(){if(d){if(d.requestAnimationFrame)return function(e){d.requestAnimationFrame(e)};if(d.mozRequestAnimationFrame)return function(e){d.mozRequestAnimationFrame(e)};if(d.webkitRequestAnimationFrame)return function(e){d.webkitRequestAnimationFrame(e)};if(d.msRequestAnimationFrame)return function(e){d.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(W())}),1e3/60)}}(),G=function(e){return H(e)},U=W,K=65599,Z=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261,r=n;!(t=e.next()).done;)r=r*K+t.value|0;return r},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261;return t*K+e|0},Q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5381;return(t<<5)+t+e|0},J=function(e){return 2097152*e[0]+e[1]},ee=function(e,t){return[$(e[0],t[0]),Q(e[1],t[1])]},te=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Z({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},ne=function(){return re(arguments)},re=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?te(r):te(r,t)}return t},ie=!0,ae=(console.warn,console.trace,Number.MAX_SAFE_INTEGER||9007199254740991),oe=function(){return!0},se=function(){return!1},ue=function(){return 0},le=function(){},ce=function(e){throw new Error(e)},he=function(e){if(void 0===e)return ie;ie=!!e},de=function(e){he()},pe=function(e){return null==e?e:w(e)?e.slice():E(e)?function(e){return z({},e)}(e):e},fe=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},ge={},ve=function(){return ge},ye=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var a=t[i],o=null==n?void 0:n[a];r[a]=void 0===o?e[a]:o}return r}},me=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},be=function(e){e.splice(0,e.length)},xe=function(e,t,n){return n&&(t=N(n,t)),e[t]},we=function(e,t,n,r){n&&(t=N(n,t)),e[t]=r},Ee="undefined"!=typeof Map?Map:function(){function e(){s(this,e),this._obj={}}return l(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),Ce=function(){function e(t){if(s(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r<n.length;r++)this.add(n[r])}}return l(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),Se="undefined"!==("undefined"==typeof Set?"undefined":o(Set))?Set:Ce,_e=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&T(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new Se,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var u=[];w(t.classes)?u=t.classes:b(t.classes)&&(u=t.classes.split(/\s+/));for(var l=0,c=u.length;l<c;l++){var h=u[l];h&&""!==h&&i.classes.add(h)}this.createEmitter();var d=t.style||t.css;d&&(de(),this.style(d)),(void 0===n||n)&&this.restore()}else ce("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else ce("An element must have a core reference and parameters set")},ke=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;E(t)&&!_(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||x(n)?r:n,n=x(n)?n:function(){};for(var a,o=this._private.cy,s=t=b(t)?this.filter(t):t,u=[],l=[],c={},h={},d={},p=0,f=this.byGroup(),g=f.nodes,v=f.edges,y=0;y<s.length;y++){var m=s[y],w=m.id();m.isNode()&&(u.unshift(m),e.bfs&&(d[w]=!0,l.push(m)),h[w]=0)}var C=function(){var t=e.bfs?u.shift():u.pop(),i=t.id();if(e.dfs){if(d[i])return"continue";d[i]=!0,l.push(t)}var o,s=h[i],f=c[i],y=null!=f?f.source():null,m=null!=f?f.target():null,b=null==f?void 0:t.same(y)?m[0]:y[0];if(!0===(o=n(t,f,b,p++,s)))return a=t,"break";if(!1===o)return"break";for(var x=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&v.has(e)})),w=0;w<x.length;w++){var E=x[w],C=E.connectedNodes().filter((function(e){return!e.same(t)&&g.has(e)})),S=C.id();0===C.length||d[S]||(C=C[0],u.push(C),e.bfs&&(d[S]=!0,l.push(C)),c[S]=E,h[S]=h[i]+1)}};e:for(;0!==u.length;){var S=C();switch(S){case"continue":continue;case"break":break e}}for(var k=o.collection(),A=0;A<l.length;A++){var T=l[A],P=c[T.id()];null!=P&&k.push(P),k.push(T)}return{path:o.collection(k),found:o.collection(a)}}},Ae={breadthFirstSearch:ke({bfs:!0}),depthFirstSearch:ke({dfs:!0})};Ae.bfs=Ae.breadthFirstSearch,Ae.dfs=Ae.depthFirstSearch;var Te=ye({root:null,weight:function(e){return 1},directed:!1}),Pe={dijkstra:function(e){if(!E(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Te(e),r=n.root,i=n.weight,o=n.directed,s=this,u=i,l=b(r)?this.filter(r)[0]:r[0],c={},h={},d={},p=this.byGroup(),f=p.nodes,g=p.edges;g.unmergeBy((function(e){return e.isLoop()}));for(var v=function(e){return c[e.id()]},y=function(e,t){c[e.id()]=t,m.updateItem(e)},m=new a((function(e,t){return v(e)-v(t)})),x=0;x<f.length;x++){var w=f[x];c[w.id()]=w.same(l)?0:1/0,m.push(w)}for(var C=function(e,t){for(var n,r=(o?e.edgesTo(t):e.edgesWith(t)).intersect(g),i=1/0,a=0;a<r.length;a++){var s=r[a],l=u(s);(l<i||!n)&&(i=l,n=s)}return{edge:n,dist:i}};m.size()>0;){var S=m.pop(),_=v(S),k=S.id();if(d[k]=_,_!==1/0)for(var A=S.neighborhood().intersect(f),T=0;T<A.length;T++){var P=A[T],M=P.id(),D=C(S,P),I=_+D.dist;I<v(P)&&(y(P,I),h[M]={node:S,edge:D.edge})}}return{distanceTo:function(e){var t=b(e)?f.filter(e)[0]:e[0];return d[t.id()]},pathTo:function(e){var t=b(e)?f.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);h[i];){var a=h[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return s.spawn(n)}}}},Me={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=new Array(i),o=n,s=function(e){for(var t=0;t<a.length;t++){if(a[t].has(e))return t}},u=0;u<i;u++)a[u]=this.spawn(n[u]);for(var l=r.sort((function(t,n){return e(t)-e(n)})),c=0;c<l.length;c++){var h=l[c],d=h.source()[0],p=h.target()[0],f=s(d),g=s(p),v=a[f],y=a[g];f!==g&&(o.merge(h),v.merge(y),a.splice(g,1))}return o}},De=ye({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Ie={aStar:function(e){var t=this.cy(),n=De(e),r=n.root,i=n.goal,o=n.heuristic,s=n.directed,u=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,c,h=r.id(),d=i.id(),p={},f={},g={},v=new a((function(e,t){return f[e.id()]-f[t.id()]})),y=new Se,m={},b={},x=function(e,t){v.push(e),y.add(t)};x(r,h),p[h]=0,f[h]=o(r);for(var w,E=0;v.size()>0;){if(l=v.pop(),c=l.id(),y.delete(c),E++,c===d){for(var C=[],S=i,_=d,k=b[_];C.unshift(S),null!=k&&C.unshift(k),null!=(S=m[_]);)k=b[_=S.id()];return{found:!0,distance:p[c],path:this.spawn(C),steps:E}}g[c]=!0;for(var A=l._private.edges,T=0;T<A.length;T++){var P=A[T];if(this.hasElementWithId(P.id())&&(!s||P.data("source")===c)){var M=P.source(),D=P.target(),I=M.id()!==c?M:D,O=I.id();if(this.hasElementWithId(O)&&!g[O]){var B=p[c]+u(P);w=O,y.has(w)?B<p[O]&&(p[O]=B,f[O]=B+o(I),m[O]=l,b[O]=P):(p[O]=B,f[O]=B+o(I),x(I,O),m[O]=l,b[O]=P)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},Oe=ye({weight:function(e){return 1},directed:!1}),Be={floydWarshall:function(e){for(var t=this.cy(),n=Oe(e),r=n.weight,i=n.directed,a=r,o=this.byGroup(),s=o.nodes,u=o.edges,l=s.length,c=l*l,h=function(e){return s.indexOf(e)},d=function(e){return s[e]},p=new Array(c),f=0;f<c;f++){var g=f%l,v=(f-g)/l;p[f]=v===g?0:1/0}for(var y=new Array(c),m=new Array(c),x=0;x<u.length;x++){var w=u[x],E=w.source()[0],C=w.target()[0];if(E!==C){var S=h(E),_=h(C),k=S*l+_,A=a(w);if(p[k]>A&&(p[k]=A,y[k]=_,m[k]=w),!i){var T=_*l+S;!i&&p[T]>A&&(p[T]=A,y[T]=S,m[T]=w)}}}for(var P=0;P<l;P++)for(var M=0;M<l;M++)for(var D=M*l+P,I=0;I<l;I++){var O=M*l+I,B=P*l+I;p[D]+p[B]<p[O]&&(p[O]=p[D]+p[B],y[O]=y[D])}var N=function(e){return h(function(e){return(b(e)?t.filter(e):e)[0]}(e))};return{distance:function(e,t){var n=N(e),r=N(t);return p[n*l+r]},path:function(e,n){var r=N(e),i=N(n),a=d(r);if(r===i)return a.collection();if(null==y[r*l+i])return t.collection();var o,s=t.collection(),u=r;for(s.merge(a);r!==i;)u=r,r=y[r*l+i],o=m[u*l+r],s.merge(o),s.merge(d(r));return s}}}},Ne=ye({weight:function(e){return 1},directed:!1,root:null}),Le={bellmanFord:function(e){var t=this,n=Ne(e),r=n.weight,i=n.directed,a=n.root,o=r,s=this,u=this.cy(),l=this.byGroup(),c=l.edges,h=l.nodes,d=h.length,p=new Ee,f=!1;a=u.collection(a)[0],c.unmergeBy((function(e){return e.isLoop()}));for(var g=c.length,v=function(e){var t=p.get(e.id());return t||(t={},p.set(e.id(),t)),t},y=function(e){return(b(e)?u.$(e):e)[0]},m=0;m<d;m++){var x=h[m],w=v(x);x.same(a)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,C=function(e,t,n,r,i,a){var o=r.dist+a;o<i.dist&&!n.same(r.edge)&&(i.dist=o,i.pred=e,i.edge=n,E=!0)},S=1;S<d;S++){E=!1;for(var _=0;_<g;_++){var k=c[_],A=k.source(),T=k.target(),P=o(k),M=v(A),D=v(T);C(A,0,k,M,D,P),i||C(T,0,k,D,M,P)}if(!E)break}if(E)for(var I=0;I<g;I++){var O=c[I],B=O.source(),N=O.target(),L=o(O),R=v(B).dist,j=v(N).dist;if(R+L<j||!i&&j+L<R){de(),f=!0;break}}return{distanceTo:function(e){return v(y(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,r=y(e),i=[],o=r;;){if(null==o)return t.spawn();var u=v(o),l=u.edge,c=u.pred;if(i.unshift(o[0]),o.same(n)&&i.length>0)break;null!=l&&i.unshift(l),o=c}return s.spawn(i)},hasNegativeWeightCycle:f,negativeWeightCycles:[]}}},Re=Math.sqrt(2),je=function(e,t,n){0===n.length&&ce("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],u=n,l=u.length-1;l>=0;l--){var c=u[l],h=c[1],d=c[2];(t[h]===o&&t[d]===s||t[h]===s&&t[d]===o)&&u.splice(l,1)}for(var p=0;p<u.length;p++){var f=u[p];f[1]===s?(u[p]=f.slice(),u[p][1]=o):f[2]===s&&(u[p]=f.slice(),u[p][2]=o)}for(var g=0;g<t.length;g++)t[g]===s&&(t[g]=o);return u},ze=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=je(i,e,t),n--}return t},Ve={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/Re);if(!(i<2)){for(var u=[],l=0;l<a;l++){var c=r[l];u.push([l,n.indexOf(c.source()),n.indexOf(c.target())])}for(var h=1/0,d=[],p=new Array(i),f=new Array(i),g=new Array(i),v=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=o;y++){for(var m=0;m<i;m++)f[m]=m;var b=ze(f,u.slice(),i,s),x=b.slice();v(f,g);var w=ze(f,b,s,2),E=ze(g,x,s,2);w.length<=E.length&&w.length<h?(h=w.length,d=w,v(f,p)):E.length<=w.length&&E.length<h&&(h=E.length,d=E,v(g,p))}for(var C=this.spawn(d.map((function(e){return r[e[0]]}))),S=this.spawn(),_=this.spawn(),k=p[0],A=0;A<p.length;A++){var T=p[A],P=n[A];T===k?S.merge(P):_.merge(P)}var M=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!C.contains(t)&&n.merge(t)}))})),n},D=[M(S),M(_)];return{cut:C,components:D,partition1:S,partition2:_}}ce("At least 2 nodes are required for Karger-Stein algorithm")}},Fe=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},qe=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Xe=function(e){return{x:e[0],y:e[1]}},Ye=function(e,t){return Math.atan2(t,e)-Math.PI/2},We=Math.log2||function(e){return Math.log(e)/Math.log(2)},He=function(e){return e>0?1:e<0?-1:0},Ge=function(e,t){return Math.sqrt(Ue(e,t))},Ue=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Ke=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},Ze=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},$e=function(e,t,n,r){return{x:Ze(e.x,t.x,n.x,r),y:Ze(e.y,t.y,n.y,r)}},Qe=function(e,t,n){return Math.max(e,Math.min(n,t))},Je=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},et=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},tt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},nt=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)t=n=r=i=a[0];else if(2===a.length)t=r=a[0],i=n=a[1];else if(4===a.length){var o=h(a,4);t=o[0],n=o[1],r=o[2],i=o[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rt=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},it=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},at=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},ot=function(e,t){return at(e,t.x1,t.y1)&&at(e,t.x2,t.y2)},st=function(e,t,n,r,i,a,o){var s,u=_t(i,a),l=i/2,c=a/2,h=r-c-o;if((s=bt(e,t,n,r,n-l+u-o,h,n+l-u+o,h,!1)).length>0)return s;var d=n+l+o;if((s=bt(e,t,n,r,d,r-c+u-o,d,r+c-u+o,!1)).length>0)return s;var p=r+c+o;if((s=bt(e,t,n,r,n-l+u-o,p,n+l-u+o,p,!1)).length>0)return s;var f,g=n-l-o;if((s=bt(e,t,n,r,g,r-c+u-o,g,r+c-u+o,!1)).length>0)return s;var v=n-l+u,y=r-c+u;if((f=yt(e,t,n,r,v,y,u+o)).length>0&&f[0]<=v&&f[1]<=y)return[f[0],f[1]];var m=n+l-u,b=r-c+u;if((f=yt(e,t,n,r,m,b,u+o)).length>0&&f[0]>=m&&f[1]<=b)return[f[0],f[1]];var x=n+l-u,w=r+c-u;if((f=yt(e,t,n,r,x,w,u+o)).length>0&&f[0]>=x&&f[1]>=w)return[f[0],f[1]];var E=n-l+u,C=r+c-u;return(f=yt(e,t,n,r,E,C,u+o)).length>0&&f[0]<=E&&f[1]>=C?[f[0],f[1]]:[]},ut=function(e,t,n,r,i,a,o){var s=o,u=Math.min(n,i),l=Math.max(n,i),c=Math.min(r,a),h=Math.max(r,a);return u-s<=e&&e<=l+s&&c-s<=t&&t<=h+s},lt=function(e,t,n,r,i,a,o,s,u){var l=Math.min(n,o,i)-u,c=Math.max(n,o,i)+u,h=Math.min(r,s,a)-u,d=Math.max(r,s,a)+u;return!(e<l||e>c||t<h||t>d)},ct=function(e,t,n,r,i,a,o,s){var u=[];!function(e,t,n,r,i){var a,o,s,u,l,c,h,d;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),a=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,i[1]=0,h=t/3,a>0?(l=(l=s+Math.sqrt(a))<0?-Math.pow(-l,1/3):Math.pow(l,1/3),c=(c=s-Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+l+c,h+=(l+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+l)/2,i[3]=h,i[5]=-h):(i[5]=i[3]=0,0===a?(d=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*d-h,i[4]=i[2]=-(d+h)):(u=(o=-o)*o*o,u=Math.acos(s/Math.sqrt(u)),d=2*Math.sqrt(o),i[0]=-h+d*Math.cos(u/3),i[2]=-h+d*Math.cos((u+2*Math.PI)/3),i[4]=-h+d*Math.cos((u+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,u);for(var l=[],c=0;c<6;c+=2)Math.abs(u[c+1])<1e-7&&u[c]>=0&&u[c]<=1&&l.push(u[c]);l.push(1),l.push(0);for(var h,d,p,f=-1,g=0;g<l.length;g++)h=Math.pow(1-l[g],2)*n+2*(1-l[g])*l[g]*i+l[g]*l[g]*o,d=Math.pow(1-l[g],2)*r+2*(1-l[g])*l[g]*a+l[g]*l[g]*s,p=Math.pow(h-e,2)+Math.pow(d-t,2),f>=0?p<f&&(f=p):f=p;return f},ht=function(e,t,n,r,i,a){var o=[e-n,t-r],s=[i-n,a-r],u=s[0]*s[0]+s[1]*s[1],l=o[0]*o[0]+o[1]*o[1],c=o[0]*s[0]+o[1]*s[1],h=c*c/u;return c<0?l:h>u?(e-i)*(e-i)+(t-a)*(t-a):l-h},dt=function(e,t,n){for(var r,i,a,o,s=0,u=0;u<n.length/2;u++)if(r=n[2*u],i=n[2*u+1],u+1<n.length/2?(a=n[2*(u+1)],o=n[2*(u+1)+1]):(a=n[2*(u+1-n.length/2)],o=n[2*(u+1-n.length/2)+1]),r==e&&a==e);else{if(!(r>=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},pt=function(e,t,n,r,i,a,o,s,u){var l,c=new Array(n.length);null!=s[0]?(l=Math.atan(s[1]/s[0]),s[0]<0?l+=Math.PI/2:l=-l-Math.PI/2):l=s;for(var h,d=Math.cos(-l),p=Math.sin(-l),f=0;f<c.length/2;f++)c[2*f]=a/2*(n[2*f]*d-n[2*f+1]*p),c[2*f+1]=o/2*(n[2*f+1]*d+n[2*f]*p),c[2*f]+=r,c[2*f+1]+=i;if(u>0){var g=gt(c,-u);h=ft(g)}else h=c;return dt(e,t,h)},ft=function(e){for(var t,n,r,i,a,o,s,u,l=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],n=e[4*c+1],r=e[4*c+2],i=e[4*c+3],c<e.length/4-1?(a=e[4*(c+1)],o=e[4*(c+1)+1],s=e[4*(c+1)+2],u=e[4*(c+1)+3]):(a=e[0],o=e[1],s=e[2],u=e[3]);var h=bt(t,n,r,i,a,o,s,u,!0);l[2*c]=h[0],l[2*c+1]=h[1]}return l},gt=function(e,t){for(var n,r,i,a,o=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[2*(s+1)],a=e[2*(s+1)+1]):(i=e[0],a=e[1]);var u=a-r,l=-(i-n),c=Math.sqrt(u*u+l*l),h=u/c,d=l/c;o[4*s]=n+h*t,o[4*s+1]=r+d*t,o[4*s+2]=i+h*t,o[4*s+3]=a+d*t}return o},vt=function(e,t,n,r,i,a,o){return e-=i,t-=a,(e/=n/2+o)*e+(t/=r/2+o)*t<=1},yt=function(e,t,n,r,i,a,o){var s=[n-e,r-t],u=[e-i,t-a],l=s[0]*s[0]+s[1]*s[1],c=2*(u[0]*s[0]+u[1]*s[1]),h=c*c-4*l*(u[0]*u[0]+u[1]*u[1]-o*o);if(h<0)return[];var d=(-c+Math.sqrt(h))/(2*l),p=(-c-Math.sqrt(h))/(2*l),f=Math.min(d,p),g=Math.max(d,p),v=[];if(f>=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},mt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},bt=function(e,t,n,r,i,a,o,s,u){var l=e-i,c=n-e,h=o-i,d=t-a,p=r-t,f=s-a,g=h*d-f*l,v=c*d-p*l,y=f*c-h*p;if(0!==y){var m=g/y,b=v/y;return-.001<=m&&m<=1.001&&-.001<=b&&b<=1.001||u?[e+m*c,t+m*p]:[]}return 0===g||0===v?mt(e,n,o)===o?[o,s]:mt(e,n,i)===i?[i,a]:mt(i,o,n)===n?[n,r]:[]:[]},xt=function(e,t,n,r,i,a,o,s){var u,l,c,h,d,p,f=[],g=new Array(n.length),v=!0;if(null==a&&(v=!1),v){for(var y=0;y<g.length/2;y++)g[2*y]=n[2*y]*a+r,g[2*y+1]=n[2*y+1]*o+i;if(s>0){var m=gt(g,-s);l=ft(m)}else l=g}else l=n;for(var b=0;b<l.length/2;b++)c=l[2*b],h=l[2*b+1],b<l.length/2-1?(d=l[2*(b+1)],p=l[2*(b+1)+1]):(d=l[0],p=l[1]),0!==(u=bt(e,t,r,i,c,h,d,p)).length&&f.push(u[0],u[1]);return f},wt=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(i-n)/i;return a<0&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},Et=function(e,t){var n=St(e,t);return n=Ct(n)},Ct=function(e){for(var t,n,r=e.length/2,i=1/0,a=1/0,o=-1/0,s=-1/0,u=0;u<r;u++)t=e[2*u],n=e[2*u+1],i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);for(var l=2/(o-i),c=2/(s-a),h=0;h<r;h++)t=e[2*h]=e[2*h]*l,n=e[2*h+1]=e[2*h+1]*c,i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);if(a<-1)for(var d=0;d<r;d++)n=e[2*d+1]=e[2*d+1]+(-1-a);return e},St=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,a=new Array(2*e),o=0;o<e;o++)i=o*n+r,a[2*o]=Math.cos(i),a[2*o+1]=Math.sin(-i);return a},_t=function(e,t){return Math.min(e/4,t/4,8)},kt=function(e,t){return Math.min(e/10,t/10,8)},At=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Tt=ye({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Pt={pageRank:function(e){for(var t=Tt(e),n=t.dampingFactor,r=t.precision,i=t.iterations,a=t.weight,o=this._private.cy,s=this.byGroup(),u=s.nodes,l=s.edges,c=u.length,h=c*c,d=l.length,p=new Array(h),f=new Array(c),g=(1-n)/c,v=0;v<c;v++){for(var y=0;y<c;y++){p[v*c+y]=0}f[v]=0}for(var m=0;m<d;m++){var b=l[m],x=b.data("source"),w=b.data("target");if(x!==w){var E=u.indexOfId(x),C=u.indexOfId(w),S=a(b);p[C*c+E]+=S,f[E]+=S}}for(var _=1/c+g,k=0;k<c;k++)if(0===f[k])for(var A=0;A<c;A++){p[A*c+k]=_}else for(var T=0;T<c;T++){var P=T*c+k;p[P]=p[P]/f[k]+g}for(var M,D=new Array(c),I=new Array(c),O=0;O<c;O++)D[O]=1;for(var B=0;B<i;B++){for(var N=0;N<c;N++)I[N]=0;for(var L=0;L<c;L++)for(var R=0;R<c;R++){var j=L*c+R;I[L]+=p[j]*D[R]}Ke(I),M=D,D=I,I=M;for(var z=0,V=0;V<c;V++){var F=M[V]-D[V];z+=F*F}if(z<r)break}return{rank:function(e){return e=o.collection(e)[0],D[u.indexOf(e)]}}}},Mt=ye({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Dt={degreeCentralityNormalized:function(e){e=Mt(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},a={},o=0,s=0,u=0;u<r;u++){var l=n[u],c=l.id();e.root=l;var h=this.degreeCentrality(e);o<h.indegree&&(o=h.indegree),s<h.outdegree&&(s=h.outdegree),i[c]=h.indegree,a[c]=h.outdegree}return{indegree:function(e){return 0==o?0:(b(e)&&(e=t.filter(e)),i[e.id()]/o)},outdegree:function(e){return 0===s?0:(b(e)&&(e=t.filter(e)),a[e.id()]/s)}}}for(var d={},p=0,f=0;f<r;f++){var g=n[f];e.root=g;var v=this.degreeCentrality(e);p<v.degree&&(p=v.degree),d[g.id()]=v.degree}return{degree:function(e){return 0===p?0:(b(e)&&(e=t.filter(e)),d[e.id()]/p)}}},degreeCentrality:function(e){e=Mt(e);var t=this.cy(),n=this,r=e,i=r.root,a=r.weight,o=r.directed,s=r.alpha;if(i=t.collection(i)[0],o){for(var u=i.connectedEdges(),l=u.filter((function(e){return e.target().same(i)&&n.has(e)})),c=u.filter((function(e){return e.source().same(i)&&n.has(e)})),h=l.length,d=c.length,p=0,f=0,g=0;g<l.length;g++)p+=a(l[g]);for(var v=0;v<c.length;v++)f+=a(c[v]);return{indegree:Math.pow(h,1-s)*Math.pow(p,s),outdegree:Math.pow(d,1-s)*Math.pow(f,s)}}for(var y=i.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=a(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};Dt.dc=Dt.degreeCentrality,Dt.dcn=Dt.degreeCentralityNormalised=Dt.degreeCentralityNormalized;var It=ye({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ot={closenessCentralityNormalized:function(e){for(var t=It(e),n=t.harmonic,r=t.weight,i=t.directed,a=this.cy(),o={},s=0,u=this.nodes(),l=this.floydWarshall({weight:r,directed:i}),c=0;c<u.length;c++){for(var h=0,d=u[c],p=0;p<u.length;p++)if(c!==p){var f=l.distance(d,u[p]);h+=n?1/f:f}n||(h=1/h),s<h&&(s=h),o[d.id()]=h}return{closeness:function(e){return 0==s?0:(e=b(e)?a.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=It(e),n=t.root,r=t.weight,i=t.directed,a=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:i}),s=0,u=this.nodes(),l=0;l<u.length;l++){var c=u[l];if(!c.same(n)){var h=o.distanceTo(c);s+=a?1/h:h}}return a?s:1/s}};Ot.cc=Ot.closenessCentrality,Ot.ccn=Ot.closenessCentralityNormalised=Ot.closenessCentralityNormalized;var Bt=ye({weight:null,directed:!1}),Nt={betweennessCentrality:function(e){for(var t=Bt(e),n=t.directed,r=t.weight,i=null!=r,o=this.cy(),s=this.nodes(),u={},l={},c=0,h=function(e,t){l[e]=t,t>c&&(c=t)},d=function(e){return l[e]},p=0;p<s.length;p++){var f=s[p],g=f.id();u[g]=n?f.outgoers().nodes():f.openNeighborhood().nodes(),h(g,0)}for(var v=function(e){for(var t=s[e].id(),n=[],l={},c={},p={},f=new a((function(e,t){return p[e]-p[t]})),g=0;g<s.length;g++){var v=s[g].id();l[v]=[],c[v]=0,p[v]=1/0}for(c[t]=1,p[t]=0,f.push(t);!f.empty();){var y=f.pop();if(n.push(y),i)for(var m=0;m<u[y].length;m++){var b=u[y][m],x=o.getElementById(y),w=void 0;w=x.edgesTo(b).length>0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var E=r(w);b=b.id(),p[b]>p[y]+E&&(p[b]=p[y]+E,f.nodes.indexOf(b)<0?f.push(b):f.updateItem(b),c[b]=0,l[b]=[]),p[b]==p[y]+E&&(c[b]=c[b]+c[y],l[b].push(y))}else for(var C=0;C<u[y].length;C++){var S=u[y][C].id();p[S]==1/0&&(f.push(S),p[S]=p[y]+1),p[S]==p[y]+1&&(c[S]=c[S]+c[y],l[S].push(y))}}for(var _={},k=0;k<s.length;k++)_[s[k].id()]=0;for(;n.length>0;){for(var A=n.pop(),T=0;T<l[A].length;T++){var P=l[A][T];_[P]=_[P]+c[P]/c[A]*(1+_[A])}A!=s[e].id()&&h(A,d(A)+_[A])}},y=0;y<s.length;y++)v(y);var m={betweenness:function(e){var t=o.collection(e).id();return d(t)},betweennessNormalized:function(e){if(0==c)return 0;var t=o.collection(e).id();return d(t)/c}};return m.betweennessNormalised=m.betweennessNormalized,m}};Nt.bc=Nt.betweennessCentrality;var Lt=ye({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Rt=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},jt=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var a=0;a<t;a++)e[a*t+r]=e[a*t+r]/n}},zt=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var a=0;a<n;a++)r[i*n+a]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+o]*t[o*n+s]}return r},Vt=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=zt(e,r,t);return e},Ft=function(e,t,n){for(var r=new Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return jt(r,t),r},qt=function(e,t,n,r){for(var i=0;i<n;i++){if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},Xt=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Yt=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return Lt(e)}(e),a={},o=0;o<t.length;o++)a[t[o].id()]=o;for(var s,u=t.length,l=u*u,c=new Array(l),h=0;h<l;h++)c[h]=0;for(var d=0;d<n.length;d++){var p=n[d],f=a[p.source().id()],g=a[p.target().id()],v=Rt(p,i.attributes);c[f*u+g]+=v,c[g*u+f]+=v}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,u,i.multFactor),jt(c,u);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=Vt(c,u,i.expandFactor),c=Ft(s,u,i.inflateFactor),qt(c,s,l,4)||(y=!0),m++;var b=function(e,t,n,r){for(var i=[],a=0;a<t;a++){for(var o=[],s=0;s<t;s++)Math.round(1e3*e[a*t+s])/1e3>0&&o.push(n[s]);0!==o.length&&i.push(r.collection(o))}return i}(c,u,t,r);return b=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Xt(e[t],e[n])&&e.splice(n,1);return e}(b)},Wt={markovClustering:Yt,mcl:Yt},Ht=function(e){return e},Gt=function(e,t){return Math.abs(t-e)},Ut=function(e,t,n){return e+Gt(t,n)},Kt=function(e,t,n){return e+Math.pow(n-t,2)},Zt=function(e){return Math.sqrt(e)},$t=function(e,t,n){return Math.max(e,Gt(t,n))},Qt=function(e,t,n,r,i){for(var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Ht,o=r,s=0;s<e;s++)o=i(o,t(s),n(s));return a(o)},Jt={euclidean:function(e,t,n){return e>=2?Qt(e,t,n,0,Kt,Zt):Qt(e,t,n,0,Ut)},squaredEuclidean:function(e,t,n){return Qt(e,t,n,0,Kt)},manhattan:function(e,t,n){return Qt(e,t,n,0,Ut)},max:function(e,t,n){return Qt(e,t,n,-1/0,$t)}};function en(e,t,n,r,i,a){var o;return o=x(e)?e:Jt[e]||Jt.euclidean,0===t&&x(e)?o(i,a):o(t,n,r,i,a)}Jt["squared-euclidean"]=Jt.squaredEuclidean,Jt.squaredeuclidean=Jt.squaredEuclidean;var tn=ye({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),nn=function(e){return tn(e)},rn=function(e,t,n,r,i){var a="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},o=n,s=t;return en(e,r.length,a,(function(e){return r[e](t)}),o,s)},an=function(e,t,n){for(var r=n.length,i=new Array(r),a=new Array(r),o=new Array(t),s=null,u=0;u<r;u++)i[u]=e.min(n[u]).value,a[u]=e.max(n[u]).value;for(var l=0;l<t;l++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(a[c]-i[c])+i[c];o[l]=s}return o},on=function(e,t,n,r,i){for(var a=1/0,o=0,s=0;s<t.length;s++){var u=rn(n,e,t[s],r,i);u<a&&(a=u,o=s)}return o},sn=function(e,t,n){for(var r=[],i=null,a=0;a<t.length;a++)n[(i=t[a]).id()]===e&&r.push(i);return r},un=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++){if(Math.abs(e[r][i]-t[r][i])>n)return!1}return!0},ln=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},cn=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];ln(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var a=0;a<t;a++)n[a]=e[Math.floor(Math.random()*e.length)];return n},hn=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=rn("manhattan",t[i],e,n,"kMedoids");return r},dn=function(e,t,n,r,i){for(var a,o,s=0;s<t.length;s++)for(var u=0;u<e.length;u++)r[s][u]=Math.pow(n[s][u],i.m);for(var l=0;l<e.length;l++)for(var c=0;c<i.attributes.length;c++){a=0,o=0;for(var h=0;h<t.length;h++)a+=r[h][l]*i.attributes[c](t[h]),o+=r[h][l];e[l][c]=a/o}},pn=function(e,t,n,r,i){for(var a=0;a<e.length;a++)t[a]=e[a].slice();for(var o,s,u,l=2/(i.m-1),c=0;c<n.length;c++)for(var h=0;h<r.length;h++){o=0;for(var d=0;d<n.length;d++)s=rn(i.distance,r[h],n[c],i.attributes,"cmeans"),u=rn(i.distance,r[h],n[d],i.attributes,"cmeans"),o+=Math.pow(s/u,l);e[h][c]=1/o}},fn=function(e){var t,n,r,i,a=this.cy(),o=this.nodes(),s=nn(e);r=new Array(o.length);for(var u=0;u<o.length;u++)r[u]=new Array(s.k);n=new Array(o.length);for(var l=0;l<o.length;l++)n[l]=new Array(s.k);for(var c=0;c<o.length;c++){for(var h=0,d=0;d<s.k;d++)n[c][d]=Math.random(),h+=n[c][d];for(var p=0;p<s.k;p++)n[c][p]=n[c][p]/h}t=new Array(s.k);for(var f=0;f<s.k;f++)t[f]=new Array(s.attributes.length);i=new Array(o.length);for(var g=0;g<o.length;g++)i[g]=new Array(s.k);for(var v=!0,y=0;v&&y<s.maxIterations;)v=!1,dn(t,o,n,i,s),pn(n,r,t,o,s),un(n,r,s.sensitivityThreshold)||(v=!0),y++;return{clusters:function(e,t,n,r){for(var i,a,o=new Array(n.k),s=0;s<o.length;s++)o[s]=[];for(var u=0;u<t.length;u++){i=-1/0,a=-1;for(var l=0;l<t[0].length;l++)t[u][l]>i&&(i=t[u][l],a=l);o[a].push(e[u])}for(var c=0;c<o.length;c++)o[c]=r.collection(o[c]);return o}(o,n,s,a),degreeOfMembership:n}},gn={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,a=nn(e),s=new Array(a.k),u={};t=a.testMode?"number"==typeof a.testCentroids?an(r,a.k,a.attributes):"object"===o(a.testCentroids)?a.testCentroids:an(r,a.k,a.attributes):an(r,a.k,a.attributes);for(var l,c,h,d=!0,p=0;d&&p<a.maxIterations;){for(var f=0;f<r.length;f++)u[(i=r[f]).id()]=on(i,t,a.distance,a.attributes,"kMeans");d=!1;for(var g=0;g<a.k;g++){var v=sn(g,r,u);if(0!==v.length){for(var y=a.attributes.length,m=t[g],b=new Array(y),x=new Array(y),w=0;w<y;w++){x[w]=0;for(var E=0;E<v.length;E++)i=v[E],x[w]+=a.attributes[w](i);b[w]=x[w]/v.length,l=b[w],c=m[w],h=a.sensitivityThreshold,Math.abs(c-l)<=h||(d=!0)}t[g]=b,s[g]=n.collection(v)}}p++}return s},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),a=null,s=nn(e),u=new Array(s.k),l={},c=new Array(s.k);s.testMode?"number"==typeof s.testCentroids||(t="object"===o(s.testCentroids)?s.testCentroids:cn(i,s.k)):t=cn(i,s.k);for(var h=!0,d=0;h&&d<s.maxIterations;){for(var p=0;p<i.length;p++)l[(a=i[p]).id()]=on(a,t,s.distance,s.attributes,"kMedoids");h=!1;for(var f=0;f<t.length;f++){var g=sn(f,i,l);if(0!==g.length){c[f]=hn(t[f],g,s.attributes);for(var v=0;v<g.length;v++)(n=hn(g[v],g,s.attributes))<c[f]&&(c[f]=n,t[f]=g[v],h=!0);u[f]=r.collection(g)}}d++}return u},fuzzyCMeans:fn,fcm:fn},vn=ye({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),yn={single:"min",complete:"max"},mn=function(e,t,n,r,i){for(var a,o=0,s=1/0,u=i.attributes,l=function(e,t){return en(i.distance,u.length,(function(t){return u[t](e)}),(function(e){return u[e](t)}),e,t)},c=0;c<e.length;c++){var h=e[c].key,d=n[h][r[h]];d<s&&(o=h,s=d)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[o],g=t[r[o]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;v<e.length;v++){var y=e[v];f.key===y.key?a=1/0:"min"===i.linkage?(a=n[f.key][y.key],n[f.key][y.key]>n[g.key][y.key]&&(a=n[g.key][y.key])):"max"===i.linkage?(a=n[f.key][y.key],n[f.key][y.key]<n[g.key][y.key]&&(a=n[g.key][y.key])):a="mean"===i.linkage?(n[f.key][y.key]*f.size+n[g.key][y.key]*g.size)/(f.size+g.size):"dendrogram"===i.mode?l(y.value,f.value):l(y.value[0],f.value[0]),n[f.key][y.key]=n[y.key][f.key]=a}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===f.key||r[b]===g.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[m].index=m}return f.key=g.key=f.index=g.index=null,!0},bn=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},xn=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=vn(e),n=yn[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,a=function(e,t){return en(r.distance,i.length,(function(t){return i[t](e)}),(function(e){return i[e](t)}),e,t)},o=[],s=[],u=[],l=[],c=0;c<n.length;c++){var h={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};o[c]=h,l[c]=h,s[c]=[],u[c]=0}for(var d=0;d<o.length;d++)for(var p=0;p<=d;p++){var f=void 0;f="dendrogram"===r.mode?d===p?1/0:a(o[d].value,o[p].value):d===p?1/0:a(o[d].value[0],o[p].value[0]),s[d][p]=f,s[p][d]=f,f<s[d][u[d]]&&(u[d]=p)}for(var g,v=mn(o,l,s,u,r);v;)v=mn(o,l,s,u,r);return"dendrogram"===r.mode?(g=function e(t,n,r){if(!t)return[];var i=[],a=[],o=[];return 0===n?(t.left&&bn(t.left,i),t.right&&bn(t.right,a),o=i.concat(a),[r.collection(o)]):1===n?t.value?[r.collection(t.value)]:(t.left&&bn(t.left,i),t.right&&bn(t.right,a),[r.collection(i),r.collection(a)]):t.value?[r.collection(t.value)]:(t.left&&(i=e(t.left,n-1,r)),t.right&&(a=e(t.right,n-1,r)),i.concat(a))}(o[0],r.dendrogramDepth,t),r.addDendrogram&&function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),i=e(t.right,n),a=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:a.id()}}),n.add({group:"edges",data:{source:i,target:a.id()}}),a.id()}return t.value?t.value.id():void 0}(o[0],t)):(g=new Array(o.length),o.forEach((function(e,n){e.key=e.index=null,g[n]=t.collection(e.value)}))),g},wn={hierarchicalClustering:xn,hca:xn},En=ye({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Cn=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-en(e,r.length,(function(e){return i(t,e)}),(function(e){return i(n,e)}),t,n)},Sn=function(e,t){return"median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];r?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var o=0,s=e.length-1;s>=0;s--){var u=e[s];a?isFinite(u)||(e[s]=-1/0,o++):e.splice(s,1)}i&&e.sort((function(e,t){return e-t}));var l=e.length,c=Math.floor(l/2);return l%2!=0?e[c+1+o]:(e[c-1+o]+e[c+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,a=t;a<n;a++){var o=e[a];isFinite(o)&&(r+=o,i++)}return r/i}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.min(a,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.max(a,r))}return r}(e):t},_n=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var a=-1,o=-1/0,s=0;s<n.length;s++){var u=n[s];t[i*e+u]>o&&(a=u,o=t[i*e+u])}a>0&&r.push(a)}for(var l=0;l<n.length;l++)r[n[l]]=n[l];return r},kn=function(e){for(var t,n,r,i,a,o,s=this.cy(),u=this.nodes(),l=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||ce("Damping must range on [0.5, 1).  Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||C(n)||ce("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number.  Got: ").concat(n)),En(e)}(e),c={},h=0;h<u.length;h++)c[u[h].id()]=h;n=(t=u.length)*t,r=new Array(n);for(var d=0;d<n;d++)r[d]=-1/0;for(var p=0;p<t;p++)for(var f=0;f<t;f++)p!==f&&(r[p*t+f]=Cn(l.distance,u[p],u[f],l.attributes));i=Sn(r,l.preference);for(var g=0;g<t;g++)r[g*t+g]=i;a=new Array(n);for(var v=0;v<n;v++)a[v]=0;o=new Array(n);for(var y=0;y<n;y++)o[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var E,S=new Array(t*l.minIterations),_=0;_<S.length;_++)S[_]=0;for(E=0;E<l.maxIterations;E++){for(var k=0;k<t;k++){for(var A=-1/0,T=-1/0,P=-1,M=0,D=0;D<t;D++)m[D]=a[k*t+D],(M=o[k*t+D]+r[k*t+D])>=A?(T=A,A=M,P=D):M>T&&(T=M);for(var I=0;I<t;I++)a[k*t+I]=(1-l.damping)*(r[k*t+I]-A)+l.damping*m[I];a[k*t+P]=(1-l.damping)*(r[k*t+P]-T)+l.damping*m[P]}for(var O=0;O<t;O++){for(var B=0,N=0;N<t;N++)m[N]=o[N*t+O],b[N]=Math.max(0,a[N*t+O]),B+=b[N];B-=b[O],b[O]=a[O*t+O],B+=b[O];for(var L=0;L<t;L++)o[L*t+O]=(1-l.damping)*Math.min(0,B-b[L])+l.damping*m[L];o[O*t+O]=(1-l.damping)*(B-b[O])+l.damping*m[O]}for(var R=0,j=0;j<t;j++){var z=o[j*t+j]+a[j*t+j]>0?1:0;S[E%l.minIterations*t+j]=z,R+=z}if(R>0&&(E>=l.minIterations-1||E==l.maxIterations-1)){for(var V=0,F=0;F<t;F++){x[F]=0;for(var q=0;q<l.minIterations;q++)x[F]+=S[q*t+F];0!==x[F]&&x[F]!==l.minIterations||V++}if(V===t)break}}for(var X=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r}(t,a,o),Y=function(e,t,n){for(var r=_n(e,t,n),i=0;i<n.length;i++){for(var a=[],o=0;o<r.length;o++)r[o]===n[i]&&a.push(o);for(var s=-1,u=-1/0,l=0;l<a.length;l++){for(var c=0,h=0;h<a.length;h++)c+=t[a[h]*e+a[l]];c>u&&(s=l,u=c)}n[i]=a[s]}return r=_n(e,t,n)}(t,r,X),W={},H=0;H<X.length;H++)W[X[H]]=[];for(var G=0;G<u.length;G++){var U=Y[c[u[G].id()]];null!=U&&W[U].push(u[G])}for(var K=new Array(X.length),Z=0;Z<X.length;Z++)K[Z]=s.collection(W[X[Z]]);return K},An={affinityPropagation:kn,ap:kn},Tn=ye({root:void 0,directed:!1}),Pn=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function s(u,l,c){u===c&&(r+=1),t[l]={id:n,low:n++,cutVertex:!1};var h,d,p,f,g=e.getElementById(l).connectedEdges().intersection(e);0===g.size()?i.push(e.spawn(e.getElementById(l))):g.forEach((function(n){h=n.source().id(),d=n.target().id(),(p=h===l?d:h)!==c&&(f=n.id(),o[f]||(o[f]=!0,a.push({x:l,y:p,edge:n})),p in t?t[l].low=Math.min(t[l].low,t[p].id):(s(u,p,l),t[l].low=Math.min(t[l].low,t[p].low),t[l].id<=t[p].low&&(t[l].cutVertex=!0,function(n,r){for(var o=a.length-1,s=[],u=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach((function(n){var r=n.connectedNodes().intersection(e);u.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(e);u.merge(n),t[r].cutVertex?u.merge(i.filter((function(e){return e.isLoop()}))):u.merge(i)}))})),i.push(u)}(l,p))))}))};e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}}));var u=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(u),components:i}},Mn=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e);return e.forEach((function(o){if(o.isNode()){var s=o.id();s in t||function o(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var u=e.spawn();;){var l=i.pop();if(u.merge(e.getElementById(l)),t[l].low=t[s].index,t[l].explored=!0,l===s)break}var c=u.edgesWith(u),h=u.merge(c);r.push(h),a=a.difference(h)}}(s)}})),{cut:a,components:r}},Dn={};[Ae,Pe,Me,Ie,Be,Le,Ve,Pt,Dt,Ot,Nt,Wt,gn,wn,An,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,a=Tn(e),o=a.root,s=a.directed,u=this,l=!1;o&&(i=b(o)?this.filter(o)[0].id():o[0].id());var c={},h={};s?u.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),a=e.outdegree(!0),o=i-a,s=a-i;1==o?n?l=!0:n=t:1==s?r?l=!0:r=t:(s>1||o>1)&&(l=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else h[t]=[void 0,e.target().id()]})):u.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?l=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):h[t]=[e.source().id(),e.target().id()]}));var d={found:!1,trail:void 0};if(l)return d;if(r&&n)if(s){if(i&&r!=i)return d;i=r}else{if(i&&r!=i&&n!=i)return d;i||(i=r)}else i||(i=u[0].id());var p=function(e){for(var t,n,r,i=e,a=[e];c[i].length;)t=c[i].shift(),n=h[t][0],i!=(r=h[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),a.unshift(t),a.unshift(i);return a},f=[],g=[];for(g=p(i);1!=g.length;)0==c[g[0]].length?(f.unshift(u.getElementById(g.shift())),f.unshift(u.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var v in f.unshift(u.getElementById(g.shift())),c)if(c[v].length)return d;return d.found=!0,d.trail=this.spawn(f,!0),d}},{hopcroftTarjanBiconnected:Pn,htbc:Pn,htb:Pn,hopcroftTarjanBiconnectedComponents:Pn},{tarjanStronglyConnected:Mn,tsc:Mn,tscc:Mn,tarjanStronglyConnectedComponents:Mn}].forEach((function(e){z(Dn,e)}));var In=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};In.prototype={fulfill:function(e){return On(this,1,"fulfillValue",e)},reject:function(e){return On(this,2,"rejectReason",e)},then:function(e,t){var n=new In;return this.onFulfilled.push(Ln(e,n,"fulfill")),this.onRejected.push(Ln(t,n,"reject")),Bn(this),n.proxy}};var On=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,Bn(e)),e},Bn=function(e){1===e.state?Nn(e,"onFulfilled",e.fulfillValue):2===e.state&&Nn(e,"onRejected",e.rejectReason)},Nn=function(e,n,r){if(0!==e[n].length){var i=e[n];e[n]=[];var a=function(){for(var e=0;e<i.length;e++)i[e](r)};"function"==typeof t?t(a):setTimeout(a,0)}},Ln=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var i;try{i=e(r)}catch(e){return void t.reject(e)}Rn(t,i)}}},Rn=function e(t,n){if(t!==n&&t.proxy!==n){var r;if("object"===o(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(e){return void t.reject(e)}if("function"!=typeof r)t.fulfill(n);else{var i=!1;try{r.call(n,(function(r){i||(i=!0,r===n?t.reject(new TypeError("circular thenable chain")):e(t,r))}),(function(e){i||(i=!0,t.reject(e))}))}catch(e){i||t.reject(e)}}}else t.reject(new TypeError("cannot resolve promise with itself"))};In.all=function(e){return new In((function(t,n){for(var r=new Array(e.length),i=0,a=function(n,a){r[n]=a,++i===e.length&&t(r)},o=0;o<e.length;o++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then((function(e){a(t,e)}),(function(e){n(e)})):a(t,r)}(o)}))},In.resolve=function(e){return new In((function(t,n){t(e)}))},In.reject=function(e){return new In((function(t,n){n(e)}))};var jn="undefined"!=typeof Promise?Promise:In,zn=function(e,t,n){var r=T(e),i=!r,a=this._private=z({duration:1e3},t,n);if(a.target=e,a.style=a.style||a.css,a.started=!1,a.playing=!1,a.hooked=!1,a.applying=!1,a.progress=0,a.completes=[],a.frames=[],a.complete&&x(a.complete)&&a.completes.push(a.complete),i){var o=e.position();a.startPosition=a.startPosition||{x:o.x,y:o.y},a.startStyle=a.startStyle||e.cy().style().getAnimationStartStyle(e,a.style)}if(r){var s=e.pan();a.startPan={x:s.x,y:s.y},a.startZoom=e.zoom()}this.length=1,this[0]=this},Vn=zn.prototype;z(Vn,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),_(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],a=i.name,o=e.startStyle[a];e.startStyle[a]=i,e.style[r]=o}return t&&this.play(),this},promise:function(e){var t,n=this._private;switch(e){case"frame":t=n.frames;break;default:case"complete":case"completed":t=n.completes}return new jn((function(e,n){t.push((function(){e()}))}))}}),Vn.complete=Vn.completed,Vn.run=Vn.play,Vn.running=Vn.playing;var Fn={};[{animated:function(){return function(){var e=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return!1;var t=e[0];return t?t._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var e=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return this;for(var t=0;t<e.length;t++){e[t]._private.animation.queue=[]}return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=void 0!==this.length,r=n?this:[this],i=this._private.cy||this,a=!n,o=!a;if(!i.styleEnabled())return this;var s=i.style();if(e=z({},e,t),0===Object.keys(e).length)return new zn(r[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(o&&(e.style=s.getPropsList(e.style||e.css),e.css=void 0),o&&null!=e.renderedPosition){var u=e.renderedPosition,l=i.pan(),c=i.zoom();e.position=qe(u,c,l)}if(a&&null!=e.panBy){var h=e.panBy,d=i.pan();e.pan={x:d.x+h.x,y:d.y+h.y}}var p=e.center||e.centre;if(a&&null!=p){var f=i.getCenterPan(p.eles,e.zoom);null!=f&&(e.pan=f)}if(a&&null!=e.fit){var g=e.fit,v=i.getFitViewport(g.eles||g.boundingBox,g.padding);null!=v&&(e.pan=v.pan,e.zoom=v.zoom)}if(a&&E(e.zoom)){var y=i.getZoomedViewport(e.zoom);null!=y?(y.zoomed&&(e.zoom=y.zoom),y.panned&&(e.pan=y.pan)):e.zoom=null}return new zn(r[0],e)}},animate:function(){return function(e,t){var n=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=z({},e,t));for(var r=0;r<n.length;r++){var i=n[r],a=i.animated()&&(void 0===e.queue||e.queue);i.animation(e,a?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=void 0!==this.length?this:[this],r=this._private.cy||this;if(!r.styleEnabled())return this;for(var i=0;i<n.length;i++){for(var a=n[i]._private,o=a.animation.current,s=0;s<o.length;s++){var u=o[s]._private;t&&(u.duration=0)}e&&(a.animation.queue=[]),t||(a.animation.current=[])}return r.notify("draw"),this}}},{data:function(e){return e=z({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=void 0!==this.length,a=i?this:[this],o=i?this[0]:this;if(b(t)){var s;if(r.allowGetting&&void 0===n)return o&&(r.beforeGet(o),s=o._private[r.field][t]),s;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var u=c({},t,n);r.beforeSet(this,u);for(var l=0,h=a.length;l<h;l++){var d=a[l];r.canSet(d)&&(d._private[r.field][t]=n)}r.updateStyle&&this.updateStyle(),r.onSet(this),r.settingTriggersEvent&&this[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&E(t)){var p,f,g=t,v=Object.keys(g);r.beforeSet(this,g);for(var y=0;y<v.length;y++){if(f=g[p=v[y]],!r.immutableKeys[p])for(var m=0;m<a.length;m++){var w=a[m];r.canSet(w)&&(w._private[r.field][p]=f)}}r.updateStyle&&this.updateStyle(),r.onSet(this),r.settingTriggersEvent&&this[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&x(t)){var C=t;this.on(r.bindingEvent,C)}else if(r.allowGetting&&void 0===t){var S;return o&&(r.beforeGet(o),S=o._private[r.field]),S}return this}},removeData:function(e){return e=z({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=void 0!==this.length?this:[this];if(b(t)){for(var i=t.split(/\s+/),a=i.length,o=0;o<a;o++){var s=i[o];if(!M(s))if(!n.immutableKeys[s])for(var u=0,l=r.length;u<l;u++)r[u]._private[n.field][s]=void 0}n.triggerEvent&&this[n.triggerFnName](n.event)}else if(void 0===t){for(var c=0,h=r.length;c<h;c++)for(var d=r[c]._private[n.field],p=Object.keys(d),f=0;f<p.length;f++){var g=p[f];!n.immutableKeys[g]&&(d[g]=void 0)}n.triggerEvent&&this[n.triggerFnName](n.event)}return this}}},{eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new jn((function(e,t){var i=r.concat([function(t){n.off.apply(n,a),e(t)}]),a=i.concat([]);n.on.apply(n,i)}))}}}].forEach((function(e){z(Fn,e)}));var qn={animate:Fn.animate(),animation:Fn.animation(),animated:Fn.animated(),clearQueue:Fn.clearQueue(),delay:Fn.delay(),delayAnimation:Fn.delayAnimation(),stop:Fn.stop()},Xn={classes:function(e){if(void 0===e){var t=[];return this[0]._private.classes.forEach((function(e){return t.push(e)})),t}w(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],r=new Se(e),i=0;i<this.length;i++){for(var a=this[i],o=a._private,s=o.classes,u=!1,l=0;l<e.length;l++){var c=e[l];if(!s.has(c)){u=!0;break}}u||(u=s.size!==e.length),u&&(o.classes=r,n.push(a))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),this},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=void 0===t,r=[],i=0,a=this.length;i<a;i++)for(var o=this[i],s=o._private.classes,u=!1,l=0;l<e.length;l++){var c=e[l],h=s.has(c),d=!1;t||n&&!h?(s.add(c),d=!0):(!t||n&&h)&&(s.delete(c),d=!0),!u&&d&&(r.push(o),u=!0)}return r.length>0&&this.spawn(r).updateStyle().emit("class"),this},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Xn.className=Xn.classNames=Xn.classes;var Yn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:R,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Yn.variable="(?:[\\w-]|(?:\\\\"+Yn.metaChar+"))+",Yn.value=Yn.string+"|"+Yn.number,Yn.className=Yn.variable,Yn.id=Yn.variable,function(){var e,t,n;for(e=Yn.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],Yn.comparatorOp+="|@"+t;for(e=Yn.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&(Yn.comparatorOp+="|\\!"+t)}();var Wn=0,Hn=1,Gn=2,Un=3,Kn=4,Zn=5,$n=6,Qn=7,Jn=8,er=9,tr=10,nr=11,rr=12,ir=13,ar=14,or=15,sr=16,ur=17,lr=18,cr=19,hr=20,dr=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*j(e,t)}(e.selector,t.selector)})),pr=function(){for(var e,t={},n=0;n<dr.length;n++)t[(e=dr[n]).selector]=e.matches;return t}(),fr="("+dr.map((function(e){return e.selector})).join("|")+")",gr=function(e){return e.replace(new RegExp("\\\\("+Yn.metaChar+")","g"),(function(e,t){return t}))},vr=function(e,t,n){e[e.length-1]=n},yr=[{name:"group",query:!0,regex:"("+Yn.group+")",populate:function(e,t,n){var r=h(n,1)[0];t.checks.push({type:Wn,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:fr,populate:function(e,t,n){var r=h(n,1)[0];t.checks.push({type:Qn,value:r})}},{name:"id",query:!0,regex:"\\#("+Yn.id+")",populate:function(e,t,n){var r=h(n,1)[0];t.checks.push({type:Jn,value:gr(r)})}},{name:"className",query:!0,regex:"\\.("+Yn.className+")",populate:function(e,t,n){var r=h(n,1)[0];t.checks.push({type:er,value:gr(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Yn.variable+")\\s*\\]",populate:function(e,t,n){var r=h(n,1)[0];t.checks.push({type:Kn,field:gr(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Yn.variable+")\\s*("+Yn.comparatorOp+")\\s*("+Yn.value+")\\s*\\]",populate:function(e,t,n){var r=h(n,3),i=r[0],a=r[1],o=r[2];o=null!=new RegExp("^"+Yn.string+"$").exec(o)?o.substring(1,o.length-1):parseFloat(o),t.checks.push({type:Un,field:gr(i),operator:a,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Yn.boolOp+")\\s*("+Yn.variable+")\\s*\\]",populate:function(e,t,n){var r=h(n,2),i=r[0],a=r[1];t.checks.push({type:Zn,field:gr(a),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Yn.meta+")\\s*("+Yn.comparatorOp+")\\s*("+Yn.number+")\\s*\\]\\]",populate:function(e,t,n){var r=h(n,3),i=r[0],a=r[1],o=r[2];t.checks.push({type:$n,field:gr(i),operator:a,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Yn.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,a=e[e.length-1];return null!=n&&(a.subject=n,e.currentSubject=null),a.edgeCount=r,a.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:Yn.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:nr,source:r,target:i}),vr(e,0,n),e.edgeCount++,i}var a={checks:[]},o=t,s={checks:[]};return a.checks.push({type:rr,source:o,target:s}),vr(e,0,a),e.edgeCount++,s}},{name:"undirectedEdge",separator:!0,regex:Yn.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r=t,i={checks:[]};return n.checks.push({type:tr,nodes:[r,i]}),vr(e,0,n),e.edgeCount++,i}var a={checks:[]},o=t,s={checks:[]};return a.checks.push({type:ar,node:o,neighbor:s}),vr(e,0,a),s}},{name:"child",separator:!0,regex:Yn.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:or,parent:i,child:r}),vr(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var a={checks:[]},o=e[e.length-1],s={checks:[]},u={checks:[]},l={checks:[]},c={checks:[]};return a.checks.push({type:cr,left:o,right:s,subject:u}),u.checks=t.checks,t.checks=[{type:hr}],c.checks.push({type:hr}),s.checks.push({type:ur,parent:c,child:l}),vr(e,0,a),e.currentSubject=u,e.compoundCount++,l}var h={checks:[]},d={checks:[]},p=[{type:ur,parent:h,child:d}];return h.checks=t.checks,t.checks=p,e.compoundCount++,d}},{name:"descendant",separator:!0,regex:Yn.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]},i=e[e.length-1];return n.checks.push({type:sr,ancestor:i,descendant:r}),vr(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var a={checks:[]},o=e[e.length-1],s={checks:[]},u={checks:[]},l={checks:[]},c={checks:[]};return a.checks.push({type:cr,left:o,right:s,subject:u}),u.checks=t.checks,t.checks=[{type:hr}],c.checks.push({type:hr}),s.checks.push({type:lr,ancestor:c,descendant:l}),vr(e,0,a),e.currentSubject=u,e.compoundCount++,l}var h={checks:[]},d={checks:[]},p=[{type:lr,ancestor:h,descendant:d}];return h.checks=t.checks,t.checks=p,e.compoundCount++,d}},{name:"subject",modifier:!0,regex:Yn.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return de(e.toString()),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;r===nr?n.type=ir:r===tr&&(n.type=ar,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];yr.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var mr=function(e){for(var t,n,r,i=0;i<yr.length;i++){var a=yr[i],o=a.name,s=e.match(a.regexObj);if(null!=s){n=s,t=a,r=o;var u=s[0];e=e.substring(u.length);break}}return{expr:t,match:n,name:r,remaining:e}},br={parse:function(e){var t=this.inputText=e,n=this[0]={checks:[]};for(this.length=1,t=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e}(t);;){var r=mr(t);if(null==r.expr)return de(),!1;var i=r.match.slice(1),a=r.expr.populate(this,n,i);if(!1===a)return!1;if(null!=a&&(n=a),(t=r.remaining).match(/^\s*$/))break}var o=this[this.length-1];null!=this.currentSubject&&(o.subject=this.currentSubject),o.edgeCount=this.edgeCount,o.compoundCount=this.compoundCount;for(var s=0;s<this.length;s++){var u=this[s];if(u.compoundCount>0&&u.edgeCount>0)return de(),!1;if(u.edgeCount>1)return de(),!1;1===u.edgeCount&&de()}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,a){var o=r.type,s=r.value;switch(o){case Wn:var u=e(s);return u.substring(0,u.length-1);case Un:var l=r.field,c=r.operator;return"["+l+n(e(c))+t(s)+"]";case Zn:var h=r.operator,d=r.field;return"["+e(h)+d+"]";case Kn:return"["+r.field+"]";case $n:var p=r.operator;return"[["+r.field+n(e(p))+t(s)+"]]";case Qn:return s;case Jn:return"#"+s;case er:return"."+s;case ur:case or:return i(r.parent,a)+n(">")+i(r.child,a);case lr:case sr:return i(r.ancestor,a)+" "+i(r.descendant,a);case cr:var f=i(r.left,a),g=i(r.subject,a),v=i(r.right,a);return f+(f.length>0?" ":"")+g+v;case hr:return""}},i=function(e,t){return e.checks.reduce((function(n,i,a){return n+(t===e&&0===a?"$":"")+r(i,t)}),"")},a="",o=0;o<this.length;o++){var s=this[o];a+=i(s,s.subject),this.length>1&&o<this.length-1&&(a+=", ")}return this.toStringCache=a,a}},xr=function(e,t,n){var r,i,a,o=b(e),s=C(e),u=b(n),l=!1,c=!1,h=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),l=!0),(o||u||l)&&(i=o||s?""+e:"",a=""+n),l&&(e=i=i.toLowerCase(),n=a=a.toLowerCase()),t){case"*=":r=i.indexOf(a)>=0;break;case"$=":r=i.indexOf(a,i.length-a.length)>=0;break;case"^=":r=0===i.indexOf(a);break;case"=":r=e===n;break;case">":h=!0,r=e>n;break;case">=":h=!0,r=e>=n;break;case"<":h=!0,r=e<n;break;case"<=":h=!0,r=e<=n;break;default:r=!1}return!c||null==e&&h||(r=!r),r},wr=function(e,t){return e.data(t)},Er=[],Cr=function(e,t){return e.checks.every((function(e){return Er[e.type](e,t)}))};Er[Wn]=function(e,t){var n=e.value;return"*"===n||n===t.group()},Er[Qn]=function(e,t){return function(e,t){return pr[e](t)}(e.value,t)},Er[Jn]=function(e,t){var n=e.value;return t.id()===n},Er[er]=function(e,t){var n=e.value;return t.hasClass(n)},Er[$n]=function(e,t){var n=e.field,r=e.operator,i=e.value;return xr(function(e,t){return e[t]()}(t,n),r,i)},Er[Un]=function(e,t){var n=e.field,r=e.operator,i=e.value;return xr(wr(t,n),r,i)},Er[Zn]=function(e,t){var n=e.field,r=e.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(wr(t,n),r)},Er[Kn]=function(e,t){var n=e.field;e.operator;return void 0!==wr(t,n)},Er[tr]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),a=t.target();return Cr(n,i)&&Cr(r,a)||Cr(r,i)&&Cr(n,a)},Er[ar]=function(e,t){return Cr(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&Cr(e.neighbor,t)}))},Er[nr]=function(e,t){return Cr(e.source,t.source())&&Cr(e.target,t.target())},Er[rr]=function(e,t){return Cr(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&Cr(e.target,t)}))},Er[ir]=function(e,t){return Cr(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&Cr(e.source,t)}))},Er[or]=function(e,t){return Cr(e.child,t)&&Cr(e.parent,t.parent())},Er[ur]=function(e,t){return Cr(e.parent,t)&&t.children().some((function(t){return Cr(e.child,t)}))},Er[sr]=function(e,t){return Cr(e.descendant,t)&&t.ancestors().some((function(t){return Cr(e.ancestor,t)}))},Er[lr]=function(e,t){return Cr(e.ancestor,t)&&t.descendants().some((function(t){return Cr(e.descendant,t)}))},Er[cr]=function(e,t){return Cr(e.subject,t)&&Cr(e.left,t)&&Cr(e.right,t)},Er[hr]=function(){return!0},Er[Hn]=function(e,t){return e.value.has(t)},Er[Gn]=function(e,t){return(0,e.value)(t)};var Sr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||b(e)&&e.match(/^\s*$/)||(_(e)?this.addQuery({checks:[{type:Hn,value:e.collection()}]}):x(e)?this.addQuery({checks:[{type:Gn,value:e}]}):b(e)?this.parse(e)||(this.invalid=!0):ce("A selector must be created from a string; found "))},_r=Sr.prototype;[br,{matches:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(Cr(n,e))return!0}return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&t[0].checks[0].type===Jn)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if(Cr(r,e))return!0}return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}}].forEach((function(e){return z(_r,e)})),_r.text=function(){return this.inputText},_r.size=function(){return this.length},_r.eq=function(e){return this[e]},_r.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},_r.addQuery=function(e){this[this.length++]=e},_r.selector=_r.toString;var kr={allAre:function(e){var t=new Sr(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new Sr(e);return this.some((function(e){return t.matches(e)}))},some:function(e,t){for(var n=0;n<this.length;n++){if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every((function(t){return e.hasElementWithId(t.id())})))},anySame:function(e){return e=this.cy().collection(e),this.some((function(t){return e.hasElementWithId(t.id())}))},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every((function(e){return t.hasElementWithId(e.id())}))},contains:function(e){e=this.cy().collection(e);var t=this;return e.every((function(e){return t.hasElementWithId(e.id())}))}};kr.allAreNeighbours=kr.allAreNeighbors,kr.has=kr.contains,kr.equal=kr.equals=kr.same;var Ar,Tr,Pr=function(e,t){return function(n,r,i,a){var o,s=n;if(null==s?o="":_(s)&&1===s.length&&(o=s.id()),1===this.length&&o){var u=this[0]._private,l=u.traversalCache=u.traversalCache||{},c=l[t]=l[t]||[],h=te(o),d=c[h];return d||(c[h]=e.call(this,n,r,i,a))}return e.call(this,n,r,i,a)}},Mr={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter((function(e){return e.isOrphan()})).filter(e)},nonorphans:function(e){return this.stdFilter((function(e){return e.isChild()})).filter(e)},children:Pr((function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)}),"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function e(n){for(var r=0;r<n.length;r++){var i=n[r];t.push(i),i.children().nonempty()&&e(i.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function Dr(e,t,n,r){for(var i=[],a=new Se,o=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var u=e[s];n?i.push(u):o&&r(i,a,u)}for(;i.length>0;){var l=i.shift();t(l),a.add(l.id()),o&&r(i,a,l)}return e}function Ir(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var a=r[i];t.has(a.id())||e.push(a)}}function Or(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function Br(e,t,n){Or(e,t,n),Ir(e,t,n)}Mr.forEachDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Dr(this,e,t,Ir)},Mr.forEachUp=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Dr(this,e,t,Or)},Mr.forEachUpAndDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Dr(this,e,t,Br)},Mr.ancestors=Mr.parents,(Ar=Tr={data:Fn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Fn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Fn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Fn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Fn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Fn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Ar.data,Ar.removeAttr=Ar.removeData;var Nr,Lr,Rr=Tr,jr={};function zr(e){return function(t){if(void 0===t&&(t=!0),0!==this.length&&this.isNode()&&!this.removed()){for(var n=0,r=this[0],i=r._private.edges,a=0;a<i.length;a++){var o=i[a];!t&&o.isLoop()||(n+=e(r,o))}return n}}}function Vr(e,t){return function(n){for(var r,i=this.nodes(),a=0;a<i.length;a++){var o=i[a][e](n);void 0===o||void 0!==r&&!t(o,r)||(r=o)}return r}}z(jr,{degree:zr((function(e,t){return t.source().same(t.target())?2:1})),indegree:zr((function(e,t){return t.target().same(e)?1:0})),outdegree:zr((function(e,t){return t.source().same(e)?1:0}))}),z(jr,{minDegree:Vr("degree",(function(e,t){return e<t})),maxDegree:Vr("degree",(function(e,t){return e>t})),minIndegree:Vr("indegree",(function(e,t){return e<t})),maxIndegree:Vr("indegree",(function(e,t){return e>t})),minOutdegree:Vr("outdegree",(function(e,t){return e<t})),maxOutdegree:Vr("outdegree",(function(e,t){return e>t}))}),z(jr,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var Fr=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var a=i._private.position,o={x:null!=t.x?t.x-a.x:0,y:null!=t.y?t.y-a.y:0};!i.isParent()||0===o.x&&0===o.y||i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},qr={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){Fr(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};(Nr=Lr={position:Fn.data(qr),silentPosition:Fn.data(z({},qr,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){Fr(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(E(e))t?this.silentPosition(e):this.position(e);else if(x(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var a,o=this[i];(a=n(o,i))&&(t?o.silentPosition(a):o.position(a))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(E(e)?(r={x:C(e.x)?e.x:0,y:C(e.y)?e.y:0},n=t):b(e)&&C(t)&&((r={x:0,y:0})[e]=t),null!=r){var i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var o=this[a],s=o.position(),u={x:s.x+r.x,y:s.y+r.y};n?o.silentPosition(u):o.position(u)}i.endBatch()}return this},silentShift:function(e,t){return E(e)?this.shift(e,!0):b(e)&&C(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),a=r.pan(),o=E(e)?e:void 0,s=void 0!==o||void 0!==t&&b(e);if(n&&n.isNode()){if(!s){var u=n.position();return o=Fe(u,i,a),void 0===e?o:o[e]}for(var l=0;l<this.length;l++){var c=this[l];void 0!==t?c.position(e,(t-a[e])/i):void 0!==o&&c.position(qe(o,i,a))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=E(e)?e:void 0,a=void 0!==i||void 0!==t&&b(e),o=r.hasCompoundNodes();if(n&&n.isNode()){if(!a){var s=n.position(),u=o?n.parent():null,l=u&&u.length>0,c=l;l&&(u=u[0]);var h=c?u.position():{x:0,y:0};return i={x:s.x-h.x,y:s.y-h.y},void 0===e?i:i[e]}for(var d=0;d<this.length;d++){var p=this[d],f=o?p.parent():null,g=f&&f.length>0,v=g;g&&(f=f[0]);var y=v?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!a)return;return this}}).modelPosition=Nr.point=Nr.position,Nr.modelPositions=Nr.points=Nr.positions,Nr.renderedPoint=Nr.renderedPosition,Nr.relativePoint=Nr.relativePosition;var Xr,Yr,Wr=Lr;Xr=Yr={},Yr.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,u=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:u,w:o-a,h:u-s}},Yr.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},Yr.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={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")}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=t.position;0!==a.w&&0!==a.h||((a={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var u=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(u=100*u/i.width.val);var l=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(l=100*l/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var h=y(i.width.val-a.w,s,u),d=h.biasDiff,p=h.biasComplementDiff,f=y(i.height.val-a.h,l,c),g=f.biasDiff,v=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(a.w,a.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-d+a.x1+a.x2+p)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-g+a.y1+a.y2+v)/2}function y(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;r<this.length;r++){var i=this[r],a=i._private;a.compoundBoundsClean&&!e||(n(i),t.batching()||(a.compoundBoundsClean=!0))}return this};var Hr=function(e){return e===1/0||e===-1/0?0:e},Gr=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Ur=function(e,t){return null==t?e:Gr(e,t.x1,t.y1,t.x2,t.y2)},Kr=function(e,t,n){return xe(e,t,n)},Zr=function(e,t,n){if(!t.cy().headless()){var r,i,a=t._private,o=a.rstyle,s=o.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=o.srcX,i=o.srcY):"target"===n?(r=o.tgtX,i=o.tgtY):(r=o.midX,i=o.midY);var u=a.arrowBounds=a.arrowBounds||{},l=u[n]=u[n]||{};l.x1=r-s,l.y1=i-s,l.x2=r+s,l.y2=i+s,l.w=l.x2-l.x1,l.h=l.y2-l.y1,tt(l,1),Gr(e,l.x1,l.y1,l.x2,l.y2)}}},$r=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,a=i.rstyle;if(t.pstyle(r+"label").strValue){var o,s,u,l,c=t.pstyle("text-halign"),h=t.pstyle("text-valign"),d=Kr(a,"labelWidth",n),p=Kr(a,"labelHeight",n),f=Kr(a,"labelX",n),g=Kr(a,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,C=p,S=d,_=S/2,k=C/2;if(m)o=f-_,s=f+_,u=g-k,l=g+k;else{switch(c.value){case"left":o=f-S,s=f;break;case"center":o=f-_,s=f+_;break;case"right":o=f,s=f+S}switch(h.value){case"top":u=g-C,l=g;break;case"center":u=g-k,l=g+k;break;case"bottom":u=g,l=g+C}}o+=v-Math.max(x,w)-E-2,s+=v+Math.max(x,w)+E+2,u+=y-Math.max(x,w)-E-2,l+=y+Math.max(x,w)+E+2;var A=n||"main",T=i.labelBounds,P=T[A]=T[A]||{};P.x1=o,P.y1=u,P.x2=s,P.y2=l,P.w=s-o,P.h=l-u;var M=m&&"autorotate"===b.strValue,D=null!=b.pfValue&&0!==b.pfValue;if(M||D){var I=M?Kr(i.rstyle,"labelAngle",n):b.pfValue,O=Math.cos(I),B=Math.sin(I),N=(o+s)/2,L=(u+l)/2;if(!m){switch(c.value){case"left":N=s;break;case"right":N=o}switch(h.value){case"top":L=l;break;case"bottom":L=u}}var R=function(e,t){return{x:(e-=N)*O-(t-=L)*B+N,y:e*B+t*O+L}},j=R(o,u),z=R(o,l),V=R(s,u),F=R(s,l);o=Math.min(j.x,z.x,V.x,F.x),s=Math.max(j.x,z.x,V.x,F.x),u=Math.min(j.y,z.y,V.y,F.y),l=Math.max(j.y,z.y,V.y,F.y)}var q=A+"Rot",X=T[q]=T[q]||{};X.x1=o,X.y1=u,X.x2=s,X.y2=l,X.w=s-o,X.h=l-u,Gr(e,o,u,s,l),Gr(i.labelBounds.all,o,u,s,l)}return e}},Qr=function(e){var t=0,n=function(e){return(e?1:0)<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays)},Jr=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Z({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)}([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},ei=function(e,t){var n,r=e._private,i=e.isEdge(),a=(null==t?ni:Qr(t))===ni,o=Jr(e),s=r.bbCachePosKey===o,u=t.useCache&&s,l=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!u||l(e)||i&&l(e.source())||l(e.target())?(s||e.recalculateRenderedStyle(u),n=function(e,t){var n,r,i,a,o,s,u,l=e._private.cy,c=l.styleEnabled(),h=l.headless(),d=Je(),p=e._private,f=e.isNode(),g=e.isEdge(),v=p.rstyle,y=f&&c?e.pstyle("bounds-expansion").pfValue:[0],m=function(e){return"none"!==e.pstyle("display").value},b=!c||m(e)&&(!g||m(e.source())&&m(e.target()));if(b){var x=0;c&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;if(c&&(w=e.pstyle("width").pfValue/2),f&&t.includeNodes){var E=e.position();o=E.x,s=E.y;var C=e.outerWidth()/2,S=e.outerHeight()/2;Gr(d,n=o-C,i=s-S,r=o+C,a=s+S)}else if(g&&t.includeEdges)if(c&&!h){var _=e.pstyle("curve-style").strValue;if(n=Math.min(v.srcX,v.midX,v.tgtX),r=Math.max(v.srcX,v.midX,v.tgtX),i=Math.min(v.srcY,v.midY,v.tgtY),a=Math.max(v.srcY,v.midY,v.tgtY),Gr(d,n-=w,i-=w,r+=w,a+=w),"haystack"===_){var k=v.haystackPts;if(k&&2===k.length){if(n=k[0].x,i=k[0].y,n>(r=k[1].x)){var A=n;n=r,r=A}if(i>(a=k[1].y)){var T=i;i=a,a=T}Gr(d,n-w,i-w,r+w,a+w)}}else if("bezier"===_||"unbundled-bezier"===_||"segments"===_||"taxi"===_){var P;switch(_){case"bezier":case"unbundled-bezier":P=v.bezierPts;break;case"segments":case"taxi":P=v.linePts}if(null!=P)for(var M=0;M<P.length;M++){var D=P[M];n=D.x-w,r=D.x+w,i=D.y-w,a=D.y+w,Gr(d,n,i,r,a)}}}else{var I=e.source().position(),O=e.target().position();if((n=I.x)>(r=O.x)){var B=n;n=r,r=B}if((i=I.y)>(a=O.y)){var N=i;i=a,a=N}Gr(d,n-=w,i-=w,r+=w,a+=w)}if(c&&t.includeEdges&&g&&(Zr(d,e,"mid-source"),Zr(d,e,"mid-target"),Zr(d,e,"source"),Zr(d,e,"target")),c)if("yes"===e.pstyle("ghost").value){var L=e.pstyle("ghost-offset-x").pfValue,R=e.pstyle("ghost-offset-y").pfValue;Gr(d,d.x1+L,d.y1+R,d.x2+L,d.y2+R)}var j=p.bodyBounds=p.bodyBounds||{};rt(j,d),nt(j,y),tt(j,1),c&&(n=d.x1,r=d.x2,i=d.y1,a=d.y2,Gr(d,n-x,i-x,r+x,a+x));var z=p.overlayBounds=p.overlayBounds||{};rt(z,d),nt(z,y),tt(z,1);var V=p.labelBounds=p.labelBounds||{};null!=V.all?((u=V.all).x1=1/0,u.y1=1/0,u.x2=-1/0,u.y2=-1/0,u.w=0,u.h=0):V.all=Je(),c&&t.includeLabels&&(t.includeMainLabels&&$r(d,e,null),g&&(t.includeSourceLabels&&$r(d,e,"source"),t.includeTargetLabels&&$r(d,e,"target")))}return d.x1=Hr(d.x1),d.y1=Hr(d.y1),d.x2=Hr(d.x2),d.y2=Hr(d.y2),d.w=Hr(d.x2-d.x1),d.h=Hr(d.y2-d.y1),d.w>0&&d.h>0&&b&&(nt(d,y),tt(d,1)),d}(e,ti),r.bbCache=n,r.bbCachePosKey=o):n=r.bbCache,!a){var c=e.isNode();n=Je(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?Ur(n,r.overlayBounds):Ur(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?Ur(n,r.labelBounds.all):(t.includeMainLabels&&Ur(n,r.labelBounds.mainRot),t.includeSourceLabels&&Ur(n,r.labelBounds.sourceRot),t.includeTargetLabels&&Ur(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},ti={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,useCache:!0},ni=Qr(ti),ri=ye(ti);Yr.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=Je();var n=ri(e=e||ti);if(this.cy().styleEnabled())for(var r=0;r<this.length;r++){var i=this[r],a=i._private,o=Jr(i),s=a.bbCachePosKey===o,u=n.useCache&&s&&!a.styleDirty;i.recalculateRenderedStyle(u)}this.updateCompoundBounds(!e.useCache);for(var l=0;l<this.length;l++){var c=this[l];Ur(t,ei(c,n))}}else e=void 0===e?ti:ri(e),t=ei(this[0],e);return t.x1=Hr(t.x1),t.y1=Hr(t.y1),t.x2=Hr(t.x2),t.y2=Hr(t.y2),t.w=Hr(t.x2-t.x1),t.h=Hr(t.y2-t.y1),t},Yr.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}return this.emitAndNotify("bounds"),this},Yr.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter((function(e){return e.isParent()})),t=t.not(i)),E(e)){var a=e;e=function(){return a}}n.startBatch(),t.forEach((function(t,n){return t._private.bbAtOldPos=e(t,n)})).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var o=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return t.silentPositions((function(e){return e._private.bbAtOldPos})),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),o},Xr.boundingbox=Xr.bb=Xr.boundingBox,Xr.renderedBoundingbox=Xr.renderedBoundingBox;var ii,ai,oi=Yr;ii=ai={};var si=function(e){e.uppercaseName=L(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=L(e.outerName),ii[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(!r)return 1;if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);switch(i.strValue){case"label":return t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return i.pfValue}}},ii["outer"+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)return n?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},ii["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},ii["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};si({name:"width"}),si({name:"height"}),ai.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),void 0!==t.autoPadding?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},ai.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},ai.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var ui=ai,li={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},ci=Object.keys(li).reduce((function(e,t){var n=li[t],r=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(t);return e[t]=function(){return function(e,t){if(e.isEdge())return t(e)}(this,n.get)},n.mult?e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map((function(e){return Fe(e,i,r)}))}}(this,n.get)}:e[r]=function(){return function(e,t){if(e.isEdge()){var n=e.cy();return Fe(t(e),n.zoom(),n.pan())}}(this,n.get)},e}),{}),hi=z({},Wr,oi,ui,ci),di=function(e,t){this.recycle(e,t)};function pi(){return!1}function fi(){return!0}di.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=pi,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?fi:pi):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=fi;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=fi;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=fi,this.stopPropagation()},isDefaultPrevented:pi,isPropagationStopped:pi,isImmediatePropagationStopped:pi};var gi=/^([^.]+)(\.(?:[^.]+))?$/,vi={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},yi=Object.keys(vi),mi={};function bi(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mi,t=arguments.length>1?arguments[1]:void 0,n=0;n<yi.length;n++){var r=yi[n];this[r]=e[r]||vi[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var xi=bi.prototype,wi=function(e,t,n,r,i,a,o){x(r)&&(i=r,r=null),o&&(a=null==a?o:z({},a,o));for(var s=w(n)?n:n.split(/\s+/),u=0;u<s.length;u++){var l=s[u];if(!M(l)){var c=l.match(gi);if(c)if(!1===t(e,l,c[1],c[2]?c[2]:null,r,i,a))break}}},Ei=function(e,t){return e.addEventFields(e.context,t),new di(t.type,t)},Ci=function(e,t,n){if("event"!==m(n))if(E(n))t(e,Ei(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var a=r[i];if(!M(a)){var o=a.match(gi);if(o){var s=o[1],u=o[2]?o[2]:null;t(e,Ei(e,{type:s,namespace:u,target:e.context}))}}}else t(e,n)};xi.on=xi.addListener=function(e,t,n,r,i){return wi(this,(function(e,t,n,r,i,a,o){x(a)&&e.listeners.push({event:t,callback:a,type:n,namespace:r,qualifier:i,conf:o})}),e,t,n,r,i),this},xi.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},xi.removeListener=xi.off=function(e,t,n,r){var i=this;0!==this.emitting&&(this.listeners=this.listeners.slice());for(var a=this.listeners,o=function(o){var s=a[o];wi(i,(function(t,n,r,i,u,l){if((s.type===r||"*"===e)&&(!i&&".*"!==s.namespace||s.namespace===i)&&(!u||t.qualifierCompare(s.qualifier,u))&&(!l||s.callback===l))return a.splice(o,1),!1}),e,t,n,r)},s=a.length-1;s>=0;s--)o(s);return this},xi.removeAllListeners=function(){return this.removeListener("*")},xi.emit=xi.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),Ci(this,(function(e,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=function(n){var i=r[n];if(i.type===a.type&&(!i.namespace||i.namespace===a.namespace||".*"===i.namespace)&&e.eventMatches(e.context,i,a)){var o=[a];null!=t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}}(o,t),e.beforeEmit(e.context,i,a),i.conf&&i.conf.one&&(e.listeners=e.listeners.filter((function(e){return e!==i})));var s=e.callbackContext(e.context,i,a),u=i.callback.apply(s,o);e.afterEmit(e.context,i,a),!1===u&&(a.stopPropagation(),a.preventDefault())}},s=0;s<i;s++)o(s);e.bubble(e.context)&&!a.isPropagationStopped()&&e.parent(e.context).emit(a,t)}),e),this.emitting--,this};var Si={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&k(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},_i=function(e){return b(e)?new Sr(e):e},ki={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new bi(Si,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=_i(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n)}return this},removeListener:function(e,t,n){for(var r=_i(t),i=0;i<this.length;i++){this[i].emitter().removeListener(e,r,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){this[e].emitter().removeAllListeners()}return this},one:function(e,t,n){for(var r=_i(t),i=0;i<this.length;i++){this[i].emitter().one(e,r,n)}return this},once:function(e,t,n){for(var r=_i(t),i=0;i<this.length;i++){this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){this[n].emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};Fn.eventAliasesOn(ki);var Ai={nodes:function(e){return this.filter((function(e){return e.isNode()})).filter(e)},edges:function(e){return this.filter((function(e){return e.isEdge()})).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(b(e)||_(e))return new Sr(e).filter(this);if(x(e)){for(var n=this.spawn(),r=0;r<this.length;r++){var i=this[r];(t?e.apply(t,[i,r,this]):e(i,r,this))&&n.push(i)}return n}return this.spawn()},not:function(e){if(e){b(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(b(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=e,i=this.length<e.length,a=i?this:r,o=i?r:this,s=0;s<a.length;s++){var u=a[s];o.has(u)&&n.push(u)}return n},xor:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=e,i=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],a=i._private.data.id;t.hasElementWithId(a)||n.push(i)}};return i(this,r),i(r,this),n},diff:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),a=e,o=function(e,t,n){for(var r=0;r<e.length;r++){var a=e[r],o=a._private.data.id;t.hasElementWithId(o)?i.merge(a):n.push(a)}};return o(this,a,n),o(a,this,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var a=e[i],o=!this.has(a);o&&r.push(a)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&b(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,a=0;a<e.length;a++){var o=e[a],s=o._private.data.id;if(!i.has(s)){var u=this.length++;this[u]=o,i.set(s,{ele:o,index:u})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){e(this[t])&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=0;r<this.length;r++){var i=this[r],a=t?e.apply(t,[i,r,this]):e(i,r,this);n.push(a)}return n},reduce:function(e,t){for(var n=t,r=0;r<this.length;r++)n=e(n,this[r],r,this);return n},max:function(e,t){for(var n,r=-1/0,i=0;i<this.length;i++){var a=this[i],o=t?e.apply(t,[a,i,this]):e(a,i,this);o>r&&(r=o,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=0;i<this.length;i++){var a=this[i],o=t?e.apply(t,[a,i,this]):e(a,i,this);o<r&&(r=o,n=a)}return{value:r,ele:n}}},Ti=Ai;Ti.u=Ti["|"]=Ti["+"]=Ti.union=Ti.or=Ti.add,Ti["\\"]=Ti["!"]=Ti["-"]=Ti.difference=Ti.relativeComplement=Ti.subtract=Ti.not,Ti.n=Ti["&"]=Ti["."]=Ti.and=Ti.intersection=Ti.intersect,Ti["^"]=Ti["(+)"]=Ti["(-)"]=Ti.symmetricDifference=Ti.symdiff=Ti.xor,Ti.fnFilter=Ti.filterFn=Ti.stdFilter=Ti.filter,Ti.complement=Ti.abscomp=Ti.absoluteComplement;var Pi=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?ae:0}var i=r(e)-r(t);if(0!==i)return i;function a(e){return"auto"===e.pstyle("z-index-compare").value&&e.isNode()?1:0}var o=a(e)-a(t);if(0!==o)return o;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},Mi={forEach:function(e,t){if(x(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(t?e.apply(t,[i,r,this]):e(i,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!x(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(Pi)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:ae-1}var r=t.source,i=t.target,a=r.zDepth(),o=i.zDepth();return Math.max(a,o,0)}}};Mi.each=Mi.forEach;"undefined"!=("undefined"==typeof Symbol?"undefined":o(Symbol))&&"undefined"!=o(Symbol.iterator)&&(Mi[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return c({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var Di=ye({nodeDimensionsIncludeLabels:!1}),Ii={layoutDimensions:function(e){var t;if(e=Di(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return 0!==t.w&&0!==t.h||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter((function(e){return!e.isParent()})),i=this.cy(),a=t.eles,o=function(e){return e.id()},s=I(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=t.spacingFactor&&1!==t.spacingFactor,l=function(){if(!u)return null;for(var e=Je(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);et(e,i.x,i.y)}return e}(),c=I((function(e,n){var r=s(e,n);u&&(r=function(e,t,n){var r=t.x1+t.w/2,i=t.y1+t.h/2;return{x:r+(n.x-r)*e,y:i+(n.y-i)*e}}(Math.abs(t.spacingFactor),l,r));return null!=t.transform&&(r=t.transform(e,r)),r}),o);if(t.animate){for(var h=0;h<r.length;h++){var d=r[h],p=c(d,h);if(null==t.animateFilter||t.animateFilter(d,h)){var f=d.animation({position:p,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(f)}else d.position(p)}if(t.fit){var g=i.animation({fit:{boundingBox:a.boundingBoxAt(c),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}else if(void 0!==t.zoom&&void 0!==t.pan){var v=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),jn.all(e.animations.map((function(e){return e.promise()}))).then((function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})}))}else r.positions(c),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(z({},e,{eles:this}))}};function Oi(e,t,n){var r,i=n._private,a=i.styleCache=i.styleCache||[];return null!=(r=a[e])?r:r=a[e]=t(n)}function Bi(e,t){return e=te(e),function(n){return Oi(e,t,n)}}function Ni(e,t){e=te(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return Oi(e,n,t)}}Ii.createLayout=Ii.makeLayout=Ii.layout;var Li={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach((function(e){n(e),e.connectedEdges().forEach(n)}));return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return e?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(e){return e._private.styleDirty=!0})),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(E(e)){var i=e;r.applyBypass(this,i,!1),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var a=this[0];return a?r.getStylePropertyValue(a,e):void 0}r.applyBypass(this,e,t,!1),this.emitAndNotify("style")}else if(void 0===e){var o=this[0];return o?r.getRawStyle(o):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=t.style();if(void 0===e)for(var r=0;r<this.length;r++){var i=this[r];n.removeAllBypasses(i,!1)}else{e=e.split(/\s+/);for(var a=0;a<this.length;a++){var o=this[a];n.removeBypasses(o,e,!1)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!t)return i;var a=r.data.parent?n.parents():null;if(a)for(var o=0;o<a.length;o++){i*=a[o].pstyle("opacity").value}return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function Ri(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++){if(!t(n[r]))return!1}return!0}function ji(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],a=e.hasCompoundNodes();if(i){var o=i._private;if(!t(i))return!1;if(i.isNode())return!a||Ri(i,r);var s=o.source,u=o.target;return n(s)&&(!a||Ri(s,n))&&(s===u||n(u)&&(!a||Ri(u,n)))}}}var zi=Bi("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));Li.takesUpSpace=Ni("takesUpSpace",ji({ok:zi}));var Vi=Bi("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&zi(e)})),Fi=Bi("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&zi(e)}));Li.interactive=Ni("interactive",ji({ok:Vi,parentOk:Fi,edgeOkViaNode:zi})),Li.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var qi=Bi("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&zi(e)})),Xi=zi;Li.visible=Ni("visible",ji({ok:qi,edgeOkViaNode:Xi})),Li.hidden=function(){var e=this[0];if(e)return!e.visible()},Li.isBundledBezier=Ni("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&(!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace())})),Li.bypass=Li.css=Li.style,Li.renderedCss=Li.renderedStyle,Li.removeBypass=Li.removeCss=Li.removeStyle,Li.pstyle=Li.parsedStyle;var Yi={};function Wi(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(1===t.length&&x(t[0])){var a=t[0];this.on(e.event,a)}else if(0===t.length||1===t.length&&w(t[0])){for(var o=1===t.length?t[0]:null,s=0;s<this.length;s++){var u=this[s],l=!e.ableField||u._private[e.ableField],c=u._private[e.field]!=e.value;if(e.overrideAble){var h=e.overrideAble(u);if(void 0!==h&&(l=h,!h))return this}l&&(u._private[e.field]=e.value,c&&n.push(u))}var d=this.spawn(n);d.updateStyle(),d.emit(e.event),o&&d.emit(o)}return this}}function Hi(e){Yi[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},Yi[e.on]=Wi({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),Yi[e.off]=Wi({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}Hi({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),Hi({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),Hi({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),Hi({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),Yi.deselect=Yi.unselect,Yi.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},Hi({field:"active",on:"activate",off:"unactivate"}),Hi({field:"pannable",on:"panify",off:"unpanify"}),Yi.inactive=function(){var e=this[0];if(e)return!e._private.active};var Gi={},Ui=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode()){for(var a=!1,o=i.connectedEdges(),s=0;s<o.length;s++){var u=o[s],l=u.source(),c=u.target();if(e.noIncomingEdges&&c===i&&l!==i||e.noOutgoingEdges&&l===i&&c!==i){a=!0;break}}a||n.push(i)}}return this.spawn(n,!0).filter(t)}},Ki=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode())for(var a=i.connectedEdges(),o=0;o<a.length;o++){var s=a[o],u=s.source(),l=s.target();e.outgoing&&u===i?(n.push(s),n.push(l)):e.incoming&&l===i&&(n.push(s),n.push(u))}}return this.spawn(n,!0).filter(t)}},Zi=function(e){return function(t){for(var n=this,r=[],i={};;){var a=e.outgoing?n.outgoers():n.incomers();if(0===a.length)break;for(var o=!1,s=0;s<a.length;s++){var u=a[s],l=u.id();i[l]||(i[l]=!0,r.push(u),o=!0)}if(!o)break;n=a}return this.spawn(r,!0).filter(t)}};function $i(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function Qi(e){return function(t){var n=[],r=this._private.cy,i=e||{};b(t)&&(t=r.$(t));for(var a=0;a<t.length;a++)for(var o=t[a]._private.edges,s=0;s<o.length;s++){var u=o[s],l=u._private.data,c=this.hasElementWithId(l.source)&&t.hasElementWithId(l.target),h=t.hasElementWithId(l.source)&&this.hasElementWithId(l.target);if(c||h){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!c)continue;if(i.thisIsTgt&&!h)continue}n.push(u)}}return this.spawn(n,!0)}}function Ji(e){return e=z({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,a=0;a<r.length;a++)for(var o=r[a]._private,s=o.source,u=s._private.data.id,l=o.data.target,c=s._private.edges,h=0;h<c.length;h++){var d=c[h],p=d._private.data,f=p.target,g=p.source,v=f===l&&g===u,y=u===f&&l===g;(i.codirected&&v||!i.codirected&&(v||y))&&n.push(d)}return this.spawn(n,!0).filter(t)}}Gi.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},z(Gi,{roots:Ui({noIncomingEdges:!0}),leaves:Ui({noOutgoingEdges:!0}),outgoers:Pr(Ki({outgoing:!0}),"outgoers"),successors:Zi({outgoing:!0}),incomers:Pr(Ki({incoming:!0}),"incomers"),predecessors:Zi({incoming:!0})}),z(Gi,{neighborhood:Pr((function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],a=i.connectedEdges(),o=0;o<a.length;o++){var s=a[o],u=s.source(),l=s.target(),c=i===u?l:u;c.length>0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Gi.neighbourhood=Gi.neighborhood,Gi.closedNeighbourhood=Gi.closedNeighborhood,Gi.openNeighbourhood=Gi.openNeighborhood,z(Gi,{source:Pr((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Pr((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:$i({attr:"source"}),targets:$i({attr:"target"})}),z(Gi,{edgesWith:Pr(Qi(),"edgesWith"),edgesTo:Pr(Qi({thisIsSrc:!0}),"edgesTo")}),z(Gi,{connectedEdges:Pr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var i=r._private.edges,a=0;a<i.length;a++){var o=i[a];t.push(o)}}return this.spawn(t,!0).filter(e)}),"connectedEdges"),connectedNodes:Pr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(t.push(r.source()[0]),t.push(r.target()[0]))}return this.spawn(t,!0).filter(e)}),"connectedNodes"),parallelEdges:Pr(Ji(),"parallelEdges"),codirectedEdges:Pr(Ji({codirected:!0}),"codirectedEdges")}),z(Gi,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=null==e?t.nodes():e.nodes(),a=[];null!=e&&i.empty()&&(i=e.sources());var o=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();a.push(e);var r=i[0];o(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return o(t,e)}}),e.forEach((function(n){n.connectedEdges().forEach((function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)}))}))};do{s()}while(i.length>0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Gi.componentsOf=Gi.components;var ea=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0!==e){var r=new Ee,i=!1;if(t){if(t.length>0&&E(t[0])&&!k(t[0])){i=!0;for(var a=[],o=new Se,s=0,u=t.length;s<u;s++){var l=t[s];null==l.data&&(l.data={});var c=l.data;if(null==c.id)c.id=fe();else if(e.hasElementWithId(c.id)||o.has(c.id))continue;var h=new _e(e,l,!1);a.push(h),o.add(c.id)}t=a}}else t=[];this.length=0;for(var d=0,p=t.length;d<p;d++){var f=t[d][0];if(null!=f){var g=f._private.data.id;n&&r.has(g)||(n&&r.set(g,{index:this.length,ele:f}),this[this.length]=f,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new Ee,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=r),i&&this.restore()}else ce("A collection must have a reference to the core")},ta=_e.prototype=ea.prototype=Object.create(Array.prototype);ta.instanceString=function(){return"collection"},ta.spawn=function(e,t){return new ea(this.cy(),e,t)},ta.spawnSelf=function(){return this.spawn(this)},ta.cy=function(){return this._private.cy},ta.renderer=function(){return this._private.cy.renderer()},ta.element=function(){return this[0]},ta.collection=function(){return A(this)?this:new ea(this._private.cy,[this])},ta.unique=function(){return new ea(this._private.cy,this,!0)},ta.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},ta.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new ea(t)},ta.$id=ta.getElementById,ta.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},ta.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},ta.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},ta.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(E(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var a=!1,o={},s=e.data.source,u=e.data.target;null!=s&&s!=i.source&&(o.source=""+s,a=!0),null!=u&&u!=i.target&&(o.target=""+u,a=!0),a&&(t=t.move(o))}else{var l="parent"in e.data,c=e.data.parent;!l||null==c&&null==i.parent||c==i.parent||(void 0===c&&(c=null),null!=c&&(c=""+c),t=t.move({parent:c}))}}e.position&&t.position(e.position);var h=function(n,i,a){var o=e[n];null!=o&&o!==r[n]&&(o?t[i]():t[a]())};return h("removed","remove","restore"),h("selected","select","unselect"),h("selectable","selectify","unselectify"),h("locked","lock","unlock"),h("grabbable","grabify","ungrabify"),h("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var d={data:pe(r.data),position:pe(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};d.classes="";var p=0;return r.classes.forEach((function(e){return d.classes+=0==p++?e:" "+e})),d}}},ta.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},ta.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),i=new _e(e,r,!1);t.push(i)}return new ea(e,t)},ta.copy=ta.clone,ta.restore=function(){for(var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,a=i.cy(),o=a._private,s=[],u=[],l=0,c=i.length;l<c;l++){var h=i[l];r&&!h.removed()||(h.isNode()?s.push(h):u.push(h))}e=s.concat(u);var d=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var p=e[t],f=p._private,g=f.data;if(p.clearTraversalCache(),r||f.removed)if(void 0===g.id)g.id=fe();else if(C(g.id))g.id=""+g.id;else{if(M(g.id)||!b(g.id)){ce("Can not create element with invalid string ID `"+g.id+"`"),d();continue}if(a.hasElementWithId(g.id)){ce("Can not create second element with ID `"+g.id+"`"),d();continue}}else;var v=g.id;if(p.isNode()){var y=f.position;null==y.x&&(y.x=0),null==y.y&&(y.y=0)}if(p.isEdge()){for(var m=p,x=["source","target"],w=x.length,E=!1,S=0;S<w;S++){var _=x[S],k=g[_];C(k)&&(k=g[_]=""+g[_]),null==k||""===k?(ce("Can not create edge `"+v+"` with unspecified "+_),E=!0):a.hasElementWithId(k)||(ce("Can not create edge `"+v+"` with nonexistant "+_+" `"+k+"`"),E=!0)}if(E){d();continue}var A=a.getElementById(g.source),T=a.getElementById(g.target);A.same(T)?A._private.edges.push(m):(A._private.edges.push(m),T._private.edges.push(m)),m._private.source=A,m._private.target=T}f.map=new Ee,f.map.set(v,{ele:p,index:0}),f.removed=!1,r&&a.addToPool(p)}for(var P=0;P<s.length;P++){var D=s[P],I=D._private.data;C(I.parent)&&(I.parent=""+I.parent);var O=I.parent,B=null!=O;if(B){var N=a.getElementById(O);if(N.empty())I.parent=void 0;else{for(var L=!1,R=N;!R.empty();){if(D.same(R)){L=!0,I.parent=void 0;break}R=R.parent()}L||(N[0]._private.children.push(D),D._private.parent=N[0],o.hasCompoundNodes=!0)}}}if(e.length>0){for(var j=e.length===i.length?i:new ea(a,e),z=0;z<j.length;z++){var V=j[z];V.isNode()||(V.parallelEdges().clearTraversalCache(),V.source().clearTraversalCache(),V.target().clearTraversalCache())}(o.hasCompoundNodes?a.collection().merge(j).merge(j.connectedNodes()).merge(j.parent()):j).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?j.emitAndNotify("add"):r&&j.emit("add")}return i},ta.removed=function(){var e=this[0];return e&&e._private.removed},ta.inside=function(){var e=this[0];return e&&!e._private.removed},ta.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},a=n._private.cy;function o(e){for(var t=e._private.edges,n=0;n<t.length;n++)u(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)u(t[n])}function u(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),o(e),s(e)):r.unshift(e))}for(var l=0,c=n.length;l<c;l++){var h=n[l];u(h)}function d(e,t){var n=e._private.edges;me(n,t),e.clearTraversalCache()}function p(e){e.clearTraversalCache()}var f=[];function g(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();me(n,t),t._private.parent=null,f.ids[r]||(f.ids[r]=!0,f.push(e))}f.ids={},n.dirtyCompoundBoundsCache(),t&&a.removeFromPool(r);for(var v=0;v<r.length;v++){var y=r[v];if(y.isEdge()){var m=y.source()[0],b=y.target()[0];d(m,y),d(b,y);for(var x=y.parallelEdges(),w=0;w<x.length;w++){var E=x[w];p(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var C=y.parent();0!==C.length&&g(C,y)}t&&(y._private.removed=!0)}var S=a._private.elements;a._private.hasCompoundNodes=!1;for(var _=0;_<S.length;_++){var k=S[_];if(k.isParent()){a._private.hasCompoundNodes=!0;break}}var A=new ea(this.cy(),r);A.size()>0&&(e?A.emitAndNotify("remove"):t&&A.emit("remove"));for(var T=0;T<f.length;T++){var P=f[T];t&&P.removed()||P.updateStyle()}return A},ta.move=function(e){var t=this._private.cy,n=this,r=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var i=r(e.source),a=r(e.target),o=null!=i&&t.hasElementWithId(i),s=null!=a&&t.hasElementWithId(a);(o||s)&&(t.batch((function(){n.remove(!1,!1),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],r=t._private.data;t.isEdge()&&(o&&(r.source=i),s&&(r.target=a))}n.restore(!1,!1)})),n.emitAndNotify("move"))}else if(void 0!==e.parent){var u=r(e.parent);if(null===u||t.hasElementWithId(u)){var l=null===u?void 0:u;t.batch((function(){var e=n.remove(!1,!1);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var r=n[t],i=r._private.data;r.isNode()&&(i.parent=l)}e.restore(!1,!1)})),n.emitAndNotify("move")}}return this},[Dn,qn,Xn,kr,Mr,Rr,jr,hi,ki,Ai,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Mi,Ii,Li,Yi,Gi].forEach((function(e){z(ta,e)}));var na={add:function(e){var t,n=this;if(_(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],a=0;a<r.length;a++){var o=r[a];i.push(o.json())}t=new ea(n,i)}}else if(w(e)){t=new ea(n,e)}else if(E(e)&&(w(e.nodes)||w(e.edges))){for(var s=e,u=[],l=["nodes","edges"],c=0,h=l.length;c<h;c++){var d=l[c],p=s[d];if(w(p))for(var f=0,g=p.length;f<g;f++){var v=z({group:d},p[f]);u.push(v)}}t=new ea(n,u)}else{t=new _e(n,e).collection()}return t},remove:function(e){if(_(e));else if(b(e)){var t=e;e=this.$(t)}return e.remove()}};var ra=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,.5*r,i),o=t(n,.5*r,a),s=t(n,r,o),u=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),l=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x=n.x+u*r,n.v=n.v+l*r,n}return function e(t,r,i){var a,o,s,u={x:-1,v:0,tension:null,friction:null},l=[0],c=0;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,u.tension=t,u.friction=r,o=(a=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||u,o),l.push(1+s.x),c+=16,Math.abs(s.x)>1e-4&&Math.abs(s.v)>1e-4;);return a?function(e){return l[e*(l.length-1)|0]}:c}}(),ia=function(e,t,n,r){var i=function(e,t,n,r){var i=4,a=.001,o=1e-7,s=10,u=11,l=1/(u-1),c="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var h=0;h<4;++h)if("number"!=typeof arguments[h]||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var d=c?new Float32Array(u):new Array(u);function p(e,t){return 1-3*t+3*e}function f(e,t){return 3*t-6*e}function g(e){return 3*e}function v(e,t,n){return((p(t,n)*e+f(t,n))*e+g(t))*e}function y(e,t,n){return 3*p(t,n)*e*e+2*f(t,n)*e+g(t)}function m(t,r){for(var a=0;a<i;++a){var o=y(r,e,n);if(0===o)return r;r-=(v(r,e,n)-t)/o}return r}function b(){for(var t=0;t<u;++t)d[t]=v(t*l,e,n)}function x(t,r,i){var a,u,l=0;do{(a=v(u=r+(i-r)/2,e,n)-t)>0?i=u:r=u}while(Math.abs(a)>o&&++l<s);return u}function w(t){for(var r=0,i=1,o=u-1;i!==o&&d[i]<=t;++i)r+=l;--i;var s=r+(t-d[i])/(d[i+1]-d[i])*l,c=y(s,e,n);return c>=a?m(t,s):0===c?s:x(t,r,r+l)}var E=!1;function C(){E=!0,e===t&&n===r||b()}var S=function(i){return E||C(),e===t&&n===r?i:0===i?0:1===i?1:v(w(i),t,r)};S.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var _="generateBezier("+[e,t,n,r]+")";return S.toString=function(){return _},S}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},aa={linear:function(e,t,n){return e+(t-e)*n},ease:ia(.25,.1,.25,1),"ease-in":ia(.42,0,1,1),"ease-out":ia(0,0,.58,1),"ease-in-out":ia(.42,0,.58,1),"ease-in-sine":ia(.47,0,.745,.715),"ease-out-sine":ia(.39,.575,.565,1),"ease-in-out-sine":ia(.445,.05,.55,.95),"ease-in-quad":ia(.55,.085,.68,.53),"ease-out-quad":ia(.25,.46,.45,.94),"ease-in-out-quad":ia(.455,.03,.515,.955),"ease-in-cubic":ia(.55,.055,.675,.19),"ease-out-cubic":ia(.215,.61,.355,1),"ease-in-out-cubic":ia(.645,.045,.355,1),"ease-in-quart":ia(.895,.03,.685,.22),"ease-out-quart":ia(.165,.84,.44,1),"ease-in-out-quart":ia(.77,0,.175,1),"ease-in-quint":ia(.755,.05,.855,.06),"ease-out-quint":ia(.23,1,.32,1),"ease-in-out-quint":ia(.86,0,.07,1),"ease-in-expo":ia(.95,.05,.795,.035),"ease-out-expo":ia(.19,1,.22,1),"ease-in-out-expo":ia(1,0,0,1),"ease-in-circ":ia(.6,.04,.98,.335),"ease-out-circ":ia(.075,.82,.165,1),"ease-in-out-circ":ia(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return aa.linear;var r=ra(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":ia};function oa(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var a=i(t,n,r);return null==e||((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max))),a}function sa(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function ua(e,t,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var o=sa(e,i),s=sa(t,i);if(C(o)&&C(s))return oa(a,o,s,n,r);if(w(o)&&w(s)){for(var u=[],l=0;l<s.length;l++){var c=o[l],h=s[l];if(null!=c&&null!=h){var d=oa(a,c,h,n,r);u.push(d)}else u.push(h)}return u}}function la(e,t,n,r){var i=!r,a=e._private,o=t._private,s=o.easing,u=o.startTime,l=(r?e:e.cy()).style();if(!o.easingImpl)if(null==s)o.easingImpl=aa.linear;else{var c,h,d;if(b(s))c=l.parse("transition-timing-function",s).value;else c=s;b(c)?(h=c,d=[]):(h=c[1],d=c.slice(2).map((function(e){return+e}))),d.length>0?("spring"===h&&d.push(o.duration),o.easingImpl=aa[h].apply(null,d)):o.easingImpl=aa[h]}var p,f=o.easingImpl;if(p=0===o.duration?1:(n-u)/o.duration,o.applying&&(p=o.progress),p<0?p=0:p>1&&(p=1),null==o.delay){var g=o.startPosition,v=o.position;if(v&&i&&!e.locked()){var y={};ca(g.x,v.x)&&(y.x=ua(g.x,v.x,p,f)),ca(g.y,v.y)&&(y.y=ua(g.y,v.y,p,f)),e.position(y)}var m=o.startPan,x=o.pan,w=a.pan,E=null!=x&&r;E&&(ca(m.x,x.x)&&(w.x=ua(m.x,x.x,p,f)),ca(m.y,x.y)&&(w.y=ua(m.y,x.y,p,f)),e.emit("pan"));var C=o.startZoom,S=o.zoom,_=null!=S&&r;_&&(ca(C,S)&&(a.zoom=Qe(a.minZoom,ua(C,S,p,f),a.maxZoom)),e.emit("zoom")),(E||_)&&e.emit("viewport");var k=o.style;if(k&&k.length>0&&i){for(var A=0;A<k.length;A++){var T=k[A],P=T.name,M=T,D=o.startStyle[P],I=ua(D,M,p,f,l.properties[D.name]);l.overrideBypass(e,P,I)}e.emit("style")}}return o.progress=p,p}function ca(e,t){return null!=e&&null!=t&&(!(!C(e)||!C(t))||!(!e||!t))}function ha(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function da(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,a=i.animation.current,o=i.animation.queue,s=!1;if(0===a.length){var u=o.shift();u&&a.push(u)}for(var l=function(e){for(var t=e.length-1;t>=0;t--){(0,e[t])()}e.splice(0,e.length)},c=a.length-1;c>=0;c--){var h=a[c],d=h._private;d.stopped?(a.splice(c,1),d.hooked=!1,d.playing=!1,d.started=!1,l(d.frames)):(d.playing||d.applying)&&(d.playing&&d.applying&&(d.applying=!1),d.started||ha(0,h,e),la(t,h,e,n),d.applying&&(d.applying=!1),l(d.frames),null!=d.step&&d.step(e),h.completed()&&(a.splice(c,1),d.hooked=!1,d.playing=!1,d.started=!1,l(d.completes)),s=!0)}return n||0!==a.length||0!==o.length||r.push(t),s}for(var a=!1,o=0;o<n.length;o++){var s=i(n[o]);a=a||s}var u=i(t,!0);(a||u)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var pa={animate:Fn.animate(),animation:Fn.animation(),animated:Fn.animated(),clearQueue:Fn.clearQueue(),delay:Fn.delay(),delayAnimation:Fn.delayAnimation(),stop:Fn.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){da(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&G((function(n){da(n,e),t()}))}()}}},fa={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&k(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},ga=function(e){return b(e)?new Sr(e):e},va={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new bi(fa,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,ga(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,ga(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,ga(t),n),this},once:function(e,t,n){return this.emitter().one(e,ga(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Fn.eventAliasesOn(va);var ya={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};ya.jpeg=ya.jpg;var ma={layout:function(e){if(null!=e)if(null!=e.name){var t=e.name,n=this.extension("layout",t);if(null!=n){var r;r=b(e.eles)?this.$(e.eles):null!=e.eles?e.eles:this.$();var i=new n(z({},e,{cy:this,eles:r}));return i}ce("No such layout `"+t+"` found.  Did you forget to import it and `cytoscape.use()` it?")}else ce("A `name` must be specified to make a layout");else ce("Layout options must be specified to make a layout")}};ma.createLayout=ma.makeLayout=ma.layout;var ba={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],a=e[i];t.getElementById(i).data(a)}}))}},xa=ye({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),wa={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this.extension("renderer",e.name);if(null!=t){void 0!==e.wheelSensitivity&&de();var n=xa(e);n.cy=this,this._private.renderer=new t(n),this.notify("init")}else ce("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){this.notify("destroy");var e=this.container();if(e)for(e._cyreg=null;e.childNodes.length>0;)e.removeChild(e.childNodes[0]);this._private.renderer=null,this.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};wa.invalidateDimensions=wa.resize;var Ea={collection:function(e,t){return b(e)?this.$(e):_(e)?e.collection():w(e)?new ea(this,e,t):new ea(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Ea.elements=Ea.filter=Ea.$;var Ca={};Ca.apply=function(e){for(var t=this._private.cy.collection(),n=0;n<e.length;n++){var r=e[n],i=this.getContextMeta(r);if(!i.empty){var a=this.getContextStyle(i),o=this.applyContextStyle(i,a,r);r._private.appliedInitStyle?this.updateTransitions(r,o.diffProps):r._private.appliedInitStyle=!0,this.updateStyleHints(r)&&t.push(r)}}return t},Ca.getPropertiesDiff=function(e,t){var n=this._private.propDiffs=this._private.propDiffs||{},r=e+"-"+t,i=n[r];if(i)return i;for(var a=[],o={},s=0;s<this.length;s++){var u=this[s],l="t"===e[s],c="t"===t[s],h=l!==c,d=u.mappedProperties.length>0;if(h||c&&d){var p=void 0;h&&d||h?p=u.properties:d&&(p=u.mappedProperties);for(var f=0;f<p.length;f++){for(var g=p[f],v=g.name,y=!1,m=s+1;m<this.length;m++){var b=this[m];if("t"===t[m]&&(y=null!=b.properties[g.name]))break}o[v]||y||(o[v]=!0,a.push(v))}}}return n[r]=a,a},Ca.getContextMeta=function(e){for(var t,n="",r=e._private.styleCxtKey||"",i=0;i<this.length;i++){var a=this[i];n+=a.selector&&a.selector.matches(e)?"t":"f"}return t=this.getPropertiesDiff(r,n),e._private.styleCxtKey=n,{key:n,diffPropNames:t,empty:0===t.length}},Ca.getContextStyle=function(e){var t=e.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[t])return n[t];for(var r={_private:{key:t}},i=0;i<this.length;i++){var a=this[i];if("t"===t[i])for(var o=0;o<a.properties.length;o++){var s=a.properties[o];r[s.name]=s}}return n[t]=r,r},Ca.applyContextStyle=function(e,t,n){for(var r=e.diffPropNames,i={},a=this.types,o=0;o<r.length;o++){var s=r[o],u=t[s],l=n.pstyle(s);if(!u){if(!l)continue;u=l.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0}}if(l!==u){if(u.mapped===a.fn&&null!=l&&null!=l.mapping&&l.mapping.value===u.value){var c=l.mapping;if((c.fnValue=u.value(n))===c.prevFnValue)continue}var h=i[s]={prev:l};this.applyParsedProperty(n,u),h.next=n.pstyle(s),h.next&&h.next.bypass&&(h.next=h.next.bypassed)}}return{diffProps:i}},Ca.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,a=function(e,t,r){return n.getPropertiesHash(e,t,r)},o=t.styleKey;if(e.removed())return!1;var s="nodes"===t.group,u=e._private.style;r=Object.keys(u);for(var l=0;l<i.length;l++){var c=i[l];t.styleKeys[c]=[9261,5381]}for(var h,d=function(e,n){return t.styleKeys[n][0]=$(e,t.styleKeys[n][0])},p=function(e,n){return t.styleKeys[n][1]=Q(e,t.styleKeys[n][1])},f=function(e,t){d(e,t),p(e,t)},g=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);d(r,t),p(r,t)}},v=0;v<r.length;v++){var y=r[v],m=u[y];if(null!=m){var b=this.properties[y],x=b.type,w=b.groupKey,E=void 0;null!=b.hashOverride?E=b.hashOverride(e,m):null!=m.pfValue&&(E=m.pfValue);var C=null==b.enums?m.value:null,S=null!=E,_=S||null!=C,k=m.units;if(x.number&&_&&!x.multiple)f(-128<(h=S?E:C)&&h<128&&Math.floor(h)!==h?2e9-(1024*h|0):h,w),S||null==k||g(k,w);else g(m.strValue,w)}}for(var A,T,P=[9261,5381],M=0;M<i.length;M++){var D=i[M],I=t.styleKeys[D];P[0]=$(I[0],P[0]),P[1]=Q(I[1],P[1])}t.styleKey=(A=P[0],T=P[1],2097152*A+T);var O=t.styleKeys;t.labelDimsKey=J(O.labelDimensions);var B=a(e,["label"],O.labelDimensions);if(t.labelKey=J(B),t.labelStyleKey=J(ee(O.commonLabel,B)),!s){var N=a(e,["source-label"],O.labelDimensions);t.sourceLabelKey=J(N),t.sourceLabelStyleKey=J(ee(O.commonLabel,N));var L=a(e,["target-label"],O.labelDimensions);t.targetLabelKey=J(L),t.targetLabelStyleKey=J(ee(O.commonLabel,L))}if(s){var R=t.styleKeys,j=R.nodeBody,z=R.nodeBorder,V=R.backgroundImage,F=R.compound,q=R.pie,X=[j,z,V,F,q].filter((function(e){return null!=e})).reduce(ee,[9261,5381]);t.nodeKey=J(X),t.hasPie=null!=q&&9261!==q[0]&&5381!==q[1]}return o!==t.styleKey},Ca.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},Ca.applyParsedProperty=function(e,t){var n,r=this,i=t,a=e._private.style,o=r.types,s=r.properties[i.name].type,u=i.bypass,l=a[i.name],c=l&&l.bypass,h=e._private,d=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},p=function(){var t=d(l),n=d(i);r.checkTriggers(e,i.name,t,n)};if(i&&"pie"===i.name.substr(0,3)&&de(),"curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(i=t=this.parse(t.name,"bezier",u)),i.delete)return a[i.name]=void 0,p(),!0;if(i.deleteBypassed)return l?!!l.bypass&&(l.bypassed=void 0,p(),!0):(p(),!0);if(i.deleteBypass)return l?!!l.bypass&&(a[i.name]=l.bypassed,p(),!0):(p(),!0);var f=function(){de((e.id(),i.name,i.field,i.field,i.field))};switch(i.mapped){case o.mapData:for(var g,v=i.field.split("."),y=h.data,m=0;m<v.length&&y;m++){y=y[v[m]]}if(null==y)return f(),!1;if(!C(y))return de((i.field,e.id())),!1;var b=i.fieldMax-i.fieldMin;if((g=0===b?0:(y-i.fieldMin)/b)<0?g=0:g>1&&(g=1),s.color){var x=i.valueMin[0],w=i.valueMax[0],E=i.valueMin[1],S=i.valueMax[1],_=i.valueMin[2],k=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],T=null==i.valueMax[3]?1:i.valueMax[3],P=[Math.round(x+(w-x)*g),Math.round(E+(S-E)*g),Math.round(_+(k-_)*g),Math.round(A+(T-A)*g)];n={bypass:i.bypass,name:i.name,value:P,strValue:"rgb("+P[0]+", "+P[1]+", "+P[2]+")"}}else{if(!s.number)return!1;var M=i.valueMin+(i.valueMax-i.valueMin)*g;n=this.parse(i.name,M,i.bypass,"mapping")}if(!n)return f(),!1;n.mapping=i,i=n;break;case o.data:for(var D=i.field.split("."),I=h.data,O=0;O<D.length&&I;O++){I=I[D[O]]}if(null!=I&&(n=this.parse(i.name,I,i.bypass,"mapping")),!n)return f(),!1;n.mapping=i,i=n;break;case o.fn:var B=i.value,N=null!=i.fnValue?i.fnValue:B(e);if(i.prevFnValue=N,null==N)return de((i.name,e.id())),!1;if(!(n=this.parse(i.name,N,i.bypass,"mapping")))return de((i.name,e.id())),!1;n.mapping=pe(i),i=n;break;case void 0:break;default:return!1}return u?(i.bypassed=c?l.bypassed:l,a[i.name]=i):c?l.bypassed=i:a[i.name]=i,p(),!0},Ca.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var i=r._private.style,a=Object.keys(i),o=0;o<a.length;o++){var s=a[o],u=i[s];null!=u&&(u.bypass?u.bypassed=null:i[s]=null)}else r._private.style={}}},Ca.update=function(){this._private.cy.mutableElements().updateStyle()},Ca.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle("transition-property").value,a=e.pstyle("transition-duration").pfValue,o=e.pstyle("transition-delay").pfValue;if(i.length>0&&a>0){for(var s={},u=!1,l=0;l<i.length;l++){var c=i[l],h=e.pstyle(c),d=t[c];if(d){var p=d.prev,f=null!=d.next?d.next:h,g=!1,v=void 0;p&&(C(p.pfValue)&&C(f.pfValue)?(g=f.pfValue-p.pfValue,v=p.pfValue+1e-6*g):C(p.value)&&C(f.value)?(g=f.value-p.value,v=p.value+1e-6*g):w(p.value)&&w(f.value)&&(g=p.value[0]!==f.value[0]||p.value[1]!==f.value[1]||p.value[2]!==f.value[2],v=p.strValue),g&&(s[c]=f.strValue,this.applyBypass(e,c,v),u=!0))}}if(!u)return;r.transitioning=!0,new jn((function(t){o>0?e.delayAnimation(o).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:a,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Ca.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);null!=s&&s(n,r)&&a(o)},Ca.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Ca.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),"curve-style"!==t||"bezier"!==n&&"bezier"!==r||!i.triggersBoundsOfParallelBeziers||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},Ca.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Sa={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var a=0;a<this.properties.length;a++){var o=this.properties[a].name,s=this.parse(o,n,!0);s&&i.push(s)}}else if(b(t)){var u=this.parse(t,n,!0);u&&i.push(u)}else{if(!E(t))return!1;var l=t;r=n;for(var c=Object.keys(l),h=0;h<c.length;h++){var d=c[h],p=l[d];if(void 0===p&&(p=l[B(d)]),void 0!==p){var f=this.parse(d,p,!0);f&&i.push(f)}}}if(0===i.length)return!1;for(var g=!1,v=0;v<e.length;v++){for(var y=e[v],m={},x=void 0,w=0;w<i.length;w++){var C=i[w];if(r){var S=y.pstyle(C.name);x=m[C.name]={prev:S}}g=this.applyParsedProperty(y,pe(C))||g,r&&(x.next=y.pstyle(C.name))}g&&this.updateStyleHints(y),r&&this.updateTransitions(y,m,!0)}return g},overrideBypass:function(e,t,n){t=O(t);for(var r=0;r<e.length;r++){var i=e[r],a=i._private.style[t],o=this.properties[t].type,s=o.color,u=o.mutiple,l=a?null!=a.pfValue?a.pfValue:a.value:null;a&&a.bypass?(a.value=n,null!=a.pfValue&&(a.pfValue=n),a.strValue=s?"rgb("+n.join(",")+")":u?n.join(" "):""+n,this.updateStyleHints(i)):this.applyBypass(i,t,n),this.checkTriggers(i,t,l,n)}},removeAllBypasses:function(e,t){return this.removeBypasses(e,this.propertyNames,t)},removeBypasses:function(e,t,n){for(var r=0;r<e.length;r++){for(var i=e[r],a={},o=0;o<t.length;o++){var s=t[o],u=this.properties[s],l=i.pstyle(u.name);if(l&&l.bypass){var c=this.parse(s,"",!0),h=a[u.name]={prev:l};this.applyParsedProperty(i,c),h.next=i.pstyle(u.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,a,!0)}}},_a={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},containerCss:function(e){var t=this._private.cy.container();if(d&&t&&d.getComputedStyle)return d.getComputedStyle(t).getPropertyValue(e)}},ka={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){if(e=e[0]){for(var n={},r=0;r<this.properties.length;r++){var i=this.properties[r],a=this.getStylePropertyValue(e,i.name,t);null!=a&&(n[i.name]=a,n[B(i.name)]=a)}return n}},getIndexedStyle:function(e,t,n,r){var i=e.pstyle(t)[n][r];return null!=i?i:e.cy().style().getDefaultProperty(t)[n][0]},getStylePropertyValue:function(e,t,n){if(e=e[0]){var r=this.properties[t];r.alias&&(r=r.pointsTo);var i=r.type,a=e.pstyle(r.name);if(a){var o=a.value,s=a.units,u=a.strValue;if(n&&i.number&&null!=o&&C(o)){var l=e.cy().zoom(),c=function(e){return e*l},h=function(e,t){return c(e)+t},d=w(o);return(d?s.every((function(e){return null!=e})):null!=s)?d?o.map((function(e,t){return h(e,s[t])})).join(" "):h(o,s):d?o.map((function(e){return b(e)?e:""+c(e)})).join(" "):""+c(o)}if(null!=u)return u}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,a=e.pstyle(i);void 0!==a&&(a=E(a)?this.parse(i,a.strValue):this.parse(i,a)),a&&(n[i]=a)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var i=Object.keys(n),a=0;a<i.length;a++){var o=i[a],s=n[o],u=r[o]||r[O(o)],l=this.parse(u.name,s);l&&t.push(l)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,i,a,o,s,u,l=n.slice();for(s=0;s<t.length;s++)if(r=t[s],null!=(i=e.pstyle(r,!1)))if(null!=i.pfValue)l[0]=$(o,l[0]),l[1]=Q(o,l[1]);else for(a=i.strValue,u=0;u<a.length;u++)o=a.charCodeAt(u),l[0]=$(o,l[0]),l[1]=Q(o,l[1]);return l}};ka.getPropertiesHash=ka.getNonDefaultPropertiesHash;var Aa={appendFromJson:function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.selector,i=n.style||n.css,a=Object.keys(i);this.selector(r);for(var o=0;o<a.length;o++){var s=a[o],u=i[s];this.css(s,u)}}return this},fromJson:function(e){return this.resetToDefault(),this.appendFromJson(e),this},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,a={},o=0;o<i.length;o++){var s=i[o];a[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:a})}return e}},Ta={appendFromString:function(e){var t,n,r,i=""+e;function a(){i=i.length>t.length?i.substr(t.length):""}function o(){n=n.length>r.length?n.substr(r.length):""}for(i=i.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(i.match(/^\s*$/))break;var s=i.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!s){de();break}t=s[0];var u=s[1];if("core"!==u)if(new Sr(u).invalid){de(),a();continue}var l=s[2],c=!1;n=l;for(var h=[];;){if(n.match(/^\s*$/))break;var d=n.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!d){de(),c=!0;break}r=d[0];var p=d[1],f=d[2];if(this.properties[p])this.parse(p,f)?(h.push({name:p,val:f}),o()):(de(),o());else de(),o()}if(c){a();break}this.selector(u);for(var g=0;g<h.length;g++){var v=h[g];this.css(v.name,v.val)}a()}return this},fromString:function(e){return this.resetToDefault(),this.appendFromString(e),this}},Pa={};!function(){var e=R,t=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},n=function(t){var n=e+"|\\w+|rgb[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%]?)(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|hsl[a]?\\((?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*(?:(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+t+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+n+")\\s*\\,\\s*("+n+")\\)$"},r=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];Pa.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:t("data")},layoutData:{mapping:!0,regex:t("layoutData")},scratch:{mapping:!0,regex:t("scratch")},mapData:{mapping:!0,regex:n("mapData")},mapLayoutData:{mapping:!0,regex:n("mapLayoutData")},mapScratch:{mapping:!0,regex:n("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:r,singleRegexMatchValue:!0},urls:{regexes:r,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return b(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},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:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return 1===t||2===t||4===t}}};var i={zeroNonZero:function(e,t){return(null==e||null==t)&&e!==t||(0==e&&0!=t||0!=e&&0==t)},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=M(e),r=M(t);return n&&!r||!n&&r}},a=Pa.types,o=[{name:"label",type:a.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:a.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:a.bidirectionalSize,triggersBounds:i.any}],s=[{name:"source-label",type:a.text,triggersBounds:i.any},{name:"source-text-rotation",type:a.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:a.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:a.size,triggersBounds:i.any}],u=[{name:"target-label",type:a.text,triggersBounds:i.any},{name:"target-text-rotation",type:a.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:a.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:a.size,triggersBounds:i.any}],l=[{name:"font-family",type:a.fontFamily,triggersBounds:i.any},{name:"font-style",type:a.fontStyle,triggersBounds:i.any},{name:"font-weight",type:a.fontWeight,triggersBounds:i.any},{name:"font-size",type:a.size,triggersBounds:i.any},{name:"text-transform",type:a.textTransform,triggersBounds:i.any},{name:"text-wrap",type:a.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:a.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:a.size,triggersBounds:i.any},{name:"text-outline-width",type:a.size,triggersBounds:i.any},{name:"line-height",type:a.positiveNumber,triggersBounds:i.any}],c=[{name:"text-valign",type:a.valign,triggersBounds:i.any},{name:"text-halign",type:a.halign,triggersBounds:i.any},{name:"color",type:a.color},{name:"text-outline-color",type:a.color},{name:"text-outline-opacity",type:a.zeroOneNumber},{name:"text-background-color",type:a.color},{name:"text-background-opacity",type:a.zeroOneNumber},{name:"text-background-padding",type:a.size,triggersBounds:i.any},{name:"text-border-opacity",type:a.zeroOneNumber},{name:"text-border-color",type:a.color},{name:"text-border-width",type:a.size,triggersBounds:i.any},{name:"text-border-style",type:a.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:a.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:a.justification}],h=[{name:"events",type:a.bool},{name:"text-events",type:a.bool}],d=[{name:"display",type:a.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:a.visibility,triggersZOrder:i.any},{name:"opacity",type:a.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:a.zeroOneNumber},{name:"min-zoomed-font-size",type:a.size},{name:"z-compound-depth",type:a.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:a.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:a.nonNegativeInt,triggersZOrder:i.any}],p=[{name:"overlay-padding",type:a.size,triggersBounds:i.any},{name:"overlay-color",type:a.color},{name:"overlay-opacity",type:a.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"overlay-shape",type:a.overlayShape,triggersBounds:i.any}],f=[{name:"underlay-padding",type:a.size,triggersBounds:i.any},{name:"underlay-color",type:a.color},{name:"underlay-opacity",type:a.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"underlay-shape",type:a.overlayShape,triggersBounds:i.any}],g=[{name:"transition-property",type:a.propList},{name:"transition-duration",type:a.time},{name:"transition-delay",type:a.time},{name:"transition-timing-function",type:a.easing}],v=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},y=[{name:"height",type:a.nodeSize,triggersBounds:i.any,hashOverride:v},{name:"width",type:a.nodeSize,triggersBounds:i.any,hashOverride:v},{name:"shape",type:a.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:a.polygonPointList,triggersBounds:i.any},{name:"background-color",type:a.color},{name:"background-fill",type:a.fill},{name:"background-opacity",type:a.zeroOneNumber},{name:"background-blacken",type:a.nOneOneNumber},{name:"background-gradient-stop-colors",type:a.colors},{name:"background-gradient-stop-positions",type:a.percentages},{name:"background-gradient-direction",type:a.gradientDirection},{name:"padding",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:a.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:a.boundsExpansion,triggersBounds:i.any}],m=[{name:"border-color",type:a.color},{name:"border-opacity",type:a.zeroOneNumber},{name:"border-width",type:a.size,triggersBounds:i.any},{name:"border-style",type:a.borderStyle}],x=[{name:"background-image",type:a.urls},{name:"background-image-crossorigin",type:a.bgCrossOrigin},{name:"background-image-opacity",type:a.zeroOneNumbers},{name:"background-image-containment",type:a.bgContainment},{name:"background-image-smoothing",type:a.bools},{name:"background-position-x",type:a.bgPos},{name:"background-position-y",type:a.bgPos},{name:"background-width-relative-to",type:a.bgRelativeTo},{name:"background-height-relative-to",type:a.bgRelativeTo},{name:"background-repeat",type:a.bgRepeat},{name:"background-fit",type:a.bgFit},{name:"background-clip",type:a.bgClip},{name:"background-width",type:a.bgWH},{name:"background-height",type:a.bgWH},{name:"background-offset-x",type:a.bgPos},{name:"background-offset-y",type:a.bgPos}],w=[{name:"position",type:a.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:a.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:a.size,triggersBounds:i.any},{name:"min-width-bias-left",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:a.size,triggersBounds:i.any},{name:"min-height-bias-top",type:a.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:a.sizeMaybePercent,triggersBounds:i.any}],E=[{name:"line-style",type:a.lineStyle},{name:"line-color",type:a.color},{name:"line-fill",type:a.fill},{name:"line-cap",type:a.lineCap},{name:"line-opacity",type:a.zeroOneNumber},{name:"line-dash-pattern",type:a.numbers},{name:"line-dash-offset",type:a.number},{name:"line-gradient-stop-colors",type:a.colors},{name:"line-gradient-stop-positions",type:a.percentages},{name:"curve-style",type:a.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:a.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:a.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:a.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:a.size,triggersBounds:i.any},{name:"control-point-distances",type:a.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:a.numbers,triggersBounds:i.any},{name:"segment-distances",type:a.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:a.numbers,triggersBounds:i.any},{name:"taxi-turn",type:a.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:a.size,triggersBounds:i.any},{name:"taxi-direction",type:a.axisDirection,triggersBounds:i.any},{name:"edge-distances",type:a.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:a.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:a.angle,triggersBounds:i.any},{name:"loop-sweep",type:a.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:a.size,triggersBounds:i.any},{name:"target-distance-from-node",type:a.size,triggersBounds:i.any}],C=[{name:"ghost",type:a.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:a.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:a.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:a.zeroOneNumber}],S=[{name:"selection-box-color",type:a.color},{name:"selection-box-opacity",type:a.zeroOneNumber},{name:"selection-box-border-color",type:a.color},{name:"selection-box-border-width",type:a.size},{name:"active-bg-color",type:a.color},{name:"active-bg-opacity",type:a.zeroOneNumber},{name:"active-bg-size",type:a.size},{name:"outside-texture-bg-color",type:a.color},{name:"outside-texture-bg-opacity",type:a.zeroOneNumber}],_=[];Pa.pieBackgroundN=16,_.push({name:"pie-size",type:a.sizeMaybePercent});for(var k=1;k<=Pa.pieBackgroundN;k++)_.push({name:"pie-"+k+"-background-color",type:a.color}),_.push({name:"pie-"+k+"-background-size",type:a.percent}),_.push({name:"pie-"+k+"-background-opacity",type:a.zeroOneNumber});var A=[],T=Pa.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:a.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:a.color},{name:"arrow-fill",type:a.arrowFill}].forEach((function(e){T.forEach((function(t){var n=t+"-"+e.name,r=e.type,i=e.triggersBounds;A.push({name:n,type:r,triggersBounds:i})}))}),{});var P=Pa.properties=[].concat(h,g,d,p,f,C,c,l,o,s,u,y,m,x,_,w,E,A,S),D=Pa.propertyGroups={behavior:h,transition:g,visibility:d,overlay:p,underlay:f,ghost:C,commonLabel:c,labelDimensions:l,mainLabel:o,sourceLabel:s,targetLabel:u,nodeBody:y,nodeBorder:m,backgroundImage:x,pie:_,compound:w,edgeLine:E,edgeArrow:A,core:S},I=Pa.propertyGroupNames={};(Pa.propertyGroupKeys=Object.keys(D)).forEach((function(e){I[e]=D[e].map((function(e){return e.name})),D[e].forEach((function(t){return t.groupKey=e}))}));var O=Pa.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"}];Pa.propertyNames=P.map((function(e){return e.name}));for(var B=0;B<P.length;B++){var N=P[B];P[N.name]=N}for(var L=0;L<O.length;L++){var j=O[L],z=P[j.pointsTo],V={name:j.name,alias:!0,pointsTo:z};P.push(V),P[j.name]=V}}(),Pa.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Pa.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=z({"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 n=1;n<=Pa.pieBackgroundN;n++){var r=t.name.replace("{{i}}",n),i=t.value;e[r]=i}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){return Pa.arrowPrefixes.forEach((function(n){var r=n+"-"+t.name,i=t.value;e[r]=i})),e}),{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var a=i.name,o=t[a],s=this.parse(a,o);n[a]=s}}return e.defaultProperties=n,e.defaultProperties},Pa.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 Ma={parse:function(e,t,n,r){if(x(t))return this.parseImplWarn(e,t,n,r);var i,a=ne(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),o=this.propCache=this.propCache||[];return(i=o[a])||(i=o[a]=this.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(i=pe(i))&&(i.value=pe(i.value)),i},parseImplWarn:function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||de("The style property `".concat(e,": ").concat(t,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==t||de(i.name),i}};Ma.parseImpl=function(e,t,n,r){e=O(e);var i=this.properties[e],a=t,o=this.types;if(!i)return null;if(void 0===t)return null;i.alias&&(i=i.pointsTo,e=i.name);var s=b(t);s&&(t=t.trim());var u,l,c=i.type;if(!c)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(x(t))return{name:e,value:t,strValue:"fn",mapped:o.fn,bypass:n};if(!s||r||t.length<7||"a"!==t[1]);else{if(t.length>=7&&"d"===t[0]&&(u=new RegExp(o.data.regex).exec(t))){if(n)return!1;var h=o.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(l=new RegExp(o.mapData.regex).exec(t))){if(n)return!1;if(c.multiple)return!1;var d=o.mapData;if(!c.color&&!c.number)return!1;var p=this.parse(e,l[4]);if(!p||p.mapped)return!1;var f=this.parse(e,l[5]);if(!f||f.mapped)return!1;if(p.pfValue===f.pfValue||p.strValue===f.strValue)return de(p.strValue),this.parse(e,p.strValue);if(c.color){var g=p.value,v=f.value;if(!(g[0]!==v[0]||g[1]!==v[1]||g[2]!==v[2]||g[3]!==v[3]&&(null!=g[3]&&1!==g[3]||null!=v[3]&&1!==v[3])))return!1}return{name:e,value:l,strValue:""+t,mapped:d,field:l[1],fieldMin:parseFloat(l[2]),fieldMax:parseFloat(l[3]),valueMin:p.value,valueMax:f.value,bypass:n}}}if(c.multiple&&"multiple"!==r){var y;if(y=s?t.split(/\s+/):w(t)?t:[t],c.evenMultiple&&y.length%2!=0)return null;for(var m=[],E=[],S=[],_="",k=!1,A=0;A<y.length;A++){var T=this.parse(e,y[A],n,"multiple");k=k||b(T.value),m.push(T.value),S.push(null!=T.pfValue?T.pfValue:T.value),E.push(T.units),_+=(A>0?" ":"")+T.strValue}return c.validate&&!c.validate(m,E)?null:c.singleEnum&&k?1===m.length&&b(m[0])?{name:e,value:m[0],strValue:m[0],bypass:n}:null:{name:e,value:m,pfValue:S,strValue:_,bypass:n,units:E}}var P,M,D=function(){for(var r=0;r<c.enums.length;r++){if(c.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(c.number){var I,B="px";if(c.units&&(I=c.units),c.implicitUnits&&(B=c.implicitUnits),!c.unitless)if(s){var N="px|em"+(c.allowPercent?"|\\%":"");I&&(N=I);var L=t.match("^("+R+")("+N+")?$");L&&(t=L[1],I=L[2]||B)}else I&&!c.implicitUnits||(I=B);if(t=parseFloat(t),isNaN(t)&&void 0===c.enums)return null;if(isNaN(t)&&void 0!==c.enums)return t=a,D();if(c.integer&&(!C(M=t)||Math.floor(M)!==M))return null;if(void 0!==c.min&&(t<c.min||c.strictMin&&t===c.min)||void 0!==c.max&&(t>c.max||c.strictMax&&t===c.max))return null;var j={name:e,value:t,strValue:""+t+(I||""),units:I,bypass:n};return c.unitless||"px"!==I&&"em"!==I?j.pfValue=t:j.pfValue="px"!==I&&I?this.getEmSizeInPixels()*t:t,"ms"!==I&&"s"!==I||(j.pfValue="ms"===I?t:1e3*t),"deg"!==I&&"rad"!==I||(j.pfValue="rad"===I?t:(P=t,Math.PI*P/180)),"%"===I&&(j.pfValue=t/100),j}if(c.propList){var z=[],F=""+t;if("none"===F);else{for(var q=F.split(/\s*,\s*|\s+/),X=0;X<q.length;X++){var Y=q[X].trim();this.properties[Y]?z.push(Y):de()}if(0===z.length)return null}return{name:e,value:z,strValue:0===z.length?"none":z.join(" "),bypass:n}}if(c.color){var W=V(t);return W?{name:e,value:W,pfValue:W,strValue:"rgb("+W[0]+","+W[1]+","+W[2]+")",bypass:n}:null}if(c.regex||c.regexes){if(c.enums){var H=D();if(H)return H}for(var G=c.regexes?c.regexes:[c.regex],U=0;U<G.length;U++){var K=new RegExp(G[U]).exec(t);if(K)return{name:e,value:c.singleRegexMatchValue?K[1]:K,strValue:""+t,bypass:n}}return null}return c.string?{name:e,value:""+t,strValue:""+t,bypass:n}:c.enums?D():null};var Da=function e(t){if(!(this instanceof e))return new e(t);T(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):ce("A style must have a core reference")},Ia=Da.prototype;Ia.instanceString=function(){return"style"},Ia.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach((function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1})),this},Ia.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Ia.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},Ia.selector=function(e){var t="core"===e?null:new Sr(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},Ia.css=function(){var e=this,t=arguments;if(1===t.length)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],a=n[i.name];void 0===a&&(a=n[B(i.name)]),void 0!==a&&this.cssRule(i.name,a)}else 2===t.length&&this.cssRule(t[0],t[1]);return this},Ia.style=Ia.css,Ia.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},Ia.append=function(e){return P(e)?e.appendToStyle(this):w(e)?this.appendFromJson(e):b(e)&&this.appendFromString(e),this},Da.fromJson=function(e,t){var n=new Da(e);return n.fromJson(t),n},Da.fromString=function(e,t){return new Da(e).fromString(t)},[Ca,Sa,_a,ka,Aa,Ta,Pa,Ma].forEach((function(e){z(Ia,e)})),Da.types=Ia.types,Da.properties=Ia.properties,Da.propertyGroups=Ia.propertyGroups,Da.propertyGroupNames=Ia.propertyGroupNames,Da.propertyGroupKeys=Ia.propertyGroupKeys;var Oa={style:function(e){e&&this.setStyle(e).update();return this._private.style},setStyle:function(e){var t=this._private;return P(e)?t.style=e.generateStyle(this):w(e)?t.style=Da.fromJson(this,e):b(e)?t.style=Da.fromString(this,e):t.style=Da(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Ba={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:("additive"!==e&&"single"!==e||(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,i,a=arguments,o=this._private.pan;switch(a.length){case 0:return o;case 1:if(b(a[0]))return o[e=a[0]];if(E(a[0])){if(!this._private.panningEnabled)return this;r=(n=a[0]).x,i=n.y,C(r)&&(o.x=r),C(i)&&(o.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;e=a[0],t=a[1],"x"!==e&&"y"!==e||!C(t)||(o[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,i,a,o,s=arguments,u=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:E(e)&&(a=(i=s[0]).x,o=i.y,C(a)&&(u.x+=a),C(o)&&(u.y+=o),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!C(r)||(u[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(C(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n,r;if(b(e)){var i=e;e=this.$(i)}else if(E(r=e)&&C(r.x1)&&C(r.x2)&&C(r.y1)&&C(r.y2)){var a=e;(n={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1}else _(e)||(e=this.mutableElements());if(!_(e)||!e.empty()){n=n||e.boundingBox();var o,s=this.width(),u=this.height();if(t=C(t)?t:0,!isNaN(s)&&!isNaN(u)&&s>0&&u>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:o=(o=(o=Math.min((s-2*t)/n.w,(u-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:o)<this._private.minZoom?this._private.minZoom:o,pan:{x:(s-o*(n.x1+n.x2))/2,y:(u-o*(n.y1+n.y2))/2}}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return C(e)&&C(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):C(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:C(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,a=r.zoom,o=!1;if(r.zoomingEnabled||(o=!0),C(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=Fe(e.position,a,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(o=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,o||!C(n)||n===a||null!=t&&(!C(t.x)||!C(t.y)))return null;if(null!=t){var s=i,u=a,l=n;return{zoomed:!0,panned:!0,zoom:l,pan:{x:-l/u*(t.x-s.x)+t.x,y:-l/u*(t.y-s.y)+t.y}}}return{zoomed:!0,panned:!1,zoom:n,pan:i}},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],a=!1,o=!1;if(!e)return this;if(C(e.zoom)||(n=!1),E(e.pan)||(r=!1),!n&&!r)return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;C(u.x)&&(t.pan.x=u.x,o=!1),C(u.y)&&(t.pan.y=u.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else _(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),a=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=d.getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};Ba.centre=Ba.center,Ba.autolockNodes=Ba.autolock,Ba.autoungrabifyNodes=Ba.autoungrabify;var Na={data:Fn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Fn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Fn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Fn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Na.attr=Na.data,Na.removeAttr=Na.removeData;var La=function(e){var t=this,n=(e=z({},e)).container;n&&!S(n)&&S(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=void 0!==d&&void 0!==n&&!e.headless,o=e;o.layout=z({name:a?"grid":"null"},o.layout),o.renderer=z({name:a?"canvas":"null"},o.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},u=this._private={container:n,ready:!1,options:o,elements:new ea(this),listeners:[],aniEles:new ea(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:void 0===o.styleEnabled?a:o.styleEnabled,zoom:C(o.zoom)?o.zoom:1,pan:{x:E(o.pan)&&C(o.pan.x)?o.pan.x:0,y:E(o.pan)&&C(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});u.styleEnabled&&t.setStyle([]);var l=z({},o,o.renderer);t.initRenderer(l);!function(e,t){if(e.some(D))return jn.all(e).then(t);t(e)}([o.style,o.elements],(function(e){var n=e[0],a=e[1];u.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var a=z({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()}(a,(function(){t.startAnimationLoop(),u.ready=!0,x(o.ready)&&t.on("ready",o.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on("ready",n)}r&&(r.readies=[]),t.emit("ready")}),o.done)}))},Ra=La.prototype;z(Ra,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},mount:function(e){if(null!=e){var t=this,n=t._private,r=n.options;return!S(e)&&S(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(z({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return pe(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(E(e)){if(t.startBatch(),e.elements){var i={},a=function(e,n){for(var r=[],a=[],o=0;o<e.length;o++){var s=e[o];if(s.data.id){var u=""+s.data.id,l=t.getElementById(u);i[u]=!0,0!==l.length?a.push({ele:l,json:s}):n?(s.group=n,r.push(s)):r.push(s)}else de()}t.add(r);for(var c=0;c<a.length;c++){var h=a[c],d=h.ele,p=h.json;d.json(p)}};if(w(e.elements))a(e.elements);else for(var o=["nodes","edges"],s=0;s<o.length;s++){var u=o[s],l=e.elements[u];w(l)&&a(l,u)}var c=t.collection();r.filter((function(e){return!i[e.id()]})).forEach((function(e){e.isParent()?c.merge(e):e.remove()})),c.forEach((function(e){return e.children().move({parent:null})})),c.forEach((function(e){return function(e){return t.getElementById(e.id())}(e).remove()}))}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x===n.pan.x&&e.pan.y===n.pan.y||t.pan(e.pan)),e.data&&t.data(e.data);for(var h=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],d=0;d<h.length;d++){var p=h[d];null!=e[p]&&t[p](e[p])}return t.endBatch(),this}var f={};!!e?f.elements=this.elements().map((function(e){return e.json()})):(f.elements={},r.forEach((function(e){var t=e.group();f.elements[t]||(f.elements[t]=[]),f.elements[t].push(e.json())}))),this._private.styleEnabled&&(f.style=t.style().json()),f.data=pe(t.data());var g=n.options;return f.zoomingEnabled=n.zoomingEnabled,f.userZoomingEnabled=n.userZoomingEnabled,f.zoom=n.zoom,f.minZoom=n.minZoom,f.maxZoom=n.maxZoom,f.panningEnabled=n.panningEnabled,f.userPanningEnabled=n.userPanningEnabled,f.pan=pe(n.pan),f.boxSelectionEnabled=n.boxSelectionEnabled,f.renderer=pe(g.renderer),f.hideEdgesOnViewport=g.hideEdgesOnViewport,f.textureOnViewport=g.textureOnViewport,f.wheelSensitivity=g.wheelSensitivity,f.motionBlur=g.motionBlur,f.multiClickDebounceTime=g.multiClickDebounceTime,f}}),Ra.$id=Ra.getElementById,[na,pa,va,ya,ma,ba,wa,Ea,Oa,Ba,Na].forEach((function(e){z(Ra,e)}));var ja={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},za=function(e){return e.scratch("breadthfirst")},Va=function(e,t){return e.scratch("breadthfirst",t)};function Fa(e){this.options=z({},ja,e)}Fa.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,i=n.eles,a=i.nodes().filter((function(e){return!e.isParent()})),o=i,s=n.directed,u=n.maximal||n.maximalAdjustments>0,l=Je(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(_(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],h=0;h<n.roots.length;h++){var d=n.roots[h],p=r.getElementById(d);c.push(p)}e=r.collection(c)}else if(b(n.roots))e=r.$(n.roots);else if(s)e=a.roots();else{var f=i.components();e=r.collection();for(var g=function(t){var n=f[t],r=n.maxDegree(!1),i=n.filter((function(e){return e.degree(!1)===r}));e=e.add(i)},v=0;v<f.length;v++)g(v)}var y=[],m={},x=function(e,t){null==y[t]&&(y[t]=[]);var n=y[t].length;y[t].push(e),Va(e,{index:n,depth:t})};o.bfs({roots:e,directed:n.directed,visit:function(e,t,n,r,i){var a=e[0],o=a.id();x(a,i),m[o]=!0}});for(var E=[],C=0;C<a.length;C++){var S=a[C];m[S.id()]||E.push(S)}var k=function(e){for(var t=y[e],n=0;n<t.length;n++){var r=t[n];null!=r?Va(r,{depth:e,index:n}):(t.splice(n,1),n--)}},A=function(){for(var e=0;e<y.length;e++)k(e)},T=function(e,t){for(var n=za(e),r=e.incomers().filter((function(e){return e.isNode()&&i.has(e)})),a=-1,o=e.id(),s=0;s<r.length;s++){var u=r[s],l=za(u);a=Math.max(a,l.depth)}return n.depth<=a&&(t[o]?null:(function(e,t){var n=za(e),r=n.depth,i=n.index;y[r][i]=null,x(e,t)}(e,a+1),t[o]=!0,!0))};if(s&&u){var P=[],M={},D=function(e){return P.push(e)};for(a.forEach((function(e){return P.push(e)}));P.length>0;){var I=P.shift(),O=T(I,M);if(O)I.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(D);else if(null===O){de(I.id());break}}}A();var B=0;if(n.avoidOverlap)for(var N=0;N<a.length;N++){var L=a[N].layoutDimensions(n),R=L.w,z=L.h;B=Math.max(B,R,z)}for(var V={},F=function(e){if(V[e.id()])return V[e.id()];for(var t=za(e).depth,n=e.neighborhood(),r=0,i=0,o=0;o<n.length;o++){var s=n[o];if(!s.isEdge()&&!s.isParent()&&a.has(s)){var u=za(s);if(null!=u){var l=u.index,c=u.depth;if(null!=l&&null!=c){var h=y[c].length;c<t&&(r+=l/h,i++)}}}}return r/=i=Math.max(1,i),0===i&&(r=0),V[e.id()]=r,r},q=function(e,t){var n=F(e)-F(t);return 0===n?j(e.id(),t.id()):n},X=0;X<y.length;X++)y[X].sort(q),k(X);for(var Y=[],W=0;W<E.length;W++)Y.push(E[W]);y.unshift(Y),A();for(var H=0,G=0;G<y.length;G++)H=Math.max(y[G].length,H);var U=l.x1+l.w/2,K=l.x1+l.h/2,Z=y.reduce((function(e,t){return Math.max(e,t.length)}),0);return i.nodes().layoutPositions(this,n,(function(e){var t=za(e),r=t.depth,i=t.index,a=y[r].length,o=Math.max(l.w/((n.grid?Z:a)+1),B),s=Math.max(l.h/(y.length+1),B),u=Math.min(l.w/2/y.length,l.h/2/y.length);if(u=Math.max(u,B),n.circle){var c=u*r+u-(y.length>0&&y[0].length<=3?u/2:0),h=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:U+c*Math.cos(h),y:K+c*Math.sin(h)}}return{x:U+(i+1-(a+1)/2)*o,y:(r+1)*s}})),this};var qa={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Xa(e){this.options=z({},qa,e)}Xa.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));for(var o,s=Je(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u=s.x1+s.w/2,l=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),h=0,d=0;d<a.length;d++){var p=a[d].layoutDimensions(t),f=p.w,g=p.h;h=Math.max(h,f,g)}if(o=C(t.radius)?t.radius:a.length<=1?0:Math.min(s.h,s.w)/2-h,a.length>1&&t.avoidOverlap){h*=1.75;var v=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(h*h/(v*v+y*y));o=Math.max(m,o)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),a=o*Math.cos(r),s=o*Math.sin(r);return{x:u+a,y:l+s}})),this};var Ya,Wa={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Ha(e){this.options=z({},Wa,e)}Ha.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,a=i.nodes().not(":parent"),o=Je(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=o.x1+o.w/2,u=o.y1+o.h/2,l=[],c=0,h=0;h<a.length;h++){var d,p=a[h];d=t.concentric(p),l.push({value:d,node:p}),p._private.scratch.concentric=d}a.updateStyle();for(var f=0;f<a.length;f++){var g=a[f].layoutDimensions(t);c=Math.max(c,g.w,g.h)}l.sort((function(e,t){return t.value-e.value}));for(var v=t.levelWidth(a),y=[[]],m=y[0],b=0;b<l.length;b++){var x=l[b];if(m.length>0)Math.abs(m[0].value-x.value)>=v&&(m=[],y.push(m));m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,C=(Math.min(o.w,o.h)/2-w)/(y.length+E?1:0);w=Math.min(w,C)}for(var S=0,_=0;_<y.length;_++){var k=y[_],A=void 0===t.sweep?2*Math.PI-2*Math.PI/k.length:t.sweep,T=k.dTheta=A/Math.max(1,k.length-1);if(k.length>1&&t.avoidOverlap){var P=Math.cos(T)-Math.cos(0),M=Math.sin(T)-Math.sin(0),D=Math.sqrt(w*w/(P*P+M*M));S=Math.max(D,S)}k.r=S,S+=w}if(t.equidistant){for(var I=0,O=0,B=0;B<y.length;B++){var N=y[B].r-O;I=Math.max(I,N)}O=0;for(var L=0;L<y.length;L++){var R=y[L];0===L&&(O=R.r),R.r=O,O+=I}}for(var j={},z=0;z<y.length;z++)for(var V=y[z],F=V.dTheta,q=V.r,X=0;X<V.length;X++){var Y=V[X],W=t.startAngle+(n?1:-1)*F*X,H={x:s+q*Math.cos(W),y:u+q*Math.sin(W)};j[Y.node.id()]=H}return i.nodes().layoutPositions(this,t,(function(e){var t=e.id();return j[t]})),this};var Ga={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Ua(e){this.options=z({},Ga,e),this.options.layout=this}Ua.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,!0!==e.animate&&!1!==e.animate||n.emit({type:"layoutstart",layout:n}),Ya=!0===e.debug;var r=Ka(t,n,e);Ya&&(void 0)(r),e.randomize&&Qa(r);var i=U(),a=function(){eo(r,t,e),!0===e.fit&&t.fit(e.padding)},o=function(t){return!(n.stopped||t>=e.numIter)&&(to(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)a(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),i=Ja(r,e,t);t.layoutPositions(n,e,i)}},u=0,l=!0;if(!0===e.animate){!function t(){for(var n=0;l&&n<e.refresh;)l=o(u),u++,n++;l?(U()-i>=e.animationThreshold&&a(),G(t)):(fo(r,e),s())}()}else{for(;l;)l=o(u),u++;fo(r,e),s()}return this},Ua.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Ua.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Ka=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:Je(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},o=n.eles.components(),s={},u=0;u<o.length;u++)for(var l=o[u],c=0;c<l.length;c++){s[l[c].id()]=u}for(u=0;u<a.nodeSize;u++){var h=(v=i[u]).layoutDimensions(n);(O={}).isLocked=v.locked(),O.id=v.data("id"),O.parentId=v.data("parent"),O.cmptId=s[v.id()],O.children=[],O.positionX=v.position("x"),O.positionY=v.position("y"),O.offsetX=0,O.offsetY=0,O.height=h.w,O.width=h.h,O.maxX=O.positionX+O.width/2,O.minX=O.positionX-O.width/2,O.maxY=O.positionY+O.height/2,O.minY=O.positionY-O.height/2,O.padLeft=parseFloat(v.style("padding")),O.padRight=parseFloat(v.style("padding")),O.padTop=parseFloat(v.style("padding")),O.padBottom=parseFloat(v.style("padding")),O.nodeRepulsion=x(n.nodeRepulsion)?n.nodeRepulsion(v):n.nodeRepulsion,a.layoutNodes.push(O),a.idToIndex[O.id]=u}var d=[],p=0,f=-1,g=[];for(u=0;u<a.nodeSize;u++){var v,y=(v=a.layoutNodes[u]).parentId;null!=y?a.layoutNodes[a.idToIndex[y]].children.push(v.id):(d[++f]=v.id,g.push(v.id))}for(a.graphSet.push(g);p<=f;){var m=d[p++],b=a.idToIndex[m],w=a.layoutNodes[b].children;if(w.length>0){a.graphSet.push(w);for(u=0;u<w.length;u++)d[++f]=w[u]}}for(u=0;u<a.graphSet.length;u++){var E=a.graphSet[u];for(c=0;c<E.length;c++){var C=a.idToIndex[E[c]];a.indexToGraph[C]=u}}for(u=0;u<a.edgeSize;u++){var S=r[u],_={};_.id=S.data("id"),_.sourceId=S.data("source"),_.targetId=S.data("target");var k=x(n.idealEdgeLength)?n.idealEdgeLength(S):n.idealEdgeLength,A=x(n.edgeElasticity)?n.edgeElasticity(S):n.edgeElasticity,T=a.idToIndex[_.sourceId],P=a.idToIndex[_.targetId];if(a.indexToGraph[T]!=a.indexToGraph[P]){for(var M=Za(_.sourceId,_.targetId,a),D=a.graphSet[M],I=0,O=a.layoutNodes[T];-1===D.indexOf(O.id);)O=a.layoutNodes[a.idToIndex[O.parentId]],I++;for(O=a.layoutNodes[P];-1===D.indexOf(O.id);)O=a.layoutNodes[a.idToIndex[O.parentId]],I++;k*=I*n.nestingFactor}_.idealLength=k,_.elasticity=A,a.layoutEdges.push(_)}return a},Za=function(e,t,n){var r=$a(e,t,0,n);return 2>r.count?0:r.graph},$a=function e(t,n,r,i){var a=i.graphSet[r];if(-1<a.indexOf(t)&&-1<a.indexOf(n))return{count:2,graph:r};for(var o=0,s=0;s<a.length;s++){var u=a[s],l=i.idToIndex[u],c=i.layoutNodes[l].children;if(0!==c.length){var h=e(t,n,i.indexToGraph[i.idToIndex[c[0]]],i);if(0!==h.count){if(1!==h.count)return h;if(2===++o)break}}}return{count:o,graph:r}},Qa=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var a=e.layoutNodes[i];0!==a.children.length||a.isLocked||(a.positionX=Math.random()*n,a.positionY=Math.random()*r)}},Ja=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach((function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,a){var o=e.layoutNodes[e.idToIndex[n.data("id")]];if(t.boundingBox){var s=(o.positionX-i.x1)/i.w,u=(o.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+u*r.h}}return{x:o.positionX,y:o.positionY}}},eo=function(e,t,n){var r=n.layout,i=n.eles.nodes(),a=Ja(e,n,i);i.positions(a),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},to=function(e,t,n){no(e,t),so(e),uo(e,t),lo(e),co(e)},no=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,a=0;a<i;a++)for(var o=e.layoutNodes[e.idToIndex[r[a]]],s=a+1;s<i;s++){var u=e.layoutNodes[e.idToIndex[r[s]]];io(o,u,e,t)}},ro=function(e){return-e+2*e*Math.random()},io=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,a=t.positionY-e.positionY;0===i&&0===a&&(i=ro(1),a=ro(1));var o=ao(e,t,i,a);if(o>0)var s=(l=r.nodeOverlap*o)*i/(g=Math.sqrt(i*i+a*a)),u=l*a/g;else{var l,c=oo(e,i,a),h=oo(t,-1*i,-1*a),d=h.x-c.x,p=h.y-c.y,f=d*d+p*p,g=Math.sqrt(f);s=(l=(e.nodeRepulsion+t.nodeRepulsion)/f)*d/g,u=l*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=u),t.isLocked||(t.offsetX+=s,t.offsetY+=u)}},ao=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},oo=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,u=a/o,l={};return 0===t&&0<n||0===t&&0>n?(l.x=r,l.y=i+a/2,l):0<t&&-1*u<=s&&s<=u?(l.x=r+o/2,l.y=i+o*n/2/t,l):0>t&&-1*u<=s&&s<=u?(l.x=r-o/2,l.y=i-o*n/2/t,l):0<n&&(s<=-1*u||s>=u)?(l.x=r+a*t/2/n,l.y=i+a/2,l):0>n&&(s<=-1*u||s>=u)?(l.x=r-a*t/2/n,l.y=i-a/2,l):l},so=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],a=e.layoutNodes[i],o=e.idToIndex[r.targetId],s=e.layoutNodes[o],u=s.positionX-a.positionX,l=s.positionY-a.positionY;if(0!==u||0!==l){var c=oo(a,u,l),h=oo(s,-1*u,-1*l),d=h.x-c.x,p=h.y-c.y,f=Math.sqrt(d*d+p*p),g=Math.pow(r.idealLength-f,2)/r.elasticity;if(0!==f)var v=g*d/f,y=g*p/f;else v=0,y=0;a.isLocked||(a.offsetX+=v,a.offsetY+=y),s.isLocked||(s.offsetX-=v,s.offsetY-=y)}}},uo=function(e,t){if(0!==t.gravity)for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],i=r.length;if(0===n)var a=e.clientHeight/2,o=e.clientWidth/2;else{var s=e.layoutNodes[e.idToIndex[r[0]]],u=e.layoutNodes[e.idToIndex[s.parentId]];a=u.positionX,o=u.positionY}for(var l=0;l<i;l++){var c=e.layoutNodes[e.idToIndex[r[l]]];if(!c.isLocked){var h=a-c.positionX,d=o-c.positionY,p=Math.sqrt(h*h+d*d);if(p>1){var f=t.gravity*h/p,g=t.gravity*d/p;c.offsetX+=f,c.offsetY+=g}}}}},lo=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],u=s.children;if(0<u.length&&!s.isLocked){for(var l=s.offsetX,c=s.offsetY,h=0;h<u.length;h++){var d=e.layoutNodes[e.idToIndex[u[h]]];d.offsetX+=l,d.offsetY+=c,n[++i]=u[h]}s.offsetX=0,s.offsetY=0}}},co=function(e,t){for(var n=0;n<e.nodeSize;n++){0<(i=e.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(n=0;n<e.nodeSize;n++){if(!(0<(i=e.layoutNodes[n]).children.length||i.isLocked)){var r=ho(i.offsetX,i.offsetY,e.temperature);i.positionX+=r.x,i.positionY+=r.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,po(i,e)}}for(n=0;n<e.nodeSize;n++){var i;0<(i=e.layoutNodes[n]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},ho=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},po=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],a=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,a=!0),(null==i.minX||t.minX-i.padLeft<i.minX)&&(i.minX=t.minX-i.padLeft,a=!0),(null==i.maxY||t.maxY+i.padBottom>i.maxY)&&(i.maxY=t.maxY+i.padBottom,a=!0),(null==i.minY||t.minY-i.padTop<i.minY)&&(i.minY=t.minY-i.padTop,a=!0),a?e(i,n):void 0}},fo=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var a=n[i],o=a.cmptId;(r[o]=r[o]||[]).push(a)}var s=0;for(i=0;i<r.length;i++){if(g=r[i]){g.x1=1/0,g.x2=-1/0,g.y1=1/0,g.y2=-1/0;for(var u=0;u<g.length;u++){var l=g[u];g.x1=Math.min(g.x1,l.positionX-l.width/2),g.x2=Math.max(g.x2,l.positionX+l.width/2),g.y1=Math.min(g.y1,l.positionY-l.height/2),g.y2=Math.max(g.y2,l.positionY+l.height/2)}g.w=g.x2-g.x1,g.h=g.y2-g.y1,s+=g.w*g.h}}r.sort((function(e,t){return t.w*t.h-e.w*e.h}));var c=0,h=0,d=0,p=0,f=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(i=0;i<r.length;i++){var g;if(g=r[i]){for(u=0;u<g.length;u++){(l=g[u]).isLocked||(l.positionX+=c-g.x1,l.positionY+=h-g.y1)}c+=g.w+t.componentSpacing,d+=g.w+t.componentSpacing,p=Math.max(p,g.h),d>f&&(h+=p+t.componentSpacing,c=0,d=0,p=0)}}},go={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function vo(e){this.options=z({},go,e)}vo.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var a=Je(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===a.h||0===a.w)r.nodes().layoutPositions(this,t,(function(e){return{x:a.x1,y:a.y1}}));else{var o=i.size(),s=Math.sqrt(o*a.h/a.w),u=Math.round(s),l=Math.round(a.w/a.h*s),c=function(e){if(null==e)return Math.min(u,l);Math.min(u,l)==u?u=e:l=e},h=function(e){if(null==e)return Math.max(u,l);Math.max(u,l)==u?u=e:l=e},d=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=d&&null!=p)u=d,l=p;else if(null!=d&&null==p)u=d,l=Math.ceil(o/u);else if(null==d&&null!=p)l=p,u=Math.ceil(o/l);else if(l*u>o){var f=c(),g=h();(f-1)*g>=o?c(f-1):(g-1)*f>=o&&h(g-1)}else for(;l*u<o;){var v=c(),y=h();(y+1)*v>=o?h(y+1):c(v+1)}var m=a.w/l,b=a.h/u;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x<i.length;x++){var w=i[x],E=w._private.position;null!=E.x&&null!=E.y||(E.x=0,E.y=0);var C=w.layoutDimensions(t),S=t.avoidOverlapPadding,_=C.w+S,k=C.h+S;m=Math.max(m,_),b=Math.max(b,k)}for(var A={},T=function(e,t){return!!A["c-"+e+"-"+t]},P=function(e,t){A["c-"+e+"-"+t]=!0},M=0,D=0,I=function(){++D>=l&&(D=0,M++)},O={},B=0;B<i.length;B++){var N=i[B],L=t.position(N);if(L&&(void 0!==L.row||void 0!==L.col)){var R={row:L.row,col:L.col};if(void 0===R.col)for(R.col=0;T(R.row,R.col);)R.col++;else if(void 0===R.row)for(R.row=0;T(R.row,R.col);)R.row++;O[N.id()]=R,P(R.row,R.col)}}i.layoutPositions(this,t,(function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=O[e.id()];if(i)n=i.col*m+m/2+a.x1,r=i.row*b+b/2+a.y1;else{for(;T(M,D);)I();n=D*m+m/2+a.x1,r=M*b+b/2+a.y1,P(M,D),I()}return{x:n,y:r}}))}return this};var yo={ready:function(){},stop:function(){}};function mo(e){this.options=z({},yo,e)}mo.prototype.run=function(){var e=this.options,t=e.eles;e.cy;return this.emit("layoutstart"),t.nodes().positions((function(){return{x:0,y:0}})),this.one("layoutready",e.ready),this.emit("layoutready"),this.one("layoutstop",e.stop),this.emit("layoutstop"),this},mo.prototype.stop=function(){return this};var bo={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function xo(e){this.options=z({},bo,e)}xo.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=x(e.positions);return t.layoutPositions(this,e,(function(t,r){var i=function(t){if(null==e.positions)return function(e){return{x:e.x,y:e.y}}(t.position());if(n)return e.positions(t);var r=e.positions[t._private.data.id];return null==r?null:r}(t);return!t.locked()&&null!=i&&i})),this};var wo={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Eo(e){this.options=z({},wo,e)}Eo.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=Je(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,(function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}})),this};var Co=[{name:"breadthfirst",impl:Fa},{name:"circle",impl:Xa},{name:"concentric",impl:Ha},{name:"cose",impl:Ua},{name:"grid",impl:vo},{name:"null",impl:mo},{name:"preset",impl:xo},{name:"random",impl:Eo}];function So(e){this.options=e,this.notifications=0}var _o=function(){},ko=function(){throw new Error("A headless instance can not render images")};So.prototype={recalculateRenderedStyle:_o,notify:function(){this.notifications++},init:_o,isHeadless:function(){return!0},png:ko,jpg:ko};var Ao={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,a,o){var s=i.x-n/2-o,u=i.x+n/2+o,l=i.y-n/2-o,c=i.y+n/2+o;return s<=e&&e<=u&&l<=t&&t<=c},r=function(e,t,n,r,i){var a=e*Math.cos(r)-t*Math.sin(r),o=(e*Math.sin(r)+t*Math.cos(r))*n;return{x:a*n+i.x,y:o+i.y}},i=function(e,t,n,i){for(var a=[],o=0;o<e.length;o+=2){var s=e[o],u=e[o+1];a.push(r(s,u,t,n,i))}return a},a=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},o=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){b(s)&&(s=e[s]),e[r]=z({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,o,s){var u=a(i(this.points,n+2*s,r,o));return dt(e,t,u)},roughCollide:n,draw:function(e,n,r,a){var o=i(this.points,n,r,a);t.arrowShapeImpl("polygon")(e,o)},spacing:function(e){return 0},gap:o},s)};s("none",{collide:se,roughCollide:se,draw:le,spacing:ue,gap:ue}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,a,o,s){var u=i(this.points,n,a,o),l=this.controlPoint,c=r(l[0],l[1],n,a,o);t.arrowShapeImpl(this.name)(e,u,c)},gap:function(e){return.8*o(e)}}),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,n,r,o,s,u){var l=a(i(this.points,n+2*u,r,o)),c=a(i(this.pointsTee,n+2*u,r,o));return dt(e,t,l)||dt(e,t,c)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),u=i(this.pointsTee,n,r,a);t.arrowShapeImpl(this.name)(e,s,u)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,o,s,u){var l=o,c=Math.pow(l.x-e,2)+Math.pow(l.y-t,2)<=Math.pow((n+2*u)*this.radius,2),h=a(i(this.points,n+2*u,r,o));return dt(e,t,h)||c},draw:function(e,n,r,a,o){var s=i(this.pointsTr,n,r,a);t.arrowShapeImpl(this.name)(e,s,a.x,a.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.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){var n=this.baseCrossLinePts.slice(),r=t/e;return n[3]=n[3]-r,n[5]=n[5]-r,n},collide:function(e,t,n,r,o,s,u){var l=a(i(this.points,n+2*u,r,o)),c=a(i(this.crossLinePts(n,s),n+2*u,r,o));return dt(e,t,l)||dt(e,t,c)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),u=i(this.crossLinePts(n,o),n,r,a);t.arrowShapeImpl(this.name)(e,s,u)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return.525*o(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,i,a,o){var s=i;return Math.pow(s.x-e,2)+Math.pow(s.y-t,2)<=Math.pow((n+2*o)*this.radius,2)},draw:function(e,n,r,i,a){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){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){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return.95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})}},To={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],a=r[1],o=r[4],s=n.pan(),u=n.zoom();return[((e-i)/o-s.x)/u,((t-a)/o-s.y)/u]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=d.getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i=r("padding-left"),a=r("padding-right"),o=r("padding-top"),s=r("padding-bottom"),u=r("border-left-width"),l=r("border-right-width"),c=r("border-top-width"),h=(r("border-bottom-width"),e.clientWidth),p=e.clientHeight,f=i+a,g=o+s,v=u+l,y=t.width/(h+v),m=h-f,b=p-g,x=t.left+i+u,w=t.top+o+c;return this.containerBB=[x,w,m,b,y]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},findNearestElements:function(e,t,n,r){var i,a,o=this,s=this,u=s.getCachedZSortedEles(),l=[],c=s.cy.zoom(),h=s.cy.hasCompoundNodes(),d=(r?24:8)/c,p=(r?8:2)/c,f=(r?8:2)/c,g=1/0;function v(e,t){if(e.isNode()){if(a)return;a=e,l.push(e)}if(e.isEdge()&&(null==t||t<g))if(i){if(i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value)for(var n=0;n<l.length;n++)if(l[n].isEdge()){l[n]=e,i=e,g=null!=t?t:g;break}}else l.push(e),i=e,g=null!=t?t:g}function y(n){var r=n.outerWidth()+2*p,i=n.outerHeight()+2*p,a=r/2,u=i/2,l=n.position();if(l.x-a<=e&&e<=l.x+a&&l.y-u<=t&&t<=l.y+u&&s.nodeShapes[o.getNodeShape(n)].checkPoint(e,t,0,r,i,l.x,l.y))return v(n,0),!0}function m(n){var r,i=n._private,a=i.rscratch,u=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,p=u/2+d,f=p*p,g=2*p,m=i.source,b=i.target;if("segments"===a.edgeType||"straight"===a.edgeType||"haystack"===a.edgeType){for(var x=a.allpts,w=0;w+3<x.length;w+=2)if(ut(e,t,x[w],x[w+1],x[w+2],x[w+3],g)&&f>(r=ht(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType)for(x=a.allpts,w=0;w+5<a.allpts.length;w+=4)if(lt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],g)&&f>(r=ct(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=o.getArrowWidth(u,c),C=[{name:"source",x:a.arrowStartX,y:a.arrowStartY,angle:a.srcArrowAngle},{name:"target",x:a.arrowEndX,y:a.arrowEndY,angle:a.tgtArrowAngle},{name:"mid-source",x:a.midX,y:a.midY,angle:a.midsrcArrowAngle},{name:"mid-target",x:a.midX,y:a.midY,angle:a.midtgtArrowAngle}];for(w=0;w<C.length;w++){var S=C[w],_=s.arrowShapes[n.pstyle(S.name+"-arrow-shape").value],k=n.pstyle("width").pfValue;if(_.roughCollide(e,t,E,S.angle,{x:S.x,y:S.y},k,d)&&_.collide(e,t,E,S.angle,{x:S.x,y:S.y},k,d))return v(n),!0}h&&l.length>0&&(y(m),y(b))}function b(e,t,n){return xe(e,t,n)}function x(n,r){var i,a=n._private,o=f;i=r?r+"-":"",n.boundingBox();var s=a.labelBounds[r||"main"],u=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&u){var l=b(a.rscratch,"labelX",r),c=b(a.rscratch,"labelY",r),h=b(a.rscratch,"labelAngle",r),d=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-o-d,y=s.x2+o-d,m=s.y1-o-p,x=s.y2+o-p;if(h){var w=Math.cos(h),E=Math.sin(h),C=function(e,t){return{x:(e-=l)*w-(t-=c)*E+l,y:e*E+t*w+c}},S=C(g,m),_=C(g,x),k=C(y,m),A=C(y,x),T=[S.x+d,S.y+p,k.x+d,k.y+p,A.x+d,A.y+p,_.x+d,_.y+p];if(dt(e,t,T))return v(n),!0}else if(at(s,e,t))return v(n),!0}}n&&(u=u.interactive);for(var w=u.length-1;w>=0;w--){var E=u[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return l},getAllInBox:function(e,t,n,r){for(var i,a,o=this.getCachedZSortedEles().interactive,s=[],u=Math.min(e,n),l=Math.max(e,n),c=Math.min(t,r),h=Math.max(t,r),d=Je({x1:e=u,y1:t=c,x2:n=l,y2:r=h}),p=0;p<o.length;p++){var f=o[p];if(f.isNode()){var g=f,v=g.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});it(d,v)&&!ot(v,d)&&s.push(g)}else{var y=f,m=y._private,b=m.rscratch;if(null!=b.startX&&null!=b.startY&&!at(d,b.startX,b.startY))continue;if(null!=b.endX&&null!=b.endY&&!at(d,b.endX,b.endY))continue;if("bezier"===b.edgeType||"multibezier"===b.edgeType||"self"===b.edgeType||"compound"===b.edgeType||"segments"===b.edgeType||"haystack"===b.edgeType){for(var x=m.rstyle.bezierPts||m.rstyle.linePts||m.rstyle.haystackPts,w=!0,E=0;E<x.length;E++)if(i=d,a=x[E],!at(i,a.x,a.y)){w=!1;break}w&&s.push(y)}else"haystack"!==b.edgeType&&"straight"!==b.edgeType||s.push(y)}}return s}},Po={calculateArrowAngles:function(e){var t,n,r,i,a,o,s=e._private.rscratch,u="haystack"===s.edgeType,l="bezier"===s.edgeType,c="multibezier"===s.edgeType,h="segments"===s.edgeType,d="compound"===s.edgeType,p="self"===s.edgeType;if(u?(r=s.haystackPts[0],i=s.haystackPts[1],a=s.haystackPts[2],o=s.haystackPts[3]):(r=s.arrowStartX,i=s.arrowStartY,a=s.arrowEndX,o=s.arrowEndY),g=s.midX,v=s.midY,h)t=r-s.segpts[0],n=i-s.segpts[1];else if(c||d||p||l){var f=s.allpts;t=r-Ze(f[0],f[2],f[4],.1),n=i-Ze(f[1],f[3],f[5],.1)}else t=r-g,n=i-v;s.srcArrowAngle=Ye(t,n);var g=s.midX,v=s.midY;if(u&&(g=(r+a)/2,v=(i+o)/2),t=a-r,n=o-i,h)if((f=s.allpts).length/2%2==0){var y=(m=f.length/2)-2;t=f[m]-f[y],n=f[m+1]-f[y+1]}else{y=(m=f.length/2-1)-2;var m,b=m+2;t=f[m]-f[y],n=f[m+1]-f[y+1]}else if(c||d||p){var x,w,E,C,f=s.allpts;if(s.ctrlpts.length/2%2==0){var S=(_=(k=f.length/2-1)+2)+2;x=Ze(f[k],f[_],f[S],0),w=Ze(f[k+1],f[_+1],f[S+1],0),E=Ze(f[k],f[_],f[S],1e-4),C=Ze(f[k+1],f[_+1],f[S+1],1e-4)}else{var _,k;S=(_=f.length/2-1)+2;x=Ze(f[k=_-2],f[_],f[S],.4999),w=Ze(f[k+1],f[_+1],f[S+1],.4999),E=Ze(f[k],f[_],f[S],.5),C=Ze(f[k+1],f[_+1],f[S+1],.5)}t=E-x,n=C-w}(s.midtgtArrowAngle=Ye(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,h)&&((f=s.allpts).length/2%2==0||(t=-(f[b=(m=f.length/2-1)+2]-f[m]),n=-(f[b+1]-f[m+1])));if(s.midsrcArrowAngle=Ye(t,n),h)t=a-s.segpts[s.segpts.length-2],n=o-s.segpts[s.segpts.length-1];else if(c||d||p||l){var A=(f=s.allpts).length;t=a-Ze(f[A-6],f[A-4],f[A-2],.9),n=o-Ze(f[A-5],f[A-3],f[A-1],.9)}else t=a-g,n=o-v;s.tgtArrowAngle=Ye(t,n)}};Po.getArrowWidth=Po.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r,r)};var Mo={};function Do(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}Mo.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var a=2*Math.random()*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=2*Math.random()*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var o=r.source,s=r.target,u=o.position(),l=s.position(),c=o.width(),h=s.width(),d=o.height(),p=s.height(),f=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*c*f+u.x,i.source.y*d*f+u.y,i.target.x*h*f+l.x,i.target.y*p*f+l.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},Mo.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=t.posPts,i=t.intersectionPts,a=t.vectorNormInverse,o=e.pstyle("edge-distances").value,s=e.pstyle("segment-weights"),u=e.pstyle("segment-distances"),l=Math.min(s.pfValue.length,u.pfValue.length);n.edgeType="segments",n.segpts=[];for(var c=0;c<l;c++){var h=s.pfValue[c],d=u.pfValue[c],p=1-h,f=h,g="node-position"===o?r:i,v={x:g.x1*p+g.x2*f,y:g.y1*p+g.y2*f};n.segpts.push(v.x+a.x*d,v.y+a.y*d)}},Mo.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,a=t.dirCounts,o=t.srcPos,s=e.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=e.pstyle("loop-direction").pfValue,c=e.pstyle("loop-sweep").pfValue,h=e.pstyle("control-point-step-size").pfValue;i.edgeType="self";var d=n,p=h;r&&(d=0,p=u);var f=l-Math.PI/2,g=f-c/2,v=f+c/2,y=String(l+"_"+c);d=void 0===a[y]?a[y]=0:++a[y],i.ctrlpts=[o.x+1.4*Math.cos(g)*p*(d/3+1),o.y+1.4*Math.sin(g)*p*(d/3+1),o.x+1.4*Math.cos(v)*p*(d/3+1),o.y+1.4*Math.sin(v)*p*(d/3+1)]},Mo.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType="compound";var a=t.srcPos,o=t.tgtPos,s=t.srcW,u=t.srcH,l=t.tgtW,c=t.tgtH,h=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),p=d?d.pfValue[0]:void 0,f=n,g=h;r&&(f=0,g=p);var v={x:a.x-s/2,y:a.y-u/2},y={x:o.x-l/2,y:o.y-c/2},m={x:Math.min(v.x,y.x),y:Math.min(v.y,y.y)},b=Math.max(.5,Math.log(.01*s)),x=Math.max(.5,Math.log(.01*l));i.ctrlpts=[m.x,m.y-(1+Math.pow(50,1.12)/100)*g*(f/3+1)*b,m.x-(1+Math.pow(50,1.12)/100)*g*(f/3+1)*x,m.y]},Mo.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},Mo.findBezierPoints=function(e,t,n,r,i){var a=e._private.rscratch,o=t.vectorNormInverse,s=t.posPts,u=t.intersectionPts,l=e.pstyle("edge-distances").value,c=e.pstyle("control-point-step-size").pfValue,h=e.pstyle("control-point-distances"),d=e.pstyle("control-point-weights"),p=h&&d?Math.min(h.value.length,d.value.length):1,f=h?h.pfValue[0]:void 0,g=d.value[0],v=r;a.edgeType=v?"multibezier":"bezier",a.ctrlpts=[];for(var y=0;y<p;y++){var m=(.5-t.eles.length/2+n)*c*(i?-1:1),b=void 0,x=He(m);v&&(f=h?h.pfValue[y]:c,g=d.value[y]);var w=void 0!==(b=r?f:void 0!==f?x*f:void 0)?b:m,E=1-g,C=g,S="node-position"===l?s:u,_={x:S.x1*E+S.x2*C,y:S.y1*E+S.y2*C};a.ctrlpts.push(_.x+o.x*w,_.y+o.y*w)}},Mo.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r=t.posPts,i=t.srcW,a=t.srcH,o=t.tgtW,s=t.tgtH,u="node-position"!==e.pstyle("edge-distances").value,l=e.pstyle("taxi-direction").value,c=l,h=e.pstyle("taxi-turn"),d="%"===h.units,p=h.pfValue,f=p<0,g=e.pstyle("taxi-turn-min-distance").pfValue,v=u?(i+o)/2:0,y=u?(a+s)/2:0,m=r.x2-r.x1,b=r.y2-r.y1,x=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},w=x(m,v),E=x(b,y),C=!1;"auto"===c?l=Math.abs(w)>Math.abs(E)?"horizontal":"vertical":"upward"===c||"downward"===c?(l="vertical",C=!0):"leftward"!==c&&"rightward"!==c||(l="horizontal",C=!0);var S,_="vertical"===l,k=_?E:w,A=_?b:m,T=He(A),P=!1;(C&&(d||f)||!("downward"===c&&A<0||"upward"===c&&A>0||"leftward"===c&&A>0||"rightward"===c&&A<0)||(k=(T*=-1)*Math.abs(k),P=!0),d)?S=(p<0?1+p:p)*k:S=(p<0?k:0)+p*T;var M=function(e){return Math.abs(e)<g||Math.abs(e)>=Math.abs(k)},D=M(S),I=M(Math.abs(k)-Math.abs(S));if((D||I)&&!P)if(_){var O=Math.abs(A)<=a/2,B=Math.abs(m)<=o/2;if(O){var N=(r.x1+r.x2)/2,L=r.y1,R=r.y2;n.segpts=[N,L,N,R]}else if(B){var j=(r.y1+r.y2)/2,z=r.x1,V=r.x2;n.segpts=[z,j,V,j]}else n.segpts=[r.x1,r.y2]}else{var F=Math.abs(A)<=i/2,q=Math.abs(b)<=s/2;if(F){var X=(r.y1+r.y2)/2,Y=r.x1,W=r.x2;n.segpts=[Y,X,W,X]}else if(q){var H=(r.x1+r.x2)/2,G=r.y1,U=r.y2;n.segpts=[H,G,H,U]}else n.segpts=[r.x2,r.y1]}else if(_){var K=r.y1+S+(u?a/2*T:0),Z=r.x1,$=r.x2;n.segpts=[Z,K,$,K]}else{var Q=r.x1+S+(u?i/2*T:0),J=r.y1,ee=r.y2;n.segpts=[Q,J,Q,ee]}},Mo.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,u=t.tgtH,l=t.srcShape,c=t.tgtShape,h=!C(n.startX)||!C(n.startY),d=!C(n.arrowStartX)||!C(n.arrowStartY),p=!C(n.endX)||!C(n.endY),f=!C(n.arrowEndX)||!C(n.arrowEndY),g=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),v=Ge({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),y=v<g,m=Ge({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=m<g,x=!1;if(h||d||y){x=!0;var w={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},E=Math.sqrt(w.x*w.x+w.y*w.y),S={x:w.x/E,y:w.y/E},_=Math.max(a,o),k={x:n.ctrlpts[0]+2*S.x*_,y:n.ctrlpts[1]+2*S.y*_},A=l.intersectLine(r.x,r.y,a,o,k.x,k.y,0);y?(n.ctrlpts[0]=n.ctrlpts[0]+S.x*(g-v),n.ctrlpts[1]=n.ctrlpts[1]+S.y*(g-v)):(n.ctrlpts[0]=A[0]+S.x*g,n.ctrlpts[1]=A[1]+S.y*g)}if(p||f||b){x=!0;var T={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},P=Math.sqrt(T.x*T.x+T.y*T.y),M={x:T.x/P,y:T.y/P},D=Math.max(a,o),I={x:n.ctrlpts[0]+2*M.x*D,y:n.ctrlpts[1]+2*M.y*D},O=c.intersectLine(i.x,i.y,s,u,I.x,I.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+M.x*(g-m),n.ctrlpts[1]=n.ctrlpts[1]+M.y*(g-m)):(n.ctrlpts[0]=O[0]+M.x*g,n.ctrlpts[1]=O[1]+M.y*g)}x&&this.findEndpoints(e)}},Mo.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);var r;t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,.5,t.midX=Ze(t.allpts[r],t.allpts[r+2],t.allpts[r+4],.5),t.midY=Ze(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],.5))}else if("straight"===t.edgeType)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("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var i=t.segpts.length/2,a=i-2;t.midX=(t.segpts[a]+t.segpts[i])/2,t.midY=(t.segpts[a+1]+t.segpts[i+1])/2}else{var o=t.segpts.length/2-1;t.midX=t.segpts[o],t.midY=t.segpts[o+1]}},Mo.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||C(t.startX)&&C(t.startY)&&C(t.endX)&&C(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,de(e.id()))},Mo.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new Ee,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new Ee,this.map.set(e[0],n)),n.set(e[1],t)}},a=[],o=[],s=0;s<e.length;s++){var u=e[s],l=u._private,c=u.pstyle("curve-style").value;if(!u.removed()&&u.takesUpSpace())if("haystack"!==c){var h="unbundled-bezier"===c||"segments"===c||"straight"===c||"straight-triangle"===c||"taxi"===c,d="unbundled-bezier"===c||"bezier"===c,p=l.source,f=l.target,g=[p.poolIndex(),f.poolIndex()].sort(),v=i.get(g);null==v&&(v={eles:[]},i.set(g,v),a.push(g)),v.eles.push(u),h&&(v.hasUnbundled=!0),d&&(v.hasBezier=!0)}else o.push(u)}for(var y=function(e){var o=a[e],s=i.get(o),u=void 0;if(!s.hasUnbundled){var l=s.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));be(s.eles),l.forEach((function(e){return s.eles.push(e)})),s.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var c=s.eles[0],h=c.source(),d=c.target();if(h.poolIndex()>d.poolIndex()){var p=h;h=d,d=p}var f=s.srcPos=h.position(),g=s.tgtPos=d.position(),v=s.srcW=h.outerWidth(),y=s.srcH=h.outerHeight(),m=s.tgtW=d.outerWidth(),b=s.tgtH=d.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(h)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(d)];s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var E=0;E<s.eles.length;E++){var S=s.eles[E],_=S[0]._private.rscratch,k=S.pstyle("curve-style").value,A="unbundled-bezier"===k||"segments"===k||"taxi"===k,T=!h.same(S.source());if(!s.calculatedIntersection&&h!==d&&(s.hasBezier||s.hasUnbundled)){s.calculatedIntersection=!0;var P=x.intersectLine(f.x,f.y,v,y,g.x,g.y,0),M=s.srcIntn=P,D=w.intersectLine(g.x,g.y,m,b,f.x,f.y,0),I=s.tgtIntn=D,O=s.intersectionPts={x1:P[0],x2:D[0],y1:P[1],y2:D[1]},B=s.posPts={x1:f.x,x2:g.x,y1:f.y,y2:g.y},N=D[1]-P[1],L=D[0]-P[0],R=Math.sqrt(L*L+N*N),j=s.vector={x:L,y:N},z=s.vectorNorm={x:j.x/R,y:j.y/R},V={x:-z.y,y:z.x};s.nodesOverlap=!C(R)||w.checkPoint(P[0],P[1],0,m,b,g.x,g.y)||x.checkPoint(D[0],D[1],0,v,y,f.x,f.y),s.vectorNormInverse=V,u={nodesOverlap:s.nodesOverlap,dirCounts:s.dirCounts,calculatedIntersection:!0,hasBezier:s.hasBezier,hasUnbundled:s.hasUnbundled,eles:s.eles,srcPos:g,tgtPos:f,srcW:m,srcH:b,tgtW:v,tgtH:y,srcIntn:I,tgtIntn:M,srcShape:w,tgtShape:x,posPts:{x1:B.x2,y1:B.y2,x2:B.x1,y2:B.y1},intersectionPts:{x1:O.x2,y1:O.y2,x2:O.x1,y2:O.y1},vector:{x:-j.x,y:-j.y},vectorNorm:{x:-z.x,y:-z.y},vectorNormInverse:{x:-V.x,y:-V.y}}}var F=T?u:s;_.nodesOverlap=F.nodesOverlap,_.srcIntn=F.srcIntn,_.tgtIntn=F.tgtIntn,r&&(h.isParent()||h.isChild()||d.isParent()||d.isChild())&&(h.parents().anySame(d)||d.parents().anySame(h)||h.same(d)&&h.isParent())?t.findCompoundLoopPoints(S,F,E,A):h===d?t.findLoopPoints(S,F,E,A):"segments"===k?t.findSegmentsPoints(S,F):"taxi"===k?t.findTaxiPoints(S,F):"straight"===k||!A&&s.eles.length%2==1&&E===Math.floor(s.eles.length/2)?t.findStraightEdgePoints(S):t.findBezierPoints(S,F,E,A,T),t.findEndpoints(S),t.tryToCorrectInvalidPoints(S,F),t.checkForInvalidEdgeWarning(S),t.storeAllpts(S),t.storeEdgeProjections(S),t.calculateArrowAngles(S),t.recalculateEdgeLabelProjections(S),t.calculateLabelAngles(S)}},m=0;m<a.length;m++)y(m);this.findHaystackPoints(o)}},Mo.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),Do(t.segpts)},Mo.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),Do(t.ctrlpts)},Mo.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Io={manualEndptToPx:function(e,t){var n=e.position(),r=e.outerWidth(),i=e.outerHeight();if(2===t.value.length){var a=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(a[0]=a[0]*r),"%"===t.units[1]&&(a[1]=a[1]*i),a[0]+=n.x,a[1]+=n.y,a}var o=t.pfValue[0];o=-Math.PI/2+o;var s=2*Math.max(r,i),u=[n.x+Math.cos(o)*s,n.y+Math.sin(o)*s];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,i,u[0],u[1],0)},findEndpoints:function(e){var t,n,r,i,a,o=this,s=e.source()[0],u=e.target()[0],l=s.position(),c=u.position(),h=e.pstyle("target-arrow-shape").value,d=e.pstyle("source-arrow-shape").value,p=e.pstyle("target-distance-from-node").pfValue,f=e.pstyle("source-distance-from-node").pfValue,g=e.pstyle("curve-style").value,v=e._private.rscratch,y=v.edgeType,m="self"===y||"compound"===y,b="bezier"===y||"multibezier"===y||m,x="bezier"!==y,w="straight"===y||"segments"===y,E="segments"===y,S=b||x||w,_=m||"taxi"===g,k=e.pstyle("source-endpoint"),A=_?"outside-to-node":k.value,T=e.pstyle("target-endpoint"),P=_?"outside-to-node":T.value;if(v.srcManEndpt=k,v.tgtManEndpt=T,b){var M=[v.ctrlpts[0],v.ctrlpts[1]];n=x?[v.ctrlpts[v.ctrlpts.length-2],v.ctrlpts[v.ctrlpts.length-1]]:M,r=M}else if(w){var D=E?v.segpts.slice(0,2):[c.x,c.y];n=E?v.segpts.slice(v.segpts.length-2):[l.x,l.y],r=D}if("inside-to-node"===P)t=[c.x,c.y];else if(T.units)t=this.manualEndptToPx(u,T);else if("outside-to-line"===P)t=v.tgtIntn;else if("outside-to-node"===P||"outside-to-node-or-label"===P?i=n:"outside-to-line"!==P&&"outside-to-line-or-label"!==P||(i=[l.x,l.y]),t=o.nodeShapes[this.getNodeShape(u)].intersectLine(c.x,c.y,u.outerWidth(),u.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===P||"outside-to-line-or-label"===P){var I=u._private.rscratch,O=I.labelWidth,B=I.labelHeight,N=I.labelX,L=I.labelY,R=O/2,j=B/2,z=u.pstyle("text-valign").value;"top"===z?L-=j:"bottom"===z&&(L+=j);var V=u.pstyle("text-halign").value;"left"===V?N-=R:"right"===V&&(N+=R);var F=xt(i[0],i[1],[N-R,L-j,N+R,L-j,N+R,L+j,N-R,L+j],c.x,c.y);if(F.length>0){var q=l,X=Ue(q,Xe(t)),Y=Ue(q,Xe(F)),W=X;if(Y<X&&(t=F,W=Y),F.length>2)Ue(q,{x:F[2],y:F[3]})<W&&(t=[F[2],F[3]])}}var H=wt(t,n,o.arrowShapes[h].spacing(e)+p),G=wt(t,n,o.arrowShapes[h].gap(e)+p);if(v.endX=G[0],v.endY=G[1],v.arrowEndX=H[0],v.arrowEndY=H[1],"inside-to-node"===A)t=[l.x,l.y];else if(k.units)t=this.manualEndptToPx(s,k);else if("outside-to-line"===A)t=v.srcIntn;else if("outside-to-node"===A||"outside-to-node-or-label"===A?a=r:"outside-to-line"!==A&&"outside-to-line-or-label"!==A||(a=[c.x,c.y]),t=o.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),a[0],a[1],0),"outside-to-node-or-label"===A||"outside-to-line-or-label"===A){var U=s._private.rscratch,K=U.labelWidth,Z=U.labelHeight,$=U.labelX,Q=U.labelY,J=K/2,ee=Z/2,te=s.pstyle("text-valign").value;"top"===te?Q-=ee:"bottom"===te&&(Q+=ee);var ne=s.pstyle("text-halign").value;"left"===ne?$-=J:"right"===ne&&($+=J);var re=xt(a[0],a[1],[$-J,Q-ee,$+J,Q-ee,$+J,Q+ee,$-J,Q+ee],l.x,l.y);if(re.length>0){var ie=c,ae=Ue(ie,Xe(t)),oe=Ue(ie,Xe(re)),se=ae;if(oe<ae&&(t=[re[0],re[1]],se=oe),re.length>2)Ue(ie,{x:re[2],y:re[3]})<se&&(t=[re[2],re[3]])}}var ue=wt(t,r,o.arrowShapes[d].spacing(e)+f),le=wt(t,r,o.arrowShapes[d].gap(e)+f);v.startX=le[0],v.startY=le[1],v.arrowStartX=ue[0],v.arrowStartY=ue[1],S&&(C(v.startX)&&C(v.startY)&&C(v.endX)&&C(v.endY)?v.badLine=!1:v.badLine=!0)},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}}},Oo={};function Bo(e,t,n){for(var r=function(e,t,n,r){return Ze(e,t,n,r)},i=t._private.rstyle.bezierPts,a=0;a<e.bezierProjPcts.length;a++){var o=e.bezierProjPcts[a];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}Oo.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)Bo(this,e,n.allpts.slice(i,i+6))}else if("segments"===r){var a=t.rstyle.linePts=[];for(i=0;i+1<n.allpts.length;i+=2)a.push({x:n.allpts[i],y:n.allpts[i+1]})}else if("haystack"===r){var o=n.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},Oo.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var No={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!M(t)){var n,r,i=e._private,a=e.width(),o=e.height(),s=e.padding(),u=e.position(),l=e.pstyle("text-halign").strValue,c=e.pstyle("text-valign").strValue,h=i.rscratch,d=i.rstyle;switch(l){case"left":n=u.x-a/2-s;break;case"right":n=u.x+a/2+s;break;default:n=u.x}switch(c){case"top":r=u.y-o/2-s;break;case"bottom":r=u.y+o/2+s;break;default:r=u.y}h.labelX=n,h.labelY=r,d.labelX=n,d.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},Lo=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},Ro=function(e,t){var n=t.x-e.x,r=t.y-e.y;return Lo(n,r)};No.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,a={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(a.mid||a.source||a.target){t={x:r.midX,y:r.midY};var o=function(e,t,r){we(n.rscratch,e,t,r),we(n.rstyle,e,t,r)};o("labelX",null,t.x),o("labelY",null,t.y);var s=Lo(r.midDispX,r.midDispY);o("labelAutoAngle",null,s);var u=function(s){var u,l="source"===s;if(a[s]){var c=e.pstyle(s+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var h,d=function e(){if(e.cache)return e.cache;for(var t=[],a=0;a+5<r.allpts.length;a+=4){var o={x:r.allpts[a],y:r.allpts[a+1]},s={x:r.allpts[a+2],y:r.allpts[a+3]},u={x:r.allpts[a+4],y:r.allpts[a+5]};t.push({p0:o,p1:s,p2:u,startDist:0,length:0,segments:[]})}var l=n.rstyle.bezierPts,c=i.bezierProjPcts.length;function h(e,t,n,r,i){var a=Ge(t,n),o=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:o?o.startDist+o.length:0,length:a};e.segments.push(s),e.length+=a}for(var d=0;d<t.length;d++){var p=t[d],f=t[d-1];f&&(p.startDist=f.startDist+f.length),h(p,p.p0,l[d*c],0,i.bezierProjPcts[0]);for(var g=0;g<c-1;g++)h(p,l[d*c+g],l[d*c+g+1],i.bezierProjPcts[g],i.bezierProjPcts[g+1]);h(p,l[d*c+c-1],p.p2,i.bezierProjPcts[c-1],1)}return e.cache=t}(),p=0,f=0,g=0;g<d.length;g++){for(var v=d[l?g:d.length-1-g],y=0;y<v.segments.length;y++){var m=v.segments[l?y:v.segments.length-1-y],b=g===d.length-1&&y===v.segments.length-1;if(p=f,(f+=m.length)>=c||b){h={cp:v,segment:m};break}}if(h)break}var x=h.cp,w=h.segment,E=(c-p)/w.length,C=w.t1-w.t0,S=l?w.t0+C*E:w.t1-C*E;S=Qe(0,S,1),t=$e(x.p0,x.p1,x.p2,S),u=function(e,t,n,r){var i=Qe(0,r-.001,1),a=Qe(0,r+.001,1),o=$e(e,t,n,i),s=$e(e,t,n,a);return Ro(o,s)}(x.p0,x.p1,x.p2,S);break;case"straight":case"segments":case"haystack":for(var _,k,A,T,P=0,M=r.allpts.length,D=0;D+3<M&&(l?(A={x:r.allpts[D],y:r.allpts[D+1]},T={x:r.allpts[D+2],y:r.allpts[D+3]}):(A={x:r.allpts[M-2-D],y:r.allpts[M-1-D]},T={x:r.allpts[M-4-D],y:r.allpts[M-3-D]}),k=P,!((P+=_=Ge(A,T))>=c));D+=2);var I=(c-k)/_;I=Qe(0,I,1),t=function(e,t,n,r){var i=t.x-e.x,a=t.y-e.y,o=Ge(e,t),s=i/o,u=a/o;return n=null==n?0:n,r=null!=r?r:n*o,{x:e.x+s*r,y:e.y+u*r}}(A,T,I),u=Ro(A,T)}o("labelX",s,t.x),o("labelY",s,t.y),o("labelAutoAngle",s,u)}};u("source"),u("target"),this.applyLabelDimensions(e)}},No.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},No.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),a=e.pstyle("line-height").pfValue,o=e.pstyle("text-wrap").strValue,s=xe(n.rscratch,"labelWrapCachedLines",t)||[],u="wrap"!==o?1:Math.max(s.length,1),l=i.height/u,c=l*a,h=i.width,d=i.height+(u-1)*(a-1)*l;we(n.rstyle,"labelWidth",t,h),we(n.rscratch,"labelWidth",t,h),we(n.rstyle,"labelHeight",t,d),we(n.rscratch,"labelHeight",t,d),we(n.rscratch,"labelLineHeight",t,c)},No.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,a=e.pstyle("text-transform").value,o=function(e,r){return r?(we(n.rscratch,e,t,r),r):xe(n.rscratch,e,t)};if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var u=o("labelKey");if(null!=u&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l=i.split("\n"),c=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,d=[],p=/[\s\u200b]+/,f=h?"":" ",g=0;g<l.length;g++){var v=l[g],y=this.calculateLabelDimensions(e,v).width;if(h){var m=v.split("").join("​");v=m}if(y>c){for(var b=v.split(p),x="",w=0;w<b.length;w++){var E=b[w],C=0===x.length?E:x+f+E;this.calculateLabelDimensions(e,C).width<=c?x+=E+f:(x&&d.push(x),x=E+f)}x.match(/^[\s\u200b]+$/)||d.push(x)}else d.push(v)}o("labelWrapCachedLines",d),i=o("labelWrapCachedText",d.join("\n")),o("labelWrapKey",u)}else if("ellipsis"===s){var S=e.pstyle("text-max-width").pfValue,_="",k=!1;if(this.calculateLabelDimensions(e,i).width<S)return i;for(var A=0;A<i.length;A++){if(this.calculateLabelDimensions(e,_+i[A]+"…").width>S)break;_+=i[A],A===i.length-1&&(k=!0)}return k||(_+="…"),_}return i},No.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},No.calculateLabelDimensions=function(e,t){var n=te(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),i=r[n];if(null!=i)return i;var a=e.pstyle("font-style").strValue,o=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,u=e.pstyle("font-weight").strValue,l=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!l){l=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=l.getContext("2d");var h=l.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}c.font="".concat(a," ").concat(u," ").concat(o,"px ").concat(s);for(var d=0,p=0,f=t.split("\n"),g=0;g<f.length;g++){var v=f[g],y=c.measureText(v),m=Math.ceil(y.width),b=o;d=Math.max(m,d),p+=b}return d+=0,p+=0,r[n]={width:d,height:p}},No.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=t?t+"-":"",a=e.pstyle(i+"text-rotation"),o=a.strValue;return"none"===o?0:r&&"autorotate"===o?n.labelAutoAngle:"autorotate"===o?0:a.pfValue},No.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,"source"),r.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var jo={},zo=!1;jo.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return zo||(de(),zo=!0),"rectangle";if(e.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var Vo={registerCalculationListeners:function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r<e.length;r++){var i=e[r],a=i._private,o=a.rstyle;o.clean=!1,o.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",(function(e){var t=e.target;r(t)})).on("style.* background.*",(function(e){var t=e.target;r(t,!1)}));var i=function(i){if(i){var a=n.onUpdateEleCalcsFns;t.cleanStyle();for(var o=0;o<t.length;o++){var s=t[o],u=s._private.rstyle;s.isNode()&&!u.cleanConnected&&(r(s.connectedEdges()),u.cleanConnected=!0)}if(a)for(var l=0;l<a.length;l++){(0,a[l])(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],i=[];if(!this.destroyed){void 0===t&&(t=!0);for(var a=0;a<e.length;a++){var o=e[a],s=o._private,u=s.rstyle;!o.isEdge()||n(o.source())&&n(o.target())||(u.clean=!1),t&&u.clean||o.removed()||"none"!==o.pstyle("display").value&&("nodes"===s.group?i.push(o):r.push(o),u.clean=!0)}for(var l=0;l<i.length;l++){var c=i[l],h=c._private.rstyle,d=c.position();this.recalculateNodeLabelProjection(c),h.nodeX=d.x,h.nodeY=d.y,h.nodeW=c.pstyle("width").pfValue,h.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var p=0;p<r.length;p++){var f=r[p]._private,g=f.rstyle,v=f.rscratch;g.srcX=v.arrowStartX,g.srcY=v.arrowStartY,g.tgtX=v.arrowEndX,g.tgtY=v.arrowEndY,g.midX=v.midX,g.midY=v.midY,g.labelAngle=v.labelAngle,g.sourceLabelAngle=v.sourceLabelAngle,g.targetLabelAngle=v.targetLabelAngle}}}},Fo={updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(i=e[n])._private.rscratch;i.grabbed()&&!i.isParent()?t.push(i):r.inDragLayer?e.drag.push(i):e.nondrag.push(i)}for(n=0;n<t.length;n++){var i=t[n];e.drag.push(i)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(Pi),t.interactive=t.filter((function(e){return e.interactive()})),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}},qo={};[To,Po,Mo,Io,Oo,No,jo,Vo,Fo].forEach((function(e){z(qo,e)}));var Xo={getCachedImage:function(e,t,n){var r=this.imageCache=this.imageCache||{},i=r[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;var a=(i=r[e]=r[e]||{}).image=new Image;a.addEventListener("load",n),a.addEventListener("error",(function(){a.error=!0}));return"data:"===e.substring(0,"data:".length).toLowerCase()||(a.crossOrigin=t),a.src=e,a}},Yo={registerBinding:function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),a=this.binder(e);return a.on.apply(a,i)}};Yo.binder=function(e){var t,n=this,r=e===window||e===document||e===document.body||(t=e,"undefined"!=typeof HTMLElement&&t instanceof HTMLElement);if(null==n.supportsPassiveEvents){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});window.addEventListener("test",null,a)}catch(e){}n.supportsPassiveEvents=i}var o=function(t,i,a){var o=Array.prototype.slice.call(arguments);return r&&n.supportsPassiveEvents&&(o[2]={capture:null!=a&&a,passive:!1,once:!1}),n.bindings.push({target:e,args:o}),(e.addEventListener||e.on).apply(e,o),this};return{on:o,addEventListener:o,addListener:o,bind:o}},Yo.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},Yo.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},Yo.load=function(){var e=this,t=function(e){return e.selected()},n=function(t,n,r,i){null==t&&(t=e.cy);for(var a=0;a<n.length;a++){var o=n[a];t.emit({originalEvent:r,type:o,position:i})}},r=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},a=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable())for(var i=0;n&&i<n.length;i++){if((t=n[i]).isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},o=function(e){e[0]._private.rscratch.inDragLayer=!0},s=function(e){e[0]._private.rscratch.isGrabTarget=!0},u=function(e,t){var n=t.addToList;n.has(e)||(n.merge(e),function(e){e[0]._private.grabbed=!0}(e))},l=function(t,n){n=n||{};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(o),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(o)),n.addToList&&t.forEach((function(e){u(e,n)})),function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(o),n.connectedEdges().forEach(o)),t.addToList&&t.addToList.unmerge(n)}}(t,n),d(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},c=l,h=function(t){t&&(e.getCachedZSortedEles().forEach((function(e){!function(e){e[0]._private.grabbed=!1}(e),function(e){e[0]._private.rscratch.inDragLayer=!1}(e),function(e){e[0]._private.rscratch.isGrabTarget=!1}(e)})),e.updateCachedGrabbedEles())},d=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(o),r.forEach(o)),t.addToList&&r.forEach((function(e){u(e,t)}))}}},p=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},f="undefined"!=typeof MutationObserver,g="undefined"!=typeof ResizeObserver;f?(e.removeObserver=new MutationObserver((function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r)for(var i=0;i<r.length;i++){if(r[i]===e.container){e.destroy();break}}}})),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}));var v=i((function(){e.cy.resize()}),100);f&&(e.styleObserver=new MutationObserver(v),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(window,"resize",v),g&&(e.resizeObserver=new ResizeObserver(v),e.resizeObserver.observe(e.container));var y=function(){e.invalidateContainerClientCoordsCache()};!function(e,t){for(;null!=e;)t(e),e=e.parentNode}(e.container,(function(t){e.registerBinding(t,"transitionend",y),e.registerBinding(t,"animationend",y),e.registerBinding(t,"scroll",y)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var m,b,x,w=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],a=n[2],o=n[3],s=t.touches?t.touches:[t],u=!1,l=0;l<s.length;l++){var c=s[l];if(r<=c.clientX&&c.clientX<=r+a&&i<=c.clientY&&c.clientY<=i+o){u=!0;break}}if(!u)return!1;for(var h=e.container,d=t.target.parentNode,p=!1;d;){if(d===h){p=!0;break}d=d.parentNode}return!!p};e.registerBinding(e.container,"mousedown",(function(t){if(w(t)){t.preventDefault(),p(),e.hoverData.capture=!0,e.hoverData.which=t.which;var r=e.cy,i=[t.clientX,t.clientY],a=e.projectIntoViewport(i[0],i[1]),o=e.selection,u=e.findNearestElements(a[0],a[1],!0,!1),h=u[0],d=e.dragData.possibleDragElements;e.hoverData.mdownPos=a,e.hoverData.mdownGPos=i;if(3==t.which){e.hoverData.cxtStarted=!0;var f={originalEvent:t,type:"cxttapstart",position:{x:a[0],y:a[1]}};h?(h.activate(),h.emit(f),e.hoverData.down=h):r.emit(f),e.hoverData.downTime=(new Date).getTime(),e.hoverData.cxtDragged=!1}else if(1==t.which){if(h&&h.activate(),null!=h&&e.nodeIsGrabbable(h)){var g=function(e){return{originalEvent:t,type:e,position:{x:a[0],y:a[1]}}};if(s(h),h.selected()){d=e.dragData.possibleDragElements=r.collection();var v=r.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));l(v,{addToList:d}),h.emit(g("grabon")),v.forEach((function(e){e.emit(g("grab"))}))}else d=e.dragData.possibleDragElements=r.collection(),c(h,{addToList:d}),h.emit(g("grabon")).emit(g("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=h,e.hoverData.downs=u,e.hoverData.downTime=(new Date).getTime(),n(h,["mousedown","tapstart","vmousedown"],t,{x:a[0],y:a[1]}),null==h?(o[4]=1,e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()):h.pannable()&&(o[4]=1),e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout((function(){if(!e.hoverData.tapholdCancelled){var n=e.hoverData.down;n?n.emit({originalEvent:t,type:"taphold",position:{x:a[0],y:a[1]}}):r.emit({originalEvent:t,type:"taphold",position:{x:a[0],y:a[1]}})}}),e.tapholdDuration)}o[0]=o[2]=a[0],o[1]=o[3]=a[1]}}),!1),e.registerBinding(window,"mousemove",(function(t){if(e.hoverData.capture||w(t)){var i=!1,o=e.cy,s=o.zoom(),u=[t.clientX,t.clientY],c=e.projectIntoViewport(u[0],u[1]),d=e.hoverData.mdownPos,p=e.hoverData.mdownGPos,f=e.selection,g=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(g=e.findNearestElement(c[0],c[1],!0,!1));var v,y=e.hoverData.last,m=e.hoverData.down,b=[c[0]-f[2],c[1]-f[3]],x=e.dragData.possibleDragElements;if(p){var E=u[0]-p[0],S=E*E,_=u[1]-p[1],k=S+_*_;e.hoverData.isOverThresholdDrag=v=k>=e.desktopTapThreshold2}var A=r(t);v&&(e.hoverData.tapholdCancelled=!0);i=!0,n(g,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var T=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||o.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(v){var P={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};m?m.emit(P):o.emit(P),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=g,g&&g.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(i=!0,o.panningEnabled()&&o.userPanningEnabled()){var M;if(e.hoverData.justStartedPan){var D=e.hoverData.mdownPos;M={x:(c[0]-D[0])*s,y:(c[1]-D[1])*s},e.hoverData.justStartedPan=!1}else M={x:b[0]*s,y:b[1]*s};o.panBy(M),o.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=m&&!m.pannable()){if(m&&m.pannable()&&m.active()&&m.unactivate(),m&&m.grabbed()||g==y||(y&&n(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),g&&n(g,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=g),m)if(v){if(o.boxSelectionEnabled()&&A)m&&m.grabbed()&&(h(x),m.emit("freeon"),x.emit("free"),e.dragData.didDrag&&(m.emit("dragfreeon"),x.emit("dragfree"))),T();else if(m&&m.grabbed()&&e.nodeIsDraggable(m)){var I=!e.dragData.didDrag;I&&e.redrawHint("eles",!0),e.dragData.didDrag=!0;var O=o.collection();e.hoverData.draggingEles||l(x,{inDragLayer:!0});var B={x:0,y:0};if(C(b[0])&&C(b[1])&&(B.x+=b[0],B.y+=b[1],I)){var N=e.hoverData.dragDelta;N&&C(N[0])&&C(N[1])&&(B.x+=N[0],B.y+=N[1])}for(var L=0;L<x.length;L++){var R=x[L];e.nodeIsDraggable(R)&&R.grabbed()&&O.push(R)}e.hoverData.draggingEles=!0,O.silentShift(B).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(b[0]),t.push(b[1])):(t[0]+=b[0],t[1]+=b[1])}();i=!0}else if(v){if(e.hoverData.dragging||!o.boxSelectionEnabled()||!A&&o.panningEnabled()&&o.userPanningEnabled()){if(!e.hoverData.selecting&&o.panningEnabled()&&o.userPanningEnabled()){a(m,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=Xe(d),e.redrawHint("select",!0),e.redraw())}}else T();m&&m.pannable()&&m.active()&&m.unactivate()}return f[2]=c[0],f[3]=c[1],i?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(window,"mouseup",(function(i){if(e.hoverData.capture){e.hoverData.capture=!1;var a=e.cy,o=e.projectIntoViewport(i.clientX,i.clientY),s=e.selection,u=e.findNearestElement(o[0],o[1],!0,!1),l=e.dragData.possibleDragElements,c=e.hoverData.down,d=r(i);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:i,type:"cxttapend",position:{x:o[0],y:o[1]}};if(c?c.emit(p):a.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:i,type:"cxttap",position:{x:o[0],y:o[1]}};c?c.emit(f):a.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(n(u,["mouseup","tapend","vmouseup"],i,{x:o[0],y:o[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(n(c,["click","tap","vclick"],i,{x:o[0],y:o[1]}),b=!1,i.timeStamp-x<=a.multiClickDebounceTime()?(m&&clearTimeout(m),b=!0,x=null,n(c,["dblclick","dbltap","vdblclick"],i,{x:o[0],y:o[1]})):(m=setTimeout((function(){b||n(c,["oneclick","onetap","voneclick"],i,{x:o[0],y:o[1]})}),a.multiClickDebounceTime()),x=i.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||r(i)||(a.$(t).unselect(["tapunselect"]),l.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=l=a.collection()),u!=c||e.dragData.didDrag||e.hoverData.selecting||null!=u&&u._private.selectable&&(e.hoverData.dragging||("additive"===a.selectionType()||d?u.selected()?u.unselect(["tapunselect"]):u.select(["tapselect"]):d||(a.$(t).unmerge(u).unselect(["tapunselect"]),u.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=a.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),a.emit({type:"boxend",originalEvent:i,position:{x:o[0],y:o[1]}});var v=function(e){return e.selectable()&&!e.selected()};"additive"===a.selectionType()||d||a.$(t).unmerge(g).unselect(),g.emit("box").stdFilter(v).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var y=c&&c.grabbed();h(l),y&&(c.emit("freeon"),l.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),l.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}}),!1);var E,S,_,k,A,T,P,M,D,I,O,B,N,L=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),a=e.projectIntoViewport(t.clientX,t.clientY),o=[a[0]*r+i.x,a[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var u=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(u=e.gestureStartZoom*t.scale),n.zoom({level:u,renderedPosition:{x:o[0],y:o[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",L,!0),e.registerBinding(window,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||L(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var R,j,z,V,F,q,X,Y=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},W=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",R=function(t){if(e.hasTouchStarted=!0,w(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,a=e.touchData.earlier;if(t.touches[0]){var o=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(t.touches[1]){o=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);i[2]=o[0],i[3]=o[1]}if(t.touches[2]){o=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);i[4]=o[0],i[5]=o[1]}if(t.touches[1]){e.touchData.singleTouchMoved=!0,h(e.dragData.touchDragEles);var u=e.findContainerClientCoords();D=u[0],I=u[1],O=u[2],B=u[3],E=t.touches[0].clientX-D,S=t.touches[0].clientY-I,_=t.touches[1].clientX-D,k=t.touches[1].clientY-I,N=0<=E&&E<=O&&0<=_&&_<=O&&0<=S&&S<=B&&0<=k&&k<=B;var d=r.pan(),f=r.zoom();A=Y(E,S,_,k),T=W(E,S,_,k),M=[((P=[(E+_)/2,(S+k)/2])[0]-d.x)/f,(P[1]-d.y)/f];if(T<4e4&&!t.touches[2]){var g=e.findNearestElement(i[0],i[1],!0,!0),v=e.findNearestElement(i[2],i[3],!0,!0);return g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):r.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])r.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),m=y[0];if(null!=m&&(m.activate(),e.touchData.start=m,e.touchData.starts=y,e.nodeIsGrabbable(m))){var b=e.dragData.touchDragEles=r.collection(),x=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),m.selected()?(x=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),l(x,{addToList:b})):c(m,{addToList:b}),s(m);var C=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};m.emit(C("grabon")),x?x.forEach((function(e){e.emit(C("grab"))})):m.emit(C("grab"))}n(m,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==m&&(e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||n(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var L=e.touchData.startPosition=[],R=0;R<i.length;R++)L[R]=a[R]=i[R];var j=t.touches[0];e.touchData.startGPosition=[j.clientX,j.clientY]}}},!1),e.registerBinding(window,"touchmove",j=function(t){var r=e.touchData.capture;if(r||w(t)){var i=e.selection,o=e.cy,s=e.touchData.now,u=e.touchData.earlier,c=o.zoom();if(t.touches[0]){var d=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=d[0],s[1]=d[1]}if(t.touches[1]){d=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=d[0],s[3]=d[1]}if(t.touches[2]){d=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=d[0],s[5]=d[1]}var p,f=e.touchData.startGPosition;if(r&&t.touches[0]&&f){for(var g=[],v=0;v<s.length;v++)g[v]=s[v]-u[v];var y=t.touches[0].clientX-f[0],m=y*y,b=t.touches[0].clientY-f[1];p=m+b*b>=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var x=t.touches[0].clientX-D,P=t.touches[0].clientY-I,O=t.touches[1].clientX-D,B=t.touches[1].clientY-I,L=W(x,P,O,B);if(L/T>=2.25||L>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var R={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(R),e.touchData.start=null):o.emit(R)}}if(r&&e.touchData.cxt){R={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(R):o.emit(R),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var j=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&j===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=j,j&&j.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(r&&t.touches[2]&&o.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||o.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(r&&t.touches[1]&&!e.touchData.didSelect&&o.zoomingEnabled()&&o.panningEnabled()&&o.userZoomingEnabled()&&o.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z<ee.length;z++){var V=ee[z]._private;V.grabbed=!1,V.rscratch.inDragLayer=!1}}var F=e.touchData.start,q=(x=t.touches[0].clientX-D,P=t.touches[0].clientY-I,O=t.touches[1].clientX-D,B=t.touches[1].clientY-I,Y(x,P,O,B)),X=q/A;if(N){var H=(x-E+(O-_))/2,G=(P-S+(B-k))/2,U=o.zoom(),K=U*X,Z=o.pan(),$=M[0]*U+Z.x,Q=M[1]*U+Z.y,J={x:-K/U*($-Z.x-H)+$,y:-K/U*(Q-Z.y-G)+Q};if(F&&F.active()){var ee=e.dragData.touchDragEles;h(ee),e.redrawHint("drag",!0),e.redrawHint("eles",!0),F.unactivate().emit("freeon"),ee.emit("free"),e.dragData.didDrag&&(F.emit("dragfreeon"),ee.emit("dragfree"))}o.viewport({zoom:K,pan:J,cancelOnFailedZoom:!0}),o.emit("pinchzoom"),A=q,E=x,S=P,_=O,k=B,e.pinching=!0}if(t.touches[0]){d=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=d[0],s[1]=d[1]}if(t.touches[1]){d=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=d[0],s[3]=d[1]}if(t.touches[2]){d=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=d[0],s[5]=d[1]}}else if(t.touches[0]&&!e.touchData.didSelect){var te=e.touchData.start,ne=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(j=e.findNearestElement(s[0],s[1],!0,!0)),r&&null!=te&&t.preventDefault(),r&&null!=te&&e.nodeIsDraggable(te))if(p){ee=e.dragData.touchDragEles;var re=!e.dragData.didDrag;re&&l(ee,{inDragLayer:!0}),e.dragData.didDrag=!0;var ie={x:0,y:0};if(C(g[0])&&C(g[1]))if(ie.x+=g[0],ie.y+=g[1],re)e.redrawHint("eles",!0),(ae=e.touchData.dragDelta)&&C(ae[0])&&C(ae[1])&&(ie.x+=ae[0],ie.y+=ae[1]);e.hoverData.draggingEles=!0,ee.silentShift(ie).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==u[0]&&e.touchData.startPosition[1]==u[1]&&e.redrawHint("eles",!0),e.redraw()}else{var ae;0===(ae=e.touchData.dragDelta=e.touchData.dragDelta||[]).length?(ae.push(g[0]),ae.push(g[1])):(ae[0]+=g[0],ae[1]+=g[1])}if(n(te||j,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),te&&te.grabbed()||j==ne||(ne&&ne.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),j&&j.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=j,r)for(z=0;z<s.length;z++)s[z]&&e.touchData.startPosition[z]&&p&&(e.touchData.singleTouchMoved=!0);if(r&&(null==te||te.pannable())&&o.panningEnabled()&&o.userPanningEnabled()){a(te,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=Xe(e.touchData.startPosition)),e.swipePanning?(o.panBy({x:g[0]*c,y:g[1]*c}),o.emit("dragpan")):p&&(e.swipePanning=!0,o.panBy({x:y*c,y:b*c}),o.emit("dragpan"),te&&(te.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));d=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=d[0],s[1]=d[1]}}for(v=0;v<s.length;v++)u[v]=s[v];r&&t.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(window,"touchcancel",z=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(window,"touchend",V=function(r){var i=e.touchData.start;if(e.touchData.capture){0===r.touches.length&&(e.touchData.capture=!1),r.preventDefault();var a=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var o,s=e.cy,u=s.zoom(),l=e.touchData.now,c=e.touchData.earlier;if(r.touches[0]){var d=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=d[0],l[1]=d[1]}if(r.touches[1]){d=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);l[2]=d[0],l[3]=d[1]}if(r.touches[2]){d=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);l[4]=d[0],l[5]=d[1]}if(i&&i.unactivate(),e.touchData.cxt){if(o={originalEvent:r,type:"cxttapend",position:{x:l[0],y:l[1]}},i?i.emit(o):s.emit(o),!e.touchData.cxtDragged){var p={originalEvent:r,type:"cxttap",position:{x:l[0],y:l[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!r.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var f=s.collection(e.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:r,position:{x:l[0],y:l[1]}});f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),r.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var g=e.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;h(g),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&(i.emit("freeon"),g.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),g.emit("dragfree"))),n(i,["touchend","tapend","vmouseup","tapdragout"],r,{x:l[0],y:l[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(l[0],l[1],!0,!0);n(y,["touchend","tapend","vmouseup","tapdragout"],r,{x:l[0],y:l[1]})}var m=e.touchData.startPosition[0]-l[0],b=m*m,x=e.touchData.startPosition[1]-l[1],w=(b+x*x)*u*u;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),n(i,["tap","vclick"],r,{x:l[0],y:l[1]}),F=!1,r.timeStamp-X<=s.multiClickDebounceTime()?(q&&clearTimeout(q),F=!0,X=null,n(i,["dbltap","vdblclick"],r,{x:l[0],y:l[1]})):(q=setTimeout((function(){F||n(i,["onetap","voneclick"],r,{x:l[0],y:l[1]})}),s.multiClickDebounceTime()),X=r.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w<e.touchTapThreshold2&&!e.pinching&&("single"===s.selectionType()?(s.$(t).unmerge(i).unselect(["tapunselect"]),i.select(["tapselect"])):i.selected()?i.unselect(["tapunselect"]):i.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var E=0;E<l.length;E++)c[E]=l[E];e.dragData.didDrag=!1,0===r.touches.length&&(e.touchData.dragDelta=[],e.touchData.startPosition=null,e.touchData.startGPosition=null,e.touchData.didSelect=!1),r.touches.length<2&&(1===r.touches.length&&(e.touchData.startGPosition=[r.touches[0].clientX,r.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),"undefined"==typeof TouchEvent){var H=[],G=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},U=function(e){H.push(function(e){return{event:e,touch:G(e)}}(e))},K=function(e){for(var t=0;t<H.length;t++){if(H[t].event.pointerId===e.pointerId)return void H.splice(t,1)}},Z=function(e){e.touches=H.map((function(e){return e.touch}))},$=function(e){return"mouse"===e.pointerType||4===e.pointerType};e.registerBinding(e.container,"pointerdown",(function(e){$(e)||(e.preventDefault(),U(e),Z(e),R(e))})),e.registerBinding(e.container,"pointerup",(function(e){$(e)||(K(e),Z(e),V(e))})),e.registerBinding(e.container,"pointercancel",(function(e){$(e)||(K(e),Z(e),z())})),e.registerBinding(e.container,"pointermove",(function(e){$(e)||(e.preventDefault(),function(e){var t=H.filter((function(t){return t.event.pointerId===e.pointerId}))[0];t.event=e,t.touch=G(e)}(e),Z(e),j(e))}))}};var Wo={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,a,o){return xt(i,a,this.points,e,t,n/2,r/2,o)},checkPoint:function(e,t,n,r,i,a,o){return pt(e,t,this.points,a,o,r,i,[0,-1],n)}}}};Wo.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){return function(e,t,n,r,i,a){var o=n-e,s=r-t;o/=i,s/=a;var u=Math.sqrt(o*o+s*s),l=u-1;if(l<0)return[];var c=l/u;return[(n-e)*c+e,(r-t)*c+t]}(i,a,e,t,n/2+o,r/2+o)},checkPoint:function(e,t,n,r,i,a,o){return vt(e,t,r,i,a,o,n)}}},Wo.generateRoundPolygon=function(e,t){for(var n=new Array(2*t.length),r=0;r<t.length/2;r++){var i=2*r,a=void 0;a=r<t.length/2-1?2*(r+1):0,n[4*r]=t[i],n[4*r+1]=t[i+1];var o=t[a]-t[i],s=t[a+1]-t[i+1],u=Math.sqrt(o*o+s*s);n[4*r+2]=o/u,n[4*r+3]=s/u}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,a,o){return function(e,t,n,r,i,a,o,s){for(var u,l=[],c=new Array(n.length),h=a/2,d=o/2,p=kt(a,o),f=0;f<n.length/4;f++){var g,v=void 0;v=0===f?n.length-2:4*f-2,g=4*f+2;var y=r+h*n[4*f],m=i+d*n[4*f+1],b=-n[v]*n[g]-n[v+1]*n[g+1],x=p/Math.tan(Math.acos(b)/2),w=y-x*n[v],E=m-x*n[v+1],C=y+x*n[g],S=m+x*n[g+1];0===f?(c[n.length-2]=w,c[n.length-1]=E):(c[4*f-2]=w,c[4*f-1]=E),c[4*f]=C,c[4*f+1]=S;var _=n[v+1],k=-n[v];_*n[g]+k*n[g+1]<0&&(_*=-1,k*=-1),0!==(u=yt(e,t,r,i,w+_*p,E+k*p,p)).length&&l.push(u[0],u[1])}for(var A=0;A<c.length/4;A++)0!==(u=bt(e,t,r,i,c[4*A],c[4*A+1],c[4*A+2],c[4*A+3],!1)).length&&l.push(u[0],u[1]);if(l.length>2){for(var T=[l[0],l[1]],P=Math.pow(T[0]-e,2)+Math.pow(T[1]-t,2),M=1;M<l.length/2;M++){var D=Math.pow(l[2*M]-e,2)+Math.pow(l[2*M+1]-t,2);D<=P&&(T[0]=l[2*M],T[1]=l[2*M+1],P=D)}return T}return l}(i,a,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,i,a,o){return function(e,t,n,r,i,a,o){for(var s=new Array(n.length),u=a/2,l=o/2,c=kt(a,o),h=c*c,d=0;d<n.length/4;d++){var p,f=void 0;f=0===d?n.length-2:4*d-2,p=4*d+2;var g=r+u*n[4*d],v=i+l*n[4*d+1],y=-n[f]*n[p]-n[f+1]*n[p+1],m=c/Math.tan(Math.acos(y)/2),b=g-m*n[f],x=v-m*n[f+1],w=g+m*n[p],E=v+m*n[p+1];s[4*d]=b,s[4*d+1]=x,s[4*d+2]=w,s[4*d+3]=E;var C=n[f+1],S=-n[f];C*n[p]+S*n[p+1]<0&&(C*=-1,S*=-1);var _=b+C*c,k=x+S*c;if(Math.pow(_-e,2)+Math.pow(k-t,2)<=h)return!0}return dt(e,t,s)}(e,t,this.points,a,o,r,i)}}},Wo.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Et(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){return st(i,a,e,t,n,r,o)},checkPoint:function(e,t,n,r,i,a,o){var s=_t(r,i),u=2*s;return!!pt(e,t,this.points,a,o,r,i-u,[0,-1],n)||(!!pt(e,t,this.points,a,o,r-u,i,[0,-1],n)||(!!vt(e,t,u,u,a-r/2+s,o-i/2+s,n)||(!!vt(e,t,u,u,a+r/2-s,o-i/2+s,n)||(!!vt(e,t,u,u,a+r/2-s,o+i/2-s,n)||!!vt(e,t,u,u,a-r/2+s,o+i/2-s,n)))))}}},Wo.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:Et(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},generateCutTrianglePts:function(e,t,n,r){var i=this.cornerLength,a=t/2,o=e/2,s=n-o,u=n+o,l=r-a,c=r+a;return{topLeft:[s,l+i,s+i,l,s+i,l+i],topRight:[u-i,l,u,l+i,u-i,l+i],bottomRight:[u,c-i,u-i,c,u-i,c-i],bottomLeft:[s+i,c,s,c-i,s+i,c-i]}},intersectLine:function(e,t,n,r,i,a,o){var s=this.generateCutTrianglePts(n+2*o,r+2*o,e,t),u=[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]);return xt(i,a,u,e,t)},checkPoint:function(e,t,n,r,i,a,o){if(pt(e,t,this.points,a,o,r,i-2*this.cornerLength,[0,-1],n))return!0;if(pt(e,t,this.points,a,o,r-2*this.cornerLength,i,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,i,a,o);return dt(e,t,s.topLeft)||dt(e,t,s.topRight)||dt(e,t,s.bottomRight)||dt(e,t,s.bottomLeft)}}},Wo.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Et(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){var s=this.generateBarrelBezierPts(n+2*o,r+2*o,e,t),u=function(e){var t=$e({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=$e({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=$e({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]},l=[].concat(u(s.topLeft),u(s.topRight),u(s.bottomRight),u(s.bottomLeft));return xt(i,a,l,e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,a=e/2,o=n-a,s=n+a,u=r-i,l=r+i,c=At(e,t),h=c.heightOffset,d=c.widthOffset,p=c.ctrlPtOffsetPct*e,f={topLeft:[o,u+h,o+p,u,o+d,u],topRight:[s-d,u,s-p,u,s,u+h],bottomRight:[s,l-h,s-p,l,s-d,l],bottomLeft:[o+d,l,o+p,l,o,l-h]};return f.topLeft.isTop=!0,f.topRight.isTop=!0,f.bottomLeft.isBottom=!0,f.bottomRight.isBottom=!0,f},checkPoint:function(e,t,n,r,i,a,o){var s=At(r,i),u=s.heightOffset,l=s.widthOffset;if(pt(e,t,this.points,a,o,r,i-2*u,[0,-1],n))return!0;if(pt(e,t,this.points,a,o,r-2*l,i,[0,-1],n))return!0;for(var c=this.generateBarrelBezierPts(r,i,a,o),h=function(e,t,n){var r,i,a=n[4],o=n[2],s=n[0],u=n[5],l=n[1],c=Math.min(a,s),h=Math.max(a,s),d=Math.min(u,l),p=Math.max(u,l);if(c<=e&&e<=h&&d<=t&&t<=p){var f=[(r=a)-2*(i=o)+s,2*(i-r),r],g=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]}(f[0],f[1],f[2],e).filter((function(e){return 0<=e&&e<=1}));if(g.length>0)return g[0]}return null},d=Object.keys(c),p=0;p<d.length;p++){var f=c[d[p]],g=h(e,t,f);if(null!=g){var v=f[5],y=f[3],m=f[1],b=Ze(v,y,m,g);if(f.isTop&&b<=t)return!0;if(f.isBottom&&t<=b)return!0}}return!1}}},Wo.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Et(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o){var s=t-(r/2+o),u=bt(i,a,e,t,e-(n/2+o),s,e+(n/2+o),s,!1);return u.length>0?u:st(i,a,e,t,n,r,o)},checkPoint:function(e,t,n,r,i,a,o){var s=_t(r,i),u=2*s;if(pt(e,t,this.points,a,o,r,i-u,[0,-1],n))return!0;if(pt(e,t,this.points,a,o,r-u,i,[0,-1],n))return!0;var l=r/2+2*n,c=i/2+2*n;return!!dt(e,t,[a-l,o-c,a-l,o,a+l,o,a+l,o-c])||(!!vt(e,t,u,u,a+r/2-s,o+i/2-s,n)||!!vt(e,t,u,u,a-r/2+s,o+i/2-s,n))}}},Wo.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Et(3,0)),this.generateRoundPolygon("round-triangle",Et(3,0)),this.generatePolygon("rectangle",Et(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",Et(5,0)),this.generateRoundPolygon("round-pentagon",Et(5,0)),this.generatePolygon("hexagon",Et(6,0)),this.generateRoundPolygon("round-hexagon",Et(6,0)),this.generatePolygon("heptagon",Et(7,0)),this.generateRoundPolygon("round-heptagon",Et(7,0)),this.generatePolygon("octagon",Et(8,0)),this.generateRoundPolygon("round-octagon",Et(8,0));var r=new Array(20),i=St(5,0),a=St(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<a.length/2;s++)a[2*s]*=o,a[2*s+1]*=o;for(s=0;s<5;s++)r[4*s]=i[2*s],r[4*s+1]=i[2*s+1],r[4*s+2]=a[2*s],r[4*s+3]=a[2*s+1];r=Ct(r),this.generatePolygon("star",r),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 n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}};var Ho={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||ve();var t=this;void 0===t.averageRedrawTime&&(t.averageRedrawTime=0),void 0===t.lastRedrawTime&&(t.lastRedrawTime=0),void 0===t.lastDrawTime&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){null==t&&ce("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort((function(e,t){return t.priority-e.priority}))}}},Go=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};Ho.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;G((function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){Go(e,!0,r);var i=U();e.render(e.renderOptions);var a=e.lastDrawTime=U();void 0===e.averageRedrawTime&&(e.averageRedrawTime=a-i),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var o=a-i;e.redrawTotalTime+=o,e.lastRedrawTime=o,e.averageRedrawTime=e.averageRedrawTime/2+o/2,e.requestedFrame=!1}else Go(e,!1,r);e.skipFrame=!1,G(n)}}))}};var Uo=function(e){this.init(e)},Ko=Uo.prototype;Ko.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Ko.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container();if(d){var r=d.document,i=r.head,a="__________cytoscape_container",o=null!=r.getElementById("__________cytoscape_stylesheet");if(n.className.indexOf(a)<0&&(n.className=(n.className||"")+" "+a),!o){var s=r.createElement("style");s.id="__________cytoscape_stylesheet",s.innerHTML="."+a+" { position: relative; }",i.insertBefore(s,i.children[0])}"static"===d.getComputedStyle(n).getPropertyValue("position")&&de()}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},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=C(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=!1,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()},Ko.notify=function(e,t){var n=this,r=n.cy;this.destroyed||("init"!==e?"destroy"!==e?(("add"===e||"remove"===e||"move"===e&&r.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&n.invalidateCachedZSortedEles(),"viewport"===e&&n.redrawHint("select",!0),"load"!==e&&"resize"!==e&&"mount"!==e||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},Ko.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch(e){}},Ko.isHeadless=function(){return!1},[Ao,qo,Xo,Yo,Wo,Ho].forEach((function(e){z(Ko,e)}));var Zo=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=i((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold),a=e.priority||le;n.beforeRender((function(i,a){var o=U(),s=n.averageRedrawTime,u=n.lastRedrawTime,l=[],c=n.cy.extent(),h=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var d=U(),p=d-o,f=d-a;if(u<1e3/60){var g=1e3/60-(i?s:0);if(f>=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*u||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*(1e3/60))break;var v=e.deq(t,h,c);if(!(v.length>0))break;for(var y=0;y<v.length;y++)l.push(v[y])}l.length>0&&(e.onDeqd(t,l),!i&&e.shouldRedraw(t,l,h,c)&&r())}),a(t))}}},$o=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:se;s(this,e),this.idsByKey=new Ee,this.keyForId=new Ee,this.cachesByLvl=new Ee,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return l(e,[{key:"getIdsFor",value:function(e){null==e&&ce("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new Se,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new Ee,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),Qo={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Jo=ye({getKey:null,doesEleInvalidateKey:se,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:oe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),es=function(e,t){this.renderer=e,this.onDequeues=[];var n=Jo(t);z(this,n),this.lookup=new $o(n.getKey,n.doesEleInvalidateKey),this.setupDequeueing()},ts=es.prototype;ts.reasons=Qo,ts.getTextureQueue=function(e){return this.eleImgCaches=this.eleImgCaches||{},this.eleImgCaches[e]=this.eleImgCaches[e]||[]},ts.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},ts.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new a((function(e,t){return t.reqs-e.reqs}))},ts.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},ts.getElement=function(e,t,n,r,i){var a=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!a.allowEdgeTxrCaching&&e.isEdge()||!a.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(We(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var l=Math.pow(2,r),c=t.h*l,h=t.w*l,d=o.eleTextBiggerThanMin(e,l);if(!this.isVisible(e,d))return null;var p,f=u.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||h>1024)return null;var g=a.getTextureQueue(p),v=g[g.length-2],y=function(){return a.recycleTexture(p,h)||a.addTexture(p,h)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidth<h&&(v=y());for(var m,b=function(e){return e&&e.scaledLabelShown===d},x=i&&i===Qo.dequeue,w=i&&i===Qo.highQuality,E=i&&i===Qo.downscale,C=r+1;C<=3;C++){var S=u.get(e,C);if(S){m=S;break}}var _=m&&m.level===r+1?m:null,k=function(){v.context.drawImage(_.texture.canvas,_.x,0,_.width,_.height,v.usedWidth,0,h,c)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,h,p),b(_))k();else if(b(m)){if(!w)return a.queueElement(e,m.level-1),m;for(var A=m.level;A>r;A--)_=a.getElement(e,t,n,A,Qo.downscale);k()}else{var T;if(!x&&!w&&!E)for(var P=r-1;P>=-4;P--){var M=u.get(e,P);if(M){T=M;break}}if(b(T))return a.queueElement(e,r),T;v.context.translate(v.usedWidth,0),v.context.scale(l,l),this.drawElement(v.context,e,t,d,!1),v.context.scale(1/l,1/l),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:r,scale:l,width:h,height:c,scaledLabelShown:d},v.usedWidth+=Math.ceil(h+8),v.eleCaches.push(f),u.set(e,r,f),a.checkTextureFullness(v),f},ts.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},ts.invalidateElement=function(e){var t=this.lookup,n=[];if(t.isInvalid(e)){for(var r=-4;r<=3;r++){var i=t.getForCachedKey(e,r);i&&n.push(i)}if(t.invalidate(e))for(var a=0;a<n.length;a++){var o=n[a],s=o.texture;s.invalidatedWidth+=o.width,o.invalidated=!0,this.checkTextureUtility(s)}this.removeFromQueue(e)}},ts.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},ts.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?me(t,e):e.fullnessChecks++},ts.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;me(n,e),e.retired=!0;for(var i=e.eleCaches,a=0;a<i.length;a++){var o=i[a];r.deleteCache(o.key,o.level)}be(i),this.getRetiredTextureQueue(t).push(e)},ts.addTexture=function(e,t){var n={};return this.getTextureQueue(e).push(n),n.eleCaches=[],n.height=e,n.width=Math.max(1024,t),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=this.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},ts.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),i=0;i<r.length;i++){var a=r[i];if(a.width>=t)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,be(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),me(r,a),n.push(a),a}},ts.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),a=r[i];if(a)a.level=Math.max(a.level,t),a.eles.merge(e),a.reqs++,n.updateItem(a);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(o),r[i]=o}},ts.dequeue=function(e){for(var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=[],i=this.lookup,a=0;a<1&&t.size()>0;a++){var o=t.pop(),s=o.key,u=o.eles[0],l=i.hasCache(u,o.level);if(n[s]=null,!l){r.push(o);var c=this.getBoundingBox(u);this.getElement(u,c,e,o.level,Qo.dequeue)}}return r},ts.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=ae,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},ts.onDequeue=function(e){this.onDequeues.push(e)},ts.offDequeue=function(e){me(this.onDequeues,e)},ts.setupDequeueing=Zo({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){(0,e.onDequeues[n])(t)}},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var a=t[i].eles,o=0;o<a.length;o++){var s=a[o].boundingBox();if(it(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var ns=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=U()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=i((function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)}),50),n.beforeRender((function(e,n){n-t.lastInvalidationTime<=250?t.skipping=!0:t.skipping=!1}),n.beforeRenderPriorities.lyrTxrSkip);t.layersQueue=new a((function(e,t){return t.reqs-e.reqs})),t.setupDequeueing()},rs=ns.prototype,is=0,as=Math.pow(2,53)-1;rs.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),a=this.renderer.makeOffscreenCanvas(r,i),o={id:is=++is%as,bb:e,level:t,width:r,height:i,canvas:a,context:a.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,u=-o.bb.x1,l=-o.bb.y1;return s.scale(n,n),s.translate(u,l),o},rs.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),a=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(We(i*t)))<-4)n=-4;else if(i>=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var o,s,u=r.layersByLevel,l=Math.pow(2,n),c=u[n]=u[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=u[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var a=c.length-1;a>=0;a--){var o=c[a];o.invalid&&me(c,o)}}();var h=function(t){var i=(t=t||{}).after;if(function(){if(!o){o=Je();for(var t=0;t<e.length;t++)n=o,r=e[t].boundingBox(),n.x1=Math.min(n.x1,r.x1),n.x2=Math.max(n.x2,r.x2),n.w=n.x2-n.x1,n.y1=Math.min(n.y1,r.y1),n.y2=Math.max(n.y2,r.y2),n.h=n.y2-n.y1}var n,r}(),o.w*l*(o.h*l)>16e6)return null;var a=r.makeLayer(o,n);if(null!=i){var s=c.indexOf(i)+1;c.splice(s,0,a)}else(void 0===t.insert||t.insert)&&c.unshift(a);return a};if(r.skipping&&!a)return null;for(var d=null,p=e.length/1,f=!a,g=0;g<e.length;g++){var v=e[g],y=v._private.rscratch,m=y.imgLayerCaches=y.imgLayerCaches||{},b=m[n];if(b)d=b;else{if((!d||d.eles.length>=p||!ot(d.bb,v.boundingBox()))&&!(d=h({insert:!0,after:d})))return null;s||f?r.queueLayer(d,v):r.drawEleInLayer(d,v,n,t),d.eles.push(v),m[n]=d}}return s||(f?null:c)},rs.getEleLevelForLayerLevel=function(e,t){return e},rs.drawEleInLayer=function(e,t,n,r){var i=this.renderer,a=e.context,o=t.boundingBox();0!==o.w&&0!==o.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,t,null,null,n,!0),i.setImgSmoothing(a,!0))},rs.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var a=n[i];if(a.reqs>0)return!1;if(a.invalid)return!1;r+=a.eles.length}return r===t.length},rs.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],a=-1,o=0;o<t.length;o++)if(i.eles[0]===t[o]){a=o;break}if(a<0)this.invalidateLayer(i);else{var s=a;for(o=0;o<i.eles.length;o++)if(i.eles[o]!==t[s+o]){this.invalidateLayer(i);break}}}},rs.updateElementsInLayers=function(e,t){for(var n=k(e[0]),r=0;r<e.length;r++)for(var i=n?null:e[r],a=n?e[r]:e[r].ele,o=a._private.rscratch,s=o.imgLayerCaches=o.imgLayerCaches||{},u=-4;u<=2;u++){var l=s[u];l&&(i&&this.getEleLevelForLayerLevel(l.level)!==i.level||t(l,a,i))}},rs.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},rs.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=U(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},rs.invalidateLayer=function(e){if(this.lastInvalidationTime=U(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];me(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i<n.length;i++){var a=n[i]._private.rscratch.imgLayerCaches;a&&(a[t]=null)}}},rs.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function(e,n,r){var i=e.replacement;if(i||((i=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,i.eles=e.eles),!i.reqs)for(var a=0;a<i.eles.length;a++)t.queueLayer(i,i.eles[a])}))},rs.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},rs.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},rs.dequeue=function(e){for(var t=this.layersQueue,n=[],r=0;r<1&&0!==t.size();){var i=t.peek();if(i.replacement)t.pop();else if(i.replaces&&i!==i.replaces.replacement)t.pop();else if(i.invalid)t.pop();else{var a=i.elesQueue.shift();a&&(this.drawEleInLayer(i,a,i.level,e),r++),0===n.length&&n.push(!0),0===i.elesQueue.length&&(t.pop(),i.reqs=0,i.replaces&&this.applyLayerReplacement(i),this.requestRedraw())}}return n},rs.applyLayerReplacement=function(e){var t=this.layersByLevel[e.level],n=e.replaces,r=t.indexOf(n);if(!(r<0||n.invalid)){t[r]=e;for(var i=0;i<e.eles.length;i++){var a=e.eles[i]._private,o=a.imgLayerCaches=a.imgLayerCaches||{};o&&(o[e.level]=e)}this.requestRedraw()}},rs.requestRedraw=i((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),rs.setupDequeueing=Zo({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:le,shouldRedraw:oe,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var os,ss={};function us(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function ls(e,t,n){for(var r,i=0;i<t.length;i++){var a=t[i];0===i&&(r=a),e.lineTo(a.x,a.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function cs(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++){var a=r[i];e.lineTo(a.x,a.y)}var o=n,s=n[0];e.moveTo(s.x,s.y);for(i=1;i<o.length;i++){a=o[i];e.lineTo(a.x,a.y)}e.closePath&&e.closePath()}function hs(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,2*Math.PI,!1);var a=t,o=a[0];e.moveTo(o.x,o.y);for(var s=0;s<a.length;s++){var u=a[s];e.lineTo(u.x,u.y)}e.closePath&&e.closePath()}function ds(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}ss.arrowShapeImpl=function(e){return(os||(os={polygon:us,"triangle-backcurve":ls,"triangle-tee":cs,"circle-triangle":hs,"triangle-cross":cs,circle:ds}))[e]};var ps={drawElement:function(e,t,n,r,i,a){t.isNode()?this.drawNode(e,t,n,r,i,a):this.drawEdge(e,t,n,r,i,a)},drawElementOverlay:function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},drawElementUnderlay:function(e,t){t.isNode()?this.drawNodeUnderlay(e,t):this.drawEdgeUnderlay(e,t)},drawCachedElementPortion:function(e,t,n,r,i,a,o,s){var u=this,l=n.getBoundingBox(t);if(0!==l.w&&0!==l.h){var c=n.getElement(t,l,r,i,a);if(null!=c){var h=s(u,t);if(0===h)return;var d,p,f,g,v,y,m=o(u,t),b=l.x1,x=l.y1,w=l.w,E=l.h;if(0!==m){var C=n.getRotationPoint(t);f=C.x,g=C.y,e.translate(f,g),e.rotate(m),(v=u.getImgSmoothing(e))||u.setImgSmoothing(e,!0);var S=n.getRotationOffset(t);d=S.x,p=S.y}else d=b,p=x;1!==h&&(y=e.globalAlpha,e.globalAlpha=y*h),e.drawImage(c.texture.canvas,c.x,0,c.width,c.height,d,p,w,E),1!==h&&(e.globalAlpha=y),0!==m&&(e.rotate(-m),e.translate(-f,-g),v||u.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},fs=function(){return 0},gs=function(e,t){return e.getTextAngle(t,null)},vs=function(e,t){return e.getTextAngle(t,"source")},ys=function(e,t){return e.getTextAngle(t,"target")},ms=function(e,t){return t.effectiveOpacity()},bs=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};ps.drawCachedElement=function(e,t,n,r,i,a){var o=this,s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,c=s.slbTxrCache,h=s.tlbTxrCache,d=t.boundingBox(),p=!0===a?u.reasons.highQuality:null;if(0!==d.w&&0!==d.h&&t.visible()&&(!r||it(d,r))){var f=t.isEdge(),g=t.element()._private.rscratch.badLine;o.drawElementUnderlay(e,t),o.drawCachedElementPortion(e,t,u,n,i,p,fs,ms),f&&g||o.drawCachedElementPortion(e,t,l,n,i,p,gs,bs),f&&!g&&(o.drawCachedElementPortion(e,t,c,n,i,p,vs,bs),o.drawCachedElementPortion(e,t,h,n,i,p,ys,bs)),o.drawElementOverlay(e,t)}},ps.drawElements=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];this.drawElement(e,r)}},ps.drawCachedElements=function(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i];this.drawCachedElement(e,a,n,r)}},ps.drawCachedNodes=function(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i];a.isNode()&&this.drawCachedElement(e,a,n,r)}},ps.drawLayeredElements=function(e,t,n,r){var i=this.data.lyrTxrCache.getLayers(t,n);if(i)for(var a=0;a<i.length;a++){var o=i[a],s=o.bb;0!==s.w&&0!==s.h&&e.drawImage(o.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var xs={drawEdge:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this,s=t._private.rscratch;if((!a||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var u;n&&(u=n,e.translate(-u.x1,-u.y1));var l=a?t.pstyle("opacity").value:1,c=a?t.pstyle("line-opacity").value:1,h=t.pstyle("curve-style").value,d=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=l*c,v=l*c,y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;"straight-triangle"===h?(o.eleStrokeStyle(e,t,n),o.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,o.eleStrokeStyle(e,t,n),o.drawEdgePath(t,e,s.allpts,d),e.lineCap="butt")},m=function(){i&&o.drawEdgeOverlay(e,t)},b=function(){i&&o.drawEdgeUnderlay(e,t)},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;o.drawArrowheads(e,t,n)},w=function(){o.drawElementText(e,t,null,r)};e.lineJoin="round";var E="yes"===t.pstyle("ghost").value;if(E){var C=t.pstyle("ghost-offset-x").pfValue,S=t.pstyle("ghost-offset-y").pfValue,_=t.pstyle("ghost-opacity").value,k=g*_;e.translate(C,S),y(k),x(k),e.translate(-C,-S)}b(),y(),x(),m(),w(),n&&e.translate(u.x1,u.y1)}}},ws=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,a=i.usePaths(),o=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==o.edgeType||a?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,u[0],u[1],u[2],r),i.drawEdgePath(n,t,o.allpts,"solid")}}}};xs.drawEdgeOverlay=ws("overlay"),xs.drawEdgeUnderlay=ws("underlay"),xs.drawEdgePath=function(e,t,n,r){var i,a=e._private.rscratch,o=t,s=!1,u=this.usePaths(),l=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(u){var h=n.join("$");a.pathCacheKey&&a.pathCacheKey===h?(i=t=a.pathCache,s=!0):(i=t=new Path2D,a.pathCacheKey=h,a.pathCache=i)}if(o.setLineDash)switch(r){case"dotted":o.setLineDash([1,1]);break;case"dashed":o.setLineDash(l),o.lineDashOffset=c;break;case"solid":o.setLineDash([])}if(!s&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+3<n.length;d+=4)t.quadraticCurveTo(n[d],n[d+1],n[d+2],n[d+3]);break;case"straight":case"segments":case"haystack":for(var p=2;p+1<n.length;p+=2)t.lineTo(n[p],n[p+1])}t=o,u?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},xs.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var a=[n[i+2]-n[i],n[i+3]-n[i+1]],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=[a[1]/o,-a[0]/o],u=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[i]-u[0],n[i+1]-u[1]),t.lineTo(n[i]+u[0],n[i+1]+u[1]),t.lineTo(n[i+2],n[i+3]),t.closePath(),t.fill()}},xs.drawArrowheads=function(e,t,n){var r=t._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},xs.drawArrowhead=function(e,t,n,r,i,a,o){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(a)||null==a)){var s=t.pstyle(n+"-arrow-shape").value;if("none"!==s){var u="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",l=t.pstyle(n+"-arrow-fill").value,c=t.pstyle("width").pfValue,h=t.pstyle("opacity").value;void 0===o&&(o=h);var d=e.globalCompositeOperation;1===o&&"hollow"!==l||(e.globalCompositeOperation="destination-out",this.colorFillStyle(e,255,255,255,1),this.colorStrokeStyle(e,255,255,255,1),this.drawArrowShape(t,e,u,c,s,r,i,a),e.globalCompositeOperation=d);var p=t.pstyle(n+"-arrow-color").value;this.colorFillStyle(e,p[0],p[1],p[2],o),this.colorStrokeStyle(e,p[0],p[1],p[2],o),this.drawArrowShape(t,e,l,c,s,r,i,a)}}},xs.drawArrowShape=function(e,t,n,r,i,a,o,s){var u,l=this,c=this.usePaths()&&"triangle-cross"!==i,h=!1,d=t,p={x:a,y:o},f=e.pstyle("arrow-scale").value,g=this.getArrowWidth(r,f),v=l.arrowShapes[i];if(c){var y=l.arrowPathCache=l.arrowPathCache||[],m=te(i),b=y[m];null!=b?(u=t=b,h=!0):(u=t=new Path2D,y[m]=u)}h||(t.beginPath&&t.beginPath(),c?v.draw(t,1,0,{x:0,y:0},1):v.draw(t,g,s,p,r),t.closePath&&t.closePath()),t=d,c&&(t.translate(a,o),t.rotate(s),t.scale(g,g)),"filled"!==n&&"both"!==n||(c?t.fill(u):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(v.matchEdgeWidth?r:1)/(c?g:1),t.lineJoin="miter",c?t.stroke(u):t.stroke()),c&&(t.scale(1/g,1/g),t.rotate(-s),t.translate(-a,-o))};var Es={safeDrawImage:function(e,t,n,r,i,a,o,s,u,l){i<=0||a<=0||u<=0||l<=0||e.drawImage(t,n,r,i,a,o,s,u,l)},drawInscribedImage:function(e,t,n,r,i){var a=this,o=n.position(),s=o.x,u=o.y,l=n.cy().style(),c=l.getIndexedStyle.bind(l),h=c(n,"background-fit","value",r),d=c(n,"background-repeat","value",r),p=n.width(),f=n.height(),g=2*n.padding(),v=p+("inner"===c(n,"background-width-relative-to","value",r)?0:g),y=f+("inner"===c(n,"background-height-relative-to","value",r)?0:g),m=n._private.rscratch,b="node"===c(n,"background-clip","value",r),x=c(n,"background-image-opacity","value",r)*i,w=c(n,"background-image-smoothing","value",r),E=t.width||t.cachedW,C=t.height||t.cachedH;null!=E&&null!=C||(document.body.appendChild(t),E=t.cachedW=t.width||t.offsetWidth,C=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var S=E,_=C;if("auto"!==c(n,"background-width","value",r)&&(S="%"===c(n,"background-width","units",r)?c(n,"background-width","pfValue",r)*v:c(n,"background-width","pfValue",r)),"auto"!==c(n,"background-height","value",r)&&(_="%"===c(n,"background-height","units",r)?c(n,"background-height","pfValue",r)*y:c(n,"background-height","pfValue",r)),0!==S&&0!==_){if("contain"===h)S*=k=Math.min(v/S,y/_),_*=k;else if("cover"===h){var k;S*=k=Math.max(v/S,y/_),_*=k}var A=s-v/2,T=c(n,"background-position-x","units",r),P=c(n,"background-position-x","pfValue",r);A+="%"===T?(v-S)*P:P;var M=c(n,"background-offset-x","units",r),D=c(n,"background-offset-x","pfValue",r);A+="%"===M?(v-S)*D:D;var I=u-y/2,O=c(n,"background-position-y","units",r),B=c(n,"background-position-y","pfValue",r);I+="%"===O?(y-_)*B:B;var N=c(n,"background-offset-y","units",r),L=c(n,"background-offset-y","pfValue",r);I+="%"===N?(y-_)*L:L,m.pathCache&&(A-=s,I-=u,s=0,u=0);var R=e.globalAlpha;e.globalAlpha=x;var j=a.getImgSmoothing(e),z=!1;if("no"===w&&j?(a.setImgSmoothing(e,!1),z=!0):"yes"!==w||j||(a.setImgSmoothing(e,!0),z=!0),"no-repeat"===d)b&&(e.save(),m.pathCache?e.clip(m.pathCache):(a.nodeShapes[a.getNodeShape(n)].draw(e,s,u,v,y),e.clip())),a.safeDrawImage(e,t,0,0,E,C,A,I,S,_),b&&e.restore();else{var V=e.createPattern(t,d);e.fillStyle=V,a.nodeShapes[a.getNodeShape(n)].draw(e,s,u,v,y),e.translate(A,I),e.fill(),e.translate(-A,-I)}e.globalAlpha=R,z&&a.setImgSmoothing(e,j)}}},Cs={};function Ss(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+a,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath(),e.fill()}Cs.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(We(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},Cs.drawElementText=function(e,t,n,r,i){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this;if(null==r){if(a&&!o.eleTextBiggerThanMin(t))return}else if(!1===r)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,c=t.pstyle("label"),h=t.pstyle("source-label"),d=t.pstyle("target-label");if(l||(!c||!c.value)&&(!h||!h.value)&&(!d||!d.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(o.drawText(e,t,null,f,a),t.isEdge()&&(o.drawText(e,t,"source",f,a),o.drawText(e,t,"target",f,a))):o.drawText(e,t,i,f,a),n&&e.translate(p.x1,p.y1)},Cs.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return t={context:e},this.fontCaches.push(t),t},Cs.setupTextStyle=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",a=t.pstyle("font-family").strValue,o=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,u=t.pstyle("text-outline-opacity").value*s,l=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+o+" "+i+" "+a,e.lineJoin="round",this.colorFillStyle(e,l[0],l[1],l[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],u)},Cs.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),a=xe(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?a:0:"none"===i.strValue?0:i.pfValue},Cs.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=t._private,o=a.rscratch,s=i?t.effectiveOpacity():1;if(!i||0!==s&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var u,l,c=xe(o,"labelX",n),h=xe(o,"labelY",n),d=this.getLabelText(t,n);if(null!=d&&""!==d&&!isNaN(c)&&!isNaN(h)){this.setupTextStyle(e,t,i);var p,f=n?n+"-":"",g=xe(o,"labelWidth",n),v=xe(o,"labelHeight",n),y=t.pstyle(f+"text-margin-x").pfValue,m=t.pstyle(f+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;switch(b&&(x="center",w="center"),c+=y,h+=m,0!==(p=r?this.getTextAngle(t,n):0)&&(u=c,l=h,e.translate(u,l),e.rotate(p),c=0,h=0),w){case"top":break;case"center":h+=v/2;break;case"bottom":h+=v}var E=t.pstyle("text-background-opacity").value,C=t.pstyle("text-border-opacity").value,S=t.pstyle("text-border-width").pfValue,_=t.pstyle("text-background-padding").pfValue;if(E>0||S>0&&C>0){var k=c-_;switch(x){case"left":k-=g;break;case"center":k-=g/2}var A=h-v-_,T=g+2*_,P=v+2*_;if(E>0){var M=e.fillStyle,D=t.pstyle("text-background-color").value;e.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+E*s+")";var I=t.pstyle("text-background-shape").strValue;0===I.indexOf("round")?Ss(e,k,A,T,P,2):e.fillRect(k,A,T,P),e.fillStyle=M}if(S>0&&C>0){var O=e.strokeStyle,B=e.lineWidth,N=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+N[0]+","+N[1]+","+N[2]+","+C*s+")",e.lineWidth=S,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=S/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(k,A,T,P),"double"===L){var R=S/2;e.strokeRect(k+R,A+R,T-2*R,P-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=B,e.strokeStyle=O}}var j=2*t.pstyle("text-outline-width").pfValue;if(j>0&&(e.lineWidth=j),"wrap"===t.pstyle("text-wrap").value){var z=xe(o,"labelWrapCachedLines",n),V=xe(o,"labelLineHeight",n),F=g/2,q=this.getLabelJustification(t);switch("auto"===q||("left"===x?"left"===q?c+=-g:"center"===q&&(c+=-F):"center"===x?"left"===q?c+=-F:"right"===q&&(c+=F):"right"===x&&("center"===q?c+=F:"right"===q&&(c+=g))),w){case"top":h-=(z.length-1)*V;break;case"center":case"bottom":h-=(z.length-1)*V}for(var X=0;X<z.length;X++)j>0&&e.strokeText(z[X],c,h),e.fillText(z[X],c,h),h+=V}else j>0&&e.strokeText(d,c,h),e.fillText(d,c,h);0!==p&&(e.rotate(-p),e.translate(-u,-l))}}};var _s={drawNode:function(e,t,n){var r,i,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],u=this,l=t._private,c=l.rscratch,h=t.position();if(C(h.x)&&C(h.y)&&(!s||t.visible())){var d,p,f=s?t.effectiveOpacity():1,g=u.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image"),b=m.value,x=new Array(b.length),w=new Array(b.length),E=0,S=0;S<b.length;S++){var _=b[S],k=x[S]=null!=_&&"none"!==_;if(k){var A=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",S);E++,w[S]=u.getCachedImage(_,A,(function(){l.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var T=t.pstyle("background-blacken").value,P=t.pstyle("border-width").pfValue,M=t.pstyle("background-opacity").value*f,D=t.pstyle("border-color").value,I=t.pstyle("border-style").value,O=t.pstyle("border-opacity").value*f;e.lineJoin="miter";var B=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;u.eleFillStyle(e,t,n)},N=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O;u.colorStrokeStyle(e,D[0],D[1],D[2],t)},L=t.pstyle("shape").strValue,R=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(h.x,h.y);var j=u.nodePathCache=u.nodePathCache||[],z=ne("polygon"===L?L+","+R.join(","):L,""+i,""+r),V=j[z];null!=V?(d=V,v=!0,c.pathCache=d):(d=new Path2D,j[z]=c.pathCache=d)}var F=function(){if(!v){var n=h;g&&(n={x:0,y:0}),u.nodeShapes[u.getNodeShape(t)].draw(d||e,n.x,n.y,r,i)}g?e.fill(d):e.fill()},q=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=l.backgrounding,a=0,o=0;o<w.length;o++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",o);r&&"over"===s||!r&&"inside"===s?a++:x[o]&&w[o].complete&&!w[o].error&&(a++,u.drawInscribedImage(e,w[o],t,o,n))}l.backgrounding=!(a===E),i!==l.backgrounding&&t.updateStyle(!1)},X=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;u.hasPie(t)&&(u.drawPie(e,t,a),n&&(g||u.nodeShapes[u.getNodeShape(t)].draw(e,h.x,h.y,r,i)))},Y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,n=(T>0?T:-T)*t,r=T>0?0:255;0!==T&&(u.colorFillStyle(e,r,r,r,n),g?e.fill(d):e.fill())},W=function(){if(P>0){if(e.lineWidth=P,e.lineCap="butt",e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(g?e.stroke(d):e.stroke(),"double"===I){e.lineWidth=P/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(d):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},H=function(){o&&u.drawNodeOverlay(e,t,h,r,i)},G=function(){o&&u.drawNodeUnderlay(e,t,h,r,i)},U=function(){u.drawElementText(e,t,null,a)},K="yes"===t.pstyle("ghost").value;if(K){var Z=t.pstyle("ghost-offset-x").pfValue,$=t.pstyle("ghost-offset-y").pfValue,Q=t.pstyle("ghost-opacity").value,J=Q*f;e.translate(Z,$),B(Q*M),F(),q(J,!0),N(Q*O),W(),X(0!==T||0!==P),q(J,!1),Y(J),e.translate(-Z,-$)}g&&e.translate(-h.x,-h.y),G(),g&&e.translate(h.x,h.y),B(),F(),q(f,!0),N(),W(),X(0!==T||0!==P),q(f,!1),Y(),g&&e.translate(-h.x,-h.y),U(),H(),n&&e.translate(p.x1,p.y1)}}},ks=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,i,a){if(n.visible()){var o=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-opacity")).value,u=n.pstyle("".concat(e,"-color")).value,l=n.pstyle("".concat(e,"-shape")).value;if(s>0){if(r=r||n.position(),null==i||null==a){var c=n.padding();i=n.width()+2*c,a=n.height()+2*c}this.colorFillStyle(t,u[0],u[1],u[2],s),this.nodeShapes[l].draw(t,r.x,r.y,i+2*o,a+2*o),t.fill()}}}};_s.drawNodeOverlay=ks("overlay"),_s.drawNodeUnderlay=ks("underlay"),_s.hasPie=function(e){return(e=e[0])._private.hasPie},_s.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),a=t.pstyle("pie-size"),o=r.x,s=r.y,u=t.width(),l=t.height(),c=Math.min(u,l)/2,h=0;this.usePaths()&&(o=0,s=0),"%"===a.units?c*=a.pfValue:void 0!==a.pfValue&&(c=a.pfValue/2);for(var d=1;d<=i.pieBackgroundN;d++){var p=t.pstyle("pie-"+d+"-background-size").value,f=t.pstyle("pie-"+d+"-background-color").value,g=t.pstyle("pie-"+d+"-background-opacity").value*n,v=p/100;v+h>1&&(v=1-h);var y=1.5*Math.PI+2*Math.PI*h,m=y+2*Math.PI*v;0===p||h>=1||h+v>1||(e.beginPath(),e.moveTo(o,s),e.arc(o,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],g),e.fill(),h+=v)}};var As={};As.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},As.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((t=n[i]).context===e){r=!1;break}return r&&(t={context:e},n.push(t)),t},As.createGradientStyleFor=function(e,t,n,r,i){var a,o=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,u=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var l=n.sourceEndpoint(),c=n.targetEndpoint(),h=n.midpoint(),d=Ge(l,h),p=Ge(c,h);a=e.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(d,p))}else{var f=o?{x:0,y:0}:n.position(),g=n.paddedWidth(),v=n.paddedHeight();a=e.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(g,v))}else if(n.isEdge()){var y=n.sourceEndpoint(),m=n.targetEndpoint();a=e.createLinearGradient(y.x,y.y,m.x,m.y)}else{var b=o?{x:0,y:0}:n.position(),x=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":a=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case"to-top":a=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case"to-left":a=e.createLinearGradient(b.x+x,b.y,b.x-x,b.y);break;case"to-right":a=e.createLinearGradient(b.x-x,b.y,b.x+x,b.y);break;case"to-bottom-right":case"to-right-bottom":a=e.createLinearGradient(b.x-x,b.y-w,b.x+x,b.y+w);break;case"to-top-right":case"to-right-top":a=e.createLinearGradient(b.x-x,b.y+w,b.x+x,b.y-w);break;case"to-bottom-left":case"to-left-bottom":a=e.createLinearGradient(b.x+x,b.y-w,b.x-x,b.y+w);break;case"to-top-left":case"to-left-top":a=e.createLinearGradient(b.x+x,b.y+w,b.x-x,b.y-w)}}if(!a)return null;for(var E=u.length===s.length,C=s.length,S=0;S<C;S++)a.addColorStop(E?u[S]:S/(C-1),"rgba("+s[S][0]+","+s[S][1]+","+s[S][2]+","+i+")");return a},As.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},As.colorFillStyle=function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},As.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle("background-color").value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},As.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},As.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},As.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle("line-color").value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},As.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],a=r[3],o=t.getPixelRatio(),s=t.motionBlurPxRatio;e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(o=s);var u,l=i*o,c=a*o;if(l!==t.canvasWidth||c!==t.canvasHeight){t.fontCaches=null;var h=n.canvasContainer;h.style.width=i+"px",h.style.height=a+"px";for(var d=0;d<t.CANVAS_LAYERS;d++)(u=n.canvases[d]).width=l,u.height=c,u.style.width=i+"px",u.style.height=a+"px";for(d=0;d<t.BUFFER_COUNT;d++)(u=n.bufferCanvases[d]).width=l,u.height=c,u.style.width=i+"px",u.style.height=a+"px";t.textureMult=1,o<=1&&(u=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,u.width=l*t.textureMult,u.height=c*t.textureMult),t.canvasWidth=l,t.canvasHeight=c}},As.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},As.render=function(e){var t=(e=e||ve()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,i=e.forcedZoom,a=e.forcedPan,o=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,u=o.cy,l=o.data,c=l.canvasNeedsRedraw,h=o.textureOnViewport&&!t&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),d=void 0!==e.motionBlur?e.motionBlur:o.motionBlur,p=o.motionBlurPxRatio,f=u.hasCompoundNodes(),g=o.hoverData.draggingEles,v=!(!o.hoverData.selecting&&!o.touchData.selecting),y=d=d&&!t&&o.motionBlurEnabled&&!v;t||(o.prevPxRatio!==s&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=s),!t&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),d&&(null==o.mbFrames&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(y=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!h&&(c[o.NODE]=!0,c[o.SELECT_BOX]=!0);var m=u.style(),b=u.zoom(),x=void 0!==i?i:b,w=u.pan(),E={x:w.x,y:w.y},C={zoom:b,pan:{x:w.x,y:w.y}},S=o.prevViewport;void 0===S||C.zoom!==S.zoom||C.pan.x!==S.pan.x||C.pan.y!==S.pan.y||g&&!f||(o.motionBlurPxRatio=1),a&&(E=a),x*=s,E.x*=s,E.y*=s;var _=o.getCachedZSortedEles();function k(e,t,n,r,i){var a=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",o.colorFillStyle(e,255,255,255,o.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=a}function A(e,r){var s,u,c,h;o.clearingMotionBlur||e!==l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]&&e!==l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]?(s=E,u=x,c=o.canvasWidth,h=o.canvasHeight):(s={x:w.x*p,y:w.y*p},u=b*p,c=o.canvasWidth*p,h=o.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?k(e,0,0,c,h):t||void 0!==r&&!r||e.clearRect(0,0,c,h),n||(e.translate(s.x,s.y),e.scale(u,u)),a&&e.translate(a.x,a.y),i&&e.scale(i,i)}if(h||(o.textureDrawLastFrame=!1),h){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=u.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var T=o.data.bufferContexts[o.TEXTURE_BUFFER];T.setTransform(1,0,0,1,0,0),T.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:T,drawOnlyNodeLayer:!0,forcedPxRatio:s*o.textureMult}),(C=o.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:o.canvasWidth,height:o.canvasHeight}).mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}c[o.DRAG]=!1,c[o.NODE]=!1;var P=l.contexts[o.NODE],M=o.textureCache.texture;C=o.textureCache.viewport;P.setTransform(1,0,0,1,0,0),d?k(P,0,0,C.width,C.height):P.clearRect(0,0,C.width,C.height);var D=m.core("outside-texture-bg-color").value,I=m.core("outside-texture-bg-opacity").value;o.colorFillStyle(P,D[0],D[1],D[2],I),P.fillRect(0,0,C.width,C.height);b=u.zoom();A(P,!1),P.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/s,C.height/C.zoom/s),P.drawImage(M,C.mpan.x,C.mpan.y,C.width/C.zoom/s,C.height/C.zoom/s)}else o.textureOnViewport&&!t&&(o.textureCache=null);var O=u.extent(),B=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),N=o.hideEdgesOnViewport&&B,L=[];if(L[o.NODE]=!c[o.NODE]&&d&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,L[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),L[o.DRAG]=!c[o.DRAG]&&d&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,L[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),c[o.NODE]||n||r||L[o.NODE]){var R=d&&!L[o.NODE]&&1!==p;A(P=t||(R?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:l.contexts[o.NODE]),d&&!R?"motionBlur":void 0),N?o.drawCachedNodes(P,_.nondrag,s,O):o.drawLayeredElements(P,_.nondrag,s,O),o.debug&&o.drawDebugPoints(P,_.nondrag),n||d||(c[o.NODE]=!1)}if(!r&&(c[o.DRAG]||n||L[o.DRAG])){R=d&&!L[o.DRAG]&&1!==p;A(P=t||(R?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:l.contexts[o.DRAG]),d&&!R?"motionBlur":void 0),N?o.drawCachedNodes(P,_.drag,s,O):o.drawCachedElements(P,_.drag,s,O),o.debug&&o.drawDebugPoints(P,_.drag),n||d||(c[o.DRAG]=!1)}if(o.showFps||!r&&c[o.SELECT_BOX]&&!n){if(A(P=t||l.contexts[o.SELECT_BOX]),1==o.selection[4]&&(o.hoverData.selecting||o.touchData.selecting)){b=o.cy.zoom();var j=m.core("selection-box-border-width").value/b;P.lineWidth=j,P.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+")",P.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),j>0&&(P.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+")",P.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){b=o.cy.zoom();var z=l.bgActivePosistion;P.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+")",P.beginPath(),P.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),P.fill()}var V=o.lastRedrawTime;if(o.showFps&&V){V=Math.round(V);var F=Math.round(1e3/V);P.setTransform(1,0,0,1,0,0),P.fillStyle="rgba(255, 0, 0, 0.75)",P.strokeStyle="rgba(255, 0, 0, 0.75)",P.lineWidth=1,P.fillText("1 frame = "+V+" ms = "+F+" fps",0,20);P.strokeRect(0,30,250,20),P.fillRect(0,30,250*Math.min(F/60,1),20)}n||(c[o.SELECT_BOX]=!1)}if(d&&1!==p){var q=l.contexts[o.NODE],X=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],Y=l.contexts[o.DRAG],W=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,o.canvasWidth,o.canvasHeight):k(e,0,0,o.canvasWidth,o.canvasHeight);var r=p;e.drawImage(t,0,0,o.canvasWidth*r,o.canvasHeight*r,0,0,o.canvasWidth,o.canvasHeight)};(c[o.NODE]||L[o.NODE])&&(H(q,X,L[o.NODE]),c[o.NODE]=!1),(c[o.DRAG]||L[o.DRAG])&&(H(Y,W,L[o.DRAG]),c[o.DRAG]=!1)}o.prevViewport=C,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),d&&(o.motionBlurTimeout=setTimeout((function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!h,o.mbFrames=0,c[o.NODE]=!0,c[o.DRAG]=!0,o.redraw()}),100)),t||u.emit("render")};for(var Ts={drawPolygonPath:function(e,t,n,r,i,a){var o=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+s*a[1]);for(var u=1;u<a.length/2;u++)e.lineTo(t+o*a[2*u],n+s*a[2*u+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,i,a){var o=r/2,s=i/2,u=kt(r,i);e.beginPath&&e.beginPath();for(var l=0;l<a.length/4;l++){var c,h=void 0;h=0===l?a.length-2:4*l-2,c=4*l+2;var d=t+o*a[4*l],p=n+s*a[4*l+1],f=-a[h]*a[c]-a[h+1]*a[c+1],g=u/Math.tan(Math.acos(f)/2),v=d-g*a[h],y=p-g*a[h+1],m=d+g*a[c],b=p+g*a[c+1];0===l?e.moveTo(v,y):e.lineTo(v,y),e.arcTo(d,p,m,b,u)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,i){var a=r/2,o=i/2,s=_t(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.arcTo(t+a,n-o,t+a,n,s),e.arcTo(t+a,n+o,t,n+o,s),e.arcTo(t-a,n+o,t-a,n,s),e.arcTo(t-a,n-o,t,n-o,s),e.lineTo(t,n-o),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,i){var a=r/2,o=i/2,s=_t(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-o),e.lineTo(t+a,n-o),e.lineTo(t+a,n),e.arcTo(t+a,n+o,t,n+o,s),e.arcTo(t-a,n+o,t-a,n,s),e.lineTo(t-a,n-o),e.lineTo(t,n-o),e.closePath()},drawCutRectanglePath:function(e,t,n,r,i){var a=r/2,o=i/2;e.beginPath&&e.beginPath(),e.moveTo(t-a+8,n-o),e.lineTo(t+a-8,n-o),e.lineTo(t+a,n-o+8),e.lineTo(t+a,n+o-8),e.lineTo(t+a-8,n+o),e.lineTo(t-a+8,n+o),e.lineTo(t-a,n+o-8),e.lineTo(t-a,n-o+8),e.closePath()},drawBarrelPath:function(e,t,n,r,i){var a=r/2,o=i/2,s=t-a,u=t+a,l=n-o,c=n+o,h=At(r,i),d=h.widthOffset,p=h.heightOffset,f=h.ctrlPtOffsetPct*d;e.beginPath&&e.beginPath(),e.moveTo(s,l+p),e.lineTo(s,c-p),e.quadraticCurveTo(s+f,c,s+d,c),e.lineTo(u-d,c),e.quadraticCurveTo(u-f,c,u,c-p),e.lineTo(u,l+p),e.quadraticCurveTo(u-f,l,u-d,l),e.lineTo(s+d,l),e.quadraticCurveTo(s+f,l,s,l+p),e.closePath()}},Ps=Math.sin(0),Ms=Math.cos(0),Ds={},Is={},Os=Math.PI/40,Bs=0*Math.PI;Bs<2*Math.PI;Bs+=Os)Ds[Bs]=Math.sin(Bs),Is[Bs]=Math.cos(Bs);Ts.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var a,o,s=r/2,u=i/2,l=0*Math.PI;l<2*Math.PI;l+=Os)a=t-s*Ds[l]*Ps+s*Is[l]*Ms,o=n+u*Is[l]*Ps+u*Ds[l]*Ms,0===l?e.moveTo(a,o):e.lineTo(a,o);e.closePath()};var Ns={};function Ls(e){var t=e.indexOf(",");return e.substr(t+1)}function Rs(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new jn((function(r,i){try{t.toBlob((function(e){null!=e?r(e):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,e.quality)}catch(e){i(e)}}));case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([r],{type:t})}(Ls(r()),n);case"base64":return Ls(r());case"base64uri":default:return r()}}Ns.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},Ns.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],a=e.full?Math.ceil(n.h):r[3],o=C(e.maxWidth)||C(e.maxHeight),s=this.getPixelRatio(),u=1;if(void 0!==e.scale)i*=e.scale,a*=e.scale,u=e.scale;else if(o){var l=1/0,c=1/0;C(e.maxWidth)&&(l=u*e.maxWidth/i),C(e.maxHeight)&&(c=u*e.maxHeight/a),i*=u=Math.min(l,c),a*=u}o||(i*=s,a*=s,u*=s);var h=document.createElement("canvas");h.width=i,h.height=a,h.style.width=i+"px",h.style.height=a+"px";var d=h.getContext("2d");if(i>0&&a>0){d.clearRect(0,0,i,a),d.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)d.translate(-n.x1*u,-n.y1*u),d.scale(u,u),this.drawElements(d,p),d.scale(1/u,1/u),d.translate(n.x1*u,n.y1*u);else{var f=t.pan(),g={x:f.x*u,y:f.y*u};u*=t.zoom(),d.translate(g.x,g.y),d.scale(u,u),this.drawElements(d,p),d.scale(1/u,1/u),d.translate(-g.x,-g.y)}e.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=e.bg,d.rect(0,0,i,a),d.fill())}return h},Ns.png=function(e){return Rs(e,this.bufferCanvasImage(e),"image/png")},Ns.jpg=function(e){return Rs(e,this.bufferCanvasImage(e),"image/jpeg")};var js={nodeShapeImpl:function(e,t,n,r,i,a,o){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,a,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,a);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,a);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}}},zs=Fs,Vs=Fs.prototype;function Fs(e){var t=this;t.data={canvases:new Array(Vs.CANVAS_LAYERS),contexts:new Array(Vs.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Vs.CANVAS_LAYERS),bufferCanvases:new Array(Vs.BUFFER_COUNT),bufferContexts:new Array(Vs.CANVAS_LAYERS)};t.data.canvasContainer=document.createElement("div");var n=t.data.canvasContainer.style;t.data.canvasContainer.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",n.position="relative",n.zIndex="0",n.overflow="hidden";var r=e.cy.container();r.appendChild(t.data.canvasContainer),r.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)";var i={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};p&&p.userAgent.match(/msie|trident|edge/i)&&(i["-ms-touch-action"]="none",i["touch-action"]="none");for(var a=0;a<Vs.CANVAS_LAYERS;a++){var o=t.data.canvases[a]=document.createElement("canvas");t.data.contexts[a]=o.getContext("2d"),Object.keys(i).forEach((function(e){o.style[e]=i[e]})),o.style.position="absolute",o.setAttribute("data-id","layer"+a),o.style.zIndex=String(Vs.CANVAS_LAYERS-a),t.data.canvasContainer.appendChild(o),t.data.canvasNeedsRedraw[a]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[Vs.NODE].setAttribute("data-id","layer"+Vs.NODE+"-node"),t.data.canvases[Vs.SELECT_BOX].setAttribute("data-id","layer"+Vs.SELECT_BOX+"-selectbox"),t.data.canvases[Vs.DRAG].setAttribute("data-id","layer"+Vs.DRAG+"-drag");for(a=0;a<Vs.BUFFER_COUNT;a++)t.data.bufferCanvases[a]=document.createElement("canvas"),t.data.bufferContexts[a]=t.data.bufferCanvases[a].getContext("2d"),t.data.bufferCanvases[a].style.position="absolute",t.data.bufferCanvases[a].setAttribute("data-id","buffer"+a),t.data.bufferCanvases[a].style.zIndex=String(-a-1),t.data.bufferCanvases[a].style.visibility="hidden";t.pathsEnabled=!0;var s=Je(),u=function(e){return{x:-e.w/2,y:-e.h/2}},l=function(e){return e.boundingBox(),e[0]._private.bodyBounds},c=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||s},h=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||s},d=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||s},f=function(e,t){return t},g=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},v=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},y=t.data.eleTxrCache=new es(t,{getKey:function(e){return e[0]._private.nodeKey},doesEleInvalidateKey:function(e){var t=e[0]._private;return!(t.oldBackgroundTimestamp===t.backgroundTimestamp)},drawElement:function(e,n,r,i,a){return t.drawElement(e,n,r,!1,!1,a)},getBoundingBox:l,getRotationPoint:function(e){return{x:((t=l(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2};var t},getRotationOffset:function(e){return u(l(e))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),m=t.data.lblTxrCache=new es(t,{getKey:function(e){return e[0]._private.labelStyleKey},drawElement:function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"main",a)},getBoundingBox:c,getRotationPoint:function(e){return g("",v(e,"labelX","labelY"),e)},getRotationOffset:function(e){var t=c(e),n=u(c(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},isVisible:f}),b=t.data.slbTxrCache=new es(t,{getKey:function(e){return e[0]._private.sourceLabelStyleKey},drawElement:function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"source",a)},getBoundingBox:h,getRotationPoint:function(e){return g("source",v(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return u(h(e))},isVisible:f}),x=t.data.tlbTxrCache=new es(t,{getKey:function(e){return e[0]._private.targetLabelStyleKey},drawElement:function(e,n,r,i,a){return t.drawElementText(e,n,r,i,"target",a)},getBoundingBox:d,getRotationPoint:function(e){return g("target",v(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return u(d(e))},isVisible:f}),w=t.data.lyrTxrCache=new ns(t);t.onUpdateEleCalcs((function(e,t){y.invalidateElements(t),m.invalidateElements(t),b.invalidateElements(t),x.invalidateElements(t),w.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}));var E=function(e){for(var t=0;t<e.length;t++)w.enqueueElementRefinement(e[t].ele)};y.onDequeue(E),m.onDequeue(E),b.onDequeue(E),x.onDequeue(E)}Vs.CANVAS_LAYERS=3,Vs.SELECT_BOX=0,Vs.DRAG=1,Vs.NODE=2,Vs.BUFFER_COUNT=3,Vs.TEXTURE_BUFFER=0,Vs.MOTIONBLUR_BUFFER_NODE=1,Vs.MOTIONBLUR_BUFFER_DRAG=2,Vs.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[Vs.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[Vs.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[Vs.SELECT_BOX]=t}};var qs="undefined"!=typeof Path2D;Vs.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},Vs.usePaths=function(){return qs&&this.pathsEnabled},Vs.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},Vs.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},Vs.makeOffscreenCanvas=function(e,t){var n;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":o(OffscreenCanvas))?n=new OffscreenCanvas(e,t):((n=document.createElement("canvas")).width=e,n.height=t),n},[ss,ps,xs,Es,Cs,_s,As,Ts,Ns,js].forEach((function(e){z(Vs,e)}));var Xs=[{type:"layout",extensions:Co},{type:"renderer",extensions:[{name:"null",impl:So},{name:"base",impl:Uo},{name:"canvas",impl:zs}]}],Ys={},Ws={};function Hs(e,t,n){var r=n,i=function(e){de()};if("core"===e){if(La.prototype[t])return i();La.prototype[t]=n}else if("collection"===e){if(ea.prototype[t])return i();ea.prototype[t]=n}else if("layout"===e){for(var a=function(e){this.options=e,n.call(this,e),E(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},o=a.prototype=Object.create(n.prototype),s=[],u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var c=n.prototype.stop;o.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return c?c.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var h=function(e){return e._private.cy},d={addEventFields:function(e,t){t.layout=e,t.cy=h(e),t.target=e},bubble:function(){return!0},parent:function(e){return h(e)}};z(o,{createEmitter:function(){return this._private.emitter=new bi(d,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),Fn.eventAliasesOn(o),r=a}else if("renderer"===e&&"null"!==t&&"base"!==t){var p=Gs("renderer","base"),f=p.prototype,g=n,v=n.prototype,y=function(){p.apply(this,arguments),g.apply(this,arguments)},m=y.prototype;for(var b in f){var x=f[b];if(null!=v[b])return i();m[b]=x}for(var w in v)m[w]=v[w];f.clientFunctions.forEach((function(e){m[e]=m[e]||function(){ce("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=y}return q({map:Ys,keys:[e,t],value:r})}function Gs(e,t){return X({map:Ys,keys:[e,t]})}function Us(e,t,n,r,i){return q({map:Ws,keys:[e,t,n,r],value:i})}function Ks(e,t,n,r){return X({map:Ws,keys:[e,t,n,r]})}var Zs=function(){return 2===arguments.length?Gs.apply(null,arguments):3===arguments.length?Hs.apply(null,arguments):4===arguments.length?Ks.apply(null,arguments):5===arguments.length?Us.apply(null,arguments):void ce("Invalid extension access syntax")};La.prototype.extension=Zs,Xs.forEach((function(e){e.extensions.forEach((function(t){Hs(e.type,t.name,t.impl)}))}));var $s=function e(){if(!(this instanceof e))return new e;this.length=0},Qs=$s.prototype;Qs.instanceString=function(){return"stylesheet"},Qs.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},Qs.css=function(e,t){var n=this.length-1;if(b(e))this[n].properties.push({name:e,value:t});else if(E(e))for(var r=e,i=Object.keys(r),a=0;a<i.length;a++){var o=i[a],s=r[o];if(null!=s){var u=Da.properties[o]||Da.properties[B(o)];if(null!=u){var l=u.name,c=s;this[n].properties.push({name:l,value:c})}}}return this},Qs.style=Qs.css,Qs.generateStyle=function(e){var t=new Da(e);return this.appendToStyle(t)},Qs.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var a=0;a<i.length;a++){var o=i[a];e.css(o.name,o.value)}}return e};var Js=function(e){return void 0===e&&(e={}),E(e)?new La(e):b(e)?Zs.apply(Zs,arguments):void 0};Js.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(Js),e.apply(null,t),this},Js.warnings=function(e){return he(e)},Js.version="3.20.0",Js.stylesheet=Js.Stylesheet=$s,e.exports=Js}).call(this,n(33).setImmediate)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)n[r]={};for(var r in t)n[r]={};return Object.keys(n).length}function i(e,t){var n=0;for(var r in e)void 0!==t[r]&&++n;return n}function a(e,t,n,r){var i=function(e,t){var n={},r=function(e,t){void 0===n[e]&&(n[e]={}),n[e][t]={}};return e.forEach((function(e){var n=t.getSourceIndex(e),i=t.getTargetIndex(e);r(n,i),r(i,n)})),n}(e,r);e.forEach((function(e){var a=i[r.getSourceIndex(e)],o=i[r.getTargetIndex(e)];r.setLength(e,1+t*n(a,o))}))}function o(e,t,n){var r=[],i=0,a=[],o=[];function s(e){e.index=e.lowlink=i++,a.push(e),e.onStack=!0;for(var t=0,n=e.out;t<n.length;t++){var r=n[t];void 0===r.index?(s(r),e.lowlink=Math.min(e.lowlink,r.lowlink)):r.onStack&&(e.lowlink=Math.min(e.lowlink,r.index))}if(e.lowlink===e.index){for(var u=[];a.length&&((r=a.pop()).onStack=!1,u.push(r),r!==e););o.push(u.map((function(e){return e.id})))}}for(var u=0;u<e;u++)r.push({id:u,out:[]});for(var l=0,c=t;l<c.length;l++){var h=c[l],d=r[n.getSourceIndex(h)],p=r[n.getTargetIndex(h)];d.out.push(p)}for(var f=0,g=r;f<g.length;f++){var v=g[f];void 0===v.index&&s(v)}return o}Object.defineProperty(t,"__esModule",{value:!0}),t.symmetricDiffLinkLengths=function(e,t,n){void 0===n&&(n=1),a(e,n,(function(e,t){return Math.sqrt(r(e,t)-i(e,t))}),t)},t.jaccardLinkLengths=function(e,t,n){void 0===n&&(n=1),a(e,n,(function(e,t){return Math.min(Object.keys(e).length,Object.keys(t).length)<1.1?0:i(e,t)/r(e,t)}),t)},t.generateDirectedEdgeConstraints=function(e,t,n,r){var i=o(e,t,r),a={};i.forEach((function(e,t){return e.forEach((function(e){return a[e]=t}))}));var s=[];return t.forEach((function(e){var t=r.getSourceIndex(e),i=r.getTargetIndex(e);a[t]!==a[i]&&s.push({axis:n,left:t,right:i,gap:r.getMinSeparation(e)})})),s},t.stronglyConnectedComponents=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.locks={}}return e.prototype.add=function(e,t){this.locks[e]=t},e.prototype.clear=function(){this.locks={}},e.prototype.isEmpty=function(){for(var e in this.locks)return!1;return!0},e.prototype.apply=function(e){for(var t in this.locks)e(Number(t),this.locks[t])},e}();t.Locks=r;var i=function(){function e(e,t,n){void 0===n&&(n=null),this.D=t,this.G=n,this.threshold=1e-4,this.numGridSnapNodes=0,this.snapGridSize=100,this.snapStrength=1e3,this.scaleSnapByMaxH=!1,this.random=new a,this.project=null,this.x=e,this.k=e.length;var i=this.n=e[0].length;this.H=new Array(this.k),this.g=new Array(this.k),this.Hd=new Array(this.k),this.a=new Array(this.k),this.b=new Array(this.k),this.c=new Array(this.k),this.d=new Array(this.k),this.e=new Array(this.k),this.ia=new Array(this.k),this.ib=new Array(this.k),this.xtmp=new Array(this.k),this.locks=new r,this.minD=Number.MAX_VALUE;for(var o,s=i;s--;)for(o=i;--o>s;){var u=t[s][o];u>0&&u<this.minD&&(this.minD=u)}for(this.minD===Number.MAX_VALUE&&(this.minD=1),s=this.k;s--;){for(this.g[s]=new Array(i),this.H[s]=new Array(i),o=i;o--;)this.H[s][o]=new Array(i);this.Hd[s]=new Array(i),this.a[s]=new Array(i),this.b[s]=new Array(i),this.c[s]=new Array(i),this.d[s]=new Array(i),this.e[s]=new Array(i),this.ia[s]=new Array(i),this.ib[s]=new Array(i),this.xtmp[s]=new Array(i)}}return e.createSquareMatrix=function(e,t){for(var n=new Array(e),r=0;r<e;++r){n[r]=new Array(e);for(var i=0;i<e;++i)n[r][i]=t(r,i)}return n},e.prototype.offsetDir=function(){for(var e=this,t=new Array(this.k),n=0,r=0;r<this.k;++r){var i=t[r]=this.random.getNextBetween(.01,1)-.5;n+=i*i}return n=Math.sqrt(n),t.map((function(t){return t*(e.minD/n)}))},e.prototype.computeDerivatives=function(e){var t=this,n=this.n;if(!(n<1)){for(var r,i=new Array(this.k),a=new Array(this.k),o=new Array(this.k),s=0,u=0;u<n;++u){for(r=0;r<this.k;++r)o[r]=this.g[r][u]=0;for(var l=0;l<n;++l)if(u!==l){for(var c=n;c--;){var h=0;for(r=0;r<this.k;++r){var d=i[r]=e[r][u]-e[r][l];h+=a[r]=d*d}if(h>1e-9)break;var p=this.offsetDir();for(r=0;r<this.k;++r)e[r][l]+=p[r]}var f=Math.sqrt(h),g=this.D[u][l],v=null!=this.G?this.G[u][l]:1;if(v>1&&f>g||!isFinite(g))for(r=0;r<this.k;++r)this.H[r][u][l]=0;else{v>1&&(v=1);var y=g*g,m=2*v*(f-g)/(y*f),b=f*f*f,x=2*-v/(y*b);for(isFinite(m),r=0;r<this.k;++r)this.g[r][u]+=i[r]*m,o[r]-=this.H[r][u][l]=x*(b+g*(a[r]-h)+f*h)}}for(r=0;r<this.k;++r)s=Math.max(s,this.H[r][u][u]=o[r])}var w=this.snapGridSize/2,E=this.snapGridSize,C=this.snapStrength/(w*w),S=this.numGridSnapNodes;for(u=0;u<S;++u)for(r=0;r<this.k;++r){var _=this.x[r][u],k=_/E,A=k%1,T=k-A;-w<(d=Math.abs(A)<=.5?_-T*E:_>0?_-(T+1)*E:_-(T-1)*E)&&d<=w&&(this.scaleSnapByMaxH?(this.g[r][u]+=s*C*d,this.H[r][u][u]+=s*C):(this.g[r][u]+=C*d,this.H[r][u][u]+=C))}this.locks.isEmpty()||this.locks.apply((function(n,i){for(r=0;r<t.k;++r)t.H[r][n][n]+=s,t.g[r][n]-=s*(i[r]-e[r][n])}))}},e.dotProd=function(e,t){for(var n=0,r=e.length;r--;)n+=e[r]*t[r];return n},e.rightMultiply=function(t,n,r){for(var i=t.length;i--;)r[i]=e.dotProd(t[i],n)},e.prototype.computeStepSize=function(t){for(var n=0,r=0,i=0;i<this.k;++i)n+=e.dotProd(this.g[i],t[i]),e.rightMultiply(this.H[i],t[i],this.Hd[i]),r+=e.dotProd(t[i],this.Hd[i]);return 0!==r&&isFinite(r)?1*n/r:0},e.prototype.reduceStress=function(){this.computeDerivatives(this.x);for(var e=this.computeStepSize(this.g),t=0;t<this.k;++t)this.takeDescentStep(this.x[t],this.g[t],e);return this.computeStress()},e.copy=function(e,t){for(var n=e.length,r=t[0].length,i=0;i<n;++i)for(var a=0;a<r;++a)t[i][a]=e[i][a]},e.prototype.stepAndProject=function(t,n,r,i){e.copy(t,n),this.takeDescentStep(n[0],r[0],i),this.project&&this.project[0](t[0],t[1],n[0]),this.takeDescentStep(n[1],r[1],i),this.project&&this.project[1](n[0],t[1],n[1]);for(var a=2;a<this.k;a++)this.takeDescentStep(n[a],r[a],i)},e.mApply=function(e,t,n){for(var r=e;r-- >0;)for(var i=t;i-- >0;)n(r,i)},e.prototype.matrixApply=function(t){e.mApply(this.k,this.n,t)},e.prototype.computeNextPosition=function(e,t){var n=this;this.computeDerivatives(e);var r=this.computeStepSize(this.g);if(this.stepAndProject(e,t,this.g,r),this.project){this.matrixApply((function(r,i){return n.e[r][i]=e[r][i]-t[r][i]}));var i=this.computeStepSize(this.e);i=Math.max(.2,Math.min(i,1)),this.stepAndProject(e,t,this.e,i)}},e.prototype.run=function(e){for(var t=Number.MAX_VALUE,n=!1;!n&&e-- >0;){var r=this.rungeKutta();n=Math.abs(t/r-1)<this.threshold,t=r}return t},e.prototype.rungeKutta=function(){var t=this;this.computeNextPosition(this.x,this.a),e.mid(this.x,this.a,this.ia),this.computeNextPosition(this.ia,this.b),e.mid(this.x,this.b,this.ib),this.computeNextPosition(this.ib,this.c),this.computeNextPosition(this.c,this.d);var n=0;return this.matrixApply((function(e,r){var i=(t.a[e][r]+2*t.b[e][r]+2*t.c[e][r]+t.d[e][r])/6,a=t.x[e][r]-i;n+=a*a,t.x[e][r]=i})),n},e.mid=function(t,n,r){e.mApply(t.length,t[0].length,(function(e,i){return r[e][i]=t[e][i]+(n[e][i]-t[e][i])/2}))},e.prototype.takeDescentStep=function(e,t,n){for(var r=0;r<this.n;++r)e[r]=e[r]-n*t[r]},e.prototype.computeStress=function(){for(var e=0,t=0,n=this.n-1;t<n;++t)for(var r=t+1,i=this.n;r<i;++r){for(var a=0,o=0;o<this.k;++o){var s=this.x[o][t]-this.x[o][r];a+=s*s}a=Math.sqrt(a);var u=this.D[t][r];if(isFinite(u)){var l=u-a;e+=l*l/(u*u)}}return e},e.zeroDistance=1e-10,e}();t.Descent=i;var a=function(){function e(e){void 0===e&&(e=1),this.seed=e,this.a=214013,this.c=2531011,this.m=2147483648,this.range=32767}return e.prototype.getNext=function(){return this.seed=(this.seed*this.a+this.c)%this.m,(this.seed>>16)/this.range},e.prototype.getNextBetween=function(e,t){return e+this.getNext()*(t-e)},e}();t.PseudoRandom=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.scale=e,this.AB=0,this.AD=0,this.A2=0}return e.prototype.addVariable=function(e){var t=this.scale/e.scale,n=e.offset/e.scale,r=e.weight;this.AB+=r*t*n,this.AD+=r*t*e.desiredPosition,this.A2+=r*t*t},e.prototype.getPosn=function(){return(this.AD-this.AB)/this.A2},e}();t.PositionStats=r;var i=function(){function e(e,t,n,r){void 0===r&&(r=!1),this.left=e,this.right=t,this.gap=n,this.equality=r,this.active=!1,this.unsatisfiable=!1,this.left=e,this.right=t,this.gap=n,this.equality=r}return e.prototype.slack=function(){return this.unsatisfiable?Number.MAX_VALUE:this.right.scale*this.right.position()-this.gap-this.left.scale*this.left.position()},e}();t.Constraint=i;var a=function(){function e(e,t,n){void 0===t&&(t=1),void 0===n&&(n=1),this.desiredPosition=e,this.weight=t,this.scale=n,this.offset=0}return e.prototype.dfdv=function(){return 2*this.weight*(this.position()-this.desiredPosition)},e.prototype.position=function(){return(this.block.ps.scale*this.block.posn+this.offset)/this.scale},e.prototype.visitNeighbours=function(e,t){var n=function(n,r){return n.active&&e!==r&&t(n,r)};this.cOut.forEach((function(e){return n(e,e.right)})),this.cIn.forEach((function(e){return n(e,e.left)}))},e}();t.Variable=a;var o=function(){function e(e){this.vars=[],e.offset=0,this.ps=new r(e.scale),this.addVariable(e)}return e.prototype.addVariable=function(e){e.block=this,this.vars.push(e),this.ps.addVariable(e),this.posn=this.ps.getPosn()},e.prototype.updateWeightedPosition=function(){this.ps.AB=this.ps.AD=this.ps.A2=0;for(var e=0,t=this.vars.length;e<t;++e)this.ps.addVariable(this.vars[e]);this.posn=this.ps.getPosn()},e.prototype.compute_lm=function(e,t,n){var r=this,i=e.dfdv();return e.visitNeighbours(t,(function(t,a){var o=r.compute_lm(a,e,n);a===t.right?(i+=o*t.left.scale,t.lm=o):(i+=o*t.right.scale,t.lm=-o),n(t)})),i/e.scale},e.prototype.populateSplitBlock=function(e,t){var n=this;e.visitNeighbours(t,(function(t,r){r.offset=e.offset+(r===t.right?t.gap:-t.gap),n.addVariable(r),n.populateSplitBlock(r,e)}))},e.prototype.traverse=function(e,t,n,r){var i=this;void 0===n&&(n=this.vars[0]),void 0===r&&(r=null),n.visitNeighbours(r,(function(r,a){t.push(e(r)),i.traverse(e,t,a,n)}))},e.prototype.findMinLM=function(){var e=null;return this.compute_lm(this.vars[0],null,(function(t){!t.equality&&(null===e||t.lm<e.lm)&&(e=t)})),e},e.prototype.findMinLMBetween=function(e,t){this.compute_lm(e,null,(function(){}));var n=null;return this.findPath(e,null,t,(function(e,t){!e.equality&&e.right===t&&(null===n||e.lm<n.lm)&&(n=e)})),n},e.prototype.findPath=function(e,t,n,r){var i=this,a=!1;return e.visitNeighbours(t,(function(t,o){a||o!==n&&!i.findPath(o,e,n,r)||(a=!0,r(t,o))})),a},e.prototype.isActiveDirectedPathBetween=function(e,t){if(e===t)return!0;for(var n=e.cOut.length;n--;){var r=e.cOut[n];if(r.active&&this.isActiveDirectedPathBetween(r.right,t))return!0}return!1},e.split=function(t){return t.active=!1,[e.createSplitBlock(t.left),e.createSplitBlock(t.right)]},e.createSplitBlock=function(t){var n=new e(t);return n.populateSplitBlock(t,null),n},e.prototype.splitBetween=function(t,n){var r=this.findMinLMBetween(t,n);if(null!==r){var i=e.split(r);return{constraint:r,lb:i[0],rb:i[1]}}return null},e.prototype.mergeAcross=function(e,t,n){t.active=!0;for(var r=0,i=e.vars.length;r<i;++r){var a=e.vars[r];a.offset+=n,this.addVariable(a)}this.posn=this.ps.getPosn()},e.prototype.cost=function(){for(var e=0,t=this.vars.length;t--;){var n=this.vars[t],r=n.position()-n.desiredPosition;e+=r*r*n.weight}return e},e}();t.Block=o;var s=function(){function e(e){this.vs=e;var t=e.length;for(this.list=new Array(t);t--;){var n=new o(e[t]);this.list[t]=n,n.blockInd=t}}return e.prototype.cost=function(){for(var e=0,t=this.list.length;t--;)e+=this.list[t].cost();return e},e.prototype.insert=function(e){e.blockInd=this.list.length,this.list.push(e)},e.prototype.remove=function(e){var t=this.list.length-1,n=this.list[t];this.list.length=t,e!==n&&(this.list[e.blockInd]=n,n.blockInd=e.blockInd)},e.prototype.merge=function(e){var t=e.left.block,n=e.right.block,r=e.right.offset-e.left.offset-e.gap;t.vars.length<n.vars.length?(n.mergeAcross(t,e,r),this.remove(t)):(t.mergeAcross(n,e,-r),this.remove(n))},e.prototype.forEach=function(e){this.list.forEach(e)},e.prototype.updateBlockPositions=function(){this.list.forEach((function(e){return e.updateWeightedPosition()}))},e.prototype.split=function(e){var t=this;this.updateBlockPositions(),this.list.forEach((function(n){var r=n.findMinLM();null!==r&&r.lm<u.LAGRANGIAN_TOLERANCE&&(n=r.left.block,o.split(r).forEach((function(e){return t.insert(e)})),t.remove(n),e.push(r))}))},e}();t.Blocks=s;var u=function(){function e(e,t){this.vs=e,this.cs=t,this.vs=e,e.forEach((function(e){e.cIn=[],e.cOut=[]})),this.cs=t,t.forEach((function(e){e.left.cOut.push(e),e.right.cIn.push(e)})),this.inactive=t.map((function(e){return e.active=!1,e})),this.bs=null}return e.prototype.cost=function(){return this.bs.cost()},e.prototype.setStartingPositions=function(e){this.inactive=this.cs.map((function(e){return e.active=!1,e})),this.bs=new s(this.vs),this.bs.forEach((function(t,n){return t.posn=e[n]}))},e.prototype.setDesiredPositions=function(e){this.vs.forEach((function(t,n){return t.desiredPosition=e[n]}))},e.prototype.mostViolated=function(){for(var t=Number.MAX_VALUE,n=null,r=this.inactive,i=r.length,a=i,o=0;o<i;++o){var s=r[o];if(!s.unsatisfiable){var u=s.slack();if((s.equality||u<t)&&(t=u,n=s,a=o,s.equality))break}}return a!==i&&(t<e.ZERO_UPPERBOUND&&!n.active||n.equality)&&(r[a]=r[i-1],r.length=i-1),n},e.prototype.satisfy=function(){null==this.bs&&(this.bs=new s(this.vs)),this.bs.split(this.inactive);for(var t=null;(t=this.mostViolated())&&(t.equality||t.slack()<e.ZERO_UPPERBOUND&&!t.active);){var n=t.left.block;if(n!==t.right.block)this.bs.merge(t);else{if(n.isActiveDirectedPathBetween(t.right,t.left)){t.unsatisfiable=!0;continue}var r=n.splitBetween(t.left,t.right);if(null===r){t.unsatisfiable=!0;continue}this.bs.insert(r.lb),this.bs.insert(r.rb),this.bs.remove(n),this.inactive.push(r.constraint),t.slack()>=0?this.inactive.push(t):this.bs.merge(t)}}},e.prototype.solve=function(){this.satisfy();for(var e=Number.MAX_VALUE,t=this.bs.cost();Math.abs(e-t)>1e-4;)this.satisfy(),e=t,t=this.bs.cost();return t},e.LAGRANGIAN_TOLERANCE=-1e-4,e.ZERO_UPPERBOUND=-1e-10,e}();t.Solver=u,t.removeOverlapInOneDimension=function(e,t,n){for(var r=e.map((function(e){return new a(e.desiredCenter)})),o=[],s=e.length,l=0;l<s-1;l++){var c=e[l],h=e[l+1];o.push(new i(r[l],r[l+1],(c.size+h.size)/2))}var d=r[0],p=r[s-1],f=e[0].size/2,g=e[s-1].size/2,v=null,y=null;return t&&(v=new a(t,1e3*d.weight),r.push(v),o.push(new i(v,d,f))),n&&(y=new a(n,1e3*p.weight),r.push(y),o.push(new i(p,y,g))),new u(r,o).solve(),{newCenters:r.slice(0,e.length).map((function(e){return e.position()})),lowerBound:v?v.position():d.position()-f,upperBound:y?y.position():p.position()+g}}},function(e,t,n){"use strict";function r(e){return(r="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)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!0;var o,s,u={};for(o=0,s=n.length;o<s;o++)u[n[o]]=!0;for(o=0,s=i.length;o<s;o++){var l=i[o],c=e[l],h=t[l];if(c!==h){if(!u[l]||null===c||null===h||"object"!==r(c)||"object"!==r(h))return!0;var d=Object.keys(c),p=Object.keys(h);if(d.length!==p.length)return!0;for(var f=0,g=d.length;f<g;f++){var v=d[f];if(c[v]!==h[v])return!0}}}return!1}},function(e,t,n){"use strict";var r=n(4),i=n.n(r),a=n(5),o=n.n(a)()(i.a);o.push([e.i,".service-dependency-graph-panel{display:flex;align-items:center;justify-content:center;flex-direction:column}.graph-container{width:100%;height:100%;display:flex;flex-direction:row}.service-dependency-graph{position:relative;flex-grow:1;min-width:0}.canvas-container{width:100%;height:100%;overflow:hidden}.zoom-button-container{position:absolute;top:0;right:1rem;z-index:99;width:35px}.no-data--selection{color:#888;text-align:center}.threshold--bad{color:#f2495c}.threshold--good{color:#73bf69}.width-100{width:100%}","",{version:3,sources:["webpack://./css/novatec-service-dependency-graph-panel.css"],names:[],mappings:"AAAA,gCAAgC,YAAY,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,iBAAiB,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,0BAA0B,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,kBAAkB,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,uBAAuB,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,oBAAoB,UAAU,CAAC,iBAAiB,CAAC,gBAAgB,aAAa,CAAC,iBAAiB,aAAa,CAAC,WAAW,UAAU",sourcesContent:[".service-dependency-graph-panel{display:flex;align-items:center;justify-content:center;flex-direction:column}.graph-container{width:100%;height:100%;display:flex;flex-direction:row}.service-dependency-graph{position:relative;flex-grow:1;min-width:0}.canvas-container{width:100%;height:100%;overflow:hidden}.zoom-button-container{position:absolute;top:0;right:1rem;z-index:99;width:35px}.no-data--selection{color:#888;text-align:center}.threshold--bad{color:#f2495c}.threshold--good{color:#73bf69}.width-100{width:100%}"],sourceRoot:""}]),t.a=o},function(e,t,n){"use strict";var r=n(4),i=n.n(r),a=n(5),o=n.n(a)()(i.a);o.push([e.i,".margin{margin:10px}.statistics{flex-basis:0;transition:flex-basis 500ms ease-in-out;overflow-y:scroll}.statistics.show{position:absolute;flex-basis:30rem;padding-left:.5%;height:250px !important;width:375px !important;right:0;z-index:999;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.table--selection{width:99%;table-layout:fixed;border:2px solid #286bc7}.table--selection th,.table--selection td{padding:3px 5px}.table--selection tr{border-bottom:2px solid #161719}.table--td--selection{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table--th--selectionSmall{width:5.5rem}.table--th--selectionMedium{width:10rem}.table--selection--head{background-color:#28282a;border-top:2px solid #161719;color:#33b5e5}.table--th,.table--td{border:2px solid #286bc7}.header--selection{font-size:1.25em;text-align:center;border-bottom:2px solid #161719;font-weight:500;color:#84c9fb}.secondHeader--selection{font-size:1.2em;text-align:center;padding-bottom:.5rem}.statistics{flex-basis:0;transition:flex-basis 250ms ease-in-out;overflow-y:scroll}.statistics.show{flex-basis:30rem;padding-left:.5%}","",{version:3,sources:["webpack://./panel/statistics/Statistics.css"],names:[],mappings:"AAAA,QAAQ,WAAW,CAAC,YAAY,YAAY,CAAC,uCAAuC,CAAC,iBAAiB,CAAC,iBAAiB,iBAAiB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,yBAAyB,CAAC,iCAAiC,CAAC,kBAAkB,SAAS,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,0CAA0C,eAAe,CAAC,qBAAqB,+BAA+B,CAAC,sBAAsB,eAAe,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,2BAA2B,YAAY,CAAC,4BAA4B,WAAW,CAAC,wBAAwB,wBAAwB,CAAC,4BAA4B,CAAC,aAAa,CAAC,sBAAsB,wBAAwB,CAAC,mBAAmB,gBAAgB,CAAC,iBAAiB,CAAC,+BAA+B,CAAC,eAAe,CAAC,aAAa,CAAC,yBAAyB,eAAe,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,YAAY,YAAY,CAAC,uCAAuC,CAAC,iBAAiB,CAAC,iBAAiB,gBAAgB,CAAC,gBAAgB",sourcesContent:[".margin{margin:10px}.statistics{flex-basis:0;transition:flex-basis 500ms ease-in-out;overflow-y:scroll}.statistics.show{position:absolute;flex-basis:30rem;padding-left:.5%;height:250px !important;width:375px !important;right:0;z-index:999;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.table--selection{width:99%;table-layout:fixed;border:2px solid #286bc7}.table--selection th,.table--selection td{padding:3px 5px}.table--selection tr{border-bottom:2px solid #161719}.table--td--selection{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table--th--selectionSmall{width:5.5rem}.table--th--selectionMedium{width:10rem}.table--selection--head{background-color:#28282a;border-top:2px solid #161719;color:#33b5e5}.table--th,.table--td{border:2px solid #286bc7}.header--selection{font-size:1.25em;text-align:center;border-bottom:2px solid #161719;font-weight:500;color:#84c9fb}.secondHeader--selection{font-size:1.2em;text-align:center;padding-bottom:.5rem}.statistics{flex-basis:0;transition:flex-basis 250ms ease-in-out;overflow-y:scroll}.statistics.show{flex-basis:30rem;padding-left:.5%}"],sourceRoot:""}]),t.a=o},function(e,t,n){"use strict";var r=n(4),i=n.n(r),a=n(5),o=n.n(a)()(i.a);o.push([e.i,".graph-container{width:100%;height:100%;display:flex;flex-direction:row}.canvas-container{width:100%;height:100%;overflow:hidden}.zoom-button-container{position:absolute;top:0;left:1rem;z-index:99}.zoom-button-container div:nth-child(2){padding:0}.navbar-button{background-color:#000;opacity:1}.navbar-button-fa{color:#fee75c}","",{version:3,sources:["webpack://./panel/serviceDependencyGraph/ServiceDependencyGraph.css"],names:[],mappings:"AAAA,iBAAiB,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,kBAAkB,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,uBAAuB,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,wCAAwC,SAAS,CAAC,eAAe,qBAAqB,CAAC,SAAS,CAAC,kBAAkB,aAAa",sourcesContent:[".graph-container{width:100%;height:100%;display:flex;flex-direction:row}.canvas-container{width:100%;height:100%;overflow:hidden}.zoom-button-container{position:absolute;top:0;left:1rem;z-index:99}.zoom-button-container div:nth-child(2){padding:0}.navbar-button{background-color:#000;opacity:1}.navbar-button-fa{color:#fee75c}"],sourceRoot:""}]),t.a=o},function(e,t,n){"use strict";var r=n(4),i=n.n(r),a=n(5),o=n.n(a)()(i.a);o.push([e.i,".suggestion{width:100%;border-right:1px solid #3865ab;border-left:1px solid #3865ab;background-color:#0b0c0e;padding-left:10px}ul{list-style-type:none}ul:last-child{border-bottom:1px solid #3865ab}","",{version:3,sources:["webpack://./options/TypeAheadTextfield/TypeaheadTextfield.css"],names:[],mappings:"AAAA,YAAY,UAAU,CAAC,8BAA8B,CAAC,6BAA6B,CAAC,wBAAwB,CAAC,iBAAiB,CAAC,GAAG,oBAAoB,CAAC,cAAc,+BAA+B",sourcesContent:[".suggestion{width:100%;border-right:1px solid #3865ab;border-left:1px solid #3865ab;background-color:#0b0c0e;padding-left:10px}ul{list-style-type:none}ul:last-child{border-bottom:1px solid #3865ab}"],sourceRoot:""}]),t.a=o},function(e,t,n){"use strict";var r=n(4),i=n.n(r),a=n(5),o=n.n(a)()(i.a);o.push([e.i,".no-background{background-color:transparent}.no-padding-left{padding-left:0}.icon-mapping-button{width:46.5%;margin-left:0}.width-100{width:100%}.width-half{width:47%;text-overflow:ellipsis}","",{version:3,sources:["webpack://./options/iconMapping/IconMapping.css"],names:[],mappings:"AAAA,eAAe,4BAA4B,CAAC,iBAAiB,cAAc,CAAC,qBAAqB,WAAW,CAAC,aAAa,CAAC,WAAW,UAAU,CAAC,YAAY,SAAS,CAAC,sBAAsB",sourcesContent:[".no-background{background-color:transparent}.no-padding-left{padding-left:0}.icon-mapping-button{width:46.5%;margin-left:0}.width-100{width:100%}.width-half{width:47%;text-overflow:ellipsis}"],sourceRoot:""}]),t.a=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t,n){this.source=e,this.target=t,this.type=n};t.PowerEdge=r;var i=function(){function e(e,t,n,r){var i=this;if(this.linkAccessor=n,this.modules=new Array(e),this.roots=[],r)this.initModulesFromGroup(r);else{this.roots.push(new s);for(var o=0;o<e;++o)this.roots[0].add(this.modules[o]=new a(o))}this.R=t.length,t.forEach((function(e){var t=i.modules[n.getSourceIndex(e)],r=i.modules[n.getTargetIndex(e)],a=n.getType(e);t.outgoing.add(a,r),r.incoming.add(a,t)}))}return e.prototype.initModulesFromGroup=function(e){var t=new s;this.roots.push(t);for(var n=0;n<e.leaves.length;++n){var r=e.leaves[n],i=new a(r.id);this.modules[r.id]=i,t.add(i)}if(e.groups)for(var o=0;o<e.groups.length;++o){var l=e.groups[o],c={};for(var h in l)"leaves"!==h&&"groups"!==h&&l.hasOwnProperty(h)&&(c[h]=l[h]);t.add(new a(-1-o,new u,new u,this.initModulesFromGroup(l),c))}return t},e.prototype.merge=function(e,t,n){void 0===n&&(n=0);var r=e.incoming.intersection(t.incoming),i=e.outgoing.intersection(t.outgoing),o=new s;o.add(e),o.add(t);var u=new a(this.modules.length,i,r,o);this.modules.push(u);var l=function(n,r,i){n.forAll((function(n,a){n.forAll((function(n){var o=n[r];o.add(a,u),o.remove(a,e),o.remove(a,t),e[i].remove(a,n),t[i].remove(a,n)}))}))};return l(i,"incoming","outgoing"),l(r,"outgoing","incoming"),this.R-=r.count()+i.count(),this.roots[n].remove(e),this.roots[n].remove(t),this.roots[n].add(u),u},e.prototype.rootMerges=function(e){void 0===e&&(e=0);for(var t=this.roots[e].modules(),n=t.length,r=new Array(n*(n-1)),i=0,a=0,o=n-1;a<o;++a)for(var s=a+1;s<n;++s){var u=t[a],l=t[s];r[i]={id:i,nEdges:this.nEdges(u,l),a:u,b:l},i++}return r},e.prototype.greedyMerge=function(){for(var e=0;e<this.roots.length;++e)if(!(this.roots[e].modules().length<2)){var t=this.rootMerges(e).sort((function(e,t){return e.nEdges==t.nEdges?e.id-t.id:e.nEdges-t.nEdges}))[0];if(!(t.nEdges>=this.R))return this.merge(t.a,t.b,e),!0}},e.prototype.nEdges=function(e,t){var n=e.incoming.intersection(t.incoming),r=e.outgoing.intersection(t.outgoing);return this.R-n.count()-r.count()},e.prototype.getGroupHierarchy=function(e){var t=this,n=[];return function e(t,n,r){t.forAll((function(t){if(t.isLeaf())n.leaves||(n.leaves=[]),n.leaves.push(t.id);else{var i=n;if(t.gid=r.length,!t.isIsland()||t.isPredefined()){if(i={id:t.gid},t.isPredefined())for(var a in t.definition)i[a]=t.definition[a];n.groups||(n.groups=[]),n.groups.push(t.gid),r.push(i)}e(t.children,i,r)}}))}(this.roots[0],{},n),this.allEdges().forEach((function(i){var a=t.modules[i.source],o=t.modules[i.target];e.push(new r(void 0===a.gid?i.source:n[a.gid],void 0===o.gid?i.target:n[o.gid],i.type))})),n},e.prototype.allEdges=function(){var t=[];return e.getEdges(this.roots[0],t),t},e.getEdges=function(t,n){t.forAll((function(t){t.getEdges(n),e.getEdges(t.children,n)}))},e}();t.Configuration=i;var a=function(){function e(e,t,n,r,i){void 0===t&&(t=new u),void 0===n&&(n=new u),void 0===r&&(r=new s),this.id=e,this.outgoing=t,this.incoming=n,this.children=r,this.definition=i}return e.prototype.getEdges=function(e){var t=this;this.outgoing.forAll((function(n,i){n.forAll((function(n){e.push(new r(t.id,n.id,i))}))}))},e.prototype.isLeaf=function(){return 0===this.children.count()},e.prototype.isIsland=function(){return 0===this.outgoing.count()&&0===this.incoming.count()},e.prototype.isPredefined=function(){return void 0!==this.definition},e}();function o(e,t){var n={};for(var r in e)r in t&&(n[r]=e[r]);return n}t.Module=a;var s=function(){function e(){this.table={}}return e.prototype.count=function(){return Object.keys(this.table).length},e.prototype.intersection=function(t){var n=new e;return n.table=o(this.table,t.table),n},e.prototype.intersectionCount=function(e){return this.intersection(e).count()},e.prototype.contains=function(e){return e in this.table},e.prototype.add=function(e){this.table[e.id]=e},e.prototype.remove=function(e){delete this.table[e.id]},e.prototype.forAll=function(e){for(var t in this.table)e(this.table[t])},e.prototype.modules=function(){var e=[];return this.forAll((function(t){t.isPredefined()||e.push(t)})),e},e}();t.ModuleSet=s;var u=function(){function e(){this.sets={},this.n=0}return e.prototype.count=function(){return this.n},e.prototype.contains=function(e){var t=!1;return this.forAllModules((function(n){t||n.id!=e||(t=!0)})),t},e.prototype.add=function(e,t){(e in this.sets?this.sets[e]:this.sets[e]=new s).add(t),++this.n},e.prototype.remove=function(e,t){var n=this.sets[e];n.remove(t),0===n.count()&&delete this.sets[e],--this.n},e.prototype.forAll=function(e){for(var t in this.sets)e(this.sets[t],Number(t))},e.prototype.forAllModules=function(e){this.forAll((function(t,n){return t.forAll(e)}))},e.prototype.intersection=function(t){var n=new e;return this.forAll((function(e,r){if(r in t.sets){var i=e.intersection(t.sets[r]),a=i.count();a>0&&(n.sets[r]=i,n.n+=a)}})),n},e}();t.LinkSets=u,t.getGroups=function(e,t,n,r){for(var a=e.length,o=new i(a,t,n,r);o.greedyMerge(););var s=[],u=o.getGroupHierarchy(s);return s.forEach((function(t){var n=function(n){var r=t[n];"number"==typeof r&&(t[n]=e[r])};n("source"),n("target")})),{groups:u,powerEdges:s}}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){this.findIter=function(e){for(var t=this._root,n=this.iterator();null!==t;){var r=this._comparator(e,t.data);if(0===r)return n._cursor=t,n;n._ancestors.push(t),t=t.get_child(r>0)}return null}}return e.prototype.clear=function(){this._root=null,this.size=0},e.prototype.find=function(e){for(var t=this._root;null!==t;){var n=this._comparator(e,t.data);if(0===n)return t.data;t=t.get_child(n>0)}return null},e.prototype.lowerBound=function(e){return this._bound(e,this._comparator)},e.prototype.upperBound=function(e){var t=this._comparator;return this._bound(e,(function(e,n){return t(n,e)}))},e.prototype.min=function(){var e=this._root;if(null===e)return null;for(;null!==e.left;)e=e.left;return e.data},e.prototype.max=function(){var e=this._root;if(null===e)return null;for(;null!==e.right;)e=e.right;return e.data},e.prototype.iterator=function(){return new o(this)},e.prototype.each=function(e){for(var t,n=this.iterator();null!==(t=n.next());)e(t)},e.prototype.reach=function(e){for(var t,n=this.iterator();null!==(t=n.prev());)e(t)},e.prototype._bound=function(e,t){for(var n=this._root,r=this.iterator();null!==n;){var i=this._comparator(e,n.data);if(0===i)return r._cursor=n,r;r._ancestors.push(n),n=n.get_child(i>0)}for(var a=r._ancestors.length-1;a>=0;--a)if(t(e,(n=r._ancestors[a]).data)>0)return r._cursor=n,r._ancestors.length=a,r;return r._ancestors.length=0,r},e}();t.TreeBase=a;var o=function(){function e(e){this._tree=e,this._ancestors=[],this._cursor=null}return e.prototype.data=function(){return null!==this._cursor?this._cursor.data:null},e.prototype.next=function(){if(null===this._cursor){var e=this._tree._root;null!==e&&this._minNode(e)}else{var t;if(null===this._cursor.right)do{if(t=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.right===t);else this._ancestors.push(this._cursor),this._minNode(this._cursor.right)}return null!==this._cursor?this._cursor.data:null},e.prototype.prev=function(){if(null===this._cursor){var e=this._tree._root;null!==e&&this._maxNode(e)}else{var t;if(null===this._cursor.left)do{if(t=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.left===t);else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left)}return null!==this._cursor?this._cursor.data:null},e.prototype._minNode=function(e){for(;null!==e.left;)this._ancestors.push(e),e=e.left;this._cursor=e},e.prototype._maxNode=function(e){for(;null!==e.right;)this._ancestors.push(e),e=e.right;this._cursor=e},e}();t.Iterator=o;var s=function(){function e(e){this.data=e,this.left=null,this.right=null,this.red=!0}return e.prototype.get_child=function(e){return e?this.right:this.left},e.prototype.set_child=function(e,t){e?this.right=t:this.left=t},e}(),u=function(e){function t(t){var n=e.call(this)||this;return n._root=null,n._comparator=t,n.size=0,n}return i(t,e),t.prototype.insert=function(e){var n=!1;if(null===this._root)this._root=new s(e),n=!0,this.size++;else{var r=new s(void 0),i=!1,a=!1,o=null,u=r,l=null,c=this._root;for(u.right=this._root;;){if(null===c?(c=new s(e),l.set_child(i,c),n=!0,this.size++):t.is_red(c.left)&&t.is_red(c.right)&&(c.red=!0,c.left.red=!1,c.right.red=!1),t.is_red(c)&&t.is_red(l)){var h=u.right===o;c===l.get_child(a)?u.set_child(h,t.single_rotate(o,!a)):u.set_child(h,t.double_rotate(o,!a))}var d=this._comparator(c.data,e);if(0===d)break;a=i,i=d<0,null!==o&&(u=o),o=l,l=c,c=c.get_child(i)}this._root=r.right}return this._root.red=!1,n},t.prototype.remove=function(e){if(null===this._root)return!1;var n=new s(void 0),r=n;r.right=this._root;for(var i=null,a=null,o=null,u=!0;null!==r.get_child(u);){var l=u;a=i,i=r,r=r.get_child(u);var c=this._comparator(e,r.data);if(u=c>0,0===c&&(o=r),!t.is_red(r)&&!t.is_red(r.get_child(u)))if(t.is_red(r.get_child(!u))){var h=t.single_rotate(r,u);i.set_child(l,h),i=h}else if(!t.is_red(r.get_child(!u))){var d=i.get_child(!l);if(null!==d)if(t.is_red(d.get_child(!l))||t.is_red(d.get_child(l))){var p=a.right===i;t.is_red(d.get_child(l))?a.set_child(p,t.double_rotate(i,l)):t.is_red(d.get_child(!l))&&a.set_child(p,t.single_rotate(i,l));var f=a.get_child(p);f.red=!0,r.red=!0,f.left.red=!1,f.right.red=!1}else i.red=!1,d.red=!0,r.red=!0}}return null!==o&&(o.data=r.data,i.set_child(i.right===r,r.get_child(null===r.left)),this.size--),this._root=n.right,null!==this._root&&(this._root.red=!1),null!==o},t.is_red=function(e){return null!==e&&e.red},t.single_rotate=function(e,t){var n=e.get_child(!t);return e.set_child(!t,n.get_child(t)),n.set_child(t,e),e.red=!0,n.red=!1,n},t.double_rotate=function(e,n){return e.set_child(!n,t.single_rotate(e.get_child(!n),!n)),t.single_rotate(e,n)},t}(a);t.RBTree=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.elem=e,this.subheaps=[]}return e.prototype.toString=function(e){for(var t="",n=!1,r=0;r<this.subheaps.length;++r){var i=this.subheaps[r];i.elem?(n&&(t+=","),t+=i.toString(e),n=!0):n=!1}return""!==t&&(t="("+t+")"),(this.elem?e(this.elem):"")+t},e.prototype.forEach=function(e){this.empty()||(e(this.elem,this),this.subheaps.forEach((function(t){return t.forEach(e)})))},e.prototype.count=function(){return this.empty()?0:1+this.subheaps.reduce((function(e,t){return e+t.count()}),0)},e.prototype.min=function(){return this.elem},e.prototype.empty=function(){return null==this.elem},e.prototype.contains=function(e){if(this===e)return!0;for(var t=0;t<this.subheaps.length;t++)if(this.subheaps[t].contains(e))return!0;return!1},e.prototype.isHeap=function(e){var t=this;return this.subheaps.every((function(n){return e(t.elem,n.elem)&&n.isHeap(e)}))},e.prototype.insert=function(t,n){return this.merge(new e(t),n)},e.prototype.merge=function(e,t){return this.empty()?e:e.empty()?this:t(this.elem,e.elem)?(this.subheaps.push(e),this):(e.subheaps.push(this),e)},e.prototype.removeMin=function(e){return this.empty()?null:this.mergePairs(e)},e.prototype.mergePairs=function(t){if(0==this.subheaps.length)return new e(null);if(1==this.subheaps.length)return this.subheaps[0];var n=this.subheaps.pop().merge(this.subheaps.pop(),t),r=this.mergePairs(t);return n.merge(r,t)},e.prototype.decreaseKey=function(t,n,r,i){var a=t.removeMin(i);t.elem=a.elem,t.subheaps=a.subheaps,null!==r&&null!==a.elem&&r(t.elem,t);var o=new e(n);return null!==r&&r(n,o),this.merge(o,i)},e}();t.PairingHeap=r;var i=function(){function e(e){this.lessThan=e}return e.prototype.top=function(){return this.empty()?null:this.root.elem},e.prototype.push=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i,a=0;i=t[a];++a)e=new r(i),this.root=this.empty()?e:this.root.merge(e,this.lessThan);return e},e.prototype.empty=function(){return!this.root||!this.root.elem},e.prototype.isHeap=function(){return this.root.isHeap(this.lessThan)},e.prototype.forEach=function(e){this.root.forEach(e)},e.prototype.pop=function(){if(this.empty())return null;var e=this.root.min();return this.root=this.root.removeMin(this.lessThan),e},e.prototype.reduceKey=function(e,t,n){void 0===n&&(n=null),this.root=this.root.decreaseKey(e,t,n,this.lessThan)},e.prototype.toString=function(e){return this.root.toString(e)},e.prototype.count=function(){return this.root.count()},e}();t.PriorityQueue=i},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(10),o=function(){};t.Point=o;var s=function(e,t,n,r){this.x1=e,this.y1=t,this.x2=n,this.y2=r};t.LineSegment=s;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(o);function l(e,t,n){return(t.x-e.x)*(n.y-e.y)-(n.x-e.x)*(t.y-e.y)}function c(e,t,n){return l(e,t,n)>0}function h(e,t,n){return l(e,t,n)<0}function d(e,t){var n,r,i,a,o=t.length-1;if(h(e,t[1],t[0])&&!c(e,t[o-1],t[0]))return 0;for(n=0,r=o;;){if(r-n==1)return c(e,t[n],t[r])?n:r;if((a=h(e,t[(i=Math.floor((n+r)/2))+1],t[i]))&&!c(e,t[i-1],t[i]))return i;c(e,t[n+1],t[n])?a||c(e,t[n],t[i])?r=i:n=i:a&&h(e,t[n],t[i])?r=i:n=i}}function p(e,t){var n,r,i,a,o=t.length-1;if(c(e,t[o-1],t[0])&&!h(e,t[1],t[0]))return 0;for(n=0,r=o;;){if(r-n==1)return h(e,t[n],t[r])?n:r;if(a=h(e,t[(i=Math.floor((n+r)/2))+1],t[i]),c(e,t[i-1],t[i])&&!a)return i;h(e,t[n+1],t[n])?a?h(e,t[n],t[i])?r=i:n=i:r=i:a?n=i:c(e,t[n],t[i])?r=i:n=i}}function f(e,t,n,r,i,a){var o,s;s=r(e[o=n(t[0],e)],t);for(var u=!1;!u;){for(u=!0;o===e.length-1&&(o=0),!i(t[s],e[o],e[o+1]);)++o;for(;0===s&&(s=t.length-1),!a(e[o],t[s],t[s-1]);)--s,u=!1}return{t1:o,t2:s}}function g(e,t){return f(e,t,d,p,c,h)}t.PolyPoint=u,t.isLeft=l,t.ConvexHull=function(e){var t,n=e.slice(0).sort((function(e,t){return e.x!==t.x?t.x-e.x:t.y-e.y})),r=e.length,i=n[0].x;for(t=1;t<r&&n[t].x===i;++t);var a=t-1,o=[];if(o.push(n[0]),a===r-1)n[a].y!==n[0].y&&o.push(n[a]);else{var s,u=r-1,c=n[r-1].x;for(t=r-2;t>=0&&n[t].x===c;t--);for(s=t+1,t=a;++t<=s;)if(!(l(n[0],n[s],n[t])>=0&&t<s)){for(;o.length>1&&!(l(o[o.length-2],o[o.length-1],n[t])>0);)o.length-=1;0!=t&&o.push(n[t])}u!=s&&o.push(n[u]);var h=o.length;for(t=s;--t>=a;)if(!(l(n[u],n[a],n[t])>=0&&t>a)){for(;o.length>h&&!(l(o[o.length-2],o[o.length-1],n[t])>0);)o.length-=1;0!=t&&o.push(n[t])}}return o},t.clockwiseRadialSweep=function(e,t,n){t.slice(0).sort((function(t,n){return Math.atan2(t.y-e.y,t.x-e.x)-Math.atan2(n.y-e.y,n.x-e.x)})).forEach(n)},t.tangent_PolyPolyC=f,t.LRtangent_PolyPolyC=function(e,t){var n=g(t,e);return{t1:n.t2,t2:n.t1}},t.RLtangent_PolyPolyC=g,t.LLtangent_PolyPolyC=function(e,t){return f(e,t,p,p,h,h)},t.RRtangent_PolyPolyC=function(e,t){return f(e,t,d,d,c,c)};var v=function(e,t){this.t1=e,this.t2=t};t.BiTangent=v;var y=function(){};t.BiTangents=y;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(o);t.TVGPoint=m;var b=function(e,t,n,r){this.id=e,this.polyid=t,this.polyvertid=n,this.p=r,r.vv=this};t.VisibilityVertex=b;var x=function(){function e(e,t){this.source=e,this.target=t}return e.prototype.length=function(){var e=this.source.p.x-this.target.p.x,t=this.source.p.y-this.target.p.y;return Math.sqrt(e*e+t*t)},e}();t.VisibilityEdge=x;var w=function(){function e(e,t){if(this.P=e,this.V=[],this.E=[],t)this.V=t.V.slice(0),this.E=t.E.slice(0);else{for(var n=e.length,r=0;r<n;r++){for(var i=e[r],a=0;a<i.length;++a){var o=i[a],s=new b(this.V.length,r,a,o);this.V.push(s),a>0&&this.E.push(new x(i[a-1].vv,s))}i.length>1&&this.E.push(new x(i[0].vv,i[i.length-1].vv))}for(r=0;r<n-1;r++){var u=e[r];for(a=r+1;a<n;a++){var l=e[a],c=C(u,l);for(var h in c){var d=c[h],p=u[d.t1],f=l[d.t2];this.addEdgeIfVisible(p,f,r,a)}}}}}return e.prototype.addEdgeIfVisible=function(e,t,n,r){this.intersectsPolys(new s(e.x,e.y,t.x,t.y),n,r)||this.E.push(new x(e.vv,t.vv))},e.prototype.addPoint=function(e,t){var n,r,i,a=this.P.length;this.V.push(new b(this.V.length,a,0,e));for(var o=0;o<a;++o)if(o!==t){var s=this.P[o],u=(n=e,i=void 0,(i=(r=s).slice(0)).push(r[0]),{rtan:d(n,i),ltan:p(n,i)});this.addEdgeIfVisible(e,s[u.ltan],t,o),this.addEdgeIfVisible(e,s[u.rtan],t,o)}return e.vv},e.prototype.intersectsPolys=function(e,t,n){for(var r=0,i=this.P.length;r<i;++r)if(r!=t&&r!=n&&E(e,this.P[r]).length>0)return!0;return!1},e}();function E(e,t){for(var n=[],r=1,i=t.length;r<i;++r){var o=a.Rectangle.lineIntersection(e.x1,e.y1,e.x2,e.y2,t[r-1].x,t[r-1].y,t[r].x,t[r].y);o&&n.push(o)}return n}function C(e,t){for(var n=e.length-1,r=t.length-1,i=new y,a=0;a<n;++a)for(var o=0;o<r;++o){var s=e[0==a?n-1:a-1],u=e[a],c=e[a+1],h=t[0==o?r-1:o-1],d=t[o],p=t[o+1],f=l(s,u,d),g=l(u,h,d),m=l(u,d,p),b=l(h,d,u),x=l(d,s,u),w=l(d,u,c);f>=0&&g>=0&&m<0&&b>=0&&x>=0&&w<0?i.ll=new v(a,o):f<=0&&g<=0&&m>0&&b<=0&&x<=0&&w>0?i.rr=new v(a,o):f<=0&&g>0&&m<=0&&b>=0&&x<0&&w>=0?i.rl=new v(a,o):f>=0&&g<0&&m>=0&&b<=0&&x>0&&w<=0&&(i.lr=new v(a,o))}return i}function S(e,t){return!e.every((function(e){return!function(e,t){for(var n=1,r=t.length;n<r;++n)if(h(t[n-1],t[n],e))return!1;return!0}(e,t)}))}t.TangentVisibilityGraph=w,t.tangents=C,t.polysOverlap=function(e,t){if(S(e,t))return!0;if(S(t,e))return!0;for(var n=1,r=e.length;n<r;++n){var i=e[n],a=e[n-1];if(E(new s(a.x,a.y,i.x,i.y),t).length>0)return!0}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=10,i=(1+Math.sqrt(5))/2,a=1e-4;t.applyPacking=function(e,t,n,o,s,u){void 0===s&&(s=1),void 0===u&&(u=!0);var l=t,c=n,h=(s=void 0!==s?s:1,o=void 0!==o?o:0,0),d=0,p=0,f=0,g=[];function v(e,t){g=[],h=0,d=0,f=0;for(var n=0;n<e.length;n++){y(e[n],t)}return Math.abs(h/d-s)}function y(e,t){for(var n=void 0,i=0;i<g.length;i++)if(g[i].space_left>=e.height&&g[i].x+g[i].width+e.width+r-t<=a){n=g[i];break}g.push(e),void 0!==n?(e.x=n.x+n.width+r,e.y=n.bottom,e.space_left=e.height,e.bottom=e.y,n.space_left-=e.height+r,n.bottom+=e.height+r):(e.y=f,f+=e.height+r,e.x=0,e.bottom=e.y,e.space_left=e.height),e.y+e.height-d>-a&&(d=e.y+e.height-0),e.x+e.width-h>-a&&(h=e.x+e.width-0)}0!=e.length&&(function(e){e.forEach((function(e){var t,n,r,i,a;t=e,n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=0,a=0,t.array.forEach((function(e){var t=void 0!==e.width?e.width:o,s=void 0!==e.height?e.height:o;t/=2,s/=2,i=Math.max(e.x+t,i),n=Math.min(e.x-t,n),a=Math.max(e.y+s,a),r=Math.min(e.y-s,r)})),t.width=i-n,t.height=a-r}))}(e),function(e,t){var n=Number.POSITIVE_INFINITY,o=0;e.sort((function(e,t){return t.height-e.height})),p=e.reduce((function(e,t){return e.width<t.width?e.width:t.width}));var s=y=p,u=m=function(e){var t=0;return e.forEach((function(e){return t+=e.width+r})),t}(e),l=0,c=Number.MAX_VALUE,h=Number.MAX_VALUE,d=-1,f=Number.MAX_VALUE,g=Number.MAX_VALUE;for(;f>p||g>a;){if(1!=d){var y=u-(u-s)/i;c=v(e,y)}if(0!=d){var m=s+(u-s)/i;h=v(e,m)}if(f=Math.abs(y-m),g=Math.abs(c-h),c<n&&(n=c,o=y),h<n&&(n=h,o=m),c>h?(s=y,y=m,c=h,d=1):(u=m,m=y,h=c,d=0),l++>100)break}v(e,o)}(e),u&&function(e){e.forEach((function(e){var t={x:0,y:0};e.array.forEach((function(e){t.x+=e.x,t.y+=e.y})),t.x/=e.array.length,t.y/=e.array.length;var n=t.x-e.width/2,r=t.y-e.height/2,i=e.x-n+l/2-h/2,a=e.y-r+c/2-d/2;e.array.forEach((function(e){e.x+=i,e.y+=a}))}))}(e))},t.separateGraphs=function(e,t){for(var n={},r={},i=[],a=0,o=0;o<t.length;o++){var s=t[o],u=s.source,l=s.target;r[u.index]?r[u.index].push(l):r[u.index]=[l],r[l.index]?r[l.index].push(u):r[l.index]=[u]}for(o=0;o<e.length;o++){var c=e[o];n[c.index]||h(c,!0)}function h(e,t){if(void 0===n[e.index]){t&&(a++,i.push({array:[]})),n[e.index]=a,i[a-1].array.push(e);var o=r[e.index];if(o)for(var s=0;s<o.length;s++)h(o[s],!1)}}return i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(17),a=n(12),o=function(e,t,n){this.id=e,this.rect=t,this.children=n,this.leaf=void 0===n||0===n.length};t.NodeWrapper=o;var s=function(e,t,n,r,i){void 0===r&&(r=null),void 0===i&&(i=null),this.id=e,this.x=t,this.y=n,this.node=r,this.line=i};t.Vert=s;var u=function(){function e(t,n){this.s=t,this.t=n;var r=e.findMatch(t,n),i=n.slice(0).reverse(),a=e.findMatch(t,i);r.length>=a.length?(this.length=r.length,this.si=r.si,this.ti=r.ti,this.reversed=!1):(this.length=a.length,this.si=a.si,this.ti=n.length-a.ti-a.length,this.reversed=!0)}return e.findMatch=function(e,t){for(var n=e.length,r=t.length,i={length:0,si:-1,ti:-1},a=new Array(n),o=0;o<n;o++){a[o]=new Array(r);for(var s=0;s<r;s++)if(e[o]===t[s]){var u=a[o][s]=0===o||0===s?1:a[o-1][s-1]+1;u>i.length&&(i.length=u,i.si=o-u+1,i.ti=s-u+1)}else a[o][s]=0}return i},e.prototype.getSequence=function(){return this.length>=0?this.s.slice(this.si,this.si+this.length):[]},e}();t.LongestCommonSubsequence=u;var l=function(){function e(e,t,n){var i=this;void 0===n&&(n=12),this.originalnodes=e,this.groupPadding=n,this.leaves=null,this.nodes=e.map((function(e,n){return new o(n,t.getBounds(e),t.getChildren(e))})),this.leaves=this.nodes.filter((function(e){return e.leaf})),this.groups=this.nodes.filter((function(e){return!e.leaf})),this.cols=this.getGridLines("x"),this.rows=this.getGridLines("y"),this.groups.forEach((function(e){return e.children.forEach((function(t){return i.nodes[t].parent=e}))})),this.root={children:[]},this.nodes.forEach((function(e){void 0===e.parent&&(e.parent=i.root,i.root.children.push(e.id)),e.ports=[]})),this.backToFront=this.nodes.slice(0),this.backToFront.sort((function(e,t){return i.getDepth(e)-i.getDepth(t)})),this.backToFront.slice(0).reverse().filter((function(e){return!e.leaf})).forEach((function(e){var t=r.Rectangle.empty();e.children.forEach((function(e){return t=t.union(i.nodes[e].rect)})),e.rect=t.inflate(i.groupPadding)}));var a=this.midPoints(this.cols.map((function(e){return e.pos}))),u=this.midPoints(this.rows.map((function(e){return e.pos}))),l=a[0],c=a[a.length-1],h=u[0],d=u[u.length-1],p=this.rows.map((function(e){return{x1:l,x2:c,y1:e.pos,y2:e.pos}})).concat(u.map((function(e){return{x1:l,x2:c,y1:e,y2:e}}))),f=this.cols.map((function(e){return{x1:e.pos,x2:e.pos,y1:h,y2:d}})).concat(a.map((function(e){return{x1:e,x2:e,y1:h,y2:d}}))),g=p.concat(f);g.forEach((function(e){return e.verts=[]})),this.verts=[],this.edges=[],p.forEach((function(e){return f.forEach((function(t){var n=new s(i.verts.length,t.x1,e.y1);e.verts.push(n),t.verts.push(n),i.verts.push(n);for(var r=i.backToFront.length;r-- >0;){var a=i.backToFront[r],o=a.rect,u=Math.abs(n.x-o.cx()),l=Math.abs(n.y-o.cy());if(u<o.width()/2&&l<o.height()/2){n.node=a;break}}}))})),g.forEach((function(e,t){i.nodes.forEach((function(t,n){t.rect.lineIntersections(e.x1,e.y1,e.x2,e.y2).forEach((function(n,r){var a=new s(i.verts.length,n.x,n.y,t,e);i.verts.push(a),e.verts.push(a),t.ports.push(a)}))}));var n=Math.abs(e.y1-e.y2)<.1,r=function(e,t){return n?t.x-e.x:t.y-e.y};e.verts.sort(r);for(var a=1;a<e.verts.length;a++){var o=e.verts[a-1],u=e.verts[a];o.node&&o.node===u.node&&o.node.leaf||i.edges.push({source:o.id,target:u.id,length:Math.abs(r(o,u))})}}))}return e.prototype.avg=function(e){return e.reduce((function(e,t){return e+t}))/e.length},e.prototype.getGridLines=function(e){for(var t=[],n=this.leaves.slice(0,this.leaves.length);n.length>0;){var r=n.filter((function(t){return t.rect["overlap"+e.toUpperCase()](n[0].rect)})),i={nodes:r,pos:this.avg(r.map((function(t){return t.rect["c"+e]()})))};t.push(i),i.nodes.forEach((function(e){return n.splice(n.indexOf(e),1)}))}return t.sort((function(e,t){return e.pos-t.pos})),t},e.prototype.getDepth=function(e){for(var t=0;e.parent!==this.root;)t++,e=e.parent;return t},e.prototype.midPoints=function(e){for(var t=e[1]-e[0],n=[e[0]-t/2],r=1;r<e.length;r++)n.push((e[r]+e[r-1])/2);return n.push(e[e.length-1]+t/2),n},e.prototype.findLineage=function(e){var t=[e];do{e=e.parent,t.push(e)}while(e!==this.root);return t.reverse()},e.prototype.findAncestorPathBetween=function(e,t){for(var n=this.findLineage(e),r=this.findLineage(t),i=0;n[i]===r[i];)i++;return{commonAncestor:n[i-1],lineages:n.slice(i).concat(r.slice(i))}},e.prototype.siblingObstacles=function(e,t){var n=this,r=this.findAncestorPathBetween(e,t),i={};r.lineages.forEach((function(e){return i[e.id]={}}));var a=r.commonAncestor.children.filter((function(e){return!(e in i)}));return r.lineages.filter((function(e){return e.parent!==r.commonAncestor})).forEach((function(e){return a=a.concat(e.parent.children.filter((function(t){return t!==e.id})))})),a.map((function(e){return n.nodes[e]}))},e.getSegmentSets=function(e,t,n){for(var r=[],i=0;i<e.length;i++)for(var a=e[i],o=0;o<a.length;o++){(h=a[o]).edgeid=i,h.i=o;var s=h[1][t]-h[0][t];Math.abs(s)<.1&&r.push(h)}r.sort((function(e,n){return e[0][t]-n[0][t]}));for(var u=[],l=null,c=0;c<r.length;c++){var h=r[c];(!l||Math.abs(h[0][t]-l.pos)>.1)&&(l={pos:h[0][t],segments:[]},u.push(l)),l.segments.push(h)}return u},e.nudgeSegs=function(e,t,n,r,a,o){var s=r.length;if(!(s<=1)){for(var u=r.map((function(t){return new i.Variable(t[0][e])})),l=[],c=0;c<s;c++)for(var h=0;h<s;h++)if(c!==h){var d=r[c],p=r[h],f=d.edgeid,g=p.edgeid,v=-1,y=-1;"x"==e?a(f,g)&&(d[0][t]<d[1][t]?(v=h,y=c):(v=c,y=h)):a(f,g)&&(d[0][t]<d[1][t]?(v=c,y=h):(v=h,y=c)),v>=0&&l.push(new i.Constraint(u[v],u[y],o))}new i.Solver(u,l).solve(),u.forEach((function(t,i){var a=r[i],o=t.position();a[0][e]=a[1][e]=o;var s=n[a.edgeid];a.i>0&&(s[a.i-1][1][e]=o),a.i<s.length-1&&(s[a.i+1][0][e]=o)}))}},e.nudgeSegments=function(t,n,r,i,a){for(var o=e.getSegmentSets(t,n,r),s=0;s<o.length;s++){for(var u=o[s],l=[],c=0;c<u.segments.length;c++){var h=u.segments[c];l.push({type:0,s:h,pos:Math.min(h[0][r],h[1][r])}),l.push({type:1,s:h,pos:Math.max(h[0][r],h[1][r])})}l.sort((function(e,t){return e.pos-t.pos+e.type-t.type}));var d=[],p=0;l.forEach((function(o){0===o.type?(d.push(o.s),p++):p--,0==p&&(e.nudgeSegs(n,r,t,d,i,a),d=[])}))}},e.prototype.routeEdges=function(t,n,r,i){var a=this,o=t.map((function(e){return a.route(r(e),i(e))})),s=e.orderEdges(o),u=o.map((function(t){return e.makeSegments(t)}));return e.nudgeSegments(u,"x","y",s,n),e.nudgeSegments(u,"y","x",s,n),e.unreverseEdges(u,o),u},e.unreverseEdges=function(e,t){e.forEach((function(e,n){t[n].reversed&&(e.reverse(),e.forEach((function(e){e.reverse()})))}))},e.angleBetween2Lines=function(e,t){var n=Math.atan2(e[0].y-e[1].y,e[0].x-e[1].x),r=Math.atan2(t[0].y-t[1].y,t[0].x-t[1].x),i=n-r;return(i>Math.PI||i<-Math.PI)&&(i=r-n),i},e.isLeft=function(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)<=0},e.getOrder=function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];void 0===t[r.l]&&(t[r.l]={}),t[r.l][r.r]=!0}return function(e,n){return void 0!==t[e]&&t[e][n]}},e.orderEdges=function(t){for(var n=[],r=0;r<t.length-1;r++)for(var i=r+1;i<t.length;i++){var a,o,s,l=t[r],c=t[i],h=new u(l,c);0!==h.length&&(h.reversed&&(c.reverse(),c.reversed=!0,h=new u(l,c)),(h.si<=0||h.ti<=0)&&(h.si+h.length>=l.length||h.ti+h.length>=c.length)?n.push({l:r,r:i}):(h.si+h.length>=l.length||h.ti+h.length>=c.length?(a=l[h.si+1],s=l[h.si-1],o=c[h.ti-1]):(a=l[h.si+h.length-2],o=l[h.si+h.length],s=c[h.ti+h.length]),e.isLeft(a,o,s)?n.push({l:i,r:r}):n.push({l:r,r:i})))}return e.getOrder(n)},e.makeSegments=function(e){function t(e){return{x:e.x,y:e.y}}for(var n=function(e,t,n){return Math.abs((t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x))<.001},r=[],i=t(e[0]),a=1;a<e.length;a++){var o=t(e[a]),s=a<e.length-1?e[a+1]:null;s&&n(i,o,s)||(r.push([i,o]),i=o)}return r},e.prototype.route=function(e,t){var n=this,r=this.nodes[e],i=this.nodes[t];this.obstacles=this.siblingObstacles(r,i);var o={};this.obstacles.forEach((function(e){return o[e.id]=e})),this.passableEdges=this.edges.filter((function(e){var t=n.verts[e.source],r=n.verts[e.target];return!(t.node&&t.node.id in o||r.node&&r.node.id in o)}));for(var s=1;s<r.ports.length;s++){var u=r.ports[0].id,l=r.ports[s].id;this.passableEdges.push({source:u,target:l,length:0})}for(s=1;s<i.ports.length;s++){u=i.ports[0].id,l=i.ports[s].id;this.passableEdges.push({source:u,target:l,length:0})}var c=new a.Calculator(this.verts.length,this.passableEdges,(function(e){return e.source}),(function(e){return e.target}),(function(e){return e.length})).PathFromNodeToNodeWithPrevCost(r.ports[0].id,i.ports[0].id,(function(e,t,a){var o=n.verts[e],s=n.verts[t],u=n.verts[a],l=Math.abs(u.x-o.x),c=Math.abs(u.y-o.y);return o.node===r&&o.node===s.node||s.node===i&&s.node===u.node?0:l>1&&c>1?1e3:0})).reverse().map((function(e){return n.verts[e]}));return c.push(this.nodes[i.id].ports[0]),c.filter((function(e,t){return!(t<c.length-1&&c[t+1].node===r&&e.node===r||t>0&&e.node===i&&c[t-1].node===i)}))},e.getRoutePath=function(t,n,r,i){var a={routepath:"M "+t[0][0].x+" "+t[0][0].y+" ",arrowpath:""};if(t.length>1)for(var o=0;o<t.length;o++){var s=(x=t[o])[1].x,u=x[1].y,l=s-x[0].x,c=u-x[0].y;if(o<t.length-1){Math.abs(l)>0?s-=l/Math.abs(l)*n:u-=c/Math.abs(c)*n,a.routepath+="L "+s+" "+u+" ";var h=t[o+1],d=h[0].x,p=h[0].y;l=h[1].x-d,c=h[1].y-p;var f,g,v=e.angleBetween2Lines(x,h)<0?1:0;Math.abs(l)>0?(f=d+l/Math.abs(l)*n,g=p):(f=d,g=p+c/Math.abs(c)*n);var y=Math.abs(f-s),m=Math.abs(g-u);a.routepath+="A "+y+" "+m+" 0 0 "+v+" "+f+" "+g+" "}else{var b=[s,u];Math.abs(l)>0?(w=[s-=l/Math.abs(l)*i,u+r],E=[s,u-r]):(w=[s+r,u-=c/Math.abs(c)*i],E=[s-r,u]),a.routepath+="L "+s+" "+u+" ",i>0&&(a.arrowpath="M "+b[0]+" "+b[1]+" L "+w[0]+" "+w[1]+" L "+E[0]+" "+E[1])}}else{var x,w,E;s=(x=t[0])[1].x,u=x[1].y,l=s-x[0].x,c=u-x[0].y,b=[s,u];Math.abs(l)>0?(w=[s-=l/Math.abs(l)*i,u+r],E=[s,u-r]):(w=[s+r,u-=c/Math.abs(c)*i],E=[s-r,u]),a.routepath+="L "+s+" "+u+" ",i>0&&(a.arrowpath="M "+b[0]+" "+b[1]+" L "+w[0]+" "+w[1]+" L "+E[0]+" "+E[1])}return a},e}();t.GridRouter=l},function(e,t,n){"use strict";var r,i;i=function(e){e&&e("core","cyCanvas",(function(e){var t=this,n=t.container(),r=document.createElement("canvas");n.appendChild(r);var i=Object.assign({},{zIndex:1,pixelRatio:"auto"},e);function a(){var e=n.offsetWidth,a=n.offsetHeight,o=e*i.pixelRatio,s=a*i.pixelRatio;r.width=o,r.height=s,r.style.width=e+"px",r.style.height=a+"px",t.trigger("cyCanvas.resize")}return"auto"===i.pixelRatio&&(i.pixelRatio=window.devicePixelRatio||1),t.on("resize",(function(){a()})),r.setAttribute("style","position:absolute; top:0; left:0; z-index:"+i.zIndex+";"),a(),{getCanvas:function(){return r},clear:function(e){var n=t.width(),r=t.height();e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,n*i.pixelRatio,r*i.pixelRatio),e.restore()},resetTransform:function(e){e.setTransform(1,0,0,1,0,0)},setTransform:function(e){var n=t.pan(),r=t.zoom();e.setTransform(1,0,0,1,0,0),e.translate(n.x*i.pixelRatio,n.y*i.pixelRatio),e.scale(r*i.pixelRatio,r*i.pixelRatio)}}}))},e.exports&&(e.exports=function(e){i(e)}),void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r),"undefined"!=typeof cytoscape&&i(cytoscape)},function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";var r="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},i=n(1),a=n(2),o=n(5)||("undefined"!=typeof window?window.cola:null),s=n(4),u=function(e){return(void 0===e?"undefined":r(e))===r(0)},l=function(){},c=function(e,t){var n;return null!=(n=e)&&(void 0===n?"undefined":r(n))===r((function(){}))?e.apply(t,[t]):e};function h(e){this.options=i({},a,e)}h.prototype.run=function(){var e=this,t=this.options;e.manuallyStopped=!1;var n=t.cy,i=t.eles,a=i.nodes(),h=i.edges(),d=!1,p=a.filter((function(e){return e.isParent()})),f=a.subtract(p),g=t.boundingBox||{x1:0,y1:0,w:n.width(),h:n.height()};void 0===g.x2&&(g.x2=g.x1+g.w),void 0===g.w&&(g.w=g.x2-g.x1),void 0===g.y2&&(g.y2=g.y1+g.h),void 0===g.h&&(g.h=g.y2-g.y1);var v=function(){for(var e=0;e<a.length;e++){var r=a[e],i=r.layoutDimensions(t),o=r.scratch("cola");if(!o.updatedDims){var s=c(t.nodeSpacing,r);o.width=i.w+2*s,o.height=i.h+2*s}}a.positions((function(e){var t=e.scratch().cola,n=void 0;return!e.grabbed()&&f.contains(e)&&(n={x:g.x1+t.x,y:g.y1+t.y},u(n.x)&&u(n.y)||(n=void 0)),n})),a.updateCompoundBounds(),d||(m(),d=!0),t.fit&&n.fit(t.padding)},y=function(){t.ungrabifyWhileSimulating&&w.grabify(),n.off("destroy",E),a.off("grab free position",C),a.off("lock unlock",S),e.one("layoutstop",t.stop),e.trigger({type:"layoutstop",layout:e})},m=function(){e.one("layoutready",t.ready),e.trigger({type:"layoutready",layout:e})},b=t.refresh;b=t.refresh<0?1:Math.max(1,b);var x=e.adaptor=o.adaptor({trigger:function(e){var n=o.EventType?o.EventType.tick:null,r=o.EventType?o.EventType.end:null;switch(e.type){case"tick":case n:t.animate&&v();break;case"end":case r:v(),t.infinite||y()}},kick:function(){var n=!0,r=function(){if(e.manuallyStopped)return y(),!0;var r=x.tick();return t.infinite||n||x.convergenceThreshold(t.convergenceThreshold),n=!1,r&&t.infinite&&x.resume(),r};if(t.animate)s((function e(){(function(){for(var e=void 0,t=0;t<b&&!e;t++)e=e||r();return e})()||s(e)}));else for(;!r(););},on:l,drag:l});e.adaptor=x;var w=a.filter(":grabbable");t.ungrabifyWhileSimulating&&w.ungrabify();var E=void 0;n.one("destroy",E=function(){e.stop()});var C=void 0;a.on("grab free position",C=function(e){var t=this.scratch().cola,n=this.position();if(e.cyTarget===this||e.target===this)switch(e.type){case"grab":x.dragstart(t);break;case"free":x.dragend(t);break;case"position":t.px===n.x-g.x1&&t.py===n.y-g.y1||(t.px=n.x-g.x1,t.py=n.y-g.y1)}});var S=void 0;a.on("lock unlock",S=function(){var e=this.scratch().cola;e.fixed=this.locked(),this.locked()?x.dragstart(e):x.dragend(e)}),x.nodes(f.map((function(e,n){var r=c(t.nodeSpacing,e),i=e.position(),a=e.layoutDimensions(t);return e.scratch().cola={x:t.randomize&&!e.locked()||void 0===i.x?Math.round(Math.random()*g.w):i.x,y:t.randomize&&!e.locked()||void 0===i.y?Math.round(Math.random()*g.h):i.y,width:a.w+2*r,height:a.h+2*r,index:n,fixed:e.locked()}})));var _=[];t.alignment&&(t.alignment.vertical&&t.alignment.vertical.forEach((function(e){var t=[];e.forEach((function(e){var n=e.node.scratch().cola.index;t.push({node:n,offset:e.offset?e.offset:0})})),_.push({type:"alignment",axis:"x",offsets:t})})),t.alignment.horizontal&&t.alignment.horizontal.forEach((function(e){var t=[];e.forEach((function(e){var n=e.node.scratch().cola.index;t.push({node:n,offset:e.offset?e.offset:0})})),_.push({type:"alignment",axis:"y",offsets:t})}))),t.gapInequalities&&t.gapInequalities.forEach((function(e){var t=e.left.scratch().cola.index,n=e.right.scratch().cola.index;_.push({axis:e.axis,left:t,right:n,gap:e.gap,equality:e.equality})})),_.length>0&&x.constraints(_),x.groups(p.map((function(e,n){var r=c(t.nodeSpacing,e),i=function(t){return parseFloat(e.style("padding-"+t))},a=i("left")+r,o=i("right")+r,s=i("top")+r,u=i("bottom")+r;return e.scratch().cola={index:n,padding:Math.max(a,o,s,u),leaves:e.children().intersection(f).map((function(e){return e[0].scratch().cola.index})),fixed:e.locked()},e})).map((function(e){return e.scratch().cola.groups=e.children().intersection(p).map((function(e){return e.scratch().cola.index})),e.scratch().cola})));var k,A=void 0,T=void 0;if(null!=t.edgeLength?(A=t.edgeLength,T="linkDistance"):null!=t.edgeSymDiffLength?(A=t.edgeSymDiffLength,T="symmetricDiffLinkLengths"):null!=t.edgeJaccardLength?(A=t.edgeJaccardLength,T="jaccardLinkLengths"):(A=100,T="linkDistance"),x.links(h.stdFilter((function(e){return f.contains(e.source())&&f.contains(e.target())})).map((function(e){var t=e.scratch().cola={source:e.source()[0].scratch().cola.index,target:e.target()[0].scratch().cola.index};return null!=A&&(t.calcLength=c(A,e)),t}))),x.size([g.w,g.h]),null!=A&&x[T]((function(e){return e.calcLength})),t.flow){var P=void 0;(void 0===(k=t.flow)?"undefined":r(k))===r("")?P={axis:t.flow,minSeparation:50}:u(t.flow)?P={axis:"y",minSeparation:t.flow}:function(e){return null!=e&&(void 0===e?"undefined":r(e))===r({})}(t.flow)?((P=t.flow).axis=P.axis||"y",P.minSeparation=null!=P.minSeparation?P.minSeparation:50):P={axis:"y",minSeparation:50},x.flowLayout(P.axis,P.minSeparation)}return e.trigger({type:"layoutstart",layout:e}),x.avoidOverlaps(t.avoidOverlap).handleDisconnected(t.handleDisconnected).start(t.unconstrIter,t.userConstIter,t.allConstIter,void 0,void 0,t.centerGraph),t.infinite||setTimeout((function(){e.manuallyStopped||x.stop()}),t.maxSimulationTime),this},h.prototype.stop=function(){return this.adaptor&&(this.manuallyStopped=!0,this.adaptor.stop()),this},e.exports=h},function(e,t,n){"use strict";e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.filter((function(e){return null!=e})).forEach((function(t){Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(e,t,n){"use strict";var r={animate:!0,refresh:1,maxSimulationTime:4e3,ungrabifyWhileSimulating:!1,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,ready:function(){},stop:function(){},randomize:!1,avoidOverlap:!0,handleDisconnected:!0,convergenceThreshold:.01,nodeSpacing:function(e){return 10},flow:void 0,alignment:void 0,gapInequalities:void 0,centerGraph:!0,edgeLength:void 0,edgeSymDiffLength:void 0,edgeJaccardLength:void 0,unconstrIter:void 0,userConstIter:void 0,allConstIter:void 0,infinite:!1};e.exports=r},function(e,t,n){"use strict";var r=n(0),i=function(e){e&&e("layout","cola",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){"use strict";var r="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},i=void 0;i="undefined"!==("undefined"==typeof window?"undefined":r(window))?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,16)}:function(e){e()},e.exports=i},function(t,n){t.exports=e}])},e.exports=r(n(39))},function(e,t,n){"use strict";e.exports=n(46).default},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(34),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(14))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,a,o,s,u=1,l={},c=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){f(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){f(e.data)},r=function(e){a.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(f,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&f(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[u]=i,r(u),u++},d.clearImmediate=p}function p(e){delete l[e]}function f(e){if(c)setTimeout(f,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(14),n(35))},function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,l=[],c=!1,h=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):h=-1,l.length&&p())}function p(){if(!c){var e=s(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++h<t;)u&&u[h].run();h=-1,t=l.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||c||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,l=s||u||Function("return this")(),c=Object.prototype.toString,h=Math.max,d=Math.min,p=function(){return l.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==c.call(e)}(e))return NaN;if(f(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||a.test(e)?o(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,a,o,s,u,l=0,c=!1,v=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n)}function b(e){return l=e,s=setTimeout(w,t),c?m(e):o}function x(e){var n=e-u;return void 0===u||n>=t||n<0||v&&e-l>=a}function w(){var e=p();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-u);return v?d(n,a-(e-l)):n}(e))}function E(e){return s=void 0,y&&r?m(e):(r=i=void 0,o)}function C(){var e=p(),n=x(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return b(u);if(v)return s=setTimeout(w,t),m(u)}return void 0===s&&(s=setTimeout(w,t)),o}return t=g(t)||0,f(n)&&(c=!!n.leading,a=(v="maxWait"in n)?h(g(n.maxWait)||0,t):a,y="trailing"in n?!!n.trailing:y),C.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},C.flush=function(){return void 0===s?o:E(p())},C}}).call(this,n(14))},function(e,t,n){e.exports=n(38)},function(e,t,n){var r,i,a;(function(){var n,o,s,u,l,c,h,d,p,f,g,v,y,m,b;s=Math.floor,f=Math.min,o=function(e,t){return e<t?-1:e>t?1:0},p=function(e,t,n,r,i){var a;if(null==n&&(n=0),null==i&&(i=o),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);n<r;)i(t,e[a=s((n+r)/2)])<0?r=a:n=a+1;return[].splice.apply(e,[n,n-n].concat(t)),t},c=function(e,t,n){return null==n&&(n=o),e.push(t),m(e,0,e.length-1,n)},l=function(e,t){var n,r;return null==t&&(t=o),n=e.pop(),e.length?(r=e[0],e[0]=n,b(e,0,t)):r=n,r},d=function(e,t,n){var r;return null==n&&(n=o),r=e[0],e[0]=t,b(e,0,n),r},h=function(e,t,n){var r;return null==n&&(n=o),e.length&&n(e[0],t)<0&&(t=(r=[e[0],t])[0],e[0]=r[1],b(e,0,n)),t},u=function(e,t){var n,r,i,a,u,l;for(null==t&&(t=o),u=[],r=0,i=(a=function(){l=[];for(var t=0,n=s(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)l.push(t);return l}.apply(this).reverse()).length;r<i;r++)n=a[r],u.push(b(e,n,t));return u},y=function(e,t,n){var r;if(null==n&&(n=o),-1!==(r=e.indexOf(t)))return m(e,0,r,n),b(e,r,n)},g=function(e,t,n){var r,i,a,s,l;if(null==n&&(n=o),!(i=e.slice(0,t)).length)return i;for(u(i,n),a=0,s=(l=e.slice(t)).length;a<s;a++)r=l[a],h(i,r,n);return i.sort(n).reverse()},v=function(e,t,n){var r,i,a,s,c,h,d,g,v;if(null==n&&(n=o),10*t<=e.length){if(!(a=e.slice(0,t).sort(n)).length)return a;for(i=a[a.length-1],s=0,h=(d=e.slice(t)).length;s<h;s++)n(r=d[s],i)<0&&(p(a,r,0,null,n),a.pop(),i=a[a.length-1]);return a}for(u(e,n),v=[],c=0,g=f(t,e.length);0<=g?c<g:c>g;0<=g?++c:--c)v.push(l(e,n));return v},m=function(e,t,n,r){var i,a,s;for(null==r&&(r=o),i=e[n];n>t&&r(i,a=e[s=n-1>>1])<0;)e[n]=a,n=s;return e[n]=i},b=function(e,t,n){var r,i,a,s,u;for(null==n&&(n=o),i=e.length,u=t,a=e[t],r=2*t+1;r<i;)(s=r+1)<i&&!(n(e[r],e[s])<0)&&(r=s),e[t]=e[r],r=2*(t=r)+1;return e[t]=a,m(e,u,t,n)},n=function(){function e(e){this.cmp=null!=e?e:o,this.nodes=[]}return e.push=c,e.pop=l,e.replace=d,e.pushpop=h,e.heapify=u,e.updateItem=y,e.nlargest=g,e.nsmallest=v,e.prototype.push=function(e){return c(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-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return d(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return h(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 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),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,e}(),i=[],void 0===(a="function"==typeof(r=function(){return n})?r.apply(t,i):r)||(e.exports=a)}).call(this)},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(40)),r(n(41)),r(n(16)),r(n(27)),r(n(29)),r(n(28)),r(n(9)),r(n(44)),r(n(15)),r(n(24)),r(n(26)),r(n(25)),r(n(10)),r(n(12)),r(n(17)),r(n(45))},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(9),o=function(e){function t(t){var n=e.call(this)||this,r=t;return r.trigger&&(n.trigger=r.trigger),r.kick&&(n.kick=r.kick),r.drag&&(n.drag=r.drag),r.on&&(n.on=r.on),n.dragstart=n.dragStart=a.Layout.dragStart,n.dragend=n.dragEnd=a.Layout.dragEnd,n}return i(t,e),t.prototype.trigger=function(e){},t.prototype.kick=function(){},t.prototype.drag=function(){},t.prototype.on=function(e,t){return this},t}(a.Layout);t.LayoutAdaptor=o,t.adaptor=function(e){return new o(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(42),i=n(43);t.d3adaptor=function(e){return!e||function(e){return e.version&&null!==e.version.match(/^3\./)}(e)?new r.D3StyleLayoutAdaptor:new i.D3StyleLayoutAdaptor(e)}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(9),o=function(e){function t(){var t=e.call(this)||this;t.event=d3.dispatch(a.EventType[a.EventType.start],a.EventType[a.EventType.tick],a.EventType[a.EventType.end]);var n=t;return t.drag=function(){if(!e)var e=d3.behavior.drag().origin(a.Layout.dragOrigin).on("dragstart.d3adaptor",a.Layout.dragStart).on("drag.d3adaptor",(function(e){a.Layout.drag(e,d3.event),n.resume()})).on("dragend.d3adaptor",a.Layout.dragEnd);if(!arguments.length)return e;this.call(e)},t}return i(t,e),t.prototype.trigger=function(e){var t={type:a.EventType[e.type],alpha:e.alpha,stress:e.stress};this.event[t.type](t)},t.prototype.kick=function(){var t=this;d3.timer((function(){return e.prototype.tick.call(t)}))},t.prototype.on=function(e,t){return"string"==typeof e?this.event.on(e,t):this.event.on(a.EventType[e],t),this},t}(a.Layout);t.D3StyleLayoutAdaptor=o,t.d3adaptor=function(){return new o}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(9),o=function(e){function t(t){var n=e.call(this)||this;n.d3Context=t,n.event=t.dispatch(a.EventType[a.EventType.start],a.EventType[a.EventType.tick],a.EventType[a.EventType.end]);var r=n;return n.drag=function(){if(!e)var e=t.drag().subject(a.Layout.dragOrigin).on("start.d3adaptor",a.Layout.dragStart).on("drag.d3adaptor",(function(e){a.Layout.drag(e,t.event),r.resume()})).on("end.d3adaptor",a.Layout.dragEnd);if(!arguments.length)return e;arguments[0].call(e)},n}return i(t,e),t.prototype.trigger=function(e){var t={type:a.EventType[e.type],alpha:e.alpha,stress:e.stress};this.event.call(t.type,t)},t.prototype.kick=function(){var t=this,n=this.d3Context.timer((function(){return e.prototype.tick.call(t)&&n.stop()}))},t.prototype.on=function(e,t){return"string"==typeof e?this.event.on(e,t):this.event.on(a.EventType[e],t),this},t}(a.Layout);t.D3StyleLayoutAdaptor=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(16),a=n(10),o=n(15),s=function(){function e(e,t){this.source=e,this.target=t}return e.prototype.actualLength=function(e){var t=this;return Math.sqrt(e.reduce((function(e,n){var r=n[t.target]-n[t.source];return e+r*r}),0))},e}();t.Link3D=s;var u=function(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),this.x=e,this.y=t,this.z=n};t.Node3D=u;var l=function(){function e(t,n,r){var i=this;void 0===r&&(r=1),this.nodes=t,this.links=n,this.idealLinkLength=r,this.constraints=null,this.useJaccardLinkLengths=!0,this.result=new Array(e.k);for(var a=0;a<e.k;++a)this.result[a]=new Array(t.length);t.forEach((function(t,n){for(var r=0,a=e.dims;r<a.length;r++){var o=a[r];void 0===t[o]&&(t[o]=Math.random())}i.result[0][n]=t.x,i.result[1][n]=t.y,i.result[2][n]=t.z}))}return e.prototype.linkLength=function(e){return e.actualLength(this.result)},e.prototype.start=function(e){var t=this;void 0===e&&(e=100);var n=this.nodes.length,s=new c;this.useJaccardLinkLengths&&o.jaccardLinkLengths(this.links,s,1.5),this.links.forEach((function(e){return e.length*=t.idealLinkLength}));var u=new r.Calculator(n,this.links,(function(e){return e.source}),(function(e){return e.target}),(function(e){return e.length})).DistanceMatrix(),l=i.Descent.createSquareMatrix(n,(function(e,t){return u[e][t]})),h=i.Descent.createSquareMatrix(n,(function(){return 2}));this.links.forEach((function(e){var t=e.source,n=e.target;return h[t][n]=h[n][t]=1})),this.descent=new i.Descent(this.result,l),this.descent.threshold=.001,this.descent.G=h,this.constraints&&(this.descent.project=new a.Projection(this.nodes,null,null,this.constraints).projectFunctions());for(var d=0;d<this.nodes.length;d++){var p=this.nodes[d];p.fixed&&this.descent.locks.add(d,[p.x,p.y,p.z])}return this.descent.run(e),this},e.prototype.tick=function(){this.descent.locks.clear();for(var e=0;e<this.nodes.length;e++){var t=this.nodes[e];t.fixed&&this.descent.locks.add(e,[t.x,t.y,t.z])}return this.descent.rungeKutta()},e.dims=["x","y","z"],e.k=e.dims.length,e}();t.Layout3D=l;var c=function(){function e(){}return e.prototype.getSourceIndex=function(e){return e.source},e.prototype.getTargetIndex=function(e){return e.target},e.prototype.getLength=function(e){return e.length},e.prototype.setLength=function(e,t){e.length=t},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(29);t.gridify=function(e,t,n,r){return e.cola.start(0,0,0,10,!1),function(e,t,n,r){e.forEach((function(e){e.routerNode={name:e.name,bounds:e.bounds.inflate(-n)}})),t.forEach((function(t){t.routerNode={bounds:t.bounds.inflate(-r),children:(void 0!==t.groups?t.groups.map((function(t){return e.length+t.id})):[]).concat(void 0!==t.leaves?t.leaves.map((function(e){return e.index})):[])}}));var a=e.concat(t).map((function(e,t){return e.routerNode.id=t,e.routerNode}));return new i.GridRouter(a,{getChildren:function(e){return e.children},getBounds:function(e){return e.bounds}},n-r)}(e.cola.nodes(),e.cola.groups(),n,r).routeEdges(e.powerGraph.powerEdges,t,(function(e){return e.source.routerNode.id}),(function(e){return e.target.routerNode.id}))},t.powerGraphGridLayout=function(e,t,n){var i;e.nodes.forEach((function(e,t){return e.index=t})),(new r.Layout).avoidOverlaps(!1).nodes(e.nodes).links(e.links).powerGraphGroups((function(e){(i=e).groups.forEach((function(e){return e.padding=n}))}));var a=e.nodes.length,o=[],s=e.nodes.slice(0);return s.forEach((function(e,t){return e.index=t})),i.groups.forEach((function(e){var t=e.index=e.id+a;s.push(e),void 0!==e.leaves&&e.leaves.forEach((function(e){return o.push({source:t,target:e.index})})),void 0!==e.groups&&e.groups.forEach((function(e){return o.push({source:t,target:e.id+a})}))})),i.powerEdges.forEach((function(e){o.push({source:e.source.index,target:e.target.index})})),(new r.Layout).size(t).nodes(s).links(o).avoidOverlaps(!1).linkDistance(30).symmetricDiffLinkLengths(5).convergenceThreshold(1e-4).start(100,0,0,0,!1),{cola:(new r.Layout).convergenceThreshold(.001).size(t).avoidOverlaps(!0).nodes(e.nodes).links(e.links).groupCompactness(1e-4).linkDistance(30).symmetricDiffLinkLengths(5).powerGraphGroups((function(e){(i=e).groups.forEach((function(e){e.padding=n}))})).start(50,0,100,0,!1),powerGraph:i}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(1)),i=u(n(11)),a=u(n(49)),o=u(n(50)),s=n(57);function u(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}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 h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?g(e):t}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(){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 y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=function(){return!0},w=function(e){!function(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&&m(e,t)}(c,e);var t,n,i,u,l=(t=c,function(){var e,n=y(t);if(v()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function c(e){var t,n=e.alwaysRenderSuggestions;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),b(g(t=l.call(this)),"onDocumentMouseDown",(function(e){t.justClickedOnSuggestionsContainer=!1;for(var n=e.detail&&e.detail.target||e.target;null!==n&&n!==document;){if(n.getAttribute&&null!==n.getAttribute("data-suggestion-index"))return;if(n===t.suggestionsContainer)return void(t.justClickedOnSuggestionsContainer=!0);n=n.parentNode}})),b(g(t),"storeAutowhateverRef",(function(e){null!==e&&(t.autowhatever=e)})),b(g(t),"onSuggestionMouseEnter",(function(e,n){var r=n.sectionIndex,i=n.itemIndex;t.updateHighlightedSuggestion(r,i),e.target===t.pressedSuggestion&&(t.justSelectedSuggestion=!0),t.justMouseEntered=!0,setTimeout((function(){t.justMouseEntered=!1}))})),b(g(t),"highlightFirstSuggestion",(function(){t.updateHighlightedSuggestion(t.props.multiSection?0:null,0)})),b(g(t),"onDocumentMouseUp",(function(){t.pressedSuggestion&&!t.justSelectedSuggestion&&t.input.focus(),t.pressedSuggestion=null})),b(g(t),"onSuggestionMouseDown",(function(e){t.justSelectedSuggestion||(t.justSelectedSuggestion=!0,t.pressedSuggestion=e.target)})),b(g(t),"onSuggestionsClearRequested",(function(){var e=t.props.onSuggestionsClearRequested;e&&e()})),b(g(t),"onSuggestionSelected",(function(e,n){var r=t.props,i=r.alwaysRenderSuggestions,a=r.onSuggestionSelected,o=r.onSuggestionsFetchRequested;a&&a(e,n);var s=t.props.shouldKeepSuggestionsOnSelect(n.suggestion);i||s?o({value:n.suggestionValue,reason:"suggestion-selected"}):t.onSuggestionsClearRequested(),t.resetHighlightedSuggestion()})),b(g(t),"onSuggestionClick",(function(e){var n=t.props,r=n.alwaysRenderSuggestions,i=n.focusInputOnSuggestionClick,a=t.getSuggestionIndices(t.findSuggestionElement(e.target)),o=a.sectionIndex,s=a.suggestionIndex,u=t.getSuggestion(o,s),l=t.props.getSuggestionValue(u);t.maybeCallOnChange(e,l,"click"),t.onSuggestionSelected(e,{suggestion:u,suggestionValue:l,suggestionIndex:s,sectionIndex:o,method:"click"});var c=t.props.shouldKeepSuggestionsOnSelect(u);r||c||t.closeSuggestions(),!0===i?t.input.focus():t.onBlur(),setTimeout((function(){t.justSelectedSuggestion=!1}))})),b(g(t),"onBlur",(function(){var e=t.props,n=e.inputProps,r=e.shouldRenderSuggestions,i=n.value,a=n.onBlur,o=t.getHighlightedSuggestion(),s=r(i,"input-blurred");t.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!s}),a&&a(t.blurEvent,{highlightedSuggestion:o})})),b(g(t),"onSuggestionMouseLeave",(function(e){t.resetHighlightedSuggestion(!1),t.justSelectedSuggestion&&e.target===t.pressedSuggestion&&(t.justSelectedSuggestion=!1)})),b(g(t),"onSuggestionTouchStart",(function(){t.justSelectedSuggestion=!0})),b(g(t),"onSuggestionTouchMove",(function(){t.justSelectedSuggestion=!1,t.pressedSuggestion=null,t.input.focus()})),b(g(t),"itemProps",(function(e){return{"data-section-index":e.sectionIndex,"data-suggestion-index":e.itemIndex,onMouseEnter:t.onSuggestionMouseEnter,onMouseLeave:t.onSuggestionMouseLeave,onMouseDown:t.onSuggestionMouseDown,onTouchStart:t.onSuggestionTouchStart,onTouchMove:t.onSuggestionTouchMove,onClick:t.onSuggestionClick}})),b(g(t),"renderSuggestionsContainer",(function(e){var n=e.containerProps,r=e.children;return(0,t.props.renderSuggestionsContainer)({containerProps:n,children:r,query:t.getQuery()})})),t.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},t.justPressedUpDown=!1,t.justMouseEntered=!1,t.pressedSuggestion=null,t}return n=c,(i=[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=0===this.state.highlightedSuggestionIndex&&this.props.highlightFirstSuggestion&&!e.highlightFirstSuggestion;(0,a.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered?this.highlightFirstSuggestion():t&&this.resetHighlightedSuggestion():this.willRenderSuggestions(e,"suggestions-updated")?(this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions(),t&&this.resetHighlightedSuggestion()):this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,i=n.onSuggestionHighlighted,o=n.highlightFirstSuggestion;if(!(0,a.default)(r,e.suggestions)&&r.length>0&&o)this.highlightFirstSuggestion();else if(i){var s=this.getHighlightedSuggestion();s!=t.highlightedSuggestion&&i({suggestion:s})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(i){var a=i.valueBeforeUpDown;return null===t?a=null:null===a&&void 0!==n&&(a=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:a}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,i=n.multiSection,a=n.getSectionSuggestions;return i?a(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(t.getAttribute&&null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,i=r.value,a=r.onChange;t!==i&&a(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e,t){var n=e.suggestions,r=e.inputProps,i=e.shouldRenderSuggestions,a=r.value;return n.length>0&&i(a,t)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,i=t.renderInputComponent,a=t.onSuggestionsFetchRequested,u=t.renderSuggestion,l=t.inputProps,c=t.multiSection,h=t.renderSectionTitle,p=t.id,f=t.getSectionSuggestions,g=t.theme,v=t.getSuggestionValue,y=t.alwaysRenderSuggestions,m=t.highlightFirstSuggestion,b=t.containerProps,w=this.state,E=w.isFocused,C=w.isCollapsed,S=w.highlightedSectionIndex,_=w.highlightedSuggestionIndex,k=w.valueBeforeUpDown,A=y?x:this.props.shouldRenderSuggestions,T=l.value,P=l.onFocus,M=l.onKeyDown,D=this.willRenderSuggestions(this.props,"render"),I=y||E&&!C&&D,O=I?n:[],B=d({},l,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=A(T,"input-focused");e.setState({isFocused:!0,isCollapsed:!n}),P&&P(t),n&&a({value:T,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,r=A(n,"input-changed");e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(d({},m?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!r})),r?a({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var i=t.keyCode;switch(i){case 40:case 38:if(C)A(T,"suggestions-revealed")&&(a({value:T,reason:"suggestions-revealed"}),e.revealSuggestions(),t.preventDefault());else if(n.length>0){var o,s=r.newHighlightedSectionIndex,u=r.newHighlightedItemIndex;o=null===u?null===k?T:k:e.getSuggestionValueByIndex(s,u),e.updateHighlightedSuggestion(s,u,T),e.maybeCallOnChange(t,o,40===i?"down":"up"),t.preventDefault()}e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var l=e.getHighlightedSuggestion();if(I&&!y&&e.closeSuggestions(),null!=l){t.preventDefault();var c=v(l);e.maybeCallOnChange(t,c,"enter"),e.onSuggestionSelected(t,{suggestion:l,suggestionValue:c,suggestionIndex:_,sectionIndex:S,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:I&&t.preventDefault();var h=I&&!y;null===k?h||(e.maybeCallOnChange(t,"","escape"),A("","escape-pressed")?a({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()):e.maybeCallOnChange(t,k,"escape"),h?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}M&&M(t)}}),N={query:this.getQuery()};return r.default.createElement(o.default,{multiSection:c,items:O,renderInputComponent:i,renderItemsContainer:this.renderSuggestionsContainer,renderItem:u,renderItemData:N,renderSectionTitle:h,getSectionItems:f,highlightedSectionIndex:S,highlightedItemIndex:_,containerProps:b,inputProps:B,itemProps:this.itemProps,theme:(0,s.mapToAutowhateverTheme)(g),id:p,ref:this.storeAutowhateverRef})}}])&&p(n.prototype,i),u&&p(n,u),c}(r.Component);t.default=w,b(w,"propTypes",{suggestions:i.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},shouldKeepSuggestionsOnSelect:i.default.func,onSuggestionSelected:i.default.func,onSuggestionHighlighted:i.default.func,renderInputComponent:i.default.func,renderSuggestionsContainer:i.default.func,getSuggestionValue:i.default.func.isRequired,renderSuggestion:i.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n)throw new Error("'inputProps' must be passed.");if(!Object.prototype.hasOwnProperty.call(n,"value"))throw new Error("'inputProps' must have 'value'.");if(!Object.prototype.hasOwnProperty.call(n,"onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:i.default.func,alwaysRenderSuggestions:i.default.bool,multiSection:i.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:i.default.bool,highlightFirstSuggestion:i.default.bool,theme:i.default.object,id:i.default.string,containerProps:i.default.object}),b(w,"defaultProps",{renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return r.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,shouldKeepSuggestionsOnSelect:function(){return!1},focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:s.defaultTheme,id:"1",containerProps:{}})},function(e,t,n){"use strict";var r=n(48);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==g(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(1)),i=l(n(11)),a=l(n(51)),o=l(n(52)),s=l(n(54)),u=l(n(55));function l(e){return e&&e.__esModule?e:{default:e}}function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){E(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e){return(g="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 v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?m(e):t}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(){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 x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var C={},S=function(e){!function(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&&w(e,t)}(h,e);var t,n,i,l,c=(t=h,function(){var e,n=x(t);if(b()){var r=x(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return y(this,e)});function h(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),E(m(t=c.call(this,e)),"storeInputReference",(function(e){null!==e&&(t.input=e);var n=t.props.inputProps.ref;n&&("function"==typeof n?n(e):"object"===g(n)&&Object.prototype.hasOwnProperty.call(n,"current")&&(n.current=e))})),E(m(t),"storeItemsContainerReference",(function(e){null!==e&&(t.itemsContainer=e)})),E(m(t),"onHighlightedItemChange",(function(e){t.highlightedItem=e})),E(m(t),"getItemId",(function(e,n){if(null===n)return null;var r=t.props.id,i=null===e?"":"section-".concat(e);return"react-autowhatever-".concat(r,"-").concat(i,"-item-").concat(n)})),E(m(t),"onFocus",(function(e){var n=t.props.inputProps;t.setState({isInputFocused:!0}),n.onFocus&&n.onFocus(e)})),E(m(t),"onBlur",(function(e){var n=t.props.inputProps;t.setState({isInputFocused:!1}),n.onBlur&&n.onBlur(e)})),E(m(t),"onKeyDown",(function(e){var n=t.props,r=n.inputProps,i=n.highlightedSectionIndex,a=n.highlightedItemIndex,o=e.keyCode;switch(o){case 40:case 38:var s=40===o?"next":"prev",u=p(t.sectionIterator[s]([i,a]),2),l=u[0],c=u[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:c});break;default:r.onKeyDown(e,{highlightedSectionIndex:i,highlightedItemIndex:a})}})),t.highlightedItem=null,t.state={isInputFocused:!1},t.setSectionsItems(e),t.setSectionIterator(e),t.setTheme(e),t}return n=h,(i=[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,a.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,o.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,i=n.id,a=n.items,o=n.renderItem,l=n.renderItemData,c=n.renderSectionTitle,h=n.highlightedSectionIndex,d=n.highlightedItemIndex,p=n.itemProps;return a.map((function(n,a){var f="react-autowhatever-".concat(i,"-"),g="".concat(f,"section-").concat(a,"-"),v=0===a;return r.default.createElement("div",t("".concat(g,"container"),"sectionContainer",v&&"sectionContainerFirst"),r.default.createElement(s.default,{section:n,renderSectionTitle:c,theme:t,sectionKeyPrefix:g}),r.default.createElement(u.default,{items:e.sectionsItems[a],itemProps:p,renderItem:o,renderItemData:l,sectionIndex:a,highlightedItemIndex:h===a?d:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:f,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,i=n.id,a=n.renderItem,o=n.renderItemData,s=n.highlightedSectionIndex,l=n.highlightedItemIndex,c=n.itemProps;return r.default.createElement(u.default,{items:e,itemProps:c,renderItem:a,renderItemData:o,highlightedItemIndex:null===s?l:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-".concat(i,"-")})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,i=t.multiSection,a=t.renderInputComponent,o=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,l=this.state.isInputFocused,c=i?this.renderSections():this.renderItems(),h=null!==c,p=this.getItemId(s,u),f="react-autowhatever-".concat(n),g=d({role:"combobox","aria-haspopup":"listbox","aria-owns":f,"aria-expanded":h},e("react-autowhatever-".concat(n,"-container"),"container",h&&"containerOpen"),{},this.props.containerProps),v=a(d({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":f,"aria-activedescendant":p},e("react-autowhatever-".concat(n,"-input"),"input",h&&"inputOpen",l&&"inputFocused"),{},this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),y=o({containerProps:d({id:f,role:"listbox"},e("react-autowhatever-".concat(n,"-items-container"),"itemsContainer",h&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:c});return r.default.createElement("div",g,v,y)}}])&&v(n.prototype,i),l&&v(n,l),h}(r.Component);t.default=S,E(S,"propTypes",{id:i.default.string,multiSection:i.default.bool,renderInputComponent:i.default.func,renderItemsContainer:i.default.func,items:i.default.array.isRequired,renderItem:i.default.func,renderItemData:i.default.object,renderSectionTitle:i.default.func,getSectionItems:i.default.func,containerProps:i.default.object,inputProps:i.default.object,itemProps:i.default.oneOfType([i.default.object,i.default.func]),highlightedSectionIndex:i.default.number,highlightedItemIndex:i.default.number,theme:i.default.oneOfType([i.default.object,i.default.array])}),E(S,"defaultProps",{id:"1",multiSection:!1,renderInputComponent:function(e){return r.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return r.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:C,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:C,inputProps:C,itemProps:C,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}})},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function i(e){var i=r(e,2),a=i[0],o=i[1];return n?null===o||o===t[a]-1?null===(a=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(a))?[null,null]:[a,0]:[a,o+1]:0===t||o===t-1?[null,null]:null===o?[null,0]:[null,o+1]}return{next:i,prev:function(e){var i=r(e,2),a=i[0],o=i[1];return n?null===o||0===o?null===(a=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(a))?[null,null]:[a,t[a]-1]:[a,o-1]:0===t||0===o?[null,null]:null===o?[null,t-1]:[null,o-1]},isLast:function(e){return null===i(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var a,o=n(53),s=(a=o)&&a.__esModule?a:{default:a},u=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),a=n[0],o=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var l=n.map((function(e){return a[e]})).filter(u);return"string"==typeof l[0]||"function"==typeof o?{key:e,className:o?o.apply(void 0,i(l)):l.join(" ")}:{key:e,style:s.default.apply(void 0,[{}].concat(i(l)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,o=i(e),s=1;s<arguments.length;s++){n=arguments[s],r=a(Object(n));for(var u=0;u<r.length;u++)o[r[u]]=n[r[u]]}return o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(1)),i=o(n(11)),a=o(n(18));function o(e){return e&&e.__esModule?e:{default:e}}function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){return(u="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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(){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 p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var g,v,y,m=function(e){!function(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&&f(e,t)}(u,e);var t,n,i,o,s=(t=u,function(){var e,n=p(t);if(d()){var r=p(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return h(this,e)});function u(){return l(this,u),s.apply(this,arguments)}return n=u,(i=[{key:"shouldComponentUpdate",value:function(e){return(0,a.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,i=e.theme,a=e.sectionKeyPrefix,o=n(t);return o?r.default.createElement("div",i("".concat(a,"title"),"sectionTitle"),o):null}}])&&c(n.prototype,i),o&&c(n,o),u}(r.Component);t.default=m,g=m,v="propTypes",y={section:i.default.any.isRequired,renderSectionTitle:i.default.func.isRequired,theme:i.default.func.isRequired,sectionKeyPrefix:i.default.string.isRequired},v in g?Object.defineProperty(g,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[v]=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==l(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(1)),i=s(n(11)),a=s(n(56)),o=s(n(18));function s(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function l(e){return(l="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 c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?g(e):t}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(){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 y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=function(e){!function(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&&m(e,t)}(l,e);var t,n,i,s,u=(t=l,function(){var e,n=y(t);if(v()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function l(){var e;d(this,l);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return b(g(e=u.call.apply(u,[this].concat(n))),"storeHighlightedItemReference",(function(t){e.props.onHighlightedItemChange(null===t?null:t.item)})),e}return n=l,(i=[{key:"shouldComponentUpdate",value:function(e){return(0,o.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,i=t.itemProps,o=t.renderItem,s=t.renderItemData,u=t.sectionIndex,l=t.highlightedItemIndex,d=t.getItemId,p=t.theme,f=t.keyPrefix,g=null===u?f:"".concat(f,"section-").concat(u,"-"),v="function"==typeof i;return r.default.createElement("ul",c({role:"listbox"},p("".concat(g,"items-list"),"itemsList")),n.map((function(t,n){var f=0===n,y=n===l,m="".concat(g,"item-").concat(n),x=v?i({sectionIndex:u,itemIndex:n}):i,w=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({id:d(u,n),"aria-selected":y},p(m,"item",f&&"itemFirst",y&&"itemHighlighted"),{},x);return y&&(w.ref=e.storeHighlightedItemReference),r.default.createElement(a.default,c({},w,{sectionIndex:u,isHighlighted:y,itemIndex:n,item:t,renderItem:o,renderItemData:s}))})))}}])&&p(n.prototype,i),s&&p(n,s),l}(r.Component);t.default=x,b(x,"propTypes",{items:i.default.array.isRequired,itemProps:i.default.oneOfType([i.default.object,i.default.func]),renderItem:i.default.func.isRequired,renderItemData:i.default.object.isRequired,sectionIndex:i.default.number,highlightedItemIndex:i.default.number,onHighlightedItemChange:i.default.func.isRequired,getItemId:i.default.func.isRequired,theme:i.default.func.isRequired,keyPrefix:i.default.string.isRequired}),b(x,"defaultProps",{sectionIndex:null})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=r?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(1)),i=o(n(11)),a=o(n(18));function o(e){return e&&e.__esModule?e:{default:e}}function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){return(u="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(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,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 p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?g(e):t}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(){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 y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=function(e){!function(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&&m(e,t)}(u,e);var t,n,i,o,s=(t=u,function(){var e,n=y(t);if(v()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function u(){var e;d(this,u);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return b(g(e=s.call.apply(s,[this].concat(n))),"storeItemReference",(function(t){null!==t&&(e.item=t)})),b(g(e),"onMouseEnter",(function(t){var n=e.props,r=n.sectionIndex,i=n.itemIndex;e.props.onMouseEnter(t,{sectionIndex:r,itemIndex:i})})),b(g(e),"onMouseLeave",(function(t){var n=e.props,r=n.sectionIndex,i=n.itemIndex;e.props.onMouseLeave(t,{sectionIndex:r,itemIndex:i})})),b(g(e),"onMouseDown",(function(t){var n=e.props,r=n.sectionIndex,i=n.itemIndex;e.props.onMouseDown(t,{sectionIndex:r,itemIndex:i})})),b(g(e),"onClick",(function(t){var n=e.props,r=n.sectionIndex,i=n.itemIndex;e.props.onClick(t,{sectionIndex:r,itemIndex:i})})),e}return n=u,(i=[{key:"shouldComponentUpdate",value:function(e){return(0,a.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,i=e.renderItem,a=e.renderItemData,o=h(e,["isHighlighted","item","renderItem","renderItemData"]);return delete o.sectionIndex,delete o.itemIndex,"function"==typeof o.onMouseEnter&&(o.onMouseEnter=this.onMouseEnter),"function"==typeof o.onMouseLeave&&(o.onMouseLeave=this.onMouseLeave),"function"==typeof o.onMouseDown&&(o.onMouseDown=this.onMouseDown),"function"==typeof o.onClick&&(o.onClick=this.onClick),r.default.createElement("li",l({role:"option"},o,{ref:this.storeItemReference}),i(n,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({isHighlighted:t},a)))}}])&&p(n.prototype,i),o&&p(n,o),u}(r.Component);t.default=x,b(x,"propTypes",{sectionIndex:i.default.number,isHighlighted:i.default.bool.isRequired,itemIndex:i.default.number.isRequired,item:i.default.any.isRequired,renderItem:i.default.func.isRequired,renderItemData:i.default.object.isRequired,onMouseEnter:i.default.func,onMouseLeave:i.default.func,onMouseDown:i.default.func,onClick:i.default.func})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapToAutowhateverTheme=t.defaultTheme=void 0;t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"};t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";n.r(t);var r=n(2),i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function l(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var c,h,d=n(1),p=n.n(d),f=n(0),g=n.n(f),v=function(){function e(e){this.maxVolume=800,this.minSpawnPropability=.004,this.drawer=e,this.animating=!1}return e.prototype.start=function(){if(this.animating=!0,!this.spawnInterval){var e=this;this.spawnInterval=setInterval((function(){return e.animate()}),60)}},e.prototype.stop=function(){this.animating=!1},e.prototype.animate=function(){this.animating?this._spawnParticles():this.hasParticles()||(clearInterval(this.spawnInterval),this.spawnInterval=null),this.drawer.repaint()},e.prototype.hasParticles=function(){var e,t;try{for(var n=l(this.drawer.cytoscape.edges().toArray()),r=n.next();!r.done;r=n.next()){var i=r.value;if(void 0!==i.data("particles")&&(i.data("particles").normal.length>0||i.data("particles").danger.length>0))return!0}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return!1},e.prototype._spawnParticles=function(){var e=this,t=this.drawer.cytoscape,n=Date.now();t.edges().forEach((function(t){var r=t.data("particles"),i=t.data("metrics");if(i){var a,o=g.a.defaultTo(i.rate,0),s=g.a.defaultTo(i.error_rate,0),u=o+s;if(a=o>=0&&s>=0?s/o:0,void 0===r&&(r={normal:[],danger:[]},t.data("particles",r)),i&&u>0)for(var l=Math.min(u/e.maxVolume,1),c=0;c<5;c++)if(Math.random()<=l+e.minSpawnPropability){var h={velocity:.05+.05*Math.random(),startTime:n};Math.random()<a?r.danger.push(h):r.normal.push(h)}}}))},e.prototype.count=function(){var e=this.drawer.cytoscape;return g()(e.edges()).map((function(e){return e.data("particles")})).filter().map((function(e){return e.normal.length+e.danger.length})).sum()},e}();!function(e){e.SELF="SELF",e.INTERNAL="INTERNAL",e.EXTERNAL_OUT="EXTERNAL_OUT",e.EXTERNAL_IN="EXTERNAL_IN"}(c||(c={})),function(e){e.INTERNAL="INTERNAL",e.EXTERNAL="EXTERNAL"}(h||(h={}));var y=n(8),m=n.n(y),b={getAssetUrl:function(e){return"public/plugins/novatec-sdg-panel/assets/icons/"+e},getTypeSymbol:function(e,t,n){if(void 0===n&&(n=!0),!e)return this.getAssetUrl("default.png");if(!n)return this.getAssetUrl(e);var r=Object(f.find)(t,(function(t){return t.pattern.toLowerCase()===e.toLowerCase()}));return void 0!==r?this.getAssetUrl(r.filename+".png"):this.getAssetUrl("default.png")}};function x(e){switch(e){case 5:return"OK";case 4:return"Warning";case 3:return"Minor";case 2:return"Major";case 1:return"Critical";default:return"OK"}}var w=[{unit:"ms",factor:1},{unit:"s",factor:1e3},{unit:"m",factor:6e4}],E=function(){function e(e,t,n){this.colors={default:"#111217",background:"#212121",defaultText:"#ffffff",edge:"#505050",status:{warning:"orange"}},this.donutRadius=15,this.frameCounter=0,this.fpsCounter=0,this.imageAssets={},this.lastRenderTime=0,this.dashAnimationOffset=0,this.cytoscape=t,this.cyCanvas=n,this.controller=e,this.particleEngine=new v(this),this.pixelRatio=window.devicePixelRatio||1,this.canvas=n.getCanvas();var r=this.canvas.getContext("2d");r&&(this.context=r),this.offscreenCanvas=document.createElement("canvas"),this.offscreenContext=this.offscreenCanvas.getContext("2d"),this.repaint(!0)}return e.prototype._getTimeScale=function(e){var t,n,r={};try{for(var i=l(w),a=i.next();!a.done;a=i.next()){var o=a.value;if(r[o.unit]=o.factor,o.unit===e)return r}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.resetAssets=function(){this.imageAssets={}},e.prototype._loadImage=function(e,t){var n,r,i,a=this;(n=e,r=t,i=new Image,a.imageAssets[r]={image:i,loaded:!1},new Promise((function(e,t){i.onload=function(){return e(r)},i.onerror=function(){return t(new Error("load ".concat(n," fail")))},i.src=n}))).then((function(e){a.imageAssets[e].loaded=!0}))},e.prototype._isImageLoaded=function(e){return!(!g.a.has(this.imageAssets,e)||!this.imageAssets[e].loaded)},e.prototype._getImageAsset=function(e,t){if(void 0===t&&(t=!0),!g.a.has(this.imageAssets,e)){var n=this.controller.getSettings(!0).externalIcons,r=b.getTypeSymbol(e,n,t);this._loadImage(r,e)}return this._isImageLoaded(e)?this.imageAssets[e].image:null},e.prototype._getAsset=function(e,t){if(!g.a.has(this.imageAssets,e)){var n=b.getAssetUrl(t);this._loadImage(n,e)}return this._isImageLoaded(e)?this.imageAssets[e].image:null},e.prototype.start=function(){var e=this;window.requestAnimationFrame((function t(){e.repaint(),window.requestAnimationFrame(t)})),setInterval((function(){e.fpsCounter=e.frameCounter,e.frameCounter=0}),1e3)},e.prototype.startAnimation=function(){this.particleEngine.start()},e.prototype.stopAnimation=function(){this.particleEngine.stop(),this.repaint()},e.prototype._skipFrame=function(){var e=Date.now()-this.lastRenderTime;return!(this.particleEngine.count()>0)&&(!this.controller.getSettings(!0).animate&&e<1e3)},e.prototype.repaint=function(e){var t=this;if(void 0===e&&(e=!0),e||!this._skipFrame()){this.lastRenderTime=Date.now();var n=this.context,r=this.cyCanvas,i=this.offscreenCanvas,a=this.offscreenContext;i.width=this.canvas.width,i.height=this.canvas.height,this._setTransformation(a),this.selectionNeighborhood=this.cytoscape.collection(),this.cytoscape.$(":selected").forEach((function(e){if(t.selectionNeighborhood.merge(e),e.isNode()){var n=e.neighborhood();t.selectionNeighborhood.merge(n)}else{var r=e.source(),i=e.target();t.selectionNeighborhood.merge(r),t.selectionNeighborhood.merge(i)}})),this._drawEdgeAnimation(a),this._drawNodes(a),r.clear(n),this.controller.getSettings(!0).showDebugInformation&&this._drawDebugInformation(),i.width>0&&i.height>0&&n.drawImage(i,0,0),this.dashAnimationOffset=Date.now()%6e4/250}},e.prototype._setTransformation=function(e){var t=this.cytoscape.pan(),n=this.cytoscape.zoom();e.setTransform(1,0,0,1,0,0),e.translate(t.x*this.pixelRatio,t.y*this.pixelRatio),e.scale(n*this.pixelRatio,n*this.pixelRatio)},e.prototype._drawEdgeAnimation=function(e){var t=this,n=Date.now();e.save();var r=this.cytoscape.edges().toArray(),i=this.selectionNeighborhood.size()>0,a=r.filter((function(e){return i&&!t.selectionNeighborhood.has(e)})),o=r.filter((function(e){return!i||t.selectionNeighborhood.has(e)}));e.globalAlpha=.25,this._drawEdges(e,a,n),e.globalAlpha=1,this._drawEdges(e,o,n),e.restore()},e.prototype._drawEdges=function(e,t,n){var r,i,a,o,s=this.cytoscape;try{for(var u=l(t),c=u.next();!c.done;c=u.next()){var h=c.value;try{var d=h.sourceEndpoint(),p=h.targetEndpoint();this._drawEdgeLine(e,h,d,p),this._drawEdgeParticles(e,h,d,p,n)}catch(e){}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}if(this.controller.getSettings(!0).showConnectionStats&&s.zoom()>1)try{for(var f=l(t),g=f.next();!g.done;g=f.next()){h=g.value;this._drawEdgeLabel(e,h)}}catch(e){a={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}},e.prototype._drawEdgeLine=function(e,t,n,r){e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y);var i,a=t.data("metrics"),o=g.a.get(a,"normal",-1),s=g.a.get(a,"danger",-1);if(!this.selectionNeighborhood.empty()&&this.selectionNeighborhood.has(t)?(e.lineWidth=3,i=140):(e.lineWidth=1,i=80),o>=0&&s>=0){var u=s/o,l=Math.min(255,i+255*Math.log2(u+1));e.strokeStyle="rgb("+l+","+i+","+i+")"}else e.strokeStyle="rgb("+i+","+i+","+i+")";e.stroke()},e.prototype._drawEdgeLabel=function(e,t){var n=this.controller.getSettings(!0).timeFormat,r=t.midpoint(),i=r.x,a=r.y,o=[],s=t.data("metrics"),u=g.a.defaultTo(s.response_time,-1),l=g.a.defaultTo(s.rate,-1),c=g.a.defaultTo(s.error_rate,-1),h=new m.a.Scale(this._getTimeScale(n));if(u>=0){var d=u>=1e3?1:0;o.push(m()(u,{scale:h,decimals:d}))}if(l>=0){d=l>=1e3?1:0;o.push(m()(parseFloat(l.toString()),{decimals:d})+" Requests")}if(c>=0){d=c>=1e3?1:0;o.push(m()(c,{decimals:d})+" Errors")}if(o.length>0){var p=o.join(", ");this._drawLabel(e,p,i,a)}},e.prototype._drawEdgeParticles=function(e,t,n,r,i){var a=t.data("particles");if(void 0!==a){var o=r.x-n.x,s=r.y-n.y,u=Math.atan2(s,o),l={ctx:e,now:i,xDirection:Math.cos(u),yDirection:Math.sin(u),xMinLimit:Math.min(n.x,r.x),xMaxLimit:Math.max(n.x,r.x),yMinLimit:Math.min(n.y,r.y),yMaxLimit:Math.max(n.y,r.y),sourcePoint:n};e.beginPath();for(var c=a.normal.length-1;c>=0;)this._drawParticle(l,a.normal,c),c--;for(e.fillStyle="#d1e2f2",e.fill(),e.beginPath(),c=a.danger.length-1;c>=0;)this._drawParticle(l,a.danger,c),c--;var h=this.controller.getSettings(!0).style.imCriticalColor;e.fillStyle=h,e.fill()}},e.prototype._drawLabel=function(e,t,n,r){e.font="8px Arial";var i=e.measureText(t).width,a=n-i/2,o=r+3;e.fillStyle=this.colors.default,e.globalAlpha=0,e.fillRect(a-1,o-6-1,i+2,8),e.globalAlpha=1,e.fillStyle=this.colors.defaultText,e.fillText(t,a,o)},e.prototype._drawParticle=function(e,t,n){var r=e.ctx,i=e.now,a=e.xDirection,o=e.yDirection,s=e.xMinLimit,u=e.xMaxLimit,l=e.yMinLimit,c=e.yMaxLimit,h=e.sourcePoint,d=t[n],p=i-d.startTime,f=h.x+a*p*d.velocity,g=h.y+o*p*d.velocity;f>u||f<s||g>c||g<l?t.splice(n,1):(r.moveTo(f,g),r.arc(f,g,1,0,2*Math.PI,!1))},e.prototype._drawNodes=function(e){for(var t=this.cytoscape,n=t.nodes().toArray(),r=0;r<n.length;r++){var i=n[r];this.selectionNeighborhood.empty()||this.selectionNeighborhood.has(i)?e.globalAlpha=1:e.globalAlpha=.25,this._drawNode(e,i),t.zoom()>=.4&&this._drawNodeLabel(e,i)}},e.prototype._drawNode=function(e,t){var n=this.cytoscape,r=t.data("type"),i=t.data("metrics"),a=g.a.defaultTo(i.rate,-1),o=g.a.defaultTo(i.error_rate,0),s=g.a.defaultTo(i.response_time,-1),u=g.a.defaultTo(i.threshold,-1),l=0,c=0,d=0,p=0,f=0,v=0;if(!1===this.controller.getSettings(!0).style.appearanceSwitch)o>0?l=1:c=1;else switch(a){case 5:c=1;break;case 4:d=1;break;case 3:p=1;break;case 2:f=1;break;case 1:v=1;break;default:c=1}if(this._drawDonut(e,t,25,5,.5,[l,c,d,p,f,v]),this.controller.getSettings(!0).showBaselines&&s>=0&&u>=0){var y=u<s;this._drawThresholdStroke(e,t,y,15,5,.5)}r===h.INTERNAL?this._drawServiceIcon(e,t):this._drawExternalService(e,t),n.zoom()>1&&this._drawNodeStatistics(e,t)},e.prototype._drawServiceIcon=function(e,t){var n=t.data("className"),r=this.controller.getSettings(!0).icons,i=g.a.find(r,(function(e){var t=e.pattern;try{return new RegExp(t).test(n)}catch(e){return!1}}));if(i){var a=this._getAsset(i.filename,i.filename+".png");if(null!=a){var o=t.position().x,s=t.position().y;e.drawImage(a,o-15,s-15,30,30)}}},e.prototype._drawNodeStatistics=function(e,t){var n=[],r=t.data("metrics"),i=g.a.defaultTo(r.rate,-1),a=g.a.defaultTo(r.error_rate,-1);if(i>=0&&n.push("Impact Severity: "+x(i)),a>=0){var o=a>=1e3?1:0;n.push("Active Alerts: "+m()(a,{decimals:o}))}var s=t.position(),u=s.x+1.25*this.donutRadius,l=s.y+4-4*(n.length-1);e.font="8px Arial",e.fillStyle=this.colors.defaultText;for(var c=0;c<n.length;c++)e.fillText(n[c],u+10,l+8*c)},e.prototype._drawThresholdStroke=function(e,t,n,r,i,a){var o=t.position(),s=o.x,u=o.y,l=2*a*(n?1.5:1),c=.2*l;e.beginPath(),e.arc(s,u,r+l-c,0,2*Math.PI,!1),e.closePath(),e.setLineDash([]),e.lineWidth=1*l,e.strokeStyle="white",e.stroke(),e.beginPath(),e.arc(s,u,r+l-c,0,2*Math.PI,!1),e.closePath(),e.setLineDash([10,2]),n&&this.controller.getSettings(!0).animate?e.lineDashOffset=this.dashAnimationOffset:e.lineDashOffset=0,e.lineWidth=l,e.strokeStyle=n?"rgb(184, 36, 36)":"#37872d",e.stroke(),e.beginPath(),e.arc(s,u,r-i-a,0,2*Math.PI,!1),e.closePath(),e.fillStyle=n?"rgb(184, 36, 36)":"#37872d",e.fill()},e.prototype._drawExternalService=function(e,t){var n=t.data("classType"),r=this.controller.getSettings(!0).externalIcons,i=g.a.find(r,(function(e){var t=e.pattern;try{return new RegExp(t).test(n)}catch(e){return!1}}));if(i){var a=this._getAsset(i.filename,i.filename+".png");if(null!=a){var o=t.position().x,s=t.position().y;e.drawImage(a,o-15,s-15,30,30)}}},e.prototype._drawNodeLabel=function(e,t){var n=t.position(),r=t.id(),i=r.split("||");r=i[0],e.font="8px Arial";var a=e.measureText(r).width,o=n.x-a/2,s=n.y+.8*t.height(),u=this.controller.getSettings(!0).showBaselines,l=t.data("metrics"),c=g.a.defaultTo(l.response_time,-1),h=g.a.defaultTo(l.threshold,-1);e.fillStyle=!u||h<0||c<0||c<=h?this.colors.default:"#FF7383",e.fillStyle=this.colors.defaultText,e.fillText(r,o,s+12)},e.prototype._drawDebugInformation=function(){var e=this.context;this.frameCounter++,e.font="12px monospace",e.fillStyle="white",e.fillText("Frames per Second: "+this.fpsCounter,10,12),e.fillText("Particles: "+this.particleEngine.count(),10,24)},e.prototype._drawDonut=function(e,t,n,r,i,a){var o=t.position().x,s=t.position().y,u=-Math.PI/2;e.beginPath(),e.arc(o,s,n+i,0,2*Math.PI,!1),e.closePath(),e.fillStyle="white",e.fill();for(var l=this.controller.getSettings(!0).style,c=[l.alertColor,l.imOkColor,l.imWarningColor,l.imMinorColor,l.imMajorColor,l.imCriticalColor],h=0;h<a.length;h++){u+=this._drawArc(e,u,o,s,n,a[h],c[h])}e.beginPath(),e.arc(o,s,n-r,0,2*Math.PI,!1),e.fillStyle="white",e.fill(),e.beginPath(),e.arc(o,s,n-r-i,0,2*Math.PI,!1),t.selected()?e.fillStyle="white":e.fillStyle=this.colors.background,e.fill()},e.prototype._drawArc=function(e,t,n,r,i,a,o){var s=360*a*Math.PI/180;return e.save(),e.beginPath(),e.moveTo(n,r),e.arc(n,r,i,t,t+s,!1),e.closePath(),e.fillStyle=o,e.fill(),e.restore(),s},e}(),C=n(13),S=n.n(C),_=n(30),k=n.n(_),A=n(31),T=n.n(A),P={name:"cola",animate:!0,refresh:1,maxSimulationTime:3e3,ungrabifyWhileSimulating:!1,fit:!0,padding:90,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,ready:function(){},stop:function(){},randomize:!1,avoidOverlap:!0,handleDisconnected:!0,convergenceThreshold:.01,nodeSpacing:function(e){return 40},flow:void 0,alignment:void 0,gapInequalities:void 0,edgeLength:void 0,edgeSymDiffLength:void 0,edgeJaccardLength:void 0,unconstrIter:50,userConstIter:void 0,allConstIter:void 0,infinite:!1},M=n(3),D=n.n(M),I=n(19),O={insert:"head",singleton:!1},B=(D()(I.a,O),I.a.locals,n(20)),N={insert:"head",singleton:!1},L=(D()(B.a,N),B.a.locals,function(e){var t=e.show,n=e.selectionId,r=e.resolvedDrillDownLink,i=(e.selectionStatistics,e.currentType,e.showBaselines,e.receiving,e.sending,e.summary),a="statistics",o=p.a.createElement("div",null);if(t){a="statistics show";var s=p.a.createElement("div",null);r&&r.length>0&&(s=p.a.createElement("a",{target:"_blank",rel:"noreferrer",href:r},p.a.createElement("i",{className:"fa fa-paper-plane-o margin"})));var u=i?i.map((function(e,t){return p.a.createElement("tr",{key:t},p.a.createElement("td",{className:"table--td--selection table--td table--td--key"},e.name),p.a.createElement("td",{className:"table--td--selection table--td"},e.value))})):null;o=p.a.createElement("div",{className:"statistics"},p.a.createElement("div",{className:"header--selection"},n),p.a.createElement("div",{className:"secondHeader--selection"},s),p.a.createElement("table",{className:"table--selection"},p.a.createElement("tr",{className:"table--selection--head"},p.a.createElement("th",{className:"table--th table--th--selectionMedium"},"CI Attribute"),p.a.createElement("th",{className:"table--th"},"Value")),u))}return p.a.createElement("div",{className:a},o)}),R=n(7),j=n(6),z=n(21),V={insert:"head",singleton:!1};D()(z.a,V),z.a.locals;k()(S.a),S.a.use(T.a);var F=function(e){function t(t){var n=e.call(this,t)||this;n.initResize=!0;var r="navbar-button-fa fa fa-play-circle";return t.animate&&(r="navbar-button-fa fa fa-pause-circle"),n.state=o(o({},t),{showStatistics:!1,animateButtonClass:r,animate:!1}),n.ref=p.a.createRef(),n.templateSrv=Object(R.getTemplateSrv)(),n.datasourceSrv=Object(R.getDataSourceSrv)(),n}return a(t,e),t.prototype.componentDidMount=function(){var e=this,t=S()({container:this.ref,zoom:this.state.zoom,elements:this.props.data,style:[{selector:"node",style:{"background-opacity":0}},{selector:"edge",style:{visibility:"hidden"}}],wheelSensitivity:.125}),n=new E(this,t,t.cyCanvas({zIndex:1}));t.on("render cyCanvas.resize",(function(){n.repaint(!0)})),t.on("select","node",(function(){return e.onSelectionChange()})),t.on("unselect","node",(function(){return e.onSelectionChange()})),t.on("layoutstop",(function(){e.zoom(1.5),e.toggleAnimation()})),this.setState((function(e){return o(o({},e),{cy:t,graphCanvas:n})})),n.start()},t.prototype.componentDidUpdate=function(){this._updateGraph(this.props.data)},t.prototype._updateGraph=function(e){var t=this._transformNodes(e.nodes),n=this._transformEdges(e.edges),r=this.state.cy.nodes().toArray(),i=this._updateOrRemove(r,t);this.state.cy.add(t);var a=this.state.cy.edges().toArray();this._updateOrRemove(a,n),this.state.cy.add(n),this.initResize?(this.initResize=!1,this.state.cy.resize(),this.state.cy.reset(),this.runLayout()):t.length>0&&(g.a.each(i,(function(e){e.lock()})),this.runLayout(!0)),this.state.graphCanvas.repaint(!0)},t.prototype._transformNodes=function(e){return g.a.map(e,(function(e){return{group:"nodes",data:{id:e.data.id,type:e.data.type,external_type:e.data.external_type,metrics:o({},e.data.metrics)}}}))},t.prototype._transformEdges=function(e){return g.a.map(e,(function(e){return{group:"edges",data:{id:e.data.source+":"+e.data.target,source:e.data.source,target:e.data.target,metrics:o({},e.data.metrics)}}}))},t.prototype._updateOrRemove=function(e,t){for(var n=[],r=function(r){var i=e[r],a=g.a.find(t,{data:{id:i.id()}});a?(i.data(a.data),g.a.remove(t,(function(e){return e.data.id===a.data.id})),n.push(i)):i.remove()},i=0;i<e.length;i++)r(i);return n},t.prototype.onSelectionChange=function(){return s(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return 1!==this.state.cy.$(":selected").length?[3,2]:[4,this.updateStatisticTable()];case 1:return e.sent(),this.setState({showStatistics:!0}),[3,3];case 2:this.setState({showStatistics:!1}),e.label=3;case 3:return[2]}}))}))},t.prototype.getSettings=function(e){return this.state.controller.getSettings(e)},t.prototype.toggleAnimation=function(){var e=!this.state.animate,t="navbar-button-fa fa fa-play-circle";e?(this.state.graphCanvas.startAnimation(),t="navbar-button-fa fa fa-pause-circle"):this.state.graphCanvas.stopAnimation(),this.setState({animate:e,animateButtonClass:t})},t.prototype.runLayout=function(e){void 0===e&&(e=!1);var t=this,n=o(o({},P),{stop:function(){e&&t.unlockNodes(),t.setState({zoom:t.state.cy.zoom()})}});this.state.cy.layout(n).run()},t.prototype.unlockNodes=function(){this.state.cy.nodes().forEach((function(e){e.unlock()}))},t.prototype.fit=function(){var e=this.state.graphCanvas.selectionNeighborhood;e&&!e.empty()?this.state.cy.fit(e,30):this.state.cy.fit(),this.setState({zoom:this.state.cy.zoom()})},t.prototype.zoom=function(e){var t=.25*e,n=Math.max(.1,this.state.zoom+t);this.setState({zoom:n}),this.state.cy.zoom(n),this.state.cy.center()},t.prototype.updateStatisticTable=function(){return s(this,void 0,void 0,(function(){var e,t,n,r,i,a,o,s,l,c;return u(this,(function(u){switch(u.label){case 0:return 1!==(e=this.state.cy.$(":selected")).length?[3,5]:(this.selectionStatistics={},t=e[0],this.selectionId=t.id().toString(),n=this.selectionId.split("||"),this.selectionId=n[0],r=[],i=t.data("className").toString(),a=i.split("||"),i=a[0],o=t.data("metrics"),s=g.a.defaultTo(o.rate,-1),l=g.a.defaultTo(o.error_rate,0),void 0===t.data("className")?[3,1]:(r.push({name:"Class",value:i}),r.push({name:"Impact Severity",value:x(s)}),r.push({name:"# of Alerts",value:l.toString()}),[3,4]));case 1:return[4,this.datasourceSrv.get(this.state.settings.datasourceName)];case 2:return[4,u.sent().snowConnection.getTopologyCISummary(this.selectionId)];case 3:c=u.sent(),r.push({name:"Class",value:c.classType}),r.push({name:"Environment",value:c.environment}),r.push({name:"Support Group",value:c.support_group}),r.push({name:"In Maintinance",value:c.maintenance_schedule}),u.label=4;case 4:this.summary=r,this.generateDrillDownLink(a[1],n[1]),u.label=5;case 5:return[2]}}))}))},t.prototype.generateDrillDownLink=function(e,t){var n=this.getSettings(!1).drillDownLink;if(void 0!==n){var r=n.replace("{node}",t);r=r.replace("{nodeClass}",e),this.resolvedDrillDownLink=this.templateSrv.replace(r)}},t.prototype.filterNodes=function(e,t){for(var n=this.state.cy.elements(),r=0;r<n.length;r++){var i=n[r],a=i._private.data;e?5===t?5!==a.metrics.rate&&0!==a.metrics.rate||i.remove():a.metrics.rate===t&&i.remove():a.metrics.error_rate>0&&i.remove()}},t.prototype.render=function(){var e=this;return void 0!==this.state.cy&&this._updateGraph(this.props.data),p.a.createElement("div",{className:"graph-container"},p.a.createElement("div",{className:"service-dependency-graph"},p.a.createElement("div",{className:"canvas-container",ref:function(t){return e.ref=t}}),p.a.createElement("div",{className:"zoom-button-container"},p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.toggleAnimation()}},p.a.createElement("i",{className:this.state.animateButtonClass})),p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.componentDidMount()}},p.a.createElement("i",{className:"navbar-button-fa fa fa-refresh"})),p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.runLayout()}},p.a.createElement("i",{className:"navbar-button-fa fa fa-sitemap"})),p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.fit()}},p.a.createElement("i",{className:"navbar-button-fa fa fa-dot-circle-o"})),p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.zoom(1)}},p.a.createElement("i",{className:"navbar-button-fa fa fa-plus"})),p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.zoom(-1)}},p.a.createElement("i",{className:"navbar-button-fa fa fa-minus"})),p.a.createElement(j.CollapsableSection,{label:"",isOpen:!1},this.state.controller.getSettings(!0).style.appearanceSwitch?p.a.createElement(p.a.Fragment,null,p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.filterNodes(!0,5)}},p.a.createElement("i",{className:"navbar-button-fa fa fa-filter",style:{color:this.state.controller.getSettings(!0).style.imOkColor}})),p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.filterNodes(!0,4)}},p.a.createElement("i",{className:"navbar-button-fa fa fa-filter",style:{color:this.state.controller.getSettings(!0).style.imWarningColor}})),p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.filterNodes(!0,3)}},p.a.createElement("i",{className:"navbar-button-fa fa fa-filter",style:{color:this.state.controller.getSettings(!0).style.imMinorColor}})),p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.filterNodes(!0,2)}},p.a.createElement("i",{className:"navbar-button-fa fa fa-filter",style:{color:this.state.controller.getSettings(!0).style.imMajorColor}})),p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.filterNodes(!0,1)}},p.a.createElement("i",{className:"navbar-button-fa fa fa-filter",style:{color:this.state.controller.getSettings(!0).style.imCriticalColor}}))):p.a.createElement("button",{className:"btn navbar-button width-100",onClick:function(){return e.filterNodes(!1,0)}},p.a.createElement("i",{className:"navbar-button-fa fa fa-filter",style:{color:this.state.controller.getSettings(!0).style.alertColor}}))))),p.a.createElement(L,{show:this.state.showStatistics,selectionId:this.selectionId,resolvedDrillDownLink:this.resolvedDrillDownLink,selectionStatistics:this.selectionStatistics,currentType:this.currentType,showBaselines:this.getSettings(!0).showBaselines,receiving:this.receiving,sending:this.sending,summary:this.summary}))},t}(d.PureComponent);function q(e){return null!=e}var X=function(){function e(e){this.controller=e}return e.prototype._createNode=function(e){if(e&&!(e.length<=0)){var t=this.controller.getSettings(!0).sumTimings,n=e[0].target;""!==n&&null!=n||(n="undefined");var r=e[0].data.className,i=e[0].data.rate_in,a=g.a.some(e,["type",c.INTERNAL])||g.a.some(e,["type",c.EXTERNAL_IN]),o=a?h.INTERNAL:h.EXTERNAL,s={},u={data:{id:n,label:n,external_type:o,type:o,metrics:s,className:r,rate_in:i}},l=t?g.a.sum:g.a.mean;if(a){s.rate=g.a.sum(g.a.map(e,(function(e){return e.data.rate_in}))),s.error_rate=g.a.sum(g.a.map(e,(function(e){return e.data.error_rate_in}))),(d=g.a.map(e,(function(e){return e.data.response_time_in})).filter(q)).length>0&&(s.response_time=l(d))}else{var d;s.rate=g.a.sum(g.a.map(e,(function(e){return e.data.rate_out}))),s.error_rate=g.a.sum(g.a.map(e,(function(e){return e.data.error_rate_out}))),(d=g.a.map(e,(function(e){return e.data.response_time_out})).filter(q)).length>0&&(s.response_time=l(d));var p=g()(e).map((function(e){return e.data.type})).uniq().value();1===p.length&&(u.data.external_type=p[0])}if(s.threshold=g()(e).map((function(e){return e.data.threshold})).filter().mean(),t){var f=g.a.defaultTo(s.rate,0)+g.a.defaultTo(s.error_rate,0),v=g.a.defaultTo(s.response_time,-1);f>0&&v>=0&&(s.response_time=v/f)}var y=s.rate,m=s.error_rate;return s.success_rate=y+m>0?1/(y+m)*y:1,u}},e.prototype._createMissingNodes=function(e,t){var n=g.a.map(t,(function(e){return e.data.id})),r=g.a.uniq(g.a.flatMap(e,(function(e){return[e.source,e.target]}))).filter(q),i=g.a.difference(r,n);return g.a.map(i,(function(t){var n,r,i=g.a.find(e,{source:t}),a=g.a.find(e,{target:t});return i&&i.type===c.EXTERNAL_IN?(n=h.EXTERNAL,r=i.data.type):a&&a.type===c.EXTERNAL_OUT?(n=h.EXTERNAL,r=a.data.type):n=h.INTERNAL,{data:{id:t,type:n,external_type:r,metrics:{}}}}))},e.prototype._createNodes=function(e){var t=this,n=g.a.filter(e,(function(e){return e.source!==e.target||g.a.has(e,"target")&&!g.a.has(e,"target")||!g.a.has(e,"target")&&g.a.has(e,"target")})),r=g.a.groupBy(n,"target"),i=g.a.map(r,(function(e){return t._createNode(e)})).filter(q),a=this._createMissingNodes(n,i);return g.a.concat(i,a)},e.prototype._createEdge=function(e){var t=e.source,n=e.target;if(void 0!==t&&void 0!==n){var r={},i={source:t,target:n,data:{source:t,target:n,metrics:r}},a=e.data,o=a.rate_out,s=a.rate_in,u=a.error_rate_out,l=a.response_time_out;if(g.a.isUndefined(o)?g.a.isUndefined(s)||(r.rate=s):r.rate=o,g.a.isUndefined(u)||(r.error_rate=u),!g.a.isUndefined(l))this.controller.getSettings(!0).sumTimings&&r.rate?r.response_time=l/r.rate:r.response_time=l;return i}},e.prototype._createEdges=function(e){var t=this,n=g()(e).filter((function(e){return!!e.source})).filter((function(e){return e.source!==e.target})).filter((function(e){return null!==e.target||null!==e.source})).value();return g.a.map(n,(function(e){return t._createEdge(e)})).filter(q)},e.prototype._filterData=function(e){if(this.controller.getSettings(!0).filterEmptyConnections){var t={nodes:[],edges:[]};return t.edges=g.a.filter(e.edges,(function(e){return g.a.size(e.data.metrics)>0})),t.nodes=g.a.filter(e.nodes,(function(t){var n=t.data.id;if(g.a.some(e.edges,{source:n})||g.a.some(e.edges,{target:n}))return!0;var r=t.data.metrics;return!!r&&(g.a.defaultTo(r.rate,-1)>=0||g.a.defaultTo(r.error_rate,-1)>=0||g.a.defaultTo(r.response_time,-1)>=0)})),t}return e},e.prototype.generateGraph=function(e){var t={nodes:this._createNodes(e),edges:this._createEdges(e)};return this._filterData(t)},e}(),Y=function(){function e(e){this.controller=e}return e.prototype._transformObjects=function(e){var t=this.controller.getSettings(!0).dataMapping,n=t.aggregationType,r=t.sourceColumn,i=t.targetColumn,a=t.extOrigin,o=t.extTarget;return g.a.map(e,(function(e){var t=g.a.has(e,r)&&""!==e[r],s=g.a.has(e,i)&&""!==e[i],u=g.a.has(e,a)&&""!==e[a],l=g.a.has(e,o)&&""!==e[o],h=[t,s,u,l].filter((function(e){return e})).length;if(h>1)if(s&&l)s=!1;else{if(!t||!u)return;t=!1}var d={target:"",data:e,type:c.INTERNAL};return 0===h?(d.target=e[n],d.type=c.EXTERNAL_IN):t||s?(t?(d.source=e[r],d.target=e[n]):(d.source=e[n],d.target=e[i]),d.source===d.target&&(d.type=c.SELF)):u?(d.source=e[a],d.target=e[n],d.type=c.EXTERNAL_IN):l&&(d.source=e[n],d.target=e[o],d.type=c.EXTERNAL_OUT),d})).filter((function(e){return null!==e}))},e.prototype._mergeGraphData=function(e){var t=g.a.values(g.a.groupBy(e,(function(e){return e.source+"<---\x3e"+e.target})));return g.a.map(t,(function(e){return g.a.reduce(e,(function(e,t){return g.a.merge(e,t)}))}))},e.prototype._cleanMetaData=function(e,t){var n={};return g.a.forOwn(e,(function(e,r){g.a.has(t,e)&&(n[r]=t[e])})),n},e.prototype._extractColumnNames=function(e){return g()(e).flatMap((function(e){return g.a.keys(e.data)})).uniq().sort().value()},e.prototype._getField=function(e,t){var n,r;try{for(var i=l(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(o.name===e)return o}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype._mergeSeries=function(e){var t,n,r,i,a=void 0;try{for(var o=l(e),s=o.next();!s.done;s=o.next()){var u=s.value;if(void 0===a)a=u;else try{for(var c=(r=void 0,l(u.fields)),h=c.next();!h.done;h=c.next()){var d=h.value,p=this._getField(d.name,a.fields);void 0===p?a.fields.push(d):p.values=g.a.concat(d.values,p.values)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype._dataToRows=function(e){var t,n,r=[],i=this.controller.getSettings(!0).dataMapping,a=i.aggregationType,o=i.sourceColumn,s=i.targetColumn,u=i.extOrigin,c=i.extTarget,h=i.type,d=i.errorRateColumn,p=i.errorRateOutgoingColumn,f=i.responseTimeColumn,v=i.responseTimeOutgoingColumn,y=i.requestRateColumn,m=i.requestRateOutgoingColumn,b=i.baselineRtUpper,x=i.classColumn;try{for(var w=l(e),E=w.next();!E.done;E=w.next())for(var C=E.value,S=C.fields,_=g.a.find(S,["name",u]),k=g.a.find(S,["name",c]),A=g.a.find(S,["name",a]),T=g.a.find(S,["name",h]),P=g.a.find(S,["name",x]),M=g.a.find(S,["name",o]),D=g.a.find(S,["name",s]),I=g.a.find(S,["name",d]),O=g.a.find(S,["name",p]),B=g.a.find(S,["name",f]),N=g.a.find(S,["name",v]),L=g.a.find(S,["name",y]),R=g.a.find(S,["name",m]),j=g.a.find(S,["name",b]),z=function(e){var t={};t[u]=null==_?void 0:_.values.get(e),t[c]=null==k?void 0:k.values.get(e),t[a]=null==A?void 0:A.values.get(e),t[o]=null==M?void 0:M.values.get(e),t[s]=null==D?void 0:D.values.get(e),t.error_rate_in=null==I?void 0:I.values.get(e),t.error_rate_out=null==O?void 0:O.values.get(e),t.response_time_in=null==B?void 0:B.values.get(e),t.response_time_out=null==N?void 0:N.values.get(e),t.rate_in=null==L?void 0:L.values.get(e),t.rate_out=null==R?void 0:R.values.get(e),t.threshold=null==j?void 0:j.values.get(e),t.type=null==T?void 0:T.values.get(e),t.className=null==P?void 0:P.values.get(e),Object.keys(t).forEach((function(e){return(void 0===t[e]||""===t[e])&&delete t[e]})),r.push(t)},V=0;V<C.length;V++)z(V)}catch(e){t={error:e}}finally{try{E&&!E.done&&(n=w.return)&&n.call(w)}finally{if(t)throw t.error}}return r},e.prototype._resolveData=function(e){var t=g.a.has(e,"sourceColumn")&&""!==e.sourceColumn,n=g.a.has(e,"targetColumn")&&""!==e.targetColumn,r=g.a.has(e,"extOrigin")&&""!==e.extOrigin,i=g.a.has(e,"extTarget")&&""!==e.extTarget,a=[t,n,r,i].filter((function(e){return e})).length;if(a>1)if(n&&i)n=!1;else{if(!t||!r)return;t=!1}var o={data:e.data};return 0===a?(o.target=e.aggregationSuffix,o.type=c.EXTERNAL_IN):t||n?(t?(o.source=e.sourceColumn,o.target=e.aggregationSuffix,o.type=c.INTERNAL):(o.source=e.aggregationSuffix,o.target=e.targetColumn,o.type=c.INTERNAL),o.source===o.target&&(o.type=c.SELF)):r?(o.source=e.externalSource,o.target=e.aggregationSuffix,o.type=c.EXTERNAL_IN):i&&(o.source=e.aggregationSuffix,o.target=e.externalTarget,o.type=c.EXTERNAL_OUT),o},e.prototype._mergeObjects=function(e){var t,n,r=[];try{for(var i=l(e),a=i.next();!a.done;a=i.next()){var o=a.value;r.push(o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.processData=function(e){var t=this._dataToRows(e),n=this._mergeObjects(t),r=this._transformObjects(n),i=this._extractColumnNames(r);return{graph:this._mergeGraphData(r),raw:e,columnNames:i}},e}(),W=[{refId:"A",name:void 0,meta:void 0,fields:[{name:"time",type:r.FieldType.time,config:{},values:new r.ArrayVector([0,0,0,0,0,0,0,0,0,0,0,0,0])},{name:"origin_external",type:r.FieldType.string,config:{},values:new r.ArrayVector(["","","","","","","","","","","","tcp://localhost:61616","tcp://10.10.10.10:61616"])},{name:"origin_service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["","","","api-gateway","api-gateway","api-gateway","api-gateway","api-gateway","customers-service","vets-service","visits-service","vets-service",""])},{name:"protocol",type:r.FieldType.string,config:{},values:new r.ArrayVector(["http","http","http","http","http","http","http","http","http","http","http","jms","jms"])},{name:"service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["api-gateway","config-server","discovery-server","api-gateway","customers-service","discovery-server","vets-service","visits-service","discovery-server","discovery-server","discovery-server","visits-service","api-gateway"])},{name:"in_count",type:r.FieldType.number,config:{},values:new r.ArrayVector([508,0,0,100,347,20,63,100,20,20,20,300,300])}],length:13},{refId:"B",name:void 0,meta:void 0,fields:[{name:"time",type:r.FieldType.time,config:{},values:new r.ArrayVector([0,0,0,0,0,0,0,0,0,0,0,0,0,0])},{name:"protocol",type:r.FieldType.string,config:{},values:new r.ArrayVector(["http","http","http","http","http","http","http","http","http","jms","http","jdbc","jdbc","jdbc"])},{name:"service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["api-gateway","api-gateway","api-gateway","api-gateway","api-gateway","api-gateway","config-server","customers-service","vets-service","vets-service","visits-service","customers-service","vets-service","visits-service"])},{name:"target_external",type:r.FieldType.string,config:{},values:new r.ArrayVector(["","","","","","7a8dce897616:8080","github.com","","","tcp://localhost:61616","","jdbc:hsqldb:mem:testdb","jdbc:hsqldb:mem:testdb","jdbc:hsqldb:mem:testdb"])},{name:"target_service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["api-gateway","customers-service","discovery-server","vets-service","visits-service","","","discovery-server","discovery-server","visits-service","discovery-server","","",""])},{name:"out_count",type:r.FieldType.number,config:{},values:new r.ArrayVector([100,347,20,62,100,0,0,20,20,300,20,1847,441,100])}],length:14},{refId:"C",name:void 0,meta:void 0,fields:[{name:"time",type:r.FieldType.time,config:{},values:new r.ArrayVector([0,0,0,0,0,0,0,0,0,0,0])},{name:"origin_service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["","","","api-gateway","api-gateway","api-gateway","api-gateway","api-gateway","customers-service","vets-service","visits-service"])},{name:"protocol",type:r.FieldType.string,config:{},values:new r.ArrayVector(["http","http","http","http","http","http","http","http","http","http","http"])},{name:"service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["api-gateway","config-server","discovery-server","api-gateway","customers-service","discovery-server","vets-service","visits-service","discovery-server","discovery-server","discovery-server"])},{name:"target_external",type:r.FieldType.string,config:{},values:new r.ArrayVector(["","","","","","","","","","",""])},{name:"in_timesum",type:r.FieldType.number,config:{},values:new r.ArrayVector([45140.00842799999,0,0,1511.9842349999872,819.3634589999965,21.881731999999943,281.0465210000002,325.85070300000007,21.53124399999996,21.40604300000001,20.813048000000038])}],length:11},{refId:"D",name:void 0,meta:void 0,fields:[{name:"time",type:r.FieldType.time,config:{},values:new r.ArrayVector([0,0,0,0,0,0,0,0,0,0,0,0,0])},{name:"protocol",type:r.FieldType.string,config:{},values:new r.ArrayVector(["http","http","http","http","http","http","http","http","http","http","jdbc","jdbc","jdbc"])},{name:"service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["api-gateway","api-gateway","api-gateway","api-gateway","api-gateway","api-gateway","config-server","customers-service","vets-service","visits-service","customers-service","vets-service","visits-service"])},{name:"target_external",type:r.FieldType.string,config:{},values:new r.ArrayVector(["","","","","","7a8dce897616:8080","github.com","","","","jdbc:hsqldb:mem:testdb","jdbc:hsqldb:mem:testdb","jdbc:hsqldb:mem:testdb"])},{name:"target_service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["api-gateway","customers-service","discovery-server","vets-service","visits-service","","","discovery-server","discovery-server","discovery-server","","",""])},{name:"out_timesum",type:r.FieldType.number,config:{},values:new r.ArrayVector([1700.468872999987,1481.533606999972,540.746261,501.65547400000014,394.81158100000175,0,0,84.59527999999978,381.87400800000023,225.65933600000017,35.9093940000007,13.000189000000091,12.258137999999946])}],length:13},{refId:"E",name:void 0,meta:void 0,fields:[{name:"time",type:r.FieldType.time,config:{},values:new r.ArrayVector([0,0,0,0])},{name:"origin_service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["","","",""])},{name:"protocol",type:r.FieldType.string,config:{},values:new r.ArrayVector(["http","http","http","http"])},{name:"service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["api-gateway","discovery-server","customers-service","vets-service"])},{name:"target_external",type:r.FieldType.string,config:{},values:new r.ArrayVector(["","","",""])},{name:"error_in",type:r.FieldType.number,config:{},values:new r.ArrayVector([14,20,20,0])}],length:4},{refId:"F",name:void 0,meta:void 0,fields:[{name:"time",type:r.FieldType.time,config:{},values:new r.ArrayVector([0,0,0,0])},{name:"origin_service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["api-gateway","api-gateway","api-gateway","customers-service"])},{name:"protocol",type:r.FieldType.string,config:{},values:new r.ArrayVector(["http","http","http","http"])},{name:"service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["customers-service","vets-service","visits-service","discovery-server"])},{name:"target_external",type:r.FieldType.string,config:{},values:new r.ArrayVector(["","","",""])},{name:"error_out",type:r.FieldType.number,config:{},values:new r.ArrayVector([14,0,0,20])}],length:4},{refId:"G",name:void 0,meta:void 0,fields:[{name:"time",type:r.FieldType.time,config:{},values:new r.ArrayVector([0,0])},{name:"service",type:r.FieldType.string,config:{},values:new r.ArrayVector(["api-gateway","customers-service"])},{name:"threshold",type:r.FieldType.number,config:{},values:new r.ArrayVector([40.40604300000001,10])}],length:2}],H=function(e){function t(t){var n=e.call(this,t)||this;return n.state=o({},t),n.ref=p.a.createRef(),n.graphGenerator=new X(n),n.preProcessor=new Y(n),n}return a(t,e),t.prototype.getSettings=function(e){return e?this.resolveVariables(this.props.options):this.props.options},t.prototype.resolveVariables=function(e){var t,n;if(e instanceof Object){var r={};try{for(var i=l(Object.keys(e)),a=i.next();!a.done;a=i.next()){var o=a.value;r[o]=this.resolveVariables(e[o])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}return e instanceof String||"string"==typeof e?Object(R.getTemplateSrv)().replace(e.toString()):e},t.prototype.resolveTemplateVars=function(e,t){var n,r,i=e;if(t&&(i=g.a.cloneDeep(i)),("string"==typeof i||i instanceof String)&&(i=Object(R.getTemplateSrv)().replace(i.toString())),i instanceof Object)try{for(var a=l(Object.keys(i)),o=a.next();!o.done;o=a.next()){var s=o.value;i[s]=this.resolveTemplateVars(i[s],!1)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.prototype.componentDidUpdate=function(){this.processData()},t.prototype.processQueryData=function(e){this.validQueryTypes=this.hasOnlyTableQueries(e);var t=this.preProcessor.processData(e);this.currentData=t},t.prototype.hasOnlyTableQueries=function(e){var t=!0;return g.a.each(e,(function(e){g.a.has(e,"columns")||(t=!1)})),t},t.prototype.processData=function(){var e=this.props.data.series;return this.getSettings(!0).dataMapping.showDummyData&&(e=W),this.processQueryData(e),this.graphGenerator.generateGraph(this.currentData.graph)},t.prototype._transformEdges=function(e){return g.a.map(e,(function(e){return{group:"edges",data:{id:e.source+":"+e.target,source:e.source,target:e.target,metrics:o({},e.metrics)}}}))},t.prototype._transformNodes=function(e){return g.a.map(e,(function(e){return{group:"nodes",data:{id:e.data.id,type:e.data.type,external_type:e.data.external_type,metrics:o({},e.data.metrics)}}}))},t.prototype._updateOrRemove=function(e,t){for(var n=[],r=function(r){var i=e[r],a=g.a.find(t,{data:{id:i.id()}});a?(i.data(a.data),g.a.remove(t,(function(e){return e.data.id===a.data.id})),n.push(i)):i.remove()},i=0;i<e.length;i++)r(i);return n},t.prototype.getError=function(){return this.isDataAvailable()?null:"No data to show - the query returned no data."},t.prototype.isDataAvailable=function(){return!g.a.isUndefined(this.currentData)&&!g.a.isUndefined(this.currentData.graph)&&this.currentData.graph.length>0},t.prototype.render=function(){var e=this.processData(),t=this.getError();return null===t?p.a.createElement("div",null,p.a.createElement("div",{className:"service-dependency-graph-panel",style:{height:this.props.height,width:this.props.width},ref:this.ref,id:"cy"},p.a.createElement(F,{data:e,zoom:2,controller:this,animate:!1,showStatistics:!1,settings:this.props.options}))):p.a.createElement("div",null,t)},t}(d.PureComponent),G=n(32),U=n.n(G),K=n(22),Z={insert:"head",singleton:!1},$=(D()(K.a,Z),K.a.locals,function(e){function t(t){var n=e.call(this,t)||this;n.onChange=function(e,t){var r=t.newValue,i=n.props.item.path,a=e.currentTarget.value;n.setState({value:a}),n.props.onChange.call(i,r)},n.getSuggestions=function(e){var t="";return void 0!==e?[]:(null!=e&&""!==e&&(t=e.trim().toLowerCase()),0===t.length||void 0===t?[]:n.getColumnNames().filter((function(e){return e.toLowerCase().startsWith(t)})))},n.onSuggestionsFetchRequested=function(e){n.setState({suggestions:n.getSuggestions(e)})},n.getSuggestionValue=function(e){return e},n.onSuggestionsClearRequested=function(){n.setState({suggestions:[]})};var r=t.value;return void 0===r&&(r=t.item.defaultValue),n.state=o(o({},t),{value:r,suggestions:[]}),n}return a(t,e),t.prototype.renderSuggestion=function(e){return p.a.createElement("div",null,e)},t.prototype.getColumnNames=function(){var e,t=this.props.context.data,n=[];if(void 0!==t&&t.length>0)for(var r in e=t[0].fields){var i=e[r],a=i.config,o=i.name;void 0!==a&&void 0!==a.displayName?n.push(a.displayName):n.push(o)}return n},t.prototype.render=function(){var e=this.props.value;void 0===e&&(e=this.props.item.defaultValue);var t=this.getSuggestions(e),n={placeholder:"Enter cloumn name...",value:e,onChange:this.onChange};return p.a.createElement(U.a,{suggestions:t,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,getSuggestionValue:this.getSuggestionValue,renderSuggestion:this.renderSuggestion,inputProps:n,theme:{input:"input-small gf-form-input width-100",suggestion:"suggestion"}})},t}(p.a.PureComponent)),Q=n(23),J={insert:"head",singleton:!1},ee=(D()(Q.a,J),Q.a.locals,function(e){function t(t){var n=e.call(this,t)||this;return n.state=o(o({},t),{icons:[]}),fetch(b.getAssetUrl("icon_index.json")).then((function(e){return e.json()})).then((function(e){e.sort(),n.setState({icons:e})})).catch((function(){})),n}return a(t,e),t.prototype.addMapping=function(){var e=this.state.item.path,t=this.state.context.options[e];t.push({pattern:"",filename:"default"}),this.state.onChange.call(e,t)},t.prototype.removeMapping=function(e){var t=this.state.item.path,n=this.state.context.options[t];n.splice(e,1),this.state.onChange.call(t,n)},t.prototype.setPatternValue=function(e,t){var n=this.state.item.path,r=this.state.context.options[n];r[t].pattern=e.currentTarget.value,this.state.onChange.call(n,r)},t.prototype.setFileNameValue=function(e,t){var n=this.state.item.path,r=this.state.context.options[n];r[t].filename=e.currentTarget.value.toString(),this.props.onChange.call(n,r)},t.prototype.render=function(){var e=this,t=this.state.item.path,n=this.state.icons,r=this.state.context.options[t];if(void 0===r){r=this.state.item.defaultValue;var i=this.state;i.context.options[t]=this.state.item.defaultValue,this.setState(i)}return p.a.createElement("div",null,p.a.createElement("div",{className:"gf-form-inline"},p.a.createElement("div",{className:"gf-form width-100"},p.a.createElement("label",{className:"gf-form-label no-background no-padding-left width-half"},"Target Name (RegEx)"),p.a.createElement("label",{className:"gf-form-label no-background no-padding-left width-half"},"Icon"))),p.a.createElement("div",null,r.map((function(t,r){return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{className:"gf-form"},p.a.createElement("input",{type:"text",className:"input-small gf-form-input",value:t.pattern,onChange:function(t){return e.setPatternValue(t,r)}}),p.a.createElement("select",{className:"input-small gf-form-input",value:t.filename,onChange:function(t){return e.setFileNameValue(t,r)}},n.map((function(e,t){return p.a.createElement("option",{value:e,key:t},e)}))),p.a.createElement("a",{className:"gf-form-label tight-form-func no-background",onClick:function(){return e.removeMapping(r)}},p.a.createElement("i",{className:"fa fa-trash"}))))}))),p.a.createElement("button",{className:"btn navbar-button navbar-button--primary icon-mapping-button",onClick:function(){return e.addMapping()}},"Add Icon Mapping"))},t}(p.a.PureComponent)),te=function(e){function t(t){var n=e.call(this,t)||this;n.getDummyDataMapping=function(){return{aggregationType:"service",sourceColumn:"origin_service",targetColumn:"target_service",responseTimeColumn:"in_timesum",requestRateColumn:"in_count",errorRateColumn:"error_in",responseTimeOutgoingColumn:"out_timesum",requestRateOutgoingColumn:"out_count",errorRateOutgoingColumn:"error_out",extOrigin:"",extTarget:"",type:"",showDummyData:!0,baselineRtUpper:"threshold"}},n.onChange=function(){var e=n.props.context.options.dataMapping,t=n.state.item,r=n.props.onChange,i=!e.showDummyData;i&&(n.setState({dataMapping:e}),e=n.getDummyDataMapping()),e.showDummyData=i,r.call(t.path,e)};var r=t.context.options.dataMapping;return void 0===r&&(r=t.item.defaultValue),n.state=o({dataMapping:r},t),n}return a(t,e),t.prototype.render=function(){var e=this,t=this.props.context.options.dataMapping;return void 0===t&&(t=this.props.item.defaultValue,this.props.context.options.dataMapping=this.props.item.defaultValue),p.a.createElement("div",null,p.a.createElement(j.Switch,{value:t.showDummyData,css:{},onChange:function(){return e.onChange()}}))},t}(p.a.PureComponent),ne=function(e){var t=e.value,n=e.onChange;return p.a.createElement(j.RadioButtonGroup,{options:[{label:"Alerts",value:!1},{label:"Impact Severity",value:!0}],value:t,onChange:function(e){return n(e)}})},re={animate:!0,dataMapping:{aggregationType:"app",sourceColumn:"origin_app",targetColumn:"target_app",responseTimeColumn:"response-time",requestRateColumn:"req_rate",errorRateColumn:"error_rate",responseTimeOutgoingColumn:"response-time-out",requestRateOutgoingColumn:"request-rate-out",errorRateOutgoingColumn:"error-rate-out",extOrigin:"external_origin",extTarget:"external_target",type:"type",classColumn:"type",baselineRtUpper:"threshold",showDummyData:!1},sumTimings:!0,filterEmptyConnections:!1,showDebugInformation:!1,showConnectionStats:!1,showBaselines:!1,style:{alertColor:"rgb(242, 72, 91)",imOkColor:"rgb(87, 242, 135)",imWarningColor:"rgb(88, 101, 242)",imMinorColor:"rgb(254, 231, 92)",imMajorColor:"rgb(250, 100, 0)",imCriticalColor:"rgb(237, 66, 69)",appearanceSwitch:!1},icons:[{pattern:"Agent Client Collector",filename:"agent"},{pattern:"Application",filename:"app_service"},{pattern:"Application Service",filename:"app_service"},{pattern:"Cluster",filename:"cluster"},{pattern:"Datacenter",filename:"datacenter"},{pattern:"Image",filename:"image"},{pattern:"Cloud Gateway",filename:"gateway"},{pattern:"Availability Zone",filename:"availability_set"},{pattern:"Cloud DataBase",filename:"db_sql"},{pattern:"Cloud LB IPAddress",filename:"ip"},{pattern:"Cloud Load Balancer",filename:"loadbalancer"},{pattern:"Cloud Function",filename:"cloud_function"},{pattern:"Cloud Object Storage",filename:"storage"},{pattern:"Compute Security Group",filename:"group"},{pattern:"Cloud Service Account",filename:"Account"},{pattern:"Cloud Network",filename:"cloud"},{pattern:"Virtual Machine Instance",filename:"virtual_machine2"},{pattern:"File System",filename:"directory"},{pattern:"AWS Datacenter",filename:"datacenter"},{pattern:"Storage Mapping",filename:"storage"},{pattern:"VNIC Endpoint",filename:"virtual_network"},{pattern:"DNS Name",filename:"dns"},{pattern:"Subnet Endpoint",filename:"route"},{pattern:"Cloud Mgmt Network Interface",filename:"network_interface"},{pattern:"MySQL Instance",filename:"db_mysql"},{pattern:"Docker Engine",filename:"docker_engine"},{pattern:"Disk Partition|Disk",filename:"disk"},{pattern:"IP Address",filename:"ip"},{pattern:"Network Adapter",filename:"network_interface"},{pattern:"Storage Device",filename:"storage"},{pattern:"Windows Server",filename:"windows"},{pattern:"Linux Server",filename:"linux"},{pattern:"Kubernetes Service",filename:"k8s-svc"},{pattern:"Kubernetes Pod",filename:"k8s-pod"},{pattern:"Kubernetes Namespace",filename:"k8s-ns"},{pattern:"Kubernetes Deployment",filename:"k8s-deploy"},{pattern:"Kubernetes Cluster",filename:"k8s-cluster"},{pattern:"Kubernetes Node",filename:"k8s-node"},{pattern:"Kubernetes DaemonSet|Kubernetes StatefulSet",filename:"k8s-ds"},{pattern:"Load Balancer Service",filename:"loadbalance_svc"},{pattern:"F5 BIG-IP",filename:"f5_loadbalancer"},{pattern:"Docker Container|Docker Image",filename:"docker_container"},{pattern:"ServiceNow Application Component",filename:"app_service"},{pattern:"ServiceNow Application",filename:"app_service"},{pattern:"ServiceNow MID Server",filename:"server2"},{pattern:"Kubernetes Volume",filename:"k8s-volume"},{pattern:"Tag-Based Application Service",filename:"tag"},{pattern:"VMware vCenter Network",filename:"network_interface"},{pattern:"ESX Server",filename:"server"},{pattern:"Virtual Machine Instance",filename:"virtual_machine2"},{pattern:"Server Chassis",filename:"server2"},{pattern:"Switch|IP Switch",filename:"switch"},{pattern:"Business Service",filename:"business_svc"},{pattern:"IP Router",filename:"router"},{pattern:"MSFT SQL Instance",filename:"db_sql"},{pattern:"Web Server",filename:"web_server"},{pattern:"HTTP",filename:"web"},{pattern:"Web Site",filename:"web_site"},{pattern:"Router Interface",filename:"network_interface"},{pattern:"Virtual Machine Instance",filename:"virtual_machine2"},{pattern:"Resource Group",filename:"resource_group"},{pattern:"File System",filename:"disk"},{pattern:"Cloud Mgmt Network Interface",filename:"network_interface"},{pattern:"Cloud Service Account",filename:"Account"},{pattern:"Availability Zone",filename:"availability_set"},{pattern:"",filename:"default"}],externalIcons:[{pattern:"web",filename:"web"},{pattern:"jms",filename:"message"},{pattern:"jdbc",filename:"database"},{pattern:"http",filename:"http"}],drillDownLink:"/d/AEOITnWnz?var-ci={node}&var-ciClasses={nodeClass}&var-childTopo=$childTopo&var-parentTopo=$parentTopo",timeFormat:"m",datasourceName:"servicenow-optimiz-plugin"};function ie(e){var t,n,r=[];try{for(var i=l(e),a=i.next();!a.done;a=i.next()){var o=a.value;r.push({pattern:o.name,filename:o.filename})}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}n.d(t,"plugin",(function(){return ae}));var ae=new r.PanelPlugin(H).setPanelOptions((function(e){return e.addCustomEditor({path:"dataMapping.aggregationType",id:"aggregationType",editor:$,name:"Component Column",category:["Connection Mapping"],defaultValue:re.dataMapping.aggregationType}).addCustomEditor({path:"dataMapping.sourceColumn",id:"sourceComponentPrefix",editor:$,name:"Source Component Column",category:["Connection Mapping"],defaultValue:re.dataMapping.sourceColumn}).addCustomEditor({path:"dataMapping.targetColumn",id:"targetComponentPrefix",name:"Target Component Column",category:["Connection Mapping"],editor:$,defaultValue:re.dataMapping.targetColumn}).addCustomEditor({path:"dataMapping.type",id:"type",name:"Type",category:["Connection Mapping"],editor:$,defaultValue:re.dataMapping.type}).addCustomEditor({path:"dataMapping.extOrigin",id:"externalOrigin",name:"External Origin",category:["Connection Mapping"],editor:$,defaultValue:re.dataMapping.extOrigin}).addCustomEditor({path:"dataMapping.extTarget",id:"externalTarget",name:"External Target",category:["Connection Mapping"],editor:$,defaultValue:re.dataMapping.extTarget}).addCustomEditor({id:"classColumn",path:"dataMapping.classColumn",name:"Class Column",editor:$,category:["Data Mapping"],defaultValue:re.dataMapping.classColumn}).addCustomEditor({id:"responseTime",path:"dataMapping.responseTimeColumn",name:"Response Time Column",editor:$,category:["Data Mapping"],defaultValue:re.dataMapping.responseTimeColumn}).addCustomEditor({id:"requestRateColumn",path:"dataMapping.requestRateColumn",name:"Request Rate Column",editor:$,category:["Data Mapping"],defaultValue:re.dataMapping.requestRateColumn}).addCustomEditor({id:"errorRateColumn",path:"dataMapping.errorRateColumn",name:"Error Rate Column",editor:$,category:["Data Mapping"],defaultValue:re.dataMapping.errorRateColumn}).addCustomEditor({id:"responseTimeOutgoingColumn",path:"dataMapping.responseTimeOutgoingColumn",name:"Response Time Column (Outgoing)",editor:$,category:["Data Mapping"],defaultValue:re.dataMapping.responseTimeOutgoingColumn}).addCustomEditor({id:"requestRateOutgoingColumn",path:"dataMapping.requestRateOutgoingColumn",name:"Request Rate Column (Outgoing)",editor:$,category:["Data Mapping"],defaultValue:re.dataMapping.requestRateOutgoingColumn}).addCustomEditor({id:"errorRateOutgoingColumn",path:"dataMapping.errorRateOutgoingColumn",name:"Error Rate Column (Outgoing)",editor:$,category:["Data Mapping"],defaultValue:re.dataMapping.errorRateOutgoingColumn}).addCustomEditor({id:"baselineRtUpper",path:"dataMapping.baselineRtUpper",name:"Response Time Baseline (Upper)",editor:$,category:["Data Mapping"],defaultValue:re.dataMapping.baselineRtUpper}).addBooleanSwitch({path:"showConnectionStats",name:"Show Connection Statistics",category:["General Settings"],defaultValue:re.showConnectionStats}).addBooleanSwitch({path:"sumTimings",name:"Handle Timings as Sums",description:"If this setting is active, the timings providedby the mapped response time columns are considered as a continually increasing sum of response times. When deactivated, it is considered that the timings provided by columns are the actual average response times.",category:["General Settings"],defaultValue:re.sumTimings}).addBooleanSwitch({path:"filterEmptyConnections",name:"Filter Empty Data",description:"If this setting is active, the timings provided by the mapped response time columns are considered as a continually increasing sum of response times. When deactivated, it is considered that the timings provided by columns are the actual average response times.",category:["General Settings"],defaultValue:re.filterEmptyConnections}).addBooleanSwitch({path:"showDebugInformation",name:"Show Debug Information",category:["General Settings"],defaultValue:re.showDebugInformation}).addCustomEditor({path:"dataMapping",id:"dummyDataSwitch",name:"Show Dummy Data",editor:te,category:["General Settings"],defaultValue:re.dataMapping}).addBooleanSwitch({path:"showBaselines",name:"Show Baselines",category:["General Settings"],defaultValue:re.showBaselines}).addSelect({path:"timeFormat",name:"Maximum Time Unit to Resolve",description:"This setting controls to which time unit time values will be resolved to. Each value always includes the smaller units.",category:["General Settings"],settings:{options:[{value:"ms",label:"ms"},{value:"s",label:"s"},{value:"m",label:"m"}]},defaultValue:re.timeFormat}).addCustomEditor({id:"appearanceSwitch",path:"style.appearanceSwitch",name:"Colors Based On",editor:ne,category:["Appearance"],defaultValue:re.style.appearanceSwitch}).addColorPicker({path:"style.alertColor",name:"Alert Color",category:["Appearance"],defaultValue:re.style.alertColor}).addColorPicker({path:"style.imOkColor",name:"OK/Clear Impact Color",category:["Appearance"],defaultValue:re.style.imOkColor}).addColorPicker({path:"style.imWarningColor",name:"Warning Impact Color",category:["Appearance"],defaultValue:re.style.imWarningColor}).addColorPicker({path:"style.imMinorColor",name:"Minor Impact Color",category:["Appearance"],defaultValue:re.style.imMinorColor}).addColorPicker({path:"style.imMajorColor",name:"Major Impact Color",category:["Appearance"],defaultValue:re.style.imMajorColor}).addColorPicker({path:"style.imCriticalColor",name:"Critical Impact Color",category:["Appearance"],defaultValue:re.style.imCriticalColor}).addCustomEditor({path:"icons",id:"iconMapping",editor:ee,name:"",description:'This setting controls which images should be mapped to your directly monitored nodes. The node names are matched by the regex pattern provided in the "Target Name(Regex) column.',category:["Icon Mapping"],defaultValue:re.icons}).addCustomEditor({path:"externalIcons",id:"externalIconMapping",editor:ee,name:"",description:'This setting controls which images should be mapped to the external nodes. The given type column is matched by the regex pattern provided in the "Target Name(Regex) column.',category:["External Icon Mapping"],defaultValue:re.externalIcons}).addTextInput({path:"drillDownLink",name:"Backend URL",category:["Tracing Drilldown"],defaultValue:re.drillDownLink}).addTextInput({path:"datasourceName",name:"Datasource Name",category:["Datasource"],description:"Datasource name will be used to make calls to other pannels in the dashboard.",defaultValue:re.datasourceName})})).setMigrationHandler((function(e){var t=e.settings;return"showDummyData"in t.dataMapping?t:{animate:t.animate,sumTimings:t.sumTimings,filterEmptyConnections:t.filterEmptyConnections,style:{healthyColor:t.style.healthyColor,dangerColor:t.style.dangerColor,noDataColor:t.style.unknownColor},showDebugInformation:t.showDebugInformation,showConnectionStats:t.showConnectionStats,externalIcons:ie(t.externalIcons),icons:t.serviceIcons,dataMapping:{aggregationType:"$aggregationType",sourceColumn:t.dataMapping.sourceComponentPrefix+"$aggregationType",targetColumn:t.dataMapping.targetComponentPrefix+"$aggregationType",responseTimeColumn:t.dataMapping.responseTimeColumn,requestRateColumn:t.dataMapping.requestRateColumn,errorRateColumn:t.dataMapping.errorRateColumn,responseTimeOutgoingColumn:t.dataMapping.responseTimeOutgoingColumn,requestRateOutgoingColumn:t.dataMapping.requestRateOutgoingColumn,errorRateOutgoingColumn:t.dataMapping.errorRateOutgoingColumn,extOrigin:t.dataMapping.extOrigin,extTarget:t.dataMapping.extTarget,type:t.dataMapping.type,showDummyData:t.showDummyData,baselineRtUpper:t.dataMapping.baselineRtUpper},drillDownLink:t.drillDownLink,showBaselines:t.showBaselines,timeFormat:re.timeFormat}}))}])}));
  //# sourceMappingURL=module.js.map