(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const o of u.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function n(a){if(a.ep)return;a.ep=!0;const u=r(a);fetch(a.href,u)}})();var vf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bk(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tv={exports:{}},rs={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var FE;function J5(){if(FE)return rs;FE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,a,u){var o=null;if(u!==void 0&&(o=""+u),a.key!==void 0&&(o=""+a.key),"key"in a){u={};for(var s in a)s!=="key"&&(u[s]=a[s])}else u=a;return a=u.ref,{$$typeof:t,type:n,key:o,ref:a!==void 0?a:null,props:u}}return rs.Fragment=e,rs.jsx=r,rs.jsxs=r,rs}var YE;function eN(){return YE||(YE=1,tv.exports=J5()),tv.exports}var wt=eN(),rv={exports:{}},Ze={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $E;function tN(){if($E)return Ze;$E=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),v=Symbol.iterator;function g(I){return I===null||typeof I!="object"?null:(I=v&&I[v]||I["@@iterator"],typeof I=="function"?I:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function w(I,H,Q){this.props=I,this.context=H,this.refs=x,this.updater=Q||m}w.prototype.isReactComponent={},w.prototype.setState=function(I,H){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,H,"setState")},w.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function _(){}_.prototype=w.prototype;function E(I,H,Q){this.props=I,this.context=H,this.refs=x,this.updater=Q||m}var S=E.prototype=new _;S.constructor=E,y(S,w.prototype),S.isPureReactComponent=!0;var C=Array.isArray,k={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function q(I,H,Q,te,Y,X){return Q=X.ref,{$$typeof:t,type:I,key:H,ref:Q!==void 0?Q:null,props:X}}function M(I,H){return q(I.type,H,void 0,void 0,void 0,I.props)}function A(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function L(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Q){return H[Q]})}var R=/\/+/g;function B(I,H){return typeof I=="object"&&I!==null&&I.key!=null?L(""+I.key):H.toString(36)}function D(){}function N(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(D,D):(I.status="pending",I.then(function(H){I.status==="pending"&&(I.status="fulfilled",I.value=H)},function(H){I.status==="pending"&&(I.status="rejected",I.reason=H)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function U(I,H,Q,te,Y){var X=typeof I;(X==="undefined"||X==="boolean")&&(I=null);var j=!1;if(I===null)j=!0;else switch(X){case"bigint":case"string":case"number":j=!0;break;case"object":switch(I.$$typeof){case t:case e:j=!0;break;case d:return j=I._init,U(j(I._payload),H,Q,te,Y)}}if(j)return Y=Y(I),j=te===""?"."+B(I,0):te,C(Y)?(Q="",j!=null&&(Q=j.replace(R,"$&/")+"/"),U(Y,H,Q,"",function(ee){return ee})):Y!=null&&(A(Y)&&(Y=M(Y,Q+(Y.key==null||I&&I.key===Y.key?"":(""+Y.key).replace(R,"$&/")+"/")+j)),H.push(Y)),1;j=0;var re=te===""?".":te+":";if(C(I))for(var ie=0;ie>>1,I=z[K];if(0>>1;Ka(te,V))Ya(X,te)?(z[K]=X,z[Y]=V,K=Y):(z[K]=te,z[Q]=V,K=Q);else if(Ya(X,V))z[K]=X,z[Y]=V,K=Y;else break e}}return G}function a(z,G){var V=z.sortIndex-G.sortIndex;return V!==0?V:z.id-G.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var f=[],c=[],d=1,v=null,g=3,m=!1,y=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function S(z){for(var G=r(c);G!==null;){if(G.callback===null)n(c);else if(G.startTime<=z)n(c),G.sortIndex=G.expirationTime,e(f,G);else break;G=r(c)}}function C(z){if(x=!1,S(z),!y)if(r(f)!==null)y=!0,N();else{var G=r(c);G!==null&&U(C,G.startTime-z)}}var k=!1,O=-1,q=5,M=-1;function A(){return!(t.unstable_now()-Mz&&A());){var K=v.callback;if(typeof K=="function"){v.callback=null,g=v.priorityLevel;var I=K(v.expirationTime<=z);if(z=t.unstable_now(),typeof I=="function"){v.callback=I,S(z),G=!0;break t}v===r(f)&&n(f),S(z)}else n(f);v=r(f)}if(v!==null)G=!0;else{var H=r(c);H!==null&&U(C,H.startTime-z),G=!1}}break e}finally{v=null,g=V,m=!1}G=void 0}}finally{G?R():k=!1}}}var R;if(typeof E=="function")R=function(){E(L)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,D=B.port2;B.port1.onmessage=L,R=function(){D.postMessage(null)}}else R=function(){w(L,0)};function N(){k||(k=!0,R())}function U(z,G){O=w(function(){z(t.unstable_now())},G)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_continueExecution=function(){y||m||(y=!0,N())},t.unstable_forceFrameRate=function(z){0>z||125K?(z.sortIndex=V,e(c,z),r(f)===null&&z===r(c)&&(x?(_(O),O=-1):x=!0,U(C,V-K))):(z.sortIndex=I,e(f,z),y||m||(y=!0,N())),z},t.unstable_shouldYield=A,t.unstable_wrapCallback=function(z){var G=g;return function(){var V=g;g=G;try{return z.apply(this,arguments)}finally{g=V}}}}(iv)),iv}var jE;function nN(){return jE||(jE=1,av.exports=rN()),av.exports}var uv={exports:{}},xr={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ZE;function aN(){if(ZE)return xr;ZE=1;var t=_1();function e(f){var c="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),uv.exports=aN(),uv.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var WE;function uN(){if(WE)return ns;WE=1;var t=nN(),e=_1(),r=iN();function n(i){var l="https://react.dev/errors/"+i;if(1)":-1b||Z[p]!==ae[b]){var me=` `+Z[p].replace(" at new "," at ");return i.displayName&&me.includes("")&&(me=me.replace("",i.displayName)),me}while(1<=p&&0<=b);break}}}finally{N=!1,Error.prepareStackTrace=h}return(h=i?i.displayName||i.name:"")?D(h):""}function z(i){switch(i.tag){case 26:case 27:case 5:return D(i.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 15:return i=U(i.type,!1),i;case 11:return i=U(i.type.render,!1),i;case 1:return i=U(i.type,!0),i;default:return""}}function G(i){try{var l="";do l+=z(i),i=i.return;while(i);return l}catch(h){return` Error generating stack: `+h.message+` `+h.stack}}function V(i){var l=i,h=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(h=l.return),i=l.return;while(i)}return l.tag===3?h:null}function K(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function I(i){if(V(i)!==i)throw Error(n(188))}function H(i){var l=i.alternate;if(!l){if(l=V(i),l===null)throw Error(n(188));return l!==i?null:i}for(var h=i,p=l;;){var b=h.return;if(b===null)break;var T=b.alternate;if(T===null){if(p=b.return,p!==null){h=p;continue}break}if(b.child===T.child){for(T=b.child;T;){if(T===h)return I(b),i;if(T===p)return I(b),l;T=T.sibling}throw Error(n(188))}if(h.return!==p.return)h=b,p=T;else{for(var P=!1,F=b.child;F;){if(F===h){P=!0,h=b,p=T;break}if(F===p){P=!0,p=b,h=T;break}F=F.sibling}if(!P){for(F=T.child;F;){if(F===h){P=!0,h=T,p=b;break}if(F===p){P=!0,p=T,h=b;break}F=F.sibling}if(!P)throw Error(n(189))}}if(h.alternate!==p)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?i:l}function Q(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=Q(i),l!==null)return l;i=i.sibling}return null}var te=Array.isArray,Y=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},j=[],re=-1;function ie(i){return{current:i}}function ee(i){0>re||(i.current=j[re],j[re]=null,re--)}function W(i,l){re++,j[re]=i.current,i.current=l}var J=ie(null),ce=ie(null),he=ie(null),be=ie(null);function _e(i,l){switch(W(he,l),W(ce,i),W(J,null),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)&&(l=l.namespaceURI)?bE(l):0;break;default:if(i=i===8?l.parentNode:l,l=i.tagName,i=i.namespaceURI)i=bE(i),l=wE(i,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}ee(J),W(J,l)}function Ne(){ee(J),ee(ce),ee(he)}function Ae(i){i.memoizedState!==null&&W(be,i);var l=J.current,h=wE(l,i.type);l!==h&&(W(ce,i),W(J,h))}function Se(i){ce.current===i&&(ee(J),ee(ce)),be.current===i&&(ee(be),Qo._currentValue=X)}var Te=Object.prototype.hasOwnProperty,Be=t.unstable_scheduleCallback,Ue=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,qe=t.unstable_requestPaint,ze=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,we=t.unstable_ImmediatePriority,$=t.unstable_UserBlockingPriority,ue=t.unstable_NormalPriority,ve=t.unstable_LowPriority,oe=t.unstable_IdlePriority,fe=t.log,Ce=t.unstable_setDisableYieldValue,ge=null,Ee=null;function Ge(i){if(Ee&&typeof Ee.onCommitFiberRoot=="function")try{Ee.onCommitFiberRoot(ge,i,void 0,(i.current.flags&128)===128)}catch{}}function Ve(i){if(typeof fe=="function"&&Ce(i),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(ge,i)}catch{}}var De=Math.clz32?Math.clz32:He,$e=Math.log,Ke=Math.LN2;function He(i){return i>>>=0,i===0?32:31-($e(i)/Ke|0)|0}var st=128,ct=4194304;function Nt(i){var l=i&42;if(l!==0)return l;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function nr(i,l){var h=i.pendingLanes;if(h===0)return 0;var p=0,b=i.suspendedLanes,T=i.pingedLanes,P=i.warmLanes;i=i.finishedLanes!==0;var F=h&134217727;return F!==0?(h=F&~b,h!==0?p=Nt(h):(T&=F,T!==0?p=Nt(T):i||(P=F&~P,P!==0&&(p=Nt(P))))):(F=h&~b,F!==0?p=Nt(F):T!==0?p=Nt(T):i||(P=h&~P,P!==0&&(p=Nt(P)))),p===0?0:l!==0&&l!==p&&(l&b)===0&&(b=p&-p,P=l&-l,b>=P||b===32&&(P&4194176)!==0)?l:p}function _t(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function Gt(i,l){switch(i){case 1:case 2:case 4:case 8:return l+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zt(){var i=st;return st<<=1,(st&4194176)===0&&(st=128),i}function ar(){var i=ct;return ct<<=1,(ct&62914560)===0&&(ct=4194304),i}function Kt(i){for(var l=[],h=0;31>h;h++)l.push(i);return l}function br(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Mr(i,l,h,p,b,T){var P=i.pendingLanes;i.pendingLanes=h,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=h,i.entangledLanes&=h,i.errorRecoveryDisabledLanes&=h,i.shellSuspendCounter=0;var F=i.entanglements,Z=i.expirationTimes,ae=i.hiddenUpdates;for(h=P&~h;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ii=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),kr={},il={};function KB(i){return Te.call(il,i)?!0:Te.call(kr,i)?!1:ii.test(i)?il[i]=!0:(kr[i]=!0,!1)}function ul(i,l,h){if(KB(l))if(h===null)i.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+h)}}function ol(i,l,h){if(h===null)i.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+h)}}function Kn(i,l,h,p){if(p===null)i.removeAttribute(h);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(h);return}i.setAttributeNS(l,h,""+p)}}function jr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function _w(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function XB(i){var l=_w(i)?"checked":"value",h=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),p=""+i[l];if(!i.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,T=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return b.call(this)},set:function(P){p=""+P,T.call(this,P)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return p},setValue:function(P){p=""+P},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function sl(i){i._valueTracker||(i._valueTracker=XB(i))}function Ew(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var h=l.getValue(),p="";return i&&(p=_w(i)?i.checked?"true":"false":i.value),i=p,i!==h?(l.setValue(i),!0):!1}function ll(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var jB=/[\n"\\]/g;function Zr(i){return i.replace(jB,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Jc(i,l,h,p,b,T,P,F){i.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?i.type=P:i.removeAttribute("type"),l!=null?P==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+jr(l)):i.value!==""+jr(l)&&(i.value=""+jr(l)):P!=="submit"&&P!=="reset"||i.removeAttribute("value"),l!=null?ed(i,P,jr(l)):h!=null?ed(i,P,jr(h)):p!=null&&i.removeAttribute("value"),b==null&&T!=null&&(i.defaultChecked=!!T),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?i.name=""+jr(F):i.removeAttribute("name")}function Sw(i,l,h,p,b,T,P,F){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(i.type=T),l!=null||h!=null){if(!(T!=="submit"&&T!=="reset"||l!=null))return;h=h!=null?""+jr(h):"",l=l!=null?""+jr(l):h,F||l===i.value||(i.value=l),i.defaultValue=l}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=F?i.checked:!!p,i.defaultChecked=!!p,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(i.name=P)}function ed(i,l,h){l==="number"&&ll(i.ownerDocument)===i||i.defaultValue===""+h||(i.defaultValue=""+h)}function Xi(i,l,h,p){if(i=i.options,l){l={};for(var b=0;b=go),zw=" ",Pw=!1;function Iw(i,l){switch(i){case"keyup":return EL.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uw(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Wi=!1;function TL(i,l){switch(i){case"compositionend":return Uw(l);case"keypress":return l.which!==32?null:(Pw=!0,zw);case"textInput":return i=l.data,i===zw&&Pw?null:i;default:return null}}function CL(i,l){if(Wi)return i==="compositionend"||!cd&&Iw(i,l)?(i=kw(),cl=ud=ya=null,Wi=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:h,offset:l-i};i=p}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=Xw(h)}}function Zw(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?Zw(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function Qw(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=ll(i.document);l instanceof i.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)i=l.contentWindow;else break;l=ll(i.document)}return l}function vd(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function BL(i,l){var h=Qw(l);l=i.focusedElem;var p=i.selectionRange;if(h!==l&&l&&l.ownerDocument&&Zw(l.ownerDocument.documentElement,l)){if(p!==null&&vd(l)){if(i=p.start,h=p.end,h===void 0&&(h=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(h,l.value.length);else if(h=(i=l.ownerDocument||document)&&i.defaultView||window,h.getSelection){h=h.getSelection();var b=l.textContent.length,T=Math.min(p.start,b);p=p.end===void 0?T:Math.min(p.end,b),!h.extend&&T>p&&(b=p,p=T,T=b),b=jw(l,T);var P=jw(l,p);b&&P&&(h.rangeCount!==1||h.anchorNode!==b.node||h.anchorOffset!==b.offset||h.focusNode!==P.node||h.focusOffset!==P.offset)&&(i=i.createRange(),i.setStart(b.node,b.offset),h.removeAllRanges(),T>p?(h.addRange(i),h.extend(P.node,P.offset)):(i.setEnd(P.node,P.offset),h.addRange(i)))}}for(i=[],h=l;h=h.parentNode;)h.nodeType===1&&i.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,Ji=null,gd=null,bo=null,pd=!1;function Ww(i,l,h){var p=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;pd||Ji==null||Ji!==ll(p)||(p=Ji,"selectionStart"in p&&vd(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),bo&&yo(bo,p)||(bo=p,p=Wl(gd,"onSelect"),0>=P,b-=P,Xn=1<<32-De(l)+b|h<Ye?(or=Pe,Pe=null):or=Pe.sibling;var ut=de(se,Pe,le[Ye],ye);if(ut===null){Pe===null&&(Pe=or);break}i&&Pe&&ut.alternate===null&&l(se,Pe),ne=T(ut,ne,Ye),Je===null?ke=ut:Je.sibling=ut,Je=ut,Pe=or}if(Ye===le.length)return h(se,Pe),it&&fi(se,Ye),ke;if(Pe===null){for(;YeYe?(or=Pe,Pe=null):or=Pe.sibling;var Pa=de(se,Pe,ut.value,ye);if(Pa===null){Pe===null&&(Pe=or);break}i&&Pe&&Pa.alternate===null&&l(se,Pe),ne=T(Pa,ne,Ye),Je===null?ke=Pa:Je.sibling=Pa,Je=Pa,Pe=or}if(ut.done)return h(se,Pe),it&&fi(se,Ye),ke;if(Pe===null){for(;!ut.done;Ye++,ut=le.next())ut=xe(se,ut.value,ye),ut!==null&&(ne=T(ut,ne,Ye),Je===null?ke=ut:Je.sibling=ut,Je=ut);return it&&fi(se,Ye),ke}for(Pe=p(Pe);!ut.done;Ye++,ut=le.next())ut=pe(Pe,se,Ye,ut.value,ye),ut!==null&&(i&&ut.alternate!==null&&Pe.delete(ut.key===null?Ye:ut.key),ne=T(ut,ne,Ye),Je===null?ke=ut:Je.sibling=ut,Je=ut);return i&&Pe.forEach(function(W5){return l(se,W5)}),it&&fi(se,Ye),ke}function Bt(se,ne,le,ye){if(typeof le=="object"&&le!==null&&le.type===f&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case o:e:{for(var ke=le.key;ne!==null;){if(ne.key===ke){if(ke=le.type,ke===f){if(ne.tag===7){h(se,ne.sibling),ye=b(ne,le.props.children),ye.return=se,se=ye;break e}}else if(ne.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===E&&gx(ke)===ne.type){h(se,ne.sibling),ye=b(ne,le.props),Co(ye,le),ye.return=se,se=ye;break e}h(se,ne);break}else l(se,ne);ne=ne.sibling}le.type===f?(ye=xi(le.props.children,se.mode,ye,le.key),ye.return=se,se=ye):(ye=Vl(le.type,le.key,le.props,null,se.mode,ye),Co(ye,le),ye.return=se,se=ye)}return P(se);case s:e:{for(ke=le.key;ne!==null;){if(ne.key===ke)if(ne.tag===4&&ne.stateNode.containerInfo===le.containerInfo&&ne.stateNode.implementation===le.implementation){h(se,ne.sibling),ye=b(ne,le.children||[]),ye.return=se,se=ye;break e}else{h(se,ne);break}else l(se,ne);ne=ne.sibling}ye=yh(le,se.mode,ye),ye.return=se,se=ye}return P(se);case E:return ke=le._init,le=ke(le._payload),Bt(se,ne,le,ye)}if(te(le))return Le(se,ne,le,ye);if(O(le)){if(ke=O(le),typeof ke!="function")throw Error(n(150));return le=ke.call(le),Xe(se,ne,le,ye)}if(typeof le.then=="function")return Bt(se,ne,El(le),ye);if(le.$$typeof===m)return Bt(se,ne,Il(se,le),ye);Sl(se,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,ne!==null&&ne.tag===6?(h(se,ne.sibling),ye=b(ne,le),ye.return=se,se=ye):(h(se,ne),ye=mh(le,se.mode,ye),ye.return=se,se=ye),P(se)):h(se,ne)}return function(se,ne,le,ye){try{To=0;var ke=Bt(se,ne,le,ye);return iu=null,ke}catch(Pe){if(Pe===Eo)throw Pe;var Je=an(29,Pe,null,se.mode);return Je.lanes=ye,Je.return=se,Je}finally{}}}var di=px(!0),mx=px(!1),uu=ie(null),Tl=ie(0);function yx(i,l){i=ua,W(Tl,i),W(uu,l),ua=i|l.baseLanes}function Sd(){W(Tl,ua),W(uu,uu.current)}function Td(){ua=Tl.current,ee(uu),ee(Tl)}var tn=ie(null),Mn=null;function wa(i){var l=i.alternate;W(Zt,Zt.current&1),W(tn,i),Mn===null&&(l===null||uu.current!==null||l.memoizedState!==null)&&(Mn=i)}function bx(i){if(i.tag===22){if(W(Zt,Zt.current),W(tn,i),Mn===null){var l=i.alternate;l!==null&&l.memoizedState!==null&&(Mn=i)}}else xa()}function xa(){W(Zt,Zt.current),W(tn,tn.current)}function Zn(i){ee(tn),Mn===i&&(Mn=null),ee(Zt)}var Zt=ie(0);function Cl(i){for(var l=i;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var IL=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(h,p){i.push(p)}};this.abort=function(){l.aborted=!0,i.forEach(function(h){return h()})}},UL=t.unstable_scheduleCallback,GL=t.unstable_NormalPriority,Qt={$$typeof:m,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cd(){return{controller:new IL,data:new Map,refCount:0}}function Ao(i){i.refCount--,i.refCount===0&&UL(GL,function(){i.controller.abort()})}var Ro=null,Ad=0,ou=0,su=null;function VL(i,l){if(Ro===null){var h=Ro=[];Ad=0,ou=qh(),su={status:"pending",value:void 0,then:function(p){h.push(p)}}}return Ad++,l.then(wx,wx),l}function wx(){if(--Ad===0&&Ro!==null){su!==null&&(su.status="fulfilled");var i=Ro;Ro=null,ou=0,su=null;for(var l=0;lT?T:8;var P=A.T,F={};A.T=F,Fd(i,!1,l,h);try{var Z=b(),ae=A.S;if(ae!==null&&ae(F,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var me=HL(Z,p);ko(i,l,me,Hr(i))}else ko(i,l,p,Hr(i))}catch(xe){ko(i,l,{then:function(){},status:"rejected",reason:xe},Hr())}finally{Y.p=T,A.T=P}}function XL(){}function Vd(i,l,h,p){if(i.tag!==5)throw Error(n(476));var b=Qx(i).queue;Zx(i,b,l,X,h===null?XL:function(){return Wx(i),h(p)})}function Qx(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:X},next:null};var h={};return l.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:h},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function Wx(i){var l=Qx(i).next.queue;ko(i,l,{},Hr())}function Hd(){return wr(Qo)}function Jx(){return Ft().memoizedState}function e_(){return Ft().memoizedState}function jL(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var h=Hr();i=Ca(h);var p=Aa(l,i,h);p!==null&&(Ar(p,l,h),Bo(p,l,h)),l={cache:Cd()},i.payload=l;return}l=l.return}}function ZL(i,l,h){var p=Hr();h={lane:p,revertLane:0,action:h,hasEagerState:!1,eagerState:null,next:null},Ll(i)?r_(l,h):(h=bd(i,l,h,p),h!==null&&(Ar(h,i,p),n_(h,l,p)))}function t_(i,l,h){var p=Hr();ko(i,l,h,p)}function ko(i,l,h,p){var b={lane:p,revertLane:0,action:h,hasEagerState:!1,eagerState:null,next:null};if(Ll(i))r_(l,b);else{var T=i.alternate;if(i.lanes===0&&(T===null||T.lanes===0)&&(T=l.lastRenderedReducer,T!==null))try{var P=l.lastRenderedState,F=T(P,h);if(b.hasEagerState=!0,b.eagerState=F,Ir(F,P))return yl(i,l,b,0),mt===null&&ml(),!1}catch{}finally{}if(h=bd(i,l,b,p),h!==null)return Ar(h,i,p),n_(h,l,p),!0}return!1}function Fd(i,l,h,p){if(p={lane:2,revertLane:qh(),action:p,hasEagerState:!1,eagerState:null,next:null},Ll(i)){if(l)throw Error(n(479))}else l=bd(i,h,p,2),l!==null&&Ar(l,i,2)}function Ll(i){var l=i.alternate;return i===Qe||l!==null&&l===Qe}function r_(i,l){lu=Rl=!0;var h=i.pending;h===null?l.next=l:(l.next=h.next,h.next=l),i.pending=l}function n_(i,l,h){if((h&4194176)!==0){var p=l.lanes;p&=i.pendingLanes,h|=p,l.lanes=h,Yr(i,h)}}var kn={readContext:wr,use:kl,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut};kn.useCacheRefresh=Ut,kn.useMemoCache=Ut,kn.useHostTransitionStatus=Ut,kn.useFormState=Ut,kn.useActionState=Ut,kn.useOptimistic=Ut;var gi={readContext:wr,use:kl,useCallback:function(i,l){return qr().memoizedState=[i,l===void 0?null:l],i},useContext:wr,useEffect:Vx,useImperativeHandle:function(i,l,h){h=h!=null?h.concat([i]):null,ql(4194308,4,Yx.bind(null,l,i),h)},useLayoutEffect:function(i,l){return ql(4194308,4,i,l)},useInsertionEffect:function(i,l){ql(4,2,i,l)},useMemo:function(i,l){var h=qr();l=l===void 0?null:l;var p=i();if(vi){Ve(!0);try{i()}finally{Ve(!1)}}return h.memoizedState=[p,l],p},useReducer:function(i,l,h){var p=qr();if(h!==void 0){var b=h(l);if(vi){Ve(!0);try{h(l)}finally{Ve(!1)}}}else b=l;return p.memoizedState=p.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},p.queue=i,i=i.dispatch=ZL.bind(null,Qe,i),[p.memoizedState,i]},useRef:function(i){var l=qr();return i={current:i},l.memoizedState=i},useState:function(i){i=zd(i);var l=i.queue,h=t_.bind(null,Qe,l);return l.dispatch=h,[i.memoizedState,h]},useDebugValue:Ud,useDeferredValue:function(i,l){var h=qr();return Gd(h,i,l)},useTransition:function(){var i=zd(!1);return i=Zx.bind(null,Qe,i.queue,!0,!1),qr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,h){var p=Qe,b=qr();if(it){if(h===void 0)throw Error(n(407));h=h()}else{if(h=l(),mt===null)throw Error(n(349));(rt&60)!==0||Cx(p,l,h)}b.memoizedState=h;var T={value:h,getSnapshot:l};return b.queue=T,Vx(Rx.bind(null,p,T,i),[i]),p.flags|=2048,cu(9,Ax.bind(null,p,T,h,l),{destroy:void 0},null),h},useId:function(){var i=qr(),l=mt.identifierPrefix;if(it){var h=jn,p=Xn;h=(p&~(1<<32-De(p)-1)).toString(32)+h,l=":"+l+"R"+h,h=Dl++,0 title"))),vr(T,p,h),T[Pt]=i,It(T),p=T;break e;case"link":var P=ME("link","href",b).get(p+(h.href||""));if(P){for(var F=0;F<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof p.is=="string"?b.createElement("select",{is:p.is}):b.createElement("select"),p.multiple?i.multiple=!0:p.size&&(i.size=p.size);break;default:i=typeof p.is=="string"?b.createElement(h,{is:p.is}):b.createElement(h)}}i[Pt]=l,i[Et]=p;e:for(b=l.child;b!==null;){if(b.tag===5||b.tag===6)i.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===l)break e;for(;b.sibling===null;){if(b.return===null||b.return===l)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}l.stateNode=i;e:switch(vr(i,h,p),h){case"button":case"input":case"select":case"textarea":i=!!p.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&aa(l)}}return Rt(l),l.flags&=-16777217,null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==p&&aa(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(n(166));if(i=he.current,wo(l)){if(i=l.stateNode,h=l.memoizedProps,p=null,b=Cr,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}i[Pt]=l,i=!!(i.nodeValue===h||p!==null&&p.suppressHydrationWarning===!0||yE(i.nodeValue,h)),i||ci(l)}else i=ef(i).createTextNode(p),i[Pt]=l,l.stateNode=i}return Rt(l),null;case 13:if(p=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=wo(l),p!==null&&p.dehydrated!==null){if(i===null){if(!b)throw Error(n(318));if(b=l.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(n(317));b[Pt]=l}else xo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Rt(l),b=!1}else pn!==null&&(Ch(pn),pn=null),b=!0;if(!b)return l.flags&256?(Zn(l),l):(Zn(l),null)}if(Zn(l),(l.flags&128)!==0)return l.lanes=h,l;if(h=p!==null,i=i!==null&&i.memoizedState!==null,h){p=l.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool);var T=null;p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(T=p.memoizedState.cachePool.pool),T!==b&&(p.flags|=2048)}return h!==i&&h&&(l.child.flags|=8192),Hl(l,l.updateQueue),Rt(l),null;case 4:return Ne(),i===null&&zh(l.stateNode.containerInfo),Rt(l),null;case 10:return ea(l.type),Rt(l),null;case 19:if(ee(Zt),b=l.memoizedState,b===null)return Rt(l),null;if(p=(l.flags&128)!==0,T=b.rendering,T===null)if(p)Go(b,!1);else{if(qt!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(T=Cl(i),T!==null){for(l.flags|=128,Go(b,!1),i=T.updateQueue,l.updateQueue=i,Hl(l,i),l.subtreeFlags=0,i=h,h=l.child;h!==null;)$_(h,i),h=h.sibling;return W(Zt,Zt.current&1|2),l.child}i=i.sibling}b.tail!==null&&ze()>Fl&&(l.flags|=128,p=!0,Go(b,!1),l.lanes=4194304)}else{if(!p)if(i=Cl(T),i!==null){if(l.flags|=128,p=!0,i=i.updateQueue,l.updateQueue=i,Hl(l,i),Go(b,!0),b.tail===null&&b.tailMode==="hidden"&&!T.alternate&&!it)return Rt(l),null}else 2*ze()-b.renderingStartTime>Fl&&h!==536870912&&(l.flags|=128,p=!0,Go(b,!1),l.lanes=4194304);b.isBackwards?(T.sibling=l.child,l.child=T):(i=b.last,i!==null?i.sibling=T:l.child=T,b.last=T)}return b.tail!==null?(l=b.tail,b.rendering=l,b.tail=l.sibling,b.renderingStartTime=ze(),l.sibling=null,i=Zt.current,W(Zt,p?i&1|2:i&1),l):(Rt(l),null);case 22:case 23:return Zn(l),Td(),p=l.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(h&536870912)!==0&&(l.flags&128)===0&&(Rt(l),l.subtreeFlags&6&&(l.flags|=8192)):Rt(l),h=l.updateQueue,h!==null&&Hl(l,h.retryQueue),h=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==h&&(l.flags|=2048),i!==null&&ee(hi),null;case 24:return h=null,i!==null&&(h=i.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),ea(Qt),Rt(l),null;case 25:return null}throw Error(n(156,l.tag))}function n5(i,l){switch(xd(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return ea(Qt),Ne(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return Se(l),null;case 13:if(Zn(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));xo()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return ee(Zt),null;case 4:return Ne(),null;case 10:return ea(l.type),null;case 22:case 23:return Zn(l),Td(),i!==null&&ee(hi),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return ea(Qt),null;case 25:return null;default:return null}}function j_(i,l){switch(xd(l),l.tag){case 3:ea(Qt),Ne();break;case 26:case 27:case 5:Se(l);break;case 4:Ne();break;case 13:Zn(l);break;case 19:ee(Zt);break;case 10:ea(l.type);break;case 22:case 23:Zn(l),Td(),i!==null&&ee(hi);break;case 24:ea(Qt)}}var a5={getCacheForType:function(i){var l=wr(Qt),h=l.data.get(i);return h===void 0&&(h=i(),l.data.set(i,h)),h}},i5=typeof WeakMap=="function"?WeakMap:Map,Dt=0,mt=null,et=null,rt=0,yt=0,Vr=null,ia=!1,gu=!1,bh=!1,ua=0,qt=0,Oa=0,_i=0,wh=0,un=0,pu=0,Vo=null,On=null,xh=!1,_h=0,Fl=1/0,Yl=null,qa=null,$l=!1,Ei=null,Ho=0,Eh=0,Sh=null,Fo=0,Th=null;function Hr(){if((Dt&2)!==0&&rt!==0)return rt&-rt;if(A.T!==null){var i=ou;return i!==0?i:qh()}return Xt()}function Z_(){un===0&&(un=(rt&536870912)===0||it?zt():536870912);var i=tn.current;return i!==null&&(i.flags|=32),un}function Ar(i,l,h){(i===mt&&yt===2||i.cancelPendingCommit!==null)&&(mu(i,0),oa(i,rt,un,!1)),br(i,h),((Dt&2)===0||i!==mt)&&(i===mt&&((Dt&2)===0&&(_i|=h),qt===4&&oa(i,rt,un,!1)),qn(i))}function Q_(i,l,h){if((Dt&6)!==0)throw Error(n(327));var p=!h&&(l&60)===0&&(l&i.expiredLanes)===0||_t(i,l),b=p?s5(i,l):Dh(i,l,!0),T=p;do{if(b===0){gu&&!p&&oa(i,l,0,!1);break}else if(b===6)oa(i,l,0,!ia);else{if(h=i.current.alternate,T&&!u5(h)){b=Dh(i,l,!1),T=!1;continue}if(b===2){if(T=l,i.errorRecoveryDisabledLanes&T)var P=0;else P=i.pendingLanes&-536870913,P=P!==0?P:P&536870912?536870912:0;if(P!==0){l=P;e:{var F=i;b=Vo;var Z=F.current.memoizedState.isDehydrated;if(Z&&(mu(F,P).flags|=256),P=Dh(F,P,!1),P!==2){if(bh&&!Z){F.errorRecoveryDisabledLanes|=T,_i|=T,b=4;break e}T=On,On=b,T!==null&&Ch(T)}b=P}if(T=!1,b!==2)continue}}if(b===1){mu(i,0),oa(i,l,0,!0);break}e:{switch(p=i,b){case 0:case 1:throw Error(n(345));case 4:if((l&4194176)===l){oa(p,l,un,!ia);break e}break;case 2:On=null;break;case 3:case 5:break;default:throw Error(n(329))}if(p.finishedWork=h,p.finishedLanes=l,(l&62914560)===l&&(T=_h+300-ze(),10h?32:h,A.T=null,Ei===null)var T=!1;else{h=Sh,Sh=null;var P=Ei,F=Ho;if(Ei=null,Ho=0,(Dt&6)!==0)throw Error(n(331));var Z=Dt;if(Dt|=4,F_(P.current),G_(P,P.current,F,h),Dt=Z,Yo(0,!1),Ee&&typeof Ee.onPostCommitFiberRoot=="function")try{Ee.onPostCommitFiberRoot(ge,P)}catch{}T=!0}return T}finally{Y.p=b,A.T=p,uE(i,l)}}return!1}function oE(i,l,h){l=Wr(h,l),l=Kd(i.stateNode,l,2),i=Aa(i,l,2),i!==null&&(br(i,2),qn(i))}function gt(i,l,h){if(i.tag===3)oE(i,i,h);else for(;l!==null;){if(l.tag===3){oE(l,i,h);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(qa===null||!qa.has(p))){i=Wr(h,i),h=f_(2),p=Aa(l,h,2),p!==null&&(c_(h,p,l,i),br(p,2),qn(p));break}}l=l.return}}function Mh(i,l,h){var p=i.pingCache;if(p===null){p=i.pingCache=new i5;var b=new Set;p.set(l,b)}else b=p.get(l),b===void 0&&(b=new Set,p.set(l,b));b.has(h)||(bh=!0,b.add(h),i=c5.bind(null,i,l,h),l.then(i,i))}function c5(i,l,h){var p=i.pingCache;p!==null&&p.delete(l),i.pingedLanes|=i.suspendedLanes&h,i.warmLanes&=~h,mt===i&&(rt&h)===h&&(qt===4||qt===3&&(rt&62914560)===rt&&300>ze()-_h?(Dt&2)===0&&mu(i,0):wh|=h,pu===rt&&(pu=0)),qn(i)}function sE(i,l){l===0&&(l=ar()),i=ba(i,l),i!==null&&(br(i,l),qn(i))}function d5(i){var l=i.memoizedState,h=0;l!==null&&(h=l.retryLane),sE(i,h)}function h5(i,l){var h=0;switch(i.tag){case 13:var p=i.stateNode,b=i.memoizedState;b!==null&&(h=b.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(n(314))}p!==null&&p.delete(l),sE(i,h)}function v5(i,l){return Be(i,l)}var jl=null,wu=null,kh=!1,Zl=!1,Oh=!1,Si=0;function qn(i){i!==wu&&i.next===null&&(wu===null?jl=wu=i:wu=wu.next=i),Zl=!0,kh||(kh=!0,p5(g5))}function Yo(i,l){if(!Oh&&Zl){Oh=!0;do for(var h=!1,p=jl;p!==null;){if(i!==0){var b=p.pendingLanes;if(b===0)var T=0;else{var P=p.suspendedLanes,F=p.pingedLanes;T=(1<<31-De(42|i)+1)-1,T&=b&~(P&~F),T=T&201326677?T&201326677|1:T?T|2:0}T!==0&&(h=!0,cE(p,T))}else T=rt,T=nr(p,p===mt?T:0),(T&3)===0||_t(p,T)||(h=!0,cE(p,T));p=p.next}while(h);Oh=!1}}function g5(){Zl=kh=!1;var i=0;Si!==0&&(S5()&&(i=Si),Si=0);for(var l=ze(),h=null,p=jl;p!==null;){var b=p.next,T=lE(p,l);T===0?(p.next=null,h===null?jl=b:h.next=b,b===null&&(wu=h)):(h=p,(i!==0||(T&3)!==0)&&(Zl=!0)),p=b}Yo(i)}function lE(i,l){for(var h=i.suspendedLanes,p=i.pingedLanes,b=i.expirationTimes,T=i.pendingLanes&-62914561;0"u"?null:document;function CE(i,l,h){var p=_u;if(p&&typeof l=="string"&&l){var b=Zr(l);b='link[rel="'+i+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),TE.has(b)||(TE.add(b),i={rel:i,crossOrigin:h,href:l},p.querySelector(b)===null&&(l=p.createElement("link"),vr(l,"link",i),It(l),p.head.appendChild(l)))}}function O5(i){sa.D(i),CE("dns-prefetch",i,null)}function q5(i,l){sa.C(i,l),CE("preconnect",i,l)}function B5(i,l,h){sa.L(i,l,h);var p=_u;if(p&&i&&l){var b='link[rel="preload"][as="'+Zr(l)+'"]';l==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+Zr(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+Zr(h.imageSizes)+'"]')):b+='[href="'+Zr(i)+'"]';var T=b;switch(l){case"style":T=Eu(i);break;case"script":T=Su(i)}on.has(T)||(i=L({rel:"preload",href:l==="image"&&h&&h.imageSrcSet?void 0:i,as:l},h),on.set(T,i),p.querySelector(b)!==null||l==="style"&&p.querySelector(Xo(T))||l==="script"&&p.querySelector(jo(T))||(l=p.createElement("link"),vr(l,"link",i),It(l),p.head.appendChild(l)))}}function L5(i,l){sa.m(i,l);var h=_u;if(h&&i){var p=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+Zr(p)+'"][href="'+Zr(i)+'"]',T=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=Su(i)}if(!on.has(T)&&(i=L({rel:"modulepreload",href:i},l),on.set(T,i),h.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(jo(T)))return}p=h.createElement("link"),vr(p,"link",i),It(p),h.head.appendChild(p)}}}function N5(i,l,h){sa.S(i,l,h);var p=_u;if(p&&i){var b=vn(p).hoistableStyles,T=Eu(i);l=l||"default";var P=b.get(T);if(!P){var F={loading:0,preload:null};if(P=p.querySelector(Xo(T)))F.loading=5;else{i=L({rel:"stylesheet",href:i,"data-precedence":l},h),(h=on.get(T))&&$h(i,h);var Z=P=p.createElement("link");It(Z),vr(Z,"link",i),Z._p=new Promise(function(ae,me){Z.onload=ae,Z.onerror=me}),Z.addEventListener("load",function(){F.loading|=1}),Z.addEventListener("error",function(){F.loading|=2}),F.loading|=4,rf(P,l,p)}P={type:"stylesheet",instance:P,count:1,state:F},b.set(T,P)}}}function z5(i,l){sa.X(i,l);var h=_u;if(h&&i){var p=vn(h).hoistableScripts,b=Su(i),T=p.get(b);T||(T=h.querySelector(jo(b)),T||(i=L({src:i,async:!0},l),(l=on.get(b))&&Kh(i,l),T=h.createElement("script"),It(T),vr(T,"link",i),h.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},p.set(b,T))}}function P5(i,l){sa.M(i,l);var h=_u;if(h&&i){var p=vn(h).hoistableScripts,b=Su(i),T=p.get(b);T||(T=h.querySelector(jo(b)),T||(i=L({src:i,async:!0,type:"module"},l),(l=on.get(b))&&Kh(i,l),T=h.createElement("script"),It(T),vr(T,"link",i),h.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},p.set(b,T))}}function AE(i,l,h,p){var b=(b=he.current)?tf(b):null;if(!b)throw Error(n(446));switch(i){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(l=Eu(h.href),h=vn(b).hoistableStyles,p=h.get(l),p||(p={type:"style",instance:null,count:0,state:null},h.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){i=Eu(h.href);var T=vn(b).hoistableStyles,P=T.get(i);if(P||(b=b.ownerDocument||b,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(i,P),(T=b.querySelector(Xo(i)))&&!T._p&&(P.instance=T,P.state.loading=5),on.has(i)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},on.set(i,h),T||I5(b,i,h,P.state))),l&&p===null)throw Error(n(528,""));return P}if(l&&p!==null)throw Error(n(529,""));return null;case"script":return l=h.async,h=h.src,typeof h=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Su(h),h=vn(b).hoistableScripts,p=h.get(l),p||(p={type:"script",instance:null,count:0,state:null},h.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,i))}}function Eu(i){return'href="'+Zr(i)+'"'}function Xo(i){return'link[rel="stylesheet"]['+i+"]"}function RE(i){return L({},i,{"data-precedence":i.precedence,precedence:null})}function I5(i,l,h,p){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=i.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),vr(l,"link",h),It(l),i.head.appendChild(l))}function Su(i){return'[src="'+Zr(i)+'"]'}function jo(i){return"script[async]"+i}function DE(i,l,h){if(l.count++,l.instance===null)switch(l.type){case"style":var p=i.querySelector('style[data-href~="'+Zr(h.href)+'"]');if(p)return l.instance=p,It(p),p;var b=L({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),It(p),vr(p,"style",b),rf(p,h.precedence,i),l.instance=p;case"stylesheet":b=Eu(h.href);var T=i.querySelector(Xo(b));if(T)return l.state.loading|=4,l.instance=T,It(T),T;p=RE(h),(b=on.get(b))&&$h(p,b),T=(i.ownerDocument||i).createElement("link"),It(T);var P=T;return P._p=new Promise(function(F,Z){P.onload=F,P.onerror=Z}),vr(T,"link",p),l.state.loading|=4,rf(T,h.precedence,i),l.instance=T;case"script":return T=Su(h.src),(b=i.querySelector(jo(T)))?(l.instance=b,It(b),b):(p=h,(b=on.get(T))&&(p=L({},h),Kh(p,b)),i=i.ownerDocument||i,b=i.createElement("script"),It(b),vr(b,"link",p),i.head.appendChild(b),l.instance=b);case"void":return null;default:throw Error(n(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,rf(p,h.precedence,i));return l.instance}function rf(i,l,h){for(var p=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,T=b,P=0;P title"):null)}function U5(i,l,h){if(h===1||l.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return i=l.disabled,typeof l.precedence=="string"&&i==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function OE(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Zo=null;function G5(){}function V5(i,l,h){if(Zo===null)throw Error(n(475));var p=Zo;if(l.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var b=Eu(h.href),T=i.querySelector(Xo(b));if(T){i=T._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(p.count++,p=af.bind(p),i.then(p,p)),l.state.loading|=4,l.instance=T,It(T);return}T=i.ownerDocument||i,h=RE(h),(b=on.get(b))&&$h(h,b),T=T.createElement("link"),It(T);var P=T;P._p=new Promise(function(F,Z){P.onload=F,P.onerror=Z}),vr(T,"link",h),l.instance=T}p.stylesheets===null&&(p.stylesheets=new Map),p.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(p.count++,l=af.bind(p),i.addEventListener("load",l),i.addEventListener("error",l))}}function H5(){if(Zo===null)throw Error(n(475));var i=Zo;return i.stylesheets&&i.count===0&&Xh(i,i.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),nv.exports=uN(),nv.exports}var sN=oN();const lN=JSON.parse('[{"data":{"id":"models/microsoft/deberta-v3-large","type":"model","likes":204,"downloads":511878,"downloads_all_time":27553871,"trending_score":2,"used_storage":8074445747,"library_name":"transformers","pipeline_tag":"fill-mask"},"group":"nodes"},{"data":{"id":"models/brianronan/test-xet-enable","type":"model","likes":0,"downloads":0,"downloads_all_time":0,"trending_score":0,"used_storage":133610664,"library_name":"NULL","pipeline_tag":"NULL"},"group":"nodes"},{"data":{"id":"models/stabilityai/stable-diffusion-2-1-base","type":"model","likes":654,"downloads":1137932,"downloads_all_time":18624276,"trending_score":2,"used_storage":50410059287,"library_name":"diffusers","pipeline_tag":"text-to-image"},"group":"nodes"},{"data":{"id":"models/julien-c/xet-feb14","type":"model","likes":0,"downloads":0,"downloads_all_time":0,"trending_score":0,"used_storage":5234139343,"library_name":"NULL","pipeline_tag":"NULL"},"group":"nodes"},{"data":{"id":"models/yikuan8/Clinical-Longformer","type":"model","likes":59,"downloads":1234935,"downloads_all_time":13542999,"trending_score":0,"used_storage":1189900247,"library_name":"transformers","pipeline_tag":"fill-mask"},"group":"nodes"},{"data":{"id":"models/google/flan-t5-xxl","type":"model","likes":1234,"downloads":231899,"downloads_all_time":11590705,"trending_score":3,"used_storage":179295887866,"library_name":"transformers","pipeline_tag":"text2text-generation"},"group":"nodes"},{"data":{"id":"models/theainerd/Wav2Vec2-large-xlsr-hindi","type":"model","likes":5,"downloads":1128456,"downloads_all_time":13384283,"trending_score":0,"used_storage":2524266079,"library_name":"transformers","pipeline_tag":"automatic-speech-recognition"},"group":"nodes"},{"data":{"id":"models/CompVis/stable-diffusion-v1-4","type":"model","likes":6715,"downloads":1088888,"downloads_all_time":38298263,"trending_score":14,"used_storage":59631537390,"library_name":"diffusers","pipeline_tag":"text-to-image"},"group":"nodes"},{"data":{"id":"models/brianronan/test-xet-upload","type":"model","likes":0,"downloads":0,"downloads_all_time":0,"trending_score":0,"used_storage":393684173,"library_name":"NULL","pipeline_tag":"NULL"},"group":"nodes"},{"data":{"id":"models/google/flan-t5-base","type":"model","likes":838,"downloads":1110832,"downloads_all_time":36324897,"trending_score":1,"used_storage":7894822589,"library_name":"transformers","pipeline_tag":"text2text-generation"},"group":"nodes"},{"data":{"id":"models/Helsinki-NLP/opus-mt-fr-en","type":"model","likes":39,"downloads":2276155,"downloads_all_time":29219292,"trending_score":0,"used_storage":2350704530,"library_name":"transformers","pipeline_tag":"translation"},"group":"nodes"},{"data":{"id":"models/celinah/dummy-xet-testing","type":"model","likes":0,"downloads":0,"downloads_all_time":0,"trending_score":0,"used_storage":143400465,"library_name":"transformers","pipeline_tag":"NULL"},"group":"nodes"},{"data":{"id":"models/diffusers/stable-diffusion-xl-1.0-inpainting-0.1","type":"model","likes":323,"downloads":721337,"downloads_all_time":6557776,"trending_score":1,"used_storage":20815472866,"library_name":"diffusers","pipeline_tag":"text-to-image"},"group":"nodes"},{"data":{"id":"models/Systran/faster-whisper-large-v3","type":"model","likes":351,"downloads":798952,"downloads_all_time":7401515,"trending_score":3,"used_storage":3102942254,"library_name":"ctranslate2","pipeline_tag":"automatic-speech-recognition"},"group":"nodes"},{"data":{"id":"models/allenai/longformer-base-4096","type":"model","likes":188,"downloads":6224811,"downloads_all_time":104451323,"trending_score":1,"used_storage":2710777429,"library_name":"transformers","pipeline_tag":"NULL"},"group":"nodes"},{"data":{"id":"models/google/t5-v1_1-xxl","type":"model","likes":103,"downloads":644094,"downloads_all_time":8492507,"trending_score":1,"used_storage":178693324045,"library_name":"transformers","pipeline_tag":"text2text-generation"},"group":"nodes"},{"data":{"id":"models/stabilityai/stable-diffusion-xl-refiner-1.0","type":"model","likes":1840,"downloads":1613325,"downloads_all_time":40129637,"trending_score":13,"used_storage":31115495204,"library_name":"diffusers","pipeline_tag":"image-to-image"},"group":"nodes"},{"data":{"id":"models/celinah/xet-experiments","type":"model","likes":0,"downloads":0,"downloads_all_time":0,"trending_score":0,"used_storage":6967180696,"library_name":"NULL","pipeline_tag":"NULL"},"group":"nodes"},{"data":{"id":"models/google/flan-t5-small","type":"model","likes":322,"downloads":581330,"downloads_all_time":7638317,"trending_score":4,"used_storage":2378897868,"library_name":"transformers","pipeline_tag":"text2text-generation"},"group":"nodes"},{"data":{"id":"models/microsoft/table-transformer-detection","type":"model","likes":343,"downloads":4243608,"downloads_all_time":32021411,"trending_score":2,"used_storage":461429446,"library_name":"transformers","pipeline_tag":"object-detection"},"group":"nodes"},{"data":{"id":"models/brianronan/test-scanner","type":"model","likes":0,"downloads":0,"downloads_all_time":0,"trending_score":0,"used_storage":260073338,"library_name":"NULL","pipeline_tag":"NULL"},"group":"nodes"},{"data":{"id":"models/kingabzpro/wav2vec2-large-xls-r-300m-Urdu","type":"model","likes":14,"downloads":220903,"downloads_all_time":4602856,"trending_score":1,"used_storage":54169970269,"library_name":"transformers","pipeline_tag":"automatic-speech-recognition"},"group":"nodes"},{"data":{"id":"models/papluca/xlm-roberta-base-language-detection","type":"model","likes":318,"downloads":5043005,"downloads_all_time":47874518,"trending_score":2,"used_storage":5567282236,"library_name":"transformers","pipeline_tag":"text-classification"},"group":"nodes"},{"data":{"id":"models/lucadiliello/BLEURT-20-D12","type":"model","likes":0,"downloads":742345,"downloads_all_time":4260341,"trending_score":0,"used_storage":1344920403,"library_name":"transformers","pipeline_tag":"text-classification"},"group":"nodes"},{"data":{"id":"models/kresnik/wav2vec2-large-xlsr-korean","type":"model","likes":40,"downloads":2045676,"downloads_all_time":18557960,"trending_score":1,"used_storage":8800393692,"library_name":"transformers","pipeline_tag":"automatic-speech-recognition"},"group":"nodes"},{"data":{"id":"models/facebook/m2m100_1.2B","type":"model","likes":163,"downloads":895564,"downloads_all_time":5018946,"trending_score":1,"used_storage":49510473447,"library_name":"transformers","pipeline_tag":"text2text-generation"},"group":"nodes"},{"data":{"id":"models/facebook/musicgen-medium","type":"model","likes":112,"downloads":1426559,"downloads_all_time":3840384,"trending_score":1,"used_storage":36073996801,"library_name":"transformers","pipeline_tag":"text-to-audio"},"group":"nodes"},{"data":{"id":"models/Helsinki-NLP/opus-mt-de-en","type":"model","likes":44,"downloads":3034754,"downloads_all_time":26620985,"trending_score":0,"used_storage":2637770406,"library_name":"transformers","pipeline_tag":"translation"},"group":"nodes"},{"data":{"id":"models/Helsinki-NLP/opus-mt-es-en","type":"model","likes":69,"downloads":1055466,"downloads_all_time":19441079,"trending_score":0,"used_storage":1252015522,"library_name":"transformers","pipeline_tag":"translation"},"group":"nodes"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","type":"model","likes":206,"downloads":1454368,"downloads_all_time":29486731,"trending_score":4,"used_storage":4456588160,"library_name":"transformers","pipeline_tag":"text-classification"},"group":"nodes"},{"data":{"id":"models/celinah/xet-experiments_bis","type":"model","likes":0,"downloads":0,"downloads_all_time":0,"trending_score":0,"used_storage":0,"library_name":"NULL","pipeline_tag":"NULL"},"group":"nodes"},{"data":{"id":"models/google/flan-t5-large","type":"model","likes":705,"downloads":1655084,"downloads_all_time":30520075,"trending_score":6,"used_storage":15929620947,"library_name":"transformers","pipeline_tag":"text2text-generation"},"group":"nodes"},{"data":{"id":"models/microsoft/table-transformer-structure-recognition","type":"model","likes":183,"downloads":1449023,"downloads_all_time":14150864,"trending_score":1,"used_storage":461896422,"library_name":"transformers","pipeline_tag":"object-detection"},"group":"nodes"},{"data":{"id":"models/Systran/faster-whisper-large-v2","type":"model","likes":32,"downloads":489911,"downloads_all_time":5280258,"trending_score":1,"used_storage":3086912962,"library_name":"ctranslate2","pipeline_tag":"automatic-speech-recognition"},"group":"nodes"},{"data":{"id":"models/stabilityai/stable-diffusion-xl-base-1.0","type":"model","likes":6388,"downloads":4103552,"downloads_all_time":81083135,"trending_score":24,"used_storage":77373571593,"library_name":"diffusers","pipeline_tag":"text-to-image"},"group":"nodes"},{"data":{"id":"models/microsoft/mdeberta-v3-base","type":"model","likes":174,"downloads":1273735,"downloads_all_time":15509921,"trending_score":1,"used_storage":5852650649,"library_name":"transformers","pipeline_tag":"fill-mask"},"group":"nodes"},{"data":{"id":"models/hf-internal-testing/tiny-random-AlbertModel","type":"model","likes":0,"downloads":749925,"downloads_all_time":11451673,"trending_score":0,"used_storage":98580129,"library_name":"transformers","pipeline_tag":"feature-extraction"},"group":"nodes"},{"data":{"id":"models/stabilityai/stable-diffusion-2-1","type":"model","likes":3949,"downloads":960039,"downloads_all_time":44056385,"trending_score":4,"used_storage":57147037677,"library_name":"diffusers","pipeline_tag":"text-to-image"},"group":"nodes"},{"data":{"id":"datasets/OwlMaster/gg2","type":"dataset","likes":1,"downloads":21651,"downloads_all_time":139732,"trending_score":0,"used_storage":37010441673,"library_name":"NULL","pipeline_tag":"NULL"},"group":"nodes"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50","type":"model","likes":43,"downloads":74640,"downloads_all_time":22110394,"trending_score":1,"used_storage":45102350610,"library_name":"transformers","pipeline_tag":"text2text-generation"},"group":"nodes"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/papluca/xlm-roberta-base-language-detection","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/papluca/xlm-roberta-base-language-detection","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/microsoft/deberta-v3-large","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/microsoft/mdeberta-v3-base","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/microsoft/mdeberta-v3-base","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/facebook/m2m100_1.2B","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/facebook/m2m100_1.2B","weight":2},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/cardiffnlp/twitter-xlm-roberta-base-sentiment","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/google/flan-t5-xxl","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/google/flan-t5-xxl","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/google/flan-t5-large","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/google/flan-t5-large","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/google/flan-t5-small","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/google/flan-t5-small","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/google/flan-t5-base","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/google/flan-t5-base","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/hf-internal-testing/tiny-random-AlbertModel","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/hf-internal-testing/tiny-random-AlbertModel","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/lucadiliello/BLEURT-20-D12","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/lucadiliello/BLEURT-20-D12","weight":1},"group":"edges"},{"data":{"id":"models/Rostlab/prot_t5_xl_uniref50_models/facebook/musicgen-medium","source":"models/Rostlab/prot_t5_xl_uniref50","target":"models/facebook/musicgen-medium","weight":1},"group":"edges"},{"data":{"id":"models/Helsinki-NLP/opus-mt-es-en_models/Helsinki-NLP/opus-mt-fr-en","source":"models/Helsinki-NLP/opus-mt-es-en","target":"models/Helsinki-NLP/opus-mt-fr-en","weight":224},"group":"edges"},{"data":{"id":"models/Helsinki-NLP/opus-mt-de-en_models/Helsinki-NLP/opus-mt-fr-en","source":"models/Helsinki-NLP/opus-mt-de-en","target":"models/Helsinki-NLP/opus-mt-fr-en","weight":336},"group":"edges"},{"data":{"id":"models/Helsinki-NLP/opus-mt-de-en_models/Helsinki-NLP/opus-mt-es-en","source":"models/Helsinki-NLP/opus-mt-de-en","target":"models/Helsinki-NLP/opus-mt-es-en","weight":336},"group":"edges"},{"data":{"id":"models/microsoft/deberta-v3-large_models/papluca/xlm-roberta-base-language-detection","source":"models/microsoft/deberta-v3-large","target":"models/papluca/xlm-roberta-base-language-detection","weight":1},"group":"edges"},{"data":{"id":"models/microsoft/deberta-v3-large_models/microsoft/mdeberta-v3-base","source":"models/microsoft/deberta-v3-large","target":"models/microsoft/mdeberta-v3-base","weight":4},"group":"edges"},{"data":{"id":"models/microsoft/mdeberta-v3-base_models/papluca/xlm-roberta-base-language-detection","source":"models/microsoft/mdeberta-v3-base","target":"models/papluca/xlm-roberta-base-language-detection","weight":2},"group":"edges"},{"data":{"id":"models/kresnik/wav2vec2-large-xlsr-korean_models/theainerd/Wav2Vec2-large-xlsr-hindi","source":"models/kresnik/wav2vec2-large-xlsr-korean","target":"models/theainerd/Wav2Vec2-large-xlsr-hindi","weight":1067},"group":"edges"},{"data":{"id":"models/kingabzpro/wav2vec2-large-xls-r-300m-Urdu_models/kresnik/wav2vec2-large-xlsr-korean","source":"models/kingabzpro/wav2vec2-large-xls-r-300m-Urdu","target":"models/kresnik/wav2vec2-large-xlsr-korean","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/papluca/xlm-roberta-base-language-detection","source":"models/facebook/m2m100_1.2B","target":"models/papluca/xlm-roberta-base-language-detection","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/microsoft/deberta-v3-large","source":"models/facebook/m2m100_1.2B","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/microsoft/mdeberta-v3-base","source":"models/facebook/m2m100_1.2B","target":"models/microsoft/mdeberta-v3-base","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/google/flan-t5-xxl","source":"models/facebook/m2m100_1.2B","target":"models/google/flan-t5-xxl","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/google/flan-t5-large","source":"models/facebook/m2m100_1.2B","target":"models/google/flan-t5-large","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/google/flan-t5-small","source":"models/facebook/m2m100_1.2B","target":"models/google/flan-t5-small","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/google/flan-t5-base","source":"models/facebook/m2m100_1.2B","target":"models/google/flan-t5-base","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/hf-internal-testing/tiny-random-AlbertModel","source":"models/facebook/m2m100_1.2B","target":"models/hf-internal-testing/tiny-random-AlbertModel","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/lucadiliello/BLEURT-20-D12","source":"models/facebook/m2m100_1.2B","target":"models/lucadiliello/BLEURT-20-D12","weight":1},"group":"edges"},{"data":{"id":"models/facebook/m2m100_1.2B_models/facebook/musicgen-medium","source":"models/facebook/m2m100_1.2B","target":"models/facebook/musicgen-medium","weight":1},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/papluca/xlm-roberta-base-language-detection","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/papluca/xlm-roberta-base-language-detection","weight":191},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/microsoft/deberta-v3-large","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/microsoft/mdeberta-v3-base","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/microsoft/mdeberta-v3-base","weight":2},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/facebook/m2m100_1.2B","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/facebook/m2m100_1.2B","weight":1},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/google/flan-t5-xxl","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/google/flan-t5-xxl","weight":2},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/google/flan-t5-large","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/google/flan-t5-large","weight":2},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/google/flan-t5-small","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/google/flan-t5-small","weight":2},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/google/flan-t5-base","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/google/flan-t5-base","weight":2},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/hf-internal-testing/tiny-random-AlbertModel","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/hf-internal-testing/tiny-random-AlbertModel","weight":2},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/lucadiliello/BLEURT-20-D12","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/lucadiliello/BLEURT-20-D12","weight":1},"group":"edges"},{"data":{"id":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment_models/facebook/musicgen-medium","source":"models/cardiffnlp/twitter-xlm-roberta-base-sentiment","target":"models/facebook/musicgen-medium","weight":2},"group":"edges"},{"data":{"id":"models/allenai/longformer-base-4096_models/yikuan8/Clinical-Longformer","source":"models/allenai/longformer-base-4096","target":"models/yikuan8/Clinical-Longformer","weight":5128},"group":"edges"},{"data":{"id":"models/CompVis/stable-diffusion-v1-4_models/stabilityai/stable-diffusion-xl-base-1.0","source":"models/CompVis/stable-diffusion-v1-4","target":"models/stabilityai/stable-diffusion-xl-base-1.0","weight":34917},"group":"edges"},{"data":{"id":"models/CompVis/stable-diffusion-v1-4_models/diffusers/stable-diffusion-xl-1.0-inpainting-0.1","source":"models/CompVis/stable-diffusion-v1-4","target":"models/diffusers/stable-diffusion-xl-1.0-inpainting-0.1","weight":18948},"group":"edges"},{"data":{"id":"models/CompVis/stable-diffusion-v1-4_models/stabilityai/stable-diffusion-2-1-base","source":"models/CompVis/stable-diffusion-v1-4","target":"models/stabilityai/stable-diffusion-2-1-base","weight":30955},"group":"edges"},{"data":{"id":"models/CompVis/stable-diffusion-v1-4_models/stabilityai/stable-diffusion-2-1","source":"models/CompVis/stable-diffusion-v1-4","target":"models/stabilityai/stable-diffusion-2-1","weight":30920},"group":"edges"},{"data":{"id":"models/microsoft/table-transformer-detection_models/microsoft/table-transformer-structure-recognition","source":"models/microsoft/table-transformer-detection","target":"models/microsoft/table-transformer-structure-recognition","weight":24},"group":"edges"},{"data":{"id":"models/google/flan-t5-xxl_models/google/t5-v1_1-xxl","source":"models/google/flan-t5-xxl","target":"models/google/t5-v1_1-xxl","weight":338},"group":"edges"},{"data":{"id":"models/google/flan-t5-xxl_models/papluca/xlm-roberta-base-language-detection","source":"models/google/flan-t5-xxl","target":"models/papluca/xlm-roberta-base-language-detection","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-xxl_models/microsoft/deberta-v3-large","source":"models/google/flan-t5-xxl","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/google/flan-t5-xxl_models/microsoft/mdeberta-v3-base","source":"models/google/flan-t5-xxl","target":"models/microsoft/mdeberta-v3-base","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-xxl_models/hf-internal-testing/tiny-random-AlbertModel","source":"models/google/flan-t5-xxl","target":"models/hf-internal-testing/tiny-random-AlbertModel","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-xxl_models/lucadiliello/BLEURT-20-D12","source":"models/google/flan-t5-xxl","target":"models/lucadiliello/BLEURT-20-D12","weight":1},"group":"edges"},{"data":{"id":"models/google/flan-t5-large_models/google/flan-t5-xxl","source":"models/google/flan-t5-large","target":"models/google/flan-t5-xxl","weight":14},"group":"edges"},{"data":{"id":"models/google/flan-t5-large_models/google/flan-t5-small","source":"models/google/flan-t5-large","target":"models/google/flan-t5-small","weight":14},"group":"edges"},{"data":{"id":"models/google/flan-t5-large_models/papluca/xlm-roberta-base-language-detection","source":"models/google/flan-t5-large","target":"models/papluca/xlm-roberta-base-language-detection","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-large_models/microsoft/deberta-v3-large","source":"models/google/flan-t5-large","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/google/flan-t5-large_models/microsoft/mdeberta-v3-base","source":"models/google/flan-t5-large","target":"models/microsoft/mdeberta-v3-base","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-large_models/hf-internal-testing/tiny-random-AlbertModel","source":"models/google/flan-t5-large","target":"models/hf-internal-testing/tiny-random-AlbertModel","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-large_models/lucadiliello/BLEURT-20-D12","source":"models/google/flan-t5-large","target":"models/lucadiliello/BLEURT-20-D12","weight":1},"group":"edges"},{"data":{"id":"models/google/flan-t5-small_models/google/flan-t5-xxl","source":"models/google/flan-t5-small","target":"models/google/flan-t5-xxl","weight":14},"group":"edges"},{"data":{"id":"models/google/flan-t5-small_models/papluca/xlm-roberta-base-language-detection","source":"models/google/flan-t5-small","target":"models/papluca/xlm-roberta-base-language-detection","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-small_models/microsoft/deberta-v3-large","source":"models/google/flan-t5-small","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/google/flan-t5-small_models/microsoft/mdeberta-v3-base","source":"models/google/flan-t5-small","target":"models/microsoft/mdeberta-v3-base","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-small_models/hf-internal-testing/tiny-random-AlbertModel","source":"models/google/flan-t5-small","target":"models/hf-internal-testing/tiny-random-AlbertModel","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-small_models/lucadiliello/BLEURT-20-D12","source":"models/google/flan-t5-small","target":"models/lucadiliello/BLEURT-20-D12","weight":1},"group":"edges"},{"data":{"id":"models/google/flan-t5-base_models/google/flan-t5-xxl","source":"models/google/flan-t5-base","target":"models/google/flan-t5-xxl","weight":14},"group":"edges"},{"data":{"id":"models/google/flan-t5-base_models/google/flan-t5-large","source":"models/google/flan-t5-base","target":"models/google/flan-t5-large","weight":14},"group":"edges"},{"data":{"id":"models/google/flan-t5-base_models/google/flan-t5-small","source":"models/google/flan-t5-base","target":"models/google/flan-t5-small","weight":14},"group":"edges"},{"data":{"id":"models/google/flan-t5-base_models/papluca/xlm-roberta-base-language-detection","source":"models/google/flan-t5-base","target":"models/papluca/xlm-roberta-base-language-detection","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-base_models/microsoft/deberta-v3-large","source":"models/google/flan-t5-base","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/google/flan-t5-base_models/microsoft/mdeberta-v3-base","source":"models/google/flan-t5-base","target":"models/microsoft/mdeberta-v3-base","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-base_models/hf-internal-testing/tiny-random-AlbertModel","source":"models/google/flan-t5-base","target":"models/hf-internal-testing/tiny-random-AlbertModel","weight":2},"group":"edges"},{"data":{"id":"models/google/flan-t5-base_models/lucadiliello/BLEURT-20-D12","source":"models/google/flan-t5-base","target":"models/lucadiliello/BLEURT-20-D12","weight":1},"group":"edges"},{"data":{"id":"models/hf-internal-testing/tiny-random-AlbertModel_models/papluca/xlm-roberta-base-language-detection","source":"models/hf-internal-testing/tiny-random-AlbertModel","target":"models/papluca/xlm-roberta-base-language-detection","weight":2},"group":"edges"},{"data":{"id":"models/hf-internal-testing/tiny-random-AlbertModel_models/microsoft/deberta-v3-large","source":"models/hf-internal-testing/tiny-random-AlbertModel","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/hf-internal-testing/tiny-random-AlbertModel_models/microsoft/mdeberta-v3-base","source":"models/hf-internal-testing/tiny-random-AlbertModel","target":"models/microsoft/mdeberta-v3-base","weight":2},"group":"edges"},{"data":{"id":"models/hf-internal-testing/tiny-random-AlbertModel_models/lucadiliello/BLEURT-20-D12","source":"models/hf-internal-testing/tiny-random-AlbertModel","target":"models/lucadiliello/BLEURT-20-D12","weight":1},"group":"edges"},{"data":{"id":"models/stabilityai/stable-diffusion-2-1_models/stabilityai/stable-diffusion-2-1-base","source":"models/stabilityai/stable-diffusion-2-1","target":"models/stabilityai/stable-diffusion-2-1-base","weight":1062769},"group":"edges"},{"data":{"id":"models/lucadiliello/BLEURT-20-D12_models/papluca/xlm-roberta-base-language-detection","source":"models/lucadiliello/BLEURT-20-D12","target":"models/papluca/xlm-roberta-base-language-detection","weight":1},"group":"edges"},{"data":{"id":"models/lucadiliello/BLEURT-20-D12_models/microsoft/deberta-v3-large","source":"models/lucadiliello/BLEURT-20-D12","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/lucadiliello/BLEURT-20-D12_models/microsoft/mdeberta-v3-base","source":"models/lucadiliello/BLEURT-20-D12","target":"models/microsoft/mdeberta-v3-base","weight":1},"group":"edges"},{"data":{"id":"models/facebook/musicgen-medium_models/google/flan-t5-xxl","source":"models/facebook/musicgen-medium","target":"models/google/flan-t5-xxl","weight":14},"group":"edges"},{"data":{"id":"models/facebook/musicgen-medium_models/google/flan-t5-large","source":"models/facebook/musicgen-medium","target":"models/google/flan-t5-large","weight":14},"group":"edges"},{"data":{"id":"models/facebook/musicgen-medium_models/google/flan-t5-small","source":"models/facebook/musicgen-medium","target":"models/google/flan-t5-small","weight":14},"group":"edges"},{"data":{"id":"models/facebook/musicgen-medium_models/google/flan-t5-base","source":"models/facebook/musicgen-medium","target":"models/google/flan-t5-base","weight":14},"group":"edges"},{"data":{"id":"models/facebook/musicgen-medium_models/papluca/xlm-roberta-base-language-detection","source":"models/facebook/musicgen-medium","target":"models/papluca/xlm-roberta-base-language-detection","weight":2},"group":"edges"},{"data":{"id":"models/facebook/musicgen-medium_models/microsoft/deberta-v3-large","source":"models/facebook/musicgen-medium","target":"models/microsoft/deberta-v3-large","weight":1},"group":"edges"},{"data":{"id":"models/facebook/musicgen-medium_models/microsoft/mdeberta-v3-base","source":"models/facebook/musicgen-medium","target":"models/microsoft/mdeberta-v3-base","weight":2},"group":"edges"},{"data":{"id":"models/facebook/musicgen-medium_models/hf-internal-testing/tiny-random-AlbertModel","source":"models/facebook/musicgen-medium","target":"models/hf-internal-testing/tiny-random-AlbertModel","weight":2},"group":"edges"},{"data":{"id":"models/facebook/musicgen-medium_models/lucadiliello/BLEURT-20-D12","source":"models/facebook/musicgen-medium","target":"models/lucadiliello/BLEURT-20-D12","weight":1},"group":"edges"},{"data":{"id":"datasets/OwlMaster/gg2_models/stabilityai/stable-diffusion-xl-base-1.0","source":"datasets/OwlMaster/gg2","target":"models/stabilityai/stable-diffusion-xl-base-1.0","weight":277703},"group":"edges"},{"data":{"id":"datasets/OwlMaster/gg2_models/stabilityai/stable-diffusion-xl-refiner-1.0","source":"datasets/OwlMaster/gg2","target":"models/stabilityai/stable-diffusion-xl-refiner-1.0","weight":567531},"group":"edges"},{"data":{"id":"datasets/OwlMaster/gg2_models/diffusers/stable-diffusion-xl-1.0-inpainting-0.1","source":"datasets/OwlMaster/gg2","target":"models/diffusers/stable-diffusion-xl-1.0-inpainting-0.1","weight":136438},"group":"edges"},{"data":{"id":"datasets/OwlMaster/gg2_models/CompVis/stable-diffusion-v1-4","source":"datasets/OwlMaster/gg2","target":"models/CompVis/stable-diffusion-v1-4","weight":1},"group":"edges"},{"data":{"id":"datasets/OwlMaster/gg2_models/stabilityai/stable-diffusion-2-1","source":"datasets/OwlMaster/gg2","target":"models/stabilityai/stable-diffusion-2-1","weight":1},"group":"edges"},{"data":{"id":"datasets/OwlMaster/gg2_models/stabilityai/stable-diffusion-2-1-base","source":"datasets/OwlMaster/gg2","target":"models/stabilityai/stable-diffusion-2-1-base","weight":1},"group":"edges"},{"data":{"id":"models/stabilityai/stable-diffusion-xl-base-1.0_models/stabilityai/stable-diffusion-xl-refiner-1.0","source":"models/stabilityai/stable-diffusion-xl-base-1.0","target":"models/stabilityai/stable-diffusion-xl-refiner-1.0","weight":315054},"group":"edges"},{"data":{"id":"models/diffusers/stable-diffusion-xl-1.0-inpainting-0.1_models/stabilityai/stable-diffusion-xl-base-1.0","source":"models/diffusers/stable-diffusion-xl-1.0-inpainting-0.1","target":"models/stabilityai/stable-diffusion-xl-base-1.0","weight":153876},"group":"edges"},{"data":{"id":"models/diffusers/stable-diffusion-xl-1.0-inpainting-0.1_models/stabilityai/stable-diffusion-xl-refiner-1.0","source":"models/diffusers/stable-diffusion-xl-1.0-inpainting-0.1","target":"models/stabilityai/stable-diffusion-xl-refiner-1.0","weight":113626},"group":"edges"},{"data":{"id":"models/Systran/faster-whisper-large-v2_models/Systran/faster-whisper-large-v3","source":"models/Systran/faster-whisper-large-v2","target":"models/Systran/faster-whisper-large-v3","weight":50},"group":"edges"},{"data":{"id":"models/brianronan/test-xet-enable_models/celinah/xet-experiments","source":"models/brianronan/test-xet-enable","target":"models/celinah/xet-experiments","weight":4368},"group":"edges"},{"data":{"id":"models/brianronan/test-xet-enable_models/celinah/xet-experiments_bis","source":"models/brianronan/test-xet-enable","target":"models/celinah/xet-experiments_bis","weight":2184},"group":"edges"},{"data":{"id":"models/brianronan/test-xet-enable_models/brianronan/test-xet-upload","source":"models/brianronan/test-xet-enable","target":"models/brianronan/test-xet-upload","weight":1574},"group":"edges"},{"data":{"id":"models/brianronan/test-scanner_models/brianronan/test-xet-upload","source":"models/brianronan/test-scanner","target":"models/brianronan/test-xet-upload","weight":5916},"group":"edges"},{"data":{"id":"models/brianronan/test-scanner_models/brianronan/test-xet-enable","source":"models/brianronan/test-scanner","target":"models/brianronan/test-xet-enable","weight":1574},"group":"edges"},{"data":{"id":"models/brianronan/test-scanner_models/celinah/xet-experiments","source":"models/brianronan/test-scanner","target":"models/celinah/xet-experiments","weight":3148},"group":"edges"},{"data":{"id":"models/brianronan/test-scanner_models/celinah/xet-experiments_bis","source":"models/brianronan/test-scanner","target":"models/celinah/xet-experiments_bis","weight":1574},"group":"edges"},{"data":{"id":"models/celinah/xet-experiments_models/celinah/xet-experiments_bis","source":"models/celinah/xet-experiments","target":"models/celinah/xet-experiments_bis","weight":117484},"group":"edges"},{"data":{"id":"models/celinah/xet-experiments_models/julien-c/xet-feb14","source":"models/celinah/xet-experiments","target":"models/julien-c/xet-feb14","weight":526},"group":"edges"},{"data":{"id":"models/brianronan/test-xet-upload_models/celinah/xet-experiments","source":"models/brianronan/test-xet-upload","target":"models/celinah/xet-experiments","weight":3148},"group":"edges"},{"data":{"id":"models/brianronan/test-xet-upload_models/celinah/xet-experiments_bis","source":"models/brianronan/test-xet-upload","target":"models/celinah/xet-experiments_bis","weight":1574},"group":"edges"},{"data":{"id":"models/celinah/xet-experiments_bis_models/julien-c/xet-feb14","source":"models/celinah/xet-experiments_bis","target":"models/julien-c/xet-feb14","weight":526},"group":"edges"},{"data":{"id":"models/celinah/dummy-xet-testing_models/celinah/xet-experiments","source":"models/celinah/dummy-xet-testing","target":"models/celinah/xet-experiments","weight":25},"group":"edges"},{"data":{"id":"models/celinah/dummy-xet-testing_models/celinah/xet-experiments_bis","source":"models/celinah/dummy-xet-testing","target":"models/celinah/xet-experiments_bis","weight":25},"group":"edges"}]');function Jb(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(f){throw f},f:a}}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 u,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var f=r.next();return o=f.done,f},e:function(f){s=!0,u=f},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw u}}}}function Lk(t,e,r){return(e=zk(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hN(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function vN(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,u,o,s=[],f=!0,c=!1;try{if(u=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;f=!1}else for(;!(f=(n=u.call(r)).done)&&(s.push(n.value),s.length!==e);f=!0);}catch(d){c=!0,a=d}finally{try{if(!f&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw a}}return s}}function gN(){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 pN(){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 lr(t,e){return fN(t)||vN(t,e)||E1(t,e)||gN()}function Nk(t){return cN(t)||hN(t)||E1(t)||pN()}function mN(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function zk(t){var e=mN(t,"string");return typeof e=="symbol"?e:e+""}function er(t){"@babel/helpers - typeof";return er=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},er(t)}function E1(t,e){if(t){if(typeof t=="string")return Jb(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Jb(t,e):void 0}}var Wt=typeof window>"u"?null:window,e2=Wt?Wt.navigator:null;Wt&&Wt.document;var yN=er(""),Pk=er({}),bN=er(function(){}),wN=typeof HTMLElement>"u"?"undefined":er(HTMLElement),zs=function(e){return e&&e.instanceString&&kt(e.instanceString)?e.instanceString():null},Ie=function(e){return e!=null&&er(e)==yN},kt=function(e){return e!=null&&er(e)===bN},pt=function(e){return!Fr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},at=function(e){return e!=null&&er(e)===Pk&&!pt(e)&&e.constructor===Object},xN=function(e){return e!=null&&er(e)===Pk},Re=function(e){return e!=null&&er(e)===er(1)&&!isNaN(e)},_N=function(e){return Re(e)&&Math.floor(e)===e},Kf=function(e){if(wN!=="undefined")return e!=null&&e instanceof HTMLElement},Fr=function(e){return Ps(e)||Ik(e)},Ps=function(e){return zs(e)==="collection"&&e._private.single},Ik=function(e){return zs(e)==="collection"&&!e._private.single},S1=function(e){return zs(e)==="core"},Uk=function(e){return zs(e)==="stylesheet"},EN=function(e){return zs(e)==="event"},Ka=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},SN=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},TN=function(e){return at(e)&&Re(e.x1)&&Re(e.x2)&&Re(e.y1)&&Re(e.y2)},CN=function(e){return xN(e)&&kt(e.then)},AN=function(){return e2&&e2.userAgent.match(/msie|trident|edge/i)},Es=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var u=[],o=0;or?1:0},BN=function(e,r){return-1*Vk(e,r)},Fe=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(w-=1),w<1/6?y+(x-y)*6*w:w<1/2?x:w<2/3?y+(x-y)*(2/3-w)*6:y}var v=new RegExp("^"+MN+"$").exec(e);if(v){if(n=parseInt(v[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(v[2]),a<0||a>100||(a=a/100,u=parseFloat(v[3]),u<0||u>100)||(u=u/100,o=v[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)s=f=c=Math.round(u*255);else{var g=u<.5?u*(1+a):u+a-u*a,m=2*u-g;s=Math.round(255*d(m,g,n+1/3)),f=Math.round(255*d(m,g,n)),c=Math.round(255*d(m,g,n-1/3))}r=[s,f,c,o]}return r},zN=function(e){var r,n=new RegExp("^"+RN+"$").exec(e);if(n){r=[];for(var a=[],u=1;u<=3;u++){var o=n[u];if(o[o.length-1]==="%"&&(a[u]=!0),o=parseFloat(o),a[u]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=a[1]||a[2]||a[3],f=a[1]&&a[2]&&a[3];if(s&&!f)return;var c=n[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;r.push(c)}}return r},PN=function(e){return IN[e.toLowerCase()]},Hk=function(e){return(pt(e)?e:null)||PN(e)||LN(e)||zN(e)||NN(e)},IN={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]},Fk=function(e){for(var r=e.map,n=e.keys,a=n.length,u=0;u=f||N<0||E&&U>=g}function M(){var D=e();if(q(D))return A(D);y=setTimeout(M,O(D))}function A(D){return y=void 0,S&&d?C(D):(d=v=void 0,m)}function L(){y!==void 0&&clearTimeout(y),w=0,d=x=v=y=void 0}function R(){return y===void 0?m:A(e())}function B(){var D=e(),N=q(D);if(d=arguments,v=this,x=D,N){if(y===void 0)return k(x);if(E)return clearTimeout(y),y=setTimeout(M,f),C(x)}return y===void 0&&(y=setTimeout(M,f)),m}return B.cancel=L,B.flush=R,B}return wv=o,wv}var jN=XN(),Vs=Is(jN),xv=Wt?Wt.performance:null,Kk=xv&&xv.now?function(){return xv.now()}:function(){return Date.now()},ZN=function(){if(Wt){if(Wt.requestAnimationFrame)return function(t){Wt.requestAnimationFrame(t)};if(Wt.mozRequestAnimationFrame)return function(t){Wt.mozRequestAnimationFrame(t)};if(Wt.webkitRequestAnimationFrame)return function(t){Wt.webkitRequestAnimationFrame(t)};if(Wt.msRequestAnimationFrame)return function(t){Wt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Kk())},1e3/60)}}(),Xf=function(e){return ZN(e)},da=Kk,Nu=9261,Xk=65599,hs=5381,jk=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Nu,n=r,a;a=e.next(),!a.done;)n=n*Xk+a.value|0;return n},Ss=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Nu;return r*Xk+e|0},Ts=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hs;return(r<<5)+r+e|0},QN=function(e,r){return e*2097152+r},Ia=function(e){return e[0]*2097152+e[1]},pf=function(e,r){return[Ss(e[0],r[0]),Ts(e[1],r[1])]},WN=function(e,r){var n={value:0,done:!1},a=0,u=e.length,o={next:function(){return a=0;a--)e[a]===r&&e.splice(a,1)},D1=function(e){e.splice(0,e.length)},i3=function(e,r){for(var n=0;n"u"?"undefined":er(Set))!==o3?Set:s3,gc=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!S1(e)){Mt("An element must have a core reference and parameters set");return}var a=r.group;if(a==null&&(r.data&&r.data.source!=null&&r.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Mt("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var u=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?a==="edges":!!r.pannable,active:!1,classes:new ju,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.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(u.position.x==null&&(u.position.x=0),u.position.y==null&&(u.position.y=0),r.renderedPosition){var o=r.renderedPosition,s=e.pan(),f=e.zoom();u.position={x:(o.x-s.x)/f,y:(o.y-s.y)/f}}var c=[];pt(r.classes)?c=r.classes:Ie(r.classes)&&(c=r.classes.split(/\s+/));for(var d=0,v=c.length;dE?1:0},d=function(_,E,S,C,k){var O;if(S==null&&(S=0),k==null&&(k=n),S<0)throw new Error("lo must be non-negative");for(C==null&&(C=_.length);SL;0<=L?A++:A--)M.push(A);return M}).apply(this).reverse(),q=[],C=0,k=O.length;CR;0<=R?++M:--M)B.push(o(_,S));return B},x=function(_,E,S,C){var k,O,q;for(C==null&&(C=n),k=_[S];S>E;){if(q=S-1>>1,O=_[q],C(k,O)<0){_[S]=O,S=q;continue}break}return _[S]=k},w=function(_,E,S){var C,k,O,q,M;for(S==null&&(S=n),k=_.length,M=E,O=_[E],C=2*E+1;C0;){var O=E.pop(),q=w(O),M=O.id();if(g[M]=q,q!==1/0)for(var A=O.neighborhood().intersect(y),L=0;L0)for(V.unshift(G);v[I];){var H=v[I];V.unshift(H.edge),V.unshift(H.node),K=H.node,I=K.id()}return s.spawn(V)}}}},p3={kruskal:function(e){e=e||function(S){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,u=n.length,o=new Array(u),s=n,f=function(C){for(var k=0;k0;){if(k(),q++,C===d){for(var M=[],A=u,L=d,R=_[L];M.unshift(A),R!=null&&M.unshift(R),A=w[L],A!=null;)L=A.id(),R=_[L];return{found:!0,distance:v[C],path:this.spawn(M),steps:q}}m[C]=!0;for(var B=S._private.edges,D=0;DR&&(y[L]=R,E[L]=A,S[L]=k),!u){var B=A*d+M;!u&&y[B]>R&&(y[B]=R,E[B]=M,S[B]=k)}}}for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:o,Be=S(Se),Ue=[],Oe=Be;;){if(Oe==null)return r.spawn();var qe=E(Oe),ze=qe.edge,je=qe.pred;if(Ue.unshift(Oe[0]),Oe.same(Te)&&Ue.length>0)break;ze!=null&&Ue.unshift(ze),Oe=je}return f.spawn(Ue)},O=0;O=0;d--){var v=c[d],g=v[1],m=v[2];(r[g]===s&&r[m]===f||r[g]===f&&r[m]===s)&&c.splice(d,1)}for(var y=0;ya;){var u=Math.floor(Math.random()*r.length);r=S3(u,e,r),n--}return r},T3={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(V){return V.isLoop()});var u=n.length,o=a.length,s=Math.ceil(Math.pow(Math.log(u)/Math.LN2,2)),f=Math.floor(u/E3);if(u<2){Mt("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],d=0;d1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,u=r;u1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,u=r;u1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,u=0,o=r;o1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(r,n):(n0&&e.splice(0,r));for(var s=0,f=e.length-1;f>=0;f--){var c=e[f];o?isFinite(c)||(e[f]=-1/0,s++):e.splice(f,1)}u&&e.sort(function(g,m){return g-m});var d=e.length,v=Math.floor(d/2);return d%2!==0?e[v+1+s]:(e[v-1+s]+e[v+s])/2},k3=function(e){return Math.PI*e/180},mf=function(e,r){return Math.atan2(r,e)-Math.PI/2},M1=Math.log2||function(t){return Math.log(t)/Math.log(2)},rO=function(e){return e>0?1:e<0?-1:0},zi=function(e,r){return Math.sqrt(Mi(e,r))},Mi=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},O3=function(e){for(var r=e.length,n=0,a=0;a=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}}},B3=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},L3=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},N3=function(e,r,n){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+n,y2:e.y2+n,w:e.w,h:e.h}},nO=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},z3=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),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},Bf=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Lf=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,u,o;if(r.length===1)n=a=u=o=r[0];else if(r.length===2)n=u=r[0],o=a=r[1];else if(r.length===4){var s=lr(r,4);n=s[0],a=s[1],u=s[2],o=s[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=u,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},x2=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},k1=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},Yu=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},P3=function(e,r){return Yu(e,r.x,r.y)},aO=function(e,r){return Yu(e,r.x1,r.y1)&&Yu(e,r.x2,r.y2)},iO=function(e,r,n,a,u,o,s){var f=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=f==="auto"?Pi(u,o):f,d=u/2,v=o/2;c=Math.min(c,d,v);var g=c!==d,m=c!==v,y;if(g){var x=n-d+c-s,w=a-v-s,_=n+d-c+s,E=w;if(y=Fa(e,r,n,a,x,w,_,E,!1),y.length>0)return y}if(m){var S=n+d+s,C=a-v+c-s,k=S,O=a+v-c+s;if(y=Fa(e,r,n,a,S,C,k,O,!1),y.length>0)return y}if(g){var q=n-d+c-s,M=a+v+s,A=n+d-c+s,L=M;if(y=Fa(e,r,n,a,q,M,A,L,!1),y.length>0)return y}if(m){var R=n-d-s,B=a-v+c-s,D=R,N=a+v-c+s;if(y=Fa(e,r,n,a,R,B,D,N,!1),y.length>0)return y}var U;{var z=n-d+c,G=a-v+c;if(U=vs(e,r,n,a,z,G,c+s),U.length>0&&U[0]<=z&&U[1]<=G)return[U[0],U[1]]}{var V=n+d-c,K=a-v+c;if(U=vs(e,r,n,a,V,K,c+s),U.length>0&&U[0]>=V&&U[1]<=K)return[U[0],U[1]]}{var I=n+d-c,H=a+v-c;if(U=vs(e,r,n,a,I,H,c+s),U.length>0&&U[0]>=I&&U[1]>=H)return[U[0],U[1]]}{var Q=n-d+c,te=a+v-c;if(U=vs(e,r,n,a,Q,te,c+s),U.length>0&&U[0]<=Q&&U[1]>=te)return[U[0],U[1]]}return[]},I3=function(e,r,n,a,u,o,s){var f=s,c=Math.min(n,u),d=Math.max(n,u),v=Math.min(a,o),g=Math.max(a,o);return c-f<=e&&e<=d+f&&v-f<=r&&r<=g+f},U3=function(e,r,n,a,u,o,s,f,c){var d={x1:Math.min(n,s,u)-c,x2:Math.max(n,s,u)+c,y1:Math.min(a,f,o)-c,y2:Math.max(a,f,o)+c};return!(ed.x2||rd.y2)},G3=function(e,r,n,a){n-=a;var u=r*r-4*e*n;if(u<0)return[];var o=Math.sqrt(u),s=2*e,f=(-r+o)/s,c=(-r-o)/s;return[f,c]},V3=function(e,r,n,a,u){var o=1e-5;e===0&&(e=o),r/=e,n/=e,a/=e;var s,f,c,d,v,g,m,y;if(f=(3*n-r*r)/9,c=-(27*a)+r*(9*n-2*(r*r)),c/=54,s=f*f*f+c*c,u[1]=0,m=r/3,s>0){v=c+Math.sqrt(s),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),g=c-Math.sqrt(s),g=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),u[0]=-m+v+g,m+=(v+g)/2,u[4]=u[2]=-m,m=Math.sqrt(3)*(-g+v)/2,u[3]=m,u[5]=-m;return}if(u[5]=u[3]=0,s===0){y=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),u[0]=-m+2*y,u[4]=u[2]=-(y+m);return}f=-f,d=f*f*f,d=Math.acos(c/Math.sqrt(d)),y=2*Math.sqrt(f),u[0]=-m+y*Math.cos(d/3),u[2]=-m+y*Math.cos((d+2*Math.PI)/3),u[4]=-m+y*Math.cos((d+4*Math.PI)/3)},H3=function(e,r,n,a,u,o,s,f){var c=1*n*n-4*n*u+2*n*s+4*u*u-4*u*s+s*s+a*a-4*a*o+2*a*f+4*o*o-4*o*f+f*f,d=1*9*n*u-3*n*n-3*n*s-6*u*u+3*u*s+9*a*o-3*a*a-3*a*f-6*o*o+3*o*f,v=1*3*n*n-6*n*u+n*s-n*e+2*u*u+2*u*e-s*e+3*a*a-6*a*o+a*f-a*r+2*o*o+2*o*r-f*r,g=1*n*u-n*n+n*e-u*e+a*o-a*a+a*r-o*r,m=[];V3(c,d,v,g,m);for(var y=1e-7,x=[],w=0;w<6;w+=2)Math.abs(m[w+1])=0&&m[w]<=1&&x.push(m[w]);x.push(1),x.push(0);for(var _=-1,E,S,C,k=0;k=0?C<_&&(_=C):_=C;return _},F3=function(e,r,n,a,u,o){var s=[e-n,r-a],f=[u-n,o-a],c=f[0]*f[0]+f[1]*f[1],d=s[0]*s[0]+s[1]*s[1],v=s[0]*f[0]+s[1]*f[1],g=v*v/c;return v<0?d:g>c?(e-u)*(e-u)+(r-o)*(r-o):d-g},Br=function(e,r,n){for(var a,u,o,s,f,c=0,d=0;d=e&&e>=o||a<=e&&e<=o)f=(e-a)/(o-a)*(s-u)+u,f>r&&c++;else continue;return c%2!==0},ha=function(e,r,n,a,u,o,s,f,c){var d=new Array(n.length),v;f[0]!=null?(v=Math.atan(f[1]/f[0]),f[0]<0?v=v+Math.PI/2:v=-v-Math.PI/2):v=f;for(var g=Math.cos(-v),m=Math.sin(-v),y=0;y0){var w=Qf(d,-c);x=Zf(w)}else x=d;return Br(e,r,x)},Y3=function(e,r,n,a,u,o,s,f){for(var c=new Array(n.length*2),d=0;d=0&&w<=1&&E.push(w),_>=0&&_<=1&&E.push(_),E.length===0)return[];var S=E[0]*f[0]+e,C=E[0]*f[1]+r;if(E.length>1){if(E[0]==E[1])return[S,C];var k=E[1]*f[0]+e,O=E[1]*f[1]+r;return[S,C,k,O]}else return[S,C]},Sv=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Fa=function(e,r,n,a,u,o,s,f,c){var d=e-u,v=n-e,g=s-u,m=r-o,y=a-r,x=f-o,w=g*m-x*d,_=v*m-y*d,E=x*v-g*y;if(E!==0){var S=w/E,C=_/E,k=.001,O=0-k,q=1+k;return O<=S&&S<=q&&O<=C&&C<=q?[e+S*v,r+S*y]:c?[e+S*v,r+S*y]:[]}else return w===0||_===0?Sv(e,n,s)===s?[s,f]:Sv(e,n,u)===u?[u,o]:Sv(u,s,n)===n?[n,a]:[]:[]},Rs=function(e,r,n,a,u,o,s,f){var c=[],d,v=new Array(n.length),g=!0;o==null&&(g=!1);var m;if(g){for(var y=0;y0){var x=Qf(v,-f);m=Zf(x)}else m=v}else m=n;for(var w,_,E,S,C=0;C2){for(var y=[d[0],d[1]],x=Math.pow(y[0]-e,2)+Math.pow(y[1]-r,2),w=1;wd&&(d=C)},get:function(S){return c[S]}},g=0;g0?U=N.edgesTo(D)[0]:U=D.edgesTo(N)[0];var z=a(U);D=D.id(),q[D]>q[R]+z&&(q[D]=q[R]+z,M.nodes.indexOf(D)<0?M.push(D):M.updateItem(D),O[D]=0,k[D]=[]),q[D]==q[R]+z&&(O[D]=O[D]+O[R],k[D].push(R))}else for(var G=0;G0;){for(var H=C.pop(),Q=0;Q0&&s.push(n[f]);s.length!==0&&u.push(a.collection(s))}return u},oz=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:fz,s=a,f,c,d=0;d=2?as(e,r,n,0,C2,cz):as(e,r,n,0,T2)},squaredEuclidean:function(e,r,n){return as(e,r,n,0,C2)},manhattan:function(e,r,n){return as(e,r,n,0,T2)},max:function(e,r,n){return as(e,r,n,-1/0,dz)}};$u["squared-euclidean"]=$u.squaredEuclidean;$u.squaredeuclidean=$u.squaredEuclidean;function mc(t,e,r,n,a,u){var o;return kt(t)?o=t:o=$u[t]||$u.euclidean,e===0&&kt(t)?o(a,u):o(e,r,n,a,u)}var hz=tr({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),q1=function(e){return hz(e)},Wf=function(e,r,n,a,u){var o=u!=="kMedoids",s=o?function(v){return n[v]}:function(v){return a[v](n)},f=function(g){return a[g](r)},c=n,d=r;return mc(e,a.length,s,f,c,d)},Tv=function(e,r,n){for(var a=n.length,u=new Array(a),o=new Array(a),s=new Array(r),f=null,c=0;cn)return!1}return!0},pz=function(e,r,n){for(var a=0;as&&(s=r[c][d],f=d);u[f].push(e[c])}for(var v=0;v=u.threshold||u.mode==="dendrogram"&&e.length===1)return!1;var y=r[o],x=r[a[o]],w;u.mode==="dendrogram"?w={left:y,right:x,key:y.key}:w={value:y.value.concat(x.value),key:y.key},e[y.index]=w,e.splice(x.index,1),r[y.key]=w;for(var _=0;_n[x.key][E.key]&&(f=n[x.key][E.key])):u.linkage==="max"?(f=n[y.key][E.key],n[y.key][E.key]0&&a.push(u);return a},O2=function(e,r,n){for(var a=[],u=0;us&&(o=c,s=r[u*e+c])}o>0&&a.push(o)}for(var d=0;dc&&(f=d,c=v)}n[u]=o[f]}return a=O2(e,r,n),a},q2=function(e){for(var r=this.cy(),n=this.nodes(),a=Rz(e),u={},o=0;o=R?(B=R,R=N,D=U):N>B&&(B=N);for(var z=0;z0?1:0;q[A%a.minIterations*s+Q]=te,H+=te}if(H>0&&(A>=a.minIterations-1||A==a.maxIterations-1)){for(var Y=0,X=0;X1||O>1)&&(s=!0),v[S]=[],E.outgoers().forEach(function(M){M.isEdge()&&v[S].push(M.id())})}else g[S]=[void 0,E.target().id()]}):o.forEach(function(E){var S=E.id();if(E.isNode()){var C=E.degree(!0);C%2&&(f?c?s=!0:c=S:f=S),v[S]=[],E.connectedEdges().forEach(function(k){return v[S].push(k.id())})}else g[S]=[E.source().id(),E.target().id()]});var m={found:!1,trail:void 0};if(s)return m;if(c&&f)if(u){if(d&&c!=d)return m;d=c}else{if(d&&c!=d&&f!=d)return m;d||(d=c)}else d||(d=o[0].id());var y=function(S){for(var C=S,k=[S],O,q,M;v[C].length;)O=v[C].shift(),q=g[O][0],M=g[O][1],C!=M?(v[M]=v[M].filter(function(A){return A!=O}),C=M):!u&&C!=q&&(v[q]=v[q].filter(function(A){return A!=O}),C=q),k.unshift(O),k.unshift(C);return k},x=[],w=[];for(w=y(d);w.length!=1;)v[w[0]].length==0?(x.unshift(o.getElementById(w.shift())),x.unshift(o.getElementById(w.shift()))):w=y(w.shift()).concat(w);x.unshift(o.getElementById(w.shift()));for(var _ in v)if(v[_].length)return m;return m.found=!0,m.trail=this.spawn(x,!0),m}},bf=function(){var e=this,r={},n=0,a=0,u=[],o=[],s={},f=function(g,m){for(var y=o.length-1,x=[],w=e.spawn();o[y].x!=g||o[y].y!=m;)x.push(o.pop().edge),y--;x.push(o.pop().edge),x.forEach(function(_){var E=_.connectedNodes().intersection(e);w.merge(_),E.forEach(function(S){var C=S.id(),k=S.connectedEdges().intersection(e);w.merge(S),r[C].cutVertex?w.merge(k.filter(function(O){return O.isLoop()})):w.merge(k)})}),u.push(w)},c=function(g,m,y){g===y&&(a+=1),r[m]={id:n,low:n++,cutVertex:!1};var x=e.getElementById(m).connectedEdges().intersection(e);if(x.size()===0)u.push(e.spawn(e.getElementById(m)));else{var w,_,E,S;x.forEach(function(C){w=C.source().id(),_=C.target().id(),E=w===m?_:w,E!==y&&(S=C.id(),s[S]||(s[S]=!0,o.push({x:m,y:E,edge:C})),E in r?r[m].low=Math.min(r[m].low,r[E].id):(c(g,E,m),r[m].low=Math.min(r[m].low,r[E].low),r[m].id<=r[E].low&&(r[m].cutVertex=!0,f(m,E))))})}};e.forEach(function(v){if(v.isNode()){var g=v.id();g in r||(a=0,c(g,g),r[g].cutVertex=a>1)}});var d=Object.keys(r).filter(function(v){return r[v].cutVertex}).map(function(v){return e.getElementById(v)});return{cut:e.spawn(d),components:u}},Nz={hopcroftTarjanBiconnected:bf,htbc:bf,htb:bf,hopcroftTarjanBiconnectedComponents:bf},wf=function(){var e=this,r={},n=0,a=[],u=[],o=e.spawn(e),s=function(c){u.push(c),r[c]={index:n,low:n++,explored:!1};var d=e.getElementById(c).connectedEdges().intersection(e);if(d.forEach(function(x){var w=x.target().id();w!==c&&(w in r||s(w),r[w].explored||(r[c].low=Math.min(r[c].low,r[w].low)))}),r[c].index===r[c].low){for(var v=e.spawn();;){var g=u.pop();if(v.merge(e.getElementById(g)),r[g].low=r[c].index,r[g].explored=!0,g===c)break}var m=v.edgesWith(v),y=v.merge(m);a.push(y),o=o.difference(y)}};return e.forEach(function(f){if(f.isNode()){var c=f.id();c in r||s(c)}}),{cut:o,components:a}},zz={tarjanStronglyConnected:wf,tsc:wf,tscc:wf,tarjanStronglyConnectedComponents:wf},dO={};[Cs,g3,p3,y3,w3,_3,T3,Z3,Gu,Vu,r1,lz,_z,Cz,qz,Lz,Nz,zz].forEach(function(t){Fe(dO,t)});/*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) */var hO=0,vO=1,gO=2,Tn=function(e){if(!(this instanceof Tn))return new Tn(e);this.id="Thenable/1.0.7",this.state=hO,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Tn.prototype={fulfill:function(e){return B2(this,vO,"fulfillValue",e)},reject:function(e){return B2(this,gO,"rejectReason",e)},then:function(e,r){var n=this,a=new Tn;return n.onFulfilled.push(N2(e,a,"fulfill")),n.onRejected.push(N2(r,a,"reject")),pO(n),a.proxy}};var B2=function(e,r,n,a){return e.state===hO&&(e.state=r,e[n]=a,pO(e)),e},pO=function(e){e.state===vO?L2(e,"onFulfilled",e.fulfillValue):e.state===gO&&L2(e,"onRejected",e.rejectReason)},L2=function(e,r,n){if(e[r].length!==0){var a=e[r];e[r]=[];var u=function(){for(var s=0;s0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],u=this._private.cy||this;if(!u.styleEnabled())return this;for(var o=0;o-1}return Kv=e,Kv}var Xv,iS;function r4(){if(iS)return Xv;iS=1;var t=wc();function e(r,n){var a=this.__data__,u=t(a,r);return u<0?(++this.size,a.push([r,n])):a[u][1]=n,this}return Xv=e,Xv}var jv,uS;function n4(){if(uS)return jv;uS=1;var t=Wz(),e=Jz(),r=e4(),n=t4(),a=r4();function u(o){var s=-1,f=o==null?0:o.length;for(this.clear();++s-1&&n%1==0&&n0&&this.spawn(a).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){pt(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=r===void 0,u=[],o=0,s=n.length;o0&&this.spawn(u).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};Nf.className=Nf.classNames=Nf.classes;var nt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Jt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};nt.variable="(?:[\\w-.]|(?:\\\\"+nt.metaChar+"))+";nt.className="(?:[\\w-]|(?:\\\\"+nt.metaChar+"))+";nt.value=nt.string+"|"+nt.number;nt.id=nt.variable;(function(){var t,e,r;for(t=nt.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(nt.comparatorOp+="|\\!"+e)})();var vt=function(){return{checks:[]}},Me={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},u1=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return BN(t.selector,e.selector)}),B4=function(){for(var t={},e,r=0;r0&&d.edgeCount>0)return ft("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return ft("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&ft("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},U4=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},r=function(d){return Ie(d)?'"'+d+'"':e(d)},n=function(d){return" "+d+" "},a=function(d,v){var g=d.type,m=d.value;switch(g){case Me.GROUP:{var y=e(m);return y.substring(0,y.length-1)}case Me.DATA_COMPARE:{var x=d.field,w=d.operator;return"["+x+n(e(w))+r(m)+"]"}case Me.DATA_BOOL:{var _=d.operator,E=d.field;return"["+e(_)+E+"]"}case Me.DATA_EXIST:{var S=d.field;return"["+S+"]"}case Me.META_COMPARE:{var C=d.operator,k=d.field;return"[["+k+n(e(C))+r(m)+"]]"}case Me.STATE:return m;case Me.ID:return"#"+m;case Me.CLASS:return"."+m;case Me.PARENT:case Me.CHILD:return u(d.parent,v)+n(">")+u(d.child,v);case Me.ANCESTOR:case Me.DESCENDANT:return u(d.ancestor,v)+" "+u(d.descendant,v);case Me.COMPOUND_SPLIT:{var O=u(d.left,v),q=u(d.subject,v),M=u(d.right,v);return O+(O.length>0?" ":"")+q+M}case Me.TRUE:return""}},u=function(d,v){return d.checks.reduce(function(g,m,y){return g+(v===d&&y===0?"$":"")+a(m,v)},"")},o="",s=0;s1&&s=0&&(r=r.replace("!",""),v=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),d=!0),(u||s||d)&&(f=!u&&!o?"":""+e,c=""+n),d&&(e=f=f.toLowerCase(),n=c=c.toLowerCase()),r){case"*=":a=f.indexOf(c)>=0;break;case"$=":a=f.indexOf(c,f.length-c.length)>=0;break;case"^=":a=f.indexOf(c)===0;break;case"=":a=e===n;break;case">":g=!0,a=e>n;break;case">=":g=!0,a=e>=n;break;case"<":g=!0,a=e0;){var d=a.shift();e(d),u.add(d.id()),s&&n(a,u,d)}return t}function SO(t,e,r){if(r.isParent())for(var n=r._private.children,a=0;a1&&arguments[1]!==void 0?arguments[1]:!0;return z1(this,t,e,SO)};function TO(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}Ku.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return z1(this,t,e,TO)};function X4(t,e,r){TO(t,e,r),SO(t,e,r)}Ku.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return z1(this,t,e,X4)};Ku.ancestors=Ku.parents;var Ds,CO;Ds=CO={data:lt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:lt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:lt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:lt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:lt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:lt.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Ds.attr=Ds.data;Ds.removeAttr=Ds.removeData;var j4=CO,_c={};function Eg(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,a=r[0],u=a._private.edges,o=0;oe}),minIndegree:Cu("indegree",function(t,e){return te}),minOutdegree:Cu("outdegree",function(t,e){return te})});Fe(_c,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a0,g=v;v&&(d=d[0]);var m=g?d.position():{x:0,y:0};r!==void 0?c.position(e,r+m[e]):u!==void 0&&c.position({x:u.x+m.x,y:u.y+m.y})}else{var y=n.position(),x=s?n.parent():null,w=x&&x.length>0,_=w;w&&(x=x[0]);var E=_?x.position():{x:0,y:0};return u={x:y.x-E.x,y:y.y-E.y},e===void 0?u:u[e]}else if(!o)return;return this}};Sn.modelPosition=Sn.point=Sn.position;Sn.modelPositions=Sn.points=Sn.positions;Sn.renderedPoint=Sn.renderedPosition;Sn.relativePoint=Sn.relativePosition;var Z4=AO,Hu,ti;Hu=ti={};ti.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),u=e.x1*n+a.x,o=e.x2*n+a.x,s=e.y1*n+a.y,f=e.y2*n+a.y;return{x1:u,x2:o,y1:s,y2:f,w:o-u,h:f-s}};ti.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};ti.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(o){if(!o.isParent())return;var s=o._private,f=o.children(),c=o.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},v=f.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),g=s.position;(v.w===0||v.h===0)&&(v={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},v.x1=g.x-v.w/2,v.x2=g.x+v.w/2,v.y1=g.y-v.h/2,v.y2=g.y+v.h/2);function m(A,L,R){var B=0,D=0,N=L+R;return A>0&&N>0&&(B=L/N*A,D=R/N*A),{biasDiff:B,biasComplementDiff:D}}function y(A,L,R,B){if(R.units==="%")switch(B){case"width":return A>0?R.pfValue*A:0;case"height":return L>0?R.pfValue*L:0;case"average":return A>0&&L>0?R.pfValue*(A+L)/2:0;case"min":return A>0&&L>0?A>L?R.pfValue*L:R.pfValue*A:0;case"max":return A>0&&L>0?A>L?R.pfValue*A:R.pfValue*L:0;default:return 0}else return R.units==="px"?R.pfValue:0}var x=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(x=x*100/d.width.val);var w=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(w=w*100/d.width.val);var _=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(_=_*100/d.height.val);var E=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(E=E*100/d.height.val);var S=m(d.width.val-v.w,x,w),C=S.biasDiff,k=S.biasComplementDiff,O=m(d.height.val-v.h,_,E),q=O.biasDiff,M=O.biasComplementDiff;s.autoPadding=y(v.w,v.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(v.w,d.width.val),g.x=(-C+v.x1+v.x2+k)/2,s.autoHeight=Math.max(v.h,d.height.val),g.y=(-q+v.y1+v.y2+M)/2}for(var n=0;ne.x2?a:e.x2,e.y1=ne.y2?u:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ki=function(e,r){return r==null?e:wn(e,r.x1,r.y1,r.x2,r.y2)},is=function(e,r,n){return xn(e,r,n)},xf=function(e,r,n){if(!r.cy().headless()){var a=r._private,u=a.rstyle,o=u.arrowWidth/2,s=r.pstyle(n+"-arrow-shape").value,f,c;if(s!=="none"){n==="source"?(f=u.srcX,c=u.srcY):n==="target"?(f=u.tgtX,c=u.tgtY):(f=u.midX,c=u.midY);var d=a.arrowBounds=a.arrowBounds||{},v=d[n]=d[n]||{};v.x1=f-o,v.y1=c-o,v.x2=f+o,v.y2=c+o,v.w=v.x2-v.x1,v.h=v.y2-v.y1,Bf(v,1),wn(e,v.x1,v.y1,v.x2,v.y2)}}},Sg=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var u=r._private,o=u.rstyle,s=r.pstyle(a+"label").strValue;if(s){var f=r.pstyle("text-halign"),c=r.pstyle("text-valign"),d=is(o,"labelWidth",n),v=is(o,"labelHeight",n),g=is(o,"labelX",n),m=is(o,"labelY",n),y=r.pstyle(a+"text-margin-x").pfValue,x=r.pstyle(a+"text-margin-y").pfValue,w=r.isEdge(),_=r.pstyle(a+"text-rotation"),E=r.pstyle("text-outline-width").pfValue,S=r.pstyle("text-border-width").pfValue,C=S/2,k=r.pstyle("text-background-padding").pfValue,O=2,q=v,M=d,A=M/2,L=q/2,R,B,D,N;if(w)R=g-A,B=g+A,D=m-L,N=m+L;else{switch(f.value){case"left":R=g-M,B=g;break;case"center":R=g-A,B=g+A;break;case"right":R=g,B=g+M;break}switch(c.value){case"top":D=m-q,N=m;break;case"center":D=m-L,N=m+L;break;case"bottom":D=m,N=m+q;break}}var U=y-Math.max(E,C)-k-O,z=y+Math.max(E,C)+k+O,G=x-Math.max(E,C)-k-O,V=x+Math.max(E,C)+k+O;R+=U,B+=z,D+=G,N+=V;var K=n||"main",I=u.labelBounds,H=I[K]=I[K]||{};H.x1=R,H.y1=D,H.x2=B,H.y2=N,H.w=B-R,H.h=N-D,H.leftPad=U,H.rightPad=z,H.topPad=G,H.botPad=V;var Q=w&&_.strValue==="autorotate",te=_.pfValue!=null&&_.pfValue!==0;if(Q||te){var Y=Q?is(u.rstyle,"labelAngle",n):_.pfValue,X=Math.cos(Y),j=Math.sin(Y),re=(R+B)/2,ie=(D+N)/2;if(!w){switch(f.value){case"left":re=B;break;case"right":re=R;break}switch(c.value){case"top":ie=N;break;case"bottom":ie=D;break}}var ee=function(Ae,Se){return Ae=Ae-re,Se=Se-ie,{x:Ae*X-Se*j+re,y:Ae*j+Se*X+ie}},W=ee(R,D),J=ee(R,N),ce=ee(B,D),he=ee(B,N);R=Math.min(W.x,J.x,ce.x,he.x),B=Math.max(W.x,J.x,ce.x,he.x),D=Math.min(W.y,J.y,ce.y,he.y),N=Math.max(W.y,J.y,ce.y,he.y)}var be=K+"Rot",_e=I[be]=I[be]||{};_e.x1=R,_e.y1=D,_e.x2=B,_e.y2=N,_e.w=B-R,_e.h=N-D,wn(e,R,D,B,N),wn(u.labelBounds.all,R,D,B,N)}return e}},Q4=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,a=r.pstyle("outline-width").value;if(n>0&&a>0){var u=r.pstyle("outline-offset").value,o=r.pstyle("shape").value,s=a+u,f=(e.w+s*2)/e.w,c=(e.h+s*2)/e.h,d=0,v=0;["diamond","pentagon","round-triangle"].includes(o)?(f=(e.w+s*2.4)/e.w,v=-s/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(o)?f=(e.w+s*2.4)/e.w:o==="star"?(f=(e.w+s*2.8)/e.w,c=(e.h+s*2.6)/e.h,v=-s/3.8):o==="triangle"?(f=(e.w+s*2.8)/e.w,c=(e.h+s*2.4)/e.h,v=-s/1.4):o==="vee"&&(f=(e.w+s*4.4)/e.w,c=(e.h+s*3.8)/e.h,v=-s*.5);var g=e.h*c-e.h,m=e.w*f-e.w;if(Lf(e,[Math.ceil(g/2),Math.ceil(m/2)]),d!=0||v!==0){var y=N3(e,d,v);nO(e,y)}}}},W4=function(e,r){var n=e._private.cy,a=n.styleEnabled(),u=n.headless(),o=zr(),s=e._private,f=e.isNode(),c=e.isEdge(),d,v,g,m,y,x,w=s.rstyle,_=f&&a?e.pstyle("bounds-expansion").pfValue:[0],E=function(Ne){return Ne.pstyle("display").value!=="none"},S=!a||E(e)&&(!c||E(e.source())&&E(e.target()));if(S){var C=0,k=0;a&&r.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(k=e.pstyle("overlay-padding").value));var O=0,q=0;a&&r.includeUnderlays&&(O=e.pstyle("underlay-opacity").value,O!==0&&(q=e.pstyle("underlay-padding").value));var M=Math.max(k,q),A=0,L=0;if(a&&(A=e.pstyle("width").pfValue,L=A/2),f&&r.includeNodes){var R=e.position();y=R.x,x=R.y;var B=e.outerWidth(),D=B/2,N=e.outerHeight(),U=N/2;d=y-D,v=y+D,g=x-U,m=x+U,wn(o,d,g,v,m),a&&r.includeOutlines&&Q4(o,e)}else if(c&&r.includeEdges)if(a&&!u){var z=e.pstyle("curve-style").strValue;if(d=Math.min(w.srcX,w.midX,w.tgtX),v=Math.max(w.srcX,w.midX,w.tgtX),g=Math.min(w.srcY,w.midY,w.tgtY),m=Math.max(w.srcY,w.midY,w.tgtY),d-=L,v+=L,g-=L,m+=L,wn(o,d,g,v,m),z==="haystack"){var G=w.haystackPts;if(G&&G.length===2){if(d=G[0].x,g=G[0].y,v=G[1].x,m=G[1].y,d>v){var V=d;d=v,v=V}if(g>m){var K=g;g=m,m=K}wn(o,d-L,g-L,v+L,m+L)}}else if(z==="bezier"||z==="unbundled-bezier"||z.endsWith("segments")||z.endsWith("taxi")){var I;switch(z){case"bezier":case"unbundled-bezier":I=w.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":I=w.linePts;break}if(I!=null)for(var H=0;Hv){var re=d;d=v,v=re}if(g>m){var ie=g;g=m,m=ie}d-=L,v+=L,g-=L,m+=L,wn(o,d,g,v,m)}if(a&&r.includeEdges&&c&&(xf(o,e,"mid-source"),xf(o,e,"mid-target"),xf(o,e,"source"),xf(o,e,"target")),a){var ee=e.pstyle("ghost").value==="yes";if(ee){var W=e.pstyle("ghost-offset-x").pfValue,J=e.pstyle("ghost-offset-y").pfValue;wn(o,o.x1+W,o.y1+J,o.x2+W,o.y2+J)}}var ce=s.bodyBounds=s.bodyBounds||{};x2(ce,o),Lf(ce,_),Bf(ce,1),a&&(d=o.x1,v=o.x2,g=o.y1,m=o.y2,wn(o,d-M,g-M,v+M,m+M));var he=s.overlayBounds=s.overlayBounds||{};x2(he,o),Lf(he,_),Bf(he,1);var be=s.labelBounds=s.labelBounds||{};be.all!=null?L3(be.all):be.all=zr(),a&&r.includeLabels&&(r.includeMainLabels&&Sg(o,e,null),c&&(r.includeSourceLabels&&Sg(o,e,"source"),r.includeTargetLabels&&Sg(o,e,"target")))}return o.x1=ln(o.x1),o.y1=ln(o.y1),o.x2=ln(o.x2),o.y2=ln(o.y2),o.w=ln(o.x2-o.x1),o.h=ln(o.y2-o.y1),o.w>0&&o.h>0&&S&&(Lf(o,_),Bf(o,1)),o},DO=function(e){var r=0,n=function(o){return(o?1:0)<0&&arguments[0]!==void 0?arguments[0]:hP,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;s--)o(s);return this};Wa.removeAllListeners=function(){return this.removeListener("*")};Wa.emit=Wa.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,pt(e)||(e=[e]),vP(this,function(u,o){r!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],a=n.length);for(var s=function(){var d=n[f];if(d.type===o.type&&(!d.namespace||d.namespace===o.namespace||d.namespace===dP)&&u.eventMatches(u.context,d,o)){var v=[o];e!=null&&i3(v,e),u.beforeEmit(u.context,d,o),d.conf&&d.conf.one&&(u.listeners=u.listeners.filter(function(y){return y!==d}));var g=u.callbackContext(u.context,d,o),m=d.callback.apply(g,v);u.afterEmit(u.context,d,o),m===!1&&(o.stopPropagation(),o.preventDefault())}},f=0;f1&&!o){var s=this.length-1,f=this[s],c=f._private.data.id;this[s]=void 0,this[e]=f,u.set(c,{ele:f,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,a=r.map,u=a.get(n);if(!u)return this;var o=u.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Ie(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=0;a=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],a=this,u=0;un&&(n=f,a=s)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,u=this,o=0;o=0&&u"u"?"undefined":er(Symbol))!=e&&er(Symbol.iterator)!=e;r&&(Jf[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},u=0,o=this.length;return Lk({next:function(){return u1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n));var u=n._private.style[e];return u??(r?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,u=n.style();if(at(e)){var o=e;u.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Ie(e))if(r===void 0){var s=this[0];return s?u.getStylePropertyValue(s,e):void 0}else u.applyBypass(this,e,r,a),this.emitAndNotify("style");else if(e===void 0){var f=this[0];return f?u.getRawStyle(f):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style(),u=this;if(e===void 0)for(var o=0;o0&&e.push(d[0]),e.push(s[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});Er.neighbourhood=Er.neighborhood;Er.closedNeighbourhood=Er.closedNeighborhood;Er.openNeighbourhood=Er.openNeighborhood;Fe(Er,{source:fn(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:fn(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:YS({attr:"source"}),targets:YS({attr:"target"})});function YS(t){return function(r){for(var n=[],a=0;a0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Er.componentsOf=Er.components;var mr=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Mt("A collection must have a reference to the core");return}var u=new ca,o=!1;if(!r)r=[];else if(r.length>0&&at(r[0])&&!Ps(r[0])){o=!0;for(var s=[],f=new ju,c=0,d=r.length;c0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),a=n._private,u=[],o=[],s,f=0,c=r.length;f0){for(var K=s.length===r.length?r:new mr(n,s),I=0;I0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],a={},u=r._private.cy;function o(N){for(var U=N._private.edges,z=0;z0&&(t?R.emitAndNotify("remove"):e&&R.emit("remove"));for(var B=0;B0?B=N:R=N;while(Math.abs(D)>o&&++U=u?E(L,U):z===0?U:C(L,R,R+c)}var O=!1;function q(){O=!0,(t!==e||r!==n)&&S()}var M=function(R){return O||q(),t===e&&r===n?R:R===0?0:R===1?1:w(k(R),e,n)};M.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var A="generateBezier("+[t,e,r,n]+")";return M.toString=function(){return A},M}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var TP=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,u){var o={x:n.x+u.dx*a,v:n.v+u.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:t(o)}}function r(n,a){var u={dx:n.v,dv:t(n)},o=e(n,a*.5,u),s=e(n,a*.5,o),f=e(n,a,s),c=1/6*(u.dx+2*(o.dx+s.dx)+f.dx),d=1/6*(u.dv+2*(o.dv+s.dv)+f.dv);return n.x=n.x+c*a,n.v=n.v+d*a,n}return function n(a,u,o){var s={x:-1,v:0,tension:null,friction:null},f=[0],c=0,d=1/1e4,v=16/1e3,g,m,y;for(a=parseFloat(a)||500,u=parseFloat(u)||20,o=o||null,s.tension=a,s.friction=u,g=o!==null,g?(c=n(a,u),m=c/o*v):m=v;y=r(y||s,m),f.push(1+y.x),c+=16,Math.abs(y.x)>d&&Math.abs(y.v)>d;);return g?function(x){return f[x*(f.length-1)|0]}:c}}(),bt=function(e,r,n,a){var u=SP(e,r,n,a);return function(o,s,f){return o+(s-o)*u(f)}},Pf={linear:function(e,r,n){return e+(r-e)*n},ease:bt(.25,.1,.25,1),"ease-in":bt(.42,0,1,1),"ease-out":bt(0,0,.58,1),"ease-in-out":bt(.42,0,.58,1),"ease-in-sine":bt(.47,0,.745,.715),"ease-out-sine":bt(.39,.575,.565,1),"ease-in-out-sine":bt(.445,.05,.55,.95),"ease-in-quad":bt(.55,.085,.68,.53),"ease-out-quad":bt(.25,.46,.45,.94),"ease-in-out-quad":bt(.455,.03,.515,.955),"ease-in-cubic":bt(.55,.055,.675,.19),"ease-out-cubic":bt(.215,.61,.355,1),"ease-in-out-cubic":bt(.645,.045,.355,1),"ease-in-quart":bt(.895,.03,.685,.22),"ease-out-quart":bt(.165,.84,.44,1),"ease-in-out-quart":bt(.77,0,.175,1),"ease-in-quint":bt(.755,.05,.855,.06),"ease-out-quint":bt(.23,1,.32,1),"ease-in-out-quint":bt(.86,0,.07,1),"ease-in-expo":bt(.95,.05,.795,.035),"ease-out-expo":bt(.19,1,.22,1),"ease-in-out-expo":bt(1,0,0,1),"ease-in-circ":bt(.6,.04,.98,.335),"ease-out-circ":bt(.075,.82,.165,1),"ease-in-out-circ":bt(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return Pf.linear;var a=TP(e,r,n);return function(u,o,s){return u+(o-u)*a(s)}},"cubic-bezier":bt};function XS(t,e,r,n,a){if(n===1||e===r)return r;var u=a(e,r,n);return t==null||((t.roundValue||t.color)&&(u=Math.round(u)),t.min!==void 0&&(u=Math.max(u,t.min)),t.max!==void 0&&(u=Math.min(u,t.max))),u}function jS(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Au(t,e,r,n,a){var u=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var o=jS(t,a),s=jS(e,a);if(Re(o)&&Re(s))return XS(u,o,s,r,n);if(pt(o)&&pt(s)){for(var f=[],c=0;c0?(m==="spring"&&y.push(o.duration),o.easingImpl=Pf[m].apply(null,y)):o.easingImpl=Pf[m]}var x=o.easingImpl,w;if(o.duration===0?w=1:w=(r-f)/o.duration,o.applying&&(w=o.progress),w<0?w=0:w>1&&(w=1),o.delay==null){var _=o.startPosition,E=o.position;if(E&&a&&!t.locked()){var S={};os(_.x,E.x)&&(S.x=Au(_.x,E.x,w,x)),os(_.y,E.y)&&(S.y=Au(_.y,E.y,w,x)),t.position(S)}var C=o.startPan,k=o.pan,O=u.pan,q=k!=null&&n;q&&(os(C.x,k.x)&&(O.x=Au(C.x,k.x,w,x)),os(C.y,k.y)&&(O.y=Au(C.y,k.y,w,x)),t.emit("pan"));var M=o.startZoom,A=o.zoom,L=A!=null&&n;L&&(os(M,A)&&(u.zoom=As(u.minZoom,Au(M,A,w,x),u.maxZoom)),t.emit("zoom")),(q||L)&&t.emit("viewport");var R=o.style;if(R&&R.length>0&&a){for(var B=0;B=0;q--){var M=O[q];M()}O.splice(0,O.length)},E=m.length-1;E>=0;E--){var S=m[E],C=S._private;if(C.stopped){m.splice(E,1),C.hooked=!1,C.playing=!1,C.started=!1,_(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||AP(d,S,t),CP(d,S,t,v),C.applying&&(C.applying=!1),_(C.frames),C.step!=null&&C.step(t),S.completed()&&(m.splice(E,1),C.hooked=!1,C.playing=!1,C.started=!1,_(C.completes)),x=!0)}return!v&&m.length===0&&y.length===0&&n.push(d),x}for(var u=!1,o=0;o0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var RP={animate:lt.animate(),animation:lt.animation(),animated:lt.animated(),clearQueue:lt.clearQueue(),delay:lt.delay(),delayAnimation:lt.delayAnimation(),stop:lt.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Xf(function(u){ZS(u,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(u,o){ZS(o,e)},n.beforeRenderPriorities.animations):r()}},DP={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Ps(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},Sf=function(e){return Ie(e)?new Za(e):e},UO={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ec(DP,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Sf(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Sf(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Sf(r),n),this},once:function(e,r,n){return this.emitter().one(e,Sf(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};lt.eventAliasesOn(UO);var s1={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};s1.jpeg=s1.jpg;var If={layout:function(e){var r=this;if(e==null){Mt("Layout options must be specified to make a layout");return}if(e.name==null){Mt("A `name` must be specified to make a layout");return}var n=e.name,a=r.extension("layout",n);if(a==null){Mt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var u;Ie(e.eles)?u=r.$(e.eles):u=e.eles!=null?e.eles:r.$();var o=new a(Fe({},e,{cy:r,eles:u}));return o}};If.createLayout=If.makeLayout=If.layout;var MP={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&a.merge(r);return}if(n.notificationsEnabled){var u=this.renderer();this.destroyed()||!u||u.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?r.notify(n):r.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};l1.invalidateDimensions=l1.resize;var Uf={collection:function(e,r){return Ie(e)?this.$(e):Fr(e)?e.collection():pt(e)?(r||(r={}),new mr(this,e,r.unique,r.removed)):new mr(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};Uf.elements=Uf.filter=Uf.$;var cr={},ws="t",OP="f";cr.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),u=0;u0;if(g||v&&m){var y=void 0;g&&m||g?y=c.properties:m&&(y=c.mappedProperties);for(var x=0;x1&&(C=1),s.color){var O=n.valueMin[0],q=n.valueMax[0],M=n.valueMin[1],A=n.valueMax[1],L=n.valueMin[2],R=n.valueMax[2],B=n.valueMin[3]==null?1:n.valueMin[3],D=n.valueMax[3]==null?1:n.valueMax[3],N=[Math.round(O+(q-O)*C),Math.round(M+(A-M)*C),Math.round(L+(R-L)*C),Math.round(B+(D-B)*C)];u={bypass:n.bypass,name:n.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else if(s.number){var U=n.valueMin+(n.valueMax-n.valueMin)*C;u=this.parse(n.name,U,n.bypass,g)}else return!1;if(!u)return x(),!1;u.mapping=n,n=u;break}case o.data:{for(var z=n.field.split("."),G=v.data,V=0;V0&&u>0){for(var s={},f=!1,c=0;c0?t.delayAnimation(o).play().promise().then(S):S()}).then(function(){return t.animation({style:s,duration:u,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1)};cr.checkTrigger=function(t,e,r,n,a,u){var o=this.properties[e],s=a(o);t.removed()||s!=null&&s(r,n,t)&&u(o)};cr.checkZOrderTrigger=function(t,e,r,n){var a=this;this.checkTrigger(t,e,r,n,function(u){return u.triggersZOrder},function(){a._private.cy.notify("zorder",t)})};cr.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};cr.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBoundsOfConnectedEdges},function(a){t.connectedEdges().forEach(function(u){u.dirtyBoundingBoxCache()})})};cr.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBoundsOfParallelEdges},function(a){t.parallelEdges().forEach(function(u){u.dirtyBoundingBoxCache()})})};cr.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var Ys={};Ys.applyBypass=function(t,e,r,n){var a=this,u=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;sa.length?n=n.substr(a.length):n=""}function f(){u.length>o.length?u=u.substr(o.length):u=""}for(;;){var c=n.match(/^\s*$/);if(c)break;var d=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){ft("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=d[0];var v=d[1];if(v!=="core"){var g=new Za(v);if(g.invalid){ft("Skipping parsing of block: Invalid selector found in string stylesheet: "+v),s();continue}}var m=d[2],y=!1;u=m;for(var x=[];;){var w=u.match(/^\s*$/);if(w)break;var _=u.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!_){ft("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),y=!0;break}o=_[0];var E=_[1],S=_[2],C=e.properties[E];if(!C){ft("Skipping property: Invalid property name in: "+o),f();continue}var k=r.parse(E,S);if(!k){ft("Skipping property: Invalid property definition in: "+o),f();continue}x.push({name:E,val:S}),f()}if(y){s();break}r.selector(v);for(var O=0;O=7&&e[0]==="d"&&(d=new RegExp(s.data.regex).exec(e))){if(r)return!1;var g=s.data;return{name:t,value:d,strValue:""+e,mapped:g,field:d[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(v=new RegExp(s.mapData.regex).exec(e))){if(r||c.multiple)return!1;var m=s.mapData;if(!(c.color||c.number))return!1;var y=this.parse(t,v[4]);if(!y||y.mapped)return!1;var x=this.parse(t,v[5]);if(!x||x.mapped)return!1;if(y.pfValue===x.pfValue||y.strValue===x.strValue)return ft("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+y.strValue+"`"),this.parse(t,y.strValue);if(c.color){var w=y.value,_=x.value,E=w[0]===_[0]&&w[1]===_[1]&&w[2]===_[2]&&(w[3]===_[3]||(w[3]==null||w[3]===1)&&(_[3]==null||_[3]===1));if(E)return!1}return{name:t,value:v,strValue:""+e,mapped:m,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:y.value,valueMax:x.value,bypass:r}}}if(c.multiple&&n!=="multiple"){var S;if(f?S=e.split(/\s+/):pt(e)?S=e:S=[e],c.evenMultiple&&S.length%2!==0)return null;for(var C=[],k=[],O=[],q="",M=!1,A=0;A0?" ":"")+L.strValue}return c.validate&&!c.validate(C,k)?null:c.singleEnum&&M?C.length===1&&Ie(C[0])?{name:t,value:C[0],strValue:C[0],bypass:r}:null:{name:t,value:C,pfValue:O,strValue:q,bypass:r,units:k}}var R=function(){for(var ee=0;eec.max||c.strictMax&&e===c.max))return null;var z={name:t,value:e,strValue:""+e+(B||""),units:B,bypass:r};return c.unitless||B!=="px"&&B!=="em"?z.pfValue=e:z.pfValue=B==="px"||!B?e:this.getEmSizeInPixels()*e,(B==="ms"||B==="s")&&(z.pfValue=B==="ms"?e:1e3*e),(B==="deg"||B==="rad")&&(z.pfValue=B==="rad"?e:k3(e)),B==="%"&&(z.pfValue=e/100),z}else if(c.propList){var G=[],V=""+e;if(V!=="none"){for(var K=V.split(/\s*,\s*|\s+/),I=0;I0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){f=Math.min((o-2*r)/n.w,(s-2*r)/n.h),f=f>this._private.maxZoom?this._private.maxZoom:f,f=f=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,a=r.zoom,u,o,s=!1;if(r.zoomingEnabled||(s=!0),Re(e)?o=e:at(e)&&(o=e.level,e.position!=null?u=pc(e.position,a,n):e.renderedPosition!=null&&(u=e.renderedPosition),u!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=or.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=f,u.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var c=e.pan;Re(c.x)&&(r.pan.x=c.x,s=!1),Re(c.y)&&(r.pan.y=c.y,s=!1),s||u.push("pan")}return u.length>0&&(u.push("viewport"),this.emit(u.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(Ie(e)){var n=e;e=this.mutableElements().filter(n)}else Fr(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),u=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var s={x:(u-r*(a.x1+a.x2))/2,y:(o-r*(a.y1+a.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var a=n.window().getComputedStyle(r),u=function(s){return parseFloat(a.getPropertyValue(s))};return{width:r.clientWidth-u("padding-left")-u("padding-right"),height:r.clientHeight-u("padding-top")-u("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Ui.centre=Ui.center;Ui.autolockNodes=Ui.autolock;Ui.autoungrabifyNodes=Ui.autoungrabify;var ks={data:lt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:lt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:lt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:lt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ks.attr=ks.data;ks.removeAttr=ks.removeData;var Os=function(e){var r=this;e=Fe({},e);var n=e.container;n&&!Kf(n)&&Kf(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var u=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=r;var o=Wt!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=Fe({name:o?"grid":"null"},s.layout),s.renderer=Fe({name:o?"canvas":"null"},s.renderer);var f=function(y,x,w){return x!==void 0?x:w!==void 0?w:y},c=this._private={container:n,ready:!1,options:s,elements:new mr(this),listeners:[],aniEles:new mr(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:f(!0,s.zoomingEnabled),userZoomingEnabled:f(!0,s.userZoomingEnabled),panningEnabled:f(!0,s.panningEnabled),userPanningEnabled:f(!0,s.userPanningEnabled),boxSelectionEnabled:f(!0,s.boxSelectionEnabled),autolock:f(!1,s.autolock,s.autolockNodes),autoungrabify:f(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:f(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:Re(s.zoom)?s.zoom:1,pan:{x:at(s.pan)&&Re(s.pan.x)?s.pan.x:0,y:at(s.pan)&&Re(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:f(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var d=function(y,x){var w=y.some(CN);if(w)return Zu.all(y).then(x);x(y)};c.styleEnabled&&r.setStyle([]);var v=Fe({},s,s.renderer);r.initRenderer(v);var g=function(y,x,w){r.notifications(!1);var _=r.mutableElements();_.length>0&&_.remove(),y!=null&&(at(y)||pt(y))&&r.add(y),r.one("layoutready",function(S){r.notifications(!0),r.emit(S),r.one("load",x),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",w),r.emit("done")});var E=Fe({},r._private.options.layout);E.eles=r.elements(),r.layout(E).run()};d([s.style,s.elements],function(m){var y=m[0],x=m[1];c.styleEnabled&&r.style().append(y),g(x,function(){r.startAnimationLoop(),c.ready=!0,kt(s.ready)&&r.on("ready",s.ready);for(var w=0;w0,s=!!t.boundingBox,f=e.extent(),c=zr(s?t.boundingBox:{x1:f.x1,y1:f.y1,w:f.w,h:f.h}),d;if(Fr(t.roots))d=t.roots;else if(pt(t.roots)){for(var v=[],g=0;g0;){var U=N(),z=L(U,B);if(z)U.outgoers().filter(function(Se){return Se.isNode()&&r.has(Se)}).forEach(D);else if(z===null){ft("Detected double maximal shift for node `"+U.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var G=0;if(t.avoidOverlap)for(var V=0;V0&&E[0].length<=3?qe/2:0),je=2*Math.PI/E[Ue].length*Oe;return Ue===0&&E[0].length===1&&(ze=1),{x:he.x+ze*Math.cos(je),y:he.y+ze*Math.sin(je)}}else{var we=E[Ue].length,$=Math.max(we===1?0:s?(c.w-t.padding*2-be.w)/((t.grid?Ne:we)-1):(c.w-t.padding*2-be.w)/((t.grid?Ne:we)+1),G),ue={x:he.x+(Oe+1-(we+1)/2)*$,y:he.y+(Ue+1-(j+1)/2)*_e};return ue}};return r.nodes().layoutPositions(this,t,Ae),this};var zP={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function VO(t){this.options=Fe({},zP,t)}VO.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,u=n.nodes().not(":parent");e.sort&&(u=u.sort(e.sort));for(var o=zr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},f=e.sweep===void 0?2*Math.PI-2*Math.PI/u.length:e.sweep,c=f/Math.max(1,u.length-1),d,v=0,g=0;g1&&e.avoidOverlap){v*=1.75;var _=Math.cos(c)-Math.cos(0),E=Math.sin(c)-Math.sin(0),S=Math.sqrt(v*v/(_*_+E*E));d=Math.max(S,d)}var C=function(O,q){var M=e.startAngle+q*c*(a?1:-1),A=d*Math.cos(M),L=d*Math.sin(M),R={x:s.x+A,y:s.y+L};return R};return n.nodes().layoutPositions(this,e,C),this};var PP={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function HO(t){this.options=Fe({},PP,t)}HO.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,a=e.eles,u=a.nodes().not(":parent"),o=zr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},f=[],c=0,d=0;d0){var k=Math.abs(E[0].value-C.value);k>=w&&(E=[],_.push(E))}E.push(C)}var O=c+e.minNodeSpacing;if(!e.avoidOverlap){var q=_.length>0&&_[0].length>1,M=Math.min(o.w,o.h)/2-O,A=M/(_.length+q?1:0);O=Math.min(O,A)}for(var L=0,R=0;R<_.length;R++){var B=_[R],D=e.sweep===void 0?2*Math.PI-2*Math.PI/B.length:e.sweep,N=B.dTheta=D/Math.max(1,B.length-1);if(B.length>1&&e.avoidOverlap){var U=Math.cos(N)-Math.cos(0),z=Math.sin(N)-Math.sin(0),G=Math.sqrt(O*O/(U*U+z*z));L=Math.max(G,L)}B.r=L,L+=O}if(e.equidistant){for(var V=0,K=0,I=0;I<_.length;I++){var H=_[I],Q=H.r-K;V=Math.max(V,Q)}K=0;for(var te=0;te<_.length;te++){var Y=_[te];te===0&&(K=Y.r),Y.r=K,K+=V}}for(var X={},j=0;j<_.length;j++)for(var re=_[j],ie=re.dTheta,ee=re.r,W=0;W=t.numIter||(YP(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&u(),Xf(d)}};d()}else{for(;c;)c=o(f),f++;JS(n,t),s()}return this};Rc.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Rc.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var UP=function(e,r,n){for(var a=n.eles.edges(),u=n.eles.nodes(),o=zr(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:u.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},f=n.eles.components(),c={},d=0;d0){s.graphSet.push(M);for(var d=0;da.count?0:a.graph},FO=function(e,r,n,a){var u=a.graphSet[n];if(-10)var v=a.nodeOverlap*d,g=Math.sqrt(s*s+f*f),m=v*s/g,y=v*f/g;else var x=tc(e,s,f),w=tc(r,-1*s,-1*f),_=w.x-x.x,E=w.y-x.y,S=_*_+E*E,g=Math.sqrt(S),v=(e.nodeRepulsion+r.nodeRepulsion)/S,m=v*_/g,y=v*E/g;e.isLocked||(e.offsetX-=m,e.offsetY-=y),r.isLocked||(r.offsetX+=m,r.offsetY+=y)}},XP=function(e,r,n,a){if(n>0)var u=e.maxX-r.minX;else var u=r.maxX-e.minX;if(a>0)var o=e.maxY-r.minY;else var o=r.maxY-e.minY;return u>=0&&o>=0?Math.sqrt(u*u+o*o):0},tc=function(e,r,n){var a=e.positionX,u=e.positionY,o=e.height||1,s=e.width||1,f=n/r,c=o/s,d={};return r===0&&0n?(d.x=a,d.y=u+o/2,d):0r&&-1*c<=f&&f<=c?(d.x=a-s/2,d.y=u-s*n/2/r,d):0=c)?(d.x=a+o*r/2/n,d.y=u+o/2,d):(0>n&&(f<=-1*c||f>=c)&&(d.x=a-o*r/2/n,d.y=u-o/2),d)},jP=function(e,r){for(var n=0;nn){var w=r.gravity*m/x,_=r.gravity*y/x;g.offsetX+=w,g.offsetY+=_}}}}},QP=function(e,r){var n=[],a=0,u=-1;for(n.push.apply(n,e.graphSet[0]),u+=e.graphSet[0].length;a<=u;){var o=n[a++],s=e.idToIndex[o],f=e.layoutNodes[s],c=f.children;if(0n)var u={x:n*e/a,y:n*r/a};else var u={x:e,y:r};return u},$O=function(e,r){var n=e.parentId;if(n!=null){var a=r.layoutNodes[r.idToIndex[n]],u=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,u=!0),(a.minX==null||e.minX-a.padLefta.maxY)&&(a.maxY=e.maxY+a.padBottom,u=!0),(a.minY==null||e.minY-a.padTop_&&(y+=w+r.componentSpacing,m=0,x=0,w=0)}}},e6={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function KO(t){this.options=Fe({},e6,t)}KO.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var u=zr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(u.h===0||u.w===0)n.nodes().layoutPositions(this,e,function(te){return{x:u.x1,y:u.y1}});else{var o=a.size(),s=Math.sqrt(o*u.h/u.w),f=Math.round(s),c=Math.round(u.w/u.h*s),d=function(Y){if(Y==null)return Math.min(f,c);var X=Math.min(f,c);X==f?f=Y:c=Y},v=function(Y){if(Y==null)return Math.max(f,c);var X=Math.max(f,c);X==f?f=Y:c=Y},g=e.rows,m=e.cols!=null?e.cols:e.columns;if(g!=null&&m!=null)f=g,c=m;else if(g!=null&&m==null)f=g,c=Math.ceil(o/f);else if(g==null&&m!=null)c=m,f=Math.ceil(o/c);else if(c*f>o){var y=d(),x=v();(y-1)*x>=o?d(y-1):(x-1)*y>=o&&v(x-1)}else for(;c*f=o?v(_+1):d(w+1)}var E=u.w/c,S=u.h/f;if(e.condense&&(E=0,S=0),e.avoidOverlap)for(var C=0;C=c&&(U=0,N++)},G={},V=0;V(U=F3(t,e,z[G],z[G+1],z[G+2],z[G+3])))return w(q,U),!0}else if(A.edgeType==="bezier"||A.edgeType==="multibezier"||A.edgeType==="self"||A.edgeType==="compound"){for(var z=A.allpts,G=0;G+5(U=H3(t,e,z[G],z[G+1],z[G+2],z[G+3],z[G+4],z[G+5])))return w(q,U),!0}for(var V=V||M.source,K=K||M.target,I=a.getArrowWidth(L,R),H=[{name:"source",x:A.arrowStartX,y:A.arrowStartY,angle:A.srcArrowAngle},{name:"target",x:A.arrowEndX,y:A.arrowEndY,angle:A.tgtArrowAngle},{name:"mid-source",x:A.midX,y:A.midY,angle:A.midsrcArrowAngle},{name:"mid-target",x:A.midX,y:A.midY,angle:A.midtgtArrowAngle}],G=0;G0&&(_(V),_(K))}function S(q,M,A){return xn(q,M,A)}function C(q,M){var A=q._private,L=g,R;M?R=M+"-":R="",q.boundingBox();var B=A.labelBounds[M||"main"],D=q.pstyle(R+"label").value,N=q.pstyle("text-events").strValue==="yes";if(!(!N||!D)){var U=S(A.rscratch,"labelX",M),z=S(A.rscratch,"labelY",M),G=S(A.rscratch,"labelAngle",M),V=q.pstyle(R+"text-margin-x").pfValue,K=q.pstyle(R+"text-margin-y").pfValue,I=B.x1-L-V,H=B.x2+L-V,Q=B.y1-L-K,te=B.y2+L-K;if(G){var Y=Math.cos(G),X=Math.sin(G),j=function(he,be){return he=he-U,be=be-z,{x:he*Y-be*X+U,y:he*X+be*Y+z}},re=j(I,Q),ie=j(I,te),ee=j(H,Q),W=j(H,te),J=[re.x+V,re.y+K,ee.x+V,ee.y+K,W.x+V,W.y+K,ie.x+V,ie.y+K];if(Br(t,e,J))return w(q),!0}else if(Yu(B,t,e))return w(q),!0}}for(var k=o.length-1;k>=0;k--){var O=o[k];O.isNode()?_(O)||C(O):E(O)||C(O)||C(O,"source")||C(O,"target")}return s};Vi.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,u=[],o=Math.min(t,r),s=Math.max(t,r),f=Math.min(e,n),c=Math.max(e,n);t=o,r=s,e=f,n=c;for(var d=zr({x1:t,y1:e,x2:r,y2:n}),v=0;v0?-(Math.PI-e.ang):Math.PI+e.ang},u6=function(e,r,n,a,u){if(e!==aT?iT(r,e,Nn):i6(sn,Nn),iT(r,n,sn),rT=Nn.nx*sn.ny-Nn.ny*sn.nx,nT=Nn.nx*sn.nx-Nn.ny*-sn.ny,la=Math.asin(Math.max(-1,Math.min(1,rT))),Math.abs(la)<1e-6){f1=r.x,c1=r.y,Oi=Du=0;return}qi=1,Gf=!1,nT<0?la<0?la=Math.PI+la:(la=Math.PI-la,qi=-1,Gf=!0):la>0&&(qi=-1,Gf=!0),r.radius!==void 0?Du=r.radius:Du=a,Ti=la/2,Tf=Math.min(Nn.len/2,sn.len/2),u?(Bn=Math.abs(Math.cos(Ti)*Du/Math.sin(Ti)),Bn>Tf?(Bn=Tf,Oi=Math.abs(Bn*Math.sin(Ti)/Math.cos(Ti))):Oi=Du):(Bn=Math.min(Tf,Du),Oi=Math.abs(Bn*Math.sin(Ti)/Math.cos(Ti))),d1=r.x+sn.nx*Bn,h1=r.y+sn.ny*Bn,f1=d1-sn.ny*Oi*qi,c1=h1+sn.nx*Oi*qi,QO=r.x+Nn.nx*Bn,WO=r.y+Nn.ny*Bn,aT=r};function JO(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function H1(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(u6(t,e,r,n,a),{cx:f1,cy:c1,radius:Oi,startX:QO,startY:WO,stopX:d1,stopY:h1,startAngle:Nn.ang+Math.PI/2*qi,endAngle:sn.ang-Math.PI/2*qi,counterClockwise:Gf})}var Tr={};Tr.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,u,o=t.pstyle("source-endpoint"),s=t.pstyle("target-endpoint"),f=o.units!=null&&s.units!=null,c=function(k,O,q,M){var A=M-O,L=q-k,R=Math.sqrt(L*L+A*A);return{x:-A/R,y:L/R}},d=t.pstyle("edge-distances").value;switch(d){case"node-position":u=r;break;case"intersection":u=n;break;case"endpoints":{if(f){var v=this.manualEndptToPx(t.source()[0],o),g=lr(v,2),m=g[0],y=g[1],x=this.manualEndptToPx(t.target()[0],s),w=lr(x,2),_=w[0],E=w[1],S={x1:m,y1:y,x2:_,y2:E};a=c(m,y,_,E),u=S}else ft("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),u=n;break}}return{midptPts:u,vectorNormInverse:a}};Tr.findHaystackPoints=function(t){for(var e=0;e0?Math.max(ge-Ee,0):Math.min(ge+Ee,0)},D=B(L,M),N=B(R,A),U=!1;E===c?_=Math.abs(D)>Math.abs(N)?a:n:E===f||E===s?(_=n,U=!0):(E===u||E===o)&&(_=a,U=!0);var z=_===n,G=z?N:D,V=z?R:L,K=rO(V),I=!1;!(U&&(C||O))&&(E===s&&V<0||E===f&&V>0||E===u&&V>0||E===o&&V<0)&&(K*=-1,G=K*Math.abs(G),I=!0);var H;if(C){var Q=k<0?1+k:k;H=Q*G}else{var te=k<0?G:0;H=te+k*K}var Y=function(ge){return Math.abs(ge)=Math.abs(G)},X=Y(H),j=Y(Math.abs(G)-Math.abs(H)),re=X||j;if(re&&!I)if(z){var ie=Math.abs(V)<=g/2,ee=Math.abs(L)<=m/2;if(ie){var W=(d.x1+d.x2)/2,J=d.y1,ce=d.y2;r.segpts=[W,J,W,ce]}else if(ee){var he=(d.y1+d.y2)/2,be=d.x1,_e=d.x2;r.segpts=[be,he,_e,he]}else r.segpts=[d.x1,d.y2]}else{var Ne=Math.abs(V)<=v/2,Ae=Math.abs(R)<=y/2;if(Ne){var Se=(d.y1+d.y2)/2,Te=d.x1,Be=d.x2;r.segpts=[Te,Se,Be,Se]}else if(Ae){var Ue=(d.x1+d.x2)/2,Oe=d.y1,qe=d.y2;r.segpts=[Ue,Oe,Ue,qe]}else r.segpts=[d.x2,d.y1]}else if(z){var ze=d.y1+H+(w?g/2*K:0),je=d.x1,we=d.x2;r.segpts=[je,ze,we,ze]}else{var $=d.x1+H+(w?v/2*K:0),ue=d.y1,ve=d.y2;r.segpts=[$,ue,$,ve]}if(r.isRound){var oe=t.pstyle("taxi-radius").value,fe=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(oe),r.isArcRadius=new Array(r.segpts.length/2).fill(fe)}};Tr.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,u=e.srcW,o=e.srcH,s=e.tgtW,f=e.tgtH,c=e.srcShape,d=e.tgtShape,v=e.srcCornerRadius,g=e.tgtCornerRadius,m=e.srcRs,y=e.tgtRs,x=!Re(r.startX)||!Re(r.startY),w=!Re(r.arrowStartX)||!Re(r.arrowStartY),_=!Re(r.endX)||!Re(r.endY),E=!Re(r.arrowEndX)||!Re(r.arrowEndY),S=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=S*C,O=zi({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),q=OV.poolIndex()){var K=G;G=V,V=K}var I=D.srcPos=G.position(),H=D.tgtPos=V.position(),Q=D.srcW=G.outerWidth(),te=D.srcH=G.outerHeight(),Y=D.tgtW=V.outerWidth(),X=D.tgtH=V.outerHeight(),j=D.srcShape=r.nodeShapes[e.getNodeShape(G)],re=D.tgtShape=r.nodeShapes[e.getNodeShape(V)],ie=D.srcCornerRadius=G.pstyle("corner-radius").value==="auto"?"auto":G.pstyle("corner-radius").pfValue,ee=D.tgtCornerRadius=V.pstyle("corner-radius").value==="auto"?"auto":V.pstyle("corner-radius").pfValue,W=D.tgtRs=V._private.rscratch,J=D.srcRs=G._private.rscratch;D.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ce=0;ce0){var ce=u,he=Mi(ce,zu(r)),be=Mi(ce,zu(J)),_e=he;if(be2){var Ne=Mi(ce,{x:J[2],y:J[3]});Ne<_e&&(r=[J[2],J[3]])}}}var Ae=yf(r,N,e.arrowShapes[s].spacing(t)+c),Se=yf(r,N,e.arrowShapes[s].gap(t)+c);if(y.endX=Se[0],y.endY=Se[1],y.arrowEndX=Ae[0],y.arrowEndY=Ae[1],A==="inside-to-node")r=[u.x,u.y];else if(M.units)r=this.manualEndptToPx(n,M);else if(A==="outside-to-line")r=y.srcIntn;else if(A==="outside-to-node"||A==="outside-to-node-or-label"?G=U:(A==="outside-to-line"||A==="outside-to-line-or-label")&&(G=[o.x,o.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(u.x,u.y,n.outerWidth(),n.outerHeight(),G[0],G[1],0,L,v),A==="outside-to-node-or-label"||A==="outside-to-line-or-label"){var Te=n._private.rscratch,Be=Te.labelWidth,Ue=Te.labelHeight,Oe=Te.labelX,qe=Te.labelY,ze=Be/2,je=Ue/2,we=n.pstyle("text-valign").value;we==="top"?qe-=je:we==="bottom"&&(qe+=je);var $=n.pstyle("text-halign").value;$==="left"?Oe-=ze:$==="right"&&(Oe+=ze);var ue=Rs(G[0],G[1],[Oe-ze,qe-je,Oe+ze,qe-je,Oe+ze,qe+je,Oe-ze,qe+je],u.x,u.y);if(ue.length>0){var ve=o,oe=Mi(ve,zu(r)),fe=Mi(ve,zu(ue)),Ce=oe;if(fe2){var ge=Mi(ve,{x:ue[2],y:ue[3]});ge=y||q){w={cp:C,segment:O};break}}if(w)break}var M=w.cp,A=w.segment,L=(y-_)/A.length,R=A.t1-A.t0,B=m?A.t0+R*L:A.t1-R*L;B=As(0,B,1),e=Uu(M.p0,M.p1,M.p2,B),g=s6(M.p0,M.p1,M.p2,B);break}case"straight":case"segments":case"haystack":{for(var D=0,N,U,z,G,V=n.allpts.length,K=0;K+3=y));K+=2);var I=y-U,H=I/N;H=As(0,H,1),e=q3(z,G,H),g=rq(z,G);break}}o("labelX",v,e.x),o("labelY",v,e.y),o("labelAutoAngle",v,g)}};c("source"),c("target"),this.applyLabelDimensions(t)}};Gn.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Gn.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,n),u=t.pstyle("line-height").pfValue,o=t.pstyle("text-wrap").strValue,s=xn(r.rscratch,"labelWrapCachedLines",e)||[],f=o!=="wrap"?1:Math.max(s.length,1),c=a.height/f,d=c*u,v=a.width,g=a.height+(f-1)*(u-1)*c;Ha(r.rstyle,"labelWidth",e,v),Ha(r.rscratch,"labelWidth",e,v),Ha(r.rstyle,"labelHeight",e,g),Ha(r.rscratch,"labelHeight",e,g),Ha(r.rscratch,"labelLineHeight",e,d)};Gn.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,u=t.pstyle("text-transform").value,o=function(te,Y){return Y?(Ha(r.rscratch,te,e,Y),Y):xn(r.rscratch,te,e)};if(!a)return"";u=="none"||(u=="uppercase"?a=a.toUpperCase():u=="lowercase"&&(a=a.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var f=o("labelKey");if(f!=null&&o("labelWrapKey")===f)return o("labelWrapCachedText");for(var c="​",d=a.split(` `),v=t.pstyle("text-max-width").pfValue,g=t.pstyle("text-overflow-wrap").value,m=g==="anywhere",y=[],x=/[\s\u200b]+|$/g,w=0;wv){var k=_.matchAll(x),O="",q=0,M=En(k),A;try{for(M.s();!(A=M.n()).done;){var L=A.value,R=L[0],B=_.substring(q,L.index);q=L.index+R.length;var D=O.length===0?B:O+B+R,N=this.calculateLabelDimensions(t,D),U=N.width;U<=v?O+=B+R:(O&&y.push(O),O=B+R)}}catch(Q){M.e(Q)}finally{M.f()}O.match(/^[\s\u200b]+$/)||y.push(O)}else y.push(_)}o("labelWrapCachedLines",y),a=o("labelWrapCachedText",y.join(` `)),o("labelWrapKey",f)}else if(s==="ellipsis"){var z=t.pstyle("text-max-width").pfValue,G="",V="…",K=!1;if(this.calculateLabelDimensions(t,a).widthz)break;G+=a[I],I===a.length-1&&(K=!0)}return K||(G+=V),G}return a};Gn.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};Gn.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,u=Xa(e,t._private.labelDimsKey),o=r.labelDimCache||(r.labelDimCache=[]),s=o[u];if(s!=null)return s;var f=0,c=t.pstyle("font-style").strValue,d=t.pstyle("font-size").pfValue,v=t.pstyle("font-family").strValue,g=t.pstyle("font-weight").strValue,m=this.labelCalcCanvas,y=this.labelCalcCanvasContext;if(!m){m=this.labelCalcCanvas=a.createElement("canvas"),y=this.labelCalcCanvasContext=m.getContext("2d");var x=m.style;x.position="absolute",x.left="-9999px",x.top="-9999px",x.zIndex="-1",x.visibility="hidden",x.pointerEvents="none"}y.font="".concat(c," ").concat(g," ").concat(d,"px ").concat(v);for(var w=0,_=0,E=e.split(` `),S=0;S1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var f=0;f=t.desktopTapThreshold2}var ar=u($);ct&&(t.hoverData.tapholdCancelled=!0);var Kt=function(){var Et=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Et.length===0?(Et.push(He[0]),Et.push(He[1])):(Et[0]+=He[0],Et[1]+=He[1])};ve=!0,a(De,["mousemove","vmousemove","tapdrag"],$,{x:ge[0],y:ge[1]});var br=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||oe.emit({originalEvent:$,type:"boxstart",position:{x:ge[0],y:ge[1]}}),Ve[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(ct){var Mr={originalEvent:$,type:"cxtdrag",position:{x:ge[0],y:ge[1]}};Ke?Ke.emit(Mr):oe.emit(Mr),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||De!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:$,type:"cxtdragout",position:{x:ge[0],y:ge[1]}}),t.hoverData.cxtOver=De,De&&De.emit({originalEvent:$,type:"cxtdragover",position:{x:ge[0],y:ge[1]}}))}}else if(t.hoverData.dragging){if(ve=!0,oe.panningEnabled()&&oe.userPanningEnabled()){var Pr;if(t.hoverData.justStartedPan){var Yr=t.hoverData.mdownPos;Pr={x:(ge[0]-Yr[0])*fe,y:(ge[1]-Yr[1])*fe},t.hoverData.justStartedPan=!1}else Pr={x:He[0]*fe,y:He[1]*fe};oe.panBy(Pr),oe.emit("dragpan"),t.hoverData.dragged=!0}ge=t.projectIntoViewport($.clientX,$.clientY)}else if(Ve[4]==1&&(Ke==null||Ke.pannable())){if(ct){if(!t.hoverData.dragging&&oe.boxSelectionEnabled()&&(ar||!oe.panningEnabled()||!oe.userPanningEnabled()))br();else if(!t.hoverData.selecting&&oe.panningEnabled()&&oe.userPanningEnabled()){var $r=o(Ke,t.hoverData.downs);$r&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ve[4]=0,t.data.bgActivePosistion=zu(Ee),t.redrawHint("select",!0),t.redraw())}Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate()}}else{if(Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate(),(!Ke||!Ke.grabbed())&&De!=$e&&($e&&a($e,["mouseout","tapdragout"],$,{x:ge[0],y:ge[1]}),De&&a(De,["mouseover","tapdragover"],$,{x:ge[0],y:ge[1]}),t.hoverData.last=De),Ke)if(ct){if(oe.boxSelectionEnabled()&&ar)Ke&&Ke.grabbed()&&(_(st),Ke.emit("freeon"),st.emit("free"),t.dragData.didDrag&&(Ke.emit("dragfreeon"),st.emit("dragfree"))),br();else if(Ke&&Ke.grabbed()&&t.nodeIsDraggable(Ke)){var Xt=!t.dragData.didDrag;Xt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||x(st,{inDragLayer:!0});var Vt={x:0,y:0};if(Re(He[0])&&Re(He[1])&&(Vt.x+=He[0],Vt.y+=He[1],Xt)){var At=t.hoverData.dragDelta;At&&Re(At[0])&&Re(At[1])&&(Vt.x+=At[0],Vt.y+=At[1])}t.hoverData.draggingEles=!0,st.silentShift(Vt).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Kt();ve=!0}if(Ve[2]=ge[0],Ve[3]=ge[1],ve)return $.stopPropagation&&$.stopPropagation(),$.preventDefault&&$.preventDefault(),!1}},!1);var B,D,N;t.registerBinding(e,"mouseup",function($){if(!(t.hoverData.which===1&&$.which!==1&&t.hoverData.capture)){var ue=t.hoverData.capture;if(ue){t.hoverData.capture=!1;var ve=t.cy,oe=t.projectIntoViewport($.clientX,$.clientY),fe=t.selection,Ce=t.findNearestElement(oe[0],oe[1],!0,!1),ge=t.dragData.possibleDragElements,Ee=t.hoverData.down,Ge=u($);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ee&&Ee.unactivate(),t.hoverData.which===3){var Ve={originalEvent:$,type:"cxttapend",position:{x:oe[0],y:oe[1]}};if(Ee?Ee.emit(Ve):ve.emit(Ve),!t.hoverData.cxtDragged){var De={originalEvent:$,type:"cxttap",position:{x:oe[0],y:oe[1]}};Ee?Ee.emit(De):ve.emit(De)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(Ce,["mouseup","tapend","vmouseup"],$,{x:oe[0],y:oe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(Ee,["click","tap","vclick"],$,{x:oe[0],y:oe[1]}),D=!1,$.timeStamp-N<=ve.multiClickDebounceTime()?(B&&clearTimeout(B),D=!0,N=null,a(Ee,["dblclick","dbltap","vdblclick"],$,{x:oe[0],y:oe[1]})):(B=setTimeout(function(){D||a(Ee,["oneclick","onetap","voneclick"],$,{x:oe[0],y:oe[1]})},ve.multiClickDebounceTime()),N=$.timeStamp)),Ee==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!u($)&&(ve.$(r).unselect(["tapunselect"]),ge.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ge=ve.collection()),Ce==Ee&&!t.dragData.didDrag&&!t.hoverData.selecting&&Ce!=null&&Ce._private.selectable&&(t.hoverData.dragging||(ve.selectionType()==="additive"||Ge?Ce.selected()?Ce.unselect(["tapunselect"]):Ce.select(["tapselect"]):Ge||(ve.$(r).unmerge(Ce).unselect(["tapunselect"]),Ce.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var $e=ve.collection(t.getAllInBox(fe[0],fe[1],fe[2],fe[3]));t.redrawHint("select",!0),$e.length>0&&t.redrawHint("eles",!0),ve.emit({type:"boxend",originalEvent:$,position:{x:oe[0],y:oe[1]}});var Ke=function(ct){return ct.selectable()&&!ct.selected()};ve.selectionType()==="additive"||Ge||ve.$(r).unmerge($e).unselect(),$e.emit("box").stdFilter(Ke).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!fe[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var He=Ee&&Ee.grabbed();_(ge),He&&(Ee.emit("freeon"),ge.emit("free"),t.dragData.didDrag&&(Ee.emit("dragfreeon"),ge.emit("dragfree")))}}fe[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var U=function($){if(!t.scrollingPage){var ue=t.cy,ve=ue.zoom(),oe=ue.pan(),fe=t.projectIntoViewport($.clientX,$.clientY),Ce=[fe[0]*ve+oe.x,fe[1]*ve+oe.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||A()){$.preventDefault();return}if(ue.panningEnabled()&&ue.userPanningEnabled()&&ue.zoomingEnabled()&&ue.userZoomingEnabled()){$.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var ge;$.deltaY!=null?ge=$.deltaY/-250:$.wheelDeltaY!=null?ge=$.wheelDeltaY/1e3:ge=$.wheelDelta/1e3,ge=ge*t.wheelSensitivity;var Ee=$.deltaMode===1;Ee&&(ge*=33);var Ge=ue.zoom()*Math.pow(10,ge);$.type==="gesturechange"&&(Ge=t.gestureStartZoom*$.scale),ue.zoom({level:Ge,renderedPosition:{x:Ce[0],y:Ce[1]}}),ue.emit($.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",U,!0),t.registerBinding(e,"scroll",function($){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function($){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||$.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(we){t.hasTouchStarted||U(we)},!0),t.registerBinding(t.container,"mouseout",function($){var ue=t.projectIntoViewport($.clientX,$.clientY);t.cy.emit({originalEvent:$,type:"mouseout",position:{x:ue[0],y:ue[1]}})},!1),t.registerBinding(t.container,"mouseover",function($){var ue=t.projectIntoViewport($.clientX,$.clientY);t.cy.emit({originalEvent:$,type:"mouseover",position:{x:ue[0],y:ue[1]}})},!1);var z,G,V,K,I,H,Q,te,Y,X,j,re,ie,ee=function($,ue,ve,oe){return Math.sqrt((ve-$)*(ve-$)+(oe-ue)*(oe-ue))},W=function($,ue,ve,oe){return(ve-$)*(ve-$)+(oe-ue)*(oe-ue)},J;t.registerBinding(t.container,"touchstart",J=function($){if(t.hasTouchStarted=!0,!!L($)){S(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var ue=t.cy,ve=t.touchData.now,oe=t.touchData.earlier;if($.touches[0]){var fe=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);ve[0]=fe[0],ve[1]=fe[1]}if($.touches[1]){var fe=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);ve[2]=fe[0],ve[3]=fe[1]}if($.touches[2]){var fe=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);ve[4]=fe[0],ve[5]=fe[1]}if($.touches[1]){t.touchData.singleTouchMoved=!0,_(t.dragData.touchDragEles);var Ce=t.findContainerClientCoords();Y=Ce[0],X=Ce[1],j=Ce[2],re=Ce[3],z=$.touches[0].clientX-Y,G=$.touches[0].clientY-X,V=$.touches[1].clientX-Y,K=$.touches[1].clientY-X,ie=0<=z&&z<=j&&0<=V&&V<=j&&0<=G&&G<=re&&0<=K&&K<=re;var ge=ue.pan(),Ee=ue.zoom();I=ee(z,G,V,K),H=W(z,G,V,K),Q=[(z+V)/2,(G+K)/2],te=[(Q[0]-ge.x)/Ee,(Q[1]-ge.y)/Ee];var Ge=200,Ve=Ge*Ge;if(H=1){for(var nr=t.touchData.startPosition=[null,null,null,null,null,null],_t=0;_t=t.touchTapThreshold2}if(ue&&t.touchData.cxt){$.preventDefault();var nr=$.touches[0].clientX-Y,_t=$.touches[0].clientY-X,Gt=$.touches[1].clientX-Y,zt=$.touches[1].clientY-X,ar=W(nr,_t,Gt,zt),Kt=ar/H,br=150,Mr=br*br,Pr=1.5,Yr=Pr*Pr;if(Kt>=Yr||ar>=Mr){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var $r={originalEvent:$,type:"cxttapend",position:{x:fe[0],y:fe[1]}};t.touchData.start?(t.touchData.start.unactivate().emit($r),t.touchData.start=null):oe.emit($r)}}if(ue&&t.touchData.cxt){var $r={originalEvent:$,type:"cxtdrag",position:{x:fe[0],y:fe[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit($r):oe.emit($r),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Xt=t.findNearestElement(fe[0],fe[1],!0,!0);(!t.touchData.cxtOver||Xt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:$,type:"cxtdragout",position:{x:fe[0],y:fe[1]}}),t.touchData.cxtOver=Xt,Xt&&Xt.emit({originalEvent:$,type:"cxtdragover",position:{x:fe[0],y:fe[1]}}))}else if(ue&&$.touches[2]&&oe.boxSelectionEnabled())$.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||oe.emit({originalEvent:$,type:"boxstart",position:{x:fe[0],y:fe[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,ve[4]=1,!ve||ve.length===0||ve[0]===void 0?(ve[0]=(fe[0]+fe[2]+fe[4])/3,ve[1]=(fe[1]+fe[3]+fe[5])/3,ve[2]=(fe[0]+fe[2]+fe[4])/3+1,ve[3]=(fe[1]+fe[3]+fe[5])/3+1):(ve[2]=(fe[0]+fe[2]+fe[4])/3,ve[3]=(fe[1]+fe[3]+fe[5])/3),t.redrawHint("select",!0),t.redraw();else if(ue&&$.touches[1]&&!t.touchData.didSelect&&oe.zoomingEnabled()&&oe.panningEnabled()&&oe.userZoomingEnabled()&&oe.userPanningEnabled()){$.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Vt=t.dragData.touchDragEles;if(Vt){t.redrawHint("drag",!0);for(var At=0;At0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var he;t.registerBinding(e,"touchcancel",he=function($){var ue=t.touchData.start;t.touchData.capture=!1,ue&&ue.unactivate()});var be,_e,Ne,Ae;if(t.registerBinding(e,"touchend",be=function($){var ue=t.touchData.start,ve=t.touchData.capture;if(ve)$.touches.length===0&&(t.touchData.capture=!1),$.preventDefault();else return;var oe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var fe=t.cy,Ce=fe.zoom(),ge=t.touchData.now,Ee=t.touchData.earlier;if($.touches[0]){var Ge=t.projectIntoViewport($.touches[0].clientX,$.touches[0].clientY);ge[0]=Ge[0],ge[1]=Ge[1]}if($.touches[1]){var Ge=t.projectIntoViewport($.touches[1].clientX,$.touches[1].clientY);ge[2]=Ge[0],ge[3]=Ge[1]}if($.touches[2]){var Ge=t.projectIntoViewport($.touches[2].clientX,$.touches[2].clientY);ge[4]=Ge[0],ge[5]=Ge[1]}ue&&ue.unactivate();var Ve;if(t.touchData.cxt){if(Ve={originalEvent:$,type:"cxttapend",position:{x:ge[0],y:ge[1]}},ue?ue.emit(Ve):fe.emit(Ve),!t.touchData.cxtDragged){var De={originalEvent:$,type:"cxttap",position:{x:ge[0],y:ge[1]}};ue?ue.emit(De):fe.emit(De)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!$.touches[2]&&fe.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var $e=fe.collection(t.getAllInBox(oe[0],oe[1],oe[2],oe[3]));oe[0]=void 0,oe[1]=void 0,oe[2]=void 0,oe[3]=void 0,oe[4]=0,t.redrawHint("select",!0),fe.emit({type:"boxend",originalEvent:$,position:{x:ge[0],y:ge[1]}});var Ke=function(Mr){return Mr.selectable()&&!Mr.selected()};$e.emit("box").stdFilter(Ke).select().emit("boxselect"),$e.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(ue!=null&&ue.unactivate(),$.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!$.touches[1]){if(!$.touches[0]){if(!$.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var He=t.dragData.touchDragEles;if(ue!=null){var st=ue._private.grabbed;_(He),t.redrawHint("drag",!0),t.redrawHint("eles",!0),st&&(ue.emit("freeon"),He.emit("free"),t.dragData.didDrag&&(ue.emit("dragfreeon"),He.emit("dragfree"))),a(ue,["touchend","tapend","vmouseup","tapdragout"],$,{x:ge[0],y:ge[1]}),ue.unactivate(),t.touchData.start=null}else{var ct=t.findNearestElement(ge[0],ge[1],!0,!0);a(ct,["touchend","tapend","vmouseup","tapdragout"],$,{x:ge[0],y:ge[1]})}var Nt=t.touchData.startPosition[0]-ge[0],nr=Nt*Nt,_t=t.touchData.startPosition[1]-ge[1],Gt=_t*_t,zt=nr+Gt,ar=zt*Ce*Ce;t.touchData.singleTouchMoved||(ue||fe.$(":selected").unselect(["tapunselect"]),a(ue,["tap","vclick"],$,{x:ge[0],y:ge[1]}),_e=!1,$.timeStamp-Ae<=fe.multiClickDebounceTime()?(Ne&&clearTimeout(Ne),_e=!0,Ae=null,a(ue,["dbltap","vdblclick"],$,{x:ge[0],y:ge[1]})):(Ne=setTimeout(function(){_e||a(ue,["onetap","voneclick"],$,{x:ge[0],y:ge[1]})},fe.multiClickDebounceTime()),Ae=$.timeStamp)),ue!=null&&!t.dragData.didDrag&&ue._private.selectable&&ar"u"){var Se=[],Te=function($){return{clientX:$.clientX,clientY:$.clientY,force:1,identifier:$.pointerId,pageX:$.pageX,pageY:$.pageY,radiusX:$.width/2,radiusY:$.height/2,screenX:$.screenX,screenY:$.screenY,target:$.target}},Be=function($){return{event:$,touch:Te($)}},Ue=function($){Se.push(Be($))},Oe=function($){for(var ue=0;ue0)return Q[0]}return null},y=Object.keys(g),x=0;x0?m:iO(u,o,e,r,n,a,s,f)},checkPoint:function(e,r,n,a,u,o,s,f){f=f==="auto"?Pi(a,u):f;var c=2*f;if(ha(e,r,this.points,o,s,a,u-c,[0,-1],n)||ha(e,r,this.points,o,s,a-c,u,[0,-1],n))return!0;var d=a/2+2*n,v=u/2+2*n,g=[o-d,s-v,o-d,s,o+d,s,o+d,s-v];return!!(Br(e,r,g)||Bi(e,r,c,c,o+a/2-f,s+u/2-f,n)||Bi(e,r,c,c,o-a/2+f,s+u/2-f,n))}}};va.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Rr(3,0)),this.generateRoundPolygon("round-triangle",Rr(3,0)),this.generatePolygon("rectangle",Rr(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Rr(5,0)),this.generateRoundPolygon("round-pentagon",Rr(5,0)),this.generatePolygon("hexagon",Rr(6,0)),this.generateRoundPolygon("round-hexagon",Rr(6,0)),this.generatePolygon("heptagon",Rr(7,0)),this.generateRoundPolygon("round-heptagon",Rr(7,0)),this.generatePolygon("octagon",Rr(8,0)),this.generateRoundPolygon("round-octagon",Rr(8,0));var n=new Array(20);{var a=e1(5,0),u=e1(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s=e.deqFastCost*C)break}else if(c){if(E>=e.deqCost*m||E>=e.deqAvgCost*g)break}else if(S>=e.deqNoDrawCost*Ag)break;var k=e.deq(n,w,x);if(k.length>0)for(var O=0;O0&&(e.onDeqd(n,y),!c&&e.shouldRedraw(n,y,w,x)&&u())},s=e.priority||R1;a.beforeRender(o,s(n))}}}},f6=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jf;Ja(this,t),this.idsByKey=new ca,this.keyForId=new ca,this.cachesByLvl=new ca,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return ei(t,[{key:"getIdsFor",value:function(r){r==null&&Mt("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new ju,n.set(r,a)),a}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),u=this.getKey(r);this.deleteIdForKey(a,n),this.addIdForKey(u,n),this.keyForId.set(n,u)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),u=this.getKey(r);return a!==u}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,a=this.lvls,u=n.get(r);return u||(u=new ca,n.set(r,u),a.push(r)),u}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var a=this.getKey(r),u=this.getCache(a,n);return u!=null&&this.updateKeyMappingFor(r),u}},{key:"getForCachedKey",value:function(r,n){var a=this.keyForId.get(r.id()),u=this.getCache(a,n);return u}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var a=this.getKey(r);return this.hasCache(a,n)}},{key:"setCache",value:function(r,n,a){a.key=r,this.getCachesAt(n).set(r,a)}},{key:"set",value:function(r,n,a){var u=this.getKey(r);this.setCache(u,n,a),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var a=this.getKey(r);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(a){return n.deleteCache(r,a)})}},{key:"invalidate",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(r);var u=this.doesEleInvalidateKey(r);return u&&this.invalidateKey(a),u||this.getNumberOfIdsForKey(a)===0}}])}(),lT=25,Cf=50,Vf=-4,v1=3,sq=7.99,c6=8,d6=1024,h6=1024,v6=1024,g6=.2,p6=.8,m6=10,y6=.15,b6=.1,w6=.9,x6=.9,_6=100,E6=1,Iu={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},S6=tr({getKey:null,doesEleInvalidateKey:jf,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Qk,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ps=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=S6(r);Fe(n,a),n.lookup=new f6(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},rr=ps.prototype;rr.reasons=Iu;rr.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};rr.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};rr.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Hs(function(r,n){return n.reqs-r.reqs});return e};rr.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};rr.getElement=function(t,e,r,n,a){var u=this,o=this.renderer,s=o.cy.zoom(),f=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!u.allowEdgeTxrCaching&&t.isEdge()||!u.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(M1(s*r))),n=sq||n>v1)return null;var c=Math.pow(2,n),d=e.h*c,v=e.w*c,g=o.eleTextBiggerThanMin(t,c);if(!this.isVisible(t,g))return null;var m=f.get(t,n);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var y;if(d<=lT?y=lT:d<=Cf?y=Cf:y=Math.ceil(d/Cf)*Cf,d>v6||v>h6)return null;var x=u.getTextureQueue(y),w=x[x.length-2],_=function(){return u.recycleTexture(y,v)||u.addTexture(y,v)};w||(w=x[x.length-1]),w||(w=_()),w.width-w.usedWidthn;R--)A=u.getElement(t,e,r,R,Iu.downscale);L()}else return u.queueElement(t,O.level-1),O;else{var B;if(!S&&!C&&!k)for(var D=n-1;D>=Vf;D--){var N=f.get(t,D);if(N){B=N;break}}if(E(B))return u.queueElement(t,n),B;w.context.translate(w.usedWidth,0),w.context.scale(c,c),this.drawElement(w.context,t,e,g,!1),w.context.scale(1/c,1/c),w.context.translate(-w.usedWidth,0)}return m={x:w.usedWidth,texture:w,level:n,scale:c,width:v,height:d,scaledLabelShown:g},w.usedWidth+=Math.ceil(v+c6),w.eleCaches.push(m),f.set(t,n,m),u.checkTextureFullness(w),m};rr.invalidateElements=function(t){for(var e=0;e=g6*t.width&&this.retireTexture(t)};rr.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>p6&&t.fullnessChecks>=m6?ja(r,t):t.fullnessChecks++};rr.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;ja(n,t),t.retired=!0;for(var u=t.eleCaches,o=0;o=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,D1(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),ja(a,o),n.push(o),o}};rr.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),u=this.getKey(t),o=a[u];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,n.updateItem(o);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:u};n.push(s),a[u]=s}};rr.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],u=e.lookup,o=0;o0;o++){var s=r.pop(),f=s.key,c=s.eles[0],d=u.hasCache(c,s.level);if(n[f]=null,d)continue;a.push(s);var v=e.getBoundingBox(c);e.getElement(c,v,t,s.level,Iu.dequeue)}return a};rr.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(t),u=n[a];u!=null&&(u.eles.length===1?(u.reqs=A1,r.updateItem(u),r.pop(),n[a]=null):u.eles.unmerge(t))};rr.onDequeue=function(t){this.onDequeues.push(t)};rr.offDequeue=function(t){ja(this.onDequeues,t)};rr.setupDequeueing=oq.setupDequeueing({deqRedrawThreshold:_6,deqCost:y6,deqAvgCost:b6,deqNoDrawCost:w6,deqFastCost:x6,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=C6||r>nc)return null}n.validateLayersElesOrdering(r,t);var f=n.layersByLevel,c=Math.pow(2,r),d=f[r]=f[r]||[],v,g=n.levelIsComplete(r,t),m,y=function(){var L=function(U){if(n.validateLayersElesOrdering(U,t),n.levelIsComplete(U,t))return m=f[U],!0},R=function(U){if(!m)for(var z=r+U;xs<=z&&z<=nc&&!L(z);z+=U);};R(1),R(-1);for(var B=d.length-1;B>=0;B--){var D=d[B];D.invalid&&ja(d,D)}};if(!g)y();else return d;var x=function(){if(!v){v=zr();for(var L=0;LcT||D>cT)return null;var N=B*D;if(N>B6)return null;var U=n.makeLayer(v,r);if(R!=null){var z=d.indexOf(R)+1;d.splice(z,0,U)}else(L.insert===void 0||L.insert)&&d.unshift(U);return U};if(n.skipping&&!s)return null;for(var _=null,E=t.length/T6,S=!s,C=0;C=E||!aO(_.bb,k.boundingBox()))&&(_=w({insert:!0,after:_}),!_))return null;m||S?n.queueLayer(_,k):n.drawEleInLayer(_,k,r,e),_.eles.push(k),q[r]=_}return m||(S?null:d)};yr.getEleLevelForLayerLevel=function(t,e){return t};yr.drawEleInLayer=function(t,e,r,n){var a=this,u=this.renderer,o=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),u.setImgSmoothing(o,!1),u.drawCachedElement(o,e,null,null,r,L6),u.setImgSmoothing(o,!0))};yr.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var a=0,u=0;u0||o.invalid)return!1;a+=o.eles.length}return a===e.length};yr.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e};yr.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=da(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,u){e.invalidateLayer(n)}))};yr.invalidateLayer=function(t){if(this.lastInvalidationTime=da(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];ja(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(u&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var f;r&&(f=r,t.translate(-f.x1,-f.y1));var c=u?e.pstyle("opacity").value:1,d=u?e.pstyle("line-opacity").value:1,v=e.pstyle("curve-style").value,g=e.pstyle("line-style").value,m=e.pstyle("width").pfValue,y=e.pstyle("line-cap").value,x=e.pstyle("line-outline-width").value,w=e.pstyle("line-outline-color").value,_=c*d,E=c*d,S=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;v==="straight-triangle"?(o.eleStrokeStyle(t,e,U),o.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=m,t.lineCap=y,o.eleStrokeStyle(t,e,U),o.drawEdgePath(e,t,s.allpts,g),t.lineCap="butt")},C=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;if(t.lineWidth=m+x,t.lineCap=y,x>0)o.colorStrokeStyle(t,w[0],w[1],w[2],U);else{t.lineCap="butt";return}v==="straight-triangle"?o.drawEdgeTrianglePath(e,t,s.allpts):(o.drawEdgePath(e,t,s.allpts,g),t.lineCap="butt")},k=function(){a&&o.drawEdgeOverlay(t,e)},O=function(){a&&o.drawEdgeUnderlay(t,e)},q=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E;o.drawArrowheads(t,e,U)},M=function(){o.drawElementText(t,e,null,n)};t.lineJoin="round";var A=e.pstyle("ghost").value==="yes";if(A){var L=e.pstyle("ghost-offset-x").pfValue,R=e.pstyle("ghost-offset-y").pfValue,B=e.pstyle("ghost-opacity").value,D=_*B;t.translate(L,R),S(D),q(D),t.translate(-L,-R)}else C();O(),S(),q(),k(),M(),r&&t.translate(f.x1,f.y1)}};var cq=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var u=this,o=u.usePaths(),s=n._private.rscratch,f=n.pstyle("".concat(e,"-padding")).pfValue,c=2*f,d=n.pstyle("".concat(e,"-color")).value;r.lineWidth=c,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",u.colorStrokeStyle(r,d[0],d[1],d[2],a),u.drawEdgePath(n,r,s.allpts,"solid")}}}};ga.drawEdgeOverlay=cq("overlay");ga.drawEdgeUnderlay=cq("underlay");ga.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,u=e,o,s=!1,f=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,d=t.pstyle("line-dash-offset").pfValue;if(f){var v=r.join("$"),g=a.pathCacheKey&&a.pathCacheKey===v;g?(o=e=a.pathCache,s=!0):(o=e=new Path2D,a.pathCacheKey=v,a.pathCache=o)}if(u.setLineDash)switch(n){case"dotted":u.setLineDash([1,1]);break;case"dashed":u.setLineDash(c),u.lineDashOffset=d;break;case"solid":u.setLineDash([]);break}if(!s&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+35&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(u&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var f=o.getLabelJustification(e);t.textAlign=f,t.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,d=e.pstyle("label"),v=e.pstyle("source-label"),g=e.pstyle("target-label");if(c||(!d||!d.value)&&(!v||!v.value)&&(!g||!g.value))return;t.textAlign="center",t.textBaseline="bottom"}var m=!r,y;r&&(y=r,t.translate(-y.x1,-y.y1)),a==null?(o.drawText(t,e,null,m,u),e.isEdge()&&(o.drawText(t,e,"source",m,u),o.drawText(t,e,"target",m,u))):o.drawText(t,e,a,m,u),r&&t.translate(y.x1,y.y1)};Hi.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",u=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,f=e.pstyle("text-outline-opacity").value*s,c=e.pstyle("color").value,d=e.pstyle("text-outline-color").value;t.font=n+" "+o+" "+a+" "+u,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],s),this.colorStrokeStyle(t,d[0],d[1],d[2],f)};function Dg(t,e,r,n,a){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+u,r),t.lineTo(e+n-u,r),t.quadraticCurveTo(e+n,r,e+n,r+u),t.lineTo(e+n,r+a-u),t.quadraticCurveTo(e+n,r+a,e+n-u,r+a),t.lineTo(e+u,r+a),t.quadraticCurveTo(e,r+a,e,r+a-u),t.lineTo(e,r+u),t.quadraticCurveTo(e,r,e+u,r),t.closePath(),o?t.stroke():t.fill()}Hi.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,u=e?e+"-":"",o=t.pstyle(u+"text-rotation");if(o.strValue==="autorotate"){var s=xn(a,"labelAngle",e);r=t.isEdge()?s:0}else o.strValue==="none"?r=0:r=o.pfValue;return r};Hi.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,u=e._private,o=u.rscratch,s=a?e.effectiveOpacity():1;if(!(a&&(s===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var f=xn(o,"labelX",r),c=xn(o,"labelY",r),d,v,g=this.getLabelText(e,r);if(g!=null&&g!==""&&!isNaN(f)&&!isNaN(c)){this.setupTextStyle(t,e,a);var m=r?r+"-":"",y=xn(o,"labelWidth",r),x=xn(o,"labelHeight",r),w=e.pstyle(m+"text-margin-x").pfValue,_=e.pstyle(m+"text-margin-y").pfValue,E=e.isEdge(),S=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;E&&(S="center",C="center"),f+=w,c+=_;var k;switch(n?k=this.getTextAngle(e,r):k=0,k!==0&&(d=f,v=c,t.translate(d,v),t.rotate(k),f=0,c=0),C){case"top":break;case"center":c+=x/2;break;case"bottom":c+=x;break}var O=e.pstyle("text-background-opacity").value,q=e.pstyle("text-border-opacity").value,M=e.pstyle("text-border-width").pfValue,A=e.pstyle("text-background-padding").pfValue,L=e.pstyle("text-background-shape").strValue,R=L.indexOf("round")===0,B=2;if(O>0||M>0&&q>0){var D=f-A;switch(S){case"left":D-=y;break;case"center":D-=y/2;break}var N=c-x-A,U=y+2*A,z=x+2*A;if(O>0){var G=t.fillStyle,V=e.pstyle("text-background-color").value;t.fillStyle="rgba("+V[0]+","+V[1]+","+V[2]+","+O*s+")",R?Dg(t,D,N,U,z,B):t.fillRect(D,N,U,z),t.fillStyle=G}if(M>0&&q>0){var K=t.strokeStyle,I=t.lineWidth,H=e.pstyle("text-border-color").value,Q=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+H[0]+","+H[1]+","+H[2]+","+q*s+")",t.lineWidth=M,t.setLineDash)switch(Q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=M/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(R?Dg(t,D,N,U,z,B,"stroke"):t.strokeRect(D,N,U,z),Q==="double"){var te=M/2;R?Dg(t,D+te,N+te,U-te*2,z-te*2,B,"stroke"):t.strokeRect(D+te,N+te,U-te*2,z-te*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=I,t.strokeStyle=K}}var Y=2*e.pstyle("text-outline-width").pfValue;if(Y>0&&(t.lineWidth=Y),e.pstyle("text-wrap").value==="wrap"){var X=xn(o,"labelWrapCachedLines",r),j=xn(o,"labelLineHeight",r),re=y/2,ie=this.getLabelJustification(e);switch(ie==="auto"||(S==="left"?ie==="left"?f+=-y:ie==="center"&&(f+=-re):S==="center"?ie==="left"?f+=-re:ie==="right"&&(f+=re):S==="right"&&(ie==="center"?f+=re:ie==="right"&&(f+=y))),C){case"top":c-=(X.length-1)*j;break;case"center":case"bottom":c-=(X.length-1)*j;break}for(var ee=0;ee0&&t.strokeText(X[ee],f,c),t.fillText(X[ee],f,c),c+=j}else Y>0&&t.strokeText(g,f,c),t.fillText(g,f,c);k!==0&&(t.rotate(-k),t.translate(-d,-v))}}};var to={};to.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,f,c=e._private,d=c.rscratch,v=e.position();if(!(!Re(v.x)||!Re(v.y))&&!(u&&!e.visible())){var g=u?e.effectiveOpacity():1,m=o.usePaths(),y,x=!1,w=e.padding();s=e.width()+2*w,f=e.height()+2*w;var _;r&&(_=r,t.translate(-_.x1,-_.y1));for(var E=e.pstyle("background-image"),S=E.value,C=new Array(S.length),k=new Array(S.length),O=0,q=0;q0&&arguments[0]!==void 0?arguments[0]:D;o.eleFillStyle(t,e,oe)},ee=function(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;o.colorStrokeStyle(t,N[0],N[1],N[2],oe)},W=function(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:X;o.colorStrokeStyle(t,te[0],te[1],te[2],oe)},J=function(oe,fe,Ce,ge){var Ee=o.nodePathCache=o.nodePathCache||[],Ge=Zk(Ce==="polygon"?Ce+","+ge.join(","):Ce,""+fe,""+oe,""+re),Ve=Ee[Ge],De,$e=!1;return Ve!=null?(De=Ve,$e=!0,d.pathCache=De):(De=new Path2D,Ee[Ge]=d.pathCache=De),{path:De,cacheHit:$e}},ce=e.pstyle("shape").strValue,he=e.pstyle("shape-polygon-points").pfValue;if(m){t.translate(v.x,v.y);var be=J(s,f,ce,he);y=be.path,x=be.cacheHit}var _e=function(){if(!x){var oe=v;m&&(oe={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(y||t,oe.x,oe.y,s,f,re,d)}m?t.fill(y):t.fill()},Ne=function(){for(var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g,fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Ce=c.backgrounding,ge=0,Ee=0;Ee0&&arguments[0]!==void 0?arguments[0]:!1,fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g;o.hasPie(e)&&(o.drawPie(t,e,fe),oe&&(m||o.nodeShapes[o.getNodeShape(e)].draw(t,v.x,v.y,s,f,re,d)))},Se=function(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g,fe=(R>0?R:-R)*oe,Ce=R>0?0:255;R!==0&&(o.colorFillStyle(t,Ce,Ce,Ce,fe),m?t.fill(y):t.fill())},Te=function(){if(B>0){if(t.lineWidth=B,t.lineCap=G,t.lineJoin=z,t.setLineDash)switch(U){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(K),t.lineDashOffset=I;break;case"solid":case"double":t.setLineDash([]);break}if(V!=="center"){if(t.save(),t.lineWidth*=2,V==="inside")m?t.clip(y):t.clip();else{var oe=new Path2D;oe.rect(-s/2-B,-f/2-B,s+2*B,f+2*B),oe.addPath(y),t.clip(oe,"evenodd")}m?t.stroke(y):t.stroke(),t.restore()}else m?t.stroke(y):t.stroke();if(U==="double"){t.lineWidth=B/3;var fe=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(y):t.stroke(),t.globalCompositeOperation=fe}t.setLineDash&&t.setLineDash([])}},Be=function(){if(Q>0){if(t.lineWidth=Q,t.lineCap="butt",t.setLineDash)switch(Y){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var oe=v;m&&(oe={x:0,y:0});var fe=o.getNodeShape(e),Ce=B;V==="inside"&&(Ce=0),V==="outside"&&(Ce*=2);var ge=(s+Ce+(Q+j))/s,Ee=(f+Ce+(Q+j))/f,Ge=s*ge,Ve=f*Ee,De=o.nodeShapes[fe].points,$e;if(m){var Ke=J(Ge,Ve,fe,De);$e=Ke.path}if(fe==="ellipse")o.drawEllipsePath($e||t,oe.x,oe.y,Ge,Ve);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(fe)){var He=0,st=0,ct=0;fe==="round-diamond"?He=(Ce+j+Q)*1.4:fe==="round-heptagon"?(He=(Ce+j+Q)*1.075,ct=-(Ce/2+j+Q)/35):fe==="round-hexagon"?He=(Ce+j+Q)*1.12:fe==="round-pentagon"?(He=(Ce+j+Q)*1.13,ct=-(Ce/2+j+Q)/15):fe==="round-tag"?(He=(Ce+j+Q)*1.12,st=(Ce/2+Q+j)*.07):fe==="round-triangle"&&(He=(Ce+j+Q)*(Math.PI/2),ct=-(Ce+j/2+Q)/Math.PI),He!==0&&(ge=(s+He)/s,Ge=s*ge,["round-hexagon","round-tag"].includes(fe)||(Ee=(f+He)/f,Ve=f*Ee)),re=re==="auto"?oO(Ge,Ve):re;for(var Nt=Ge/2,nr=Ve/2,_t=re+(Ce+Q+j)/2,Gt=new Array(De.length/2),zt=new Array(De.length/2),ar=0;ar0){if(a=a||n.position(),u==null||o==null){var m=n.padding();u=n.width()+2*m,o=n.height()+2*m}s.colorFillStyle(r,d[0],d[1],d[2],c),s.nodeShapes[v].draw(r,a.x,a.y,u+f*2,o+f*2,g),r.fill()}}}};to.drawNodeOverlay=dq("overlay");to.drawNodeUnderlay=dq("underlay");to.hasPie=function(t){return t=t[0],t._private.hasPie};to.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),u=e.pstyle("pie-size"),o=n.x,s=n.y,f=e.width(),c=e.height(),d=Math.min(f,c)/2,v=0,g=this.usePaths();g&&(o=0,s=0),u.units==="%"?d=d*u.pfValue:u.pfValue!==void 0&&(d=u.pfValue/2);for(var m=1;m<=a.pieBackgroundN;m++){var y=e.pstyle("pie-"+m+"-background-size").value,x=e.pstyle("pie-"+m+"-background-color").value,w=e.pstyle("pie-"+m+"-background-opacity").value*r,_=y/100;_+v>1&&(_=1-v);var E=1.5*Math.PI+2*Math.PI*v,S=2*Math.PI*_,C=E+S;y===0||v>=1||v+_>1||(t.beginPath(),t.moveTo(o,s),t.arc(o,s,d,E,C),t.closePath(),this.colorFillStyle(t,x[0],x[1],x[2],w),t.fill(),v+=_)}};var Dr={},$6=100;Dr.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Dr.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,a=0;ae.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!v&&(d[e.NODE]=!0,d[e.SELECT_BOX]=!0);var E=r.style(),S=r.zoom(),C=o!==void 0?o:S,k=r.pan(),O={x:k.x,y:k.y},q={zoom:S,pan:{x:k.x,y:k.y}},M=e.prevViewport,A=M===void 0||q.zoom!==M.zoom||q.pan.x!==M.pan.x||q.pan.y!==M.pan.y;!A&&!(x&&!y)&&(e.motionBlurPxRatio=1),s&&(O=s),C*=f,O.x*=f,O.y*=f;var L=e.getCachedZSortedEles();function R(ee,W,J,ce,he){var be=ee.globalCompositeOperation;ee.globalCompositeOperation="destination-out",e.colorFillStyle(ee,255,255,255,e.motionBlurTransparency),ee.fillRect(W,J,ce,he),ee.globalCompositeOperation=be}function B(ee,W){var J,ce,he,be;!e.clearingMotionBlur&&(ee===c.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||ee===c.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(J={x:k.x*m,y:k.y*m},ce=S*m,he=e.canvasWidth*m,be=e.canvasHeight*m):(J=O,ce=C,he=e.canvasWidth,be=e.canvasHeight),ee.setTransform(1,0,0,1,0,0),W==="motionBlur"?R(ee,0,0,he,be):!n&&(W===void 0||W)&&ee.clearRect(0,0,he,be),a||(ee.translate(J.x,J.y),ee.scale(ce,ce)),s&&ee.translate(s.x,s.y),o&&ee.scale(o,o)}if(v||(e.textureDrawLastFrame=!1),v){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var D=e.data.bufferContexts[e.TEXTURE_BUFFER];D.setTransform(1,0,0,1,0,0),D.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:D,drawOnlyNodeLayer:!0,forcedPxRatio:f*e.textureMult});var q=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};q.mpan={x:(0-q.pan.x)/q.zoom,y:(0-q.pan.y)/q.zoom}}d[e.DRAG]=!1,d[e.NODE]=!1;var N=c.contexts[e.NODE],U=e.textureCache.texture,q=e.textureCache.viewport;N.setTransform(1,0,0,1,0,0),g?R(N,0,0,q.width,q.height):N.clearRect(0,0,q.width,q.height);var z=E.core("outside-texture-bg-color").value,G=E.core("outside-texture-bg-opacity").value;e.colorFillStyle(N,z[0],z[1],z[2],G),N.fillRect(0,0,q.width,q.height);var S=r.zoom();B(N,!1),N.clearRect(q.mpan.x,q.mpan.y,q.width/q.zoom/f,q.height/q.zoom/f),N.drawImage(U,q.mpan.x,q.mpan.y,q.width/q.zoom/f,q.height/q.zoom/f)}else e.textureOnViewport&&!n&&(e.textureCache=null);var V=r.extent(),K=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),I=e.hideEdgesOnViewport&&K,H=[];if(H[e.NODE]=!d[e.NODE]&&g&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,H[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),H[e.DRAG]=!d[e.DRAG]&&g&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,H[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),d[e.NODE]||a||u||H[e.NODE]){var Q=g&&!H[e.NODE]&&m!==1,N=n||(Q?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:c.contexts[e.NODE]),te=g&&!Q?"motionBlur":void 0;B(N,te),I?e.drawCachedNodes(N,L.nondrag,f,V):e.drawLayeredElements(N,L.nondrag,f,V),e.debug&&e.drawDebugPoints(N,L.nondrag),!a&&!g&&(d[e.NODE]=!1)}if(!u&&(d[e.DRAG]||a||H[e.DRAG])){var Q=g&&!H[e.DRAG]&&m!==1,N=n||(Q?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:c.contexts[e.DRAG]);B(N,g&&!Q?"motionBlur":void 0),I?e.drawCachedNodes(N,L.drag,f,V):e.drawCachedElements(N,L.drag,f,V),e.debug&&e.drawDebugPoints(N,L.drag),!a&&!g&&(d[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,B),g&&m!==1){var Y=c.contexts[e.NODE],X=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],j=c.contexts[e.DRAG],re=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ie=function(W,J,ce){W.setTransform(1,0,0,1,0,0),ce||!_?W.clearRect(0,0,e.canvasWidth,e.canvasHeight):R(W,0,0,e.canvasWidth,e.canvasHeight);var he=m;W.drawImage(J,0,0,e.canvasWidth*he,e.canvasHeight*he,0,0,e.canvasWidth,e.canvasHeight)};(d[e.NODE]||H[e.NODE])&&(ie(Y,X,H[e.NODE]),d[e.NODE]=!1),(d[e.DRAG]||H[e.DRAG])&&(ie(j,re,H[e.DRAG]),d[e.DRAG]=!1)}e.prevViewport=q,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),g&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!v,e.mbFrames=0,d[e.NODE]=!0,d[e.DRAG]=!0,e.redraw()},$6)),n||r.emit("render")};var ss;Dr.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,a=r.data,u=n.style(),o=t.drawOnlyNodeLayer,s=t.drawAllLayers,f=a.canvasNeedsRedraw,c=t.forcedContext;if(r.showFps||!o&&f[r.SELECT_BOX]&&!s){var d=c||a.contexts[r.SELECT_BOX];if(e(d),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var v=r.cy.zoom(),g=u.core("selection-box-border-width").value/v;d.lineWidth=g,d.fillStyle="rgba("+u.core("selection-box-color").value[0]+","+u.core("selection-box-color").value[1]+","+u.core("selection-box-color").value[2]+","+u.core("selection-box-opacity").value+")",d.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),g>0&&(d.strokeStyle="rgba("+u.core("selection-box-border-color").value[0]+","+u.core("selection-box-border-color").value[1]+","+u.core("selection-box-border-color").value[2]+","+u.core("selection-box-opacity").value+")",d.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(a.bgActivePosistion&&!r.hoverData.selecting){var v=r.cy.zoom(),m=a.bgActivePosistion;d.fillStyle="rgba("+u.core("active-bg-color").value[0]+","+u.core("active-bg-color").value[1]+","+u.core("active-bg-color").value[2]+","+u.core("active-bg-opacity").value+")",d.beginPath(),d.arc(m.x,m.y,u.core("active-bg-size").pfValue/v,0,2*Math.PI),d.fill()}var y=r.lastRedrawTime;if(r.showFps&&y){y=Math.round(y);var x=Math.round(1e3/y),w="1 frame = "+y+" ms = "+x+" fps";if(d.setTransform(1,0,0,1,0,0),d.fillStyle="rgba(255, 0, 0, 0.75)",d.strokeStyle="rgba(255, 0, 0, 0.75)",d.font="30px Arial",!ss){var _=d.measureText(w);ss=_.actualBoundingBoxAscent}d.fillText(w,0,ss);var E=60;d.strokeRect(0,ss+10,250,20),d.fillRect(0,ss+10,250*Math.min(x/E,1),20)}s||(f[r.SELECT_BOX]=!1)}};function gT(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function K6(t,e,r){var n=gT(t,t.VERTEX_SHADER,e),a=gT(t,t.FRAGMENT_SHADER,r),u=t.createProgram();if(t.attachShader(u,n),t.attachShader(u,a),t.linkProgram(u),!t.getProgramParameter(u,t.LINK_STATUS))throw new Error("Could not initialize shaders");return u}function X6(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),a=n.context=n.getContext("2d");return n.clear=function(){return a.clearRect(0,0,n.width,n.height)},n.clear(),n}function $1(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function j6(t,e,r,n,a){var u=n*r+e.x,o=a*r+e.y;return o=Math.round(t.canvasHeight-o),[u,o]}function ls(t,e,r){var n=t[0]/255,a=t[1]/255,u=t[2]/255,o=e,s=r||new Array(4);return s[0]=n*o,s[1]=a*o,s[2]=u*o,s[3]=o,s}function Mu(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function Z6(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function Q6(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function hq(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function vq(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function W6(t,e,r,n,a,u){switch(e){case t.FLOAT:return new Float32Array(r.buffer,u*n,a);case t.INT:return new Int32Array(r.buffer,u*n,a)}}function J6(t,e,r,n){var a=hq(t,e),u=lr(a,2),o=u[0],s=u[1],f=vq(t,s,n),c=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,f,t.STATIC_DRAW),s===t.FLOAT?t.vertexAttribPointer(r,o,s,!1,0,0):s===t.INT&&t.vertexAttribIPointer(r,o,s,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),c}function Ga(t,e,r,n){var a=hq(t,r),u=lr(a,3),o=u[0],s=u[1],f=u[2],c=vq(t,s,e*o),d=o*f,v=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,e*d,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),s===t.FLOAT?t.vertexAttribPointer(n,o,s,!1,d,0):s===t.INT&&t.vertexAttribIPointer(n,o,s,d,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var g=new Array(e),m=0;mo&&(s=o/n,f=n*s,c=a*s),{scale:s,texW:f,texH:c}}},{key:"draw",value:function(r,n,a){var u=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,f=this.texHeight,c=this.getScale(n),d=c.scale,v=c.texW,g=c.texH,m=[null,null],y=function(S,C){if(a&&C){var k=C.context,O=S.x,q=S.row,M=O,A=f*q;k.save(),k.translate(M,A),k.scale(d,d),a(k,n),k.restore()}},x=function(){y(u.freePointer,u.canvas),m[0]={x:u.freePointer.x,y:u.freePointer.row*f,w:v,h:g},m[1]={x:u.freePointer.x+v,y:u.freePointer.row*f,w:0,h:g},u.freePointer.x+=v,u.freePointer.x==o&&(u.freePointer.x=0,u.freePointer.row++)},w=function(){var S=u.scratch,C=u.canvas;S.clear(),y({x:0,row:0},S);var k=o-u.freePointer.x,O=v-k,q=f;{var M=u.freePointer.x,A=u.freePointer.row*f,L=k;C.context.drawImage(S,0,0,L,q,M,A,L,q),m[0]={x:M,y:A,w:L,h:g}}{var R=k,B=(u.freePointer.row+1)*f,D=O;C&&C.context.drawImage(S,R,0,D,q,0,B,D,q),m[1]={x:0,y:B,w:D,h:g}}u.freePointer.x=O,u.freePointer.row++},_=function(){u.freePointer.x=0,u.freePointer.row++};if(this.freePointer.x+v<=o)x();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(_(),x()):this.enableWrapping?w():(_(),x())}return this.keyToLocation.set(r,m),this.needsBuffer=!0,m}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,a=this.texRows,u=this.getScale(r),o=u.texW;return this.freePointer.x+o>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=n.forceRedraw,u=a===void 0?!1:a,o=n.filterEle,s=o===void 0?function(){return!0}:o,f=n.filterType,c=f===void 0?function(){return!0}:f,d=!1,v=!1,g=En(r),m;try{for(g.s();!(m=g.n()).done;){var y=m.value;if(s(y)){var x=En(this.renderTypes.values()),w;try{for(x.s();!(w=x.n()).done;){var _=w.value,E=_.type;if(c(E)){var S=_.getKey(y),C=this.collections.get(_.collection);if(u)C.markKeyForGC(S),v=!0;else{var k=_.getID?_.getID(y):y.id(),O=this._key(E,k),q=this.typeAndIdToKey.get(O);q!==void 0&&q!==S&&(this.typeAndIdToKey.delete(O),C.markKeyForGC(q),d=!0)}}}}catch(M){x.e(M)}finally{x.f()}}}}catch(M){g.e(M)}finally{g.f()}return v&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=En(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;a.gc()}}catch(u){r.e(u)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,a){var u=this.renderTypes.get(n),o=u.getKey(r);a||(a=u.getBoundingBox(r));var s=this.collections.get(u.collection),f=!1,c=s.draw(o,a,function(g){u.drawElement(g,r,a,!0,!0),f=!0});if(f){var d=u.getID?u.getID(r):r.id(),v=this._key(n,d);this.typeAndIdToKey.set(v,o)}return c}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r,n){if(this.batchAtlases.length===this.maxAtlasesPerBatch){var a=this.renderTypes.get(n),u=a.getKey(r),o=this.collections.get(a.collection),s=o.getAtlas(u);return!!s&&this.batchAtlases.includes(s)}return!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)return;this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"getAtlasInfo",value:function(r,n){var a=this.renderTypes.get(n),u=a.getBoundingBox(r),o=this.getOrCreateAtlas(r,n,u),s=this.getAtlasIndexForBatch(o);if(s!==void 0){var f=a.getKey(r),c=o.getOffsets(f),d=lr(c,2),v=d[0],g=d[1];return{index:s,tex1:v,tex2:g,bb:u}}}},{key:"setTransformMatrix",value:function(r,n,a,u){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=this.getRenderTypeOpts(a),f=s.getPadding?s.getPadding(r):0;if(u){var c=u.bb,d=u.tex1,v=u.tex2,g=d.w/(d.w+v.w);o||(g=1-g);var m=this.getAdjustedBB(c,f,o,g);this._applyTransformMatrix(n,m,s,r)}else{var y=s.getBoundingBox(r),x=this.getAdjustedBB(y,f,!0,1);this._applyTransformMatrix(n,x,s,r)}}},{key:"_applyTransformMatrix",value:function(r,n,a,u){var o,s;gq(r);var f=a.getRotation?a.getRotation(u):0;if(f!==0){var c=a.getRotationPoint(u),d=c.x,v=c.y;ac(r,r,[d,v]),pq(r,r,f);var g=a.getRotationOffset(u);o=g.x+n.xOffset,s=g.y}else o=n.x1,s=n.y1;ac(r,r,[o,s]),K1(r,r,[n.w,n.h])}},{key:"getAdjustedBB",value:function(r,n,a,u){var o=r.x1,s=r.y1,f=r.w,c=r.h;n&&(o-=n,s-=n,f+=2*n,c+=2*n);var d=0,v=f*u;return a&&u<1?f=v:!a&&u<1&&(d=f-v,o+=d,f=v),{x1:o,y1:s,w:f,h:c,xOffset:d}}},{key:"getDebugInfo",value:function(){var r=[],n=En(this.collections),a;try{for(n.s();!(a=n.n()).done;){var u=lr(a.value,2),o=u[0],s=u[1],f=s.getCounts(),c=f.keyCount,d=f.atlasCount;r.push({type:o,keyCount:c,atlasCount:d})}}catch(v){n.e(v)}finally{n.f()}return r}}])}(),Af=0,yT=1,bT=2,Mg=3,wT=4,s8=function(){function t(e,r,n){Ja(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=X6,this.atlasManager=new o8(e,n),this.program=this.createShaderProgram(_s.SCREEN),this.pickingProgram=this.createShaderProgram(_s.PICKING),this.vao=this.createVAO()}return ei(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.type,u=this.atlasManager;return a?u.invalidate(r,{filterType:function(s){return s===a},forceRedraw:!0}):u.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"createShaderProgram",value:function(r){var n=this.gl,a=`#version 300 es precision highp float; uniform mat3 uPanZoomMatrix; uniform int uAtlasSize; // instanced in vec2 aPosition; in mat3 aTransform; // what are we rendering? in int aVertType; // for picking in vec4 aIndex; // For textures in int aAtlasId; // which shader unit/atlas to use in vec4 aTex; // x/y/w/h of texture in atlas // for edges in vec4 aPointAPointB; in vec4 aPointCPointD; in float aLineWidth; in vec4 aColor; out vec2 vTexCoord; out vec4 vColor; flat out int vAtlasId; flat out vec4 vIndex; flat out int vVertType; void main(void) { int vid = gl_VertexID; vec2 position = aPosition; if(aVertType == `.concat(Af,`) { float texX = aTex.x; float texY = aTex.y; float texW = aTex.z; float texH = aTex.w; int vid = gl_VertexID; if(vid == 1 || vid == 2 || vid == 4) { texX += texW; } if(vid == 2 || vid == 4 || vid == 5) { texY += texH; } float d = float(uAtlasSize); vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1 gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } else if(aVertType == `).concat(wT,`) { gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); vColor = aColor; } else if(aVertType == `).concat(yT,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; // adjust the geometry so that the line is centered on the edge position.y = position.y - 0.5; vec2 xBasis = target - source; vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x)); vec2 point = source + xBasis * position.x + yBasis * aLineWidth * position.y; gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; } else if(aVertType == `).concat(bT,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; vec2 pointD = aPointCPointD.zw; // adjust the geometry so that the line is centered on the edge position.y = position.y - 0.5; vec2 p0 = pointA; vec2 p1 = pointB; vec2 p2 = pointC; vec2 pos = position; if(position.x == 1.0) { p0 = pointD; p1 = pointC; p2 = pointB; pos = vec2(0.0, -position.y); } vec2 p01 = p1 - p0; vec2 p12 = p2 - p1; vec2 p21 = p1 - p2; // Find the normal vector. vec2 tangent = normalize(normalize(p12) + normalize(p01)); vec2 normal = vec2(-tangent.y, tangent.x); // Find the vector perpendicular to p0 -> p1. vec2 p01Norm = normalize(vec2(-p01.y, p01.x)); // Determine the bend direction. float sigma = sign(dot(p01 + p21, normal)); float width = aLineWidth; if(sign(pos.y) == -sigma) { // This is an intersecting vertex. Adjust the position so that there's no overlap. vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm); gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); } else { // This is a non-intersecting vertex. Treat it like a mitre join. vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm); gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0); } vColor = aColor; } else if(aVertType == `).concat(Mg,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) position = vec2(-0.15, -0.3); if(vid == 1) position = vec2( 0.0, 0.0); if(vid == 2) position = vec2( 0.15, -0.3); gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); vColor = aColor; } else { gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space } vAtlasId = aAtlasId; vIndex = aIndex; vVertType = aVertType; } `),u=this.atlasManager.getIndexArray(),o=`#version 300 es precision highp float; // define texture unit for each node in the batch `.concat(u.map(function(c){return"uniform sampler2D uTexture".concat(c,";")}).join(` `),` uniform vec4 uBGColor; in vec2 vTexCoord; in vec4 vColor; flat in int vAtlasId; flat in vec4 vIndex; flat in int vVertType; out vec4 outColor; void main(void) { if(vVertType == `).concat(Af,`) { `).concat(u.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(` else `),` } else if(vVertType == `).concat(Mg,`) { // blend arrow color with background (using premultiplied alpha) outColor.rgb = vColor.rgb + (uBGColor.rgb * (1.0 - vColor.a)); outColor.a = 1.0; // make opaque, masks out line under arrow } else { outColor = vColor; } `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } `),s=K6(n,a,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uTextures=[];for(var f=0;f1&&arguments[1]!==void 0?arguments[1]:_s.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.rectangleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.atlasManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"getTempMatrix",value:function(){return this.tempMatrix=this.tempMatrix||Hf()}},{key:"drawTexture",value:function(r,n,a){var u=this.atlasManager;if(r.visible()&&u.getRenderTypeOpts(a).isVisible(r)){u.canAddToCurrentBatch(r,a)||this.endBatch(),this.instanceCount+1>=this.maxInstances&&this.endBatch();var o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=Af;var s=this.indexBuffer.getView(o);Mu(n,s);var f=u.getAtlasInfo(r,a),c=f.index,d=f.tex1,v=f.tex2;v.w>0&&this.wrappedCount++;for(var g=!0,m=0,y=[d,v];m=this.maxInstances&&this.endBatch()}}},{key:"drawSimpleRectangle",value:function(r,n,a){if(r.visible()){var u=this.atlasManager,o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=wT;var s=this.indexBuffer.getView(o);Mu(n,s);var f=r.pstyle("background-color").value,c=r.pstyle("background-opacity").value,d=this.colorBuffer.getView(o);ls(f,c,d);var v=this.transformBuffer.getMatrixView(o);u.setTransformMatrix(r,v,a),this.rectangleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"drawEdgeArrow",value:function(r,n,a){if(r.visible()){var u=r._private.rscratch,o,s,f;if(a==="source"?(o=u.arrowStartX,s=u.arrowStartY,f=u.srcArrowAngle):(o=u.arrowEndX,s=u.arrowEndY,f=u.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(f)||f==null)){var c=r.pstyle(a+"-arrow-shape").value;if(c!=="none"){var d=r.pstyle(a+"-arrow-color").value,v=r.pstyle("opacity").value,g=r.pstyle("line-opacity").value,m=v*g,y=r.pstyle("width").pfValue,x=r.pstyle("arrow-scale").value,w=this.r.getArrowWidth(y,x),_=this.instanceCount,E=this.transformBuffer.getMatrixView(_);gq(E),ac(E,E,[o,s]),K1(E,E,[w,w]),pq(E,E,f),this.vertTypeBuffer.getView(_)[0]=Mg;var S=this.indexBuffer.getView(_);Mu(n,S);var C=this.colorBuffer.getView(_);ls(d,m,C),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var a=this.getEdgePoints(r);if(a){var u=r.pstyle("opacity").value,o=r.pstyle("line-opacity").value,s=r.pstyle("width").pfValue,f=r.pstyle("line-color").value,c=u*o;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var d=this.instanceCount;this.vertTypeBuffer.getView(d)[0]=yT;var v=this.indexBuffer.getView(d);Mu(n,v);var g=this.colorBuffer.getView(d);ls(f,c,g);var m=this.lineWidthBuffer.getView(d);m[0]=s;var y=this.pointAPointBBuffer.getView(d);y[0]=a[0],y[1]=a[1],y[2]=a[2],y[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var x=0;x=this.maxInstances&&this.endBatch()}}}}},{key:"getEdgePoints",value:function(r){var n=r._private.rscratch;if(!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))){var a=n.allpts;if(a.length==4)return a;var u=this.getNumSegments(r);return this.getCurveSegmentPoints(a,u)}}},{key:"getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var a=Array((n+1)*2),u=0;u<=n;u++)if(u==0)a[0]=r[0],a[1]=r[1];else if(u==n)a[u*2]=r[r.length-2],a[u*2+1]=r[r.length-1];else{var o=u/n;this.setCurvePoint(r,o,a,u*2)}return a}},{key:"setCurvePoint",value:function(r,n,a,u){if(r.length<=2)a[u]=r[0],a[u+1]=r[1];else{for(var o=Array(r.length-2),s=0;s0}},{key:"getStyle",value:function(r,n){var a=n.pstyle("".concat(r,"-opacity")).value,u=n.pstyle("".concat(r,"-color")).value,o=n.pstyle("".concat(r,"-shape")).value;return{opacity:a,color:u,shape:o}}},{key:"getPadding",value:function(r,n){return n.pstyle("".concat(r,"-padding")).pfValue}},{key:"draw",value:function(r,n,a,u){if(this.isVisible(r,a)){var o=this.r,s=u.w,f=u.h,c=s/2,d=f/2,v=this.getStyle(r,a),g=v.shape,m=v.color,y=v.opacity;n.save(),n.fillStyle=xT(m,y),g==="round-rectangle"||g==="roundrectangle"?o.drawRoundRectanglePath(n,c,d,s,f,"auto"):g==="ellipse"&&o.drawEllipsePath(n,c,d,s,f),n.fill(),n.restore()}}}])}(),mq={};mq.initWebgl=function(t,e){var r=this,n=r.data.contexts[r.WEBGL];t.bgColor=f8(r),t.webglTexSize=Math.min(t.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=t8(n),r.pickingFrameBuffer.needsDraw=!0;var a=function(c){return function(d){return r.getTextAngle(d,c)}},u=function(c){return function(d){var v=d.pstyle(c);return v&&v.value}};r.drawing=new s8(r,n,t);var o=new l8(r);r.drawing.addAtlasCollection("node",mT({texRows:t.webglTexRowsNodes})),r.drawing.addAtlasCollection("label",mT({texRows:t.webglTexRows})),r.drawing.addAtlasRenderType("node-body",ku({collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement})),r.drawing.addAtlasRenderType("label",ku({collection:"label",getKey:e.getLabelKey,getBoundingBox:e.getLabelBox,drawElement:e.drawLabel,getRotation:a(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:u("label")})),r.drawing.addAtlasRenderType("node-overlay",ku({collection:"node",getBoundingBox:e.getElementBox,getKey:function(c){return o.getStyleKey("overlay",c)},drawElement:function(c,d,v){return o.draw("overlay",c,d,v)},isVisible:function(c){return o.isVisible("overlay",c)},getPadding:function(c){return o.getPadding("overlay",c)}})),r.drawing.addAtlasRenderType("node-underlay",ku({collection:"node",getBoundingBox:e.getElementBox,getKey:function(c){return o.getStyleKey("underlay",c)},drawElement:function(c,d,v){return o.draw("underlay",c,d,v)},isVisible:function(c){return o.isVisible("underlay",c)},getPadding:function(c){return o.getPadding("underlay",c)}})),r.drawing.addAtlasRenderType("edge-source-label",ku({collection:"label",getKey:e.getSourceLabelKey,getBoundingBox:e.getSourceLabelBox,drawElement:e.drawSourceLabel,getRotation:a("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:u("source-label")})),r.drawing.addAtlasRenderType("edge-target-label",ku({collection:"label",getKey:e.getTargetLabelKey,getBoundingBox:e.getTargetLabelBox,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:u("target-label")}));var s=Vs(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(f,c){var d=!1;c&&c.length>0&&(d|=r.drawing.invalidate(c)),d&&s()}),c8(r)};function f8(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return Hk(r)}function c8(t){{var e=t.render;t.render=function(u){u=u||{};var o=t.cy;t.webgl&&(o.zoom()>sq?(d8(t),e.call(t,u)):(h8(t),bq(t,u,_s.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(u){r.call(t,u),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(u,o,s,f){return b8(t,u,o)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var a=t.notify;t.notify=function(u,o){a.call(t,u,o),u==="viewport"||u==="bounds"?t.pickingFrameBuffer.needsDraw=!0:u==="background"&&t.drawing.invalidate(o,{type:"node-body"})}}}function d8(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function h8(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function v8(t){var e=t.canvasWidth,r=t.canvasHeight,n=$1(t),a=n.pan,u=n.zoom,o=Hf();ac(o,o,[a.x,a.y]),K1(o,o,[u,u]);var s=Hf();n8(s,e,r);var f=Hf();return r8(f,s,o),f}function yq(t,e){var r=t.canvasWidth,n=t.canvasHeight,a=$1(t),u=a.pan,o=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(u.x,u.y),e.scale(o,o)}function g8(t,e){t.drawSelectionRectangle(e,function(r){return yq(t,r)})}function p8(t){var e=t.data.contexts[t.NODE];e.save(),yq(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function m8(t){var e=function(a,u,o){for(var s=a.atlasManager.getAtlasCollection(u),f=t.data.contexts[t.NODE],c=.125,d=s.atlases,v=0;v=0&&C.add(q)}return C}function b8(t,e,r){var n=y8(t,e,r),a=t.getCachedZSortedEles(),u,o,s=En(n),f;try{for(s.s();!(f=s.n()).done;){var c=f.value,d=a[c];if(!u&&d.isNode()&&(u=d),!o&&d.isEdge()&&(o=d),u&&o)break}}catch(v){s.e(v)}finally{s.f()}return[u,o].filter(Boolean)}function w8(t){return t.pstyle("shape").value==="rectangle"&&t.pstyle("background-fill").value==="solid"&&t.pstyle("border-width").pfValue===0&&t.pstyle("background-image").strValue==="none"}function kg(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawTexture(r,e,"node-underlay"),w8(r)?n.drawSimpleRectangle(r,e,"node-body"):n.drawTexture(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function bq(t,e,r){var n;t.webglDebug&&(n=performance.now());var a=t.drawing,u=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&g8(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var o=t.data.contexts[t.WEBGL];r.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=v8(t),f=t.getCachedZSortedEles();if(u=f.length,a.startFrame(s,r),r.screen){for(var c=0;c0&&o>0){m.clearRect(0,0,u,o),m.globalCompositeOperation="source-over";var y=this.getCachedZSortedEles();if(t.full)m.translate(-n.x1*c,-n.y1*c),m.scale(c,c),this.drawElements(m,y),m.scale(1/c,1/c),m.translate(n.x1*c,n.y1*c);else{var x=e.pan(),w={x:x.x*c,y:x.y*c};c*=e.zoom(),m.translate(w.x,w.y),m.scale(c,c),this.drawElements(m,y),m.scale(1/c,1/c),m.translate(-w.x,-w.y)}t.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=t.bg,m.rect(0,0,u,o),m.fill())}return g};function x8(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),u=0;u"u"?"undefined":er(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),a=n.document;r=a.createElement("canvas"),r.width=t,r.height=e}return r};[fq,Vn,ga,Y1,Hi,to,Dr,mq,ri,Xs,_q].forEach(function(t){Fe(We,t)});var S8=[{name:"null",impl:ZO},{name:"base",impl:uq},{name:"canvas",impl:_8}],T8=[{type:"layout",extensions:a6},{type:"renderer",extensions:S8}],Sq={},Tq={};function Cq(t,e,r){var n=r,a=function(M){ft("Can not register `"+e+"` for `"+t+"` since `"+M+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(Os.prototype[e])return a(e);Os.prototype[e]=r}else if(t==="collection"){if(mr.prototype[e])return a(e);mr.prototype[e]=r}else if(t==="layout"){for(var u=function(M){this.options=M,r.call(this,M),at(this._private)||(this._private={}),this._private.cy=M.cy,this._private.listeners=[],this.createEmitter()},o=u.prototype=Object.create(r.prototype),s=[],f=0;f-1}return zg=e,zg}var Pg,kT;function q8(){if(kT)return Pg;kT=1;var t=kc();function e(r,n){var a=this.__data__,u=t(a,r);return u<0?(++this.size,a.push([r,n])):a[u][1]=n,this}return Pg=e,Pg}var Ig,OT;function Oc(){if(OT)return Ig;OT=1;var t=D8(),e=M8(),r=k8(),n=O8(),a=q8();function u(o){var s=-1,f=o==null?0:o.length;for(this.clear();++s-1&&n%1==0&&n-1&&r%1==0&&r<=t}return Bp=e,Bp}var Lp,DC;function uI(){if(DC)return Lp;DC=1;var t=Fi(),e=W1(),r=Hn(),n="[object Arguments]",a="[object Array]",u="[object Boolean]",o="[object Date]",s="[object Error]",f="[object Function]",c="[object Map]",d="[object Number]",v="[object Object]",g="[object RegExp]",m="[object Set]",y="[object String]",x="[object WeakMap]",w="[object ArrayBuffer]",_="[object DataView]",E="[object Float32Array]",S="[object Float64Array]",C="[object Int8Array]",k="[object Int16Array]",O="[object Int32Array]",q="[object Uint8Array]",M="[object Uint8ClampedArray]",A="[object Uint16Array]",L="[object Uint32Array]",R={};R[E]=R[S]=R[C]=R[k]=R[O]=R[q]=R[M]=R[A]=R[L]=!0,R[n]=R[a]=R[w]=R[u]=R[_]=R[o]=R[s]=R[f]=R[c]=R[d]=R[v]=R[g]=R[m]=R[y]=R[x]=!1;function B(D){return r(D)&&e(D.length)&&!!R[t(D)]}return Lp=B,Lp}var Np,MC;function Ic(){if(MC)return Np;MC=1;function t(e){return function(r){return e(r)}}return Np=t,Np}var ys={exports:{}};ys.exports;var kC;function J1(){return kC||(kC=1,function(t,e){var r=Rq(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,u=a&&a.exports===n,o=u&&r.process,s=function(){try{var f=a&&a.require&&a.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s}(ys,ys.exports)),ys.exports}var zp,OC;function Ws(){if(OC)return zp;OC=1;var t=uI(),e=Ic(),r=J1(),n=r&&r.isTypedArray,a=n?e(n):t;return zp=a,zp}var Pp,qC;function kq(){if(qC)return Pp;qC=1;var t=nI(),e=Qs(),r=$t(),n=ao(),a=Pc(),u=Ws(),o=Object.prototype,s=o.hasOwnProperty;function f(c,d){var v=r(c),g=!v&&e(c),m=!v&&!g&&n(c),y=!v&&!g&&!m&&u(c),x=v||g||m||y,w=x?t(c.length,String):[],_=w.length;for(var E in c)(d||s.call(c,E))&&!(x&&(E=="length"||m&&(E=="offset"||E=="parent")||y&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||a(E,_)))&&w.push(E);return w}return Pp=f,Pp}var Ip,BC;function Uc(){if(BC)return Ip;BC=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return Ip=e,Ip}var Up,LC;function Oq(){if(LC)return Up;LC=1;function t(e,r){return function(n){return e(r(n))}}return Up=t,Up}var Gp,NC;function oI(){if(NC)return Gp;NC=1;var t=Oq(),e=t(Object.keys,Object);return Gp=e,Gp}var Vp,zC;function ew(){if(zC)return Vp;zC=1;var t=Uc(),e=oI(),r=Object.prototype,n=r.hasOwnProperty;function a(u){if(!t(u))return e(u);var o=[];for(var s in Object(u))n.call(u,s)&&s!="constructor"&&o.push(s);return o}return Vp=a,Vp}var Hp,PC;function pa(){if(PC)return Hp;PC=1;var t=js(),e=W1();function r(n){return n!=null&&e(n.length)&&!t(n)}return Hp=r,Hp}var Fp,IC;function ni(){if(IC)return Fp;IC=1;var t=kq(),e=ew(),r=pa();function n(a){return r(a)?t(a):e(a)}return Fp=n,Fp}var Yp,UC;function sI(){if(UC)return Yp;UC=1;var t=Zs(),e=ni();function r(n,a){return n&&t(a,e(a),n)}return Yp=r,Yp}var $p,GC;function lI(){if(GC)return $p;GC=1;function t(e){var r=[];if(e!=null)for(var n in Object(e))r.push(n);return r}return $p=t,$p}var Kp,VC;function fI(){if(VC)return Kp;VC=1;var t=dn(),e=Uc(),r=lI(),n=Object.prototype,a=n.hasOwnProperty;function u(o){if(!t(o))return r(o);var s=e(o),f=[];for(var c in o)c=="constructor"&&(s||!a.call(o,c))||f.push(c);return f}return Kp=u,Kp}var Xp,HC;function $i(){if(HC)return Xp;HC=1;var t=kq(),e=fI(),r=pa();function n(a){return r(a)?t(a,!0):e(a)}return Xp=n,Xp}var jp,FC;function cI(){if(FC)return jp;FC=1;var t=Zs(),e=$i();function r(n,a){return n&&t(a,e(a),n)}return jp=r,jp}var bs={exports:{}};bs.exports;var YC;function qq(){return YC||(YC=1,function(t,e){var r=An(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,u=a&&a.exports===n,o=u?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,d){if(d)return c.slice();var v=c.length,g=s?s(v):new c.constructor(v);return c.copy(g),g}t.exports=f}(bs,bs.exports)),bs.exports}var Zp,$C;function Bq(){if($C)return Zp;$C=1;function t(e,r){var n=-1,a=e.length;for(r||(r=Array(a));++nm))return!1;var x=v.get(o),w=v.get(s);if(x&&w)return x==s&&w==o;var _=-1,E=!0,S=f&a?new t:void 0;for(v.set(o,s),v.set(s,o);++_0&&u(d)?a>1?r(d,a-1,u,o,s):t(s,d):o||(s[s.length]=d)}return s}return Gy=r,Gy}var Vy,PR;function sU(){if(PR)return Vy;PR=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return Vy=t,Vy}var Hy,IR;function cB(){if(IR)return Hy;IR=1;var t=sU(),e=Math.max;function r(n,a,u){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,s=-1,f=e(o.length-a,0),c=Array(f);++s0){if(++u>=t)return arguments[0]}else u=0;return a.apply(void 0,arguments)}}return Yy=n,Yy}var $y,VR;function dB(){if(VR)return $y;VR=1;var t=lU(),e=fU(),r=e(t);return $y=r,$y}var Ky,HR;function $c(){if(HR)return Ky;HR=1;var t=Ki(),e=cB(),r=dB();function n(a,u){return r(e(a,u,t),a+"")}return Ky=n,Ky}var Xy,FR;function hB(){if(FR)return Xy;FR=1;function t(e,r,n,a){for(var u=e.length,o=n+(a?1:-1);a?o--:++o-1}return Wy=e,Wy}var Jy,jR;function gU(){if(jR)return Jy;jR=1;function t(e,r,n){for(var a=-1,u=e==null?0:e.length;++a=o){var _=c?null:a(f);if(_)return u(_);y=!1,g=n,w=new t}else w=c?[]:x;e:for(;++v1?m.setNode(y,v):m.setNode(y)}),this},a.prototype.setNode=function(d,v){return t.has(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=v),this):(this._nodes[d]=arguments.length>1?v:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=r,this._children[d]={},this._children[r][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)},a.prototype.node=function(d){return this._nodes[d]},a.prototype.hasNode=function(d){return t.has(this._nodes,d)},a.prototype.removeNode=function(d){var v=this;if(t.has(this._nodes,d)){var g=function(m){v.removeEdge(v._edgeObjs[m])};delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],t.each(this.children(d),function(m){v.setParent(m)}),delete this._children[d]),t.each(t.keys(this._in[d]),g),delete this._in[d],delete this._preds[d],t.each(t.keys(this._out[d]),g),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this},a.prototype.setParent=function(d,v){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t.isUndefined(v))v=r;else{v+="";for(var g=v;!t.isUndefined(g);g=this.parent(g))if(g===d)throw new Error("Setting "+v+" as parent of "+d+" would create a cycle");this.setNode(v)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=v,this._children[v][d]=!0,this},a.prototype._removeFromParentsChildList=function(d){delete this._children[this._parent[d]][d]},a.prototype.parent=function(d){if(this._isCompound){var v=this._parent[d];if(v!==r)return v}},a.prototype.children=function(d){if(t.isUndefined(d)&&(d=r),this._isCompound){var v=this._children[d];if(v)return t.keys(v)}else{if(d===r)return this.nodes();if(this.hasNode(d))return[]}},a.prototype.predecessors=function(d){var v=this._preds[d];if(v)return t.keys(v)},a.prototype.successors=function(d){var v=this._sucs[d];if(v)return t.keys(v)},a.prototype.neighbors=function(d){var v=this.predecessors(d);if(v)return t.union(v,this.successors(d))},a.prototype.isLeaf=function(d){var v;return this.isDirected()?v=this.successors(d):v=this.neighbors(d),v.length===0},a.prototype.filterNodes=function(d){var v=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});v.setGraph(this.graph());var g=this;t.each(this._nodes,function(x,w){d(w)&&v.setNode(w,x)}),t.each(this._edgeObjs,function(x){v.hasNode(x.v)&&v.hasNode(x.w)&&v.setEdge(x,g.edge(x))});var m={};function y(x){var w=g.parent(x);return w===void 0||v.hasNode(w)?(m[x]=w,w):w in m?m[w]:y(w)}return this._isCompound&&t.each(v.nodes(),function(x){v.setParent(x,y(x))}),v},a.prototype.setDefaultEdgeLabel=function(d){return t.isFunction(d)||(d=t.constant(d)),this._defaultEdgeLabelFn=d,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return t.values(this._edgeObjs)},a.prototype.setPath=function(d,v){var g=this,m=arguments;return t.reduce(d,function(y,x){return m.length>1?g.setEdge(y,x,v):g.setEdge(y,x),x}),this},a.prototype.setEdge=function(){var d,v,g,m,y=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(d=x.v,v=x.w,g=x.name,arguments.length===2&&(m=arguments[1],y=!0)):(d=x,v=arguments[1],g=arguments[3],arguments.length>2&&(m=arguments[2],y=!0)),d=""+d,v=""+v,t.isUndefined(g)||(g=""+g);var w=s(this._isDirected,d,v,g);if(t.has(this._edgeLabels,w))return y&&(this._edgeLabels[w]=m),this;if(!t.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(v),this._edgeLabels[w]=y?m:this._defaultEdgeLabelFn(d,v,g);var _=f(this._isDirected,d,v,g);return d=_.v,v=_.w,Object.freeze(_),this._edgeObjs[w]=_,u(this._preds[v],d),u(this._sucs[d],v),this._in[v][w]=_,this._out[d][w]=_,this._edgeCount++,this},a.prototype.edge=function(d,v,g){var m=arguments.length===1?c(this._isDirected,arguments[0]):s(this._isDirected,d,v,g);return this._edgeLabels[m]},a.prototype.hasEdge=function(d,v,g){var m=arguments.length===1?c(this._isDirected,arguments[0]):s(this._isDirected,d,v,g);return t.has(this._edgeLabels,m)},a.prototype.removeEdge=function(d,v,g){var m=arguments.length===1?c(this._isDirected,arguments[0]):s(this._isDirected,d,v,g),y=this._edgeObjs[m];return y&&(d=y.v,v=y.w,delete this._edgeLabels[m],delete this._edgeObjs[m],o(this._preds[v],d),o(this._sucs[d],v),delete this._in[v][m],delete this._out[d][m],this._edgeCount--),this},a.prototype.inEdges=function(d,v){var g=this._in[d];if(g){var m=t.values(g);return v?t.filter(m,function(y){return y.v===v}):m}},a.prototype.outEdges=function(d,v){var g=this._out[d];if(g){var m=t.values(g);return v?t.filter(m,function(y){return y.w===v}):m}},a.prototype.nodeEdges=function(d,v){var g=this.inEdges(d,v);if(g)return g.concat(this.outEdges(d,v))};function u(d,v){d[v]?d[v]++:d[v]=1}function o(d,v){--d[v]||delete d[v]}function s(d,v,g,m){var y=""+v,x=""+g;if(!d&&y>x){var w=y;y=x,x=w}return y+n+x+n+(t.isUndefined(m)?e:m)}function f(d,v,g,m){var y=""+v,x=""+g;if(!d&&y>x){var w=y;y=x,x=w}var _={v:y,w:x};return m&&(_.name=m),_}function c(d,v){return s(d,v.v,v.w,v.name)}return s0}var l0,iD;function xU(){return iD||(iD=1,l0="2.1.8"),l0}var f0,uD;function _U(){return uD||(uD=1,f0={Graph:fw(),version:xU()}),f0}var c0,oD;function EU(){if(oD)return c0;oD=1;var t=hn(),e=fw();c0={write:r,read:u};function r(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return t.isUndefined(o.graph())||(s.value=t.clone(o.graph())),s}function n(o){return t.map(o.nodes(),function(s){var f=o.node(s),c=o.parent(s),d={v:s};return t.isUndefined(f)||(d.value=f),t.isUndefined(c)||(d.parent=c),d})}function a(o){return t.map(o.edges(),function(s){var f=o.edge(s),c={v:s.v,w:s.w};return t.isUndefined(s.name)||(c.name=s.name),t.isUndefined(f)||(c.value=f),c})}function u(o){var s=new e(o.options).setGraph(o.value);return t.each(o.nodes,function(f){s.setNode(f.v,f.value),f.parent&&s.setParent(f.v,f.parent)}),t.each(o.edges,function(f){s.setEdge({v:f.v,w:f.w,name:f.name},f.value)}),s}return c0}var d0,sD;function SU(){if(sD)return d0;sD=1;var t=hn();d0=e;function e(r){var n={},a=[],u;function o(s){t.has(n,s)||(n[s]=!0,u.push(s),t.each(r.successors(s),o),t.each(r.predecessors(s),o))}return t.each(r.nodes(),function(s){u=[],o(s),u.length&&a.push(u)}),a}return d0}var h0,lD;function pB(){if(lD)return h0;lD=1;var t=hn();h0=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(r){return r.key})},e.prototype.has=function(r){return t.has(this._keyIndices,r)},e.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(r,n){var a=this._keyIndices;if(r=String(r),!t.has(a,r)){var u=this._arr,o=u.length;return a[r]=o,u.push({key:r,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},e.prototype.decrease=function(r,n){var a=this._keyIndices[r];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(r){var n=this._arr,a=2*r,u=a+1,o=r;a>1,!(n[u].priority0&&(v=d.removeMin(),g=c[v],g.distance!==Number.POSITIVE_INFINITY);)f(v).forEach(m);return c}return v0}var g0,cD;function TU(){if(cD)return g0;cD=1;var t=mB(),e=hn();g0=r;function r(n,a,u){return e.transform(n.nodes(),function(o,s){o[s]=t(n,s,a,u)},{})}return g0}var p0,dD;function yB(){if(dD)return p0;dD=1;var t=hn();p0=e;function e(r){var n=0,a=[],u={},o=[];function s(f){var c=u[f]={onStack:!0,lowlink:n,index:n++};if(a.push(f),r.successors(f).forEach(function(g){t.has(u,g)?u[g].onStack&&(c.lowlink=Math.min(c.lowlink,u[g].index)):(s(g),c.lowlink=Math.min(c.lowlink,u[g].lowlink))}),c.lowlink===c.index){var d=[],v;do v=a.pop(),u[v].onStack=!1,d.push(v);while(f!==v);o.push(d)}}return r.nodes().forEach(function(f){t.has(u,f)||s(f)}),o}return p0}var m0,hD;function CU(){if(hD)return m0;hD=1;var t=hn(),e=yB();m0=r;function r(n){return t.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return m0}var y0,vD;function AU(){if(vD)return y0;vD=1;var t=hn();y0=r;var e=t.constant(1);function r(a,u,o){return n(a,u||e,o||function(s){return a.outEdges(s)})}function n(a,u,o){var s={},f=a.nodes();return f.forEach(function(c){s[c]={},s[c][c]={distance:0},f.forEach(function(d){c!==d&&(s[c][d]={distance:Number.POSITIVE_INFINITY})}),o(c).forEach(function(d){var v=d.v===c?d.w:d.v,g=u(d);s[c][v]={distance:g,predecessor:c}})}),f.forEach(function(c){var d=s[c];f.forEach(function(v){var g=s[v];f.forEach(function(m){var y=g[c],x=d[m],w=g[m],_=y.distance+x.distance;_0;){if(c=f.removeMin(),t.has(s,c))o.setEdge(c,s[c]);else{if(v)throw new Error("Input graph is not connected: "+a);v=!0}a.nodeEdges(c).forEach(d)}return o}return S0}var T0,xD;function OU(){return xD||(xD=1,T0={components:SU(),dijkstra:mB(),dijkstraAll:TU(),findCycles:CU(),floydWarshall:AU(),isAcyclic:RU(),postorder:DU(),preorder:MU(),prim:kU(),tarjan:yB(),topsort:bB()}),T0}var C0,_D;function qU(){if(_D)return C0;_D=1;var t=_U();return C0={Graph:t.Graph,json:EU(),alg:OU(),version:t.version},C0}var A0,ED;function Cn(){if(ED)return A0;ED=1;var t;if(typeof X1=="function")try{t=qU()}catch{}return t||(t=window.graphlib),A0=t,A0}var R0,SD;function BU(){if(SD)return R0;SD=1;var t=Yq(),e=1,r=4;function n(a){return t(a,e|r)}return R0=n,R0}var D0,TD;function Kc(){if(TD)return D0;TD=1;var t=ro(),e=pa(),r=Pc(),n=dn();function a(u,o,s){if(!n(s))return!1;var f=typeof o;return(f=="number"?e(s)&&r(o,s.length):f=="string"&&o in s)?t(s[o],u):!1}return D0=a,D0}var M0,CD;function LU(){if(CD)return M0;CD=1;var t=$c(),e=ro(),r=Kc(),n=$i(),a=Object.prototype,u=a.hasOwnProperty,o=t(function(s,f){s=Object(s);var c=-1,d=f.length,v=d>2?f[2]:void 0;for(v&&r(f[0],f[1],v)&&(d=1);++c-1?f[c?u[d]:d]:void 0}}return k0=n,k0}var O0,RD;function zU(){if(RD)return O0;RD=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return O0=e,O0}var q0,DD;function PU(){if(DD)return q0;DD=1;var t=zU(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return q0=r,q0}var B0,MD;function IU(){if(MD)return B0;MD=1;var t=PU(),e=dn(),r=uo(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function f(c){if(typeof c=="number")return c;if(r(c))return n;if(e(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=e(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=t(c);var v=u.test(c);return v||o.test(c)?s(c.slice(2),v?2:8):a.test(c)?n:+c}return B0=f,B0}var L0,kD;function xB(){if(kD)return L0;kD=1;var t=IU(),e=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=t(a),a===e||a===-1/0){var u=a<0?-1:1;return u*r}return a===a?a:0}return L0=n,L0}var N0,OD;function UU(){if(OD)return N0;OD=1;var t=xB();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return N0=e,N0}var z0,qD;function GU(){if(qD)return z0;qD=1;var t=hB(),e=ma(),r=UU(),n=Math.max;function a(u,o,s){var f=u==null?0:u.length;if(!f)return-1;var c=s==null?0:r(s);return c<0&&(c=n(f+c,0)),t(u,e(o,3),c)}return z0=a,z0}var P0,BD;function VU(){if(BD)return P0;BD=1;var t=NU(),e=GU(),r=t(e);return P0=r,P0}var I0,LD;function _B(){if(LD)return I0;LD=1;var t=lw();function e(r){var n=r==null?0:r.length;return n?t(r,1):[]}return I0=e,I0}var U0,ND;function HU(){if(ND)return U0;ND=1;var t=iw(),e=$q(),r=$i();function n(a,u){return a==null?a:t(a,e(u),r)}return U0=n,U0}var G0,zD;function FU(){if(zD)return G0;zD=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return G0=t,G0}var V0,PD;function YU(){if(PD)return V0;PD=1;var t=Nc(),e=uw(),r=ma();function n(a,u){var o={};return u=r(u,3),e(a,function(s,f,c){t(o,f,u(s,f,c))}),o}return V0=n,V0}var H0,ID;function cw(){if(ID)return H0;ID=1;var t=uo();function e(r,n,a){for(var u=-1,o=r.length;++ur}return F0=t,F0}var Y0,GD;function KU(){if(GD)return Y0;GD=1;var t=cw(),e=$U(),r=Ki();function n(a){return a&&a.length?t(a,r,e):void 0}return Y0=n,Y0}var $0,VD;function EB(){if(VD)return $0;VD=1;var t=Nc(),e=ro();function r(n,a,u){(u!==void 0&&!e(n[a],u)||u===void 0&&!(a in n))&&t(n,a,u)}return $0=r,$0}var K0,HD;function XU(){if(HD)return K0;HD=1;var t=Fi(),e=Gc(),r=Hn(),n="[object Object]",a=Function.prototype,u=Object.prototype,o=a.toString,s=u.hasOwnProperty,f=o.call(Object);function c(d){if(!r(d)||t(d)!=n)return!1;var v=e(d);if(v===null)return!0;var g=s.call(v,"constructor")&&v.constructor;return typeof g=="function"&&g instanceof g&&o.call(g)==f}return K0=c,K0}var X0,FD;function SB(){if(FD)return X0;FD=1;function t(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}return X0=t,X0}var j0,YD;function jU(){if(YD)return j0;YD=1;var t=Zs(),e=$i();function r(n){return t(n,e(n))}return j0=r,j0}var Z0,$D;function ZU(){if($D)return Z0;$D=1;var t=EB(),e=qq(),r=Vq(),n=Bq(),a=Fq(),u=Qs(),o=$t(),s=vB(),f=ao(),c=js(),d=dn(),v=XU(),g=Ws(),m=SB(),y=jU();function x(w,_,E,S,C,k,O){var q=m(w,E),M=m(_,E),A=O.get(M);if(A){t(w,E,A);return}var L=k?k(q,M,E+"",w,_,O):void 0,R=L===void 0;if(R){var B=o(M),D=!B&&f(M),N=!B&&!D&&g(M);L=M,B||D||N?o(q)?L=q:s(q)?L=n(q):D?(R=!1,L=e(M,!0)):N?(R=!1,L=r(M,!0)):L=[]:v(M)||u(M)?(L=q,u(q)?L=y(q):(!d(q)||c(q))&&(L=a(M))):R=!1}R&&(O.set(M,L),C(L,M,S,k,O),O.delete(M)),t(w,E,L)}return Z0=x,Z0}var Q0,KD;function QU(){if(KD)return Q0;KD=1;var t=Lc(),e=EB(),r=iw(),n=ZU(),a=dn(),u=$i(),o=SB();function s(f,c,d,v,g){f!==c&&r(c,function(m,y){if(g||(g=new t),a(m))n(f,c,y,d,s,v,g);else{var x=v?v(o(f,y),m,y+"",f,c,g):void 0;x===void 0&&(x=m),e(f,y,x)}},u)}return Q0=s,Q0}var W0,XD;function WU(){if(XD)return W0;XD=1;var t=$c(),e=Kc();function r(n){return t(function(a,u){var o=-1,s=u.length,f=s>1?u[s-1]:void 0,c=s>2?u[2]:void 0;for(f=n.length>3&&typeof f=="function"?(s--,f):void 0,c&&e(u[0],u[1],c)&&(f=s<3?void 0:f,s=1),a=Object(a);++on||s&&f&&d&&!c&&!v||u&&f&&d||!a&&d||!o)return 1;if(!u&&!s&&!v&&r=c)return d;var v=a[u];return d*(v=="desc"?-1:1)}}return r.index-n.index}return vb=e,vb}var gb,cM;function vG(){if(cM)return gb;cM=1;var t=Hc(),e=Yc(),r=ma(),n=sB(),a=cG(),u=Ic(),o=hG(),s=Ki(),f=$t();function c(d,v,g){v.length?v=t(v,function(x){return f(x)?function(w){return e(w,x.length===1?x[0]:x)}:x}):v=[s];var m=-1;v=t(v,u(r));var y=n(d,function(x,w,_){var E=t(v,function(S){return S(x)});return{criteria:E,index:++m,value:x}});return a(y,function(x,w){return o(x,w,g)})}return gb=c,gb}var pb,dM;function gG(){if(dM)return pb;dM=1;var t=lw(),e=vG(),r=$c(),n=Kc(),a=r(function(u,o){if(u==null)return[];var s=o.length;return s>1&&n(u,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(u,t(o,1),[])});return pb=a,pb}var mb,hM;function pG(){if(hM)return mb;hM=1;var t=tB(),e=0;function r(n){var a=++e;return t(n)+a}return mb=r,mb}var yb,vM;function mG(){if(vM)return yb;vM=1;function t(e,r,n){for(var a=-1,u=e.length,o=r.length,s={};++a0;--w)if(x=d[w].dequeue(),x){g=g.concat(o(c,d,v,x,!0));break}}}return g}function o(c,d,v,g,m){var y=m?[]:void 0;return t.forEach(c.inEdges(g.v),function(x){var w=c.edge(x),_=c.node(x.v);m&&y.push({v:x.v,w:x.w}),_.out-=w,f(d,v,_)}),t.forEach(c.outEdges(g.v),function(x){var w=c.edge(x),_=x.w,E=c.node(_);E.in-=w,f(d,v,E)}),c.removeNode(g.v),y}function s(c,d){var v=new e,g=0,m=0;t.forEach(c.nodes(),function(w){v.setNode(w,{v:w,in:0,out:0})}),t.forEach(c.edges(),function(w){var _=v.edge(w.v,w.w)||0,E=d(w),S=_+E;v.setEdge(w.v,w.w,S),m=Math.max(m,v.node(w.v).out+=E),g=Math.max(g,v.node(w.w).in+=E)});var y=t.range(m+g+3).map(function(){return new r}),x=g+1;return t.forEach(v.nodes(),function(w){f(y,x,v.node(w))}),{graph:v,buckets:y,zeroIdx:x}}function f(c,d,v){v.out?v.in?c[v.out-v.in+d].enqueue(v):c[c.length-1].enqueue(v):c[0].enqueue(v)}return _b}var Eb,bM;function xG(){if(bM)return Eb;bM=1;var t=Ct(),e=wG();Eb={run:r,undo:a};function r(u){var o=u.graph().acyclicer==="greedy"?e(u,s(u)):n(u);t.forEach(o,function(f){var c=u.edge(f);u.removeEdge(f),c.forwardName=f.name,c.reversed=!0,u.setEdge(f.w,f.v,c,t.uniqueId("rev"))});function s(f){return function(c){return f.edge(c).weight}}}function n(u){var o=[],s={},f={};function c(d){t.has(f,d)||(f[d]=!0,s[d]=!0,t.forEach(u.outEdges(d),function(v){t.has(s,v.w)?o.push(v):c(v.w)}),delete s[d])}return t.forEach(u.nodes(),c),o}function a(u){t.forEach(u.edges(),function(o){var s=u.edge(o);if(s.reversed){u.removeEdge(o);var f=s.forwardName;delete s.reversed,delete s.forwardName,u.setEdge(o.w,o.v,s,f)}})}return Eb}var Sb,wM;function Nr(){if(wM)return Sb;wM=1;var t=Ct(),e=Cn().Graph;Sb={addDummyNode:r,simplify:n,asNonCompoundGraph:a,successorWeights:u,predecessorWeights:o,intersectRect:s,buildLayerMatrix:f,normalizeRanks:c,removeEmptyRanks:d,addBorderNode:v,maxRank:g,partition:m,time:y,notime:x};function r(w,_,E,S){var C;do C=t.uniqueId(S);while(w.hasNode(C));return E.dummy=_,w.setNode(C,E),C}function n(w){var _=new e().setGraph(w.graph());return t.forEach(w.nodes(),function(E){_.setNode(E,w.node(E))}),t.forEach(w.edges(),function(E){var S=_.edge(E.v,E.w)||{weight:0,minlen:1},C=w.edge(E);_.setEdge(E.v,E.w,{weight:S.weight+C.weight,minlen:Math.max(S.minlen,C.minlen)})}),_}function a(w){var _=new e({multigraph:w.isMultigraph()}).setGraph(w.graph());return t.forEach(w.nodes(),function(E){w.children(E).length||_.setNode(E,w.node(E))}),t.forEach(w.edges(),function(E){_.setEdge(E,w.edge(E))}),_}function u(w){var _=t.map(w.nodes(),function(E){var S={};return t.forEach(w.outEdges(E),function(C){S[C.w]=(S[C.w]||0)+w.edge(C).weight}),S});return t.zipObject(w.nodes(),_)}function o(w){var _=t.map(w.nodes(),function(E){var S={};return t.forEach(w.inEdges(E),function(C){S[C.v]=(S[C.v]||0)+w.edge(C).weight}),S});return t.zipObject(w.nodes(),_)}function s(w,_){var E=w.x,S=w.y,C=_.x-E,k=_.y-S,O=w.width/2,q=w.height/2;if(!C&&!k)throw new Error("Not possible to find intersection inside of the rectangle");var M,A;return Math.abs(k)*O>Math.abs(C)*q?(k<0&&(q=-q),M=q*C/k,A=q):(C<0&&(O=-O),M=O,A=O*k/C),{x:E+M,y:S+A}}function f(w){var _=t.map(t.range(g(w)+1),function(){return[]});return t.forEach(w.nodes(),function(E){var S=w.node(E),C=S.rank;t.isUndefined(C)||(_[C][S.order]=E)}),_}function c(w){var _=t.min(t.map(w.nodes(),function(E){return w.node(E).rank}));t.forEach(w.nodes(),function(E){var S=w.node(E);t.has(S,"rank")&&(S.rank-=_)})}function d(w){var _=t.min(t.map(w.nodes(),function(k){return w.node(k).rank})),E=[];t.forEach(w.nodes(),function(k){var O=w.node(k).rank-_;E[O]||(E[O]=[]),E[O].push(k)});var S=0,C=w.graph().nodeRankFactor;t.forEach(E,function(k,O){t.isUndefined(k)&&O%C!==0?--S:S&&t.forEach(k,function(q){w.node(q).rank+=S})})}function v(w,_,E,S){var C={width:0,height:0};return arguments.length>=4&&(C.rank=E,C.order=S),r(w,"border",C,_)}function g(w){return t.max(t.map(w.nodes(),function(_){var E=w.node(_).rank;if(!t.isUndefined(E))return E}))}function m(w,_){var E={lhs:[],rhs:[]};return t.forEach(w,function(S){_(S)?E.lhs.push(S):E.rhs.push(S)}),E}function y(w,_){var E=t.now();try{return _()}finally{console.log(w+" time: "+(t.now()-E)+"ms")}}function x(w,_){return _()}return Sb}var Tb,xM;function _G(){if(xM)return Tb;xM=1;var t=Ct(),e=Nr();Tb={run:r,undo:a};function r(u){u.graph().dummyChains=[],t.forEach(u.edges(),function(o){n(u,o)})}function n(u,o){var s=o.v,f=u.node(s).rank,c=o.w,d=u.node(c).rank,v=o.name,g=u.edge(o),m=g.labelRank;if(d!==f+1){u.removeEdge(o);var y,x,w;for(w=0,++f;fA.lim&&(L=A,R=!0);var B=t.filter(C.edges(),function(D){return R===E(S,S.node(D.v),L)&&R!==E(S,S.node(D.w),L)});return t.minBy(B,function(D){return r(C,D)})}function x(S,C,k,O){var q=k.v,M=k.w;S.removeEdge(q,M),S.setEdge(O.v,O.w,{}),v(S),f(S,C),w(S,C)}function w(S,C){var k=t.find(S.nodes(),function(q){return!C.node(q).parent}),O=a(S,k);O=O.slice(1),t.forEach(O,function(q){var M=S.node(q).parent,A=C.edge(q,M),L=!1;A||(A=C.edge(M,q),L=!0),C.node(q).rank=C.node(M).rank+(L?A.minlen:-A.minlen)})}function _(S,C,k){return S.hasEdge(C,k)}function E(S,C,k){return k.low<=C.lim&&C.lim<=k.lim}return Rb}var Db,TM;function SG(){if(TM)return Db;TM=1;var t=uc(),e=t.longestPath,r=CB(),n=EG();Db=a;function a(f){switch(f.graph().ranker){case"network-simplex":s(f);break;case"tight-tree":o(f);break;case"longest-path":u(f);break;default:s(f)}}var u=e;function o(f){e(f),r(f)}function s(f){n(f)}return Db}var Mb,CM;function TG(){if(CM)return Mb;CM=1;var t=Ct();Mb=e;function e(a){var u=n(a);t.forEach(a.graph().dummyChains,function(o){for(var s=a.node(o),f=s.edgeObj,c=r(a,u,f.v,f.w),d=c.path,v=c.lca,g=0,m=d[g],y=!0;o!==f.w;){if(s=a.node(o),y){for(;(m=d[g])!==v&&a.node(m).maxRankd||v>u[g].lim));for(m=g,g=s;(g=a.parent(g))!==m;)c.push(g);return{path:f.concat(c.reverse()),lca:m}}function n(a){var u={},o=0;function s(f){var c=o;t.forEach(a.children(f),s),u[f]={low:c,lim:o++}}return t.forEach(a.children(),s),u}return Mb}var kb,AM;function CG(){if(AM)return kb;AM=1;var t=Ct(),e=Nr();kb={run:r,cleanup:o};function r(s){var f=e.addDummyNode(s,"root",{},"_root"),c=a(s),d=t.max(t.values(c))-1,v=2*d+1;s.graph().nestingRoot=f,t.forEach(s.edges(),function(m){s.edge(m).minlen*=v});var g=u(s)+1;t.forEach(s.children(),function(m){n(s,f,v,g,d,c,m)}),s.graph().nodeRankFactor=v}function n(s,f,c,d,v,g,m){var y=s.children(m);if(!y.length){m!==f&&s.setEdge(f,m,{weight:0,minlen:c});return}var x=e.addBorderNode(s,"_bt"),w=e.addBorderNode(s,"_bb"),_=s.node(m);s.setParent(x,m),_.borderTop=x,s.setParent(w,m),_.borderBottom=w,t.forEach(y,function(E){n(s,f,c,d,v,g,E);var S=s.node(E),C=S.borderTop?S.borderTop:E,k=S.borderBottom?S.borderBottom:E,O=S.borderTop?d:2*d,q=C!==k?1:v-g[m]+1;s.setEdge(x,C,{weight:O,minlen:q,nestingEdge:!0}),s.setEdge(k,w,{weight:O,minlen:q,nestingEdge:!0})}),s.parent(m)||s.setEdge(f,x,{weight:0,minlen:v+g[m]})}function a(s){var f={};function c(d,v){var g=s.children(d);g&&g.length&&t.forEach(g,function(m){c(m,v+1)}),f[d]=v}return t.forEach(s.children(),function(d){c(d,1)}),f}function u(s){return t.reduce(s.edges(),function(f,c){return f+s.edge(c).weight},0)}function o(s){var f=s.graph();s.removeNode(f.nestingRoot),delete f.nestingRoot,t.forEach(s.edges(),function(c){var d=s.edge(c);d.nestingEdge&&s.removeEdge(c)})}return kb}var Ob,RM;function AG(){if(RM)return Ob;RM=1;var t=Ct(),e=Nr();Ob=r;function r(a){function u(o){var s=a.children(o),f=a.node(o);if(s.length&&t.forEach(s,u),t.has(f,"minRank")){f.borderLeft=[],f.borderRight=[];for(var c=f.minRank,d=f.maxRank+1;c0;)m%2&&(y+=d[m+1]),m=m-1>>1,d[m]+=g.weight;v+=g.weight*y})),v}return Lb}var Nb,OM;function kG(){if(OM)return Nb;OM=1;var t=Ct();Nb=e;function e(r,n){return t.map(n,function(a){var u=r.inEdges(a);if(u.length){var o=t.reduce(u,function(s,f){var c=r.edge(f),d=r.node(f.v);return{sum:s.sum+c.weight*d.order,weight:s.weight+c.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return Nb}var zb,qM;function OG(){if(qM)return zb;qM=1;var t=Ct();zb=e;function e(a,u){var o={};t.forEach(a,function(f,c){var d=o[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:c};t.isUndefined(f.barycenter)||(d.barycenter=f.barycenter,d.weight=f.weight)}),t.forEach(u.edges(),function(f){var c=o[f.v],d=o[f.w];!t.isUndefined(c)&&!t.isUndefined(d)&&(d.indegree++,c.out.push(o[f.w]))});var s=t.filter(o,function(f){return!f.indegree});return r(s)}function r(a){var u=[];function o(c){return function(d){d.merged||(t.isUndefined(d.barycenter)||t.isUndefined(c.barycenter)||d.barycenter>=c.barycenter)&&n(c,d)}}function s(c){return function(d){d.in.push(c),--d.indegree===0&&a.push(d)}}for(;a.length;){var f=a.pop();u.push(f),t.forEach(f.in.reverse(),o(f)),t.forEach(f.out,s(f))}return t.map(t.filter(u,function(c){return!c.merged}),function(c){return t.pick(c,["vs","i","barycenter","weight"])})}function n(a,u){var o=0,s=0;a.weight&&(o+=a.barycenter*a.weight,s+=a.weight),u.weight&&(o+=u.barycenter*u.weight,s+=u.weight),a.vs=u.vs.concat(a.vs),a.barycenter=o/s,a.weight=s,a.i=Math.min(u.i,a.i),u.merged=!0}return zb}var Pb,BM;function qG(){if(BM)return Pb;BM=1;var t=Ct(),e=Nr();Pb=r;function r(u,o){var s=e.partition(u,function(x){return t.has(x,"barycenter")}),f=s.lhs,c=t.sortBy(s.rhs,function(x){return-x.i}),d=[],v=0,g=0,m=0;f.sort(a(!!o)),m=n(d,c,m),t.forEach(f,function(x){m+=x.vs.length,d.push(x.vs),v+=x.barycenter*x.weight,g+=x.weight,m=n(d,c,m)});var y={vs:t.flatten(d,!0)};return g&&(y.barycenter=v/g,y.weight=g),y}function n(u,o,s){for(var f;o.length&&(f=t.last(o)).i<=s;)o.pop(),u.push(f.vs),s++;return s}function a(u){return function(o,s){return o.barycenters.barycenter?1:u?s.i-o.i:o.i-s.i}}return Pb}var Ib,LM;function BG(){if(LM)return Ib;LM=1;var t=Ct(),e=kG(),r=OG(),n=qG();Ib=a;function a(s,f,c,d){var v=s.children(f),g=s.node(f),m=g?g.borderLeft:void 0,y=g?g.borderRight:void 0,x={};m&&(v=t.filter(v,function(k){return k!==m&&k!==y}));var w=e(s,v);t.forEach(w,function(k){if(s.children(k.v).length){var O=a(s,k.v,c,d);x[k.v]=O,t.has(O,"barycenter")&&o(k,O)}});var _=r(w,c);u(_,x);var E=n(_,d);if(m&&(E.vs=t.flatten([m,E.vs,y],!0),s.predecessors(m).length)){var S=s.node(s.predecessors(m)[0]),C=s.node(s.predecessors(y)[0]);t.has(E,"barycenter")||(E.barycenter=0,E.weight=0),E.barycenter=(E.barycenter*E.weight+S.order+C.order)/(E.weight+2),E.weight+=2}return E}function u(s,f){t.forEach(s,function(c){c.vs=t.flatten(c.vs.map(function(d){return f[d]?f[d].vs:d}),!0)})}function o(s,f){t.isUndefined(s.barycenter)?(s.barycenter=f.barycenter,s.weight=f.weight):(s.barycenter=(s.barycenter*s.weight+f.barycenter*f.weight)/(s.weight+f.weight),s.weight+=f.weight)}return Ib}var Ub,NM;function LG(){if(NM)return Ub;NM=1;var t=Ct(),e=Cn().Graph;Ub=r;function r(a,u,o){var s=n(a),f=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(c){return a.node(c)});return t.forEach(a.nodes(),function(c){var d=a.node(c),v=a.parent(c);(d.rank===u||d.minRank<=u&&u<=d.maxRank)&&(f.setNode(c),f.setParent(c,v||s),t.forEach(a[o](c),function(g){var m=g.v===c?g.w:g.v,y=f.edge(m,c),x=t.isUndefined(y)?0:y.weight;f.setEdge(m,c,{weight:a.edge(g).weight+x})}),t.has(d,"minRank")&&f.setNode(c,{borderLeft:d.borderLeft[u],borderRight:d.borderRight[u]}))}),f}function n(a){for(var u;a.hasNode(u=t.uniqueId("_root")););return u}return Ub}var Gb,zM;function NG(){if(zM)return Gb;zM=1;var t=Ct();Gb=e;function e(r,n,a){var u={},o;t.forEach(a,function(s){for(var f=r.parent(s),c,d;f;){if(c=r.parent(f),c?(d=u[c],u[c]=f):(d=o,o=f),d&&d!==f){n.setEdge(d,f);return}f=c}})}return Gb}var Vb,PM;function zG(){if(PM)return Vb;PM=1;var t=Ct(),e=DG(),r=MG(),n=BG(),a=LG(),u=NG(),o=Cn().Graph,s=Nr();Vb=f;function f(g){var m=s.maxRank(g),y=c(g,t.range(1,m+1),"inEdges"),x=c(g,t.range(m-1,-1,-1),"outEdges"),w=e(g);v(g,w);for(var _=Number.POSITIVE_INFINITY,E,S=0,C=0;C<4;++S,++C){d(S%2?y:x,S%4>=2),w=s.buildLayerMatrix(g);var k=r(g,w);k<_&&(C=0,E=t.cloneDeep(w),_=k)}v(g,E)}function c(g,m,y){return t.map(m,function(x){return a(g,x,y)})}function d(g,m){var y=new o;t.forEach(g,function(x){var w=x.graph().root,_=n(x,w,y,m);t.forEach(_.vs,function(E,S){x.node(E).order=S}),u(x,y,_.vs)})}function v(g,m){t.forEach(m,function(y){t.forEach(y,function(x,w){g.node(x).order=w})})}return Vb}var Hb,IM;function PG(){if(IM)return Hb;IM=1;var t=Ct(),e=Cn().Graph,r=Nr();Hb={positionX:y,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:s,verticalAlignment:f,horizontalCompaction:c,alignCoordinates:g,findSmallestWidthAlignment:v,balance:m};function n(_,E){var S={};function C(k,O){var q=0,M=0,A=k.length,L=t.last(O);return t.forEach(O,function(R,B){var D=u(_,R),N=D?_.node(D).order:A;(D||R===L)&&(t.forEach(O.slice(M,B+1),function(U){t.forEach(_.predecessors(U),function(z){var G=_.node(z),V=G.order;(VL)&&o(S,D,R)})})}function k(O,q){var M=-1,A,L=0;return t.forEach(q,function(R,B){if(_.node(R).dummy==="border"){var D=_.predecessors(R);D.length&&(A=_.node(D[0]).order,C(q,L,B,M,A),L=B,M=A)}C(q,L,q.length,A,O.length)}),q}return t.reduce(E,k),S}function u(_,E){if(_.node(E).dummy)return t.find(_.predecessors(E),function(S){return _.node(S).dummy})}function o(_,E,S){if(E>S){var C=E;E=S,S=C}var k=_[E];k||(_[E]=k={}),k[S]=!0}function s(_,E,S){if(E>S){var C=E;E=S,S=C}return t.has(_[E],S)}function f(_,E,S,C){var k={},O={},q={};return t.forEach(E,function(M){t.forEach(M,function(A,L){k[A]=A,O[A]=A,q[A]=L})}),t.forEach(E,function(M){var A=-1;t.forEach(M,function(L){var R=C(L);if(R.length){R=t.sortBy(R,function(z){return q[z]});for(var B=(R.length-1)/2,D=Math.floor(B),N=Math.ceil(B);D<=N;++D){var U=R[D];O[L]===L&&A1?o-1:0),f=1;f=this.R))return this.merge(v.a,v.b,c),!0}},f.prototype.nEdges=function(c,d){var v=c.incoming.intersection(d.incoming),g=c.outgoing.intersection(d.outgoing);return this.R-v.count()-g.count()},f.prototype.getGroupHierarchy=function(c){var d=this,v=[],g={};r(this.roots[0],g,v);var m=this.allEdges();return m.forEach(function(y){var x=d.modules[y.source],w=d.modules[y.target];c.push(new t(typeof x.gid>"u"?y.source:v[x.gid],typeof w.gid>"u"?y.target:v[w.gid],y.type))}),v},f.prototype.allEdges=function(){var c=[];return f.getEdges(this.roots[0],c),c},f.getEdges=function(c,d){c.forAll(function(v){v.getEdges(d),f.getEdges(v.children,d)})},f}();fa.Configuration=e;function r(f,c,d){f.forAll(function(v){if(v.isLeaf())c.leaves||(c.leaves=[]),c.leaves.push(v.id);else{var g=c;if(v.gid=d.length,!v.isIsland()||v.isPredefined()){if(g={id:v.gid},v.isPredefined())for(var m in v.definition)g[m]=v.definition[m];c.groups||(c.groups=[]),c.groups.push(v.gid),d.push(g)}r(v.children,g,d)}})}var n=function(){function f(c,d,v,g,m){d===void 0&&(d=new o),v===void 0&&(v=new o),g===void 0&&(g=new u),this.id=c,this.outgoing=d,this.incoming=v,this.children=g,this.definition=m}return f.prototype.getEdges=function(c){var d=this;this.outgoing.forAll(function(v,g){v.forAll(function(m){c.push(new t(d.id,m.id,g))})})},f.prototype.isLeaf=function(){return this.children.count()===0},f.prototype.isIsland=function(){return this.outgoing.count()===0&&this.incoming.count()===0},f.prototype.isPredefined=function(){return typeof this.definition<"u"},f}();fa.Module=n;function a(f,c){var d={};for(var v in f)v in c&&(d[v]=f[v]);return d}var u=function(){function f(){this.table={}}return f.prototype.count=function(){return Object.keys(this.table).length},f.prototype.intersection=function(c){var d=new f;return d.table=a(this.table,c.table),d},f.prototype.intersectionCount=function(c){return this.intersection(c).count()},f.prototype.contains=function(c){return c in this.table},f.prototype.add=function(c){this.table[c.id]=c},f.prototype.remove=function(c){delete this.table[c.id]},f.prototype.forAll=function(c){for(var d in this.table)c(this.table[d])},f.prototype.modules=function(){var c=[];return this.forAll(function(d){d.isPredefined()||c.push(d)}),c},f}();fa.ModuleSet=u;var o=function(){function f(){this.sets={},this.n=0}return f.prototype.count=function(){return this.n},f.prototype.contains=function(c){var d=!1;return this.forAllModules(function(v){!d&&v.id==c&&(d=!0)}),d},f.prototype.add=function(c,d){var v=c in this.sets?this.sets[c]:this.sets[c]=new u;v.add(d),++this.n},f.prototype.remove=function(c,d){var v=this.sets[c];v.remove(d),v.count()===0&&delete this.sets[c],--this.n},f.prototype.forAll=function(c){for(var d in this.sets)c(this.sets[d],Number(d))},f.prototype.forAllModules=function(c){this.forAll(function(d,v){return d.forAll(c)})},f.prototype.intersection=function(c){var d=new f;return this.forAll(function(v,g){if(g in c.sets){var m=v.intersection(c.sets[g]),y=m.count();y>0&&(d.sets[g]=m,d.n+=y)}}),d},f}();fa.LinkSets=o;function s(f,c,d,v){for(var g=f.length,m=new e(g,c,d,v);m.greedyMerge(););var y=[],x=m.getGroupHierarchy(y);return y.forEach(function(w){var _=function(E){var S=w[E];typeof S=="number"&&(w[E]=f[S])};_("source"),_("target")}),{groups:x,powerEdges:y}}return fa.getGroups=s,fa}var Ai={},KM;function dw(){if(KM)return Ai;KM=1,Object.defineProperty(Ai,"__esModule",{value:!0});function t(f,c){var d={};for(var v in f)d[v]={};for(var v in c)d[v]={};return Object.keys(d).length}function e(f,c){var d=0;for(var v in f)typeof c[v]<"u"&&++d;return d}function r(f,c){var d={},v=function(g,m){typeof d[g]>"u"&&(d[g]={}),d[g][m]={}};return f.forEach(function(g){var m=c.getSourceIndex(g),y=c.getTargetIndex(g);v(m,y),v(y,m)}),d}function n(f,c,d,v){var g=r(f,v);f.forEach(function(m){var y=g[v.getSourceIndex(m)],x=g[v.getTargetIndex(m)];v.setLength(m,1+c*d(y,x))})}function a(f,c,d){d===void 0&&(d=1),n(f,d,function(v,g){return Math.sqrt(t(v,g)-e(v,g))},c)}Ai.symmetricDiffLinkLengths=a;function u(f,c,d){d===void 0&&(d=1),n(f,d,function(v,g){return Math.min(Object.keys(v).length,Object.keys(g).length)<1.1?0:e(v,g)/t(v,g)},c)}Ai.jaccardLinkLengths=u;function o(f,c,d,v){var g=s(f,c,v),m={};g.forEach(function(x,w){return x.forEach(function(_){return m[_]=w})});var y=[];return c.forEach(function(x){var w=v.getSourceIndex(x),_=v.getTargetIndex(x),E=m[w],S=m[_];E!==S&&y.push({axis:d,left:w,right:_,gap:v.getMinSeparation(x)})}),y}Ai.generateDirectedEdgeConstraints=o;function s(f,c,d){var v=[],g=0,m=[],y=[];function x(A){A.index=A.lowlink=g++,m.push(A),A.onStack=!0;for(var L=0,R=A.out;L"u"?(x(B),A.lowlink=Math.min(A.lowlink,B.lowlink)):B.onStack&&(A.lowlink=Math.min(A.lowlink,B.index))}if(A.lowlink===A.index){for(var D=[];m.length&&(B=m.pop(),B.onStack=!1,D.push(B),B!==A););y.push(D.map(function(N){return N.id}))}}for(var w=0;w"u"&&x(M)}return y}return Ai.stronglyConnectedComponents=s,Ai}var qu={},XM;function hw(){if(XM)return qu;XM=1,Object.defineProperty(qu,"__esModule",{value:!0});var t=function(){function n(){this.locks={}}return n.prototype.add=function(a,u){this.locks[a]=u},n.prototype.clear=function(){this.locks={}},n.prototype.isEmpty=function(){for(var a in this.locks)return!1;return!0},n.prototype.apply=function(a){for(var u in this.locks)a(Number(u),this.locks[u])},n}();qu.Locks=t;var e=function(){function n(a,u,o){o===void 0&&(o=null),this.D=u,this.G=o,this.threshold=1e-4,this.numGridSnapNodes=0,this.snapGridSize=100,this.snapStrength=1e3,this.scaleSnapByMaxH=!1,this.random=new r,this.project=null,this.x=a,this.k=a.length;var s=this.n=a[0].length;this.H=new Array(this.k),this.g=new Array(this.k),this.Hd=new Array(this.k),this.a=new Array(this.k),this.b=new Array(this.k),this.c=new Array(this.k),this.d=new Array(this.k),this.e=new Array(this.k),this.ia=new Array(this.k),this.ib=new Array(this.k),this.xtmp=new Array(this.k),this.locks=new t,this.minD=Number.MAX_VALUE;for(var f=s,c;f--;)for(c=s;--c>f;){var d=u[f][c];d>0&&d1e-9)break;var _=this.offsetDir();for(s=0;s1&&E>S||!isFinite(S)){for(s=0;s1&&(C=1);var k=S*S,O=2*C*(E-S)/(k*E),q=E*E*E,M=2*-C/(k*q);for(isFinite(O)||console.log(O),s=0;s0?N-(G+1)*L:N-(G-1)*L;-A0;)for(var f=u;f-- >0;)o(s,f)},n.prototype.matrixApply=function(a){n.mApply(this.k,this.n,a)},n.prototype.computeNextPosition=function(a,u){var o=this;this.computeDerivatives(a);var s=this.computeStepSize(this.g);if(this.stepAndProject(a,u,this.g,s),this.project){this.matrixApply(function(c,d){return o.e[c][d]=a[c][d]-u[c][d]});var f=this.computeStepSize(this.e);f=Math.max(.2,Math.min(f,1)),this.stepAndProject(a,u,this.e,f)}},n.prototype.run=function(a){for(var u=Number.MAX_VALUE,o=!1;!o&&a-- >0;){var s=this.rungeKutta();o=Math.abs(u/s-1)>16)/this.range},n.prototype.getNextBetween=function(a,u){return a+this.getNext()*(u-a)},n}();return qu.PseudoRandom=r,qu}var _r={},Ln={},jM;function vw(){if(jM)return Ln;jM=1,Object.defineProperty(Ln,"__esModule",{value:!0});var t=function(){function s(f){this.scale=f,this.AB=0,this.AD=0,this.A2=0}return s.prototype.addVariable=function(f){var c=this.scale/f.scale,d=f.offset/f.scale,v=f.weight;this.AB+=v*c*d,this.AD+=v*c*f.desiredPosition,this.A2+=v*c*c},s.prototype.getPosn=function(){return(this.AD-this.AB)/this.A2},s}();Ln.PositionStats=t;var e=function(){function s(f,c,d,v){v===void 0&&(v=!1),this.left=f,this.right=c,this.gap=d,this.equality=v,this.active=!1,this.unsatisfiable=!1,this.left=f,this.right=c,this.gap=d,this.equality=v}return s.prototype.slack=function(){return this.unsatisfiable?Number.MAX_VALUE:this.right.scale*this.right.position()-this.gap-this.left.scale*this.left.position()},s}();Ln.Constraint=e;var r=function(){function s(f,c,d){c===void 0&&(c=1),d===void 0&&(d=1),this.desiredPosition=f,this.weight=c,this.scale=d,this.offset=0}return s.prototype.dfdv=function(){return 2*this.weight*(this.position()-this.desiredPosition)},s.prototype.position=function(){return(this.block.ps.scale*this.block.posn+this.offset)/this.scale},s.prototype.visitNeighbours=function(f,c){var d=function(v,g){return v.active&&f!==g&&c(v,g)};this.cOut.forEach(function(v){return d(v,v.right)}),this.cIn.forEach(function(v){return d(v,v.left)})},s}();Ln.Variable=r;var n=function(){function s(f){this.vars=[],f.offset=0,this.ps=new t(f.scale),this.addVariable(f)}return s.prototype.addVariable=function(f){f.block=this,this.vars.push(f),this.ps.addVariable(f),this.posn=this.ps.getPosn()},s.prototype.updateWeightedPosition=function(){this.ps.AB=this.ps.AD=this.ps.A2=0;for(var f=0,c=this.vars.length;f=0?this.inactive.push(f):this.bs.merge(f)}}},s.prototype.solve=function(){this.satisfy();for(var f=Number.MAX_VALUE,c=this.bs.cost();Math.abs(f-c)>1e-4;)this.satisfy(),f=c,c=this.bs.cost();return c},s.LAGRANGIAN_TOLERANCE=-1e-4,s.ZERO_UPPERBOUND=-1e-10,s}();Ln.Solver=u;function o(s,f,c){for(var d=s.map(function(q){return new r(q.desiredCenter)}),v=[],g=s.length,m=0;m0)}return null}}return u.prototype.clear=function(){this._root=null,this.size=0},u.prototype.find=function(o){for(var s=this._root;s!==null;){var f=this._comparator(o,s.data);if(f===0)return s.data;s=s.get_child(f>0)}return null},u.prototype.lowerBound=function(o){return this._bound(o,this._comparator)},u.prototype.upperBound=function(o){var s=this._comparator;function f(c,d){return s(d,c)}return this._bound(o,f)},u.prototype.min=function(){var o=this._root;if(o===null)return null;for(;o.left!==null;)o=o.left;return o.data},u.prototype.max=function(){var o=this._root;if(o===null)return null;for(;o.right!==null;)o=o.right;return o.data},u.prototype.iterator=function(){return new r(this)},u.prototype.each=function(o){for(var s=this.iterator(),f;(f=s.next())!==null;)o(f)},u.prototype.reach=function(o){for(var s=this.iterator(),f;(f=s.prev())!==null;)o(f)},u.prototype._bound=function(o,s){for(var f=this._root,c=this.iterator();f!==null;){var d=this._comparator(o,f.data);if(d===0)return c._cursor=f,c;c._ancestors.push(f),f=f.get_child(d>0)}for(var v=c._ancestors.length-1;v>=0;--v)if(f=c._ancestors[v],s(o,f.data)>0)return c._cursor=f,c._ancestors.length=v,c;return c._ancestors.length=0,c},u}();Va.TreeBase=e;var r=function(){function u(o){this._tree=o,this._ancestors=[],this._cursor=null}return u.prototype.data=function(){return this._cursor!==null?this._cursor.data:null},u.prototype.next=function(){if(this._cursor===null){var o=this._tree._root;o!==null&&this._minNode(o)}else if(this._cursor.right===null){var s;do if(s=this._cursor,this._ancestors.length)this._cursor=this._ancestors.pop();else{this._cursor=null;break}while(this._cursor.right===s)}else this._ancestors.push(this._cursor),this._minNode(this._cursor.right);return this._cursor!==null?this._cursor.data:null},u.prototype.prev=function(){if(this._cursor===null){var o=this._tree._root;o!==null&&this._maxNode(o)}else if(this._cursor.left===null){var s;do if(s=this._cursor,this._ancestors.length)this._cursor=this._ancestors.pop();else{this._cursor=null;break}while(this._cursor.left===s)}else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left);return this._cursor!==null?this._cursor.data:null},u.prototype._minNode=function(o){for(;o.left!==null;)this._ancestors.push(o),o=o.left;this._cursor=o},u.prototype._maxNode=function(o){for(;o.right!==null;)this._ancestors.push(o),o=o.right;this._cursor=o},u}();Va.Iterator=r;var n=function(){function u(o){this.data=o,this.left=null,this.right=null,this.red=!0}return u.prototype.get_child=function(o){return o?this.right:this.left},u.prototype.set_child=function(o,s){o?this.right=s:this.left=s},u}(),a=function(u){t(o,u);function o(s){var f=u.call(this)||this;return f._root=null,f._comparator=s,f.size=0,f}return o.prototype.insert=function(s){var f=!1;if(this._root===null)this._root=new n(s),f=!0,this.size++;else{var c=new n(void 0),d=!1,v=!1,g=null,m=c,y=null,x=this._root;for(m.right=this._root;;){if(x===null?(x=new n(s),y.set_child(d,x),f=!0,this.size++):o.is_red(x.left)&&o.is_red(x.right)&&(x.red=!0,x.left.red=!1,x.right.red=!1),o.is_red(x)&&o.is_red(y)){var w=m.right===g;x===y.get_child(v)?m.set_child(w,o.single_rotate(g,!v)):m.set_child(w,o.double_rotate(g,!v))}var _=this._comparator(x.data,s);if(_===0)break;v=d,d=_<0,g!==null&&(m=g),g=y,y=x,x=x.get_child(d)}this._root=c.right}return this._root.red=!1,f},o.prototype.remove=function(s){if(this._root===null)return!1;var f=new n(void 0),c=f;c.right=this._root;for(var d=null,v=null,g=null,m=!0;c.get_child(m)!==null;){var y=m;v=d,d=c,c=c.get_child(m);var x=this._comparator(s,c.data);if(m=x>0,x===0&&(g=c),!o.is_red(c)&&!o.is_red(c.get_child(m))){if(o.is_red(c.get_child(!m))){var w=o.single_rotate(c,m);d.set_child(y,w),d=w}else if(!o.is_red(c.get_child(!m))){var _=d.get_child(!y);if(_!==null)if(!o.is_red(_.get_child(!y))&&!o.is_red(_.get_child(y)))d.red=!1,_.red=!0,c.red=!0;else{var E=v.right===d;o.is_red(_.get_child(y))?v.set_child(E,o.double_rotate(d,y)):o.is_red(_.get_child(!y))&&v.set_child(E,o.single_rotate(d,y));var S=v.get_child(E);S.red=!0,c.red=!0,S.left.red=!1,S.right.red=!1}}}}return g!==null&&(g.data=c.data,d.set_child(d.right===c,c.get_child(c.left===null)),this.size--),this._root=f.right,this._root!==null&&(this._root.red=!1),g!==null},o.is_red=function(s){return s!==null&&s.red},o.single_rotate=function(s,f){var c=s.get_child(!f);return s.set_child(!f,c.get_child(f)),c.set_child(f,s),s.red=!0,c.red=!1,c},o.double_rotate=function(s,f){return s.set_child(!f,o.single_rotate(s.get_child(!f),!f)),o.single_rotate(s,f)},o}(e);return Va.RBTree=a,Va}var QM;function el(){if(QM)return _r;QM=1;var t=_r&&_r.__extends||function(){var M=function(A,L){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,B){R.__proto__=B}||function(R,B){for(var D in B)B.hasOwnProperty(D)&&(R[D]=B[D])},M(A,L)};return function(A,L){M(A,L);function R(){this.constructor=A}A.prototype=L===null?Object.create(L):(R.prototype=L.prototype,new R)}}();Object.defineProperty(_r,"__esModule",{value:!0});var e=vw(),r=RB();function n(M){return M.bounds=typeof M.leaves<"u"?M.leaves.reduce(function(A,L){return L.bounds.union(A)},a.empty()):a.empty(),typeof M.groups<"u"&&(M.bounds=M.groups.reduce(function(A,L){return n(L).union(A)},M.bounds)),M.bounds=M.bounds.inflate(M.padding),M.bounds}_r.computeGroupBounds=n;var a=function(){function M(A,L,R,B){this.x=A,this.X=L,this.y=R,this.Y=B}return M.empty=function(){return new M(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)},M.prototype.cx=function(){return(this.x+this.X)/2},M.prototype.cy=function(){return(this.y+this.Y)/2},M.prototype.overlapX=function(A){var L=this.cx(),R=A.cx();return L<=R&&A.x0?R[0]:null},M.prototype.vertices=function(){return[{x:this.x,y:this.y},{x:this.X,y:this.y},{x:this.X,y:this.Y},{x:this.x,y:this.Y}]},M.lineIntersection=function(A,L,R,B,D,N,U,z){var G=R-A,V=U-D,K=B-L,I=z-N,H=I*G-V*K;if(H==0)return null;var Q=A-D,te=L-N,Y=V*te-I*Q,X=Y/H,j=G*te-K*Q,re=j/H;return X>=0&&X<=1&&re>=0&&re<=1?{x:A+X*G,y:L+X*K}:null},M.prototype.inflate=function(A){return new M(this.x-A,this.X+A,this.y-A,this.Y+A)},M}();_r.Rectangle=a;function u(M,A,L){var R=M.rayIntersection(A.cx(),A.cy())||{x:M.cx(),y:M.cy()},B=A.rayIntersection(M.cx(),M.cy())||{x:A.cx(),y:A.cy()},D=B.x-R.x,N=B.y-R.y,U=Math.sqrt(D*D+N*N),z=U-L;return{sourceIntersection:R,targetIntersection:B,arrowStart:{x:R.x+z*D/U,y:R.y+z*N/U}}}_r.makeEdgeBetween=u;function o(M,A,L){var R=A.rayIntersection(M.x,M.y);R||(R={x:A.cx(),y:A.cy()});var B=R.x-M.x,D=R.y-M.y,N=Math.sqrt(B*B+D*D);return{x:R.x-L*B/N,y:R.y-L*D/N}}_r.makeEdgeTo=o;var s=function(){function M(A,L,R){this.v=A,this.r=L,this.pos=R,this.prev=d(),this.next=d()}return M}(),f=function(){function M(A,L,R){this.isOpen=A,this.v=L,this.pos=R}return M}();function c(M,A){return M.pos>A.pos?1:M.pos=D);var U=new Array(N);for(B=0;B0&&(M[R].insert(D),D[B].insert(M))};L("next","prev"),L("prev","next")}function _(M,A){return y(M,A,v,1e-6)}_r.generateXConstraints=_;function E(M,A){return y(M,A,g,1e-6)}_r.generateYConstraints=E;function S(M){return m(M,v,1e-6)}_r.generateXGroupConstraints=S;function C(M){return m(M,g,1e-6)}_r.generateYGroupConstraints=C;function k(M){var A=M.map(function(B){return new e.Variable(B.cx())}),L=_(M,A),R=new e.Solver(A,L);R.solve(),A.forEach(function(B,D){return M[D].setXCentre(B.position())}),A=M.map(function(B){return new e.Variable(B.cy())}),L=E(M,A),R=new e.Solver(A,L),R.solve(),A.forEach(function(B,D){return M[D].setYCentre(B.position())})}_r.removeOverlaps=k;var O=function(M){t(A,M);function A(L,R){var B=M.call(this,0,R)||this;return B.index=L,B}return A}(e.Variable);_r.IndexedVariable=O;var q=function(){function M(A,L,R,B,D){var N=this;if(R===void 0&&(R=null),B===void 0&&(B=null),D===void 0&&(D=!1),this.nodes=A,this.groups=L,this.rootGroup=R,this.avoidOverlaps=D,this.variables=A.map(function(z,G){return z.variable=new O(G,1)}),B&&this.createConstraints(B),D&&R&&typeof R.groups<"u"){A.forEach(function(z){if(!z.width||!z.height){z.bounds=new a(z.x,z.x,z.y,z.y);return}var G=z.width/2,V=z.height/2;z.bounds=new a(z.x-G,z.x+G,z.y-V,z.y+V)}),n(R);var U=A.length;L.forEach(function(z){N.variables[U]=z.minVar=new O(U++,typeof z.stiffness<"u"?z.stiffness:.01),N.variables[U]=z.maxVar=new O(U++,typeof z.stiffness<"u"?z.stiffness:.01)})}}return M.prototype.createSeparation=function(A){return new e.Constraint(this.nodes[A.left].variable,this.nodes[A.right].variable,A.gap,typeof A.equality<"u"?A.equality:!1)},M.prototype.makeFeasible=function(A){var L=this;if(this.avoidOverlaps){var R="x",B="width";A.axis==="x"&&(R="y",B="height");var D=A.offsets.map(function(U){return L.nodes[U.node]}).sort(function(U,z){return U[R]-z[R]}),N=null;D.forEach(function(U){if(N){var z=N[R]+N[B];z>U[R]&&(U[R]=z)}N=U})}},M.prototype.createAlignment=function(A){var L=this,R=this.nodes[A.offsets[0].node].variable;this.makeFeasible(A);var B=A.axis==="x"?this.xConstraints:this.yConstraints;A.offsets.slice(1).forEach(function(D){var N=L.nodes[D.node].variable;B.push(new e.Constraint(R,N,D.offset,!0))})},M.prototype.createConstraints=function(A){var L=this,R=function(B){return typeof B.type>"u"||B.type==="separation"};this.xConstraints=A.filter(function(B){return B.axis==="x"&&R(B)}).map(function(B){return L.createSeparation(B)}),this.yConstraints=A.filter(function(B){return B.axis==="y"&&R(B)}).map(function(B){return L.createSeparation(B)}),A.filter(function(B){return B.type==="alignment"}).forEach(function(B){return L.createAlignment(B)})},M.prototype.setupVariablesAndBounds=function(A,L,R,B){this.nodes.forEach(function(D,N){D.fixed?(D.variable.weight=D.fixedWeight?D.fixedWeight:1e3,R[N]=B(D)):D.variable.weight=1;var U=(D.width||0)/2,z=(D.height||0)/2,G=A[N],V=L[N];D.bounds=new a(G-U,G+U,V-z,V+z)})},M.prototype.xProject=function(A,L,R){!this.rootGroup&&!(this.avoidOverlaps||this.xConstraints)||this.project(A,L,A,R,function(B){return B.px},this.xConstraints,S,function(B){return B.bounds.setXCentre(R[B.variable.index]=B.variable.position())},function(B){var D=R[B.minVar.index]=B.minVar.position(),N=R[B.maxVar.index]=B.maxVar.position(),U=B.padding/2;B.bounds.x=D-U,B.bounds.X=N+U})},M.prototype.yProject=function(A,L,R){!this.rootGroup&&!this.yConstraints||this.project(A,L,L,R,function(B){return B.py},this.yConstraints,C,function(B){return B.bounds.setYCentre(R[B.variable.index]=B.variable.position())},function(B){var D=R[B.minVar.index]=B.minVar.position(),N=R[B.maxVar.index]=B.maxVar.position(),U=B.padding/2;B.bounds.y=D-U,B.bounds.Y=N+U})},M.prototype.projectFunctions=function(){var A=this;return[function(L,R,B){return A.xProject(L,R,B)},function(L,R,B){return A.yProject(L,R,B)}]},M.prototype.project=function(A,L,R,B,D,N,U,z,G){this.setupVariablesAndBounds(A,L,B,D),this.rootGroup&&this.avoidOverlaps&&(n(this.rootGroup),N=N.concat(U(this.rootGroup))),this.solve(this.variables,N,R,B),this.nodes.forEach(z),this.rootGroup&&this.avoidOverlaps&&(this.groups.forEach(G),n(this.rootGroup))},M.prototype.solve=function(A,L,R,B){var D=new e.Solver(A,L);D.setStartingPositions(R),D.setDesiredPositions(B),D.solve()},M}();return _r.Projection=q,_r}var Rf={},fs={},WM;function DB(){if(WM)return fs;WM=1,Object.defineProperty(fs,"__esModule",{value:!0});var t=function(){function r(n){this.elem=n,this.subheaps=[]}return r.prototype.toString=function(n){for(var a="",u=!1,o=0;ow&&(y.d=w,y.prev=g,f.reduceKey(y.q,y,function(E,S){return E.q=S}))}}return d},u}();return Rf.Calculator=a,Rf}var Tt={},ek;function MB(){if(ek)return Tt;ek=1;var t=Tt&&Tt.__extends||function(){var D=function(N,U){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(z,G){z.__proto__=G}||function(z,G){for(var V in G)G.hasOwnProperty(V)&&(z[V]=G[V])},D(N,U)};return function(N,U){D(N,U);function z(){this.constructor=N}N.prototype=U===null?Object.create(U):(z.prototype=U.prototype,new z)}}();Object.defineProperty(Tt,"__esModule",{value:!0});var e=el(),r=function(){function D(){}return D}();Tt.Point=r;var n=function(){function D(N,U,z,G){this.x1=N,this.y1=U,this.x2=z,this.y2=G}return D}();Tt.LineSegment=n;var a=function(D){t(N,D);function N(){return D!==null&&D.apply(this,arguments)||this}return N}(r);Tt.PolyPoint=a;function u(D,N,U){return(N.x-D.x)*(U.y-D.y)-(U.x-D.x)*(N.y-D.y)}Tt.isLeft=u;function o(D,N,U){return u(D,N,U)>0}function s(D,N,U){return u(D,N,U)<0}function f(D){var N=D.slice(0).sort(function(X,j){return X.x!==j.x?j.x-X.x:j.y-X.y}),U=D.length,z,G=0,V=N[0].x;for(z=1;z=0&&N[z].x===te;z--);for(H=z+1,z=K;++z<=H;)if(!(u(N[G],N[H],N[z])>=0&&z1&&!(u(I[I.length-2],I[I.length-1],N[z])>0);)I.length-=1;z!=G&&I.push(N[z])}Q!=H&&I.push(N[Q]);var Y=I.length;for(z=H;--z>=K;)if(!(u(N[Q],N[K],N[z])>=0&&z>K)){for(;I.length>Y&&!(u(I[I.length-2],I[I.length-1],N[z])>0);)I.length-=1;z!=G&&I.push(N[z])}}return I}Tt.ConvexHull=f;function c(D,N,U){N.slice(0).sort(function(z,G){return Math.atan2(z.y-D.y,z.x-D.x)-Math.atan2(G.y-D.y,G.x-D.x)}).forEach(U)}Tt.clockwiseRadialSweep=c;function d(D,N){var U=N.slice(0);return U.push(N[0]),{rtan:v(D,U),ltan:g(D,U)}}function v(D,N){var U=N.length-1,z,G,V,K,I;if(s(D,N[1],N[0])&&!o(D,N[U-1],N[0]))return 0;for(z=0,G=U;;){if(G-z===1)return o(D,N[z],N[G])?z:G;if(V=Math.floor((z+G)/2),I=s(D,N[V+1],N[V]),I&&!o(D,N[V-1],N[V]))return V;K=o(D,N[z+1],N[z]),K?I||o(D,N[z],N[V])?G=V:z=V:I&&s(D,N[z],N[V])?G=V:z=V}}function g(D,N){var U=N.length-1,z,G,V,K,I;if(o(D,N[U-1],N[0])&&!s(D,N[1],N[0]))return 0;for(z=0,G=U;;){if(G-z===1)return s(D,N[z],N[G])?z:G;if(V=Math.floor((z+G)/2),I=s(D,N[V+1],N[V]),o(D,N[V-1],N[V])&&!I)return V;K=s(D,N[z+1],N[z]),K?I?s(D,N[z],N[V])?G=V:z=V:G=V:I?z=V:o(D,N[z],N[V])?G=V:z=V}}function m(D,N,U,z,G,V){var K,I;K=U(N[0],D),I=z(D[K],N);for(var H=!1;!H;){for(H=!0;K===D.length-1&&(K=0),!G(N[I],D[K],D[K+1]);)++K;for(;I===0&&(I=N.length-1),!V(D[K],N[I],N[I-1]);)--I,H=!1}return{t1:K,t2:I}}Tt.tangent_PolyPolyC=m;function y(D,N){var U=x(N,D);return{t1:U.t2,t2:U.t1}}Tt.LRtangent_PolyPolyC=y;function x(D,N){return m(D,N,v,g,o,s)}Tt.RLtangent_PolyPolyC=x;function w(D,N){return m(D,N,g,g,s,s)}Tt.LLtangent_PolyPolyC=w;function _(D,N){return m(D,N,v,v,o,o)}Tt.RRtangent_PolyPolyC=_;var E=function(){function D(N,U){this.t1=N,this.t2=U}return D}();Tt.BiTangent=E;var S=function(){function D(){}return D}();Tt.BiTangents=S;var C=function(D){t(N,D);function N(){return D!==null&&D.apply(this,arguments)||this}return N}(r);Tt.TVGPoint=C;var k=function(){function D(N,U,z,G){this.id=N,this.polyid=U,this.polyvertid=z,this.p=G,G.vv=this}return D}();Tt.VisibilityVertex=k;var O=function(){function D(N,U){this.source=N,this.target=U}return D.prototype.length=function(){var N=this.source.p.x-this.target.p.x,U=this.source.p.y-this.target.p.y;return Math.sqrt(N*N+U*U)},D}();Tt.VisibilityEdge=O;var q=function(){function D(N,U){if(this.P=N,this.V=[],this.E=[],U)this.V=U.V.slice(0),this.E=U.E.slice(0);else{for(var z=N.length,G=0;G0&&this.E.push(new O(V[K-1].vv,H))}V.length>1&&this.E.push(new O(V[0].vv,V[V.length-1].vv))}for(var G=0;G0)return!0;return!1},D}();Tt.TangentVisibilityGraph=q;function M(D,N){for(var U=[],z=1,G=N.length;z=0&&re>=0&&ie<0&&ee>=0&&W>=0&&J<0?G.ll=new E(V,K):j<=0&&re<=0&&ie>0&&ee<=0&&W<=0&&J>0?G.rr=new E(V,K):j<=0&&re>0&&ie<=0&&ee>=0&&W<0&&J>=0?G.rl=new E(V,K):j>=0&&re<0&&ie>=0&&ee<=0&&W>0&&J<=0&&(G.lr=new E(V,K))}return G}Tt.tangents=A;function L(D,N){for(var U=1,z=N.length;U0)return!0}return!1}return Tt.polysOverlap=B,Tt}var cs={},tk;function kB(){if(tk)return cs;tk=1,Object.defineProperty(cs,"__esModule",{value:!0});var t={PADDING:10,GOLDEN_SECTION:(1+Math.sqrt(5))/2,FLOAT_EPSILON:1e-4};function e(n,a,u,y,m,f){m===void 0&&(m=1),f===void 0&&(f=!0);var c=0,d=0,v=a,g=u,m=typeof m<"u"?m:1,y=typeof y<"u"?y:0,x=0,w=0,_=0,E=0,S=[];if(n.length==0)return;C(n),O(n),f&&k(n);function C(R){R.forEach(function(D){B(D)});function B(D){var N=Number.MAX_VALUE,U=Number.MAX_VALUE,z=0,G=0;D.array.forEach(function(V){var K=typeof V.width<"u"?V.width:y,I=typeof V.height<"u"?V.height:y;K/=2,I/=2,z=Math.max(V.x+K,z),N=Math.min(V.x-K,N),G=Math.max(V.y+I,G),U=Math.min(V.y-I,U)}),D.width=z-N,D.height=G-U}}function k(R){R.forEach(function(B){var D={x:0,y:0};B.array.forEach(function(z){D.x+=z.x,D.y+=z.y}),D.x/=B.array.length,D.y/=B.array.length;var N={x:D.x-B.width/2,y:D.y-B.height/2},U={x:B.x-N.x+v/2-x/2,y:B.y-N.y+g/2-w/2};B.array.forEach(function(z){z.x+=U.x,z.y+=U.y})})}function O(R,B){var D=Number.POSITIVE_INFINITY,N=0;R.sort(function(X,j){return j.height-X.height}),_=R.reduce(function(X,j){return X.width_||Q>t.FLOAT_EPSILON;){if(I!=1)var te=z-(z-U)/t.GOLDEN_SECTION,V=q(R,te);if(I!=0)var Y=U+(z-U)/t.GOLDEN_SECTION,K=q(R,Y);if(H=Math.abs(te-Y),Q=Math.abs(V-K),VK?(U=te,te=Y,V=K,I=1):(z=Y,Y=te,K=V,I=0),G++>100)break}q(R,N)}function q(R,B){S=[],x=0,w=0,E=d;for(var D=0;D=R.height&&S[N].x+S[N].width+R.width+t.PADDING-B<=t.FLOAT_EPSILON){D=S[N];break}S.push(R),D!==void 0?(R.x=D.x+D.width+t.PADDING,R.y=D.bottom,R.space_left=R.height,R.bottom=R.y,D.space_left-=R.height+t.PADDING,D.bottom+=R.height+t.PADDING):(R.y=E,E+=R.height+t.PADDING,R.x=c,R.bottom=R.y,R.space_left=R.height),R.y+R.height-w>-1e-4&&(w=R.y+R.height-d),R.x+R.width-x>-1e-4&&(x=R.x+R.width-c)}function A(R){var B=0;return R.forEach(function(D){return B+=D.width+t.PADDING}),B}function L(){return x/w}}cs.applyPacking=e;function r(n,a){for(var u={},o={},s=[],f=0,c=0;c"u"||typeof m.py>"u")&&(m.px=m.x,m.py=m.y);var x=[m.px,m.py];this._descent.locks.add(y,x)}var w=this._descent.rungeKutta();return w===0?this._alpha=0:typeof this._lastStress<"u"&&(this._alpha=w),this._lastStress=w,this.updateNodePositions(),this.trigger({type:f.tick,alpha:this._alpha,stress:this._lastStress}),!1},v.prototype.updateNodePositions=function(){for(var g=this._descent.x[0],m=this._descent.x[1],y,x=this._nodes.length;x--;)y=this._nodes[x],y.x=g[x],y.y=m[x]},v.prototype.nodes=function(g){if(!g){if(this._nodes.length===0&&this._links.length>0){var m=0;this._links.forEach(function(x){m=Math.max(m,x.source,x.target)}),this._nodes=new Array(++m);for(var y=0;y"u"&&(y.padding=1),typeof y.leaves<"u"&&y.leaves.forEach(function(x,w){typeof x=="number"&&((y.leaves[w]=m._nodes[x]).parent=y)}),typeof y.groups<"u"&&y.groups.forEach(function(x,w){typeof x=="number"&&((y.groups[w]=m._groups[x]).parent=y)})}),this._rootGroup.leaves=this._nodes.filter(function(y){return typeof y.parent>"u"}),this._rootGroup.groups=this._groups.filter(function(y){return typeof y.parent>"u"}),this):this._groups},v.prototype.powerGraphGroups=function(g){var m=e.getGroups(this._nodes,this._links,this.linkAccessor,this._rootGroup);return this.groups(m.groups),g(m),this},v.prototype.avoidOverlaps=function(g){return arguments.length?(this._avoidOverlaps=g,this):this._avoidOverlaps},v.prototype.handleDisconnected=function(g){return arguments.length?(this._handleDisconnected=g,this):this._handleDisconnected},v.prototype.flowLayout=function(g,m){return arguments.length||(g="y"),this._directedLinkConstraints={axis:g,getMinSeparation:typeof m=="number"?function(){return m}:m},this},v.prototype.links=function(g){return arguments.length?(this._links=g,this):this._links},v.prototype.constraints=function(g){return arguments.length?(this._constraints=g,this):this._constraints},v.prototype.distanceMatrix=function(g){return arguments.length?(this._distanceMatrix=g,this):this._distanceMatrix},v.prototype.size=function(g){return g?(this._canvasSize=g,this):this._canvasSize},v.prototype.defaultNodeSize=function(g){return g?(this._defaultNodeSize=g,this):this._defaultNodeSize},v.prototype.groupCompactness=function(g){return g?(this._groupCompactness=g,this):this._groupCompactness},v.prototype.linkDistance=function(g){return g?(this._linkDistance=typeof g=="function"?g:+g,this._linkLengthCalculator=null,this):this._linkDistance},v.prototype.linkType=function(g){return this._linkType=g,this},v.prototype.convergenceThreshold=function(g){return g?(this._threshold=typeof g=="function"?g:+g,this):this._threshold},v.prototype.alpha=function(g){return arguments.length?(g=+g,this._alpha?g>0?this._alpha=g:this._alpha=0:g>0&&(this._running||(this._running=!0,this.trigger({type:f.start,alpha:this._alpha=g}),this.kick())),this):this._alpha},v.prototype.getLinkLength=function(g){return typeof this._linkDistance=="function"?+this._linkDistance(g):this._linkDistance},v.setLinkLength=function(g,m){g.length=m},v.prototype.getLinkType=function(g){return typeof this._linkType=="function"?this._linkType(g):0},v.prototype.symmetricDiffLinkLengths=function(g,m){var y=this;return m===void 0&&(m=1),this.linkDistance(function(x){return g*x.length}),this._linkLengthCalculator=function(){return r.symmetricDiffLinkLengths(y._links,y.linkAccessor,m)},this},v.prototype.jaccardLinkLengths=function(g,m){var y=this;return m===void 0&&(m=1),this.linkDistance(function(x){return g*x.length}),this._linkLengthCalculator=function(){return r.jaccardLinkLengths(y._links,y.linkAccessor,m)},this},v.prototype.start=function(g,m,y,x,w,_){var E=this;g===void 0&&(g=0),m===void 0&&(m=0),y===void 0&&(y=0),x===void 0&&(x=0),w===void 0&&(w=!0),_===void 0&&(_=!0);var S,C=this.nodes().length,k=C+2*this._groups.length;this._links.length;var O=this._canvasSize[0],q=this._canvasSize[1],M=new Array(k),A=new Array(k),L=null,R=this._avoidOverlaps;this._nodes.forEach(function(K,I){K.index=I,typeof K.x>"u"&&(K.x=O/2,K.y=q/2),M[I]=K.x,A[I]=K.y}),this._linkLengthCalculator&&this._linkLengthCalculator();var B;this._distanceMatrix?B=this._distanceMatrix:(B=new u.Calculator(k,this._links,v.getSourceIndex,v.getTargetIndex,function(K){return E.getLinkLength(K)}).DistanceMatrix(),L=n.Descent.createSquareMatrix(k,function(){return 2}),this._links.forEach(function(K){typeof K.source=="number"&&(K.source=E._nodes[K.source]),typeof K.target=="number"&&(K.target=E._nodes[K.target])}),this._links.forEach(function(K){var I=v.getSourceIndex(K),H=v.getTargetIndex(K);L[I][H]=L[H][I]=K.weight||1}));var D=n.Descent.createSquareMatrix(k,function(K,I){return B[K][I]});if(this._rootGroup&&typeof this._rootGroup.groups<"u"){var S=C,N=function(I,H,Q,te){L[I][H]=L[H][I]=Q,D[I][H]=D[H][I]=te};this._groups.forEach(function(I){N(S,S+1,E._groupCompactness,.1),M[S]=0,A[S++]=0,M[S]=0,A[S++]=0})}else this._rootGroup={leaves:this._nodes,groups:[]};var U=this._constraints||[];this._directedLinkConstraints&&(this.linkAccessor.getMinSeparation=this._directedLinkConstraints.getMinSeparation,U=U.concat(r.generateDirectedEdgeConstraints(C,this._links,this._directedLinkConstraints.axis,this.linkAccessor))),this.avoidOverlaps(!1),this._descent=new n.Descent([M,A],D),this._descent.locks.clear();for(var S=0;S0&&(this._descent.project=new a.Projection(this._nodes,this._groups,this._rootGroup,U).projectFunctions()),this._descent.run(m),this.separateOverlappingComponents(O,q,_),this.avoidOverlaps(R),R&&(this._nodes.forEach(function(K,I){K.x=M[I],K.y=A[I]}),this._descent.project=new a.Projection(this._nodes,this._groups,this._rootGroup,U,!0).projectFunctions(),this._nodes.forEach(function(K,I){M[I]=K.x,A[I]=K.y})),this._descent.G=L,this._descent.run(y),x){this._descent.snapStrength=1e3,this._descent.snapGridSize=this._nodes[0].width,this._descent.numGridSnapNodes=C,this._descent.scaleSnapByMaxH=C!=k;var V=n.Descent.createSquareMatrix(k,function(K,I){return K>=C||I>=C?L[K][I]:0});this._descent.G=V,this._descent.run(x)}return this.updateNodePositions(),this.separateOverlappingComponents(O,q,_),w?this.resume():this},v.prototype.initialLayout=function(g,m,y){if(this._groups.length>0&&g>0){var x=this._nodes.length,w=this._links.map(function(E){return{source:E.source.index,target:E.target.index}}),_=this._nodes.map(function(E){return{index:E.index}});this._groups.forEach(function(E,S){_.push({index:E.index=x+S})}),this._groups.forEach(function(E,S){typeof E.leaves<"u"&&E.leaves.forEach(function(C){return w.push({source:E.index,target:C.index})}),typeof E.groups<"u"&&E.groups.forEach(function(C){return w.push({source:E.index,target:C.index})})}),new v().size(this.size()).nodes(_).links(w).avoidOverlaps(!1).linkDistance(this.linkDistance()).symmetricDiffLinkLengths(5).convergenceThreshold(1e-4).start(g,0,0,0,!1),this._nodes.forEach(function(E){m[E.index]=_[E.index].x,y[E.index]=_[E.index].y})}else this._descent.run(g)},v.prototype.separateOverlappingComponents=function(g,m,y){var x=this;if(y===void 0&&(y=!0),!this._distanceMatrix&&this._handleDisconnected){var w=this._descent.x[0],_=this._descent.x[1];this._nodes.forEach(function(S,C){S.x=w[C],S.y=_[C]});var E=s.separateGraphs(this._nodes,this._links);s.applyPacking(E,g,m,this._defaultNodeSize,1,y),this._nodes.forEach(function(S,C){x._descent.x[0][C]=S.x,x._descent.x[1][C]=S.y,S.bounds&&(S.bounds.setXCentre(S.x),S.bounds.setYCentre(S.y))})}},v.prototype.resume=function(){return this.alpha(.1)},v.prototype.stop=function(){return this.alpha(0)},v.prototype.prepareEdgeRouting=function(g){g===void 0&&(g=0),this._visibilityGraph=new o.TangentVisibilityGraph(this._nodes.map(function(m){return m.bounds.inflate(-g).vertices()}))},v.prototype.routeEdge=function(g,m,y){m===void 0&&(m=5);var x=[],w=new o.TangentVisibilityGraph(this._visibilityGraph.P,{V:this._visibilityGraph.V,E:this._visibilityGraph.E}),_={x:g.source.x,y:g.source.y},E={x:g.target.x,y:g.target.y},S=w.addPoint(_,g.source.index),C=w.addPoint(E,g.target.index);w.addEdgeIfVisible(_,E,g.source.index,g.target.index),typeof y<"u"&&y(w);var k=function(U){return U.source.id},O=function(U){return U.target.id},q=function(U){return U.length()},M=new u.Calculator(w.V.length,w.E,k,O,q),A=M.PathFromNodeToNode(S.id,C.id);if(A.length===1||A.length===w.V.length){var L=a.makeEdgeBetween(g.source.innerBounds,g.target.innerBounds,m);x=[L.sourceIntersection,L.arrowStart]}else{for(var R=A.length-2,B=w.V[A[R]].p,D=w.V[A[0]].p,x=[g.source.innerBounds.rayIntersection(B.x,B.y)],N=R;N>=0;--N)x.push(w.V[A[N]].p);x.push(a.makeEdgeTo(D,g.target.innerBounds,m))}return x},v.getSourceIndex=function(g){return typeof g.source=="number"?g.source:g.source.index},v.getTargetIndex=function(g){return typeof g.target=="number"?g.target:g.target.index},v.linkId=function(g){return v.getSourceIndex(g)+"-"+v.getTargetIndex(g)},v.dragStart=function(g){c(g)?v.storeOffset(g,v.dragOrigin(g)):(v.stopNode(g),g.fixed|=2)},v.stopNode=function(g){g.px=g.x,g.py=g.y},v.storeOffset=function(g,m){typeof g.leaves<"u"&&g.leaves.forEach(function(y){y.fixed|=2,v.stopNode(y),y._dragGroupOffsetX=y.x-m.x,y._dragGroupOffsetY=y.y-m.y}),typeof g.groups<"u"&&g.groups.forEach(function(y){return v.storeOffset(y,m)})},v.dragOrigin=function(g){return c(g)?{x:g.bounds.cx(),y:g.bounds.cy()}:g},v.drag=function(g,m){c(g)?(typeof g.leaves<"u"&&g.leaves.forEach(function(y){g.bounds.setXCentre(m.x),g.bounds.setYCentre(m.y),y.px=y._dragGroupOffsetX+m.x,y.py=y._dragGroupOffsetY+m.y}),typeof g.groups<"u"&&g.groups.forEach(function(y){return v.drag(y,m)})):(g.px=m.x,g.py=m.y)},v.dragEnd=function(g){c(g)?(typeof g.leaves<"u"&&g.leaves.forEach(function(m){v.dragEnd(m),delete m._dragGroupOffsetX,delete m._dragGroupOffsetY}),typeof g.groups<"u"&&g.groups.forEach(v.dragEnd)):g.fixed&=-7},v.mouseOver=function(g){g.fixed|=4,g.px=g.x,g.py=g.y},v.mouseOut=function(g){g.fixed&=-5},v}();t.Layout=d}(Zb)),Zb}var nk;function XG(){if(nk)return Ci;nk=1;var t=Ci&&Ci.__extends||function(){var a=function(u,o){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,f){s.__proto__=f}||function(s,f){for(var c in f)f.hasOwnProperty(c)&&(s[c]=f[c])},a(u,o)};return function(u,o){a(u,o);function s(){this.constructor=u}u.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)}}();Object.defineProperty(Ci,"__esModule",{value:!0});var e=tl(),r=function(a){t(u,a);function u(o){var s=a.call(this)||this,f=o;return f.trigger&&(s.trigger=f.trigger),f.kick&&(s.kick=f.kick),f.drag&&(s.drag=f.drag),f.on&&(s.on=f.on),s.dragstart=s.dragStart=e.Layout.dragStart,s.dragend=s.dragEnd=e.Layout.dragEnd,s}return u.prototype.trigger=function(o){},u.prototype.kick=function(){},u.prototype.drag=function(){},u.prototype.on=function(o,s){return this},u}(e.Layout);Ci.LayoutAdaptor=r;function n(a){return new r(a)}return Ci.adaptor=n,Ci}var Df={},Ri={},ak;function jG(){if(ak)return Ri;ak=1;var t=Ri&&Ri.__extends||function(){var a=function(u,o){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,f){s.__proto__=f}||function(s,f){for(var c in f)f.hasOwnProperty(c)&&(s[c]=f[c])},a(u,o)};return function(u,o){a(u,o);function s(){this.constructor=u}u.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)}}();Object.defineProperty(Ri,"__esModule",{value:!0});var e=tl(),r=function(a){t(u,a);function u(){var o=a.call(this)||this;o.event=d3.dispatch(e.EventType[e.EventType.start],e.EventType[e.EventType.tick],e.EventType[e.EventType.end]);var s=o;return o.drag=function(){if(!f)var f=d3.behavior.drag().origin(e.Layout.dragOrigin).on("dragstart.d3adaptor",e.Layout.dragStart).on("drag.d3adaptor",function(c){e.Layout.drag(c,d3.event),s.resume()}).on("dragend.d3adaptor",e.Layout.dragEnd);if(!arguments.length)return f;this.call(f)},o}return u.prototype.trigger=function(o){var s={type:e.EventType[o.type],alpha:o.alpha,stress:o.stress};this.event[s.type](s)},u.prototype.kick=function(){var o=this;d3.timer(function(){return a.prototype.tick.call(o)})},u.prototype.on=function(o,s){return typeof o=="string"?this.event.on(o,s):this.event.on(e.EventType[o],s),this},u}(e.Layout);Ri.D3StyleLayoutAdaptor=r;function n(){return new r}return Ri.d3adaptor=n,Ri}var Bu={},ik;function ZG(){if(ik)return Bu;ik=1;var t=Bu&&Bu.__extends||function(){var n=function(a,u){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var f in s)s.hasOwnProperty(f)&&(o[f]=s[f])},n(a,u)};return function(a,u){n(a,u);function o(){this.constructor=a}a.prototype=u===null?Object.create(u):(o.prototype=u.prototype,new o)}}();Object.defineProperty(Bu,"__esModule",{value:!0});var e=tl(),r=function(n){t(a,n);function a(u){var o=n.call(this)||this;o.d3Context=u,o.event=u.dispatch(e.EventType[e.EventType.start],e.EventType[e.EventType.tick],e.EventType[e.EventType.end]);var s=o;return o.drag=function(){if(!f)var f=u.drag().subject(e.Layout.dragOrigin).on("start.d3adaptor",e.Layout.dragStart).on("drag.d3adaptor",function(c){e.Layout.drag(c,u.event),s.resume()}).on("end.d3adaptor",e.Layout.dragEnd);if(!arguments.length)return f;arguments[0].call(f)},o}return a.prototype.trigger=function(u){var o={type:e.EventType[u.type],alpha:u.alpha,stress:u.stress};this.event.call(o.type,o)},a.prototype.kick=function(){var u=this,o=this.d3Context.timer(function(){return n.prototype.tick.call(u)&&o.stop()})},a.prototype.on=function(u,o){return typeof u=="string"?this.event.on(u,o):this.event.on(e.EventType[u],o),this},a}(e.Layout);return Bu.D3StyleLayoutAdaptor=r,Bu}var uk;function QG(){if(uk)return Df;uk=1,Object.defineProperty(Df,"__esModule",{value:!0});var t=jG(),e=ZG();function r(a){return!a||n(a)?new t.D3StyleLayoutAdaptor:new e.D3StyleLayoutAdaptor(a)}Df.d3adaptor=r;function n(a){var u=/^3\./;return a.version&&a.version.match(u)!==null}return Df}var Di={},ok;function OB(){if(ok)return Di;ok=1,Object.defineProperty(Di,"__esModule",{value:!0});var t=el(),e=vw(),r=Xc(),n=function(){function s(f,c,d){this.id=f,this.rect=c,this.children=d,this.leaf=typeof d>"u"||d.length===0}return s}();Di.NodeWrapper=n;var a=function(){function s(f,c,d,v,g){v===void 0&&(v=null),g===void 0&&(g=null),this.id=f,this.x=c,this.y=d,this.node=v,this.line=g}return s}();Di.Vert=a;var u=function(){function s(f,c){this.s=f,this.t=c;var d=s.findMatch(f,c),v=c.slice(0).reverse(),g=s.findMatch(f,v);d.length>=g.length?(this.length=d.length,this.si=d.si,this.ti=d.ti,this.reversed=!1):(this.length=g.length,this.si=g.si,this.ti=c.length-g.ti-g.length,this.reversed=!0)}return s.findMatch=function(f,c){for(var d=f.length,v=c.length,g={length:0,si:-1,ti:-1},m=new Array(d),y=0;yg.length&&(g.length=w,g.si=y-w+1,g.ti=x-w+1)}else m[y][x]=0}return g},s.prototype.getSequence=function(){return this.length>=0?this.s.slice(this.si,this.si+this.length):[]},s}();Di.LongestCommonSubsequence=u;var o=function(){function s(f,c,d){var v=this;d===void 0&&(d=12),this.originalnodes=f,this.groupPadding=d,this.leaves=null,this.nodes=f.map(function(O,q){return new n(q,c.getBounds(O),c.getChildren(O))}),this.leaves=this.nodes.filter(function(O){return O.leaf}),this.groups=this.nodes.filter(function(O){return!O.leaf}),this.cols=this.getGridLines("x"),this.rows=this.getGridLines("y"),this.groups.forEach(function(O){return O.children.forEach(function(q){return v.nodes[q].parent=O})}),this.root={children:[]},this.nodes.forEach(function(O){typeof O.parent>"u"&&(O.parent=v.root,v.root.children.push(O.id)),O.ports=[]}),this.backToFront=this.nodes.slice(0),this.backToFront.sort(function(O,q){return v.getDepth(O)-v.getDepth(q)});var g=this.backToFront.slice(0).reverse().filter(function(O){return!O.leaf});g.forEach(function(O){var q=t.Rectangle.empty();O.children.forEach(function(M){return q=q.union(v.nodes[M].rect)}),O.rect=q.inflate(v.groupPadding)});var m=this.midPoints(this.cols.map(function(O){return O.pos})),y=this.midPoints(this.rows.map(function(O){return O.pos})),x=m[0],w=m[m.length-1],_=y[0],E=y[y.length-1],S=this.rows.map(function(O){return{x1:x,x2:w,y1:O.pos,y2:O.pos}}).concat(y.map(function(O){return{x1:x,x2:w,y1:O,y2:O}})),C=this.cols.map(function(O){return{x1:O.pos,x2:O.pos,y1:_,y2:E}}).concat(m.map(function(O){return{x1:O,x2:O,y1:_,y2:E}})),k=S.concat(C);k.forEach(function(O){return O.verts=[]}),this.verts=[],this.edges=[],S.forEach(function(O){return C.forEach(function(q){var M=new a(v.verts.length,q.x1,O.y1);O.verts.push(M),q.verts.push(M),v.verts.push(M);for(var A=v.backToFront.length;A-- >0;){var L=v.backToFront[A],R=L.rect,B=Math.abs(M.x-R.cx()),D=Math.abs(M.y-R.cy());if(B0;){var v=d.filter(function(m){return m.rect["overlap"+f.toUpperCase()](d[0].rect)}),g={nodes:v,pos:this.avg(v.map(function(m){return m.rect["c"+f]()}))};c.push(g),g.nodes.forEach(function(m){return d.splice(d.indexOf(m),1)})}return c.sort(function(m,y){return m.pos-y.pos}),c},s.prototype.getDepth=function(f){for(var c=0;f.parent!==this.root;)c++,f=f.parent;return c},s.prototype.midPoints=function(f){for(var c=f[1]-f[0],d=[f[0]-c/2],v=1;v.1)&&(E={pos:x[0][c],segments:[]},_.push(E)),E.segments.push(x)}return _},s.nudgeSegs=function(f,c,d,v,g,m){var y=v.length;if(!(y<=1)){for(var x=v.map(function(L){return new e.Variable(L[0][f])}),w=[],_=0;_=0&&w.push(new e.Constraint(x[q],x[M],m))}var A=new e.Solver(x,w);A.solve(),x.forEach(function(L,R){var B=v[R],D=L.position();B[0][f]=B[1][f]=D;var N=d[B.edgeid];B.i>0&&(N[B.i-1][1][f]=D),B.iMath.PI||g<-Math.PI)&&(g=v-d),g},s.isLeft=function(f,c,d){return(c.x-f.x)*(d.y-f.y)-(c.y-f.y)*(d.x-f.x)<=0},s.getOrder=function(f){for(var c={},d=0;d"u"&&(c[v.l]={}),c[v.l][v.r]=!0}return function(g,m){return typeof c[g]<"u"&&c[g][m]}},s.orderEdges=function(f){for(var c=[],d=0;d=g.length||y.ti+y.length>=m.length)){c.push({l:d,r:v});continue}y.si+y.length>=g.length||y.ti+y.length>=m.length?(x=g[y.si+1],_=g[y.si-1],w=m[y.ti-1]):(x=g[y.si+y.length-2],w=g[y.si+y.length],_=m[y.ti+y.length]),s.isLeft(x,w,_)?c.push({l:v,r:d}):c.push({l:d,r:v})}}return s.getOrder(c)},s.makeSegments=function(f){function c(w){return{x:w.x,y:w.y}}for(var d=function(w,_,E){return Math.abs((_.x-w.x)*(E.y-w.y)-(_.y-w.y)*(E.x-w.x))<.001},v=[],g=c(f[0]),m=1;m1&&U>1?1e3:0},O=C.PathFromNodeToNodeWithPrevCost(v.ports[0].id,g.ports[0].id,k),q=O.reverse().map(function(M){return d.verts[M]});return q.push(this.nodes[g.id].ports[0]),q.filter(function(M,A){return!(A0&&M.node===g&&q[A-1].node===g)})},s.getRoutePath=function(f,c,d,v){var g={routepath:"M "+f[0][0].x+" "+f[0][0].y+" ",arrowpath:""};if(f.length>1)for(var m=0;m0?x-=_/Math.abs(_)*c:w-=E/Math.abs(E)*c,g.routepath+="L "+x+" "+w+" ";var S=f[m+1],C=S[0].x,k=S[0].y,O=S[1].x,q=S[1].y;_=O-C,E=q-k;var M=s.angleBetween2Lines(y,S)<0?1:0,A,L;Math.abs(_)>0?(A=C+_/Math.abs(_)*c,L=k):(A=C,L=k+E/Math.abs(E)*c);var R=Math.abs(A-x),B=Math.abs(L-w);g.routepath+="A "+R+" "+B+" 0 0 "+M+" "+A+" "+L+" "}else{var D=[x,w],N,U;Math.abs(_)>0?(x-=_/Math.abs(_)*v,N=[x,w+d],U=[x,w-d]):(w-=E/Math.abs(E)*v,N=[x+d,w],U=[x-d,w]),g.routepath+="L "+x+" "+w+" ",v>0&&(g.arrowpath="M "+D[0]+" "+D[1]+" L "+N[0]+" "+N[1]+" L "+U[0]+" "+U[1])}}else{var y=f[0],x=y[1].x,w=y[1].y,_=x-y[0].x,E=w-y[0].y,D=[x,w],N,U;Math.abs(_)>0?(x-=_/Math.abs(_)*v,N=[x,w+d],U=[x,w-d]):(w-=E/Math.abs(E)*v,N=[x+d,w],U=[x-d,w]),g.routepath+="L "+x+" "+w+" ",v>0&&(g.arrowpath="M "+D[0]+" "+D[1]+" L "+N[0]+" "+N[1]+" L "+U[0]+" "+U[1])}return g},s}();return Di.GridRouter=o,Di}var Lu={},sk;function WG(){if(sk)return Lu;sk=1,Object.defineProperty(Lu,"__esModule",{value:!0});var t=Xc(),e=hw(),r=el(),n=dw(),a=function(){function f(c,d){this.source=c,this.target=d}return f.prototype.actualLength=function(c){var d=this;return Math.sqrt(c.reduce(function(v,g){var m=g[d.target]-g[d.source];return v+m*m},0))},f}();Lu.Link3D=a;var u=function(){function f(c,d,v){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),this.x=c,this.y=d,this.z=v}return f}();Lu.Node3D=u;var o=function(){function f(c,d,v){var g=this;v===void 0&&(v=1),this.nodes=c,this.links=d,this.idealLinkLength=v,this.constraints=null,this.useJaccardLinkLengths=!0,this.result=new Array(f.k);for(var m=0;m"u"&&(y[E]=Math.random())}g.result[0][x]=y.x,g.result[1][x]=y.y,g.result[2][x]=y.z})}return f.prototype.linkLength=function(c){return c.actualLength(this.result)},f.prototype.start=function(c){var d=this;c===void 0&&(c=100);var v=this.nodes.length,g=new s;this.useJaccardLinkLengths&&n.jaccardLinkLengths(this.links,g,1.5),this.links.forEach(function(E){return E.length*=d.idealLinkLength});var m=new t.Calculator(v,this.links,function(E){return E.source},function(E){return E.target},function(E){return E.length}).DistanceMatrix(),y=e.Descent.createSquareMatrix(v,function(E,S){return m[E][S]}),x=e.Descent.createSquareMatrix(v,function(){return 2});this.links.forEach(function(E){var S=E.source,C=E.target;return x[S][C]=x[C][S]=1}),this.descent=new e.Descent(this.result,y),this.descent.threshold=.001,this.descent.G=x,this.constraints&&(this.descent.project=new r.Projection(this.nodes,null,null,this.constraints).projectFunctions());for(var w=0;w"u"?"undefined":o(S))===o("")},g=function(S){return(typeof S>"u"?"undefined":o(S))===o(0)},m=function(S){return S!=null&&(typeof S>"u"?"undefined":o(S))===o({})},y=function(S){return S!=null&&(typeof S>"u"?"undefined":o(S))===o(function(){})},x=function(){},w=function(S,C){if(y(S)){var k=S;return k.apply(C,[C])}else return S};function _(E){this.options=s({},f,E)}_.prototype.run=function(){var E=this,S=this.options;E.manuallyStopped=!1;var C=S.cy,k=S.eles,O=k.nodes(),q=k.edges(),M=!1,A=function(ce){return ce.isParent()},L=O.filter(A),R=O.subtract(L),B=S.boundingBox||{x1:0,y1:0,w:C.width(),h:C.height()};B.x2===void 0&&(B.x2=B.x1+B.w),B.w===void 0&&(B.w=B.x2-B.x1),B.y2===void 0&&(B.y2=B.y1+B.h),B.h===void 0&&(B.h=B.y2-B.y1);var D=function(){for(var ce=0;ce0&&G.constraints(Q),G.groups(L.map(function(J,ce){var he=w(S.nodeSpacing,J),be=function(Be){return parseFloat(J.style("padding-"+Be))},_e=be("left")+he,Ne=be("right")+he,Ae=be("top")+he,Se=be("bottom")+he;return J.scratch().cola={index:ce,padding:Math.max(_e,Ne,Ae,Se),leaves:J.children().intersection(R).map(function(Te){return Te[0].scratch().cola.index}),fixed:J.locked()},J}).map(function(J){return J.scratch().cola.groups=J.children().intersection(L).map(function(ce){return ce.scratch().cola.index}),J.scratch().cola}));var X=void 0,j=void 0;S.edgeLength!=null?(X=S.edgeLength,j="linkDistance"):S.edgeSymDiffLength!=null?(X=S.edgeSymDiffLength,j="symmetricDiffLinkLengths"):S.edgeJaccardLength!=null?(X=S.edgeJaccardLength,j="jaccardLinkLengths"):(X=100,j="linkDistance");var re=function(ce){return ce.calcLength};if(G.links(q.stdFilter(function(J){return R.contains(J.source())&&R.contains(J.target())}).map(function(J){var ce=J.scratch().cola={source:J.source()[0].scratch().cola.index,target:J.target()[0].scratch().cola.index};return X!=null&&(ce.calcLength=w(X,J)),ce})),G.size([B.w,B.h]),X!=null&&G[j](re),S.flow){var ie=void 0,ee="y",W=50;v(S.flow)?ie={axis:S.flow,minSeparation:W}:g(S.flow)?ie={axis:ee,minSeparation:S.flow}:m(S.flow)?(ie=S.flow,ie.axis=ie.axis||ee,ie.minSeparation=ie.minSeparation!=null?ie.minSeparation:W):ie={axis:ee,minSeparation:W},G.flowLayout(ie.axis,ie.minSeparation)}return E.trigger({type:"layoutstart",layout:E}),G.avoidOverlaps(S.avoidOverlap).handleDisconnected(S.handleDisconnected).start(S.unconstrIter,S.userConstIter,S.allConstIter,void 0,void 0,S.centerGraph),S.infinite||setTimeout(function(){E.manuallyStopped||G.stop()},S.maxSimulationTime),this},_.prototype.stop=function(){return this.adaptor&&(this.manuallyStopped=!0,this.adaptor.stop()),this},n.exports=_},function(n,a,u){n.exports=Object.assign!=null?Object.assign.bind(Object):function(o){for(var s=arguments.length,f=Array(s>1?s-1:0),c=1;c"u"?"undefined":o(window))!=="undefined"?s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(f){return setTimeout(f,16)}:s=function(c){c()},n.exports=s},function(n,a){n.exports=r}])})}(Yf)),Yf.exports}var nV=rV();const aV=Bk(nV);function qB(t){for(var e=t.length/6|0,r=new Array(e),n=0;n>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Mf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Mf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=oV.exec(t))?new Lr(e[1],e[2],e[3],1):(e=sV.exec(t))?new Lr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=lV.exec(t))?Mf(e[1],e[2],e[3],e[4]):(e=fV.exec(t))?Mf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=cV.exec(t))?yk(e[1],e[2]/100,e[3]/100,1):(e=dV.exec(t))?yk(e[1],e[2]/100,e[3]/100,e[4]):dk.hasOwnProperty(t)?gk(dk[t]):t==="transparent"?new Lr(NaN,NaN,NaN,0):null}function gk(t){return new Lr(t>>16&255,t>>8&255,t&255,1)}function Mf(t,e,r,n){return n<=0&&(t=e=r=NaN),new Lr(t,e,r,n)}function gV(t){return t instanceof rl||(t=Ls(t)),t?(t=t.rgb(),new Lr(t.r,t.g,t.b,t.opacity)):new Lr}function sc(t,e,r,n){return arguments.length===1?gV(t):new Lr(t,e,r,n??1)}function Lr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}gw(Lr,sc,BB(rl,{brighter(t){return t=t==null?oc:Math.pow(oc,t),new Lr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?qs:Math.pow(qs,t),new Lr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Lr(Ni(this.r),Ni(this.g),Ni(this.b),lc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:pk,formatHex:pk,formatHex8:pV,formatRgb:mk,toString:mk}));function pk(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}`}function pV(){return`#${Li(this.r)}${Li(this.g)}${Li(this.b)}${Li((isNaN(this.opacity)?1:this.opacity)*255)}`}function mk(){const t=lc(this.opacity);return`${t===1?"rgb(":"rgba("}${Ni(this.r)}, ${Ni(this.g)}, ${Ni(this.b)}${t===1?")":`, ${t})`}`}function lc(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ni(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Li(t){return t=Ni(t),(t<16?"0":"")+t.toString(16)}function yk(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new _n(t,e,r,n)}function LB(t){if(t instanceof _n)return new _n(t.h,t.s,t.l,t.opacity);if(t instanceof rl||(t=Ls(t)),!t)return new _n;if(t instanceof _n)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),u=Math.max(e,r,n),o=NaN,s=u-a,f=(u+a)/2;return s?(e===u?o=(r-n)/s+(r0&&f<1?0:o,new _n(o,s,f,t.opacity)}function mV(t,e,r,n){return arguments.length===1?LB(t):new _n(t,e,r,n??1)}function _n(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}gw(_n,mV,BB(rl,{brighter(t){return t=t==null?oc:Math.pow(oc,t),new _n(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?qs:Math.pow(qs,t),new _n(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new Lr(Qb(t>=240?t-240:t+120,a,n),Qb(t,a,n),Qb(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new _n(bk(this.h),kf(this.s),kf(this.l),lc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=lc(this.opacity);return`${t===1?"hsl(":"hsla("}${bk(this.h)}, ${kf(this.s)*100}%, ${kf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function bk(t){return t=(t||0)%360,t<0?t+360:t}function kf(t){return Math.max(0,Math.min(1,t||0))}function Qb(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function yV(t,e,r,n,a){var u=t*t,o=u*t;return((1-3*t+3*u-o)*e+(4-6*u+3*o)*r+(1+3*t+3*u-3*o)*n+o*a)/6}function bV(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),a=t[n],u=t[n+1],o=n>0?t[n-1]:2*a-u,s=n()=>t;function wV(t,e){return function(r){return t+r*e}}function xV(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function _V(t){return(t=+t)==1?NB:function(e,r){return r-e?xV(e,r,t):pw(isNaN(e)?r:e)}}function NB(t,e){var r=e-t;return r?wV(t,r):pw(isNaN(t)?e:t)}const wk=function t(e){var r=_V(e);function n(a,u){var o=r((a=sc(a)).r,(u=sc(u)).r),s=r(a.g,u.g),f=r(a.b,u.b),c=NB(a.opacity,u.opacity);return function(d){return a.r=o(d),a.g=s(d),a.b=f(d),a.opacity=c(d),a+""}}return n.gamma=t,n}(1);function EV(t){return function(e){var r=e.length,n=new Array(r),a=new Array(r),u=new Array(r),o,s;for(o=0;or&&(u=e.slice(r,u),s[o]?s[o]+=u:s[++o]=u),(n=n[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,f.push({i:o,x:fc(n,a)})),r=Wb.lastIndex;return rSV(t[t.length-1]);var BV=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(qB);const PB=qV(BV);function $f(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function LV(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function IB(t){let e,r,n;t.length!==2?(e=$f,r=(s,f)=>$f(t(s),f),n=(s,f)=>t(s)-f):(e=t===$f||t===LV?t:NV,r=t,n=t);function a(s,f,c=0,d=s.length){if(c>>1;r(s[v],f)<0?c=v+1:d=v}while(c>>1;r(s[v],f)<=0?c=v+1:d=v}while(cc&&n(s[v-1],f)>-n(s[v],f)?v-1:v}return{left:a,center:o,right:u}}function NV(){return 0}function zV(t){return t===null?NaN:+t}const PV=IB($f),IV=PV.right;IB(zV).center;class xk extends Map{constructor(e,r=VV){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,a]of e)this.set(n,a)}get(e){return super.get(_k(this,e))}has(e){return super.has(_k(this,e))}set(e,r){return super.set(UV(this,e),r)}delete(e){return super.delete(GV(this,e))}}function _k({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function UV({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function GV({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function VV(t){return t!==null&&typeof t=="object"?t.valueOf():t}const HV=Math.sqrt(50),FV=Math.sqrt(10),YV=Math.sqrt(2);function cc(t,e,r){const n=(e-t)/Math.max(0,r),a=Math.floor(Math.log10(n)),u=n/Math.pow(10,a),o=u>=HV?10:u>=FV?5:u>=YV?2:1;let s,f,c;return a<0?(c=Math.pow(10,-a)/o,s=Math.round(t*c),f=Math.round(e*c),s/ce&&--f,c=-c):(c=Math.pow(10,a)*o,s=Math.round(t/c),f=Math.round(e/c),s*ce&&--f),f0))return[];if(t===e)return[t];const n=e=a))return[];const s=u-a+1,f=new Array(s);if(n)if(o<0)for(let c=0;ce&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function QV(t,e,r){var n=t[0],a=t[1],u=e[0],o=e[1];return a2?WV:QV,f=c=null,v}function v(g){return g==null||isNaN(g=+g)?u:(f||(f=s(t.map(n),e,r)))(n(o(g)))}return v.invert=function(g){return o(a((c||(c=s(e,t.map(n),fc)))(g)))},v.domain=function(g){return arguments.length?(t=Array.from(g,jV),d()):t.slice()},v.range=function(g){return arguments.length?(e=Array.from(g),d()):e.slice()},v.rangeRound=function(g){return e=Array.from(g),r=zB,d()},v.clamp=function(g){return arguments.length?(o=g?!0:cn,d()):o!==cn},v.interpolate=function(g){return arguments.length?(r=g,d()):r},v.unknown=function(g){return arguments.length?(u=g,v):u},function(g,m){return n=g,a=m,d()}}function JV(){return yw()(cn,cn)}function eH(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function dc(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Xu(t){return t=dc(Math.abs(t)),t?t[1]:NaN}function tH(t,e){return function(r,n){for(var a=r.length,u=[],o=0,s=t[0],f=0;a>0&&s>0&&(f+s+1>n&&(s=Math.max(1,n-f)),u.push(r.substring(a-=s,a+s)),!((f+=s+1)>n));)s=t[o=(o+1)%t.length];return u.reverse().join(e)}}function rH(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var nH=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ns(t){if(!(e=nH.exec(t)))throw new Error("invalid format: "+t);var e;return new bw({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ns.prototype=bw.prototype;function bw(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}bw.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function aH(t){e:for(var e=t.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(a+1):t}var GB;function iH(t,e){var r=dc(t,e);if(!r)return t+"";var n=r[0],a=r[1],u=a-(GB=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return u===o?n:u>o?n+new Array(u-o+1).join("0"):u>0?n.slice(0,u)+"."+n.slice(u):"0."+new Array(1-u).join("0")+dc(t,Math.max(0,e+u-1))[0]}function Tk(t,e){var r=dc(t,e);if(!r)return t+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const Ck={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:eH,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Tk(t*100,e),r:Tk,s:iH,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ak(t){return t}var Rk=Array.prototype.map,Dk=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uH(t){var e=t.grouping===void 0||t.thousands===void 0?Ak:tH(Rk.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",a=t.decimal===void 0?".":t.decimal+"",u=t.numerals===void 0?Ak:rH(Rk.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",f=t.nan===void 0?"NaN":t.nan+"";function c(v){v=Ns(v);var g=v.fill,m=v.align,y=v.sign,x=v.symbol,w=v.zero,_=v.width,E=v.comma,S=v.precision,C=v.trim,k=v.type;k==="n"?(E=!0,k="g"):Ck[k]||(S===void 0&&(S=12),C=!0,k="g"),(w||g==="0"&&m==="=")&&(w=!0,g="0",m="=");var O=x==="$"?r:x==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():"",q=x==="$"?n:/[%p]/.test(k)?o:"",M=Ck[k],A=/[defgprs%]/.test(k);S=S===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function L(R){var B=O,D=q,N,U,z;if(k==="c")D=M(R)+D,R="";else{R=+R;var G=R<0||1/R<0;if(R=isNaN(R)?f:M(Math.abs(R),S),C&&(R=aH(R)),G&&+R==0&&y!=="+"&&(G=!1),B=(G?y==="("?y:s:y==="-"||y==="("?"":y)+B,D=(k==="s"?Dk[8+GB/3]:"")+D+(G&&y==="("?")":""),A){for(N=-1,U=R.length;++Nz||z>57){D=(z===46?a+R.slice(N+1):R.slice(N))+D,R=R.slice(0,N);break}}}E&&!w&&(R=e(R,1/0));var V=B.length+R.length+D.length,K=V<_?new Array(_-V+1).join(g):"";switch(E&&w&&(R=e(K+R,K.length?_-D.length:1/0),K=""),m){case"<":R=B+R+D+K;break;case"=":R=B+K+R+D;break;case"^":R=K.slice(0,V=K.length>>1)+B+R+D+K.slice(V);break;default:R=K+B+R+D;break}return u(R)}return L.toString=function(){return v+""},L}function d(v,g){var m=c((v=Ns(v),v.type="f",v)),y=Math.max(-8,Math.min(8,Math.floor(Xu(g)/3)))*3,x=Math.pow(10,-y),w=Dk[8+y/3];return function(_){return m(x*_)+w}}return{format:c,formatPrefix:d}}var Of,ww,VB;oH({thousands:",",grouping:[3],currency:["$",""]});function oH(t){return Of=uH(t),ww=Of.format,VB=Of.formatPrefix,Of}function sH(t){return Math.max(0,-Xu(Math.abs(t)))}function lH(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xu(e)/3)))*3-Xu(Math.abs(t)))}function fH(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Xu(e)-Xu(t))+1}function cH(t,e,r,n){var a=$V(t,e,r),u;switch(n=Ns(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(u=lH(a,o))&&(n.precision=u),VB(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(u=fH(a,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=u-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(u=sH(a))&&(n.precision=u-(n.type==="%")*2);break}}return ww(n)}function xw(t){var e=t.domain;return t.ticks=function(r){var n=e();return b1(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var a=e();return cH(a[0],a[a.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),a=0,u=n.length-1,o=n[a],s=n[u],f,c,d=10;for(s0;){if(c=w1(o,s,r),c===f)return n[a]=o,n[u]=s,e(n);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;f=c}return t},t}function HB(){var t=JV();return t.copy=function(){return mw(t,HB())},Zc.apply(t,arguments),xw(t)}function dH(t,e){t=t.slice();var r=0,n=t.length-1,a=t[r],u=t[n],o;return uMath.pow(t,e)}function mH(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function Ok(t){return(e,r)=>-t(-e,r)}function yH(t){const e=t(Mk,kk),r=e.domain;let n=10,a,u;function o(){return a=mH(n),u=pH(n),r()[0]<0?(a=Ok(a),u=Ok(u),t(hH,vH)):t(Mk,kk),e}return e.base=function(s){return arguments.length?(n=+s,o()):n},e.domain=function(s){return arguments.length?(r(s),o()):r()},e.ticks=s=>{const f=r();let c=f[0],d=f[f.length-1];const v=d0){for(;g<=m;++g)for(y=1;yd)break;_.push(x)}}else for(;g<=m;++g)for(y=n-1;y>=1;--y)if(x=g>0?y/u(-g):y*u(g),!(xd)break;_.push(x)}_.length*2{if(s==null&&(s=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Ns(f)).precision==null&&(f.trim=!0),f=ww(f)),s===1/0)return f;const c=Math.max(1,n*s/e.ticks().length);return d=>{let v=d/u(Math.round(a(d)));return v*nr(dH(r(),{floor:s=>u(Math.floor(a(s))),ceil:s=>u(Math.ceil(a(s)))})),e}function FB(){const t=yH(yw()).domain([1,10]);return t.copy=()=>mw(t,FB()).base(t.base()),Zc.apply(t,arguments),t}function qk(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function bH(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function wH(t){return t<0?-t*t:t*t}function xH(t){var e=t(cn,cn),r=1;function n(){return r===1?t(cn,cn):r===.5?t(bH,wH):t(qk(r),qk(1/r))}return e.exponent=function(a){return arguments.length?(r=+a,n()):r},xw(e)}function YB(){var t=xH(yw());return t.copy=function(){return mw(t,YB()).exponent(t.exponent())},Zc.apply(t,arguments),t}function _H(){return YB.apply(null,arguments).exponent(.5)}function EH(){var t=0,e=1,r,n,a,u,o=cn,s=!1,f;function c(v){return v==null||isNaN(v=+v)?f:o(a===0?.5:(v=(u(v)-r)*a,s?Math.max(0,Math.min(1,v)):v))}c.domain=function(v){return arguments.length?([t,e]=v,r=u(t=+t),n=u(e=+e),a=r===n?0:1/(n-r),c):[t,e]},c.clamp=function(v){return arguments.length?(s=!!v,c):s},c.interpolator=function(v){return arguments.length?(o=v,c):o};function d(v){return function(g){var m,y;return arguments.length?([m,y]=g,o=v(m,y),c):[o(0),o(1)]}}return c.range=d(jc),c.rangeRound=d(zB),c.unknown=function(v){return arguments.length?(f=v,c):f},function(v){return u=v,r=v(t),n=v(e),a=r===n?0:1/(n-r),c}}function SH(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function $B(){var t=xw(EH()(cn));return t.copy=function(){return SH(t,$B())},KV.apply(t,arguments)}const TH=new Set(["id","type","library_name","pipeline_tag"]),CH=new Set(["downloads","likes","downloads","downloads_all_time","trending_score","used_storage"]);function AH(t){return TH.has(t)}function RH(t){return CH.has(t)}function DH(t,e){if(AH(e)){const r=new Set(t.filter(a=>a.group==="nodes").map(a=>a.data[e]));return UB(r,iV)}else if(RH(e)){const r=t.map(u=>u.data[e]).filter(u=>isNaN(u)===!1),n=[Math.min(...r),Math.max(...r)];return $B(n,PB)}}function MH(t,e){const r=t.map(u=>u.data[e]).filter(u=>isNaN(u)===!1),n=[Math.min(...r),Math.max(...r)],a=[5,30];return _H().domain(n).range(a)}function kH({layout:t,label:e,edgeScale:r,nodeColor:n,nodeSize:a}){const u=lN,o=bn.useRef(Pn({}));return bn.useEffect(()=>{console.log("running effect"),Pn.use(KG),Pn.use(aV);const s=typeof t=="string"?{name:t}:t;o.current=window.cy=Pn({container:document.getElementById("cy"),elements:u,layout:s}),o.current.style().selector("node").style({"font-size":8}).update()},[u,t]),bn.useEffect(()=>{if(!o.current)return;const s=r==="linear"?HB:FB,f=u.filter(d=>d.group==="edges").map(d=>d.data.weight),c=s().domain([Math.min(...f),Math.max(...f)]).range([.1,1]);o.current.style().selector("edge").style({opacity:d=>c(d.data("weight"))}).update()},[r,u]),bn.useEffect(()=>{if(!o.current)return;const s=a?MH(u,a):void 0;o.current.style().selector("node").style({width:f=>s?s(f.data(a)):20,height:f=>s?s(f.data(a)):20}).update()},[a,u]),bn.useEffect(()=>{if(!o.current)return;const s=n?DH(u,n):void 0;o.current.style().selector("node").style({"background-color":f=>s?s(f.data(n)):PB(.5)}).update()},[n,u,t]),bn.useEffect(()=>{o.current&&o.current.style().selector("node").style({label:s=>e?s.data("id"):""}).update()},[e]),bn.useEffect(()=>{if(!o.current)return;const s=typeof t=="string"?{name:t}:t;o.current.layout(s).run(),o.current.fit()},[t]),wt.jsx("div",{children:wt.jsx("div",{id:"cy",style:{width:"100%",height:"800px"}})})}const OH=new Set(["type","library_name","pipeline_tag"]),qH=new Set(["likes","downloads","trending_score","used_storage"]);function BH(){const[t,e]=bn.useState("used_storage"),[r,n]=bn.useState("library_name"),[a,u]=bn.useState(!1),o=wt.jsx(wt.Fragment,{children:wt.jsxs("div",{id:"controls",style:{display:"flex",flexDirection:"row",padding:"10px",gap:"1em"},children:[wt.jsxs("div",{children:[wt.jsx("label",{htmlFor:"nodeSize",children:"Node Size:"}),wt.jsxs("select",{id:"nodeSize",value:t??"",onChange:s=>{const f=s.target.value;e(f===""?void 0:f)},children:[wt.jsx("option",{value:"",children:"None"}),[...qH].map(s=>wt.jsx("option",{value:s,children:s},s))]})]}),wt.jsxs("div",{children:[wt.jsx("label",{htmlFor:"nodeColor",children:"Node Color:"}),wt.jsxs("select",{id:"nodeColor",value:r??"",onChange:s=>{const f=s.target.value;n(f===""?void 0:f)},children:[wt.jsx("option",{value:"",children:"None"}),[...OH].map(s=>wt.jsx("option",{value:s,children:s},s))]})]}),wt.jsxs("div",{children:[wt.jsx("label",{htmlFor:"showLabels",children:"Show Labels:"}),wt.jsx("input",{id:"showLabels",type:"checkbox",checked:a,onChange:s=>u(s.target.checked)})]})]})});return wt.jsx(wt.Fragment,{children:wt.jsx("div",{id:"content",style:{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:wt.jsxs("div",{id:"inner",style:{width:"80%",height:"100%",display:"flex",flexDirection:"column"},children:[wt.jsx("h1",{children:"Xet Repository Graph"}),o,wt.jsx(kH,{layout:"cose",label:a,edgeScale:"log",nodeColor:r,nodeSize:t})]})})})}sN.createRoot(document.getElementById("root")).render(wt.jsx(bn.StrictMode,{children:wt.jsx(BH,{})}));