grapholscape
Version:
ontology visualization
25 lines (24 loc) • 1.44 MB
JavaScript
/**
* MIT License
*
* Copyright (c) 2018-2024 OBDA Systems
*
* 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(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function t(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function n(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 r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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,c(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=h(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function a(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(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,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||h(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 l(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||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 c(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 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},u(e)}function h(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}"function"==typeof SuppressedError&&SuppressedError;var d="undefined"==typeof window?null:window,p=d?d.navigator:null;d&&d.document;var g,f,v,y,m,b,E,w,_,x,T,C,N,A,I,O,S,L,P,R,D,M,k,F,B,G,$,V,z=u(""),U=u({}),q=u((function(){})),j="undefined"==typeof HTMLElement?"undefined":u(HTMLElement),H=function(e){return e&&e.instanceString&&X(e.instanceString)?e.instanceString():null},Y=function(e){return null!=e&&u(e)==z},X=function(e){return null!=e&&u(e)===q},W=function(e){return!K(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},Q=function(e){return null!=e&&u(e)===U&&!W(e)&&e.constructor===Object},Z=function(e){return null!=e&&u(e)===u(1)&&!isNaN(e)},J=function(e){return"undefined"===j?void 0:null!=e&&e instanceof HTMLElement},K=function(e){return ee(e)||te(e)},ee=function(e){return"collection"===H(e)&&e._private.single},te=function(e){return"collection"===H(e)&&!e._private.single},ne=function(e){return"core"===H(e)},re=function(e){return"stylesheet"===H(e)},ie=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},oe=function(e){return function(e){return null!=e&&u(e)===U}(e)&&X(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,i=arguments,o=t.apply(this,i),a=n.cache;return(r=a[o])||(r=a[o]=e.apply(this,i)),r};return n.cache={},n},se=ae((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),le=ae((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),ce=ae((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),ue=function(e){return ie(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},he="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",de="rgb[a]?\\(("+he+"[%]?)\\s*,\\s*("+he+"[%]?)\\s*,\\s*("+he+"[%]?)(?:\\s*,\\s*("+he+"))?\\)",pe="rgb[a]?\\((?:"+he+"[%]?)\\s*,\\s*(?:"+he+"[%]?)\\s*,\\s*(?:"+he+"[%]?)(?:\\s*,\\s*(?:"+he+"))?\\)",ge="hsl[a]?\\(("+he+")\\s*,\\s*("+he+"[%])\\s*,\\s*("+he+"[%])(?:\\s*,\\s*("+he+"))?\\)",fe="hsl[a]?\\((?:"+he+")\\s*,\\s*(?:"+he+"[%])\\s*,\\s*(?:"+he+"[%])(?:\\s*,\\s*(?:"+he+"))?\\)",ve=function(e,t){return e<t?-1:e>t?1:0},ye=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),o=0;o<i.length;o++){var a=i[o];e[a]=r[a]}}return e},me=function(e){return(W(e)?e:null)||function(e){return be[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,i=16;return 4===e.length?(t=parseInt(e[1]+e[1],i),n=parseInt(e[2]+e[2],i),r=parseInt(e[3]+e[3],i)):(t=parseInt(e[1]+e[2],i),n=parseInt(e[3]+e[4],i),r=parseInt(e[5]+e[6],i)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^"+de+"$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var o=n[i];if("%"===o[o.length-1]&&(r[i]=!0),o=parseFloat(o),r[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!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,i,o,a,s,l;function c(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 u=new RegExp("^"+ge+"$").exec(e);if(u){if((n=parseInt(u[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(u[2]))<0||r>100)return;if(r/=100,(i=parseFloat(u[3]))<0||i>100)return;if(i/=100,void 0!==(o=u[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;a=Math.round(255*c(d,h,n+1/3)),s=Math.round(255*c(d,h,n)),l=Math.round(255*c(d,h,n-1/3))}t=[a,s,l,o]}return t}(e)},be={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]},Ee=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(Q(o))throw Error("Tried to set map with object key");i<n.length-1?(null==t[o]&&(t[o]={}),t=t[o]):t[o]=e.value}},we=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(Q(o))throw Error("Tried to get map with object key");if(null==(t=t[o]))return t}return t},_e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Te(){if(f)return g;return f=1,g=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},g}function Ce(){if(b)return m;b=1;var e=function(){if(y)return v;y=1;var e="object"==typeof _e&&_e&&_e.Object===Object&&_e;return v=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return m=n}function Ne(){if(C)return T;C=1;var e=function(){if(x)return _;x=1;var e=/\s/;return _=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},_}(),t=/^\s+/;return T=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},T}function Ae(){if(A)return N;A=1;var e=Ce().Symbol;return N=e}function Ie(){if(R)return P;R=1;var e=Ae(),t=function(){if(O)return I;O=1;var e=Ae(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;return I=function(e){var t=n.call(e,i),o=e[i];try{e[i]=void 0;var a=!0}catch(e){}var s=r.call(e);return a&&(t?e[i]=o:delete e[i]),s}}(),n=function(){if(L)return S;L=1;var e=Object.prototype.toString;return S=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return P=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function Oe(){if(F)return k;F=1;var e=Ie(),t=M?D:(M=1,D=function(e){return null!=e&&"object"==typeof e});return k=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}var Se=function(){if(V)return $;V=1;var e=Te(),t=function(){if(w)return E;w=1;var e=Ce();return E=function(){return e.Date.now()}}(),n=function(){if(G)return B;G=1;var e=Ne(),t=Te(),n=Oe(),r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;return B=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 c=i.test(s);return c||o.test(s)?a(s.slice(2),c?2:8):r.test(s)?NaN:+s}}(),r=Math.max,i=Math.min;return $=function(o,a,s){var l,c,u,h,d,p,g=0,f=!1,v=!1,y=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function m(e){var t=l,n=c;return l=c=void 0,g=e,h=o.apply(n,t)}function b(e){var t=e-p;return void 0===p||t>=a||t<0||v&&e-g>=u}function E(){var e=t();if(b(e))return w(e);d=setTimeout(E,function(e){var t=a-(e-p);return v?i(t,u-(e-g)):t}(e))}function w(e){return d=void 0,y&&l?m(e):(l=c=void 0,h)}function _(){var e=t(),n=b(e);if(l=arguments,c=this,p=e,n){if(void 0===d)return function(e){return g=e,d=setTimeout(E,a),f?m(e):h}(p);if(v)return clearTimeout(d),d=setTimeout(E,a),m(p)}return void 0===d&&(d=setTimeout(E,a)),h}return a=n(a)||0,e(s)&&(f=!!s.leading,u=(v="maxWait"in s)?r(n(s.maxWait)||0,a):u,y="trailing"in s?!!s.trailing:y),_.cancel=function(){void 0!==d&&clearTimeout(d),g=0,l=p=c=d=void 0},_.flush=function(){return void 0===d?h:w(t())},_},$}(),Le=xe(Se),Pe=d?d.performance:null,Re=Pe&&Pe.now?function(){return Pe.now()}:function(){return Date.now()},De=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(Re())}),1e3/60)}}(),Me=function(e){return De(e)},ke=Re,Fe=9261,Be=5381,Ge=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fe;!(t=e.next()).done;)n=65599*n+t.value|0;return n},$e=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fe)+e|0},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be;return(t<<5)+t+e|0},ze=function(e){return 2097152*e[0]+e[1]},Ue=function(e,t){return[$e(e[0],t[0]),Ve(e[1],t[1])]},qe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Ge({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},je=function(){return He(arguments)},He=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?qe(r):qe(r,t)}return t},Ye=!0,Xe=null!=console.warn,We=null!=console.trace,Qe=Number.MAX_SAFE_INTEGER||9007199254740991,Ze=function(){return!0},Je=function(){return!1},Ke=function(){return 0},et=function(){},tt=function(e){throw new Error(e)},nt=function(e){if(void 0===e)return Ye;Ye=!!e},rt=function(e){nt()&&(Xe?console.warn(e):(console.log(e),We&&console.trace()))},it=function(e){return null==e?e:W(e)?e.slice():Q(e)?function(e){return ye({},e)}(e):e},ot=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},at={},st=function(){return at},lt=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var o=t[i],a=null==n?void 0:n[o];r[o]=void 0===a?e[o]:a}return r}},ct=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)},ht=function(e,t,n){return n&&(t=ce(n,t)),e[t]},dt=function(e,t,n,r){n&&(t=ce(n,t)),e[t]=r},pt="undefined"!=typeof Map?Map:function(){return i((function e(){r(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]}}])}(),gt=function(){return i((function e(t){if(r(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 i=0;i<n.length;i++)this.add(n[i])}}),[{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)}}])}(),ft="undefined"!==("undefined"==typeof Set?"undefined":u(Set))?Set:gt,vt=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&ne(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 ft,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==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];W(t.classes)?l=t.classes:Y(t.classes)&&(l=t.classes.split(/\s+/));for(var c=0,u=l.length;c<u;c++){var h=l[c];h&&""!==h&&i.classes.add(h)}this.createEmitter(),(void 0===n||n)&&this.restore();var d=t.style||t.css;d&&(rt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d))}else tt("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else tt("An element must have a core reference and parameters set")},yt=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;Q(t)&&!K(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 o,a=this._private.cy,s=t=Y(t)?this.filter(t):t,l=[],c=[],u={},h={},d={},p=0,g=this.byGroup(),f=g.nodes,v=g.edges,y=0;y<s.length;y++){var m=s[y],b=m.id();m.isNode()&&(l.unshift(m),e.bfs&&(d[b]=!0,c.push(m)),h[b]=0)}for(var E,w=function(){var t=e.bfs?l.shift():l.pop(),i=t.id();if(e.dfs){if(d[i])return 0;d[i]=!0,c.push(t)}var a,s=h[i],g=u[i],y=null!=g?g.source():null,m=null!=g?g.target():null,b=null==g?void 0:t.same(y)?m[0]:y[0];if(!0===(a=n(t,g,b,p++,s)))return o=t,1;if(!1===a)return 1;for(var E=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&v.has(e)})),w=0;w<E.length;w++){var _=E[w],x=_.connectedNodes().filter((function(e){return!e.same(t)&&f.has(e)})),T=x.id();0===x.length||d[T]||(x=x[0],l.push(x),e.bfs&&(d[T]=!0,c.push(x)),u[T]=_,h[T]=h[i]+1)}};0!==l.length&&(0===(E=w())||1!==E););for(var _=a.collection(),x=0;x<c.length;x++){var T=c[x],C=u[T.id()];null!=C&&_.push(C),_.push(T)}return{path:a.collection(_),found:a.collection(o)}}},mt={breadthFirstSearch:yt({bfs:!0}),depthFirstSearch:yt({dfs:!0})};mt.bfs=mt.breadthFirstSearch,mt.dfs=mt.depthFirstSearch;var bt,Et,wt,_t={exports:{}},xt=_t.exports;function Tt(){return bt||(bt=1,e=_t,function(){var t,n,r,i,o,a,s,l,c,u,h,d,p,g,f;r=Math.floor,u=Math.min,n=function(e,t){return e<t?-1:e>t?1:0},c=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);i<o;)a(t,e[s=r((i+o)/2)])<0?o=s:i=s+1;return[].splice.apply(e,[i,i-i].concat(t)),t},a=function(e,t,r){return null==r&&(r=n),e.push(t),g(e,0,e.length-1,r)},o=function(e,t){var r,i;return null==t&&(t=n),r=e.pop(),e.length?(i=e[0],e[0]=r,f(e,0,t)):i=r,i},l=function(e,t,r){var i;return null==r&&(r=n),i=e[0],e[0]=t,f(e,0,r),i},s=function(e,t,r){var i;return null==r&&(r=n),e.length&&r(e[0],t)<0&&(t=(i=[e[0],t])[0],e[0]=i[1],f(e,0,r)),t},i=function(e,t){var i,o,a,s,l,c;for(null==t&&(t=n),l=[],o=0,a=(s=function(){c=[];for(var t=0,n=r(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)c.push(t);return c}.apply(this).reverse()).length;o<a;o++)i=s[o],l.push(f(e,i,t));return l},p=function(e,t,r){var i;if(null==r&&(r=n),-1!==(i=e.indexOf(t)))return g(e,0,i,r),f(e,i,r)},h=function(e,t,r){var o,a,l,c,u;if(null==r&&(r=n),!(a=e.slice(0,t)).length)return a;for(i(a,r),l=0,c=(u=e.slice(t)).length;l<c;l++)o=u[l],s(a,o,r);return a.sort(r).reverse()},d=function(e,t,r){var a,s,l,h,d,p,g,f,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],h=0,p=(g=e.slice(t)).length;h<p;h++)r(a=g[h],s)<0&&(c(l,a,0,null,r),l.pop(),s=l[l.length-1]);return l}for(i(e,r),v=[],d=0,f=u(t,e.length);0<=f?d<f:d>f;0<=f?++d:--d)v.push(o(e,r));return v},g=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},f=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i<o;)(s=i+1)<o&&!(r(e[i],e[s])<0)&&(i=s),e[t]=e[i],i=2*(t=i)+1;return e[t]=a,g(e,l,t,r)},t=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=a,e.pop=o,e.replace=l,e.pushpop=s,e.heapify=i,e.updateItem=p,e.nlargest=h,e.nsmallest=d,e.prototype.push=function(e){return a(this.nodes,e,this.cmp)},e.prototype.pop=function(){return o(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 i(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return p(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(xt)),_t.exports;var e}var Ct=xe(wt?Et:(wt=1,Et=Tt())),Nt=lt({root:null,weight:function(e){return 1},directed:!1}),At={dijkstra:function(e){if(!Q(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Nt(e),r=n.root,i=n.weight,o=n.directed,a=this,s=i,l=Y(r)?this.filter(r)[0]:r[0],c={},u={},h={},d=this.byGroup(),p=d.nodes,g=d.edges;g.unmergeBy((function(e){return e.isLoop()}));for(var f=function(e){return c[e.id()]},v=function(e,t){c[e.id()]=t,y.updateItem(e)},y=new Ct((function(e,t){return f(e)-f(t)})),m=0;m<p.length;m++){var b=p[m];c[b.id()]=b.same(l)?0:1/0,y.push(b)}for(var E=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 l=r[a],c=s(l);(c<i||!n)&&(i=c,n=l)}return{edge:n,dist:i}};y.size()>0;){var w=y.pop(),_=f(w),x=w.id();if(h[x]=_,_!==1/0)for(var T=w.neighborhood().intersect(p),C=0;C<T.length;C++){var N=T[C],A=N.id(),I=E(w,N),O=_+I.dist;O<f(N)&&(v(N,O),u[A]={node:w,edge:I.edge})}}return{distanceTo:function(e){var t=Y(e)?p.filter(e)[0]:e[0];return h[t.id()]},pathTo:function(e){var t=Y(e)?p.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);u[i];){var o=u[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},It={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t<o.length;t++){if(o[t].has(e))return t}},l=0;l<i;l++)o[l]=this.spawn(n[l]);for(var c=r.sort((function(t,n){return e(t)-e(n)})),u=0;u<c.length;u++){var h=c[u],d=h.source()[0],p=h.target()[0],g=s(d),f=s(p),v=o[g],y=o[f];g!==f&&(a.merge(h),v.merge(y),o.splice(f,1))}return a}},Ot=lt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),St={aStar:function(e){var t=this.cy(),n=Ot(e),r=n.root,i=n.goal,o=n.heuristic,a=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,c,u=r.id(),h=i.id(),d={},p={},g={},f=new Ct((function(e,t){return p[e.id()]-p[t.id()]})),v=new ft,y={},m={},b=function(e,t){f.push(e),v.add(t)};b(r,u),d[u]=0,p[u]=o(r);for(var E,w=0;f.size()>0;){if(l=f.pop(),c=l.id(),v.delete(c),w++,c===h){for(var _=[],x=i,T=h,C=m[T];_.unshift(x),null!=C&&_.unshift(C),null!=(x=y[T]);)C=m[T=x.id()];return{found:!0,distance:d[c],path:this.spawn(_),steps:w}}g[c]=!0;for(var N=l._private.edges,A=0;A<N.length;A++){var I=N[A];if(this.hasElementWithId(I.id())&&(!a||I.data("source")===c)){var O=I.source(),S=I.target(),L=O.id()!==c?O:S,P=L.id();if(this.hasElementWithId(P)&&!g[P]){var R=d[c]+s(I);E=P,v.has(E)?R<d[P]&&(d[P]=R,p[P]=R+o(L),y[P]=l,m[P]=I):(d[P]=R,p[P]=R+o(L),b(L,P),y[P]=l,m[P]=I)}}}}return{found:!1,distance:void 0,path:void 0,steps:w}}},Lt=lt({weight:function(e){return 1},directed:!1}),Pt={floydWarshall:function(e){for(var t=this.cy(),n=Lt(e),r=n.weight,i=n.directed,o=r,a=this.byGroup(),s=a.nodes,l=a.edges,c=s.length,u=c*c,h=function(e){return s.indexOf(e)},d=function(e){return s[e]},p=new Array(u),g=0;g<u;g++){var f=g%c,v=(g-f)/c;p[g]=v===f?0:1/0}for(var y=new Array(u),m=new Array(u),b=0;b<l.length;b++){var E=l[b],w=E.source()[0],_=E.target()[0];if(w!==_){var x=h(w),T=h(_),C=x*c+T,N=o(E);if(p[C]>N&&(p[C]=N,y[C]=T,m[C]=E),!i){var A=T*c+x;!i&&p[A]>N&&(p[A]=N,y[A]=x,m[A]=E)}}}for(var I=0;I<c;I++)for(var O=0;O<c;O++)for(var S=O*c+I,L=0;L<c;L++){var P=O*c+L,R=I*c+L;p[S]+p[R]<p[P]&&(p[P]=p[S]+p[R],y[P]=y[S])}var D=function(e){return h(function(e){return(Y(e)?t.filter(e):e)[0]}(e))},M={distance:function(e,t){var n=D(e),r=D(t);return p[n*c+r]},path:function(e,n){var r=D(e),i=D(n),o=d(r);if(r===i)return o.collection();if(null==y[r*c+i])return t.collection();var a,s=t.collection(),l=r;for(s.merge(o);r!==i;)l=r,r=y[r*c+i],a=m[l*c+r],s.merge(a),s.merge(d(r));return s}};return M}},Rt=lt({weight:function(e){return 1},directed:!1,root:null}),Dt={bellmanFord:function(e){var t=this,n=Rt(e),r=n.weight,i=n.directed,o=n.root,a=r,s=this,l=this.cy(),c=this.byGroup(),u=c.edges,h=c.nodes,d=h.length,p=new pt,g=!1,f=[];o=l.collection(o)[0],u.unmergeBy((function(e){return e.isLoop()}));for(var v=u.length,y=function(e){var t=p.get(e.id());return t||(t={},p.set(e.id(),t)),t},m=function(e){return(Y(e)?l.$(e):e)[0]},b=0;b<d;b++){var E=h[b],w=y(E);E.same(o)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var _=!1,x=function(e,t,n,r,i,o){var a=r.dist+o;a<i.dist&&!n.same(r.edge)&&(i.dist=a,i.pred=e,i.edge=n,_=!0)},T=1;T<d;T++){_=!1;for(var C=0;C<v;C++){var N=u[C],A=N.source(),I=N.target(),O=a(N),S=y(A),L=y(I);x(A,0,N,S,L,O),i||x(I,0,N,L,S,O)}if(!_)break}if(_)for(var P=[],R=0;R<v;R++){var D=u[R],M=D.source(),k=D.target(),F=a(D),B=y(M).dist,G=y(k).dist;if(B+F<G||!i&&G+F<B){if(g||(rt("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),!1===e.findNegativeWeightCycles)break;var $=[];B+F<G&&$.push(M),!i&&G+F<B&&$.push(k);for(var V=$.length,z=0;z<V;z++){var U=$[z],q=[U];q.push(y(U).edge);for(var j=y(U).pred;-1===q.indexOf(j);)q.push(j),q.push(y(j).edge),j=y(j).pred;for(var H=(q=q.slice(q.indexOf(j)))[0].id(),X=0,W=2;W<q.length;W+=2)q[W].id()<H&&(H=q[W].id(),X=W);(q=q.slice(X).concat(q.slice(0,X))).push(q[0]);var Q=q.map((function(e){return e.id()})).join(",");-1===P.indexOf(Q)&&(f.push(s.spawn(q)),P.push(Q))}}}return{distanceTo:function(e){return y(m(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,c=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=c}return s.spawn(r)},hasNegativeWeightCycle:g,negativeWeightCycles:f}}},Mt=Math.sqrt(2),kt=function(e,t,n){0===n.length&&tt("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,c=l.length-1;c>=0;c--){var u=l[c],h=u[1],d=u[2];(t[h]===a&&t[d]===s||t[h]===s&&t[d]===a)&&l.splice(c,1)}for(var p=0;p<l.length;p++){var g=l[p];g[1]===s?(l[p]=g.slice(),l[p][1]=a):g[2]===s&&(l[p]=g.slice(),l[p][2]=a)}for(var f=0;f<t.length;f++)t[f]===s&&(t[f]=a);return l},Ft=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=kt(i,e,t),n--}return t},Bt={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,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/Mt);if(!(i<2)){for(var l=[],c=0;c<o;c++){var u=r[c];l.push([c,n.indexOf(u.source()),n.indexOf(u.target())])}for(var h=1/0,d=[],p=new Array(i),g=new Array(i),f=new Array(i),v=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=a;y++){for(var m=0;m<i;m++)g[m]=m;var b=Ft(g,l.slice(),i,s),E=b.slice();v(g,f);var w=Ft(g,b,s,2),_=Ft(f,E,s,2);w.length<=_.length&&w.length<h?(h=w.length,d=w,v(g,p)):_.length<=w.length&&_.length<h&&(h=_.length,d=_,v(f,p))}for(var x=this.spawn(d.map((function(e){return r[e[0]]}))),T=this.spawn(),C=this.spawn(),N=p[0],A=0;A<p.length;A++){var I=p[A],O=n[A];I===N?T.merge(O):C.merge(O)}var S=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!x.contains(t)&&n.merge(t)}))})),n},L=[S(T),S(C)];return{cut:x,components:L,partition1:T,partition2:C}}tt("At least 2 nodes are required for Karger-Stein algorithm")}},Gt=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},$t=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Vt=function(e){return{x:e[0],y:e[1]}},zt=function(e,t){return Math.atan2(t,e)-Math.PI/2},Ut=Math.log2||function(e){return Math.log(e)/Math.log(2)},qt=function(e){return e>0?1:e<0?-1:0},jt=function(e,t){return Math.sqrt(Ht(e,t))},Ht=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Yt=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},Xt=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Wt=function(e,t,n,r){return{x:Xt(e.x,t.x,n.x,r),y:Xt(e.y,t.y,n.y,r)}},Qt=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}}},Jt=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},Kt=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},en=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},tn=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=s(o,4);t=a[0],n=a[1],r=a[2],i=a[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},nn=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},rn=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)))))))},on=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},an=function(e,t){return on(e,t.x1,t.y1)&&on(e,t.x2,t.y2)},sn=function(e,t,n,r,i,o,a){var s,l,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",u="auto"===c?Cn(i,o):c,h=i/2,d=o/2,p=(u=Math.min(u,h,d))!==h,g=u!==d;if(p){var f=r-d-a;if((s=bn(e,t,n,r,n-h+u-a,f,n+h-u+a,f,!1)).length>0)return s}if(g){var v=n+h+a;if((s=bn(e,t,n,r,v,r-d+u-a,v,r+d-u+a,!1)).length>0)return s}if(p){var y=r+d+a;if((s=bn(e,t,n,r,n-h+u-a,y,n+h-u+a,y,!1)).length>0)return s}if(g){var m=n-h-a;if((s=bn(e,t,n,r,m,r-d+u-a,m,r+d-u+a,!1)).length>0)return s}var b=n-h+u,E=r-d+u;if((l=yn(e,t,n,r,b,E,u+a)).length>0&&l[0]<=b&&l[1]<=E)return[l[0],l[1]];var w=n+h-u,_=r-d+u;if((l=yn(e,t,n,r,w,_,u+a)).length>0&&l[0]>=w&&l[1]<=_)return[l[0],l[1]];var x=n+h-u,T=r+d-u;if((l=yn(e,t,n,r,x,T,u+a)).length>0&&l[0]>=x&&l[1]>=T)return[l[0],l[1]];var C=n-h+u,N=r+d-u;return(l=yn(e,t,n,r,C,N,u+a)).length>0&&l[0]<=C&&l[1]>=N?[l[0],l[1]]:[]},ln=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),c=Math.max(n,i),u=Math.min(r,o),h=Math.max(r,o);return l-s<=e&&e<=c+s&&u-s<=t&&t<=h+s},cn=function(e,t,n,r,i,o,a,s,l){var c=Math.min(n,a,i)-l,u=Math.max(n,a,i)+l,h=Math.min(r,s,o)-l,d=Math.max(r,s,o)+l;return!(e<c||e>u||t<h||t>d)},un=function(e,t,n,r,i,o,a,s){var l=[];!function(e,t,n,r,i){var o,a,s,l,c,u,h,d;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),o=(a=(3*n-t*t)/9)*a*a+(s/=54)*s,i[1]=0,h=t/3,o>0?(c=(c=s+Math.sqrt(o))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),u=(u=s-Math.sqrt(o))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-h+c+u,h+=(c+u)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-u+c)/2,i[3]=h,i[5]=-h):(i[5]=i[3]=0,0===o?(d=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*d-h,i[4]=i[2]=-(d+h)):(l=(a=-a)*a*a,l=Math.acos(s/Math.sqrt(l)),d=2*Math.sqrt(a),i[0]=-h+d*Math.cos(l/3),i[2]=-h+d*Math.cos((l+2*Math.PI)/3),i[4]=-h+d*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s,9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,l);for(var c=[],u=0;u<6;u+=2)Math.abs(l[u+1])<1e-7&&l[u]>=0&&l[u]<=1&&c.push(l[u]);c.push(1),c.push(0);for(var h,d,p,g=-1,f=0;f<c.length;f++)h=Math.pow(1-c[f],2)*n+2*(1-c[f])*c[f]*i+c[f]*c[f]*a,d=Math.pow(1-c[f],2)*r+2*(1-c[f])*c[f]*o+c[f]*c[f]*s,p=Math.pow(h-e,2)+Math.pow(d-t,2),g>=0?p<g&&(g=p):g=p;return g},hn=function(e,t,n,r,i,o){var a=[e-n,t-r],s=[i-n,o-r],l=s[0]*s[0]+s[1]*s[1],c=a[0]*a[0]+a[1]*a[1],u=a[0]*s[0]+a[1]*s[1],h=u*u/l;return u<0?c:h>l?(e-i)*(e-i)+(t-o)*(t-o):c-h},dn=function(e,t,n){for(var r,i,o,a,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(o=n[2*(l+1)],a=n[2*(l+1)+1]):(o=n[2*(l+1-n.length/2)],a=n[2*(l+1-n.length/2)+1]),r==e&&o==e);else{if(!(r>=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},pn=function(e,t,n,r,i,o,a,s,l){var c,u=new Array(n.length);null!=s[0]?(c=Math.atan(s[1]/s[0]),s[0]<0?c+=Math.PI/2:c=-c-Math.PI/2):c=s;for(var h,d=Math.cos(-c),p=Math.sin(-c),g=0;g<u.length/2;g++)u[2*g]=o/2*(n[2*g]*d-n[2*g+1]*p),u[2*g+1]=a/2*(n[2*g+1]*d+n[2*g]*p),u[2*g]+=r,u[2*g+1]+=i;if(l>0){var f=fn(u,-l);h=gn(f)}else h=u;return dn(e,t,h)},gn=function(e){for(var t,n,r,i,o,a,s,l,c=new Array(e.length/2),u=0;u<e.length/4;u++){t=e[4*u],n=e[4*u+1],r=e[4*u+2],i=e[4*u+3],u<e.length/4-1?(o=e[4*(u+1)],a=e[4*(u+1)+1],s=e[4*(u+1)+2],l=e[4*(u+1)+3]):(o=e[0],a=e[1],s=e[2],l=e[3]);var h=bn(t,n,r,i,o,a,s,l,!0);c[2*u]=h[0],c[2*u+1]=h[1]}return c},fn=function(e,t){for(var n,r,i,o,a=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)],o=e[2*(s+1)+1]):(i=e[0],o=e[1]);var l=o-r,c=-(i-n),u=Math.sqrt(l*l+c*c),h=l/u,d=c/u;a[4*s]=n+h*t,a[4*s+1]=r+d*t,a[4*s+2]=i+h*t,a[4*s+3]=o+d*t}return a},vn=function(e,t,n,r,i,o,a){return e-=i,t-=o,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},yn=function(e,t,n,r,i,o,a){var s=[n-e,r-t],l=[e-i,t-o],c=s[0]*s[0]+s[1]*s[1],u=2*(l[0]*s[0]+l[1]*s[1]),h=u*u-4*c*(l[0]*l[0]+l[1]*l[1]-a*a);if(h<0)return[];var d=(-u+Math.sqrt(h))/(2*c),p=(-u-Math.sqrt(h))/(2*c),g=Math.min(d,p),f=Math.max(d,p),v=[];if(g>=0&&g<=1&&v.push(g),f>=0&&f<=1&&v.push(f),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]},mn=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},bn=function(e,t,n,r,i,o,a,s,l){var c=e-i,u=n-e,h=a-i,d=t-o,p=r-t,g=s-o,f=h*d-g*c,v=u*d-p*c,y=g*u-h*p;if(0!==y){var m=f/y,b=v/y,E=-.001;return E<=m&&m<=1.001&&E<=b&&b<=1.001||l?[e+m*u,t+m*p]:[]}return 0===f||0===v?mn(e,n,a)===a?[a,s]:mn(e,n,i)===i?[i,o]:mn(i,a,n)===n?[n,r]:[]:[]},En=function(e,t,n,r,i,o,a,s){var l,c,u,h,d,p,g=[],f=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y<f.length/2;y++)f[2*y]=n[2*y]*o+r,f[2*y+1]=n[2*y+1]*a+i;if(s>0){var m=fn(f,-s);c=gn(m)}else c=f}else c=n;for(var b=0;b<c.length/2;b++)u=c[2*b],h=c[2*b+1],b<c.length/2-1?(d=c[2*(b+1)],p=c[2*(b+1)+1]):(d=c[0],p=c[1]),0!==(l=bn(e,t,r,i,u,h,d,p)).length&&g.push(l[0],l[1]);return g},wn=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]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*r[0],t[1]+o*r[1]]},_n=function(e,t){var n=Tn(e,t);return n=xn(n)},xn=function(e){for(var t,n,r=e.length/2,i=1/0,o=1/0,a=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);for(var c=2/(a-i),u=2/(s-o),h=0;h<r;h++)t=e[2*h]=e[2*h]*c,n=e[2*h+1]=e[2*h+1]*u,i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);if(o<-1)for(var d=0;d<r;d++)n=e[2*d+1]=e[2*d+1]+(-1-o);return e},Tn=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,o=new Array(2*e),a=0;a<e;a++)i=a*n+r,o[2*a]=Math.cos(i),o[2*a+1]=Math.sin(-i);return o},Cn=function(e,t){return Math.min(e/4,t/4,8)},Nn=function(e,t){return Math.min(e/10,t/10,8)},An=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},In=lt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),On={pageRank:function(e){for(var t=In(e),n=t.dampingFactor,r=t.precision,i=t.iterations,o=t.weight,a=this._private.cy,s=this.byGroup(),l=s.nodes,c=s.edges,u=l.length,h=u*u,d=c.length,p=new Array(h),g=new Array(u),f=(1-n)/u,v=0;v<u;v++){for(var y=0;y<u;y++){p[v*u+y]=0}g[v]=0}for(var m=0;m<d;m++){var b=c[m],E=b.data("source"),w=b.data("target");if(E!==w){var _=l.indexOfId(E),x=l.indexOfId(w),T=o(b);p[x*u+_]+=T,g[_]+=T}}for(var C=1/u+f,N=0;N<u;N++)if(0===g[N])for(var A=0;A<u;A++){p[A*u+N]=C}else for(var I=0;I<u;I++){var O=I*u+N;p[O]=p[O]/g[N]+f}for(var S,L=new Array(u),P=new Array(u),R=0;R<u;R++)L[R]=1;for(var D=0;D<i;D++){for(var M=0;M<u;M++)P[M]=0;for(var k=0;k<u;k++)for(var F=0;F<u;F++){var B=k*u+F;P[k]+=p[B]*L[F]}Yt(P),S=L,L=P,P=S;for(var G=0,$=0;$<u;$++){var V=S[$]-L[$];G+=V*V}if(G<r)break}return{rank:function(e){return e=a.collection(e)[0],L[l.indexOf(e)]}}}},Sn=lt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ln={degreeCentralityNormalized:function(e){e=Sn(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},o={},a=0,s=0,l=0;l<r;l++){var c=n[l],u=c.id();e.root=c;var h=this.degreeCentrality(e);a<h.indegree&&(a=h.indegree),s<h.outdegree&&(s=h.outdegree),i[u]=h.indegree,o[u]=h.outdegree}return{indegree:function(e){return 0==a?0:(Y(e)&&(e=t.filter(e)),i[e.id()]/a)},outdegree:function(e){return 0===s?0:(Y(e)&&(e=t.filter(e)),o[e.id()]/s)}}}for(var d={},p=0,g=0;g<r;g++){var f=n[g];e.root=f;var v=this.degreeCentrality(e);p<v.degree&&(p=v.degree),d[f.id()]=v.degree}return{degree:function(e){return 0===p?0:(Y(e)&&(e=t.filter(e)),d[e.id()]/p)}}},degreeCentrality:function(e){e=Sn(e);var t=this.cy(),n=this,r=e,i=r.root,o=r.weight,a=r.directed,s=r.alpha;if(i=t.collection(i)[0],a){for(var l=i.connectedEdges(),c=l.filter((function(e){return e.target().same(i)&&n.has(e)})),u=l.filter((function(e){return e.source().same(i)&&n.has(e)})),h=c.length,d=u.length,p=0,g=0,f=0;f<c.length;f++)p+=o(c[f]);for(var v=0;v<u.length;v++)g+=o(u[v]);return{indegree:Math.pow(h,1-s)*Math.pow(p,s),outdegree:Math.pow(d,1-s)*Math.pow(g,s)}}for(var y=i.connectedEdges().intersection(n),m=y.length,b=0,E=0;E<y.length;E++)b+=o(y[E]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};Ln.dc=Ln.degreeCentrality,Ln.dcn=Ln.degreeCentralityNormalised=Ln.degreeCentralityNormalized;var Pn=lt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Rn={closenessCentralityNormalized:function(e){for(var t=Pn(e),n=t.harmonic,r=t.weight,i=t.directed,o=this.cy(),a={},s=0,l=this.nodes(),c=this.floydWarshall({weight:r,directed:i}),u=0;u<l.length;u++){for(var h=0,d=l[u],p=0;p<l.length;p++)if(u!==p){var g=c.distance(d,l[p]);h+=n?1/g:g}n||(h=1/h),s<h&&(s=h),a[d.id()]=h}return{closeness:function(e){return 0==s?0:(e=Y(e)?o.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=Pn(e),n=t.root,r=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var a=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),c=0;c<l.length;c++){var u=l[c];if(!u.same(n)){var h=a.distanceTo(u);s+=o?1/h:h}}return o?s:1/s}};Rn.cc=Rn.closenessCentrality,Rn.ccn=Rn.closenessCentralityNormalised=Rn.closenessCentralityNormalized;var Dn=lt({weight:null,directed:!1}),Mn={betweennessCentrality:function(e){for(var t=Dn(e),n=t.directed,r=t.weight,i=null!=r,o=this.cy(),a=this.nodes(),s={},l={},c=0,u=function(e,t){l[e]=t,t>c&&(c=t)},h=function(e){return l[e]},d=0;d<a.length;d++){var p=a[d],g=p.id();s[g]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),u(g,0)}for(var f=function(){for(var e=a[v].id(),t=[],n={},l={},c={},d=new Ct((function(e,t){return c[e]-c[t]})),p=0;p<a.length;p++){var g=a[p].id();n[g]=[],l[g]=0,c[g]=1/0}for(l[e]=1,c[e]=0,d.push(e);!d.empty();){var f=d.pop();if(t.push(f),i)for(var y=0;y<s[f].length;y++){var m=s[f][y],b=o.getElementById(f),E=void 0;E=b.edgesTo(m).length>0?b.edgesTo(m)[0]:m.edgesTo(b)[0];var w=r(E);m=m.id(),c[m]>c[f]+w&&(c[m]=c[f]+w,d.nodes.indexOf(m)<0?d.push(m):d.updateItem(m),l[m]=0,n[m]=[]),c[m]==c[f]+w&&(l[m]=l[m]+l[f],n[m].push(f))}else for(var _=0;_<s[f].length;_++){var x=s[f][_].id();c[x]==1/0&&(d.push(x),c[x]=c[f]+1),c[x]==c[f]+1&&(l[x]=l[x]+l[f],n[x].push(f))}}for(var T={},C=0;C<a.length;C++)T[a[C].id()]=0;for(;t.length>0;){for(var N=t.pop(),A=0;A<n[N].length;A++){var I=n[N][A];T[I]=T[I]+l[I]/l[N]*(1+T[N])}N!=a[v].id()&&u(N,h(N)+T[N])}},v=0;v<a.length;v++)f();var y={betweenness:function(e){var t=o.collection(e).id();return h(t)},betweennessNormalized:function(e){if(0==c)return 0;var t=o.collection(e).id();return h(t)/c}};return y.betweennessNormalised=y.betweennessNormalized,y}};Mn.bc=Mn.betweennessCentrality;var kn=lt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Fn=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Bn=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 o=0;o<t;o++)e[o*t+r]=e[o*t+r]/n}},Gn=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)r[i*n+o]=0;for(var a=0;a<n;a++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+a]*t[a*n+s]}return r},$n=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Gn(e,r,t);return e},Vn=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 Bn(r,t),r},zn=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},Un=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},qn=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return kn(e)}(e),o={},a=0;a<t.length;a++)o[t[a].id()]=a;for(var s,l=t.length,c=l*l,u=new Array(c),h=0;h<c;h++)u[h]=0;for(var d=0;d<n.length;d++){var p=n[d],g=o[p.source().id()],f=o[p.target().id()],v=Fn(p,i.attributes);u[g*l+f]+=v,u[f*l+g]+=v}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(u,l,i.multFactor),Bn(u,l);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=$n(u,l,i.expandFactor),u=Vn(s,l,i.inflateFactor),zn(u,s,c,4)||(y=!0),m++;var b=function(e,t,n,r){for(var i=[],o=0;o<t;o++){for(var a=[],s=0;s<t;s++)Math.round(1e3*e[o*t+s])/1e3>0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(u,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&&Un(e[t],e[n])&&e.splice(n,1);return e}(b),b},jn={markovClustering:qn,mcl:qn},Hn=function(e){return e},Yn=function(e,t){return Math.abs(t-e)},Xn=function(e,t,n){return e+Yn(t,n)},Wn=function(e,t,n){return e+Math.pow(n-t,2)},Qn=function(e){return Math.sqrt(e)},Zn=function(e,t,n){return Math.max(e,Yn(t,n))},Jn=function(e,t,n,r,i){for(var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Hn,a=r,s=0;s<e;s++)a=i(a,t(s),n(s));return o(a)},Kn={euclidean:function(e,t,n){return e>=2?Jn(e,t,n,0,Wn,Qn):Jn(e,t,n,0,Xn)},squaredEuclidean:function(e,t,n){return Jn(e,t,n,0,Wn)},manhattan:function(e,t,n){return Jn(e,t,n,0,Xn)},max:function(e,t,n){return Jn(e,t,n,-1/0,Zn)}};function er(e,t,n,r,i,o){var a;return a=X(e)?e:Kn[e]||Kn.euclidean,0===t&&X(e)?a(i,o):a(t,n,r,i,o)}Kn["squared-euclidean"]=Kn.squaredEuclidean,Kn.squaredeuclidean=Kn.squaredEuclidean;var tr=lt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),nr=function(e){return tr(e)},rr=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return er(e,r.length,o,(function(e){return r[e](t)}),a,s)},ir=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,o[l]=e.max(n[l]).value;for(var c=0;c<t;c++){s=[];for(var u=0;u<r;u++)s[u]=Math.random()*(o[u]-i[u])+i[u];a[c]=s}return a},or=function(e,t,n,r,i){for(var o=1/0,a=0,s=0;s<t.length;s++){var l=rr(n,e,t[s],r,i);l<o&&(o=l,a=s)}return a},ar=function(e,t,n){for(var r=[],i=null,o=0;o<t.length;o++)n[(i=t[o]).id()]===e&&r.push(i);return r},sr=function(e,t,n){return Math.abs(t-e)<=n},lr=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},cr=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 i=e[Math.floor(Math.random()*e.length)];cr(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},hr=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=rr("manhattan",t[i],e,n,"kMedoids");return r},dr=function(e,t,n,r,i){for(var o,a,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],i.m);for(var c=0;c<e.length;c++)for(var u=0;u<i.attributes.length;u++){o=0,a=0;for(var h=0;h<t.length;h++)o+=r[h][c]*i.attributes[u](t[h]),a+=r[h][c];e[c][u]=o/a}},pr=function(e,t,n,r,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var a,s,l,c=2/(i.m-1),u=0;u<n.length;u++)for(var h=0;h<r.length;h++){a=0;for(var d=0;d<n.length;d++)s=rr(i.distance,r[h],n[u],i.attributes,"cmeans"),l=rr(i.distance,r[h],n[d],i.attributes,"cmeans"),a+=Math.pow(s/l,c);e[h][u]=1/a}},gr=function(e){var t,n,r,i,o,a=this.cy(),s=this.nodes(),l=nr(e);i=new Array(s.length);for(var c=0;c<s.length;c++)i[c]=new Array(l.k);r=new Array(s.length);for(var u=0;u<s.length;u++)r[u]=new Array(l.k);for(var h=0;h<s.length;h++){for(var d=0,p=0;p<l.k;p++)r[h][p]=Math.random(),d+=r[h][p];for(var g=0;g<l.k;g++)r[h][g]=r[h][g]/d}n=new Array(l.k);for(var f=0;f<l.k;f++)n[f]=new Array(l.attributes.length);o=new Array(s.length);for(var v=0;v<s.length;v++)o[v]=new Array(l.k);for(var y=!0,m=0;y&&m<l.maxIterations;)y=!1,dr(n,s,r,o,l),pr(r,i,n,s,l),lr(r,i,l.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var i,o,a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var l=0;l<t.length;l++){i=-1/0,o=-1;for(var c=0;c<t[0].length;c++)t[l][c]>i&&(i=t[l][c],o=c);a[o].push(e[l])}for(var u=0;u<a.length;u++)a[u]=r.collection(a[u]);return a}(s,r,l,a),{clusters:t,degreeOfMembership:r}},fr={kMeans:function(e){var t,n=this.cy()