cytoscape
Version:
Graph theory (a.k.a. network) library for analysis and visualisation
23 lines (22 loc) • 418 kB
JavaScript
/**
* Copyright (c) 2016-2025, The Cytoscape Consortium.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the “Software”), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).cytoscape=t()}(this,(function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t,n){return t&&function(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,s(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,o,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}(e,t)||u(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 o(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}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},l(e)}function u(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var c="undefined"==typeof window?null:window,d=c?c.navigator:null;c&&c.document;var h,f,p,g,v,y,m,b,x,w,E,k,T,C,P,S,B,D,_,A,M,R,I,N,L,z,O,V,F=l(""),j=l({}),X=l((function(){})),Y="undefined"==typeof HTMLElement?"undefined":l(HTMLElement),q=function(e){return e&&e.instanceString&&K(e.instanceString)?e.instanceString():null},W=function(e){return null!=e&&l(e)==F},K=function(e){return null!=e&&l(e)===X},U=function(e){return!$(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},H=function(e){return null!=e&&l(e)===j&&!U(e)&&e.constructor===Object},G=function(e){return null!=e&&l(e)===l(1)&&!isNaN(e)},Z=function(e){return"undefined"===Y?void 0:null!=e&&e instanceof HTMLElement},$=function(e){return Q(e)||J(e)},Q=function(e){return"collection"===q(e)&&e._private.single},J=function(e){return"collection"===q(e)&&!e._private.single},ee=function(e){return"core"===q(e)},te=function(e){return"stylesheet"===q(e)},ne=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},re=function(e){return function(e){return null!=e&&l(e)===j}(e)&&K(e.then)},ae=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(){var r,a=arguments,i=t.apply(this,a),o=n.cache;return(r=o[i])||(r=o[i]=e.apply(this,a)),r};return n.cache={},n},ie=ae((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),oe=ae((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),se=ae((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),le=function(e){return ne(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},ue="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",ce="rgb[a]?\\(("+ue+"[%]?)\\s*,\\s*("+ue+"[%]?)\\s*,\\s*("+ue+"[%]?)(?:\\s*,\\s*("+ue+"))?\\)",de="rgb[a]?\\((?:"+ue+"[%]?)\\s*,\\s*(?:"+ue+"[%]?)\\s*,\\s*(?:"+ue+"[%]?)(?:\\s*,\\s*(?:"+ue+"))?\\)",he="hsl[a]?\\(("+ue+")\\s*,\\s*("+ue+"[%])\\s*,\\s*("+ue+"[%])(?:\\s*,\\s*("+ue+"))?\\)",fe="hsl[a]?\\((?:"+ue+")\\s*,\\s*(?:"+ue+"[%])\\s*,\\s*(?:"+ue+"[%])(?:\\s*,\\s*(?:"+ue+"))?\\)",pe=function(e,t){return e<t?-1:e>t?1:0},ge=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 a=Object.keys(r),i=0;i<a.length;i++){var o=a[i];e[o]=r[o]}}return e},ve=function(e){return(U(e)?e:null)||function(e){return ye[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,a=16;return 4===e.length?(t=parseInt(e[1]+e[1],a),n=parseInt(e[2]+e[2],a),r=parseInt(e[3]+e[3],a)):(t=parseInt(e[1]+e[2],a),n=parseInt(e[3]+e[4],a),r=parseInt(e[5]+e[6],a)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^"+ce+"$").exec(e);if(n){t=[];for(var r=[],a=1;a<=3;a++){var i=n[a];if("%"===i[i.length-1]&&(r[a]=!0),i=parseFloat(i),r[a]&&(i=i/100*255),i<0||i>255)return;t.push(Math.floor(i))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,a,i,o,s,l;function u(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("^"+he+"$").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,(a=parseFloat(c[3]))<0||a>100)return;if(a/=100,void 0!==(i=c[4])&&((i=parseFloat(i))<0||i>1))return;if(0===r)o=s=l=Math.round(255*a);else{var d=a<.5?a*(1+r):a+r-a*r,h=2*a-d;o=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[o,s,l,i]}return t}(e)},ye={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]},me=function(e){for(var t=e.map,n=e.keys,r=n.length,a=0;a<r;a++){var i=n[a];if(H(i))throw Error("Tried to set map with object key");a<n.length-1?(null==t[i]&&(t[i]={}),t=t[i]):t[i]=e.value}},be=function(e){for(var t=e.map,n=e.keys,r=n.length,a=0;a<r;a++){var i=n[a];if(H(i))throw Error("Tried to get map with object key");if(null==(t=t[i]))return t}return t},xe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function we(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ee(){if(f)return h;return f=1,h=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function ke(){if(y)return v;y=1;var e=function(){if(g)return p;g=1;var e="object"==typeof xe&&xe&&xe.Object===Object&&xe;return p=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return v=n}function Te(){if(k)return E;k=1;var e=function(){if(w)return x;w=1;var e=/\s/;return x=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},x}(),t=/^\s+/;return E=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},E}function Ce(){if(C)return T;C=1;var e=ke().Symbol;return T=e}function Pe(){if(A)return _;A=1;var e=Ce(),t=function(){if(S)return P;S=1;var e=Ce(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;return P=function(e){var t=n.call(e,a),i=e[a];try{e[a]=void 0;var o=!0}catch(e){}var s=r.call(e);return o&&(t?e[a]=i:delete e[a]),s}}(),n=function(){if(D)return B;D=1;var e=Object.prototype.toString;return B=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return _=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function Se(){if(N)return I;N=1;var e=Pe(),t=R?M:(R=1,M=function(e){return null!=e&&"object"==typeof e});return I=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}var Be=function(){if(V)return O;V=1;var e=Ee(),t=function(){if(b)return m;b=1;var e=ke();return m=function(){return e.Date.now()}}(),n=function(){if(z)return L;z=1;var e=Te(),t=Ee(),n=Se(),r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt;return L=function(s){if("number"==typeof s)return s;if(n(s))return NaN;if(t(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=t(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=e(s);var u=a.test(s);return u||i.test(s)?o(s.slice(2),u?2:8):r.test(s)?NaN:+s}}(),r=Math.max,a=Math.min;return O=function(i,o,s){var l,u,c,d,h,f,p=0,g=!1,v=!1,y=!0;if("function"!=typeof i)throw new TypeError("Expected a function");function m(e){var t=l,n=u;return l=u=void 0,p=e,d=i.apply(n,t)}function b(e){var t=e-f;return void 0===f||t>=o||t<0||v&&e-p>=c}function x(){var e=t();if(b(e))return w(e);h=setTimeout(x,function(e){var t=o-(e-f);return v?a(t,c-(e-p)):t}(e))}function w(e){return h=void 0,y&&l?m(e):(l=u=void 0,d)}function E(){var e=t(),n=b(e);if(l=arguments,u=this,f=e,n){if(void 0===h)return function(e){return p=e,h=setTimeout(x,o),g?m(e):d}(f);if(v)return clearTimeout(h),h=setTimeout(x,o),m(f)}return void 0===h&&(h=setTimeout(x,o)),d}return o=n(o)||0,e(s)&&(g=!!s.leading,c=(v="maxWait"in s)?r(n(s.maxWait)||0,o):c,y="trailing"in s?!!s.trailing:y),E.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=u=h=void 0},E.flush=function(){return void 0===h?d:w(t())},E},O}(),De=we(Be),_e=c?c.performance:null,Ae=_e&&_e.now?function(){return _e.now()}:function(){return Date.now()},Me=function(){if(c){if(c.requestAnimationFrame)return function(e){c.requestAnimationFrame(e)};if(c.mozRequestAnimationFrame)return function(e){c.mozRequestAnimationFrame(e)};if(c.webkitRequestAnimationFrame)return function(e){c.webkitRequestAnimationFrame(e)};if(c.msRequestAnimationFrame)return function(e){c.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(Ae())}),1e3/60)}}(),Re=function(e){return Me(e)},Ie=Ae,Ne=9261,Le=5381,ze=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Oe=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne)+e|0},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Le;return(t<<5)+t+e|0},Fe=function(e){return 2097152*e[0]+e[1]},je=function(e,t){return[Oe(e[0],t[0]),Ve(e[1],t[1])]},Xe=function(e,t){var n={value:0,done:!1},r=0,a=e.length;return ze({next:function(){return r<a?n.value=e[r++]:n.done=!0,n}},t)},Ye=function(e,t){var n={value:0,done:!1},r=0,a=e.length;return ze({next:function(){return r<a?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},qe=function(){return We(arguments)},We=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?Ye(r):Ye(r,t)}return t},Ke=!0,Ue=null!=console.warn,He=null!=console.trace,Ge=Number.MAX_SAFE_INTEGER||9007199254740991,Ze=function(){return!0},$e=function(){return!1},Qe=function(){return 0},Je=function(){},et=function(e){throw new Error(e)},tt=function(e){if(void 0===e)return Ke;Ke=!!e},nt=function(e){tt()&&(Ue?console.warn(e):(console.log(e),He&&console.trace()))},rt=function(e){return null==e?e:U(e)?e.slice():H(e)?function(e){return ge({},e)}(e):e},at=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},it={},ot=function(){return it},st=function(e){var t=Object.keys(e);return function(n){for(var r={},a=0;a<t.length;a++){var i=t[a],o=null==n?void 0:n[i];r[i]=void 0===o?e[i]:o}return r}},lt=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},ut=function(e){e.splice(0,e.length)},ct=function(e,t,n){return n&&(t=se(n,t)),e[t]},dt=function(e,t,n,r){n&&(t=se(n,t)),e[t]=r},ht="undefined"!=typeof Map?Map:function(){return n((function e(){t(this,e),this._obj={}}),[{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]}}])}(),ft=function(){return n((function e(n){if(t(this,e),this._obj=Object.create(null),this.size=0,null!=n){var r;r=null!=n.instanceString&&n.instanceString()===this.instanceString()?n.toArray():n;for(var a=0;a<r.length;a++)this.add(r[a])}}),[{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)}}])}(),pt="undefined"!==("undefined"==typeof Set?"undefined":l(Set))?Set:ft,gt=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&ee(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 a=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 pt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.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==a.position.x&&(a.position.x=0),null==a.position.y&&(a.position.y=0),t.renderedPosition){var i=t.renderedPosition,o=e.pan(),s=e.zoom();a.position={x:(i.x-o.x)/s,y:(i.y-o.y)/s}}var l=[];U(t.classes)?l=t.classes:W(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var d=l[u];d&&""!==d&&a.classes.add(d)}this.createEmitter(),(void 0===n||n)&&this.restore();var h=t.style||t.css;h&&(nt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h))}else et("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else et("An element must have a core reference and parameters set")},vt=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var a;H(t)&&!$(t)&&(t=(a=t).roots||a.root,n=a.visit,r=a.directed),r=2!==arguments.length||K(n)?r:n,n=K(n)?n:function(){};for(var i,o=this._private.cy,s=t=W(t)?this.filter(t):t,l=[],u=[],c={},d={},h={},f=0,p=this.byGroup(),g=p.nodes,v=p.edges,y=0;y<s.length;y++){var m=s[y],b=m.id();m.isNode()&&(l.unshift(m),e.bfs&&(h[b]=!0,u.push(m)),d[b]=0)}for(var x,w=function(){var t=e.bfs?l.shift():l.pop(),a=t.id();if(e.dfs){if(h[a])return 0;h[a]=!0,u.push(t)}var o,s=d[a],p=c[a],y=null!=p?p.source():null,m=null!=p?p.target():null,b=null==p?void 0:t.same(y)?m[0]:y[0];if(!0===(o=n(t,p,b,f++,s)))return i=t,1;if(!1===o)return 1;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],k=E.connectedNodes().filter((function(e){return!e.same(t)&&g.has(e)})),T=k.id();0===k.length||h[T]||(k=k[0],l.push(k),e.bfs&&(h[T]=!0,u.push(k)),c[T]=E,d[T]=d[a]+1)}};0!==l.length&&(0===(x=w())||1!==x););for(var E=o.collection(),k=0;k<u.length;k++){var T=u[k],C=c[T.id()];null!=C&&E.push(C),E.push(T)}return{path:o.collection(E),found:o.collection(i)}}},yt={breadthFirstSearch:vt({bfs:!0}),depthFirstSearch:vt({dfs:!0})};yt.bfs=yt.breadthFirstSearch,yt.dfs=yt.depthFirstSearch;var mt,bt,xt,wt={exports:{}},Et=wt.exports;function kt(){return mt||(mt=1,function(e){(function(){var t,n,r,a,i,o,s,l,u,c,d,h,f,p,g;r=Math.floor,c=Math.min,n=function(e,t){return e<t?-1:e>t?1:0},u=function(e,t,a,i,o){var s;if(null==a&&(a=0),null==o&&(o=n),a<0)throw new Error("lo must be non-negative");for(null==i&&(i=e.length);a<i;)o(t,e[s=r((a+i)/2)])<0?i=s:a=s+1;return[].splice.apply(e,[a,a-a].concat(t)),t},o=function(e,t,r){return null==r&&(r=n),e.push(t),p(e,0,e.length-1,r)},i=function(e,t){var r,a;return null==t&&(t=n),r=e.pop(),e.length?(a=e[0],e[0]=r,g(e,0,t)):a=r,a},l=function(e,t,r){var a;return null==r&&(r=n),a=e[0],e[0]=t,g(e,0,r),a},s=function(e,t,r){var a;return null==r&&(r=n),e.length&&r(e[0],t)<0&&(t=(a=[e[0],t])[0],e[0]=a[1],g(e,0,r)),t},a=function(e,t){var a,i,o,s,l,u;for(null==t&&(t=n),l=[],i=0,o=(s=function(){u=[];for(var t=0,n=r(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;i<o;i++)a=s[i],l.push(g(e,a,t));return l},f=function(e,t,r){var a;if(null==r&&(r=n),-1!==(a=e.indexOf(t)))return p(e,0,a,r),g(e,a,r)},d=function(e,t,r){var i,o,l,u,c;if(null==r&&(r=n),!(o=e.slice(0,t)).length)return o;for(a(o,r),l=0,u=(c=e.slice(t)).length;l<u;l++)i=c[l],s(o,i,r);return o.sort(r).reverse()},h=function(e,t,r){var o,s,l,d,h,f,p,g,v;if(null==r&&(r=n),10*t<=e.length){if(!(l=e.slice(0,t).sort(r)).length)return l;for(s=l[l.length-1],d=0,f=(p=e.slice(t)).length;d<f;d++)r(o=p[d],s)<0&&(u(l,o,0,null,r),l.pop(),s=l[l.length-1]);return l}for(a(e,r),v=[],h=0,g=c(t,e.length);0<=g?h<g:h>g;0<=g?++h:--h)v.push(i(e,r));return v},p=function(e,t,r,a){var i,o,s;for(null==a&&(a=n),i=e[r];r>t&&a(i,o=e[s=r-1>>1])<0;)e[r]=o,r=s;return e[r]=i},g=function(e,t,r){var a,i,o,s,l;for(null==r&&(r=n),i=e.length,l=t,o=e[t],a=2*t+1;a<i;)(s=a+1)<i&&!(r(e[a],e[s])<0)&&(a=s),e[t]=e[a],a=2*(t=a)+1;return e[t]=o,p(e,l,t,r)},t=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=o,e.pop=i,e.replace=l,e.pushpop=s,e.heapify=a,e.updateItem=f,e.nlargest=d,e.nsmallest=h,e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return i(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 l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return a(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return f(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}(),e.exports=t}).call(Et)}(wt)),wt.exports}var Tt=we(xt?bt:(xt=1,bt=kt())),Ct=st({root:null,weight:function(e){return 1},directed:!1}),Pt={dijkstra:function(e){if(!H(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Ct(e),r=n.root,a=n.weight,i=n.directed,o=this,s=a,l=W(r)?this.filter(r)[0]:r[0],u={},c={},d={},h=this.byGroup(),f=h.nodes,p=h.edges;p.unmergeBy((function(e){return e.isLoop()}));for(var g=function(e){return u[e.id()]},v=function(e,t){u[e.id()]=t,y.updateItem(e)},y=new Tt((function(e,t){return g(e)-g(t)})),m=0;m<f.length;m++){var b=f[m];u[b.id()]=b.same(l)?0:1/0,y.push(b)}for(var x=function(e,t){for(var n,r=(i?e.edgesTo(t):e.edgesWith(t)).intersect(p),a=1/0,o=0;o<r.length;o++){var l=r[o],u=s(l);(u<a||!n)&&(a=u,n=l)}return{edge:n,dist:a}};y.size()>0;){var w=y.pop(),E=g(w),k=w.id();if(d[k]=E,E!==1/0)for(var T=w.neighborhood().intersect(f),C=0;C<T.length;C++){var P=T[C],S=P.id(),B=x(w,P),D=E+B.dist;D<g(P)&&(v(P,D),c[S]={node:w,edge:B.edge})}}return{distanceTo:function(e){var t=W(e)?f.filter(e)[0]:e[0];return d[t.id()]},pathTo:function(e){var t=W(e)?f.filter(e)[0]:e[0],n=[],r=t,a=r.id();if(t.length>0)for(n.unshift(t);c[a];){var i=c[a];n.unshift(i.edge),n.unshift(i.node),a=(r=i.node).id()}return o.spawn(n)}}}},St={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,a=n.length,i=new Array(a),o=n,s=function(e){for(var t=0;t<i.length;t++){if(i[t].has(e))return t}},l=0;l<a;l++)i[l]=this.spawn(n[l]);for(var u=r.sort((function(t,n){return e(t)-e(n)})),c=0;c<u.length;c++){var d=u[c],h=d.source()[0],f=d.target()[0],p=s(h),g=s(f),v=i[p],y=i[g];p!==g&&(o.merge(d),v.merge(y),i.splice(g,1))}return o}},Bt=st({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Dt={aStar:function(e){var t=this.cy(),n=Bt(e),r=n.root,a=n.goal,i=n.heuristic,o=n.directed,s=n.weight;r=t.collection(r)[0],a=t.collection(a)[0];var l,u,c=r.id(),d=a.id(),h={},f={},p={},g=new Tt((function(e,t){return f[e.id()]-f[t.id()]})),v=new pt,y={},m={},b=function(e,t){g.push(e),v.add(t)};b(r,c),h[c]=0,f[c]=i(r);for(var x,w=0;g.size()>0;){if(l=g.pop(),u=l.id(),v.delete(u),w++,u===d){for(var E=[],k=a,T=d,C=m[T];E.unshift(k),null!=C&&E.unshift(C),null!=(k=y[T]);)C=m[T=k.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:w}}p[u]=!0;for(var P=l._private.edges,S=0;S<P.length;S++){var B=P[S];if(this.hasElementWithId(B.id())&&(!o||B.data("source")===u)){var D=B.source(),_=B.target(),A=D.id()!==u?D:_,M=A.id();if(this.hasElementWithId(M)&&!p[M]){var R=h[u]+s(B);x=M,v.has(x)?R<h[M]&&(h[M]=R,f[M]=R+i(A),y[M]=l,m[M]=B):(h[M]=R,f[M]=R+i(A),b(A,M),y[M]=l,m[M]=B)}}}}return{found:!1,distance:void 0,path:void 0,steps:w}}},_t=st({weight:function(e){return 1},directed:!1}),At={floydWarshall:function(e){for(var t=this.cy(),n=_t(e),r=n.weight,a=n.directed,i=r,o=this.byGroup(),s=o.nodes,l=o.edges,u=s.length,c=u*u,d=function(e){return s.indexOf(e)},h=function(e){return s[e]},f=new Array(c),p=0;p<c;p++){var g=p%u,v=(p-g)/u;f[p]=v===g?0:1/0}for(var y=new Array(c),m=new Array(c),b=0;b<l.length;b++){var x=l[b],w=x.source()[0],E=x.target()[0];if(w!==E){var k=d(w),T=d(E),C=k*u+T,P=i(x);if(f[C]>P&&(f[C]=P,y[C]=T,m[C]=x),!a){var S=T*u+k;!a&&f[S]>P&&(f[S]=P,y[S]=k,m[S]=x)}}}for(var B=0;B<u;B++)for(var D=0;D<u;D++)for(var _=D*u+B,A=0;A<u;A++){var M=D*u+A,R=B*u+A;f[_]+f[R]<f[M]&&(f[M]=f[_]+f[R],y[M]=y[_])}var I=function(e){return d(function(e){return(W(e)?t.filter(e):e)[0]}(e))},N={distance:function(e,t){var n=I(e),r=I(t);return f[n*u+r]},path:function(e,n){var r=I(e),a=I(n),i=h(r);if(r===a)return i.collection();if(null==y[r*u+a])return t.collection();var o,s=t.collection(),l=r;for(s.merge(i);r!==a;)l=r,r=y[r*u+a],o=m[l*u+r],s.merge(o),s.merge(h(r));return s}};return N}},Mt=st({weight:function(e){return 1},directed:!1,root:null}),Rt={bellmanFord:function(e){var t=this,n=Mt(e),r=n.weight,a=n.directed,i=n.root,o=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,d=u.nodes,h=d.length,f=new ht,p=!1,g=[];i=l.collection(i)[0],c.unmergeBy((function(e){return e.isLoop()}));for(var v=c.length,y=function(e){var t=f.get(e.id());return t||(t={},f.set(e.id(),t)),t},m=function(e){return(W(e)?l.$(e):e)[0]},b=0;b<h;b++){var x=d[b],w=y(x);x.same(i)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,k=function(e,t,n,r,a,i){var o=r.dist+i;o<a.dist&&!n.same(r.edge)&&(a.dist=o,a.pred=e,a.edge=n,E=!0)},T=1;T<h;T++){E=!1;for(var C=0;C<v;C++){var P=c[C],S=P.source(),B=P.target(),D=o(P),_=y(S),A=y(B);k(S,0,P,_,A,D),a||k(B,0,P,A,_,D)}if(!E)break}if(E)for(var M=[],R=0;R<v;R++){var I=c[R],N=I.source(),L=I.target(),z=o(I),O=y(N).dist,V=y(L).dist;if(O+z<V||!a&&V+z<O){if(p||(nt("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),!1===e.findNegativeWeightCycles)break;var F=[];O+z<V&&F.push(N),!a&&V+z<O&&F.push(L);for(var j=F.length,X=0;X<j;X++){var Y=F[X],q=[Y];q.push(y(Y).edge);for(var K=y(Y).pred;-1===q.indexOf(K);)q.push(K),q.push(y(K).edge),K=y(K).pred;for(var U=(q=q.slice(q.indexOf(K)))[0].id(),H=0,G=2;G<q.length;G+=2)q[G].id()<U&&(U=q[G].id(),H=G);(q=q.slice(H).concat(q.slice(0,H))).push(q[0]);var Z=q.map((function(e){return e.id()})).join(",");-1===M.indexOf(Z)&&(g.push(s.spawn(q)),M.push(Z))}}}return{distanceTo:function(e){return y(m(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=[],a=m(e);;){if(null==a)return t.spawn();var o=y(a),l=o.edge,u=o.pred;if(r.unshift(a[0]),a.same(n)&&r.length>0)break;null!=l&&r.unshift(l),a=u}return s.spawn(r)},hasNegativeWeightCycle:p,negativeWeightCycles:g}}},It=Math.sqrt(2),Nt=function(e,t,n){0===n.length&&et("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],a=r[1],i=r[2],o=t[a],s=t[i],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===o&&t[h]===s||t[d]===s&&t[h]===o)&&l.splice(u,1)}for(var f=0;f<l.length;f++){var p=l[f];p[1]===s?(l[f]=p.slice(),l[f][1]=o):p[2]===s&&(l[f]=p.slice(),l[f][2]=o)}for(var g=0;g<t.length;g++)t[g]===s&&(t[g]=o);return l},Lt=function(e,t,n,r){for(;n>r;){var a=Math.floor(Math.random()*t.length);t=Nt(a,e,t),n--}return t},zt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var a=n.length,i=r.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),s=Math.floor(a/It);if(!(a<2)){for(var l=[],u=0;u<i;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var d=1/0,h=[],f=new Array(a),p=new Array(a),g=new Array(a),v=function(e,t){for(var n=0;n<a;n++)t[n]=e[n]},y=0;y<=o;y++){for(var m=0;m<a;m++)p[m]=m;var b=Lt(p,l.slice(),a,s),x=b.slice();v(p,g);var w=Lt(p,b,s,2),E=Lt(g,x,s,2);w.length<=E.length&&w.length<d?(d=w.length,h=w,v(p,f)):E.length<=w.length&&E.length<d&&(d=E.length,h=E,v(g,f))}for(var k=this.spawn(h.map((function(e){return r[e[0]]}))),T=this.spawn(),C=this.spawn(),P=f[0],S=0;S<f.length;S++){var B=f[S],D=n[S];B===P?T.merge(D):C.merge(D)}var _=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!k.contains(t)&&n.merge(t)}))})),n},A=[_(T),_(C)];return{cut:k,components:A,partition1:T,partition2:C}}et("At least 2 nodes are required for Karger-Stein algorithm")}},Ot=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Vt=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Ft=function(e){return{x:e[0],y:e[1]}},jt=function(e,t){return Math.atan2(t,e)-Math.PI/2},Xt=Math.log2||function(e){return Math.log(e)/Math.log(2)},Yt=function(e){return e>0?1:e<0?-1:0},qt=function(e,t){return Math.sqrt(Wt(e,t))},Wt=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Kt=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var a=0;a<t;a++)e[a]=e[a]/n;return e},Ut=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Ht=function(e,t,n,r){return{x:Ut(e.x,t.x,n.x,r),y:Ut(e.y,t.y,n.y,r)}},Gt=function(e,t,n){return Math.max(e,Math.min(n,t))},Zt=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}}},$t=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Qt=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},Jt=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},en=function(e){var t,n,r,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=a=o[0];else if(2===o.length)t=r=o[0],a=n=o[1];else if(4===o.length){var s=i(o,4);t=s[0],n=s[1],r=s[2],a=s[3]}return e.x1-=a,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},tn=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},nn=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)))))))},rn=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},an=function(e,t){return rn(e,t.x1,t.y1)&&rn(e,t.x2,t.y2)},on=function(e,t,n,r,a,i,o){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?Tn(a,i):u,d=a/2,h=i/2,f=(c=Math.min(c,d,h))!==d,p=c!==h;if(f){var g=r-h-o;if((s=mn(e,t,n,r,n-d+c-o,g,n+d-c+o,g,!1)).length>0)return s}if(p){var v=n+d+o;if((s=mn(e,t,n,r,v,r-h+c-o,v,r+h-c+o,!1)).length>0)return s}if(f){var y=r+h+o;if((s=mn(e,t,n,r,n-d+c-o,y,n+d-c+o,y,!1)).length>0)return s}if(p){var m=n-d-o;if((s=mn(e,t,n,r,m,r-h+c-o,m,r+h-c+o,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=vn(e,t,n,r,b,x,c+o)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=vn(e,t,n,r,w,E,c+o)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var k=n+d-c,T=r+h-c;if((l=vn(e,t,n,r,k,T,c+o)).length>0&&l[0]>=k&&l[1]>=T)return[l[0],l[1]];var C=n-d+c,P=r+h-c;return(l=vn(e,t,n,r,C,P,c+o)).length>0&&l[0]<=C&&l[1]>=P?[l[0],l[1]]:[]},sn=function(e,t,n,r,a,i,o){var s=o,l=Math.min(n,a),u=Math.max(n,a),c=Math.min(r,i),d=Math.max(r,i);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},ln=function(e,t,n,r,a,i,o,s,l){var u=Math.min(n,o,a)-l,c=Math.max(n,o,a)+l,d=Math.min(r,s,i)-l,h=Math.max(r,s,i)+l;return!(e<u||e>c||t<d||t>h)},un=function(e,t,n,r,a,i,o,s){var l=[];!function(e,t,n,r,a){var i,o,s,l,u,c,d,h;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),i=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,a[1]=0,d=t/3,i>0?(u=(u=s+Math.sqrt(i))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(i))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),a[0]=-d+u+c,d+=(u+c)/2,a[4]=a[2]=-d,d=Math.sqrt(3)*(-c+u)/2,a[3]=d,a[5]=-d):(a[5]=a[3]=0,0===i?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),a[0]=2*h-d,a[4]=a[2]=-(h+d)):(l=(o=-o)*o*o,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(o),a[0]=-d+h*Math.cos(l/3),a[2]=-d+h*Math.cos((l+2*Math.PI)/3),a[4]=-d+h*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+r*r-4*r*i+2*r*s+4*i*i-4*i*s+s*s,9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*r*i-3*r*r-3*r*s-6*i*i+3*i*s,3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*r*r-6*r*i+r*s-r*t+2*i*i+2*i*t-s*t,1*n*a-n*n+n*e-a*e+r*i-r*r+r*t-i*t,l);for(var u=[],c=0;c<6;c+=2)Math.abs(l[c+1])<1e-7&&l[c]>=0&&l[c]<=1&&u.push(l[c]);u.push(1),u.push(0);for(var d,h,f,p=-1,g=0;g<u.length;g++)d=Math.pow(1-u[g],2)*n+2*(1-u[g])*u[g]*a+u[g]*u[g]*o,h=Math.pow(1-u[g],2)*r+2*(1-u[g])*u[g]*i+u[g]*u[g]*s,f=Math.pow(d-e,2)+Math.pow(h-t,2),p>=0?f<p&&(p=f):p=f;return p},cn=function(e,t,n,r,a,i){var o=[e-n,t-r],s=[a-n,i-r],l=s[0]*s[0]+s[1]*s[1],u=o[0]*o[0]+o[1]*o[1],c=o[0]*s[0]+o[1]*s[1],d=c*c/l;return c<0?u:d>l?(e-a)*(e-a)+(t-i)*(t-i):u-d},dn=function(e,t,n){for(var r,a,i,o,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],a=n[2*l+1],l+1<n.length/2?(i=n[2*(l+1)],o=n[2*(l+1)+1]):(i=n[2*(l+1-n.length/2)],o=n[2*(l+1-n.length/2)+1]),r==e&&i==e);else{if(!(r>=e&&e>=i||r<=e&&e<=i))continue;(e-r)/(i-r)*(o-a)+a>t&&s++}return s%2!=0},hn=function(e,t,n,r,a,i,o,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),f=Math.sin(-u),p=0;p<c.length/2;p++)c[2*p]=i/2*(n[2*p]*h-n[2*p+1]*f),c[2*p+1]=o/2*(n[2*p+1]*h+n[2*p]*f),c[2*p]+=r,c[2*p+1]+=a;if(l>0){var g=pn(c,-l);d=fn(g)}else d=c;return dn(e,t,d)},fn=function(e){for(var t,n,r,a,i,o,s,l,u=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],a=e[4*c+3],c<e.length/4-1?(i=e[4*(c+1)],o=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(i=e[0],o=e[1],s=e[2],l=e[3]);var d=mn(t,n,r,a,i,o,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},pn=function(e,t){for(var n,r,a,i,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?(a=e[2*(s+1)],i=e[2*(s+1)+1]):(a=e[0],i=e[1]);var l=i-r,u=-(a-n),c=Math.sqrt(l*l+u*u),d=l/c,h=u/c;o[4*s]=n+d*t,o[4*s+1]=r+h*t,o[4*s+2]=a+d*t,o[4*s+3]=i+h*t}return o},gn=function(e,t,n,r,a,i,o){return e-=a,t-=i,(e/=n/2+o)*e+(t/=r/2+o)*t<=1},vn=function(e,t,n,r,a,i,o){var s=[n-e,r-t],l=[e-a,t-i],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),d=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-o*o);if(d<0)return[];var h=(-c+Math.sqrt(d))/(2*u),f=(-c-Math.sqrt(d))/(2*u),p=Math.min(h,f),g=Math.max(h,f),v=[];if(p>=0&&p<=1&&v.push(p),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]},yn=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},mn=function(e,t,n,r,a,i,o,s,l){var u=e-a,c=n-e,d=o-a,h=t-i,f=r-t,p=s-i,g=d*h-p*u,v=c*h-f*u,y=p*c-d*f;if(0!==y){var m=g/y,b=v/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*f]:[]}return 0===g||0===v?yn(e,n,o)===o?[o,s]:yn(e,n,a)===a?[a,i]:yn(a,o,n)===n?[n,r]:[]:[]},bn=function(e,t,n,r,a,i,o,s){var l,u,c,d,h,f,p=[],g=new Array(n.length),v=!0;if(null==i&&(v=!1),v){for(var y=0;y<g.length/2;y++)g[2*y]=n[2*y]*i+r,g[2*y+1]=n[2*y+1]*o+a;if(s>0){var m=pn(g,-s);u=fn(m)}else u=g}else u=n;for(var b=0;b<u.length/2;b++)c=u[2*b],d=u[2*b+1],b<u.length/2-1?(h=u[2*(b+1)],f=u[2*(b+1)+1]):(h=u[0],f=u[1]),0!==(l=mn(e,t,r,a,c,d,h,f)).length&&p.push(l[0],l[1]);return p},xn=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],a=Math.sqrt(r[0]*r[0]+r[1]*r[1]),i=(a-n)/a;return i<0&&(i=1e-5),[t[0]+i*r[0],t[1]+i*r[1]]},wn=function(e,t){var n=kn(e,t);return n=En(n)},En=function(e){for(var t,n,r=e.length/2,a=1/0,i=1/0,o=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],a=Math.min(a,t),o=Math.max(o,t),i=Math.min(i,n),s=Math.max(s,n);for(var u=2/(o-a),c=2/(s-i),d=0;d<r;d++)t=e[2*d]=e[2*d]*u,n=e[2*d+1]=e[2*d+1]*c,a=Math.min(a,t),o=Math.max(o,t),i=Math.min(i,n),s=Math.max(s,n);if(i<-1)for(var h=0;h<r;h++)n=e[2*h+1]=e[2*h+1]+(-1-i);return e},kn=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 a,i=new Array(2*e),o=0;o<e;o++)a=o*n+r,i[2*o]=Math.cos(a),i[2*o+1]=Math.sin(-a);return i},Tn=function(e,t){return Math.min(e/4,t/4,8)},Cn=function(e,t){return Math.min(e/10,t/10,8)},Pn=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Sn=st({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Bn={pageRank:function(e){for(var t=Sn(e),n=t.dampingFactor,r=t.precision,a=t.iterations,i=t.weight,o=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,h=u.length,f=new Array(d),p=new Array(c),g=(1-n)/c,v=0;v<c;v++){for(var y=0;y<c;y++){f[v*c+y]=0}p[v]=0}for(var m=0;m<h;m++){var b=u[m],x=b.data("source"),w=b.data("target");if(x!==w){var E=l.indexOfId(x),k=l.indexOfId(w),T=i(b);f[k*c+E]+=T,p[E]+=T}}for(var C=1/c+g,P=0;P<c;P++)if(0===p[P])for(var S=0;S<c;S++){f[S*c+P]=C}else for(var B=0;B<c;B++){var D=B*c+P;f[D]=f[D]/p[P]+g}for(var _,A=new Array(c),M=new Array(c),R=0;R<c;R++)A[R]=1;for(var I=0;I<a;I++){for(var N=0;N<c;N++)M[N]=0;for(var L=0;L<c;L++)for(var z=0;z<c;z++){var O=L*c+z;M[L]+=f[O]*A[z]}Kt(M),_=A,A=M,M=_;for(var V=0,F=0;F<c;F++){var j=_[F]-A[F];V+=j*j}if(V<r)break}return{rank:function(e){return e=o.collection(e)[0],A[l.indexOf(e)]}}}},Dn=st({root:null,weight:function(e){return 1},directed:!1,alpha:0}),_n={degreeCentralityNormalized:function(e){e=Dn(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var a={},i={},o=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var d=this.degreeCentrality(e);o<d.indegree&&(o=d.indegree),s<d.outdegree&&(s=d.outdegree),a[c]=d.indegree,i[c]=d.outdegree}return{indegree:function(e){return 0==o?0:(W(e)&&(e=t.filter(e)),a[e.id()]/o)},outdegree:function(e){return 0===s?0:(W(e)&&(e=t.filter(e)),i[e.id()]/s)}}}for(var h={},f=0,p=0;p<r;p++){var g=n[p];e.root=g;var v=this.degreeCentrality(e);f<v.degree&&(f=v.degree),h[g.id()]=v.degree}return{degree:function(e){return 0===f?0:(W(e)&&(e=t.filter(e)),h[e.id()]/f)}}},degreeCentrality:function(e){e=Dn(e);var t=this.cy(),n=this,r=e,a=r.root,i=r.weight,o=r.directed,s=r.alpha;if(a=t.collection(a)[0],o){for(var l=a.connectedEdges(),u=l.filter((function(e){return e.target().same(a)&&n.has(e)})),c=l.filter((function(e){return e.source().same(a)&&n.has(e)})),d=u.length,h=c.length,f=0,p=0,g=0;g<u.length;g++)f+=i(u[g]);for(var v=0;v<c.length;v++)p+=i(c[v]);return{indegree:Math.pow(d,1-s)*Math.pow(f,s),outdegree:Math.pow(h,1-s)*Math.pow(p,s)}}for(var y=a.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=i(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};_n.dc=_n.degreeCentrality,_n.dcn=_n.degreeCentralityNormalised=_n.degreeCentralityNormalized;var An=st({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Mn={closenessCentralityNormalized:function(e){for(var t=An(e),n=t.harmonic,r=t.weight,a=t.directed,i=this.cy(),o={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:a}),c=0;c<l.length;c++){for(var d=0,h=l[c],f=0;f<l.length;f++)if(c!==f){var p=u.distance(h,l[f]);d+=n?1/p:p}n||(d=1/d),s<d&&(s=d),o[h.id()]=d}return{closeness:function(e){return 0==s?0:(e=W(e)?i.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=An(e),n=t.root,r=t.weight,a=t.directed,i=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:a}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var d=o.distanceTo(c);s+=i?1/d:d}}return i?s:1/s}};Mn.cc=Mn.closenessCentrality,Mn.ccn=Mn.closenessCentralityNormalised=Mn.closenessCentralityNormalized;var Rn=st({weight:null,directed:!1}),In={betweennessCentrality:function(e){for(var t=Rn(e),n=t.directed,r=t.weight,a=null!=r,i=this.cy(),o=this.nodes(),s={},l={},u=0,c=function(e,t){l[e]=t,t>u&&(u=t)},d=function(e){return l[e]},h=0;h<o.length;h++){var f=o[h],p=f.id();s[p]=n?f.outgoers().nodes():f.openNeighborhood().nodes(),c(p,0)}for(var g=function(){for(var e=o[v].id(),t=[],n={},l={},u={},h=new Tt((function(e,t){return u[e]-u[t]})),f=0;f<o.length;f++){var p=o[f].id();n[p]=[],l[p]=0,u[p]=1/0}for(l[e]=1,u[e]=0,h.push(e);!h.empty();){var g=h.pop();if(t.push(g),a)for(var y=0;y<s[g].length;y++){var m=s[g][y],b=i.getElementById(g),x=void 0;x=b.edgesTo(m).length>0?b.edgesTo(m)[0]:m.edgesTo(b)[0];var w=r(x);m=m.id(),u[m]>u[g]+w&&(u[m]=u[g]+w,h.nodes.indexOf(m)<0?h.push(m):h.updateItem(m),l[m]=0,n[m]=[]),u[m]==u[g]+w&&(l[m]=l[m]+l[g],n[m].push(g))}else for(var E=0;E<s[g].length;E++){var k=s[g][E].id();u[k]==1/0&&(h.push(k),u[k]=u[g]+1),u[k]==u[g]+1&&(l[k]=l[k]+l[g],n[k].push(g))}}for(var T={},C=0;C<o.length;C++)T[o[C].id()]=0;for(;t.length>0;){for(var P=t.pop(),S=0;S<n[P].length;S++){var B=n[P][S];T[B]=T[B]+l[B]/l[P]*(1+T[P])}P!=o[v].id()&&c(P,d(P)+T[P])}},v=0;v<o.length;v++)g();var y={betweenness:function(e){var t=i.collection(e).id();return d(t)},betweennessNormalized:function(e){if(0==u)return 0;var t=i.collection(e).id();return d(t)/u}};return y.betweennessNormalised=y.betweennessNormalized,y}};In.bc=In.betweennessCentrality;var Nn=st({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Ln=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},zn=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var a=0;a<t;a++)n+=e[a*t+r];for(var i=0;i<t;i++)e[i*t+r]=e[i*t+r]/n}},On=function(e,t,n){for(var r=new Array(n*n),a=0;a<n;a++){for(var i=0;i<n;i++)r[a*n+i]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[a*n+s]+=e[a*n+o]*t[o*n+s]}return r},Vn=function(e,t,n){for(var r=e.slice(0),a=1;a<n;a++)e=On(e,r,t);return e},Fn=function(e,t,n){for(var r=new Array(t*t),a=0;a<t*t;a++)r[a]=Math.pow(e[a],n);return zn(r,t),r},jn=function(e,t,n,r){for(var a=0;a<n;a++){if(Math.round(e[a]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[a]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},Xn=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Yn=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),a=function(e){return Nn(e)}(e),i={},o=0;o<t.length;o++)i[t[o].id()]=o;for(var s,l=t.length,u=l*l,c=new Array(u),d=0;d<u;d++)c[d]=0;for(var h=0;h<n.length;h++){var f=n[h],p=i[f.source().id()],g=i[f.target().id()],v=Ln(f,a.attributes);c[p*l+g]+=v,c[g*l+p]+=v}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,l,a.multFactor),zn(c,l);for(var y=!0,m=0;y&&m<a.maxIterations;)y=!1,s=Vn(c,l,a.expandFactor),c=Fn(s,l,a.inflateFactor),jn(c,s,u,4)||(y=!0),m++;var b=function(e,t,n,r){for(var a=[],i=0;i<t;i++){for(var o=[],s=0;s<t;s++)Math.round(1e3*e[i*t+s])/1e3>0&&o.push(n[s]);0!==o.length&&a.push(r.collection(o))}return a}(c,l,t,r);return b=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Xn(e[t],e[n])&&e.splice(n,1);return e}(b),b},qn={markovClustering:Yn,mcl:Yn},Wn=function(e){return e},Kn=function(e,t){return Math.abs(t-e)},Un=function(e,t,n){return e+Kn(t,n)},Hn=function(e,t,n){return e+Math.pow(n-t,2)},Gn=function(e){return Math.sqrt(e)},Zn=function(e,t,n){return Math.max(e,Kn(t,n))},$n=function(e,t,n,r,a){for(var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Wn,o=r,s=0;s<e;s++)o=a(o,t(s),n(s));return i(o)},Qn={euclidean:function(e,t,n){return e>=2?$n(e,t,n,0,Hn,Gn):$n(e,t,n,0,Un)},squaredEuclidean:function(e,t,n){return $n(e,t,n,0,Hn)},manhattan:function(e,t,n){return $n(e,t,n,0,Un)},max:function(e,t,n){return $n(e,t,n,-1/0,Zn)}};function Jn(e,t,n,r,a,i){var o;return o=K(e)?e:Qn[e]||Qn.euclidean,0===t&&K(e)?o(a,i):o(t,n,r,a,i)}Qn["squared-euclidean"]=Qn.squaredEuclidean,Qn.squaredeuclidean=Qn.squaredEuclidean;var er=st({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),tr=function(e){return er(e)},nr=function(e,t,n,r,a){var i="kMedoids"!==a?function(e){return n[e]}:function(e){return r[e](n)},o=n,s=t;return Jn(e,r.length,i,(function(e){return r[e](t)}),o,s)},rr=function(e,t,n){for(var r=n.length,a=new Array(r),i=new Array(r),o=new Array(t),s=null,l=0;l<r;l++)a[l]=e.min(n[l]).value,i[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(i[c]-a[c])+a[c];o[u]=s}return o},ar=function(e,t,n,r,a){for(var i=1/0,o=0,s=0;s<t.length;s++){var l=nr(n,e,t[s],r,a);l<i&&(i=l,o=s)}return o},ir=function(e,t,n){for(var r=[],a=null,i=0;i<t.length;i++)n[(a=t[i]).id()]===e&&r.push(a);return r},or=function(e,t,n){return Math.abs(t-e)<=n},sr=function(e,t,n){for(var r=0;r<e.length;r++)for(var a=0;a<e[r].length;a++){if(Math.abs(e[r][a]-t[r][a])>n)return!1}return!0},lr=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},ur=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var a=e[Math.floor(Math.random()*e.length)];lr(a,n,r);)a=e[Math.floor(Math.random()*e.length)];n[r]=a}else for(var i=0;i<t;i++)n[i]=e[Math.floor(Math.random()*e.length)];return n},cr=function(e,t,n){for(var r=0,a=0;a<t.length;a++)r+=nr("manhattan",t[a],e,n,"kMedoids");return r},dr=function(e,t,n,r,a){for(var i,o,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],a.m);for(var u=0;u<e.length;u++)for(var c=0;c<a.attributes.length;c++){i=0,o=0;for(var d=0;d<t.length;d++)i+=r[d][u]*a.attributes[c](t[d]),o+=r[d][u];e[u][c]=i/o}},hr=function(e,t,n,r,a){for(var i=0;i<e.length;i++)t[i]=e[i].slice();for(var o,s,l,u=2/(a.m-1),c=0;c<n.length;c++)for(var d=0;d<r.length;d++){o=0;for(var h=0;h<n.length;h++)s=nr(a.distance,r[d],n[c],a.attributes,"cmeans"),l=nr(a.distance,r[d],n[h],a.attributes,"cmeans"),o+=Math.pow(s/l,u);e[d][c]=1/o}},fr=function(e){var t,n,r,a,i,o=this.cy(),s=this.nodes(),l=tr(e);a=new Array(s.length);for(var u=0;u<s.length;u++)a[u]=new Array(l.k);r=new Array(s.length);for(var c=0;c<s.length;c++)r[c]=new Array(l.k);for(var d=0;d<s.length;d++){for(var h=0,f=0;f<l.k;f++)r[d][f]=Math.random(),h+=r[d][f];for(var p=0;p<l.k;p++)r[d][p]=r[d][p]/h}n=new Array(l.k);for(var g=0;g<l.k;g++)n[g]=new Array(l.attributes.length);i=new Array(s.length);for(var v=0;v<s.length;v++)i[v]=new Array(l.k);for(var y=!0,m=0;y&&m<l.maxIterations;)y=!1,dr(n,s,r,i,l),hr(r,a,n,s,l),sr(r,a,l.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var a,i,o=new Array(n.k),s=0;s<o.length;s++)o[s]=[];for(var l=0;l<t.length;l++){a=-1/0,i=-1;for(var u=0;u<t[0].length;u++)t[l][u]>a&&(a=t[l][u],i=u);o[i].push(e[l])}for(var c=0;c<o.length;c++)o[c]=r.collection(o[c]);return o}(s,r,l,o),{clusters:t,degreeOfMembership:r}},pr={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),a=null,i=tr(e),o=new Array(i.k),s={};i.testMode?"number"==typeof i.testCentroids?(i.testCentroids,t=rr(r,i.k,i.attributes)):t="object"===l(i.testCentroids)?i.testCentroids:rr(r,i.k,i.attributes):t=rr(r,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<r.length;d++)s[(a=r[d