@reventlessdev/reventless-host-shell 3.0.0-alpha.92 → 3.0.0-alpha.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{n as _,b as e,m as r,L as t,I as l,e as s,g as a,q as o,$ as n,x as m,O as i}from"./index-BDNTR5TK.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-Dep87C4a.js";import"./preload-helper-BhLMWRjL.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-DysgZ6xd.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-DWrxCvCs.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-BBGkOHMQ.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CkYd2Guw.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-BS-h5UZc.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-B8MMWKQv.js";let h="query Geocode($text: String!) {\n geocode(text: $text) {\n label\n lat\n lng\n }\n}";function f(s){return _(l(s),l=>{let s=_(e(l,"label"),r),a=_(e(l,"lat"),t),o=_(e(l,"lng"),t);if(void 0!==s&&void 0!==a&&void 0!==o)return{label:s,lat:a,lng:o}})}function d(r){return s(a(_(_(l(r),_=>e(_,"geocode")),o),[]),f)}function v(){return{search:_=>{let e=i.contents;return void 0!==e?n(e(h,m([["text",_]])).then(d),_=>Promise.resolve([])):Promise.resolve([])}}}export{f as decodeResult,d as decodeResults,v as fromShell,h as geocodeQuery};
1
+ import{n as _,b as e,m as r,L as t,I as l,e as s,g as a,q as o,$ as n,x as m,O as i}from"./index-DwXbA4il.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-Dep87C4a.js";import"./preload-helper-BhLMWRjL.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-DysgZ6xd.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-DWrxCvCs.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-BBGkOHMQ.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CkYd2Guw.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-BS-h5UZc.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-B8MMWKQv.js";let h="query Geocode($text: String!) {\n geocode(text: $text) {\n label\n lat\n lng\n }\n}";function f(s){return _(l(s),l=>{let s=_(e(l,"label"),r),a=_(e(l,"lat"),t),o=_(e(l,"lng"),t);if(void 0!==s&&void 0!==a&&void 0!==o)return{label:s,lat:a,lng:o}})}function d(r){return s(a(_(_(l(r),_=>e(_,"geocode")),o),[]),f)}function v(){return{search:_=>{let e=i.contents;return void 0!==e?n(e(h,m([["text",_]])).then(d),_=>Promise.resolve([])):Promise.resolve([])}}}export{f as decodeResult,d as decodeResults,v as fromShell,h as geocodeQuery};
@@ -1 +1 @@
1
- import{p as _,o as e,w as r,f as t,r as a}from"./index-BDNTR5TK.js";import{_ as s,a as o}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CkYd2Guw.js";import{b as l,m as n,g as i}from"./GraphView.res-BfT6Y2Fq.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-Dep87C4a.js";import"./preload-helper-BhLMWRjL.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-DysgZ6xd.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-DWrxCvCs.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-BBGkOHMQ.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-BS-h5UZc.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-B8MMWKQv.js";let m="dagre",d={contents:m},h=o("span",{children:"◈","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});function f(t){let a=t.source,i=_(a),m=l(a);return s("div",{children:[o(n,{nodes:m.nodes,edges:m.edges,onOpenNode:_=>e(a,i,_),layout:d.contents}),o("span",{children:r([a],void 0,"row"),style:{fontSize:"11px",opacity:"0.7"}})],style:{display:"flex",flexDirection:"column",gap:"8px"}})}let p={make:f};function c(_,e){t(_,_=>{d.contents=_}),a({id:"graph",label:"Graph",icon:h,arity:"Single",isCapable:(_,e,r)=>i(_,r.registry,r.ownEntity),render:_=>{let e=_[0];return void 0!==e?o(f,{source:e}):null},capability:"entity-ref fields — one or more *Id/*Ids foreign keys drawn as a node-link diagram (a field pointing at other rows of the same view forms a tree; a field that is the view's own key restated is not a reference the mode draws)"})}export{p as ModeView,m as defaultLayout,h as graphIcon,c as init,d as layoutRef};
1
+ import{p as _,o as e,w as r,f as t,r as a}from"./index-DwXbA4il.js";import{_ as s,a as o}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CkYd2Guw.js";import{b as l,m as n,g as i}from"./GraphView.res-1lpWK5Qh.js";import"./virtualExposes-DN39MDG_.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-Dep87C4a.js";import"./preload-helper-BhLMWRjL.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-DysgZ6xd.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-DWrxCvCs.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-BBGkOHMQ.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-BS-h5UZc.js";import"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-B8MMWKQv.js";let m="dagre",d={contents:m},h=o("span",{children:"◈","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});function f(t){let a=t.source,i=_(a),m=l(a);return s("div",{children:[o(n,{nodes:m.nodes,edges:m.edges,onOpenNode:_=>e(a,i,_),layout:d.contents}),o("span",{children:r([a],void 0,"row"),style:{fontSize:"11px",opacity:"0.7"}})],style:{display:"flex",flexDirection:"column",gap:"8px"}})}let p={make:f};function c(_,e){t(_,_=>{d.contents=_}),a({id:"graph",label:"Graph",icon:h,arity:"Single",isCapable:(_,e,r)=>i(_,r.registry,r.ownEntity),render:_=>{let e=_[0];return void 0!==e?o(f,{source:e}):null},capability:"entity-ref fields — one or more *Id/*Ids foreign keys drawn as a node-link diagram (a field pointing at other rows of the same view forms a tree; a field that is the view's own key restated is not a reference the mode draws)"})}export{p as ModeView,m as defaultLayout,h as graphIcon,c as init,d as layoutRef};
@@ -1,4 +1,4 @@
1
- import{h as e,b as t}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-BS-h5UZc.js";import{p as n,t as r,b as i,h as a,d as o,e as s,i as l,j as u,k as c,l as h,m as d,g as f,n as g,q as p,u as v,v as y,x as m,y as b,f as x,z as w,A as E,B as T,D as _,E as C,R as N,F as A,G as M}from"./index-BDNTR5TK.js";function D(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{a as k}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CkYd2Guw.js";function I(e,t,n){let r=void 0!==t?t:[];return s(h(e),e=>{let t=e[1],i=e[0],a=l(t),o=e=>!c(e,r,n),s=u(i,t,a);if("object"==typeof s)switch(s.TAG){case"KEntityId":let e=s._0;return o(e)?[i,e,!1]:void 0;case"KArrayOfEntityIds":let t=s._0;return o(t)?[i,t,!0]:void 0;default:return}})}function P(e,t,n){return 0!==I(e,void 0!==t?t:[],n).length}function S(e,t,n){return n?s(f(g(i(e.dict,t),p),[]),d):v(y(e.dict,t),[],e=>[e])}function L(e){let t=I(e.schema,void 0,void 0),s=n(e),l={};s.forEach(t=>{l[t.key]=r(e,t)});let u=s.map(t=>({id:t.key,label:r(e,t),group:e.readModelName})),c=s.flatMap(n=>t.flatMap(t=>{let r=t[1];return S(n,t[0],t[2]).map(t=>{let n=i(l,t);return void 0!==n?{id:t,label:n,group:e.readModelName}:{id:t,label:(o=t,o.length>8?o.slice(0,8)+"…":o),group:a(r)};var o})})),h=o(u.concat(c),[],(e,t)=>e.some(e=>e.id===t.id)?e:e.concat([t])),d=s.flatMap(e=>t.flatMap(t=>{let n=t[0];return S(e,n,t[2]).filter(t=>t!==e.key).map(t=>({from:e.key,to_:t,label:a(n)}))}));return{nodes:h,edges:d}}function O(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 B(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,Y(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function F(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,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 a,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,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function z(e,t,n){return(t=Y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(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,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}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 G(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||U(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 Y(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 X(e){return X="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},X(e)}function U(e,t){if(e){if("string"==typeof e)return O(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(e,t):void 0}}var j="undefined"==typeof window?null:window,H=j?j.navigator:null;j&&j.document;var W,q,K,Z,$,Q,J,ee,te,ne,re,ie,ae,oe,se,le,ue,ce,he,de,fe,ge,pe,ve,ye,me,be,xe,we=X(""),Ee=X({}),Te=X(function(){}),_e="undefined"==typeof HTMLElement?"undefined":X(HTMLElement),Ce=function(e){return e&&e.instanceString&&Ae(e.instanceString)?e.instanceString():null},Ne=function(e){return null!=e&&X(e)==we},Ae=function(e){return null!=e&&X(e)===Te},Me=function(e){return!Pe(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},De=function(e){return null!=e&&X(e)===Ee&&!Me(e)&&e.constructor===Object},ke=function(e){return null!=e&&X(e)===X(1)&&!isNaN(e)},Ie=function(e){return"undefined"===_e?void 0:null!=e&&e instanceof HTMLElement},Pe=function(e){return Se(e)||Le(e)},Se=function(e){return"collection"===Ce(e)&&e._private.single},Le=function(e){return"collection"===Ce(e)&&!e._private.single},Oe=function(e){return"core"===Ce(e)},Re=function(e){return"stylesheet"===Ce(e)},Be=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},Fe=function(e){return function(e){return null!=e&&X(e)===Ee}(e)&&Ae(e.then)},ze=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,a=t.apply(this,i),o=n.cache;return(r=o[a])||(r=o[a]=e.apply(this,i)),r};return n.cache={},n},Ve=ze(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Ge=ze(function(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Ye=ze(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),Xe=function(e){return Be(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Ue=function(e,t){return e.slice(-1*t.length)===t},je="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",He="rgb[a]?\\(("+je+"[%]?)\\s*,\\s*("+je+"[%]?)\\s*,\\s*("+je+"[%]?)(?:\\s*,\\s*("+je+"))?\\)",We="rgb[a]?\\((?:"+je+"[%]?)\\s*,\\s*(?:"+je+"[%]?)\\s*,\\s*(?:"+je+"[%]?)(?:\\s*,\\s*(?:"+je+"))?\\)",qe="hsl[a]?\\(("+je+")\\s*,\\s*("+je+"[%])\\s*,\\s*("+je+"[%])(?:\\s*,\\s*("+je+"))?\\)",Ke="hsl[a]?\\((?:"+je+")\\s*,\\s*(?:"+je+"[%])\\s*,\\s*(?:"+je+"[%])(?:\\s*,\\s*(?:"+je+"))?\\)",Ze=function(e,t){return e<t?-1:e>t?1:0},$e=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];e[o]=r[o]}}return e},Qe=function(e){return(Me(e)?e:null)||function(e){return Je[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("^"+He+"$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var 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,a,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("^"+qe+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(a=c[4])&&((a=parseFloat(a))<0||a>1))return;if(0===r)o=s=l=Math.round(255*i);else{var h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;o=Math.round(255*u(d,h,n+1/3)),s=Math.round(255*u(d,h,n)),l=Math.round(255*u(d,h,n-1/3))}t=[o,s,l,a]}return t}(e)},Je={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]},et=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(De(a))throw Error("Tried to set map with object key");i<n.length-1?(null==t[a]&&(t[a]={}),t=t[a]):t[a]=e.value}},tt=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(De(a))throw Error("Tried to get map with object key");if(null==(t=t[a]))return t}return t},nt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function it(){if(q)return W;return q=1,W=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function at(){if(Q)return $;Q=1;var e=function(){if(Z)return K;Z=1;var e="object"==typeof nt&&nt&&nt.Object===Object&&nt;return K=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return $=n}function ot(){if(ie)return re;ie=1;var e=function(){if(ne)return te;ne=1;var e=/\s/;return te=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},te}(),t=/^\s+/;return re=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},re}function st(){if(oe)return ae;oe=1;var e=at().Symbol;return ae=e}function lt(){if(de)return he;de=1;var e=st(),t=function(){if(le)return se;le=1;var e=st(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;return se=function(e){var t=n.call(e,i),a=e[i];try{e[i]=void 0;var o=!0}catch(l){}var s=r.call(e);return o&&(t?e[i]=a:delete e[i]),s}}(),n=function(){if(ce)return ue;ce=1;var e=Object.prototype.toString;return ue=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return he=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function ut(){if(ve)return pe;ve=1;var e=lt(),t=ge?fe:(ge=1,fe=function(e){return null!=e&&"object"==typeof e});return pe=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}var ct=rt(function(){if(xe)return be;xe=1;var e=it(),t=function(){if(ee)return J;ee=1;var e=at();return J=function(){return e.Date.now()}}(),n=function(){if(me)return ye;me=1;var e=ot(),t=it(),n=ut(),r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;return ye=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=i.test(s);return u||a.test(s)?o(s.slice(2),u?2:8):r.test(s)?NaN:+s}}(),r=Math.max,i=Math.min;return be=function(a,o,s){var l,u,c,h,d,f,g=0,p=!1,v=!1,y=!0;if("function"!=typeof a)throw new TypeError("Expected a function");function m(e){var t=l,n=u;return l=u=void 0,g=e,h=a.apply(n,t)}function b(e){var t=e-f;return void 0===f||t>=o||t<0||v&&e-g>=c}function x(){var e=t();if(b(e))return w(e);d=setTimeout(x,function(e){var t=o-(e-f);return v?i(t,c-(e-g)):t}(e))}function w(e){return d=void 0,y&&l?m(e):(l=u=void 0,h)}function E(){var e=t(),n=b(e);if(l=arguments,u=this,f=e,n){if(void 0===d)return function(e){return g=e,d=setTimeout(x,o),p?m(e):h}(f);if(v)return clearTimeout(d),d=setTimeout(x,o),m(f)}return void 0===d&&(d=setTimeout(x,o)),h}return o=n(o)||0,e(s)&&(p=!!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!==d&&clearTimeout(d),g=0,l=f=u=d=void 0},E.flush=function(){return void 0===d?h:w(t())},E}}()),ht=j?j.performance:null,dt=ht&&ht.now?function(){return ht.now()}:function(){return Date.now()},ft=function(){if(j){if(j.requestAnimationFrame)return function(e){j.requestAnimationFrame(e)};if(j.mozRequestAnimationFrame)return function(e){j.mozRequestAnimationFrame(e)};if(j.webkitRequestAnimationFrame)return function(e){j.webkitRequestAnimationFrame(e)};if(j.msRequestAnimationFrame)return function(e){j.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(dt())},1e3/60)}}(),gt=function(e){return ft(e)},pt=dt,vt=9261,yt=5381,mt=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vt;!(t=e.next()).done;)n=65599*n+t.value|0;return n},bt=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:vt)+e|0},xt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yt;return(t<<5)+t+e|0},wt=function(e){return 2097152*e[0]+e[1]},Et=function(e,t){return[bt(e[0],t[0]),xt(e[1],t[1])]},Tt=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return mt({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)},_t=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return mt({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},Ct=function(){return Nt(arguments)},Nt=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?_t(r):_t(r,t)}return t};function At(e,t,n){if(0===n)return e;var r=(t.x1+t.x2)/2,i=(t.y1+t.y2)/2,a=t.w/t.h,o=1/a,s=function(e,t,n,r,i){var a=i*Math.PI/180;return{x:Math.cos(a)*(e-n)-Math.sin(a)*(t-r)+n,y:Math.sin(a)*(e-n)+Math.cos(a)*(t-r)+r}}(e.x,e.y,r,i,n),l=function(e,t,n,r,i,a){return{x:(e-n)*i+n,y:(t-r)*a+r}}(s.x,s.y,r,i,a,o);return{x:l.x,y:l.y}}var Mt=!0,Dt=null!=console.warn,kt=null!=console.trace,It=Number.MAX_SAFE_INTEGER||9007199254740991,Pt=function(){return!0},St=function(){return!1},Lt=function(){return 0},Ot=function(){},Rt=function(e){throw new Error(e)},Bt=function(e){if(void 0===e)return Mt;Mt=!!e},Ft=function(e){Bt()&&(Dt?console.warn(e):(console.log(e),kt&&console.trace()))},zt=function(e){return null==e?e:Me(e)?e.slice():De(e)?function(e){return $e({},e)}(e):e},Vt=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},Gt={},Yt=function(){return Gt},Xt=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var a=t[i],o=null==n?void 0:n[a];r[a]=void 0===o?e[a]:o}return r}},Ut=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},jt=function(e){e.splice(0,e.length)},Ht=function(e,t,n){return n&&(t=Ye(n,t)),e[t]},Wt=function(e,t,n,r){n&&(t=Ye(n,t)),e[t]=r},qt="undefined"!=typeof Map?Map:function(){return B(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]}}])}(),Kt=function(){return B(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 r=0;r<n.length;r++)this.add(n[r])}},[{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)}}])}(),Zt="undefined"!==("undefined"==typeof Set?"undefined":X(Set))?Set:Kt,$t=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&Oe(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 Zt,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 a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var l=[];Me(t.classes)?l=t.classes:Ne(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var h=l[u];h&&""!==h&&i.classes.add(h)}this.createEmitter(),(void 0===n||n)&&this.restore();var d=t.style||t.css;d&&(Ft("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d))}else Rt("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else Rt("An element must have a core reference and parameters set")},Qt=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;De(t)&&!Pe(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||Ae(n)?r:n,n=Ae(n)?n:function(){};for(var a,o=this._private.cy,s=t=Ne(t)?this.filter(t):t,l=[],u=[],c={},h={},d={},f=0,g=this.byGroup(),p=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,u.push(m)),h[b]=0)}for(var x,w=function(){var t=e.bfs?l.shift():l.pop(),i=t.id();if(e.dfs){if(d[i])return 0;d[i]=!0,u.push(t)}var o,s=h[i],g=c[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===(o=n(t,g,b,f++,s)))return a=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],T=E.connectedNodes().filter(function(e){return!e.same(t)&&p.has(e)}),_=T.id();0===T.length||d[_]||(T=T[0],l.push(T),e.bfs&&(d[_]=!0,u.push(T)),c[_]=E,h[_]=h[i]+1)}};0!==l.length&&(0===(x=w())||1!==x););for(var E=o.collection(),T=0;T<u.length;T++){var _=u[T],C=c[_.id()];null!=C&&E.push(C),E.push(_)}return{path:o.collection(E),found:o.collection(a)}}},Jt={breadthFirstSearch:Qt({bfs:!0}),depthFirstSearch:Qt({dfs:!0})};Jt.bfs=Jt.breadthFirstSearch,Jt.dfs=Jt.depthFirstSearch;var en,tn,nn,rn={exports:{}},an=rn.exports;function on(){return en||(en=1,e=rn,function(){var t,n,r,i,a,o,s,l,u,c,h,d,f,g,p;r=Math.floor,c=Math.min,n=function(e,t){return e<t?-1:e>t?1:0},u=function(e,t,i,a,o){var s;if(null==i&&(i=0),null==o&&(o=n),i<0)throw new Error("lo must be non-negative");for(null==a&&(a=e.length);i<a;)o(t,e[s=r((i+a)/2)])<0?a=s:i=s+1;return[].splice.apply(e,[i,i-i].concat(t)),t},o=function(e,t,r){return null==r&&(r=n),e.push(t),g(e,0,e.length-1,r)},a=function(e,t){var r,i;return null==t&&(t=n),r=e.pop(),e.length?(i=e[0],e[0]=r,p(e,0,t)):i=r,i},l=function(e,t,r){var i;return null==r&&(r=n),i=e[0],e[0]=t,p(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],p(e,0,r)),t},i=function(e,t){var i,a,o,s,l,u;for(null==t&&(t=n),l=[],a=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;a<o;a++)i=s[a],l.push(p(e,i,t));return l},f=function(e,t,r){var i;if(null==r&&(r=n),-1!==(i=e.indexOf(t)))return g(e,0,i,r),p(e,i,r)},h=function(e,t,r){var a,o,l,u,c;if(null==r&&(r=n),!(o=e.slice(0,t)).length)return o;for(i(o,r),l=0,u=(c=e.slice(t)).length;l<u;l++)a=c[l],s(o,a,r);return o.sort(r).reverse()},d=function(e,t,r){var o,s,l,h,d,f,g,p,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,f=(g=e.slice(t)).length;h<f;h++)r(o=g[h],s)<0&&(u(l,o,0,null,r),l.pop(),s=l[l.length-1]);return l}for(i(e,r),v=[],d=0,p=c(t,e.length);0<=p?d<p:d>p;0<=p?++d:--d)v.push(a(e,r));return v},g=function(e,t,r,i){var a,o,s;for(null==i&&(i=n),a=e[r];r>t&&i(a,o=e[s=r-1>>1])<0;)e[r]=o,r=s;return e[r]=a},p=function(e,t,r){var i,a,o,s,l;for(null==r&&(r=n),a=e.length,l=t,o=e[t],i=2*t+1;i<a;)(s=i+1)<a&&!(r(e[i],e[s])<0)&&(i=s),e[t]=e[i],i=2*(t=i)+1;return e[t]=o,g(e,l,t,r)},t=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=o,e.pop=a,e.replace=l,e.pushpop=s,e.heapify=i,e.updateItem=f,e.nlargest=h,e.nsmallest=d,e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return a(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 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(an)),rn.exports;var e}var sn,ln=rt(nn?tn:(nn=1,tn=on())),un=Xt({root:null,weight:function(e){return 1},directed:!1}),cn={dijkstra:function(e){if(!De(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=un(e),r=n.root,i=n.weight,a=n.directed,o=this,s=i,l=Ne(r)?this.filter(r)[0]:r[0],u={},c={},h={},d=this.byGroup(),f=d.nodes,g=d.edges;g.unmergeBy(function(e){return e.isLoop()});for(var p=function(e){return u[e.id()]},v=function(e,t){u[e.id()]=t,y.updateItem(e)},y=new ln(function(e,t){return p(e)-p(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=(a?e.edgesTo(t):e.edgesWith(t)).intersect(g),i=1/0,o=0;o<r.length;o++){var l=r[o],u=s(l);(u<i||!n)&&(i=u,n=l)}return{edge:n,dist:i}};y.size()>0;){var w=y.pop(),E=p(w),T=w.id();if(h[T]=E,E!==1/0)for(var _=w.neighborhood().intersect(f),C=0;C<_.length;C++){var N=_[C],A=N.id(),M=x(w,N),D=E+M.dist;D<p(N)&&(v(N,D),c[A]={node:w,edge:M.edge})}}return{distanceTo:function(e){var t=Ne(e)?f.filter(e)[0]:e[0];return h[t.id()]},pathTo:function(e){var t=Ne(e)?f.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);c[i];){var a=c[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return o.spawn(n)}}}},hn={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=new Array(i),o=n,s=function(e){for(var t=0;t<a.length;t++){if(a[t].has(e))return t}},l=0;l<i;l++)a[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 h=u[c],d=h.source()[0],f=h.target()[0],g=s(d),p=s(f),v=a[g],y=a[p];g!==p&&(o.merge(h),v.merge(y),a.splice(p,1))}return o}},dn=Xt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),fn={aStar:function(e){var t=this.cy(),n=dn(e),r=n.root,i=n.goal,a=n.heuristic,o=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,u,c=r.id(),h=i.id(),d={},f={},g={},p=new ln(function(e,t){return f[e.id()]-f[t.id()]}),v=new Zt,y={},m={},b=function(e,t){p.push(e),v.add(t)},x=function(){l=p.pop(),u=l.id(),v.delete(u)},w=function(e){return v.has(e)};b(r,c),d[c]=0,f[c]=a(r);for(var E=0;p.size()>0;){if(x(),E++,u===h){for(var T=[],_=i,C=h,N=m[C];T.unshift(_),null!=N&&T.unshift(N),null!=(_=y[C]);)N=m[C=_.id()];return{found:!0,distance:d[u],path:this.spawn(T),steps:E}}g[u]=!0;for(var A=l._private.edges,M=0;M<A.length;M++){var D=A[M];if(this.hasElementWithId(D.id())&&(!o||D.data("source")===u)){var k=D.source(),I=D.target(),P=k.id()!==u?k:I,S=P.id();if(this.hasElementWithId(S)&&!g[S]){var L=d[u]+s(D);w(S)?L<d[S]&&(d[S]=L,f[S]=L+a(P),y[S]=l,m[S]=D):(d[S]=L,f[S]=L+a(P),b(P,S),y[S]=l,m[S]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},gn=Xt({weight:function(e){return 1},directed:!1}),pn={floydWarshall:function(e){for(var t=this.cy(),n=gn(e),r=n.weight,i=n.directed,a=r,o=this.byGroup(),s=o.nodes,l=o.edges,u=s.length,c=u*u,h=function(e){return s.indexOf(e)},d=function(e){return s[e]},f=new Array(c),g=0;g<c;g++){var p=g%u,v=(g-p)/u;f[g]=v===p?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 T=h(w),_=h(E),C=T*u+_,N=a(x);if(f[C]>N&&(f[C]=N,y[C]=_,m[C]=x),!i){var A=_*u+T;!i&&f[A]>N&&(f[A]=N,y[A]=T,m[A]=x)}}}for(var M=0;M<u;M++)for(var D=0;D<u;D++)for(var k=D*u+M,I=0;I<u;I++){var P=D*u+I,S=M*u+I;f[k]+f[S]<f[P]&&(f[P]=f[k]+f[S],y[P]=y[k])}var L=function(e){return h(function(e){return(Ne(e)?t.filter(e):e)[0]}(e))},O={distance:function(e,t){var n=L(e),r=L(t);return f[n*u+r]},path:function(e,n){var r=L(e),i=L(n),a=d(r);if(r===i)return a.collection();if(null==y[r*u+i])return t.collection();var o,s=t.collection(),l=r;for(s.merge(a);r!==i;)l=r,r=y[r*u+i],o=m[l*u+r],s.merge(o),s.merge(d(r));return s}};return O}},vn=Xt({weight:function(e){return 1},directed:!1,root:null}),yn={bellmanFord:function(e){var t=this,n=vn(e),r=n.weight,i=n.directed,a=n.root,o=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,h=u.nodes,d=h.length,f=new qt,g=!1,p=[];a=l.collection(a)[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(Ne(e)?l.$(e):e)[0]},b=0;b<d;b++){var x=h[b],w=y(x);x.same(a)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,T=function(e,t,n,r,i,a){var o=r.dist+a;o<i.dist&&!n.same(r.edge)&&(i.dist=o,i.pred=e,i.edge=n,E=!0)},_=1;_<d;_++){E=!1;for(var C=0;C<v;C++){var N=c[C],A=N.source(),M=N.target(),D=o(N),k=y(A),I=y(M);T(A,0,N,k,I,D),i||T(M,0,N,I,k,D)}if(!E)break}if(E)for(var P=[],S=0;S<v;S++){var L=c[S],O=L.source(),R=L.target(),B=o(L),F=y(O).dist,z=y(R).dist;if(F+B<z||!i&&z+B<F){if(g||(Ft("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),!1===e.findNegativeWeightCycles)break;var V=[];F+B<z&&V.push(O),!i&&z+B<F&&V.push(R);for(var G=V.length,Y=0;Y<G;Y++){var X=V[Y],U=[X];U.push(y(X).edge);for(var j=y(X).pred;-1===U.indexOf(j);)U.push(j),U.push(y(j).edge),j=y(j).pred;for(var H=(U=U.slice(U.indexOf(j)))[0].id(),W=0,q=2;q<U.length;q+=2)U[q].id()<H&&(H=U[q].id(),W=q);(U=U.slice(W).concat(U.slice(0,W))).push(U[0]);var K=U.map(function(e){return e.id()}).join(",");-1===P.indexOf(K)&&(p.push(s.spawn(U)),P.push(K))}}}return{distanceTo:function(e){return y(m(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,r=[],i=m(e);;){if(null==i)return t.spawn();var o=y(i),l=o.edge,u=o.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:g,negativeWeightCycles:p}}},mn=Math.sqrt(2),bn=function(e,t,n){0===n.length&&Rt("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],l=n,u=l.length-1;u>=0;u--){var c=l[u],h=c[1],d=c[2];(t[h]===o&&t[d]===s||t[h]===s&&t[d]===o)&&l.splice(u,1)}for(var f=0;f<l.length;f++){var g=l[f];g[1]===s?(l[f]=g.slice(),l[f][1]=o):g[2]===s&&(l[f]=g.slice(),l[f][2]=o)}for(var p=0;p<t.length;p++)t[p]===s&&(t[p]=o);return l},xn=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=bn(i,e,t),n--}return t},wn={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/mn);if(!(i<2)){for(var l=[],u=0;u<a;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var h=1/0,d=[],f=new Array(i),g=new Array(i),p=new Array(i),v=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=o;y++){for(var m=0;m<i;m++)g[m]=m;var b=xn(g,l.slice(),i,s),x=b.slice();v(g,p);var w=xn(g,b,s,2),E=xn(p,x,s,2);w.length<=E.length&&w.length<h?(h=w.length,d=w,v(g,f)):E.length<=w.length&&E.length<h&&(h=E.length,d=E,v(p,f))}for(var T=this.spawn(d.map(function(e){return r[e[0]]})),_=this.spawn(),C=this.spawn(),N=f[0],A=0;A<f.length;A++){var M=f[A],D=n[A];M===N?_.merge(D):C.merge(D)}var k=function(t){var n=e.spawn();return t.forEach(function(t){n.merge(t),t.connectedEdges().forEach(function(t){e.contains(t)&&!T.contains(t)&&n.merge(t)})}),n},I=[k(_),k(C)];return{cut:T,components:I,partition1:_,partition2:C}}Rt("At least 2 nodes are required for Karger-Stein algorithm")}},En=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Tn=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},_n=function(e){return{x:e[0],y:e[1]}},Cn=function(e,t){return Math.atan2(t,e)-Math.PI/2},Nn=Math.log2||function(e){return Math.log(e)/Math.log(2)},An=function(e){return e>0?1:e<0?-1:0},Mn=function(e,t){return Math.sqrt(Dn(e,t))},Dn=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},kn=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},In=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Pn=function(e,t,n,r){return{x:In(e.x,t.x,n.x,r),y:In(e.y,t.y,n.y,r)}},Sn=function(e,t,n){return Math.max(e,Math.min(n,t))},Ln=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}}},On=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},Rn=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},Bn=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},Fn=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)t=n=r=i=a[0];else if(2===a.length)t=r=a[0],i=n=a[1];else if(4===a.length){var o=V(a,4);t=o[0],n=o[1],r=o[2],i=o[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},zn=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},Vn=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)))))))},Gn=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Yn=function(e,t){return Gn(e,t.x,t.y)},Xn=function(e,t){return Gn(e,t.x1,t.y1)&&Gn(e,t.x2,t.y2)},Un=null!==(sn=Math.hypot)&&void 0!==sn?sn:function(e,t){return Math.sqrt(e*e+t*t)};function jn(e,t,n,r,i,a){var o=function(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},r=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},i=function(e,t){return{x:e.x*t,y:e.y*t}},a=function(e,t){return e.x*t.y-e.y*t.x},o=function(e){var t=Un(e.x,e.y);return 0===t?{x:0,y:0}:{x:e.x/t,y:e.y/t}},s=function(e,t,o,s){var l=r(t,e),u=r(s,o),c=a(l,u);if(Math.abs(c)<1e-9)return n(e,i(l,.5));var h=a(r(o,e),u)/c;return n(e,i(l,h))},l=e.map(function(e){return{x:e.x,y:e.y}});(function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length];t+=r.x*i.y-i.x*r.y}return t/2})(l)<0&&l.reverse();for(var u=l.length,c=[],h=0;h<u;h++){var d=l[h],f=l[(h+1)%u],g=r(f,d),p=o({x:g.y,y:-g.x});c.push(p)}for(var v=c.map(function(e,r){return{p1:n(l[r],i(e,t)),p2:n(l[(r+1)%u],i(e,t))}}),y=[],m=0;m<u;m++){var b=v[(m-1+u)%u],x=v[m],w=s(b.p1,b.p2,x.p1,x.p2);y.push(w)}return y}(ar(e,t,n,r,i),a),s=Ln();return o.forEach(function(e){return Rn(s,e.x,e.y)}),s}var Hn=function(e,t,n,r,i,a,o){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?hr(i,a):u,h=i/2,d=a/2,f=(c=Math.min(c,h,d))!==h,g=c!==d;if(f){var p=r-d-o;if((s=ir(e,t,n,r,n-h+c-o,p,n+h-c+o,p,!1)).length>0)return s}if(g){var v=n+h+o;if((s=ir(e,t,n,r,v,r-d+c-o,v,r+d-c+o,!1)).length>0)return s}if(f){var y=r+d+o;if((s=ir(e,t,n,r,n-h+c-o,y,n+h-c+o,y,!1)).length>0)return s}if(g){var m=n-h-o;if((s=ir(e,t,n,r,m,r-d+c-o,m,r+d-c+o,!1)).length>0)return s}var b=n-h+c,x=r-d+c;if((l=nr(e,t,n,r,b,x,c+o)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+h-c,E=r-d+c;if((l=nr(e,t,n,r,w,E,c+o)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var T=n+h-c,_=r+d-c;if((l=nr(e,t,n,r,T,_,c+o)).length>0&&l[0]>=T&&l[1]>=_)return[l[0],l[1]];var C=n-h+c,N=r+d-c;return(l=nr(e,t,n,r,C,N,c+o)).length>0&&l[0]<=C&&l[1]>=N?[l[0],l[1]]:[]},Wn=function(e,t,n,r,i,a,o){var s=o,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,a),h=Math.max(r,a);return l-s<=e&&e<=u+s&&c-s<=t&&t<=h+s},qn=function(e,t,n,r,i,a,o,s,l){var u=Math.min(n,o,i)-l,c=Math.max(n,o,i)+l,h=Math.min(r,s,a)-l,d=Math.max(r,s,a)+l;return!(e<u||e>c||t<h||t>d)},Kn=function(e,t,n,r,i,a,o,s){var l=[];!function(e,t,n,r,i){var a,o,s,l,u,c,h,d;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),a=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,i[1]=0,h=t/3,a>0?(u=(u=s+Math.sqrt(a))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+u+c,h+=(u+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+u)/2,i[3]=h,i[5]=-h):(i[5]=i[3]=0,0===a?(d=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*d-h,i[4]=i[2]=-(d+h)):(l=(o=-o)*o*o,l=Math.acos(s/Math.sqrt(l)),d=2*Math.sqrt(o),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*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,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 h,d,f,g=-1,p=0;p<u.length;p++)h=Math.pow(1-u[p],2)*n+2*(1-u[p])*u[p]*i+u[p]*u[p]*o,d=Math.pow(1-u[p],2)*r+2*(1-u[p])*u[p]*a+u[p]*u[p]*s,f=Math.pow(h-e,2)+Math.pow(d-t,2),g>=0?f<g&&(g=f):g=f;return g},Zn=function(e,t,n,r,i,a){var o=[e-n,t-r],s=[i-n,a-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],h=c*c/l;return c<0?u:h>l?(e-i)*(e-i)+(t-a)*(t-a):u-h},$n=function(e,t,n){for(var r,i,a,o,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(a=n[2*(l+1)],o=n[2*(l+1)+1]):(a=n[2*(l+1-n.length/2)],o=n[2*(l+1-n.length/2)+1]),r==e&&a==e);else{if(!(r>=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},Qn=function(e,t,n,r,i,a,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 h,d=Math.cos(-u),f=Math.sin(-u),g=0;g<c.length/2;g++)c[2*g]=a/2*(n[2*g]*d-n[2*g+1]*f),c[2*g+1]=o/2*(n[2*g+1]*d+n[2*g]*f),c[2*g]+=r,c[2*g+1]+=i;if(l>0){var p=er(c,-l);h=Jn(p)}else h=c;return $n(e,t,h)},Jn=function(e){for(var t,n,r,i,a,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],i=e[4*c+3],c<e.length/4-1?(a=e[4*(c+1)],o=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(a=e[0],o=e[1],s=e[2],l=e[3]);var h=ir(t,n,r,i,a,o,s,l,!0);u[2*c]=h[0],u[2*c+1]=h[1]}return u},er=function(e,t){for(var n,r,i,a,o=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[2*(s+1)],a=e[2*(s+1)+1]):(i=e[0],a=e[1]);var l=a-r,u=-(i-n),c=Math.sqrt(l*l+u*u),h=l/c,d=u/c;o[4*s]=n+h*t,o[4*s+1]=r+d*t,o[4*s+2]=i+h*t,o[4*s+3]=a+d*t}return o},tr=function(e,t,n,r,i,a,o){return e-=i,t-=a,(e/=n/2+o)*e+(t/=r/2+o)*t<=1},nr=function(e,t,n,r,i,a,o){var s=[n-e,r-t],l=[e-i,t-a],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),h=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-o*o);if(h<0)return[];var d=(-c+Math.sqrt(h))/(2*u),f=(-c-Math.sqrt(h))/(2*u),g=Math.min(d,f),p=Math.max(d,f),v=[];if(g>=0&&g<=1&&v.push(g),p>=0&&p<=1&&v.push(p),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]},rr=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},ir=function(e,t,n,r,i,a,o,s,l){var u=e-i,c=n-e,h=o-i,d=t-a,f=r-t,g=s-a,p=h*d-g*u,v=c*d-f*u,y=g*c-h*f;if(0!==y){var m=p/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===p||0===v?rr(e,n,o)===o?[o,s]:rr(e,n,i)===i?[i,a]:rr(i,o,n)===n?[n,r]:[]:[]},ar=function(e,t,n,r,i){var a=[],o=r/2,s=i/2,l=t,u=n;a.push({x:l+o*e[0],y:u+s*e[1]});for(var c=1;c<e.length/2;c++)a.push({x:l+o*e[2*c],y:u+s*e[2*c+1]});return a},or=function(e,t,n,r,i,a,o,s){var l,u,c,h,d,f,g=[],p=new Array(n.length),v=!0;if(null==a&&(v=!1),v){for(var y=0;y<p.length/2;y++)p[2*y]=n[2*y]*a+r,p[2*y+1]=n[2*y+1]*o+i;if(s>0){var m=er(p,-s);u=Jn(m)}else u=p}else u=n;for(var b=0;b<u.length/2;b++)c=u[2*b],h=u[2*b+1],b<u.length/2-1?(d=u[2*(b+1)],f=u[2*(b+1)+1]):(d=u[0],f=u[1]),0!==(l=ir(e,t,r,i,c,h,d,f)).length&&g.push(l[0],l[1]);return g},sr=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(i-n)/i;return a<0&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},lr=function(e,t){var n=cr(e,t);return n=ur(n)},ur=function(e){for(var t,n,r=e.length/2,i=1/0,a=1/0,o=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);for(var u=2/(o-i),c=2/(s-a),h=0;h<r;h++)t=e[2*h]=e[2*h]*u,n=e[2*h+1]=e[2*h+1]*c,i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);if(a<-1)for(var d=0;d<r;d++)n=e[2*d+1]=e[2*d+1]+(-1-a);return e},cr=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,a=new Array(2*e),o=0;o<e;o++)i=o*n+r,a[2*o]=Math.cos(i),a[2*o+1]=Math.sin(-i);return a},hr=function(e,t){return Math.min(e/4,t/4,8)},dr=function(e,t){return Math.min(e/10,t/10,8)},fr=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function gr(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length],a={x:i.x-r.x,y:i.y-r.y},o={x:-a.y,y:a.x},s=Math.sqrt(o.x*o.x+o.y*o.y);t.push({x:o.x/s,y:o.y/s})}return t}function r(e,t){var n,r=1/0,i=-1/0,a=F(e);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o.x*t.x+o.y*t.y;r=Math.min(r,s),i=Math.max(i,s)}}catch(l){a.e(l)}finally{a.f()}return{min:r,max:i}}function i(e,t){return!(e.max<t.min||t.max<e.min)}var a,o=F([].concat(G(n(e)),G(n(t))));try{for(o.s();!(a=o.n()).done;){var s=a.value;if(!i(r(e,s),r(t,s)))return!1}}catch(l){o.e(l)}finally{o.f()}return!0}var pr=Xt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),vr={pageRank:function(e){for(var t=pr(e),n=t.dampingFactor,r=t.precision,i=t.iterations,a=t.weight,o=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,h=c*c,d=u.length,f=new Array(h),g=new Array(c),p=(1-n)/c,v=0;v<c;v++){for(var y=0;y<c;y++){f[v*c+y]=0}g[v]=0}for(var m=0;m<d;m++){var b=u[m],x=b.data("source"),w=b.data("target");if(x!==w){var E=l.indexOfId(x),T=l.indexOfId(w),_=a(b);f[T*c+E]+=_,g[E]+=_}}for(var C=1/c+p,N=0;N<c;N++)if(0===g[N])for(var A=0;A<c;A++){f[A*c+N]=C}else for(var M=0;M<c;M++){var D=M*c+N;f[D]=f[D]/g[N]+p}for(var k,I=new Array(c),P=new Array(c),S=0;S<c;S++)I[S]=1;for(var L=0;L<i;L++){for(var O=0;O<c;O++)P[O]=0;for(var R=0;R<c;R++)for(var B=0;B<c;B++){var F=R*c+B;P[R]+=f[F]*I[B]}kn(P),k=I,I=P,P=k;for(var z=0,V=0;V<c;V++){var G=k[V]-I[V];z+=G*G}if(z<r)break}return{rank:function(e){return e=o.collection(e)[0],I[l.indexOf(e)]}}}},yr=Xt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),mr={degreeCentralityNormalized:function(e){e=yr(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},a={},o=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var h=this.degreeCentrality(e);o<h.indegree&&(o=h.indegree),s<h.outdegree&&(s=h.outdegree),i[c]=h.indegree,a[c]=h.outdegree}return{indegree:function(e){return 0==o?0:(Ne(e)&&(e=t.filter(e)),i[e.id()]/o)},outdegree:function(e){return 0===s?0:(Ne(e)&&(e=t.filter(e)),a[e.id()]/s)}}}for(var d={},f=0,g=0;g<r;g++){var p=n[g];e.root=p;var v=this.degreeCentrality(e);f<v.degree&&(f=v.degree),d[p.id()]=v.degree}return{degree:function(e){return 0===f?0:(Ne(e)&&(e=t.filter(e)),d[e.id()]/f)}}},degreeCentrality:function(e){e=yr(e);var t=this.cy(),n=this,r=e,i=r.root,a=r.weight,o=r.directed,s=r.alpha;if(i=t.collection(i)[0],o){for(var l=i.connectedEdges(),u=l.filter(function(e){return e.target().same(i)&&n.has(e)}),c=l.filter(function(e){return e.source().same(i)&&n.has(e)}),h=u.length,d=c.length,f=0,g=0,p=0;p<u.length;p++)f+=a(u[p]);for(var v=0;v<c.length;v++)g+=a(c[v]);return{indegree:Math.pow(h,1-s)*Math.pow(f,s),outdegree:Math.pow(d,1-s)*Math.pow(g,s)}}for(var y=i.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=a(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};mr.dc=mr.degreeCentrality,mr.dcn=mr.degreeCentralityNormalised=mr.degreeCentralityNormalized;var br=Xt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),xr={closenessCentralityNormalized:function(e){for(var t=br(e),n=t.harmonic,r=t.weight,i=t.directed,a=this.cy(),o={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:i}),c=0;c<l.length;c++){for(var h=0,d=l[c],f=0;f<l.length;f++)if(c!==f){var g=u.distance(d,l[f]);h+=n?1/g:g}n||(h=1/h),s<h&&(s=h),o[d.id()]=h}return{closeness:function(e){return 0==s?0:(e=Ne(e)?a.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=br(e),n=t.root,r=t.weight,i=t.directed,a=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var h=o.distanceTo(c);s+=a?1/h:h}}return a?s:1/s}};xr.cc=xr.closenessCentrality,xr.ccn=xr.closenessCentralityNormalised=xr.closenessCentralityNormalized;var wr=Xt({weight:null,directed:!1}),Er={betweennessCentrality:function(e){for(var t=wr(e),n=t.directed,r=t.weight,i=null!=r,a=this.cy(),o=this.nodes(),s={},l={},u=0,c=function(e,t){l[e]=t,t>u&&(u=t)},h=function(e){return l[e]},d=0;d<o.length;d++){var f=o[d],g=f.id();s[g]=n?f.outgoers().nodes():f.openNeighborhood().nodes(),c(g,0)}for(var p=function(){for(var e=o[v].id(),t=[],n={},l={},u={},d=new ln(function(e,t){return u[e]-u[t]}),f=0;f<o.length;f++){var g=o[f].id();n[g]=[],l[g]=0,u[g]=1/0}for(l[e]=1,u[e]=0,d.push(e);!d.empty();){var p=d.pop();if(t.push(p),i)for(var y=0;y<s[p].length;y++){var m=s[p][y],b=a.getElementById(p),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[p]+w&&(u[m]=u[p]+w,d.nodes.indexOf(m)<0?d.push(m):d.updateItem(m),l[m]=0,n[m]=[]),u[m]==u[p]+w&&(l[m]=l[m]+l[p],n[m].push(p))}else for(var E=0;E<s[p].length;E++){var T=s[p][E].id();u[T]==1/0&&(d.push(T),u[T]=u[p]+1),u[T]==u[p]+1&&(l[T]=l[T]+l[p],n[T].push(p))}}for(var _={},C=0;C<o.length;C++)_[o[C].id()]=0;for(;t.length>0;){for(var N=t.pop(),A=0;A<n[N].length;A++){var M=n[N][A];_[M]=_[M]+l[M]/l[N]*(1+_[N])}N!=o[v].id()&&c(N,h(N)+_[N])}},v=0;v<o.length;v++)p();var y={betweenness:function(e){var t=a.collection(e).id();return h(t)},betweennessNormalized:function(e){if(0==u)return 0;var t=a.collection(e).id();return h(t)/u}};return y.betweennessNormalised=y.betweennessNormalized,y}};Er.bc=Er.betweennessCentrality;var Tr=Xt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),_r=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Cr=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var a=0;a<t;a++)e[a*t+r]=e[a*t+r]/n}},Nr=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var a=0;a<n;a++)r[i*n+a]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+o]*t[o*n+s]}return r},Ar=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Nr(e,r,t);return e},Mr=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 Cr(r,t),r},Dr=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},kr=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Ir=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return Tr(e)}(e),a={},o=0;o<t.length;o++)a[t[o].id()]=o;for(var s,l=t.length,u=l*l,c=new Array(u),h=0;h<u;h++)c[h]=0;for(var d=0;d<n.length;d++){var f=n[d],g=a[f.source().id()],p=a[f.target().id()],v=_r(f,i.attributes);c[g*l+p]+=v,c[p*l+g]+=v}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,l,i.multFactor),Cr(c,l);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=Ar(c,l,i.expandFactor),c=Mr(s,l,i.inflateFactor),Dr(c,s,u,4)||(y=!0),m++;var b=function(e,t,n,r){for(var i=[],a=0;a<t;a++){for(var o=[],s=0;s<t;s++)Math.round(1e3*e[a*t+s])/1e3>0&&o.push(n[s]);0!==o.length&&i.push(r.collection(o))}return i}(c,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&&kr(e[t],e[n])&&e.splice(n,1);return e}(b),b},Pr={markovClustering:Ir,mcl:Ir},Sr=function(e){return e},Lr=function(e,t){return Math.abs(t-e)},Or=function(e,t,n){return e+Lr(t,n)},Rr=function(e,t,n){return e+Math.pow(n-t,2)},Br=function(e){return Math.sqrt(e)},Fr=function(e,t,n){return Math.max(e,Lr(t,n))},zr=function(e,t,n,r,i){for(var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Sr,o=r,s=0;s<e;s++)o=i(o,t(s),n(s));return a(o)},Vr={euclidean:function(e,t,n){return e>=2?zr(e,t,n,0,Rr,Br):zr(e,t,n,0,Or)},squaredEuclidean:function(e,t,n){return zr(e,t,n,0,Rr)},manhattan:function(e,t,n){return zr(e,t,n,0,Or)},max:function(e,t,n){return zr(e,t,n,-1/0,Fr)}};function Gr(e,t,n,r,i,a){var o;return o=Ae(e)?e:Vr[e]||Vr.euclidean,0===t&&Ae(e)?o(i,a):o(t,n,r,i,a)}Vr["squared-euclidean"]=Vr.squaredEuclidean,Vr.squaredeuclidean=Vr.squaredEuclidean;var Yr=Xt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Xr=function(e){return Yr(e)},Ur=function(e,t,n,r,i){var a="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},o=n,s=t;return Gr(e,r.length,a,function(e){return r[e](t)},o,s)},jr=function(e,t,n){for(var r=n.length,i=new Array(r),a=new Array(r),o=new Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,a[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()*(a[c]-i[c])+i[c];o[u]=s}return o},Hr=function(e,t,n,r,i){for(var a=1/0,o=0,s=0;s<t.length;s++){var l=Ur(n,e,t[s],r,i);l<a&&(a=l,o=s)}return o},Wr=function(e,t,n){for(var r=[],i=null,a=0;a<t.length;a++)n[(i=t[a]).id()]===e&&r.push(i);return r},qr=function(e,t,n){return Math.abs(t-e)<=n},Kr=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},Zr=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},$r=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)];Zr(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var a=0;a<t;a++)n[a]=e[Math.floor(Math.random()*e.length)];return n},Qr=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=Ur("manhattan",t[i],e,n,"kMedoids");return r},Jr=function(e,t,n,r,i){for(var a,o,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 u=0;u<e.length;u++)for(var c=0;c<i.attributes.length;c++){a=0,o=0;for(var h=0;h<t.length;h++)a+=r[h][u]*i.attributes[c](t[h]),o+=r[h][u];e[u][c]=a/o}},ei=function(e,t,n,r,i){for(var a=0;a<e.length;a++)t[a]=e[a].slice();for(var o,s,l,u=2/(i.m-1),c=0;c<n.length;c++)for(var h=0;h<r.length;h++){o=0;for(var d=0;d<n.length;d++)s=Ur(i.distance,r[h],n[c],i.attributes,"cmeans"),l=Ur(i.distance,r[h],n[d],i.attributes,"cmeans"),o+=Math.pow(s/l,u);e[h][c]=1/o}},ti=function(e){var t,n,r,i,a,o=this.cy(),s=this.nodes(),l=Xr(e);i=new Array(s.length);for(var u=0;u<s.length;u++)i[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 h=0;h<s.length;h++){for(var d=0,f=0;f<l.k;f++)r[h][f]=Math.random(),d+=r[h][f];for(var g=0;g<l.k;g++)r[h][g]=r[h][g]/d}n=new Array(l.k);for(var p=0;p<l.k;p++)n[p]=new Array(l.attributes.length);a=new Array(s.length);for(var v=0;v<s.length;v++)a[v]=new Array(l.k);for(var y=!0,m=0;y&&m<l.maxIterations;)y=!1,Jr(n,s,r,a,l),ei(r,i,n,s,l),Kr(r,i,l.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var i,a,o=new Array(n.k),s=0;s<o.length;s++)o[s]=[];for(var l=0;l<t.length;l++){i=-1/0,a=-1;for(var u=0;u<t[0].length;u++)t[l][u]>i&&(i=t[l][u],a=u);o[a].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}},ni={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,a=Xr(e),o=new Array(a.k),s={};a.testMode?"number"==typeof a.testCentroids?(a.testCentroids,t=jr(r,a.k,a.attributes)):t="object"===X(a.testCentroids)?a.testCentroids:jr(r,a.k,a.attributes):t=jr(r,a.k,a.attributes);for(var l=!0,u=0;l&&u<a.maxIterations;){for(var c=0;c<r.length;c++)s[(i=r[c]).id()]=Hr(i,t,a.distance,a.attributes,"kMeans");l=!1;for(var h=0;h<a.k;h++){var d=Wr(h,r,s);if(0!==d.length){for(var f=a.attributes.length,g=t[h],p=new Array(f),v=new Array(f),y=0;y<f;y++){v[y]=0;for(var m=0;m<d.length;m++)i=d[m],v[y]+=a.attributes[y](i);p[y]=v[y]/d.length,qr(p[y],g[y],a.sensitivityThreshold)||(l=!0)}t[h]=p,o[h]=n.collection(d)}}u++}return o},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),a=null,o=Xr(e),s=new Array(o.k),l={},u=new Array(o.k);o.testMode?"number"==typeof o.testCentroids||(t="object"===X(o.testCentroids)?o.testCentroids:$r(i,o.k)):t=$r(i,o.k);for(var c=!0,h=0;c&&h<o.maxIterations;){for(var d=0;d<i.length;d++)l[(a=i[d]).id()]=Hr(a,t,o.distance,o.attributes,"kMedoids");c=!1;for(var f=0;f<t.length;f++){var g=Wr(f,i,l);if(0!==g.length){u[f]=Qr(t[f],g,o.attributes);for(var p=0;p<g.length;p++)(n=Qr(g[p],g,o.attributes))<u[f]&&(u[f]=n,t[f]=g[p],c=!0);s[f]=r.collection(g)}}h++}return s},fuzzyCMeans:ti,fcm:ti},ri=Xt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),ii={single:"min",complete:"max"},ai=function(e,t,n,r,i){for(var a,o=0,s=1/0,l=i.attributes,u=function(e,t){return Gr(i.distance,l.length,function(t){return l[t](e)},function(e){return l[e](t)},e,t)},c=0;c<e.length;c++){var h=e[c].key,d=n[h][r[h]];d<s&&(o=h,s=d)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var f,g=t[o],p=t[r[o]];f="dendrogram"===i.mode?{left:g,right:p,key:g.key}:{value:g.value.concat(p.value),key:g.key},e[g.index]=f,e.splice(p.index,1),t[g.key]=f;for(var v=0;v<e.length;v++){var y=e[v];g.key===y.key?a=1/0:"min"===i.linkage?(a=n[g.key][y.key],n[g.key][y.key]>n[p.key][y.key]&&(a=n[p.key][y.key])):"max"===i.linkage?(a=n[g.key][y.key],n[g.key][y.key]<n[p.key][y.key]&&(a=n[p.key][y.key])):a="mean"===i.linkage?(n[g.key][y.key]*g.size+n[p.key][y.key]*p.size)/(g.size+p.size):"dendrogram"===i.mode?u(y.value,g.value):u(y.value[0],g.value[0]),n[g.key][y.key]=n[y.key][g.key]=a}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===g.key||r[b]===p.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[m].index=m}return g.key=p.key=g.index=p.index=null,!0},oi=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&oi(e.left,t),e.right&&oi(e.right,t)))},si=function(e,t){if(!e)return"";if(e.left&&e.right){var n=si(e.left,t),r=si(e.right,t),i=t.add({group:"nodes",data:{id:n+","+r}});return t.add({group:"edges",data:{source:n,target:i.id()}}),t.add({group:"edges",data:{source:r,target:i.id()}}),i.id()}return e.value?e.value.id():void 0},li=function(e,t,n){if(!e)return[];var r=[],i=[],a=[];return 0===t?(e.left&&oi(e.left,r),e.right&&oi(e.right,i),a=r.concat(i),[n.collection(a)]):1===t?e.value?[n.collection(e.value)]:(e.left&&oi(e.left,r),e.right&&oi(e.right,i),[n.collection(r),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(r=li(e.left,t-1,n)),e.right&&(i=li(e.right,t-1,n)),r.concat(i))},ui=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=ri(e),n=ii[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,a=function(e,t){return Gr(r.distance,i.length,function(t){return i[t](e)},function(e){return i[e](t)},e,t)},o=[],s=[],l=[],u=[],c=0;c<n.length;c++){var h={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};o[c]=h,u[c]=h,s[c]=[],l[c]=0}for(var d=0;d<o.length;d++)for(var f=0;f<=d;f++){var g=void 0;g="dendrogram"===r.mode?d===f?1/0:a(o[d].value,o[f].value):d===f?1/0:a(o[d].value[0],o[f].value[0]),s[d][f]=g,s[f][d]=g,g<s[d][l[d]]&&(l[d]=f)}for(var p,v=ai(o,u,s,l,r);v;)v=ai(o,u,s,l,r);return"dendrogram"===r.mode?(p=li(o[0],r.dendrogramDepth,t),r.addDendrogram&&si(o[0],t)):(p=new Array(o.length),o.forEach(function(e,n){e.key=e.index=null,p[n]=t.collection(e.value)})),p},ci={hierarchicalClustering:ui,hca:ui},hi=Xt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),di=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-Gr(e,r.length,function(e){return i(t,e)},function(e){return i(n,e)},t,n)},fi=function(e,t){var n=null;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var a=0,o=e.length-1;o>=0;o--){var s=e[o];i?isFinite(s)||(e[o]=-1/0,a++):e.splice(o,1)}r&&e.sort(function(e,t){return e-t});var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+a]:(e[u-1+a]+e[u+a])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,a=t;a<n;a++){var o=e[a];isFinite(o)&&(r+=o,i++)}return r/i}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.min(a,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.max(a,r))}return r}(e):t,n},gi=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var a=-1,o=-1/0,s=0;s<n.length;s++){var l=n[s];t[i*e+l]>o&&(a=l,o=t[i*e+l])}a>0&&r.push(a)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},pi=function(e){for(var t,n,r,i,a,o,s=this.cy(),l=this.nodes(),u=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Rt("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some(function(e){return e===n})||ke(n)||Rt("Preference must be one of [".concat(r.map(function(e){return"'".concat(e,"'")}).join(", "),"] or a number. Got: ").concat(n)),hi(e)}(e),c={},h=0;h<l.length;h++)c[l[h].id()]=h;n=(t=l.length)*t,r=new Array(n);for(var d=0;d<n;d++)r[d]=-1/0;for(var f=0;f<t;f++)for(var g=0;g<t;g++)f!==g&&(r[f*t+g]=di(u.distance,l[f],l[g],u.attributes));i=fi(r,u.preference);for(var p=0;p<t;p++)r[p*t+p]=i;a=new Array(n);for(var v=0;v<n;v++)a[v]=0;o=new Array(n);for(var y=0;y<n;y++)o[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var E,T=new Array(t*u.minIterations),_=0;_<T.length;_++)T[_]=0;for(E=0;E<u.maxIterations;E++){for(var C=0;C<t;C++){for(var N=-1/0,A=-1/0,M=-1,D=0,k=0;k<t;k++)m[k]=a[C*t+k],(D=o[C*t+k]+r[C*t+k])>=N?(A=N,N=D,M=k):D>A&&(A=D);for(var I=0;I<t;I++)a[C*t+I]=(1-u.damping)*(r[C*t+I]-N)+u.damping*m[I];a[C*t+M]=(1-u.damping)*(r[C*t+M]-A)+u.damping*m[M]}for(var P=0;P<t;P++){for(var S=0,L=0;L<t;L++)m[L]=o[L*t+P],b[L]=Math.max(0,a[L*t+P]),S+=b[L];S-=b[P],b[P]=a[P*t+P],S+=b[P];for(var O=0;O<t;O++)o[O*t+P]=(1-u.damping)*Math.min(0,S-b[O])+u.damping*m[O];o[P*t+P]=(1-u.damping)*(S-b[P])+u.damping*m[P]}for(var R=0,B=0;B<t;B++){var F=o[B*t+B]+a[B*t+B]>0?1:0;T[E%u.minIterations*t+B]=F,R+=F}if(R>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var z=0,V=0;V<t;V++){x[V]=0;for(var G=0;G<u.minIterations;G++)x[V]+=T[G*t+V];0!==x[V]&&x[V]!==u.minIterations||z++}if(z===t)break}}for(var Y=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r}(t,a,o),X=function(e,t,n){for(var r=gi(e,t,n),i=0;i<n.length;i++){for(var a=[],o=0;o<r.length;o++)r[o]===n[i]&&a.push(o);for(var s=-1,l=-1/0,u=0;u<a.length;u++){for(var c=0,h=0;h<a.length;h++)c+=t[a[h]*e+a[u]];c>l&&(s=u,l=c)}n[i]=a[s]}return gi(e,t,n)}(t,r,Y),U={},j=0;j<Y.length;j++)U[Y[j]]=[];for(var H=0;H<l.length;H++){var W=X[c[l[H].id()]];null!=W&&U[W].push(l[H])}for(var q=new Array(Y.length),K=0;K<Y.length;K++)q[K]=s.collection(U[Y[K]]);return q},vi={affinityPropagation:pi,ap:pi},yi=Xt({root:void 0,directed:!1}),mi={hierholzer:function(e){if(!De(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,a=yi(e),o=a.root,s=a.directed,l=this,u=!1;o&&(i=Ne(o)?this.filter(o)[0].id():o[0].id());var c={},h={};s?l.forEach(function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),a=e.outdegree(!0),o=i-a,s=a-i;1==o?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||o>1)&&(u=!0),c[t]=[],e.outgoers().forEach(function(e){e.isEdge()&&c[t].push(e.id())})}else h[t]=[void 0,e.target().id()]}):l.forEach(function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach(function(e){return c[t].push(e.id())})):h[t]=[e.source().id(),e.target().id()]});var d={found:!1,trail:void 0};if(u)return d;if(r&&n)if(s){if(i&&r!=i)return d;i=r}else{if(i&&r!=i&&n!=i)return d;i||(i=r)}else i||(i=l[0].id());var f=function(e){for(var t,n,r,i=e,a=[e];c[i].length;)t=c[i].shift(),n=h[t][0],i!=(r=h[t][1])?(c[r]=c[r].filter(function(e){return e!=t}),i=r):s||i==n||(c[n]=c[n].filter(function(e){return e!=t}),i=n),a.unshift(t),a.unshift(i);return a},g=[],p=[];for(p=f(i);1!=p.length;)0==c[p[0]].length?(g.unshift(l.getElementById(p.shift())),g.unshift(l.getElementById(p.shift()))):p=f(p.shift()).concat(p);for(var v in g.unshift(l.getElementById(p.shift())),c)if(c[v].length)return d;return d.found=!0,d.trail=this.spawn(g,!0),d}},bi=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function(l,u,c){l===c&&(r+=1),t[u]={id:n,low:n++,cutVertex:!1};var h,d,f,g,p=e.getElementById(u).connectedEdges().intersection(e);0===p.size()?i.push(e.spawn(e.getElementById(u))):p.forEach(function(n){h=n.source().id(),d=n.target().id(),(f=h===u?d:h)!==c&&(g=n.id(),o[g]||(o[g]=!0,a.push({x:u,y:f,edge:n})),f in t?t[u].low=Math.min(t[u].low,t[f].id):(s(l,f,u),t[u].low=Math.min(t[u].low,t[f].low),t[u].id<=t[f].low&&(t[u].cutVertex=!0,function(n,r){for(var o=a.length-1,s=[],l=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach(function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter(function(e){return e.isLoop()})):l.merge(i)})}),i.push(l)}(u,f))))})};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}});var l=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(l),components:i}},xi=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),h=l.merge(c);r.push(h),a=a.difference(h)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:a,components:r}},wi={};[Jt,cn,hn,fn,pn,yn,wn,vr,mr,xr,Er,Pr,ni,ci,vi,mi,{hopcroftTarjanBiconnected:bi,htbc:bi,htb:bi,hopcroftTarjanBiconnectedComponents:bi},{tarjanStronglyConnected:xi,tsc:xi,tscc:xi,tarjanStronglyConnectedComponents:xi}].forEach(function(e){$e(wi,e)});
1
+ import{h as e,b as t}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-BS-h5UZc.js";import{p as n,t as r,b as i,h as a,d as o,e as s,i as l,j as u,k as c,l as h,m as d,g as f,n as g,q as p,u as v,v as y,x as m,y as b,f as x,z as w,A as E,B as T,D as _,E as C,R as N,F as A,G as M}from"./index-DwXbA4il.js";function D(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{a as k}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CkYd2Guw.js";function I(e,t,n){let r=void 0!==t?t:[];return s(h(e),e=>{let t=e[1],i=e[0],a=l(t),o=e=>!c(e,r,n),s=u(i,t,a);if("object"==typeof s)switch(s.TAG){case"KEntityId":let e=s._0;return o(e)?[i,e,!1]:void 0;case"KArrayOfEntityIds":let t=s._0;return o(t)?[i,t,!0]:void 0;default:return}})}function P(e,t,n){return 0!==I(e,void 0!==t?t:[],n).length}function S(e,t,n){return n?s(f(g(i(e.dict,t),p),[]),d):v(y(e.dict,t),[],e=>[e])}function L(e){let t=I(e.schema,void 0,void 0),s=n(e),l={};s.forEach(t=>{l[t.key]=r(e,t)});let u=s.map(t=>({id:t.key,label:r(e,t),group:e.readModelName})),c=s.flatMap(n=>t.flatMap(t=>{let r=t[1];return S(n,t[0],t[2]).map(t=>{let n=i(l,t);return void 0!==n?{id:t,label:n,group:e.readModelName}:{id:t,label:(o=t,o.length>8?o.slice(0,8)+"…":o),group:a(r)};var o})})),h=o(u.concat(c),[],(e,t)=>e.some(e=>e.id===t.id)?e:e.concat([t])),d=s.flatMap(e=>t.flatMap(t=>{let n=t[0];return S(e,n,t[2]).filter(t=>t!==e.key).map(t=>({from:e.key,to_:t,label:a(n)}))}));return{nodes:h,edges:d}}function O(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 B(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,Y(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function F(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,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 a,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,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function z(e,t,n){return(t=Y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(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,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}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 G(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||U(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 Y(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 X(e){return X="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},X(e)}function U(e,t){if(e){if("string"==typeof e)return O(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(e,t):void 0}}var j="undefined"==typeof window?null:window,H=j?j.navigator:null;j&&j.document;var W,q,K,Z,$,Q,J,ee,te,ne,re,ie,ae,oe,se,le,ue,ce,he,de,fe,ge,pe,ve,ye,me,be,xe,we=X(""),Ee=X({}),Te=X(function(){}),_e="undefined"==typeof HTMLElement?"undefined":X(HTMLElement),Ce=function(e){return e&&e.instanceString&&Ae(e.instanceString)?e.instanceString():null},Ne=function(e){return null!=e&&X(e)==we},Ae=function(e){return null!=e&&X(e)===Te},Me=function(e){return!Pe(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},De=function(e){return null!=e&&X(e)===Ee&&!Me(e)&&e.constructor===Object},ke=function(e){return null!=e&&X(e)===X(1)&&!isNaN(e)},Ie=function(e){return"undefined"===_e?void 0:null!=e&&e instanceof HTMLElement},Pe=function(e){return Se(e)||Le(e)},Se=function(e){return"collection"===Ce(e)&&e._private.single},Le=function(e){return"collection"===Ce(e)&&!e._private.single},Oe=function(e){return"core"===Ce(e)},Re=function(e){return"stylesheet"===Ce(e)},Be=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},Fe=function(e){return function(e){return null!=e&&X(e)===Ee}(e)&&Ae(e.then)},ze=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,a=t.apply(this,i),o=n.cache;return(r=o[a])||(r=o[a]=e.apply(this,i)),r};return n.cache={},n},Ve=ze(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Ge=ze(function(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Ye=ze(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),Xe=function(e){return Be(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Ue=function(e,t){return e.slice(-1*t.length)===t},je="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",He="rgb[a]?\\(("+je+"[%]?)\\s*,\\s*("+je+"[%]?)\\s*,\\s*("+je+"[%]?)(?:\\s*,\\s*("+je+"))?\\)",We="rgb[a]?\\((?:"+je+"[%]?)\\s*,\\s*(?:"+je+"[%]?)\\s*,\\s*(?:"+je+"[%]?)(?:\\s*,\\s*(?:"+je+"))?\\)",qe="hsl[a]?\\(("+je+")\\s*,\\s*("+je+"[%])\\s*,\\s*("+je+"[%])(?:\\s*,\\s*("+je+"))?\\)",Ke="hsl[a]?\\((?:"+je+")\\s*,\\s*(?:"+je+"[%])\\s*,\\s*(?:"+je+"[%])(?:\\s*,\\s*(?:"+je+"))?\\)",Ze=function(e,t){return e<t?-1:e>t?1:0},$e=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];e[o]=r[o]}}return e},Qe=function(e){return(Me(e)?e:null)||function(e){return Je[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("^"+He+"$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var 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,a,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("^"+qe+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(a=c[4])&&((a=parseFloat(a))<0||a>1))return;if(0===r)o=s=l=Math.round(255*i);else{var h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;o=Math.round(255*u(d,h,n+1/3)),s=Math.round(255*u(d,h,n)),l=Math.round(255*u(d,h,n-1/3))}t=[o,s,l,a]}return t}(e)},Je={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]},et=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(De(a))throw Error("Tried to set map with object key");i<n.length-1?(null==t[a]&&(t[a]={}),t=t[a]):t[a]=e.value}},tt=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(De(a))throw Error("Tried to get map with object key");if(null==(t=t[a]))return t}return t},nt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function it(){if(q)return W;return q=1,W=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function at(){if(Q)return $;Q=1;var e=function(){if(Z)return K;Z=1;var e="object"==typeof nt&&nt&&nt.Object===Object&&nt;return K=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return $=n}function ot(){if(ie)return re;ie=1;var e=function(){if(ne)return te;ne=1;var e=/\s/;return te=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},te}(),t=/^\s+/;return re=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},re}function st(){if(oe)return ae;oe=1;var e=at().Symbol;return ae=e}function lt(){if(de)return he;de=1;var e=st(),t=function(){if(le)return se;le=1;var e=st(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;return se=function(e){var t=n.call(e,i),a=e[i];try{e[i]=void 0;var o=!0}catch(l){}var s=r.call(e);return o&&(t?e[i]=a:delete e[i]),s}}(),n=function(){if(ce)return ue;ce=1;var e=Object.prototype.toString;return ue=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return he=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function ut(){if(ve)return pe;ve=1;var e=lt(),t=ge?fe:(ge=1,fe=function(e){return null!=e&&"object"==typeof e});return pe=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}var ct=rt(function(){if(xe)return be;xe=1;var e=it(),t=function(){if(ee)return J;ee=1;var e=at();return J=function(){return e.Date.now()}}(),n=function(){if(me)return ye;me=1;var e=ot(),t=it(),n=ut(),r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;return ye=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=i.test(s);return u||a.test(s)?o(s.slice(2),u?2:8):r.test(s)?NaN:+s}}(),r=Math.max,i=Math.min;return be=function(a,o,s){var l,u,c,h,d,f,g=0,p=!1,v=!1,y=!0;if("function"!=typeof a)throw new TypeError("Expected a function");function m(e){var t=l,n=u;return l=u=void 0,g=e,h=a.apply(n,t)}function b(e){var t=e-f;return void 0===f||t>=o||t<0||v&&e-g>=c}function x(){var e=t();if(b(e))return w(e);d=setTimeout(x,function(e){var t=o-(e-f);return v?i(t,c-(e-g)):t}(e))}function w(e){return d=void 0,y&&l?m(e):(l=u=void 0,h)}function E(){var e=t(),n=b(e);if(l=arguments,u=this,f=e,n){if(void 0===d)return function(e){return g=e,d=setTimeout(x,o),p?m(e):h}(f);if(v)return clearTimeout(d),d=setTimeout(x,o),m(f)}return void 0===d&&(d=setTimeout(x,o)),h}return o=n(o)||0,e(s)&&(p=!!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!==d&&clearTimeout(d),g=0,l=f=u=d=void 0},E.flush=function(){return void 0===d?h:w(t())},E}}()),ht=j?j.performance:null,dt=ht&&ht.now?function(){return ht.now()}:function(){return Date.now()},ft=function(){if(j){if(j.requestAnimationFrame)return function(e){j.requestAnimationFrame(e)};if(j.mozRequestAnimationFrame)return function(e){j.mozRequestAnimationFrame(e)};if(j.webkitRequestAnimationFrame)return function(e){j.webkitRequestAnimationFrame(e)};if(j.msRequestAnimationFrame)return function(e){j.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(dt())},1e3/60)}}(),gt=function(e){return ft(e)},pt=dt,vt=9261,yt=5381,mt=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vt;!(t=e.next()).done;)n=65599*n+t.value|0;return n},bt=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:vt)+e|0},xt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yt;return(t<<5)+t+e|0},wt=function(e){return 2097152*e[0]+e[1]},Et=function(e,t){return[bt(e[0],t[0]),xt(e[1],t[1])]},Tt=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return mt({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)},_t=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return mt({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},Ct=function(){return Nt(arguments)},Nt=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?_t(r):_t(r,t)}return t};function At(e,t,n){if(0===n)return e;var r=(t.x1+t.x2)/2,i=(t.y1+t.y2)/2,a=t.w/t.h,o=1/a,s=function(e,t,n,r,i){var a=i*Math.PI/180;return{x:Math.cos(a)*(e-n)-Math.sin(a)*(t-r)+n,y:Math.sin(a)*(e-n)+Math.cos(a)*(t-r)+r}}(e.x,e.y,r,i,n),l=function(e,t,n,r,i,a){return{x:(e-n)*i+n,y:(t-r)*a+r}}(s.x,s.y,r,i,a,o);return{x:l.x,y:l.y}}var Mt=!0,Dt=null!=console.warn,kt=null!=console.trace,It=Number.MAX_SAFE_INTEGER||9007199254740991,Pt=function(){return!0},St=function(){return!1},Lt=function(){return 0},Ot=function(){},Rt=function(e){throw new Error(e)},Bt=function(e){if(void 0===e)return Mt;Mt=!!e},Ft=function(e){Bt()&&(Dt?console.warn(e):(console.log(e),kt&&console.trace()))},zt=function(e){return null==e?e:Me(e)?e.slice():De(e)?function(e){return $e({},e)}(e):e},Vt=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},Gt={},Yt=function(){return Gt},Xt=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var a=t[i],o=null==n?void 0:n[a];r[a]=void 0===o?e[a]:o}return r}},Ut=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},jt=function(e){e.splice(0,e.length)},Ht=function(e,t,n){return n&&(t=Ye(n,t)),e[t]},Wt=function(e,t,n,r){n&&(t=Ye(n,t)),e[t]=r},qt="undefined"!=typeof Map?Map:function(){return B(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]}}])}(),Kt=function(){return B(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 r=0;r<n.length;r++)this.add(n[r])}},[{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)}}])}(),Zt="undefined"!==("undefined"==typeof Set?"undefined":X(Set))?Set:Kt,$t=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&Oe(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 Zt,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 a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var l=[];Me(t.classes)?l=t.classes:Ne(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var h=l[u];h&&""!==h&&i.classes.add(h)}this.createEmitter(),(void 0===n||n)&&this.restore();var d=t.style||t.css;d&&(Ft("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d))}else Rt("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else Rt("An element must have a core reference and parameters set")},Qt=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;De(t)&&!Pe(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||Ae(n)?r:n,n=Ae(n)?n:function(){};for(var a,o=this._private.cy,s=t=Ne(t)?this.filter(t):t,l=[],u=[],c={},h={},d={},f=0,g=this.byGroup(),p=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,u.push(m)),h[b]=0)}for(var x,w=function(){var t=e.bfs?l.shift():l.pop(),i=t.id();if(e.dfs){if(d[i])return 0;d[i]=!0,u.push(t)}var o,s=h[i],g=c[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===(o=n(t,g,b,f++,s)))return a=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],T=E.connectedNodes().filter(function(e){return!e.same(t)&&p.has(e)}),_=T.id();0===T.length||d[_]||(T=T[0],l.push(T),e.bfs&&(d[_]=!0,u.push(T)),c[_]=E,h[_]=h[i]+1)}};0!==l.length&&(0===(x=w())||1!==x););for(var E=o.collection(),T=0;T<u.length;T++){var _=u[T],C=c[_.id()];null!=C&&E.push(C),E.push(_)}return{path:o.collection(E),found:o.collection(a)}}},Jt={breadthFirstSearch:Qt({bfs:!0}),depthFirstSearch:Qt({dfs:!0})};Jt.bfs=Jt.breadthFirstSearch,Jt.dfs=Jt.depthFirstSearch;var en,tn,nn,rn={exports:{}},an=rn.exports;function on(){return en||(en=1,e=rn,function(){var t,n,r,i,a,o,s,l,u,c,h,d,f,g,p;r=Math.floor,c=Math.min,n=function(e,t){return e<t?-1:e>t?1:0},u=function(e,t,i,a,o){var s;if(null==i&&(i=0),null==o&&(o=n),i<0)throw new Error("lo must be non-negative");for(null==a&&(a=e.length);i<a;)o(t,e[s=r((i+a)/2)])<0?a=s:i=s+1;return[].splice.apply(e,[i,i-i].concat(t)),t},o=function(e,t,r){return null==r&&(r=n),e.push(t),g(e,0,e.length-1,r)},a=function(e,t){var r,i;return null==t&&(t=n),r=e.pop(),e.length?(i=e[0],e[0]=r,p(e,0,t)):i=r,i},l=function(e,t,r){var i;return null==r&&(r=n),i=e[0],e[0]=t,p(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],p(e,0,r)),t},i=function(e,t){var i,a,o,s,l,u;for(null==t&&(t=n),l=[],a=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;a<o;a++)i=s[a],l.push(p(e,i,t));return l},f=function(e,t,r){var i;if(null==r&&(r=n),-1!==(i=e.indexOf(t)))return g(e,0,i,r),p(e,i,r)},h=function(e,t,r){var a,o,l,u,c;if(null==r&&(r=n),!(o=e.slice(0,t)).length)return o;for(i(o,r),l=0,u=(c=e.slice(t)).length;l<u;l++)a=c[l],s(o,a,r);return o.sort(r).reverse()},d=function(e,t,r){var o,s,l,h,d,f,g,p,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,f=(g=e.slice(t)).length;h<f;h++)r(o=g[h],s)<0&&(u(l,o,0,null,r),l.pop(),s=l[l.length-1]);return l}for(i(e,r),v=[],d=0,p=c(t,e.length);0<=p?d<p:d>p;0<=p?++d:--d)v.push(a(e,r));return v},g=function(e,t,r,i){var a,o,s;for(null==i&&(i=n),a=e[r];r>t&&i(a,o=e[s=r-1>>1])<0;)e[r]=o,r=s;return e[r]=a},p=function(e,t,r){var i,a,o,s,l;for(null==r&&(r=n),a=e.length,l=t,o=e[t],i=2*t+1;i<a;)(s=i+1)<a&&!(r(e[i],e[s])<0)&&(i=s),e[t]=e[i],i=2*(t=i)+1;return e[t]=o,g(e,l,t,r)},t=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=o,e.pop=a,e.replace=l,e.pushpop=s,e.heapify=i,e.updateItem=f,e.nlargest=h,e.nsmallest=d,e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return a(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 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(an)),rn.exports;var e}var sn,ln=rt(nn?tn:(nn=1,tn=on())),un=Xt({root:null,weight:function(e){return 1},directed:!1}),cn={dijkstra:function(e){if(!De(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=un(e),r=n.root,i=n.weight,a=n.directed,o=this,s=i,l=Ne(r)?this.filter(r)[0]:r[0],u={},c={},h={},d=this.byGroup(),f=d.nodes,g=d.edges;g.unmergeBy(function(e){return e.isLoop()});for(var p=function(e){return u[e.id()]},v=function(e,t){u[e.id()]=t,y.updateItem(e)},y=new ln(function(e,t){return p(e)-p(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=(a?e.edgesTo(t):e.edgesWith(t)).intersect(g),i=1/0,o=0;o<r.length;o++){var l=r[o],u=s(l);(u<i||!n)&&(i=u,n=l)}return{edge:n,dist:i}};y.size()>0;){var w=y.pop(),E=p(w),T=w.id();if(h[T]=E,E!==1/0)for(var _=w.neighborhood().intersect(f),C=0;C<_.length;C++){var N=_[C],A=N.id(),M=x(w,N),D=E+M.dist;D<p(N)&&(v(N,D),c[A]={node:w,edge:M.edge})}}return{distanceTo:function(e){var t=Ne(e)?f.filter(e)[0]:e[0];return h[t.id()]},pathTo:function(e){var t=Ne(e)?f.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);c[i];){var a=c[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return o.spawn(n)}}}},hn={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=new Array(i),o=n,s=function(e){for(var t=0;t<a.length;t++){if(a[t].has(e))return t}},l=0;l<i;l++)a[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 h=u[c],d=h.source()[0],f=h.target()[0],g=s(d),p=s(f),v=a[g],y=a[p];g!==p&&(o.merge(h),v.merge(y),a.splice(p,1))}return o}},dn=Xt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),fn={aStar:function(e){var t=this.cy(),n=dn(e),r=n.root,i=n.goal,a=n.heuristic,o=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,u,c=r.id(),h=i.id(),d={},f={},g={},p=new ln(function(e,t){return f[e.id()]-f[t.id()]}),v=new Zt,y={},m={},b=function(e,t){p.push(e),v.add(t)},x=function(){l=p.pop(),u=l.id(),v.delete(u)},w=function(e){return v.has(e)};b(r,c),d[c]=0,f[c]=a(r);for(var E=0;p.size()>0;){if(x(),E++,u===h){for(var T=[],_=i,C=h,N=m[C];T.unshift(_),null!=N&&T.unshift(N),null!=(_=y[C]);)N=m[C=_.id()];return{found:!0,distance:d[u],path:this.spawn(T),steps:E}}g[u]=!0;for(var A=l._private.edges,M=0;M<A.length;M++){var D=A[M];if(this.hasElementWithId(D.id())&&(!o||D.data("source")===u)){var k=D.source(),I=D.target(),P=k.id()!==u?k:I,S=P.id();if(this.hasElementWithId(S)&&!g[S]){var L=d[u]+s(D);w(S)?L<d[S]&&(d[S]=L,f[S]=L+a(P),y[S]=l,m[S]=D):(d[S]=L,f[S]=L+a(P),b(P,S),y[S]=l,m[S]=D)}}}}return{found:!1,distance:void 0,path:void 0,steps:E}}},gn=Xt({weight:function(e){return 1},directed:!1}),pn={floydWarshall:function(e){for(var t=this.cy(),n=gn(e),r=n.weight,i=n.directed,a=r,o=this.byGroup(),s=o.nodes,l=o.edges,u=s.length,c=u*u,h=function(e){return s.indexOf(e)},d=function(e){return s[e]},f=new Array(c),g=0;g<c;g++){var p=g%u,v=(g-p)/u;f[g]=v===p?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 T=h(w),_=h(E),C=T*u+_,N=a(x);if(f[C]>N&&(f[C]=N,y[C]=_,m[C]=x),!i){var A=_*u+T;!i&&f[A]>N&&(f[A]=N,y[A]=T,m[A]=x)}}}for(var M=0;M<u;M++)for(var D=0;D<u;D++)for(var k=D*u+M,I=0;I<u;I++){var P=D*u+I,S=M*u+I;f[k]+f[S]<f[P]&&(f[P]=f[k]+f[S],y[P]=y[k])}var L=function(e){return h(function(e){return(Ne(e)?t.filter(e):e)[0]}(e))},O={distance:function(e,t){var n=L(e),r=L(t);return f[n*u+r]},path:function(e,n){var r=L(e),i=L(n),a=d(r);if(r===i)return a.collection();if(null==y[r*u+i])return t.collection();var o,s=t.collection(),l=r;for(s.merge(a);r!==i;)l=r,r=y[r*u+i],o=m[l*u+r],s.merge(o),s.merge(d(r));return s}};return O}},vn=Xt({weight:function(e){return 1},directed:!1,root:null}),yn={bellmanFord:function(e){var t=this,n=vn(e),r=n.weight,i=n.directed,a=n.root,o=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,h=u.nodes,d=h.length,f=new qt,g=!1,p=[];a=l.collection(a)[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(Ne(e)?l.$(e):e)[0]},b=0;b<d;b++){var x=h[b],w=y(x);x.same(a)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var E=!1,T=function(e,t,n,r,i,a){var o=r.dist+a;o<i.dist&&!n.same(r.edge)&&(i.dist=o,i.pred=e,i.edge=n,E=!0)},_=1;_<d;_++){E=!1;for(var C=0;C<v;C++){var N=c[C],A=N.source(),M=N.target(),D=o(N),k=y(A),I=y(M);T(A,0,N,k,I,D),i||T(M,0,N,I,k,D)}if(!E)break}if(E)for(var P=[],S=0;S<v;S++){var L=c[S],O=L.source(),R=L.target(),B=o(L),F=y(O).dist,z=y(R).dist;if(F+B<z||!i&&z+B<F){if(g||(Ft("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),!1===e.findNegativeWeightCycles)break;var V=[];F+B<z&&V.push(O),!i&&z+B<F&&V.push(R);for(var G=V.length,Y=0;Y<G;Y++){var X=V[Y],U=[X];U.push(y(X).edge);for(var j=y(X).pred;-1===U.indexOf(j);)U.push(j),U.push(y(j).edge),j=y(j).pred;for(var H=(U=U.slice(U.indexOf(j)))[0].id(),W=0,q=2;q<U.length;q+=2)U[q].id()<H&&(H=U[q].id(),W=q);(U=U.slice(W).concat(U.slice(0,W))).push(U[0]);var K=U.map(function(e){return e.id()}).join(",");-1===P.indexOf(K)&&(p.push(s.spawn(U)),P.push(K))}}}return{distanceTo:function(e){return y(m(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,r=[],i=m(e);;){if(null==i)return t.spawn();var o=y(i),l=o.edge,u=o.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:g,negativeWeightCycles:p}}},mn=Math.sqrt(2),bn=function(e,t,n){0===n.length&&Rt("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],l=n,u=l.length-1;u>=0;u--){var c=l[u],h=c[1],d=c[2];(t[h]===o&&t[d]===s||t[h]===s&&t[d]===o)&&l.splice(u,1)}for(var f=0;f<l.length;f++){var g=l[f];g[1]===s?(l[f]=g.slice(),l[f][1]=o):g[2]===s&&(l[f]=g.slice(),l[f][2]=o)}for(var p=0;p<t.length;p++)t[p]===s&&(t[p]=o);return l},xn=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=bn(i,e,t),n--}return t},wn={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/mn);if(!(i<2)){for(var l=[],u=0;u<a;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var h=1/0,d=[],f=new Array(i),g=new Array(i),p=new Array(i),v=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=o;y++){for(var m=0;m<i;m++)g[m]=m;var b=xn(g,l.slice(),i,s),x=b.slice();v(g,p);var w=xn(g,b,s,2),E=xn(p,x,s,2);w.length<=E.length&&w.length<h?(h=w.length,d=w,v(g,f)):E.length<=w.length&&E.length<h&&(h=E.length,d=E,v(p,f))}for(var T=this.spawn(d.map(function(e){return r[e[0]]})),_=this.spawn(),C=this.spawn(),N=f[0],A=0;A<f.length;A++){var M=f[A],D=n[A];M===N?_.merge(D):C.merge(D)}var k=function(t){var n=e.spawn();return t.forEach(function(t){n.merge(t),t.connectedEdges().forEach(function(t){e.contains(t)&&!T.contains(t)&&n.merge(t)})}),n},I=[k(_),k(C)];return{cut:T,components:I,partition1:_,partition2:C}}Rt("At least 2 nodes are required for Karger-Stein algorithm")}},En=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Tn=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},_n=function(e){return{x:e[0],y:e[1]}},Cn=function(e,t){return Math.atan2(t,e)-Math.PI/2},Nn=Math.log2||function(e){return Math.log(e)/Math.log(2)},An=function(e){return e>0?1:e<0?-1:0},Mn=function(e,t){return Math.sqrt(Dn(e,t))},Dn=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},kn=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},In=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Pn=function(e,t,n,r){return{x:In(e.x,t.x,n.x,r),y:In(e.y,t.y,n.y,r)}},Sn=function(e,t,n){return Math.max(e,Math.min(n,t))},Ln=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}}},On=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},Rn=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},Bn=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},Fn=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)t=n=r=i=a[0];else if(2===a.length)t=r=a[0],i=n=a[1];else if(4===a.length){var o=V(a,4);t=o[0],n=o[1],r=o[2],i=o[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},zn=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},Vn=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)))))))},Gn=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Yn=function(e,t){return Gn(e,t.x,t.y)},Xn=function(e,t){return Gn(e,t.x1,t.y1)&&Gn(e,t.x2,t.y2)},Un=null!==(sn=Math.hypot)&&void 0!==sn?sn:function(e,t){return Math.sqrt(e*e+t*t)};function jn(e,t,n,r,i,a){var o=function(e,t){if(e.length<3)throw new Error("Need at least 3 vertices");var n=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},r=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},i=function(e,t){return{x:e.x*t,y:e.y*t}},a=function(e,t){return e.x*t.y-e.y*t.x},o=function(e){var t=Un(e.x,e.y);return 0===t?{x:0,y:0}:{x:e.x/t,y:e.y/t}},s=function(e,t,o,s){var l=r(t,e),u=r(s,o),c=a(l,u);if(Math.abs(c)<1e-9)return n(e,i(l,.5));var h=a(r(o,e),u)/c;return n(e,i(l,h))},l=e.map(function(e){return{x:e.x,y:e.y}});(function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length];t+=r.x*i.y-i.x*r.y}return t/2})(l)<0&&l.reverse();for(var u=l.length,c=[],h=0;h<u;h++){var d=l[h],f=l[(h+1)%u],g=r(f,d),p=o({x:g.y,y:-g.x});c.push(p)}for(var v=c.map(function(e,r){return{p1:n(l[r],i(e,t)),p2:n(l[(r+1)%u],i(e,t))}}),y=[],m=0;m<u;m++){var b=v[(m-1+u)%u],x=v[m],w=s(b.p1,b.p2,x.p1,x.p2);y.push(w)}return y}(ar(e,t,n,r,i),a),s=Ln();return o.forEach(function(e){return Rn(s,e.x,e.y)}),s}var Hn=function(e,t,n,r,i,a,o){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?hr(i,a):u,h=i/2,d=a/2,f=(c=Math.min(c,h,d))!==h,g=c!==d;if(f){var p=r-d-o;if((s=ir(e,t,n,r,n-h+c-o,p,n+h-c+o,p,!1)).length>0)return s}if(g){var v=n+h+o;if((s=ir(e,t,n,r,v,r-d+c-o,v,r+d-c+o,!1)).length>0)return s}if(f){var y=r+d+o;if((s=ir(e,t,n,r,n-h+c-o,y,n+h-c+o,y,!1)).length>0)return s}if(g){var m=n-h-o;if((s=ir(e,t,n,r,m,r-d+c-o,m,r+d-c+o,!1)).length>0)return s}var b=n-h+c,x=r-d+c;if((l=nr(e,t,n,r,b,x,c+o)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+h-c,E=r-d+c;if((l=nr(e,t,n,r,w,E,c+o)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var T=n+h-c,_=r+d-c;if((l=nr(e,t,n,r,T,_,c+o)).length>0&&l[0]>=T&&l[1]>=_)return[l[0],l[1]];var C=n-h+c,N=r+d-c;return(l=nr(e,t,n,r,C,N,c+o)).length>0&&l[0]<=C&&l[1]>=N?[l[0],l[1]]:[]},Wn=function(e,t,n,r,i,a,o){var s=o,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,a),h=Math.max(r,a);return l-s<=e&&e<=u+s&&c-s<=t&&t<=h+s},qn=function(e,t,n,r,i,a,o,s,l){var u=Math.min(n,o,i)-l,c=Math.max(n,o,i)+l,h=Math.min(r,s,a)-l,d=Math.max(r,s,a)+l;return!(e<u||e>c||t<h||t>d)},Kn=function(e,t,n,r,i,a,o,s){var l=[];!function(e,t,n,r,i){var a,o,s,l,u,c,h,d;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),a=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,i[1]=0,h=t/3,a>0?(u=(u=s+Math.sqrt(a))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+u+c,h+=(u+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+u)/2,i[3]=h,i[5]=-h):(i[5]=i[3]=0,0===a?(d=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*d-h,i[4]=i[2]=-(d+h)):(l=(o=-o)*o*o,l=Math.acos(s/Math.sqrt(l)),d=2*Math.sqrt(o),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*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,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 h,d,f,g=-1,p=0;p<u.length;p++)h=Math.pow(1-u[p],2)*n+2*(1-u[p])*u[p]*i+u[p]*u[p]*o,d=Math.pow(1-u[p],2)*r+2*(1-u[p])*u[p]*a+u[p]*u[p]*s,f=Math.pow(h-e,2)+Math.pow(d-t,2),g>=0?f<g&&(g=f):g=f;return g},Zn=function(e,t,n,r,i,a){var o=[e-n,t-r],s=[i-n,a-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],h=c*c/l;return c<0?u:h>l?(e-i)*(e-i)+(t-a)*(t-a):u-h},$n=function(e,t,n){for(var r,i,a,o,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(a=n[2*(l+1)],o=n[2*(l+1)+1]):(a=n[2*(l+1-n.length/2)],o=n[2*(l+1-n.length/2)+1]),r==e&&a==e);else{if(!(r>=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},Qn=function(e,t,n,r,i,a,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 h,d=Math.cos(-u),f=Math.sin(-u),g=0;g<c.length/2;g++)c[2*g]=a/2*(n[2*g]*d-n[2*g+1]*f),c[2*g+1]=o/2*(n[2*g+1]*d+n[2*g]*f),c[2*g]+=r,c[2*g+1]+=i;if(l>0){var p=er(c,-l);h=Jn(p)}else h=c;return $n(e,t,h)},Jn=function(e){for(var t,n,r,i,a,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],i=e[4*c+3],c<e.length/4-1?(a=e[4*(c+1)],o=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(a=e[0],o=e[1],s=e[2],l=e[3]);var h=ir(t,n,r,i,a,o,s,l,!0);u[2*c]=h[0],u[2*c+1]=h[1]}return u},er=function(e,t){for(var n,r,i,a,o=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[2*(s+1)],a=e[2*(s+1)+1]):(i=e[0],a=e[1]);var l=a-r,u=-(i-n),c=Math.sqrt(l*l+u*u),h=l/c,d=u/c;o[4*s]=n+h*t,o[4*s+1]=r+d*t,o[4*s+2]=i+h*t,o[4*s+3]=a+d*t}return o},tr=function(e,t,n,r,i,a,o){return e-=i,t-=a,(e/=n/2+o)*e+(t/=r/2+o)*t<=1},nr=function(e,t,n,r,i,a,o){var s=[n-e,r-t],l=[e-i,t-a],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),h=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-o*o);if(h<0)return[];var d=(-c+Math.sqrt(h))/(2*u),f=(-c-Math.sqrt(h))/(2*u),g=Math.min(d,f),p=Math.max(d,f),v=[];if(g>=0&&g<=1&&v.push(g),p>=0&&p<=1&&v.push(p),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]},rr=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},ir=function(e,t,n,r,i,a,o,s,l){var u=e-i,c=n-e,h=o-i,d=t-a,f=r-t,g=s-a,p=h*d-g*u,v=c*d-f*u,y=g*c-h*f;if(0!==y){var m=p/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===p||0===v?rr(e,n,o)===o?[o,s]:rr(e,n,i)===i?[i,a]:rr(i,o,n)===n?[n,r]:[]:[]},ar=function(e,t,n,r,i){var a=[],o=r/2,s=i/2,l=t,u=n;a.push({x:l+o*e[0],y:u+s*e[1]});for(var c=1;c<e.length/2;c++)a.push({x:l+o*e[2*c],y:u+s*e[2*c+1]});return a},or=function(e,t,n,r,i,a,o,s){var l,u,c,h,d,f,g=[],p=new Array(n.length),v=!0;if(null==a&&(v=!1),v){for(var y=0;y<p.length/2;y++)p[2*y]=n[2*y]*a+r,p[2*y+1]=n[2*y+1]*o+i;if(s>0){var m=er(p,-s);u=Jn(m)}else u=p}else u=n;for(var b=0;b<u.length/2;b++)c=u[2*b],h=u[2*b+1],b<u.length/2-1?(d=u[2*(b+1)],f=u[2*(b+1)+1]):(d=u[0],f=u[1]),0!==(l=ir(e,t,r,i,c,h,d,f)).length&&g.push(l[0],l[1]);return g},sr=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(i-n)/i;return a<0&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},lr=function(e,t){var n=cr(e,t);return n=ur(n)},ur=function(e){for(var t,n,r=e.length/2,i=1/0,a=1/0,o=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);for(var u=2/(o-i),c=2/(s-a),h=0;h<r;h++)t=e[2*h]=e[2*h]*u,n=e[2*h+1]=e[2*h+1]*c,i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);if(a<-1)for(var d=0;d<r;d++)n=e[2*d+1]=e[2*d+1]+(-1-a);return e},cr=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,a=new Array(2*e),o=0;o<e;o++)i=o*n+r,a[2*o]=Math.cos(i),a[2*o+1]=Math.sin(-i);return a},hr=function(e,t){return Math.min(e/4,t/4,8)},dr=function(e,t){return Math.min(e/10,t/10,8)},fr=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function gr(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length],a={x:i.x-r.x,y:i.y-r.y},o={x:-a.y,y:a.x},s=Math.sqrt(o.x*o.x+o.y*o.y);t.push({x:o.x/s,y:o.y/s})}return t}function r(e,t){var n,r=1/0,i=-1/0,a=F(e);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o.x*t.x+o.y*t.y;r=Math.min(r,s),i=Math.max(i,s)}}catch(l){a.e(l)}finally{a.f()}return{min:r,max:i}}function i(e,t){return!(e.max<t.min||t.max<e.min)}var a,o=F([].concat(G(n(e)),G(n(t))));try{for(o.s();!(a=o.n()).done;){var s=a.value;if(!i(r(e,s),r(t,s)))return!1}}catch(l){o.e(l)}finally{o.f()}return!0}var pr=Xt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),vr={pageRank:function(e){for(var t=pr(e),n=t.dampingFactor,r=t.precision,i=t.iterations,a=t.weight,o=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,h=c*c,d=u.length,f=new Array(h),g=new Array(c),p=(1-n)/c,v=0;v<c;v++){for(var y=0;y<c;y++){f[v*c+y]=0}g[v]=0}for(var m=0;m<d;m++){var b=u[m],x=b.data("source"),w=b.data("target");if(x!==w){var E=l.indexOfId(x),T=l.indexOfId(w),_=a(b);f[T*c+E]+=_,g[E]+=_}}for(var C=1/c+p,N=0;N<c;N++)if(0===g[N])for(var A=0;A<c;A++){f[A*c+N]=C}else for(var M=0;M<c;M++){var D=M*c+N;f[D]=f[D]/g[N]+p}for(var k,I=new Array(c),P=new Array(c),S=0;S<c;S++)I[S]=1;for(var L=0;L<i;L++){for(var O=0;O<c;O++)P[O]=0;for(var R=0;R<c;R++)for(var B=0;B<c;B++){var F=R*c+B;P[R]+=f[F]*I[B]}kn(P),k=I,I=P,P=k;for(var z=0,V=0;V<c;V++){var G=k[V]-I[V];z+=G*G}if(z<r)break}return{rank:function(e){return e=o.collection(e)[0],I[l.indexOf(e)]}}}},yr=Xt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),mr={degreeCentralityNormalized:function(e){e=yr(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},a={},o=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var h=this.degreeCentrality(e);o<h.indegree&&(o=h.indegree),s<h.outdegree&&(s=h.outdegree),i[c]=h.indegree,a[c]=h.outdegree}return{indegree:function(e){return 0==o?0:(Ne(e)&&(e=t.filter(e)),i[e.id()]/o)},outdegree:function(e){return 0===s?0:(Ne(e)&&(e=t.filter(e)),a[e.id()]/s)}}}for(var d={},f=0,g=0;g<r;g++){var p=n[g];e.root=p;var v=this.degreeCentrality(e);f<v.degree&&(f=v.degree),d[p.id()]=v.degree}return{degree:function(e){return 0===f?0:(Ne(e)&&(e=t.filter(e)),d[e.id()]/f)}}},degreeCentrality:function(e){e=yr(e);var t=this.cy(),n=this,r=e,i=r.root,a=r.weight,o=r.directed,s=r.alpha;if(i=t.collection(i)[0],o){for(var l=i.connectedEdges(),u=l.filter(function(e){return e.target().same(i)&&n.has(e)}),c=l.filter(function(e){return e.source().same(i)&&n.has(e)}),h=u.length,d=c.length,f=0,g=0,p=0;p<u.length;p++)f+=a(u[p]);for(var v=0;v<c.length;v++)g+=a(c[v]);return{indegree:Math.pow(h,1-s)*Math.pow(f,s),outdegree:Math.pow(d,1-s)*Math.pow(g,s)}}for(var y=i.connectedEdges().intersection(n),m=y.length,b=0,x=0;x<y.length;x++)b+=a(y[x]);return{degree:Math.pow(m,1-s)*Math.pow(b,s)}}};mr.dc=mr.degreeCentrality,mr.dcn=mr.degreeCentralityNormalised=mr.degreeCentralityNormalized;var br=Xt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),xr={closenessCentralityNormalized:function(e){for(var t=br(e),n=t.harmonic,r=t.weight,i=t.directed,a=this.cy(),o={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:i}),c=0;c<l.length;c++){for(var h=0,d=l[c],f=0;f<l.length;f++)if(c!==f){var g=u.distance(d,l[f]);h+=n?1/g:g}n||(h=1/h),s<h&&(s=h),o[d.id()]=h}return{closeness:function(e){return 0==s?0:(e=Ne(e)?a.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=br(e),n=t.root,r=t.weight,i=t.directed,a=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var h=o.distanceTo(c);s+=a?1/h:h}}return a?s:1/s}};xr.cc=xr.closenessCentrality,xr.ccn=xr.closenessCentralityNormalised=xr.closenessCentralityNormalized;var wr=Xt({weight:null,directed:!1}),Er={betweennessCentrality:function(e){for(var t=wr(e),n=t.directed,r=t.weight,i=null!=r,a=this.cy(),o=this.nodes(),s={},l={},u=0,c=function(e,t){l[e]=t,t>u&&(u=t)},h=function(e){return l[e]},d=0;d<o.length;d++){var f=o[d],g=f.id();s[g]=n?f.outgoers().nodes():f.openNeighborhood().nodes(),c(g,0)}for(var p=function(){for(var e=o[v].id(),t=[],n={},l={},u={},d=new ln(function(e,t){return u[e]-u[t]}),f=0;f<o.length;f++){var g=o[f].id();n[g]=[],l[g]=0,u[g]=1/0}for(l[e]=1,u[e]=0,d.push(e);!d.empty();){var p=d.pop();if(t.push(p),i)for(var y=0;y<s[p].length;y++){var m=s[p][y],b=a.getElementById(p),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[p]+w&&(u[m]=u[p]+w,d.nodes.indexOf(m)<0?d.push(m):d.updateItem(m),l[m]=0,n[m]=[]),u[m]==u[p]+w&&(l[m]=l[m]+l[p],n[m].push(p))}else for(var E=0;E<s[p].length;E++){var T=s[p][E].id();u[T]==1/0&&(d.push(T),u[T]=u[p]+1),u[T]==u[p]+1&&(l[T]=l[T]+l[p],n[T].push(p))}}for(var _={},C=0;C<o.length;C++)_[o[C].id()]=0;for(;t.length>0;){for(var N=t.pop(),A=0;A<n[N].length;A++){var M=n[N][A];_[M]=_[M]+l[M]/l[N]*(1+_[N])}N!=o[v].id()&&c(N,h(N)+_[N])}},v=0;v<o.length;v++)p();var y={betweenness:function(e){var t=a.collection(e).id();return h(t)},betweennessNormalized:function(e){if(0==u)return 0;var t=a.collection(e).id();return h(t)/u}};return y.betweennessNormalised=y.betweennessNormalized,y}};Er.bc=Er.betweennessCentrality;var Tr=Xt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),_r=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Cr=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var a=0;a<t;a++)e[a*t+r]=e[a*t+r]/n}},Nr=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var a=0;a<n;a++)r[i*n+a]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+o]*t[o*n+s]}return r},Ar=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Nr(e,r,t);return e},Mr=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 Cr(r,t),r},Dr=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},kr=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Ir=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return Tr(e)}(e),a={},o=0;o<t.length;o++)a[t[o].id()]=o;for(var s,l=t.length,u=l*l,c=new Array(u),h=0;h<u;h++)c[h]=0;for(var d=0;d<n.length;d++){var f=n[d],g=a[f.source().id()],p=a[f.target().id()],v=_r(f,i.attributes);c[g*l+p]+=v,c[p*l+g]+=v}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,l,i.multFactor),Cr(c,l);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=Ar(c,l,i.expandFactor),c=Mr(s,l,i.inflateFactor),Dr(c,s,u,4)||(y=!0),m++;var b=function(e,t,n,r){for(var i=[],a=0;a<t;a++){for(var o=[],s=0;s<t;s++)Math.round(1e3*e[a*t+s])/1e3>0&&o.push(n[s]);0!==o.length&&i.push(r.collection(o))}return i}(c,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&&kr(e[t],e[n])&&e.splice(n,1);return e}(b),b},Pr={markovClustering:Ir,mcl:Ir},Sr=function(e){return e},Lr=function(e,t){return Math.abs(t-e)},Or=function(e,t,n){return e+Lr(t,n)},Rr=function(e,t,n){return e+Math.pow(n-t,2)},Br=function(e){return Math.sqrt(e)},Fr=function(e,t,n){return Math.max(e,Lr(t,n))},zr=function(e,t,n,r,i){for(var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Sr,o=r,s=0;s<e;s++)o=i(o,t(s),n(s));return a(o)},Vr={euclidean:function(e,t,n){return e>=2?zr(e,t,n,0,Rr,Br):zr(e,t,n,0,Or)},squaredEuclidean:function(e,t,n){return zr(e,t,n,0,Rr)},manhattan:function(e,t,n){return zr(e,t,n,0,Or)},max:function(e,t,n){return zr(e,t,n,-1/0,Fr)}};function Gr(e,t,n,r,i,a){var o;return o=Ae(e)?e:Vr[e]||Vr.euclidean,0===t&&Ae(e)?o(i,a):o(t,n,r,i,a)}Vr["squared-euclidean"]=Vr.squaredEuclidean,Vr.squaredeuclidean=Vr.squaredEuclidean;var Yr=Xt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Xr=function(e){return Yr(e)},Ur=function(e,t,n,r,i){var a="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},o=n,s=t;return Gr(e,r.length,a,function(e){return r[e](t)},o,s)},jr=function(e,t,n){for(var r=n.length,i=new Array(r),a=new Array(r),o=new Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,a[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()*(a[c]-i[c])+i[c];o[u]=s}return o},Hr=function(e,t,n,r,i){for(var a=1/0,o=0,s=0;s<t.length;s++){var l=Ur(n,e,t[s],r,i);l<a&&(a=l,o=s)}return o},Wr=function(e,t,n){for(var r=[],i=null,a=0;a<t.length;a++)n[(i=t[a]).id()]===e&&r.push(i);return r},qr=function(e,t,n){return Math.abs(t-e)<=n},Kr=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},Zr=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},$r=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)];Zr(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var a=0;a<t;a++)n[a]=e[Math.floor(Math.random()*e.length)];return n},Qr=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=Ur("manhattan",t[i],e,n,"kMedoids");return r},Jr=function(e,t,n,r,i){for(var a,o,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 u=0;u<e.length;u++)for(var c=0;c<i.attributes.length;c++){a=0,o=0;for(var h=0;h<t.length;h++)a+=r[h][u]*i.attributes[c](t[h]),o+=r[h][u];e[u][c]=a/o}},ei=function(e,t,n,r,i){for(var a=0;a<e.length;a++)t[a]=e[a].slice();for(var o,s,l,u=2/(i.m-1),c=0;c<n.length;c++)for(var h=0;h<r.length;h++){o=0;for(var d=0;d<n.length;d++)s=Ur(i.distance,r[h],n[c],i.attributes,"cmeans"),l=Ur(i.distance,r[h],n[d],i.attributes,"cmeans"),o+=Math.pow(s/l,u);e[h][c]=1/o}},ti=function(e){var t,n,r,i,a,o=this.cy(),s=this.nodes(),l=Xr(e);i=new Array(s.length);for(var u=0;u<s.length;u++)i[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 h=0;h<s.length;h++){for(var d=0,f=0;f<l.k;f++)r[h][f]=Math.random(),d+=r[h][f];for(var g=0;g<l.k;g++)r[h][g]=r[h][g]/d}n=new Array(l.k);for(var p=0;p<l.k;p++)n[p]=new Array(l.attributes.length);a=new Array(s.length);for(var v=0;v<s.length;v++)a[v]=new Array(l.k);for(var y=!0,m=0;y&&m<l.maxIterations;)y=!1,Jr(n,s,r,a,l),ei(r,i,n,s,l),Kr(r,i,l.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var i,a,o=new Array(n.k),s=0;s<o.length;s++)o[s]=[];for(var l=0;l<t.length;l++){i=-1/0,a=-1;for(var u=0;u<t[0].length;u++)t[l][u]>i&&(i=t[l][u],a=u);o[a].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}},ni={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,a=Xr(e),o=new Array(a.k),s={};a.testMode?"number"==typeof a.testCentroids?(a.testCentroids,t=jr(r,a.k,a.attributes)):t="object"===X(a.testCentroids)?a.testCentroids:jr(r,a.k,a.attributes):t=jr(r,a.k,a.attributes);for(var l=!0,u=0;l&&u<a.maxIterations;){for(var c=0;c<r.length;c++)s[(i=r[c]).id()]=Hr(i,t,a.distance,a.attributes,"kMeans");l=!1;for(var h=0;h<a.k;h++){var d=Wr(h,r,s);if(0!==d.length){for(var f=a.attributes.length,g=t[h],p=new Array(f),v=new Array(f),y=0;y<f;y++){v[y]=0;for(var m=0;m<d.length;m++)i=d[m],v[y]+=a.attributes[y](i);p[y]=v[y]/d.length,qr(p[y],g[y],a.sensitivityThreshold)||(l=!0)}t[h]=p,o[h]=n.collection(d)}}u++}return o},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),a=null,o=Xr(e),s=new Array(o.k),l={},u=new Array(o.k);o.testMode?"number"==typeof o.testCentroids||(t="object"===X(o.testCentroids)?o.testCentroids:$r(i,o.k)):t=$r(i,o.k);for(var c=!0,h=0;c&&h<o.maxIterations;){for(var d=0;d<i.length;d++)l[(a=i[d]).id()]=Hr(a,t,o.distance,o.attributes,"kMedoids");c=!1;for(var f=0;f<t.length;f++){var g=Wr(f,i,l);if(0!==g.length){u[f]=Qr(t[f],g,o.attributes);for(var p=0;p<g.length;p++)(n=Qr(g[p],g,o.attributes))<u[f]&&(u[f]=n,t[f]=g[p],c=!0);s[f]=r.collection(g)}}h++}return s},fuzzyCMeans:ti,fcm:ti},ri=Xt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),ii={single:"min",complete:"max"},ai=function(e,t,n,r,i){for(var a,o=0,s=1/0,l=i.attributes,u=function(e,t){return Gr(i.distance,l.length,function(t){return l[t](e)},function(e){return l[e](t)},e,t)},c=0;c<e.length;c++){var h=e[c].key,d=n[h][r[h]];d<s&&(o=h,s=d)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var f,g=t[o],p=t[r[o]];f="dendrogram"===i.mode?{left:g,right:p,key:g.key}:{value:g.value.concat(p.value),key:g.key},e[g.index]=f,e.splice(p.index,1),t[g.key]=f;for(var v=0;v<e.length;v++){var y=e[v];g.key===y.key?a=1/0:"min"===i.linkage?(a=n[g.key][y.key],n[g.key][y.key]>n[p.key][y.key]&&(a=n[p.key][y.key])):"max"===i.linkage?(a=n[g.key][y.key],n[g.key][y.key]<n[p.key][y.key]&&(a=n[p.key][y.key])):a="mean"===i.linkage?(n[g.key][y.key]*g.size+n[p.key][y.key]*p.size)/(g.size+p.size):"dendrogram"===i.mode?u(y.value,g.value):u(y.value[0],g.value[0]),n[g.key][y.key]=n[y.key][g.key]=a}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===g.key||r[b]===p.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[m].index=m}return g.key=p.key=g.index=p.index=null,!0},oi=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&oi(e.left,t),e.right&&oi(e.right,t)))},si=function(e,t){if(!e)return"";if(e.left&&e.right){var n=si(e.left,t),r=si(e.right,t),i=t.add({group:"nodes",data:{id:n+","+r}});return t.add({group:"edges",data:{source:n,target:i.id()}}),t.add({group:"edges",data:{source:r,target:i.id()}}),i.id()}return e.value?e.value.id():void 0},li=function(e,t,n){if(!e)return[];var r=[],i=[],a=[];return 0===t?(e.left&&oi(e.left,r),e.right&&oi(e.right,i),a=r.concat(i),[n.collection(a)]):1===t?e.value?[n.collection(e.value)]:(e.left&&oi(e.left,r),e.right&&oi(e.right,i),[n.collection(r),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(r=li(e.left,t-1,n)),e.right&&(i=li(e.right,t-1,n)),r.concat(i))},ui=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=ri(e),n=ii[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,a=function(e,t){return Gr(r.distance,i.length,function(t){return i[t](e)},function(e){return i[e](t)},e,t)},o=[],s=[],l=[],u=[],c=0;c<n.length;c++){var h={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};o[c]=h,u[c]=h,s[c]=[],l[c]=0}for(var d=0;d<o.length;d++)for(var f=0;f<=d;f++){var g=void 0;g="dendrogram"===r.mode?d===f?1/0:a(o[d].value,o[f].value):d===f?1/0:a(o[d].value[0],o[f].value[0]),s[d][f]=g,s[f][d]=g,g<s[d][l[d]]&&(l[d]=f)}for(var p,v=ai(o,u,s,l,r);v;)v=ai(o,u,s,l,r);return"dendrogram"===r.mode?(p=li(o[0],r.dendrogramDepth,t),r.addDendrogram&&si(o[0],t)):(p=new Array(o.length),o.forEach(function(e,n){e.key=e.index=null,p[n]=t.collection(e.value)})),p},ci={hierarchicalClustering:ui,hca:ui},hi=Xt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),di=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-Gr(e,r.length,function(e){return i(t,e)},function(e){return i(n,e)},t,n)},fi=function(e,t){var n=null;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var a=0,o=e.length-1;o>=0;o--){var s=e[o];i?isFinite(s)||(e[o]=-1/0,a++):e.splice(o,1)}r&&e.sort(function(e,t){return e-t});var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+a]:(e[u-1+a]+e[u+a])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,a=t;a<n;a++){var o=e[a];isFinite(o)&&(r+=o,i++)}return r/i}(e):"min"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.min(a,r))}return r}(e):"max"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.max(a,r))}return r}(e):t,n},gi=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var a=-1,o=-1/0,s=0;s<n.length;s++){var l=n[s];t[i*e+l]>o&&(a=l,o=t[i*e+l])}a>0&&r.push(a)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},pi=function(e){for(var t,n,r,i,a,o,s=this.cy(),l=this.nodes(),u=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Rt("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some(function(e){return e===n})||ke(n)||Rt("Preference must be one of [".concat(r.map(function(e){return"'".concat(e,"'")}).join(", "),"] or a number. Got: ").concat(n)),hi(e)}(e),c={},h=0;h<l.length;h++)c[l[h].id()]=h;n=(t=l.length)*t,r=new Array(n);for(var d=0;d<n;d++)r[d]=-1/0;for(var f=0;f<t;f++)for(var g=0;g<t;g++)f!==g&&(r[f*t+g]=di(u.distance,l[f],l[g],u.attributes));i=fi(r,u.preference);for(var p=0;p<t;p++)r[p*t+p]=i;a=new Array(n);for(var v=0;v<n;v++)a[v]=0;o=new Array(n);for(var y=0;y<n;y++)o[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var E,T=new Array(t*u.minIterations),_=0;_<T.length;_++)T[_]=0;for(E=0;E<u.maxIterations;E++){for(var C=0;C<t;C++){for(var N=-1/0,A=-1/0,M=-1,D=0,k=0;k<t;k++)m[k]=a[C*t+k],(D=o[C*t+k]+r[C*t+k])>=N?(A=N,N=D,M=k):D>A&&(A=D);for(var I=0;I<t;I++)a[C*t+I]=(1-u.damping)*(r[C*t+I]-N)+u.damping*m[I];a[C*t+M]=(1-u.damping)*(r[C*t+M]-A)+u.damping*m[M]}for(var P=0;P<t;P++){for(var S=0,L=0;L<t;L++)m[L]=o[L*t+P],b[L]=Math.max(0,a[L*t+P]),S+=b[L];S-=b[P],b[P]=a[P*t+P],S+=b[P];for(var O=0;O<t;O++)o[O*t+P]=(1-u.damping)*Math.min(0,S-b[O])+u.damping*m[O];o[P*t+P]=(1-u.damping)*(S-b[P])+u.damping*m[P]}for(var R=0,B=0;B<t;B++){var F=o[B*t+B]+a[B*t+B]>0?1:0;T[E%u.minIterations*t+B]=F,R+=F}if(R>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var z=0,V=0;V<t;V++){x[V]=0;for(var G=0;G<u.minIterations;G++)x[V]+=T[G*t+V];0!==x[V]&&x[V]!==u.minIterations||z++}if(z===t)break}}for(var Y=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r}(t,a,o),X=function(e,t,n){for(var r=gi(e,t,n),i=0;i<n.length;i++){for(var a=[],o=0;o<r.length;o++)r[o]===n[i]&&a.push(o);for(var s=-1,l=-1/0,u=0;u<a.length;u++){for(var c=0,h=0;h<a.length;h++)c+=t[a[h]*e+a[u]];c>l&&(s=u,l=c)}n[i]=a[s]}return gi(e,t,n)}(t,r,Y),U={},j=0;j<Y.length;j++)U[Y[j]]=[];for(var H=0;H<l.length;H++){var W=X[c[l[H].id()]];null!=W&&U[W].push(l[H])}for(var q=new Array(Y.length),K=0;K<Y.length;K++)q[K]=s.collection(U[Y[K]]);return q},vi={affinityPropagation:pi,ap:pi},yi=Xt({root:void 0,directed:!1}),mi={hierholzer:function(e){if(!De(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,a=yi(e),o=a.root,s=a.directed,l=this,u=!1;o&&(i=Ne(o)?this.filter(o)[0].id():o[0].id());var c={},h={};s?l.forEach(function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),a=e.outdegree(!0),o=i-a,s=a-i;1==o?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||o>1)&&(u=!0),c[t]=[],e.outgoers().forEach(function(e){e.isEdge()&&c[t].push(e.id())})}else h[t]=[void 0,e.target().id()]}):l.forEach(function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach(function(e){return c[t].push(e.id())})):h[t]=[e.source().id(),e.target().id()]});var d={found:!1,trail:void 0};if(u)return d;if(r&&n)if(s){if(i&&r!=i)return d;i=r}else{if(i&&r!=i&&n!=i)return d;i||(i=r)}else i||(i=l[0].id());var f=function(e){for(var t,n,r,i=e,a=[e];c[i].length;)t=c[i].shift(),n=h[t][0],i!=(r=h[t][1])?(c[r]=c[r].filter(function(e){return e!=t}),i=r):s||i==n||(c[n]=c[n].filter(function(e){return e!=t}),i=n),a.unshift(t),a.unshift(i);return a},g=[],p=[];for(p=f(i);1!=p.length;)0==c[p[0]].length?(g.unshift(l.getElementById(p.shift())),g.unshift(l.getElementById(p.shift()))):p=f(p.shift()).concat(p);for(var v in g.unshift(l.getElementById(p.shift())),c)if(c[v].length)return d;return d.found=!0,d.trail=this.spawn(g,!0),d}},bi=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function(l,u,c){l===c&&(r+=1),t[u]={id:n,low:n++,cutVertex:!1};var h,d,f,g,p=e.getElementById(u).connectedEdges().intersection(e);0===p.size()?i.push(e.spawn(e.getElementById(u))):p.forEach(function(n){h=n.source().id(),d=n.target().id(),(f=h===u?d:h)!==c&&(g=n.id(),o[g]||(o[g]=!0,a.push({x:u,y:f,edge:n})),f in t?t[u].low=Math.min(t[u].low,t[f].id):(s(l,f,u),t[u].low=Math.min(t[u].low,t[f].low),t[u].id<=t[f].low&&(t[u].cutVertex=!0,function(n,r){for(var o=a.length-1,s=[],l=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach(function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter(function(e){return e.isLoop()})):l.merge(i)})}),i.push(l)}(u,f))))})};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}});var l=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(l),components:i}},xi=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),h=l.merge(c);r.push(h),a=a.difference(h)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:a,components:r}},wi={};[Jt,cn,hn,fn,pn,yn,wn,vr,mr,xr,Er,Pr,ni,ci,vi,mi,{hopcroftTarjanBiconnected:bi,htbc:bi,htb:bi,hopcroftTarjanBiconnectedComponents:bi},{tarjanStronglyConnected:xi,tsc:xi,tscc:xi,tarjanStronglyConnectedComponents:xi}].forEach(function(e){$e(wi,e)});
2
2
  /*!
3
3
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
4
4
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)