@masuidrive/ticket
Version:
Real-time ticket tracking viewer with Vite + Express
4 lines • 442 kB
JavaScript
function Bs(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t<e;t++)a[t]=r[t];return a}function ec(r){if(Array.isArray(r))return r}function rc(r){if(Array.isArray(r))return Bs(r)}function ht(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function tc(r,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,jl(a.key),a)}}function gt(r,e,t){return e&&tc(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function kr(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Xs(r))||e){t&&(r=t);var a=0,n=function(){};return{s:n,n:function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return s=l.done,l},e:function(l){o=!0,i=l},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function Jl(r,e,t){return(e=jl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ac(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function nc(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],l=!0,u=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);l=!0);}catch(v){u=!0,n=v}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}function ic(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sc(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Je(r,e){return ec(r)||nc(r,e)||Xs(r,e)||ic()}function mn(r){return rc(r)||ac(r)||Xs(r)||sc()}function oc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function jl(r){var e=oc(r,"string");return typeof e=="symbol"?e:e+""}function ar(r){"@babel/helpers - typeof";return ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ar(r)}function Xs(r,e){if(r){if(typeof r=="string")return Bs(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Bs(r,e):void 0}}var rr=typeof window>"u"?null:window,To=rr?rr.navigator:null;rr&&rr.document;var uc=ar(""),ev=ar({}),lc=ar(function(){}),vc=typeof HTMLElement>"u"?"undefined":ar(HTMLElement),La=function(e){return e&&e.instanceString&&Ue(e.instanceString)?e.instanceString():null},ge=function(e){return e!=null&&ar(e)==uc},Ue=function(e){return e!=null&&ar(e)===lc},_e=function(e){return!Dr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Le=function(e){return e!=null&&ar(e)===ev&&!_e(e)&&e.constructor===Object},fc=function(e){return e!=null&&ar(e)===ev},ae=function(e){return e!=null&&ar(e)===ar(1)&&!isNaN(e)},cc=function(e){return ae(e)&&Math.floor(e)===e},bn=function(e){if(vc!=="undefined")return e!=null&&e instanceof HTMLElement},Dr=function(e){return Ia(e)||rv(e)},Ia=function(e){return La(e)==="collection"&&e._private.single},rv=function(e){return La(e)==="collection"&&!e._private.single},Ys=function(e){return La(e)==="core"},tv=function(e){return La(e)==="stylesheet"},dc=function(e){return La(e)==="event"},ut=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},hc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},gc=function(e){return Le(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},pc=function(e){return fc(e)&&Ue(e.then)},yc=function(){return To&&To.userAgent.match(/msie|trident|edge/i)},Qt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var a=function(){var i=this,s=arguments,o,l=t.apply(i,s),u=a.cache;return(o=u[l])||(o=u[l]=e.apply(i,s)),o};return a.cache={},a},Zs=Qt(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Mn=Qt(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),av=Qt(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),So=function(e){return ut(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},at=function(e,t){return e.slice(-1*t.length)===t},tr="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",mc="rgb[a]?\\(("+tr+"[%]?)\\s*,\\s*("+tr+"[%]?)\\s*,\\s*("+tr+"[%]?)(?:\\s*,\\s*("+tr+"))?\\)",bc="rgb[a]?\\((?:"+tr+"[%]?)\\s*,\\s*(?:"+tr+"[%]?)\\s*,\\s*(?:"+tr+"[%]?)(?:\\s*,\\s*(?:"+tr+"))?\\)",wc="hsl[a]?\\(("+tr+")\\s*,\\s*("+tr+"[%])\\s*,\\s*("+tr+"[%])(?:\\s*,\\s*("+tr+"))?\\)",xc="hsl[a]?\\((?:"+tr+")\\s*,\\s*(?:"+tr+"[%])\\s*,\\s*(?:"+tr+"[%])(?:\\s*,\\s*(?:"+tr+"))?\\)",Ec="\\#[0-9a-fA-F]{3}",Cc="\\#[0-9a-fA-F]{6}",nv=function(e,t){return e<t?-1:e>t?1:0},Tc=function(e,t){return-1*nv(e,t)},be=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var a=e[t];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var s=n[i];r[s]=a[s]}}return r},Sc=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,a,n,i,s=16;return t?(a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[a,n,i]}},kc=function(e){var t,a,n,i,s,o,l,u;function v(d,y,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?d+(y-d)*6*g:g<1/2?y:g<2/3?d+(y-d)*(2/3-g)*6:d}var f=new RegExp("^"+wc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=l=u=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;o=Math.round(255*v(h,c,a+1/3)),l=Math.round(255*v(h,c,a)),u=Math.round(255*v(h,c,a-1/3))}t=[o,l,u,s]}return t},Dc=function(e){var t,a=new RegExp("^"+mc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;t.push(u)}}return t},Bc=function(e){return Pc[e.toLowerCase()]},iv=function(e){return(_e(e)?e:null)||Bc(e)||Sc(e)||Dc(e)||kc(e)},Pc={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]},sv=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var s=a[i];if(Le(s))throw Error("Tried to set map with object key");i<a.length-1?(t[s]==null&&(t[s]={}),t=t[s]):t[s]=e.value}},ov=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var s=a[i];if(Le(s))throw Error("Tried to get map with object key");if(t=t[s],t==null)return t}return t},Ka=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oa(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Jn,ko;function Na(){if(ko)return Jn;ko=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return Jn=r,Jn}var jn,Do;function Ac(){if(Do)return jn;Do=1;var r=typeof Ka=="object"&&Ka&&Ka.Object===Object&&Ka;return jn=r,jn}var ei,Bo;function Ln(){if(Bo)return ei;Bo=1;var r=Ac(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return ei=t,ei}var ri,Po;function Rc(){if(Po)return ri;Po=1;var r=Ln(),e=function(){return r.Date.now()};return ri=e,ri}var ti,Ao;function Mc(){if(Ao)return ti;Ao=1;var r=/\s/;function e(t){for(var a=t.length;a--&&r.test(t.charAt(a)););return a}return ti=e,ti}var ai,Ro;function Lc(){if(Ro)return ai;Ro=1;var r=Mc(),e=/^\s+/;function t(a){return a&&a.slice(0,r(a)+1).replace(e,"")}return ai=t,ai}var ni,Mo;function Qs(){if(Mo)return ni;Mo=1;var r=Ln(),e=r.Symbol;return ni=e,ni}var ii,Lo;function Ic(){if(Lo)return ii;Lo=1;var r=Qs(),e=Object.prototype,t=e.hasOwnProperty,a=e.toString,n=r?r.toStringTag:void 0;function i(s){var o=t.call(s,n),l=s[n];try{s[n]=void 0;var u=!0}catch{}var v=a.call(s);return u&&(o?s[n]=l:delete s[n]),v}return ii=i,ii}var si,Io;function Oc(){if(Io)return si;Io=1;var r=Object.prototype,e=r.toString;function t(a){return e.call(a)}return si=t,si}var oi,Oo;function uv(){if(Oo)return oi;Oo=1;var r=Qs(),e=Ic(),t=Oc(),a="[object Null]",n="[object Undefined]",i=r?r.toStringTag:void 0;function s(o){return o==null?o===void 0?n:a:i&&i in Object(o)?e(o):t(o)}return oi=s,oi}var ui,No;function Nc(){if(No)return ui;No=1;function r(e){return e!=null&&typeof e=="object"}return ui=r,ui}var li,zo;function za(){if(zo)return li;zo=1;var r=uv(),e=Nc(),t="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&r(n)==t}return li=a,li}var vi,Fo;function zc(){if(Fo)return vi;Fo=1;var r=Lc(),e=Na(),t=za(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return a;if(e(u)){var v=typeof u.valueOf=="function"?u.valueOf():u;u=e(v)?v+"":v}if(typeof u!="string")return u===0?u:+u;u=r(u);var f=i.test(u);return f||s.test(u)?o(u.slice(2),f?2:8):n.test(u)?a:+u}return vi=l,vi}var fi,Vo;function Fc(){if(Vo)return fi;Vo=1;var r=Na(),e=Rc(),t=zc(),a="Expected a function",n=Math.max,i=Math.min;function s(o,l,u){var v,f,c,h,d,y,g=0,p=!1,m=!1,b=!0;if(typeof o!="function")throw new TypeError(a);l=t(l)||0,r(u)&&(p=!!u.leading,m="maxWait"in u,c=m?n(t(u.maxWait)||0,l):c,b="trailing"in u?!!u.trailing:b);function w(A){var R=v,L=f;return v=f=void 0,g=A,h=o.apply(L,R),h}function E(A){return g=A,d=setTimeout(T,l),p?w(A):h}function C(A){var R=A-y,L=A-g,I=l-R;return m?i(I,c-L):I}function x(A){var R=A-y,L=A-g;return y===void 0||R>=l||R<0||m&&L>=c}function T(){var A=e();if(x(A))return k(A);d=setTimeout(T,C(A))}function k(A){return d=void 0,b&&v?w(A):(v=f=void 0,h)}function D(){d!==void 0&&clearTimeout(d),g=0,v=y=f=d=void 0}function B(){return d===void 0?h:k(e())}function P(){var A=e(),R=x(A);if(v=arguments,f=this,y=A,R){if(d===void 0)return E(y);if(m)return clearTimeout(d),d=setTimeout(T,l),w(y)}return d===void 0&&(d=setTimeout(T,l)),h}return P.cancel=D,P.flush=B,P}return fi=s,fi}var Vc=Fc(),Fa=Oa(Vc),ci=rr?rr.performance:null,lv=ci&&ci.now?function(){return ci.now()}:function(){return Date.now()},qc=function(){if(rr){if(rr.requestAnimationFrame)return function(r){rr.requestAnimationFrame(r)};if(rr.mozRequestAnimationFrame)return function(r){rr.mozRequestAnimationFrame(r)};if(rr.webkitRequestAnimationFrame)return function(r){rr.webkitRequestAnimationFrame(r)};if(rr.msRequestAnimationFrame)return function(r){rr.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(lv())},1e3/60)}}(),wn=function(e){return qc(e)},Yr=lv,Tt=9261,vv=65599,Ht=5381,fv=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tt,a=t,n;n=e.next(),!n.done;)a=a*vv+n.value|0;return a},Ca=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tt;return t*vv+e|0},Ta=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ht;return(t<<5)+t+e|0},_c=function(e,t){return e*2097152+t},et=function(e){return e[0]*2097152+e[1]},Xa=function(e,t){return[Ca(e[0],t[0]),Ta(e[1],t[1])]},qo=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return fv(s,t)},Dt=function(e,t){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return fv(s,t)},cv=function(){return Gc(arguments)},Gc=function(e){for(var t,a=0;a<e.length;a++){var n=e[a];a===0?t=Dt(n):t=Dt(n,t)}return t};function Hc(r,e,t,a,n){var i=n*Math.PI/180,s=Math.cos(i)*(r-t)-Math.sin(i)*(e-a)+t,o=Math.sin(i)*(r-t)+Math.cos(i)*(e-a)+a;return{x:s,y:o}}var Wc=function(e,t,a,n,i,s){return{x:(e-a)*i+a,y:(t-n)*s+n}};function $c(r,e,t){if(t===0)return r;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,s=1/i,o=Hc(r.x,r.y,a,n,t),l=Wc(o.x,o.y,a,n,i,s);return{x:l.x,y:l.y}}var _o=!0,Uc=console.warn!=null,Kc=console.trace!=null,Js=Number.MAX_SAFE_INTEGER||9007199254740991,dv=function(){return!0},xn=function(){return!1},Go=function(){return 0},js=function(){},$e=function(e){throw new Error(e)},hv=function(e){if(e!==void 0)_o=!!e;else return _o},Ve=function(e){hv()&&(Uc?console.warn(e):(console.log(e),Kc&&console.trace()))},Xc=function(e){return be({},e)},qr=function(e){return e==null?e:_e(e)?e.slice():Le(e)?Xc(e):e},Yc=function(e){return e.slice()},gv=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},Zc={},pv=function(){return Zc},cr=function(e){var t=Object.keys(e);return function(a){for(var n={},i=0;i<t.length;i++){var s=t[i],o=a==null?void 0:a[s];n[s]=o===void 0?e[s]:o}return n}},lt=function(e,t,a){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)},eo=function(e){e.splice(0,e.length)},Qc=function(e,t){for(var a=0;a<t.length;a++){var n=t[a];e.push(n)}},Tr=function(e,t,a){return a&&(t=av(a,t)),e[t]},Kr=function(e,t,a,n){a&&(t=av(a,t)),e[t]=n},Jc=function(){function r(){ht(this,r),this._obj={}}return gt(r,[{key:"set",value:function(t,a){return this._obj[t]=a,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}])}(),Xr=typeof Map<"u"?Map:Jc,jc="undefined",ed=function(){function r(e){if(ht(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var a=0;a<t.length;a++)this.add(t[a])}}return gt(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var a=this._obj;a[t]!==1&&(a[t]=1,this.size++)}},{key:"delete",value:function(t){var a=this._obj;a[t]===1&&(a[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(a){return t.has(a)})}},{key:"forEach",value:function(t,a){return this.toArray().forEach(t,a)}}])}(),ra=(typeof Set>"u"?"undefined":ar(Set))!==jc?Set:ed,In=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Ys(e)){$e("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){$e("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}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:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new ra,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(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];_e(t.classes)?u=t.classes:ge(t.classes)&&(u=t.classes.split(/\s+/));for(var v=0,f=u.length;v<f;v++){var c=u[v];!c||c===""||i.classes.add(c)}this.createEmitter(),(a===void 0||a)&&this.restore();var h=t.style||t.css;h&&(Ve("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h))},Ho=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var s;Le(a)&&!Dr(a)&&(s=a,a=s.roots||s.root,n=s.visit,i=s.directed),i=arguments.length===2&&!Ue(n)?n:i,n=Ue(n)?n:function(){};for(var o=this._private.cy,l=a=ge(a)?this.filter(a):a,u=[],v=[],f={},c={},h={},d=0,y,g=this.byGroup(),p=g.nodes,m=g.edges,b=0;b<l.length;b++){var w=l[b],E=w.id();w.isNode()&&(u.unshift(w),e.bfs&&(h[E]=!0,v.push(w)),c[E]=0)}for(var C=function(){var A=e.bfs?u.shift():u.pop(),R=A.id();if(e.dfs){if(h[R])return 0;h[R]=!0,v.push(A)}var L=c[R],I=f[R],M=I!=null?I.source():null,O=I!=null?I.target():null,V=I==null?void 0:A.same(M)?O[0]:M[0],G;if(G=n(A,I,V,d++,L),G===!0)return y=A,1;if(G===!1)return 1;for(var N=A.connectedEdges().filter(function(j){return(!i||j.source().same(A))&&m.has(j)}),F=0;F<N.length;F++){var U=N[F],Q=U.connectedNodes().filter(function(j){return!j.same(A)&&p.has(j)}),K=Q.id();Q.length!==0&&!h[K]&&(Q=Q[0],u.push(Q),e.bfs&&(h[K]=!0,v.push(Q)),f[K]=U,c[K]=c[R]+1)}},x;u.length!==0&&(x=C(),!(x!==0&&x===1)););for(var T=o.collection(),k=0;k<v.length;k++){var D=v[k],B=f[D.id()];B!=null&&T.push(B),T.push(D)}return{path:o.collection(T),found:o.collection(y)}}},Sa={breadthFirstSearch:Ho({bfs:!0}),depthFirstSearch:Ho({dfs:!0})};Sa.bfs=Sa.breadthFirstSearch;Sa.dfs=Sa.depthFirstSearch;var on={exports:{}},rd=on.exports,Wo;function td(){return Wo||(Wo=1,function(r,e){(function(){var t,a,n,i,s,o,l,u,v,f,c,h,d,y,g;n=Math.floor,f=Math.min,a=function(p,m){return p<m?-1:p>m?1:0},v=function(p,m,b,w,E){var C;if(b==null&&(b=0),E==null&&(E=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=p.length);b<w;)C=n((b+w)/2),E(m,p[C])<0?w=C:b=C+1;return[].splice.apply(p,[b,b-b].concat(m)),m},o=function(p,m,b){return b==null&&(b=a),p.push(m),y(p,0,p.length-1,b)},s=function(p,m){var b,w;return m==null&&(m=a),b=p.pop(),p.length?(w=p[0],p[0]=b,g(p,0,m)):w=b,w},u=function(p,m,b){var w;return b==null&&(b=a),w=p[0],p[0]=m,g(p,0,b),w},l=function(p,m,b){var w;return b==null&&(b=a),p.length&&b(p[0],m)<0&&(w=[p[0],m],m=w[0],p[0]=w[1],g(p,0,b)),m},i=function(p,m){var b,w,E,C,x,T;for(m==null&&(m=a),C=(function(){T=[];for(var k=0,D=n(p.length/2);0<=D?k<D:k>D;0<=D?k++:k--)T.push(k);return T}).apply(this).reverse(),x=[],w=0,E=C.length;w<E;w++)b=C[w],x.push(g(p,b,m));return x},d=function(p,m,b){var w;if(b==null&&(b=a),w=p.indexOf(m),w!==-1)return y(p,0,w,b),g(p,w,b)},c=function(p,m,b){var w,E,C,x,T;if(b==null&&(b=a),E=p.slice(0,m),!E.length)return E;for(i(E,b),T=p.slice(m),C=0,x=T.length;C<x;C++)w=T[C],l(E,w,b);return E.sort(b).reverse()},h=function(p,m,b){var w,E,C,x,T,k,D,B,P;if(b==null&&(b=a),m*10<=p.length){if(C=p.slice(0,m).sort(b),!C.length)return C;for(E=C[C.length-1],D=p.slice(m),x=0,k=D.length;x<k;x++)w=D[x],b(w,E)<0&&(v(C,w,0,null,b),C.pop(),E=C[C.length-1]);return C}for(i(p,b),P=[],T=0,B=f(m,p.length);0<=B?T<B:T>B;0<=B?++T:--T)P.push(s(p,b));return P},y=function(p,m,b,w){var E,C,x;for(w==null&&(w=a),E=p[b];b>m;){if(x=b-1>>1,C=p[x],w(E,C)<0){p[b]=C,b=x;continue}break}return p[b]=E},g=function(p,m,b){var w,E,C,x,T;for(b==null&&(b=a),E=p.length,T=m,C=p[m],w=2*m+1;w<E;)x=w+1,x<E&&!(b(p[w],p[x])<0)&&(w=x),p[m]=p[w],m=w,w=2*m+1;return p[m]=C,y(p,T,m,b)},t=function(){p.push=o,p.pop=s,p.replace=u,p.pushpop=l,p.heapify=i,p.updateItem=d,p.nlargest=c,p.nsmallest=h;function p(m){this.cmp=m??a,this.nodes=[]}return p.prototype.push=function(m){return o(this.nodes,m,this.cmp)},p.prototype.pop=function(){return s(this.nodes,this.cmp)},p.prototype.peek=function(){return this.nodes[0]},p.prototype.contains=function(m){return this.nodes.indexOf(m)!==-1},p.prototype.replace=function(m){return u(this.nodes,m,this.cmp)},p.prototype.pushpop=function(m){return l(this.nodes,m,this.cmp)},p.prototype.heapify=function(){return i(this.nodes,this.cmp)},p.prototype.updateItem=function(m){return d(this.nodes,m,this.cmp)},p.prototype.clear=function(){return this.nodes=[]},p.prototype.empty=function(){return this.nodes.length===0},p.prototype.size=function(){return this.nodes.length},p.prototype.clone=function(){var m;return m=new p,m.nodes=this.nodes.slice(0),m},p.prototype.toArray=function(){return this.nodes.slice(0)},p.prototype.insert=p.prototype.push,p.prototype.top=p.prototype.peek,p.prototype.front=p.prototype.peek,p.prototype.has=p.prototype.contains,p.prototype.copy=p.prototype.clone,p}(),function(p,m){return r.exports=m()}(this,function(){return t})}).call(rd)}(on)),on.exports}var di,$o;function ad(){return $o||($o=1,di=td()),di}var nd=ad(),Va=Oa(nd),id=cr({root:null,weight:function(e){return 1},directed:!1}),sd={dijkstra:function(e){if(!Le(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var a=id(e),n=a.root,i=a.weight,s=a.directed,o=this,l=i,u=ge(n)?this.filter(n)[0]:n[0],v={},f={},c={},h=this.byGroup(),d=h.nodes,y=h.edges;y.unmergeBy(function(L){return L.isLoop()});for(var g=function(I){return v[I.id()]},p=function(I,M){v[I.id()]=M,m.updateItem(I)},m=new Va(function(L,I){return g(L)-g(I)}),b=0;b<d.length;b++){var w=d[b];v[w.id()]=w.same(u)?0:1/0,m.push(w)}for(var E=function(I,M){for(var O=(s?I.edgesTo(M):I.edgesWith(M)).intersect(y),V=1/0,G,N=0;N<O.length;N++){var F=O[N],U=l(F);(U<V||!G)&&(V=U,G=F)}return{edge:G,dist:V}};m.size()>0;){var C=m.pop(),x=g(C),T=C.id();if(c[T]=x,x!==1/0)for(var k=C.neighborhood().intersect(d),D=0;D<k.length;D++){var B=k[D],P=B.id(),A=E(C,B),R=x+A.dist;R<g(B)&&(p(B,R),f[P]={node:C,edge:A.edge})}}return{distanceTo:function(I){var M=ge(I)?d.filter(I)[0]:I[0];return c[M.id()]},pathTo:function(I){var M=ge(I)?d.filter(I)[0]:I[0],O=[],V=M,G=V.id();if(M.length>0)for(O.unshift(M);f[G];){var N=f[G];O.unshift(N.edge),O.unshift(N.node),V=N.node,G=V.id()}return o.spawn(O)}}}},od={kruskal:function(e){e=e||function(b){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,s=new Array(i),o=a,l=function(w){for(var E=0;E<s.length;E++){var C=s[E];if(C.has(w))return E}},u=0;u<i;u++)s[u]=this.spawn(a[u]);for(var v=n.sort(function(b,w){return e(b)-e(w)}),f=0;f<v.length;f++){var c=v[f],h=c.source()[0],d=c.target()[0],y=l(h),g=l(d),p=s[y],m=s[g];y!==g&&(o.merge(c),p.merge(m),s.splice(g,1))}return o}},ud=cr({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),ld={aStar:function(e){var t=this.cy(),a=ud(e),n=a.root,i=a.goal,s=a.heuristic,o=a.directed,l=a.weight;n=t.collection(n)[0],i=t.collection(i)[0];var u=n.id(),v=i.id(),f={},c={},h={},d=new Va(function(G,N){return c[G.id()]-c[N.id()]}),y=new ra,g={},p={},m=function(N,F){d.push(N),y.add(F)},b,w,E=function(){b=d.pop(),w=b.id(),y.delete(w)},C=function(N){return y.has(N)};m(n,u),f[u]=0,c[u]=s(n);for(var x=0;d.size()>0;){if(E(),x++,w===v){for(var T=[],k=i,D=v,B=p[D];T.unshift(k),B!=null&&T.unshift(B),k=g[D],k!=null;)D=k.id(),B=p[D];return{found:!0,distance:f[w],path:this.spawn(T),steps:x}}h[w]=!0;for(var P=b._private.edges,A=0;A<P.length;A++){var R=P[A];if(this.hasElementWithId(R.id())&&!(o&&R.data("source")!==w)){var L=R.source(),I=R.target(),M=L.id()!==w?L:I,O=M.id();if(this.hasElementWithId(O)&&!h[O]){var V=f[w]+l(R);if(!C(O)){f[O]=V,c[O]=V+s(M),m(M,O),g[O]=b,p[O]=R;continue}V<f[O]&&(f[O]=V,c[O]=V+s(M),g[O]=b,p[O]=R)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},vd=cr({weight:function(e){return 1},directed:!1}),fd={floydWarshall:function(e){for(var t=this.cy(),a=vd(e),n=a.weight,i=a.directed,s=n,o=this.byGroup(),l=o.nodes,u=o.edges,v=l.length,f=v*v,c=function(U){return l.indexOf(U)},h=function(U){return l[U]},d=new Array(f),y=0;y<f;y++){var g=y%v,p=(y-g)/v;p===g?d[y]=0:d[y]=1/0}for(var m=new Array(f),b=new Array(f),w=0;w<u.length;w++){var E=u[w],C=E.source()[0],x=E.target()[0];if(C!==x){var T=c(C),k=c(x),D=T*v+k,B=s(E);if(d[D]>B&&(d[D]=B,m[D]=k,b[D]=E),!i){var P=k*v+T;!i&&d[P]>B&&(d[P]=B,m[P]=T,b[P]=E)}}}for(var A=0;A<v;A++)for(var R=0;R<v;R++)for(var L=R*v+A,I=0;I<v;I++){var M=R*v+I,O=A*v+I;d[L]+d[O]<d[M]&&(d[M]=d[L]+d[O],m[M]=m[L])}var V=function(U){return(ge(U)?t.filter(U):U)[0]},G=function(U){return c(V(U))},N={distance:function(U,Q){var K=G(U),j=G(Q);return d[K*v+j]},path:function(U,Q){var K=G(U),j=G(Q),re=h(K);if(K===j)return re.collection();if(m[K*v+j]==null)return t.collection();var ne=t.collection(),J=K,z;for(ne.merge(re);K!==j;)J=K,K=m[K*v+j],z=b[J*v+K],ne.merge(z),ne.merge(h(K));return ne}};return N}},cd=cr({weight:function(e){return 1},directed:!1,root:null}),dd={bellmanFord:function(e){var t=this,a=cd(e),n=a.weight,i=a.directed,s=a.root,o=n,l=this,u=this.cy(),v=this.byGroup(),f=v.edges,c=v.nodes,h=c.length,d=new Xr,y=!1,g=[];s=u.collection(s)[0],f.unmergeBy(function(Ce){return Ce.isLoop()});for(var p=f.length,m=function(we){var ye=d.get(we.id());return ye||(ye={},d.set(we.id(),ye)),ye},b=function(we){return(ge(we)?u.$(we):we)[0]},w=function(we){return m(b(we)).dist},E=function(we){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,ie=b(we),de=[],he=ie;;){if(he==null)return t.spawn();var Ee=m(he),pe=Ee.edge,Se=Ee.pred;if(de.unshift(he[0]),he.same(ye)&&de.length>0)break;pe!=null&&de.unshift(pe),he=Se}return l.spawn(de)},C=0;C<h;C++){var x=c[C],T=m(x);x.same(s)?T.dist=0:T.dist=1/0,T.pred=null,T.edge=null}for(var k=!1,D=function(we,ye,ie,de,he,Ee){var pe=de.dist+Ee;pe<he.dist&&!ie.same(de.edge)&&(he.dist=pe,he.pred=we,he.edge=ie,k=!0)},B=1;B<h;B++){k=!1;for(var P=0;P<p;P++){var A=f[P],R=A.source(),L=A.target(),I=o(A),M=m(R),O=m(L);D(R,L,A,M,O,I),i||D(L,R,A,O,M,I)}if(!k)break}if(k)for(var V=[],G=0;G<p;G++){var N=f[G],F=N.source(),U=N.target(),Q=o(N),K=m(F).dist,j=m(U).dist;if(K+Q<j||!i&&j+Q<K)if(y||(Ve("Graph contains a negative weight cycle for Bellman-Ford"),y=!0),e.findNegativeWeightCycles!==!1){var re=[];K+Q<j&&re.push(F),!i&&j+Q<K&&re.push(U);for(var ne=re.length,J=0;J<ne;J++){var z=re[J],q=[z];q.push(m(z).edge);for(var H=m(z).pred;q.indexOf(H)===-1;)q.push(H),q.push(m(H).edge),H=m(H).pred;q=q.slice(q.indexOf(H));for(var Y=q[0].id(),te=0,ce=2;ce<q.length;ce+=2)q[ce].id()<Y&&(Y=q[ce].id(),te=ce);q=q.slice(te).concat(q.slice(0,te)),q.push(q[0]);var Ae=q.map(function(Ce){return Ce.id()}).join(",");V.indexOf(Ae)===-1&&(g.push(l.spawn(q)),V.push(Ae))}}else break}return{distanceTo:w,pathTo:E,hasNegativeWeightCycle:y,negativeWeightCycles:g}}},hd=Math.sqrt(2),gd=function(e,t,a){a.length===0&&$e("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],s=n[2],o=t[i],l=t[s],u=a,v=u.length-1;v>=0;v--){var f=u[v],c=f[1],h=f[2];(t[c]===o&&t[h]===l||t[c]===l&&t[h]===o)&&u.splice(v,1)}for(var d=0;d<u.length;d++){var y=u[d];y[1]===l?(u[d]=y.slice(),u[d][1]=o):y[2]===l&&(u[d]=y.slice(),u[d][2]=o)}for(var g=0;g<t.length;g++)t[g]===l&&(t[g]=o);return u},hi=function(e,t,a,n){for(;a>n;){var i=Math.floor(Math.random()*t.length);t=gd(i,e,t),a--}return t},pd={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(O){return O.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/hd);if(i<2){$e("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],v=0;v<s;v++){var f=n[v];u.push([v,a.indexOf(f.source()),a.indexOf(f.target())])}for(var c=1/0,h=[],d=new Array(i),y=new Array(i),g=new Array(i),p=function(V,G){for(var N=0;N<i;N++)G[N]=V[N]},m=0;m<=o;m++){for(var b=0;b<i;b++)y[b]=b;var w=hi(y,u.slice(),i,l),E=w.slice();p(y,g);var C=hi(y,w,l,2),x=hi(g,E,l,2);C.length<=x.length&&C.length<c?(c=C.length,h=C,p(y,d)):x.length<=C.length&&x.length<c&&(c=x.length,h=x,p(g,d))}for(var T=this.spawn(h.map(function(O){return n[O[0]]})),k=this.spawn(),D=this.spawn(),B=d[0],P=0;P<d.length;P++){var A=d[P],R=a[P];A===B?k.merge(R):D.merge(R)}var L=function(V){var G=e.spawn();return V.forEach(function(N){G.merge(N),N.connectedEdges().forEach(function(F){e.contains(F)&&!T.contains(F)&&G.merge(F)})}),G},I=[L(k),L(D)],M={cut:T,components:I,partition1:k,partition2:D};return M}},gi,yd=function(e){return{x:e.x,y:e.y}},On=function(e,t,a){return{x:e.x*t+a.x,y:e.y*t+a.y}},yv=function(e,t,a){return{x:(e.x-a.x)/t,y:(e.y-a.y)/t}},Wt=function(e){return{x:e[0],y:e[1]}},md=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=t;i<a;i++){var s=e[i];isFinite(s)&&(n=Math.min(s,n))}return n},bd=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=t;i<a;i++){var s=e[i];isFinite(s)&&(n=Math.max(s,n))}return n},wd=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=t;s<a;s++){var o=e[s];isFinite(o)&&(n+=o,i++)}return n/i},xd=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a<e.length&&e.splice(a,e.length-a),t>0&&e.splice(0,t));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}i&&e.sort(function(c,h){return c-h});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+o]:(e[f-1+o]+e[f+o])/2},Ed=function(e){return Math.PI*e/180},Ya=function(e,t){return Math.atan2(t,e)-Math.PI/2},ro=Math.log2||function(r){return Math.log(r)/Math.log(2)},to=function(e){return e>0?1:e<0?-1:0},Bt=function(e,t){return Math.sqrt(Et(e,t))},Et=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},Cd=function(e){for(var t=e.length,a=0,n=0;n<t;n++)a+=e[n];for(var i=0;i<t;i++)e[i]=e[i]/a;return e},sr=function(e,t,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*t+n*n*a},Kt=function(e,t,a,n){return{x:sr(e.x,t.x,a.x,n),y:sr(e.y,t.y,a.y,n)}},Td=function(e,t,a,n){var i={x:t.x-e.x,y:t.y-e.y},s=Bt(e,t),o={x:i.x/s,y:i.y/s};return a=a??0,n=n??a*s,{x:e.x+o.x*n,y:e.y+o.y*n}},ka=function(e,t,a){return Math.max(e,Math.min(a,t))},wr=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&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(e.w!=null&&e.h!=null&&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}}},Sd=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},kd=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Dd=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},mv=function(e,t,a){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,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},un=function(e){var t=arguments.length>1&&arguments[1]!==void 0?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},ln=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(t.length===1)a=n=i=s=t[0];else if(t.length===2)a=i=t[0],s=n=t[1];else if(t.length===4){var o=Je(t,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Uo=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},ao=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)},nt=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},Ko=function(e,t){return nt(e,t.x,t.y)},bv=function(e,t){return nt(e,t.x1,t.y1)&&nt(e,t.x2,t.y2)},Bd=(gi=Math.hypot)!==null&&gi!==void 0?gi:function(r,e){return Math.sqrt(r*r+e*e)};function Pd(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(T,k){return{x:T.x+k.x,y:T.y+k.y}},a=function(T,k){return{x:T.x-k.x,y:T.y-k.y}},n=function(T,k){return{x:T.x*k,y:T.y*k}},i=function(T,k){return T.x*k.y-T.y*k.x},s=function(T){var k=Bd(T.x,T.y);return k===0?{x:0,y:0}:{x:T.x/k,y:T.y/k}},o=function(T){for(var k=0,D=0;D<T.length;D++){var B=T[D],P=T[(D+1)%T.length];k+=B.x*P.y-P.x*B.y}return k/2},l=function(T,k,D,B){var P=a(k,T),A=a(B,D),R=i(P,A);if(Math.abs(R)<1e-9)return t(T,n(P,.5));var L=i(a(D,T),A)/R;return t(T,n(P,L))},u=r.map(function(x){return{x:x.x,y:x.y}});o(u)<0&&u.reverse();for(var v=u.length,f=[],c=0;c<v;c++){var h=u[c],d=u[(c+1)%v],y=a(d,h),g=s({x:y.y,y:-y.x});f.push(g)}for(var p=f.map(function(x,T){var k=t(u[T],n(x,e)),D=t(u[(T+1)%v],n(x,e));return{p1:k,p2:D}}),m=[],b=0;b<v;b++){var w=p[(b-1+v)%v],E=p[b],C=l(w.p1,w.p2,E.p1,E.p2);m.push(C)}return m}function Ad(r,e,t,a,n,i){var s=Vd(r,e,t,a,n),o=Pd(s,i),l=wr();return o.forEach(function(u){return mv(l,u.x,u.y)}),l}var wv=function(e,t,a,n,i,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?vt(i,s):l,v=i/2,f=s/2;u=Math.min(u,v,f);var c=u!==v,h=u!==f,d;if(c){var y=a-v+u-o,g=n-f-o,p=a+v-u+o,m=g;if(d=it(e,t,a,n,y,g,p,m,!1),d.length>0)return d}if(h){var b=a+v+o,w=n-f+u-o,E=b,C=n+f-u+o;if(d=it(e,t,a,n,b,w,E,C,!1),d.length>0)return d}if(c){var x=a-v+u-o,T=n+f+o,k=a+v-u+o,D=T;if(d=it(e,t,a,n,x,T,k,D,!1),d.length>0)return d}if(h){var B=a-v-o,P=n-f+u-o,A=B,R=n+f-u+o;if(d=it(e,t,a,n,B,P,A,R,!1),d.length>0)return d}var L;{var I=a-v+u,M=n-f+u;if(L=ya(e,t,a,n,I,M,u+o),L.length>0&&L[0]<=I&&L[1]<=M)return[L[0],L[1]]}{var O=a+v-u,V=n-f+u;if(L=ya(e,t,a,n,O,V,u+o),L.length>0&&L[0]>=O&&L[1]<=V)return[L[0],L[1]]}{var G=a+v-u,N=n+f-u;if(L=ya(e,t,a,n,G,N,u+o),L.length>0&&L[0]>=G&&L[1]>=N)return[L[0],L[1]]}{var F=a-v+u,U=n+f-u;if(L=ya(e,t,a,n,F,U,u+o),L.length>0&&L[0]<=F&&L[1]>=U)return[L[0],L[1]]}return[]},Rd=function(e,t,a,n,i,s,o){var l=o,u=Math.min(a,i),v=Math.max(a,i),f=Math.min(n,s),c=Math.max(n,s);return u-l<=e&&e<=v+l&&f-l<=t&&t<=c+l},Md=function(e,t,a,n,i,s,o,l,u){var v={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};return!(e<v.x1||e>v.x2||t<v.y1||t>v.y2)},Ld=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-t+s)/o,u=(-t-s)/o;return[l,u]},Id=function(e,t,a,n,i){var s=1e-5;e===0&&(e=s),t/=e,a/=e,n/=e;var o,l,u,v,f,c,h,d;if(l=(3*a-t*t)/9,u=-(27*n)+t*(9*a-2*(t*t)),u/=54,o=l*l*l+u*u,i[1]=0,h=t/3,o>0){f=u+Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),c=u-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+f+c,h+=(f+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+f)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,o===0){d=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-h+2*d,i[4]=i[2]=-(d+h);return}l=-l,v=l*l*l,v=Math.acos(u/Math.sqrt(v)),d=2*Math.sqrt(l),i[0]=-h+d*Math.cos(v/3),i[2]=-h+d*Math.cos((v+2*Math.PI)/3),i[4]=-h+d*Math.cos((v+4*Math.PI)/3)},Od=function(e,t,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,v=1*9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,f=1*3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*t+2*s*s+2*s*t-l*t,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*t-s*t,h=[];Id(u,v,f,c,h);for(var d=1e-7,y=[],g=0;g<6;g+=2)Math.abs(h[g+1])<d&&h[g]>=0&&h[g]<=1&&y.push(h[g]);y.push(1),y.push(0);for(var p=-1,m,b,w,E=0;E<y.length;E++)m=Math.pow(1-y[E],2)*a+2*(1-y[E])*y[E]*i+y[E]*y[E]*o,b=Math.pow(1-y[E],2)*n+2*(1-y[E])*y[E]*s+y[E]*y[E]*l,w=Math.pow(m-e,2)+Math.pow(b-t,2),p>=0?w<p&&(p=w):p=w;return p},Nd=function(e,t,a,n,i,s){var o=[e-a,t-n],l=[i-a,s-n],u=l[0]*l[0]+l[1]*l[1],v=o[0]*o[0]+o[1]*o[1],f=o[0]*l[0]+o[1]*l[1],c=f*f/u;return f<0?v:c>u?(e-i)*(e-i)+(t-s)*(t-s):v-c},Sr=function(e,t,a){for(var n,i,s,o,l,u=0,v=0;v<a.length/2;v++)if(n=a[v*2],i=a[v*2+1],v+1<a.length/2?(s=a[(v+1)*2],o=a[(v+1)*2+1]):(s=a[(v+1-a.length/2)*2],o=a[(v+1-a.length/2)*2+1]),!(n==e&&s==e))if(n>=e&&e>=s||n<=e&&e<=s)l=(e-n)/(s-n)*(o-i)+i,l>t&&u++;else continue;return u%2!==0},Zr=function(e,t,a,n,i,s,o,l,u){var v=new Array(a.length),f;l[0]!=null?(f=Math.atan(l[1]/l[0]),l[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=l;for(var c=Math.cos(-f),h=Math.sin(-f),d=0;d<v.length/2;d++)v[d*2]=s/2*(a[d*2]*c-a[d*2+1]*h),v[d*2+1]=o/2*(a[d*2+1]*c+a[d*2]*h),v[d*2]+=n,v[d*2+1]+=i;var y;if(u>0){var g=Cn(v,-u);y=En(g)}else y=v;return Sr(e,t,y)},zd=function(e,t,a,n,i,s,o,l){for(var u=new Array(a.length*2),v=0;v<l.length;v++){var f=l[v];u[v*4+0]=f.startX,u[v*4+1]=f.startY,u[v*4+2]=f.stopX,u[v*4+3]=f.stopY;var c=Math.pow(f.cx-e,2)+Math.pow(f.cy-t,2);if(c<=Math.pow(f.radius,2))return!0}return Sr(e,t,u)},En=function(e){for(var t=new Array(e.length/2),a,n,i,s,o,l,u,v,f=0;f<e.length/4;f++){a=e[f*4],n=e[f*4+1],i=e[f*4+2],s=e[f*4+3],f<e.length/4-1?(o=e[(f+1)*4],l=e[(f+1)*4+1],u=e[(f+1)*4+2],v=e[(f+1)*4+3]):(o=e[0],l=e[1],u=e[2],v=e[3]);var c=it(a,n,i,s,o,l,u,v,!0);t[f*2]=c[0],t[f*2+1]=c[1]}return t},Cn=function(e,t){for(var a=new Array(e.length*2),n,i,s,o,l=0;l<e.length/2;l++){n=e[l*2],i=e[l*2+1],l<e.length/2-1?(s=e[(l+1)*2],o=e[(l+1)*2+1]):(s=e[0],o=e[1]);var u=o-i,v=-(s-n),f=Math.sqrt(u*u+v*v),c=u/f,h=v/f;a[l*4]=n+c*t,a[l*4+1]=i+h*t,a[l*4+2]=s+c*t,a[l*4+3]=o+h*t}return a},Fd=function(e,t,a,n,i,s){var o=a-e,l=n-t;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),v=u-1;if(v<0)return[];var f=v/u;return[(a-e)*f+e,(n-t)*f+t]},kt=function(e,t,a,n,i,s,o){return e-=i,t-=s,e/=a/2+o,t/=n/2+o,e*e+t*t<=1},ya=function(e,t,a,n,i,s,o){var l=[a-e,n-t],u=[e-i,t-s],v=l[0]*l[0]+l[1]*l[1],f=2*(u[0]*l[0]+u[1]*l[1]),c=u[0]*u[0]+u[1]*u[1]-o*o,h=f*f-4*v*c;if(h<0)return[];var d=(-f+Math.sqrt(h))/(2*v),y=(-f-Math.sqrt(h))/(2*v),g=Math.min(d,y),p=Math.max(d,y),m=[];if(g>=0&&g<=1&&m.push(g),p>=0&&p<=1&&m.push(p),m.length===0)return[];var b=m[0]*l[0]+e,w=m[0]*l[1]+t;if(m.length>1){if(m[0]==m[1])return[b,w];var E=m[1]*l[0]+e,C=m[1]*l[1]+t;return[b,w,E,C]}else return[b,w]},pi=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},it=function(e,t,a,n,i,s,o,l,u){var v=e-i,f=a-e,c=o-i,h=t-s,d=n-t,y=l-s,g=c*h-y*v,p=f*h-d*v,m=y*f-c*d;if(m!==0){var b=g/m,w=p/m,E=.001,C=0-E,x=1+E;return C<=b&&b<=x&&C<=w&&w<=x?[e+b*f,t+b*d]:u?[e+b*f,t+b*d]:[]}else return g===0||p===0?pi(e,a,o)===o?[o,l]:pi(e,a,i)===i?[i,s]:pi(i,o,a)===a?[a,n]:[]:[]},Vd=function(e,t,a,n,i){var s=[],o=n/2,l=i/2,u=t,v=a;s.push({x:u+o*e[0],y:v+l*e[1]});for(var f=1;f<e.length/2;f++)s.push({x:u+o*e[f*2],y:v+l*e[f*2+1]});return s},Da=function(e,t,a,n,i,s,o,l){var u=[],v,f=new Array(a.length),c=!0;s==null&&(c=!1);var h;if(c){for(var d=0;d<f.length/2;d++)f[d*2]=a[d*2]*s+n,f[d*2+1]=a[d*2+1]*o+i;if(l>0){var y=Cn(f,-l);h=En(y)}else h=f}else h=a;for(var g,p,m,b,w=0;w<h.length/2;w++)g=h[w*2],p=h[w*2+1],w<h.length/2-1?(m=h[(w+1)*2],b=h[(w+1)*2+1]):(m=h[0],b=h[1]),v=it(e,t,n,i,g,p,m,b),v.length!==0&&u.push(v[0],v[1]);return u},qd=function(e,t,a,n,i,s,o,l,u){var v=[],f,c=new Array(a.length*2);u.forEach(function(m,b){b===0?(c[c.length-2]=m.startX,c[c.length-1]=m.startY):(c[b*4-2]=m.startX,c[b*4-1]=m.startY),c[b*4]=m.stopX,c[b*4+1]=m.stopY,f=ya(e,t,n,i,m.cx,m.cy,m.radius),f.length!==0&&v.push(f[0],f[1])});for(var h=0;h<c.length/4;h++)f=it(e,t,n,i,c[h*4],c[h*4+1],c[h*4+2],c[h*4+3],!1),f.length!==0&&v.push(f[0],f[1]);if(v.length>2){for(var d=[v[0],v[1]],y=Math.pow(d[0]-e,2)+Math.pow(d[1]-t,2),g=1;g<v.length/2;g++){var p=Math.pow(v[g*2]-e,2)+Math.pow(v[g*2+1]-t,2);p<=y&&(d[0]=v[g*2],d[1]=v[g*2+1],y=p)}return d}return v},Za=function(e,t,a){var n=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=(i-a)/i;return s<0&&(s=1e-5),[t[0]+s*n[0],t[1]+s*n[1]]},br=function(e,t){var a=Ps(e,t);return a=xv(a),a},xv=function(e){for(var t,a,n=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<n;u++)t=e[2*u],a=e[2*u+1],i=Math.min(i,t),o=Math.max(o,t),s=Math.min(s,a),l=Math.max(l,a);for(var v=2/(o-i),f=2/(l-s),c=0;c<n;c++)t=e[2*c]=e[2*c]*v,a=e[2*c+1]=e[2*c+1]*f,i=Math.min(i,t),o=Math.max(o,t),s=Math.min(s,a),l=Math.max(l,a);if(s<-1)for(var h=0;h<n;h++)a=e[2*h+1]=e[2*h+1]+(-1-s);return e},Ps=function(e,t){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=t;for(var i=new Array(e*2),s,o=0;o<e;o++)s=o*a+n,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},vt=function(e,t){return Math.min(e/4,t/4,8)},Ev=function(e,t){return Math.min(e/10,t/10,8)},no=function(){return 8},_d=function(e,t,a){return[e-2*t+a,2*(t-e),e]},As=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function yi(r,e){function t(f){for(var c=[],h=0;h<f.length;h++){var d=f[h],y=f[(h+1)%f.length],g={x:y.x-d.x,y:y.y-d.y},p={x:-g.y,y:g.x},m=Math.sqrt(p.x*p.x+p.y*p.y);c.push({x:p.x/m,y:p.y/m})}return c}function a(f,c){var h=1/0,d=-1/0,y=kr(f),g;try{for(y.s();!(g=y.n()).done;){var p=g.value,m=p.x*c.x+p.y*c.y;h=Math.min(h,m),d=Math.max(d,m)}}catch(b){y.e(b)}finally{y.f()}return{min:h,max:d}}function n(f,c){return!(f.max<c.min||c.max<f.min)}var i=[].concat(mn(t(r)),mn(t(e))),s=kr(i),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=a(r,l),v=a(e,l);if(!n(u,v))return!1}}catch(f){s.e(f)}finally{s.f()}return!0}var Gd=cr({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Hd={pageRank:function(e){for(var t=Gd(e),a=t.dampingFactor,n=t.precision,i=t.iterations,s=t.weight,o=this._private.cy,l=this.byGroup(),u=l.nodes,v=l.edges,f=u.length,c=f*f,h=v.length,d=new Array(c),y=new Array(f),g=(1-a)/f,p=0;p<f;p++){for(var m=0;m<f;m++){var b=p*f+m;d[b]=0}y[p]=0}for(var w=0;w<h;w++){var E=v[w],C=E.data("source"),x=E.data("target");if(C!==x){var T=u.indexOfId(C),k=u.indexOfId(x),D=s(E),B=k*f+T;d[B]+=D,y[T]+=D}}for(var P=1/f+g,A=0;A<f;A++)if(y[A]===0)for(var R=0;R<f;R++){var L=R*f+A;d[L]=P}else for(var I=0;I<f;I++){var M=I*f+A;d[M]=d[M]/y[A]+g}for(var O=new Array(f),V=new Array(f),G,N=0;N<f;N++)O[N]=1;for(var F=0;F<i;F++){for(var U=0;U<f;U++)V[U]=0;for(var Q=0;Q<f;Q++)for(var K=0;K<f;K++){var j=Q*f+K;V[Q]+=d[j]*O[K]}Cd(V),G=O,O=V,V=G;for(var re=0,ne=0;ne<f;ne++){var J=G[ne]-O[ne];re+=J*J}if(re<n)break}var z={rank:function(H){return H=o.collection(H)[0],O[u.indexOf(H)]}};return z}},Xo=cr({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Xt={degreeCentralityNormalized:function(e){e=Xo(e);var t=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var v={},f={},c=0,h=0,d=0;d<n;d++){var y=a[d],g=y.id();e.root=y;var p=this.degreeCentrality(e);c<p.indegree&&(c=p.indegree),h<p.outdegree&&(h=p.outdegree),v[g]=p.indegree,f[g]=p.outdegree}return{indegree:function(b){return c==0?0:(ge(b)&&(b=t.filter(b)),v[b.id()]/c)},outdegree:function(b){return h===0?0:(ge(b)&&(b=t.filter(b)),f[b.id()]/h)}}}else{for(var i={},s=0,o=0;o<n;o++){var l=a[o];e.root=l;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[l.id()]=u.degree}return{degree:function(b){return s===0?0:(ge(b)&&(b=t.filter(b)),i[b.id()]/s)}}}},degreeCentrality:function(e){e=Xo(e);var t=this.cy(),a=this,n=e,i=n.root,s=n.weight,o=n.directed,l=n.alpha;if(i=t.collection(i)[0],o){for(var h=i.connectedEdges(),d=h.filter(function(C){return C.target().same(i)&&a.has(C)}),y=h.filter(function(C){return C.source().same(i)&&a.has(C)}),g=d.length,p=y.length,m=0,b=0,w=0;w<d.length;w++)m+=s(d[w]);for(var E=0;E<y.length;E++)b+=s(y[E]);return{indegree:Math.pow(g,1-l)*Math.pow(m,l),outdegree:Math.pow(p,1-l)*Math.pow(b,l)}}else{for(var u=i.connectedEdges().intersection(a),v=u.length,f=0,c=0;c<u.length;c++)f+=s(u[c]);return{degree:Math.pow(v,1-l)*Math.pow(f,l)}}}};Xt.dc=Xt.degreeCentrality;Xt.dcn=Xt.degreeCentralityNormalised=Xt.degreeCentralityNormalized;var Yo=cr({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Yt={closenessCentralityNormalized:function(e){for(var t=Yo(e),a=t.harmonic,n=t.weight,i=t.directed,s=this.cy(),o={},l=0,u=this.nodes(),v=this.floydWarshall({weight:n,directed:i}),f=0;f<u.length;f++){for(var c=0,h=u[f],d=0;d<u.length;d++)if(f!==d){var y=v.distance(h,u[d]);a?c+=1/y:c+=y}a||(c=1/c),l<c&&(l=c),o[h.id()]=c}return{closeness:function(p){return l==0?0:(ge(p)?p=s.filter(p)[0].id():p=p.id(),o[p]/l)}}},closenessCentrality:function(e){var t=Yo(e),a=t.root,n=t.weight,i=t.directed,s=t.harmonic;a=this.filter(a)[0];for(var o=this.dijkstra({root:a,weight:n,directed:i}),l=0,u=this.nodes(),v=0;v<u.length;v++){var f=u[v];if(!f.same(a)){var c=o.distanceTo(f);s?l+=1/c:l+=c}}return s?l:1/l}};Yt.cc=Yt.closenessCentrality;Yt.ccn=Yt.closenessCentralityNormalised=Yt.closenessCentralityNormalized;var Wd=cr({weight:null,directed:!1}),Rs={betweennessCentrality:function(e){for(var t=Wd(e),a=t.directed,n=t.weight,i=n!=null,s=this.cy(),o=this.nodes(),l={},u={},v=0,f={set:function(b,w){u[b]=w,w>v&&(v=w)},get:function(b){return u[b]}},c=0;c<o.length;c++){var h=o[c],d=h.id();a?l[d]=h.outgoers().nodes():l[d]=h.openNeighborhood().nodes(),f.set(d,0)}for(var y=function(){for(var b=o[g].id(),w=[],E={},C={},x={},T=new Va(function(Q,K){return x[Q]-x[K]}),k=0;k<o.length;k++){var D=o[k].id();E[D]=[],C[D]=0,x[D]=1/0}for(C[b]=1,x[b]=0,T.push(b);!T.empty();){var B=T.pop();if(w.push(B),i)for(var P=0;P<l[B].length;P++){var A=l[B][P],R=s.getElementById(B),L=void 0;R.edgesTo(A).length>0?L=R.edgesTo(A)[0]:L=A.edgesTo(R)[0];var I=n(L);A=A.id(),x[A]>x[B]+I&&(x[A]=x[B]+I,T.nodes.indexOf(A)<0?T.push(A):T.updateItem(A),C[A]=0,E[A]=[]),x[A]==x[B]+I&&(C[A]=C[A]+C[B],E[A].push(B))}else for(var M=0;M<l[B].length;M++){var O=l[B][M].id();x[O]==1/0&&(T.push(O),x[O]=x[B]+1),x[O]==x[B]+1&&(C[O]=C[O]+C[B],E[O].push(B))}}for(var V={},G=0;G<o.length;G++)V[o[G].id()]=0;for(;w.length>0;){for(var N=w.pop(),F=0;F<E[N].length;F++){var U=E[N][F];V[U]=V[U]+C[U]/C[N]*(1+V[N])}N!=o[g].id()&&f.set(N,f.get(N)+V[N])}},g=0;g<o.length;g++)y();var p={betweenness:function(b){var w=s.collection(b).id();return f.get(w)},betweennessNormalized:function(b){if(v==0)return 0;var w=s.collection(b).id();return f.get(w)/v}};return p.betweennessNormalised=p.betweennessNormalized,p}};Rs.bc=Rs.betweennessCentrality;var $d=cr({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),Ud=function(e){return $d(e)},Kd=function(e,t){for(var a=0,n=0;n<t.length;n++)a+=t[n](e);return a},Xd=function(e,t,a){for(var n=0;n<t;n++)e[n*t+n]=a},Cv=function(e,t){for(var a,n=0;n<t;n++){a=0;for(var i=0;i<t;i++)a+=e[i*t+n];for(var s=0;s<t;s++)e[s*t+n]=e[s*t+n]/a}},Yd=function(e,t,a){for(var n=new Array(a*a),i=0;i<a;i++)