@swarmvaultai/viewer 0.7.31 โ†’ 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,332 +0,0 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const u of l)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 a(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function n(l){if(l.ep)return;l.ep=!0;const u=a(l);fetch(l.href,u)}})();function H1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jv={exports:{}},Ru={};var Wy;function I2(){if(Wy)return Ru;Wy=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function a(n,l,u){var o=null;if(u!==void 0&&(o=""+u),l.key!==void 0&&(o=""+l.key),"key"in l){u={};for(var c in l)c!=="key"&&(u[c]=l[c])}else u=l;return l=u.ref,{$$typeof:t,type:n,key:o,ref:l!==void 0?l:null,props:u}}return Ru.Fragment=e,Ru.jsx=a,Ru.jsxs=a,Ru}var Jy;function Y2(){return Jy||(Jy=1,jv.exports=I2()),jv.exports}var M=Y2(),Pv={exports:{}},Je={};var e0;function F2(){if(e0)return Je;e0=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),m=Symbol.iterator;function x(N){return N===null||typeof N!="object"?null:(N=m&&N[m]||N["@@iterator"],typeof N=="function"?N:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function w(N,G,Z){this.props=N,this.context=G,this.refs=S,this.updater=Z||b}w.prototype.isReactComponent={},w.prototype.setState=function(N,G){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,G,"setState")},w.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function T(){}T.prototype=w.prototype;function C(N,G,Z){this.props=N,this.context=G,this.refs=S,this.updater=Z||b}var B=C.prototype=new T;B.constructor=C,E(B,w.prototype),B.isPureReactComponent=!0;var R=Array.isArray;function L(){}var A={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function z(N,G,Z){var $=Z.ref;return{$$typeof:t,type:N,key:G,ref:$!==void 0?$:null,props:Z}}function U(N,G){return z(N.type,G,N.props)}function V(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function P(N){var G={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Z){return G[Z]})}var H=/\/+/g;function I(N,G){return typeof N=="object"&&N!==null&&N.key!=null?P(""+N.key):G.toString(36)}function F(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(L,L):(N.status="pending",N.then(function(G){N.status==="pending"&&(N.status="fulfilled",N.value=G)},function(G){N.status==="pending"&&(N.status="rejected",N.reason=G)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function _(N,G,Z,$,ae){var se=typeof N;(se==="undefined"||se==="boolean")&&(N=null);var de=!1;if(N===null)de=!0;else switch(se){case"bigint":case"string":case"number":de=!0;break;case"object":switch(N.$$typeof){case t:case e:de=!0;break;case h:return de=N._init,_(de(N._payload),G,Z,$,ae)}}if(de)return ae=ae(N),de=$===""?"."+I(N,0):$,R(ae)?(Z="",de!=null&&(Z=de.replace(H,"$&/")+"/"),_(ae,G,Z,"",function(te){return te})):ae!=null&&(V(ae)&&(ae=U(ae,Z+(ae.key==null||N&&N.key===ae.key?"":(""+ae.key).replace(H,"$&/")+"/")+de)),G.push(ae)),1;de=0;var Se=$===""?".":$+":";if(R(N))for(var fe=0;fe<N.length;fe++)$=N[fe],se=Se+I($,fe),de+=_($,G,Z,se,ae);else if(fe=x(N),typeof fe=="function")for(N=fe.call(N),fe=0;!($=N.next()).done;)$=$.value,se=Se+I($,fe++),de+=_($,G,Z,se,ae);else if(se==="object"){if(typeof N.then=="function")return _(F(N),G,Z,$,ae);throw G=String(N),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return de}function j(N,G,Z){if(N==null)return N;var $=[],ae=0;return _(N,$,"","",function(se){return G.call(Z,se,ae++)}),$}function Y(N){if(N._status===-1){var G=N._result;G=G(),G.then(function(Z){(N._status===0||N._status===-1)&&(N._status=1,N._result=Z)},function(Z){(N._status===0||N._status===-1)&&(N._status=2,N._result=Z)}),N._status===-1&&(N._status=0,N._result=G)}if(N._status===1)return N._result.default;throw N._result}var Q=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},W={map:j,forEach:function(N,G,Z){j(N,function(){G.apply(this,arguments)},Z)},count:function(N){var G=0;return j(N,function(){G++}),G},toArray:function(N){return j(N,function(G){return G})||[]},only:function(N){if(!V(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Je.Activity=g,Je.Children=W,Je.Component=w,Je.Fragment=a,Je.Profiler=l,Je.PureComponent=C,Je.StrictMode=n,Je.Suspense=v,Je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Je.__COMPILER_RUNTIME={__proto__:null,c:function(N){return A.H.useMemoCache(N)}},Je.cache=function(N){return function(){return N.apply(null,arguments)}},Je.cacheSignal=function(){return null},Je.cloneElement=function(N,G,Z){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var $=E({},N.props),ae=N.key;if(G!=null)for(se in G.key!==void 0&&(ae=""+G.key),G)!O.call(G,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&G.ref===void 0||($[se]=G[se]);var se=arguments.length-2;if(se===1)$.children=Z;else if(1<se){for(var de=Array(se),Se=0;Se<se;Se++)de[Se]=arguments[Se+2];$.children=de}return z(N.type,ae,$)},Je.createContext=function(N){return N={$$typeof:o,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:u,_context:N},N},Je.createElement=function(N,G,Z){var $,ae={},se=null;if(G!=null)for($ in G.key!==void 0&&(se=""+G.key),G)O.call(G,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(ae[$]=G[$]);var de=arguments.length-2;if(de===1)ae.children=Z;else if(1<de){for(var Se=Array(de),fe=0;fe<de;fe++)Se[fe]=arguments[fe+2];ae.children=Se}if(N&&N.defaultProps)for($ in de=N.defaultProps,de)ae[$]===void 0&&(ae[$]=de[$]);return z(N,se,ae)},Je.createRef=function(){return{current:null}},Je.forwardRef=function(N){return{$$typeof:c,render:N}},Je.isValidElement=V,Je.lazy=function(N){return{$$typeof:h,_payload:{_status:-1,_result:N},_init:Y}},Je.memo=function(N,G){return{$$typeof:f,type:N,compare:G===void 0?null:G}},Je.startTransition=function(N){var G=A.T,Z={};A.T=Z;try{var $=N(),ae=A.S;ae!==null&&ae(Z,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(L,Q)}catch(se){Q(se)}finally{G!==null&&Z.types!==null&&(G.types=Z.types),A.T=G}},Je.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Je.use=function(N){return A.H.use(N)},Je.useActionState=function(N,G,Z){return A.H.useActionState(N,G,Z)},Je.useCallback=function(N,G){return A.H.useCallback(N,G)},Je.useContext=function(N){return A.H.useContext(N)},Je.useDebugValue=function(){},Je.useDeferredValue=function(N,G){return A.H.useDeferredValue(N,G)},Je.useEffect=function(N,G){return A.H.useEffect(N,G)},Je.useEffectEvent=function(N){return A.H.useEffectEvent(N)},Je.useId=function(){return A.H.useId()},Je.useImperativeHandle=function(N,G,Z){return A.H.useImperativeHandle(N,G,Z)},Je.useInsertionEffect=function(N,G){return A.H.useInsertionEffect(N,G)},Je.useLayoutEffect=function(N,G){return A.H.useLayoutEffect(N,G)},Je.useMemo=function(N,G){return A.H.useMemo(N,G)},Je.useOptimistic=function(N,G){return A.H.useOptimistic(N,G)},Je.useReducer=function(N,G,Z){return A.H.useReducer(N,G,Z)},Je.useRef=function(N){return A.H.useRef(N)},Je.useState=function(N){return A.H.useState(N)},Je.useSyncExternalStore=function(N,G,Z){return A.H.useSyncExternalStore(N,G,Z)},Je.useTransition=function(){return A.H.useTransition()},Je.version="19.2.4",Je}var t0;function Gh(){return t0||(t0=1,Pv.exports=F2()),Pv.exports}var qe=Gh();const X2=H1(qe);var Hv={exports:{}},zu={},Gv={exports:{}},Iv={};var a0;function K2(){return a0||(a0=1,(function(t){function e(_,j){var Y=_.length;_.push(j);e:for(;0<Y;){var Q=Y-1>>>1,W=_[Q];if(0<l(W,j))_[Q]=j,_[Y]=W,Y=Q;else break e}}function a(_){return _.length===0?null:_[0]}function n(_){if(_.length===0)return null;var j=_[0],Y=_.pop();if(Y!==j){_[0]=Y;e:for(var Q=0,W=_.length,N=W>>>1;Q<N;){var G=2*(Q+1)-1,Z=_[G],$=G+1,ae=_[$];if(0>l(Z,Y))$<W&&0>l(ae,Z)?(_[Q]=ae,_[$]=Y,Q=$):(_[Q]=Z,_[G]=Y,Q=G);else if($<W&&0>l(ae,Y))_[Q]=ae,_[$]=Y,Q=$;else break e}}return j}function l(_,j){var Y=_.sortIndex-j.sortIndex;return Y!==0?Y:_.id-j.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,c=o.now();t.unstable_now=function(){return o.now()-c}}var v=[],f=[],h=1,g=null,m=3,x=!1,b=!1,E=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function B(_){for(var j=a(f);j!==null;){if(j.callback===null)n(f);else if(j.startTime<=_)n(f),j.sortIndex=j.expirationTime,e(v,j);else break;j=a(f)}}function R(_){if(E=!1,B(_),!b)if(a(v)!==null)b=!0,L||(L=!0,P());else{var j=a(f);j!==null&&F(R,j.startTime-_)}}var L=!1,A=-1,O=5,z=-1;function U(){return S?!0:!(t.unstable_now()-z<O)}function V(){if(S=!1,L){var _=t.unstable_now();z=_;var j=!0;try{e:{b=!1,E&&(E=!1,T(A),A=-1),x=!0;var Y=m;try{t:{for(B(_),g=a(v);g!==null&&!(g.expirationTime>_&&U());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,m=g.priorityLevel;var W=Q(g.expirationTime<=_);if(_=t.unstable_now(),typeof W=="function"){g.callback=W,B(_),j=!0;break t}g===a(v)&&n(v),B(_)}else n(v);g=a(v)}if(g!==null)j=!0;else{var N=a(f);N!==null&&F(R,N.startTime-_),j=!1}}break e}finally{g=null,m=Y,x=!1}j=void 0}}finally{j?P():L=!1}}}var P;if(typeof C=="function")P=function(){C(V)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,I=H.port2;H.port1.onmessage=V,P=function(){I.postMessage(null)}}else P=function(){w(V,0)};function F(_,j){A=w(function(){_(t.unstable_now())},j)}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(_){_.callback=null},t.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(_){switch(m){case 1:case 2:case 3:var j=3;break;default:j=m}var Y=m;m=j;try{return _()}finally{m=Y}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(_,j){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var Y=m;m=_;try{return j()}finally{m=Y}},t.unstable_scheduleCallback=function(_,j,Y){var Q=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Q+Y:Q):Y=Q,_){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=Y+W,_={id:h++,callback:j,priorityLevel:_,startTime:Y,expirationTime:W,sortIndex:-1},Y>Q?(_.sortIndex=Y,e(f,_),a(v)===null&&_===a(f)&&(E?(T(A),A=-1):E=!0,F(R,Y-Q))):(_.sortIndex=W,e(v,_),b||x||(b=!0,L||(L=!0,P()))),_},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(_){var j=m;return function(){var Y=m;m=j;try{return _.apply(this,arguments)}finally{m=Y}}}})(Iv)),Iv}var r0;function Z2(){return r0||(r0=1,Gv.exports=K2()),Gv.exports}var Yv={exports:{}},za={};var n0;function Q2(){if(n0)return za;n0=1;var t=Gh();function e(v){var f="https://react.dev/errors/"+v;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+v+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var n={d:{f:a,r:function(){throw Error(e(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(v,f,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:v,containerInfo:f,implementation:h}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(v,f){if(v==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return za.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,za.createPortal=function(v,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return u(v,f,null,h)},za.flushSync=function(v){var f=o.T,h=n.p;try{if(o.T=null,n.p=2,v)return v()}finally{o.T=f,n.p=h,n.d.f()}},za.preconnect=function(v,f){typeof v=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,n.d.C(v,f))},za.prefetchDNS=function(v){typeof v=="string"&&n.d.D(v)},za.preinit=function(v,f){if(typeof v=="string"&&f&&typeof f.as=="string"){var h=f.as,g=c(h,f.crossOrigin),m=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?n.d.S(v,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:m,fetchPriority:x}):h==="script"&&n.d.X(v,{crossOrigin:g,integrity:m,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},za.preinitModule=function(v,f){if(typeof v=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=c(f.as,f.crossOrigin);n.d.M(v,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&n.d.M(v)},za.preload=function(v,f){if(typeof v=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,g=c(h,f.crossOrigin);n.d.L(v,h,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},za.preloadModule=function(v,f){if(typeof v=="string")if(f){var h=c(f.as,f.crossOrigin);n.d.m(v,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else n.d.m(v)},za.requestFormReset=function(v){n.d.r(v)},za.unstable_batchedUpdates=function(v,f){return v(f)},za.useFormState=function(v,f,h){return o.H.useFormState(v,f,h)},za.useFormStatus=function(){return o.H.useHostTransitionStatus()},za.version="19.2.4",za}var i0;function $2(){if(i0)return Yv.exports;i0=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Yv.exports=Q2(),Yv.exports}var l0;function W2(){if(l0)return zu;l0=1;var t=Z2(),e=Gh(),a=$2();function n(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function o(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function c(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function v(r){if(u(r)!==r)throw Error(n(188))}function f(r){var i=r.alternate;if(!i){if(i=u(r),i===null)throw Error(n(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var y=p.alternate;if(y===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===s)return v(p),r;if(y===d)return v(p),i;y=y.sibling}throw Error(n(188))}if(s.return!==d.return)s=p,d=y;else{for(var D=!1,k=p.child;k;){if(k===s){D=!0,s=p,d=y;break}if(k===d){D=!0,d=p,s=y;break}k=k.sibling}if(!D){for(k=y.child;k;){if(k===s){D=!0,s=y,d=p;break}if(k===d){D=!0,d=y,s=p;break}k=k.sibling}if(!D)throw Error(n(189))}}if(s.alternate!==d)throw Error(n(190))}if(s.tag!==3)throw Error(n(188));return s.stateNode.current===s?r:i}function h(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=h(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,m=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),C=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function P(r){return r===null||typeof r!="object"?null:(r=V&&r[V]||r["@@iterator"],typeof r=="function"?r:null)}var H=Symbol.for("react.client.reference");function I(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===H?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case E:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case R:return"Suspense";case L:return"SuspenseList";case z:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case b:return"Portal";case C:return r.displayName||"Context";case T:return(r._context.displayName||"Context")+".Consumer";case B:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case A:return i=r.displayName||null,i!==null?i:I(r.type)||"Memo";case O:i=r._payload,r=r._init;try{return I(r(i))}catch{}}return null}var F=Array.isArray,_=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},Q=[],W=-1;function N(r){return{current:r}}function G(r){0>W||(r.current=Q[W],Q[W]=null,W--)}function Z(r,i){W++,Q[W]=r.current,r.current=i}var $=N(null),ae=N(null),se=N(null),de=N(null);function Se(r,i){switch(Z(se,i),Z(ae,r),Z($,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?wy(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=wy(i),r=Sy(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}G($),Z($,r)}function fe(){G($),G(ae),G(se)}function te(r){r.memoizedState!==null&&Z(de,r);var i=$.current,s=Sy(i,r.type);i!==s&&(Z(ae,r),Z($,s))}function re(r){ae.current===r&&(G($),G(ae)),de.current===r&&(G(de),Du._currentValue=Y)}var le,he;function Ee(r){if(le===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);le=i&&i[1]||"",he=-1<s.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+le+r+he}var ke=!1;function at(r,i){if(!r||ke)return"";ke=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(ve){var ue=ve}Reflect.construct(r,[],be)}else{try{be.call()}catch(ve){ue=ve}r.call(be.prototype)}}else{try{throw Error()}catch(ve){ue=ve}(be=r())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(ve){if(ve&&ue&&typeof ve.stack=="string")return[ve.stack,ue.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),D=y[0],k=y[1];if(D&&k){var X=D.split(`
4
- `),ie=k.split(`
5
- `);for(p=d=0;d<X.length&&!X[d].includes("DetermineComponentFrameRoot");)d++;for(;p<ie.length&&!ie[p].includes("DetermineComponentFrameRoot");)p++;if(d===X.length||p===ie.length)for(d=X.length-1,p=ie.length-1;1<=d&&0<=p&&X[d]!==ie[p];)p--;for(;1<=d&&0<=p;d--,p--)if(X[d]!==ie[p]){if(d!==1||p!==1)do if(d--,p--,0>p||X[d]!==ie[p]){var ge=`
6
- `+X[d].replace(" at new "," at ");return r.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",r.displayName)),ge}while(1<=d&&0<=p);break}}}finally{ke=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Ee(s):""}function Xe(r,i){switch(r.tag){case 26:case 27:case 5:return Ee(r.type);case 16:return Ee("Lazy");case 13:return r.child!==i&&i!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return at(r.type,!1);case 11:return at(r.type.render,!1);case 1:return at(r.type,!0);case 31:return Ee("Activity");default:return""}}function He(r){try{var i="",s=null;do i+=Xe(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
7
- Error generating stack: `+d.message+`
8
- `+d.stack}}var Ue=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,Ve=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,Qe=t.unstable_requestPaint,Be=t.unstable_now,et=t.unstable_getCurrentPriorityLevel,rt=t.unstable_ImmediatePriority,vt=t.unstable_UserBlockingPriority,ut=t.unstable_NormalPriority,ot=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,Me=t.log,pe=t.unstable_setDisableYieldValue,q=null,ee=null;function ce(r){if(typeof Me=="function"&&pe(r),ee&&typeof ee.setStrictMode=="function")try{ee.setStrictMode(q,r)}catch{}}var oe=Math.clz32?Math.clz32:we,me=Math.log,Re=Math.LN2;function we(r){return r>>>=0,r===0?32:31-(me(r)/Re|0)|0}var ze=256,Ne=262144,_e=4194304;function We(r){var i=r&42;if(i!==0)return i;switch(r&-r){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:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function $e(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,y=r.suspendedLanes,D=r.pingedLanes;r=r.warmLanes;var k=d&134217727;return k!==0?(d=k&~y,d!==0?p=We(d):(D&=k,D!==0?p=We(D):s||(s=k&~r,s!==0&&(p=We(s))))):(k=d&~y,k!==0?p=We(k):D!==0?p=We(D):s||(s=d&~r,s!==0&&(p=We(s)))),p===0?0:i!==0&&i!==p&&(i&y)===0&&(y=p&-p,s=i&-i,y>=s||y===32&&(s&4194048)!==0)?i:p}function De(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function it(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32: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+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 tt(){var r=_e;return _e<<=1,(_e&62914560)===0&&(_e=4194304),r}function jt(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function Et(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function ua(r,i,s,d,p,y){var D=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var k=r.entanglements,X=r.expirationTimes,ie=r.hiddenUpdates;for(s=D&~s;0<s;){var ge=31-oe(s),be=1<<ge;k[ge]=0,X[ge]=-1;var ue=ie[ge];if(ue!==null)for(ie[ge]=null,ge=0;ge<ue.length;ge++){var ve=ue[ge];ve!==null&&(ve.lane&=-536870913)}s&=~be}d!==0&&zt(r,d,0),y!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=y&~(D&~i))}function zt(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-oe(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function Ft(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-oe(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function xe(r,i){var s=i&-i;return s=(s&42)!==0?1:Te(s),(s&(r.suspendedLanes|i))!==0?0:s}function Te(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Ke(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function gt(){var r=j.p;return r!==0?r:(r=window.event,r===void 0?32:Yy(r.type))}function da(r,i){var s=j.p;try{return j.p=r,i()}finally{j.p=s}}var Ot=Math.random().toString(36).slice(2),_t="__reactFiber$"+Ot,$t="__reactProps$"+Ot,qt="__reactContainer$"+Ot,ha="__reactEvents$"+Ot,ga="__reactListeners$"+Ot,Ma="__reactHandles$"+Ot,sn="__reactResources$"+Ot,pa="__reactMarker$"+Ot;function Li(r){delete r[_t],delete r[$t],delete r[ha],delete r[ga],delete r[Ma]}function on(r){var i=r[_t];if(i)return i;for(var s=r.parentNode;s;){if(i=s[qt]||s[_t]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=Ny(r);r!==null;){if(s=r[_t])return s;r=Ny(r)}return i}r=s,s=r.parentNode}return null}function cn(r){if(r=r[_t]||r[qt]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function ti(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(n(33))}function fn(r){var i=r[sn];return i||(i=r[sn]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ea(r){r[pa]=!0}var hs=new Set,gs={};function Qa(r,i){Cr(r,i),Cr(r+"Capture",i)}function Cr(r,i){for(gs[r]=i,r=0;r<i.length;r++)hs.add(i[r])}var ki=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]*$"),Hl={},Gl={};function Rc(r){return Ue.call(Gl,r)?!0:Ue.call(Hl,r)?!1:ki.test(r)?Gl[r]=!0:(Hl[r]=!0,!1)}function Ra(r,i,s){if(Rc(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function vn(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function lr(r,i,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+d)}}function ma(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ja(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function zc(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,y=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(D){s=""+D,y.call(this,D)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function ps(r){if(!r._valueTracker){var i=ja(r)?"checked":"value";r._valueTracker=zc(r,i,""+r[i])}}function ms(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=ja(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function ys(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Vw=/[\n"\\]/g;function ur(r){return r.replace(Vw,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Oc(r,i,s,d,p,y,D,k){r.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?r.type=D:r.removeAttribute("type"),i!=null?D==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+ma(i)):r.value!==""+ma(i)&&(r.value=""+ma(i)):D!=="submit"&&D!=="reset"||r.removeAttribute("value"),i!=null?Lc(r,D,ma(i)):s!=null?Lc(r,D,ma(s)):d!=null&&r.removeAttribute("value"),p==null&&y!=null&&(r.defaultChecked=!!y),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?r.name=""+ma(k):r.removeAttribute("name")}function gg(r,i,s,d,p,y,D,k){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){ps(r);return}s=s!=null?""+ma(s):"",i=i!=null?""+ma(i):s,k||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=k?r.checked:!!d,r.defaultChecked=!!d,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(r.name=D),ps(r)}function Lc(r,i,s){i==="number"&&ys(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function _i(r,i,s,d){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&d&&(r[s].defaultSelected=!0)}else{for(s=""+ma(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function pg(r,i,s){if(i!=null&&(i=""+ma(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+ma(s):""}function mg(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(n(92));if(F(d)){if(1<d.length)throw Error(n(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=ma(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),ps(r)}function qi(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var Uw=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function yg(r,i,s){var d=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,s):typeof s!="number"||s===0||Uw.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function bg(r,i,s){if(i!=null&&typeof i!="object")throw Error(n(62));if(r=r.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&s[p]!==d&&yg(r,p,d)}else for(var y in i)i.hasOwnProperty(y)&&yg(r,y,i[y])}function kc(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var jw=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Pw=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function bs(r){return Pw.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function qr(){}var _c=null;function qc(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Vi=null,Ui=null;function xg(r){var i=cn(r);if(i&&(r=i.stateNode)){var s=r[$t]||null;e:switch(r=i.stateNode,i.type){case"input":if(Oc(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+ur(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[$t]||null;if(!p)throw Error(n(90));Oc(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&ms(d)}break e;case"textarea":pg(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&_i(r,!!s.multiple,i,!1)}}}var Vc=!1;function wg(r,i,s){if(Vc)return r(i,s);Vc=!0;try{var d=r(i);return d}finally{if(Vc=!1,(Vi!==null||Ui!==null)&&(lo(),Vi&&(i=Vi,r=Ui,Ui=Vi=null,xg(i),r)))for(i=0;i<r.length;i++)xg(r[i])}}function Il(r,i){var s=r.stateNode;if(s===null)return null;var d=s[$t]||null;if(d===null)return null;s=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(n(231,i,typeof s));return s}var Vr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uc=!1;if(Vr)try{var Yl={};Object.defineProperty(Yl,"passive",{get:function(){Uc=!0}}),window.addEventListener("test",Yl,Yl),window.removeEventListener("test",Yl,Yl)}catch{Uc=!1}var dn=null,jc=null,xs=null;function Sg(){if(xs)return xs;var r,i=jc,s=i.length,d,p="value"in dn?dn.value:dn.textContent,y=p.length;for(r=0;r<s&&i[r]===p[r];r++);var D=s-r;for(d=1;d<=D&&i[s-d]===p[y-d];d++);return xs=p.slice(r,1<d?1-d:void 0)}function ws(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function Ss(){return!0}function Eg(){return!1}function Pa(r){function i(s,d,p,y,D){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=y,this.target=D,this.currentTarget=null;for(var k in r)r.hasOwnProperty(k)&&(s=r[k],this[k]=s?s(y):y[k]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ss:Eg,this.isPropagationStopped=Eg,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ss)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ss)},persist:function(){},isPersistent:Ss}),i}var ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Es=Pa(ai),Fl=g({},ai,{view:0,detail:0}),Hw=Pa(Fl),Pc,Hc,Xl,Ts=g({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ic,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Xl&&(Xl&&r.type==="mousemove"?(Pc=r.screenX-Xl.screenX,Hc=r.screenY-Xl.screenY):Hc=Pc=0,Xl=r),Pc)},movementY:function(r){return"movementY"in r?r.movementY:Hc}}),Tg=Pa(Ts),Gw=g({},Ts,{dataTransfer:0}),Iw=Pa(Gw),Yw=g({},Fl,{relatedTarget:0}),Gc=Pa(Yw),Fw=g({},ai,{animationName:0,elapsedTime:0,pseudoElement:0}),Xw=Pa(Fw),Kw=g({},ai,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Zw=Pa(Kw),Qw=g({},ai,{data:0}),Cg=Pa(Qw),$w={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ww={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Jw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eS(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=Jw[r])?!!i[r]:!1}function Ic(){return eS}var tS=g({},Fl,{key:function(r){if(r.key){var i=$w[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=ws(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Ww[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ic,charCode:function(r){return r.type==="keypress"?ws(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ws(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),aS=Pa(tS),rS=g({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ag=Pa(rS),nS=g({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ic}),iS=Pa(nS),lS=g({},ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),uS=Pa(lS),sS=g({},Ts,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),oS=Pa(sS),cS=g({},ai,{newState:0,oldState:0}),fS=Pa(cS),vS=[9,13,27,32],Yc=Vr&&"CompositionEvent"in window,Kl=null;Vr&&"documentMode"in document&&(Kl=document.documentMode);var dS=Vr&&"TextEvent"in window&&!Kl,Dg=Vr&&(!Yc||Kl&&8<Kl&&11>=Kl),Bg=" ",Ng=!1;function Mg(r,i){switch(r){case"keyup":return vS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rg(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ji=!1;function hS(r,i){switch(r){case"compositionend":return Rg(i);case"keypress":return i.which!==32?null:(Ng=!0,Bg);case"textInput":return r=i.data,r===Bg&&Ng?null:r;default:return null}}function gS(r,i){if(ji)return r==="compositionend"||!Yc&&Mg(r,i)?(r=Sg(),xs=jc=dn=null,ji=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Dg&&i.locale!=="ko"?null:i.data;default:return null}}var pS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function zg(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!pS[r.type]:i==="textarea"}function Og(r,i,s,d){Vi?Ui?Ui.push(d):Ui=[d]:Vi=d,i=ho(i,"onChange"),0<i.length&&(s=new Es("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var Zl=null,Ql=null;function mS(r){gy(r,0)}function Cs(r){var i=ti(r);if(ms(i))return r}function Lg(r,i){if(r==="change")return i}var kg=!1;if(Vr){var Fc;if(Vr){var Xc="oninput"in document;if(!Xc){var _g=document.createElement("div");_g.setAttribute("oninput","return;"),Xc=typeof _g.oninput=="function"}Fc=Xc}else Fc=!1;kg=Fc&&(!document.documentMode||9<document.documentMode)}function qg(){Zl&&(Zl.detachEvent("onpropertychange",Vg),Ql=Zl=null)}function Vg(r){if(r.propertyName==="value"&&Cs(Ql)){var i=[];Og(i,Ql,r,qc(r)),wg(mS,i)}}function yS(r,i,s){r==="focusin"?(qg(),Zl=i,Ql=s,Zl.attachEvent("onpropertychange",Vg)):r==="focusout"&&qg()}function bS(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Cs(Ql)}function xS(r,i){if(r==="click")return Cs(i)}function wS(r,i){if(r==="input"||r==="change")return Cs(i)}function SS(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var $a=typeof Object.is=="function"?Object.is:SS;function $l(r,i){if($a(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),d=Object.keys(i);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var p=s[d];if(!Ue.call(i,p)||!$a(r[p],i[p]))return!1}return!0}function Ug(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function jg(r,i){var s=Ug(r);r=0;for(var d;s;){if(s.nodeType===3){if(d=r+s.textContent.length,r<=i&&d>=i)return{node:s,offset:i-r};r=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ug(s)}}function Pg(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Pg(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Hg(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=ys(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=ys(r.document)}return i}function Kc(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var ES=Vr&&"documentMode"in document&&11>=document.documentMode,Pi=null,Zc=null,Wl=null,Qc=!1;function Gg(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Qc||Pi==null||Pi!==ys(d)||(d=Pi,"selectionStart"in d&&Kc(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Wl&&$l(Wl,d)||(Wl=d,d=ho(Zc,"onSelect"),0<d.length&&(i=new Es("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Pi)))}function ri(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Hi={animationend:ri("Animation","AnimationEnd"),animationiteration:ri("Animation","AnimationIteration"),animationstart:ri("Animation","AnimationStart"),transitionrun:ri("Transition","TransitionRun"),transitionstart:ri("Transition","TransitionStart"),transitioncancel:ri("Transition","TransitionCancel"),transitionend:ri("Transition","TransitionEnd")},$c={},Ig={};Vr&&(Ig=document.createElement("div").style,"AnimationEvent"in window||(delete Hi.animationend.animation,delete Hi.animationiteration.animation,delete Hi.animationstart.animation),"TransitionEvent"in window||delete Hi.transitionend.transition);function ni(r){if($c[r])return $c[r];if(!Hi[r])return r;var i=Hi[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Ig)return $c[r]=i[s];return r}var Yg=ni("animationend"),Fg=ni("animationiteration"),Xg=ni("animationstart"),TS=ni("transitionrun"),CS=ni("transitionstart"),AS=ni("transitioncancel"),Kg=ni("transitionend"),Zg=new Map,Wc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Wc.push("scrollEnd");function br(r,i){Zg.set(r,i),Qa(i,[r])}var As=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},sr=[],Gi=0,Jc=0;function Ds(){for(var r=Gi,i=Jc=Gi=0;i<r;){var s=sr[i];sr[i++]=null;var d=sr[i];sr[i++]=null;var p=sr[i];sr[i++]=null;var y=sr[i];if(sr[i++]=null,d!==null&&p!==null){var D=d.pending;D===null?p.next=p:(p.next=D.next,D.next=p),d.pending=p}y!==0&&Qg(s,p,y)}}function Bs(r,i,s,d){sr[Gi++]=r,sr[Gi++]=i,sr[Gi++]=s,sr[Gi++]=d,Jc|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function ef(r,i,s,d){return Bs(r,i,s,d),Ns(r)}function ii(r,i){return Bs(r,null,null,i),Ns(r)}function Qg(r,i,s){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s);for(var p=!1,y=r.return;y!==null;)y.childLanes|=s,d=y.alternate,d!==null&&(d.childLanes|=s),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(p=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,p&&i!==null&&(p=31-oe(s),r=y.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),y):null}function Ns(r){if(50<xu)throw xu=0,cv=null,Error(n(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ii={};function DS(r,i,s,d){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wa(r,i,s,d){return new DS(r,i,s,d)}function tf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ur(r,i){var s=r.alternate;return s===null?(s=Wa(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function $g(r,i){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Ms(r,i,s,d,p,y){var D=0;if(d=r,typeof r=="function")tf(r)&&(D=1);else if(typeof r=="string")D=z2(r,s,$.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case z:return r=Wa(31,s,i,p),r.elementType=z,r.lanes=y,r;case E:return li(s.children,p,y,i);case S:D=8,p|=24;break;case w:return r=Wa(12,s,i,p|2),r.elementType=w,r.lanes=y,r;case R:return r=Wa(13,s,i,p),r.elementType=R,r.lanes=y,r;case L:return r=Wa(19,s,i,p),r.elementType=L,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case C:D=10;break e;case T:D=9;break e;case B:D=11;break e;case A:D=14;break e;case O:D=16,d=null;break e}D=29,s=Error(n(130,r===null?"null":typeof r,"")),d=null}return i=Wa(D,s,i,p),i.elementType=r,i.type=d,i.lanes=y,i}function li(r,i,s,d){return r=Wa(7,r,d,i),r.lanes=s,r}function af(r,i,s){return r=Wa(6,r,null,i),r.lanes=s,r}function Wg(r){var i=Wa(18,null,null,0);return i.stateNode=r,i}function rf(r,i,s){return i=Wa(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Jg=new WeakMap;function or(r,i){if(typeof r=="object"&&r!==null){var s=Jg.get(r);return s!==void 0?s:(i={value:r,source:i,stack:He(i)},Jg.set(r,i),i)}return{value:r,source:i,stack:He(i)}}var Yi=[],Fi=0,Rs=null,Jl=0,cr=[],fr=0,hn=null,Ar=1,Dr="";function jr(r,i){Yi[Fi++]=Jl,Yi[Fi++]=Rs,Rs=r,Jl=i}function ep(r,i,s){cr[fr++]=Ar,cr[fr++]=Dr,cr[fr++]=hn,hn=r;var d=Ar;r=Dr;var p=32-oe(d)-1;d&=~(1<<p),s+=1;var y=32-oe(i)+p;if(30<y){var D=p-p%5;y=(d&(1<<D)-1).toString(32),d>>=D,p-=D,Ar=1<<32-oe(i)+p|s<<p|d,Dr=y+r}else Ar=1<<y|s<<p|d,Dr=r}function nf(r){r.return!==null&&(jr(r,1),ep(r,1,0))}function lf(r){for(;r===Rs;)Rs=Yi[--Fi],Yi[Fi]=null,Jl=Yi[--Fi],Yi[Fi]=null;for(;r===hn;)hn=cr[--fr],cr[fr]=null,Dr=cr[--fr],cr[fr]=null,Ar=cr[--fr],cr[fr]=null}function tp(r,i){cr[fr++]=Ar,cr[fr++]=Dr,cr[fr++]=hn,Ar=i.id,Dr=i.overflow,hn=r}var Sa=null,Pt=null,pt=!1,gn=null,vr=!1,uf=Error(n(519));function pn(r){var i=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw eu(or(i,r)),uf}function ap(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[_t]=r,i[$t]=d,s){case"dialog":ft("cancel",i),ft("close",i);break;case"iframe":case"object":case"embed":ft("load",i);break;case"video":case"audio":for(s=0;s<Su.length;s++)ft(Su[s],i);break;case"source":ft("error",i);break;case"img":case"image":case"link":ft("error",i),ft("load",i);break;case"details":ft("toggle",i);break;case"input":ft("invalid",i),gg(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":ft("invalid",i);break;case"textarea":ft("invalid",i),mg(i,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||d.suppressHydrationWarning===!0||by(i.textContent,s)?(d.popover!=null&&(ft("beforetoggle",i),ft("toggle",i)),d.onScroll!=null&&ft("scroll",i),d.onScrollEnd!=null&&ft("scrollend",i),d.onClick!=null&&(i.onclick=qr),i=!0):i=!1,i||pn(r,!0)}function rp(r){for(Sa=r.return;Sa;)switch(Sa.tag){case 5:case 31:case 13:vr=!1;return;case 27:case 3:vr=!0;return;default:Sa=Sa.return}}function Xi(r){if(r!==Sa)return!1;if(!pt)return rp(r),pt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Cv(r.type,r.memoizedProps)),s=!s),s&&Pt&&pn(r),rp(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));Pt=By(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));Pt=By(r)}else i===27?(i=Pt,Mn(r.type)?(r=Mv,Mv=null,Pt=r):Pt=i):Pt=Sa?hr(r.stateNode.nextSibling):null;return!0}function ui(){Pt=Sa=null,pt=!1}function sf(){var r=gn;return r!==null&&(Ya===null?Ya=r:Ya.push.apply(Ya,r),gn=null),r}function eu(r){gn===null?gn=[r]:gn.push(r)}var of=N(null),si=null,Pr=null;function mn(r,i,s){Z(of,i._currentValue),i._currentValue=s}function Hr(r){r._currentValue=of.current,G(of)}function cf(r,i,s){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===s)break;r=r.return}}function ff(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var y=p.dependencies;if(y!==null){var D=p.child;y=y.firstContext;e:for(;y!==null;){var k=y;y=p;for(var X=0;X<i.length;X++)if(k.context===i[X]){y.lanes|=s,k=y.alternate,k!==null&&(k.lanes|=s),cf(y.return,s,r),d||(D=null);break e}y=k.next}}else if(p.tag===18){if(D=p.return,D===null)throw Error(n(341));D.lanes|=s,y=D.alternate,y!==null&&(y.lanes|=s),cf(D,s,r),D=null}else D=p.child;if(D!==null)D.return=p;else for(D=p;D!==null;){if(D===r){D=null;break}if(p=D.sibling,p!==null){p.return=D.return,D=p;break}D=D.return}p=D}}function Ki(r,i,s,d){r=null;for(var p=i,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var D=p.alternate;if(D===null)throw Error(n(387));if(D=D.memoizedProps,D!==null){var k=p.type;$a(p.pendingProps.value,D.value)||(r!==null?r.push(k):r=[k])}}else if(p===de.current){if(D=p.alternate,D===null)throw Error(n(387));D.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Du):r=[Du])}p=p.return}r!==null&&ff(i,r,s,d),i.flags|=262144}function zs(r){for(r=r.firstContext;r!==null;){if(!$a(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function oi(r){si=r,Pr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Ea(r){return np(si,r)}function Os(r,i){return si===null&&oi(r),np(r,i)}function np(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Pr===null){if(r===null)throw Error(n(308));Pr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Pr=Pr.next=i;return s}var BS=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},NS=t.unstable_scheduleCallback,MS=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vf(){return{controller:new BS,data:new Map,refCount:0}}function tu(r){r.refCount--,r.refCount===0&&NS(MS,function(){r.controller.abort()})}var au=null,df=0,Zi=0,Qi=null;function RS(r,i){if(au===null){var s=au=[];df=0,Zi=pv(),Qi={status:"pending",value:void 0,then:function(d){s.push(d)}}}return df++,i.then(ip,ip),i}function ip(){if(--df===0&&au!==null){Qi!==null&&(Qi.status="fulfilled");var r=au;au=null,Zi=0,Qi=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function zS(r,i){var s=[],d={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),d}var lp=_.S;_.S=function(r,i){Gm=Be(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&RS(r,i),lp!==null&&lp(r,i)};var ci=N(null);function hf(){var r=ci.current;return r!==null?r:Lt.pooledCache}function Ls(r,i){i===null?Z(ci,ci.current):Z(ci,i.pool)}function up(){var r=hf();return r===null?null:{parent:ta._currentValue,pool:r}}var $i=Error(n(460)),gf=Error(n(474)),ks=Error(n(542)),_s={then:function(){}};function sp(r){return r=r.status,r==="fulfilled"||r==="rejected"}function op(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(qr,qr),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,fp(r),r;default:if(typeof i.status=="string")i.then(qr,qr);else{if(r=Lt,r!==null&&100<r.shellSuspendCounter)throw Error(n(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,fp(r),r}throw vi=i,$i}}function fi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(vi=s,$i):s}}var vi=null;function cp(){if(vi===null)throw Error(n(459));var r=vi;return vi=null,r}function fp(r){if(r===$i||r===ks)throw Error(n(483))}var Wi=null,ru=0;function qs(r){var i=ru;return ru+=1,Wi===null&&(Wi=[]),op(Wi,r,i)}function nu(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Vs(r,i){throw i.$$typeof===m?Error(n(525)):(r=Object.prototype.toString.call(i),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function vp(r){function i(J,K){if(r){var ne=J.deletions;ne===null?(J.deletions=[K],J.flags|=16):ne.push(K)}}function s(J,K){if(!r)return null;for(;K!==null;)i(J,K),K=K.sibling;return null}function d(J){for(var K=new Map;J!==null;)J.key!==null?K.set(J.key,J):K.set(J.index,J),J=J.sibling;return K}function p(J,K){return J=Ur(J,K),J.index=0,J.sibling=null,J}function y(J,K,ne){return J.index=ne,r?(ne=J.alternate,ne!==null?(ne=ne.index,ne<K?(J.flags|=67108866,K):ne):(J.flags|=67108866,K)):(J.flags|=1048576,K)}function D(J){return r&&J.alternate===null&&(J.flags|=67108866),J}function k(J,K,ne,ye){return K===null||K.tag!==6?(K=af(ne,J.mode,ye),K.return=J,K):(K=p(K,ne),K.return=J,K)}function X(J,K,ne,ye){var Ie=ne.type;return Ie===E?ge(J,K,ne.props.children,ye,ne.key):K!==null&&(K.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===O&&fi(Ie)===K.type)?(K=p(K,ne.props),nu(K,ne),K.return=J,K):(K=Ms(ne.type,ne.key,ne.props,null,J.mode,ye),nu(K,ne),K.return=J,K)}function ie(J,K,ne,ye){return K===null||K.tag!==4||K.stateNode.containerInfo!==ne.containerInfo||K.stateNode.implementation!==ne.implementation?(K=rf(ne,J.mode,ye),K.return=J,K):(K=p(K,ne.children||[]),K.return=J,K)}function ge(J,K,ne,ye,Ie){return K===null||K.tag!==7?(K=li(ne,J.mode,ye,Ie),K.return=J,K):(K=p(K,ne),K.return=J,K)}function be(J,K,ne){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=af(""+K,J.mode,ne),K.return=J,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case x:return ne=Ms(K.type,K.key,K.props,null,J.mode,ne),nu(ne,K),ne.return=J,ne;case b:return K=rf(K,J.mode,ne),K.return=J,K;case O:return K=fi(K),be(J,K,ne)}if(F(K)||P(K))return K=li(K,J.mode,ne,null),K.return=J,K;if(typeof K.then=="function")return be(J,qs(K),ne);if(K.$$typeof===C)return be(J,Os(J,K),ne);Vs(J,K)}return null}function ue(J,K,ne,ye){var Ie=K!==null?K.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ie!==null?null:k(J,K,""+ne,ye);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:return ne.key===Ie?X(J,K,ne,ye):null;case b:return ne.key===Ie?ie(J,K,ne,ye):null;case O:return ne=fi(ne),ue(J,K,ne,ye)}if(F(ne)||P(ne))return Ie!==null?null:ge(J,K,ne,ye,null);if(typeof ne.then=="function")return ue(J,K,qs(ne),ye);if(ne.$$typeof===C)return ue(J,K,Os(J,ne),ye);Vs(J,ne)}return null}function ve(J,K,ne,ye,Ie){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return J=J.get(ne)||null,k(K,J,""+ye,Ie);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case x:return J=J.get(ye.key===null?ne:ye.key)||null,X(K,J,ye,Ie);case b:return J=J.get(ye.key===null?ne:ye.key)||null,ie(K,J,ye,Ie);case O:return ye=fi(ye),ve(J,K,ne,ye,Ie)}if(F(ye)||P(ye))return J=J.get(ne)||null,ge(K,J,ye,Ie,null);if(typeof ye.then=="function")return ve(J,K,ne,qs(ye),Ie);if(ye.$$typeof===C)return ve(J,K,ne,Os(K,ye),Ie);Vs(K,ye)}return null}function Le(J,K,ne,ye){for(var Ie=null,bt=null,je=K,lt=K=0,ht=null;je!==null&&lt<ne.length;lt++){je.index>lt?(ht=je,je=null):ht=je.sibling;var xt=ue(J,je,ne[lt],ye);if(xt===null){je===null&&(je=ht);break}r&&je&&xt.alternate===null&&i(J,je),K=y(xt,K,lt),bt===null?Ie=xt:bt.sibling=xt,bt=xt,je=ht}if(lt===ne.length)return s(J,je),pt&&jr(J,lt),Ie;if(je===null){for(;lt<ne.length;lt++)je=be(J,ne[lt],ye),je!==null&&(K=y(je,K,lt),bt===null?Ie=je:bt.sibling=je,bt=je);return pt&&jr(J,lt),Ie}for(je=d(je);lt<ne.length;lt++)ht=ve(je,J,lt,ne[lt],ye),ht!==null&&(r&&ht.alternate!==null&&je.delete(ht.key===null?lt:ht.key),K=y(ht,K,lt),bt===null?Ie=ht:bt.sibling=ht,bt=ht);return r&&je.forEach(function(kn){return i(J,kn)}),pt&&jr(J,lt),Ie}function Ze(J,K,ne,ye){if(ne==null)throw Error(n(151));for(var Ie=null,bt=null,je=K,lt=K=0,ht=null,xt=ne.next();je!==null&&!xt.done;lt++,xt=ne.next()){je.index>lt?(ht=je,je=null):ht=je.sibling;var kn=ue(J,je,xt.value,ye);if(kn===null){je===null&&(je=ht);break}r&&je&&kn.alternate===null&&i(J,je),K=y(kn,K,lt),bt===null?Ie=kn:bt.sibling=kn,bt=kn,je=ht}if(xt.done)return s(J,je),pt&&jr(J,lt),Ie;if(je===null){for(;!xt.done;lt++,xt=ne.next())xt=be(J,xt.value,ye),xt!==null&&(K=y(xt,K,lt),bt===null?Ie=xt:bt.sibling=xt,bt=xt);return pt&&jr(J,lt),Ie}for(je=d(je);!xt.done;lt++,xt=ne.next())xt=ve(je,J,lt,xt.value,ye),xt!==null&&(r&&xt.alternate!==null&&je.delete(xt.key===null?lt:xt.key),K=y(xt,K,lt),bt===null?Ie=xt:bt.sibling=xt,bt=xt);return r&&je.forEach(function(G2){return i(J,G2)}),pt&&jr(J,lt),Ie}function Mt(J,K,ne,ye){if(typeof ne=="object"&&ne!==null&&ne.type===E&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:e:{for(var Ie=ne.key;K!==null;){if(K.key===Ie){if(Ie=ne.type,Ie===E){if(K.tag===7){s(J,K.sibling),ye=p(K,ne.props.children),ye.return=J,J=ye;break e}}else if(K.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===O&&fi(Ie)===K.type){s(J,K.sibling),ye=p(K,ne.props),nu(ye,ne),ye.return=J,J=ye;break e}s(J,K);break}else i(J,K);K=K.sibling}ne.type===E?(ye=li(ne.props.children,J.mode,ye,ne.key),ye.return=J,J=ye):(ye=Ms(ne.type,ne.key,ne.props,null,J.mode,ye),nu(ye,ne),ye.return=J,J=ye)}return D(J);case b:e:{for(Ie=ne.key;K!==null;){if(K.key===Ie)if(K.tag===4&&K.stateNode.containerInfo===ne.containerInfo&&K.stateNode.implementation===ne.implementation){s(J,K.sibling),ye=p(K,ne.children||[]),ye.return=J,J=ye;break e}else{s(J,K);break}else i(J,K);K=K.sibling}ye=rf(ne,J.mode,ye),ye.return=J,J=ye}return D(J);case O:return ne=fi(ne),Mt(J,K,ne,ye)}if(F(ne))return Le(J,K,ne,ye);if(P(ne)){if(Ie=P(ne),typeof Ie!="function")throw Error(n(150));return ne=Ie.call(ne),Ze(J,K,ne,ye)}if(typeof ne.then=="function")return Mt(J,K,qs(ne),ye);if(ne.$$typeof===C)return Mt(J,K,Os(J,ne),ye);Vs(J,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,K!==null&&K.tag===6?(s(J,K.sibling),ye=p(K,ne),ye.return=J,J=ye):(s(J,K),ye=af(ne,J.mode,ye),ye.return=J,J=ye),D(J)):s(J,K)}return function(J,K,ne,ye){try{ru=0;var Ie=Mt(J,K,ne,ye);return Wi=null,Ie}catch(je){if(je===$i||je===ks)throw je;var bt=Wa(29,je,null,J.mode);return bt.lanes=ye,bt.return=J,bt}}}var di=vp(!0),dp=vp(!1),yn=!1;function pf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mf(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function bn(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function xn(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(St&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=Ns(r),Qg(r,null,s),i}return Bs(r,d,i,s),Ns(r)}function iu(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,Ft(r,s)}}function yf(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?p=y=D:y=y.next=D,s=s.next}while(s!==null);y===null?p=y=i:y=y.next=i}else p=y=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var bf=!1;function lu(){if(bf){var r=Qi;if(r!==null)throw r}}function uu(r,i,s,d){bf=!1;var p=r.updateQueue;yn=!1;var y=p.firstBaseUpdate,D=p.lastBaseUpdate,k=p.shared.pending;if(k!==null){p.shared.pending=null;var X=k,ie=X.next;X.next=null,D===null?y=ie:D.next=ie,D=X;var ge=r.alternate;ge!==null&&(ge=ge.updateQueue,k=ge.lastBaseUpdate,k!==D&&(k===null?ge.firstBaseUpdate=ie:k.next=ie,ge.lastBaseUpdate=X))}if(y!==null){var be=p.baseState;D=0,ge=ie=X=null,k=y;do{var ue=k.lane&-536870913,ve=ue!==k.lane;if(ve?(dt&ue)===ue:(d&ue)===ue){ue!==0&&ue===Zi&&(bf=!0),ge!==null&&(ge=ge.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Le=r,Ze=k;ue=i;var Mt=s;switch(Ze.tag){case 1:if(Le=Ze.payload,typeof Le=="function"){be=Le.call(Mt,be,ue);break e}be=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Ze.payload,ue=typeof Le=="function"?Le.call(Mt,be,ue):Le,ue==null)break e;be=g({},be,ue);break e;case 2:yn=!0}}ue=k.callback,ue!==null&&(r.flags|=64,ve&&(r.flags|=8192),ve=p.callbacks,ve===null?p.callbacks=[ue]:ve.push(ue))}else ve={lane:ue,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ge===null?(ie=ge=ve,X=be):ge=ge.next=ve,D|=ue;if(k=k.next,k===null){if(k=p.shared.pending,k===null)break;ve=k,k=ve.next,ve.next=null,p.lastBaseUpdate=ve,p.shared.pending=null}}while(!0);ge===null&&(X=be),p.baseState=X,p.firstBaseUpdate=ie,p.lastBaseUpdate=ge,y===null&&(p.shared.lanes=0),Cn|=D,r.lanes=D,r.memoizedState=be}}function hp(r,i){if(typeof r!="function")throw Error(n(191,r));r.call(i)}function gp(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)hp(s[r],i)}var Ji=N(null),Us=N(0);function pp(r,i){r=$r,Z(Us,r),Z(Ji,i),$r=r|i.baseLanes}function xf(){Z(Us,$r),Z(Ji,Ji.current)}function wf(){$r=Us.current,G(Ji),G(Us)}var Ja=N(null),dr=null;function wn(r){var i=r.alternate;Z(Wt,Wt.current&1),Z(Ja,r),dr===null&&(i===null||Ji.current!==null||i.memoizedState!==null)&&(dr=r)}function Sf(r){Z(Wt,Wt.current),Z(Ja,r),dr===null&&(dr=r)}function mp(r){r.tag===22?(Z(Wt,Wt.current),Z(Ja,r),dr===null&&(dr=r)):Sn()}function Sn(){Z(Wt,Wt.current),Z(Ja,Ja.current)}function er(r){G(Ja),dr===r&&(dr=null),G(Wt)}var Wt=N(0);function js(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Bv(s)||Nv(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Gr=0,nt=null,Bt=null,aa=null,Ps=!1,el=!1,hi=!1,Hs=0,su=0,tl=null,OS=0;function Kt(){throw Error(n(321))}function Ef(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!$a(r[s],i[s]))return!1;return!0}function Tf(r,i,s,d,p,y){return Gr=y,nt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,_.H=r===null||r.memoizedState===null?em:Uf,hi=!1,y=s(d,p),hi=!1,el&&(y=bp(i,s,d,p)),yp(r),y}function yp(r){_.H=fu;var i=Bt!==null&&Bt.next!==null;if(Gr=0,aa=Bt=nt=null,Ps=!1,su=0,tl=null,i)throw Error(n(300));r===null||ra||(r=r.dependencies,r!==null&&zs(r)&&(ra=!0))}function bp(r,i,s,d){nt=r;var p=0;do{if(el&&(tl=null),su=0,el=!1,25<=p)throw Error(n(301));if(p+=1,aa=Bt=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}_.H=tm,y=i(s,d)}while(el);return y}function LS(){var r=_.H,i=r.useState()[0];return i=typeof i.then=="function"?ou(i):i,r=r.useState()[0],(Bt!==null?Bt.memoizedState:null)!==r&&(nt.flags|=1024),i}function Cf(){var r=Hs!==0;return Hs=0,r}function Af(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Df(r){if(Ps){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ps=!1}Gr=0,aa=Bt=nt=null,el=!1,su=Hs=0,tl=null}function _a(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return aa===null?nt.memoizedState=aa=r:aa=aa.next=r,aa}function Jt(){if(Bt===null){var r=nt.alternate;r=r!==null?r.memoizedState:null}else r=Bt.next;var i=aa===null?nt.memoizedState:aa.next;if(i!==null)aa=i,Bt=r;else{if(r===null)throw nt.alternate===null?Error(n(467)):Error(n(310));Bt=r,r={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},aa===null?nt.memoizedState=aa=r:aa=aa.next=r}return aa}function Gs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ou(r){var i=su;return su+=1,tl===null&&(tl=[]),r=op(tl,r,i),i=nt,(aa===null?i.memoizedState:aa.next)===null&&(i=i.alternate,_.H=i===null||i.memoizedState===null?em:Uf),r}function Is(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return ou(r);if(r.$$typeof===C)return Ea(r)}throw Error(n(438,String(r)))}function Bf(r){var i=null,s=nt.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=nt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Gs(),nt.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),d=0;d<r;d++)s[d]=U;return i.index++,s}function Ir(r,i){return typeof i=="function"?i(r):i}function Ys(r){var i=Jt();return Nf(i,Bt,r)}function Nf(r,i,s){var d=r.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=s;var p=r.baseQueue,y=d.pending;if(y!==null){if(p!==null){var D=p.next;p.next=y.next,y.next=D}i.baseQueue=p=y,d.pending=null}if(y=r.baseState,p===null)r.memoizedState=y;else{i=p.next;var k=D=null,X=null,ie=i,ge=!1;do{var be=ie.lane&-536870913;if(be!==ie.lane?(dt&be)===be:(Gr&be)===be){var ue=ie.revertLane;if(ue===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),be===Zi&&(ge=!0);else if((Gr&ue)===ue){ie=ie.next,ue===Zi&&(ge=!0);continue}else be={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},X===null?(k=X=be,D=y):X=X.next=be,nt.lanes|=ue,Cn|=ue;be=ie.action,hi&&s(y,be),y=ie.hasEagerState?ie.eagerState:s(y,be)}else ue={lane:be,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},X===null?(k=X=ue,D=y):X=X.next=ue,nt.lanes|=be,Cn|=be;ie=ie.next}while(ie!==null&&ie!==i);if(X===null?D=y:X.next=k,!$a(y,r.memoizedState)&&(ra=!0,ge&&(s=Qi,s!==null)))throw s;r.memoizedState=y,r.baseState=D,r.baseQueue=X,d.lastRenderedState=y}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Mf(r){var i=Jt(),s=i.queue;if(s===null)throw Error(n(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,y=i.memoizedState;if(p!==null){s.pending=null;var D=p=p.next;do y=r(y,D.action),D=D.next;while(D!==p);$a(y,i.memoizedState)||(ra=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),s.lastRenderedState=y}return[y,d]}function xp(r,i,s){var d=nt,p=Jt(),y=pt;if(y){if(s===void 0)throw Error(n(407));s=s()}else s=i();var D=!$a((Bt||p).memoizedState,s);if(D&&(p.memoizedState=s,ra=!0),p=p.queue,Of(Ep.bind(null,d,p,r),[r]),p.getSnapshot!==i||D||aa!==null&&aa.memoizedState.tag&1){if(d.flags|=2048,al(9,{destroy:void 0},Sp.bind(null,d,p,s,i),null),Lt===null)throw Error(n(349));y||(Gr&127)!==0||wp(d,i,s)}return s}function wp(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=nt.updateQueue,i===null?(i=Gs(),nt.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Sp(r,i,s,d){i.value=s,i.getSnapshot=d,Tp(i)&&Cp(r)}function Ep(r,i,s){return s(function(){Tp(i)&&Cp(r)})}function Tp(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!$a(r,s)}catch{return!0}}function Cp(r){var i=ii(r,2);i!==null&&Fa(i,r,2)}function Rf(r){var i=_a();if(typeof r=="function"){var s=r;if(r=s(),hi){ce(!0);try{s()}finally{ce(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:r},i}function Ap(r,i,s,d){return r.baseState=s,Nf(r,Bt,typeof d=="function"?d:Ir)}function kS(r,i,s,d,p){if(Ks(r))throw Error(n(485));if(r=i.action,r!==null){var y={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){y.listeners.push(D)}};_.T!==null?s(!0):y.isTransition=!1,d(y),s=i.pending,s===null?(y.next=i.pending=y,Dp(i,y)):(y.next=s.next,i.pending=s.next=y)}}function Dp(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var y=_.T,D={};_.T=D;try{var k=s(p,d),X=_.S;X!==null&&X(D,k),Bp(r,i,k)}catch(ie){zf(r,i,ie)}finally{y!==null&&D.types!==null&&(y.types=D.types),_.T=y}}else try{y=s(p,d),Bp(r,i,y)}catch(ie){zf(r,i,ie)}}function Bp(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){Np(r,i,d)},function(d){return zf(r,i,d)}):Np(r,i,s)}function Np(r,i,s){i.status="fulfilled",i.value=s,Mp(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Dp(r,s)))}function zf(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,Mp(i),i=i.next;while(i!==d)}r.action=null}function Mp(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Rp(r,i){return i}function zp(r,i){if(pt){var s=Lt.formState;if(s!==null){e:{var d=nt;if(pt){if(Pt){t:{for(var p=Pt,y=vr;p.nodeType!==8;){if(!y){p=null;break t}if(p=hr(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Pt=hr(p.nextSibling),d=p.data==="F!";break e}}pn(d)}d=!1}d&&(i=s[0])}}return s=_a(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rp,lastRenderedState:i},s.queue=d,s=$p.bind(null,nt,d),d.dispatch=s,d=Rf(!1),y=Vf.bind(null,nt,!1,d.queue),d=_a(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=kS.bind(null,nt,p,y,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function Op(r){var i=Jt();return Lp(i,Bt,r)}function Lp(r,i,s){if(i=Nf(r,i,Rp)[0],r=Ys(Ir)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=ou(i)}catch(D){throw D===$i?ks:D}else d=i;i=Jt();var p=i.queue,y=p.dispatch;return s!==i.memoizedState&&(nt.flags|=2048,al(9,{destroy:void 0},_S.bind(null,p,s),null)),[d,y,r]}function _S(r,i){r.action=i}function kp(r){var i=Jt(),s=Bt;if(s!==null)return Lp(i,s,r);Jt(),i=i.memoizedState,s=Jt();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function al(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=nt.updateQueue,i===null&&(i=Gs(),nt.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(d=s.next,s.next=r,r.next=d,i.lastEffect=r),r}function _p(){return Jt().memoizedState}function Fs(r,i,s,d){var p=_a();nt.flags|=r,p.memoizedState=al(1|i,{destroy:void 0},s,d===void 0?null:d)}function Xs(r,i,s,d){var p=Jt();d=d===void 0?null:d;var y=p.memoizedState.inst;Bt!==null&&d!==null&&Ef(d,Bt.memoizedState.deps)?p.memoizedState=al(i,y,s,d):(nt.flags|=r,p.memoizedState=al(1|i,y,s,d))}function qp(r,i){Fs(8390656,8,r,i)}function Of(r,i){Xs(2048,8,r,i)}function qS(r){nt.flags|=4;var i=nt.updateQueue;if(i===null)i=Gs(),nt.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Vp(r){var i=Jt().memoizedState;return qS({ref:i,nextImpl:r}),function(){if((St&2)!==0)throw Error(n(440));return i.impl.apply(void 0,arguments)}}function Up(r,i){return Xs(4,2,r,i)}function jp(r,i){return Xs(4,4,r,i)}function Pp(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Hp(r,i,s){s=s!=null?s.concat([r]):null,Xs(4,4,Pp.bind(null,i,r),s)}function Lf(){}function Gp(r,i){var s=Jt();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&Ef(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function Ip(r,i){var s=Jt();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&Ef(i,d[1]))return d[0];if(d=r(),hi){ce(!0);try{r()}finally{ce(!1)}}return s.memoizedState=[d,i],d}function kf(r,i,s){return s===void 0||(Gr&1073741824)!==0&&(dt&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Ym(),nt.lanes|=r,Cn|=r,s)}function Yp(r,i,s,d){return $a(s,i)?s:Ji.current!==null?(r=kf(r,s,d),$a(r,i)||(ra=!0),r):(Gr&42)===0||(Gr&1073741824)!==0&&(dt&261930)===0?(ra=!0,r.memoizedState=s):(r=Ym(),nt.lanes|=r,Cn|=r,i)}function Fp(r,i,s,d,p){var y=j.p;j.p=y!==0&&8>y?y:8;var D=_.T,k={};_.T=k,Vf(r,!1,i,s);try{var X=p(),ie=_.S;if(ie!==null&&ie(k,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ge=zS(X,d);cu(r,i,ge,rr(r))}else cu(r,i,d,rr(r))}catch(be){cu(r,i,{then:function(){},status:"rejected",reason:be},rr())}finally{j.p=y,D!==null&&k.types!==null&&(D.types=k.types),_.T=D}}function VS(){}function _f(r,i,s,d){if(r.tag!==5)throw Error(n(476));var p=Xp(r).queue;Fp(r,p,i,Y,s===null?VS:function(){return Kp(r),s(d)})}function Xp(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:Y},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Kp(r){var i=Xp(r);i.next===null&&(i=r.alternate.memoizedState),cu(r,i.next.queue,{},rr())}function qf(){return Ea(Du)}function Zp(){return Jt().memoizedState}function Qp(){return Jt().memoizedState}function US(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=rr();r=bn(s);var d=xn(i,r,s);d!==null&&(Fa(d,i,s),iu(d,i,s)),i={cache:vf()},r.payload=i;return}i=i.return}}function jS(r,i,s){var d=rr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ks(r)?Wp(i,s):(s=ef(r,i,s,d),s!==null&&(Fa(s,r,d),Jp(s,i,d)))}function $p(r,i,s){var d=rr();cu(r,i,s,d)}function cu(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ks(r))Wp(i,p);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var D=i.lastRenderedState,k=y(D,s);if(p.hasEagerState=!0,p.eagerState=k,$a(k,D))return Bs(r,i,p,0),Lt===null&&Ds(),!1}catch{}if(s=ef(r,i,p,d),s!==null)return Fa(s,r,d),Jp(s,i,d),!0}return!1}function Vf(r,i,s,d){if(d={lane:2,revertLane:pv(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Ks(r)){if(i)throw Error(n(479))}else i=ef(r,s,d,2),i!==null&&Fa(i,r,2)}function Ks(r){var i=r.alternate;return r===nt||i!==null&&i===nt}function Wp(r,i){el=Ps=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function Jp(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,Ft(r,s)}}var fu={readContext:Ea,use:Is,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};fu.useEffectEvent=Kt;var em={readContext:Ea,use:Is,useCallback:function(r,i){return _a().memoizedState=[r,i===void 0?null:i],r},useContext:Ea,useEffect:qp,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Fs(4194308,4,Pp.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Fs(4194308,4,r,i)},useInsertionEffect:function(r,i){Fs(4,2,r,i)},useMemo:function(r,i){var s=_a();i=i===void 0?null:i;var d=r();if(hi){ce(!0);try{r()}finally{ce(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=_a();if(s!==void 0){var p=s(i);if(hi){ce(!0);try{s(i)}finally{ce(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=jS.bind(null,nt,r),[d.memoizedState,r]},useRef:function(r){var i=_a();return r={current:r},i.memoizedState=r},useState:function(r){r=Rf(r);var i=r.queue,s=$p.bind(null,nt,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:Lf,useDeferredValue:function(r,i){var s=_a();return kf(s,r,i)},useTransition:function(){var r=Rf(!1);return r=Fp.bind(null,nt,r.queue,!0,!1),_a().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=nt,p=_a();if(pt){if(s===void 0)throw Error(n(407));s=s()}else{if(s=i(),Lt===null)throw Error(n(349));(dt&127)!==0||wp(d,i,s)}p.memoizedState=s;var y={value:s,getSnapshot:i};return p.queue=y,qp(Ep.bind(null,d,y,r),[r]),d.flags|=2048,al(9,{destroy:void 0},Sp.bind(null,d,y,s,i),null),s},useId:function(){var r=_a(),i=Lt.identifierPrefix;if(pt){var s=Dr,d=Ar;s=(d&~(1<<32-oe(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Hs++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=OS++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:qf,useFormState:zp,useActionState:zp,useOptimistic:function(r){var i=_a();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Vf.bind(null,nt,!0,s),s.dispatch=i,[r,i]},useMemoCache:Bf,useCacheRefresh:function(){return _a().memoizedState=US.bind(null,nt)},useEffectEvent:function(r){var i=_a(),s={impl:r};return i.memoizedState=s,function(){if((St&2)!==0)throw Error(n(440));return s.impl.apply(void 0,arguments)}}},Uf={readContext:Ea,use:Is,useCallback:Gp,useContext:Ea,useEffect:Of,useImperativeHandle:Hp,useInsertionEffect:Up,useLayoutEffect:jp,useMemo:Ip,useReducer:Ys,useRef:_p,useState:function(){return Ys(Ir)},useDebugValue:Lf,useDeferredValue:function(r,i){var s=Jt();return Yp(s,Bt.memoizedState,r,i)},useTransition:function(){var r=Ys(Ir)[0],i=Jt().memoizedState;return[typeof r=="boolean"?r:ou(r),i]},useSyncExternalStore:xp,useId:Zp,useHostTransitionStatus:qf,useFormState:Op,useActionState:Op,useOptimistic:function(r,i){var s=Jt();return Ap(s,Bt,r,i)},useMemoCache:Bf,useCacheRefresh:Qp};Uf.useEffectEvent=Vp;var tm={readContext:Ea,use:Is,useCallback:Gp,useContext:Ea,useEffect:Of,useImperativeHandle:Hp,useInsertionEffect:Up,useLayoutEffect:jp,useMemo:Ip,useReducer:Mf,useRef:_p,useState:function(){return Mf(Ir)},useDebugValue:Lf,useDeferredValue:function(r,i){var s=Jt();return Bt===null?kf(s,r,i):Yp(s,Bt.memoizedState,r,i)},useTransition:function(){var r=Mf(Ir)[0],i=Jt().memoizedState;return[typeof r=="boolean"?r:ou(r),i]},useSyncExternalStore:xp,useId:Zp,useHostTransitionStatus:qf,useFormState:kp,useActionState:kp,useOptimistic:function(r,i){var s=Jt();return Bt!==null?Ap(s,Bt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Bf,useCacheRefresh:Qp};tm.useEffectEvent=Vp;function jf(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Pf={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=rr(),p=bn(d);p.payload=i,s!=null&&(p.callback=s),i=xn(r,p,d),i!==null&&(Fa(i,r,d),iu(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=rr(),p=bn(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=xn(r,p,d),i!==null&&(Fa(i,r,d),iu(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=rr(),d=bn(s);d.tag=2,i!=null&&(d.callback=i),i=xn(r,d,s),i!==null&&(Fa(i,r,s),iu(i,r,s))}};function am(r,i,s,d,p,y,D){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,y,D):i.prototype&&i.prototype.isPureReactComponent?!$l(s,d)||!$l(p,y):!0}function rm(r,i,s,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,d),i.state!==r&&Pf.enqueueReplaceState(i,i.state,null)}function gi(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function nm(r){As(r)}function im(r){console.error(r)}function lm(r){As(r)}function Zs(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function um(r,i,s){try{var d=r.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Hf(r,i,s){return s=bn(s),s.tag=3,s.payload={element:null},s.callback=function(){Zs(r,i)},s}function sm(r){return r=bn(r),r.tag=3,r}function om(r,i,s,d){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var y=d.value;r.payload=function(){return p(y)},r.callback=function(){um(i,s,d)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(r.callback=function(){um(i,s,d),typeof p!="function"&&(An===null?An=new Set([this]):An.add(this));var k=d.stack;this.componentDidCatch(d.value,{componentStack:k!==null?k:""})})}function PS(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Ki(i,s,p,!0),s=Ja.current,s!==null){switch(s.tag){case 31:case 13:return dr===null?uo():s.alternate===null&&Zt===0&&(Zt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===_s?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),dv(r,d,p)),!1;case 22:return s.flags|=65536,d===_s?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([d]):s.add(d)),dv(r,d,p)),!1}throw Error(n(435,s.tag))}return dv(r,d,p),uo(),!1}if(pt)return i=Ja.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==uf&&(r=Error(n(422),{cause:d}),eu(or(r,s)))):(d!==uf&&(i=Error(n(423),{cause:d}),eu(or(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=or(d,s),p=Hf(r.stateNode,d,p),yf(r,p),Zt!==4&&(Zt=2)),!1;var y=Error(n(520),{cause:d});if(y=or(y,s),bu===null?bu=[y]:bu.push(y),Zt!==4&&(Zt=2),i===null)return!0;d=or(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Hf(s.stateNode,d,r),yf(s,r),!1;case 1:if(i=s.type,y=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(An===null||!An.has(y))))return s.flags|=65536,p&=-p,s.lanes|=p,p=sm(p),om(p,r,s,d),yf(s,p),!1}s=s.return}while(s!==null);return!1}var Gf=Error(n(461)),ra=!1;function Ta(r,i,s,d){i.child=r===null?dp(i,null,s,d):di(i,r.child,s,d)}function cm(r,i,s,d,p){s=s.render;var y=i.ref;if("ref"in d){var D={};for(var k in d)k!=="ref"&&(D[k]=d[k])}else D=d;return oi(i),d=Tf(r,i,s,D,y,p),k=Cf(),r!==null&&!ra?(Af(r,i,p),Yr(r,i,p)):(pt&&k&&nf(i),i.flags|=1,Ta(r,i,d,p),i.child)}function fm(r,i,s,d,p){if(r===null){var y=s.type;return typeof y=="function"&&!tf(y)&&y.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=y,vm(r,i,y,d,p)):(r=Ms(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(y=r.child,!$f(r,p)){var D=y.memoizedProps;if(s=s.compare,s=s!==null?s:$l,s(D,d)&&r.ref===i.ref)return Yr(r,i,p)}return i.flags|=1,r=Ur(y,d),r.ref=i.ref,r.return=i,i.child=r}function vm(r,i,s,d,p){if(r!==null){var y=r.memoizedProps;if($l(y,d)&&r.ref===i.ref)if(ra=!1,i.pendingProps=d=y,$f(r,p))(r.flags&131072)!==0&&(ra=!0);else return i.lanes=r.lanes,Yr(r,i,p)}return If(r,i,s,d,p)}function dm(r,i,s,d){var p=d.children,y=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(y=y!==null?y.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~y}else d=0,i.child=null;return hm(r,i,y,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Ls(i,y!==null?y.cachePool:null),y!==null?pp(i,y):xf(),mp(i);else return d=i.lanes=536870912,hm(r,i,y!==null?y.baseLanes|s:s,s,d)}else y!==null?(Ls(i,y.cachePool),pp(i,y),Sn(),i.memoizedState=null):(r!==null&&Ls(i,null),xf(),Sn());return Ta(r,i,p,s),i.child}function vu(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function hm(r,i,s,d,p){var y=hf();return y=y===null?null:{parent:ta._currentValue,pool:y},i.memoizedState={baseLanes:s,cachePool:y},r!==null&&Ls(i,null),xf(),mp(i),r!==null&&Ki(r,i,d,!0),i.childLanes=p,null}function Qs(r,i){return i=Ws({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function gm(r,i,s){return di(i,r.child,null,s),r=Qs(i,i.pendingProps),r.flags|=2,er(i),i.memoizedState=null,r}function HS(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(pt){if(d.mode==="hidden")return r=Qs(i,d),i.lanes=536870912,vu(null,r);if(Sf(i),(r=Pt)?(r=Dy(r,vr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:hn!==null?{id:Ar,overflow:Dr}:null,retryLane:536870912,hydrationErrors:null},s=Wg(r),s.return=i,i.child=s,Sa=i,Pt=null)):r=null,r===null)throw pn(i);return i.lanes=536870912,null}return Qs(i,d)}var y=r.memoizedState;if(y!==null){var D=y.dehydrated;if(Sf(i),p)if(i.flags&256)i.flags&=-257,i=gm(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(n(558));else if(ra||Ki(r,i,s,!1),p=(s&r.childLanes)!==0,ra||p){if(d=Lt,d!==null&&(D=xe(d,s),D!==0&&D!==y.retryLane))throw y.retryLane=D,ii(r,D),Fa(d,r,D),Gf;uo(),i=gm(r,i,s)}else r=y.treeContext,Pt=hr(D.nextSibling),Sa=i,pt=!0,gn=null,vr=!1,r!==null&&tp(i,r),i=Qs(i,d),i.flags|=4096;return i}return r=Ur(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function $s(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(n(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function If(r,i,s,d,p){return oi(i),s=Tf(r,i,s,d,void 0,p),d=Cf(),r!==null&&!ra?(Af(r,i,p),Yr(r,i,p)):(pt&&d&&nf(i),i.flags|=1,Ta(r,i,s,p),i.child)}function pm(r,i,s,d,p,y){return oi(i),i.updateQueue=null,s=bp(i,d,s,p),yp(r),d=Cf(),r!==null&&!ra?(Af(r,i,y),Yr(r,i,y)):(pt&&d&&nf(i),i.flags|=1,Ta(r,i,s,y),i.child)}function mm(r,i,s,d,p){if(oi(i),i.stateNode===null){var y=Ii,D=s.contextType;typeof D=="object"&&D!==null&&(y=Ea(D)),y=new s(d,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Pf,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=d,y.state=i.memoizedState,y.refs={},pf(i),D=s.contextType,y.context=typeof D=="object"&&D!==null?Ea(D):Ii,y.state=i.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(jf(i,s,D,d),y.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(D=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),D!==y.state&&Pf.enqueueReplaceState(y,y.state,null),uu(i,d,y,p),lu(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){y=i.stateNode;var k=i.memoizedProps,X=gi(s,k);y.props=X;var ie=y.context,ge=s.contextType;D=Ii,typeof ge=="object"&&ge!==null&&(D=Ea(ge));var be=s.getDerivedStateFromProps;ge=typeof be=="function"||typeof y.getSnapshotBeforeUpdate=="function",k=i.pendingProps!==k,ge||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k||ie!==D)&&rm(i,y,d,D),yn=!1;var ue=i.memoizedState;y.state=ue,uu(i,d,y,p),lu(),ie=i.memoizedState,k||ue!==ie||yn?(typeof be=="function"&&(jf(i,s,be,d),ie=i.memoizedState),(X=yn||am(i,s,X,d,ue,ie,D))?(ge||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=ie),y.props=d,y.state=ie,y.context=D,d=X):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{y=i.stateNode,mf(r,i),D=i.memoizedProps,ge=gi(s,D),y.props=ge,be=i.pendingProps,ue=y.context,ie=s.contextType,X=Ii,typeof ie=="object"&&ie!==null&&(X=Ea(ie)),k=s.getDerivedStateFromProps,(ie=typeof k=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(D!==be||ue!==X)&&rm(i,y,d,X),yn=!1,ue=i.memoizedState,y.state=ue,uu(i,d,y,p),lu();var ve=i.memoizedState;D!==be||ue!==ve||yn||r!==null&&r.dependencies!==null&&zs(r.dependencies)?(typeof k=="function"&&(jf(i,s,k,d),ve=i.memoizedState),(ge=yn||am(i,s,ge,d,ue,ve,X)||r!==null&&r.dependencies!==null&&zs(r.dependencies))?(ie||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,ve,X),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,ve,X)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||D===r.memoizedProps&&ue===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||D===r.memoizedProps&&ue===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ve),y.props=d,y.state=ve,y.context=X,d=ge):(typeof y.componentDidUpdate!="function"||D===r.memoizedProps&&ue===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||D===r.memoizedProps&&ue===r.memoizedState||(i.flags|=1024),d=!1)}return y=d,$s(r,i),d=(i.flags&128)!==0,y||d?(y=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,r!==null&&d?(i.child=di(i,r.child,null,p),i.child=di(i,null,s,p)):Ta(r,i,s,p),i.memoizedState=y.state,r=i.child):r=Yr(r,i,p),r}function ym(r,i,s,d){return ui(),i.flags|=256,Ta(r,i,s,d),i.child}var Yf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ff(r){return{baseLanes:r,cachePool:up()}}function Xf(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=ar),r}function bm(r,i,s){var d=i.pendingProps,p=!1,y=(i.flags&128)!==0,D;if((D=y)||(D=r!==null&&r.memoizedState===null?!1:(Wt.current&2)!==0),D&&(p=!0,i.flags&=-129),D=(i.flags&32)!==0,i.flags&=-33,r===null){if(pt){if(p?wn(i):Sn(),(r=Pt)?(r=Dy(r,vr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:hn!==null?{id:Ar,overflow:Dr}:null,retryLane:536870912,hydrationErrors:null},s=Wg(r),s.return=i,i.child=s,Sa=i,Pt=null)):r=null,r===null)throw pn(i);return Nv(r)?i.lanes=32:i.lanes=536870912,null}var k=d.children;return d=d.fallback,p?(Sn(),p=i.mode,k=Ws({mode:"hidden",children:k},p),d=li(d,p,s,null),k.return=i,d.return=i,k.sibling=d,i.child=k,d=i.child,d.memoizedState=Ff(s),d.childLanes=Xf(r,D,s),i.memoizedState=Yf,vu(null,d)):(wn(i),Kf(i,k))}var X=r.memoizedState;if(X!==null&&(k=X.dehydrated,k!==null)){if(y)i.flags&256?(wn(i),i.flags&=-257,i=Zf(r,i,s)):i.memoizedState!==null?(Sn(),i.child=r.child,i.flags|=128,i=null):(Sn(),k=d.fallback,p=i.mode,d=Ws({mode:"visible",children:d.children},p),k=li(k,p,s,null),k.flags|=2,d.return=i,k.return=i,d.sibling=k,i.child=d,di(i,r.child,null,s),d=i.child,d.memoizedState=Ff(s),d.childLanes=Xf(r,D,s),i.memoizedState=Yf,i=vu(null,d));else if(wn(i),Nv(k)){if(D=k.nextSibling&&k.nextSibling.dataset,D)var ie=D.dgst;D=ie,d=Error(n(419)),d.stack="",d.digest=D,eu({value:d,source:null,stack:null}),i=Zf(r,i,s)}else if(ra||Ki(r,i,s,!1),D=(s&r.childLanes)!==0,ra||D){if(D=Lt,D!==null&&(d=xe(D,s),d!==0&&d!==X.retryLane))throw X.retryLane=d,ii(r,d),Fa(D,r,d),Gf;Bv(k)||uo(),i=Zf(r,i,s)}else Bv(k)?(i.flags|=192,i.child=r.child,i=null):(r=X.treeContext,Pt=hr(k.nextSibling),Sa=i,pt=!0,gn=null,vr=!1,r!==null&&tp(i,r),i=Kf(i,d.children),i.flags|=4096);return i}return p?(Sn(),k=d.fallback,p=i.mode,X=r.child,ie=X.sibling,d=Ur(X,{mode:"hidden",children:d.children}),d.subtreeFlags=X.subtreeFlags&65011712,ie!==null?k=Ur(ie,k):(k=li(k,p,s,null),k.flags|=2),k.return=i,d.return=i,d.sibling=k,i.child=d,vu(null,d),d=i.child,k=r.child.memoizedState,k===null?k=Ff(s):(p=k.cachePool,p!==null?(X=ta._currentValue,p=p.parent!==X?{parent:X,pool:X}:p):p=up(),k={baseLanes:k.baseLanes|s,cachePool:p}),d.memoizedState=k,d.childLanes=Xf(r,D,s),i.memoizedState=Yf,vu(r.child,d)):(wn(i),s=r.child,r=s.sibling,s=Ur(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(D=i.deletions,D===null?(i.deletions=[r],i.flags|=16):D.push(r)),i.child=s,i.memoizedState=null,s)}function Kf(r,i){return i=Ws({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Ws(r,i){return r=Wa(22,r,null,i),r.lanes=0,r}function Zf(r,i,s){return di(i,r.child,null,s),r=Kf(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function xm(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),cf(r.return,i,s)}function Qf(r,i,s,d,p,y){var D=r.memoizedState;D===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:y}:(D.isBackwards=i,D.rendering=null,D.renderingStartTime=0,D.last=d,D.tail=s,D.tailMode=p,D.treeForkCount=y)}function wm(r,i,s){var d=i.pendingProps,p=d.revealOrder,y=d.tail;d=d.children;var D=Wt.current,k=(D&2)!==0;if(k?(D=D&1|2,i.flags|=128):D&=1,Z(Wt,D),Ta(r,i,d,s),d=pt?Jl:0,!k&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&xm(r,s,i);else if(r.tag===19)xm(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&js(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),Qf(i,!1,p,s,y,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&js(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Qf(i,!0,s,null,y,d);break;case"together":Qf(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Yr(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Cn|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Ki(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(n(153));if(i.child!==null){for(r=i.child,s=Ur(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=Ur(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function $f(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&zs(r)))}function GS(r,i,s){switch(i.tag){case 3:Se(i,i.stateNode.containerInfo),mn(i,ta,r.memoizedState.cache),ui();break;case 27:case 5:te(i);break;case 4:Se(i,i.stateNode.containerInfo);break;case 10:mn(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Sf(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(wn(i),i.flags|=128,null):(s&i.child.childLanes)!==0?bm(r,i,s):(wn(i),r=Yr(r,i,s),r!==null?r.sibling:null);wn(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Ki(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return wm(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Z(Wt,Wt.current),d)break;return null;case 22:return i.lanes=0,dm(r,i,s,i.pendingProps);case 24:mn(i,ta,r.memoizedState.cache)}return Yr(r,i,s)}function Sm(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)ra=!0;else{if(!$f(r,s)&&(i.flags&128)===0)return ra=!1,GS(r,i,s);ra=(r.flags&131072)!==0}else ra=!1,pt&&(i.flags&1048576)!==0&&ep(i,Jl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=fi(i.elementType),i.type=r,typeof r=="function")tf(r)?(d=gi(r,d),i.tag=1,i=mm(null,i,r,d,s)):(i.tag=0,i=If(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===B){i.tag=11,i=cm(null,i,r,d,s);break e}else if(p===A){i.tag=14,i=fm(null,i,r,d,s);break e}}throw i=I(r)||r,Error(n(306,i,""))}}return i;case 0:return If(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=gi(d,i.pendingProps),mm(r,i,d,p,s);case 3:e:{if(Se(i,i.stateNode.containerInfo),r===null)throw Error(n(387));d=i.pendingProps;var y=i.memoizedState;p=y.element,mf(r,i),uu(i,d,null,s);var D=i.memoizedState;if(d=D.cache,mn(i,ta,d),d!==y.cache&&ff(i,[ta],s,!0),lu(),d=D.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:D.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=ym(r,i,d,s);break e}else if(d!==p){p=or(Error(n(424)),i),eu(p),i=ym(r,i,d,s);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Pt=hr(r.firstChild),Sa=i,pt=!0,gn=null,vr=!0,s=dp(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ui(),d===p){i=Yr(r,i,s);break e}Ta(r,i,d,s)}i=i.child}return i;case 26:return $s(r,i),r===null?(s=Oy(i.type,null,i.pendingProps,null))?i.memoizedState=s:pt||(s=i.type,r=i.pendingProps,d=go(se.current).createElement(s),d[_t]=i,d[$t]=r,Ca(d,s,r),ea(d),i.stateNode=d):i.memoizedState=Oy(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return te(i),r===null&&pt&&(d=i.stateNode=My(i.type,i.pendingProps,se.current),Sa=i,vr=!0,p=Pt,Mn(i.type)?(Mv=p,Pt=hr(d.firstChild)):Pt=p),Ta(r,i,i.pendingProps.children,s),$s(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&pt&&((p=d=Pt)&&(d=b2(d,i.type,i.pendingProps,vr),d!==null?(i.stateNode=d,Sa=i,Pt=hr(d.firstChild),vr=!1,p=!0):p=!1),p||pn(i)),te(i),p=i.type,y=i.pendingProps,D=r!==null?r.memoizedProps:null,d=y.children,Cv(p,y)?d=null:D!==null&&Cv(p,D)&&(i.flags|=32),i.memoizedState!==null&&(p=Tf(r,i,LS,null,null,s),Du._currentValue=p),$s(r,i),Ta(r,i,d,s),i.child;case 6:return r===null&&pt&&((r=s=Pt)&&(s=x2(s,i.pendingProps,vr),s!==null?(i.stateNode=s,Sa=i,Pt=null,r=!0):r=!1),r||pn(i)),null;case 13:return bm(r,i,s);case 4:return Se(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=di(i,null,d,s):Ta(r,i,d,s),i.child;case 11:return cm(r,i,i.type,i.pendingProps,s);case 7:return Ta(r,i,i.pendingProps,s),i.child;case 8:return Ta(r,i,i.pendingProps.children,s),i.child;case 12:return Ta(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,mn(i,i.type,d.value),Ta(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,oi(i),p=Ea(p),d=d(p),i.flags|=1,Ta(r,i,d,s),i.child;case 14:return fm(r,i,i.type,i.pendingProps,s);case 15:return vm(r,i,i.type,i.pendingProps,s);case 19:return wm(r,i,s);case 31:return HS(r,i,s);case 22:return dm(r,i,s,i.pendingProps);case 24:return oi(i),d=Ea(ta),r===null?(p=hf(),p===null&&(p=Lt,y=vf(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=s),p=y),i.memoizedState={parent:d,cache:p},pf(i),mn(i,ta,p)):((r.lanes&s)!==0&&(mf(r,i),uu(i,null,null,s),lu()),p=r.memoizedState,y=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),mn(i,ta,d)):(d=y.cache,mn(i,ta,d),d!==p.cache&&ff(i,[ta],s,!0))),Ta(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(n(156,i.tag))}function Fr(r){r.flags|=4}function Wf(r,i,s,d,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Zm())r.flags|=8192;else throw vi=_s,gf}else r.flags&=-16777217}function Em(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Vy(i))if(Zm())r.flags|=8192;else throw vi=_s,gf}function Js(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?tt():536870912,r.lanes|=i,ll|=i)}function du(r,i){if(!pt)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Ht(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,d=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=s,i}function IS(r,i,s){var d=i.pendingProps;switch(lf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(i),null;case 1:return Ht(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Hr(ta),fe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Xi(i)?Fr(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,sf())),Ht(i),null;case 26:var p=i.type,y=i.memoizedState;return r===null?(Fr(i),y!==null?(Ht(i),Em(i,y)):(Ht(i),Wf(i,p,null,d,s))):y?y!==r.memoizedState?(Fr(i),Ht(i),Em(i,y)):(Ht(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&Fr(i),Ht(i),Wf(i,p,r,d,s)),null;case 27:if(re(i),s=se.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Fr(i);else{if(!d){if(i.stateNode===null)throw Error(n(166));return Ht(i),null}r=$.current,Xi(i)?ap(i):(r=My(p,d,s),i.stateNode=r,Fr(i))}return Ht(i),null;case 5:if(re(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Fr(i);else{if(!d){if(i.stateNode===null)throw Error(n(166));return Ht(i),null}if(y=$.current,Xi(i))ap(i);else{var D=go(se.current);switch(y){case 1:y=D.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=D.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=D.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=D.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=D.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof d.is=="string"?D.createElement("select",{is:d.is}):D.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?D.createElement(p,{is:d.is}):D.createElement(p)}}y[_t]=i,y[$t]=d;e:for(D=i.child;D!==null;){if(D.tag===5||D.tag===6)y.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===i)break e;for(;D.sibling===null;){if(D.return===null||D.return===i)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}i.stateNode=y;e:switch(Ca(y,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Fr(i)}}return Ht(i),Wf(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&Fr(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(n(166));if(r=se.current,Xi(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=Sa,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[_t]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||by(r.nodeValue,s)),r||pn(i,!0)}else r=go(r).createTextNode(d),r[_t]=i,i.stateNode=r}return Ht(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=Xi(i),s!==null){if(r===null){if(!d)throw Error(n(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(557));r[_t]=i}else ui(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ht(i),r=!1}else s=sf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(er(i),i):(er(i),null);if((i.flags&128)!==0)throw Error(n(558))}return Ht(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Xi(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(n(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(n(317));p[_t]=i}else ui(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ht(i),p=!1}else p=sf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(er(i),i):(er(i),null)}return er(i),(i.flags&128)!==0?(i.lanes=s,i):(s=d!==null,r=r!==null&&r.memoizedState!==null,s&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==p&&(d.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Js(i,i.updateQueue),Ht(i),null);case 4:return fe(),r===null&&xv(i.stateNode.containerInfo),Ht(i),null;case 10:return Hr(i.type),Ht(i),null;case 19:if(G(Wt),d=i.memoizedState,d===null)return Ht(i),null;if(p=(i.flags&128)!==0,y=d.rendering,y===null)if(p)du(d,!1);else{if(Zt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=js(r),y!==null){for(i.flags|=128,du(d,!1),r=y.updateQueue,i.updateQueue=r,Js(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)$g(s,r),s=s.sibling;return Z(Wt,Wt.current&1|2),pt&&jr(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&Be()>no&&(i.flags|=128,p=!0,du(d,!1),i.lanes=4194304)}else{if(!p)if(r=js(y),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Js(i,r),du(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!pt)return Ht(i),null}else 2*Be()-d.renderingStartTime>no&&s!==536870912&&(i.flags|=128,p=!0,du(d,!1),i.lanes=4194304);d.isBackwards?(y.sibling=i.child,i.child=y):(r=d.last,r!==null?r.sibling=y:i.child=y,d.last=y)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=Be(),r.sibling=null,s=Wt.current,Z(Wt,p?s&1|2:s&1),pt&&jr(i,d.treeForkCount),r):(Ht(i),null);case 22:case 23:return er(i),wf(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(s&536870912)!==0&&(i.flags&128)===0&&(Ht(i),i.subtreeFlags&6&&(i.flags|=8192)):Ht(i),s=i.updateQueue,s!==null&&Js(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&G(ci),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Hr(ta),Ht(i),null;case 25:return null;case 30:return null}throw Error(n(156,i.tag))}function YS(r,i){switch(lf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Hr(ta),fe(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return re(i),null;case 31:if(i.memoizedState!==null){if(er(i),i.alternate===null)throw Error(n(340));ui()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(er(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(n(340));ui()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return G(Wt),null;case 4:return fe(),null;case 10:return Hr(i.type),null;case 22:case 23:return er(i),wf(),r!==null&&G(ci),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Hr(ta),null;case 25:return null;default:return null}}function Tm(r,i){switch(lf(i),i.tag){case 3:Hr(ta),fe();break;case 26:case 27:case 5:re(i);break;case 4:fe();break;case 31:i.memoizedState!==null&&er(i);break;case 13:er(i);break;case 19:G(Wt);break;case 10:Hr(i.type);break;case 22:case 23:er(i),wf(),r!==null&&G(ci);break;case 24:Hr(ta)}}function hu(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var y=s.create,D=s.inst;d=y(),D.destroy=d}s=s.next}while(s!==p)}}catch(k){Dt(i,i.return,k)}}function En(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var y=p.next;d=y;do{if((d.tag&r)===r){var D=d.inst,k=D.destroy;if(k!==void 0){D.destroy=void 0,p=i;var X=s,ie=k;try{ie()}catch(ge){Dt(p,X,ge)}}}d=d.next}while(d!==y)}}catch(ge){Dt(i,i.return,ge)}}function Cm(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{gp(i,s)}catch(d){Dt(r,r.return,d)}}}function Am(r,i,s){s.props=gi(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){Dt(r,i,d)}}function gu(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof s=="function"?r.refCleanup=s(d):s.current=d}}catch(p){Dt(r,i,p)}}function Br(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){Dt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){Dt(r,i,p)}else s.current=null}function Dm(r){var i=r.type,s=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(p){Dt(r,r.return,p)}}function Jf(r,i,s){try{var d=r.stateNode;d2(d,r.type,s,i),d[$t]=i}catch(p){Dt(r,r.return,p)}}function Bm(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Mn(r.type)||r.tag===4}function ev(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Bm(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Mn(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function tv(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=qr));else if(d!==4&&(d===27&&Mn(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(tv(r,i,s),r=r.sibling;r!==null;)tv(r,i,s),r=r.sibling}function eo(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&Mn(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(eo(r,i,s),r=r.sibling;r!==null;)eo(r,i,s),r=r.sibling}function Nm(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Ca(i,d,s),i[_t]=r,i[$t]=s}catch(y){Dt(r,r.return,y)}}var Xr=!1,na=!1,av=!1,Mm=typeof WeakSet=="function"?WeakSet:Set,ya=null;function FS(r,i){if(r=r.containerInfo,Ev=So,r=Hg(r),Kc(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var D=0,k=-1,X=-1,ie=0,ge=0,be=r,ue=null;t:for(;;){for(var ve;be!==s||p!==0&&be.nodeType!==3||(k=D+p),be!==y||d!==0&&be.nodeType!==3||(X=D+d),be.nodeType===3&&(D+=be.nodeValue.length),(ve=be.firstChild)!==null;)ue=be,be=ve;for(;;){if(be===r)break t;if(ue===s&&++ie===p&&(k=D),ue===y&&++ge===d&&(X=D),(ve=be.nextSibling)!==null)break;be=ue,ue=be.parentNode}be=ve}s=k===-1||X===-1?null:{start:k,end:X}}else s=null}s=s||{start:0,end:0}}else s=null;for(Tv={focusedElem:r,selectionRange:s},So=!1,ya=i;ya!==null;)if(i=ya,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,ya=r;else for(;ya!==null;){switch(i=ya,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,s=i,p=y.memoizedProps,y=y.memoizedState,d=s.stateNode;try{var Le=gi(s.type,p);r=d.getSnapshotBeforeUpdate(Le,y),d.__reactInternalSnapshotBeforeUpdate=r}catch(Ze){Dt(s,s.return,Ze)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Dv(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Dv(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(n(163))}if(r=i.sibling,r!==null){r.return=i.return,ya=r;break}ya=i.return}}function Rm(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:Zr(r,s),d&4&&hu(5,s);break;case 1:if(Zr(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(D){Dt(s,s.return,D)}else{var p=gi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(D){Dt(s,s.return,D)}}d&64&&Cm(s),d&512&&gu(s,s.return);break;case 3:if(Zr(r,s),d&64&&(r=s.updateQueue,r!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{gp(r,i)}catch(D){Dt(s,s.return,D)}}break;case 27:i===null&&d&4&&Nm(s);case 26:case 5:Zr(r,s),i===null&&d&4&&Dm(s),d&512&&gu(s,s.return);break;case 12:Zr(r,s);break;case 31:Zr(r,s),d&4&&Lm(r,s);break;case 13:Zr(r,s),d&4&&km(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=t2.bind(null,s),w2(r,s))));break;case 22:if(d=s.memoizedState!==null||Xr,!d){i=i!==null&&i.memoizedState!==null||na,p=Xr;var y=na;Xr=d,(na=i)&&!y?Qr(r,s,(s.subtreeFlags&8772)!==0):Zr(r,s),Xr=p,na=y}break;case 30:break;default:Zr(r,s)}}function zm(r){var i=r.alternate;i!==null&&(r.alternate=null,zm(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Li(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var It=null,Ha=!1;function Kr(r,i,s){for(s=s.child;s!==null;)Om(r,i,s),s=s.sibling}function Om(r,i,s){if(ee&&typeof ee.onCommitFiberUnmount=="function")try{ee.onCommitFiberUnmount(q,s)}catch{}switch(s.tag){case 26:na||Br(s,i),Kr(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:na||Br(s,i);var d=It,p=Ha;Mn(s.type)&&(It=s.stateNode,Ha=!1),Kr(r,i,s),Tu(s.stateNode),It=d,Ha=p;break;case 5:na||Br(s,i);case 6:if(d=It,p=Ha,It=null,Kr(r,i,s),It=d,Ha=p,It!==null)if(Ha)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(s.stateNode)}catch(y){Dt(s,i,y)}else try{It.removeChild(s.stateNode)}catch(y){Dt(s,i,y)}break;case 18:It!==null&&(Ha?(r=It,Cy(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),hl(r)):Cy(It,s.stateNode));break;case 4:d=It,p=Ha,It=s.stateNode.containerInfo,Ha=!0,Kr(r,i,s),It=d,Ha=p;break;case 0:case 11:case 14:case 15:En(2,s,i),na||En(4,s,i),Kr(r,i,s);break;case 1:na||(Br(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Am(s,i,d)),Kr(r,i,s);break;case 21:Kr(r,i,s);break;case 22:na=(d=na)||s.memoizedState!==null,Kr(r,i,s),na=d;break;default:Kr(r,i,s)}}function Lm(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{hl(r)}catch(s){Dt(i,i.return,s)}}}function km(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{hl(r)}catch(s){Dt(i,i.return,s)}}function XS(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Mm),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Mm),i;default:throw Error(n(435,r.tag))}}function to(r,i){var s=XS(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=a2.bind(null,r,d);d.then(p,p)}})}function Ga(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],y=r,D=i,k=D;e:for(;k!==null;){switch(k.tag){case 27:if(Mn(k.type)){It=k.stateNode,Ha=!1;break e}break;case 5:It=k.stateNode,Ha=!1;break e;case 3:case 4:It=k.stateNode.containerInfo,Ha=!0;break e}k=k.return}if(It===null)throw Error(n(160));Om(y,D,p),It=null,Ha=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)_m(i,r),i=i.sibling}var xr=null;function _m(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Ga(i,r),Ia(r),d&4&&(En(3,r,r.return),hu(3,r),En(5,r,r.return));break;case 1:Ga(i,r),Ia(r),d&512&&(na||s===null||Br(s,s.return)),d&64&&Xr&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var p=xr;if(Ga(i,r),Ia(r),d&512&&(na||s===null||Br(s,s.return)),d&4){var y=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":y=p.getElementsByTagName("title")[0],(!y||y[pa]||y[_t]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(d),p.head.insertBefore(y,p.querySelector("head > title"))),Ca(y,d,s),y[_t]=r,ea(y),d=y;break e;case"link":var D=_y("link","href",p).get(d+(s.href||""));if(D){for(var k=0;k<D.length;k++)if(y=D[k],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){D.splice(k,1);break t}}y=p.createElement(d),Ca(y,d,s),p.head.appendChild(y);break;case"meta":if(D=_y("meta","content",p).get(d+(s.content||""))){for(k=0;k<D.length;k++)if(y=D[k],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){D.splice(k,1);break t}}y=p.createElement(d),Ca(y,d,s),p.head.appendChild(y);break;default:throw Error(n(468,d))}y[_t]=r,ea(y),d=y}r.stateNode=d}else qy(p,r.type,r.stateNode);else r.stateNode=ky(p,d,r.memoizedProps);else y!==d?(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,d===null?qy(p,r.type,r.stateNode):ky(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&Jf(r,r.memoizedProps,s.memoizedProps)}break;case 27:Ga(i,r),Ia(r),d&512&&(na||s===null||Br(s,s.return)),s!==null&&d&4&&Jf(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Ga(i,r),Ia(r),d&512&&(na||s===null||Br(s,s.return)),r.flags&32){p=r.stateNode;try{qi(p,"")}catch(Le){Dt(r,r.return,Le)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,Jf(r,p,s!==null?s.memoizedProps:p)),d&1024&&(av=!0);break;case 6:if(Ga(i,r),Ia(r),d&4){if(r.stateNode===null)throw Error(n(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(Le){Dt(r,r.return,Le)}}break;case 3:if(yo=null,p=xr,xr=po(i.containerInfo),Ga(i,r),xr=p,Ia(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{hl(i.containerInfo)}catch(Le){Dt(r,r.return,Le)}av&&(av=!1,qm(r));break;case 4:d=xr,xr=po(r.stateNode.containerInfo),Ga(i,r),Ia(r),xr=d;break;case 12:Ga(i,r),Ia(r);break;case 31:Ga(i,r),Ia(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,to(r,d)));break;case 13:Ga(i,r),Ia(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(ro=Be()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,to(r,d)));break;case 22:p=r.memoizedState!==null;var X=s!==null&&s.memoizedState!==null,ie=Xr,ge=na;if(Xr=ie||p,na=ge||X,Ga(i,r),na=ge,Xr=ie,Ia(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||X||Xr||na||pi(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){X=s=i;try{if(y=X.stateNode,p)D=y.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{k=X.stateNode;var be=X.memoizedProps.style,ue=be!=null&&be.hasOwnProperty("display")?be.display:null;k.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Le){Dt(X,X.return,Le)}}}else if(i.tag===6){if(s===null){X=i;try{X.stateNode.nodeValue=p?"":X.memoizedProps}catch(Le){Dt(X,X.return,Le)}}}else if(i.tag===18){if(s===null){X=i;try{var ve=X.stateNode;p?Ay(ve,!0):Ay(X.stateNode,!1)}catch(Le){Dt(X,X.return,Le)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,to(r,s))));break;case 19:Ga(i,r),Ia(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,to(r,d)));break;case 30:break;case 21:break;default:Ga(i,r),Ia(r)}}function Ia(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(Bm(d)){s=d;break}d=d.return}if(s==null)throw Error(n(160));switch(s.tag){case 27:var p=s.stateNode,y=ev(r);eo(r,y,p);break;case 5:var D=s.stateNode;s.flags&32&&(qi(D,""),s.flags&=-33);var k=ev(r);eo(r,k,D);break;case 3:case 4:var X=s.stateNode.containerInfo,ie=ev(r);tv(r,ie,X);break;default:throw Error(n(161))}}catch(ge){Dt(r,r.return,ge)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function qm(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;qm(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Zr(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Rm(r,i.alternate,i),i=i.sibling}function pi(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:En(4,i,i.return),pi(i);break;case 1:Br(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Am(i,i.return,s),pi(i);break;case 27:Tu(i.stateNode);case 26:case 5:Br(i,i.return),pi(i);break;case 22:i.memoizedState===null&&pi(i);break;case 30:pi(i);break;default:pi(i)}r=r.sibling}}function Qr(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,y=i,D=y.flags;switch(y.tag){case 0:case 11:case 15:Qr(p,y,s),hu(4,y);break;case 1:if(Qr(p,y,s),d=y,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ie){Dt(d,d.return,ie)}if(d=y,p=d.updateQueue,p!==null){var k=d.stateNode;try{var X=p.shared.hiddenCallbacks;if(X!==null)for(p.shared.hiddenCallbacks=null,p=0;p<X.length;p++)hp(X[p],k)}catch(ie){Dt(d,d.return,ie)}}s&&D&64&&Cm(y),gu(y,y.return);break;case 27:Nm(y);case 26:case 5:Qr(p,y,s),s&&d===null&&D&4&&Dm(y),gu(y,y.return);break;case 12:Qr(p,y,s);break;case 31:Qr(p,y,s),s&&D&4&&Lm(p,y);break;case 13:Qr(p,y,s),s&&D&4&&km(p,y);break;case 22:y.memoizedState===null&&Qr(p,y,s),gu(y,y.return);break;case 30:break;default:Qr(p,y,s)}i=i.sibling}}function rv(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&tu(s))}function nv(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&tu(r))}function wr(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Vm(r,i,s,d),i=i.sibling}function Vm(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:wr(r,i,s,d),p&2048&&hu(9,i);break;case 1:wr(r,i,s,d);break;case 3:wr(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&tu(r)));break;case 12:if(p&2048){wr(r,i,s,d),r=i.stateNode;try{var y=i.memoizedProps,D=y.id,k=y.onPostCommit;typeof k=="function"&&k(D,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(X){Dt(i,i.return,X)}}else wr(r,i,s,d);break;case 31:wr(r,i,s,d);break;case 13:wr(r,i,s,d);break;case 23:break;case 22:y=i.stateNode,D=i.alternate,i.memoizedState!==null?y._visibility&2?wr(r,i,s,d):pu(r,i):y._visibility&2?wr(r,i,s,d):(y._visibility|=2,rl(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&rv(D,i);break;case 24:wr(r,i,s,d),p&2048&&nv(i.alternate,i);break;default:wr(r,i,s,d)}}function rl(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var y=r,D=i,k=s,X=d,ie=D.flags;switch(D.tag){case 0:case 11:case 15:rl(y,D,k,X,p),hu(8,D);break;case 23:break;case 22:var ge=D.stateNode;D.memoizedState!==null?ge._visibility&2?rl(y,D,k,X,p):pu(y,D):(ge._visibility|=2,rl(y,D,k,X,p)),p&&ie&2048&&rv(D.alternate,D);break;case 24:rl(y,D,k,X,p),p&&ie&2048&&nv(D.alternate,D);break;default:rl(y,D,k,X,p)}i=i.sibling}}function pu(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:pu(s,d),p&2048&&rv(d.alternate,d);break;case 24:pu(s,d),p&2048&&nv(d.alternate,d);break;default:pu(s,d)}i=i.sibling}}var mu=8192;function nl(r,i,s){if(r.subtreeFlags&mu)for(r=r.child;r!==null;)Um(r,i,s),r=r.sibling}function Um(r,i,s){switch(r.tag){case 26:nl(r,i,s),r.flags&mu&&r.memoizedState!==null&&O2(s,xr,r.memoizedState,r.memoizedProps);break;case 5:nl(r,i,s);break;case 3:case 4:var d=xr;xr=po(r.stateNode.containerInfo),nl(r,i,s),xr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=mu,mu=16777216,nl(r,i,s),mu=d):nl(r,i,s));break;default:nl(r,i,s)}}function jm(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function yu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];ya=d,Hm(d,r)}jm(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Pm(r),r=r.sibling}function Pm(r){switch(r.tag){case 0:case 11:case 15:yu(r),r.flags&2048&&En(9,r,r.return);break;case 3:yu(r);break;case 12:yu(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,ao(r)):yu(r);break;default:yu(r)}}function ao(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];ya=d,Hm(d,r)}jm(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:En(8,i,i.return),ao(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,ao(i));break;default:ao(i)}r=r.sibling}}function Hm(r,i){for(;ya!==null;){var s=ya;switch(s.tag){case 0:case 11:case 15:En(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:tu(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,ya=d;else e:for(s=r;ya!==null;){d=ya;var p=d.sibling,y=d.return;if(zm(d),d===s){ya=null;break e}if(p!==null){p.return=y,ya=p;break e}ya=y}}}var KS={getCacheForType:function(r){var i=Ea(ta),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return Ea(ta).controller.signal}},ZS=typeof WeakMap=="function"?WeakMap:Map,St=0,Lt=null,ct=null,dt=0,At=0,tr=null,Tn=!1,il=!1,iv=!1,$r=0,Zt=0,Cn=0,mi=0,lv=0,ar=0,ll=0,bu=null,Ya=null,uv=!1,ro=0,Gm=0,no=1/0,io=null,An=null,sa=0,Dn=null,ul=null,Wr=0,sv=0,ov=null,Im=null,xu=0,cv=null;function rr(){return(St&2)!==0&&dt!==0?dt&-dt:_.T!==null?pv():gt()}function Ym(){if(ar===0)if((dt&536870912)===0||pt){var r=Ne;Ne<<=1,(Ne&3932160)===0&&(Ne=262144),ar=r}else ar=536870912;return r=Ja.current,r!==null&&(r.flags|=32),ar}function Fa(r,i,s){(r===Lt&&(At===2||At===9)||r.cancelPendingCommit!==null)&&(sl(r,0),Bn(r,dt,ar,!1)),Et(r,s),((St&2)===0||r!==Lt)&&(r===Lt&&((St&2)===0&&(mi|=s),Zt===4&&Bn(r,dt,ar,!1)),Nr(r))}function Fm(r,i,s){if((St&6)!==0)throw Error(n(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||De(r,i),p=d?WS(r,i):vv(r,i,!0),y=d;do{if(p===0){il&&!d&&Bn(r,i,0,!1);break}else{if(s=r.current.alternate,y&&!QS(s)){p=vv(r,i,!1),y=!1;continue}if(p===2){if(y=i,r.errorRecoveryDisabledLanes&y)var D=0;else D=r.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){i=D;e:{var k=r;p=bu;var X=k.current.memoizedState.isDehydrated;if(X&&(sl(k,D).flags|=256),D=vv(k,D,!1),D!==2){if(iv&&!X){k.errorRecoveryDisabledLanes|=y,mi|=y,p=4;break e}y=Ya,Ya=p,y!==null&&(Ya===null?Ya=y:Ya.push.apply(Ya,y))}p=D}if(y=!1,p!==2)continue}}if(p===1){sl(r,0),Bn(r,i,0,!0);break}e:{switch(d=r,y=p,y){case 0:case 1:throw Error(n(345));case 4:if((i&4194048)!==i)break;case 6:Bn(d,i,ar,!Tn);break e;case 2:Ya=null;break;case 3:case 5:break;default:throw Error(n(329))}if((i&62914560)===i&&(p=ro+300-Be(),10<p)){if(Bn(d,i,ar,!Tn),$e(d,0,!0)!==0)break e;Wr=i,d.timeoutHandle=Ey(Xm.bind(null,d,s,Ya,io,uv,i,ar,mi,ll,Tn,y,"Throttled",-0,0),p);break e}Xm(d,s,Ya,io,uv,i,ar,mi,ll,Tn,y,null,-0,0)}}break}while(!0);Nr(r)}function Xm(r,i,s,d,p,y,D,k,X,ie,ge,be,ue,ve){if(r.timeoutHandle=-1,be=i.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qr},Um(i,y,be);var Le=(y&62914560)===y?ro-Be():(y&4194048)===y?Gm-Be():0;if(Le=L2(be,Le),Le!==null){Wr=y,r.cancelPendingCommit=Le(ty.bind(null,r,i,y,s,d,p,D,k,X,ge,be,null,ue,ve)),Bn(r,y,D,!ie);return}}ty(r,i,y,s,d,p,D,k,X)}function QS(r){for(var i=r;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var d=0;d<s.length;d++){var p=s[d],y=p.getSnapshot;p=p.value;try{if(!$a(y(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Bn(r,i,s,d){i&=~lv,i&=~mi,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var y=31-oe(p),D=1<<y;d[y]=-1,p&=~D}s!==0&&zt(r,s,i)}function lo(){return(St&6)===0?(wu(0),!1):!0}function fv(){if(ct!==null){if(At===0)var r=ct.return;else r=ct,Pr=si=null,Df(r),Wi=null,ru=0,r=ct;for(;r!==null;)Tm(r.alternate,r),r=r.return;ct=null}}function sl(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,p2(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),Wr=0,fv(),Lt=r,ct=s=Ur(r.current,null),dt=i,At=0,tr=null,Tn=!1,il=De(r,i),iv=!1,ll=ar=lv=mi=Cn=Zt=0,Ya=bu=null,uv=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-oe(d),y=1<<p;i|=r[p],d&=~y}return $r=i,Ds(),s}function Km(r,i){nt=null,_.H=fu,i===$i||i===ks?(i=cp(),At=3):i===gf?(i=cp(),At=4):At=i===Gf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,tr=i,ct===null&&(Zt=1,Zs(r,or(i,r.current)))}function Zm(){var r=Ja.current;return r===null?!0:(dt&4194048)===dt?dr===null:(dt&62914560)===dt||(dt&536870912)!==0?r===dr:!1}function Qm(){var r=_.H;return _.H=fu,r===null?fu:r}function $m(){var r=_.A;return _.A=KS,r}function uo(){Zt=4,Tn||(dt&4194048)!==dt&&Ja.current!==null||(il=!0),(Cn&134217727)===0&&(mi&134217727)===0||Lt===null||Bn(Lt,dt,ar,!1)}function vv(r,i,s){var d=St;St|=2;var p=Qm(),y=$m();(Lt!==r||dt!==i)&&(io=null,sl(r,i)),i=!1;var D=Zt;e:do try{if(At!==0&&ct!==null){var k=ct,X=tr;switch(At){case 8:fv(),D=6;break e;case 3:case 2:case 9:case 6:Ja.current===null&&(i=!0);var ie=At;if(At=0,tr=null,ol(r,k,X,ie),s&&il){D=0;break e}break;default:ie=At,At=0,tr=null,ol(r,k,X,ie)}}$S(),D=Zt;break}catch(ge){Km(r,ge)}while(!0);return i&&r.shellSuspendCounter++,Pr=si=null,St=d,_.H=p,_.A=y,ct===null&&(Lt=null,dt=0,Ds()),D}function $S(){for(;ct!==null;)Wm(ct)}function WS(r,i){var s=St;St|=2;var d=Qm(),p=$m();Lt!==r||dt!==i?(io=null,no=Be()+500,sl(r,i)):il=De(r,i);e:do try{if(At!==0&&ct!==null){i=ct;var y=tr;t:switch(At){case 1:At=0,tr=null,ol(r,i,y,1);break;case 2:case 9:if(sp(y)){At=0,tr=null,Jm(i);break}i=function(){At!==2&&At!==9||Lt!==r||(At=7),Nr(r)},y.then(i,i);break e;case 3:At=7;break e;case 4:At=5;break e;case 7:sp(y)?(At=0,tr=null,Jm(i)):(At=0,tr=null,ol(r,i,y,7));break;case 5:var D=null;switch(ct.tag){case 26:D=ct.memoizedState;case 5:case 27:var k=ct;if(D?Vy(D):k.stateNode.complete){At=0,tr=null;var X=k.sibling;if(X!==null)ct=X;else{var ie=k.return;ie!==null?(ct=ie,so(ie)):ct=null}break t}}At=0,tr=null,ol(r,i,y,5);break;case 6:At=0,tr=null,ol(r,i,y,6);break;case 8:fv(),Zt=6;break e;default:throw Error(n(462))}}JS();break}catch(ge){Km(r,ge)}while(!0);return Pr=si=null,_.H=d,_.A=p,St=s,ct!==null?0:(Lt=null,dt=0,Ds(),Zt)}function JS(){for(;ct!==null&&!Pe();)Wm(ct)}function Wm(r){var i=Sm(r.alternate,r,$r);r.memoizedProps=r.pendingProps,i===null?so(r):ct=i}function Jm(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=pm(s,i,i.pendingProps,i.type,void 0,dt);break;case 11:i=pm(s,i,i.pendingProps,i.type.render,i.ref,dt);break;case 5:Df(i);default:Tm(s,i),i=ct=$g(i,$r),i=Sm(s,i,$r)}r.memoizedProps=r.pendingProps,i===null?so(r):ct=i}function ol(r,i,s,d){Pr=si=null,Df(i),Wi=null,ru=0;var p=i.return;try{if(PS(r,p,i,s,dt)){Zt=1,Zs(r,or(s,r.current)),ct=null;return}}catch(y){if(p!==null)throw ct=p,y;Zt=1,Zs(r,or(s,r.current)),ct=null;return}i.flags&32768?(pt||d===1?r=!0:il||(dt&536870912)!==0?r=!1:(Tn=r=!0,(d===2||d===9||d===3||d===6)&&(d=Ja.current,d!==null&&d.tag===13&&(d.flags|=16384))),ey(i,r)):so(i)}function so(r){var i=r;do{if((i.flags&32768)!==0){ey(i,Tn);return}r=i.return;var s=IS(i.alternate,i,$r);if(s!==null){ct=s;return}if(i=i.sibling,i!==null){ct=i;return}ct=i=r}while(i!==null);Zt===0&&(Zt=5)}function ey(r,i){do{var s=YS(r.alternate,r);if(s!==null){s.flags&=32767,ct=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){ct=r;return}ct=r=s}while(r!==null);Zt=6,ct=null}function ty(r,i,s,d,p,y,D,k,X){r.cancelPendingCommit=null;do oo();while(sa!==0);if((St&6)!==0)throw Error(n(327));if(i!==null){if(i===r.current)throw Error(n(177));if(y=i.lanes|i.childLanes,y|=Jc,ua(r,s,y,D,k,X),r===Lt&&(ct=Lt=null,dt=0),ul=i,Dn=r,Wr=s,sv=y,ov=p,Im=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,r2(ut,function(){return ly(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=_.T,_.T=null,p=j.p,j.p=2,D=St,St|=4;try{FS(r,i,s)}finally{St=D,j.p=p,_.T=d}}sa=1,ay(),ry(),ny()}}function ay(){if(sa===1){sa=0;var r=Dn,i=ul,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=_.T,_.T=null;var d=j.p;j.p=2;var p=St;St|=4;try{_m(i,r);var y=Tv,D=Hg(r.containerInfo),k=y.focusedElem,X=y.selectionRange;if(D!==k&&k&&k.ownerDocument&&Pg(k.ownerDocument.documentElement,k)){if(X!==null&&Kc(k)){var ie=X.start,ge=X.end;if(ge===void 0&&(ge=ie),"selectionStart"in k)k.selectionStart=ie,k.selectionEnd=Math.min(ge,k.value.length);else{var be=k.ownerDocument||document,ue=be&&be.defaultView||window;if(ue.getSelection){var ve=ue.getSelection(),Le=k.textContent.length,Ze=Math.min(X.start,Le),Mt=X.end===void 0?Ze:Math.min(X.end,Le);!ve.extend&&Ze>Mt&&(D=Mt,Mt=Ze,Ze=D);var J=jg(k,Ze),K=jg(k,Mt);if(J&&K&&(ve.rangeCount!==1||ve.anchorNode!==J.node||ve.anchorOffset!==J.offset||ve.focusNode!==K.node||ve.focusOffset!==K.offset)){var ne=be.createRange();ne.setStart(J.node,J.offset),ve.removeAllRanges(),Ze>Mt?(ve.addRange(ne),ve.extend(K.node,K.offset)):(ne.setEnd(K.node,K.offset),ve.addRange(ne))}}}}for(be=[],ve=k;ve=ve.parentNode;)ve.nodeType===1&&be.push({element:ve,left:ve.scrollLeft,top:ve.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<be.length;k++){var ye=be[k];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}So=!!Ev,Tv=Ev=null}finally{St=p,j.p=d,_.T=s}}r.current=i,sa=2}}function ry(){if(sa===2){sa=0;var r=Dn,i=ul,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=_.T,_.T=null;var d=j.p;j.p=2;var p=St;St|=4;try{Rm(r,i.alternate,i)}finally{St=p,j.p=d,_.T=s}}sa=3}}function ny(){if(sa===4||sa===3){sa=0,Qe();var r=Dn,i=ul,s=Wr,d=Im;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?sa=5:(sa=0,ul=Dn=null,iy(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(An=null),Ke(s),i=i.stateNode,ee&&typeof ee.onCommitFiberRoot=="function")try{ee.onCommitFiberRoot(q,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=_.T,p=j.p,j.p=2,_.T=null;try{for(var y=r.onRecoverableError,D=0;D<d.length;D++){var k=d[D];y(k.value,{componentStack:k.stack})}}finally{_.T=i,j.p=p}}(Wr&3)!==0&&oo(),Nr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===cv?xu++:(xu=0,cv=r):xu=0,wu(0)}}function iy(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,tu(i)))}function oo(){return ay(),ry(),ny(),ly()}function ly(){if(sa!==5)return!1;var r=Dn,i=sv;sv=0;var s=Ke(Wr),d=_.T,p=j.p;try{j.p=32>s?32:s,_.T=null,s=ov,ov=null;var y=Dn,D=Wr;if(sa=0,ul=Dn=null,Wr=0,(St&6)!==0)throw Error(n(331));var k=St;if(St|=4,Pm(y.current),Vm(y,y.current,D,s),St=k,wu(0,!1),ee&&typeof ee.onPostCommitFiberRoot=="function")try{ee.onPostCommitFiberRoot(q,y)}catch{}return!0}finally{j.p=p,_.T=d,iy(r,i)}}function uy(r,i,s){i=or(s,i),i=Hf(r.stateNode,i,2),r=xn(r,i,2),r!==null&&(Et(r,2),Nr(r))}function Dt(r,i,s){if(r.tag===3)uy(r,r,s);else for(;i!==null;){if(i.tag===3){uy(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(An===null||!An.has(d))){r=or(s,r),s=sm(2),d=xn(i,s,2),d!==null&&(om(s,d,i,r),Et(d,2),Nr(d));break}}i=i.return}}function dv(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new ZS;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(s)||(iv=!0,p.add(s),r=e2.bind(null,r,i,s),i.then(r,r))}function e2(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,Lt===r&&(dt&s)===s&&(Zt===4||Zt===3&&(dt&62914560)===dt&&300>Be()-ro?(St&2)===0&&sl(r,0):lv|=s,ll===dt&&(ll=0)),Nr(r)}function sy(r,i){i===0&&(i=tt()),r=ii(r,i),r!==null&&(Et(r,i),Nr(r))}function t2(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),sy(r,s)}function a2(r,i){var s=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(n(314))}d!==null&&d.delete(i),sy(r,s)}function r2(r,i){return Ae(r,i)}var co=null,cl=null,hv=!1,fo=!1,gv=!1,Nn=0;function Nr(r){r!==cl&&r.next===null&&(cl===null?co=cl=r:cl=cl.next=r),fo=!0,hv||(hv=!0,i2())}function wu(r,i){if(!gv&&fo){gv=!0;do for(var s=!1,d=co;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var y=0;else{var D=d.suspendedLanes,k=d.pingedLanes;y=(1<<31-oe(42|r)+1)-1,y&=p&~(D&~k),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,vy(d,y))}else y=dt,y=$e(d,d===Lt?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||De(d,y)||(s=!0,vy(d,y));d=d.next}while(s);gv=!1}}function n2(){oy()}function oy(){fo=hv=!1;var r=0;Nn!==0&&g2()&&(r=Nn);for(var i=Be(),s=null,d=co;d!==null;){var p=d.next,y=cy(d,i);y===0?(d.next=null,s===null?co=p:s.next=p,p===null&&(cl=s)):(s=d,(r!==0||(y&3)!==0)&&(fo=!0)),d=p}sa!==0&&sa!==5||wu(r),Nn!==0&&(Nn=0)}function cy(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var D=31-oe(y),k=1<<D,X=p[D];X===-1?((k&s)===0||(k&d)!==0)&&(p[D]=it(k,i)):X<=i&&(r.expiredLanes|=k),y&=~k}if(i=Lt,s=dt,s=$e(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(At===2||At===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Ve(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||De(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&Ve(d),Ke(s)){case 2:case 8:s=vt;break;case 32:s=ut;break;case 268435456:s=Ye;break;default:s=ut}return d=fy.bind(null,r),s=Ae(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&Ve(d),r.callbackPriority=2,r.callbackNode=null,2}function fy(r,i){if(sa!==0&&sa!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(oo()&&r.callbackNode!==s)return null;var d=dt;return d=$e(r,r===Lt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Fm(r,d,i),cy(r,Be()),r.callbackNode!=null&&r.callbackNode===s?fy.bind(null,r):null)}function vy(r,i){if(oo())return null;Fm(r,i,!0)}function i2(){m2(function(){(St&6)!==0?Ae(rt,n2):oy()})}function pv(){if(Nn===0){var r=Zi;r===0&&(r=ze,ze<<=1,(ze&261888)===0&&(ze=256)),Nn=r}return Nn}function dy(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:bs(""+r)}function hy(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function l2(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var y=dy((p[$t]||null).action),D=d.submitter;D&&(i=(i=D[$t]||null)?dy(i.formAction):D.getAttribute("formAction"),i!==null&&(y=i,D=null));var k=new Es("action","action",null,d,p);r.push({event:k,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Nn!==0){var X=D?hy(p,D):new FormData(p);_f(s,{pending:!0,data:X,method:p.method,action:y},null,X)}}else typeof y=="function"&&(k.preventDefault(),X=D?hy(p,D):new FormData(p),_f(s,{pending:!0,data:X,method:p.method,action:y},y,X))},currentTarget:p}]})}}for(var mv=0;mv<Wc.length;mv++){var yv=Wc[mv],u2=yv.toLowerCase(),s2=yv[0].toUpperCase()+yv.slice(1);br(u2,"on"+s2)}br(Yg,"onAnimationEnd"),br(Fg,"onAnimationIteration"),br(Xg,"onAnimationStart"),br("dblclick","onDoubleClick"),br("focusin","onFocus"),br("focusout","onBlur"),br(TS,"onTransitionRun"),br(CS,"onTransitionStart"),br(AS,"onTransitionCancel"),br(Kg,"onTransitionEnd"),Cr("onMouseEnter",["mouseout","mouseover"]),Cr("onMouseLeave",["mouseout","mouseover"]),Cr("onPointerEnter",["pointerout","pointerover"]),Cr("onPointerLeave",["pointerout","pointerover"]),Qa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Su="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),o2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Su));function gy(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var y=void 0;if(i)for(var D=d.length-1;0<=D;D--){var k=d[D],X=k.instance,ie=k.currentTarget;if(k=k.listener,X!==y&&p.isPropagationStopped())break e;y=k,p.currentTarget=ie;try{y(p)}catch(ge){As(ge)}p.currentTarget=null,y=X}else for(D=0;D<d.length;D++){if(k=d[D],X=k.instance,ie=k.currentTarget,k=k.listener,X!==y&&p.isPropagationStopped())break e;y=k,p.currentTarget=ie;try{y(p)}catch(ge){As(ge)}p.currentTarget=null,y=X}}}}function ft(r,i){var s=i[ha];s===void 0&&(s=i[ha]=new Set);var d=r+"__bubble";s.has(d)||(py(i,r,2,!1),s.add(d))}function bv(r,i,s){var d=0;i&&(d|=4),py(s,r,d,i)}var vo="_reactListening"+Math.random().toString(36).slice(2);function xv(r){if(!r[vo]){r[vo]=!0,hs.forEach(function(s){s!=="selectionchange"&&(o2.has(s)||bv(s,!1,r),bv(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[vo]||(i[vo]=!0,bv("selectionchange",!1,i))}}function py(r,i,s,d){switch(Yy(i)){case 2:var p=q2;break;case 8:p=V2;break;default:p=kv}s=p.bind(null,i,s,r),p=void 0,!Uc||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function wv(r,i,s,d,p){var y=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var D=d.tag;if(D===3||D===4){var k=d.stateNode.containerInfo;if(k===p)break;if(D===4)for(D=d.return;D!==null;){var X=D.tag;if((X===3||X===4)&&D.stateNode.containerInfo===p)return;D=D.return}for(;k!==null;){if(D=on(k),D===null)return;if(X=D.tag,X===5||X===6||X===26||X===27){d=y=D;continue e}k=k.parentNode}}d=d.return}wg(function(){var ie=y,ge=qc(s),be=[];e:{var ue=Zg.get(r);if(ue!==void 0){var ve=Es,Le=r;switch(r){case"keypress":if(ws(s)===0)break e;case"keydown":case"keyup":ve=aS;break;case"focusin":Le="focus",ve=Gc;break;case"focusout":Le="blur",ve=Gc;break;case"beforeblur":case"afterblur":ve=Gc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ve=Tg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=Iw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=iS;break;case Yg:case Fg:case Xg:ve=Xw;break;case Kg:ve=uS;break;case"scroll":case"scrollend":ve=Hw;break;case"wheel":ve=oS;break;case"copy":case"cut":case"paste":ve=Zw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=Ag;break;case"toggle":case"beforetoggle":ve=fS}var Ze=(i&4)!==0,Mt=!Ze&&(r==="scroll"||r==="scrollend"),J=Ze?ue!==null?ue+"Capture":null:ue;Ze=[];for(var K=ie,ne;K!==null;){var ye=K;if(ne=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ne===null||J===null||(ye=Il(K,J),ye!=null&&Ze.push(Eu(K,ye,ne))),Mt)break;K=K.return}0<Ze.length&&(ue=new ve(ue,Le,null,s,ge),be.push({event:ue,listeners:Ze}))}}if((i&7)===0){e:{if(ue=r==="mouseover"||r==="pointerover",ve=r==="mouseout"||r==="pointerout",ue&&s!==_c&&(Le=s.relatedTarget||s.fromElement)&&(on(Le)||Le[qt]))break e;if((ve||ue)&&(ue=ge.window===ge?ge:(ue=ge.ownerDocument)?ue.defaultView||ue.parentWindow:window,ve?(Le=s.relatedTarget||s.toElement,ve=ie,Le=Le?on(Le):null,Le!==null&&(Mt=u(Le),Ze=Le.tag,Le!==Mt||Ze!==5&&Ze!==27&&Ze!==6)&&(Le=null)):(ve=null,Le=ie),ve!==Le)){if(Ze=Tg,ye="onMouseLeave",J="onMouseEnter",K="mouse",(r==="pointerout"||r==="pointerover")&&(Ze=Ag,ye="onPointerLeave",J="onPointerEnter",K="pointer"),Mt=ve==null?ue:ti(ve),ne=Le==null?ue:ti(Le),ue=new Ze(ye,K+"leave",ve,s,ge),ue.target=Mt,ue.relatedTarget=ne,ye=null,on(ge)===ie&&(Ze=new Ze(J,K+"enter",Le,s,ge),Ze.target=ne,Ze.relatedTarget=Mt,ye=Ze),Mt=ye,ve&&Le)t:{for(Ze=c2,J=ve,K=Le,ne=0,ye=J;ye;ye=Ze(ye))ne++;ye=0;for(var Ie=K;Ie;Ie=Ze(Ie))ye++;for(;0<ne-ye;)J=Ze(J),ne--;for(;0<ye-ne;)K=Ze(K),ye--;for(;ne--;){if(J===K||K!==null&&J===K.alternate){Ze=J;break t}J=Ze(J),K=Ze(K)}Ze=null}else Ze=null;ve!==null&&my(be,ue,ve,Ze,!1),Le!==null&&Mt!==null&&my(be,Mt,Le,Ze,!0)}}e:{if(ue=ie?ti(ie):window,ve=ue.nodeName&&ue.nodeName.toLowerCase(),ve==="select"||ve==="input"&&ue.type==="file")var bt=Lg;else if(zg(ue))if(kg)bt=wS;else{bt=bS;var je=yS}else ve=ue.nodeName,!ve||ve.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ie&&kc(ie.elementType)&&(bt=Lg):bt=xS;if(bt&&(bt=bt(r,ie))){Og(be,bt,s,ge);break e}je&&je(r,ue,ie),r==="focusout"&&ie&&ue.type==="number"&&ie.memoizedProps.value!=null&&Lc(ue,"number",ue.value)}switch(je=ie?ti(ie):window,r){case"focusin":(zg(je)||je.contentEditable==="true")&&(Pi=je,Zc=ie,Wl=null);break;case"focusout":Wl=Zc=Pi=null;break;case"mousedown":Qc=!0;break;case"contextmenu":case"mouseup":case"dragend":Qc=!1,Gg(be,s,ge);break;case"selectionchange":if(ES)break;case"keydown":case"keyup":Gg(be,s,ge)}var lt;if(Yc)e:{switch(r){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else ji?Mg(r,s)&&(ht="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(ht="onCompositionStart");ht&&(Dg&&s.locale!=="ko"&&(ji||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&ji&&(lt=Sg()):(dn=ge,jc="value"in dn?dn.value:dn.textContent,ji=!0)),je=ho(ie,ht),0<je.length&&(ht=new Cg(ht,r,null,s,ge),be.push({event:ht,listeners:je}),lt?ht.data=lt:(lt=Rg(s),lt!==null&&(ht.data=lt)))),(lt=dS?hS(r,s):gS(r,s))&&(ht=ho(ie,"onBeforeInput"),0<ht.length&&(je=new Cg("onBeforeInput","beforeinput",null,s,ge),be.push({event:je,listeners:ht}),je.data=lt)),l2(be,r,ie,s,ge)}gy(be,i)})}function Eu(r,i,s){return{instance:r,listener:i,currentTarget:s}}function ho(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Il(r,s),p!=null&&d.unshift(Eu(r,p,y)),p=Il(r,i),p!=null&&d.push(Eu(r,p,y))),r.tag===3)return d;r=r.return}return[]}function c2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function my(r,i,s,d,p){for(var y=i._reactName,D=[];s!==null&&s!==d;){var k=s,X=k.alternate,ie=k.stateNode;if(k=k.tag,X!==null&&X===d)break;k!==5&&k!==26&&k!==27||ie===null||(X=ie,p?(ie=Il(s,y),ie!=null&&D.unshift(Eu(s,ie,X))):p||(ie=Il(s,y),ie!=null&&D.push(Eu(s,ie,X)))),s=s.return}D.length!==0&&r.push({event:i,listeners:D})}var f2=/\r\n?/g,v2=/\u0000|\uFFFD/g;function yy(r){return(typeof r=="string"?r:""+r).replace(f2,`
9
- `).replace(v2,"")}function by(r,i){return i=yy(i),yy(r)===i}function Nt(r,i,s,d,p,y){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||qi(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&qi(r,""+d);break;case"className":vn(r,"class",d);break;case"tabIndex":vn(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":vn(r,s,d);break;case"style":bg(r,d,y);break;case"data":if(i!=="object"){vn(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=bs(""+d),r.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(s==="formAction"?(i!=="input"&&Nt(r,i,"name",p.name,p,null),Nt(r,i,"formEncType",p.formEncType,p,null),Nt(r,i,"formMethod",p.formMethod,p,null),Nt(r,i,"formTarget",p.formTarget,p,null)):(Nt(r,i,"encType",p.encType,p,null),Nt(r,i,"method",p.method,p,null),Nt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=bs(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=qr);break;case"onScroll":d!=null&&ft("scroll",r);break;case"onScrollEnd":d!=null&&ft("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(n(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(n(60));r.innerHTML=s}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}s=bs(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""+d):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":d===!0?r.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,d):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(s,d):r.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(s):r.setAttribute(s,d);break;case"popover":ft("beforetoggle",r),ft("toggle",r),Ra(r,"popover",d);break;case"xlinkActuate":lr(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":lr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":lr(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":lr(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":lr(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":lr(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":lr(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":lr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":lr(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Ra(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=jw.get(s)||s,Ra(r,s,d))}}function Sv(r,i,s,d,p,y){switch(s){case"style":bg(r,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(n(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(n(60));r.innerHTML=s}}break;case"children":typeof d=="string"?qi(r,d):(typeof d=="number"||typeof d=="bigint")&&qi(r,""+d);break;case"onScroll":d!=null&&ft("scroll",r);break;case"onScrollEnd":d!=null&&ft("scrollend",r);break;case"onClick":d!=null&&(r.onclick=qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gs.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),y=r[$t]||null,y=y!=null?y[s]:null,typeof y=="function"&&r.removeEventListener(i,y,p),typeof d=="function")){typeof y!="function"&&y!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,d,p);break e}s in r?r[s]=d:d===!0?r.setAttribute(s,""):Ra(r,s,d)}}}function Ca(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ft("error",r),ft("load",r);var d=!1,p=!1,y;for(y in s)if(s.hasOwnProperty(y)){var D=s[y];if(D!=null)switch(y){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,i));default:Nt(r,i,y,D,s,null)}}p&&Nt(r,i,"srcSet",s.srcSet,s,null),d&&Nt(r,i,"src",s.src,s,null);return;case"input":ft("invalid",r);var k=y=D=p=null,X=null,ie=null;for(d in s)if(s.hasOwnProperty(d)){var ge=s[d];if(ge!=null)switch(d){case"name":p=ge;break;case"type":D=ge;break;case"checked":X=ge;break;case"defaultChecked":ie=ge;break;case"value":y=ge;break;case"defaultValue":k=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(n(137,i));break;default:Nt(r,i,d,ge,s,null)}}gg(r,y,k,X,ie,D,p,!1);return;case"select":ft("invalid",r),d=D=y=null;for(p in s)if(s.hasOwnProperty(p)&&(k=s[p],k!=null))switch(p){case"value":y=k;break;case"defaultValue":D=k;break;case"multiple":d=k;default:Nt(r,i,p,k,s,null)}i=y,s=D,r.multiple=!!d,i!=null?_i(r,!!d,i,!1):s!=null&&_i(r,!!d,s,!0);return;case"textarea":ft("invalid",r),y=p=d=null;for(D in s)if(s.hasOwnProperty(D)&&(k=s[D],k!=null))switch(D){case"value":d=k;break;case"defaultValue":p=k;break;case"children":y=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(n(91));break;default:Nt(r,i,D,k,s,null)}mg(r,d,p,y);return;case"option":for(X in s)s.hasOwnProperty(X)&&(d=s[X],d!=null)&&(X==="selected"?r.selected=d&&typeof d!="function"&&typeof d!="symbol":Nt(r,i,X,d,s,null));return;case"dialog":ft("beforetoggle",r),ft("toggle",r),ft("cancel",r),ft("close",r);break;case"iframe":case"object":ft("load",r);break;case"video":case"audio":for(d=0;d<Su.length;d++)ft(Su[d],r);break;case"image":ft("error",r),ft("load",r);break;case"details":ft("toggle",r);break;case"embed":case"source":case"link":ft("error",r),ft("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in s)if(s.hasOwnProperty(ie)&&(d=s[ie],d!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,i));default:Nt(r,i,ie,d,s,null)}return;default:if(kc(i)){for(ge in s)s.hasOwnProperty(ge)&&(d=s[ge],d!==void 0&&Sv(r,i,ge,d,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(d=s[k],d!=null&&Nt(r,i,k,d,s,null))}function d2(r,i,s,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,D=null,k=null,X=null,ie=null,ge=null;for(ve in s){var be=s[ve];if(s.hasOwnProperty(ve)&&be!=null)switch(ve){case"checked":break;case"value":break;case"defaultValue":X=be;default:d.hasOwnProperty(ve)||Nt(r,i,ve,null,d,be)}}for(var ue in d){var ve=d[ue];if(be=s[ue],d.hasOwnProperty(ue)&&(ve!=null||be!=null))switch(ue){case"type":y=ve;break;case"name":p=ve;break;case"checked":ie=ve;break;case"defaultChecked":ge=ve;break;case"value":D=ve;break;case"defaultValue":k=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(n(137,i));break;default:ve!==be&&Nt(r,i,ue,ve,d,be)}}Oc(r,D,k,X,ie,ge,y,p);return;case"select":ve=D=k=ue=null;for(y in s)if(X=s[y],s.hasOwnProperty(y)&&X!=null)switch(y){case"value":break;case"multiple":ve=X;default:d.hasOwnProperty(y)||Nt(r,i,y,null,d,X)}for(p in d)if(y=d[p],X=s[p],d.hasOwnProperty(p)&&(y!=null||X!=null))switch(p){case"value":ue=y;break;case"defaultValue":k=y;break;case"multiple":D=y;default:y!==X&&Nt(r,i,p,y,d,X)}i=k,s=D,d=ve,ue!=null?_i(r,!!s,ue,!1):!!d!=!!s&&(i!=null?_i(r,!!s,i,!0):_i(r,!!s,s?[]:"",!1));return;case"textarea":ve=ue=null;for(k in s)if(p=s[k],s.hasOwnProperty(k)&&p!=null&&!d.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Nt(r,i,k,null,d,p)}for(D in d)if(p=d[D],y=s[D],d.hasOwnProperty(D)&&(p!=null||y!=null))switch(D){case"value":ue=p;break;case"defaultValue":ve=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(n(91));break;default:p!==y&&Nt(r,i,D,p,d,y)}pg(r,ue,ve);return;case"option":for(var Le in s)ue=s[Le],s.hasOwnProperty(Le)&&ue!=null&&!d.hasOwnProperty(Le)&&(Le==="selected"?r.selected=!1:Nt(r,i,Le,null,d,ue));for(X in d)ue=d[X],ve=s[X],d.hasOwnProperty(X)&&ue!==ve&&(ue!=null||ve!=null)&&(X==="selected"?r.selected=ue&&typeof ue!="function"&&typeof ue!="symbol":Nt(r,i,X,ue,d,ve));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ze in s)ue=s[Ze],s.hasOwnProperty(Ze)&&ue!=null&&!d.hasOwnProperty(Ze)&&Nt(r,i,Ze,null,d,ue);for(ie in d)if(ue=d[ie],ve=s[ie],d.hasOwnProperty(ie)&&ue!==ve&&(ue!=null||ve!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(n(137,i));break;default:Nt(r,i,ie,ue,d,ve)}return;default:if(kc(i)){for(var Mt in s)ue=s[Mt],s.hasOwnProperty(Mt)&&ue!==void 0&&!d.hasOwnProperty(Mt)&&Sv(r,i,Mt,void 0,d,ue);for(ge in d)ue=d[ge],ve=s[ge],!d.hasOwnProperty(ge)||ue===ve||ue===void 0&&ve===void 0||Sv(r,i,ge,ue,d,ve);return}}for(var J in s)ue=s[J],s.hasOwnProperty(J)&&ue!=null&&!d.hasOwnProperty(J)&&Nt(r,i,J,null,d,ue);for(be in d)ue=d[be],ve=s[be],!d.hasOwnProperty(be)||ue===ve||ue==null&&ve==null||Nt(r,i,be,ue,d,ve)}function xy(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function h2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],y=p.transferSize,D=p.initiatorType,k=p.duration;if(y&&k&&xy(D)){for(D=0,k=p.responseEnd,d+=1;d<s.length;d++){var X=s[d],ie=X.startTime;if(ie>k)break;var ge=X.transferSize,be=X.initiatorType;ge&&xy(be)&&(X=X.responseEnd,D+=ge*(X<k?1:(k-ie)/(X-ie)))}if(--d,i+=8*(y+D)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Ev=null,Tv=null;function go(r){return r.nodeType===9?r:r.ownerDocument}function wy(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sy(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function Cv(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Av=null;function g2(){var r=window.event;return r&&r.type==="popstate"?r===Av?!1:(Av=r,!0):(Av=null,!1)}var Ey=typeof setTimeout=="function"?setTimeout:void 0,p2=typeof clearTimeout=="function"?clearTimeout:void 0,Ty=typeof Promise=="function"?Promise:void 0,m2=typeof queueMicrotask=="function"?queueMicrotask:typeof Ty<"u"?function(r){return Ty.resolve(null).then(r).catch(y2)}:Ey;function y2(r){setTimeout(function(){throw r})}function Mn(r){return r==="head"}function Cy(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),hl(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Tu(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Tu(s);for(var y=s.firstChild;y;){var D=y.nextSibling,k=y.nodeName;y[pa]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&y.rel.toLowerCase()==="stylesheet"||s.removeChild(y),y=D}}else s==="body"&&Tu(r.ownerDocument.body);s=p}while(s);hl(i)}function Ay(r,i){var s=r;r=0;do{var d=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=d}while(s)}function Dv(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Dv(s),Li(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function b2(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[pa])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=hr(r.nextSibling),r===null)break}return null}function x2(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=hr(r.nextSibling),r===null))return null;return r}function Dy(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=hr(r.nextSibling),r===null))return null;return r}function Bv(r){return r.data==="$?"||r.data==="$~"}function Nv(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function w2(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var d=function(){i(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function hr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var Mv=null;function By(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return hr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function Ny(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function My(r,i,s){switch(i=go(s),r){case"html":if(r=i.documentElement,!r)throw Error(n(452));return r;case"head":if(r=i.head,!r)throw Error(n(453));return r;case"body":if(r=i.body,!r)throw Error(n(454));return r;default:throw Error(n(451))}}function Tu(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Li(r)}var gr=new Map,Ry=new Set;function po(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Jr=j.d;j.d={f:S2,r:E2,D:T2,C:C2,L:A2,m:D2,X:N2,S:B2,M:M2};function S2(){var r=Jr.f(),i=lo();return r||i}function E2(r){var i=cn(r);i!==null&&i.tag===5&&i.type==="form"?Kp(i):Jr.r(r)}var fl=typeof document>"u"?null:document;function zy(r,i,s){var d=fl;if(d&&typeof i=="string"&&i){var p=ur(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Ry.has(p)||(Ry.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Ca(i,"link",r),ea(i),d.head.appendChild(i)))}}function T2(r){Jr.D(r),zy("dns-prefetch",r,null)}function C2(r,i){Jr.C(r,i),zy("preconnect",r,i)}function A2(r,i,s){Jr.L(r,i,s);var d=fl;if(d&&r&&i){var p='link[rel="preload"][as="'+ur(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+ur(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+ur(s.imageSizes)+'"]')):p+='[href="'+ur(r)+'"]';var y=p;switch(i){case"style":y=vl(r);break;case"script":y=dl(r)}gr.has(y)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),gr.set(y,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Cu(y))||i==="script"&&d.querySelector(Au(y))||(i=d.createElement("link"),Ca(i,"link",r),ea(i),d.head.appendChild(i)))}}function D2(r,i){Jr.m(r,i);var s=fl;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+ur(d)+'"][href="'+ur(r)+'"]',y=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=dl(r)}if(!gr.has(y)&&(r=g({rel:"modulepreload",href:r},i),gr.set(y,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Au(y)))return}d=s.createElement("link"),Ca(d,"link",r),ea(d),s.head.appendChild(d)}}}function B2(r,i,s){Jr.S(r,i,s);var d=fl;if(d&&r){var p=fn(d).hoistableStyles,y=vl(r);i=i||"default";var D=p.get(y);if(!D){var k={loading:0,preload:null};if(D=d.querySelector(Cu(y)))k.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=gr.get(y))&&Rv(r,s);var X=D=d.createElement("link");ea(X),Ca(X,"link",r),X._p=new Promise(function(ie,ge){X.onload=ie,X.onerror=ge}),X.addEventListener("load",function(){k.loading|=1}),X.addEventListener("error",function(){k.loading|=2}),k.loading|=4,mo(D,i,d)}D={type:"stylesheet",instance:D,count:1,state:k},p.set(y,D)}}}function N2(r,i){Jr.X(r,i);var s=fl;if(s&&r){var d=fn(s).hoistableScripts,p=dl(r),y=d.get(p);y||(y=s.querySelector(Au(p)),y||(r=g({src:r,async:!0},i),(i=gr.get(p))&&zv(r,i),y=s.createElement("script"),ea(y),Ca(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function M2(r,i){Jr.M(r,i);var s=fl;if(s&&r){var d=fn(s).hoistableScripts,p=dl(r),y=d.get(p);y||(y=s.querySelector(Au(p)),y||(r=g({src:r,async:!0,type:"module"},i),(i=gr.get(p))&&zv(r,i),y=s.createElement("script"),ea(y),Ca(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function Oy(r,i,s,d){var p=(p=se.current)?po(p):null;if(!p)throw Error(n(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=vl(s.href),s=fn(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=vl(s.href);var y=fn(p).hoistableStyles,D=y.get(r);if(D||(p=p.ownerDocument||p,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,D),(y=p.querySelector(Cu(r)))&&!y._p&&(D.instance=y,D.state.loading=5),gr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},gr.set(r,s),y||R2(p,r,s,D.state))),i&&d===null)throw Error(n(528,""));return D}if(i&&d!==null)throw Error(n(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=dl(s),s=fn(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,r))}}function vl(r){return'href="'+ur(r)+'"'}function Cu(r){return'link[rel="stylesheet"]['+r+"]"}function Ly(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function R2(r,i,s,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Ca(i,"link",s),ea(i),r.head.appendChild(i))}function dl(r){return'[src="'+ur(r)+'"]'}function Au(r){return"script[async]"+r}function ky(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+ur(s.href)+'"]');if(d)return i.instance=d,ea(d),d;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),ea(d),Ca(d,"style",p),mo(d,s.precedence,r),i.instance=d;case"stylesheet":p=vl(s.href);var y=r.querySelector(Cu(p));if(y)return i.state.loading|=4,i.instance=y,ea(y),y;d=Ly(s),(p=gr.get(p))&&Rv(d,p),y=(r.ownerDocument||r).createElement("link"),ea(y);var D=y;return D._p=new Promise(function(k,X){D.onload=k,D.onerror=X}),Ca(y,"link",d),i.state.loading|=4,mo(y,s.precedence,r),i.instance=y;case"script":return y=dl(s.src),(p=r.querySelector(Au(y)))?(i.instance=p,ea(p),p):(d=s,(p=gr.get(y))&&(d=g({},s),zv(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),ea(p),Ca(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(n(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,mo(d,s.precedence,r));return i.instance}function mo(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,y=p,D=0;D<d.length;D++){var k=d[D];if(k.dataset.precedence===i)y=k;else if(y!==p)break}y?y.parentNode.insertBefore(r,y.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function Rv(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function zv(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var yo=null;function _y(r,i,s){if(yo===null){var d=new Map,p=yo=new Map;p.set(s,d)}else p=yo,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var y=s[p];if(!(y[pa]||y[_t]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var D=y.getAttribute(i)||"";D=r+D;var k=d.get(D);k?k.push(y):d.set(D,[y])}}return d}function qy(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function z2(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Vy(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function O2(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=vl(d.href),y=i.querySelector(Cu(p));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=bo.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=y,ea(y);return}y=i.ownerDocument||i,d=Ly(d),(p=gr.get(p))&&Rv(d,p),y=y.createElement("link"),ea(y);var D=y;D._p=new Promise(function(k,X){D.onload=k,D.onerror=X}),Ca(y,"link",d),s.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=bo.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Ov=0;function L2(r,i){return r.stylesheets&&r.count===0&&wo(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&wo(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+i);0<r.imgBytes&&Ov===0&&(Ov=62500*h2());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&wo(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>Ov?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function bo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wo(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var xo=null;function wo(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,xo=new Map,i.forEach(k2,r),xo=null,bo.call(r))}function k2(r,i){if(!(i.state.loading&4)){var s=xo.get(r);if(s)var d=s.get(null);else{s=new Map,xo.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var D=p[y];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),d=D)}d&&s.set(null,d)}p=i.instance,D=p.getAttribute("data-precedence"),y=s.get(D)||d,y===d&&s.set(null,p),s.set(D,p),this.count++,d=bo.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),y?y.parentNode.insertBefore(p,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Du={$$typeof:C,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function _2(r,i,s,d,p,y,D,k,X){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jt(0),this.hiddenUpdates=jt(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function Uy(r,i,s,d,p,y,D,k,X,ie,ge,be){return r=new _2(r,i,s,D,X,ie,ge,be,k),i=1,y===!0&&(i|=24),y=Wa(3,null,null,i),r.current=y,y.stateNode=r,i=vf(),i.refCount++,r.pooledCache=i,i.refCount++,y.memoizedState={element:d,isDehydrated:s,cache:i},pf(y),r}function jy(r){return r?(r=Ii,r):Ii}function Py(r,i,s,d,p,y){p=jy(p),d.context===null?d.context=p:d.pendingContext=p,d=bn(i),d.payload={element:s},y=y===void 0?null:y,y!==null&&(d.callback=y),s=xn(r,d,i),s!==null&&(Fa(s,r,i),iu(s,r,i))}function Hy(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function Lv(r,i){Hy(r,i),(r=r.alternate)&&Hy(r,i)}function Gy(r){if(r.tag===13||r.tag===31){var i=ii(r,67108864);i!==null&&Fa(i,r,67108864),Lv(r,67108864)}}function Iy(r){if(r.tag===13||r.tag===31){var i=rr();i=Te(i);var s=ii(r,i);s!==null&&Fa(s,r,i),Lv(r,i)}}var So=!0;function q2(r,i,s,d){var p=_.T;_.T=null;var y=j.p;try{j.p=2,kv(r,i,s,d)}finally{j.p=y,_.T=p}}function V2(r,i,s,d){var p=_.T;_.T=null;var y=j.p;try{j.p=8,kv(r,i,s,d)}finally{j.p=y,_.T=p}}function kv(r,i,s,d){if(So){var p=_v(d);if(p===null)wv(r,i,d,Eo,s),Fy(r,d);else if(j2(p,r,i,s,d))d.stopPropagation();else if(Fy(r,d),i&4&&-1<U2.indexOf(r)){for(;p!==null;){var y=cn(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var D=We(y.pendingLanes);if(D!==0){var k=y;for(k.pendingLanes|=2,k.entangledLanes|=2;D;){var X=1<<31-oe(D);k.entanglements[1]|=X,D&=~X}Nr(y),(St&6)===0&&(no=Be()+500,wu(0))}}break;case 31:case 13:k=ii(y,2),k!==null&&Fa(k,y,2),lo(),Lv(y,2)}if(y=_v(d),y===null&&wv(r,i,d,Eo,s),y===p)break;p=y}p!==null&&d.stopPropagation()}else wv(r,i,d,null,s)}}function _v(r){return r=qc(r),qv(r)}var Eo=null;function qv(r){if(Eo=null,r=on(r),r!==null){var i=u(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=o(i),r!==null)return r;r=null}else if(s===31){if(r=c(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return Eo=r,null}function Yy(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(et()){case rt:return 2;case vt:return 8;case ut:case ot:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Vv=!1,Rn=null,zn=null,On=null,Bu=new Map,Nu=new Map,Ln=[],U2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Fy(r,i){switch(r){case"focusin":case"focusout":Rn=null;break;case"dragenter":case"dragleave":zn=null;break;case"mouseover":case"mouseout":On=null;break;case"pointerover":case"pointerout":Bu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nu.delete(i.pointerId)}}function Mu(r,i,s,d,p,y){return r===null||r.nativeEvent!==y?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:y,targetContainers:[p]},i!==null&&(i=cn(i),i!==null&&Gy(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function j2(r,i,s,d,p){switch(i){case"focusin":return Rn=Mu(Rn,r,i,s,d,p),!0;case"dragenter":return zn=Mu(zn,r,i,s,d,p),!0;case"mouseover":return On=Mu(On,r,i,s,d,p),!0;case"pointerover":var y=p.pointerId;return Bu.set(y,Mu(Bu.get(y)||null,r,i,s,d,p)),!0;case"gotpointercapture":return y=p.pointerId,Nu.set(y,Mu(Nu.get(y)||null,r,i,s,d,p)),!0}return!1}function Xy(r){var i=on(r.target);if(i!==null){var s=u(i);if(s!==null){if(i=s.tag,i===13){if(i=o(s),i!==null){r.blockedOn=i,da(r.priority,function(){Iy(s)});return}}else if(i===31){if(i=c(s),i!==null){r.blockedOn=i,da(r.priority,function(){Iy(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function To(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=_v(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);_c=d,s.target.dispatchEvent(d),_c=null}else return i=cn(s),i!==null&&Gy(i),r.blockedOn=s,!1;i.shift()}return!0}function Ky(r,i,s){To(r)&&s.delete(i)}function P2(){Vv=!1,Rn!==null&&To(Rn)&&(Rn=null),zn!==null&&To(zn)&&(zn=null),On!==null&&To(On)&&(On=null),Bu.forEach(Ky),Nu.forEach(Ky)}function Co(r,i){r.blockedOn===i&&(r.blockedOn=null,Vv||(Vv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,P2)))}var Ao=null;function Zy(r){Ao!==r&&(Ao=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ao===r&&(Ao=null);for(var i=0;i<r.length;i+=3){var s=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(qv(d||s)===null)continue;break}var y=cn(s);y!==null&&(r.splice(i,3),i-=3,_f(y,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function hl(r){function i(X){return Co(X,r)}Rn!==null&&Co(Rn,r),zn!==null&&Co(zn,r),On!==null&&Co(On,r),Bu.forEach(i),Nu.forEach(i);for(var s=0;s<Ln.length;s++){var d=Ln[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<Ln.length&&(s=Ln[0],s.blockedOn===null);)Xy(s),s.blockedOn===null&&Ln.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],y=s[d+1],D=p[$t]||null;if(typeof y=="function")D||Zy(s);else if(D){var k=null;if(y&&y.hasAttribute("formAction")){if(p=y,D=y[$t]||null)k=D.formAction;else if(qv(p)!==null)continue}else k=D.action;typeof k=="function"?s[d+1]=k:(s.splice(d,3),d-=3),Zy(s)}}}function Qy(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(D){return p=D})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Uv(r){this._internalRoot=r}Do.prototype.render=Uv.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(n(409));var s=i.current,d=rr();Py(s,d,r,i,null,null)},Do.prototype.unmount=Uv.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Py(r.current,2,null,r,null,null),lo(),i[qt]=null}};function Do(r){this._internalRoot=r}Do.prototype.unstable_scheduleHydration=function(r){if(r){var i=gt();r={blockedOn:null,target:r,priority:i};for(var s=0;s<Ln.length&&i!==0&&i<Ln[s].priority;s++);Ln.splice(s,0,r),s===0&&Xy(r)}};var $y=e.version;if($y!=="19.2.4")throw Error(n(527,$y,"19.2.4"));j.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=f(i),r=r!==null?h(r):null,r=r===null?null:r.stateNode,r};var H2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bo.isDisabled&&Bo.supportsFiber)try{q=Bo.inject(H2),ee=Bo}catch{}}return zu.createRoot=function(r,i){if(!l(r))throw Error(n(299));var s=!1,d="",p=nm,y=im,D=lm;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(D=i.onRecoverableError)),i=Uy(r,1,!1,null,null,s,d,null,p,y,D,Qy),r[qt]=i.current,xv(r),new Uv(i)},zu.hydrateRoot=function(r,i,s){if(!l(r))throw Error(n(299));var d=!1,p="",y=nm,D=im,k=lm,X=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(X=s.formState)),i=Uy(r,1,!0,i,s??null,d,p,X,y,D,k,Qy),i.context=jy(null),s=i.current,d=rr(),d=Te(d),p=bn(d),p.callback=null,xn(s,p,d),s=d,i.current.lanes=s,Et(i,s),Nr(i),r[qt]=i.current,xv(r),new Do(i)},zu.version="19.2.4",zu}var u0;function J2(){if(u0)return Hv.exports;u0=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Hv.exports=W2(),Hv.exports}var eE=J2();const tE=H1(eE);function s0(t){if(t===void 0)return"โ€”";if(t===null)return"null";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function aE({changes:t}){return t.length?M.jsxs("table",{className:"diff-frontmatter",children:[M.jsx("thead",{children:M.jsxs("tr",{children:[M.jsx("th",{children:"Field"}),M.jsx("th",{children:"Before"}),M.jsx("th",{children:"After"})]})}),M.jsx("tbody",{children:t.map(e=>M.jsxs("tr",{className:e.protected?"is-protected":void 0,children:[M.jsxs("td",{className:"text-mono",children:[e.key,e.protected?M.jsx("span",{className:"label label-danger",children:" protected"}):null]}),M.jsx("td",{className:"text-mono text-sm",children:s0(e.before)}),M.jsx("td",{className:"text-mono text-sm",children:s0(e.after)})]},e.key))})]}):null}function rE({diff:t,warnings:e}){const[a,n]=qe.useState("unified"),l=t.frontmatterChanges.filter(u=>u.protected);return M.jsxs("div",{className:"diff-view",children:[e?.length?M.jsx("p",{className:"text-error text-sm",children:e.includes("protected_frontmatter_changed")?"Warning: protected frontmatter fields changed. Verify before accepting.":e.join(", ")}):null,M.jsx(aE,{changes:t.frontmatterChanges}),(l.length===0&&t.frontmatterChanges.length===0,null),M.jsxs("div",{className:"diff-toolbar",children:[M.jsxs("span",{className:"text-muted text-sm",children:["+",t.addedLines," / -",t.removedLines]}),M.jsxs("div",{className:"action-row",children:[M.jsx("button",{type:"button",className:`btn btn-ghost${a==="unified"?" is-active":""}`,onClick:()=>n("unified"),children:"Unified"}),M.jsx("button",{type:"button",className:`btn btn-ghost${a==="split"?" is-active":""}`,onClick:()=>n("split"),children:"Split"})]})]}),t.hunks.map(u=>M.jsxs("div",{className:"diff-hunk",children:[M.jsxs("div",{className:"diff-hunk-header text-mono text-sm",children:["@@ -",u.oldStart,",",u.oldLines," +",u.newStart,",",u.newLines," @@"]}),a==="unified"?M.jsx("pre",{className:"diff-unified",children:u.lines.map((o,c)=>M.jsxs("div",{className:`diff-line diff-${o.type}`,children:[M.jsx("span",{className:"diff-marker",children:o.type==="add"?"+":o.type==="remove"?"-":" "}),M.jsx("span",{className:"diff-text",children:o.value})]},`u-${c}`))}):M.jsxs("div",{className:"diff-split",children:[M.jsx("pre",{className:"diff-column diff-column-before",children:u.lines.filter(o=>o.type!=="add").map((o,c)=>M.jsx("div",{className:`diff-line diff-${o.type}`,children:M.jsx("span",{className:"diff-text",children:o.value})},`b-${c}`))}),M.jsx("pre",{className:"diff-column diff-column-after",children:u.lines.filter(o=>o.type!=="remove").map((o,c)=>M.jsx("div",{className:`diff-line diff-${o.type}`,children:M.jsx("span",{className:"diff-text",children:o.value})},`a-${c}`))})]})]},`hunk-${u.oldStart}-${u.newStart}`))]})}function nE(t){return t.replace(/\s+/g," ").trim().slice(0,220)}function iE({approvals:t,selectedApprovalId:e,onSelectApproval:a,approvalDetail:n,approvalError:l,actionError:u,busyAction:o,onReviewAction:c,onOpenPage:v}){return M.jsxs("div",{children:[l?M.jsx("p",{className:"text-error",children:l}):null,u?M.jsx("p",{className:"text-error",children:u}):null,t.length?M.jsx("div",{className:"card-list",children:t.map(f=>M.jsxs("button",{type:"button",className:`result-card${e===f.approvalId?" is-active":""}`,onClick:()=>a(f.approvalId),children:[M.jsxs("span",{className:"label",children:["pending ",f.pendingCount]}),M.jsx("strong",{className:"card-title",children:f.approvalId}),M.jsxs("p",{className:"text-muted text-sm",children:["accepted ",f.acceptedCount," / rejected ",f.rejectedCount]})]},f.approvalId))}):M.jsx("p",{className:"text-muted text-sm",children:"No staged approval bundles."}),n?.entries.length?M.jsx("div",{className:"card-list",style:{marginTop:8},children:n.entries.map(f=>M.jsx(lE,{entry:f,busyAction:o,onReviewAction:c,onOpenPage:v},`${f.pageId}:${f.nextPath??f.previousPath??f.changeType}`))}):null]})}function lE({entry:t,busyAction:e,onReviewAction:a,onOpenPage:n}){const[l,u]=qe.useState(!1),o=!!t.structuredDiff?.hunks.length,c=t.warnings?.includes("protected_frontmatter_changed")??!1;return M.jsxs("article",{className:"card",children:[M.jsxs("span",{className:"label",children:[t.status," / ",t.changeType]}),M.jsx("strong",{className:"card-title",children:t.title}),M.jsx("p",{className:"text-mono text-sm",children:t.nextPath??t.previousPath}),c?M.jsx("p",{className:"text-error text-sm",children:"Warning: protected frontmatter fields changed."}):null,M.jsxs("div",{className:"action-row",children:[t.stagedContent?M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{n(t.nextPath??t.previousPath??"",t.pageId)},children:"Open page"}):null,o?M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>u(v=>!v),children:l?"Hide diff":"View diff"}):null]}),l&&t.structuredDiff?M.jsx(rE,{diff:t.structuredDiff,warnings:t.warnings}):null,t.status==="pending"?M.jsxs("div",{className:"action-row",children:[M.jsx("button",{type:"button",className:"btn btn-primary",disabled:e===`accept:${t.pageId}`,onClick:()=>a(t.pageId,"accept"),children:"Accept"}),M.jsx("button",{type:"button",className:"btn btn-danger",disabled:e===`reject:${t.pageId}`,onClick:()=>a(t.pageId,"reject"),children:"Reject"})]}):M.jsx("p",{className:"text-secondary text-sm",children:t.currentContent?nE(t.currentContent):"No current content on disk."})]})}function uE({candidates:t,candidateError:e,busyAction:a,onCandidateAction:n,onOpenPage:l}){return M.jsxs("div",{children:[e?M.jsx("p",{className:"text-error",children:e}):null,t.length?M.jsx("div",{className:"card-list",children:t.map(u=>M.jsxs("article",{className:"card",children:[M.jsx("span",{className:"label",children:u.kind}),M.jsx("strong",{className:"card-title",children:u.title}),M.jsx("p",{className:"text-mono text-sm",children:u.path}),M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{l(u.path,u.pageId)},children:"Open candidate"}),M.jsxs("div",{className:"action-row",children:[M.jsx("button",{type:"button",className:"btn btn-primary",disabled:a===`promote:${u.pageId}`,onClick:()=>n(u.pageId,"promote",u.activePath),children:"Promote"}),M.jsx("button",{type:"button",className:"btn btn-danger",disabled:a===`archive:${u.pageId}`,onClick:()=>n(u.pageId,"archive",u.path),children:"Archive"})]})]},u.pageId))}):M.jsx("p",{className:"text-muted text-sm",children:"No candidate pages are waiting for review."})]})}function sE({edgeStatusFilter:t,onEdgeStatusChange:e,kindFilter:a,onKindChange:n,pageStatusFilter:l,onPageStatusChange:u,projectFilter:o,onProjectChange:c,projectOptions:v,sourceTypeFilter:f,onSourceTypeChange:h,sourceTypeOptions:g,sourceClassFilter:m,onSourceClassChange:x,sourceClassOptions:b,communityFilter:E,onCommunityChange:S,communityOptions:w,query:T,onQueryChange:C}){const[B,R]=qe.useState(()=>new Set(["graph"])),L=z=>{R(U=>{const V=new Set(U);return V.has(z)?V.delete(z):V.add(z),V})},A=[t,E,m].filter(z=>z!=="all").length,O=[a,l,o,f].filter(z=>z!=="all").length;return M.jsxs("div",{className:"sidebar",children:[M.jsx("div",{className:"sidebar-section",children:M.jsxs("label",{className:"filter-group",children:[M.jsx("span",{className:"filter-label",children:"Search"}),M.jsx("input",{type:"search",className:"input",value:T,onChange:z=>C(z.target.value),placeholder:"Pages, outputs, candidates\\u2026","aria-label":"Search pages"})]})}),M.jsxs("div",{className:"sidebar-section",children:[M.jsxs("button",{type:"button",className:`sidebar-section-toggle ${B.has("graph")?"is-expanded":""}`,onClick:()=>L("graph"),children:["Graph",A>0?M.jsx("span",{className:"filter-badge",children:A}):null]}),M.jsxs("div",{className:`sidebar-section-body ${B.has("graph")?"is-expanded":""}`,children:[M.jsxs("label",{className:"filter-group",children:[M.jsx("span",{className:"filter-label",children:"Edge status"}),M.jsxs("select",{className:"input",value:t,onChange:z=>e(z.target.value),children:[M.jsx("option",{value:"all",children:"All"}),M.jsx("option",{value:"extracted",children:"Extracted"}),M.jsx("option",{value:"conflicted",children:"Conflicted"}),M.jsx("option",{value:"inferred",children:"Inferred"}),M.jsx("option",{value:"stale",children:"Stale"})]})]}),M.jsxs("label",{className:"filter-group",children:[M.jsx("span",{className:"filter-label",children:"Source class"}),M.jsxs("select",{className:"input",value:m,onChange:z=>x(z.target.value),children:[M.jsx("option",{value:"all",children:"All"}),b.map(z=>M.jsx("option",{value:z,children:z},z))]})]}),M.jsxs("label",{className:"filter-group",children:[M.jsx("span",{className:"filter-label",children:"Community"}),M.jsxs("select",{className:"input",value:E,onChange:z=>S(z.target.value),children:[M.jsx("option",{value:"all",children:"All"}),w.map(z=>M.jsx("option",{value:z,children:z},z))]})]})]})]}),M.jsxs("div",{className:"sidebar-section",children:[M.jsxs("button",{type:"button",className:`sidebar-section-toggle ${B.has("pages")?"is-expanded":""}`,onClick:()=>L("pages"),children:["Pages",O>0?M.jsx("span",{className:"filter-badge",children:O}):null]}),M.jsxs("div",{className:`sidebar-section-body ${B.has("pages")?"is-expanded":""}`,children:[M.jsxs("label",{className:"filter-group",children:[M.jsx("span",{className:"filter-label",children:"Page kind"}),M.jsxs("select",{className:"input",value:a,onChange:z=>n(z.target.value),children:[M.jsx("option",{value:"all",children:"All"}),M.jsx("option",{value:"source",children:"Source"}),M.jsx("option",{value:"module",children:"Module"}),M.jsx("option",{value:"concept",children:"Concept"}),M.jsx("option",{value:"entity",children:"Entity"}),M.jsx("option",{value:"output",children:"Output"}),M.jsx("option",{value:"insight",children:"Insight"}),M.jsx("option",{value:"graph_report",children:"Graph report"}),M.jsx("option",{value:"community_summary",children:"Community summary"}),M.jsx("option",{value:"index",children:"Index"})]})]}),M.jsxs("label",{className:"filter-group",children:[M.jsx("span",{className:"filter-label",children:"Status"}),M.jsxs("select",{className:"input",value:l,onChange:z=>u(z.target.value),children:[M.jsx("option",{value:"all",children:"All"}),M.jsx("option",{value:"active",children:"Active"}),M.jsx("option",{value:"candidate",children:"Candidate"}),M.jsx("option",{value:"draft",children:"Draft"}),M.jsx("option",{value:"archived",children:"Archived"})]})]}),M.jsxs("label",{className:"filter-group",children:[M.jsx("span",{className:"filter-label",children:"Project"}),M.jsxs("select",{className:"input",value:o,onChange:z=>c(z.target.value),children:[M.jsx("option",{value:"all",children:"All"}),M.jsx("option",{value:"unassigned",children:"Unassigned"}),v.map(z=>M.jsx("option",{value:z,children:z},z))]})]}),M.jsxs("label",{className:"filter-group",children:[M.jsx("span",{className:"filter-label",children:"Source type"}),M.jsxs("select",{className:"input",value:f,onChange:z=>h(z.target.value),children:[M.jsx("option",{value:"all",children:"All"}),g.map(z=>M.jsx("option",{value:z,children:z},z))]})]})]})]})]})}function Sh(t,e){(e==null||e>t.length)&&(e=t.length);for(var a=0,n=Array(e);a<e;a++)n[a]=t[a];return n}function oE(t){if(Array.isArray(t))return t}function cE(t){if(Array.isArray(t))return Sh(t)}function Qn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fE(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I1(n.key),n)}}function $n(t,e,a){return e&&fE(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Za(t,e){var a=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=Ih(t))||e){a&&(t=a);var n=0,l=function(){};return{s:l,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(v){throw v},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,o=!0,c=!1;return{s:function(){a=a.call(t)},n:function(){var v=a.next();return o=v.done,v},e:function(v){c=!0,u=v},f:function(){try{o||a.return==null||a.return()}finally{if(c)throw u}}}}function G1(t,e,a){return(e=I1(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function vE(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function dE(t,e){var a=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(a!=null){var n,l,u,o,c=[],v=!0,f=!1;try{if(u=(a=a.call(t)).next,e===0){if(Object(a)!==a)return;v=!1}else for(;!(v=(n=u.call(a)).done)&&(c.push(n.value),c.length!==e);v=!0);}catch(h){f=!0,l=h}finally{try{if(!v&&a.return!=null&&(o=a.return(),Object(o)!==o))return}finally{if(f)throw l}}return c}}function hE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function la(t,e){return oE(t)||dE(t,e)||Ih(t,e)||hE()}function Jo(t){return cE(t)||vE(t)||Ih(t)||gE()}function pE(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var n=a.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function I1(t){var e=pE(t,"string");return typeof e=="symbol"?e:e+""}function fa(t){"@babel/helpers - typeof";return fa=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},fa(t)}function Ih(t,e){if(t){if(typeof t=="string")return Sh(t,e);var a={}.toString.call(t).slice(8,-1);return a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set"?Array.from(t):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Sh(t,e):void 0}}var oa=typeof window>"u"?null:window,o0=oa?oa.navigator:null;oa&&oa.document;var mE=fa(""),Y1=fa({}),yE=fa(function(){}),bE=typeof HTMLElement>"u"?"undefined":fa(HTMLElement),as=function(e){return e&&e.instanceString&&Xt(e.instanceString)?e.instanceString():null},Ge=function(e){return e!=null&&fa(e)==mE},Xt=function(e){return e!=null&&fa(e)===yE},kt=function(e){return!nr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},yt=function(e){return e!=null&&fa(e)===Y1&&!kt(e)&&e.constructor===Object},xE=function(e){return e!=null&&fa(e)===Y1},Ce=function(e){return e!=null&&fa(e)===fa(1)&&!isNaN(e)},wE=function(e){return Ce(e)&&Math.floor(e)===e},ec=function(e){if(bE!=="undefined")return e!=null&&e instanceof HTMLElement},nr=function(e){return rs(e)||F1(e)},rs=function(e){return as(e)==="collection"&&e._private.single},F1=function(e){return as(e)==="collection"&&!e._private.single},Yh=function(e){return as(e)==="core"},X1=function(e){return as(e)==="stylesheet"},SE=function(e){return as(e)==="event"},In=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},EE=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},TE=function(e){return yt(e)&&Ce(e.x1)&&Ce(e.x2)&&Ce(e.y1)&&Ce(e.y2)},CE=function(e){return xE(e)&&Xt(e.then)},AE=function(){return o0&&o0.userAgent.match(/msie|trident|edge/i)},Ol=function(e,a){a||(a=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var u=[],o=0;o<arguments.length;o++)u.push(arguments[o]);return u.join("$")});var n=function(){var u=this,o=arguments,c,v=a.apply(u,o),f=n.cache;return(c=f[v])||(c=f[v]=e.apply(u,o)),c};return n.cache={},n},Fh=Ol(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),dc=Ol(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),K1=Ol(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),c0=function(e){return In(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Un=function(e,a){return e.slice(-1*a.length)===a},ca="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",DE="rgb[a]?\\(("+ca+"[%]?)\\s*,\\s*("+ca+"[%]?)\\s*,\\s*("+ca+"[%]?)(?:\\s*,\\s*("+ca+"))?\\)",BE="rgb[a]?\\((?:"+ca+"[%]?)\\s*,\\s*(?:"+ca+"[%]?)\\s*,\\s*(?:"+ca+"[%]?)(?:\\s*,\\s*(?:"+ca+"))?\\)",NE="hsl[a]?\\(("+ca+")\\s*,\\s*("+ca+"[%])\\s*,\\s*("+ca+"[%])(?:\\s*,\\s*("+ca+"))?\\)",ME="hsl[a]?\\((?:"+ca+")\\s*,\\s*(?:"+ca+"[%])\\s*,\\s*(?:"+ca+"[%])(?:\\s*,\\s*(?:"+ca+"))?\\)",RE="\\#[0-9a-fA-F]{3}",zE="\\#[0-9a-fA-F]{6}",Z1=function(e,a){return e<a?-1:e>a?1:0},OE=function(e,a){return-1*Z1(e,a)},Fe=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,a=1;a<e.length;a++){var n=e[a];if(n!=null)for(var l=Object.keys(n),u=0;u<l.length;u++){var o=l[u];t[o]=n[o]}}return t},LE=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var a=e.length===4,n,l,u,o=16;return a?(n=parseInt(e[1]+e[1],o),l=parseInt(e[2]+e[2],o),u=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),l=parseInt(e[3]+e[4],o),u=parseInt(e[5]+e[6],o)),[n,l,u]}},kE=function(e){var a,n,l,u,o,c,v,f;function h(b,E,S){return S<0&&(S+=1),S>1&&(S-=1),S<1/6?b+(E-b)*6*S:S<1/2?E:S<2/3?b+(E-b)*(2/3-S)*6:b}var g=new RegExp("^"+NE+"$").exec(e);if(g){if(n=parseInt(g[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,l=parseFloat(g[2]),l<0||l>100||(l=l/100,u=parseFloat(g[3]),u<0||u>100)||(u=u/100,o=g[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(l===0)c=v=f=Math.round(u*255);else{var m=u<.5?u*(1+l):u+l-u*l,x=2*u-m;c=Math.round(255*h(x,m,n+1/3)),v=Math.round(255*h(x,m,n)),f=Math.round(255*h(x,m,n-1/3))}a=[c,v,f,o]}return a},_E=function(e){var a,n=new RegExp("^"+DE+"$").exec(e);if(n){a=[];for(var l=[],u=1;u<=3;u++){var o=n[u];if(o[o.length-1]==="%"&&(l[u]=!0),o=parseFloat(o),l[u]&&(o=o/100*255),o<0||o>255)return;a.push(Math.floor(o))}var c=l[1]||l[2]||l[3],v=l[1]&&l[2]&&l[3];if(c&&!v)return;var f=n[4];if(f!==void 0){if(f=parseFloat(f),f<0||f>1)return;a.push(f)}}return a},qE=function(e){return VE[e.toLowerCase()]},Q1=function(e){return(kt(e)?e:null)||qE(e)||LE(e)||_E(e)||kE(e)},VE={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]},$1=function(e){for(var a=e.map,n=e.keys,l=n.length,u=0;u<l;u++){var o=n[u];if(yt(o))throw Error("Tried to set map with object key");u<n.length-1?(a[o]==null&&(a[o]={}),a=a[o]):a[o]=e.value}},W1=function(e){for(var a=e.map,n=e.keys,l=n.length,u=0;u<l;u++){var o=n[u];if(yt(o))throw Error("Tried to get map with object key");if(a=a[o],a==null)return a}return a},No=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ns(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fv,f0;function is(){if(f0)return Fv;f0=1;function t(e){var a=typeof e;return e!=null&&(a=="object"||a=="function")}return Fv=t,Fv}var Xv,v0;function UE(){if(v0)return Xv;v0=1;var t=typeof No=="object"&&No&&No.Object===Object&&No;return Xv=t,Xv}var Kv,d0;function hc(){if(d0)return Kv;d0=1;var t=UE(),e=typeof self=="object"&&self&&self.Object===Object&&self,a=t||e||Function("return this")();return Kv=a,Kv}var Zv,h0;function jE(){if(h0)return Zv;h0=1;var t=hc(),e=function(){return t.Date.now()};return Zv=e,Zv}var Qv,g0;function PE(){if(g0)return Qv;g0=1;var t=/\s/;function e(a){for(var n=a.length;n--&&t.test(a.charAt(n)););return n}return Qv=e,Qv}var $v,p0;function HE(){if(p0)return $v;p0=1;var t=PE(),e=/^\s+/;function a(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return $v=a,$v}var Wv,m0;function Xh(){if(m0)return Wv;m0=1;var t=hc(),e=t.Symbol;return Wv=e,Wv}var Jv,y0;function GE(){if(y0)return Jv;y0=1;var t=Xh(),e=Object.prototype,a=e.hasOwnProperty,n=e.toString,l=t?t.toStringTag:void 0;function u(o){var c=a.call(o,l),v=o[l];try{o[l]=void 0;var f=!0}catch{}var h=n.call(o);return f&&(c?o[l]=v:delete o[l]),h}return Jv=u,Jv}var ed,b0;function IE(){if(b0)return ed;b0=1;var t=Object.prototype,e=t.toString;function a(n){return e.call(n)}return ed=a,ed}var td,x0;function J1(){if(x0)return td;x0=1;var t=Xh(),e=GE(),a=IE(),n="[object Null]",l="[object Undefined]",u=t?t.toStringTag:void 0;function o(c){return c==null?c===void 0?l:n:u&&u in Object(c)?e(c):a(c)}return td=o,td}var ad,w0;function YE(){if(w0)return ad;w0=1;function t(e){return e!=null&&typeof e=="object"}return ad=t,ad}var rd,S0;function ls(){if(S0)return rd;S0=1;var t=J1(),e=YE(),a="[object Symbol]";function n(l){return typeof l=="symbol"||e(l)&&t(l)==a}return rd=n,rd}var nd,E0;function FE(){if(E0)return nd;E0=1;var t=HE(),e=is(),a=ls(),n=NaN,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function v(f){if(typeof f=="number")return f;if(a(f))return n;if(e(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=e(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=t(f);var g=u.test(f);return g||o.test(f)?c(f.slice(2),g?2:8):l.test(f)?n:+f}return nd=v,nd}var id,T0;function XE(){if(T0)return id;T0=1;var t=is(),e=jE(),a=FE(),n="Expected a function",l=Math.max,u=Math.min;function o(c,v,f){var h,g,m,x,b,E,S=0,w=!1,T=!1,C=!0;if(typeof c!="function")throw new TypeError(n);v=a(v)||0,t(f)&&(w=!!f.leading,T="maxWait"in f,m=T?l(a(f.maxWait)||0,v):m,C="trailing"in f?!!f.trailing:C);function B(H){var I=h,F=g;return h=g=void 0,S=H,x=c.apply(F,I),x}function R(H){return S=H,b=setTimeout(O,v),w?B(H):x}function L(H){var I=H-E,F=H-S,_=v-I;return T?u(_,m-F):_}function A(H){var I=H-E,F=H-S;return E===void 0||I>=v||I<0||T&&F>=m}function O(){var H=e();if(A(H))return z(H);b=setTimeout(O,L(H))}function z(H){return b=void 0,C&&h?B(H):(h=g=void 0,x)}function U(){b!==void 0&&clearTimeout(b),S=0,h=E=g=b=void 0}function V(){return b===void 0?x:z(e())}function P(){var H=e(),I=A(H);if(h=arguments,g=this,E=H,I){if(b===void 0)return R(E);if(T)return clearTimeout(b),b=setTimeout(O,v),B(E)}return b===void 0&&(b=setTimeout(O,v)),x}return P.cancel=U,P.flush=V,P}return id=o,id}var KE=XE(),us=ns(KE),ld=oa?oa.performance:null,ex=ld&&ld.now?function(){return ld.now()}:function(){return Date.now()},ZE=(function(){if(oa){if(oa.requestAnimationFrame)return function(t){oa.requestAnimationFrame(t)};if(oa.mozRequestAnimationFrame)return function(t){oa.mozRequestAnimationFrame(t)};if(oa.webkitRequestAnimationFrame)return function(t){oa.webkitRequestAnimationFrame(t)};if(oa.msRequestAnimationFrame)return function(t){oa.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(ex())},1e3/60)}})(),tc=function(e){return ZE(e)},rn=ex,Ei=9261,tx=65599,Cl=5381,ax=function(e){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ei,n=a,l;l=e.next(),!l.done;)n=n*tx+l.value|0;return n},Fu=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ei;return a*tx+e|0},Xu=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cl;return(a<<5)+a+e|0},QE=function(e,a){return e*2097152+a},_n=function(e){return e[0]*2097152+e[1]},Mo=function(e,a){return[Fu(e[0],a[0]),Xu(e[1],a[1])]},C0=function(e,a){var n={value:0,done:!1},l=0,u=e.length,o={next:function(){return l<u?n.value=e[l++]:n.done=!0,n}};return ax(o,a)},Ai=function(e,a){var n={value:0,done:!1},l=0,u=e.length,o={next:function(){return l<u?n.value=e.charCodeAt(l++):n.done=!0,n}};return ax(o,a)},rx=function(){return $E(arguments)},$E=function(e){for(var a,n=0;n<e.length;n++){var l=e[n];n===0?a=Ai(l):a=Ai(l,a)}return a};function WE(t,e,a,n,l){var u=l*Math.PI/180,o=Math.cos(u)*(t-a)-Math.sin(u)*(e-n)+a,c=Math.sin(u)*(t-a)+Math.cos(u)*(e-n)+n;return{x:o,y:c}}var JE=function(e,a,n,l,u,o){return{x:(e-n)*u+n,y:(a-l)*o+l}};function eT(t,e,a){if(a===0)return t;var n=(e.x1+e.x2)/2,l=(e.y1+e.y2)/2,u=e.w/e.h,o=1/u,c=WE(t.x,t.y,n,l,a),v=JE(c.x,c.y,n,l,u,o);return{x:v.x,y:v.y}}var A0=!0,tT=console.warn!=null,aT=console.trace!=null,Kh=Number.MAX_SAFE_INTEGER||9007199254740991,nx=function(){return!0},ac=function(){return!1},D0=function(){return 0},Zh=function(){},Yt=function(e){throw new Error(e)},ix=function(e){if(e!==void 0)A0=!!e;else return A0},Ct=function(e){ix()&&(tT?console.warn(e):(console.log(e),aT&&console.trace()))},rT=function(e){return Fe({},e)},Or=function(e){return e==null?e:kt(e)?e.slice():yt(e)?rT(e):e},nT=function(e){return e.slice()},lx=function(e,a){for(a=e="";e++<36;a+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return a},iT={},ux=function(){return iT},Ba=function(e){var a=Object.keys(e);return function(n){for(var l={},u=0;u<a.length;u++){var o=a[u],c=n?.[o];l[o]=c===void 0?e[o]:c}return l}},Yn=function(e,a,n){for(var l=e.length-1;l>=0;l--)e[l]===a&&e.splice(l,1)},Qh=function(e){e.splice(0,e.length)},lT=function(e,a){for(var n=0;n<a.length;n++){var l=a[n];e.push(l)}},Xa=function(e,a,n){return n&&(a=K1(n,a)),e[a]},tn=function(e,a,n,l){n&&(a=K1(n,a)),e[a]=l},uT=(function(){function t(){Qn(this,t),this._obj={}}return $n(t,[{key:"set",value:function(a,n){return this._obj[a]=n,this}},{key:"delete",value:function(a){return this._obj[a]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(a){return this._obj[a]!==void 0}},{key:"get",value:function(a){return this._obj[a]}}])})(),an=typeof Map<"u"?Map:uT,sT="undefined",oT=(function(){function t(e){if(Qn(this,t),this._obj=Object.create(null),this.size=0,e!=null){var a;e.instanceString!=null&&e.instanceString()===this.instanceString()?a=e.toArray():a=e;for(var n=0;n<a.length;n++)this.add(a[n])}}return $n(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(a){var n=this._obj;n[a]!==1&&(n[a]=1,this.size++)}},{key:"delete",value:function(a){var n=this._obj;n[a]===1&&(n[a]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(a){return this._obj[a]===1}},{key:"toArray",value:function(){var a=this;return Object.keys(this._obj).filter(function(n){return a.has(n)})}},{key:"forEach",value:function(a,n){return this.toArray().forEach(a,n)}}])})(),_l=(typeof Set>"u"?"undefined":fa(Set))!==sT?Set:oT,gc=function(e,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||a===void 0||!Yh(e)){Yt("An element must have a core reference and parameters set");return}var l=a.group;if(l==null&&(a.data&&a.data.source!=null&&a.data.target!=null?l="edges":l="nodes"),l!=="nodes"&&l!=="edges"){Yt("An element must be of type `nodes` or `edges`; you specified `"+l+"`");return}this.length=1,this[0]=this;var u=this._private={cy:e,single:!0,data:a.data||{},position:a.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:l,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!a.selected,selectable:a.selectable===void 0?!0:!!a.selectable,locked:!!a.locked,grabbed:!1,grabbable:a.grabbable===void 0?!0:!!a.grabbable,pannable:a.pannable===void 0?l==="edges":!!a.pannable,active:!1,classes:new _l,animation:{current:[],queue:[]},rscratch:{},scratch:a.scratch||{},edges:[],children:[],parent:a.parent&&a.parent.isNode()?a.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),a.renderedPosition){var o=a.renderedPosition,c=e.pan(),v=e.zoom();u.position={x:(o.x-c.x)/v,y:(o.y-c.y)/v}}var f=[];kt(a.classes)?f=a.classes:Ge(a.classes)&&(f=a.classes.split(/\s+/));for(var h=0,g=f.length;h<g;h++){var m=f[h];!m||m===""||u.classes.add(m)}this.createEmitter(),(n===void 0||n)&&this.restore();var x=a.style||a.css;x&&(Ct("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(x))},B0=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,l,u){var o;yt(n)&&!nr(n)&&(o=n,n=o.roots||o.root,l=o.visit,u=o.directed),u=arguments.length===2&&!Xt(l)?l:u,l=Xt(l)?l:function(){};for(var c=this._private.cy,v=n=Ge(n)?this.filter(n):n,f=[],h=[],g={},m={},x={},b=0,E,S=this.byGroup(),w=S.nodes,T=S.edges,C=0;C<v.length;C++){var B=v[C],R=B.id();B.isNode()&&(f.unshift(B),e.bfs&&(x[R]=!0,h.push(B)),m[R]=0)}for(var L=function(){var H=e.bfs?f.shift():f.pop(),I=H.id();if(e.dfs){if(x[I])return 0;x[I]=!0,h.push(H)}var F=m[I],_=g[I],j=_!=null?_.source():null,Y=_!=null?_.target():null,Q=_==null?void 0:H.same(j)?Y[0]:j[0],W;if(W=l(H,_,Q,b++,F),W===!0)return E=H,1;if(W===!1)return 1;for(var N=H.connectedEdges().filter(function(se){return(!u||se.source().same(H))&&T.has(se)}),G=0;G<N.length;G++){var Z=N[G],$=Z.connectedNodes().filter(function(se){return!se.same(H)&&w.has(se)}),ae=$.id();$.length!==0&&!x[ae]&&($=$[0],f.push($),e.bfs&&(x[ae]=!0,h.push($)),g[ae]=Z,m[ae]=m[I]+1)}},A;f.length!==0&&(A=L(),!(A!==0&&A===1)););for(var O=c.collection(),z=0;z<h.length;z++){var U=h[z],V=g[U.id()];V!=null&&O.push(V),O.push(U)}return{path:c.collection(O),found:c.collection(E)}}},Ku={breadthFirstSearch:B0({bfs:!0}),depthFirstSearch:B0({dfs:!0})};Ku.bfs=Ku.breadthFirstSearch;Ku.dfs=Ku.depthFirstSearch;var Ho={exports:{}},cT=Ho.exports,N0;function fT(){return N0||(N0=1,(function(t,e){(function(){var a,n,l,u,o,c,v,f,h,g,m,x,b,E,S;l=Math.floor,g=Math.min,n=function(w,T){return w<T?-1:w>T?1:0},h=function(w,T,C,B,R){var L;if(C==null&&(C=0),R==null&&(R=n),C<0)throw new Error("lo must be non-negative");for(B==null&&(B=w.length);C<B;)L=l((C+B)/2),R(T,w[L])<0?B=L:C=L+1;return[].splice.apply(w,[C,C-C].concat(T)),T},c=function(w,T,C){return C==null&&(C=n),w.push(T),E(w,0,w.length-1,C)},o=function(w,T){var C,B;return T==null&&(T=n),C=w.pop(),w.length?(B=w[0],w[0]=C,S(w,0,T)):B=C,B},f=function(w,T,C){var B;return C==null&&(C=n),B=w[0],w[0]=T,S(w,0,C),B},v=function(w,T,C){var B;return C==null&&(C=n),w.length&&C(w[0],T)<0&&(B=[w[0],T],T=B[0],w[0]=B[1],S(w,0,C)),T},u=function(w,T){var C,B,R,L,A,O;for(T==null&&(T=n),L=(function(){O=[];for(var z=0,U=l(w.length/2);0<=U?z<U:z>U;0<=U?z++:z--)O.push(z);return O}).apply(this).reverse(),A=[],B=0,R=L.length;B<R;B++)C=L[B],A.push(S(w,C,T));return A},b=function(w,T,C){var B;if(C==null&&(C=n),B=w.indexOf(T),B!==-1)return E(w,0,B,C),S(w,B,C)},m=function(w,T,C){var B,R,L,A,O;if(C==null&&(C=n),R=w.slice(0,T),!R.length)return R;for(u(R,C),O=w.slice(T),L=0,A=O.length;L<A;L++)B=O[L],v(R,B,C);return R.sort(C).reverse()},x=function(w,T,C){var B,R,L,A,O,z,U,V,P;if(C==null&&(C=n),T*10<=w.length){if(L=w.slice(0,T).sort(C),!L.length)return L;for(R=L[L.length-1],U=w.slice(T),A=0,z=U.length;A<z;A++)B=U[A],C(B,R)<0&&(h(L,B,0,null,C),L.pop(),R=L[L.length-1]);return L}for(u(w,C),P=[],O=0,V=g(T,w.length);0<=V?O<V:O>V;0<=V?++O:--O)P.push(o(w,C));return P},E=function(w,T,C,B){var R,L,A;for(B==null&&(B=n),R=w[C];C>T;){if(A=C-1>>1,L=w[A],B(R,L)<0){w[C]=L,C=A;continue}break}return w[C]=R},S=function(w,T,C){var B,R,L,A,O;for(C==null&&(C=n),R=w.length,O=T,L=w[T],B=2*T+1;B<R;)A=B+1,A<R&&!(C(w[B],w[A])<0)&&(B=A),w[T]=w[B],T=B,B=2*T+1;return w[T]=L,E(w,O,T,C)},a=(function(){w.push=c,w.pop=o,w.replace=f,w.pushpop=v,w.heapify=u,w.updateItem=b,w.nlargest=m,w.nsmallest=x;function w(T){this.cmp=T??n,this.nodes=[]}return w.prototype.push=function(T){return c(this.nodes,T,this.cmp)},w.prototype.pop=function(){return o(this.nodes,this.cmp)},w.prototype.peek=function(){return this.nodes[0]},w.prototype.contains=function(T){return this.nodes.indexOf(T)!==-1},w.prototype.replace=function(T){return f(this.nodes,T,this.cmp)},w.prototype.pushpop=function(T){return v(this.nodes,T,this.cmp)},w.prototype.heapify=function(){return u(this.nodes,this.cmp)},w.prototype.updateItem=function(T){return b(this.nodes,T,this.cmp)},w.prototype.clear=function(){return this.nodes=[]},w.prototype.empty=function(){return this.nodes.length===0},w.prototype.size=function(){return this.nodes.length},w.prototype.clone=function(){var T;return T=new w,T.nodes=this.nodes.slice(0),T},w.prototype.toArray=function(){return this.nodes.slice(0)},w.prototype.insert=w.prototype.push,w.prototype.top=w.prototype.peek,w.prototype.front=w.prototype.peek,w.prototype.has=w.prototype.contains,w.prototype.copy=w.prototype.clone,w})(),(function(w,T){return t.exports=T()})(this,function(){return a})}).call(cT)})(Ho)),Ho.exports}var ud,M0;function vT(){return M0||(M0=1,ud=fT()),ud}var dT=vT(),ss=ns(dT),hT=Ba({root:null,weight:function(e){return 1},directed:!1}),gT={dijkstra:function(e){if(!yt(e)){var a=arguments;e={root:a[0],weight:a[1],directed:a[2]}}var n=hT(e),l=n.root,u=n.weight,o=n.directed,c=this,v=u,f=Ge(l)?this.filter(l)[0]:l[0],h={},g={},m={},x=this.byGroup(),b=x.nodes,E=x.edges;E.unmergeBy(function(F){return F.isLoop()});for(var S=function(_){return h[_.id()]},w=function(_,j){h[_.id()]=j,T.updateItem(_)},T=new ss(function(F,_){return S(F)-S(_)}),C=0;C<b.length;C++){var B=b[C];h[B.id()]=B.same(f)?0:1/0,T.push(B)}for(var R=function(_,j){for(var Y=(o?_.edgesTo(j):_.edgesWith(j)).intersect(E),Q=1/0,W,N=0;N<Y.length;N++){var G=Y[N],Z=v(G);(Z<Q||!W)&&(Q=Z,W=G)}return{edge:W,dist:Q}};T.size()>0;){var L=T.pop(),A=S(L),O=L.id();if(m[O]=A,A!==1/0)for(var z=L.neighborhood().intersect(b),U=0;U<z.length;U++){var V=z[U],P=V.id(),H=R(L,V),I=A+H.dist;I<S(V)&&(w(V,I),g[P]={node:L,edge:H.edge})}}return{distanceTo:function(_){var j=Ge(_)?b.filter(_)[0]:_[0];return m[j.id()]},pathTo:function(_){var j=Ge(_)?b.filter(_)[0]:_[0],Y=[],Q=j,W=Q.id();if(j.length>0)for(Y.unshift(j);g[W];){var N=g[W];Y.unshift(N.edge),Y.unshift(N.node),Q=N.node,W=Q.id()}return c.spawn(Y)}}}},pT={kruskal:function(e){e=e||function(C){return 1};for(var a=this.byGroup(),n=a.nodes,l=a.edges,u=n.length,o=new Array(u),c=n,v=function(B){for(var R=0;R<o.length;R++){var L=o[R];if(L.has(B))return R}},f=0;f<u;f++)o[f]=this.spawn(n[f]);for(var h=l.sort(function(C,B){return e(C)-e(B)}),g=0;g<h.length;g++){var m=h[g],x=m.source()[0],b=m.target()[0],E=v(x),S=v(b),w=o[E],T=o[S];E!==S&&(c.merge(m),w.merge(T),o.splice(S,1))}return c}},mT=Ba({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),yT={aStar:function(e){var a=this.cy(),n=mT(e),l=n.root,u=n.goal,o=n.heuristic,c=n.directed,v=n.weight;l=a.collection(l)[0],u=a.collection(u)[0];var f=l.id(),h=u.id(),g={},m={},x={},b=new ss(function(W,N){return m[W.id()]-m[N.id()]}),E=new _l,S={},w={},T=function(N,G){b.push(N),E.add(G)},C,B,R=function(){C=b.pop(),B=C.id(),E.delete(B)},L=function(N){return E.has(N)};T(l,f),g[f]=0,m[f]=o(l);for(var A=0;b.size()>0;){if(R(),A++,B===h){for(var O=[],z=u,U=h,V=w[U];O.unshift(z),V!=null&&O.unshift(V),z=S[U],z!=null;)U=z.id(),V=w[U];return{found:!0,distance:g[B],path:this.spawn(O),steps:A}}x[B]=!0;for(var P=C._private.edges,H=0;H<P.length;H++){var I=P[H];if(this.hasElementWithId(I.id())&&!(c&&I.data("source")!==B)){var F=I.source(),_=I.target(),j=F.id()!==B?F:_,Y=j.id();if(this.hasElementWithId(Y)&&!x[Y]){var Q=g[B]+v(I);if(!L(Y)){g[Y]=Q,m[Y]=Q+o(j),T(j,Y),S[Y]=C,w[Y]=I;continue}Q<g[Y]&&(g[Y]=Q,m[Y]=Q+o(j),S[Y]=C,w[Y]=I)}}}}return{found:!1,distance:void 0,path:void 0,steps:A}}},bT=Ba({weight:function(e){return 1},directed:!1}),xT={floydWarshall:function(e){for(var a=this.cy(),n=bT(e),l=n.weight,u=n.directed,o=l,c=this.byGroup(),v=c.nodes,f=c.edges,h=v.length,g=h*h,m=function(Z){return v.indexOf(Z)},x=function(Z){return v[Z]},b=new Array(g),E=0;E<g;E++){var S=E%h,w=(E-S)/h;w===S?b[E]=0:b[E]=1/0}for(var T=new Array(g),C=new Array(g),B=0;B<f.length;B++){var R=f[B],L=R.source()[0],A=R.target()[0];if(L!==A){var O=m(L),z=m(A),U=O*h+z,V=o(R);if(b[U]>V&&(b[U]=V,T[U]=z,C[U]=R),!u){var P=z*h+O;!u&&b[P]>V&&(b[P]=V,T[P]=O,C[P]=R)}}}for(var H=0;H<h;H++)for(var I=0;I<h;I++)for(var F=I*h+H,_=0;_<h;_++){var j=I*h+_,Y=H*h+_;b[F]+b[Y]<b[j]&&(b[j]=b[F]+b[Y],T[j]=T[F])}var Q=function(Z){return(Ge(Z)?a.filter(Z):Z)[0]},W=function(Z){return m(Q(Z))},N={distance:function(Z,$){var ae=W(Z),se=W($);return b[ae*h+se]},path:function(Z,$){var ae=W(Z),se=W($),de=x(ae);if(ae===se)return de.collection();if(T[ae*h+se]==null)return a.collection();var Se=a.collection(),fe=ae,te;for(Se.merge(de);ae!==se;)fe=ae,ae=T[ae*h+se],te=C[fe*h+ae],Se.merge(te),Se.merge(x(ae));return Se}};return N}},wT=Ba({weight:function(e){return 1},directed:!1,root:null}),ST={bellmanFord:function(e){var a=this,n=wT(e),l=n.weight,u=n.directed,o=n.root,c=l,v=this,f=this.cy(),h=this.byGroup(),g=h.edges,m=h.nodes,x=m.length,b=new an,E=!1,S=[];o=f.collection(o)[0],g.unmergeBy(function(Xe){return Xe.isLoop()});for(var w=g.length,T=function(He){var Ue=b.get(He.id());return Ue||(Ue={},b.set(He.id(),Ue)),Ue},C=function(He){return(Ge(He)?f.$(He):He)[0]},B=function(He){return T(C(He)).dist},R=function(He){for(var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,Ae=C(He),Ve=[],Pe=Ae;;){if(Pe==null)return a.spawn();var Qe=T(Pe),Be=Qe.edge,et=Qe.pred;if(Ve.unshift(Pe[0]),Pe.same(Ue)&&Ve.length>0)break;Be!=null&&Ve.unshift(Be),Pe=et}return v.spawn(Ve)},L=0;L<x;L++){var A=m[L],O=T(A);A.same(o)?O.dist=0:O.dist=1/0,O.pred=null,O.edge=null}for(var z=!1,U=function(He,Ue,Ae,Ve,Pe,Qe){var Be=Ve.dist+Qe;Be<Pe.dist&&!Ae.same(Ve.edge)&&(Pe.dist=Be,Pe.pred=He,Pe.edge=Ae,z=!0)},V=1;V<x;V++){z=!1;for(var P=0;P<w;P++){var H=g[P],I=H.source(),F=H.target(),_=c(H),j=T(I),Y=T(F);U(I,F,H,j,Y,_),u||U(F,I,H,Y,j,_)}if(!z)break}if(z)for(var Q=[],W=0;W<w;W++){var N=g[W],G=N.source(),Z=N.target(),$=c(N),ae=T(G).dist,se=T(Z).dist;if(ae+$<se||!u&&se+$<ae)if(E||(Ct("Graph contains a negative weight cycle for Bellman-Ford"),E=!0),e.findNegativeWeightCycles!==!1){var de=[];ae+$<se&&de.push(G),!u&&se+$<ae&&de.push(Z);for(var Se=de.length,fe=0;fe<Se;fe++){var te=de[fe],re=[te];re.push(T(te).edge);for(var le=T(te).pred;re.indexOf(le)===-1;)re.push(le),re.push(T(le).edge),le=T(le).pred;re=re.slice(re.indexOf(le));for(var he=re[0].id(),Ee=0,ke=2;ke<re.length;ke+=2)re[ke].id()<he&&(he=re[ke].id(),Ee=ke);re=re.slice(Ee).concat(re.slice(0,Ee)),re.push(re[0]);var at=re.map(function(Xe){return Xe.id()}).join(",");Q.indexOf(at)===-1&&(S.push(v.spawn(re)),Q.push(at))}}else break}return{distanceTo:B,pathTo:R,hasNegativeWeightCycle:E,negativeWeightCycles:S}}},ET=Math.sqrt(2),TT=function(e,a,n){n.length===0&&Yt("Karger-Stein must be run on a connected (sub)graph");for(var l=n[e],u=l[1],o=l[2],c=a[u],v=a[o],f=n,h=f.length-1;h>=0;h--){var g=f[h],m=g[1],x=g[2];(a[m]===c&&a[x]===v||a[m]===v&&a[x]===c)&&f.splice(h,1)}for(var b=0;b<f.length;b++){var E=f[b];E[1]===v?(f[b]=E.slice(),f[b][1]=c):E[2]===v&&(f[b]=E.slice(),f[b][2]=c)}for(var S=0;S<a.length;S++)a[S]===v&&(a[S]=c);return f},sd=function(e,a,n,l){for(;n>l;){var u=Math.floor(Math.random()*a.length);a=TT(u,e,a),n--}return a},CT={kargerStein:function(){var e=this,a=this.byGroup(),n=a.nodes,l=a.edges;l.unmergeBy(function(Y){return Y.isLoop()});var u=n.length,o=l.length,c=Math.ceil(Math.pow(Math.log(u)/Math.LN2,2)),v=Math.floor(u/ET);if(u<2){Yt("At least 2 nodes are required for Karger-Stein algorithm");return}for(var f=[],h=0;h<o;h++){var g=l[h];f.push([h,n.indexOf(g.source()),n.indexOf(g.target())])}for(var m=1/0,x=[],b=new Array(u),E=new Array(u),S=new Array(u),w=function(Q,W){for(var N=0;N<u;N++)W[N]=Q[N]},T=0;T<=c;T++){for(var C=0;C<u;C++)E[C]=C;var B=sd(E,f.slice(),u,v),R=B.slice();w(E,S);var L=sd(E,B,v,2),A=sd(S,R,v,2);L.length<=A.length&&L.length<m?(m=L.length,x=L,w(E,b)):A.length<=L.length&&A.length<m&&(m=A.length,x=A,w(S,b))}for(var O=this.spawn(x.map(function(Y){return l[Y[0]]})),z=this.spawn(),U=this.spawn(),V=b[0],P=0;P<b.length;P++){var H=b[P],I=n[P];H===V?z.merge(I):U.merge(I)}var F=function(Q){var W=e.spawn();return Q.forEach(function(N){W.merge(N),N.connectedEdges().forEach(function(G){e.contains(G)&&!O.contains(G)&&W.merge(G)})}),W},_=[F(z),F(U)],j={cut:O,components:_,partition1:z,partition2:U};return j}},od,AT=function(e){return{x:e.x,y:e.y}},pc=function(e,a,n){return{x:e.x*a+n.x,y:e.y*a+n.y}},sx=function(e,a,n){return{x:(e.x-n.x)/a,y:(e.y-n.y)/a}},Al=function(e){return{x:e[0],y:e[1]}},DT=function(e){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,l=1/0,u=a;u<n;u++){var o=e[u];isFinite(o)&&(l=Math.min(o,l))}return l},BT=function(e){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,l=-1/0,u=a;u<n;u++){var o=e[u];isFinite(o)&&(l=Math.max(o,l))}return l},NT=function(e){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,l=0,u=0,o=a;o<n;o++){var c=e[o];isFinite(c)&&(l+=c,u++)}return l/u},MT=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,l=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;l?e=e.slice(a,n):(n<e.length&&e.splice(n,e.length-n),a>0&&e.splice(0,a));for(var c=0,v=e.length-1;v>=0;v--){var f=e[v];o?isFinite(f)||(e[v]=-1/0,c++):e.splice(v,1)}u&&e.sort(function(m,x){return m-x});var h=e.length,g=Math.floor(h/2);return h%2!==0?e[g+1+c]:(e[g-1+c]+e[g+c])/2},RT=function(e){return Math.PI*e/180},Ro=function(e,a){return Math.atan2(a,e)-Math.PI/2},$h=Math.log2||function(t){return Math.log(t)/Math.log(2)},Wh=function(e){return e>0?1:e<0?-1:0},Di=function(e,a){return Math.sqrt(wi(e,a))},wi=function(e,a){var n=a.x-e.x,l=a.y-e.y;return n*n+l*l},zT=function(e){for(var a=e.length,n=0,l=0;l<a;l++)n+=e[l];for(var u=0;u<a;u++)e[u]=e[u]/n;return e},ba=function(e,a,n,l){return(1-l)*(1-l)*e+2*(1-l)*l*a+l*l*n},Nl=function(e,a,n,l){return{x:ba(e.x,a.x,n.x,l),y:ba(e.y,a.y,n.y,l)}},OT=function(e,a,n,l){var u={x:a.x-e.x,y:a.y-e.y},o=Di(e,a),c={x:u.x/o,y:u.y/o};return n=n??0,l=l??n*o,{x:e.x+c.x*l,y:e.y+c.y*l}},Zu=function(e,a,n){return Math.max(e,Math.min(n,a))},Va=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},LT=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},kT=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},_T=function(e,a){e.x1=Math.min(e.x1,a.x1),e.x2=Math.max(e.x2,a.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a.y1),e.y2=Math.max(e.y2,a.y2),e.h=e.y2-e.y1},ox=function(e,a,n){e.x1=Math.min(e.x1,a),e.x2=Math.max(e.x2,a),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},Go=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=a,e.x2+=a,e.y1-=a,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Io=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,l,u,o;if(a.length===1)n=l=u=o=a[0];else if(a.length===2)n=u=a[0],o=l=a[1];else if(a.length===4){var c=la(a,4);n=c[0],l=c[1],u=c[2],o=c[3]}return e.x1-=o,e.x2+=l,e.y1-=n,e.y2+=u,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},R0=function(e,a){e.x1=a.x1,e.y1=a.y1,e.x2=a.x2,e.y2=a.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Jh=function(e,a){return!(e.x1>a.x2||a.x1>e.x2||e.x2<a.x1||a.x2<e.x1||e.y2<a.y1||a.y2<e.y1||e.y1>a.y2||a.y1>e.y2)},jn=function(e,a,n){return e.x1<=a&&a<=e.x2&&e.y1<=n&&n<=e.y2},z0=function(e,a){return jn(e,a.x,a.y)},cx=function(e,a){return jn(e,a.x1,a.y1)&&jn(e,a.x2,a.y2)},qT=(od=Math.hypot)!==null&&od!==void 0?od:function(t,e){return Math.sqrt(t*t+e*e)};function VT(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var a=function(O,z){return{x:O.x+z.x,y:O.y+z.y}},n=function(O,z){return{x:O.x-z.x,y:O.y-z.y}},l=function(O,z){return{x:O.x*z,y:O.y*z}},u=function(O,z){return O.x*z.y-O.y*z.x},o=function(O){var z=qT(O.x,O.y);return z===0?{x:0,y:0}:{x:O.x/z,y:O.y/z}},c=function(O){for(var z=0,U=0;U<O.length;U++){var V=O[U],P=O[(U+1)%O.length];z+=V.x*P.y-P.x*V.y}return z/2},v=function(O,z,U,V){var P=n(z,O),H=n(V,U),I=u(P,H);if(Math.abs(I)<1e-9)return a(O,l(P,.5));var F=u(n(U,O),H)/I;return a(O,l(P,F))},f=t.map(function(A){return{x:A.x,y:A.y}});c(f)<0&&f.reverse();for(var h=f.length,g=[],m=0;m<h;m++){var x=f[m],b=f[(m+1)%h],E=n(b,x),S=o({x:E.y,y:-E.x});g.push(S)}for(var w=g.map(function(A,O){var z=a(f[O],l(A,e)),U=a(f[(O+1)%h],l(A,e));return{p1:z,p2:U}}),T=[],C=0;C<h;C++){var B=w[(C-1+h)%h],R=w[C],L=v(B.p1,B.p2,R.p1,R.p2);T.push(L)}return T}function UT(t,e,a,n,l,u){var o=KT(t,e,a,n,l),c=VT(o,u),v=Va();return c.forEach(function(f){return ox(v,f.x,f.y)}),v}var fx=function(e,a,n,l,u,o,c){var v=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",f=v==="auto"?Fn(u,o):v,h=u/2,g=o/2;f=Math.min(f,h,g);var m=f!==h,x=f!==g,b;if(m){var E=n-h+f-c,S=l-g-c,w=n+h-f+c,T=S;if(b=Pn(e,a,n,l,E,S,w,T,!1),b.length>0)return b}if(x){var C=n+h+c,B=l-g+f-c,R=C,L=l+g-f+c;if(b=Pn(e,a,n,l,C,B,R,L,!1),b.length>0)return b}if(m){var A=n-h+f-c,O=l+g+c,z=n+h-f+c,U=O;if(b=Pn(e,a,n,l,A,O,z,U,!1),b.length>0)return b}if(x){var V=n-h-c,P=l-g+f-c,H=V,I=l+g-f+c;if(b=Pn(e,a,n,l,V,P,H,I,!1),b.length>0)return b}var F;{var _=n-h+f,j=l-g+f;if(F=ju(e,a,n,l,_,j,f+c),F.length>0&&F[0]<=_&&F[1]<=j)return[F[0],F[1]]}{var Y=n+h-f,Q=l-g+f;if(F=ju(e,a,n,l,Y,Q,f+c),F.length>0&&F[0]>=Y&&F[1]<=Q)return[F[0],F[1]]}{var W=n+h-f,N=l+g-f;if(F=ju(e,a,n,l,W,N,f+c),F.length>0&&F[0]>=W&&F[1]>=N)return[F[0],F[1]]}{var G=n-h+f,Z=l+g-f;if(F=ju(e,a,n,l,G,Z,f+c),F.length>0&&F[0]<=G&&F[1]>=Z)return[F[0],F[1]]}return[]},jT=function(e,a,n,l,u,o,c){var v=c,f=Math.min(n,u),h=Math.max(n,u),g=Math.min(l,o),m=Math.max(l,o);return f-v<=e&&e<=h+v&&g-v<=a&&a<=m+v},PT=function(e,a,n,l,u,o,c,v,f){var h={x1:Math.min(n,c,u)-f,x2:Math.max(n,c,u)+f,y1:Math.min(l,v,o)-f,y2:Math.max(l,v,o)+f};return!(e<h.x1||e>h.x2||a<h.y1||a>h.y2)},HT=function(e,a,n,l){n-=l;var u=a*a-4*e*n;if(u<0)return[];var o=Math.sqrt(u),c=2*e,v=(-a+o)/c,f=(-a-o)/c;return[v,f]},GT=function(e,a,n,l,u){var o=1e-5;e===0&&(e=o),a/=e,n/=e,l/=e;var c,v,f,h,g,m,x,b;if(v=(3*n-a*a)/9,f=-(27*l)+a*(9*n-2*(a*a)),f/=54,c=v*v*v+f*f,u[1]=0,x=a/3,c>0){g=f+Math.sqrt(c),g=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),m=f-Math.sqrt(c),m=m<0?-Math.pow(-m,1/3):Math.pow(m,1/3),u[0]=-x+g+m,x+=(g+m)/2,u[4]=u[2]=-x,x=Math.sqrt(3)*(-m+g)/2,u[3]=x,u[5]=-x;return}if(u[5]=u[3]=0,c===0){b=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),u[0]=-x+2*b,u[4]=u[2]=-(b+x);return}v=-v,h=v*v*v,h=Math.acos(f/Math.sqrt(h)),b=2*Math.sqrt(v),u[0]=-x+b*Math.cos(h/3),u[2]=-x+b*Math.cos((h+2*Math.PI)/3),u[4]=-x+b*Math.cos((h+4*Math.PI)/3)},IT=function(e,a,n,l,u,o,c,v){var f=1*n*n-4*n*u+2*n*c+4*u*u-4*u*c+c*c+l*l-4*l*o+2*l*v+4*o*o-4*o*v+v*v,h=9*n*u-3*n*n-3*n*c-6*u*u+3*u*c+9*l*o-3*l*l-3*l*v-6*o*o+3*o*v,g=3*n*n-6*n*u+n*c-n*e+2*u*u+2*u*e-c*e+3*l*l-6*l*o+l*v-l*a+2*o*o+2*o*a-v*a,m=1*n*u-n*n+n*e-u*e+l*o-l*l+l*a-o*a,x=[];GT(f,h,g,m,x);for(var b=1e-7,E=[],S=0;S<6;S+=2)Math.abs(x[S+1])<b&&x[S]>=0&&x[S]<=1&&E.push(x[S]);E.push(1),E.push(0);for(var w=-1,T,C,B,R=0;R<E.length;R++)T=Math.pow(1-E[R],2)*n+2*(1-E[R])*E[R]*u+E[R]*E[R]*c,C=Math.pow(1-E[R],2)*l+2*(1-E[R])*E[R]*o+E[R]*E[R]*v,B=Math.pow(T-e,2)+Math.pow(C-a,2),w>=0?B<w&&(w=B):w=B;return w},YT=function(e,a,n,l,u,o){var c=[e-n,a-l],v=[u-n,o-l],f=v[0]*v[0]+v[1]*v[1],h=c[0]*c[0]+c[1]*c[1],g=c[0]*v[0]+c[1]*v[1],m=g*g/f;return g<0?h:m>f?(e-u)*(e-u)+(a-o)*(a-o):h-m},Ka=function(e,a,n){for(var l,u,o,c,v,f=0,h=0;h<n.length/2;h++)if(l=n[h*2],u=n[h*2+1],h+1<n.length/2?(o=n[(h+1)*2],c=n[(h+1)*2+1]):(o=n[(h+1-n.length/2)*2],c=n[(h+1-n.length/2)*2+1]),!(l==e&&o==e))if(l>=e&&e>=o||l<=e&&e<=o)v=(e-l)/(o-l)*(c-u)+u,v>a&&f++;else continue;return f%2!==0},nn=function(e,a,n,l,u,o,c,v,f){var h=new Array(n.length),g;v[0]!=null?(g=Math.atan(v[1]/v[0]),v[0]<0?g=g+Math.PI/2:g=-g-Math.PI/2):g=v;for(var m=Math.cos(-g),x=Math.sin(-g),b=0;b<h.length/2;b++)h[b*2]=o/2*(n[b*2]*m-n[b*2+1]*x),h[b*2+1]=c/2*(n[b*2+1]*m+n[b*2]*x),h[b*2]+=l,h[b*2+1]+=u;var E;if(f>0){var S=nc(h,-f);E=rc(S)}else E=h;return Ka(e,a,E)},FT=function(e,a,n,l,u,o,c,v){for(var f=new Array(n.length*2),h=0;h<v.length;h++){var g=v[h];f[h*4+0]=g.startX,f[h*4+1]=g.startY,f[h*4+2]=g.stopX,f[h*4+3]=g.stopY;var m=Math.pow(g.cx-e,2)+Math.pow(g.cy-a,2);if(m<=Math.pow(g.radius,2))return!0}return Ka(e,a,f)},rc=function(e){for(var a=new Array(e.length/2),n,l,u,o,c,v,f,h,g=0;g<e.length/4;g++){n=e[g*4],l=e[g*4+1],u=e[g*4+2],o=e[g*4+3],g<e.length/4-1?(c=e[(g+1)*4],v=e[(g+1)*4+1],f=e[(g+1)*4+2],h=e[(g+1)*4+3]):(c=e[0],v=e[1],f=e[2],h=e[3]);var m=Pn(n,l,u,o,c,v,f,h,!0);a[g*2]=m[0],a[g*2+1]=m[1]}return a},nc=function(e,a){for(var n=new Array(e.length*2),l,u,o,c,v=0;v<e.length/2;v++){l=e[v*2],u=e[v*2+1],v<e.length/2-1?(o=e[(v+1)*2],c=e[(v+1)*2+1]):(o=e[0],c=e[1]);var f=c-u,h=-(o-l),g=Math.sqrt(f*f+h*h),m=f/g,x=h/g;n[v*4]=l+m*a,n[v*4+1]=u+x*a,n[v*4+2]=o+m*a,n[v*4+3]=c+x*a}return n},XT=function(e,a,n,l,u,o){var c=n-e,v=l-a;c/=u,v/=o;var f=Math.sqrt(c*c+v*v),h=f-1;if(h<0)return[];var g=h/f;return[(n-e)*g+e,(l-a)*g+a]},Ci=function(e,a,n,l,u,o,c){return e-=u,a-=o,e/=n/2+c,a/=l/2+c,e*e+a*a<=1},ju=function(e,a,n,l,u,o,c){var v=[n-e,l-a],f=[e-u,a-o],h=v[0]*v[0]+v[1]*v[1],g=2*(f[0]*v[0]+f[1]*v[1]),m=f[0]*f[0]+f[1]*f[1]-c*c,x=g*g-4*h*m;if(x<0)return[];var b=(-g+Math.sqrt(x))/(2*h),E=(-g-Math.sqrt(x))/(2*h),S=Math.min(b,E),w=Math.max(b,E),T=[];if(S>=0&&S<=1&&T.push(S),w>=0&&w<=1&&T.push(w),T.length===0)return[];var C=T[0]*v[0]+e,B=T[0]*v[1]+a;if(T.length>1){if(T[0]==T[1])return[C,B];var R=T[1]*v[0]+e,L=T[1]*v[1]+a;return[C,B,R,L]}else return[C,B]},cd=function(e,a,n){return a<=e&&e<=n||n<=e&&e<=a?e:e<=a&&a<=n||n<=a&&a<=e?a:n},Pn=function(e,a,n,l,u,o,c,v,f){var h=e-u,g=n-e,m=c-u,x=a-o,b=l-a,E=v-o,S=m*x-E*h,w=g*x-b*h,T=E*g-m*b;if(T!==0){var C=S/T,B=w/T,R=.001,L=0-R,A=1+R;return L<=C&&C<=A&&L<=B&&B<=A?[e+C*g,a+C*b]:f?[e+C*g,a+C*b]:[]}else return S===0||w===0?cd(e,n,c)===c?[c,v]:cd(e,n,u)===u?[u,o]:cd(u,c,n)===n?[n,l]:[]:[]},KT=function(e,a,n,l,u){var o=[],c=l/2,v=u/2,f=a,h=n;o.push({x:f+c*e[0],y:h+v*e[1]});for(var g=1;g<e.length/2;g++)o.push({x:f+c*e[g*2],y:h+v*e[g*2+1]});return o},Qu=function(e,a,n,l,u,o,c,v){var f=[],h,g=new Array(n.length),m=!0;o==null&&(m=!1);var x;if(m){for(var b=0;b<g.length/2;b++)g[b*2]=n[b*2]*o+l,g[b*2+1]=n[b*2+1]*c+u;if(v>0){var E=nc(g,-v);x=rc(E)}else x=g}else x=n;for(var S,w,T,C,B=0;B<x.length/2;B++)S=x[B*2],w=x[B*2+1],B<x.length/2-1?(T=x[(B+1)*2],C=x[(B+1)*2+1]):(T=x[0],C=x[1]),h=Pn(e,a,l,u,S,w,T,C),h.length!==0&&f.push(h[0],h[1]);return f},ZT=function(e,a,n,l,u,o,c,v,f){var h=[],g,m=new Array(n.length*2);f.forEach(function(T,C){C===0?(m[m.length-2]=T.startX,m[m.length-1]=T.startY):(m[C*4-2]=T.startX,m[C*4-1]=T.startY),m[C*4]=T.stopX,m[C*4+1]=T.stopY,g=ju(e,a,l,u,T.cx,T.cy,T.radius),g.length!==0&&h.push(g[0],g[1])});for(var x=0;x<m.length/4;x++)g=Pn(e,a,l,u,m[x*4],m[x*4+1],m[x*4+2],m[x*4+3],!1),g.length!==0&&h.push(g[0],g[1]);if(h.length>2){for(var b=[h[0],h[1]],E=Math.pow(b[0]-e,2)+Math.pow(b[1]-a,2),S=1;S<h.length/2;S++){var w=Math.pow(h[S*2]-e,2)+Math.pow(h[S*2+1]-a,2);w<=E&&(b[0]=h[S*2],b[1]=h[S*2+1],E=w)}return b}return h},zo=function(e,a,n){var l=[e[0]-a[0],e[1]-a[1]],u=Math.sqrt(l[0]*l[0]+l[1]*l[1]),o=(u-n)/u;return o<0&&(o=1e-5),[a[0]+o*l[0],a[1]+o*l[1]]},qa=function(e,a){var n=Eh(e,a);return n=vx(n),n},vx=function(e){for(var a,n,l=e.length/2,u=1/0,o=1/0,c=-1/0,v=-1/0,f=0;f<l;f++)a=e[2*f],n=e[2*f+1],u=Math.min(u,a),c=Math.max(c,a),o=Math.min(o,n),v=Math.max(v,n);for(var h=2/(c-u),g=2/(v-o),m=0;m<l;m++)a=e[2*m]=e[2*m]*h,n=e[2*m+1]=e[2*m+1]*g,u=Math.min(u,a),c=Math.max(c,a),o=Math.min(o,n),v=Math.max(v,n);if(o<-1)for(var x=0;x<l;x++)n=e[2*x+1]=e[2*x+1]+(-1-o);return e},Eh=function(e,a){var n=1/e*2*Math.PI,l=e%2===0?Math.PI/2+n/2:Math.PI/2;l+=a;for(var u=new Array(e*2),o,c=0;c<e;c++)o=c*n+l,u[2*c]=Math.cos(o),u[2*c+1]=Math.sin(-o);return u},Fn=function(e,a){return Math.min(e/4,a/4,8)},dx=function(e,a){return Math.min(e/10,a/10,8)},eg=function(){return 8},QT=function(e,a,n){return[e-2*a+n,2*(a-e),e]},Th=function(e,a){return{heightOffset:Math.min(15,.05*a),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function fd(t,e){function a(g){for(var m=[],x=0;x<g.length;x++){var b=g[x],E=g[(x+1)%g.length],S={x:E.x-b.x,y:E.y-b.y},w={x:-S.y,y:S.x},T=Math.sqrt(w.x*w.x+w.y*w.y);m.push({x:w.x/T,y:w.y/T})}return m}function n(g,m){var x=1/0,b=-1/0,E=Za(g),S;try{for(E.s();!(S=E.n()).done;){var w=S.value,T=w.x*m.x+w.y*m.y;x=Math.min(x,T),b=Math.max(b,T)}}catch(C){E.e(C)}finally{E.f()}return{min:x,max:b}}function l(g,m){return!(g.max<m.min||m.max<g.min)}var u=[].concat(Jo(a(t)),Jo(a(e))),o=Za(u),c;try{for(o.s();!(c=o.n()).done;){var v=c.value,f=n(t,v),h=n(e,v);if(!l(f,h))return!1}}catch(g){o.e(g)}finally{o.f()}return!0}var $T=Ba({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),WT={pageRank:function(e){for(var a=$T(e),n=a.dampingFactor,l=a.precision,u=a.iterations,o=a.weight,c=this._private.cy,v=this.byGroup(),f=v.nodes,h=v.edges,g=f.length,m=g*g,x=h.length,b=new Array(m),E=new Array(g),S=(1-n)/g,w=0;w<g;w++){for(var T=0;T<g;T++){var C=w*g+T;b[C]=0}E[w]=0}for(var B=0;B<x;B++){var R=h[B],L=R.data("source"),A=R.data("target");if(L!==A){var O=f.indexOfId(L),z=f.indexOfId(A),U=o(R),V=z*g+O;b[V]+=U,E[O]+=U}}for(var P=1/g+S,H=0;H<g;H++)if(E[H]===0)for(var I=0;I<g;I++){var F=I*g+H;b[F]=P}else for(var _=0;_<g;_++){var j=_*g+H;b[j]=b[j]/E[H]+S}for(var Y=new Array(g),Q=new Array(g),W,N=0;N<g;N++)Y[N]=1;for(var G=0;G<u;G++){for(var Z=0;Z<g;Z++)Q[Z]=0;for(var $=0;$<g;$++)for(var ae=0;ae<g;ae++){var se=$*g+ae;Q[$]+=b[se]*Y[ae]}zT(Q),W=Y,Y=Q,Q=W;for(var de=0,Se=0;Se<g;Se++){var fe=W[Se]-Y[Se];de+=fe*fe}if(de<l)break}var te={rank:function(le){return le=c.collection(le)[0],Y[f.indexOf(le)]}};return te}},O0=Ba({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ml={degreeCentralityNormalized:function(e){e=O0(e);var a=this.cy(),n=this.nodes(),l=n.length;if(e.directed){for(var h={},g={},m=0,x=0,b=0;b<l;b++){var E=n[b],S=E.id();e.root=E;var w=this.degreeCentrality(e);m<w.indegree&&(m=w.indegree),x<w.outdegree&&(x=w.outdegree),h[S]=w.indegree,g[S]=w.outdegree}return{indegree:function(C){return m==0?0:(Ge(C)&&(C=a.filter(C)),h[C.id()]/m)},outdegree:function(C){return x===0?0:(Ge(C)&&(C=a.filter(C)),g[C.id()]/x)}}}else{for(var u={},o=0,c=0;c<l;c++){var v=n[c];e.root=v;var f=this.degreeCentrality(e);o<f.degree&&(o=f.degree),u[v.id()]=f.degree}return{degree:function(C){return o===0?0:(Ge(C)&&(C=a.filter(C)),u[C.id()]/o)}}}},degreeCentrality:function(e){e=O0(e);var a=this.cy(),n=this,l=e,u=l.root,o=l.weight,c=l.directed,v=l.alpha;if(u=a.collection(u)[0],c){for(var x=u.connectedEdges(),b=x.filter(function(L){return L.target().same(u)&&n.has(L)}),E=x.filter(function(L){return L.source().same(u)&&n.has(L)}),S=b.length,w=E.length,T=0,C=0,B=0;B<b.length;B++)T+=o(b[B]);for(var R=0;R<E.length;R++)C+=o(E[R]);return{indegree:Math.pow(S,1-v)*Math.pow(T,v),outdegree:Math.pow(w,1-v)*Math.pow(C,v)}}else{for(var f=u.connectedEdges().intersection(n),h=f.length,g=0,m=0;m<f.length;m++)g+=o(f[m]);return{degree:Math.pow(h,1-v)*Math.pow(g,v)}}}};Ml.dc=Ml.degreeCentrality;Ml.dcn=Ml.degreeCentralityNormalised=Ml.degreeCentralityNormalized;var L0=Ba({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Rl={closenessCentralityNormalized:function(e){for(var a=L0(e),n=a.harmonic,l=a.weight,u=a.directed,o=this.cy(),c={},v=0,f=this.nodes(),h=this.floydWarshall({weight:l,directed:u}),g=0;g<f.length;g++){for(var m=0,x=f[g],b=0;b<f.length;b++)if(g!==b){var E=h.distance(x,f[b]);n?m+=1/E:m+=E}n||(m=1/m),v<m&&(v=m),c[x.id()]=m}return{closeness:function(w){return v==0?0:(Ge(w)?w=o.filter(w)[0].id():w=w.id(),c[w]/v)}}},closenessCentrality:function(e){var a=L0(e),n=a.root,l=a.weight,u=a.directed,o=a.harmonic;n=this.filter(n)[0];for(var c=this.dijkstra({root:n,weight:l,directed:u}),v=0,f=this.nodes(),h=0;h<f.length;h++){var g=f[h];if(!g.same(n)){var m=c.distanceTo(g);o?v+=1/m:v+=m}}return o?v:1/v}};Rl.cc=Rl.closenessCentrality;Rl.ccn=Rl.closenessCentralityNormalised=Rl.closenessCentralityNormalized;var JT=Ba({weight:null,directed:!1}),Ch={betweennessCentrality:function(e){for(var a=JT(e),n=a.directed,l=a.weight,u=l!=null,o=this.cy(),c=this.nodes(),v={},f={},h=0,g={set:function(C,B){f[C]=B,B>h&&(h=B)},get:function(C){return f[C]}},m=0;m<c.length;m++){var x=c[m],b=x.id();n?v[b]=x.outgoers().nodes():v[b]=x.openNeighborhood().nodes(),g.set(b,0)}for(var E=function(){for(var C=c[S].id(),B=[],R={},L={},A={},O=new ss(function($,ae){return A[$]-A[ae]}),z=0;z<c.length;z++){var U=c[z].id();R[U]=[],L[U]=0,A[U]=1/0}for(L[C]=1,A[C]=0,O.push(C);!O.empty();){var V=O.pop();if(B.push(V),u)for(var P=0;P<v[V].length;P++){var H=v[V][P],I=o.getElementById(V),F=void 0;I.edgesTo(H).length>0?F=I.edgesTo(H)[0]:F=H.edgesTo(I)[0];var _=l(F);H=H.id(),A[H]>A[V]+_&&(A[H]=A[V]+_,O.nodes.indexOf(H)<0?O.push(H):O.updateItem(H),L[H]=0,R[H]=[]),A[H]==A[V]+_&&(L[H]=L[H]+L[V],R[H].push(V))}else for(var j=0;j<v[V].length;j++){var Y=v[V][j].id();A[Y]==1/0&&(O.push(Y),A[Y]=A[V]+1),A[Y]==A[V]+1&&(L[Y]=L[Y]+L[V],R[Y].push(V))}}for(var Q={},W=0;W<c.length;W++)Q[c[W].id()]=0;for(;B.length>0;){for(var N=B.pop(),G=0;G<R[N].length;G++){var Z=R[N][G];Q[Z]=Q[Z]+L[Z]/L[N]*(1+Q[N])}N!=c[S].id()&&g.set(N,g.get(N)+Q[N])}},S=0;S<c.length;S++)E();var w={betweenness:function(C){var B=o.collection(C).id();return g.get(B)},betweennessNormalized:function(C){if(h==0)return 0;var B=o.collection(C).id();return g.get(B)/h}};return w.betweennessNormalised=w.betweennessNormalized,w}};Ch.bc=Ch.betweennessCentrality;var eC=Ba({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),tC=function(e){return eC(e)},aC=function(e,a){for(var n=0,l=0;l<a.length;l++)n+=a[l](e);return n},rC=function(e,a,n){for(var l=0;l<a;l++)e[l*a+l]=n},hx=function(e,a){for(var n,l=0;l<a;l++){n=0;for(var u=0;u<a;u++)n+=e[u*a+l];for(var o=0;o<a;o++)e[o*a+l]=e[o*a+l]/n}},nC=function(e,a,n){for(var l=new Array(n*n),u=0;u<n;u++){for(var o=0;o<n;o++)l[u*n+o]=0;for(var c=0;c<n;c++)for(var v=0;v<n;v++)l[u*n+v]+=e[u*n+c]*a[c*n+v]}return l},iC=function(e,a,n){for(var l=e.slice(0),u=1;u<n;u++)e=nC(e,l,a);return e},lC=function(e,a,n){for(var l=new Array(a*a),u=0;u<a*a;u++)l[u]=Math.pow(e[u],n);return hx(l,a),l},uC=function(e,a,n,l){for(var u=0;u<n;u++){var o=Math.round(e[u]*Math.pow(10,l))/Math.pow(10,l),c=Math.round(a[u]*Math.pow(10,l))/Math.pow(10,l);if(o!==c)return!1}return!0},sC=function(e,a,n,l){for(var u=[],o=0;o<a;o++){for(var c=[],v=0;v<a;v++)Math.round(e[o*a+v]*1e3)/1e3>0&&c.push(n[v]);c.length!==0&&u.push(l.collection(c))}return u},oC=function(e,a){for(var n=0;n<e.length;n++)if(!a[n]||e[n].id()!==a[n].id())return!1;return!0},cC=function(e){for(var a=0;a<e.length;a++)for(var n=0;n<e.length;n++)a!=n&&oC(e[a],e[n])&&e.splice(n,1);return e},k0=function(e){for(var a=this.nodes(),n=this.edges(),l=this.cy(),u=tC(e),o={},c=0;c<a.length;c++)o[a[c].id()]=c;for(var v=a.length,f=v*v,h=new Array(f),g,m=0;m<f;m++)h[m]=0;for(var x=0;x<n.length;x++){var b=n[x],E=o[b.source().id()],S=o[b.target().id()],w=aC(b,u.attributes);h[E*v+S]+=w,h[S*v+E]+=w}rC(h,v,u.multFactor),hx(h,v);for(var T=!0,C=0;T&&C<u.maxIterations;)T=!1,g=iC(h,v,u.expandFactor),h=lC(g,v,u.inflateFactor),uC(h,g,f,4)||(T=!0),C++;var B=sC(h,v,a,l);return B=cC(B),B},fC={markovClustering:k0,mcl:k0},vC=function(e){return e},gx=function(e,a){return Math.abs(a-e)},_0=function(e,a,n){return e+gx(a,n)},q0=function(e,a,n){return e+Math.pow(n-a,2)},dC=function(e){return Math.sqrt(e)},hC=function(e,a,n){return Math.max(e,gx(a,n))},Ou=function(e,a,n,l,u){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:vC,c=l,v,f,h=0;h<e;h++)v=a(h),f=n(h),c=u(c,v,f);return o(c)},Ll={euclidean:function(e,a,n){return e>=2?Ou(e,a,n,0,q0,dC):Ou(e,a,n,0,_0)},squaredEuclidean:function(e,a,n){return Ou(e,a,n,0,q0)},manhattan:function(e,a,n){return Ou(e,a,n,0,_0)},max:function(e,a,n){return Ou(e,a,n,-1/0,hC)}};Ll["squared-euclidean"]=Ll.squaredEuclidean;Ll.squaredeuclidean=Ll.squaredEuclidean;function mc(t,e,a,n,l,u){var o;return Xt(t)?o=t:o=Ll[t]||Ll.euclidean,e===0&&Xt(t)?o(l,u):o(e,a,n,l,u)}var gC=Ba({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),tg=function(e){return gC(e)},ic=function(e,a,n,l,u){var o=u!=="kMedoids",c=o?function(g){return n[g]}:function(g){return l[g](n)},v=function(m){return l[m](a)},f=n,h=a;return mc(e,l.length,c,v,f,h)},vd=function(e,a,n){for(var l=n.length,u=new Array(l),o=new Array(l),c=new Array(a),v=null,f=0;f<l;f++)u[f]=e.min(n[f]).value,o[f]=e.max(n[f]).value;for(var h=0;h<a;h++){v=[];for(var g=0;g<l;g++)v[g]=Math.random()*(o[g]-u[g])+u[g];c[h]=v}return c},px=function(e,a,n,l,u){for(var o=1/0,c=0,v=0;v<a.length;v++){var f=ic(n,e,a[v],l,u);f<o&&(o=f,c=v)}return c},mx=function(e,a,n){for(var l=[],u=null,o=0;o<a.length;o++)u=a[o],n[u.id()]===e&&l.push(u);return l},pC=function(e,a,n){return Math.abs(a-e)<=n},mC=function(e,a,n){for(var l=0;l<e.length;l++)for(var u=0;u<e[l].length;u++){var o=Math.abs(e[l][u]-a[l][u]);if(o>n)return!1}return!0},yC=function(e,a,n){for(var l=0;l<n;l++)if(e===a[l])return!0;return!1},V0=function(e,a){var n=new Array(a);if(e.length<50)for(var l=0;l<a;l++){for(var u=e[Math.floor(Math.random()*e.length)];yC(u,n,l);)u=e[Math.floor(Math.random()*e.length)];n[l]=u}else for(var o=0;o<a;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},U0=function(e,a,n){for(var l=0,u=0;u<a.length;u++)l+=ic("manhattan",a[u],e,n,"kMedoids");return l},bC=function(e){var a=this.cy(),n=this.nodes(),l=null,u=tg(e),o=new Array(u.k),c={},v;u.testMode?typeof u.testCentroids=="number"?(u.testCentroids,v=vd(n,u.k,u.attributes)):fa(u.testCentroids)==="object"?v=u.testCentroids:v=vd(n,u.k,u.attributes):v=vd(n,u.k,u.attributes);for(var f=!0,h=0;f&&h<u.maxIterations;){for(var g=0;g<n.length;g++)l=n[g],c[l.id()]=px(l,v,u.distance,u.attributes,"kMeans");f=!1;for(var m=0;m<u.k;m++){var x=mx(m,n,c);if(x.length!==0){for(var b=u.attributes.length,E=v[m],S=new Array(b),w=new Array(b),T=0;T<b;T++){w[T]=0;for(var C=0;C<x.length;C++)l=x[C],w[T]+=u.attributes[T](l);S[T]=w[T]/x.length,pC(S[T],E[T],u.sensitivityThreshold)||(f=!0)}v[m]=S,o[m]=a.collection(x)}}h++}return o},xC=function(e){var a=this.cy(),n=this.nodes(),l=null,u=tg(e),o=new Array(u.k),c,v={},f,h=new Array(u.k);u.testMode?typeof u.testCentroids=="number"||(fa(u.testCentroids)==="object"?c=u.testCentroids:c=V0(n,u.k)):c=V0(n,u.k);for(var g=!0,m=0;g&&m<u.maxIterations;){for(var x=0;x<n.length;x++)l=n[x],v[l.id()]=px(l,c,u.distance,u.attributes,"kMedoids");g=!1;for(var b=0;b<c.length;b++){var E=mx(b,n,v);if(E.length!==0){h[b]=U0(c[b],E,u.attributes);for(var S=0;S<E.length;S++)f=U0(E[S],E,u.attributes),f<h[b]&&(h[b]=f,c[b]=E[S],g=!0);o[b]=a.collection(E)}}m++}return o},wC=function(e,a,n,l,u){for(var o,c,v=0;v<a.length;v++)for(var f=0;f<e.length;f++)l[v][f]=Math.pow(n[v][f],u.m);for(var h=0;h<e.length;h++)for(var g=0;g<u.attributes.length;g++){o=0,c=0;for(var m=0;m<a.length;m++)o+=l[m][h]*u.attributes[g](a[m]),c+=l[m][h];e[h][g]=o/c}},SC=function(e,a,n,l,u){for(var o=0;o<e.length;o++)a[o]=e[o].slice();for(var c,v,f,h=2/(u.m-1),g=0;g<n.length;g++)for(var m=0;m<l.length;m++){c=0;for(var x=0;x<n.length;x++)v=ic(u.distance,l[m],n[g],u.attributes,"cmeans"),f=ic(u.distance,l[m],n[x],u.attributes,"cmeans"),c+=Math.pow(v/f,h);e[m][g]=1/c}},EC=function(e,a,n,l){for(var u=new Array(n.k),o=0;o<u.length;o++)u[o]=[];for(var c,v,f=0;f<a.length;f++){c=-1/0,v=-1;for(var h=0;h<a[0].length;h++)a[f][h]>c&&(c=a[f][h],v=h);u[v].push(e[f])}for(var g=0;g<u.length;g++)u[g]=l.collection(u[g]);return u},j0=function(e){var a=this.cy(),n=this.nodes(),l=tg(e),u,o,c,v,f;v=new Array(n.length);for(var h=0;h<n.length;h++)v[h]=new Array(l.k);c=new Array(n.length);for(var g=0;g<n.length;g++)c[g]=new Array(l.k);for(var m=0;m<n.length;m++){for(var x=0,b=0;b<l.k;b++)c[m][b]=Math.random(),x+=c[m][b];for(var E=0;E<l.k;E++)c[m][E]=c[m][E]/x}o=new Array(l.k);for(var S=0;S<l.k;S++)o[S]=new Array(l.attributes.length);f=new Array(n.length);for(var w=0;w<n.length;w++)f[w]=new Array(l.k);for(var T=!0,C=0;T&&C<l.maxIterations;)T=!1,wC(o,n,c,f,l),SC(c,v,o,n,l),mC(c,v,l.sensitivityThreshold)||(T=!0),C++;return u=EC(n,c,l,a),{clusters:u,degreeOfMembership:c}},TC={kMeans:bC,kMedoids:xC,fuzzyCMeans:j0,fcm:j0},CC=Ba({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),AC={single:"min",complete:"max"},DC=function(e){var a=CC(e),n=AC[a.linkage];return n!=null&&(a.linkage=n),a},P0=function(e,a,n,l,u){for(var o=0,c=1/0,v,f=u.attributes,h=function(z,U){return mc(u.distance,f.length,function(V){return f[V](z)},function(V){return f[V](U)},z,U)},g=0;g<e.length;g++){var m=e[g].key,x=n[m][l[m]];x<c&&(o=m,c=x)}if(u.mode==="threshold"&&c>=u.threshold||u.mode==="dendrogram"&&e.length===1)return!1;var b=a[o],E=a[l[o]],S;u.mode==="dendrogram"?S={left:b,right:E,key:b.key}:S={value:b.value.concat(E.value),key:b.key},e[b.index]=S,e.splice(E.index,1),a[b.key]=S;for(var w=0;w<e.length;w++){var T=e[w];b.key===T.key?v=1/0:u.linkage==="min"?(v=n[b.key][T.key],n[b.key][T.key]>n[E.key][T.key]&&(v=n[E.key][T.key])):u.linkage==="max"?(v=n[b.key][T.key],n[b.key][T.key]<n[E.key][T.key]&&(v=n[E.key][T.key])):u.linkage==="mean"?v=(n[b.key][T.key]*b.size+n[E.key][T.key]*E.size)/(b.size+E.size):u.mode==="dendrogram"?v=h(T.value,b.value):v=h(T.value[0],b.value[0]),n[b.key][T.key]=n[T.key][b.key]=v}for(var C=0;C<e.length;C++){var B=e[C].key;if(l[B]===b.key||l[B]===E.key){for(var R=B,L=0;L<e.length;L++){var A=e[L].key;n[B][A]<n[B][R]&&(R=A)}l[B]=R}e[C].index=C}return b.key=E.key=b.index=E.index=null,!0},Dl=function(e,a,n){e&&(e.value?a.push(e.value):(e.left&&Dl(e.left,a),e.right&&Dl(e.right,a)))},Ah=function(e,a){if(!e)return"";if(e.left&&e.right){var n=Ah(e.left,a),l=Ah(e.right,a),u=a.add({group:"nodes",data:{id:n+","+l}});return a.add({group:"edges",data:{source:n,target:u.id()}}),a.add({group:"edges",data:{source:l,target:u.id()}}),u.id()}else if(e.value)return e.value.id()},Dh=function(e,a,n){if(!e)return[];var l=[],u=[],o=[];return a===0?(e.left&&Dl(e.left,l),e.right&&Dl(e.right,u),o=l.concat(u),[n.collection(o)]):a===1?e.value?[n.collection(e.value)]:(e.left&&Dl(e.left,l),e.right&&Dl(e.right,u),[n.collection(l),n.collection(u)]):e.value?[n.collection(e.value)]:(e.left&&(l=Dh(e.left,a-1,n)),e.right&&(u=Dh(e.right,a-1,n)),l.concat(u))},H0=function(e){for(var a=this.cy(),n=this.nodes(),l=DC(e),u=l.attributes,o=function(C,B){return mc(l.distance,u.length,function(R){return u[R](C)},function(R){return u[R](B)},C,B)},c=[],v=[],f=[],h=[],g=0;g<n.length;g++){var m={value:l.mode==="dendrogram"?n[g]:[n[g]],key:g,index:g};c[g]=m,h[g]=m,v[g]=[],f[g]=0}for(var x=0;x<c.length;x++)for(var b=0;b<=x;b++){var E=void 0;l.mode==="dendrogram"?E=x===b?1/0:o(c[x].value,c[b].value):E=x===b?1/0:o(c[x].value[0],c[b].value[0]),v[x][b]=E,v[b][x]=E,E<v[x][f[x]]&&(f[x]=b)}for(var S=P0(c,h,v,f,l);S;)S=P0(c,h,v,f,l);var w;return l.mode==="dendrogram"?(w=Dh(c[0],l.dendrogramDepth,a),l.addDendrogram&&Ah(c[0],a)):(w=new Array(c.length),c.forEach(function(T,C){T.key=T.index=null,w[C]=a.collection(T.value)})),w},BC={hierarchicalClustering:H0,hca:H0},NC=Ba({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),MC=function(e){var a=e.damping,n=e.preference;.5<=a&&a<1||Yt("Damping must range on [0.5, 1). Got: ".concat(a));var l=["median","mean","min","max"];return l.some(function(u){return u===n})||Ce(n)||Yt("Preference must be one of [".concat(l.map(function(u){return"'".concat(u,"'")}).join(", "),"] or a number. Got: ").concat(n)),NC(e)},RC=function(e,a,n,l){var u=function(c,v){return l[v](c)};return-mc(e,l.length,function(o){return u(a,o)},function(o){return u(n,o)},a,n)},zC=function(e,a){var n=null;return a==="median"?n=MT(e):a==="mean"?n=NT(e):a==="min"?n=DT(e):a==="max"?n=BT(e):n=a,n},OC=function(e,a,n){for(var l=[],u=0;u<e;u++)a[u*e+u]+n[u*e+u]>0&&l.push(u);return l},G0=function(e,a,n){for(var l=[],u=0;u<e;u++){for(var o=-1,c=-1/0,v=0;v<n.length;v++){var f=n[v];a[u*e+f]>c&&(o=f,c=a[u*e+f])}o>0&&l.push(o)}for(var h=0;h<n.length;h++)l[n[h]]=n[h];return l},LC=function(e,a,n){for(var l=G0(e,a,n),u=0;u<n.length;u++){for(var o=[],c=0;c<l.length;c++)l[c]===n[u]&&o.push(c);for(var v=-1,f=-1/0,h=0;h<o.length;h++){for(var g=0,m=0;m<o.length;m++)g+=a[o[m]*e+o[h]];g>f&&(v=h,f=g)}n[u]=o[v]}return l=G0(e,a,n),l},I0=function(e){for(var a=this.cy(),n=this.nodes(),l=MC(e),u={},o=0;o<n.length;o++)u[n[o].id()]=o;var c,v,f,h,g,m;c=n.length,v=c*c,f=new Array(v);for(var x=0;x<v;x++)f[x]=-1/0;for(var b=0;b<c;b++)for(var E=0;E<c;E++)b!==E&&(f[b*c+E]=RC(l.distance,n[b],n[E],l.attributes));h=zC(f,l.preference);for(var S=0;S<c;S++)f[S*c+S]=h;g=new Array(v);for(var w=0;w<v;w++)g[w]=0;m=new Array(v);for(var T=0;T<v;T++)m[T]=0;for(var C=new Array(c),B=new Array(c),R=new Array(c),L=0;L<c;L++)C[L]=0,B[L]=0,R[L]=0;for(var A=new Array(c*l.minIterations),O=0;O<A.length;O++)A[O]=0;var z;for(z=0;z<l.maxIterations;z++){for(var U=0;U<c;U++){for(var V=-1/0,P=-1/0,H=-1,I=0,F=0;F<c;F++)C[F]=g[U*c+F],I=m[U*c+F]+f[U*c+F],I>=V?(P=V,V=I,H=F):I>P&&(P=I);for(var _=0;_<c;_++)g[U*c+_]=(1-l.damping)*(f[U*c+_]-V)+l.damping*C[_];g[U*c+H]=(1-l.damping)*(f[U*c+H]-P)+l.damping*C[H]}for(var j=0;j<c;j++){for(var Y=0,Q=0;Q<c;Q++)C[Q]=m[Q*c+j],B[Q]=Math.max(0,g[Q*c+j]),Y+=B[Q];Y-=B[j],B[j]=g[j*c+j],Y+=B[j];for(var W=0;W<c;W++)m[W*c+j]=(1-l.damping)*Math.min(0,Y-B[W])+l.damping*C[W];m[j*c+j]=(1-l.damping)*(Y-B[j])+l.damping*C[j]}for(var N=0,G=0;G<c;G++){var Z=m[G*c+G]+g[G*c+G]>0?1:0;A[z%l.minIterations*c+G]=Z,N+=Z}if(N>0&&(z>=l.minIterations-1||z==l.maxIterations-1)){for(var $=0,ae=0;ae<c;ae++){R[ae]=0;for(var se=0;se<l.minIterations;se++)R[ae]+=A[se*c+ae];(R[ae]===0||R[ae]===l.minIterations)&&$++}if($===c)break}}for(var de=OC(c,g,m),Se=LC(c,f,de),fe={},te=0;te<de.length;te++)fe[de[te]]=[];for(var re=0;re<n.length;re++){var le=u[n[re].id()],he=Se[le];he!=null&&fe[he].push(n[re])}for(var Ee=new Array(de.length),ke=0;ke<de.length;ke++)Ee[ke]=a.collection(fe[de[ke]]);return Ee},kC={affinityPropagation:I0,ap:I0},_C=Ba({root:void 0,directed:!1}),qC={hierholzer:function(e){if(!yt(e)){var a=arguments;e={root:a[0],directed:a[1]}}var n=_C(e),l=n.root,u=n.directed,o=this,c=!1,v,f,h;l&&(h=Ge(l)?this.filter(l)[0].id():l[0].id());var g={},m={};u?o.forEach(function(T){var C=T.id();if(T.isNode()){var B=T.indegree(!0),R=T.outdegree(!0),L=B-R,A=R-B;L==1?v?c=!0:v=C:A==1?f?c=!0:f=C:(A>1||L>1)&&(c=!0),g[C]=[],T.outgoers().forEach(function(O){O.isEdge()&&g[C].push(O.id())})}else m[C]=[void 0,T.target().id()]}):o.forEach(function(T){var C=T.id();if(T.isNode()){var B=T.degree(!0);B%2&&(v?f?c=!0:f=C:v=C),g[C]=[],T.connectedEdges().forEach(function(R){return g[C].push(R.id())})}else m[C]=[T.source().id(),T.target().id()]});var x={found:!1,trail:void 0};if(c)return x;if(f&&v)if(u){if(h&&f!=h)return x;h=f}else{if(h&&f!=h&&v!=h)return x;h||(h=f)}else h||(h=o[0].id());var b=function(C){for(var B=C,R=[C],L,A,O;g[B].length;)L=g[B].shift(),A=m[L][0],O=m[L][1],B!=O?(g[O]=g[O].filter(function(z){return z!=L}),B=O):!u&&B!=A&&(g[A]=g[A].filter(function(z){return z!=L}),B=A),R.unshift(L),R.unshift(B);return R},E=[],S=[];for(S=b(h);S.length!=1;)g[S[0]].length==0?(E.unshift(o.getElementById(S.shift())),E.unshift(o.getElementById(S.shift()))):S=b(S.shift()).concat(S);E.unshift(o.getElementById(S.shift()));for(var w in g)if(g[w].length)return x;return x.found=!0,x.trail=this.spawn(E,!0),x}},Oo=function(){var e=this,a={},n=0,l=0,u=[],o=[],c={},v=function(m,x){for(var b=o.length-1,E=[],S=e.spawn();o[b].x!=m||o[b].y!=x;)E.push(o.pop().edge),b--;E.push(o.pop().edge),E.forEach(function(w){var T=w.connectedNodes().intersection(e);S.merge(w),T.forEach(function(C){var B=C.id(),R=C.connectedEdges().intersection(e);S.merge(C),a[B].cutVertex?S.merge(R.filter(function(L){return L.isLoop()})):S.merge(R)})}),u.push(S)},f=function(m,x,b){m===b&&(l+=1),a[x]={id:n,low:n++,cutVertex:!1};var E=e.getElementById(x).connectedEdges().intersection(e);if(E.size()===0)u.push(e.spawn(e.getElementById(x)));else{var S,w,T,C;E.forEach(function(B){S=B.source().id(),w=B.target().id(),T=S===x?w:S,T!==b&&(C=B.id(),c[C]||(c[C]=!0,o.push({x,y:T,edge:B})),T in a?a[x].low=Math.min(a[x].low,a[T].id):(f(m,T,x),a[x].low=Math.min(a[x].low,a[T].low),a[x].id<=a[T].low&&(a[x].cutVertex=!0,v(x,T))))})}};e.forEach(function(g){if(g.isNode()){var m=g.id();m in a||(l=0,f(m,m),a[m].cutVertex=l>1)}});var h=Object.keys(a).filter(function(g){return a[g].cutVertex}).map(function(g){return e.getElementById(g)});return{cut:e.spawn(h),components:u}},VC={hopcroftTarjanBiconnected:Oo,htbc:Oo,htb:Oo,hopcroftTarjanBiconnectedComponents:Oo},Lo=function(){var e=this,a={},n=0,l=[],u=[],o=e.spawn(e),c=function(f){u.push(f),a[f]={index:n,low:n++,explored:!1};var h=e.getElementById(f).connectedEdges().intersection(e);if(h.forEach(function(E){var S=E.target().id();S!==f&&(S in a||c(S),a[S].explored||(a[f].low=Math.min(a[f].low,a[S].low)))}),a[f].index===a[f].low){for(var g=e.spawn();;){var m=u.pop();if(g.merge(e.getElementById(m)),a[m].low=a[f].index,a[m].explored=!0,m===f)break}var x=g.edgesWith(g),b=g.merge(x);l.push(b),o=o.difference(b)}};return e.forEach(function(v){if(v.isNode()){var f=v.id();f in a||c(f)}}),{cut:o,components:l}},UC={tarjanStronglyConnected:Lo,tsc:Lo,tscc:Lo,tarjanStronglyConnectedComponents:Lo},yx={};[Ku,gT,pT,yT,xT,ST,CT,WT,Ml,Rl,Ch,fC,TC,BC,kC,qC,VC,UC].forEach(function(t){Fe(yx,t)});var bx=0,xx=1,wx=2,Tr=function(e){if(!(this instanceof Tr))return new Tr(e);this.id="Thenable/1.0.7",this.state=bx,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))};Tr.prototype={fulfill:function(e){return Y0(this,xx,"fulfillValue",e)},reject:function(e){return Y0(this,wx,"rejectReason",e)},then:function(e,a){var n=this,l=new Tr;return n.onFulfilled.push(X0(e,l,"fulfill")),n.onRejected.push(X0(a,l,"reject")),Sx(n),l.proxy}};var Y0=function(e,a,n,l){return e.state===bx&&(e.state=a,e[n]=l,Sx(e)),e},Sx=function(e){e.state===xx?F0(e,"onFulfilled",e.fulfillValue):e.state===wx&&F0(e,"onRejected",e.rejectReason)},F0=function(e,a,n){if(e[a].length!==0){var l=e[a];e[a]=[];var u=function(){for(var c=0;c<l.length;c++)l[c](n)};typeof setImmediate=="function"?setImmediate(u):setTimeout(u,0)}},X0=function(e,a,n){return function(l){if(typeof e!="function")a[n].call(a,l);else{var u;try{u=e(l)}catch(o){a.reject(o);return}Ex(a,u)}}},Ex=function(e,a){if(e===a||e.proxy===a){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(fa(a)==="object"&&a!==null||typeof a=="function")try{n=a.then}catch(u){e.reject(u);return}if(typeof n=="function"){var l=!1;try{n.call(a,function(u){l||(l=!0,u===a?e.reject(new TypeError("circular thenable chain")):Ex(e,u))},function(u){l||(l=!0,e.reject(u))})}catch(u){l||e.reject(u)}return}e.fulfill(a)};Tr.all=function(t){return new Tr(function(e,a){for(var n=new Array(t.length),l=0,u=function(v,f){n[v]=f,l++,l===t.length&&e(n)},o=0;o<t.length;o++)(function(c){var v=t[c],f=v!=null&&v.then!=null;if(f)v.then(function(g){u(c,g)},function(g){a(g)});else{var h=v;u(c,h)}})(o)})};Tr.resolve=function(t){return new Tr(function(e,a){e(t)})};Tr.reject=function(t){return new Tr(function(e,a){a(t)})};var ql=typeof Promise<"u"?Promise:Tr,Bh=function(e,a,n){var l=Yh(e),u=!l,o=this._private=Fe({duration:1e3},a,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&Xt(o.complete)&&o.completes.push(o.complete),u){var c=e.position();o.startPosition=o.startPosition||{x:c.x,y:c.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(l){var v=e.pan();o.startPan={x:v.x,y:v.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},Bi=Bh.prototype;Fe(Bi,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var a,n=e.target._private.animation;e.queue?a=n.queue:a=n.current,a.push(this),nr(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var a=this._private;return e===void 0?a.progress*a.duration:this.progress(e/a.duration)},progress:function(e){var a=this._private,n=a.playing;return e===void 0?a.progress:(n&&this.pause(),a.progress=e,a.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,a=e.playing;a&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(f,h){var g=e[f];g!=null&&(e[f]=e[h],e[h]=g)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var l=0;l<e.style.length;l++){var u=e.style[l],o=u.name,c=e.startStyle[o];e.startStyle[o]=u,e.style[l]=c}return a&&this.play(),this},promise:function(e){var a=this._private,n;switch(e){case"frame":n=a.frames;break;default:case"complete":case"completed":n=a.completes}return new ql(function(l,u){n.push(function(){l()})})}});Bi.complete=Bi.completed;Bi.run=Bi.play;Bi.running=Bi.playing;var jC={animated:function(){return function(){var a=this,n=a.length!==void 0,l=n?a:[a],u=this._private.cy||this;if(!u.styleEnabled())return!1;var o=l[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var a=this,n=a.length!==void 0,l=n?a:[a],u=this._private.cy||this;if(!u.styleEnabled())return this;for(var o=0;o<l.length;o++){var c=l[o];c._private.animation.queue=[]}return this}},delay:function(){return function(a,n){var l=this._private.cy||this;return l.styleEnabled()?this.animate({delay:a,duration:a,complete:n}):this}},delayAnimation:function(){return function(a,n){var l=this._private.cy||this;return l.styleEnabled()?this.animation({delay:a,duration:a,complete:n}):this}},animation:function(){return function(a,n){var l=this,u=l.length!==void 0,o=u?l:[l],c=this._private.cy||this,v=!u,f=!v;if(!c.styleEnabled())return this;var h=c.style();a=Fe({},a,n);var g=Object.keys(a).length===0;if(g)return new Bh(o[0],a);switch(a.duration===void 0&&(a.duration=400),a.duration){case"slow":a.duration=600;break;case"fast":a.duration=200;break}if(f&&(a.style=h.getPropsList(a.style||a.css),a.css=void 0),f&&a.renderedPosition!=null){var m=a.renderedPosition,x=c.pan(),b=c.zoom();a.position=sx(m,b,x)}if(v&&a.panBy!=null){var E=a.panBy,S=c.pan();a.pan={x:S.x+E.x,y:S.y+E.y}}var w=a.center||a.centre;if(v&&w!=null){var T=c.getCenterPan(w.eles,a.zoom);T!=null&&(a.pan=T)}if(v&&a.fit!=null){var C=a.fit,B=c.getFitViewport(C.eles||C.boundingBox,C.padding);B!=null&&(a.pan=B.pan,a.zoom=B.zoom)}if(v&&yt(a.zoom)){var R=c.getZoomedViewport(a.zoom);R!=null?(R.zoomed&&(a.zoom=R.zoom),R.panned&&(a.pan=R.pan)):a.zoom=null}return new Bh(o[0],a)}},animate:function(){return function(a,n){var l=this,u=l.length!==void 0,o=u?l:[l],c=this._private.cy||this;if(!c.styleEnabled())return this;n&&(a=Fe({},a,n));for(var v=0;v<o.length;v++){var f=o[v],h=f.animated()&&(a.queue===void 0||a.queue),g=f.animation(a,h?{queue:!0}:void 0);g.play()}return this}},stop:function(){return function(a,n){var l=this,u=l.length!==void 0,o=u?l:[l],c=this._private.cy||this;if(!c.styleEnabled())return this;for(var v=0;v<o.length;v++){for(var f=o[v],h=f._private,g=h.animation.current,m=0;m<g.length;m++){var x=g[m],b=x._private;n&&(b.duration=0)}a&&(h.animation.queue=[]),n||(h.animation.current=[])}return c.notify("draw"),this}}},dd,K0;function yc(){if(K0)return dd;K0=1;var t=Array.isArray;return dd=t,dd}var hd,Z0;function PC(){if(Z0)return hd;Z0=1;var t=yc(),e=ls(),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function l(u,o){if(t(u))return!1;var c=typeof u;return c=="number"||c=="symbol"||c=="boolean"||u==null||e(u)?!0:n.test(u)||!a.test(u)||o!=null&&u in Object(o)}return hd=l,hd}var gd,Q0;function HC(){if(Q0)return gd;Q0=1;var t=J1(),e=is(),a="[object AsyncFunction]",n="[object Function]",l="[object GeneratorFunction]",u="[object Proxy]";function o(c){if(!e(c))return!1;var v=t(c);return v==n||v==l||v==a||v==u}return gd=o,gd}var pd,$0;function GC(){if($0)return pd;$0=1;var t=hc(),e=t["__core-js_shared__"];return pd=e,pd}var md,W0;function IC(){if(W0)return md;W0=1;var t=GC(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function a(n){return!!e&&e in n}return md=a,md}var yd,J0;function YC(){if(J0)return yd;J0=1;var t=Function.prototype,e=t.toString;function a(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return yd=a,yd}var bd,eb;function FC(){if(eb)return bd;eb=1;var t=HC(),e=IC(),a=is(),n=YC(),l=/[\\^$.*+?()[\]{}|]/g,u=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,v=o.toString,f=c.hasOwnProperty,h=RegExp("^"+v.call(f).replace(l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g(m){if(!a(m)||e(m))return!1;var x=t(m)?h:u;return x.test(n(m))}return bd=g,bd}var xd,tb;function XC(){if(tb)return xd;tb=1;function t(e,a){return e?.[a]}return xd=t,xd}var wd,ab;function ag(){if(ab)return wd;ab=1;var t=FC(),e=XC();function a(n,l){var u=e(n,l);return t(u)?u:void 0}return wd=a,wd}var Sd,rb;function bc(){if(rb)return Sd;rb=1;var t=ag(),e=t(Object,"create");return Sd=e,Sd}var Ed,nb;function KC(){if(nb)return Ed;nb=1;var t=bc();function e(){this.__data__=t?t(null):{},this.size=0}return Ed=e,Ed}var Td,ib;function ZC(){if(ib)return Td;ib=1;function t(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a}return Td=t,Td}var Cd,lb;function QC(){if(lb)return Cd;lb=1;var t=bc(),e="__lodash_hash_undefined__",a=Object.prototype,n=a.hasOwnProperty;function l(u){var o=this.__data__;if(t){var c=o[u];return c===e?void 0:c}return n.call(o,u)?o[u]:void 0}return Cd=l,Cd}var Ad,ub;function $C(){if(ub)return Ad;ub=1;var t=bc(),e=Object.prototype,a=e.hasOwnProperty;function n(l){var u=this.__data__;return t?u[l]!==void 0:a.call(u,l)}return Ad=n,Ad}var Dd,sb;function WC(){if(sb)return Dd;sb=1;var t=bc(),e="__lodash_hash_undefined__";function a(n,l){var u=this.__data__;return this.size+=this.has(n)?0:1,u[n]=t&&l===void 0?e:l,this}return Dd=a,Dd}var Bd,ob;function JC(){if(ob)return Bd;ob=1;var t=KC(),e=ZC(),a=QC(),n=$C(),l=WC();function u(o){var c=-1,v=o==null?0:o.length;for(this.clear();++c<v;){var f=o[c];this.set(f[0],f[1])}}return u.prototype.clear=t,u.prototype.delete=e,u.prototype.get=a,u.prototype.has=n,u.prototype.set=l,Bd=u,Bd}var Nd,cb;function eA(){if(cb)return Nd;cb=1;function t(){this.__data__=[],this.size=0}return Nd=t,Nd}var Md,fb;function Tx(){if(fb)return Md;fb=1;function t(e,a){return e===a||e!==e&&a!==a}return Md=t,Md}var Rd,vb;function xc(){if(vb)return Rd;vb=1;var t=Tx();function e(a,n){for(var l=a.length;l--;)if(t(a[l][0],n))return l;return-1}return Rd=e,Rd}var zd,db;function tA(){if(db)return zd;db=1;var t=xc(),e=Array.prototype,a=e.splice;function n(l){var u=this.__data__,o=t(u,l);if(o<0)return!1;var c=u.length-1;return o==c?u.pop():a.call(u,o,1),--this.size,!0}return zd=n,zd}var Od,hb;function aA(){if(hb)return Od;hb=1;var t=xc();function e(a){var n=this.__data__,l=t(n,a);return l<0?void 0:n[l][1]}return Od=e,Od}var Ld,gb;function rA(){if(gb)return Ld;gb=1;var t=xc();function e(a){return t(this.__data__,a)>-1}return Ld=e,Ld}var kd,pb;function nA(){if(pb)return kd;pb=1;var t=xc();function e(a,n){var l=this.__data__,u=t(l,a);return u<0?(++this.size,l.push([a,n])):l[u][1]=n,this}return kd=e,kd}var _d,mb;function iA(){if(mb)return _d;mb=1;var t=eA(),e=tA(),a=aA(),n=rA(),l=nA();function u(o){var c=-1,v=o==null?0:o.length;for(this.clear();++c<v;){var f=o[c];this.set(f[0],f[1])}}return u.prototype.clear=t,u.prototype.delete=e,u.prototype.get=a,u.prototype.has=n,u.prototype.set=l,_d=u,_d}var qd,yb;function lA(){if(yb)return qd;yb=1;var t=ag(),e=hc(),a=t(e,"Map");return qd=a,qd}var Vd,bb;function uA(){if(bb)return Vd;bb=1;var t=JC(),e=iA(),a=lA();function n(){this.size=0,this.__data__={hash:new t,map:new(a||e),string:new t}}return Vd=n,Vd}var Ud,xb;function sA(){if(xb)return Ud;xb=1;function t(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}return Ud=t,Ud}var jd,wb;function wc(){if(wb)return jd;wb=1;var t=sA();function e(a,n){var l=a.__data__;return t(n)?l[typeof n=="string"?"string":"hash"]:l.map}return jd=e,jd}var Pd,Sb;function oA(){if(Sb)return Pd;Sb=1;var t=wc();function e(a){var n=t(this,a).delete(a);return this.size-=n?1:0,n}return Pd=e,Pd}var Hd,Eb;function cA(){if(Eb)return Hd;Eb=1;var t=wc();function e(a){return t(this,a).get(a)}return Hd=e,Hd}var Gd,Tb;function fA(){if(Tb)return Gd;Tb=1;var t=wc();function e(a){return t(this,a).has(a)}return Gd=e,Gd}var Id,Cb;function vA(){if(Cb)return Id;Cb=1;var t=wc();function e(a,n){var l=t(this,a),u=l.size;return l.set(a,n),this.size+=l.size==u?0:1,this}return Id=e,Id}var Yd,Ab;function dA(){if(Ab)return Yd;Ab=1;var t=uA(),e=oA(),a=cA(),n=fA(),l=vA();function u(o){var c=-1,v=o==null?0:o.length;for(this.clear();++c<v;){var f=o[c];this.set(f[0],f[1])}}return u.prototype.clear=t,u.prototype.delete=e,u.prototype.get=a,u.prototype.has=n,u.prototype.set=l,Yd=u,Yd}var Fd,Db;function hA(){if(Db)return Fd;Db=1;var t=dA(),e="Expected a function";function a(n,l){if(typeof n!="function"||l!=null&&typeof l!="function")throw new TypeError(e);var u=function(){var o=arguments,c=l?l.apply(this,o):o[0],v=u.cache;if(v.has(c))return v.get(c);var f=n.apply(this,o);return u.cache=v.set(c,f)||v,f};return u.cache=new(a.Cache||t),u}return a.Cache=t,Fd=a,Fd}var Xd,Bb;function gA(){if(Bb)return Xd;Bb=1;var t=hA(),e=500;function a(n){var l=t(n,function(o){return u.size===e&&u.clear(),o}),u=l.cache;return l}return Xd=a,Xd}var Kd,Nb;function Cx(){if(Nb)return Kd;Nb=1;var t=gA(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,n=t(function(l){var u=[];return l.charCodeAt(0)===46&&u.push(""),l.replace(e,function(o,c,v,f){u.push(v?f.replace(a,"$1"):c||o)}),u});return Kd=n,Kd}var Zd,Mb;function Ax(){if(Mb)return Zd;Mb=1;function t(e,a){for(var n=-1,l=e==null?0:e.length,u=Array(l);++n<l;)u[n]=a(e[n],n,e);return u}return Zd=t,Zd}var Qd,Rb;function pA(){if(Rb)return Qd;Rb=1;var t=Xh(),e=Ax(),a=yc(),n=ls(),l=t?t.prototype:void 0,u=l?l.toString:void 0;function o(c){if(typeof c=="string")return c;if(a(c))return e(c,o)+"";if(n(c))return u?u.call(c):"";var v=c+"";return v=="0"&&1/c==-1/0?"-0":v}return Qd=o,Qd}var $d,zb;function Dx(){if(zb)return $d;zb=1;var t=pA();function e(a){return a==null?"":t(a)}return $d=e,$d}var Wd,Ob;function Bx(){if(Ob)return Wd;Ob=1;var t=yc(),e=PC(),a=Cx(),n=Dx();function l(u,o){return t(u)?u:e(u,o)?[u]:a(n(u))}return Wd=l,Wd}var Jd,Lb;function rg(){if(Lb)return Jd;Lb=1;var t=ls();function e(a){if(typeof a=="string"||t(a))return a;var n=a+"";return n=="0"&&1/a==-1/0?"-0":n}return Jd=e,Jd}var eh,kb;function mA(){if(kb)return eh;kb=1;var t=Bx(),e=rg();function a(n,l){l=t(l,n);for(var u=0,o=l.length;n!=null&&u<o;)n=n[e(l[u++])];return u&&u==o?n:void 0}return eh=a,eh}var th,_b;function yA(){if(_b)return th;_b=1;var t=mA();function e(a,n,l){var u=a==null?void 0:t(a,n);return u===void 0?l:u}return th=e,th}var bA=yA(),xA=ns(bA),ah,qb;function wA(){if(qb)return ah;qb=1;var t=ag(),e=(function(){try{var a=t(Object,"defineProperty");return a({},"",{}),a}catch{}})();return ah=e,ah}var rh,Vb;function SA(){if(Vb)return rh;Vb=1;var t=wA();function e(a,n,l){n=="__proto__"&&t?t(a,n,{configurable:!0,enumerable:!0,value:l,writable:!0}):a[n]=l}return rh=e,rh}var nh,Ub;function EA(){if(Ub)return nh;Ub=1;var t=SA(),e=Tx(),a=Object.prototype,n=a.hasOwnProperty;function l(u,o,c){var v=u[o];(!(n.call(u,o)&&e(v,c))||c===void 0&&!(o in u))&&t(u,o,c)}return nh=l,nh}var ih,jb;function TA(){if(jb)return ih;jb=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function a(n,l){var u=typeof n;return l=l??t,!!l&&(u=="number"||u!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<l}return ih=a,ih}var lh,Pb;function CA(){if(Pb)return lh;Pb=1;var t=EA(),e=Bx(),a=TA(),n=is(),l=rg();function u(o,c,v,f){if(!n(o))return o;c=e(c,o);for(var h=-1,g=c.length,m=g-1,x=o;x!=null&&++h<g;){var b=l(c[h]),E=v;if(b==="__proto__"||b==="constructor"||b==="prototype")return o;if(h!=m){var S=x[b];E=f?f(S,b,x):void 0,E===void 0&&(E=n(S)?S:a(c[h+1])?[]:{})}t(x,b,E),x=x[b]}return o}return lh=u,lh}var uh,Hb;function AA(){if(Hb)return uh;Hb=1;var t=CA();function e(a,n,l){return a==null?a:t(a,n,l)}return uh=e,uh}var DA=AA(),BA=ns(DA),sh,Gb;function NA(){if(Gb)return sh;Gb=1;function t(e,a){var n=-1,l=e.length;for(a||(a=Array(l));++n<l;)a[n]=e[n];return a}return sh=t,sh}var oh,Ib;function MA(){if(Ib)return oh;Ib=1;var t=Ax(),e=NA(),a=yc(),n=ls(),l=Cx(),u=rg(),o=Dx();function c(v){return a(v)?t(v,u):n(v)?[v]:e(l(o(v)))}return oh=c,oh}var RA=MA(),zA=ns(RA),OA={data:function(e){var a={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(l){},beforeSet:function(l,u){},onSet:function(l){},canSet:function(l){return!0}};return e=Fe({},a,e),function(l,u){var o=e,c=this,v=c.length!==void 0,f=v?c:[c],h=v?c[0]:c;if(Ge(l)){var g=l.indexOf(".")!==-1,m=g&&zA(l);if(o.allowGetting&&u===void 0){var x;return h&&(o.beforeGet(h),m&&h._private[o.field][l]===void 0?x=xA(h._private[o.field],m):x=h._private[o.field][l]),x}else if(o.allowSetting&&u!==void 0){var b=!o.immutableKeys[l];if(b){var E=G1({},l,u);o.beforeSet(c,E);for(var S=0,w=f.length;S<w;S++){var T=f[S];o.canSet(T)&&(m&&h._private[o.field][l]===void 0?BA(T._private[o.field],m,u):T._private[o.field][l]=u)}o.updateStyle&&c.updateStyle(),o.onSet(c),o.settingTriggersEvent&&c[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&yt(l)){var C=l,B,R,L=Object.keys(C);o.beforeSet(c,C);for(var A=0;A<L.length;A++){B=L[A],R=C[B];var O=!o.immutableKeys[B];if(O)for(var z=0;z<f.length;z++){var U=f[z];o.canSet(U)&&(U._private[o.field][B]=R)}}o.updateStyle&&c.updateStyle(),o.onSet(c),o.settingTriggersEvent&&c[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&Xt(l)){var V=l;c.on(o.bindingEvent,V)}else if(o.allowGetting&&l===void 0){var P;return h&&(o.beforeGet(h),P=h._private[o.field]),P}return c}},removeData:function(e){var a={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Fe({},a,e),function(l){var u=e,o=this,c=o.length!==void 0,v=c?o:[o];if(Ge(l)){for(var f=l.split(/\s+/),h=f.length,g=0;g<h;g++){var m=f[g];if(!In(m)){var x=!u.immutableKeys[m];if(x)for(var b=0,E=v.length;b<E;b++)v[b]._private[u.field][m]=void 0}}u.triggerEvent&&o[u.triggerFnName](u.event)}else if(l===void 0){for(var S=0,w=v.length;S<w;S++)for(var T=v[S]._private[u.field],C=Object.keys(T),B=0;B<C.length;B++){var R=C[B],L=!u.immutableKeys[R];L&&(T[R]=void 0)}u.triggerEvent&&o[u.triggerFnName](u.event)}return o}}},LA={eventAliasesOn:function(e){var a=e;a.addListener=a.listen=a.bind=a.on,a.unlisten=a.unbind=a.off=a.removeListener,a.trigger=a.emit,a.pon=a.promiseOn=function(n,l){var u=this,o=Array.prototype.slice.call(arguments,0);return new ql(function(c,v){var f=function(x){u.off.apply(u,g),c(x)},h=o.concat([f]),g=h.concat([]);u.on.apply(u,h)})}}},Tt={};[jC,OA,LA].forEach(function(t){Fe(Tt,t)});var kA={animate:Tt.animate(),animation:Tt.animation(),animated:Tt.animated(),clearQueue:Tt.clearQueue(),delay:Tt.delay(),delayAnimation:Tt.delayAnimation(),stop:Tt.stop()},Yo={classes:function(e){var a=this;if(e===void 0){var n=[];return a[0]._private.classes.forEach(function(b){return n.push(b)}),n}else kt(e)||(e=(e||"").match(/\S+/g)||[]);for(var l=[],u=new _l(e),o=0;o<a.length;o++){for(var c=a[o],v=c._private,f=v.classes,h=!1,g=0;g<e.length;g++){var m=e[g],x=f.has(m);if(!x){h=!0;break}}h||(h=f.size!==e.length),h&&(v.classes=u,l.push(c))}return l.length>0&&this.spawn(l).updateStyle().emit("class"),a},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var a=this[0];return a!=null&&a._private.classes.has(e)},toggleClass:function(e,a){kt(e)||(e=e.match(/\S+/g)||[]);for(var n=this,l=a===void 0,u=[],o=0,c=n.length;o<c;o++)for(var v=n[o],f=v._private.classes,h=!1,g=0;g<e.length;g++){var m=e[g],x=f.has(m),b=!1;a||l&&!x?(f.add(m),b=!0):(!a||l&&x)&&(f.delete(m),b=!0),!h&&b&&(u.push(v),h=!0)}return u.length>0&&this.spawn(u).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,a){var n=this;if(a==null)a=250;else if(a===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},a),n}};Yo.className=Yo.classNames=Yo.classes;var mt={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:ca,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};mt.variable="(?:[\\w-.]|(?:\\\\"+mt.metaChar+"))+";mt.className="(?:[\\w-]|(?:\\\\"+mt.metaChar+"))+";mt.value=mt.string+"|"+mt.number;mt.id=mt.variable;(function(){var t,e,a;for(t=mt.comparatorOp.split("|"),a=0;a<t.length;a++)e=t[a],mt.comparatorOp+="|@"+e;for(t=mt.comparatorOp.split("|"),a=0;a<t.length;a++)e=t[a],!(e.indexOf("!")>=0)&&e!=="="&&(mt.comparatorOp+="|\\!"+e)})();var Rt=function(){return{checks:[]}},Oe={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},Nh=[{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 OE(t.selector,e.selector)}),_A=(function(){for(var t={},e,a=0;a<Nh.length;a++)e=Nh[a],t[e.selector]=e.matches;return t})(),qA=function(e,a){return _A[e](a)},VA="("+Nh.map(function(t){return t.selector}).join("|")+")",gl=function(e){return e.replace(new RegExp("\\\\("+mt.metaChar+")","g"),function(a,n){return n})},qn=function(e,a,n){e[e.length-1]=n},Mh=[{name:"group",query:!0,regex:"("+mt.group+")",populate:function(e,a,n){var l=la(n,1),u=l[0];a.checks.push({type:Oe.GROUP,value:u==="*"?u:u+"s"})}},{name:"state",query:!0,regex:VA,populate:function(e,a,n){var l=la(n,1),u=l[0];a.checks.push({type:Oe.STATE,value:u})}},{name:"id",query:!0,regex:"\\#("+mt.id+")",populate:function(e,a,n){var l=la(n,1),u=l[0];a.checks.push({type:Oe.ID,value:gl(u)})}},{name:"className",query:!0,regex:"\\.("+mt.className+")",populate:function(e,a,n){var l=la(n,1),u=l[0];a.checks.push({type:Oe.CLASS,value:gl(u)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+mt.variable+")\\s*\\]",populate:function(e,a,n){var l=la(n,1),u=l[0];a.checks.push({type:Oe.DATA_EXIST,field:gl(u)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+mt.variable+")\\s*("+mt.comparatorOp+")\\s*("+mt.value+")\\s*\\]",populate:function(e,a,n){var l=la(n,3),u=l[0],o=l[1],c=l[2],v=new RegExp("^"+mt.string+"$").exec(c)!=null;v?c=c.substring(1,c.length-1):c=parseFloat(c),a.checks.push({type:Oe.DATA_COMPARE,field:gl(u),operator:o,value:c})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+mt.boolOp+")\\s*("+mt.variable+")\\s*\\]",populate:function(e,a,n){var l=la(n,2),u=l[0],o=l[1];a.checks.push({type:Oe.DATA_BOOL,field:gl(o),operator:u})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+mt.meta+")\\s*("+mt.comparatorOp+")\\s*("+mt.number+")\\s*\\]\\]",populate:function(e,a,n){var l=la(n,3),u=l[0],o=l[1],c=l[2];a.checks.push({type:Oe.META_COMPARE,field:gl(u),operator:o,value:parseFloat(c)})}},{name:"nextQuery",separator:!0,regex:mt.separator,populate:function(e,a){var n=e.currentSubject,l=e.edgeCount,u=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=l,o.compoundCount=u,e.edgeCount=0,e.compoundCount=0;var c=e[e.length++]=Rt();return c}},{name:"directedEdge",separator:!0,regex:mt.directedEdge,populate:function(e,a){if(e.currentSubject==null){var n=Rt(),l=a,u=Rt();return n.checks.push({type:Oe.DIRECTED_EDGE,source:l,target:u}),qn(e,a,n),e.edgeCount++,u}else{var o=Rt(),c=a,v=Rt();return o.checks.push({type:Oe.NODE_SOURCE,source:c,target:v}),qn(e,a,o),e.edgeCount++,v}}},{name:"undirectedEdge",separator:!0,regex:mt.undirectedEdge,populate:function(e,a){if(e.currentSubject==null){var n=Rt(),l=a,u=Rt();return n.checks.push({type:Oe.UNDIRECTED_EDGE,nodes:[l,u]}),qn(e,a,n),e.edgeCount++,u}else{var o=Rt(),c=a,v=Rt();return o.checks.push({type:Oe.NODE_NEIGHBOR,node:c,neighbor:v}),qn(e,a,o),v}}},{name:"child",separator:!0,regex:mt.child,populate:function(e,a){if(e.currentSubject==null){var n=Rt(),l=Rt(),u=e[e.length-1];return n.checks.push({type:Oe.CHILD,parent:u,child:l}),qn(e,a,n),e.compoundCount++,l}else if(e.currentSubject===a){var o=Rt(),c=e[e.length-1],v=Rt(),f=Rt(),h=Rt(),g=Rt();return o.checks.push({type:Oe.COMPOUND_SPLIT,left:c,right:v,subject:f}),f.checks=a.checks,a.checks=[{type:Oe.TRUE}],g.checks.push({type:Oe.TRUE}),v.checks.push({type:Oe.PARENT,parent:g,child:h}),qn(e,c,o),e.currentSubject=f,e.compoundCount++,h}else{var m=Rt(),x=Rt(),b=[{type:Oe.PARENT,parent:m,child:x}];return m.checks=a.checks,a.checks=b,e.compoundCount++,x}}},{name:"descendant",separator:!0,regex:mt.descendant,populate:function(e,a){if(e.currentSubject==null){var n=Rt(),l=Rt(),u=e[e.length-1];return n.checks.push({type:Oe.DESCENDANT,ancestor:u,descendant:l}),qn(e,a,n),e.compoundCount++,l}else if(e.currentSubject===a){var o=Rt(),c=e[e.length-1],v=Rt(),f=Rt(),h=Rt(),g=Rt();return o.checks.push({type:Oe.COMPOUND_SPLIT,left:c,right:v,subject:f}),f.checks=a.checks,a.checks=[{type:Oe.TRUE}],g.checks.push({type:Oe.TRUE}),v.checks.push({type:Oe.ANCESTOR,ancestor:g,descendant:h}),qn(e,c,o),e.currentSubject=f,e.compoundCount++,h}else{var m=Rt(),x=Rt(),b=[{type:Oe.ANCESTOR,ancestor:m,descendant:x}];return m.checks=a.checks,a.checks=b,e.compoundCount++,x}}},{name:"subject",modifier:!0,regex:mt.subject,populate:function(e,a){if(e.currentSubject!=null&&e.currentSubject!==a)return Ct("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=a;var n=e[e.length-1],l=n.checks[0],u=l==null?null:l.type;u===Oe.DIRECTED_EDGE?l.type=Oe.NODE_TARGET:u===Oe.UNDIRECTED_EDGE&&(l.type=Oe.NODE_NEIGHBOR,l.node=l.nodes[1],l.neighbor=l.nodes[0],l.nodes=null)}}];Mh.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var UA=function(e){for(var a,n,l,u=0;u<Mh.length;u++){var o=Mh[u],c=o.name,v=e.match(o.regexObj);if(v!=null){n=v,a=o,l=c;var f=v[0];e=e.substring(f.length);break}}return{expr:a,match:n,name:l,remaining:e}},jA=function(e){var a=e.match(/^\s+/);if(a){var n=a[0];e=e.substring(n.length)}return e},PA=function(e){var a=this,n=a.inputText=e,l=a[0]=Rt();for(a.length=1,n=jA(n);;){var u=UA(n);if(u.expr==null)return Ct("The selector `"+e+"`is invalid"),!1;var o=u.match.slice(1),c=u.expr.populate(a,l,o);if(c===!1)return!1;if(c!=null&&(l=c),n=u.remaining,n.match(/^\s*$/))break}var v=a[a.length-1];a.currentSubject!=null&&(v.subject=a.currentSubject),v.edgeCount=a.edgeCount,v.compoundCount=a.compoundCount;for(var f=0;f<a.length;f++){var h=a[f];if(h.compoundCount>0&&h.edgeCount>0)return Ct("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Ct("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Ct("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},HA=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},a=function(h){return Ge(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},l=function(h,g){var m=h.type,x=h.value;switch(m){case Oe.GROUP:{var b=e(x);return b.substring(0,b.length-1)}case Oe.DATA_COMPARE:{var E=h.field,S=h.operator;return"["+E+n(e(S))+a(x)+"]"}case Oe.DATA_BOOL:{var w=h.operator,T=h.field;return"["+e(w)+T+"]"}case Oe.DATA_EXIST:{var C=h.field;return"["+C+"]"}case Oe.META_COMPARE:{var B=h.operator,R=h.field;return"[["+R+n(e(B))+a(x)+"]]"}case Oe.STATE:return x;case Oe.ID:return"#"+x;case Oe.CLASS:return"."+x;case Oe.PARENT:case Oe.CHILD:return u(h.parent,g)+n(">")+u(h.child,g);case Oe.ANCESTOR:case Oe.DESCENDANT:return u(h.ancestor,g)+" "+u(h.descendant,g);case Oe.COMPOUND_SPLIT:{var L=u(h.left,g),A=u(h.subject,g),O=u(h.right,g);return L+(L.length>0?" ":"")+A+O}case Oe.TRUE:return""}},u=function(h,g){return h.checks.reduce(function(m,x,b){return m+(g===h&&b===0?"$":"")+l(x,g)},"")},o="",c=0;c<this.length;c++){var v=this[c];o+=u(v,v.subject),this.length>1&&c<this.length-1&&(o+=", ")}return this.toStringCache=o,o},GA={parse:PA,toString:HA},Nx=function(e,a,n){var l,u=Ge(e),o=Ce(e),c=Ge(n),v,f,h=!1,g=!1,m=!1;switch(a.indexOf("!")>=0&&(a=a.replace("!",""),g=!0),a.indexOf("@")>=0&&(a=a.replace("@",""),h=!0),(u||c||h)&&(v=!u&&!o?"":""+e,f=""+n),h&&(e=v=v.toLowerCase(),n=f=f.toLowerCase()),a){case"*=":l=v.indexOf(f)>=0;break;case"$=":l=v.indexOf(f,v.length-f.length)>=0;break;case"^=":l=v.indexOf(f)===0;break;case"=":l=e===n;break;case">":m=!0,l=e>n;break;case">=":m=!0,l=e>=n;break;case"<":m=!0,l=e<n;break;case"<=":m=!0,l=e<=n;break;default:l=!1;break}return g&&(e!=null||!m)&&(l=!l),l},IA=function(e,a){switch(a){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},YA=function(e){return e!==void 0},ng=function(e,a){return e.data(a)},FA=function(e,a){return e[a]()},Qt=[],Gt=function(e,a){return e.checks.every(function(n){return Qt[n.type](n,a)})};Qt[Oe.GROUP]=function(t,e){var a=t.value;return a==="*"||a===e.group()};Qt[Oe.STATE]=function(t,e){var a=t.value;return qA(a,e)};Qt[Oe.ID]=function(t,e){var a=t.value;return e.id()===a};Qt[Oe.CLASS]=function(t,e){var a=t.value;return e.hasClass(a)};Qt[Oe.META_COMPARE]=function(t,e){var a=t.field,n=t.operator,l=t.value;return Nx(FA(e,a),n,l)};Qt[Oe.DATA_COMPARE]=function(t,e){var a=t.field,n=t.operator,l=t.value;return Nx(ng(e,a),n,l)};Qt[Oe.DATA_BOOL]=function(t,e){var a=t.field,n=t.operator;return IA(ng(e,a),n)};Qt[Oe.DATA_EXIST]=function(t,e){var a=t.field;return t.operator,YA(ng(e,a))};Qt[Oe.UNDIRECTED_EDGE]=function(t,e){var a=t.nodes[0],n=t.nodes[1],l=e.source(),u=e.target();return Gt(a,l)&&Gt(n,u)||Gt(n,l)&&Gt(a,u)};Qt[Oe.NODE_NEIGHBOR]=function(t,e){return Gt(t.node,e)&&e.neighborhood().some(function(a){return a.isNode()&&Gt(t.neighbor,a)})};Qt[Oe.DIRECTED_EDGE]=function(t,e){return Gt(t.source,e.source())&&Gt(t.target,e.target())};Qt[Oe.NODE_SOURCE]=function(t,e){return Gt(t.source,e)&&e.outgoers().some(function(a){return a.isNode()&&Gt(t.target,a)})};Qt[Oe.NODE_TARGET]=function(t,e){return Gt(t.target,e)&&e.incomers().some(function(a){return a.isNode()&&Gt(t.source,a)})};Qt[Oe.CHILD]=function(t,e){return Gt(t.child,e)&&Gt(t.parent,e.parent())};Qt[Oe.PARENT]=function(t,e){return Gt(t.parent,e)&&e.children().some(function(a){return Gt(t.child,a)})};Qt[Oe.DESCENDANT]=function(t,e){return Gt(t.descendant,e)&&e.ancestors().some(function(a){return Gt(t.ancestor,a)})};Qt[Oe.ANCESTOR]=function(t,e){return Gt(t.ancestor,e)&&e.descendants().some(function(a){return Gt(t.descendant,a)})};Qt[Oe.COMPOUND_SPLIT]=function(t,e){return Gt(t.subject,e)&&Gt(t.left,e)&&Gt(t.right,e)};Qt[Oe.TRUE]=function(){return!0};Qt[Oe.COLLECTION]=function(t,e){var a=t.value;return a.has(e)};Qt[Oe.FILTER]=function(t,e){var a=t.value;return a(e)};var XA=function(e){var a=this;if(a.length===1&&a[0].checks.length===1&&a[0].checks[0].type===Oe.ID)return e.getElementById(a[0].checks[0].value).collection();var n=function(u){for(var o=0;o<a.length;o++){var c=a[o];if(Gt(c,u))return!0}return!1};return a.text()==null&&(n=function(){return!0}),e.filter(n)},KA=function(e){for(var a=this,n=0;n<a.length;n++){var l=a[n];if(Gt(l,e))return!0}return!1},ZA={matches:KA,filter:XA},Xn=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ge(e)&&e.match(/^\s*$/)||(nr(e)?this.addQuery({checks:[{type:Oe.COLLECTION,value:e.collection()}]}):Xt(e)?this.addQuery({checks:[{type:Oe.FILTER,value:e}]}):Ge(e)?this.parse(e)||(this.invalid=!0):Yt("A selector must be created from a string; found "))},Kn=Xn.prototype;[GA,ZA].forEach(function(t){return Fe(Kn,t)});Kn.text=function(){return this.inputText};Kn.size=function(){return this.length};Kn.eq=function(t){return this[t]};Kn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Kn.addQuery=function(t){this[this.length++]=t};Kn.selector=Kn.toString;var Hn={allAre:function(e){var a=new Xn(e);return this.every(function(n){return a.matches(n)})},is:function(e){var a=new Xn(e);return this.some(function(n){return a.matches(n)})},some:function(e,a){for(var n=0;n<this.length;n++){var l=a?e.apply(a,[this[n],n,this]):e(this[n],n,this);if(l)return!0}return!1},every:function(e,a){for(var n=0;n<this.length;n++){var l=a?e.apply(a,[this[n],n,this]):e(this[n],n,this);if(!l)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var a=this.length,n=e.length;return a!==n?!1:a===1?this[0]===e[0]:this.every(function(l){return e.hasElementWithId(l.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(a){return e.hasElementWithId(a.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var a=this.neighborhood();return e.every(function(n){return a.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var a=this;return e.every(function(n){return a.hasElementWithId(n.id())})}};Hn.allAreNeighbours=Hn.allAreNeighbors;Hn.has=Hn.contains;Hn.equal=Hn.equals=Hn.same;var yr=function(e,a){return function(l,u,o,c){var v=l,f=this,h;if(v==null?h="":nr(v)&&v.length===1&&(h=v.id()),f.length===1&&h){var g=f[0]._private,m=g.traversalCache=g.traversalCache||{},x=m[a]=m[a]||[],b=Ai(h),E=x[b];return E||(x[b]=e.call(f,l,u,o,c))}else return e.call(f,l,u,o,c)}},kl={parent:function(e){var a=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var l=0;l<this.length;l++){var u=this[l],o=u._private.parent;o&&a.push(o)}return this.spawn(a,!0).filter(e)},parents:function(e){for(var a=[],n=this.parent();n.nonempty();){for(var l=0;l<n.length;l++){var u=n[l];a.push(u)}n=n.parent()}return this.spawn(a,!0).filter(e)},commonAncestors:function(e){for(var a,n=0;n<this.length;n++){var l=this[n],u=l.parents();a=a||u,a=a.intersect(u)}return a.filter(e)},orphans:function(e){return this.stdFilter(function(a){return a.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(a){return a.isChild()}).filter(e)},children:yr(function(t){for(var e=[],a=0;a<this.length;a++)for(var n=this[a],l=n._private.children,u=0;u<l.length;u++)e.push(l[u]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var a=[];function n(l){for(var u=0;u<l.length;u++){var o=l[u];a.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(a,!0).filter(e)}};function ig(t,e,a,n){for(var l=[],u=new _l,o=t.cy(),c=o.hasCompoundNodes(),v=0;v<t.length;v++){var f=t[v];a?l.push(f):c&&n(l,u,f)}for(;l.length>0;){var h=l.shift();e(h),u.add(h.id()),c&&n(l,u,h)}return t}function Mx(t,e,a){if(a.isParent())for(var n=a._private.children,l=0;l<n.length;l++){var u=n[l];e.has(u.id())||t.push(u)}}kl.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ig(this,t,e,Mx)};function Rx(t,e,a){if(a.isChild()){var n=a._private.parent;e.has(n.id())||t.push(n)}}kl.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ig(this,t,e,Rx)};function QA(t,e,a){Rx(t,e,a),Mx(t,e,a)}kl.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ig(this,t,e,QA)};kl.ancestors=kl.parents;var $u,zx;$u=zx={data:Tt.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:Tt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Tt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Tt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Tt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Tt.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};$u.attr=$u.data;$u.removeAttr=$u.removeData;var $A=zx,Sc={};function ch(t){return function(e){var a=this;if(e===void 0&&(e=!0),a.length!==0)if(a.isNode()&&!a.removed()){for(var n=0,l=a[0],u=l._private.edges,o=0;o<u.length;o++){var c=u[o];!e&&c.isLoop()||(n+=t(l,c))}return n}else return}}Fe(Sc,{degree:ch(function(t,e){return e.source().same(e.target())?2:1}),indegree:ch(function(t,e){return e.target().same(t)?1:0}),outdegree:ch(function(t,e){return e.source().same(t)?1:0})});function pl(t,e){return function(a){for(var n,l=this.nodes(),u=0;u<l.length;u++){var o=l[u],c=o[t](a);c!==void 0&&(n===void 0||e(c,n))&&(n=c)}return n}}Fe(Sc,{minDegree:pl("degree",function(t,e){return t<e}),maxDegree:pl("degree",function(t,e){return t>e}),minIndegree:pl("indegree",function(t,e){return t<e}),maxIndegree:pl("indegree",function(t,e){return t>e}),minOutdegree:pl("outdegree",function(t,e){return t<e}),maxOutdegree:pl("outdegree",function(t,e){return t>e})});Fe(Sc,{totalDegree:function(e){for(var a=0,n=this.nodes(),l=0;l<n.length;l++)a+=n[l].degree(e);return a}});var Er,Ox,Lx=function(e,a,n){for(var l=0;l<e.length;l++){var u=e[l];if(!u.locked()){var o=u._private.position,c={x:a.x!=null?a.x-o.x:0,y:a.y!=null?a.y-o.y:0};u.isParent()&&!(c.x===0&&c.y===0)&&u.children().shift(c,n),u.dirtyBoundingBoxCache()}}},Yb={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,a){Lx(e,a,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Er=Ox={position:Tt.data(Yb),silentPosition:Tt.data(Fe({},Yb,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,a){Lx(e,a,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,a){if(yt(e))a?this.silentPosition(e):this.position(e);else if(Xt(e)){var n=e,l=this.cy();l.startBatch();for(var u=0;u<this.length;u++){var o=this[u],c=void 0;(c=n(o,u))&&(a?o.silentPosition(c):o.position(c))}l.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,a,n){var l;if(yt(e)?(l={x:Ce(e.x)?e.x:0,y:Ce(e.y)?e.y:0},n=a):Ge(e)&&Ce(a)&&(l={x:0,y:0},l[e]=a),l!=null){var u=this.cy();u.startBatch();for(var o=0;o<this.length;o++){var c=this[o];if(!(u.hasCompoundNodes()&&c.isChild()&&c.ancestors().anySame(this))){var v=c.position(),f={x:v.x+l.x,y:v.y+l.y};n?c.silentPosition(f):c.position(f)}}u.endBatch()}return this},silentShift:function(e,a){return yt(e)?this.shift(e,!0):Ge(e)&&Ce(a)&&this.shift(e,a,!0),this},renderedPosition:function(e,a){var n=this[0],l=this.cy(),u=l.zoom(),o=l.pan(),c=yt(e)?e:void 0,v=c!==void 0||a!==void 0&&Ge(e);if(n&&n.isNode())if(v)for(var f=0;f<this.length;f++){var h=this[f];a!==void 0?h.position(e,(a-o[e])/u):c!==void 0&&h.position(sx(c,u,o))}else{var g=n.position();return c=pc(g,u,o),e===void 0?c:c[e]}else if(!v)return;return this},relativePosition:function(e,a){var n=this[0],l=this.cy(),u=yt(e)?e:void 0,o=u!==void 0||a!==void 0&&Ge(e),c=l.hasCompoundNodes();if(n&&n.isNode())if(o)for(var v=0;v<this.length;v++){var f=this[v],h=c?f.parent():null,g=h&&h.length>0,m=g;g&&(h=h[0]);var x=m?h.position():{x:0,y:0};a!==void 0?f.position(e,a+x[e]):u!==void 0&&f.position({x:u.x+x.x,y:u.y+x.y})}else{var b=n.position(),E=c?n.parent():null,S=E&&E.length>0,w=S;S&&(E=E[0]);var T=w?E.position():{x:0,y:0};return u={x:b.x-T.x,y:b.y-T.y},e===void 0?u:u[e]}else if(!o)return;return this}};Er.modelPosition=Er.point=Er.position;Er.modelPositions=Er.points=Er.positions;Er.renderedPoint=Er.renderedPosition;Er.relativePoint=Er.relativePosition;var WA=Ox,zl,Wn;zl=Wn={};Wn.renderedBoundingBox=function(t){var e=this.boundingBox(t),a=this.cy(),n=a.zoom(),l=a.pan(),u=e.x1*n+l.x,o=e.x2*n+l.x,c=e.y1*n+l.y,v=e.y2*n+l.y;return{x1:u,x2:o,y1:c,y2:v,w:o-u,h:v-c}};Wn.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(a){if(a.isParent()){var n=a._private;n.compoundBoundsClean=!1,n.bbCache=null,t||a.emitAndNotify("bounds")}}),this)};Wn.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 a(o){if(!o.isParent())return;var c=o._private,v=o.children(),f=o.pstyle("compound-sizing-wrt-labels").value==="include",h={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")}},g=v.boundingBox({includeLabels:f,includeOverlays:!1,useCache:!1}),m=c.position;(g.w===0||g.h===0)&&(g={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},g.x1=m.x-g.w/2,g.x2=m.x+g.w/2,g.y1=m.y-g.h/2,g.y2=m.y+g.h/2);function x(z,U,V){var P=0,H=0,I=U+V;return z>0&&I>0&&(P=U/I*z,H=V/I*z),{biasDiff:P,biasComplementDiff:H}}function b(z,U,V,P){if(V.units==="%")switch(P){case"width":return z>0?V.pfValue*z:0;case"height":return U>0?V.pfValue*U:0;case"average":return z>0&&U>0?V.pfValue*(z+U)/2:0;case"min":return z>0&&U>0?z>U?V.pfValue*U:V.pfValue*z:0;case"max":return z>0&&U>0?z>U?V.pfValue*z:V.pfValue*U:0;default:return 0}else return V.units==="px"?V.pfValue:0}var E=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(E=E*100/h.width.val);var S=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(S=S*100/h.width.val);var w=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(w=w*100/h.height.val);var T=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(T=T*100/h.height.val);var C=x(h.width.val-g.w,E,S),B=C.biasDiff,R=C.biasComplementDiff,L=x(h.height.val-g.h,w,T),A=L.biasDiff,O=L.biasComplementDiff;c.autoPadding=b(g.w,g.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),c.autoWidth=Math.max(g.w,h.width.val),m.x=(-B+g.x1+g.x2+R)/2,c.autoHeight=Math.max(g.h,h.height.val),m.y=(-A+g.y1+g.y2+O)/2}for(var n=0;n<this.length;n++){var l=this[n],u=l._private;(!u.compoundBoundsClean||t)&&(a(l),e.batching()||(u.compoundBoundsClean=!0))}return this};var mr=function(e){return e===1/0||e===-1/0?0:e},Sr=function(e,a,n,l,u){l-a===0||u-n===0||a==null||n==null||l==null||u==null||(e.x1=a<e.x1?a:e.x1,e.x2=l>e.x2?l:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=u>e.y2?u:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Vn=function(e,a){return a==null?e:Sr(e,a.x1,a.y1,a.x2,a.y2)},Lu=function(e,a,n){return Xa(e,a,n)},ko=function(e,a,n){if(!a.cy().headless()){var l=a._private,u=l.rstyle,o=u.arrowWidth/2,c=a.pstyle(n+"-arrow-shape").value,v,f;if(c!=="none"){n==="source"?(v=u.srcX,f=u.srcY):n==="target"?(v=u.tgtX,f=u.tgtY):(v=u.midX,f=u.midY);var h=l.arrowBounds=l.arrowBounds||{},g=h[n]=h[n]||{};g.x1=v-o,g.y1=f-o,g.x2=v+o,g.y2=f+o,g.w=g.x2-g.x1,g.h=g.y2-g.y1,Go(g,1),Sr(e,g.x1,g.y1,g.x2,g.y2)}}},fh=function(e,a,n){if(!a.cy().headless()){var l;n?l=n+"-":l="";var u=a._private,o=u.rstyle,c=a.pstyle(l+"label").strValue;if(c){var v=a.pstyle("text-halign"),f=a.pstyle("text-valign"),h=Lu(o,"labelWidth",n),g=Lu(o,"labelHeight",n),m=Lu(o,"labelX",n),x=Lu(o,"labelY",n),b=a.pstyle(l+"text-margin-x").pfValue,E=a.pstyle(l+"text-margin-y").pfValue,S=a.isEdge(),w=a.pstyle(l+"text-rotation"),T=a.pstyle("text-outline-width").pfValue,C=a.pstyle("text-border-width").pfValue,B=C/2,R=a.pstyle("text-background-padding").pfValue,L=2,A=g,O=h,z=O/2,U=A/2,V,P,H,I;if(S)V=m-z,P=m+z,H=x-U,I=x+U;else{switch(v.value){case"left":V=m-O,P=m;break;case"center":V=m-z,P=m+z;break;case"right":V=m,P=m+O;break}switch(f.value){case"top":H=x-A,I=x;break;case"center":H=x-U,I=x+U;break;case"bottom":H=x,I=x+A;break}}var F=b-Math.max(T,B)-R-L,_=b+Math.max(T,B)+R+L,j=E-Math.max(T,B)-R-L,Y=E+Math.max(T,B)+R+L;V+=F,P+=_,H+=j,I+=Y;var Q=n||"main",W=u.labelBounds,N=W[Q]=W[Q]||{};N.x1=V,N.y1=H,N.x2=P,N.y2=I,N.w=P-V,N.h=I-H,N.leftPad=F,N.rightPad=_,N.topPad=j,N.botPad=Y;var G=S&&w.strValue==="autorotate",Z=w.pfValue!=null&&w.pfValue!==0;if(G||Z){var $=G?Lu(u.rstyle,"labelAngle",n):w.pfValue,ae=Math.cos($),se=Math.sin($),de=(V+P)/2,Se=(H+I)/2;if(!S){switch(v.value){case"left":de=P;break;case"right":de=V;break}switch(f.value){case"top":Se=I;break;case"bottom":Se=H;break}}var fe=function(Xe,He){return Xe=Xe-de,He=He-Se,{x:Xe*ae-He*se+de,y:Xe*se+He*ae+Se}},te=fe(V,H),re=fe(V,I),le=fe(P,H),he=fe(P,I);V=Math.min(te.x,re.x,le.x,he.x),P=Math.max(te.x,re.x,le.x,he.x),H=Math.min(te.y,re.y,le.y,he.y),I=Math.max(te.y,re.y,le.y,he.y)}var Ee=Q+"Rot",ke=W[Ee]=W[Ee]||{};ke.x1=V,ke.y1=H,ke.x2=P,ke.y2=I,ke.w=P-V,ke.h=I-H,Sr(e,V,H,P,I),Sr(u.labelBounds.all,V,H,P,I)}return e}},Fb=function(e,a){if(!a.cy().headless()){var n=a.pstyle("outline-opacity").value,l=a.pstyle("outline-width").value,u=a.pstyle("outline-offset").value,o=l+u;kx(e,a,n,o,"outside",o/2)}},kx=function(e,a,n,l,u,o){if(!(n===0||l<=0||u==="inside")){var c=a.cy(),v=c.renderer(),f=v.nodeShapes[v.getNodeShape(a)];if(f){var h=a.position(),g=h.x,m=h.y,x=a.width(),b=a.height();if(f.hasMiterBounds){u==="center"&&(l/=2);var E=f.miterBounds(g,m,x,b,l);Vn(e,E)}else o!=null&&o>0&&Io(e,[o,o,o,o])}}},JA=function(e,a){if(!a.cy().headless()){var n=a.pstyle("border-opacity").value,l=a.pstyle("border-width").pfValue,u=a.pstyle("border-position").value;kx(e,a,n,l,u)}},eD=function(e,a){var n=e._private.cy,l=n.styleEnabled(),u=n.headless(),o=Va(),c=e._private,v=e.isNode(),f=e.isEdge(),h,g,m,x,b,E,S=c.rstyle,w=v&&l?e.pstyle("bounds-expansion").pfValue:[0],T=function(at){return at.pstyle("display").value!=="none"},C=!l||T(e)&&(!f||T(e.source())&&T(e.target()));if(C){var B=0,R=0;l&&a.includeOverlays&&(B=e.pstyle("overlay-opacity").value,B!==0&&(R=e.pstyle("overlay-padding").value));var L=0,A=0;l&&a.includeUnderlays&&(L=e.pstyle("underlay-opacity").value,L!==0&&(A=e.pstyle("underlay-padding").value));var O=Math.max(R,A),z=0,U=0;if(l&&(z=e.pstyle("width").pfValue,U=z/2),v&&a.includeNodes){var V=e.position();b=V.x,E=V.y;var P=e.outerWidth(),H=P/2,I=e.outerHeight(),F=I/2;h=b-H,g=b+H,m=E-F,x=E+F,Sr(o,h,m,g,x),l&&Fb(o,e),l&&a.includeOutlines&&!u&&Fb(o,e),l&&JA(o,e)}else if(f&&a.includeEdges)if(l&&!u){var _=e.pstyle("curve-style").strValue;if(h=Math.min(S.srcX,S.midX,S.tgtX),g=Math.max(S.srcX,S.midX,S.tgtX),m=Math.min(S.srcY,S.midY,S.tgtY),x=Math.max(S.srcY,S.midY,S.tgtY),h-=U,g+=U,m-=U,x+=U,Sr(o,h,m,g,x),_==="haystack"){var j=S.haystackPts;if(j&&j.length===2){if(h=j[0].x,m=j[0].y,g=j[1].x,x=j[1].y,h>g){var Y=h;h=g,g=Y}if(m>x){var Q=m;m=x,x=Q}Sr(o,h-U,m-U,g+U,x+U)}}else if(_==="bezier"||_==="unbundled-bezier"||Un(_,"segments")||Un(_,"taxi")){var W;switch(_){case"bezier":case"unbundled-bezier":W=S.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":W=S.linePts;break}if(W!=null)for(var N=0;N<W.length;N++){var G=W[N];h=G.x-U,g=G.x+U,m=G.y-U,x=G.y+U,Sr(o,h,m,g,x)}}}else{var Z=e.source(),$=Z.position(),ae=e.target(),se=ae.position();if(h=$.x,g=se.x,m=$.y,x=se.y,h>g){var de=h;h=g,g=de}if(m>x){var Se=m;m=x,x=Se}h-=U,g+=U,m-=U,x+=U,Sr(o,h,m,g,x)}if(l&&a.includeEdges&&f&&(ko(o,e,"mid-source"),ko(o,e,"mid-target"),ko(o,e,"source"),ko(o,e,"target")),l){var fe=e.pstyle("ghost").value==="yes";if(fe){var te=e.pstyle("ghost-offset-x").pfValue,re=e.pstyle("ghost-offset-y").pfValue;Sr(o,o.x1+te,o.y1+re,o.x2+te,o.y2+re)}}var le=c.bodyBounds=c.bodyBounds||{};R0(le,o),Io(le,w),Go(le,1),l&&(h=o.x1,g=o.x2,m=o.y1,x=o.y2,Sr(o,h-O,m-O,g+O,x+O));var he=c.overlayBounds=c.overlayBounds||{};R0(he,o),Io(he,w),Go(he,1);var Ee=c.labelBounds=c.labelBounds||{};Ee.all!=null?kT(Ee.all):Ee.all=Va(),l&&a.includeLabels&&(a.includeMainLabels&&fh(o,e,null),f&&(a.includeSourceLabels&&fh(o,e,"source"),a.includeTargetLabels&&fh(o,e,"target")))}return o.x1=mr(o.x1),o.y1=mr(o.y1),o.x2=mr(o.x2),o.y2=mr(o.y2),o.w=mr(o.x2-o.x1),o.h=mr(o.y2-o.y1),o.w>0&&o.h>0&&C&&(Io(o,w),Go(o,1)),o},_x=function(e){var a=0,n=function(o){return(o?1:0)<<a++},l=0;return l+=n(e.incudeNodes),l+=n(e.includeEdges),l+=n(e.includeLabels),l+=n(e.includeMainLabels),l+=n(e.includeSourceLabels),l+=n(e.includeTargetLabels),l+=n(e.includeOverlays),l+=n(e.includeOutlines),l},qx=function(e){var a=function(c){return Math.round(c)};if(e.isEdge()){var n=e.source().position(),l=e.target().position();return C0([a(n.x),a(n.y),a(l.x),a(l.y)])}else{var u=e.position();return C0([a(u.x),a(u.y)])}},Xb=function(e,a){var n=e._private,l,u=e.isEdge(),o=a==null?Kb:_x(a),c=o===Kb;if(n.bbCache==null?(l=eD(e,Wu),n.bbCache=l,n.bbCachePosKey=qx(e)):l=n.bbCache,!c){var v=e.isNode();l=Va(),(a.includeNodes&&v||a.includeEdges&&!v)&&(a.includeOverlays?Vn(l,n.overlayBounds):Vn(l,n.bodyBounds)),a.includeLabels&&(a.includeMainLabels&&(!u||a.includeSourceLabels&&a.includeTargetLabels)?Vn(l,n.labelBounds.all):(a.includeMainLabels&&Vn(l,n.labelBounds.mainRot),a.includeSourceLabels&&Vn(l,n.labelBounds.sourceRot),a.includeTargetLabels&&Vn(l,n.labelBounds.targetRot))),l.w=l.x2-l.x1,l.h=l.y2-l.y1}return l},Wu={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Kb=_x(Wu),Zb=Ba(Wu);Wn.boundingBox=function(t){var e,a=t===void 0||t.useCache===void 0||t.useCache===!0,n=Ol(function(h){var g=h._private;return g.bbCache==null||g.styleDirty||g.bbCachePosKey!==qx(h)},function(h){return h.id()});if(a&&this.length===1&&!n(this[0]))t===void 0?t=Wu:t=Zb(t),e=Xb(this[0],t);else{e=Va(),t=t||Wu;var l=Zb(t),u=this,o=u.cy(),c=o.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),c&&this.recalculateRenderedStyle(a),this.updateCompoundBounds(!a);for(var v=0;v<u.length;v++){var f=u[v];n(f)&&f.dirtyBoundingBoxCache(),Vn(e,Xb(f,l))}}return e.x1=mr(e.x1),e.y1=mr(e.y1),e.x2=mr(e.x2),e.y2=mr(e.y2),e.w=mr(e.x2-e.x1),e.h=mr(e.y2-e.y1),e};Wn.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Wn.boundingBoxAt=function(t){var e=this.nodes(),a=this.cy(),n=a.hasCompoundNodes(),l=a.collection();if(n&&(l=e.filter(function(f){return f.isParent()}),e=e.not(l)),yt(t)){var u=t;t=function(){return u}}var o=function(h,g){return h._private.bbAtOldPos=t(h,g)},c=function(h){return h._private.bbAtOldPos};a.startBatch(),e.forEach(o).silentPositions(t),n&&(l.dirtyCompoundBoundsCache(),l.dirtyBoundingBoxCache(),l.updateCompoundBounds(!0));var v=LT(this.boundingBox({useCache:!1}));return e.silentPositions(c),n&&(l.dirtyCompoundBoundsCache(),l.dirtyBoundingBoxCache(),l.updateCompoundBounds(!0)),a.endBatch(),v};zl.boundingbox=zl.bb=zl.boundingBox;zl.renderedBoundingbox=zl.renderedBoundingBox;var tD=Wn,Pu,os;Pu=os={};var Vx=function(e){e.uppercaseName=c0(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=c0(e.outerName),Pu[e.name]=function(){var n=this[0],l=n._private,u=l.cy,o=u._private.styleEnabled;if(n)if(o){if(n.isParent())return n.updateCompoundBounds(),l[e.autoName]||0;var c=n.pstyle(e.name);return c.strValue==="label"?(n.recalculateRenderedStyle(),l.rstyle[e.labelName]||0):c.pfValue}else return 1},Pu["outer"+e.uppercaseName]=function(){var n=this[0],l=n._private,u=l.cy,o=u._private.styleEnabled;if(n)if(o){var c=n[e.name](),v=n.pstyle("border-position").value,f;v==="center"?f=n.pstyle("border-width").pfValue:v==="outside"?f=2*n.pstyle("border-width").pfValue:f=0;var h=2*n.padding();return c+f+h}else return 1},Pu["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var l=n[e.name]();return l*this.cy().zoom()}},Pu["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var l=n[e.outerName]();return l*this.cy().zoom()}}};Vx({name:"width"});Vx({name:"height"});os.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};os.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};os.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var aD=os,rD=function(e,a){if(e.isEdge()&&e.takesUpSpace())return a(e)},nD=function(e,a){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return pc(a(e),n.zoom(),n.pan())}},iD=function(e,a){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),l=n.pan(),u=n.zoom();return a(e).map(function(o){return pc(o,u,l)})}},lD=function(e){return e.renderer().getControlPoints(e)},uD=function(e){return e.renderer().getSegmentPoints(e)},sD=function(e){return e.renderer().getSourceEndpoint(e)},oD=function(e){return e.renderer().getTargetEndpoint(e)},cD=function(e){return e.renderer().getEdgeMidpoint(e)},Qb={controlPoints:{get:lD,mult:!0},segmentPoints:{get:uD,mult:!0},sourceEndpoint:{get:sD},targetEndpoint:{get:oD},midpoint:{get:cD}},fD=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},vD=Object.keys(Qb).reduce(function(t,e){var a=Qb[e],n=fD(e);return t[e]=function(){return rD(this,a.get)},a.mult?t[n]=function(){return iD(this,a.get)}:t[n]=function(){return nD(this,a.get)},t},{}),dD=Fe({},WA,tD,aD,vD);var Ux=function(e,a){this.recycle(e,a)};function ku(){return!1}function _o(){return!0}Ux.prototype={instanceString:function(){return"event"},recycle:function(e,a){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=ku,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?_o:ku):e!=null&&e.type?a=e:this.type=e,a!=null&&(this.originalEvent=a.originalEvent,this.type=a.type!=null?a.type:this.type,this.cy=a.cy,this.target=a.target,this.position=a.position,this.renderedPosition=a.renderedPosition,this.namespace=a.namespace,this.layout=a.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,l=this.cy.zoom(),u=this.cy.pan();this.renderedPosition={x:n.x*l+u.x,y:n.y*l+u.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=_o;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=_o;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=_o,this.stopPropagation()},isDefaultPrevented:ku,isPropagationStopped:ku,isImmediatePropagationStopped:ku};var jx=/^([^.]+)(\.(?:[^.]+))?$/,hD=".*",Px={qualifierCompare:function(e,a){return e===a},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},$b=Object.keys(Px),gD={};function Ec(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gD,e=arguments.length>1?arguments[1]:void 0,a=0;a<$b.length;a++){var n=$b[a];this[n]=t[n]||Px[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Zn=Ec.prototype,Hx=function(e,a,n,l,u,o,c){Xt(l)&&(u=l,l=null),c&&(o==null?o=c:o=Fe({},o,c));for(var v=kt(n)?n:n.split(/\s+/),f=0;f<v.length;f++){var h=v[f];if(!In(h)){var g=h.match(jx);if(g){var m=g[1],x=g[2]?g[2]:null,b=a(e,h,m,x,l,u,o);if(b===!1)break}}}},Wb=function(e,a){return e.addEventFields(e.context,a),new Ux(a.type,a)},pD=function(e,a,n){if(SE(n)){a(e,n);return}else if(yt(n)){a(e,Wb(e,n));return}for(var l=kt(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var o=l[u];if(!In(o)){var c=o.match(jx);if(c){var v=c[1],f=c[2]?c[2]:null,h=Wb(e,{type:v,namespace:f,target:e.context});a(e,h)}}}};Zn.on=Zn.addListener=function(t,e,a,n,l){return Hx(this,function(u,o,c,v,f,h,g){Xt(h)&&u.listeners.push({event:o,callback:h,type:c,namespace:v,qualifier:f,conf:g})},t,e,a,n,l),this};Zn.one=function(t,e,a,n){return this.on(t,e,a,n,{one:!0})};Zn.removeListener=Zn.off=function(t,e,a,n){var l=this;this.emitting!==0&&(this.listeners=nT(this.listeners));for(var u=this.listeners,o=function(f){var h=u[f];Hx(l,function(g,m,x,b,E,S){if((h.type===x||t==="*")&&(!b&&h.namespace!==".*"||h.namespace===b)&&(!E||g.qualifierCompare(h.qualifier,E))&&(!S||h.callback===S))return u.splice(f,1),!1},t,e,a,n)},c=u.length-1;c>=0;c--)o(c);return this};Zn.removeAllListeners=function(){return this.removeListener("*")};Zn.emit=Zn.trigger=function(t,e,a){var n=this.listeners,l=n.length;return this.emitting++,kt(e)||(e=[e]),pD(this,function(u,o){a!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:a}],l=n.length);for(var c=function(){var h=n[v];if(h.type===o.type&&(!h.namespace||h.namespace===o.namespace||h.namespace===hD)&&u.eventMatches(u.context,h,o)){var g=[o];e!=null&&lT(g,e),u.beforeEmit(u.context,h,o),h.conf&&h.conf.one&&(u.listeners=u.listeners.filter(function(b){return b!==h}));var m=u.callbackContext(u.context,h,o),x=h.callback.apply(m,g);u.afterEmit(u.context,h,o),x===!1&&(o.stopPropagation(),o.preventDefault())}},v=0;v<l;v++)c();u.bubble(u.context)&&!o.isPropagationStopped()&&u.parent(u.context).emit(o,e)},t),this.emitting--,this};var mD={qualifierCompare:function(e,a){return e==null||a==null?e==null&&a==null:e.sameText(a)},eventMatches:function(e,a,n){var l=a.qualifier;return l!=null?e!==n.target&&rs(n.target)&&l.matches(n.target):!0},addEventFields:function(e,a){a.cy=e.cy(),a.target=e},callbackContext:function(e,a,n){return a.qualifier!=null?n.target:e},beforeEmit:function(e,a){a.conf&&a.conf.once&&a.conf.onceCollection.removeListener(a.event,a.qualifier,a.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},qo=function(e){return Ge(e)?new Xn(e):e},Gx={createEmitter:function(){for(var e=0;e<this.length;e++){var a=this[e],n=a._private;n.emitter||(n.emitter=new Ec(mD,a))}return this},emitter:function(){return this._private.emitter},on:function(e,a,n){for(var l=qo(a),u=0;u<this.length;u++){var o=this[u];o.emitter().on(e,l,n)}return this},removeListener:function(e,a,n){for(var l=qo(a),u=0;u<this.length;u++){var o=this[u];o.emitter().removeListener(e,l,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var a=this[e];a.emitter().removeAllListeners()}return this},one:function(e,a,n){for(var l=qo(a),u=0;u<this.length;u++){var o=this[u];o.emitter().one(e,l,n)}return this},once:function(e,a,n){for(var l=qo(a),u=0;u<this.length;u++){var o=this[u];o.emitter().on(e,l,n,{once:!0,onceCollection:this})}},emit:function(e,a){for(var n=0;n<this.length;n++){var l=this[n];l.emitter().emit(e,a)}return this},emitAndNotify:function(e,a){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,a),this}};Tt.eventAliasesOn(Gx);var Ix={nodes:function(e){return this.filter(function(a){return a.isNode()}).filter(e)},edges:function(e){return this.filter(function(a){return a.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),a=this.spawn(),n=0;n<this.length;n++){var l=this[n];l.isNode()?e.push(l):a.push(l)}return{nodes:e,edges:a}},filter:function(e,a){if(e===void 0)return this;if(Ge(e)||nr(e))return new Xn(e).filter(this);if(Xt(e)){for(var n=this.spawn(),l=this,u=0;u<l.length;u++){var o=l[u],c=a?e.apply(a,[o,u,l]):e(o,u,l);c&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Ge(e)&&(e=this.filter(e));for(var a=this.spawn(),n=0;n<this.length;n++){var l=this[n],u=e.has(l);u||a.push(l)}return a}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ge(e)){var a=e;return this.filter(a)}for(var n=this.spawn(),l=this,u=e,o=this.length<e.length,c=o?l:u,v=o?u:l,f=0;f<c.length;f++){var h=c[f];v.has(h)&&n.push(h)}return n},xor:function(e){var a=this._private.cy;Ge(e)&&(e=a.$(e));var n=this.spawn(),l=this,u=e,o=function(v,f){for(var h=0;h<v.length;h++){var g=v[h],m=g._private.data.id,x=f.hasElementWithId(m);x||n.push(g)}};return o(l,u),o(u,l),n},diff:function(e){var a=this._private.cy;Ge(e)&&(e=a.$(e));var n=this.spawn(),l=this.spawn(),u=this.spawn(),o=this,c=e,v=function(h,g,m){for(var x=0;x<h.length;x++){var b=h[x],E=b._private.data.id,S=g.hasElementWithId(E);S?u.merge(b):m.push(b)}};return v(o,c,n),v(c,o,l),{left:n,right:l,both:u}},add:function(e){var a=this._private.cy;if(!e)return this;if(Ge(e)){var n=e;e=a.mutableElements().filter(n)}for(var l=this.spawnSelf(),u=0;u<e.length;u++){var o=e[u],c=!this.has(o);c&&l.push(o)}return l},merge:function(e){var a=this._private,n=a.cy;if(!e)return this;if(e&&Ge(e)){var l=e;e=n.mutableElements().filter(l)}for(var u=a.map,o=0;o<e.length;o++){var c=e[o],v=c._private.data.id,f=!u.has(v);if(f){var h=this.length++;this[h]=c,u.set(v,{ele:c,index:h})}}return this},unmergeAt:function(e){var a=this[e],n=a.id(),l=this._private,u=l.map;this[e]=void 0,u.delete(n);var o=e===this.length-1;if(this.length>1&&!o){var c=this.length-1,v=this[c],f=v._private.data.id;this[c]=void 0,this[e]=v,u.set(f,{ele:v,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var a=this._private,n=e._private.data.id,l=a.map,u=l.get(n);if(!u)return this;var o=u.index;return this.unmergeAt(o),this},unmerge:function(e){var a=this._private.cy;if(!e)return this;if(e&&Ge(e)){var n=e;e=a.mutableElements().filter(n)}for(var l=0;l<e.length;l++)this.unmergeOne(e[l]);return this},unmergeBy:function(e){for(var a=this.length-1;a>=0;a--){var n=this[a];e(n)&&this.unmergeAt(a)}return this},map:function(e,a){for(var n=[],l=this,u=0;u<l.length;u++){var o=l[u],c=a?e.apply(a,[o,u,l]):e(o,u,l);n.push(c)}return n},reduce:function(e,a){for(var n=a,l=this,u=0;u<l.length;u++)n=e(n,l[u],u,l);return n},max:function(e,a){for(var n=-1/0,l,u=this,o=0;o<u.length;o++){var c=u[o],v=a?e.apply(a,[c,o,u]):e(c,o,u);v>n&&(n=v,l=c)}return{value:n,ele:l}},min:function(e,a){for(var n=1/0,l,u=this,o=0;o<u.length;o++){var c=u[o],v=a?e.apply(a,[c,o,u]):e(c,o,u);v<n&&(n=v,l=c)}return{value:n,ele:l}}},wt=Ix;wt.u=wt["|"]=wt["+"]=wt.union=wt.or=wt.add;wt["\\"]=wt["!"]=wt["-"]=wt.difference=wt.relativeComplement=wt.subtract=wt.not;wt.n=wt["&"]=wt["."]=wt.and=wt.intersection=wt.intersect;wt["^"]=wt["(+)"]=wt["(-)"]=wt.symmetricDifference=wt.symdiff=wt.xor;wt.fnFilter=wt.filterFn=wt.stdFilter=wt.filter;wt.complement=wt.abscomp=wt.absoluteComplement;var yD={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Yx=function(e,a){var n=e.cy(),l=n.hasCompoundNodes();function u(h){var g=h.pstyle("z-compound-depth");return g.value==="auto"?l?h.zDepth():0:g.value==="bottom"?-1:g.value==="top"?Kh:0}var o=u(e)-u(a);if(o!==0)return o;function c(h){var g=h.pstyle("z-index-compare");return g.value==="auto"&&h.isNode()?1:0}var v=c(e)-c(a);if(v!==0)return v;var f=e.pstyle("z-index").value-a.pstyle("z-index").value;return f!==0?f:e.poolIndex()-a.poolIndex()},lc={forEach:function(e,a){if(Xt(e))for(var n=this.length,l=0;l<n;l++){var u=this[l],o=a?e.apply(a,[u,l,this]):e(u,l,this);if(o===!1)break}return this},toArray:function(){for(var e=[],a=0;a<this.length;a++)e.push(this[a]);return e},slice:function(e,a){var n=[],l=this.length;a==null&&(a=l),e==null&&(e=0),e<0&&(e=l+e),a<0&&(a=l+a);for(var u=e;u>=0&&u<a&&u<l;u++)n.push(this[u]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Xt(e))return this;var a=this.toArray().sort(e);return this.spawn(a)},sortByZIndex:function(){return this.sort(Yx)},zDepth:function(){var e=this[0];if(e){var a=e._private,n=a.group;if(n==="nodes"){var l=a.data.parent?e.parents().size():0;return e.isParent()?l:Kh-1}else{var u=a.source,o=a.target,c=u.zDepth(),v=o.zDepth();return Math.max(c,v,0)}}}};lc.each=lc.forEach;var bD=function(){var e="undefined",a=(typeof Symbol>"u"?"undefined":fa(Symbol))!=e&&fa(Symbol.iterator)!=e;a&&(lc[Symbol.iterator]=function(){var n=this,l={value:void 0,done:!1},u=0,o=this.length;return G1({next:function(){return u<o?l.value=n[u++]:(l.value=void 0,l.done=!0),l}},Symbol.iterator,function(){return this})})};bD();var xD=Ba({nodeDimensionsIncludeLabels:!1}),Fo={layoutDimensions:function(e){e=xD(e);var a;if(!this.takesUpSpace())a={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();a={w:n.w,h:n.h}}else a={w:this.outerWidth(),h:this.outerHeight()};return(a.w===0||a.h===0)&&(a.w=a.h=1),a},layoutPositions:function(e,a,n){var l=this.nodes().filter(function(R){return!R.isParent()}),u=this.cy(),o=a.eles,c=function(L){return L.id()},v=Ol(n,c);e.emit({type:"layoutstart",layout:e}),e.animations=[];var f=function(L,A,O){var z={x:A.x1+A.w/2,y:A.y1+A.h/2},U={x:(O.x-z.x)*L,y:(O.y-z.y)*L};return{x:z.x+U.x,y:z.y+U.y}},h=a.spacingFactor&&a.spacingFactor!==1,g=function(){if(!h)return null;for(var L=Va(),A=0;A<l.length;A++){var O=l[A],z=v(O,A);ox(L,z.x,z.y)}return L},m=g(),x=Ol(function(R,L){var A=v(R,L);if(h){var O=Math.abs(a.spacingFactor);A=f(O,m,A)}return a.transform!=null&&(A=a.transform(R,A)),A},c);if(a.animate){for(var b=0;b<l.length;b++){var E=l[b],S=x(E,b),w=a.animateFilter==null||a.animateFilter(E,b);if(w){var T=E.animation({position:S,duration:a.animationDuration,easing:a.animationEasing});e.animations.push(T)}else E.position(S)}if(a.fit){var C=u.animation({fit:{boundingBox:o.boundingBoxAt(x),padding:a.padding},duration:a.animationDuration,easing:a.animationEasing});e.animations.push(C)}else if(a.zoom!==void 0&&a.pan!==void 0){var B=u.animation({zoom:a.zoom,pan:a.pan,duration:a.animationDuration,easing:a.animationEasing});e.animations.push(B)}e.animations.forEach(function(R){return R.play()}),e.one("layoutready",a.ready),e.emit({type:"layoutready",layout:e}),ql.all(e.animations.map(function(R){return R.promise()})).then(function(){e.one("layoutstop",a.stop),e.emit({type:"layoutstop",layout:e})})}else l.positions(x),a.fit&&u.fit(a.eles,a.padding),a.zoom!=null&&u.zoom(a.zoom),a.pan&&u.pan(a.pan),e.one("layoutready",a.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",a.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var a=this.cy();return a.makeLayout(Fe({},e,{eles:this}))}};Fo.createLayout=Fo.makeLayout=Fo.layout;function Fx(t,e,a){var n=a._private,l=n.styleCache=n.styleCache||[],u;return(u=l[t])!=null||(u=l[t]=e(a)),u}function Tc(t,e){return t=Ai(t),function(n){return Fx(t,e,n)}}function Cc(t,e){t=Ai(t);var a=function(l){return e.call(l)};return function(){var l=this[0];if(l)return Fx(t,a,l)}}var Aa={recalculateRenderedStyle:function(e){var a=this.cy(),n=a.renderer(),l=a.styleEnabled();return n&&l&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),a=function(u){return u._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(a)}else this.forEach(function(l){a(l),l.connectedEdges().forEach(a)});return this},updateStyle:function(e){var a=this._private.cy;if(!a.styleEnabled())return this;if(a.batching()){var n=a._private.batchStyleEles;return n.merge(this),this}var l=a.hasCompoundNodes(),u=this;e=!!(e||e===void 0),l&&(u=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=u;return e?o.emitAndNotify("style"):o.emit("style"),u.forEach(function(c){return c._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var a=0;a<this.length;a++){var n=this[a];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],l=n.cy();if(l.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,l.style().apply(n));var u=n._private.style[e];return u??(a?l.style().getDefaultProperty(e):null)}},numericStyle:function(e){var a=this[0];if(a.cy().styleEnabled()&&a){var n=a.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var a=this[0];if(a.cy().styleEnabled()&&a)return a.pstyle(e).units},renderedStyle:function(e){var a=this.cy();if(!a.styleEnabled())return this;var n=this[0];if(n)return a.style().getRenderedStyle(n,e)},style:function(e,a){var n=this.cy();if(!n.styleEnabled())return this;var l=!1,u=n.style();if(yt(e)){var o=e;u.applyBypass(this,o,l),this.emitAndNotify("style")}else if(Ge(e))if(a===void 0){var c=this[0];return c?u.getStylePropertyValue(c,e):void 0}else u.applyBypass(this,e,a,l),this.emitAndNotify("style");else if(e===void 0){var v=this[0];return v?u.getRawStyle(v):void 0}return this},removeStyle:function(e){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,l=a.style(),u=this;if(e===void 0)for(var o=0;o<u.length;o++){var c=u[o];l.removeAllBypasses(c,n)}else{e=e.split(/\s+/);for(var v=0;v<u.length;v++){var f=u[v];l.removeBypasses(f,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var a=e.hasCompoundNodes(),n=this[0];if(n){var l=n._private,u=n.pstyle("opacity").value;if(!a)return u;var o=l.data.parent?n.parents():null;if(o)for(var c=0;c<o.length;c++){var v=o[c],f=v.pstyle("opacity").value;u=f*u}return u}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var a=this[0],n=a.cy().hasCompoundNodes();if(a)return n?a.effectiveOpacity()===0:a.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var a=this[0];return!!a._private.backgrounding}};function vh(t,e){var a=t._private,n=a.data.parent?t.parents():null;if(n)for(var l=0;l<n.length;l++){var u=n[l];if(!e(u))return!1}return!0}function lg(t){var e=t.ok,a=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var l=this.cy();if(!l.styleEnabled())return!0;var u=this[0],o=l.hasCompoundNodes();if(u){var c=u._private;if(!e(u))return!1;if(u.isNode())return!o||vh(u,n);var v=c.source,f=c.target;return a(v)&&(!o||vh(v,a))&&(v===f||a(f)&&(!o||vh(f,a)))}}}var Vl=Tc("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Aa.takesUpSpace=Cc("takesUpSpace",lg({ok:Vl}));var wD=Tc("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Vl(t)}),SD=Tc("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Vl(t)});Aa.interactive=Cc("interactive",lg({ok:wD,parentOk:SD,edgeOkViaNode:Vl}));Aa.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var ED=Tc("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Vl(t)}),TD=Vl;Aa.visible=Cc("visible",lg({ok:ED,edgeOkViaNode:TD}));Aa.hidden=function(){var t=this[0];if(t)return!t.visible()};Aa.isBundledBezier=Cc("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});Aa.bypass=Aa.css=Aa.style;Aa.renderedCss=Aa.renderedStyle;Aa.removeBypass=Aa.removeCss=Aa.removeStyle;Aa.pstyle=Aa.parsedStyle;var Gn={};function Jb(t){return function(){var e=arguments,a=[];if(e.length===2){var n=e[0],l=e[1];this.on(t.event,n,l)}else if(e.length===1&&Xt(e[0])){var u=e[0];this.on(t.event,u)}else if(e.length===0||e.length===1&&kt(e[0])){for(var o=e.length===1?e[0]:null,c=0;c<this.length;c++){var v=this[c],f=!t.ableField||v._private[t.ableField],h=v._private[t.field]!=t.value;if(t.overrideAble){var g=t.overrideAble(v);if(g!==void 0&&(f=g,!g))return this}f&&(v._private[t.field]=t.value,h&&a.push(v))}var m=this.spawn(a);m.updateStyle(),m.emit(t.event),o&&m.emit(o)}return this}}function Ul(t){Gn[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var a=t.overrideField(e);if(a!==void 0)return a}return e._private[t.field]}},Gn[t.on]=Jb({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Gn[t.off]=Jb({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Ul({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Ul({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Ul({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Ul({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Gn.deselect=Gn.unselect;Gn.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Ul({field:"active",on:"activate",off:"unactivate"});Ul({field:"pannable",on:"panify",off:"unpanify"});Gn.inactive=function(){var t=this[0];if(t)return!t._private.active};var Oa={},e1=function(e){return function(n){for(var l=this,u=[],o=0;o<l.length;o++){var c=l[o];if(c.isNode()){for(var v=!1,f=c.connectedEdges(),h=0;h<f.length;h++){var g=f[h],m=g.source(),x=g.target();if(e.noIncomingEdges&&x===c&&m!==c||e.noOutgoingEdges&&m===c&&x!==c){v=!0;break}}v||u.push(c)}}return this.spawn(u,!0).filter(n)}},t1=function(e){return function(a){for(var n=this,l=[],u=0;u<n.length;u++){var o=n[u];if(o.isNode())for(var c=o.connectedEdges(),v=0;v<c.length;v++){var f=c[v],h=f.source(),g=f.target();e.outgoing&&h===o?(l.push(f),l.push(g)):e.incoming&&g===o&&(l.push(f),l.push(h))}}return this.spawn(l,!0).filter(a)}},a1=function(e){return function(a){for(var n=this,l=[],u={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var c=!1,v=0;v<o.length;v++){var f=o[v],h=f.id();u[h]||(u[h]=!0,l.push(f),c=!0)}if(!c)break;n=o}return this.spawn(l,!0).filter(a)}};Oa.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Fe(Oa,{roots:e1({noIncomingEdges:!0}),leaves:e1({noOutgoingEdges:!0}),outgoers:yr(t1({outgoing:!0}),"outgoers"),successors:a1({outgoing:!0}),incomers:yr(t1({incoming:!0}),"incomers"),predecessors:a1({})});Fe(Oa,{neighborhood:yr(function(t){for(var e=[],a=this.nodes(),n=0;n<a.length;n++)for(var l=a[n],u=l.connectedEdges(),o=0;o<u.length;o++){var c=u[o],v=c.source(),f=c.target(),h=l===v?f:v;h.length>0&&e.push(h[0]),e.push(c[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)}});Oa.neighbourhood=Oa.neighborhood;Oa.closedNeighbourhood=Oa.closedNeighborhood;Oa.openNeighbourhood=Oa.openNeighborhood;Fe(Oa,{source:yr(function(e){var a=this[0],n;return a&&(n=a._private.source||a.cy().collection()),n&&e?n.filter(e):n},"source"),target:yr(function(e){var a=this[0],n;return a&&(n=a._private.target||a.cy().collection()),n&&e?n.filter(e):n},"target"),sources:r1({attr:"source"}),targets:r1({attr:"target"})});function r1(t){return function(a){for(var n=[],l=0;l<this.length;l++){var u=this[l],o=u._private[t.attr];o&&n.push(o)}return this.spawn(n,!0).filter(a)}}Fe(Oa,{edgesWith:yr(n1(),"edgesWith"),edgesTo:yr(n1({thisIsSrc:!0}),"edgesTo")});function n1(t){return function(a){var n=[],l=this._private.cy,u=t||{};Ge(a)&&(a=l.$(a));for(var o=0;o<a.length;o++)for(var c=a[o]._private.edges,v=0;v<c.length;v++){var f=c[v],h=f._private.data,g=this.hasElementWithId(h.source)&&a.hasElementWithId(h.target),m=a.hasElementWithId(h.source)&&this.hasElementWithId(h.target),x=g||m;x&&((u.thisIsSrc||u.thisIsTgt)&&(u.thisIsSrc&&!g||u.thisIsTgt&&!m)||n.push(f))}return this.spawn(n,!0)}}Fe(Oa,{connectedEdges:yr(function(t){for(var e=[],a=this,n=0;n<a.length;n++){var l=a[n];if(l.isNode())for(var u=l._private.edges,o=0;o<u.length;o++){var c=u[o];e.push(c)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:yr(function(t){for(var e=[],a=this,n=0;n<a.length;n++){var l=a[n];l.isEdge()&&(e.push(l.source()[0]),e.push(l.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:yr(i1(),"parallelEdges"),codirectedEdges:yr(i1({codirected:!0}),"codirectedEdges")});function i1(t){var e={codirected:!1};return t=Fe({},e,t),function(n){for(var l=[],u=this.edges(),o=t,c=0;c<u.length;c++)for(var v=u[c],f=v._private,h=f.source,g=h._private.data.id,m=f.data.target,x=h._private.edges,b=0;b<x.length;b++){var E=x[b],S=E._private.data,w=S.target,T=S.source,C=w===m&&T===g,B=g===w&&m===T;(o.codirected&&C||!o.codirected&&(C||B))&&l.push(E)}return this.spawn(l,!0).filter(n)}}Fe(Oa,{components:function(e){var a=this,n=a.cy(),l=n.collection(),u=e==null?a.nodes():e.nodes(),o=[];e!=null&&u.empty()&&(u=e.sources());var c=function(h,g){l.merge(h),u.unmerge(h),g.merge(h)};if(u.empty())return a.spawn();var v=function(){var h=n.collection();o.push(h);var g=u[0];c(g,h),a.bfs({directed:!1,roots:g,visit:function(x){return c(x,h)}}),h.forEach(function(m){m.connectedEdges().forEach(function(x){a.has(x)&&h.has(x.source())&&h.has(x.target())&&h.merge(x)})})};do v();while(u.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Oa.componentsOf=Oa.components;var Da=function(e,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Yt("A collection must have a reference to the core");return}var u=new an,o=!1;if(!a)a=[];else if(a.length>0&&yt(a[0])&&!rs(a[0])){o=!0;for(var c=[],v=new _l,f=0,h=a.length;f<h;f++){var g=a[f];g.data==null&&(g.data={});var m=g.data;if(m.id==null)m.id=lx();else if(e.hasElementWithId(m.id)||v.has(m.id))continue;var x=new gc(e,g,!1);c.push(x),v.add(m.id)}a=c}this.length=0;for(var b=0,E=a.length;b<E;b++){var S=a[b][0];if(S!=null){var w=S._private.data.id;(!n||!u.has(w))&&(n&&u.set(w,{index:this.length,ele:S}),this[this.length]=S,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(T){this.lazyMap=T},rebuildMap:function(){for(var C=this.lazyMap=new an,B=this.eles,R=0;R<B.length;R++){var L=B[R];C.set(L.id(),{index:R,ele:L})}}},n&&(this._private.map=u),o&&!l&&this.restore()},Ut=gc.prototype=Da.prototype=Object.create(Array.prototype);Ut.instanceString=function(){return"collection"};Ut.spawn=function(t,e){return new Da(this.cy(),t,e)};Ut.spawnSelf=function(){return this.spawn(this)};Ut.cy=function(){return this._private.cy};Ut.renderer=function(){return this._private.cy.renderer()};Ut.element=function(){return this[0]};Ut.collection=function(){return F1(this)?this:new Da(this._private.cy,[this])};Ut.unique=function(){return new Da(this._private.cy,this,!0)};Ut.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};Ut.getElementById=function(t){t=""+t;var e=this._private.cy,a=this._private.map.get(t);return a?a.ele:new Da(e)};Ut.$id=Ut.getElementById;Ut.poolIndex=function(){var t=this._private.cy,e=t._private.elements,a=this[0]._private.data.id;return e._private.map.get(a).index};Ut.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};Ut.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};Ut.json=function(t){var e=this.element(),a=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(yt(t)){if(a.startBatch(),t.data){e.data(t.data);var l=n.data;if(e.isEdge()){var u=!1,o={},c=t.data.source,v=t.data.target;c!=null&&c!=l.source&&(o.source=""+c,u=!0),v!=null&&v!=l.target&&(o.target=""+v,u=!0),u&&(e=e.move(o))}else{var f="parent"in t.data,h=t.data.parent;f&&(h!=null||l.parent!=null)&&h!=l.parent&&(h===void 0&&(h=null),h!=null&&(h=""+h),e=e.move({parent:h}))}}t.position&&e.position(t.position);var g=function(E,S,w){var T=t[E];T!=null&&T!==n[E]&&(T?e[S]():e[w]())};return g("removed","remove","restore"),g("selected","select","unselect"),g("selectable","selectify","unselectify"),g("locked","lock","unlock"),g("grabbable","grabify","ungrabify"),g("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),a.endBatch(),this}else if(t===void 0){var m={data:Or(n.data),position:Or(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};m.classes="";var x=0;return n.classes.forEach(function(b){return m.classes+=x++===0?b:" "+b}),m}}};Ut.jsons=function(){for(var t=[],e=0;e<this.length;e++){var a=this[e],n=a.json();t.push(n)}return t};Ut.clone=function(){for(var t=this.cy(),e=[],a=0;a<this.length;a++){var n=this[a],l=n.json(),u=new gc(t,l,!1);e.push(u)}return new Da(t,e)};Ut.copy=Ut.clone;Ut.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this,n=a.cy(),l=n._private,u=[],o=[],c,v=0,f=a.length;v<f;v++){var h=a[v];e&&!h.removed()||(h.isNode()?u.push(h):o.push(h))}c=u.concat(o);var g,m=function(){c.splice(g,1),g--};for(g=0;g<c.length;g++){var x=c[g],b=x._private,E=b.data;if(x.clearTraversalCache(),!(!e&&!b.removed)){if(E.id===void 0)E.id=lx();else if(Ce(E.id))E.id=""+E.id;else if(In(E.id)||!Ge(E.id)){Yt("Can not create element with invalid string ID `"+E.id+"`"),m();continue}else if(n.hasElementWithId(E.id)){Yt("Can not create second element with ID `"+E.id+"`"),m();continue}}var S=E.id;if(x.isNode()){var w=b.position;w.x==null&&(w.x=0),w.y==null&&(w.y=0)}if(x.isEdge()){for(var T=x,C=["source","target"],B=C.length,R=!1,L=0;L<B;L++){var A=C[L],O=E[A];Ce(O)&&(O=E[A]=""+E[A]),O==null||O===""?(Yt("Can not create edge `"+S+"` with unspecified "+A),R=!0):n.hasElementWithId(O)||(Yt("Can not create edge `"+S+"` with nonexistent "+A+" `"+O+"`"),R=!0)}if(R){m();continue}var z=n.getElementById(E.source),U=n.getElementById(E.target);z.same(U)?z._private.edges.push(T):(z._private.edges.push(T),U._private.edges.push(T)),T._private.source=z,T._private.target=U}b.map=new an,b.map.set(S,{ele:x,index:0}),b.removed=!1,e&&n.addToPool(x)}for(var V=0;V<u.length;V++){var P=u[V],H=P._private.data;Ce(H.parent)&&(H.parent=""+H.parent);var I=H.parent,F=I!=null;if(F||P._private.parent){var _=P._private.parent?n.collection().merge(P._private.parent):n.getElementById(I);if(_.empty())H.parent=void 0;else if(_[0].removed())Ct("Node added with missing parent, reference to parent removed"),H.parent=void 0,P._private.parent=null;else{for(var j=!1,Y=_;!Y.empty();){if(P.same(Y)){j=!0,H.parent=void 0;break}Y=Y.parent()}j||(_[0]._private.children.push(P),P._private.parent=_[0],l.hasCompoundNodes=!0)}}}if(c.length>0){for(var Q=c.length===a.length?a:new Da(n,c),W=0;W<Q.length;W++){var N=Q[W];N.isNode()||(N.parallelEdges().clearTraversalCache(),N.source().clearTraversalCache(),N.target().clearTraversalCache())}var G;l.hasCompoundNodes?G=n.collection().merge(Q).merge(Q.connectedNodes()).merge(Q.parent()):G=Q,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?Q.emitAndNotify("add"):e&&Q.emit("add")}return a};Ut.removed=function(){var t=this[0];return t&&t._private.removed};Ut.inside=function(){var t=this[0];return t&&!t._private.removed};Ut.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this,n=[],l={},u=a._private.cy;function o(I){for(var F=I._private.edges,_=0;_<F.length;_++)v(F[_])}function c(I){for(var F=I._private.children,_=0;_<F.length;_++)v(F[_])}function v(I){var F=l[I.id()];e&&I.removed()||F||(l[I.id()]=!0,I.isNode()?(n.push(I),o(I),c(I)):n.unshift(I))}for(var f=0,h=a.length;f<h;f++){var g=a[f];v(g)}function m(I,F){var _=I._private.edges;Yn(_,F),I.clearTraversalCache()}function x(I){I.clearTraversalCache()}var b=[];b.ids={};function E(I,F){F=F[0],I=I[0];var _=I._private.children,j=I.id();Yn(_,F),F._private.parent=null,b.ids[j]||(b.ids[j]=!0,b.push(I))}a.dirtyCompoundBoundsCache(),e&&u.removeFromPool(n);for(var S=0;S<n.length;S++){var w=n[S];if(w.isEdge()){var T=w.source()[0],C=w.target()[0];m(T,w),m(C,w);for(var B=w.parallelEdges(),R=0;R<B.length;R++){var L=B[R];x(L),L.isBundledBezier()&&L.dirtyBoundingBoxCache()}}else{var A=w.parent();A.length!==0&&E(A,w)}e&&(w._private.removed=!0)}var O=u._private.elements;u._private.hasCompoundNodes=!1;for(var z=0;z<O.length;z++){var U=O[z];if(U.isParent()){u._private.hasCompoundNodes=!0;break}}var V=new Da(this.cy(),n);V.size()>0&&(t?V.emitAndNotify("remove"):e&&V.emit("remove"));for(var P=0;P<b.length;P++){var H=b[P];(!e||!H.removed())&&H.updateStyle()}return V};Ut.move=function(t){var e=this._private.cy,a=this,n=!1,l=!1,u=function(b){return b==null?b:""+b};if(t.source!==void 0||t.target!==void 0){var o=u(t.source),c=u(t.target),v=o!=null&&e.hasElementWithId(o),f=c!=null&&e.hasElementWithId(c);(v||f)&&(e.batch(function(){a.remove(n,l),a.emitAndNotify("moveout");for(var x=0;x<a.length;x++){var b=a[x],E=b._private.data;b.isEdge()&&(v&&(E.source=o),f&&(E.target=c))}a.restore(n,l)}),a.emitAndNotify("move"))}else if(t.parent!==void 0){var h=u(t.parent),g=h===null||e.hasElementWithId(h);if(g){var m=h===null?void 0:h;e.batch(function(){var x=a.remove(n,l);x.emitAndNotify("moveout");for(var b=0;b<a.length;b++){var E=a[b],S=E._private.data;E.isNode()&&(S.parent=m)}x.restore(n,l)}),a.emitAndNotify("move")}}return this};[yx,kA,Yo,Hn,kl,$A,Sc,dD,Gx,Ix,yD,lc,Fo,Aa,Gn,Oa].forEach(function(t){Fe(Ut,t)});var CD={add:function(e){var a,n=this;if(nr(e)){var l=e;if(l._private.cy===n)a=l.restore();else{for(var u=[],o=0;o<l.length;o++){var c=l[o];u.push(c.json())}a=new Da(n,u)}}else if(kt(e)){var v=e;a=new Da(n,v)}else if(yt(e)&&(kt(e.nodes)||kt(e.edges))){for(var f=e,h=[],g=["nodes","edges"],m=0,x=g.length;m<x;m++){var b=g[m],E=f[b];if(kt(E))for(var S=0,w=E.length;S<w;S++){var T=Fe({group:b},E[S]);h.push(T)}}a=new Da(n,h)}else{var C=e;a=new gc(n,C).collection()}return a},remove:function(e){if(!nr(e)){if(Ge(e)){var a=e;e=this.$(a)}}return e.remove()}};function AD(t,e,a,n){var l=4,u=.001,o=1e-7,c=10,v=11,f=1/(v-1),h=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var g=0;g<4;++g)if(typeof arguments[g]!="number"||isNaN(arguments[g])||!isFinite(arguments[g]))return!1;t=Math.min(t,1),a=Math.min(a,1),t=Math.max(t,0),a=Math.max(a,0);var m=h?new Float32Array(v):new Array(v);function x(U,V){return 1-3*V+3*U}function b(U,V){return 3*V-6*U}function E(U){return 3*U}function S(U,V,P){return((x(V,P)*U+b(V,P))*U+E(V))*U}function w(U,V,P){return 3*x(V,P)*U*U+2*b(V,P)*U+E(V)}function T(U,V){for(var P=0;P<l;++P){var H=w(V,t,a);if(H===0)return V;var I=S(V,t,a)-U;V-=I/H}return V}function C(){for(var U=0;U<v;++U)m[U]=S(U*f,t,a)}function B(U,V,P){var H,I,F=0;do I=V+(P-V)/2,H=S(I,t,a)-U,H>0?P=I:V=I;while(Math.abs(H)>o&&++F<c);return I}function R(U){for(var V=0,P=1,H=v-1;P!==H&&m[P]<=U;++P)V+=f;--P;var I=(U-m[P])/(m[P+1]-m[P]),F=V+I*f,_=w(F,t,a);return _>=u?T(U,F):_===0?F:B(U,V,V+f)}var L=!1;function A(){L=!0,(t!==e||a!==n)&&C()}var O=function(V){return L||A(),t===e&&a===n?V:V===0?0:V===1?1:S(R(V),e,n)};O.getControlPoints=function(){return[{x:t,y:e},{x:a,y:n}]};var z="generateBezier("+[t,e,a,n]+")";return O.toString=function(){return z},O}var DD=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,l,u){var o={x:n.x+u.dx*l,v:n.v+u.dv*l,tension:n.tension,friction:n.friction};return{dx:o.v,dv:t(o)}}function a(n,l){var u={dx:n.v,dv:t(n)},o=e(n,l*.5,u),c=e(n,l*.5,o),v=e(n,l,c),f=1/6*(u.dx+2*(o.dx+c.dx)+v.dx),h=1/6*(u.dv+2*(o.dv+c.dv)+v.dv);return n.x=n.x+f*l,n.v=n.v+h*l,n}return function n(l,u,o){var c={x:-1,v:0,tension:null,friction:null},v=[0],f=0,h=1/1e4,g=16/1e3,m,x,b;for(l=parseFloat(l)||500,u=parseFloat(u)||20,o=o||null,c.tension=l,c.friction=u,m=o!==null,m?(f=n(l,u),x=f/o*g):x=g;b=a(b||c,x),v.push(1+b.x),f+=16,Math.abs(b.x)>h&&Math.abs(b.v)>h;);return m?function(E){return v[E*(v.length-1)|0]}:f}})(),Vt=function(e,a,n,l){var u=AD(e,a,n,l);return function(o,c,v){return o+(c-o)*u(v)}},Xo={linear:function(e,a,n){return e+(a-e)*n},ease:Vt(.25,.1,.25,1),"ease-in":Vt(.42,0,1,1),"ease-out":Vt(0,0,.58,1),"ease-in-out":Vt(.42,0,.58,1),"ease-in-sine":Vt(.47,0,.745,.715),"ease-out-sine":Vt(.39,.575,.565,1),"ease-in-out-sine":Vt(.445,.05,.55,.95),"ease-in-quad":Vt(.55,.085,.68,.53),"ease-out-quad":Vt(.25,.46,.45,.94),"ease-in-out-quad":Vt(.455,.03,.515,.955),"ease-in-cubic":Vt(.55,.055,.675,.19),"ease-out-cubic":Vt(.215,.61,.355,1),"ease-in-out-cubic":Vt(.645,.045,.355,1),"ease-in-quart":Vt(.895,.03,.685,.22),"ease-out-quart":Vt(.165,.84,.44,1),"ease-in-out-quart":Vt(.77,0,.175,1),"ease-in-quint":Vt(.755,.05,.855,.06),"ease-out-quint":Vt(.23,1,.32,1),"ease-in-out-quint":Vt(.86,0,.07,1),"ease-in-expo":Vt(.95,.05,.795,.035),"ease-out-expo":Vt(.19,1,.22,1),"ease-in-out-expo":Vt(1,0,0,1),"ease-in-circ":Vt(.6,.04,.98,.335),"ease-out-circ":Vt(.075,.82,.165,1),"ease-in-out-circ":Vt(.785,.135,.15,.86),spring:function(e,a,n){if(n===0)return Xo.linear;var l=DD(e,a,n);return function(u,o,c){return u+(o-u)*l(c)}},"cubic-bezier":Vt};function l1(t,e,a,n,l){if(n===1||e===a)return a;var u=l(e,a,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 u1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function ml(t,e,a,n,l){var u=l!=null?l.type:null;a<0?a=0:a>1&&(a=1);var o=u1(t,l),c=u1(e,l);if(Ce(o)&&Ce(c))return l1(u,o,c,a,n);if(kt(o)&&kt(c)){for(var v=[],f=0;f<c.length;f++){var h=o[f],g=c[f];if(h!=null&&g!=null){var m=l1(u,h,g,a,n);v.push(m)}else v.push(g)}return v}}function BD(t,e,a,n){var l=!n,u=t._private,o=e._private,c=o.easing,v=o.startTime,f=n?t:t.cy(),h=f.style();if(!o.easingImpl)if(c==null)o.easingImpl=Xo.linear;else{var g;if(Ge(c)){var m=h.parse("transition-timing-function",c);g=m.value}else g=c;var x,b;Ge(g)?(x=g,b=[]):(x=g[1],b=g.slice(2).map(function(Q){return+Q})),b.length>0?(x==="spring"&&b.push(o.duration),o.easingImpl=Xo[x].apply(null,b)):o.easingImpl=Xo[x]}var E=o.easingImpl,S;if(o.duration===0?S=1:S=(a-v)/o.duration,o.applying&&(S=o.progress),S<0?S=0:S>1&&(S=1),o.delay==null){var w=o.startPosition,T=o.position;if(T&&l&&!t.locked()){var C={};_u(w.x,T.x)&&(C.x=ml(w.x,T.x,S,E)),_u(w.y,T.y)&&(C.y=ml(w.y,T.y,S,E)),t.position(C)}var B=o.startPan,R=o.pan,L=u.pan,A=R!=null&&n;A&&(_u(B.x,R.x)&&(L.x=ml(B.x,R.x,S,E)),_u(B.y,R.y)&&(L.y=ml(B.y,R.y,S,E)),t.emit("pan"));var O=o.startZoom,z=o.zoom,U=z!=null&&n;U&&(_u(O,z)&&(u.zoom=Zu(u.minZoom,ml(O,z,S,E),u.maxZoom)),t.emit("zoom")),(A||U)&&t.emit("viewport");var V=o.style;if(V&&V.length>0&&l){for(var P=0;P<V.length;P++){var H=V[P],I=H.name,F=H,_=o.startStyle[I],j=h.properties[_.name],Y=ml(_,F,S,E,j);h.overrideBypass(t,I,Y)}t.emit("style")}}return o.progress=S,S}function _u(t,e){return t==null||e==null?!1:Ce(t)&&Ce(e)?!0:!!(t&&e)}function ND(t,e,a,n){var l=e._private;l.started=!0,l.startTime=a-l.progress*l.duration}function s1(t,e){var a=e._private.aniEles,n=[];function l(h,g){var m=h._private,x=m.animation.current,b=m.animation.queue,E=!1;if(x.length===0){var S=b.shift();S&&x.push(S)}for(var w=function(L){for(var A=L.length-1;A>=0;A--){var O=L[A];O()}L.splice(0,L.length)},T=x.length-1;T>=0;T--){var C=x[T],B=C._private;if(B.stopped){x.splice(T,1),B.hooked=!1,B.playing=!1,B.started=!1,w(B.frames);continue}!B.playing&&!B.applying||(B.playing&&B.applying&&(B.applying=!1),B.started||ND(h,C,t),BD(h,C,t,g),B.applying&&(B.applying=!1),w(B.frames),B.step!=null&&B.step(t),C.completed()&&(x.splice(T,1),B.hooked=!1,B.playing=!1,B.started=!1,w(B.completes)),E=!0)}return!g&&x.length===0&&b.length===0&&n.push(h),E}for(var u=!1,o=0;o<a.length;o++){var c=a[o],v=l(c);u=u||v}var f=l(e,!0);(u||f)&&(a.length>0?e.notify("draw",a):e.notify("draw")),a.unmerge(n),e.emit("step")}var MD={animate:Tt.animate(),animation:Tt.animation(),animated:Tt.animated(),clearQueue:Tt.clearQueue(),delay:Tt.delay(),delayAnimation:Tt.delayAnimation(),stop:Tt.stop(),addToAnimationPool:function(e){var a=this;a.styleEnabled()&&a._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function a(){e._private.animationsRunning&&tc(function(u){s1(u,e),a()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(u,o){s1(o,e)},n.beforeRenderPriorities.animations):a()}},RD={qualifierCompare:function(e,a){return e==null||a==null?e==null&&a==null:e.sameText(a)},eventMatches:function(e,a,n){var l=a.qualifier;return l!=null?e!==n.target&&rs(n.target)&&l.matches(n.target):!0},addEventFields:function(e,a){a.cy=e,a.target=e},callbackContext:function(e,a,n){return a.qualifier!=null?n.target:e}},Vo=function(e){return Ge(e)?new Xn(e):e},Xx={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ec(RD,this)),this},emitter:function(){return this._private.emitter},on:function(e,a,n){return this.emitter().on(e,Vo(a),n),this},removeListener:function(e,a,n){return this.emitter().removeListener(e,Vo(a),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,a,n){return this.emitter().one(e,Vo(a),n),this},once:function(e,a,n){return this.emitter().one(e,Vo(a),n),this},emit:function(e,a){return this.emitter().emit(e,a),this},emitAndNotify:function(e,a){return this.emit(e),this.notify(e,a),this}};Tt.eventAliasesOn(Xx);var Rh={png:function(e){var a=this._private.renderer;return e=e||{},a.png(e)},jpg:function(e){var a=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",a.jpg(e)}};Rh.jpeg=Rh.jpg;var Ko={layout:function(e){var a=this;if(e==null){Yt("Layout options must be specified to make a layout");return}if(e.name==null){Yt("A `name` must be specified to make a layout");return}var n=e.name,l=a.extension("layout",n);if(l==null){Yt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var u;Ge(e.eles)?u=a.$(e.eles):u=e.eles!=null?e.eles:a.$();var o=new l(Fe({},e,{cy:a,eles:u}));return o}};Ko.createLayout=Ko.makeLayout=Ko.layout;var zD={notify:function(e,a){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var l=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();a!=null&&l.merge(a);return}if(n.notificationsEnabled){var u=this.renderer();this.destroyed()||!u||u.notify(e,a)}},notifications:function(e){var a=this._private;return e===void 0?a.notificationsEnabled:(a.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 a=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var l=e.batchNotifications[n];l.empty()?a.notify(n):a.notify(n,l)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var a=this;return this.batch(function(){for(var n=Object.keys(e),l=0;l<n.length;l++){var u=n[l],o=e[u],c=a.getElementById(u);c.data(o)}})}},OD=Ba({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),zh={renderTo:function(e,a,n,l){var u=this._private.renderer;return u.renderTo(e,a,n,l),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var a=this,n=a.extension("renderer",e.name);if(n==null){Yt("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Ct("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var l=OD(e);l.cy=a,a._private.renderer=new n(l),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var a=e.container();if(a)for(a._cyreg=null;a.childNodes.length>0;)a.removeChild(a.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var l=n._private;l.rscratch={},l.rstyle={},l.animation.current=[],l.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};zh.invalidateDimensions=zh.resize;var Zo={collection:function(e,a){return Ge(e)?this.$(e):nr(e)?e.collection():kt(e)?(a||(a={}),new Da(this,e,a.unique,a.removed)):new Da(this)},nodes:function(e){var a=this.$(function(n){return n.isNode()});return e?a.filter(e):a},edges:function(e){var a=this.$(function(n){return n.isEdge()});return e?a.filter(e):a},$:function(e){var a=this._private.elements;return e?a.filter(e):a.spawnSelf()},mutableElements:function(){return this._private.elements}};Zo.elements=Zo.filter=Zo.$;var wa={},Gu="t",LD="f";wa.apply=function(t){for(var e=this,a=e._private,n=a.cy,l=n.collection(),u=0;u<t.length;u++){var o=t[u],c=e.getContextMeta(o);if(!c.empty){var v=e.getContextStyle(c),f=e.applyContextStyle(c,v,o);o._private.appliedInitStyle?e.updateTransitions(o,f.diffProps):o._private.appliedInitStyle=!0;var h=e.updateStyleHints(o);h&&l.push(o)}}return l};wa.getPropertiesDiff=function(t,e){var a=this,n=a._private.propDiffs=a._private.propDiffs||{},l=t+"-"+e,u=n[l];if(u)return u;for(var o=[],c={},v=0;v<a.length;v++){var f=a[v],h=t[v]===Gu,g=e[v]===Gu,m=h!==g,x=f.mappedProperties.length>0;if(m||g&&x){var b=void 0;m&&x||m?b=f.properties:x&&(b=f.mappedProperties);for(var E=0;E<b.length;E++){for(var S=b[E],w=S.name,T=!1,C=v+1;C<a.length;C++){var B=a[C],R=e[C]===Gu;if(R&&(T=B.properties[S.name]!=null,T))break}!c[w]&&!T&&(c[w]=!0,o.push(w))}}}return n[l]=o,o};wa.getContextMeta=function(t){for(var e=this,a="",n,l=t._private.styleCxtKey||"",u=0;u<e.length;u++){var o=e[u],c=o.selector&&o.selector.matches(t);c?a+=Gu:a+=LD}return n=e.getPropertiesDiff(l,a),t._private.styleCxtKey=a,{key:a,diffPropNames:n,empty:n.length===0}};wa.getContextStyle=function(t){var e=t.key,a=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var l={_private:{key:e}},u=0;u<a.length;u++){var o=a[u],c=e[u]===Gu;if(c)for(var v=0;v<o.properties.length;v++){var f=o.properties[v];l[f.name]=f}}return n[e]=l,l};wa.applyContextStyle=function(t,e,a){for(var n=this,l=t.diffPropNames,u={},o=n.types,c=0;c<l.length;c++){var v=l[c],f=e[v],h=a.pstyle(v);if(!f)if(h)h.bypass?f={name:v,deleteBypassed:!0}:f={name:v,delete:!0};else continue;if(h!==f){if(f.mapped===o.fn&&h!=null&&h.mapping!=null&&h.mapping.value===f.value){var g=h.mapping,m=g.fnValue=f.value(a);if(m===g.prevFnValue)continue}var x=u[v]={prev:h};n.applyParsedProperty(a,f),x.next=a.pstyle(v),x.next&&x.next.bypass&&(x.next=x.next.bypassed)}}return{diffProps:u}};wa.updateStyleHints=function(t){var e=t._private,a=this,n=a.propertyGroupNames,l=a.propertyGroupKeys,u=function(le,he,Ee){return a.getPropertiesHash(le,he,Ee)},o=e.styleKey;if(t.removed())return!1;var c=e.group==="nodes",v=t._private.style;n=Object.keys(v);for(var f=0;f<l.length;f++){var h=l[f];e.styleKeys[h]=[Ei,Cl]}for(var g=function(le,he){return e.styleKeys[he][0]=Fu(le,e.styleKeys[he][0])},m=function(le,he){return e.styleKeys[he][1]=Xu(le,e.styleKeys[he][1])},x=function(le,he){g(le,he),m(le,he)},b=function(le,he){for(var Ee=0;Ee<le.length;Ee++){var ke=le.charCodeAt(Ee);g(ke,he),m(ke,he)}},E=2e9,S=function(le){return-128<le&&le<128&&Math.floor(le)!==le?E-(le*1024|0):le},w=0;w<n.length;w++){var T=n[w],C=v[T];if(C!=null){var B=this.properties[T],R=B.type,L=B.groupKey,A=void 0;B.hashOverride!=null?A=B.hashOverride(t,C):C.pfValue!=null&&(A=C.pfValue);var O=B.enums==null?C.value:null,z=A!=null,U=O!=null,V=z||U,P=C.units;if(R.number&&V&&!R.multiple){var H=z?A:O;x(S(H),L),!z&&P!=null&&b(P,L)}else b(C.strValue,L)}}for(var I=[Ei,Cl],F=0;F<l.length;F++){var _=l[F],j=e.styleKeys[_];I[0]=Fu(j[0],I[0]),I[1]=Xu(j[1],I[1])}e.styleKey=QE(I[0],I[1]);var Y=e.styleKeys;e.labelDimsKey=_n(Y.labelDimensions);var Q=u(t,["label"],Y.labelDimensions);if(e.labelKey=_n(Q),e.labelStyleKey=_n(Mo(Y.commonLabel,Q)),!c){var W=u(t,["source-label"],Y.labelDimensions);e.sourceLabelKey=_n(W),e.sourceLabelStyleKey=_n(Mo(Y.commonLabel,W));var N=u(t,["target-label"],Y.labelDimensions);e.targetLabelKey=_n(N),e.targetLabelStyleKey=_n(Mo(Y.commonLabel,N))}if(c){var G=e.styleKeys,Z=G.nodeBody,$=G.nodeBorder,ae=G.nodeOutline,se=G.backgroundImage,de=G.compound,Se=G.pie,fe=G.stripe,te=[Z,$,ae,se,de,Se,fe].filter(function(re){return re!=null}).reduce(Mo,[Ei,Cl]);e.nodeKey=_n(te),e.hasPie=Se!=null&&Se[0]!==Ei&&Se[1]!==Cl,e.hasStripe=fe!=null&&fe[0]!==Ei&&fe[1]!==Cl}return o!==e.styleKey};wa.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};wa.applyParsedProperty=function(t,e){var a=this,n=e,l=t._private.style,u,o=a.types,c=a.properties[n.name].type,v=n.bypass,f=l[n.name],h=f&&f.bypass,g=t._private,m="mapping",x=function(Z){return Z==null?null:Z.pfValue!=null?Z.pfValue:Z.value},b=function(){var Z=x(f),$=x(n);a.checkTriggers(t,n.name,Z,$)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",v)),n.delete)return l[n.name]=void 0,b(),!0;if(n.deleteBypassed)return f?f.bypass?(f.bypassed=void 0,b(),!0):!1:(b(),!0);if(n.deleteBypass)return f?f.bypass?(l[n.name]=f.bypassed,b(),!0):!1:(b(),!0);var E=function(){Ct("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case o.mapData:{for(var S=n.field.split("."),w=g.data,T=0;T<S.length&&w;T++){var C=S[T];w=w[C]}if(w==null)return E(),!1;var B;if(Ce(w)){var R=n.fieldMax-n.fieldMin;R===0?B=0:B=(w-n.fieldMin)/R}else return Ct("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+w+"` for `"+t.id()+"` is non-numeric)"),!1;if(B<0?B=0:B>1&&(B=1),c.color){var L=n.valueMin[0],A=n.valueMax[0],O=n.valueMin[1],z=n.valueMax[1],U=n.valueMin[2],V=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],H=n.valueMax[3]==null?1:n.valueMax[3],I=[Math.round(L+(A-L)*B),Math.round(O+(z-O)*B),Math.round(U+(V-U)*B),Math.round(P+(H-P)*B)];u={bypass:n.bypass,name:n.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else if(c.number){var F=n.valueMin+(n.valueMax-n.valueMin)*B;u=this.parse(n.name,F,n.bypass,m)}else return!1;if(!u)return E(),!1;u.mapping=n,n=u;break}case o.data:{for(var _=n.field.split("."),j=g.data,Y=0;Y<_.length&&j;Y++){var Q=_[Y];j=j[Q]}if(j!=null&&(u=this.parse(n.name,j,n.bypass,m)),!u)return E(),!1;u.mapping=n,n=u;break}case o.fn:{var W=n.value,N=n.fnValue!=null?n.fnValue:W(t);if(n.prevFnValue=N,N==null)return Ct("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(u=this.parse(n.name,N,n.bypass,m),!u)return Ct("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;u.mapping=Or(n),n=u;break}case void 0:break;default:return!1}return v?(h?n.bypassed=f.bypassed:n.bypassed=f,l[n.name]=n):h?f.bypassed=n:l[n.name]=n,b(),!0};wa.cleanElements=function(t,e){for(var a=0;a<t.length;a++){var n=t[a];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var l=n._private.style,u=Object.keys(l),o=0;o<u.length;o++){var c=u[o],v=l[c];v!=null&&(v.bypass?v.bypassed=null:l[c]=null)}}};wa.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};wa.updateTransitions=function(t,e){var a=this,n=t._private,l=t.pstyle("transition-property").value,u=t.pstyle("transition-duration").pfValue,o=t.pstyle("transition-delay").pfValue;if(l.length>0&&u>0){for(var c={},v=!1,f=0;f<l.length;f++){var h=l[f],g=t.pstyle(h),m=e[h];if(m){var x=m.prev,b=x,E=m.next!=null?m.next:g,S=!1,w=void 0,T=1e-6;b&&(Ce(b.pfValue)&&Ce(E.pfValue)?(S=E.pfValue-b.pfValue,w=b.pfValue+T*S):Ce(b.value)&&Ce(E.value)?(S=E.value-b.value,w=b.value+T*S):kt(b.value)&&kt(E.value)&&(S=b.value[0]!==E.value[0]||b.value[1]!==E.value[1]||b.value[2]!==E.value[2],w=b.strValue),S&&(c[h]=E.strValue,this.applyBypass(t,h,w),v=!0))}}if(!v)return;n.transitioning=!0,new ql(function(C){o>0?t.delayAnimation(o).play().promise().then(C):C()}).then(function(){return t.animation({style:c,duration:u,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){a.removeBypasses(t,l),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,l),t.emitAndNotify("style"),n.transitioning=!1)};wa.checkTrigger=function(t,e,a,n,l,u){var o=this.properties[e],c=l(o);t.removed()||c!=null&&c(a,n,t)&&u(o)};wa.checkZOrderTrigger=function(t,e,a,n){var l=this;this.checkTrigger(t,e,a,n,function(u){return u.triggersZOrder},function(){l._private.cy.notify("zorder",t)})};wa.checkBoundsTrigger=function(t,e,a,n){this.checkTrigger(t,e,a,n,function(l){return l.triggersBounds},function(l){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};wa.checkConnectedEdgesBoundsTrigger=function(t,e,a,n){this.checkTrigger(t,e,a,n,function(l){return l.triggersBoundsOfConnectedEdges},function(l){t.connectedEdges().forEach(function(u){u.dirtyBoundingBoxCache()})})};wa.checkParallelEdgesBoundsTrigger=function(t,e,a,n){this.checkTrigger(t,e,a,n,function(l){return l.triggersBoundsOfParallelEdges},function(l){t.parallelEdges().forEach(function(u){u.dirtyBoundingBoxCache()})})};wa.checkTriggers=function(t,e,a,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,a,n),this.checkBoundsTrigger(t,e,a,n),this.checkConnectedEdgesBoundsTrigger(t,e,a,n),this.checkParallelEdgesBoundsTrigger(t,e,a,n)};var cs={};cs.applyBypass=function(t,e,a,n){var l=this,u=[],o=!0;if(e==="*"||e==="**"){if(a!==void 0)for(var c=0;c<l.properties.length;c++){var v=l.properties[c],f=v.name,h=this.parse(f,a,!0);h&&u.push(h)}}else if(Ge(e)){var g=this.parse(e,a,!0);g&&u.push(g)}else if(yt(e)){var m=e;n=a;for(var x=Object.keys(m),b=0;b<x.length;b++){var E=x[b],S=m[E];if(S===void 0&&(S=m[dc(E)]),S!==void 0){var w=this.parse(E,S,!0);w&&u.push(w)}}}else return!1;if(u.length===0)return!1;for(var T=!1,C=0;C<t.length;C++){for(var B=t[C],R={},L=void 0,A=0;A<u.length;A++){var O=u[A];if(n){var z=B.pstyle(O.name);L=R[O.name]={prev:z}}T=this.applyParsedProperty(B,Or(O))||T,n&&(L.next=B.pstyle(O.name))}T&&this.updateStyleHints(B),n&&this.updateTransitions(B,R,o)}return T};cs.overrideBypass=function(t,e,a){e=Fh(e);for(var n=0;n<t.length;n++){var l=t[n],u=l._private.style[e],o=this.properties[e].type,c=o.color,v=o.mutiple,f=u?u.pfValue!=null?u.pfValue:u.value:null;!u||!u.bypass?this.applyBypass(l,e,a):(u.value=a,u.pfValue!=null&&(u.pfValue=a),c?u.strValue="rgb("+a.join(",")+")":v?u.strValue=a.join(" "):u.strValue=""+a,this.updateStyleHints(l)),this.checkTriggers(l,e,f,a)}};cs.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};cs.removeBypasses=function(t,e,a){for(var n=!0,l=0;l<t.length;l++){for(var u=t[l],o={},c=0;c<e.length;c++){var v=e[c],f=this.properties[v],h=u.pstyle(f.name);if(!(!h||!h.bypass)){var g="",m=this.parse(v,g,!0),x=o[f.name]={prev:h};this.applyParsedProperty(u,m),x.next=u.pstyle(f.name)}}this.updateStyleHints(u),a&&this.updateTransitions(u,o,n)}};var ug={};ug.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};ug.containerCss=function(t){var e=this._private.cy,a=e.container(),n=e.window();if(n&&a&&n.getComputedStyle)return n.getComputedStyle(a).getPropertyValue(t)};var Lr={};Lr.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};Lr.getRawStyle=function(t,e){var a=this;if(t=t[0],t){for(var n={},l=0;l<a.properties.length;l++){var u=a.properties[l],o=a.getStylePropertyValue(t,u.name,e);o!=null&&(n[u.name]=o,n[dc(u.name)]=o)}return n}};Lr.getIndexedStyle=function(t,e,a,n){var l=t.pstyle(e)[a][n];return l??t.cy().style().getDefaultProperty(e)[a][0]};Lr.getStylePropertyValue=function(t,e,a){var n=this;if(t=t[0],t){var l=n.properties[e];l.alias&&(l=l.pointsTo);var u=l.type,o=t.pstyle(l.name);if(o){var c=o.value,v=o.units,f=o.strValue;if(a&&u.number&&c!=null&&Ce(c)){var h=t.cy().zoom(),g=function(S){return S*h},m=function(S,w){return g(S)+w},x=kt(c),b=x?v.every(function(E){return E!=null}):v!=null;return b?x?c.map(function(E,S){return m(E,v[S])}).join(" "):m(c,v):x?c.map(function(E){return Ge(E)?E:""+g(E)}).join(" "):""+g(c)}else if(f!=null)return f}return null}};Lr.getAnimationStartStyle=function(t,e){for(var a={},n=0;n<e.length;n++){var l=e[n],u=l.name,o=t.pstyle(u);o!==void 0&&(yt(o)?o=this.parse(u,o.strValue):o=this.parse(u,o)),o&&(a[u]=o)}return a};Lr.getPropsList=function(t){var e=this,a=[],n=t,l=e.properties;if(n)for(var u=Object.keys(n),o=0;o<u.length;o++){var c=u[o],v=n[c],f=l[c]||l[Fh(c)],h=this.parse(f.name,v);h&&a.push(h)}return a};Lr.getNonDefaultPropertiesHash=function(t,e,a){var n=a.slice(),l,u,o,c,v,f;for(v=0;v<e.length;v++)if(l=e[v],u=t.pstyle(l,!1),u!=null)if(u.pfValue!=null)n[0]=Fu(c,n[0]),n[1]=Xu(c,n[1]);else for(o=u.strValue,f=0;f<o.length;f++)c=o.charCodeAt(f),n[0]=Fu(c,n[0]),n[1]=Xu(c,n[1]);return n};Lr.getPropertiesHash=Lr.getNonDefaultPropertiesHash;var Ac={};Ac.appendFromJson=function(t){for(var e=this,a=0;a<t.length;a++){var n=t[a],l=n.selector,u=n.style||n.css,o=Object.keys(u);e.selector(l);for(var c=0;c<o.length;c++){var v=o[c],f=u[v];e.css(v,f)}}return e};Ac.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Ac.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var a=this[e],n=a.selector,l=a.properties,u={},o=0;o<l.length;o++){var c=l[o];u[c.name]=c.strValue}t.push({selector:n?n.toString():"core",style:u})}return t};var sg={};sg.appendFromString=function(t){var e=this,a=this,n=""+t,l,u,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function c(){n.length>l.length?n=n.substr(l.length):n=""}function v(){u.length>o.length?u=u.substr(o.length):u=""}for(;;){var f=n.match(/^\s*$/);if(f)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Ct("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}l=h[0];var g=h[1];if(g!=="core"){var m=new Xn(g);if(m.invalid){Ct("Skipping parsing of block: Invalid selector found in string stylesheet: "+g),c();continue}}var x=h[2],b=!1;u=x;for(var E=[];;){var S=u.match(/^\s*$/);if(S)break;var w=u.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!w){Ct("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+x),b=!0;break}o=w[0];var T=w[1],C=w[2],B=e.properties[T];if(!B){Ct("Skipping property: Invalid property name in: "+o),v();continue}var R=a.parse(T,C);if(!R){Ct("Skipping property: Invalid property definition in: "+o),v();continue}E.push({name:T,val:C}),v()}if(b){c();break}a.selector(g);for(var L=0;L<E.length;L++){var A=E[L];a.css(A.name,A.val)}c()}return a};sg.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var ia={};(function(){var t=ca,e=BE,a=ME,n=RE,l=zE,u=function(re){return"^"+re+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(re){var le=t+"|\\w+|"+e+"|"+a+"|"+n+"|"+l;return"^"+re+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+le+")\\s*\\,\\s*("+le+")\\)$"},c=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];ia.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:u("data")},layoutData:{mapping:!0,regex:u("layoutData")},scratch:{mapping:!0,regex:u("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:c,singleRegexMatchValue:!0},urls:{regexes:c,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(re,le){switch(re.length){case 2:return le[0]!=="deg"&&le[0]!=="rad"&&le[1]!=="deg"&&le[1]!=="rad";case 1:return Ge(re[0])||le[0]==="deg"||le[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(re){var le=re.length;return le===1||le===2||le===4}}};var v={zeroNonZero:function(re,le){return(re==null||le==null)&&re!==le||re==0&&le!=0?!0:re!=0&&le==0},any:function(re,le){return re!=le},emptyNonEmpty:function(re,le){var he=In(re),Ee=In(le);return he&&!Ee||!he&&Ee}},f=ia.types,h=[{name:"label",type:f.text,triggersBounds:v.any,triggersZOrder:v.emptyNonEmpty},{name:"text-rotation",type:f.textRotation,triggersBounds:v.any},{name:"text-margin-x",type:f.bidirectionalSize,triggersBounds:v.any},{name:"text-margin-y",type:f.bidirectionalSize,triggersBounds:v.any}],g=[{name:"source-label",type:f.text,triggersBounds:v.any},{name:"source-text-rotation",type:f.textRotation,triggersBounds:v.any},{name:"source-text-margin-x",type:f.bidirectionalSize,triggersBounds:v.any},{name:"source-text-margin-y",type:f.bidirectionalSize,triggersBounds:v.any},{name:"source-text-offset",type:f.size,triggersBounds:v.any}],m=[{name:"target-label",type:f.text,triggersBounds:v.any},{name:"target-text-rotation",type:f.textRotation,triggersBounds:v.any},{name:"target-text-margin-x",type:f.bidirectionalSize,triggersBounds:v.any},{name:"target-text-margin-y",type:f.bidirectionalSize,triggersBounds:v.any},{name:"target-text-offset",type:f.size,triggersBounds:v.any}],x=[{name:"font-family",type:f.fontFamily,triggersBounds:v.any},{name:"font-style",type:f.fontStyle,triggersBounds:v.any},{name:"font-weight",type:f.fontWeight,triggersBounds:v.any},{name:"font-size",type:f.size,triggersBounds:v.any},{name:"text-transform",type:f.textTransform,triggersBounds:v.any},{name:"text-wrap",type:f.textWrap,triggersBounds:v.any},{name:"text-overflow-wrap",type:f.textOverflowWrap,triggersBounds:v.any},{name:"text-max-width",type:f.size,triggersBounds:v.any},{name:"text-outline-width",type:f.size,triggersBounds:v.any},{name:"line-height",type:f.positiveNumber,triggersBounds:v.any}],b=[{name:"text-valign",type:f.valign,triggersBounds:v.any},{name:"text-halign",type:f.halign,triggersBounds:v.any},{name:"color",type:f.color},{name:"text-outline-color",type:f.color},{name:"text-outline-opacity",type:f.zeroOneNumber},{name:"text-background-color",type:f.color},{name:"text-background-opacity",type:f.zeroOneNumber},{name:"text-background-padding",type:f.size,triggersBounds:v.any},{name:"text-border-opacity",type:f.zeroOneNumber},{name:"text-border-color",type:f.color},{name:"text-border-width",type:f.size,triggersBounds:v.any},{name:"text-border-style",type:f.borderStyle,triggersBounds:v.any},{name:"text-background-shape",type:f.textBackgroundShape,triggersBounds:v.any},{name:"text-justification",type:f.justification},{name:"box-select-labels",type:f.bool,triggersBounds:v.any}],E=[{name:"events",type:f.bool,triggersZOrder:v.any},{name:"text-events",type:f.bool,triggersZOrder:v.any},{name:"box-selection",type:f.boxSelection,triggersZOrder:v.any}],S=[{name:"display",type:f.display,triggersZOrder:v.any,triggersBounds:v.any,triggersBoundsOfConnectedEdges:v.any,triggersBoundsOfParallelEdges:function(re,le,he){return re===le?!1:he.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:f.visibility,triggersZOrder:v.any},{name:"opacity",type:f.zeroOneNumber,triggersZOrder:v.zeroNonZero},{name:"text-opacity",type:f.zeroOneNumber},{name:"min-zoomed-font-size",type:f.size},{name:"z-compound-depth",type:f.zCompoundDepth,triggersZOrder:v.any},{name:"z-index-compare",type:f.zIndexCompare,triggersZOrder:v.any},{name:"z-index",type:f.number,triggersZOrder:v.any}],w=[{name:"overlay-padding",type:f.size,triggersBounds:v.any},{name:"overlay-color",type:f.color},{name:"overlay-opacity",type:f.zeroOneNumber,triggersBounds:v.zeroNonZero},{name:"overlay-shape",type:f.overlayShape,triggersBounds:v.any},{name:"overlay-corner-radius",type:f.cornerRadius}],T=[{name:"underlay-padding",type:f.size,triggersBounds:v.any},{name:"underlay-color",type:f.color},{name:"underlay-opacity",type:f.zeroOneNumber,triggersBounds:v.zeroNonZero},{name:"underlay-shape",type:f.overlayShape,triggersBounds:v.any},{name:"underlay-corner-radius",type:f.cornerRadius}],C=[{name:"transition-property",type:f.propList},{name:"transition-duration",type:f.time},{name:"transition-delay",type:f.time},{name:"transition-timing-function",type:f.easing}],B=function(re,le){return le.value==="label"?-re.poolIndex():le.pfValue},R=[{name:"height",type:f.nodeSize,triggersBounds:v.any,hashOverride:B},{name:"width",type:f.nodeSize,triggersBounds:v.any,hashOverride:B},{name:"shape",type:f.nodeShape,triggersBounds:v.any},{name:"shape-polygon-points",type:f.polygonPointList,triggersBounds:v.any},{name:"corner-radius",type:f.cornerRadius},{name:"background-color",type:f.color},{name:"background-fill",type:f.fill},{name:"background-opacity",type:f.zeroOneNumber},{name:"background-blacken",type:f.nOneOneNumber},{name:"background-gradient-stop-colors",type:f.colors},{name:"background-gradient-stop-positions",type:f.percentages},{name:"background-gradient-direction",type:f.gradientDirection},{name:"padding",type:f.sizeMaybePercent,triggersBounds:v.any},{name:"padding-relative-to",type:f.paddingRelativeTo,triggersBounds:v.any},{name:"bounds-expansion",type:f.boundsExpansion,triggersBounds:v.any}],L=[{name:"border-color",type:f.color},{name:"border-opacity",type:f.zeroOneNumber},{name:"border-width",type:f.size,triggersBounds:v.any},{name:"border-style",type:f.borderStyle},{name:"border-cap",type:f.lineCap},{name:"border-join",type:f.lineJoin},{name:"border-dash-pattern",type:f.numbers},{name:"border-dash-offset",type:f.number},{name:"border-position",type:f.linePosition}],A=[{name:"outline-color",type:f.color},{name:"outline-opacity",type:f.zeroOneNumber},{name:"outline-width",type:f.size,triggersBounds:v.any},{name:"outline-style",type:f.borderStyle},{name:"outline-offset",type:f.size,triggersBounds:v.any}],O=[{name:"background-image",type:f.urls},{name:"background-image-crossorigin",type:f.bgCrossOrigin},{name:"background-image-opacity",type:f.zeroOneNumbers},{name:"background-image-containment",type:f.bgContainment},{name:"background-image-smoothing",type:f.bools},{name:"background-position-x",type:f.bgPos},{name:"background-position-y",type:f.bgPos},{name:"background-width-relative-to",type:f.bgRelativeTo},{name:"background-height-relative-to",type:f.bgRelativeTo},{name:"background-repeat",type:f.bgRepeat},{name:"background-fit",type:f.bgFit},{name:"background-clip",type:f.bgClip},{name:"background-width",type:f.bgWH},{name:"background-height",type:f.bgWH},{name:"background-offset-x",type:f.bgPos},{name:"background-offset-y",type:f.bgPos}],z=[{name:"position",type:f.position,triggersBounds:v.any},{name:"compound-sizing-wrt-labels",type:f.compoundIncludeLabels,triggersBounds:v.any},{name:"min-width",type:f.size,triggersBounds:v.any},{name:"min-width-bias-left",type:f.sizeMaybePercent,triggersBounds:v.any},{name:"min-width-bias-right",type:f.sizeMaybePercent,triggersBounds:v.any},{name:"min-height",type:f.size,triggersBounds:v.any},{name:"min-height-bias-top",type:f.sizeMaybePercent,triggersBounds:v.any},{name:"min-height-bias-bottom",type:f.sizeMaybePercent,triggersBounds:v.any}],U=[{name:"line-style",type:f.lineStyle},{name:"line-color",type:f.color},{name:"line-fill",type:f.fill},{name:"line-cap",type:f.lineCap},{name:"line-opacity",type:f.zeroOneNumber},{name:"line-dash-pattern",type:f.numbers},{name:"line-dash-offset",type:f.number},{name:"line-outline-width",type:f.size},{name:"line-outline-color",type:f.color},{name:"line-gradient-stop-colors",type:f.colors},{name:"line-gradient-stop-positions",type:f.percentages},{name:"curve-style",type:f.curveStyle,triggersBounds:v.any,triggersBoundsOfParallelEdges:function(re,le){return re===le?!1:re==="bezier"||le==="bezier"}},{name:"haystack-radius",type:f.zeroOneNumber,triggersBounds:v.any},{name:"source-endpoint",type:f.edgeEndpoint,triggersBounds:v.any},{name:"target-endpoint",type:f.edgeEndpoint,triggersBounds:v.any},{name:"control-point-step-size",type:f.size,triggersBounds:v.any},{name:"control-point-distances",type:f.bidirectionalSizes,triggersBounds:v.any},{name:"control-point-weights",type:f.numbers,triggersBounds:v.any},{name:"segment-distances",type:f.bidirectionalSizes,triggersBounds:v.any},{name:"segment-weights",type:f.numbers,triggersBounds:v.any},{name:"segment-radii",type:f.numbers,triggersBounds:v.any},{name:"radius-type",type:f.radiusType,triggersBounds:v.any},{name:"taxi-turn",type:f.bidirectionalSizeMaybePercent,triggersBounds:v.any},{name:"taxi-turn-min-distance",type:f.size,triggersBounds:v.any},{name:"taxi-direction",type:f.axisDirection,triggersBounds:v.any},{name:"taxi-radius",type:f.number,triggersBounds:v.any},{name:"edge-distances",type:f.edgeDistances,triggersBounds:v.any},{name:"arrow-scale",type:f.positiveNumber,triggersBounds:v.any},{name:"loop-direction",type:f.angle,triggersBounds:v.any},{name:"loop-sweep",type:f.angle,triggersBounds:v.any},{name:"source-distance-from-node",type:f.size,triggersBounds:v.any},{name:"target-distance-from-node",type:f.size,triggersBounds:v.any}],V=[{name:"ghost",type:f.bool,triggersBounds:v.any},{name:"ghost-offset-x",type:f.bidirectionalSize,triggersBounds:v.any},{name:"ghost-offset-y",type:f.bidirectionalSize,triggersBounds:v.any},{name:"ghost-opacity",type:f.zeroOneNumber}],P=[{name:"selection-box-color",type:f.color},{name:"selection-box-opacity",type:f.zeroOneNumber},{name:"selection-box-border-color",type:f.color},{name:"selection-box-border-width",type:f.size},{name:"active-bg-color",type:f.color},{name:"active-bg-opacity",type:f.zeroOneNumber},{name:"active-bg-size",type:f.size},{name:"outside-texture-bg-color",type:f.color},{name:"outside-texture-bg-opacity",type:f.zeroOneNumber}],H=[];ia.pieBackgroundN=16,H.push({name:"pie-size",type:f.sizeMaybePercent}),H.push({name:"pie-hole",type:f.sizeMaybePercent}),H.push({name:"pie-start-angle",type:f.angle});for(var I=1;I<=ia.pieBackgroundN;I++)H.push({name:"pie-"+I+"-background-color",type:f.color}),H.push({name:"pie-"+I+"-background-size",type:f.percent}),H.push({name:"pie-"+I+"-background-opacity",type:f.zeroOneNumber});var F=[];ia.stripeBackgroundN=16,F.push({name:"stripe-size",type:f.sizeMaybePercent}),F.push({name:"stripe-direction",type:f.axisDirectionPrimary});for(var _=1;_<=ia.stripeBackgroundN;_++)F.push({name:"stripe-"+_+"-background-color",type:f.color}),F.push({name:"stripe-"+_+"-background-size",type:f.percent}),F.push({name:"stripe-"+_+"-background-opacity",type:f.zeroOneNumber});var j=[],Y=ia.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:f.arrowShape,triggersBounds:v.any},{name:"arrow-color",type:f.color},{name:"arrow-fill",type:f.arrowFill},{name:"arrow-width",type:f.arrowWidth}].forEach(function(te){Y.forEach(function(re){var le=re+"-"+te.name,he=te.type,Ee=te.triggersBounds;j.push({name:le,type:he,triggersBounds:Ee})})},{});var Q=ia.properties=[].concat(E,C,S,w,T,V,b,x,h,g,m,R,L,A,O,H,F,z,U,j,P),W=ia.propertyGroups={behavior:E,transition:C,visibility:S,overlay:w,underlay:T,ghost:V,commonLabel:b,labelDimensions:x,mainLabel:h,sourceLabel:g,targetLabel:m,nodeBody:R,nodeBorder:L,nodeOutline:A,backgroundImage:O,pie:H,stripe:F,compound:z,edgeLine:U,edgeArrow:j,core:P},N=ia.propertyGroupNames={},G=ia.propertyGroupKeys=Object.keys(W);G.forEach(function(te){N[te]=W[te].map(function(re){return re.name}),W[te].forEach(function(re){return re.groupKey=te})});var Z=ia.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];ia.propertyNames=Q.map(function(te){return te.name});for(var $=0;$<Q.length;$++){var ae=Q[$];Q[ae.name]=ae}for(var se=0;se<Z.length;se++){var de=Z[se],Se=Q[de.pointsTo],fe={name:de.name,alias:!0,pointsTo:Se};Q.push(fe),Q[de.name]=fe}})();ia.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};ia.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Fe({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(v,f){for(var h=1;h<=ia.pieBackgroundN;h++){var g=f.name.replace("{{i}}",h),m=f.value;v[g]=m}return v},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(v,f){for(var h=1;h<=ia.stripeBackgroundN;h++){var g=f.name.replace("{{i}}",h),m=f.value;v[g]=m}return v},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(v,f){return ia.arrowPrefixes.forEach(function(h){var g=h+"-"+f.name,m=f.value;v[g]=m}),v},{})),a={},n=0;n<this.properties.length;n++){var l=this.properties[n];if(!l.pointsTo){var u=l.name,o=e[u],c=this.parse(u,o);a[u]=c}}return t.defaultProperties=a,t.defaultProperties};ia.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var Dc={};Dc.parse=function(t,e,a,n){var l=this;if(Xt(e))return l.parseImplWarn(t,e,a,n);var u=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=a?"t":"f",c=""+e,v=rx(t,c,o,u),f=l.propCache=l.propCache||[],h;return(h=f[v])||(h=f[v]=l.parseImplWarn(t,e,a,n)),(a||n==="mapping")&&(h=Or(h),h&&(h.value=Or(h.value))),h};Dc.parseImplWarn=function(t,e,a,n){var l=this.parseImpl(t,e,a,n);return!l&&e!=null&&Ct("The style property `".concat(t,": ").concat(e,"` is invalid")),l&&(l.name==="width"||l.name==="height")&&e==="label"&&Ct("The style value of `label` is deprecated for `"+l.name+"`"),l};Dc.parseImpl=function(t,e,a,n){var l=this;t=Fh(t);var u=l.properties[t],o=e,c=l.types;if(!u||e===void 0)return null;u.alias&&(u=u.pointsTo,t=u.name);var v=Ge(e);v&&(e=e.trim());var f=u.type;if(!f)return null;if(a&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Xt(e))return{name:t,value:e,strValue:"fn",mapped:c.fn,bypass:a};var h,g;if(!(!v||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(h=new RegExp(c.data.regex).exec(e))){if(a)return!1;var m=c.data;return{name:t,value:h,strValue:""+e,mapped:m,field:h[1],bypass:a}}else if(e.length>=10&&e[0]==="m"&&(g=new RegExp(c.mapData.regex).exec(e))){if(a||f.multiple)return!1;var x=c.mapData;if(!(f.color||f.number))return!1;var b=this.parse(t,g[4]);if(!b||b.mapped)return!1;var E=this.parse(t,g[5]);if(!E||E.mapped)return!1;if(b.pfValue===E.pfValue||b.strValue===E.strValue)return Ct("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+b.strValue+"`"),this.parse(t,b.strValue);if(f.color){var S=b.value,w=E.value,T=S[0]===w[0]&&S[1]===w[1]&&S[2]===w[2]&&(S[3]===w[3]||(S[3]==null||S[3]===1)&&(w[3]==null||w[3]===1));if(T)return!1}return{name:t,value:g,strValue:""+e,mapped:x,field:g[1],fieldMin:parseFloat(g[2]),fieldMax:parseFloat(g[3]),valueMin:b.value,valueMax:E.value,bypass:a}}}if(f.multiple&&n!=="multiple"){var C;if(v?C=e.split(/\s+/):kt(e)?C=e:C=[e],f.evenMultiple&&C.length%2!==0)return null;for(var B=[],R=[],L=[],A="",O=!1,z=0;z<C.length;z++){var U=l.parse(t,C[z],a,"multiple");O=O||Ge(U.value),B.push(U.value),L.push(U.pfValue!=null?U.pfValue:U.value),R.push(U.units),A+=(z>0?" ":"")+U.strValue}return f.validate&&!f.validate(B,R)?null:f.singleEnum&&O?B.length===1&&Ge(B[0])?{name:t,value:B[0],strValue:B[0],bypass:a}:null:{name:t,value:B,pfValue:L,strValue:A,bypass:a,units:R}}var V=function(){for(var fe=0;fe<f.enums.length;fe++){var te=f.enums[fe];if(te===e)return{name:t,value:e,strValue:""+e,bypass:a}}return null};if(f.number){var P,H="px";if(f.units&&(P=f.units),f.implicitUnits&&(H=f.implicitUnits),!f.unitless)if(v){var I="px|em"+(f.allowPercent?"|\\%":"");P&&(I=P);var F=e.match("^("+ca+")("+I+")?$");F&&(e=F[1],P=F[2]||H)}else(!P||f.implicitUnits)&&(P=H);if(e=parseFloat(e),isNaN(e)&&f.enums===void 0)return null;if(isNaN(e)&&f.enums!==void 0)return e=o,V();if(f.integer&&!wE(e)||f.min!==void 0&&(e<f.min||f.strictMin&&e===f.min)||f.max!==void 0&&(e>f.max||f.strictMax&&e===f.max))return null;var _={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:a};return f.unitless||P!=="px"&&P!=="em"?_.pfValue=e:_.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(_.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(_.pfValue=P==="rad"?e:RT(e)),P==="%"&&(_.pfValue=e/100),_}else if(f.propList){var j=[],Y=""+e;if(Y!=="none"){for(var Q=Y.split(/\s*,\s*|\s+/),W=0;W<Q.length;W++){var N=Q[W].trim();l.properties[N]?j.push(N):Ct("`"+N+"` is not a valid property name")}if(j.length===0)return null}return{name:t,value:j,strValue:j.length===0?"none":j.join(" "),bypass:a}}else if(f.color){var G=Q1(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:a}:null}else if(f.regex||f.regexes){if(f.enums){var Z=V();if(Z)return Z}for(var $=f.regexes?f.regexes:[f.regex],ae=0;ae<$.length;ae++){var se=new RegExp($[ae]),de=se.exec(e);if(de)return{name:t,value:f.singleRegexMatchValue?de[1]:de,strValue:""+e,bypass:a}}return null}else return f.string?{name:t,value:""+e,strValue:""+e,bypass:a}:f.enums?V():null};var xa=function(e){if(!(this instanceof xa))return new xa(e);if(!Yh(e)){Yt("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},La=xa.prototype;La.instanceString=function(){return"style"};La.clear=function(){for(var t=this._private,e=t.cy,a=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(a,!0),a.forEach(function(l){var u=l[0]._private;u.styleDirty=!0,u.appliedInitStyle=!1}),this};La.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};La.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};La.selector=function(t){var e=t==="core"?null:new Xn(t),a=this.length++;return this[a]={selector:e,properties:[],mappedProperties:[],index:a},this};La.css=function(){var t=this,e=arguments;if(e.length===1)for(var a=e[0],n=0;n<t.properties.length;n++){var l=t.properties[n],u=a[l.name];u===void 0&&(u=a[dc(l.name)]),u!==void 0&&this.cssRule(l.name,u)}else e.length===2&&this.cssRule(e[0],e[1]);return this};La.style=La.css;La.cssRule=function(t,e){var a=this.parse(t,e);if(a){var n=this.length-1;this[n].properties.push(a),this[n].properties[a.name]=a,a.name.match(/pie-(\d+)-background-size/)&&a.value&&(this._private.hasPie=!0),a.name.match(/stripe-(\d+)-background-size/)&&a.value&&(this._private.hasStripe=!0),a.mapped&&this[n].mappedProperties.push(a);var l=!this[n].selector;l&&(this._private.coreStyle[a.name]=a)}return this};La.append=function(t){return X1(t)?t.appendToStyle(this):kt(t)?this.appendFromJson(t):Ge(t)&&this.appendFromString(t),this};xa.fromJson=function(t,e){var a=new xa(t);return a.fromJson(e),a};xa.fromString=function(t,e){return new xa(t).fromString(e)};[wa,cs,ug,Lr,Ac,sg,ia,Dc].forEach(function(t){Fe(La,t)});xa.types=La.types;xa.properties=La.properties;xa.propertyGroups=La.propertyGroups;xa.propertyGroupNames=La.propertyGroupNames;xa.propertyGroupKeys=La.propertyGroupKeys;var kD={style:function(e){if(e){var a=this.setStyle(e);a.update()}return this._private.style},setStyle:function(e){var a=this._private;return X1(e)?a.style=e.generateStyle(this):kt(e)?a.style=xa.fromJson(this,e):Ge(e)?a.style=xa.fromString(this,e):a.style=xa(this),a.style},updateStyle:function(){this.mutableElements().updateStyle()}},_D="single",Ni={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var a=this._private;if(a.selectionType==null&&(a.selectionType=_D),e!==void 0)(e==="additive"||e==="single")&&(a.selectionType=e);else return a.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,a=this._private.pan,n,l,u,o,c;switch(e.length){case 0:return a;case 1:if(Ge(e[0]))return n=e[0],a[n];if(yt(e[0])){if(!this._private.panningEnabled)return this;u=e[0],o=u.x,c=u.y,Ce(o)&&(a.x=o),Ce(c)&&(a.y=c),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],l=e[1],(n==="x"||n==="y")&&Ce(l)&&(a[n]=l),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,a){var n=arguments,l=this._private.pan,u,o,c,v,f;if(!this._private.panningEnabled)return this;switch(n.length){case 1:yt(e)&&(c=n[0],v=c.x,f=c.y,Ce(v)&&(l.x+=v),Ce(f)&&(l.y+=f),this.emit("pan viewport"));break;case 2:u=e,o=a,(u==="x"||u==="y")&&Ce(o)&&(l[u]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,a){var n=this.getFitViewport(e,a);if(n){var l=this._private;l.zoom=n.zoom,l.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,a){if(Ce(e)&&a===void 0&&(a=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ge(e)){var l=e;e=this.$(l)}else if(TE(e)){var u=e;n={x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else nr(e)||(e=this.mutableElements());if(!(nr(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),c=this.height(),v;if(a=Ce(a)?a:0,!isNaN(o)&&!isNaN(c)&&o>0&&c>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){v=Math.min((o-2*a)/n.w,(c-2*a)/n.h),v=v>this._private.maxZoom?this._private.maxZoom:v,v=v<this._private.minZoom?this._private.minZoom:v;var f={x:(o-v*(n.x1+n.x2))/2,y:(c-v*(n.y1+n.y2))/2};return{zoom:v,pan:f}}}}},zoomRange:function(e,a){var n=this._private;if(a==null){var l=e;e=l.min,a=l.max}return Ce(e)&&Ce(a)&&e<=a?(n.minZoom=e,n.maxZoom=a):Ce(e)&&a===void 0&&e<=n.maxZoom?n.minZoom=e:Ce(a)&&e===void 0&&a>=n.minZoom&&(n.maxZoom=a),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 a=this._private,n=a.pan,l=a.zoom,u,o,c=!1;if(a.zoomingEnabled||(c=!0),Ce(e)?o=e:yt(e)&&(o=e.level,e.position!=null?u=pc(e.position,l,n):e.renderedPosition!=null&&(u=e.renderedPosition),u!=null&&!a.panningEnabled&&(c=!0)),o=o>a.maxZoom?a.maxZoom:o,o=o<a.minZoom?a.minZoom:o,c||!Ce(o)||o===l||u!=null&&(!Ce(u.x)||!Ce(u.y)))return null;if(u!=null){var v=n,f=l,h=o,g={x:-h/f*(u.x-v.x)+u.x,y:-h/f*(u.y-v.y)+u.y};return{zoomed:!0,panned:!0,zoom:h,pan:g}}else return{zoomed:!0,panned:!1,zoom:o,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var a=this.getZoomedViewport(e),n=this._private;return a==null||!a.zoomed?this:(n.zoom=a.zoom,a.panned&&(n.pan.x=a.pan.x,n.pan.y=a.pan.y),this.emit("zoom"+(a.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var a=this._private,n=!0,l=!0,u=[],o=!1,c=!1;if(!e)return this;if(Ce(e.zoom)||(n=!1),yt(e.pan)||(l=!1),!n&&!l)return this;if(n){var v=e.zoom;v<a.minZoom||v>a.maxZoom||!a.zoomingEnabled?o=!0:(a.zoom=v,u.push("zoom"))}if(l&&(!o||!e.cancelOnFailedZoom)&&a.panningEnabled){var f=e.pan;Ce(f.x)&&(a.pan.x=f.x,c=!1),Ce(f.y)&&(a.pan.y=f.y,c=!1),c||u.push("pan")}return u.length>0&&(u.push("viewport"),this.emit(u.join(" ")),this.notify("viewport")),this},center:function(e){var a=this.getCenterPan(e);return a&&(this._private.pan=a,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,a){if(this._private.panningEnabled){if(Ge(e)){var n=e;e=this.mutableElements().filter(n)}else nr(e)||(e=this.mutableElements());if(e.length!==0){var l=e.boundingBox(),u=this.width(),o=this.height();a=a===void 0?this._private.zoom:a;var c={x:(u-a*(l.x1+l.x2))/2,y:(o-a*(l.y1+l.y2))/2};return c}}},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,a=e.container,n=this;return e.sizeCache=e.sizeCache||(a?(function(){var l=n.window().getComputedStyle(a),u=function(c){return parseFloat(l.getPropertyValue(c))};return{width:a.clientWidth-u("padding-left")-u("padding-right"),height:a.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,a=this._private.zoom,n=this.renderedExtent(),l={x1:(n.x1-e.x)/a,x2:(n.x2-e.x)/a,y1:(n.y1-e.y)/a,y2:(n.y2-e.y)/a};return l.w=l.x2-l.x1,l.h=l.y2-l.y1,l},renderedExtent:function(){var e=this.width(),a=this.height();return{x1:0,y1:0,x2:e,y2:a,w:e,h:a}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Ni.centre=Ni.center;Ni.autolockNodes=Ni.autolock;Ni.autoungrabifyNodes=Ni.autoungrabify;var Ju={data:Tt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Tt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Tt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Tt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Ju.attr=Ju.data;Ju.removeAttr=Ju.removeData;var es=function(e){var a=this;e=Fe({},e);var n=e.container;n&&!ec(n)&&ec(n[0])&&(n=n[0]);var l=n?n._cyreg:null;l=l||{},l&&l.cy&&(l.cy.destroy(),l={});var u=l.readies=l.readies||[];n&&(n._cyreg=l),l.cy=a;var o=oa!==void 0&&n!==void 0&&!e.headless,c=e;c.layout=Fe({name:o?"grid":"null"},c.layout),c.renderer=Fe({name:o?"canvas":"null"},c.renderer);var v=function(b,E,S){return E!==void 0?E:S!==void 0?S:b},f=this._private={container:n,ready:!1,options:c,elements:new Da(this),listeners:[],aniEles:new Da(this),data:c.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:v(!0,c.zoomingEnabled),userZoomingEnabled:v(!0,c.userZoomingEnabled),panningEnabled:v(!0,c.panningEnabled),userPanningEnabled:v(!0,c.userPanningEnabled),boxSelectionEnabled:v(!0,c.boxSelectionEnabled),autolock:v(!1,c.autolock,c.autolockNodes),autoungrabify:v(!1,c.autoungrabify,c.autoungrabifyNodes),autounselectify:v(!1,c.autounselectify),styleEnabled:c.styleEnabled===void 0?o:c.styleEnabled,zoom:Ce(c.zoom)?c.zoom:1,pan:{x:yt(c.pan)&&Ce(c.pan.x)?c.pan.x:0,y:yt(c.pan)&&Ce(c.pan.y)?c.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:v(250,c.multiClickDebounceTime)};this.createEmitter(),this.selectionType(c.selectionType),this.zoomRange({min:c.minZoom,max:c.maxZoom});var h=function(b,E){var S=b.some(CE);if(S)return ql.all(b).then(E);E(b)};f.styleEnabled&&a.setStyle([]);var g=Fe({},c,c.renderer);a.initRenderer(g);var m=function(b,E,S){a.notifications(!1);var w=a.mutableElements();w.length>0&&w.remove(),b!=null&&(yt(b)||kt(b))&&a.add(b),a.one("layoutready",function(C){a.notifications(!0),a.emit(C),a.one("load",E),a.emitAndNotify("load")}).one("layoutstop",function(){a.one("done",S),a.emit("done")});var T=Fe({},a._private.options.layout);T.eles=a.elements(),a.layout(T).run()};h([c.style,c.elements],function(x){var b=x[0],E=x[1];f.styleEnabled&&a.style().append(b),m(E,function(){a.startAnimationLoop(),f.ready=!0,Xt(c.ready)&&a.on("ready",c.ready);for(var S=0;S<u.length;S++){var w=u[S];a.on("ready",w)}l&&(l.readies=[]),a.emit("ready")},c.done)})},uc=es.prototype;Fe(uc,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return oa;var a=this._private.container.ownerDocument;return a===void 0||a==null?oa:a.defaultView||oa},mount:function(e){if(e!=null){var a=this,n=a._private,l=n.options;return!ec(e)&&ec(e[0])&&(e=e[0]),a.stopAnimationLoop(),a.destroyRenderer(),n.container=e,n.styleEnabled=!0,a.invalidateSize(),a.initRenderer(Fe({},l,l.renderer,{name:l.renderer.name==="null"?"canvas":l.renderer.name})),a.startAnimationLoop(),a.style(l.style),a.emit("mount"),a}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Or(this._private.options)},json:function(e){var a=this,n=a._private,l=a.mutableElements(),u=function(B){return a.getElementById(B.id())};if(yt(e)){if(a.startBatch(),e.elements){var o={},c=function(B,R){for(var L=[],A=[],O=0;O<B.length;O++){var z=B[O];if(!z.data.id){Ct("cy.json() cannot handle elements without an ID attribute");continue}var U=""+z.data.id,V=a.getElementById(U);o[U]=!0,V.length!==0?A.push({ele:V,json:z}):(R&&(z.group=R),L.push(z))}a.add(L);for(var P=0;P<A.length;P++){var H=A[P],I=H.ele,F=H.json;I.json(F)}};if(kt(e.elements))c(e.elements);else for(var v=["nodes","edges"],f=0;f<v.length;f++){var h=v[f],g=e.elements[h];kt(g)&&c(g,h)}var m=a.collection();l.filter(function(C){return!o[C.id()]}).forEach(function(C){C.isParent()?m.merge(C):C.remove()}),m.forEach(function(C){return C.children().move({parent:null})}),m.forEach(function(C){return u(C).remove()})}e.style&&a.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&a.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&a.pan(e.pan),e.data&&a.data(e.data);for(var x=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],b=0;b<x.length;b++){var E=x[b];e[E]!=null&&a[E](e[E])}return a.endBatch(),this}else{var S=!!e,w={};S?w.elements=this.elements().map(function(C){return C.json()}):(w.elements={},l.forEach(function(C){var B=C.group();w.elements[B]||(w.elements[B]=[]),w.elements[B].push(C.json())})),this._private.styleEnabled&&(w.style=a.style().json()),w.data=Or(a.data());var T=n.options;return w.zoomingEnabled=n.zoomingEnabled,w.userZoomingEnabled=n.userZoomingEnabled,w.zoom=n.zoom,w.minZoom=n.minZoom,w.maxZoom=n.maxZoom,w.panningEnabled=n.panningEnabled,w.userPanningEnabled=n.userPanningEnabled,w.pan=Or(n.pan),w.boxSelectionEnabled=n.boxSelectionEnabled,w.renderer=Or(T.renderer),w.hideEdgesOnViewport=T.hideEdgesOnViewport,w.textureOnViewport=T.textureOnViewport,w.wheelSensitivity=T.wheelSensitivity,w.motionBlur=T.motionBlur,w.multiClickDebounceTime=T.multiClickDebounceTime,w}}});uc.$id=uc.getElementById;[CD,MD,Xx,Rh,Ko,zD,zh,Zo,kD,Ni,Ju].forEach(function(t){Fe(uc,t)});var qD={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,a){return!0},ready:void 0,stop:void 0,transform:function(e,a){return a}},VD={maximal:!1,acyclic:!1},yl=function(e){return e.scratch("breadthfirst")},o1=function(e,a){return e.scratch("breadthfirst",a)};function Kx(t){this.options=Fe({},qD,VD,t)}Kx.prototype.run=function(){var t=this.options,e=t.cy,a=t.eles,n=a.nodes().filter(function(Ue){return Ue.isChildless()}),l=a,u=t.directed,o=t.acyclic||t.maximal||t.maximalAdjustments>0,c=!!t.boundingBox,v=Va(c?t.boundingBox:structuredClone(e.extent())),f;if(nr(t.roots))f=t.roots;else if(kt(t.roots)){for(var h=[],g=0;g<t.roots.length;g++){var m=t.roots[g],x=e.getElementById(m);h.push(x)}f=e.collection(h)}else if(Ge(t.roots))f=e.$(t.roots);else if(u)f=n.roots();else{var b=a.components();f=e.collection();for(var E=function(){var Ae=b[S],Ve=Ae.maxDegree(!1),Pe=Ae.filter(function(Qe){return Qe.degree(!1)===Ve});f=f.add(Pe)},S=0;S<b.length;S++)E()}var w=[],T={},C=function(Ae,Ve){w[Ve]==null&&(w[Ve]=[]);var Pe=w[Ve].length;w[Ve].push(Ae),o1(Ae,{index:Pe,depth:Ve})},B=function(Ae,Ve){var Pe=yl(Ae),Qe=Pe.depth,Be=Pe.index;w[Qe][Be]=null,Ae.isChildless()&&C(Ae,Ve)};l.bfs({roots:f,directed:t.directed,visit:function(Ae,Ve,Pe,Qe,Be){var et=Ae[0],rt=et.id();et.isChildless()&&C(et,Be),T[rt]=!0}});for(var R=[],L=0;L<n.length;L++){var A=n[L];T[A.id()]||R.push(A)}var O=function(Ae){for(var Ve=w[Ae],Pe=0;Pe<Ve.length;Pe++){var Qe=Ve[Pe];if(Qe==null){Ve.splice(Pe,1),Pe--;continue}o1(Qe,{depth:Ae,index:Pe})}},z=function(Ae,Ve){for(var Pe=yl(Ae),Qe=Ae.incomers().filter(function(Ye){return Ye.isNode()&&a.has(Ye)}),Be=-1,et=Ae.id(),rt=0;rt<Qe.length;rt++){var vt=Qe[rt],ut=yl(vt);Be=Math.max(Be,ut.depth)}if(Pe.depth<=Be){if(!t.acyclic&&Ve[et])return null;var ot=Be+1;return B(Ae,ot),Ve[et]=ot,!0}return!1};if(u&&o){var U=[],V={},P=function(Ae){return U.push(Ae)},H=function(){return U.shift()};for(n.forEach(function(Ue){return U.push(Ue)});U.length>0;){var I=H(),F=z(I,V);if(F)I.outgoers().filter(function(Ue){return Ue.isNode()&&a.has(Ue)}).forEach(P);else if(F===null){Ct("Detected double maximal shift for node `"+I.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var _=0;if(t.avoidOverlap)for(var j=0;j<n.length;j++){var Y=n[j],Q=Y.layoutDimensions(t),W=Q.w,N=Q.h;_=Math.max(_,W,N)}var G={},Z=function(Ae){if(G[Ae.id()])return G[Ae.id()];for(var Ve=yl(Ae).depth,Pe=Ae.neighborhood(),Qe=0,Be=0,et=0;et<Pe.length;et++){var rt=Pe[et];if(!(rt.isEdge()||rt.isParent()||!n.has(rt))){var vt=yl(rt);if(vt!=null){var ut=vt.index,ot=vt.depth;if(!(ut==null||ot==null)){var Ye=w[ot].length;ot<Ve&&(Qe+=ut/Ye,Be++)}}}}return Be=Math.max(1,Be),Qe=Qe/Be,Be===0&&(Qe=0),G[Ae.id()]=Qe,Qe},$=function(Ae,Ve){var Pe=Z(Ae),Qe=Z(Ve),Be=Pe-Qe;return Be===0?Z1(Ae.id(),Ve.id()):Be};t.depthSort!==void 0&&($=t.depthSort);for(var ae=w.length,se=0;se<ae;se++)w[se].sort($),O(se);for(var de=[],Se=0;Se<R.length;Se++)de.push(R[Se]);var fe=function(){for(var Ae=0;Ae<ae;Ae++)O(Ae)};de.length&&(w.unshift(de),ae=w.length,fe());for(var te=0,re=0;re<ae;re++)te=Math.max(w[re].length,te);var le={x:v.x1+v.w/2,y:v.y1+v.h/2},he=n.reduce(function(Ue,Ae){return(function(Ve){return{w:Ue.w===-1?Ve.w:(Ue.w+Ve.w)/2,h:Ue.h===-1?Ve.h:(Ue.h+Ve.h)/2}})(Ae.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),Ee=Math.max(ae===1?0:c?(v.h-t.padding*2-he.h)/(ae-1):(v.h-t.padding*2-he.h)/(ae+1),_),ke=w.reduce(function(Ue,Ae){return Math.max(Ue,Ae.length)},0),at=function(Ae){var Ve=yl(Ae),Pe=Ve.depth,Qe=Ve.index;if(t.circle){var Be=Math.min(v.w/2/ae,v.h/2/ae);Be=Math.max(Be,_);var et=Be*Pe+Be-(ae>0&&w[0].length<=3?Be/2:0),rt=2*Math.PI/w[Pe].length*Qe;return Pe===0&&w[0].length===1&&(et=1),{x:le.x+et*Math.cos(rt),y:le.y+et*Math.sin(rt)}}else{var vt=w[Pe].length,ut=Math.max(vt===1?0:c?(v.w-t.padding*2-he.w)/((t.grid?ke:vt)-1):(v.w-t.padding*2-he.w)/((t.grid?ke:vt)+1),_),ot={x:le.x+(Qe+1-(vt+1)/2)*ut,y:le.y+(Pe+1-(ae+1)/2)*Ee};return ot}},Xe={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Xe).indexOf(t.direction)===-1&&Yt("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Xe).join(", ")));var He=function(Ae){return eT(at(Ae),v,Xe[t.direction])};return a.nodes().layoutPositions(this,t,He),this};var UD={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,a){return!0},ready:void 0,stop:void 0,transform:function(e,a){return a}};function Zx(t){this.options=Fe({},UD,t)}Zx.prototype.run=function(){var t=this.options,e=t,a=t.cy,n=e.eles,l=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,u=n.nodes().not(":parent");e.sort&&(u=u.sort(e.sort));for(var o=Va(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),c={x:o.x1+o.w/2,y:o.y1+o.h/2},v=e.sweep===void 0?2*Math.PI-2*Math.PI/u.length:e.sweep,f=v/Math.max(1,u.length-1),h,g=0,m=0;m<u.length;m++){var x=u[m],b=x.layoutDimensions(e),E=b.w,S=b.h;g=Math.max(g,E,S)}if(Ce(e.radius)?h=e.radius:u.length<=1?h=0:h=Math.min(o.h,o.w)/2-g,u.length>1&&e.avoidOverlap){g*=1.75;var w=Math.cos(f)-Math.cos(0),T=Math.sin(f)-Math.sin(0),C=Math.sqrt(g*g/(w*w+T*T));h=Math.max(C,h)}var B=function(L,A){var O=e.startAngle+A*f*(l?1:-1),z=h*Math.cos(O),U=h*Math.sin(O),V={x:c.x+z,y:c.y+U};return V};return n.nodes().layoutPositions(this,e,B),this};var jD={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,a){return!0},ready:void 0,stop:void 0,transform:function(e,a){return a}};function Qx(t){this.options=Fe({},jD,t)}Qx.prototype.run=function(){for(var t=this.options,e=t,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,l=e.eles,u=l.nodes().not(":parent"),o=Va(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),c={x:o.x1+o.w/2,y:o.y1+o.h/2},v=[],f=0,h=0;h<u.length;h++){var g=u[h],m=void 0;m=e.concentric(g),v.push({value:m,node:g}),g._private.scratch.concentric=m}u.updateStyle();for(var x=0;x<u.length;x++){var b=u[x],E=b.layoutDimensions(e);f=Math.max(f,E.w,E.h)}v.sort(function(Ee,ke){return ke.value-Ee.value});for(var S=e.levelWidth(u),w=[[]],T=w[0],C=0;C<v.length;C++){var B=v[C];if(T.length>0){var R=Math.abs(T[0].value-B.value);R>=S&&(T=[],w.push(T))}T.push(B)}var L=f+e.minNodeSpacing;if(!e.avoidOverlap){var A=w.length>0&&w[0].length>1,O=Math.min(o.w,o.h)/2-L,z=O/(w.length+A?1:0);L=Math.min(L,z)}for(var U=0,V=0;V<w.length;V++){var P=w[V],H=e.sweep===void 0?2*Math.PI-2*Math.PI/P.length:e.sweep,I=P.dTheta=H/Math.max(1,P.length-1);if(P.length>1&&e.avoidOverlap){var F=Math.cos(I)-Math.cos(0),_=Math.sin(I)-Math.sin(0),j=Math.sqrt(L*L/(F*F+_*_));U=Math.max(j,U)}P.r=U,U+=L}if(e.equidistant){for(var Y=0,Q=0,W=0;W<w.length;W++){var N=w[W],G=N.r-Q;Y=Math.max(Y,G)}Q=0;for(var Z=0;Z<w.length;Z++){var $=w[Z];Z===0&&(Q=$.r),$.r=Q,Q+=Y}}for(var ae={},se=0;se<w.length;se++)for(var de=w[se],Se=de.dTheta,fe=de.r,te=0;te<de.length;te++){var re=de[te],le=e.startAngle+(a?1:-1)*Se*te,he={x:c.x+fe*Math.cos(le),y:c.y+fe*Math.sin(le)};ae[re.node.id()]=he}return l.nodes().layoutPositions(this,e,function(Ee){var ke=Ee.id();return ae[ke]}),this};var dh,PD={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,a){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Bc(t){this.options=Fe({},PD,t),this.options.layout=this;var e=this.options.eles.nodes(),a=this.options.eles.edges(),n=a.filter(function(l){var u=l.source().data("id"),o=l.target().data("id"),c=e.some(function(f){return f.data("id")===u}),v=e.some(function(f){return f.data("id")===o});return!c||!v});this.options.eles=this.options.eles.not(n)}Bc.prototype.run=function(){var t=this.options,e=t.cy,a=this;a.stopped=!1,(t.animate===!0||t.animate===!1)&&a.emit({type:"layoutstart",layout:a}),t.debug===!0?dh=!0:dh=!1;var n=HD(e,a,t);dh&&ID(n),t.randomize&&YD(n);var l=rn(),u=function(){FD(n,e,t),t.fit===!0&&e.fit(t.padding)},o=function(m){return!(a.stopped||m>=t.numIter||(XD(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},c=function(){if(t.animate===!0||t.animate===!1)u(),a.one("layoutstop",t.stop),a.emit({type:"layoutstop",layout:a});else{var m=t.eles.nodes(),x=Wx(n,t,m);m.layoutPositions(a,t,x)}},v=0,f=!0;if(t.animate===!0){var h=function(){for(var m=0;f&&m<t.refresh;)f=o(v),v++,m++;if(!f)f1(n,t),c();else{var x=rn();x-l>=t.animationThreshold&&u(),tc(h)}};h()}else{for(;f;)f=o(v),v++;f1(n,t),c()}return this};Bc.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Bc.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var HD=function(e,a,n){for(var l=n.eles.edges(),u=n.eles.nodes(),o=Va(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),c={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:u.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:l.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},v=n.eles.components(),f={},h=0;h<v.length;h++)for(var g=v[h],m=0;m<g.length;m++){var x=g[m];f[x.id()]=h}for(var h=0;h<c.nodeSize;h++){var b=u[h],E=b.layoutDimensions(n),S={};S.isLocked=b.locked(),S.id=b.data("id"),S.parentId=b.data("parent"),S.cmptId=f[b.id()],S.children=[],S.positionX=b.position("x"),S.positionY=b.position("y"),S.offsetX=0,S.offsetY=0,S.height=E.w,S.width=E.h,S.maxX=S.positionX+S.width/2,S.minX=S.positionX-S.width/2,S.maxY=S.positionY+S.height/2,S.minY=S.positionY-S.height/2,S.padLeft=parseFloat(b.style("padding")),S.padRight=parseFloat(b.style("padding")),S.padTop=parseFloat(b.style("padding")),S.padBottom=parseFloat(b.style("padding")),S.nodeRepulsion=Xt(n.nodeRepulsion)?n.nodeRepulsion(b):n.nodeRepulsion,c.layoutNodes.push(S),c.idToIndex[S.id]=h}for(var w=[],T=0,C=-1,B=[],h=0;h<c.nodeSize;h++){var b=c.layoutNodes[h],R=b.parentId;R!=null?c.layoutNodes[c.idToIndex[R]].children.push(b.id):(w[++C]=b.id,B.push(b.id))}for(c.graphSet.push(B);T<=C;){var L=w[T++],A=c.idToIndex[L],x=c.layoutNodes[A],O=x.children;if(O.length>0){c.graphSet.push(O);for(var h=0;h<O.length;h++)w[++C]=O[h]}}for(var h=0;h<c.graphSet.length;h++)for(var z=c.graphSet[h],m=0;m<z.length;m++){var U=c.idToIndex[z[m]];c.indexToGraph[U]=h}for(var h=0;h<c.edgeSize;h++){var V=l[h],P={};P.id=V.data("id"),P.sourceId=V.data("source"),P.targetId=V.data("target");var H=Xt(n.idealEdgeLength)?n.idealEdgeLength(V):n.idealEdgeLength,I=Xt(n.edgeElasticity)?n.edgeElasticity(V):n.edgeElasticity,F=c.idToIndex[P.sourceId],_=c.idToIndex[P.targetId],j=c.indexToGraph[F],Y=c.indexToGraph[_];if(j!=Y){for(var Q=GD(P.sourceId,P.targetId,c),W=c.graphSet[Q],N=0,S=c.layoutNodes[F];W.indexOf(S.id)===-1;)S=c.layoutNodes[c.idToIndex[S.parentId]],N++;for(S=c.layoutNodes[_];W.indexOf(S.id)===-1;)S=c.layoutNodes[c.idToIndex[S.parentId]],N++;H*=N*n.nestingFactor}P.idealLength=H,P.elasticity=I,c.layoutEdges.push(P)}return c},GD=function(e,a,n){var l=$x(e,a,0,n);return 2>l.count?0:l.graph},$x=function(e,a,n,l){var u=l.graphSet[n];if(-1<u.indexOf(e)&&-1<u.indexOf(a))return{count:2,graph:n};for(var o=0,c=0;c<u.length;c++){var v=u[c],f=l.idToIndex[v],h=l.layoutNodes[f].children;if(h.length!==0){var g=l.indexToGraph[l.idToIndex[h[0]]],m=$x(e,a,g,l);if(m.count!==0)if(m.count===1){if(o++,o===2)break}else return m}}return{count:o,graph:n}},ID,YD=function(e,a){for(var n=e.clientWidth,l=e.clientHeight,u=0;u<e.nodeSize;u++){var o=e.layoutNodes[u];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*l)}},Wx=function(e,a,n){var l=e.boundingBox,u={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return a.boundingBox&&(n.forEach(function(o){var c=e.layoutNodes[e.idToIndex[o.data("id")]];u.x1=Math.min(u.x1,c.positionX),u.x2=Math.max(u.x2,c.positionX),u.y1=Math.min(u.y1,c.positionY),u.y2=Math.max(u.y2,c.positionY)}),u.w=u.x2-u.x1,u.h=u.y2-u.y1),function(o,c){var v=e.layoutNodes[e.idToIndex[o.data("id")]];if(a.boundingBox){var f=u.w===0?.5:(v.positionX-u.x1)/u.w,h=u.h===0?.5:(v.positionY-u.y1)/u.h;return{x:l.x1+f*l.w,y:l.y1+h*l.h}}else return{x:v.positionX,y:v.positionY}}},FD=function(e,a,n){var l=n.layout,u=n.eles.nodes(),o=Wx(e,n,u);u.positions(o),e.ready!==!0&&(e.ready=!0,l.one("layoutready",n.ready),l.emit({type:"layoutready",layout:this}))},XD=function(e,a,n){KD(e,a),$D(e),WD(e,a),JD(e),eB(e)},KD=function(e,a){for(var n=0;n<e.graphSet.length;n++)for(var l=e.graphSet[n],u=l.length,o=0;o<u;o++)for(var c=e.layoutNodes[e.idToIndex[l[o]]],v=o+1;v<u;v++){var f=e.layoutNodes[e.idToIndex[l[v]]];ZD(c,f,e,a)}},c1=function(e){return-1+2*e*Math.random()},ZD=function(e,a,n,l){var u=e.cmptId,o=a.cmptId;if(!(u!==o&&!n.isCompound)){var c=a.positionX-e.positionX,v=a.positionY-e.positionY,f=1;c===0&&v===0&&(c=c1(f),v=c1(f));var h=QD(e,a,c,v);if(h>0)var g=l.nodeOverlap*h,m=Math.sqrt(c*c+v*v),x=g*c/m,b=g*v/m;else var E=sc(e,c,v),S=sc(a,-1*c,-1*v),w=S.x-E.x,T=S.y-E.y,C=w*w+T*T,m=Math.sqrt(C),g=(e.nodeRepulsion+a.nodeRepulsion)/C,x=g*w/m,b=g*T/m;e.isLocked||(e.offsetX-=x,e.offsetY-=b),a.isLocked||(a.offsetX+=x,a.offsetY+=b)}},QD=function(e,a,n,l){if(n>0)var u=e.maxX-a.minX;else var u=a.maxX-e.minX;if(l>0)var o=e.maxY-a.minY;else var o=a.maxY-e.minY;return u>=0&&o>=0?Math.sqrt(u*u+o*o):0},sc=function(e,a,n){var l=e.positionX,u=e.positionY,o=e.height||1,c=e.width||1,v=n/a,f=o/c,h={};return a===0&&0<n||a===0&&0>n?(h.x=l,h.y=u+o/2,h):0<a&&-1*f<=v&&v<=f?(h.x=l+c/2,h.y=u+c*n/2/a,h):0>a&&-1*f<=v&&v<=f?(h.x=l-c/2,h.y=u-c*n/2/a,h):0<n&&(v<=-1*f||v>=f)?(h.x=l+o*a/2/n,h.y=u+o/2,h):(0>n&&(v<=-1*f||v>=f)&&(h.x=l-o*a/2/n,h.y=u-o/2),h)},$D=function(e,a){for(var n=0;n<e.edgeSize;n++){var l=e.layoutEdges[n],u=e.idToIndex[l.sourceId],o=e.layoutNodes[u],c=e.idToIndex[l.targetId],v=e.layoutNodes[c],f=v.positionX-o.positionX,h=v.positionY-o.positionY;if(!(f===0&&h===0)){var g=sc(o,f,h),m=sc(v,-1*f,-1*h),x=m.x-g.x,b=m.y-g.y,E=Math.sqrt(x*x+b*b),S=Math.pow(l.idealLength-E,2)/l.elasticity;if(E!==0)var w=S*x/E,T=S*b/E;else var w=0,T=0;o.isLocked||(o.offsetX+=w,o.offsetY+=T),v.isLocked||(v.offsetX-=w,v.offsetY-=T)}}},WD=function(e,a){if(a.gravity!==0)for(var n=1,l=0;l<e.graphSet.length;l++){var u=e.graphSet[l],o=u.length;if(l===0)var c=e.clientHeight/2,v=e.clientWidth/2;else var f=e.layoutNodes[e.idToIndex[u[0]]],h=e.layoutNodes[e.idToIndex[f.parentId]],c=h.positionX,v=h.positionY;for(var g=0;g<o;g++){var m=e.layoutNodes[e.idToIndex[u[g]]];if(!m.isLocked){var x=c-m.positionX,b=v-m.positionY,E=Math.sqrt(x*x+b*b);if(E>n){var S=a.gravity*x/E,w=a.gravity*b/E;m.offsetX+=S,m.offsetY+=w}}}}},JD=function(e,a){var n=[],l=0,u=-1;for(n.push.apply(n,e.graphSet[0]),u+=e.graphSet[0].length;l<=u;){var o=n[l++],c=e.idToIndex[o],v=e.layoutNodes[c],f=v.children;if(0<f.length&&!v.isLocked){for(var h=v.offsetX,g=v.offsetY,m=0;m<f.length;m++){var x=e.layoutNodes[e.idToIndex[f[m]]];x.offsetX+=h,x.offsetY+=g,n[++u]=f[m]}v.offsetX=0,v.offsetY=0}}},eB=function(e,a){for(var n=0;n<e.nodeSize;n++){var l=e.layoutNodes[n];0<l.children.length&&(l.maxX=void 0,l.minX=void 0,l.maxY=void 0,l.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var l=e.layoutNodes[n];if(!(0<l.children.length||l.isLocked)){var u=tB(l.offsetX,l.offsetY,e.temperature);l.positionX+=u.x,l.positionY+=u.y,l.offsetX=0,l.offsetY=0,l.minX=l.positionX-l.width,l.maxX=l.positionX+l.width,l.minY=l.positionY-l.height,l.maxY=l.positionY+l.height,Jx(l,e)}}for(var n=0;n<e.nodeSize;n++){var l=e.layoutNodes[n];0<l.children.length&&!l.isLocked&&(l.positionX=(l.maxX+l.minX)/2,l.positionY=(l.maxY+l.minY)/2,l.width=l.maxX-l.minX,l.height=l.maxY-l.minY)}},tB=function(e,a,n){var l=Math.sqrt(e*e+a*a);if(l>n)var u={x:n*e/l,y:n*a/l};else var u={x:e,y:a};return u},Jx=function(e,a){var n=e.parentId;if(n!=null){var l=a.layoutNodes[a.idToIndex[n]],u=!1;if((l.maxX==null||e.maxX+l.padRight>l.maxX)&&(l.maxX=e.maxX+l.padRight,u=!0),(l.minX==null||e.minX-l.padLeft<l.minX)&&(l.minX=e.minX-l.padLeft,u=!0),(l.maxY==null||e.maxY+l.padBottom>l.maxY)&&(l.maxY=e.maxY+l.padBottom,u=!0),(l.minY==null||e.minY-l.padTop<l.minY)&&(l.minY=e.minY-l.padTop,u=!0),u)return Jx(l,a)}},f1=function(e,a){for(var n=e.layoutNodes,l=[],u=0;u<n.length;u++){var o=n[u],c=o.cmptId,v=l[c]=l[c]||[];v.push(o)}for(var f=0,u=0;u<l.length;u++){var h=l[u];if(h){h.x1=1/0,h.x2=-1/0,h.y1=1/0,h.y2=-1/0;for(var g=0;g<h.length;g++){var m=h[g];h.x1=Math.min(h.x1,m.positionX-m.width/2),h.x2=Math.max(h.x2,m.positionX+m.width/2),h.y1=Math.min(h.y1,m.positionY-m.height/2),h.y2=Math.max(h.y2,m.positionY+m.height/2)}h.w=h.x2-h.x1,h.h=h.y2-h.y1,f+=h.w*h.h}}l.sort(function(T,C){return C.w*C.h-T.w*T.h});for(var x=0,b=0,E=0,S=0,w=Math.sqrt(f)*e.clientWidth/e.clientHeight,u=0;u<l.length;u++){var h=l[u];if(h){for(var g=0;g<h.length;g++){var m=h[g];m.isLocked||(m.positionX+=x-h.x1,m.positionY+=b-h.y1)}x+=h.w+a.componentSpacing,E+=h.w+a.componentSpacing,S=Math.max(S,h.h),E>w&&(b+=S+a.componentSpacing,x=0,E=0,S=0)}}},aB={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,a){return!0},ready:void 0,stop:void 0,transform:function(e,a){return a}};function ew(t){this.options=Fe({},aB,t)}ew.prototype.run=function(){var t=this.options,e=t,a=t.cy,n=e.eles,l=n.nodes().not(":parent");e.sort&&(l=l.sort(e.sort));var u=Va(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()});if(u.h===0||u.w===0)n.nodes().layoutPositions(this,e,function(Z){return{x:u.x1,y:u.y1}});else{var o=l.size(),c=Math.sqrt(o*u.h/u.w),v=Math.round(c),f=Math.round(u.w/u.h*c),h=function($){if($==null)return Math.min(v,f);var ae=Math.min(v,f);ae==v?v=$:f=$},g=function($){if($==null)return Math.max(v,f);var ae=Math.max(v,f);ae==v?v=$:f=$},m=e.rows,x=e.cols!=null?e.cols:e.columns;if(m!=null&&x!=null)v=m,f=x;else if(m!=null&&x==null)v=m,f=Math.ceil(o/v);else if(m==null&&x!=null)f=x,v=Math.ceil(o/f);else if(f*v>o){var b=h(),E=g();(b-1)*E>=o?h(b-1):(E-1)*b>=o&&g(E-1)}else for(;f*v<o;){var S=h(),w=g();(w+1)*S>=o?g(w+1):h(S+1)}var T=u.w/f,C=u.h/v;if(e.condense&&(T=0,C=0),e.avoidOverlap)for(var B=0;B<l.length;B++){var R=l[B],L=R._private.position;(L.x==null||L.y==null)&&(L.x=0,L.y=0);var A=R.layoutDimensions(e),O=e.avoidOverlapPadding,z=A.w+O,U=A.h+O;T=Math.max(T,z),C=Math.max(C,U)}for(var V={},P=function($,ae){return!!V["c-"+$+"-"+ae]},H=function($,ae){V["c-"+$+"-"+ae]=!0},I=0,F=0,_=function(){F++,F>=f&&(F=0,I++)},j={},Y=0;Y<l.length;Y++){var Q=l[Y],W=e.position(Q);if(W&&(W.row!==void 0||W.col!==void 0)){var N={row:W.row,col:W.col};if(N.col===void 0)for(N.col=0;P(N.row,N.col);)N.col++;else if(N.row===void 0)for(N.row=0;P(N.row,N.col);)N.row++;j[Q.id()]=N,H(N.row,N.col)}}var G=function($,ae){var se,de;if($.locked()||$.isParent())return!1;var Se=j[$.id()];if(Se)se=Se.col*T+T/2+u.x1,de=Se.row*C+C/2+u.y1;else{for(;P(I,F);)_();se=F*T+T/2+u.x1,de=I*C+C/2+u.y1,H(I,F),_()}return{x:se,y:de}};l.layoutPositions(this,e,G)}return this};var rB={ready:function(){},stop:function(){}};function og(t){this.options=Fe({},rB,t)}og.prototype.run=function(){var t=this.options,e=t.eles,a=this;return t.cy,a.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),a.one("layoutready",t.ready),a.emit("layoutready"),a.one("layoutstop",t.stop),a.emit("layoutstop"),this};og.prototype.stop=function(){return this};var nB={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,a){return!0},ready:void 0,stop:void 0,transform:function(e,a){return a}};function tw(t){this.options=Fe({},nB,t)}tw.prototype.run=function(){var t=this.options,e=t.eles,a=e.nodes(),n=Xt(t.positions);function l(u){if(t.positions==null)return AT(u.position());if(n)return t.positions(u);var o=t.positions[u._private.data.id];return o??null}return a.layoutPositions(this,t,function(u,o){var c=l(u);return u.locked()||c==null?!1:c}),this};var iB={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,a){return!0},ready:void 0,stop:void 0,transform:function(e,a){return a}};function aw(t){this.options=Fe({},iB,t)}aw.prototype.run=function(){var t=this.options,e=t.cy,a=t.eles,n=Va(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l=function(o,c){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return a.nodes().layoutPositions(this,t,l),this};var lB=[{name:"breadthfirst",impl:Kx},{name:"circle",impl:Zx},{name:"concentric",impl:Qx},{name:"cose",impl:Bc},{name:"grid",impl:ew},{name:"null",impl:og},{name:"preset",impl:tw},{name:"random",impl:aw}];function rw(t){this.options=t,this.notifications=0}var v1=function(){},d1=function(){throw new Error("A headless instance can not render images")};rw.prototype={recalculateRenderedStyle:v1,notify:function(){this.notifications++},init:v1,isHeadless:function(){return!0},png:d1,jpg:d1};var cg={};cg.arrowShapeWidth=.3;cg.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,a=function(f,h,g,m,x,b,E){var S=x.x-g/2-E,w=x.x+g/2+E,T=x.y-g/2-E,C=x.y+g/2+E,B=S<=f&&f<=w&&T<=h&&h<=C;return B},n=function(f,h,g,m,x){var b=f*Math.cos(m)-h*Math.sin(m),E=f*Math.sin(m)+h*Math.cos(m),S=b*g,w=E*g,T=S+x.x,C=w+x.y;return{x:T,y:C}},l=function(f,h,g,m){for(var x=[],b=0;b<f.length;b+=2){var E=f[b],S=f[b+1];x.push(n(E,S,h,g,m))}return x},u=function(f){for(var h=[],g=0;g<f.length;g++){var m=f[g];h.push(m.x,m.y)}return h},o=function(f){return f.pstyle("width").pfValue*f.pstyle("arrow-scale").pfValue*2},c=function(f,h){Ge(h)&&(h=t[h]),t[f]=Fe({name:f,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(m,x,b,E,S,w){var T=u(l(this.points,b+2*w,E,S)),C=Ka(m,x,T);return C},roughCollide:a,draw:function(m,x,b,E){var S=l(this.points,x,b,E);e.arrowShapeImpl("polygon")(m,S)},spacing:function(m){return 0},gap:o},h)};c("none",{collide:ac,roughCollide:ac,draw:Zh,spacing:D0,gap:D0}),c("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),c("arrow","triangle"),c("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:a,draw:function(f,h,g,m,x){var b=l(this.points,h,g,m),E=this.controlPoint,S=n(E[0],E[1],h,g,m);e.arrowShapeImpl(this.name)(f,b,S)},gap:function(f){return o(f)*.8}}),c("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(f,h,g,m,x,b,E){var S=u(l(this.points,g+2*E,m,x)),w=u(l(this.pointsTee,g+2*E,m,x)),T=Ka(f,h,S)||Ka(f,h,w);return T},draw:function(f,h,g,m,x){var b=l(this.points,h,g,m),E=l(this.pointsTee,h,g,m);e.arrowShapeImpl(this.name)(f,b,E)}}),c("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(f,h,g,m,x,b,E){var S=x,w=Math.pow(S.x-f,2)+Math.pow(S.y-h,2)<=Math.pow((g+2*E)*this.radius,2),T=u(l(this.points,g+2*E,m,x));return Ka(f,h,T)||w},draw:function(f,h,g,m,x){var b=l(this.pointsTr,h,g,m);e.arrowShapeImpl(this.name)(f,b,m.x,m.y,this.radius*h)},spacing:function(f){return e.getArrowWidth(f.pstyle("width").pfValue,f.pstyle("arrow-scale").value)*this.radius}}),c("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(f,h){var g=this.baseCrossLinePts.slice(),m=h/f,x=3,b=5;return g[x]=g[x]-m,g[b]=g[b]-m,g},collide:function(f,h,g,m,x,b,E){var S=u(l(this.points,g+2*E,m,x)),w=u(l(this.crossLinePts(g,b),g+2*E,m,x)),T=Ka(f,h,S)||Ka(f,h,w);return T},draw:function(f,h,g,m,x){var b=l(this.points,h,g,m),E=l(this.crossLinePts(h,x),h,g,m);e.arrowShapeImpl(this.name)(f,b,E)}}),c("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(f){return o(f)*.525}}),c("circle",{radius:.15,collide:function(f,h,g,m,x,b,E){var S=x,w=Math.pow(S.x-f,2)+Math.pow(S.y-h,2)<=Math.pow((g+2*E)*this.radius,2);return w},draw:function(f,h,g,m,x){e.arrowShapeImpl(this.name)(f,m.x,m.y,this.radius*h)},spacing:function(f){return e.getArrowWidth(f.pstyle("width").pfValue,f.pstyle("arrow-scale").value)*this.radius}}),c("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(f){return 1},gap:function(f){return 1}}),c("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),c("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(f){return f.pstyle("width").pfValue*f.pstyle("arrow-scale").value}}),c("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(f){return .95*f.pstyle("width").pfValue*f.pstyle("arrow-scale").value}})};var zi={};zi.projectIntoViewport=function(t,e){var a=this.cy,n=this.findContainerClientCoords(),l=n[0],u=n[1],o=n[4],c=a.pan(),v=a.zoom(),f=((t-l)/o-c.x)/v,h=((e-u)/o-c.y)/v;return[f,h]};zi.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),a=this.cy.window().getComputedStyle(t),n=function(w){return parseFloat(a.getPropertyValue(w))},l={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},u={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},o=t.clientWidth,c=t.clientHeight,v=l.left+l.right,f=l.top+l.bottom,h=u.left+u.right,g=e.width/(o+h),m=o-v,x=c-f,b=e.left+l.left+u.left,E=e.top+l.top+u.top;return this.containerBB=[b,E,m,x,g]};zi.invalidateContainerClientCoordsCache=function(){this.containerBB=null};zi.findNearestElement=function(t,e,a,n){return this.findNearestElements(t,e,a,n)[0]};zi.findNearestElements=function(t,e,a,n){var l=this,u=this,o=u.getCachedZSortedEles(),c=[],v=u.cy.zoom(),f=u.cy.hasCompoundNodes(),h=(n?24:8)/v,g=(n?8:2)/v,m=(n?8:2)/v,x=1/0,b,E;a&&(o=o.interactive);function S(A,O){if(A.isNode()){if(E)return;E=A,c.push(A)}if(A.isEdge()&&(O==null||O<x))if(b){if(b.pstyle("z-compound-depth").value===A.pstyle("z-compound-depth").value&&b.pstyle("z-compound-depth").value===A.pstyle("z-compound-depth").value){for(var z=0;z<c.length;z++)if(c[z].isEdge()){c[z]=A,b=A,x=O??x;break}}}else c.push(A),b=A,x=O??x}function w(A){var O=A.outerWidth()+2*g,z=A.outerHeight()+2*g,U=O/2,V=z/2,P=A.position(),H=A.pstyle("corner-radius").value==="auto"?"auto":A.pstyle("corner-radius").pfValue,I=A._private.rscratch;if(P.x-U<=t&&t<=P.x+U&&P.y-V<=e&&e<=P.y+V){var F=u.nodeShapes[l.getNodeShape(A)];if(F.checkPoint(t,e,0,O,z,P.x,P.y,H,I))return S(A,0),!0}}function T(A){var O=A._private,z=O.rscratch,U=A.pstyle("width").pfValue,V=A.pstyle("arrow-scale").value,P=U/2+h,H=P*P,I=P*2,Y=O.source,Q=O.target,F;if(z.edgeType==="segments"||z.edgeType==="straight"||z.edgeType==="haystack"){for(var _=z.allpts,j=0;j+3<_.length;j+=2)if(jT(t,e,_[j],_[j+1],_[j+2],_[j+3],I)&&H>(F=YT(t,e,_[j],_[j+1],_[j+2],_[j+3])))return S(A,F),!0}else if(z.edgeType==="bezier"||z.edgeType==="multibezier"||z.edgeType==="self"||z.edgeType==="compound"){for(var _=z.allpts,j=0;j+5<z.allpts.length;j+=4)if(PT(t,e,_[j],_[j+1],_[j+2],_[j+3],_[j+4],_[j+5],I)&&H>(F=IT(t,e,_[j],_[j+1],_[j+2],_[j+3],_[j+4],_[j+5])))return S(A,F),!0}for(var Y=Y||O.source,Q=Q||O.target,W=l.getArrowWidth(U,V),N=[{name:"source",x:z.arrowStartX,y:z.arrowStartY,angle:z.srcArrowAngle},{name:"target",x:z.arrowEndX,y:z.arrowEndY,angle:z.tgtArrowAngle},{name:"mid-source",x:z.midX,y:z.midY,angle:z.midsrcArrowAngle},{name:"mid-target",x:z.midX,y:z.midY,angle:z.midtgtArrowAngle}],j=0;j<N.length;j++){var G=N[j],Z=u.arrowShapes[A.pstyle(G.name+"-arrow-shape").value],$=A.pstyle("width").pfValue;if(Z.roughCollide(t,e,W,G.angle,{x:G.x,y:G.y},$,h)&&Z.collide(t,e,W,G.angle,{x:G.x,y:G.y},$,h))return S(A),!0}f&&c.length>0&&(w(Y),w(Q))}function C(A,O,z){return Xa(A,O,z)}function B(A,O){var z=A._private,U=m,V;O?V=O+"-":V="",A.boundingBox();var P=z.labelBounds[O||"main"],H=A.pstyle(V+"label").value,I=A.pstyle("text-events").strValue==="yes";if(!(!I||!H)){var F=C(z.rscratch,"labelX",O),_=C(z.rscratch,"labelY",O),j=C(z.rscratch,"labelAngle",O),Y=A.pstyle(V+"text-margin-x").pfValue,Q=A.pstyle(V+"text-margin-y").pfValue,W=P.x1-U-Y,N=P.x2+U-Y,G=P.y1-U-Q,Z=P.y2+U-Q;if(j){var $=Math.cos(j),ae=Math.sin(j),se=function(he,Ee){return he=he-F,Ee=Ee-_,{x:he*$-Ee*ae+F,y:he*ae+Ee*$+_}},de=se(W,G),Se=se(W,Z),fe=se(N,G),te=se(N,Z),re=[de.x+Y,de.y+Q,fe.x+Y,fe.y+Q,te.x+Y,te.y+Q,Se.x+Y,Se.y+Q];if(Ka(t,e,re))return S(A),!0}else if(jn(P,t,e))return S(A),!0}}for(var R=o.length-1;R>=0;R--){var L=o[R];L.isNode()?w(L)||B(L):T(L)||B(L)||B(L,"source")||B(L,"target")}return c};zi.getAllInBox=function(t,e,a,n){var l=this.getCachedZSortedEles().interactive,u=this.cy.zoom(),o=2/u,c=[],v=Math.min(t,a),f=Math.max(t,a),h=Math.min(e,n),g=Math.max(e,n);t=v,a=f,e=h,n=g;var m=Va({x1:t,y1:e,x2:a,y2:n}),x=[{x:m.x1,y:m.y1},{x:m.x2,y:m.y1},{x:m.x2,y:m.y2},{x:m.x1,y:m.y2}],b=[[x[0],x[1]],[x[1],x[2]],[x[2],x[3]],[x[3],x[0]]];function E(he,Ee,ke){return Xa(he,Ee,ke)}function S(he,Ee){var ke=he._private,at=o,Xe="";he.boundingBox();var He=ke.labelBounds.main;if(!He)return null;var Ue=E(ke.rscratch,"labelX",Ee),Ae=E(ke.rscratch,"labelY",Ee),Ve=E(ke.rscratch,"labelAngle",Ee),Pe=he.pstyle(Xe+"text-margin-x").pfValue,Qe=he.pstyle(Xe+"text-margin-y").pfValue,Be=He.x1-at-Pe,et=He.x2+at-Pe,rt=He.y1-at-Qe,vt=He.y2+at-Qe;if(Ve){var ut=Math.cos(Ve),ot=Math.sin(Ve),Ye=function(pe,q){return pe=pe-Ue,q=q-Ae,{x:pe*ut-q*ot+Ue,y:pe*ot+q*ut+Ae}};return[Ye(Be,rt),Ye(et,rt),Ye(et,vt),Ye(Be,vt)]}else return[{x:Be,y:rt},{x:et,y:rt},{x:et,y:vt},{x:Be,y:vt}]}function w(he,Ee,ke,at){function Xe(He,Ue,Ae){return(Ae.y-He.y)*(Ue.x-He.x)>(Ue.y-He.y)*(Ae.x-He.x)}return Xe(he,ke,at)!==Xe(Ee,ke,at)&&Xe(he,Ee,ke)!==Xe(he,Ee,at)}for(var T=0;T<l.length;T++){var C=l[T];if(C.isNode()){var B=C,R=B.pstyle("text-events").strValue==="yes",L=B.pstyle("box-selection").strValue,A=B.pstyle("box-select-labels").strValue==="yes";if(L==="none")continue;var O=(L==="overlap"||A)&&R,z=B.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:O});if(L==="contain"){var U=!1;if(A&&R){var V=S(B);V&&fd(V,x)&&(c.push(B),U=!0)}!U&&cx(m,z)&&c.push(B)}else if(L==="overlap"&&Jh(m,z)){var P=B.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),H=[{x:P.x1,y:P.y1},{x:P.x2,y:P.y1},{x:P.x2,y:P.y2},{x:P.x1,y:P.y2}];if(fd(H,x))c.push(B);else{var I=S(B);I&&fd(I,x)&&c.push(B)}}}else{var F=C,_=F._private,j=_.rscratch,Y=F.pstyle("box-selection").strValue;if(Y==="none")continue;if(Y==="contain"){if(j.startX!=null&&j.startY!=null&&!jn(m,j.startX,j.startY)||j.endX!=null&&j.endY!=null&&!jn(m,j.endX,j.endY))continue;if(j.edgeType==="bezier"||j.edgeType==="multibezier"||j.edgeType==="self"||j.edgeType==="compound"||j.edgeType==="segments"||j.edgeType==="haystack"){for(var Q=_.rstyle.bezierPts||_.rstyle.linePts||_.rstyle.haystackPts,W=!0,N=0;N<Q.length;N++)if(!z0(m,Q[N])){W=!1;break}W&&c.push(F)}else j.edgeType==="straight"&&c.push(F)}else if(Y==="overlap"){var G=!1;if(j.startX!=null&&j.startY!=null&&j.endX!=null&&j.endY!=null&&(jn(m,j.startX,j.startY)||jn(m,j.endX,j.endY)))c.push(F),G=!0;else if(!G&&j.edgeType==="haystack"){for(var Z=_.rstyle.haystackPts,$=0;$<Z.length;$++)if(z0(m,Z[$])){c.push(F),G=!0;break}}if(!G){var ae=_.rstyle.bezierPts||_.rstyle.linePts||_.rstyle.haystackPts;if((!ae||ae.length<2)&&j.edgeType==="straight"&&j.startX!=null&&j.startY!=null&&j.endX!=null&&j.endY!=null&&(ae=[{x:j.startX,y:j.startY},{x:j.endX,y:j.endY}]),!ae||ae.length<2)continue;for(var se=0;se<ae.length-1;se++){for(var de=ae[se],Se=ae[se+1],fe=0;fe<b.length;fe++){var te=la(b[fe],2),re=te[0],le=te[1];if(w(de,Se,re,le)){c.push(F),G=!0;break}}if(G)break}}}}}return c};var oc={};oc.calculateArrowAngles=function(t){var e=t._private.rscratch,a=e.edgeType==="haystack",n=e.edgeType==="bezier",l=e.edgeType==="multibezier",u=e.edgeType==="segments",o=e.edgeType==="compound",c=e.edgeType==="self",v,f,h,g,m,x,w,T;if(a?(h=e.haystackPts[0],g=e.haystackPts[1],m=e.haystackPts[2],x=e.haystackPts[3]):(h=e.arrowStartX,g=e.arrowStartY,m=e.arrowEndX,x=e.arrowEndY),w=e.midX,T=e.midY,u)v=h-e.segpts[0],f=g-e.segpts[1];else if(l||o||c||n){var b=e.allpts,E=ba(b[0],b[2],b[4],.1),S=ba(b[1],b[3],b[5],.1);v=h-E,f=g-S}else v=h-w,f=g-T;e.srcArrowAngle=Ro(v,f);var w=e.midX,T=e.midY;if(a&&(w=(h+m)/2,T=(g+x)/2),v=m-h,f=x-g,u){var b=e.allpts;if(b.length/2%2===0){var C=b.length/2,B=C-2;v=b[C]-b[B],f=b[C+1]-b[B+1]}else if(e.isRound)v=e.midVector[1],f=-e.midVector[0];else{var C=b.length/2-1,B=C-2;v=b[C]-b[B],f=b[C+1]-b[B+1]}}else if(l||o||c){var b=e.allpts,R=e.ctrlpts,L,A,O,z;if(R.length/2%2===0){var U=b.length/2-1,V=U+2,P=V+2;L=ba(b[U],b[V],b[P],0),A=ba(b[U+1],b[V+1],b[P+1],0),O=ba(b[U],b[V],b[P],1e-4),z=ba(b[U+1],b[V+1],b[P+1],1e-4)}else{var V=b.length/2-1,U=V-2,P=V+2;L=ba(b[U],b[V],b[P],.4999),A=ba(b[U+1],b[V+1],b[P+1],.4999),O=ba(b[U],b[V],b[P],.5),z=ba(b[U+1],b[V+1],b[P+1],.5)}v=O-L,f=z-A}if(e.midtgtArrowAngle=Ro(v,f),e.midDispX=v,e.midDispY=f,v*=-1,f*=-1,u){var b=e.allpts;if(b.length/2%2!==0){if(!e.isRound){var C=b.length/2-1,H=C+2;v=-(b[H]-b[C]),f=-(b[H+1]-b[C+1])}}}if(e.midsrcArrowAngle=Ro(v,f),u)v=m-e.segpts[e.segpts.length-2],f=x-e.segpts[e.segpts.length-1];else if(l||o||c||n){var b=e.allpts,I=b.length,E=ba(b[I-6],b[I-4],b[I-2],.9),S=ba(b[I-5],b[I-3],b[I-1],.9);v=m-E,f=x-S}else v=m-w,f=x-T;e.tgtArrowAngle=Ro(v,f)};oc.getArrowWidth=oc.getArrowHeight=function(t,e){var a=this.arrowWidthCache=this.arrowWidthCache||{},n=a[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,a[t+", "+e]=n,n)};var Oh,Lh,zr={},pr={},h1,g1,Ti,Qo,en,yi,Si,Mr,bl,Uo,nw,iw,kh,_h,p1,m1=function(e,a,n){n.x=a.x-e.x,n.y=a.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},uB=function(e,a){a.x=e.x*-1,a.y=e.y*-1,a.nx=e.nx*-1,a.ny=e.ny*-1,a.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},sB=function(e,a,n,l,u){if(e!==p1?m1(a,e,zr):uB(pr,zr),m1(a,n,pr),h1=zr.nx*pr.ny-zr.ny*pr.nx,g1=zr.nx*pr.nx-zr.ny*-pr.ny,en=Math.asin(Math.max(-1,Math.min(1,h1))),Math.abs(en)<1e-6){Oh=a.x,Lh=a.y,Si=bl=0;return}Ti=1,Qo=!1,g1<0?en<0?en=Math.PI+en:(en=Math.PI-en,Ti=-1,Qo=!0):en>0&&(Ti=-1,Qo=!0),a.radius!==void 0?bl=a.radius:bl=l,yi=en/2,Uo=Math.min(zr.len/2,pr.len/2),u?(Mr=Math.abs(Math.cos(yi)*bl/Math.sin(yi)),Mr>Uo?(Mr=Uo,Si=Math.abs(Mr*Math.sin(yi)/Math.cos(yi))):Si=bl):(Mr=Math.min(Uo,bl),Si=Math.abs(Mr*Math.sin(yi)/Math.cos(yi))),kh=a.x+pr.nx*Mr,_h=a.y+pr.ny*Mr,Oh=kh-pr.ny*Si*Ti,Lh=_h+pr.nx*Si*Ti,nw=a.x+zr.nx*Mr,iw=a.y+zr.ny*Mr,p1=a};function lw(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 fg(t,e,a,n){var l=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}:(sB(t,e,a,n,l),{cx:Oh,cy:Lh,radius:Si,startX:nw,startY:iw,stopX:kh,stopY:_h,startAngle:zr.ang+Math.PI/2*Ti,endAngle:pr.ang-Math.PI/2*Ti,counterClockwise:Qo})}var ts=.01,oB=Math.sqrt(2*ts),ka={};ka.findMidptPtsEtc=function(t,e){var a=e.posPts,n=e.intersectionPts,l=e.vectorNormInverse,u,o=t.pstyle("source-endpoint"),c=t.pstyle("target-endpoint"),v=o.units!=null&&c.units!=null,f=function(R,L,A,O){var z=O-L,U=A-R,V=Math.sqrt(U*U+z*z);return{x:-z/V,y:U/V}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":u=a;break;case"intersection":u=n;break;case"endpoints":{if(v){var g=this.manualEndptToPx(t.source()[0],o),m=la(g,2),x=m[0],b=m[1],E=this.manualEndptToPx(t.target()[0],c),S=la(E,2),w=S[0],T=S[1],C={x1:x,y1:b,x2:w,y2:T};l=f(x,b,w,T),u=C}else Ct("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:l}};ka.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var a=t[e],n=a._private,l=n.rscratch;if(!l.haystack){var u=Math.random()*2*Math.PI;l.source={x:Math.cos(u),y:Math.sin(u)},u=Math.random()*2*Math.PI,l.target={x:Math.cos(u),y:Math.sin(u)}}var o=n.source,c=n.target,v=o.position(),f=c.position(),h=o.width(),g=c.width(),m=o.height(),x=c.height(),b=a.pstyle("haystack-radius").value,E=b/2;l.haystackPts=l.allpts=[l.source.x*h*E+v.x,l.source.y*m*E+v.y,l.target.x*g*E+f.x,l.target.y*x*E+f.y],l.midX=(l.allpts[0]+l.allpts[2])/2,l.midY=(l.allpts[1]+l.allpts[3])/2,l.edgeType="haystack",l.haystack=!0,this.storeEdgeProjections(a),this.calculateArrowAngles(a),this.recalculateEdgeLabelProjections(a),this.calculateLabelAngles(a)}};ka.findSegmentsPoints=function(t,e){var a=t._private.rscratch,n=t.pstyle("segment-weights"),l=t.pstyle("segment-distances"),u=t.pstyle("segment-radii"),o=t.pstyle("radius-type"),c=Math.min(n.pfValue.length,l.pfValue.length),v=u.pfValue[u.pfValue.length-1],f=o.pfValue[o.pfValue.length-1];a.edgeType="segments",a.segpts=[],a.radii=[],a.isArcRadius=[];for(var h=0;h<c;h++){var g=n.pfValue[h],m=l.pfValue[h],x=1-g,b=g,E=this.findMidptPtsEtc(t,e),S=E.midptPts,w=E.vectorNormInverse,T={x:S.x1*x+S.x2*b,y:S.y1*x+S.y2*b};a.segpts.push(T.x+w.x*m,T.y+w.y*m),a.radii.push(u.pfValue[h]!==void 0?u.pfValue[h]:v),a.isArcRadius.push((o.pfValue[h]!==void 0?o.pfValue[h]:f)==="arc-radius")}};ka.findLoopPoints=function(t,e,a,n){var l=t._private.rscratch,u=e.dirCounts,o=e.srcPos,c=t.pstyle("control-point-distances"),v=c?c.pfValue[0]:void 0,f=t.pstyle("loop-direction").pfValue,h=t.pstyle("loop-sweep").pfValue,g=t.pstyle("control-point-step-size").pfValue;l.edgeType="self";var m=a,x=g;n&&(m=0,x=v);var b=f-Math.PI/2,E=b-h/2,S=b+h/2,w=f+"_"+h;m=u[w]===void 0?u[w]=0:++u[w],l.ctrlpts=[o.x+Math.cos(E)*1.4*x*(m/3+1),o.y+Math.sin(E)*1.4*x*(m/3+1),o.x+Math.cos(S)*1.4*x*(m/3+1),o.y+Math.sin(S)*1.4*x*(m/3+1)]};ka.findCompoundLoopPoints=function(t,e,a,n){var l=t._private.rscratch;l.edgeType="compound";var u=e.srcPos,o=e.tgtPos,c=e.srcW,v=e.srcH,f=e.tgtW,h=e.tgtH,g=t.pstyle("control-point-step-size").pfValue,m=t.pstyle("control-point-distances"),x=m?m.pfValue[0]:void 0,b=a,E=g;n&&(b=0,E=x);var S=50,w={x:u.x-c/2,y:u.y-v/2},T={x:o.x-f/2,y:o.y-h/2},C={x:Math.min(w.x,T.x),y:Math.min(w.y,T.y)},B=.5,R=Math.max(B,Math.log(c*ts)),L=Math.max(B,Math.log(f*ts));l.ctrlpts=[C.x,C.y-(1+Math.pow(S,1.12)/100)*E*(b/3+1)*R,C.x-(1+Math.pow(S,1.12)/100)*E*(b/3+1)*L,C.y]};ka.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};ka.findBezierPoints=function(t,e,a,n,l){var u=t._private.rscratch,o=t.pstyle("control-point-step-size").pfValue,c=t.pstyle("control-point-distances"),v=t.pstyle("control-point-weights"),f=c&&v?Math.min(c.value.length,v.value.length):1,h=c?c.pfValue[0]:void 0,g=v.value[0],m=n;u.edgeType=m?"multibezier":"bezier",u.ctrlpts=[];for(var x=0;x<f;x++){var b=(.5-e.eles.length/2+a)*o*(l?-1:1),E=void 0,S=Wh(b);m&&(h=c?c.pfValue[x]:o,g=v.value[x]),n?E=h:E=h!==void 0?S*h:void 0;var w=E!==void 0?E:b,T=1-g,C=g,B=this.findMidptPtsEtc(t,e),R=B.midptPts,L=B.vectorNormInverse,A={x:R.x1*T+R.x2*C,y:R.y1*T+R.y2*C};u.ctrlpts.push(A.x+L.x*w,A.y+L.y*w)}};ka.findTaxiPoints=function(t,e){var a=t._private.rscratch;a.edgeType="segments";var n="vertical",l="horizontal",u="leftward",o="rightward",c="downward",v="upward",f="auto",h=e.posPts,g=e.srcW,m=e.srcH,x=e.tgtW,b=e.tgtH,E=t.pstyle("edge-distances").value,S=E!=="node-position",w=t.pstyle("taxi-direction").value,T=w,C=t.pstyle("taxi-turn"),B=C.units==="%",R=C.pfValue,L=R<0,A=t.pstyle("taxi-turn-min-distance").pfValue,O=S?(g+x)/2:0,z=S?(m+b)/2:0,U=h.x2-h.x1,V=h.y2-h.y1,P=function(q,ee){return q>0?Math.max(q-ee,0):Math.min(q+ee,0)},H=P(U,O),I=P(V,z),F=!1;T===f?w=Math.abs(H)>Math.abs(I)?l:n:T===v||T===c?(w=n,F=!0):(T===u||T===o)&&(w=l,F=!0);var _=w===n,j=_?I:H,Y=_?V:U,Q=Wh(Y),W=!1;!(F&&(B||L))&&(T===c&&Y<0||T===v&&Y>0||T===u&&Y>0||T===o&&Y<0)&&(Q*=-1,j=Q*Math.abs(j),W=!0);var N;if(B){var G=R<0?1+R:R;N=G*j}else{var Z=R<0?j:0;N=Z+R*Q}var $=function(q){return Math.abs(q)<A||Math.abs(q)>=Math.abs(j)},ae=$(N),se=$(Math.abs(j)-Math.abs(N)),de=ae||se;if(de&&!W)if(_){var Se=Math.abs(Y)<=m/2,fe=Math.abs(U)<=x/2;if(Se){var te=(h.x1+h.x2)/2,re=h.y1,le=h.y2;a.segpts=[te,re,te,le]}else if(fe){var he=(h.y1+h.y2)/2,Ee=h.x1,ke=h.x2;a.segpts=[Ee,he,ke,he]}else a.segpts=[h.x1,h.y2]}else{var at=Math.abs(Y)<=g/2,Xe=Math.abs(V)<=b/2;if(at){var He=(h.y1+h.y2)/2,Ue=h.x1,Ae=h.x2;a.segpts=[Ue,He,Ae,He]}else if(Xe){var Ve=(h.x1+h.x2)/2,Pe=h.y1,Qe=h.y2;a.segpts=[Ve,Pe,Ve,Qe]}else a.segpts=[h.x2,h.y1]}else if(_){var Be=h.y1+N+(S?m/2*Q:0),et=h.x1,rt=h.x2;a.segpts=[et,Be,rt,Be]}else{var vt=h.x1+N+(S?g/2*Q:0),ut=h.y1,ot=h.y2;a.segpts=[vt,ut,vt,ot]}if(a.isRound){var Ye=t.pstyle("taxi-radius").value,Me=t.pstyle("radius-type").value[0]==="arc-radius";a.radii=new Array(a.segpts.length/2).fill(Ye),a.isArcRadius=new Array(a.segpts.length/2).fill(Me)}};ka.tryToCorrectInvalidPoints=function(t,e){var a=t._private.rscratch;if(a.edgeType==="bezier"){var n=e.srcPos,l=e.tgtPos,u=e.srcW,o=e.srcH,c=e.tgtW,v=e.tgtH,f=e.srcShape,h=e.tgtShape,g=e.srcCornerRadius,m=e.tgtCornerRadius,x=e.srcRs,b=e.tgtRs,E=!Ce(a.startX)||!Ce(a.startY),S=!Ce(a.arrowStartX)||!Ce(a.arrowStartY),w=!Ce(a.endX)||!Ce(a.endY),T=!Ce(a.arrowEndX)||!Ce(a.arrowEndY),C=3,B=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,R=C*B,L=Di({x:a.ctrlpts[0],y:a.ctrlpts[1]},{x:a.startX,y:a.startY}),A=L<R,O=Di({x:a.ctrlpts[0],y:a.ctrlpts[1]},{x:a.endX,y:a.endY}),z=O<R,U=!1;if(E||S||A){U=!0;var V={x:a.ctrlpts[0]-n.x,y:a.ctrlpts[1]-n.y},P=Math.sqrt(V.x*V.x+V.y*V.y),H={x:V.x/P,y:V.y/P},I=Math.max(u,o),F={x:a.ctrlpts[0]+H.x*2*I,y:a.ctrlpts[1]+H.y*2*I},_=f.intersectLine(n.x,n.y,u,o,F.x,F.y,0,g,x);A?(a.ctrlpts[0]=a.ctrlpts[0]+H.x*(R-L),a.ctrlpts[1]=a.ctrlpts[1]+H.y*(R-L)):(a.ctrlpts[0]=_[0]+H.x*R,a.ctrlpts[1]=_[1]+H.y*R)}if(w||T||z){U=!0;var j={x:a.ctrlpts[0]-l.x,y:a.ctrlpts[1]-l.y},Y=Math.sqrt(j.x*j.x+j.y*j.y),Q={x:j.x/Y,y:j.y/Y},W=Math.max(u,o),N={x:a.ctrlpts[0]+Q.x*2*W,y:a.ctrlpts[1]+Q.y*2*W},G=h.intersectLine(l.x,l.y,c,v,N.x,N.y,0,m,b);z?(a.ctrlpts[0]=a.ctrlpts[0]+Q.x*(R-O),a.ctrlpts[1]=a.ctrlpts[1]+Q.y*(R-O)):(a.ctrlpts[0]=G[0]+Q.x*R,a.ctrlpts[1]=G[1]+Q.y*R)}U&&this.findEndpoints(t)}};ka.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var a=0;a+1<e.ctrlpts.length;a+=2)e.allpts.push(e.ctrlpts[a],e.ctrlpts[a+1]),a+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[a]+e.ctrlpts[a+2])/2,(e.ctrlpts[a+1]+e.ctrlpts[a+3])/2);e.allpts.push(e.endX,e.endY);var n,l;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,l=.5,e.midX=ba(e.allpts[n],e.allpts[n+2],e.allpts[n+4],l),e.midY=ba(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],l))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var u=2;u+3<e.allpts.length;u+=2){var o=e.radii[u/2-1],c=e.isArcRadius[u/2-1];e.roundCorners.push(fg({x:e.allpts[u-2],y:e.allpts[u-1]},{x:e.allpts[u],y:e.allpts[u+1],radius:o},{x:e.allpts[u+2],y:e.allpts[u+3]},o,c))}}if(e.segpts.length%4===0){var v=e.segpts.length/2,f=v-2;e.midX=(e.segpts[f]+e.segpts[v])/2,e.midY=(e.segpts[f+1]+e.segpts[v+1])/2}else{var h=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[h],e.midY=e.segpts[h+1];else{var g={x:e.segpts[h],y:e.segpts[h+1]},m=e.roundCorners[h/2];if(m.radius===0){var x={x:e.segpts[h+2],y:e.segpts[h+3]};e.midX=g.x,e.midY=g.y,e.midVector=[g.y-x.y,x.x-g.x]}else{var b=[g.x-m.cx,g.y-m.cy],E=m.radius/Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2));b=b.map(function(S){return S*E}),e.midX=m.cx+b[0],e.midY=m.cy+b[1],e.midVector=b}}}}};ka.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||Ce(e.startX)&&Ce(e.startY)&&Ce(e.endX)&&Ce(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ct("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};ka.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var a=this,n=a.cy,l=n.hasCompoundNodes(),u=new an,o=function(z,U){return[].concat(Jo(z),[U?1:0]).join("-")},c=[],v=[],f=0;f<t.length;f++){var h=t[f],g=h._private,m=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(m==="haystack"){v.push(h);continue}var x=m==="unbundled-bezier"||Un(m,"segments")||m==="straight"||m==="straight-triangle"||Un(m,"taxi"),b=m==="unbundled-bezier"||m==="bezier",E=g.source,S=g.target,w=E.poolIndex(),T=S.poolIndex(),C=[w,T].sort(),B=o(C,x),R=u.get(B);R==null&&(R={eles:[]},c.push({pairId:C,edgeIsUnbundled:x}),u.set(B,R)),R.eles.push(h),x&&(R.hasUnbundled=!0),b&&(R.hasBezier=!0)}}for(var L=function(){var z=c[A],U=z.pairId,V=z.edgeIsUnbundled,P=o(U,V),H=u.get(P),I;if(!H.hasUnbundled){var F=H.eles[0].parallelEdges().filter(function(Me){return Me.isBundledBezier()});Qh(H.eles),F.forEach(function(Me){return H.eles.push(Me)}),H.eles.sort(function(Me,pe){return Me.poolIndex()-pe.poolIndex()})}var _=H.eles[0],j=_.source(),Y=_.target();if(j.poolIndex()>Y.poolIndex()){var Q=j;j=Y,Y=Q}var W=H.srcPos=j.position(),N=H.tgtPos=Y.position(),G=H.srcW=j.outerWidth(),Z=H.srcH=j.outerHeight(),$=H.tgtW=Y.outerWidth(),ae=H.tgtH=Y.outerHeight(),se=H.srcShape=a.nodeShapes[e.getNodeShape(j)],de=H.tgtShape=a.nodeShapes[e.getNodeShape(Y)],Se=H.srcCornerRadius=j.pstyle("corner-radius").value==="auto"?"auto":j.pstyle("corner-radius").pfValue,fe=H.tgtCornerRadius=Y.pstyle("corner-radius").value==="auto"?"auto":Y.pstyle("corner-radius").pfValue,te=H.tgtRs=Y._private.rscratch,re=H.srcRs=j._private.rscratch;H.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var le=0;le<H.eles.length;le++){var he=H.eles[le],Ee=he[0]._private.rscratch,ke=he.pstyle("curve-style").value,at=ke==="unbundled-bezier"||Un(ke,"segments")||Un(ke,"taxi"),Xe=!j.same(he.source());if(!H.calculatedIntersection&&j!==Y&&(H.hasBezier||H.hasUnbundled)){H.calculatedIntersection=!0;var He=se.intersectLine(W.x,W.y,G,Z,N.x,N.y,0,Se,re),Ue=H.srcIntn=He,Ae=de.intersectLine(N.x,N.y,$,ae,W.x,W.y,0,fe,te),Ve=H.tgtIntn=Ae,Pe=H.intersectionPts={x1:He[0],x2:Ae[0],y1:He[1],y2:Ae[1]},Qe=H.posPts={x1:W.x,x2:N.x,y1:W.y,y2:N.y},Be=Ae[1]-He[1],et=Ae[0]-He[0],rt=Math.sqrt(et*et+Be*Be);Ce(rt)&&rt>=oB||(rt=Math.sqrt(Math.max(et*et,ts)+Math.max(Be*Be,ts)));var vt=H.vector={x:et,y:Be},ut=H.vectorNorm={x:vt.x/rt,y:vt.y/rt},ot={x:-ut.y,y:ut.x};H.nodesOverlap=!Ce(rt)||de.checkPoint(He[0],He[1],0,$,ae,N.x,N.y,fe,te)||se.checkPoint(Ae[0],Ae[1],0,G,Z,W.x,W.y,Se,re),H.vectorNormInverse=ot,I={nodesOverlap:H.nodesOverlap,dirCounts:H.dirCounts,calculatedIntersection:!0,hasBezier:H.hasBezier,hasUnbundled:H.hasUnbundled,eles:H.eles,srcPos:N,srcRs:te,tgtPos:W,tgtRs:re,srcW:$,srcH:ae,tgtW:G,tgtH:Z,srcIntn:Ve,tgtIntn:Ue,srcShape:de,tgtShape:se,posPts:{x1:Qe.x2,y1:Qe.y2,x2:Qe.x1,y2:Qe.y1},intersectionPts:{x1:Pe.x2,y1:Pe.y2,x2:Pe.x1,y2:Pe.y1},vector:{x:-vt.x,y:-vt.y},vectorNorm:{x:-ut.x,y:-ut.y},vectorNormInverse:{x:-ot.x,y:-ot.y}}}var Ye=Xe?I:H;Ee.nodesOverlap=Ye.nodesOverlap,Ee.srcIntn=Ye.srcIntn,Ee.tgtIntn=Ye.tgtIntn,Ee.isRound=ke.startsWith("round"),l&&(j.isParent()||j.isChild()||Y.isParent()||Y.isChild())&&(j.parents().anySame(Y)||Y.parents().anySame(j)||j.same(Y)&&j.isParent())?e.findCompoundLoopPoints(he,Ye,le,at):j===Y?e.findLoopPoints(he,Ye,le,at):ke.endsWith("segments")?e.findSegmentsPoints(he,Ye):ke.endsWith("taxi")?e.findTaxiPoints(he,Ye):ke==="straight"||!at&&H.eles.length%2===1&&le===Math.floor(H.eles.length/2)?e.findStraightEdgePoints(he):e.findBezierPoints(he,Ye,le,at,Xe),e.findEndpoints(he),e.tryToCorrectInvalidPoints(he,Ye),e.checkForInvalidEdgeWarning(he),e.storeAllpts(he),e.storeEdgeProjections(he),e.calculateArrowAngles(he),e.recalculateEdgeLabelProjections(he),e.calculateLabelAngles(he)}},A=0;A<c.length;A++)L();this.findHaystackPoints(v)}};function uw(t){var e=[];if(t!=null){for(var a=0;a<t.length;a+=2){var n=t[a],l=t[a+1];e.push({x:n,y:l})}return e}}ka.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var a=e.edgeType;if(a==="segments")return uw(e.segpts)};ka.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var a=e.edgeType;if(a==="bezier"||a==="multibezier"||a==="self"||a==="compound")return uw(e.ctrlpts)};ka.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var fs={};fs.manualEndptToPx=function(t,e){var a=this,n=t.position(),l=t.outerWidth(),u=t.outerHeight(),o=t._private.rscratch;if(e.value.length===2){var c=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(c[0]=c[0]*l),e.units[1]==="%"&&(c[1]=c[1]*u),c[0]+=n.x,c[1]+=n.y,c}else{var v=e.pfValue[0];v=-Math.PI/2+v;var f=2*Math.max(l,u),h=[n.x+Math.cos(v)*f,n.y+Math.sin(v)*f];return a.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,l,u,h[0],h[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,o)}};fs.findEndpoints=function(t){var e,a,n,l,u=this,o,c=t.source()[0],v=t.target()[0],f=c.position(),h=v.position(),g=t.pstyle("target-arrow-shape").value,m=t.pstyle("source-arrow-shape").value,x=t.pstyle("target-distance-from-node").pfValue,b=t.pstyle("source-distance-from-node").pfValue,E=c._private.rscratch,S=v._private.rscratch,w=t.pstyle("curve-style").value,T=t._private.rscratch,C=T.edgeType,B=Un(w,"taxi"),R=C==="self"||C==="compound",L=C==="bezier"||C==="multibezier"||R,A=C!=="bezier",O=C==="straight"||C==="segments",z=C==="segments",U=L||A||O,V=R||B,P=t.pstyle("source-endpoint"),H=V?"outside-to-node":P.value,I=c.pstyle("corner-radius").value==="auto"?"auto":c.pstyle("corner-radius").pfValue,F=t.pstyle("target-endpoint"),_=V?"outside-to-node":F.value,j=v.pstyle("corner-radius").value==="auto"?"auto":v.pstyle("corner-radius").pfValue;T.srcManEndpt=P,T.tgtManEndpt=F;var Y,Q,W,N,G=(e=(F==null||(a=F.pfValue)===null||a===void 0?void 0:a.length)===2?F.pfValue:null)!==null&&e!==void 0?e:[0,0],Z=(n=(P==null||(l=P.pfValue)===null||l===void 0?void 0:l.length)===2?P.pfValue:null)!==null&&n!==void 0?n:[0,0];if(L){var $=[T.ctrlpts[0],T.ctrlpts[1]],ae=A?[T.ctrlpts[T.ctrlpts.length-2],T.ctrlpts[T.ctrlpts.length-1]]:$;Y=ae,Q=$}else if(O){var se=z?T.segpts.slice(0,2):[h.x+G[0],h.y+G[1]],de=z?T.segpts.slice(T.segpts.length-2):[f.x+Z[0],f.y+Z[1]];Y=de,Q=se}if(_==="inside-to-node")o=[h.x,h.y];else if(F.units)o=this.manualEndptToPx(v,F);else if(_==="outside-to-line")o=T.tgtIntn;else if(_==="outside-to-node"||_==="outside-to-node-or-label"?W=Y:(_==="outside-to-line"||_==="outside-to-line-or-label")&&(W=[f.x,f.y]),o=u.nodeShapes[this.getNodeShape(v)].intersectLine(h.x,h.y,v.outerWidth(),v.outerHeight(),W[0],W[1],0,j,S),_==="outside-to-node-or-label"||_==="outside-to-line-or-label"){var Se=v._private.rscratch,fe=Se.labelWidth,te=Se.labelHeight,re=Se.labelX,le=Se.labelY,he=fe/2,Ee=te/2,ke=v.pstyle("text-valign").value;ke==="top"?le-=Ee:ke==="bottom"&&(le+=Ee);var at=v.pstyle("text-halign").value;at==="left"?re-=he:at==="right"&&(re+=he);var Xe=Qu(W[0],W[1],[re-he,le-Ee,re+he,le-Ee,re+he,le+Ee,re-he,le+Ee],h.x,h.y);if(Xe.length>0){var He=f,Ue=wi(He,Al(o)),Ae=wi(He,Al(Xe)),Ve=Ue;if(Ae<Ue&&(o=Xe,Ve=Ae),Xe.length>2){var Pe=wi(He,{x:Xe[2],y:Xe[3]});Pe<Ve&&(o=[Xe[2],Xe[3]])}}}var Qe=zo(o,Y,u.arrowShapes[g].spacing(t)+x),Be=zo(o,Y,u.arrowShapes[g].gap(t)+x);if(T.endX=Be[0],T.endY=Be[1],T.arrowEndX=Qe[0],T.arrowEndY=Qe[1],H==="inside-to-node")o=[f.x,f.y];else if(P.units)o=this.manualEndptToPx(c,P);else if(H==="outside-to-line")o=T.srcIntn;else if(H==="outside-to-node"||H==="outside-to-node-or-label"?N=Q:(H==="outside-to-line"||H==="outside-to-line-or-label")&&(N=[h.x,h.y]),o=u.nodeShapes[this.getNodeShape(c)].intersectLine(f.x,f.y,c.outerWidth(),c.outerHeight(),N[0],N[1],0,I,E),H==="outside-to-node-or-label"||H==="outside-to-line-or-label"){var et=c._private.rscratch,rt=et.labelWidth,vt=et.labelHeight,ut=et.labelX,ot=et.labelY,Ye=rt/2,Me=vt/2,pe=c.pstyle("text-valign").value;pe==="top"?ot-=Me:pe==="bottom"&&(ot+=Me);var q=c.pstyle("text-halign").value;q==="left"?ut-=Ye:q==="right"&&(ut+=Ye);var ee=Qu(N[0],N[1],[ut-Ye,ot-Me,ut+Ye,ot-Me,ut+Ye,ot+Me,ut-Ye,ot+Me],f.x,f.y);if(ee.length>0){var ce=h,oe=wi(ce,Al(o)),me=wi(ce,Al(ee)),Re=oe;if(me<oe&&(o=[ee[0],ee[1]],Re=me),ee.length>2){var we=wi(ce,{x:ee[2],y:ee[3]});we<Re&&(o=[ee[2],ee[3]])}}}var ze=zo(o,Q,u.arrowShapes[m].spacing(t)+b),Ne=zo(o,Q,u.arrowShapes[m].gap(t)+b);T.startX=Ne[0],T.startY=Ne[1],T.arrowStartX=ze[0],T.arrowStartY=ze[1],U&&(!Ce(T.startX)||!Ce(T.startY)||!Ce(T.endX)||!Ce(T.endY)?T.badLine=!0:T.badLine=!1)};fs.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),e.edgeType==="haystack"?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}};fs.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),e.edgeType==="haystack"?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}};var vg={};function cB(t,e,a){for(var n=function(f,h,g,m){return ba(f,h,g,m)},l=e._private,u=l.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var c=t.bezierProjPcts[o];u.push({x:n(a[0],a[2],a[4],c),y:n(a[1],a[3],a[5],c)})}}vg.storeEdgeProjections=function(t){var e=t._private,a=e.rscratch,n=a.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var l=0;l+5<a.allpts.length;l+=4)cB(this,t,a.allpts.slice(l,l+6))}else if(n==="segments")for(var u=e.rstyle.linePts=[],l=0;l+1<a.allpts.length;l+=2)u.push({x:a.allpts[l],y:a.allpts[l+1]});else if(n==="haystack"){var o=a.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};vg.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var kr={};kr.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!In(e)){var a,n,l=t._private,u=t.width(),o=t.height(),c=t.padding(),v=t.position(),f=t.pstyle("text-halign").strValue,h=t.pstyle("text-valign").strValue,g=l.rscratch,m=l.rstyle;switch(f){case"left":a=v.x-u/2-c;break;case"right":a=v.x+u/2+c;break;default:a=v.x}switch(h){case"top":n=v.y-o/2-c;break;case"bottom":n=v.y+o/2+c;break;default:n=v.y}g.labelX=a,g.labelY=n,m.labelX=a,m.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var sw=function(e,a){var n=Math.atan(a/e);return e===0&&n<0&&(n=n*-1),n},ow=function(e,a){var n=a.x-e.x,l=a.y-e.y;return sw(n,l)},fB=function(e,a,n,l){var u=Zu(0,l-.001,1),o=Zu(0,l+.001,1),c=Nl(e,a,n,u),v=Nl(e,a,n,o);return ow(c,v)};kr.recalculateEdgeLabelProjections=function(t){var e,a=t._private,n=a.rscratch,l=this,u={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(u.mid||u.source||u.target){e={x:n.midX,y:n.midY};var o=function(g,m,x){tn(a.rscratch,g,m,x),tn(a.rstyle,g,m,x)};o("labelX",null,e.x),o("labelY",null,e.y);var c=sw(n.midDispX,n.midDispY);o("labelAutoAngle",null,c);var v=function(){if(v.cache)return v.cache;for(var g=[],m=0;m+5<n.allpts.length;m+=4){var x={x:n.allpts[m],y:n.allpts[m+1]},b={x:n.allpts[m+2],y:n.allpts[m+3]},E={x:n.allpts[m+4],y:n.allpts[m+5]};g.push({p0:x,p1:b,p2:E,startDist:0,length:0,segments:[]})}var S=a.rstyle.bezierPts,w=l.bezierProjPcts.length;function T(A,O,z,U,V){var P=Di(O,z),H=A.segments[A.segments.length-1],I={p0:O,p1:z,t0:U,t1:V,startDist:H?H.startDist+H.length:0,length:P};A.segments.push(I),A.length+=P}for(var C=0;C<g.length;C++){var B=g[C],R=g[C-1];R&&(B.startDist=R.startDist+R.length),T(B,B.p0,S[C*w],0,l.bezierProjPcts[0]);for(var L=0;L<w-1;L++)T(B,S[C*w+L],S[C*w+L+1],l.bezierProjPcts[L],l.bezierProjPcts[L+1]);T(B,S[C*w+w-1],B.p2,l.bezierProjPcts[w-1],1)}return v.cache=g},f=function(g){var m,x=g==="source";if(u[g]){var b=t.pstyle(g+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var E=v(),S,w=0,T=0,C=0;C<E.length;C++){for(var B=E[x?C:E.length-1-C],R=0;R<B.segments.length;R++){var L=B.segments[x?R:B.segments.length-1-R],A=C===E.length-1&&R===B.segments.length-1;if(w=T,T+=L.length,T>=b||A){S={cp:B,segment:L};break}}if(S)break}var O=S.cp,z=S.segment,U=(b-w)/z.length,V=z.t1-z.t0,P=x?z.t0+V*U:z.t1-V*U;P=Zu(0,P,1),e=Nl(O.p0,O.p1,O.p2,P),m=fB(O.p0,O.p1,O.p2,P);break}case"straight":case"segments":case"haystack":{for(var H=0,I,F,_,j,Y=n.allpts.length,Q=0;Q+3<Y&&(x?(_={x:n.allpts[Q],y:n.allpts[Q+1]},j={x:n.allpts[Q+2],y:n.allpts[Q+3]}):(_={x:n.allpts[Y-2-Q],y:n.allpts[Y-1-Q]},j={x:n.allpts[Y-4-Q],y:n.allpts[Y-3-Q]}),I=Di(_,j),F=H,H+=I,!(H>=b));Q+=2);var W=b-F,N=W/I;N=Zu(0,N,1),e=OT(_,j,N),m=ow(_,j);break}}o("labelX",g,e.x),o("labelY",g,e.y),o("labelAutoAngle",g,m)}};f("source"),f("target"),this.applyLabelDimensions(t)}};kr.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};kr.applyPrefixedLabelDimensions=function(t,e){var a=t._private,n=this.getLabelText(t,e),l=Ai(n,t._private.labelDimsKey);if(Xa(a.rscratch,"prefixedLabelDimsKey",e)!==l){tn(a.rscratch,"prefixedLabelDimsKey",e,l);var u=this.calculateLabelDimensions(t,n),o=t.pstyle("line-height").pfValue,c=t.pstyle("text-wrap").strValue,v=Xa(a.rscratch,"labelWrapCachedLines",e)||[],f=c!=="wrap"?1:Math.max(v.length,1),h=u.height/f,g=h*o,m=u.width,x=u.height+(f-1)*(o-1)*h;tn(a.rstyle,"labelWidth",e,m),tn(a.rscratch,"labelWidth",e,m),tn(a.rstyle,"labelHeight",e,x),tn(a.rscratch,"labelHeight",e,x),tn(a.rscratch,"labelLineHeight",e,g)}};kr.getLabelText=function(t,e){var a=t._private,n=e?e+"-":"",l=t.pstyle(n+"label").strValue,u=t.pstyle("text-transform").value,o=function(Z,$){return $?(tn(a.rscratch,Z,e,$),$):Xa(a.rscratch,Z,e)};if(!l)return"";u=="none"||(u=="uppercase"?l=l.toUpperCase():u=="lowercase"&&(l=l.toLowerCase()));var c=t.pstyle("text-wrap").value;if(c==="wrap"){var v=o("labelKey");if(v!=null&&o("labelWrapKey")===v)return o("labelWrapCachedText");for(var f="โ€‹",h=l.split(`
13
- `),g=t.pstyle("text-max-width").pfValue,m=t.pstyle("text-overflow-wrap").value,x=m==="anywhere",b=[],E=/[\s\u200b]+|$/g,S=0;S<h.length;S++){var w=h[S],T=this.calculateLabelDimensions(t,w),C=T.width;if(x){var B=w.split("").join(f);w=B}if(C>g){var R=w.matchAll(E),L="",A=0,O=Za(R),z;try{for(O.s();!(z=O.n()).done;){var U=z.value,V=U[0],P=w.substring(A,U.index);A=U.index+V.length;var H=L.length===0?P:L+P+V,I=this.calculateLabelDimensions(t,H),F=I.width;F<=g?L+=P+V:(L&&b.push(L),L=P+V)}}catch(G){O.e(G)}finally{O.f()}L.match(/^[\s\u200b]+$/)||b.push(L)}else b.push(w)}o("labelWrapCachedLines",b),l=o("labelWrapCachedText",b.join(`
14
- `)),o("labelWrapKey",v)}else if(c==="ellipsis"){var _=t.pstyle("text-max-width").pfValue,j="",Y="โ€ฆ",Q=!1;if(this.calculateLabelDimensions(t,l).width<_)return l;for(var W=0;W<l.length;W++){var N=this.calculateLabelDimensions(t,j+l[W]+Y).width;if(N>_)break;j+=l[W],W===l.length-1&&(Q=!0)}return Q||(j+=Y),j}return l};kr.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,a=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(a){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};kr.calculateLabelDimensions=function(t,e){var a=this,n=a.cy.window(),l=n.document,u=0,o=t.pstyle("font-style").strValue,c=t.pstyle("font-size").pfValue,v=t.pstyle("font-family").strValue,f=t.pstyle("font-weight").strValue,h=this.labelCalcCanvas,g=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=l.createElement("canvas"),g=this.labelCalcCanvasContext=h.getContext("2d");var m=h.style;m.position="absolute",m.left="-9999px",m.top="-9999px",m.zIndex="-1",m.visibility="hidden",m.pointerEvents="none"}g.font="".concat(o," ").concat(f," ").concat(c,"px ").concat(v);for(var x=0,b=0,E=e.split(`
15
- `),S=0;S<E.length;S++){var w=E[S],T=g.measureText(w),C=Math.ceil(T.width),B=c;x=Math.max(C,x),b+=B}return x+=u,b+=u,{width:x,height:b}};kr.calculateLabelAngle=function(t,e){var a=t._private,n=a.rscratch,l=t.isEdge(),u=e?e+"-":"",o=t.pstyle(u+"text-rotation"),c=o.strValue;return c==="none"?0:l&&c==="autorotate"?n.labelAutoAngle:c==="autorotate"?0:o.pfValue};kr.calculateLabelAngles=function(t){var e=this,a=t.isEdge(),n=t._private,l=n.rscratch;l.labelAngle=e.calculateLabelAngle(t),a&&(l.sourceLabelAngle=e.calculateLabelAngle(t,"source"),l.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var cw={},y1=28,b1=!1;cw.getNodeShape=function(t){var e=this,a=t.pstyle("shape").value;if(a==="cutrectangle"&&(t.width()<y1||t.height()<y1))return b1||(Ct("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),b1=!0),"rectangle";if(t.isParent())return a==="rectangle"||a==="roundrectangle"||a==="round-rectangle"||a==="cutrectangle"||a==="cut-rectangle"||a==="barrel"?a:"rectangle";if(a==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return a};var Nc={};Nc.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),a=this,n=function(o){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),c)for(var v=0;v<o.length;v++){var f=o[v],h=f._private,g=h.rstyle;g.clean=!1,g.cleanConnected=!1}};a.binder(t).on("bounds.* dirty.*",function(o){var c=o.target;n(c)}).on("style.* background.*",function(o){var c=o.target;n(c,!1)});var l=function(o){if(o){var c=a.onUpdateEleCalcsFns;e.cleanStyle();for(var v=0;v<e.length;v++){var f=e[v],h=f._private.rstyle;f.isNode()&&!h.cleanConnected&&(n(f.connectedEdges()),h.cleanConnected=!0)}if(c)for(var g=0;g<c.length;g++){var m=c[g];m(o,e)}a.recalculateRenderedStyle(e),e=t.collection()}};a.flushRenderedStyleQueue=function(){l(!0)},a.beforeRender(l,a.beforeRenderPriorities.eleCalcs)};Nc.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};Nc.recalculateRenderedStyle=function(t,e){var a=function(B){return B._private.rstyle.cleanConnected};if(t.length!==0){var n=[],l=[];if(!this.destroyed){e===void 0&&(e=!0);for(var u=0;u<t.length;u++){var o=t[u],c=o._private,v=c.rstyle;o.isEdge()&&(!a(o.source())||!a(o.target()))&&(v.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(C){return!C._private.rstyle.clean&&C.isBundledBezier()})&&(v.clean=!1),!(e&&v.clean||o.removed())&&o.pstyle("display").value!=="none"&&(c.group==="nodes"?l.push(o):n.push(o),v.clean=!0)}for(var f=0;f<l.length;f++){var h=l[f],g=h._private,m=g.rstyle,x=h.position();this.recalculateNodeLabelProjection(h),m.nodeX=x.x,m.nodeY=x.y,m.nodeW=h.pstyle("width").pfValue,m.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var b=0;b<n.length;b++){var E=n[b],S=E._private,w=S.rstyle,T=S.rscratch;w.srcX=T.arrowStartX,w.srcY=T.arrowStartY,w.tgtX=T.arrowEndX,w.tgtY=T.arrowEndY,w.midX=T.midX,w.midY=T.midY,w.labelAngle=T.labelAngle,w.sourceLabelAngle=T.sourceLabelAngle,w.targetLabelAngle=T.targetLabelAngle}}}};var Mc={};Mc.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],a=0;a<t.length;a++){var n=t[a],l=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):l.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var a=0;a<e.length;a++){var n=e[a];t.drag.push(n)}}};Mc.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Mc.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Yx),e.interactive=e.filter(function(a){return a.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var fw={};[zi,oc,ka,fs,vg,kr,cw,Nc,Mc].forEach(function(t){Fe(fw,t)});var vw={};vw.getCachedImage=function(t,e,a){var n=this,l=n.imageCache=n.imageCache||{},u=l[t];if(u)return u.image.complete||u.image.addEventListener("load",a),u.image;u=l[t]=l[t]||{};var o=u.image=new Image;o.addEventListener("load",a),o.addEventListener("error",function(){o.error=!0});var c="data:",v=t.substring(0,c.length).toLowerCase()===c;return v||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var jl={};jl.registerBinding=function(t,e,a,n){var l=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var u=[],o=0;o<t.length;o++){var c=t[o];if(c!==void 0){var v=this.binder(c);u.push(v.on.apply(v,l))}}return u}var v=this.binder(t);return v.on.apply(v,l)};jl.binder=function(t){var e=this,a=e.cy.window(),n=t===a||t===a.document||t===a.document.body||EE(t);if(e.supportsPassiveEvents==null){var l=!1;try{var u=Object.defineProperty({},"passive",{get:function(){return l=!0,!0}});a.addEventListener("test",null,u)}catch{}e.supportsPassiveEvents=l}var o=function(v,f,h){var g=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(g[2]={capture:h??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:g}),(t.addEventListener||t.on).apply(t,g),this};return{on:o,addEventListener:o,addListener:o,bind:o}};jl.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};jl.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};jl.load=function(){var t=this,e=t.cy.window(),a=function(q){return q.selected()},n=function(q){var ee=q.getRootNode();if(ee&&ee.nodeType===11&&ee.host!==void 0)return ee},l=function(q,ee,ce,oe){q==null&&(q=t.cy);for(var me=0;me<ee.length;me++){var Re=ee[me];q.emit({originalEvent:ce,type:Re,position:oe})}},u=function(q){return q.shiftKey||q.metaKey||q.ctrlKey},o=function(q,ee){var ce=!0;if(t.cy.hasCompoundNodes()&&q&&q.pannable())for(var oe=0;ee&&oe<ee.length;oe++){var q=ee[oe];if(q.isNode()&&q.isParent()&&!q.pannable()){ce=!1;break}}else ce=!0;return ce},c=function(q){q[0]._private.grabbed=!0},v=function(q){q[0]._private.grabbed=!1},f=function(q){q[0]._private.rscratch.inDragLayer=!0},h=function(q){q[0]._private.rscratch.inDragLayer=!1},g=function(q){q[0]._private.rscratch.isGrabTarget=!0},m=function(q){q[0]._private.rscratch.isGrabTarget=!1},x=function(q,ee){var ce=ee.addToList,oe=ce.has(q);!oe&&q.grabbable()&&!q.locked()&&(ce.merge(q),c(q))},b=function(q,ee){if(q.cy().hasCompoundNodes()&&!(ee.inDragLayer==null&&ee.addToList==null)){var ce=q.descendants();ee.inDragLayer&&(ce.forEach(f),ce.connectedEdges().forEach(f)),ee.addToList&&x(ce,ee)}},E=function(q,ee){ee=ee||{};var ce=q.cy().hasCompoundNodes();ee.inDragLayer&&(q.forEach(f),q.neighborhood().stdFilter(function(oe){return!ce||oe.isEdge()}).forEach(f)),ee.addToList&&q.forEach(function(oe){x(oe,ee)}),b(q,ee),T(q,{inDragLayer:ee.inDragLayer}),t.updateCachedGrabbedEles()},S=E,w=function(q){q&&(t.getCachedZSortedEles().forEach(function(ee){v(ee),h(ee),m(ee)}),t.updateCachedGrabbedEles())},T=function(q,ee){if(!(ee.inDragLayer==null&&ee.addToList==null)&&q.cy().hasCompoundNodes()){var ce=q.ancestors().orphans();if(!ce.same(q)){var oe=ce.descendants().spawnSelf().merge(ce).unmerge(q).unmerge(q.descendants()),me=oe.connectedEdges();ee.inDragLayer&&(me.forEach(f),oe.forEach(f)),ee.addToList&&oe.forEach(function(Re){x(Re,ee)})}}},C=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},B=typeof MutationObserver<"u",R=typeof ResizeObserver<"u";B?(t.removeObserver=new MutationObserver(function(pe){for(var q=0;q<pe.length;q++){var ee=pe[q],ce=ee.removedNodes;if(ce)for(var oe=0;oe<ce.length;oe++){var me=ce[oe];if(me===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(pe){t.destroy()});var L=us(function(){t.cy.resize()},100);B&&(t.styleObserver=new MutationObserver(L),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",L),R&&(t.resizeObserver=new ResizeObserver(L),t.resizeObserver.observe(t.container));var A=function(q,ee){for(;q!=null;)ee(q),q=q.parentNode},O=function(){t.invalidateContainerClientCoordsCache()};A(t.container,function(pe){t.registerBinding(pe,"transitionend",O),t.registerBinding(pe,"animationend",O),t.registerBinding(pe,"scroll",O)}),t.registerBinding(t.container,"contextmenu",function(pe){pe.preventDefault()});var z=function(){return t.selection[4]!==0},U=function(q){for(var ee=t.findContainerClientCoords(),ce=ee[0],oe=ee[1],me=ee[2],Re=ee[3],we=q.touches?q.touches:[q],ze=!1,Ne=0;Ne<we.length;Ne++){var _e=we[Ne];if(ce<=_e.clientX&&_e.clientX<=ce+me&&oe<=_e.clientY&&_e.clientY<=oe+Re){ze=!0;break}}if(!ze)return!1;for(var We=t.container,$e=q.target,De=$e.parentNode,it=!1;De;){if(De===We){it=!0;break}De=De.parentNode}return!!it};t.registerBinding(t.container,"mousedown",function(q){if(U(q)&&!(t.hoverData.which===1&&q.which!==1)){q.preventDefault(),C(),t.hoverData.capture=!0,t.hoverData.which=q.which;var ee=t.cy,ce=[q.clientX,q.clientY],oe=t.projectIntoViewport(ce[0],ce[1]),me=t.selection,Re=t.findNearestElements(oe[0],oe[1],!0,!1),we=Re[0],ze=t.dragData.possibleDragElements;t.hoverData.mdownPos=oe,t.hoverData.mdownGPos=ce;var Ne=function(tt){return{originalEvent:q,type:tt,position:{x:oe[0],y:oe[1]}}},_e=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var tt=t.hoverData.down;tt?tt.emit(Ne("taphold")):ee.emit(Ne("taphold"))}},t.tapholdDuration)};if(q.which==3){t.hoverData.cxtStarted=!0;var We={originalEvent:q,type:"cxttapstart",position:{x:oe[0],y:oe[1]}};we?(we.activate(),we.emit(We),t.hoverData.down=we):ee.emit(We),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(q.which==1){we&&we.activate();{if(we!=null&&t.nodeIsGrabbable(we)){var $e=function(tt){tt.emit(Ne("grab"))};if(g(we),!we.selected())ze=t.dragData.possibleDragElements=ee.collection(),S(we,{addToList:ze}),we.emit(Ne("grabon")).emit(Ne("grab"));else{ze=t.dragData.possibleDragElements=ee.collection();var De=ee.$(function(it){return it.isNode()&&it.selected()&&t.nodeIsGrabbable(it)});E(De,{addToList:ze}),we.emit(Ne("grabon")),De.forEach($e)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=we,t.hoverData.downs=Re,t.hoverData.downTime=new Date().getTime()}l(we,["mousedown","tapstart","vmousedown"],q,{x:oe[0],y:oe[1]}),we==null?(me[4]=1,t.data.bgActivePosistion={x:oe[0],y:oe[1]},t.redrawHint("select",!0),t.redraw()):we.pannable()&&(me[4]=1),_e()}me[0]=me[2]=oe[0],me[1]=me[3]=oe[1]}},!1);var V=n(t.container);t.registerBinding([e,V],"mousemove",function(q){var ee=t.hoverData.capture;if(!(!ee&&!U(q))){var ce=!1,oe=t.cy,me=oe.zoom(),Re=[q.clientX,q.clientY],we=t.projectIntoViewport(Re[0],Re[1]),ze=t.hoverData.mdownPos,Ne=t.hoverData.mdownGPos,_e=t.selection,We=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(We=t.findNearestElement(we[0],we[1],!0,!1));var $e=t.hoverData.last,De=t.hoverData.down,it=[we[0]-_e[2],we[1]-_e[3]],tt=t.dragData.possibleDragElements,jt;if(Ne){var Et=Re[0]-Ne[0],ua=Et*Et,zt=Re[1]-Ne[1],Ft=zt*zt,xe=ua+Ft;t.hoverData.isOverThresholdDrag=jt=xe>=t.desktopTapThreshold2}var Te=u(q);jt&&(t.hoverData.tapholdCancelled=!0);var Ke=function(){var pa=t.hoverData.dragDelta=t.hoverData.dragDelta||[];pa.length===0?(pa.push(it[0]),pa.push(it[1])):(pa[0]+=it[0],pa[1]+=it[1])};ce=!0,l(We,["mousemove","vmousemove","tapdrag"],q,{x:we[0],y:we[1]});var gt=function(pa){return{originalEvent:q,type:pa,position:{x:we[0],y:we[1]}}},da=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||oe.emit(gt("boxstart")),_e[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(jt){var Ot=gt("cxtdrag");De?De.emit(Ot):oe.emit(Ot),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||We!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(gt("cxtdragout")),t.hoverData.cxtOver=We,We&&We.emit(gt("cxtdragover")))}}else if(t.hoverData.dragging){if(ce=!0,oe.panningEnabled()&&oe.userPanningEnabled()){var _t;if(t.hoverData.justStartedPan){var $t=t.hoverData.mdownPos;_t={x:(we[0]-$t[0])*me,y:(we[1]-$t[1])*me},t.hoverData.justStartedPan=!1}else _t={x:it[0]*me,y:it[1]*me};oe.panBy(_t),oe.emit(gt("dragpan")),t.hoverData.dragged=!0}we=t.projectIntoViewport(q.clientX,q.clientY)}else if(_e[4]==1&&(De==null||De.pannable())){if(jt){if(!t.hoverData.dragging&&oe.boxSelectionEnabled()&&(Te||!oe.panningEnabled()||!oe.userPanningEnabled()))da();else if(!t.hoverData.selecting&&oe.panningEnabled()&&oe.userPanningEnabled()){var qt=o(De,t.hoverData.downs);qt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,_e[4]=0,t.data.bgActivePosistion=Al(ze),t.redrawHint("select",!0),t.redraw())}De&&De.pannable()&&De.active()&&De.unactivate()}}else{if(De&&De.pannable()&&De.active()&&De.unactivate(),(!De||!De.grabbed())&&We!=$e&&($e&&l($e,["mouseout","tapdragout"],q,{x:we[0],y:we[1]}),We&&l(We,["mouseover","tapdragover"],q,{x:we[0],y:we[1]}),t.hoverData.last=We),De)if(jt){if(oe.boxSelectionEnabled()&&Te)De&&De.grabbed()&&(w(tt),De.emit(gt("freeon")),tt.emit(gt("free")),t.dragData.didDrag&&(De.emit(gt("dragfreeon")),tt.emit(gt("dragfree")))),da();else if(De&&De.grabbed()&&t.nodeIsDraggable(De)){var ha=!t.dragData.didDrag;ha&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||E(tt,{inDragLayer:!0});var ga={x:0,y:0};if(Ce(it[0])&&Ce(it[1])&&(ga.x+=it[0],ga.y+=it[1],ha)){var Ma=t.hoverData.dragDelta;Ma&&Ce(Ma[0])&&Ce(Ma[1])&&(ga.x+=Ma[0],ga.y+=Ma[1])}t.hoverData.draggingEles=!0,tt.silentShift(ga).emit(gt("position")).emit(gt("drag")),t.redrawHint("drag",!0),t.redraw()}}else Ke();ce=!0}if(_e[2]=we[0],_e[3]=we[1],ce)return q.stopPropagation&&q.stopPropagation(),q.preventDefault&&q.preventDefault(),!1}},!1);var P,H,I;t.registerBinding(e,"mouseup",function(q){if(!(t.hoverData.which===1&&q.which!==1&&t.hoverData.capture)){var ee=t.hoverData.capture;if(ee){t.hoverData.capture=!1;var ce=t.cy,oe=t.projectIntoViewport(q.clientX,q.clientY),me=t.selection,Re=t.findNearestElement(oe[0],oe[1],!0,!1),we=t.dragData.possibleDragElements,ze=t.hoverData.down,Ne=u(q);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ze&&ze.unactivate();var _e=function(Et){return{originalEvent:q,type:Et,position:{x:oe[0],y:oe[1]}}};if(t.hoverData.which===3){var We=_e("cxttapend");if(ze?ze.emit(We):ce.emit(We),!t.hoverData.cxtDragged){var $e=_e("cxttap");ze?ze.emit($e):ce.emit($e)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(l(Re,["mouseup","tapend","vmouseup"],q,{x:oe[0],y:oe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(l(ze,["click","tap","vclick"],q,{x:oe[0],y:oe[1]}),H=!1,q.timeStamp-I<=ce.multiClickDebounceTime()?(P&&clearTimeout(P),H=!0,I=null,l(ze,["dblclick","dbltap","vdblclick"],q,{x:oe[0],y:oe[1]})):(P=setTimeout(function(){H||l(ze,["oneclick","onetap","voneclick"],q,{x:oe[0],y:oe[1]})},ce.multiClickDebounceTime()),I=q.timeStamp)),ze==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!u(q)&&(ce.$(a).unselect(["tapunselect"]),we.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=we=ce.collection()),Re==ze&&!t.dragData.didDrag&&!t.hoverData.selecting&&Re!=null&&Re._private.selectable&&(t.hoverData.dragging||(ce.selectionType()==="additive"||Ne?Re.selected()?Re.unselect(["tapunselect"]):Re.select(["tapselect"]):Ne||(ce.$(a).unmerge(Re).unselect(["tapunselect"]),Re.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var De=ce.collection(t.getAllInBox(me[0],me[1],me[2],me[3]));t.redrawHint("select",!0),De.length>0&&t.redrawHint("eles",!0),ce.emit(_e("boxend"));var it=function(Et){return Et.selectable()&&!Et.selected()};ce.selectionType()==="additive"||Ne||ce.$(a).unmerge(De).unselect(),De.emit(_e("box")).stdFilter(it).select().emit(_e("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!me[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var tt=ze&&ze.grabbed();w(we),tt&&(ze.emit(_e("freeon")),we.emit(_e("free")),t.dragData.didDrag&&(ze.emit(_e("dragfreeon")),we.emit(_e("dragfree"))))}}me[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 F=[],_=4,j,Y=1e5,Q=function(q,ee){for(var ce=0;ce<q.length;ce++)if(q[ce]%ee!==0)return!1;return!0},W=function(q){for(var ee=Math.abs(q[0]),ce=1;ce<q.length;ce++)if(Math.abs(q[ce])!==ee)return!1;return!0},N=function(q){var ee=!1,ce=q.deltaY;if(ce==null&&(q.wheelDeltaY!=null?ce=q.wheelDeltaY/4:q.wheelDelta!=null&&(ce=q.wheelDelta/4)),ce!==0){if(j==null)if(F.length>=_){var oe=F;if(j=Q(oe,5),!j){var me=Math.abs(oe[0]);j=W(oe)&&me>5}if(j)for(var Re=0;Re<oe.length;Re++)Y=Math.min(Math.abs(oe[Re]),Y)}else F.push(ce),ee=!0;else j&&(Y=Math.min(Math.abs(ce),Y));if(!t.scrollingPage){var we=t.cy,ze=we.zoom(),Ne=we.pan(),_e=t.projectIntoViewport(q.clientX,q.clientY),We=[_e[0]*ze+Ne.x,_e[1]*ze+Ne.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||z()){q.preventDefault();return}if(we.panningEnabled()&&we.userPanningEnabled()&&we.zoomingEnabled()&&we.userZoomingEnabled()){q.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 $e;ee&&Math.abs(ce)>5&&(ce=Wh(ce)*5),$e=ce/-250,j&&($e/=Y,$e*=3),$e=$e*t.wheelSensitivity;var De=q.deltaMode===1;De&&($e*=33);var it=we.zoom()*Math.pow(10,$e);q.type==="gesturechange"&&(it=t.gestureStartZoom*q.scale),we.zoom({level:it,renderedPosition:{x:We[0],y:We[1]}}),we.emit({type:q.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:q,position:{x:_e[0],y:_e[1]}})}}}};t.registerBinding(t.container,"wheel",N,!0),t.registerBinding(e,"scroll",function(q){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(q){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||q.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(pe){t.hasTouchStarted||N(pe)},!0),t.registerBinding(t.container,"mouseout",function(q){var ee=t.projectIntoViewport(q.clientX,q.clientY);t.cy.emit({originalEvent:q,type:"mouseout",position:{x:ee[0],y:ee[1]}})},!1),t.registerBinding(t.container,"mouseover",function(q){var ee=t.projectIntoViewport(q.clientX,q.clientY);t.cy.emit({originalEvent:q,type:"mouseover",position:{x:ee[0],y:ee[1]}})},!1);var G,Z,$,ae,se,de,Se,fe,te,re,le,he,Ee,ke=function(q,ee,ce,oe){return Math.sqrt((ce-q)*(ce-q)+(oe-ee)*(oe-ee))},at=function(q,ee,ce,oe){return(ce-q)*(ce-q)+(oe-ee)*(oe-ee)},Xe;t.registerBinding(t.container,"touchstart",Xe=function(q){if(t.hasTouchStarted=!0,!!U(q)){C(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var ee=t.cy,ce=t.touchData.now,oe=t.touchData.earlier;if(q.touches[0]){var me=t.projectIntoViewport(q.touches[0].clientX,q.touches[0].clientY);ce[0]=me[0],ce[1]=me[1]}if(q.touches[1]){var me=t.projectIntoViewport(q.touches[1].clientX,q.touches[1].clientY);ce[2]=me[0],ce[3]=me[1]}if(q.touches[2]){var me=t.projectIntoViewport(q.touches[2].clientX,q.touches[2].clientY);ce[4]=me[0],ce[5]=me[1]}var Re=function(Te){return{originalEvent:q,type:Te,position:{x:ce[0],y:ce[1]}}};if(q.touches[1]){t.touchData.singleTouchMoved=!0,w(t.dragData.touchDragEles);var we=t.findContainerClientCoords();te=we[0],re=we[1],le=we[2],he=we[3],G=q.touches[0].clientX-te,Z=q.touches[0].clientY-re,$=q.touches[1].clientX-te,ae=q.touches[1].clientY-re,Ee=0<=G&&G<=le&&0<=$&&$<=le&&0<=Z&&Z<=he&&0<=ae&&ae<=he;var ze=ee.pan(),Ne=ee.zoom();se=ke(G,Z,$,ae),de=at(G,Z,$,ae),Se=[(G+$)/2,(Z+ae)/2],fe=[(Se[0]-ze.x)/Ne,(Se[1]-ze.y)/Ne];var _e=200,We=_e*_e;if(de<We&&!q.touches[2]){var $e=t.findNearestElement(ce[0],ce[1],!0,!0),De=t.findNearestElement(ce[2],ce[3],!0,!0);$e&&$e.isNode()?($e.activate().emit(Re("cxttapstart")),t.touchData.start=$e):De&&De.isNode()?(De.activate().emit(Re("cxttapstart")),t.touchData.start=De):ee.emit(Re("cxttapstart")),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(q.touches[2])ee.boxSelectionEnabled()&&q.preventDefault();else if(!q.touches[1]){if(q.touches[0]){var it=t.findNearestElements(ce[0],ce[1],!0,!0),tt=it[0];if(tt!=null&&(tt.activate(),t.touchData.start=tt,t.touchData.starts=it,t.nodeIsGrabbable(tt))){var jt=t.dragData.touchDragEles=ee.collection(),Et=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),tt.selected()?(Et=ee.$(function(xe){return xe.selected()&&t.nodeIsGrabbable(xe)}),E(Et,{addToList:jt})):S(tt,{addToList:jt}),g(tt),tt.emit(Re("grabon")),Et?Et.forEach(function(xe){xe.emit(Re("grab"))}):tt.emit(Re("grab"))}l(tt,["touchstart","tapstart","vmousedown"],q,{x:ce[0],y:ce[1]}),tt==null&&(t.data.bgActivePosistion={x:me[0],y:me[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&l(t.touchData.start,["taphold"],q,{x:ce[0],y:ce[1]})},t.tapholdDuration)}}if(q.touches.length>=1){for(var ua=t.touchData.startPosition=[null,null,null,null,null,null],zt=0;zt<ce.length;zt++)ua[zt]=oe[zt]=ce[zt];var Ft=q.touches[0];t.touchData.startGPosition=[Ft.clientX,Ft.clientY]}}},!1);var He;t.registerBinding(e,"touchmove",He=function(q){var ee=t.touchData.capture;if(!(!ee&&!U(q))){var ce=t.selection,oe=t.cy,me=t.touchData.now,Re=t.touchData.earlier,we=oe.zoom();if(q.touches[0]){var ze=t.projectIntoViewport(q.touches[0].clientX,q.touches[0].clientY);me[0]=ze[0],me[1]=ze[1]}if(q.touches[1]){var ze=t.projectIntoViewport(q.touches[1].clientX,q.touches[1].clientY);me[2]=ze[0],me[3]=ze[1]}if(q.touches[2]){var ze=t.projectIntoViewport(q.touches[2].clientX,q.touches[2].clientY);me[4]=ze[0],me[5]=ze[1]}var Ne=function(ms){return{originalEvent:q,type:ms,position:{x:me[0],y:me[1]}}},_e=t.touchData.startGPosition,We;if(ee&&q.touches[0]&&_e){for(var $e=[],De=0;De<me.length;De++)$e[De]=me[De]-Re[De];var it=q.touches[0].clientX-_e[0],tt=it*it,jt=q.touches[0].clientY-_e[1],Et=jt*jt,ua=tt+Et;We=ua>=t.touchTapThreshold2}if(ee&&t.touchData.cxt){q.preventDefault();var zt=q.touches[0].clientX-te,Ft=q.touches[0].clientY-re,xe=q.touches[1].clientX-te,Te=q.touches[1].clientY-re,Ke=at(zt,Ft,xe,Te),gt=Ke/de,da=150,Ot=da*da,_t=1.5,$t=_t*_t;if(gt>=$t||Ke>=Ot){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var qt=Ne("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(qt),t.touchData.start=null):oe.emit(qt)}}if(ee&&t.touchData.cxt){var qt=Ne("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(qt):oe.emit(qt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var ha=t.findNearestElement(me[0],me[1],!0,!0);(!t.touchData.cxtOver||ha!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Ne("cxtdragout")),t.touchData.cxtOver=ha,ha&&ha.emit(Ne("cxtdragover")))}else if(ee&&q.touches[2]&&oe.boxSelectionEnabled())q.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||oe.emit(Ne("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,ce[4]=1,!ce||ce.length===0||ce[0]===void 0?(ce[0]=(me[0]+me[2]+me[4])/3,ce[1]=(me[1]+me[3]+me[5])/3,ce[2]=(me[0]+me[2]+me[4])/3+1,ce[3]=(me[1]+me[3]+me[5])/3+1):(ce[2]=(me[0]+me[2]+me[4])/3,ce[3]=(me[1]+me[3]+me[5])/3),t.redrawHint("select",!0),t.redraw();else if(ee&&q.touches[1]&&!t.touchData.didSelect&&oe.zoomingEnabled()&&oe.panningEnabled()&&oe.userZoomingEnabled()&&oe.userPanningEnabled()){q.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ga=t.dragData.touchDragEles;if(ga){t.redrawHint("drag",!0);for(var Ma=0;Ma<ga.length;Ma++){var sn=ga[Ma]._private;sn.grabbed=!1,sn.rscratch.inDragLayer=!1}}var pa=t.touchData.start,zt=q.touches[0].clientX-te,Ft=q.touches[0].clientY-re,xe=q.touches[1].clientX-te,Te=q.touches[1].clientY-re,Li=ke(zt,Ft,xe,Te),on=Li/se;if(Ee){var cn=zt-G,ti=Ft-Z,fn=xe-$,ea=Te-ae,hs=(cn+fn)/2,gs=(ti+ea)/2,Qa=oe.zoom(),Cr=Qa*on,ki=oe.pan(),Hl=fe[0]*Qa+ki.x,Gl=fe[1]*Qa+ki.y,Rc={x:-Cr/Qa*(Hl-ki.x-hs)+Hl,y:-Cr/Qa*(Gl-ki.y-gs)+Gl};if(pa&&pa.active()){var ga=t.dragData.touchDragEles;w(ga),t.redrawHint("drag",!0),t.redrawHint("eles",!0),pa.unactivate().emit(Ne("freeon")),ga.emit(Ne("free")),t.dragData.didDrag&&(pa.emit(Ne("dragfreeon")),ga.emit(Ne("dragfree")))}oe.viewport({zoom:Cr,pan:Rc,cancelOnFailedZoom:!0}),oe.emit(Ne("pinchzoom")),se=Li,G=zt,Z=Ft,$=xe,ae=Te,t.pinching=!0}if(q.touches[0]){var ze=t.projectIntoViewport(q.touches[0].clientX,q.touches[0].clientY);me[0]=ze[0],me[1]=ze[1]}if(q.touches[1]){var ze=t.projectIntoViewport(q.touches[1].clientX,q.touches[1].clientY);me[2]=ze[0],me[3]=ze[1]}if(q.touches[2]){var ze=t.projectIntoViewport(q.touches[2].clientX,q.touches[2].clientY);me[4]=ze[0],me[5]=ze[1]}}else if(q.touches[0]&&!t.touchData.didSelect){var Ra=t.touchData.start,vn=t.touchData.last,ha;if(!t.hoverData.draggingEles&&!t.swipePanning&&(ha=t.findNearestElement(me[0],me[1],!0,!0)),ee&&Ra!=null&&q.preventDefault(),ee&&Ra!=null&&t.nodeIsDraggable(Ra))if(We){var ga=t.dragData.touchDragEles,lr=!t.dragData.didDrag;lr&&E(ga,{inDragLayer:!0}),t.dragData.didDrag=!0;var ma={x:0,y:0};if(Ce($e[0])&&Ce($e[1])&&(ma.x+=$e[0],ma.y+=$e[1],lr)){t.redrawHint("eles",!0);var ja=t.touchData.dragDelta;ja&&Ce(ja[0])&&Ce(ja[1])&&(ma.x+=ja[0],ma.y+=ja[1])}t.hoverData.draggingEles=!0,ga.silentShift(ma).emit(Ne("position")).emit(Ne("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==Re[0]&&t.touchData.startPosition[1]==Re[1]&&t.redrawHint("eles",!0),t.redraw()}else{var ja=t.touchData.dragDelta=t.touchData.dragDelta||[];ja.length===0?(ja.push($e[0]),ja.push($e[1])):(ja[0]+=$e[0],ja[1]+=$e[1])}if(l(Ra||ha,["touchmove","tapdrag","vmousemove"],q,{x:me[0],y:me[1]}),(!Ra||!Ra.grabbed())&&ha!=vn&&(vn&&vn.emit(Ne("tapdragout")),ha&&ha.emit(Ne("tapdragover"))),t.touchData.last=ha,ee)for(var Ma=0;Ma<me.length;Ma++)me[Ma]&&t.touchData.startPosition[Ma]&&We&&(t.touchData.singleTouchMoved=!0);if(ee&&(Ra==null||Ra.pannable())&&oe.panningEnabled()&&oe.userPanningEnabled()){var zc=o(Ra,t.touchData.starts);zc&&(q.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Al(t.touchData.startPosition)),t.swipePanning?(oe.panBy({x:$e[0]*we,y:$e[1]*we}),oe.emit(Ne("dragpan"))):We&&(t.swipePanning=!0,oe.panBy({x:it*we,y:jt*we}),oe.emit(Ne("dragpan")),Ra&&(Ra.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ze=t.projectIntoViewport(q.touches[0].clientX,q.touches[0].clientY);me[0]=ze[0],me[1]=ze[1]}}for(var De=0;De<me.length;De++)Re[De]=me[De];ee&&q.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Ue;t.registerBinding(e,"touchcancel",Ue=function(q){var ee=t.touchData.start;t.touchData.capture=!1,ee&&ee.unactivate()});var Ae,Ve,Pe,Qe;if(t.registerBinding(e,"touchend",Ae=function(q){var ee=t.touchData.start,ce=t.touchData.capture;if(ce)q.touches.length===0&&(t.touchData.capture=!1),q.preventDefault();else return;var oe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var me=t.cy,Re=me.zoom(),we=t.touchData.now,ze=t.touchData.earlier;if(q.touches[0]){var Ne=t.projectIntoViewport(q.touches[0].clientX,q.touches[0].clientY);we[0]=Ne[0],we[1]=Ne[1]}if(q.touches[1]){var Ne=t.projectIntoViewport(q.touches[1].clientX,q.touches[1].clientY);we[2]=Ne[0],we[3]=Ne[1]}if(q.touches[2]){var Ne=t.projectIntoViewport(q.touches[2].clientX,q.touches[2].clientY);we[4]=Ne[0],we[5]=Ne[1]}var _e=function(Ot){return{originalEvent:q,type:Ot,position:{x:we[0],y:we[1]}}};ee&&ee.unactivate();var We;if(t.touchData.cxt){if(We=_e("cxttapend"),ee?ee.emit(We):me.emit(We),!t.touchData.cxtDragged){var $e=_e("cxttap");ee?ee.emit($e):me.emit($e)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!q.touches[2]&&me.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var De=me.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),me.emit(_e("boxend"));var it=function(Ot){return Ot.selectable()&&!Ot.selected()};De.emit(_e("box")).stdFilter(it).select().emit(_e("boxselect")),De.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(ee?.unactivate(),q.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!q.touches[1]){if(!q.touches[0]){if(!q.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var tt=t.dragData.touchDragEles;if(ee!=null){var jt=ee._private.grabbed;w(tt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),jt&&(ee.emit(_e("freeon")),tt.emit(_e("free")),t.dragData.didDrag&&(ee.emit(_e("dragfreeon")),tt.emit(_e("dragfree")))),l(ee,["touchend","tapend","vmouseup","tapdragout"],q,{x:we[0],y:we[1]}),ee.unactivate(),t.touchData.start=null}else{var Et=t.findNearestElement(we[0],we[1],!0,!0);l(Et,["touchend","tapend","vmouseup","tapdragout"],q,{x:we[0],y:we[1]})}var ua=t.touchData.startPosition[0]-we[0],zt=ua*ua,Ft=t.touchData.startPosition[1]-we[1],xe=Ft*Ft,Te=zt+xe,Ke=Te*Re*Re;t.touchData.singleTouchMoved||(ee||me.$(":selected").unselect(["tapunselect"]),l(ee,["tap","vclick"],q,{x:we[0],y:we[1]}),Ve=!1,q.timeStamp-Qe<=me.multiClickDebounceTime()?(Pe&&clearTimeout(Pe),Ve=!0,Qe=null,l(ee,["dbltap","vdblclick"],q,{x:we[0],y:we[1]})):(Pe=setTimeout(function(){Ve||l(ee,["onetap","voneclick"],q,{x:we[0],y:we[1]})},me.multiClickDebounceTime()),Qe=q.timeStamp)),ee!=null&&!t.dragData.didDrag&&ee._private.selectable&&Ke<t.touchTapThreshold2&&!t.pinching&&(me.selectionType()==="single"?(me.$(a).unmerge(ee).unselect(["tapunselect"]),ee.select(["tapselect"])):ee.selected()?ee.unselect(["tapunselect"]):ee.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var gt=0;gt<we.length;gt++)ze[gt]=we[gt];t.dragData.didDrag=!1,q.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),q.touches.length<2&&(q.touches.length===1&&(t.touchData.startGPosition=[q.touches[0].clientX,q.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var Be=[],et=function(q){return{clientX:q.clientX,clientY:q.clientY,force:1,identifier:q.pointerId,pageX:q.pageX,pageY:q.pageY,radiusX:q.width/2,radiusY:q.height/2,screenX:q.screenX,screenY:q.screenY,target:q.target}},rt=function(q){return{event:q,touch:et(q)}},vt=function(q){Be.push(rt(q))},ut=function(q){for(var ee=0;ee<Be.length;ee++){var ce=Be[ee];if(ce.event.pointerId===q.pointerId){Be.splice(ee,1);return}}},ot=function(q){var ee=Be.filter(function(ce){return ce.event.pointerId===q.pointerId})[0];ee.event=q,ee.touch=et(q)},Ye=function(q){q.touches=Be.map(function(ee){return ee.touch})},Me=function(q){return q.pointerType==="mouse"||q.pointerType===4};t.registerBinding(t.container,"pointerdown",function(pe){Me(pe)||(pe.preventDefault(),vt(pe),Ye(pe),Xe(pe))}),t.registerBinding(t.container,"pointerup",function(pe){Me(pe)||(ut(pe),Ye(pe),Ae(pe))}),t.registerBinding(t.container,"pointercancel",function(pe){Me(pe)||(ut(pe),Ye(pe),Ue(pe))}),t.registerBinding(t.container,"pointermove",function(pe){Me(pe)||(pe.preventDefault(),ot(pe),Ye(pe),He(pe))})}};var ln={};ln.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,l,u,o,c,v){this.renderer.nodeShapeImpl("polygon",n,l,u,o,c,this.points)},intersectLine:function(n,l,u,o,c,v,f,h){return Qu(c,v,this.points,n,l,u/2,o/2,f)},checkPoint:function(n,l,u,o,c,v,f,h){return nn(n,l,this.points,v,f,o,c,[0,-1],u)},hasMiterBounds:t!=="rectangle",miterBounds:function(n,l,u,o,c,v){return UT(this.points,n,l,u,o,c)}}};ln.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,a,n,l,u,o){this.renderer.nodeShapeImpl(this.name,e,a,n,l,u)},intersectLine:function(e,a,n,l,u,o,c,v){return XT(u,o,e,a,n/2+c,l/2+c)},checkPoint:function(e,a,n,l,u,o,c,v){return Ci(e,a,l,u,o,c,n)}}};ln.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,l,u,o,c,v,f){if(v[f]!==void 0&&v[f+"-cx"]===n&&v[f+"-cy"]===l)return v[f];v[f]=new Array(e.length/2),v[f+"-cx"]=n,v[f+"-cy"]=l;var h=u/2,g=o/2;c=c==="auto"?dx(u,o):c;for(var m=new Array(e.length/2),x=0;x<e.length/2;x++)m[x]={x:n+h*e[x*2],y:l+g*e[x*2+1]};var b,E,S,w,T=m.length;for(E=m[T-1],b=0;b<T;b++)S=m[b%T],w=m[(b+1)%T],v[f][b]=fg(E,S,w,c),E=S,S=w;return v[f]},draw:function(n,l,u,o,c,v,f){this.renderer.nodeShapeImpl("round-polygon",n,l,u,o,c,this.points,this.getOrCreateCorners(l,u,o,c,v,f,"drawCorners"))},intersectLine:function(n,l,u,o,c,v,f,h,g){return ZT(c,v,this.points,n,l,u,o,f,this.getOrCreateCorners(n,l,u,o,h,g,"corners"))},checkPoint:function(n,l,u,o,c,v,f,h,g){return FT(n,l,this.points,v,f,o,c,this.getOrCreateCorners(v,f,o,c,h,g,"corners"))}}};ln.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:qa(4,0),draw:function(e,a,n,l,u,o){this.renderer.nodeShapeImpl(this.name,e,a,n,l,u,this.points,o)},intersectLine:function(e,a,n,l,u,o,c,v){return fx(u,o,e,a,n,l,c,v)},checkPoint:function(e,a,n,l,u,o,c,v){var f=l/2,h=u/2;v=v==="auto"?Fn(l,u):v,v=Math.min(f,h,v);var g=v*2;return!!(nn(e,a,this.points,o,c,l,u-g,[0,-1],n)||nn(e,a,this.points,o,c,l-g,u,[0,-1],n)||Ci(e,a,g,g,o-f+v,c-h+v,n)||Ci(e,a,g,g,o+f-v,c-h+v,n)||Ci(e,a,g,g,o+f-v,c+h-v,n)||Ci(e,a,g,g,o-f+v,c+h-v,n))}}};ln.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:eg(),points:qa(4,0),draw:function(e,a,n,l,u,o){this.renderer.nodeShapeImpl(this.name,e,a,n,l,u,null,o)},generateCutTrianglePts:function(e,a,n,l,u){var o=u==="auto"?this.cornerLength:u,c=a/2,v=e/2,f=n-v,h=n+v,g=l-c,m=l+c;return{topLeft:[f,g+o,f+o,g,f+o,g+o],topRight:[h-o,g,h,g+o,h-o,g+o],bottomRight:[h,m-o,h-o,m,h-o,m-o],bottomLeft:[f+o,m,f,m-o,f+o,m-o]}},intersectLine:function(e,a,n,l,u,o,c,v){var f=this.generateCutTrianglePts(n+2*c,l+2*c,e,a,v),h=[].concat.apply([],[f.topLeft.splice(0,4),f.topRight.splice(0,4),f.bottomRight.splice(0,4),f.bottomLeft.splice(0,4)]);return Qu(u,o,h,e,a)},checkPoint:function(e,a,n,l,u,o,c,v){var f=v==="auto"?this.cornerLength:v;if(nn(e,a,this.points,o,c,l,u-2*f,[0,-1],n)||nn(e,a,this.points,o,c,l-2*f,u,[0,-1],n))return!0;var h=this.generateCutTrianglePts(l,u,o,c);return Ka(e,a,h.topLeft)||Ka(e,a,h.topRight)||Ka(e,a,h.bottomRight)||Ka(e,a,h.bottomLeft)}}};ln.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:qa(4,0),draw:function(e,a,n,l,u,o){this.renderer.nodeShapeImpl(this.name,e,a,n,l,u)},intersectLine:function(e,a,n,l,u,o,c,v){var f=.15,h=.5,g=.85,m=this.generateBarrelBezierPts(n+2*c,l+2*c,e,a),x=function(S){var w=Nl({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},f),T=Nl({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},h),C=Nl({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},g);return[S[0],S[1],w.x,w.y,T.x,T.y,C.x,C.y,S[4],S[5]]},b=[].concat(x(m.topLeft),x(m.topRight),x(m.bottomRight),x(m.bottomLeft));return Qu(u,o,b,e,a)},generateBarrelBezierPts:function(e,a,n,l){var u=a/2,o=e/2,c=n-o,v=n+o,f=l-u,h=l+u,g=Th(e,a),m=g.heightOffset,x=g.widthOffset,b=g.ctrlPtOffsetPct*e,E={topLeft:[c,f+m,c+b,f,c+x,f],topRight:[v-x,f,v-b,f,v,f+m],bottomRight:[v,h-m,v-b,h,v-x,h],bottomLeft:[c+x,h,c+b,h,c,h-m]};return E.topLeft.isTop=!0,E.topRight.isTop=!0,E.bottomLeft.isBottom=!0,E.bottomRight.isBottom=!0,E},checkPoint:function(e,a,n,l,u,o,c,v){var f=Th(l,u),h=f.heightOffset,g=f.widthOffset;if(nn(e,a,this.points,o,c,l,u-2*h,[0,-1],n)||nn(e,a,this.points,o,c,l-2*g,u,[0,-1],n))return!0;for(var m=this.generateBarrelBezierPts(l,u,o,c),x=function(O,z,U){var V=U[4],P=U[2],H=U[0],I=U[5],F=U[1],_=Math.min(V,H),j=Math.max(V,H),Y=Math.min(I,F),Q=Math.max(I,F);if(_<=O&&O<=j&&Y<=z&&z<=Q){var W=QT(V,P,H),N=HT(W[0],W[1],W[2],O),G=N.filter(function(Z){return 0<=Z&&Z<=1});if(G.length>0)return G[0]}return null},b=Object.keys(m),E=0;E<b.length;E++){var S=b[E],w=m[S],T=x(e,a,w);if(T!=null){var C=w[5],B=w[3],R=w[1],L=ba(C,B,R,T);if(w.isTop&&L<=a||w.isBottom&&a<=L)return!0}}return!1}}};ln.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:qa(4,0),draw:function(e,a,n,l,u,o){this.renderer.nodeShapeImpl(this.name,e,a,n,l,u,this.points,o)},intersectLine:function(e,a,n,l,u,o,c,v){var f=e-(n/2+c),h=a-(l/2+c),g=h,m=e+(n/2+c),x=Pn(u,o,e,a,f,h,m,g,!1);return x.length>0?x:fx(u,o,e,a,n,l,c,v)},checkPoint:function(e,a,n,l,u,o,c,v){v=v==="auto"?Fn(l,u):v;var f=2*v;if(nn(e,a,this.points,o,c,l,u-f,[0,-1],n)||nn(e,a,this.points,o,c,l-f,u,[0,-1],n))return!0;var h=l/2+2*n,g=u/2+2*n,m=[o-h,c-g,o-h,c,o+h,c,o+h,c-g];return!!(Ka(e,a,m)||Ci(e,a,f,f,o+l/2-v,c+u/2-v,n)||Ci(e,a,f,f,o-l/2+v,c+u/2-v,n))}}};ln.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",qa(3,0)),this.generateRoundPolygon("round-triangle",qa(3,0)),this.generatePolygon("rectangle",qa(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var a=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",a),this.generateRoundPolygon("round-diamond",a)}this.generatePolygon("pentagon",qa(5,0)),this.generateRoundPolygon("round-pentagon",qa(5,0)),this.generatePolygon("hexagon",qa(6,0)),this.generateRoundPolygon("round-hexagon",qa(6,0)),this.generatePolygon("heptagon",qa(7,0)),this.generateRoundPolygon("round-heptagon",qa(7,0)),this.generatePolygon("octagon",qa(8,0)),this.generateRoundPolygon("round-octagon",qa(8,0));var n=new Array(20);{var l=Eh(5,0),u=Eh(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var c=0;c<u.length/2;c++)u[c*2]*=o,u[c*2+1]*=o;for(var c=0;c<20/4;c++)n[c*4]=l[c*2],n[c*4+1]=l[c*2+1],n[c*4+2]=u[c*2],n[c*4+3]=u[c*2+1]}n=vx(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var v=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",v),this.generateRoundPolygon("round-tag",v)}t.makePolygon=function(f){var h=f.join("$"),g="polygon-"+h,m;return(m=this[g])?m:e.generatePolygon(g,f)}};var vs={};vs.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};vs.redraw=function(t){t=t||ux();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};vs.beforeRender=function(t,e){if(!this.destroyed){e==null&&Yt("Priority is not optional for beforeRender");var a=this.beforeRenderCallbacks;a.push({fn:t,priority:e}),a.sort(function(n,l){return l.priority-n.priority})}};var x1=function(e,a,n){for(var l=e.beforeRenderCallbacks,u=0;u<l.length;u++)l[u].fn(a,n)};vs.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var a=function(l){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){x1(t,!0,l);var u=rn();t.render(t.renderOptions);var o=t.lastDrawTime=rn();t.averageRedrawTime===void 0&&(t.averageRedrawTime=o-u),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var c=o-u;t.redrawTotalTime+=c,t.lastRedrawTime=c,t.averageRedrawTime=t.averageRedrawTime/2+c/2,t.requestedFrame=!1}else x1(t,!1,l);t.skipFrame=!1,tc(a)}};tc(a)}};var vB=function(e){this.init(e)},dw=vB,Pl=dw.prototype;Pl.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Pl.init=function(t){var e=this;e.options=t,e.cy=t.cy;var a=e.container=t.cy.container(),n=e.cy.window();if(n){var l=n.document,u=l.head,o="__________cytoscape_stylesheet",c="__________cytoscape_container",v=l.getElementById(o)!=null;if(a.className.indexOf(c)<0&&(a.className=(a.className||"")+" "+c),!v){var f=l.createElement("style");f.id=o,f.textContent="."+c+" { position: relative; }",u.insertBefore(f,u.children[0])}var h=n.getComputedStyle(a),g=h.getPropertyValue("position");g==="static"&&Ct("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=Ce(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};Pl.notify=function(t,e){var a=this,n=a.cy;if(!this.destroyed){if(t==="init"){a.load();return}if(t==="destroy"){a.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&a.invalidateCachedZSortedEles(),t==="viewport"&&a.redrawHint("select",!0),t==="gc"&&a.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container)),a.redrawHint("eles",!0),a.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Pl.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var a=t.bindings[e],n=a,l=n.target;(l.off||l.removeEventListener).apply(l,n.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};Pl.isHeadless=function(){return!1};[cg,fw,vw,jl,ln,vs].forEach(function(t){Fe(Pl,t)});var hh=1e3/60,hw={setupDequeueing:function(e){return function(){var n=this,l=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var u=us(function(){l.redrawHint("eles",!0),l.redrawHint("drag",!0),l.redraw()},e.deqRedrawThreshold),o=function(f,h){var g=rn(),m=l.averageRedrawTime,x=l.lastRedrawTime,b=[],E=l.cy.extent(),S=l.getPixelRatio();for(f||l.flushRenderedStyleQueue();;){var w=rn(),T=w-g,C=w-h;if(x<hh){var B=hh-(f?m:0);if(C>=e.deqFastCost*B)break}else if(f){if(T>=e.deqCost*x||T>=e.deqAvgCost*m)break}else if(C>=e.deqNoDrawCost*hh)break;var R=e.deq(n,S,E);if(R.length>0)for(var L=0;L<R.length;L++)b.push(R[L]);else break}b.length>0&&(e.onDeqd(n,b),!f&&e.shouldRedraw(n,b,S,E)&&u())},c=e.priority||Zh;l.beforeRender(o,c(n))}}}},dB=(function(){function t(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ac;Qn(this,t),this.idsByKey=new an,this.keyForId=new an,this.cachesByLvl=new an,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=a}return $n(t,[{key:"getIdsFor",value:function(a){a==null&&Yt("Can not get id list for null key");var n=this.idsByKey,l=this.idsByKey.get(a);return l||(l=new _l,n.set(a,l)),l}},{key:"addIdForKey",value:function(a,n){a!=null&&this.getIdsFor(a).add(n)}},{key:"deleteIdForKey",value:function(a,n){a!=null&&this.getIdsFor(a).delete(n)}},{key:"getNumberOfIdsForKey",value:function(a){return a==null?0:this.getIdsFor(a).size}},{key:"updateKeyMappingFor",value:function(a){var n=a.id(),l=this.keyForId.get(n),u=this.getKey(a);this.deleteIdForKey(l,n),this.addIdForKey(u,n),this.keyForId.set(n,u)}},{key:"deleteKeyMappingFor",value:function(a){var n=a.id(),l=this.keyForId.get(n);this.deleteIdForKey(l,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(a){var n=a.id(),l=this.keyForId.get(n),u=this.getKey(a);return l!==u}},{key:"isInvalid",value:function(a){return this.keyHasChangedFor(a)||this.doesEleInvalidateKey(a)}},{key:"getCachesAt",value:function(a){var n=this.cachesByLvl,l=this.lvls,u=n.get(a);return u||(u=new an,n.set(a,u),l.push(a)),u}},{key:"getCache",value:function(a,n){return this.getCachesAt(n).get(a)}},{key:"get",value:function(a,n){var l=this.getKey(a),u=this.getCache(l,n);return u!=null&&this.updateKeyMappingFor(a),u}},{key:"getForCachedKey",value:function(a,n){var l=this.keyForId.get(a.id()),u=this.getCache(l,n);return u}},{key:"hasCache",value:function(a,n){return this.getCachesAt(n).has(a)}},{key:"has",value:function(a,n){var l=this.getKey(a);return this.hasCache(l,n)}},{key:"setCache",value:function(a,n,l){l.key=a,this.getCachesAt(n).set(a,l)}},{key:"set",value:function(a,n,l){var u=this.getKey(a);this.setCache(u,n,l),this.updateKeyMappingFor(a)}},{key:"deleteCache",value:function(a,n){this.getCachesAt(n).delete(a)}},{key:"delete",value:function(a,n){var l=this.getKey(a);this.deleteCache(l,n)}},{key:"invalidateKey",value:function(a){var n=this;this.lvls.forEach(function(l){return n.deleteCache(a,l)})}},{key:"invalidate",value:function(a){var n=a.id(),l=this.keyForId.get(n);this.deleteKeyMappingFor(a);var u=this.doesEleInvalidateKey(a);return u&&this.invalidateKey(l),u||this.getNumberOfIdsForKey(l)===0}}])})(),w1=25,jo=50,$o=-4,qh=3,gw=7.99,hB=8,gB=1024,pB=1024,mB=1024,yB=.2,bB=.8,xB=10,wB=.15,SB=.1,EB=.9,TB=.9,CB=100,AB=1,Bl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},DB=Ba({getKey:null,doesEleInvalidateKey:ac,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:nx,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Hu=function(e,a){var n=this;n.renderer=e,n.onDequeues=[];var l=DB(a);Fe(n,l),n.lookup=new dB(l.getKey,l.doesEleInvalidateKey),n.setupDequeueing()},va=Hu.prototype;va.reasons=Bl;va.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};va.getRetiredTextureQueue=function(t){var e=this,a=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=a[t]=a[t]||[];return n};va.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new ss(function(a,n){return n.reqs-a.reqs});return e};va.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};va.getElement=function(t,e,a,n,l){var u=this,o=this.renderer,c=o.cy.zoom(),v=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($h(c*a))),n<$o)n=$o;else if(c>=gw||n>qh)return null;var f=Math.pow(2,n),h=e.h*f,g=e.w*f,m=o.eleTextBiggerThanMin(t,f);if(!this.isVisible(t,m))return null;var x=v.get(t,n);if(x&&x.invalidated&&(x.invalidated=!1,x.texture.invalidatedWidth-=x.width),x)return x;var b;if(h<=w1?b=w1:h<=jo?b=jo:b=Math.ceil(h/jo)*jo,h>mB||g>pB)return null;var E=u.getTextureQueue(b),S=E[E.length-2],w=function(){return u.recycleTexture(b,g)||u.addTexture(b,g)};S||(S=E[E.length-1]),S||(S=w()),S.width-S.usedWidth<g&&(S=w());for(var T=function(_){return _&&_.scaledLabelShown===m},C=l&&l===Bl.dequeue,B=l&&l===Bl.highQuality,R=l&&l===Bl.downscale,L,A=n+1;A<=qh;A++){var O=v.get(t,A);if(O){L=O;break}}var z=L&&L.level===n+1?L:null,U=function(){S.context.drawImage(z.texture.canvas,z.x,0,z.width,z.height,S.usedWidth,0,g,h)};if(S.context.setTransform(1,0,0,1,0,0),S.context.clearRect(S.usedWidth,0,g,b),T(z))U();else if(T(L))if(B){for(var V=L.level;V>n;V--)z=u.getElement(t,e,a,V,Bl.downscale);U()}else return u.queueElement(t,L.level-1),L;else{var P;if(!C&&!B&&!R)for(var H=n-1;H>=$o;H--){var I=v.get(t,H);if(I){P=I;break}}if(T(P))return u.queueElement(t,n),P;S.context.translate(S.usedWidth,0),S.context.scale(f,f),this.drawElement(S.context,t,e,m,!1),S.context.scale(1/f,1/f),S.context.translate(-S.usedWidth,0)}return x={x:S.usedWidth,texture:S,level:n,scale:f,width:g,height:h,scaledLabelShown:m},S.usedWidth+=Math.ceil(g+hB),S.eleCaches.push(x),v.set(t,n,x),u.checkTextureFullness(S),x};va.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};va.invalidateElement=function(t){var e=this,a=e.lookup,n=[],l=a.isInvalid(t);if(l){for(var u=$o;u<=qh;u++){var o=a.getForCachedKey(t,u);o&&n.push(o)}var c=a.invalidate(t);if(c)for(var v=0;v<n.length;v++){var f=n[v],h=f.texture;h.invalidatedWidth+=f.width,f.invalidated=!0,e.checkTextureUtility(h)}e.removeFromQueue(t)}};va.checkTextureUtility=function(t){t.invalidatedWidth>=yB*t.width&&this.retireTexture(t)};va.checkTextureFullness=function(t){var e=this,a=e.getTextureQueue(t.height);t.usedWidth/t.width>bB&&t.fullnessChecks>=xB?Yn(a,t):t.fullnessChecks++};va.retireTexture=function(t){var e=this,a=t.height,n=e.getTextureQueue(a),l=this.lookup;Yn(n,t),t.retired=!0;for(var u=t.eleCaches,o=0;o<u.length;o++){var c=u[o];l.deleteCache(c.key,c.level)}Qh(u);var v=e.getRetiredTextureQueue(a);v.push(t)};va.addTexture=function(t,e){var a=this,n=a.getTextureQueue(t),l={};return n.push(l),l.eleCaches=[],l.height=t,l.width=Math.max(gB,e),l.usedWidth=0,l.invalidatedWidth=0,l.fullnessChecks=0,l.canvas=a.renderer.makeOffscreenCanvas(l.width,l.height),l.context=l.canvas.getContext("2d"),l};va.recycleTexture=function(t,e){for(var a=this,n=a.getTextureQueue(t),l=a.getRetiredTextureQueue(t),u=0;u<l.length;u++){var o=l[u];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Qh(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Yn(l,o),n.push(o),o}};va.queueElement=function(t,e){var a=this,n=a.getElementQueue(),l=a.getElementKeyToQueue(),u=this.getKey(t),o=l[u];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,n.updateItem(o);else{var c={eles:t.spawn().merge(t),level:e,reqs:1,key:u};n.push(c),l[u]=c}};va.dequeue=function(t){for(var e=this,a=e.getElementQueue(),n=e.getElementKeyToQueue(),l=[],u=e.lookup,o=0;o<AB&&a.size()>0;o++){var c=a.pop(),v=c.key,f=c.eles[0],h=u.hasCache(f,c.level);if(n[v]=null,h)continue;l.push(c);var g=e.getBoundingBox(f);e.getElement(f,g,t,c.level,Bl.dequeue)}return l};va.removeFromQueue=function(t){var e=this,a=e.getElementQueue(),n=e.getElementKeyToQueue(),l=this.getKey(t),u=n[l];u!=null&&(u.eles.length===1?(u.reqs=Kh,a.updateItem(u),a.pop(),n[l]=null):u.eles.unmerge(t))};va.onDequeue=function(t){this.onDequeues.push(t)};va.offDequeue=function(t){Yn(this.onDequeues,t)};va.setupDequeueing=hw.setupDequeueing({deqRedrawThreshold:CB,deqCost:wB,deqAvgCost:SB,deqNoDrawCost:EB,deqFastCost:TB,deq:function(e,a,n){return e.dequeue(a,n)},onDeqd:function(e,a){for(var n=0;n<e.onDequeues.length;n++){var l=e.onDequeues[n];l(a)}},shouldRedraw:function(e,a,n,l){for(var u=0;u<a.length;u++)for(var o=a[u].eles,c=0;c<o.length;c++){var v=o[c].boundingBox();if(Jh(v,l))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var BB=1,Iu=-4,cc=2,NB=3.99,MB=50,RB=50,zB=.15,OB=.1,LB=.9,kB=.9,_B=1,S1=250,qB=4e3*4e3,E1=32767,VB=!0,pw=function(e){var a=this,n=a.renderer=e,l=n.cy;a.layersByLevel={},a.firstGet=!0,a.lastInvalidationTime=rn()-2*S1,a.skipping=!1,a.eleTxrDeqs=l.collection(),a.scheduleElementRefinement=us(function(){a.refineElementTextures(a.eleTxrDeqs),a.eleTxrDeqs.unmerge(a.eleTxrDeqs)},RB),n.beforeRender(function(o,c){c-a.lastInvalidationTime<=S1?a.skipping=!0:a.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var u=function(c,v){return v.reqs-c.reqs};a.layersQueue=new ss(u),a.setupDequeueing()},Na=pw.prototype,T1=0,UB=Math.pow(2,53)-1;Na.makeLayer=function(t,e){var a=Math.pow(2,e),n=Math.ceil(t.w*a),l=Math.ceil(t.h*a),u=this.renderer.makeOffscreenCanvas(n,l),o={id:T1=++T1%UB,bb:t,level:e,width:n,height:l,canvas:u,context:u.getContext("2d"),eles:[],elesQueue:[],reqs:0},c=o.context,v=-o.bb.x1,f=-o.bb.y1;return c.scale(a,a),c.translate(v,f),o};Na.getLayers=function(t,e,a){var n=this,l=n.renderer,u=l.cy,o=u.zoom(),c=n.firstGet;if(n.firstGet=!1,a==null){if(a=Math.ceil($h(o*e)),a<Iu)a=Iu;else if(o>=NB||a>cc)return null}n.validateLayersElesOrdering(a,t);var v=n.layersByLevel,f=Math.pow(2,a),h=v[a]=v[a]||[],g,m=n.levelIsComplete(a,t),x,b=function(){var U=function(F){if(n.validateLayersElesOrdering(F,t),n.levelIsComplete(F,t))return x=v[F],!0},V=function(F){if(!x)for(var _=a+F;Iu<=_&&_<=cc&&!U(_);_+=F);};V(1),V(-1);for(var P=h.length-1;P>=0;P--){var H=h[P];H.invalid&&Yn(h,H)}};if(!m)b();else return h;var E=function(){if(!g){g=Va();for(var U=0;U<t.length;U++)_T(g,t[U].boundingBox())}return g},S=function(U){U=U||{};var V=U.after;E();var P=Math.ceil(g.w*f),H=Math.ceil(g.h*f);if(P>E1||H>E1)return null;var I=P*H;if(I>qB)return null;var F=n.makeLayer(g,a);if(V!=null){var _=h.indexOf(V)+1;h.splice(_,0,F)}else(U.insert===void 0||U.insert)&&h.unshift(F);return F};if(n.skipping&&!c)return null;for(var w=null,T=t.length/BB,C=!c,B=0;B<t.length;B++){var R=t[B],L=R._private.rscratch,A=L.imgLayerCaches=L.imgLayerCaches||{},O=A[a];if(O){w=O;continue}if((!w||w.eles.length>=T||!cx(w.bb,R.boundingBox()))&&(w=S({insert:!0,after:w}),!w))return null;x||C?n.queueLayer(w,R):n.drawEleInLayer(w,R,a,e),w.eles.push(R),A[a]=w}return x||(C?null:h)};Na.getEleLevelForLayerLevel=function(t,e){return t};Na.drawEleInLayer=function(t,e,a,n){var l=this,u=this.renderer,o=t.context,c=e.boundingBox();c.w===0||c.h===0||!e.visible()||(a=l.getEleLevelForLayerLevel(a,n),u.setImgSmoothing(o,!1),u.drawCachedElement(o,e,null,null,a,VB),u.setImgSmoothing(o,!0))};Na.levelIsComplete=function(t,e){var a=this,n=a.layersByLevel[t];if(!n||n.length===0)return!1;for(var l=0,u=0;u<n.length;u++){var o=n[u];if(o.reqs>0||o.invalid)return!1;l+=o.eles.length}return l===e.length};Na.validateLayersElesOrdering=function(t,e){var a=this.layersByLevel[t];if(a)for(var n=0;n<a.length;n++){for(var l=a[n],u=-1,o=0;o<e.length;o++)if(l.eles[0]===e[o]){u=o;break}if(u<0){this.invalidateLayer(l);continue}for(var c=u,o=0;o<l.eles.length;o++)if(l.eles[o]!==e[c+o]){this.invalidateLayer(l);break}}};Na.updateElementsInLayers=function(t,e){for(var a=this,n=rs(t[0]),l=0;l<t.length;l++)for(var u=n?null:t[l],o=n?t[l]:t[l].ele,c=o._private.rscratch,v=c.imgLayerCaches=c.imgLayerCaches||{},f=Iu;f<=cc;f++){var h=v[f];h&&(u&&a.getEleLevelForLayerLevel(h.level)!==u.level||e(h,o,u))}};Na.haveLayers=function(){for(var t=this,e=!1,a=Iu;a<=cc;a++){var n=t.layersByLevel[a];if(n&&n.length>0){e=!0;break}}return e};Na.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=rn(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,l,u){e.invalidateLayer(n)}))};Na.invalidateLayer=function(t){if(this.lastInvalidationTime=rn(),!t.invalid){var e=t.level,a=t.eles,n=this.layersByLevel[e];Yn(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var l=0;l<a.length;l++){var u=a[l]._private.rscratch.imgLayerCaches;u&&(u[e]=null)}}};Na.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,l,u){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var c=0;c<o.eles.length;c++)e.queueLayer(o,o.eles[c])})};Na.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Na.queueLayer=function(t,e){var a=this,n=a.layersQueue,l=t.elesQueue,u=l.hasId=l.hasId||{};if(!t.replacement){if(e){if(u[e.id()])return;l.push(e),u[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}};Na.dequeue=function(t){for(var e=this,a=e.layersQueue,n=[],l=0;l<_B&&a.size()!==0;){var u=a.peek();if(u.replacement){a.pop();continue}if(u.replaces&&u!==u.replaces.replacement){a.pop();continue}if(u.invalid){a.pop();continue}var o=u.elesQueue.shift();o&&(e.drawEleInLayer(u,o,u.level,t),l++),n.length===0&&n.push(!0),u.elesQueue.length===0&&(a.pop(),u.reqs=0,u.replaces&&e.applyLayerReplacement(u),e.requestRedraw())}return n};Na.applyLayerReplacement=function(t){var e=this,a=e.layersByLevel[t.level],n=t.replaces,l=a.indexOf(n);if(!(l<0||n.invalid)){a[l]=t;for(var u=0;u<t.eles.length;u++){var o=t.eles[u]._private,c=o.imgLayerCaches=o.imgLayerCaches||{};c&&(c[t.level]=t)}e.requestRedraw()}};Na.requestRedraw=us(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Na.setupDequeueing=hw.setupDequeueing({deqRedrawThreshold:MB,deqCost:zB,deqAvgCost:OB,deqNoDrawCost:LB,deqFastCost:kB,deq:function(e,a){return e.dequeue(a)},onDeqd:Zh,shouldRedraw:nx,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var mw={},C1;function jB(t,e){for(var a=0;a<e.length;a++){var n=e[a];t.lineTo(n.x,n.y)}}function PB(t,e,a){for(var n,l=0;l<e.length;l++){var u=e[l];l===0&&(n=u),t.lineTo(u.x,u.y)}t.quadraticCurveTo(a.x,a.y,n.x,n.y)}function A1(t,e,a){t.beginPath&&t.beginPath();for(var n=e,l=0;l<n.length;l++){var u=n[l];t.lineTo(u.x,u.y)}var o=a,c=a[0];t.moveTo(c.x,c.y);for(var l=1;l<o.length;l++){var u=o[l];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function HB(t,e,a,n,l){t.beginPath&&t.beginPath(),t.arc(a,n,l,0,Math.PI*2,!1);var u=e,o=u[0];t.moveTo(o.x,o.y);for(var c=0;c<u.length;c++){var v=u[c];t.lineTo(v.x,v.y)}t.closePath&&t.closePath()}function GB(t,e,a,n){t.arc(e,a,n,0,Math.PI*2,!1)}mw.arrowShapeImpl=function(t){return(C1||(C1={polygon:jB,"triangle-backcurve":PB,"triangle-tee":A1,"circle-triangle":HB,"triangle-cross":A1,circle:GB}))[t]};var _r={};_r.drawElement=function(t,e,a,n,l,u){var o=this;e.isNode()?o.drawNode(t,e,a,n,l,u):o.drawEdge(t,e,a,n,l,u)};_r.drawElementOverlay=function(t,e){var a=this;e.isNode()?a.drawNodeOverlay(t,e):a.drawEdgeOverlay(t,e)};_r.drawElementUnderlay=function(t,e){var a=this;e.isNode()?a.drawNodeUnderlay(t,e):a.drawEdgeUnderlay(t,e)};_r.drawCachedElementPortion=function(t,e,a,n,l,u,o,c){var v=this,f=a.getBoundingBox(e);if(!(f.w===0||f.h===0)){var h=a.getElement(e,f,n,l,u);if(h!=null){var g=c(v,e);if(g===0)return;var m=o(v,e),x=f.x1,b=f.y1,E=f.w,S=f.h,w,T,C,B,R;if(m!==0){var L=a.getRotationPoint(e);C=L.x,B=L.y,t.translate(C,B),t.rotate(m),R=v.getImgSmoothing(t),R||v.setImgSmoothing(t,!0);var A=a.getRotationOffset(e);w=A.x,T=A.y}else w=x,T=b;var O;g!==1&&(O=t.globalAlpha,t.globalAlpha=O*g),t.drawImage(h.texture.canvas,h.x,0,h.width,h.height,w,T,E,S),g!==1&&(t.globalAlpha=O),m!==0&&(t.rotate(-m),t.translate(-C,-B),R||v.setImgSmoothing(t,!1))}else a.drawElement(t,e)}};var IB=function(){return 0},YB=function(e,a){return e.getTextAngle(a,null)},FB=function(e,a){return e.getTextAngle(a,"source")},XB=function(e,a){return e.getTextAngle(a,"target")},KB=function(e,a){return a.effectiveOpacity()},gh=function(e,a){return a.pstyle("text-opacity").pfValue*a.effectiveOpacity()};_r.drawCachedElement=function(t,e,a,n,l,u){var o=this,c=o.data,v=c.eleTxrCache,f=c.lblTxrCache,h=c.slbTxrCache,g=c.tlbTxrCache,m=e.boundingBox(),x=u===!0?v.reasons.highQuality:null;if(!(m.w===0||m.h===0||!e.visible())&&(!n||Jh(m,n))){var b=e.isEdge(),E=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,v,a,l,x,IB,KB),(!b||!E)&&o.drawCachedElementPortion(t,e,f,a,l,x,YB,gh),b&&!E&&(o.drawCachedElementPortion(t,e,h,a,l,x,FB,gh),o.drawCachedElementPortion(t,e,g,a,l,x,XB,gh)),o.drawElementOverlay(t,e)}};_r.drawElements=function(t,e){for(var a=this,n=0;n<e.length;n++){var l=e[n];a.drawElement(t,l)}};_r.drawCachedElements=function(t,e,a,n){for(var l=this,u=0;u<e.length;u++){var o=e[u];l.drawCachedElement(t,o,a,n)}};_r.drawCachedNodes=function(t,e,a,n){for(var l=this,u=0;u<e.length;u++){var o=e[u];o.isNode()&&l.drawCachedElement(t,o,a,n)}};_r.drawLayeredElements=function(t,e,a,n){var l=this,u=l.data.lyrTxrCache.getLayers(e,a);if(u)for(var o=0;o<u.length;o++){var c=u[o],v=c.bb;v.w===0||v.h===0||t.drawImage(c.canvas,v.x1,v.y1,v.w,v.h)}else l.drawCachedElements(t,e,a,n)};var un={};un.drawEdge=function(t,e,a){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,c=e._private.rscratch;if(!(u&&!e.visible())&&!(c.badLine||c.allpts==null||isNaN(c.allpts[0]))){var v;a&&(v=a,t.translate(-v.x1,-v.y1));var f=u?e.pstyle("opacity").value:1,h=u?e.pstyle("line-opacity").value:1,g=e.pstyle("curve-style").value,m=e.pstyle("line-style").value,x=e.pstyle("width").pfValue,b=e.pstyle("line-cap").value,E=e.pstyle("line-outline-width").value,S=e.pstyle("line-outline-color").value,w=f*h,T=f*h,C=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;g==="straight-triangle"?(o.eleStrokeStyle(t,e,F),o.drawEdgeTrianglePath(e,t,c.allpts)):(t.lineWidth=x,t.lineCap=b,o.eleStrokeStyle(t,e,F),o.drawEdgePath(e,t,c.allpts,m),t.lineCap="butt")},B=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;if(t.lineWidth=x+E,t.lineCap=b,E>0)o.colorStrokeStyle(t,S[0],S[1],S[2],F);else{t.lineCap="butt";return}g==="straight-triangle"?o.drawEdgeTrianglePath(e,t,c.allpts):(o.drawEdgePath(e,t,c.allpts,m),t.lineCap="butt")},R=function(){l&&o.drawEdgeOverlay(t,e)},L=function(){l&&o.drawEdgeUnderlay(t,e)},A=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;o.drawArrowheads(t,e,F)},O=function(){o.drawElementText(t,e,null,n)};t.lineJoin="round";var z=e.pstyle("ghost").value==="yes";if(z){var U=e.pstyle("ghost-offset-x").pfValue,V=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,H=w*P;t.translate(U,V),C(H),A(H),t.translate(-U,-V)}else B();L(),C(),A(),R(),O(),a&&t.translate(v.x1,v.y1)}};var yw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(a,n){if(n.visible()){var l=n.pstyle("".concat(e,"-opacity")).value;if(l!==0){var u=this,o=u.usePaths(),c=n._private.rscratch,v=n.pstyle("".concat(e,"-padding")).pfValue,f=2*v,h=n.pstyle("".concat(e,"-color")).value;a.lineWidth=f,c.edgeType==="self"&&!o?a.lineCap="butt":a.lineCap="round",u.colorStrokeStyle(a,h[0],h[1],h[2],l),u.drawEdgePath(n,a,c.allpts,"solid")}}}};un.drawEdgeOverlay=yw("overlay");un.drawEdgeUnderlay=yw("underlay");un.drawEdgePath=function(t,e,a,n){var l=t._private.rscratch,u=e,o,c=!1,v=this.usePaths(),f=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(v){var g=a.join("$"),m=l.pathCacheKey&&l.pathCacheKey===g;m?(o=e=l.pathCache,c=!0):(o=e=new Path2D,l.pathCacheKey=g,l.pathCache=o)}if(u.setLineDash)switch(n){case"dotted":u.setLineDash([1,1]);break;case"dashed":u.setLineDash(f),u.lineDashOffset=h;break;case"solid":u.setLineDash([]);break}if(!c&&!l.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(a[0],a[1]),l.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var x=2;x+3<a.length;x+=4)e.quadraticCurveTo(a[x],a[x+1],a[x+2],a[x+3]);break;case"straight":case"haystack":for(var b=2;b+1<a.length;b+=2)e.lineTo(a[b],a[b+1]);break;case"segments":if(l.isRound){var E=Za(l.roundCorners),S;try{for(E.s();!(S=E.n()).done;){var w=S.value;lw(e,w)}}catch(C){E.e(C)}finally{E.f()}e.lineTo(a[a.length-2],a[a.length-1])}else for(var T=2;T+1<a.length;T+=2)e.lineTo(a[T],a[T+1]);break}e=u,v?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};un.drawEdgeTrianglePath=function(t,e,a){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,l=0;l+1<a.length;l+=2){var u=[a[l+2]-a[l],a[l+3]-a[l+1]],o=Math.sqrt(u[0]*u[0]+u[1]*u[1]),c=[u[1]/o,-u[0]/o],v=[c[0]*n/2,c[1]*n/2];e.beginPath(),e.moveTo(a[l]-v[0],a[l+1]-v[1]),e.lineTo(a[l]+v[0],a[l+1]+v[1]),e.lineTo(a[l+2],a[l+3]),e.closePath(),e.fill()}};un.drawArrowheads=function(t,e,a){var n=e._private.rscratch,l=n.edgeType==="haystack";l||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,a),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,a),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,a),l||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,a)};un.drawArrowhead=function(t,e,a,n,l,u,o){if(!(isNaN(n)||n==null||isNaN(l)||l==null||isNaN(u)||u==null)){var c=this,v=e.pstyle(a+"-arrow-shape").value;if(v!=="none"){var f=e.pstyle(a+"-arrow-fill").value==="hollow"?"both":"filled",h=e.pstyle(a+"-arrow-fill").value,g=e.pstyle("width").pfValue,m=e.pstyle(a+"-arrow-width"),x=m.value==="match-line"?g:m.pfValue;m.units==="%"&&(x*=g);var b=e.pstyle("opacity").value;o===void 0&&(o=b);var E=t.globalCompositeOperation;(o!==1||h==="hollow")&&(t.globalCompositeOperation="destination-out",c.colorFillStyle(t,255,255,255,1),c.colorStrokeStyle(t,255,255,255,1),c.drawArrowShape(e,t,f,g,v,x,n,l,u),t.globalCompositeOperation=E);var S=e.pstyle(a+"-arrow-color").value;c.colorFillStyle(t,S[0],S[1],S[2],o),c.colorStrokeStyle(t,S[0],S[1],S[2],o),c.drawArrowShape(e,t,h,g,v,x,n,l,u)}}};un.drawArrowShape=function(t,e,a,n,l,u,o,c,v){var f=this,h=this.usePaths()&&l!=="triangle-cross",g=!1,m,x=e,b={x:o,y:c},E=t.pstyle("arrow-scale").value,S=this.getArrowWidth(n,E),w=f.arrowShapes[l];if(h){var T=f.arrowPathCache=f.arrowPathCache||[],C=Ai(l),B=T[C];B!=null?(m=e=B,g=!0):(m=e=new Path2D,T[C]=m)}g||(e.beginPath&&e.beginPath(),h?w.draw(e,1,0,{x:0,y:0},1):w.draw(e,S,v,b,n),e.closePath&&e.closePath()),e=x,h&&(e.translate(o,c),e.rotate(v),e.scale(S,S)),(a==="filled"||a==="both")&&(h?e.fill(m):e.fill()),(a==="hollow"||a==="both")&&(e.lineWidth=u/(h?S:1),e.lineJoin="miter",h?e.stroke(m):e.stroke()),h&&(e.scale(1/S,1/S),e.rotate(-v),e.translate(-o,-c))};var dg={};dg.safeDrawImage=function(t,e,a,n,l,u,o,c,v,f){if(!(l<=0||u<=0||v<=0||f<=0))try{t.drawImage(e,a,n,l,u,o,c,v,f)}catch(h){Ct(h)}};dg.drawInscribedImage=function(t,e,a,n,l){var u=this,o=a.position(),c=o.x,v=o.y,f=a.cy().style(),h=f.getIndexedStyle.bind(f),g=h(a,"background-fit","value",n),m=h(a,"background-repeat","value",n),x=a.width(),b=a.height(),E=a.padding()*2,S=x+(h(a,"background-width-relative-to","value",n)==="inner"?0:E),w=b+(h(a,"background-height-relative-to","value",n)==="inner"?0:E),T=a._private.rscratch,C=h(a,"background-clip","value",n),B=C==="node",R=h(a,"background-image-opacity","value",n)*l,L=h(a,"background-image-smoothing","value",n),A=a.pstyle("corner-radius").value;A!=="auto"&&(A=a.pstyle("corner-radius").pfValue);var O=e.width||e.cachedW,z=e.height||e.cachedH;(O==null||z==null)&&(document.body.appendChild(e),O=e.cachedW=e.width||e.offsetWidth,z=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var U=O,V=z;if(h(a,"background-width","value",n)!=="auto"&&(h(a,"background-width","units",n)==="%"?U=h(a,"background-width","pfValue",n)*S:U=h(a,"background-width","pfValue",n)),h(a,"background-height","value",n)!=="auto"&&(h(a,"background-height","units",n)==="%"?V=h(a,"background-height","pfValue",n)*w:V=h(a,"background-height","pfValue",n)),!(U===0||V===0)){if(g==="contain"){var P=Math.min(S/U,w/V);U*=P,V*=P}else if(g==="cover"){var P=Math.max(S/U,w/V);U*=P,V*=P}var H=c-S/2,I=h(a,"background-position-x","units",n),F=h(a,"background-position-x","pfValue",n);I==="%"?H+=(S-U)*F:H+=F;var _=h(a,"background-offset-x","units",n),j=h(a,"background-offset-x","pfValue",n);_==="%"?H+=(S-U)*j:H+=j;var Y=v-w/2,Q=h(a,"background-position-y","units",n),W=h(a,"background-position-y","pfValue",n);Q==="%"?Y+=(w-V)*W:Y+=W;var N=h(a,"background-offset-y","units",n),G=h(a,"background-offset-y","pfValue",n);N==="%"?Y+=(w-V)*G:Y+=G,T.pathCache&&(H-=c,Y-=v,c=0,v=0);var Z=t.globalAlpha;t.globalAlpha=R;var $=u.getImgSmoothing(t),ae=!1;if(L==="no"&&$?(u.setImgSmoothing(t,!1),ae=!0):L==="yes"&&!$&&(u.setImgSmoothing(t,!0),ae=!0),m==="no-repeat")B&&(t.save(),T.pathCache?t.clip(T.pathCache):(u.nodeShapes[u.getNodeShape(a)].draw(t,c,v,S,w,A,T),t.clip())),u.safeDrawImage(t,e,0,0,O,z,H,Y,U,V),B&&t.restore();else{var se=t.createPattern(e,m);t.fillStyle=se,u.nodeShapes[u.getNodeShape(a)].draw(t,c,v,S,w,A,T),t.translate(H,Y),t.fill(),t.translate(-H,-Y)}t.globalAlpha=Z,ae&&u.setImgSmoothing(t,$)}};var Oi={};Oi.eleTextBiggerThanMin=function(t,e){if(!e){var a=t.cy().zoom(),n=this.getPixelRatio(),l=Math.ceil($h(a*n));e=Math.pow(2,l)}var u=t.pstyle("font-size").pfValue*e,o=t.pstyle("min-zoomed-font-size").pfValue;return!(u<o)};Oi.drawElementText=function(t,e,a,n,l){var u=arguments.length>5&&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 c=e.pstyle("label");if(!c||!c.value)return;var v=o.getLabelJustification(e);t.textAlign=v,t.textBaseline="bottom"}else{var f=e.element()._private.rscratch.badLine,h=e.pstyle("label"),g=e.pstyle("source-label"),m=e.pstyle("target-label");if(f||(!h||!h.value)&&(!g||!g.value)&&(!m||!m.value))return;t.textAlign="center",t.textBaseline="bottom"}var x=!a,b;a&&(b=a,t.translate(-b.x1,-b.y1)),l==null?(o.drawText(t,e,null,x,u),e.isEdge()&&(o.drawText(t,e,"source",x,u),o.drawText(t,e,"target",x,u))):o.drawText(t,e,l,x,u),a&&t.translate(b.x1,b.y1)};Oi.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var a=0;a<this.fontCaches.length;a++)if(e=this.fontCaches[a],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Oi.setupTextStyle=function(t,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue+"px",u=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,c=a?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,v=e.pstyle("text-outline-opacity").value*c,f=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+o+" "+l+" "+u,t.lineJoin="round",this.colorFillStyle(t,f[0],f[1],f[2],c),this.colorStrokeStyle(t,h[0],h[1],h[2],v)};function ZB(t,e,a,n,l){var u=Math.min(n,l),o=u/2,c=e+n/2,v=a+l/2;t.beginPath(),t.arc(c,v,o,0,Math.PI*2),t.closePath()}function D1(t,e,a,n,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(u,n/2,l/2);t.beginPath(),t.moveTo(e+o,a),t.lineTo(e+n-o,a),t.quadraticCurveTo(e+n,a,e+n,a+o),t.lineTo(e+n,a+l-o),t.quadraticCurveTo(e+n,a+l,e+n-o,a+l),t.lineTo(e+o,a+l),t.quadraticCurveTo(e,a+l,e,a+l-o),t.lineTo(e,a+o),t.quadraticCurveTo(e,a,e+o,a),t.closePath()}Oi.getTextAngle=function(t,e){var a,n=t._private,l=n.rscratch,u=e?e+"-":"",o=t.pstyle(u+"text-rotation");if(o.strValue==="autorotate"){var c=Xa(l,"labelAngle",e);a=t.isEdge()?c:0}else o.strValue==="none"?a=0:a=o.pfValue;return a};Oi.drawText=function(t,e,a){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,u=e._private,o=u.rscratch,c=l?e.effectiveOpacity():1;if(!(l&&(c===0||e.pstyle("text-opacity").value===0))){a==="main"&&(a=null);var v=Xa(o,"labelX",a),f=Xa(o,"labelY",a),h,g,m=this.getLabelText(e,a);if(m!=null&&m!==""&&!isNaN(v)&&!isNaN(f)){this.setupTextStyle(t,e,l);var x=a?a+"-":"",b=Xa(o,"labelWidth",a),E=Xa(o,"labelHeight",a),S=e.pstyle(x+"text-margin-x").pfValue,w=e.pstyle(x+"text-margin-y").pfValue,T=e.isEdge(),C=e.pstyle("text-halign").value,B=e.pstyle("text-valign").value;T&&(C="center",B="center"),v+=S,f+=w;var R;switch(n?R=this.getTextAngle(e,a):R=0,R!==0&&(h=v,g=f,t.translate(h,g),t.rotate(R),v=0,f=0),B){case"top":break;case"center":f+=E/2;break;case"bottom":f+=E;break}var L=e.pstyle("text-background-opacity").value,A=e.pstyle("text-border-opacity").value,O=e.pstyle("text-border-width").pfValue,z=e.pstyle("text-background-padding").pfValue,U=e.pstyle("text-background-shape").strValue,V=U==="round-rectangle"||U==="roundrectangle",P=U==="circle",H=2;if(L>0||O>0&&A>0){var I=t.fillStyle,F=t.strokeStyle,_=t.lineWidth,j=e.pstyle("text-background-color").value,Y=e.pstyle("text-border-color").value,Q=e.pstyle("text-border-style").value,W=L>0,N=O>0&&A>0,G=v-z;switch(C){case"left":G-=b;break;case"center":G-=b/2;break}var Z=f-E-z,$=b+2*z,ae=E+2*z;if(W&&(t.fillStyle="rgba(".concat(j[0],",").concat(j[1],",").concat(j[2],",").concat(L*c,")")),N&&(t.strokeStyle="rgba(".concat(Y[0],",").concat(Y[1],",").concat(Y[2],",").concat(A*c,")"),t.lineWidth=O,t.setLineDash))switch(Q){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=O/4,t.setLineDash([]);break;default:t.setLineDash([]);break}if(V?(t.beginPath(),D1(t,G,Z,$,ae,H)):P?(t.beginPath(),ZB(t,G,Z,$,ae)):(t.beginPath(),t.rect(G,Z,$,ae)),W&&t.fill(),N&&t.stroke(),N&&Q==="double"){var se=O/2;t.beginPath(),V?D1(t,G+se,Z+se,$-2*se,ae-2*se,H):t.rect(G+se,Z+se,$-2*se,ae-2*se),t.stroke()}t.fillStyle=I,t.strokeStyle=F,t.lineWidth=_,t.setLineDash&&t.setLineDash([])}var de=2*e.pstyle("text-outline-width").pfValue;if(de>0&&(t.lineWidth=de),e.pstyle("text-wrap").value==="wrap"){var Se=Xa(o,"labelWrapCachedLines",a),fe=Xa(o,"labelLineHeight",a),te=b/2,re=this.getLabelJustification(e);switch(re==="auto"||(C==="left"?re==="left"?v+=-b:re==="center"&&(v+=-te):C==="center"?re==="left"?v+=-te:re==="right"&&(v+=te):C==="right"&&(re==="center"?v+=te:re==="right"&&(v+=b))),B){case"top":f-=(Se.length-1)*fe;break;case"center":case"bottom":f-=(Se.length-1)*fe;break}for(var le=0;le<Se.length;le++)de>0&&t.strokeText(Se[le],v,f),t.fillText(Se[le],v,f),f+=fe}else de>0&&t.strokeText(m,v,f),t.fillText(m,v,f);R!==0&&(t.rotate(-R),t.translate(-h,-g))}}};var Jn={};Jn.drawNode=function(t,e,a){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,c,v,f=e._private,h=f.rscratch,g=e.position();if(!(!Ce(g.x)||!Ce(g.y))&&!(u&&!e.visible())){var m=u?e.effectiveOpacity():1,x=o.usePaths(),b,E=!1,S=e.padding();c=e.width()+2*S,v=e.height()+2*S;var w;a&&(w=a,t.translate(-w.x1,-w.y1));for(var T=e.pstyle("background-image"),C=T.value,B=new Array(C.length),R=new Array(C.length),L=0,A=0;A<C.length;A++){var O=C[A],z=B[A]=O!=null&&O!=="none";if(z){var U=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",A);L++,R[A]=o.getCachedImage(O,U,function(){f.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var V=e.pstyle("background-blacken").value,P=e.pstyle("border-width").pfValue,H=e.pstyle("background-opacity").value*m,I=e.pstyle("border-color").value,F=e.pstyle("border-style").value,_=e.pstyle("border-join").value,j=e.pstyle("border-cap").value,Y=e.pstyle("border-position").value,Q=e.pstyle("border-dash-pattern").pfValue,W=e.pstyle("border-dash-offset").pfValue,N=e.pstyle("border-opacity").value*m,G=e.pstyle("outline-width").pfValue,Z=e.pstyle("outline-color").value,$=e.pstyle("outline-style").value,ae=e.pstyle("outline-opacity").value*m,se=e.pstyle("outline-offset").value,de=e.pstyle("corner-radius").value;de!=="auto"&&(de=e.pstyle("corner-radius").pfValue);var Se=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H;o.eleFillStyle(t,e,Me)},fe=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;o.colorStrokeStyle(t,I[0],I[1],I[2],Me)},te=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ae;o.colorStrokeStyle(t,Z[0],Z[1],Z[2],Me)},re=function(Me,pe,q,ee){var ce=o.nodePathCache=o.nodePathCache||[],oe=rx(q==="polygon"?q+","+ee.join(","):q,""+pe,""+Me,""+de),me=ce[oe],Re,we=!1;return me!=null?(Re=me,we=!0,h.pathCache=Re):(Re=new Path2D,ce[oe]=h.pathCache=Re),{path:Re,cacheHit:we}},le=e.pstyle("shape").strValue,he=e.pstyle("shape-polygon-points").pfValue;if(x){t.translate(g.x,g.y);var Ee=re(c,v,le,he);b=Ee.path,E=Ee.cacheHit}var ke=function(){if(!E){var Me=g;x&&(Me={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(b||t,Me.x,Me.y,c,v,de,h)}x?t.fill(b):t.fill()},at=function(){for(var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,q=f.backgrounding,ee=0,ce=0;ce<R.length;ce++){var oe=e.cy().style().getIndexedStyle(e,"background-image-containment","value",ce);if(pe&&oe==="over"||!pe&&oe==="inside"){ee++;continue}B[ce]&&R[ce].complete&&!R[ce].error&&(ee++,o.drawInscribedImage(t,R[ce],e,ce,Me))}f.backgrounding=ee!==L,q!==f.backgrounding&&e.updateStyle(!1)},Xe=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;o.hasPie(e)&&(o.drawPie(t,e,pe),Me&&(x||o.nodeShapes[o.getNodeShape(e)].draw(t,g.x,g.y,c,v,de,h)))},He=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;o.hasStripe(e)&&(t.save(),x?t.clip(h.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(t,g.x,g.y,c,v,de,h),t.clip()),o.drawStripe(t,e,pe),t.restore(),Me&&(x||o.nodeShapes[o.getNodeShape(e)].draw(t,g.x,g.y,c,v,de,h)))},Ue=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m,pe=(V>0?V:-V)*Me,q=V>0?0:255;V!==0&&(o.colorFillStyle(t,q,q,q,pe),x?t.fill(b):t.fill())},Ae=function(){if(P>0){if(t.lineWidth=P,t.lineCap=j,t.lineJoin=_,t.setLineDash)switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(Q),t.lineDashOffset=W;break;case"solid":case"double":t.setLineDash([]);break}if(Y!=="center"){if(t.save(),t.lineWidth*=2,Y==="inside")x?t.clip(b):t.clip();else{var Me=new Path2D;Me.rect(-c/2-P,-v/2-P,c+2*P,v+2*P),Me.addPath(b),t.clip(Me,"evenodd")}x?t.stroke(b):t.stroke(),t.restore()}else x?t.stroke(b):t.stroke();if(F==="double"){t.lineWidth=P/3;var pe=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",x?t.stroke(b):t.stroke(),t.globalCompositeOperation=pe}t.setLineDash&&t.setLineDash([])}},Ve=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch($){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var Me=g;x&&(Me={x:0,y:0});var pe=o.getNodeShape(e),q=P;Y==="inside"&&(q=0),Y==="outside"&&(q*=2);var ee=(c+q+(G+se))/c,ce=(v+q+(G+se))/v,oe=c*ee,me=v*ce,Re=o.nodeShapes[pe].points,we;if(x){var ze=re(oe,me,pe,Re);we=ze.path}if(pe==="ellipse")o.drawEllipsePath(we||t,Me.x,Me.y,oe,me);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(pe)){var Ne=0,_e=0,We=0;pe==="round-diamond"?Ne=(q+se+G)*1.4:pe==="round-heptagon"?(Ne=(q+se+G)*1.075,We=-(q/2+se+G)/35):pe==="round-hexagon"?Ne=(q+se+G)*1.12:pe==="round-pentagon"?(Ne=(q+se+G)*1.13,We=-(q/2+se+G)/15):pe==="round-tag"?(Ne=(q+se+G)*1.12,_e=(q/2+G+se)*.07):pe==="round-triangle"&&(Ne=(q+se+G)*(Math.PI/2),We=-(q+se/2+G)/Math.PI),Ne!==0&&(ee=(c+Ne)/c,oe=c*ee,["round-hexagon","round-tag"].includes(pe)||(ce=(v+Ne)/v,me=v*ce)),de=de==="auto"?dx(oe,me):de;for(var $e=oe/2,De=me/2,it=de+(q+G+se)/2,tt=new Array(Re.length/2),jt=new Array(Re.length/2),Et=0;Et<Re.length/2;Et++)tt[Et]={x:Me.x+_e+$e*Re[Et*2],y:Me.y+We+De*Re[Et*2+1]};var ua,zt,Ft,xe,Te=tt.length;for(zt=tt[Te-1],ua=0;ua<Te;ua++)Ft=tt[ua%Te],xe=tt[(ua+1)%Te],jt[ua]=fg(zt,Ft,xe,it),zt=Ft,Ft=xe;o.drawRoundPolygonPath(we||t,Me.x+_e,Me.y+We,c*ee,v*ce,Re,jt)}else if(["roundrectangle","round-rectangle"].includes(pe))de=de==="auto"?Fn(oe,me):de,o.drawRoundRectanglePath(we||t,Me.x,Me.y,oe,me,de+(q+G+se)/2);else if(["cutrectangle","cut-rectangle"].includes(pe))de=de==="auto"?eg():de,o.drawCutRectanglePath(we||t,Me.x,Me.y,oe,me,null,de+(q+G+se)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(pe))de=de==="auto"?Fn(oe,me):de,o.drawBottomRoundRectanglePath(we||t,Me.x,Me.y,oe,me,de+(q+G+se)/2);else if(pe==="barrel")o.drawBarrelPath(we||t,Me.x,Me.y,oe,me);else if(pe.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(pe)){var Ke=(q+G+se)/c;Re=rc(nc(Re,Ke)),o.drawPolygonPath(we||t,Me.x,Me.y,c,v,Re)}else{var gt=(q+G+se)/c;Re=rc(nc(Re,-gt)),o.drawPolygonPath(we||t,Me.x,Me.y,c,v,Re)}if(x?t.stroke(we):t.stroke(),$==="double"){t.lineWidth=q/3;var da=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",x?t.stroke(we):t.stroke(),t.globalCompositeOperation=da}t.setLineDash&&t.setLineDash([])}},Pe=function(){l&&o.drawNodeOverlay(t,e,g,c,v)},Qe=function(){l&&o.drawNodeUnderlay(t,e,g,c,v)},Be=function(){o.drawElementText(t,e,null,n)},et=e.pstyle("ghost").value==="yes";if(et){var rt=e.pstyle("ghost-offset-x").pfValue,vt=e.pstyle("ghost-offset-y").pfValue,ut=e.pstyle("ghost-opacity").value,ot=ut*m;t.translate(rt,vt),te(),Ve(),Se(ut*H),ke(),at(ot,!0),fe(ut*N),Ae(),Xe(V!==0||P!==0),He(V!==0||P!==0),at(ot,!1),Ue(ot),t.translate(-rt,-vt)}x&&t.translate(-g.x,-g.y),Qe(),x&&t.translate(g.x,g.y),te(),Ve(),Se(),ke(),at(m,!0),fe(),Ae(),Xe(V!==0||P!==0),He(V!==0||P!==0),at(m,!1),Ue(),x&&t.translate(-g.x,-g.y),Be(),Pe(),a&&t.translate(w.x1,w.y1)}};var bw=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(a,n,l,u,o){var c=this;if(n.visible()){var v=n.pstyle("".concat(e,"-padding")).pfValue,f=n.pstyle("".concat(e,"-opacity")).value,h=n.pstyle("".concat(e,"-color")).value,g=n.pstyle("".concat(e,"-shape")).value,m=n.pstyle("".concat(e,"-corner-radius")).value;if(f>0){if(l=l||n.position(),u==null||o==null){var x=n.padding();u=n.width()+2*x,o=n.height()+2*x}c.colorFillStyle(a,h[0],h[1],h[2],f),c.nodeShapes[g].draw(a,l.x,l.y,u+v*2,o+v*2,m),a.fill()}}}};Jn.drawNodeOverlay=bw("overlay");Jn.drawNodeUnderlay=bw("underlay");Jn.hasPie=function(t){return t=t[0],t._private.hasPie};Jn.hasStripe=function(t){return t=t[0],t._private.hasStripe};Jn.drawPie=function(t,e,a,n){e=e[0],n=n||e.position();var l=e.cy().style(),u=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),c=e.pstyle("pie-start-angle").pfValue,v=n.x,f=n.y,h=e.width(),g=e.height(),m=Math.min(h,g)/2,x,b=0,E=this.usePaths();if(E&&(v=0,f=0),u.units==="%"?m=m*u.pfValue:u.pfValue!==void 0&&(m=u.pfValue/2),o.units==="%"?x=m*o.pfValue:o.pfValue!==void 0&&(x=o.pfValue/2),!(x>=m))for(var S=1;S<=l.pieBackgroundN;S++){var w=e.pstyle("pie-"+S+"-background-size").value,T=e.pstyle("pie-"+S+"-background-color").value,C=e.pstyle("pie-"+S+"-background-opacity").value*a,B=w/100;B+b>1&&(B=1-b);var R=1.5*Math.PI+2*Math.PI*b;R+=c;var L=2*Math.PI*B,A=R+L;w===0||b>=1||b+B>1||(x===0?(t.beginPath(),t.moveTo(v,f),t.arc(v,f,m,R,A),t.closePath()):(t.beginPath(),t.arc(v,f,m,R,A),t.arc(v,f,x,A,R,!0),t.closePath()),this.colorFillStyle(t,T[0],T[1],T[2],C),t.fill(),b+=B)}};Jn.drawStripe=function(t,e,a,n){e=e[0],n=n||e.position();var l=e.cy().style(),u=n.x,o=n.y,c=e.width(),v=e.height(),f=0,h=this.usePaths();t.save();var g=e.pstyle("stripe-direction").value,m=e.pstyle("stripe-size");switch(g){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var x=c,b=v;m.units==="%"?(x=x*m.pfValue,b=b*m.pfValue):m.pfValue!==void 0&&(x=m.pfValue,b=m.pfValue),h&&(u=0,o=0),o-=x/2,u-=b/2;for(var E=1;E<=l.stripeBackgroundN;E++){var S=e.pstyle("stripe-"+E+"-background-size").value,w=e.pstyle("stripe-"+E+"-background-color").value,T=e.pstyle("stripe-"+E+"-background-opacity").value*a,C=S/100;C+f>1&&(C=1-f),!(S===0||f>=1||f+C>1)&&(t.beginPath(),t.rect(u,o+b*f,x,b*C),t.closePath(),this.colorFillStyle(t,w[0],w[1],w[2],T),t.fill(),f+=C)}t.restore()};var Ua={},QB=100;Ua.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),a=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/a};Ua.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],a=!0,n,l=0;l<e.length;l++)if(n=e[l],n.context===t){a=!1;break}return a&&(n={context:t},e.push(n)),n};Ua.createGradientStyleFor=function(t,e,a,n,l){var u,o=this.usePaths(),c=a.pstyle(e+"-gradient-stop-colors").value,v=a.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(a.isEdge()){var f=a.sourceEndpoint(),h=a.targetEndpoint(),g=a.midpoint(),m=Di(f,g),x=Di(h,g);u=t.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(m,x))}else{var b=o?{x:0,y:0}:a.position(),E=a.paddedWidth(),S=a.paddedHeight();u=t.createRadialGradient(b.x,b.y,0,b.x,b.y,Math.max(E,S))}else if(a.isEdge()){var w=a.sourceEndpoint(),T=a.targetEndpoint();u=t.createLinearGradient(w.x,w.y,T.x,T.y)}else{var C=o?{x:0,y:0}:a.position(),B=a.paddedWidth(),R=a.paddedHeight(),L=B/2,A=R/2,O=a.pstyle("background-gradient-direction").value;switch(O){case"to-bottom":u=t.createLinearGradient(C.x,C.y-A,C.x,C.y+A);break;case"to-top":u=t.createLinearGradient(C.x,C.y+A,C.x,C.y-A);break;case"to-left":u=t.createLinearGradient(C.x+L,C.y,C.x-L,C.y);break;case"to-right":u=t.createLinearGradient(C.x-L,C.y,C.x+L,C.y);break;case"to-bottom-right":case"to-right-bottom":u=t.createLinearGradient(C.x-L,C.y-A,C.x+L,C.y+A);break;case"to-top-right":case"to-right-top":u=t.createLinearGradient(C.x-L,C.y+A,C.x+L,C.y-A);break;case"to-bottom-left":case"to-left-bottom":u=t.createLinearGradient(C.x+L,C.y-A,C.x-L,C.y+A);break;case"to-top-left":case"to-left-top":u=t.createLinearGradient(C.x+L,C.y+A,C.x-L,C.y-A);break}}if(!u)return null;for(var z=v.length===c.length,U=c.length,V=0;V<U;V++)u.addColorStop(z?v[V]:V/(U-1),"rgba("+c[V][0]+","+c[V][1]+","+c[V][2]+","+l+")");return u};Ua.gradientFillStyle=function(t,e,a,n){var l=this.createGradientStyleFor(t,"background",e,a,n);if(!l)return null;t.fillStyle=l};Ua.colorFillStyle=function(t,e,a,n,l){t.fillStyle="rgba("+e+","+a+","+n+","+l+")"};Ua.eleFillStyle=function(t,e,a){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,a);else{var l=e.pstyle("background-color").value;this.colorFillStyle(t,l[0],l[1],l[2],a)}};Ua.gradientStrokeStyle=function(t,e,a,n){var l=this.createGradientStyleFor(t,"line",e,a,n);if(!l)return null;t.strokeStyle=l};Ua.colorStrokeStyle=function(t,e,a,n,l){t.strokeStyle="rgba("+e+","+a+","+n+","+l+")"};Ua.eleStrokeStyle=function(t,e,a){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,a);else{var l=e.pstyle("line-color").value;this.colorStrokeStyle(t,l[0],l[1],l[2],a)}};Ua.matchCanvasSize=function(t){var e=this,a=e.data,n=e.findContainerClientCoords(),l=n[2],u=n[3],o=e.getPixelRatio(),c=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=c);var v=l*o,f=u*o,h;if(!(v===e.canvasWidth&&f===e.canvasHeight)){e.fontCaches=null;var g=a.canvasContainer;g.style.width=l+"px",g.style.height=u+"px";for(var m=0;m<e.CANVAS_LAYERS;m++)h=a.canvases[m],h.width=v,h.height=f,h.style.width=l+"px",h.style.height=u+"px";for(var m=0;m<e.BUFFER_COUNT;m++)h=a.bufferCanvases[m],h.width=v,h.height=f,h.style.width=l+"px",h.style.height=u+"px";e.textureMult=1,o<=1&&(h=a.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,h.width=v*e.textureMult,h.height=f*e.textureMult),e.canvasWidth=v,e.canvasHeight=f,e.pixelRatio=o}};Ua.renderTo=function(t,e,a,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:a,drawAllLayers:!0,forcedPxRatio:n})};Ua.clearCanvas=function(){var t=this,e=t.data;function a(n){n.clearRect(0,0,t.canvasWidth,t.canvasHeight)}a(e.contexts[t.NODE]),a(e.contexts[t.DRAG])};Ua.render=function(t){var e=this;t=t||ux();var a=e.cy,n=t.forcedContext,l=t.drawAllLayers,u=t.drawOnlyNodeLayer,o=t.forcedZoom,c=t.forcedPan,v=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,f=e.data,h=f.canvasNeedsRedraw,g=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),m=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,x=e.motionBlurPxRatio,b=a.hasCompoundNodes(),E=e.hoverData.draggingEles,S=!!(e.hoverData.selecting||e.touchData.selecting);m=m&&!n&&e.motionBlurEnabled&&!S;var w=m;n||(e.prevPxRatio!==v&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=v),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),m&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(w=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!g&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var T=a.style(),C=a.zoom(),B=o!==void 0?o:C,R=a.pan(),L={x:R.x,y:R.y},A={zoom:C,pan:{x:R.x,y:R.y}},O=e.prevViewport,z=O===void 0||A.zoom!==O.zoom||A.pan.x!==O.pan.x||A.pan.y!==O.pan.y;!z&&!(E&&!b)&&(e.motionBlurPxRatio=1),c&&(L=c),B*=v,L.x*=v,L.y*=v;var U=e.getCachedZSortedEles();function V(fe,te,re,le,he){var Ee=fe.globalCompositeOperation;fe.globalCompositeOperation="destination-out",e.colorFillStyle(fe,255,255,255,e.motionBlurTransparency),fe.fillRect(te,re,le,he),fe.globalCompositeOperation=Ee}function P(fe,te){var re,le,he,Ee;!e.clearingMotionBlur&&(fe===f.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||fe===f.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(re={x:R.x*x,y:R.y*x},le=C*x,he=e.canvasWidth*x,Ee=e.canvasHeight*x):(re=L,le=B,he=e.canvasWidth,Ee=e.canvasHeight),fe.setTransform(1,0,0,1,0,0),te==="motionBlur"?V(fe,0,0,he,Ee):!n&&(te===void 0||te)&&fe.clearRect(0,0,he,Ee),l||(fe.translate(re.x,re.y),fe.scale(le,le)),c&&fe.translate(c.x,c.y),o&&fe.scale(o,o)}if(g||(e.textureDrawLastFrame=!1),g){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=a.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var H=e.data.bufferContexts[e.TEXTURE_BUFFER];H.setTransform(1,0,0,1,0,0),H.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:H,drawOnlyNodeLayer:!0,forcedPxRatio:v*e.textureMult});var A=e.textureCache.viewport={zoom:a.zoom(),pan:a.pan(),width:e.canvasWidth,height:e.canvasHeight};A.mpan={x:(0-A.pan.x)/A.zoom,y:(0-A.pan.y)/A.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var I=f.contexts[e.NODE],F=e.textureCache.texture,A=e.textureCache.viewport;I.setTransform(1,0,0,1,0,0),m?V(I,0,0,A.width,A.height):I.clearRect(0,0,A.width,A.height);var _=T.core("outside-texture-bg-color").value,j=T.core("outside-texture-bg-opacity").value;e.colorFillStyle(I,_[0],_[1],_[2],j),I.fillRect(0,0,A.width,A.height);var C=a.zoom();P(I,!1),I.clearRect(A.mpan.x,A.mpan.y,A.width/A.zoom/v,A.height/A.zoom/v),I.drawImage(F,A.mpan.x,A.mpan.y,A.width/A.zoom/v,A.height/A.zoom/v)}else e.textureOnViewport&&!n&&(e.textureCache=null);var Y=a.extent(),Q=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),W=e.hideEdgesOnViewport&&Q,N=[];if(N[e.NODE]=!h[e.NODE]&&m&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,N[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),N[e.DRAG]=!h[e.DRAG]&&m&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,N[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||l||u||N[e.NODE]){var G=m&&!N[e.NODE]&&x!==1,I=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:f.contexts[e.NODE]),Z=m&&!G?"motionBlur":void 0;P(I,Z),W?e.drawCachedNodes(I,U.nondrag,v,Y):e.drawLayeredElements(I,U.nondrag,v,Y),e.debug&&e.drawDebugPoints(I,U.nondrag),!l&&!m&&(h[e.NODE]=!1)}if(!u&&(h[e.DRAG]||l||N[e.DRAG])){var G=m&&!N[e.DRAG]&&x!==1,I=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:f.contexts[e.DRAG]);P(I,m&&!G?"motionBlur":void 0),W?e.drawCachedNodes(I,U.drag,v,Y):e.drawCachedElements(I,U.drag,v,Y),e.debug&&e.drawDebugPoints(I,U.drag),!l&&!m&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),m&&x!==1){var $=f.contexts[e.NODE],ae=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],se=f.contexts[e.DRAG],de=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],Se=function(te,re,le){te.setTransform(1,0,0,1,0,0),le||!w?te.clearRect(0,0,e.canvasWidth,e.canvasHeight):V(te,0,0,e.canvasWidth,e.canvasHeight);var he=x;te.drawImage(re,0,0,e.canvasWidth*he,e.canvasHeight*he,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||N[e.NODE])&&(Se($,ae,N[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||N[e.DRAG])&&(Se(se,de,N[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=A,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),m&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!g,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},QB)),n||a.emit("render")};var qu;Ua.drawSelectionRectangle=function(t,e){var a=this,n=a.cy,l=a.data,u=n.style(),o=t.drawOnlyNodeLayer,c=t.drawAllLayers,v=l.canvasNeedsRedraw,f=t.forcedContext;if(a.showFps||!o&&v[a.SELECT_BOX]&&!c){var h=f||l.contexts[a.SELECT_BOX];if(e(h),a.selection[4]==1&&(a.hoverData.selecting||a.touchData.selecting)){var g=a.cy.zoom(),m=u.core("selection-box-border-width").value/g;h.lineWidth=m,h.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+")",h.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),m>0&&(h.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+")",h.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(l.bgActivePosistion&&!a.hoverData.selecting){var g=a.cy.zoom(),x=l.bgActivePosistion;h.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+")",h.beginPath(),h.arc(x.x,x.y,u.core("active-bg-size").pfValue/g,0,2*Math.PI),h.fill()}var b=a.lastRedrawTime;if(a.showFps&&b){b=Math.round(b);var E=Math.round(1e3/b),S="1 frame = "+b+" ms = "+E+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!qu){var w=h.measureText(S);qu=w.actualBoundingBoxAscent}h.fillText(S,0,qu);var T=60;h.strokeRect(0,qu+10,250,20),h.fillRect(0,qu+10,250*Math.min(E/T,1),20)}c||(v[a.SELECT_BOX]=!1)}};function B1(t,e,a){var n=t.createShader(e);if(t.shaderSource(n,a),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function $B(t,e,a){var n=B1(t,t.VERTEX_SHADER,e),l=B1(t,t.FRAGMENT_SHADER,a),u=t.createProgram();if(t.attachShader(u,n),t.attachShader(u,l),t.linkProgram(u),!t.getProgramParameter(u,t.LINK_STATUS))throw new Error("Could not initialize shaders");return u}function WB(t,e,a){a===void 0&&(a=e);var n=t.makeOffscreenCanvas(e,a),l=n.context=n.getContext("2d");return n.clear=function(){return l.clearRect(0,0,n.width,n.height)},n.clear(),n}function hg(t){var e=t.pixelRatio,a=t.cy.zoom(),n=t.cy.pan();return{zoom:a*e,pan:{x:n.x*e,y:n.y*e}}}function JB(t){var e=t.pixelRatio,a=t.cy.zoom();return a*e}function eN(t,e,a,n,l){var u=n*a+e.x,o=l*a+e.y;return o=Math.round(t.canvasHeight-o),[u,o]}function tN(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function aN(t,e){if(t.length!==e.length)return!1;for(var a=0;a<t.length;a++)if(t[a]!==e[a])return!1;return!0}function bi(t,e,a){var n=t[0]/255,l=t[1]/255,u=t[2]/255,o=e,c=a||new Array(4);return c[0]=n*o,c[1]=l*o,c[2]=u*o,c[3]=o,c}function xl(t,e){var a=e||new Array(4);return a[0]=(t>>0&255)/255,a[1]=(t>>8&255)/255,a[2]=(t>>16&255)/255,a[3]=(t>>24&255)/255,a}function rN(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function nN(t,e){var a=t.createTexture();return a.buffer=function(n){t.bindTexture(t.TEXTURE_2D,a),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)},a.deleteTexture=function(){t.deleteTexture(a)},a}function xw(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 ww(t,e,a){switch(e){case t.FLOAT:return new Float32Array(a);case t.INT:return new Int32Array(a)}}function iN(t,e,a,n,l,u){switch(e){case t.FLOAT:return new Float32Array(a.buffer,u*n,l);case t.INT:return new Int32Array(a.buffer,u*n,l)}}function lN(t,e,a,n){var l=xw(t,e),u=la(l,2),o=u[0],c=u[1],v=ww(t,c,n),f=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,f),t.bufferData(t.ARRAY_BUFFER,v,t.STATIC_DRAW),c===t.FLOAT?t.vertexAttribPointer(a,o,c,!1,0,0):c===t.INT&&t.vertexAttribIPointer(a,o,c,0,0),t.enableVertexAttribArray(a),t.bindBuffer(t.ARRAY_BUFFER,null),f}function Rr(t,e,a,n){var l=xw(t,a),u=la(l,3),o=u[0],c=u[1],v=u[2],f=ww(t,c,e*o),h=o*v,g=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,g),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),c===t.FLOAT?t.vertexAttribPointer(n,o,c,!1,h,0):c===t.INT&&t.vertexAttribIPointer(n,o,c,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var m=new Array(e),x=0;x<e;x++)m[x]=iN(t,c,f,h,o,x);return g.dataArray=f,g.stride=h,g.size=o,g.getView=function(b){return m[b]},g.setPoint=function(b,E,S){var w=m[b];w[0]=E,w[1]=S},g.bufferSubData=function(b){t.bindBuffer(t.ARRAY_BUFFER,g),b?t.bufferSubData(t.ARRAY_BUFFER,0,f,0,b*o):t.bufferSubData(t.ARRAY_BUFFER,0,f)},g}function uN(t,e,a){for(var n=9,l=new Float32Array(e*n),u=new Array(e),o=0;o<e;o++){var c=o*n*4;u[o]=new Float32Array(l.buffer,c,n)}var v=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,l.byteLength,t.DYNAMIC_DRAW);for(var f=0;f<3;f++){var h=a+f;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,3,t.FLOAT,!1,36,f*12),t.vertexAttribDivisor(h,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),v.getMatrixView=function(g){return u[g]},v.setData=function(g,m){u[m].set(g,0)},v.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferSubData(t.ARRAY_BUFFER,0,l)},v}function sN(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var a=t.createTexture();return t.bindTexture(t.TEXTURE_2D,a),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),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.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,a,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,l){t.bindTexture(t.TEXTURE_2D,a),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,l,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var N1=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function ph(){var t=new N1(9);return N1!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function M1(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function oN(t,e,a){var n=e[0],l=e[1],u=e[2],o=e[3],c=e[4],v=e[5],f=e[6],h=e[7],g=e[8],m=a[0],x=a[1],b=a[2],E=a[3],S=a[4],w=a[5],T=a[6],C=a[7],B=a[8];return t[0]=m*n+x*o+b*f,t[1]=m*l+x*c+b*h,t[2]=m*u+x*v+b*g,t[3]=E*n+S*o+w*f,t[4]=E*l+S*c+w*h,t[5]=E*u+S*v+w*g,t[6]=T*n+C*o+B*f,t[7]=T*l+C*c+B*h,t[8]=T*u+C*v+B*g,t}function Wo(t,e,a){var n=e[0],l=e[1],u=e[2],o=e[3],c=e[4],v=e[5],f=e[6],h=e[7],g=e[8],m=a[0],x=a[1];return t[0]=n,t[1]=l,t[2]=u,t[3]=o,t[4]=c,t[5]=v,t[6]=m*n+x*o+f,t[7]=m*l+x*c+h,t[8]=m*u+x*v+g,t}function R1(t,e,a){var n=e[0],l=e[1],u=e[2],o=e[3],c=e[4],v=e[5],f=e[6],h=e[7],g=e[8],m=Math.sin(a),x=Math.cos(a);return t[0]=x*n+m*o,t[1]=x*l+m*c,t[2]=x*u+m*v,t[3]=x*o-m*n,t[4]=x*c-m*l,t[5]=x*v-m*u,t[6]=f,t[7]=h,t[8]=g,t}function Vh(t,e,a){var n=a[0],l=a[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=l*e[3],t[4]=l*e[4],t[5]=l*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function cN(t,e,a){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/a,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var fN=(function(){function t(e,a,n,l){Qn(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=a,this.texRows=n,this.texHeight=Math.floor(a/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=l(e,a,a),this.scratch=l(e,a,this.texHeight,"scratch")}return $n(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(a){var n=a.w,l=a.h,u=this.texHeight,o=this.texSize,c=u/l,v=n*c,f=l*c;return v>o&&(c=o/n,v=n*c,f=l*c),{scale:c,texW:v,texH:f}}},{key:"draw",value:function(a,n,l){var u=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,c=this.texRows,v=this.texHeight,f=this.getScale(n),h=f.scale,g=f.texW,m=f.texH,x=function(C,B){if(l&&B){var R=B.context,L=C.x,A=C.row,O=L,z=v*A;R.save(),R.translate(O,z),R.scale(h,h),l(R,n),R.restore()}},b=[null,null],E=function(){x(u.freePointer,u.canvas),b[0]={x:u.freePointer.x,y:u.freePointer.row*v,w:g,h:m},b[1]={x:u.freePointer.x+g,y:u.freePointer.row*v,w:0,h:m},u.freePointer.x+=g,u.freePointer.x==o&&(u.freePointer.x=0,u.freePointer.row++)},S=function(){var C=u.scratch,B=u.canvas;C.clear(),x({x:0,row:0},C);var R=o-u.freePointer.x,L=g-R,A=v;{var O=u.freePointer.x,z=u.freePointer.row*v,U=R;B.context.drawImage(C,0,0,U,A,O,z,U,A),b[0]={x:O,y:z,w:U,h:m}}{var V=R,P=(u.freePointer.row+1)*v,H=L;B&&B.context.drawImage(C,V,0,H,A,0,P,H,A),b[1]={x:0,y:P,w:H,h:m}}u.freePointer.x=L,u.freePointer.row++},w=function(){u.freePointer.x=0,u.freePointer.row++};if(this.freePointer.x+g<=o)E();else{if(this.freePointer.row>=c-1)return!1;this.freePointer.x===o?(w(),E()):this.enableWrapping?S():(w(),E())}return this.keyToLocation.set(a,b),this.needsBuffer=!0,b}},{key:"getOffsets",value:function(a){return this.keyToLocation.get(a)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(a){if(this.locked)return!1;var n=this.texSize,l=this.texRows,u=this.getScale(a),o=u.texW;return this.freePointer.x+o>n?this.freePointer.row<l-1:!0}},{key:"bufferIfNeeded",value:function(a){this.texture||(this.texture=nN(a,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),vN=(function(){function t(e,a,n,l){Qn(this,t),this.r=e,this.texSize=a,this.texRows=n,this.createTextureCanvas=l,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return $n(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var a=this.r,n=this.texSize,l=this.texRows,u=this.createTextureCanvas;return new fN(a,n,l,u)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var a=this.r,n=this.texSize,l=this.texRows,u=this.createTextureCanvas,o=Math.floor(n/l);this.scratch=u(a,n,o,"scratch")}return this.scratch}},{key:"draw",value:function(a,n,l){var u=this.styleKeyToAtlas.get(a);return u||(u=this.atlases[this.atlases.length-1],(!u||!u.canFit(n))&&(u&&u.lock(),u=this._createAtlas(),this.atlases.push(u)),u.draw(a,n,l),this.styleKeyToAtlas.set(a,u)),u}},{key:"getAtlas",value:function(a){return this.styleKeyToAtlas.get(a)}},{key:"hasAtlas",value:function(a){return this.styleKeyToAtlas.has(a)}},{key:"markKeyForGC",value:function(a){this.markedKeys.add(a)}},{key:"gc",value:function(){var a=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var l=[],u=new Map,o=null,c=Za(this.atlases),v;try{var f=function(){var g=v.value,m=g.getKeys(),x=dN(n,m);if(x.size===0)return l.push(g),m.forEach(function(R){return u.set(R,g)}),1;o||(o=a._createAtlas(),l.push(o));var b=Za(m),E;try{for(b.s();!(E=b.n()).done;){var S=E.value;if(!x.has(S)){var w=g.getOffsets(S),T=la(w,2),C=T[0],B=T[1];o.canFit({w:C.w+B.w,h:C.h})||(o.lock(),o=a._createAtlas(),l.push(o)),g.canvas&&(a._copyTextureToNewAtlas(S,g,o),u.set(S,o))}}}catch(R){b.e(R)}finally{b.f()}g.dispose()};for(c.s();!(v=c.n()).done;)f()}catch(h){c.e(h)}finally{c.f()}this.atlases=l,this.styleKeyToAtlas=u,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(a,n,l){var u=n.getOffsets(a),o=la(u,2),c=o[0],v=o[1];if(v.w===0)l.draw(a,c,function(m){m.drawImage(n.canvas,c.x,c.y,c.w,c.h,0,0,c.w,c.h)});else{var f=this._getScratchCanvas();f.clear(),f.context.drawImage(n.canvas,c.x,c.y,c.w,c.h,0,0,c.w,c.h),f.context.drawImage(n.canvas,v.x,v.y,v.w,v.h,c.w,0,v.w,v.h);var h=c.w+v.w,g=c.h;l.draw(a,{w:h,h:g},function(m){m.drawImage(f,0,0,h,g,0,0,h,g)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function dN(t,e){return t.intersection?t.intersection(e):new Set(Jo(t).filter(function(a){return e.has(a)}))}var hN=(function(){function t(e,a){Qn(this,t),this.r=e,this.globalOptions=a,this.atlasSize=a.webglTexSize,this.maxAtlasesPerBatch=a.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return $n(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(a,n){var l=this.globalOptions,u=l.webglTexSize,o=l.createTextureCanvas,c=n.texRows,v=this._cacheScratchCanvas(o),f=new vN(this.r,u,c,v);this.collections.set(a,f)}},{key:"addRenderType",value:function(a,n){var l=n.collection;if(!this.collections.has(l))throw new Error("invalid atlas collection name '".concat(l,"'"));var u=this.collections.get(l),o=Fe({type:a,atlasCollection:u},n);this.renderTypes.set(a,o)}},{key:"getRenderTypeOpts",value:function(a){return this.renderTypes.get(a)}},{key:"getAtlasCollection",value:function(a){return this.collections.get(a)}},{key:"_cacheScratchCanvas",value:function(a){var n=-1,l=-1,u=null;return function(o,c,v,f){return f?((!u||c!=n||v!=l)&&(n=c,l=v,u=a(o,c,v)),u):a(o,c,v)}}},{key:"_key",value:function(a,n){return"".concat(a,"-").concat(n)}},{key:"invalidate",value:function(a){var n=this,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=l.forceRedraw,o=u===void 0?!1:u,c=l.filterEle,v=c===void 0?function(){return!0}:c,f=l.filterType,h=f===void 0?function(){return!0}:f,g=!1,m=!1,x=Za(a),b;try{for(x.s();!(b=x.n()).done;){var E=b.value;if(v(E)){var S=Za(this.renderTypes.values()),w;try{var T=function(){var B=w.value,R=B.type;if(h(R)){var L=n.collections.get(B.collection),A=B.getKey(E),O=Array.isArray(A)?A:[A];if(o)O.forEach(function(P){return L.markKeyForGC(P)}),m=!0;else{var z=B.getID?B.getID(E):E.id(),U=n._key(R,z),V=n.typeAndIdToKey.get(U);V!==void 0&&!aN(O,V)&&(g=!0,n.typeAndIdToKey.delete(U),V.forEach(function(P){return L.markKeyForGC(P)}))}}};for(S.s();!(w=S.n()).done;)T()}catch(C){S.e(C)}finally{S.f()}}}}catch(C){x.e(C)}finally{x.f()}return m&&(this.gc(),g=!1),g}},{key:"gc",value:function(){var a=Za(this.collections.values()),n;try{for(a.s();!(n=a.n()).done;){var l=n.value;l.gc()}}catch(u){a.e(u)}finally{a.f()}}},{key:"getOrCreateAtlas",value:function(a,n,l,u){var o=this.renderTypes.get(n),c=this.collections.get(o.collection),v=!1,f=c.draw(u,l,function(m){o.drawClipped?(m.save(),m.beginPath(),m.rect(0,0,l.w,l.h),m.clip(),o.drawElement(m,a,l,!0,!0),m.restore()):o.drawElement(m,a,l,!0,!0),v=!0});if(v){var h=o.getID?o.getID(a):a.id(),g=this._key(n,h);this.typeAndIdToKey.has(g)?this.typeAndIdToKey.get(g).push(u):this.typeAndIdToKey.set(g,[u])}return f}},{key:"getAtlasInfo",value:function(a,n){var l=this,u=this.renderTypes.get(n),o=u.getKey(a),c=Array.isArray(o)?o:[o];return c.map(function(v){var f=u.getBoundingBox(a,v),h=l.getOrCreateAtlas(a,n,f,v),g=h.getOffsets(v),m=la(g,2),x=m[0],b=m[1];return{atlas:h,tex:x,tex1:x,tex2:b,bb:f}})}},{key:"getDebugInfo",value:function(){var a=[],n=Za(this.collections),l;try{for(n.s();!(l=n.n()).done;){var u=la(l.value,2),o=u[0],c=u[1],v=c.getCounts(),f=v.keyCount,h=v.atlasCount;a.push({type:o,keyCount:f,atlasCount:h})}}catch(g){n.e(g)}finally{n.f()}return a}}])})(),gN=(function(){function t(e){Qn(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return $n(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(a,n){return n})}},{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(a){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(a):!0}},{key:"getAtlasIndexForBatch",value:function(a){var n=this.batchAtlases.indexOf(a);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(a),n=this.batchAtlases.length-1}return n}}])})(),pN=`
16
- float circleSD(vec2 p, float r) {
17
- return distance(vec2(0), p) - r; // signed distance
18
- }
19
- `,mN=`
20
- float rectangleSD(vec2 p, vec2 b) {
21
- vec2 d = abs(p)-b;
22
- return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
23
- }
24
- `,yN=`
25
- float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
26
- cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
27
- cr.x = (p.y > 0.0) ? cr.x : cr.y;
28
- vec2 q = abs(p) - b + cr.x;
29
- return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
30
- }
31
- `,bN=`
32
- float ellipseSD(vec2 p, vec2 ab) {
33
- p = abs( p ); // symmetry
34
-
35
- // find root with Newton solver
36
- vec2 q = ab*(p-ab);
37
- float w = (q.x<q.y)? 1.570796327 : 0.0;
38
- for( int i=0; i<5; i++ ) {
39
- vec2 cs = vec2(cos(w),sin(w));
40
- vec2 u = ab*vec2( cs.x,cs.y);
41
- vec2 v = ab*vec2(-cs.y,cs.x);
42
- w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
43
- }
44
-
45
- // compute final point and distance
46
- float d = length(p-ab*vec2(cos(w),sin(w)));
47
-
48
- // return signed distance
49
- return (dot(p/ab,p/ab)>1.0) ? d : -d;
50
- }
51
- `,Yu={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},fc={IGNORE:1,USE_BB:2},mh=0,z1=1,O1=2,yh=3,wl=4,Po=5,Vu=6,Uu=7,xN=(function(){function t(e,a,n){Qn(this,t),this.r=e,this.gl=a,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=WB,this.atlasManager=new hN(e,n),this.batchManager=new gN(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Yu.SCREEN),this.pickingProgram=this._createShaderProgram(Yu.PICKING),this.vao=this._createVAO()}return $n(t,[{key:"addAtlasCollection",value:function(a,n){this.atlasManager.addAtlasCollection(a,n)}},{key:"addTextureAtlasRenderType",value:function(a,n){this.atlasManager.addRenderType(a,n)}},{key:"addSimpleShapeRenderType",value:function(a,n){this.simpleShapeOptions.set(a,n)}},{key:"invalidate",value:function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=n.type,u=this.atlasManager;return l?u.invalidate(a,{filterType:function(c){return c===l},forceRedraw:!0}):u.invalidate(a)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(a){var n=this.gl,l=`#version 300 es
52
- precision highp float;
53
-
54
- uniform mat3 uPanZoomMatrix;
55
- uniform int uAtlasSize;
56
-
57
- // instanced
58
- in vec2 aPosition; // a vertex from the unit square
59
-
60
- in mat3 aTransform; // used to transform verticies, eg into a bounding box
61
- in int aVertType; // the type of thing we are rendering
62
-
63
- // the z-index that is output when using picking mode
64
- in vec4 aIndex;
65
-
66
- // For textures
67
- in int aAtlasId; // which shader unit/atlas to use
68
- in vec4 aTex; // x/y/w/h of texture in atlas
69
-
70
- // for edges
71
- in vec4 aPointAPointB;
72
- in vec4 aPointCPointD;
73
- in vec2 aLineWidth; // also used for node border width
74
-
75
- // simple shapes
76
- in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
77
- in vec4 aColor; // also used for edges
78
- in vec4 aBorderColor; // aLineWidth is used for border width
79
-
80
- // output values passed to the fragment shader
81
- out vec2 vTexCoord;
82
- out vec4 vColor;
83
- out vec2 vPosition;
84
- // flat values are not interpolated
85
- flat out int vAtlasId;
86
- flat out int vVertType;
87
- flat out vec2 vTopRight;
88
- flat out vec2 vBotLeft;
89
- flat out vec4 vCornerRadius;
90
- flat out vec4 vBorderColor;
91
- flat out vec2 vBorderWidth;
92
- flat out vec4 vIndex;
93
-
94
- void main(void) {
95
- int vid = gl_VertexID;
96
- vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
97
-
98
- if(aVertType == `.concat(mh,`) {
99
- float texX = aTex.x; // texture coordinates
100
- float texY = aTex.y;
101
- float texW = aTex.z;
102
- float texH = aTex.w;
103
-
104
- if(vid == 1 || vid == 2 || vid == 4) {
105
- texX += texW;
106
- }
107
- if(vid == 2 || vid == 4 || vid == 5) {
108
- texY += texH;
109
- }
110
-
111
- float d = float(uAtlasSize);
112
- vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
113
-
114
- gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
115
- }
116
- else if(aVertType == `).concat(wl," || aVertType == ").concat(Uu,`
117
- || aVertType == `).concat(Po," || aVertType == ").concat(Vu,`) { // simple shapes
118
-
119
- // the bounding box is needed by the fragment shader
120
- vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
121
- vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
122
- vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
123
-
124
- // calculations are done in the fragment shader, just pass these along
125
- vColor = aColor;
126
- vCornerRadius = aCornerRadius;
127
- vBorderColor = aBorderColor;
128
- vBorderWidth = aLineWidth;
129
-
130
- gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
131
- }
132
- else if(aVertType == `).concat(z1,`) {
133
- vec2 source = aPointAPointB.xy;
134
- vec2 target = aPointAPointB.zw;
135
-
136
- // adjust the geometry so that the line is centered on the edge
137
- position.y = position.y - 0.5;
138
-
139
- // stretch the unit square into a long skinny rectangle
140
- vec2 xBasis = target - source;
141
- vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
142
- vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
143
-
144
- gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
145
- vColor = aColor;
146
- }
147
- else if(aVertType == `).concat(O1,`) {
148
- vec2 pointA = aPointAPointB.xy;
149
- vec2 pointB = aPointAPointB.zw;
150
- vec2 pointC = aPointCPointD.xy;
151
- vec2 pointD = aPointCPointD.zw;
152
-
153
- // adjust the geometry so that the line is centered on the edge
154
- position.y = position.y - 0.5;
155
-
156
- vec2 p0, p1, p2, pos;
157
- if(position.x == 0.0) { // The left side of the unit square
158
- p0 = pointA;
159
- p1 = pointB;
160
- p2 = pointC;
161
- pos = position;
162
- } else { // The right side of the unit square, use same approach but flip the geometry upside down
163
- p0 = pointD;
164
- p1 = pointC;
165
- p2 = pointB;
166
- pos = vec2(0.0, -position.y);
167
- }
168
-
169
- vec2 p01 = p1 - p0;
170
- vec2 p12 = p2 - p1;
171
- vec2 p21 = p1 - p2;
172
-
173
- // Find the normal vector.
174
- vec2 tangent = normalize(normalize(p12) + normalize(p01));
175
- vec2 normal = vec2(-tangent.y, tangent.x);
176
-
177
- // Find the vector perpendicular to p0 -> p1.
178
- vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
179
-
180
- // Determine the bend direction.
181
- float sigma = sign(dot(p01 + p21, normal));
182
- float width = aLineWidth[0];
183
-
184
- if(sign(pos.y) == -sigma) {
185
- // This is an intersecting vertex. Adjust the position so that there's no overlap.
186
- vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
187
- gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
188
- } else {
189
- // This is a non-intersecting vertex. Treat it like a mitre join.
190
- vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
191
- gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
192
- }
193
-
194
- vColor = aColor;
195
- }
196
- else if(aVertType == `).concat(yh,` && vid < 3) {
197
- // massage the first triangle into an edge arrow
198
- if(vid == 0)
199
- position = vec2(-0.15, -0.3);
200
- if(vid == 1)
201
- position = vec2( 0.0, 0.0);
202
- if(vid == 2)
203
- position = vec2( 0.15, -0.3);
204
-
205
- gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
206
- vColor = aColor;
207
- }
208
- else {
209
- gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
210
- }
211
-
212
- vAtlasId = aAtlasId;
213
- vVertType = aVertType;
214
- vIndex = aIndex;
215
- }
216
- `),u=this.batchManager.getIndexArray(),o=`#version 300 es
217
- precision highp float;
218
-
219
- // declare texture unit for each texture atlas in the batch
220
- `.concat(u.map(function(f){return"uniform sampler2D uTexture".concat(f,";")}).join(`
221
- `),`
222
-
223
- uniform vec4 uBGColor;
224
- uniform float uZoom;
225
-
226
- in vec2 vTexCoord;
227
- in vec4 vColor;
228
- in vec2 vPosition; // model coordinates
229
-
230
- flat in int vAtlasId;
231
- flat in vec4 vIndex;
232
- flat in int vVertType;
233
- flat in vec2 vTopRight;
234
- flat in vec2 vBotLeft;
235
- flat in vec4 vCornerRadius;
236
- flat in vec4 vBorderColor;
237
- flat in vec2 vBorderWidth;
238
-
239
- out vec4 outColor;
240
-
241
- `).concat(pN,`
242
- `).concat(mN,`
243
- `).concat(yN,`
244
- `).concat(bN,`
245
-
246
- vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
247
- return vec4(
248
- top.rgb + (bot.rgb * (1.0 - top.a)),
249
- top.a + (bot.a * (1.0 - top.a))
250
- );
251
- }
252
-
253
- vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
254
- // scale to the zoom level so that borders don't look blurry when zoomed in
255
- // note 1.5 is an aribitrary value chosen because it looks good
256
- return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
257
- }
258
-
259
- void main(void) {
260
- if(vVertType == `).concat(mh,`) {
261
- // look up the texel from the texture unit
262
- `).concat(u.map(function(f){return"if(vAtlasId == ".concat(f,") outColor = texture(uTexture").concat(f,", vTexCoord);")}).join(`
263
- else `),`
264
- }
265
- else if(vVertType == `).concat(yh,`) {
266
- // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
267
- outColor = blend(vColor, uBGColor);
268
- outColor.a = 1.0; // make opaque, masks out line under arrow
269
- }
270
- else if(vVertType == `).concat(wl,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
271
- outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
272
- }
273
- else if(vVertType == `).concat(wl," || vVertType == ").concat(Uu,`
274
- || vVertType == `).concat(Po," || vVertType == ").concat(Vu,`) { // use SDF
275
-
276
- float outerBorder = vBorderWidth[0];
277
- float innerBorder = vBorderWidth[1];
278
- float borderPadding = outerBorder * 2.0;
279
- float w = vTopRight.x - vBotLeft.x - borderPadding;
280
- float h = vTopRight.y - vBotLeft.y - borderPadding;
281
- vec2 b = vec2(w/2.0, h/2.0); // half width, half height
282
- vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
283
-
284
- float d; // signed distance
285
- if(vVertType == `).concat(wl,`) {
286
- d = rectangleSD(p, b);
287
- } else if(vVertType == `).concat(Uu,` && w == h) {
288
- d = circleSD(p, b.x); // faster than ellipse
289
- } else if(vVertType == `).concat(Uu,`) {
290
- d = ellipseSD(p, b);
291
- } else {
292
- d = roundRectangleSD(p, b, vCornerRadius.wzyx);
293
- }
294
-
295
- // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
296
- // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
297
- if(d > 0.0) {
298
- if(d > outerBorder) {
299
- discard;
300
- } else {
301
- outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
302
- }
303
- } else {
304
- if(d > innerBorder) {
305
- vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
306
- vec4 innerBorderColor = blend(vBorderColor, vColor);
307
- outColor = distInterp(innerBorderColor, outerColor, d);
308
- }
309
- else {
310
- vec4 outerColor;
311
- if(innerBorder == 0.0 && outerBorder == 0.0) {
312
- outerColor = vec4(0);
313
- } else if(innerBorder == 0.0) {
314
- outerColor = vBorderColor;
315
- } else {
316
- outerColor = blend(vBorderColor, vColor);
317
- }
318
- outColor = distInterp(vColor, outerColor, d - innerBorder);
319
- }
320
- }
321
- }
322
- else {
323
- outColor = vColor;
324
- }
325
-
326
- `).concat(a.picking?`if(outColor.a == 0.0) discard;
327
- else outColor = vIndex;`:"",`
328
- }
329
- `),c=$B(n,l,o);c.aPosition=n.getAttribLocation(c,"aPosition"),c.aIndex=n.getAttribLocation(c,"aIndex"),c.aVertType=n.getAttribLocation(c,"aVertType"),c.aTransform=n.getAttribLocation(c,"aTransform"),c.aAtlasId=n.getAttribLocation(c,"aAtlasId"),c.aTex=n.getAttribLocation(c,"aTex"),c.aPointAPointB=n.getAttribLocation(c,"aPointAPointB"),c.aPointCPointD=n.getAttribLocation(c,"aPointCPointD"),c.aLineWidth=n.getAttribLocation(c,"aLineWidth"),c.aColor=n.getAttribLocation(c,"aColor"),c.aCornerRadius=n.getAttribLocation(c,"aCornerRadius"),c.aBorderColor=n.getAttribLocation(c,"aBorderColor"),c.uPanZoomMatrix=n.getUniformLocation(c,"uPanZoomMatrix"),c.uAtlasSize=n.getUniformLocation(c,"uAtlasSize"),c.uBGColor=n.getUniformLocation(c,"uBGColor"),c.uZoom=n.getUniformLocation(c,"uZoom"),c.uTextures=[];for(var v=0;v<this.batchManager.getMaxAtlasesPerBatch();v++)c.uTextures.push(n.getUniformLocation(c,"uTexture".concat(v)));return c}},{key:"_createVAO",value:function(){var a=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=a.length/2;var n=this.maxInstances,l=this.gl,u=this.program,o=l.createVertexArray();return l.bindVertexArray(o),lN(l,"vec2",u.aPosition,a),this.transformBuffer=uN(l,n,u.aTransform),this.indexBuffer=Rr(l,n,"vec4",u.aIndex),this.vertTypeBuffer=Rr(l,n,"int",u.aVertType),this.atlasIdBuffer=Rr(l,n,"int",u.aAtlasId),this.texBuffer=Rr(l,n,"vec4",u.aTex),this.pointAPointBBuffer=Rr(l,n,"vec4",u.aPointAPointB),this.pointCPointDBuffer=Rr(l,n,"vec4",u.aPointCPointD),this.lineWidthBuffer=Rr(l,n,"vec2",u.aLineWidth),this.colorBuffer=Rr(l,n,"vec4",u.aColor),this.cornerRadiusBuffer=Rr(l,n,"vec4",u.aCornerRadius),this.borderColorBuffer=Rr(l,n,"vec4",u.aBorderColor),l.bindVertexArray(null),o}},{key:"buffers",get:function(){var a=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return Un(n,"Buffer")}).map(function(n){return a[n]})),this._buffers}},{key:"startFrame",value:function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yu.SCREEN;this.panZoomMatrix=a,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(a,n){return a.visible()?n&&n.isVisible?n.isVisible(a):!0:!1}},{key:"drawTexture",value:function(a,n,l){var u=this.atlasManager,o=this.batchManager,c=u.getRenderTypeOpts(l);if(this._isVisible(a,c)&&!(a.isEdge()&&!this._isValidEdge(a))){if(this.renderTarget.picking&&c.getTexPickingMode){var v=c.getTexPickingMode(a);if(v===fc.IGNORE)return;if(v==fc.USE_BB){this.drawPickingRectangle(a,n,l);return}}var f=u.getAtlasInfo(a,l),h=Za(f),g;try{for(h.s();!(g=h.n()).done;){var m=g.value,x=m.atlas,b=m.tex1,E=m.tex2;o.canAddToCurrentBatch(x)||this.endBatch();for(var S=o.getAtlasIndexForBatch(x),w=0,T=[[b,!0],[E,!1]];w<T.length;w++){var C=la(T[w],2),B=C[0],R=C[1];if(B.w!=0){var L=this.instanceCount;this.vertTypeBuffer.getView(L)[0]=mh;var A=this.indexBuffer.getView(L);xl(n,A);var O=this.atlasIdBuffer.getView(L);O[0]=S;var z=this.texBuffer.getView(L);z[0]=B.x,z[1]=B.y,z[2]=B.w,z[3]=B.h;var U=this.transformBuffer.getMatrixView(L);this.setTransformMatrix(a,U,c,m,R),this.instanceCount++,R||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(V){h.e(V)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(a,n,l,u){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,c=0;if(l.shapeProps&&l.shapeProps.padding&&(c=a.pstyle(l.shapeProps.padding).pfValue),u){var v=u.bb,f=u.tex1,h=u.tex2,g=f.w/(f.w+h.w);o||(g=1-g);var m=this._getAdjustedBB(v,c,o,g);this._applyTransformMatrix(n,m,l,a)}else{var x=l.getBoundingBox(a),b=this._getAdjustedBB(x,c,!0,1);this._applyTransformMatrix(n,b,l,a)}}},{key:"_applyTransformMatrix",value:function(a,n,l,u){var o,c;M1(a);var v=l.getRotation?l.getRotation(u):0;if(v!==0){var f=l.getRotationPoint(u),h=f.x,g=f.y;Wo(a,a,[h,g]),R1(a,a,v);var m=l.getRotationOffset(u);o=m.x+(n.xOffset||0),c=m.y+(n.yOffset||0)}else o=n.x1,c=n.y1;Wo(a,a,[o,c]),Vh(a,a,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(a,n,l,u){var o=a.x1,c=a.y1,v=a.w,f=a.h,h=a.yOffset;n&&(o-=n,c-=n,v+=2*n,f+=2*n);var g=0,m=v*u;return l&&u<1?v=m:!l&&u<1&&(g=v-m,o+=g,v=m),{x1:o,y1:c,w:v,h:f,xOffset:g,yOffset:h}}},{key:"drawPickingRectangle",value:function(a,n,l){var u=this.atlasManager.getRenderTypeOpts(l),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=wl;var c=this.indexBuffer.getView(o);xl(n,c);var v=this.colorBuffer.getView(o);bi([0,0,0],1,v);var f=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(a,f,u),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(a,n,l){var u=this.simpleShapeOptions.get(l);if(this._isVisible(a,u)){var o=u.shapeProps,c=this._getVertTypeForShape(a,o.shape);if(c===void 0||u.isSimple&&!u.isSimple(a,this.renderTarget)){this.drawTexture(a,n,l);return}var v=this.instanceCount;if(this.vertTypeBuffer.getView(v)[0]=c,c===Po||c===Vu){var f=u.getBoundingBox(a),h=this._getCornerRadius(a,o.radius,f),g=this.cornerRadiusBuffer.getView(v);g[0]=h,g[1]=h,g[2]=h,g[3]=h,c===Vu&&(g[0]=0,g[2]=0)}var m=this.indexBuffer.getView(v);xl(n,m);var x=this.renderTarget.picking?1:a.pstyle(o.opacity).value,b=a.pstyle(o.color).value,E=this.colorBuffer.getView(v);bi(b,x,E);var S=this.lineWidthBuffer.getView(v);if(S[0]=0,S[1]=0,o.border){var w=a.pstyle("border-width").value;if(w>0){var T=a.pstyle("border-color").value,C=a.pstyle("border-opacity").value,B=this.borderColorBuffer.getView(v);bi(T,C,B);var R=a.pstyle("border-position").value;if(R==="inside")S[0]=0,S[1]=-w;else if(R==="outside")S[0]=w,S[1]=0;else{var L=w/2;S[0]=L,S[1]=-L}}}var A=this.transformBuffer.getMatrixView(v);this.setTransformMatrix(a,A,u),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(a,n){var l=a.pstyle(n).value;switch(l){case"rectangle":return wl;case"ellipse":return Uu;case"roundrectangle":case"round-rectangle":return Po;case"bottom-round-rectangle":return Vu;default:return}}},{key:"_getCornerRadius",value:function(a,n,l){var u=l.w,o=l.h;if(a.pstyle(n).value==="auto")return Fn(u,o);var c=a.pstyle(n).pfValue,v=u/2,f=o/2;return Math.min(c,f,v)}},{key:"drawEdgeArrow",value:function(a,n,l){if(a.visible()){var u=a._private.rscratch,o,c,v;if(l==="source"?(o=u.arrowStartX,c=u.arrowStartY,v=u.srcArrowAngle):(o=u.arrowEndX,c=u.arrowEndY,v=u.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(c)||c==null||isNaN(v)||v==null)){var f=a.pstyle(l+"-arrow-shape").value;if(f!=="none"){var h=a.pstyle(l+"-arrow-color").value,g=a.pstyle("opacity").value,m=a.pstyle("line-opacity").value,x=g*m,b=a.pstyle("width").pfValue,E=a.pstyle("arrow-scale").value,S=this.r.getArrowWidth(b,E),w=this.instanceCount,T=this.transformBuffer.getMatrixView(w);M1(T),Wo(T,T,[o,c]),Vh(T,T,[S,S]),R1(T,T,v),this.vertTypeBuffer.getView(w)[0]=yh;var C=this.indexBuffer.getView(w);xl(n,C);var B=this.colorBuffer.getView(w);bi(h,x,B),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(a,n){if(a.visible()){var l=this._getEdgePoints(a);if(l){var u=a.pstyle("opacity").value,o=a.pstyle("line-opacity").value,c=a.pstyle("width").pfValue,v=a.pstyle("line-color").value,f=u*o;if(l.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),l.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=z1;var g=this.indexBuffer.getView(h);xl(n,g);var m=this.colorBuffer.getView(h);bi(v,f,m);var x=this.lineWidthBuffer.getView(h);x[0]=c;var b=this.pointAPointBBuffer.getView(h);b[0]=l[0],b[1]=l[1],b[2]=l[2],b[3]=l[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var E=0;E<l.length-2;E+=2){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=O1;var w=this.indexBuffer.getView(S);xl(n,w);var T=this.colorBuffer.getView(S);bi(v,f,T);var C=this.lineWidthBuffer.getView(S);C[0]=c;var B=l[E-2],R=l[E-1],L=l[E],A=l[E+1],O=l[E+2],z=l[E+3],U=l[E+4],V=l[E+5];E==0&&(B=2*L-O+.001,R=2*A-z+.001),E==l.length-4&&(U=2*O-L+.001,V=2*z-A+.001);var P=this.pointAPointBBuffer.getView(S);P[0]=B,P[1]=R,P[2]=L,P[3]=A;var H=this.pointCPointDBuffer.getView(S);H[0]=O,H[1]=z,H[2]=U,H[3]=V,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(a){var n=a._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(a){var n=a._private.rscratch;if(this._isValidEdge(a)){var l=n.allpts;if(l.length==4)return l;var u=this._getNumSegments(a);return this._getCurveSegmentPoints(l,u)}}},{key:"_getNumSegments",value:function(a){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(a,n){if(a.length==4)return a;for(var l=Array((n+1)*2),u=0;u<=n;u++)if(u==0)l[0]=a[0],l[1]=a[1];else if(u==n)l[u*2]=a[a.length-2],l[u*2+1]=a[a.length-1];else{var o=u/n;this._setCurvePoint(a,o,l,u*2)}return l}},{key:"_setCurvePoint",value:function(a,n,l,u){if(a.length<=2)l[u]=a[0],l[u+1]=a[1];else{for(var o=Array(a.length-2),c=0;c<o.length;c+=2){var v=(1-n)*a[c]+n*a[c+2],f=(1-n)*a[c+1]+n*a[c+3];o[c]=v,o[c+1]=f}return this._setCurvePoint(o,n,l,u)}}},{key:"endBatch",value:function(){var a=this.gl,n=this.vao,l=this.vertexCount,u=this.instanceCount;if(u!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;a.useProgram(o),a.bindVertexArray(n);var c=Za(this.buffers),v;try{for(c.s();!(v=c.n()).done;){var f=v.value;f.bufferSubData(u)}}catch(b){c.e(b)}finally{c.f()}for(var h=this.batchManager.getAtlases(),g=0;g<h.length;g++)h[g].bufferIfNeeded(a);for(var m=0;m<h.length;m++)a.activeTexture(a.TEXTURE0+m),a.bindTexture(a.TEXTURE_2D,h[m].texture),a.uniform1i(o.uTextures[m],m);a.uniform1f(o.uZoom,JB(this.r)),a.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),a.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var x=bi(this.bgColor,1);a.uniform4fv(o.uBGColor,x),a.drawArraysInstanced(a.TRIANGLES,0,l,u),a.bindVertexArray(null),a.bindTexture(a.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:u,atlasCount:h.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var a=this.atlasManager.getDebugInfo(),n=a.reduce(function(o,c){return o+c.atlasCount},0),l=this.batchDebugInfo,u=l.reduce(function(o,c){return o+c.count},0);return{atlasInfo:a,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:l.length,batchInfo:l,totalInstances:u}}}])})(),Sw={};Sw.initWebgl=function(t,e){var a=this,n=a.data.contexts[a.WEBGL];t.bgColor=wN(a),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)),a.webglDebug=t.webglDebug,a.webglDebugShowAtlases=t.webglDebugShowAtlases,a.pickingFrameBuffer=sN(n),a.pickingFrameBuffer.needsDraw=!0,a.drawing=new xN(a,n,t);var l=function(g){return function(m){return a.getTextAngle(m,g)}},u=function(g){return function(m){var x=m.pstyle(g);return x&&x.value}},o=function(g){return function(m){return m.pstyle("".concat(g,"-opacity")).value>0}},c=function(g){var m=g.pstyle("text-events").strValue==="yes";return m?fc.USE_BB:fc.IGNORE},v=function(g){var m=g.position(),x=m.x,b=m.y,E=g.outerWidth(),S=g.outerHeight();return{w:E,h:S,x1:x-E/2,y1:b-S/2}};a.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),a.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),a.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),a.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:v,isSimple:tN,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),a.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:v,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),a.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:v,isVisible:o("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),a.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:c,getKey:bh(e.getLabelKey,null),getBoundingBox:xh(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:l(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:u("label")}),a.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:c,getKey:bh(e.getSourceLabelKey,"source"),getBoundingBox:xh(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:l("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:u("source-label")}),a.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:c,getKey:bh(e.getTargetLabelKey,"target"),getBoundingBox:xh(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:l("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:u("target-label")});var f=us(function(){console.log("garbage collect flag set"),a.data.gc=!0},1e4);a.onUpdateEleCalcs(function(h,g){var m=!1;g&&g.length>0&&(m|=a.drawing.invalidate(g)),m&&f()}),SN(a)};function wN(t){var e=t.cy.container(),a=e&&e.style&&e.style.backgroundColor||"white";return Q1(a)}function Ew(t,e){var a=t._private.rscratch;return Xa(a,"labelWrapCachedLines",e)||[]}var bh=function(e,a){return function(n){var l=e(n),u=Ew(n,a);return u.length>1?u.map(function(o,c){return"".concat(l,"_").concat(c)}):l}},xh=function(e,a){return function(n,l){var u=e(n);if(typeof l=="string"){var o=l.indexOf("_");if(o>0){var c=Number(l.substring(o+1)),v=Ew(n,a),f=u.h/v.length,h=f*c,g=u.y1+h;return{x1:u.x1,w:u.w,y1:g,h:f,yOffset:h}}}return u}};function SN(t){{var e=t.render;t.render=function(u){u=u||{};var o=t.cy;t.webgl&&(o.zoom()>gw?(EN(t),e.call(t,u)):(TN(t),Cw(t,u,Yu.SCREEN)))}}{var a=t.matchCanvasSize;t.matchCanvasSize=function(u){a.call(t,u),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(u,o,c,v){return MN(t,u,o)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var l=t.notify;t.notify=function(u,o){l.call(t,u,o),u==="viewport"||u==="bounds"?t.pickingFrameBuffer.needsDraw=!0:u==="background"&&t.drawing.invalidate(o,{type:"node-body"})}}}function EN(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function TN(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 CN(t){var e=t.canvasWidth,a=t.canvasHeight,n=hg(t),l=n.pan,u=n.zoom,o=ph();Wo(o,o,[l.x,l.y]),Vh(o,o,[u,u]);var c=ph();cN(c,e,a);var v=ph();return oN(v,c,o),v}function Tw(t,e){var a=t.canvasWidth,n=t.canvasHeight,l=hg(t),u=l.pan,o=l.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,a,n),e.translate(u.x,u.y),e.scale(o,o)}function AN(t,e){t.drawSelectionRectangle(e,function(a){return Tw(t,a)})}function DN(t){var e=t.data.contexts[t.NODE];e.save(),Tw(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 BN(t){var e=function(l,u,o){for(var c=l.atlasManager.getAtlasCollection(u),v=t.data.contexts[t.NODE],f=c.atlases,h=0;h<f.length;h++){var g=f[h],m=g.canvas;if(m){var x=m.width,b=m.height,E=x*h,S=m.height*o,w=.4;v.save(),v.scale(w,w),v.drawImage(m,E,S),v.strokeStyle="black",v.rect(E,S,x,b),v.stroke(),v.restore()}}},a=0;e(t.drawing,"node",a++),e(t.drawing,"label",a++)}function NN(t,e,a,n,l){var u,o,c,v,f=hg(t),h=f.pan,g=f.zoom;{var m=eN(t,h,g,e,a),x=la(m,2),b=x[0],E=x[1],S=6;u=b-S/2,o=E-S/2,c=S,v=S}if(c===0||v===0)return[];var w=t.data.contexts[t.WEBGL];w.bindFramebuffer(w.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(w.viewport(0,0,w.canvas.width,w.canvas.height),Cw(t,null,Yu.PICKING),t.pickingFrameBuffer.needsDraw=!1);var T=c*v,C=new Uint8Array(T*4);w.readPixels(u,o,c,v,w.RGBA,w.UNSIGNED_BYTE,C),w.bindFramebuffer(w.FRAMEBUFFER,null);for(var B=new Set,R=0;R<T;R++){var L=C.slice(R*4,R*4+4),A=rN(L)-1;A>=0&&B.add(A)}return B}function MN(t,e,a){var n=NN(t,e,a),l=t.getCachedZSortedEles(),u,o,c=Za(n),v;try{for(c.s();!(v=c.n()).done;){var f=v.value,h=l[f];if(!u&&h.isNode()&&(u=h),!o&&h.isEdge()&&(o=h),u&&o)break}}catch(g){c.e(g)}finally{c.f()}return[u,o].filter(Boolean)}function wh(t,e,a){var n=t.drawing;e+=1,a.isNode()?(n.drawNode(a,e,"node-underlay"),n.drawNode(a,e,"node-body"),n.drawTexture(a,e,"label"),n.drawNode(a,e,"node-overlay")):(n.drawEdgeLine(a,e),n.drawEdgeArrow(a,e,"source"),n.drawEdgeArrow(a,e,"target"),n.drawTexture(a,e,"label"),n.drawTexture(a,e,"edge-source-label"),n.drawTexture(a,e,"edge-target-label"))}function Cw(t,e,a){var n;t.webglDebug&&(n=performance.now());var l=t.drawing,u=0;if(a.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&AN(t,e),t.data.canvasNeedsRedraw[t.NODE]||a.picking){var o=t.data.contexts[t.WEBGL];a.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 c=CN(t),v=t.getCachedZSortedEles();if(u=v.length,l.startFrame(c,a),a.screen){for(var f=0;f<v.nondrag.length;f++)wh(t,f,v.nondrag[f]);for(var h=0;h<v.drag.length;h++)wh(t,h,v.drag[h])}else if(a.picking)for(var g=0;g<v.length;g++)wh(t,g,v[g]);l.endFrame(),a.screen&&t.webglDebugShowAtlases&&(DN(t),BN(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var m=performance.now(),x=!1,b=Math.ceil(m-n),E=l.getDebugInfo(),S=["".concat(u," elements"),"".concat(E.totalInstances," instances"),"".concat(E.batchCount," batches"),"".concat(E.totalAtlases," atlases"),"".concat(E.wrappedCount," wrapped textures"),"".concat(E.simpleCount," simple shapes")].join(", ");if(x)console.log("WebGL (".concat(a.name,") - time ").concat(b,"ms, ").concat(S));else{console.log("WebGL (".concat(a.name,") - frame time ").concat(b,"ms")),console.log("Totals:"),console.log(" ".concat(S)),console.log("Texture Atlases Used:");var w=E.atlasInfo,T=Za(w),C;try{for(T.s();!(C=T.n()).done;){var B=C.value;console.log(" ".concat(B.type,": ").concat(B.keyCount," keys, ").concat(B.atlasCount," atlases"))}}catch(R){T.e(R)}finally{T.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,l.gc())}var ei={};ei.drawPolygonPath=function(t,e,a,n,l,u){var o=n/2,c=l/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*u[0],a+c*u[1]);for(var v=1;v<u.length/2;v++)t.lineTo(e+o*u[v*2],a+c*u[v*2+1]);t.closePath()};ei.drawRoundPolygonPath=function(t,e,a,n,l,u,o){o.forEach(function(c){return lw(t,c)}),t.closePath()};ei.drawRoundRectanglePath=function(t,e,a,n,l,u){var o=n/2,c=l/2,v=u==="auto"?Fn(n,l):Math.min(u,c,o);t.beginPath&&t.beginPath(),t.moveTo(e,a-c),t.arcTo(e+o,a-c,e+o,a,v),t.arcTo(e+o,a+c,e,a+c,v),t.arcTo(e-o,a+c,e-o,a,v),t.arcTo(e-o,a-c,e,a-c,v),t.lineTo(e,a-c),t.closePath()};ei.drawBottomRoundRectanglePath=function(t,e,a,n,l,u){var o=n/2,c=l/2,v=u==="auto"?Fn(n,l):u;t.beginPath&&t.beginPath(),t.moveTo(e,a-c),t.lineTo(e+o,a-c),t.lineTo(e+o,a),t.arcTo(e+o,a+c,e,a+c,v),t.arcTo(e-o,a+c,e-o,a,v),t.lineTo(e-o,a-c),t.lineTo(e,a-c),t.closePath()};ei.drawCutRectanglePath=function(t,e,a,n,l,u,o){var c=n/2,v=l/2,f=o==="auto"?eg():o;t.beginPath&&t.beginPath(),t.moveTo(e-c+f,a-v),t.lineTo(e+c-f,a-v),t.lineTo(e+c,a-v+f),t.lineTo(e+c,a+v-f),t.lineTo(e+c-f,a+v),t.lineTo(e-c+f,a+v),t.lineTo(e-c,a+v-f),t.lineTo(e-c,a-v+f),t.closePath()};ei.drawBarrelPath=function(t,e,a,n,l){var u=n/2,o=l/2,c=e-u,v=e+u,f=a-o,h=a+o,g=Th(n,l),m=g.widthOffset,x=g.heightOffset,b=g.ctrlPtOffsetPct*m;t.beginPath&&t.beginPath(),t.moveTo(c,f+x),t.lineTo(c,h-x),t.quadraticCurveTo(c+b,h,c+m,h),t.lineTo(v-m,h),t.quadraticCurveTo(v-b,h,v,h-x),t.lineTo(v,f+x),t.quadraticCurveTo(v-b,f,v-m,f),t.lineTo(c+m,f),t.quadraticCurveTo(c+b,f,c,f+x),t.closePath()};var L1=Math.sin(0),k1=Math.cos(0),Uh={},jh={},Aw=Math.PI/40;for(var Sl=0*Math.PI;Sl<2*Math.PI;Sl+=Aw)Uh[Sl]=Math.sin(Sl),jh[Sl]=Math.cos(Sl);ei.drawEllipsePath=function(t,e,a,n,l){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,a,n/2,l/2,0,0,2*Math.PI);else for(var u,o,c=n/2,v=l/2,f=0*Math.PI;f<2*Math.PI;f+=Aw)u=e-c*Uh[f]*L1+c*jh[f]*k1,o=a+v*jh[f]*L1+v*Uh[f]*k1,f===0?t.moveTo(u,o):t.lineTo(u,o);t.closePath()};var ds={};ds.createBuffer=function(t,e){var a=document.createElement("canvas");return a.width=t,a.height=e,[a,a.getContext("2d")]};ds.bufferCanvasImage=function(t){var e=this.cy,a=e.mutableElements(),n=a.boundingBox(),l=this.findContainerClientCoords(),u=t.full?Math.ceil(n.w):l[2],o=t.full?Math.ceil(n.h):l[3],c=Ce(t.maxWidth)||Ce(t.maxHeight),v=this.getPixelRatio(),f=1;if(t.scale!==void 0)u*=t.scale,o*=t.scale,f=t.scale;else if(c){var h=1/0,g=1/0;Ce(t.maxWidth)&&(h=f*t.maxWidth/u),Ce(t.maxHeight)&&(g=f*t.maxHeight/o),f=Math.min(h,g),u*=f,o*=f}c||(u*=v,o*=v,f*=v);var m=document.createElement("canvas");m.width=u,m.height=o,m.style.width=u+"px",m.style.height=o+"px";var x=m.getContext("2d");if(u>0&&o>0){x.clearRect(0,0,u,o),x.globalCompositeOperation="source-over";var b=this.getCachedZSortedEles();if(t.full)x.translate(-n.x1*f,-n.y1*f),x.scale(f,f),this.drawElements(x,b),x.scale(1/f,1/f),x.translate(n.x1*f,n.y1*f);else{var E=e.pan(),S={x:E.x*f,y:E.y*f};f*=e.zoom(),x.translate(S.x,S.y),x.scale(f,f),this.drawElements(x,b),x.scale(1/f,1/f),x.translate(-S.x,-S.y)}t.bg&&(x.globalCompositeOperation="destination-over",x.fillStyle=t.bg,x.rect(0,0,u,o),x.fill())}return m};function RN(t,e){for(var a=atob(t),n=new ArrayBuffer(a.length),l=new Uint8Array(n),u=0;u<a.length;u++)l[u]=a.charCodeAt(u);return new Blob([n],{type:e})}function _1(t){var e=t.indexOf(",");return t.substr(e+1)}function Dw(t,e,a){var n=function(){return e.toDataURL(a,t.quality)};switch(t.output){case"blob-promise":return new ql(function(l,u){try{e.toBlob(function(o){o!=null?l(o):u(new Error("`canvas.toBlob()` sent a null value in its callback"))},a,t.quality)}catch(o){u(o)}});case"blob":return RN(_1(n()),a);case"base64":return _1(n());default:return n()}}ds.png=function(t){return Dw(t,this.bufferCanvasImage(t),"image/png")};ds.jpg=function(t){return Dw(t,this.bufferCanvasImage(t),"image/jpeg")};var Bw={};Bw.nodeShapeImpl=function(t,e,a,n,l,u,o,c){switch(t){case"ellipse":return this.drawEllipsePath(e,a,n,l,u);case"polygon":return this.drawPolygonPath(e,a,n,l,u,o);case"round-polygon":return this.drawRoundPolygonPath(e,a,n,l,u,o,c);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,a,n,l,u,c);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,a,n,l,u,o,c);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,a,n,l,u,c);case"barrel":return this.drawBarrelPath(e,a,n,l,u)}};var zN=Nw,st=Nw.prototype;st.CANVAS_LAYERS=3;st.SELECT_BOX=0;st.DRAG=1;st.NODE=2;st.WEBGL=3;st.CANVAS_TYPES=["2d","2d","2d","webgl2"];st.BUFFER_COUNT=3;st.TEXTURE_BUFFER=0;st.MOTIONBLUR_BUFFER_NODE=1;st.MOTIONBLUR_BUFFER_DRAG=2;function Nw(t){var e=this,a=e.cy.window(),n=a.document;t.webgl&&(st.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(st.CANVAS_LAYERS),contexts:new Array(st.CANVAS_LAYERS),canvasNeedsRedraw:new Array(st.CANVAS_LAYERS),bufferCanvases:new Array(st.BUFFER_COUNT),bufferContexts:new Array(st.CANVAS_LAYERS)};var l="-webkit-tap-highlight-color",u="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[l]=u,o.position="relative",o.zIndex="0",o.overflow="hidden";var c=t.cy.container();c.appendChild(e.data.canvasContainer),c.style[l]=u;var v={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};AE()&&(v["-ms-touch-action"]="none",v["touch-action"]="none");for(var f=0;f<st.CANVAS_LAYERS;f++){var h=e.data.canvases[f]=n.createElement("canvas"),g=st.CANVAS_TYPES[f];e.data.contexts[f]=h.getContext(g),e.data.contexts[f]||Yt("Could not create canvas of type "+g),Object.keys(v).forEach(function(fe){h.style[fe]=v[fe]}),h.style.position="absolute",h.setAttribute("data-id","layer"+f),h.style.zIndex=String(st.CANVAS_LAYERS-f),e.data.canvasContainer.appendChild(h),e.data.canvasNeedsRedraw[f]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[st.NODE].setAttribute("data-id","layer"+st.NODE+"-node"),e.data.canvases[st.SELECT_BOX].setAttribute("data-id","layer"+st.SELECT_BOX+"-selectbox"),e.data.canvases[st.DRAG].setAttribute("data-id","layer"+st.DRAG+"-drag"),e.data.canvases[st.WEBGL]&&e.data.canvases[st.WEBGL].setAttribute("data-id","layer"+st.WEBGL+"-webgl");for(var f=0;f<st.BUFFER_COUNT;f++)e.data.bufferCanvases[f]=n.createElement("canvas"),e.data.bufferContexts[f]=e.data.bufferCanvases[f].getContext("2d"),e.data.bufferCanvases[f].style.position="absolute",e.data.bufferCanvases[f].setAttribute("data-id","buffer"+f),e.data.bufferCanvases[f].style.zIndex=String(-f-1),e.data.bufferCanvases[f].style.visibility="hidden";e.pathsEnabled=!0;var m=Va(),x=function(te){return{x:(te.x1+te.x2)/2,y:(te.y1+te.y2)/2}},b=function(te){return{x:-te.w/2,y:-te.h/2}},E=function(te){var re=te[0]._private,le=re.oldBackgroundTimestamp===re.backgroundTimestamp;return!le},S=function(te){return te[0]._private.nodeKey},w=function(te){return te[0]._private.labelStyleKey},T=function(te){return te[0]._private.sourceLabelStyleKey},C=function(te){return te[0]._private.targetLabelStyleKey},B=function(te,re,le,he,Ee){return e.drawElement(te,re,le,!1,!1,Ee)},R=function(te,re,le,he,Ee){return e.drawElementText(te,re,le,he,"main",Ee)},L=function(te,re,le,he,Ee){return e.drawElementText(te,re,le,he,"source",Ee)},A=function(te,re,le,he,Ee){return e.drawElementText(te,re,le,he,"target",Ee)},O=function(te){return te.boundingBox(),te[0]._private.bodyBounds},z=function(te){return te.boundingBox(),te[0]._private.labelBounds.main||m},U=function(te){return te.boundingBox(),te[0]._private.labelBounds.source||m},V=function(te){return te.boundingBox(),te[0]._private.labelBounds.target||m},P=function(te,re){return re},H=function(te){return x(O(te))},I=function(te,re,le){var he=te?te+"-":"";return{x:re.x+le.pstyle(he+"text-margin-x").pfValue,y:re.y+le.pstyle(he+"text-margin-y").pfValue}},F=function(te,re,le){var he=te[0]._private.rscratch;return{x:he[re],y:he[le]}},_=function(te){return I("",F(te,"labelX","labelY"),te)},j=function(te){return I("source",F(te,"sourceLabelX","sourceLabelY"),te)},Y=function(te){return I("target",F(te,"targetLabelX","targetLabelY"),te)},Q=function(te){return b(O(te))},W=function(te){return b(U(te))},N=function(te){return b(V(te))},G=function(te){var re=z(te),le=b(z(te));if(te.isNode()){switch(te.pstyle("text-halign").value){case"left":le.x=-re.w-(re.leftPad||0);break;case"right":le.x=-(re.rightPad||0);break}switch(te.pstyle("text-valign").value){case"top":le.y=-re.h-(re.topPad||0);break;case"bottom":le.y=-(re.botPad||0);break}}return le},Z=e.data.eleTxrCache=new Hu(e,{getKey:S,doesEleInvalidateKey:E,drawElement:B,getBoundingBox:O,getRotationPoint:H,getRotationOffset:Q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),$=e.data.lblTxrCache=new Hu(e,{getKey:w,drawElement:R,getBoundingBox:z,getRotationPoint:_,getRotationOffset:G,isVisible:P}),ae=e.data.slbTxrCache=new Hu(e,{getKey:T,drawElement:L,getBoundingBox:U,getRotationPoint:j,getRotationOffset:W,isVisible:P}),se=e.data.tlbTxrCache=new Hu(e,{getKey:C,drawElement:A,getBoundingBox:V,getRotationPoint:Y,getRotationOffset:N,isVisible:P}),de=e.data.lyrTxrCache=new pw(e);e.onUpdateEleCalcs(function(te,re){Z.invalidateElements(re),$.invalidateElements(re),ae.invalidateElements(re),se.invalidateElements(re),de.invalidateElements(re);for(var le=0;le<re.length;le++){var he=re[le]._private;he.oldBackgroundTimestamp=he.backgroundTimestamp}});var Se=function(te){for(var re=0;re<te.length;re++)de.enqueueElementRefinement(te[re].ele)};Z.onDequeue(Se),$.onDequeue(Se),ae.onDequeue(Se),se.onDequeue(Se),t.webgl&&e.initWebgl(t,{getStyleKey:S,getLabelKey:w,getSourceLabelKey:T,getTargetLabelKey:C,drawElement:B,drawLabel:R,drawSourceLabel:L,drawTargetLabel:A,getElementBox:O,getLabelBox:z,getSourceLabelBox:U,getTargetLabelBox:V,getElementRotationPoint:H,getElementRotationOffset:Q,getLabelRotationPoint:_,getSourceLabelRotationPoint:j,getTargetLabelRotationPoint:Y,getLabelRotationOffset:G,getSourceLabelRotationOffset:W,getTargetLabelRotationOffset:N})}st.redrawHint=function(t,e){var a=this;switch(t){case"eles":a.data.canvasNeedsRedraw[st.NODE]=e;break;case"drag":a.data.canvasNeedsRedraw[st.DRAG]=e;break;case"select":a.data.canvasNeedsRedraw[st.SELECT_BOX]=e;break;case"gc":a.data.gc=!0;break}};var ON=typeof Path2D<"u";st.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};st.usePaths=function(){return ON&&this.pathsEnabled};st.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};st.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};st.makeOffscreenCanvas=function(t,e){var a;if((typeof OffscreenCanvas>"u"?"undefined":fa(OffscreenCanvas))!=="undefined")a=new OffscreenCanvas(t,e);else{var n=this.cy.window(),l=n.document;a=l.createElement("canvas"),a.width=t,a.height=e}return a};[mw,_r,un,dg,Oi,Jn,Ua,Sw,ei,ds,Bw].forEach(function(t){Fe(st,t)});var LN=[{name:"null",impl:rw},{name:"base",impl:dw},{name:"canvas",impl:zN}],kN=[{type:"layout",extensions:lB},{type:"renderer",extensions:LN}],Mw={},Rw={};function zw(t,e,a){var n=a,l=function(O){Ct("Can not register `"+e+"` for `"+t+"` since `"+O+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(es.prototype[e])return l(e);es.prototype[e]=a}else if(t==="collection"){if(Da.prototype[e])return l(e);Da.prototype[e]=a}else if(t==="layout"){for(var u=function(O){this.options=O,a.call(this,O),yt(this._private)||(this._private={}),this._private.cy=O.cy,this._private.listeners=[],this.createEmitter()},o=u.prototype=Object.create(a.prototype),c=[],v=0;v<c.length;v++){var f=c[v];o[f]=o[f]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var h=a.prototype.stop;o.stop=function(){var A=this.options;if(A&&A.animate){var O=this.animations;if(O)for(var z=0;z<O.length;z++)O[z].stop()}return h?h.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var g=function(O){return O._private.cy},m={addEventFields:function(O,z){z.layout=O,z.cy=g(O),z.target=O},bubble:function(){return!0},parent:function(O){return g(O)}};Fe(o,{createEmitter:function(){return this._private.emitter=new Ec(m,this),this},emitter:function(){return this._private.emitter},on:function(O,z){return this.emitter().on(O,z),this},one:function(O,z){return this.emitter().one(O,z),this},once:function(O,z){return this.emitter().one(O,z),this},removeListener:function(O,z){return this.emitter().removeListener(O,z),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(O,z){return this.emitter().emit(O,z),this}}),Tt.eventAliasesOn(o),n=u}else if(t==="renderer"&&e!=="null"&&e!=="base"){var x=Ow("renderer","base"),b=x.prototype,E=a,S=a.prototype,w=function(){x.apply(this,arguments),E.apply(this,arguments)},T=w.prototype;for(var C in b){var B=b[C],R=S[C]!=null;if(R)return l(C);T[C]=B}for(var L in S)T[L]=S[L];b.clientFunctions.forEach(function(A){T[A]=T[A]||function(){Yt("Renderer does not implement `renderer."+A+"()` on its prototype")}}),n=w}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Yt(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return $1({map:Mw,keys:[t,e],value:n})}function Ow(t,e){return W1({map:Mw,keys:[t,e]})}function _N(t,e,a,n,l){return $1({map:Rw,keys:[t,e,a,n],value:l})}function qN(t,e,a,n){return W1({map:Rw,keys:[t,e,a,n]})}var Ph=function(){if(arguments.length===2)return Ow.apply(null,arguments);if(arguments.length===3)return zw.apply(null,arguments);if(arguments.length===4)return qN.apply(null,arguments);if(arguments.length===5)return _N.apply(null,arguments);Yt("Invalid extension access syntax")};es.prototype.extension=Ph;kN.forEach(function(t){t.extensions.forEach(function(e){zw(t.type,e.name,e.impl)})});var vc=function(){if(!(this instanceof vc))return new vc;this.length=0},Mi=vc.prototype;Mi.instanceString=function(){return"stylesheet"};Mi.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Mi.css=function(t,e){var a=this.length-1;if(Ge(t))this[a].properties.push({name:t,value:e});else if(yt(t))for(var n=t,l=Object.keys(n),u=0;u<l.length;u++){var o=l[u],c=n[o];if(c!=null){var v=xa.properties[o]||xa.properties[dc(o)];if(v!=null){var f=v.name,h=c;this[a].properties.push({name:f,value:h})}}}return this};Mi.style=Mi.css;Mi.generateStyle=function(t){var e=new xa(t);return this.appendToStyle(e)};Mi.appendToStyle=function(t){for(var e=0;e<this.length;e++){var a=this[e],n=a.selector,l=a.properties;t.selector(n);for(var u=0;u<l.length;u++){var o=l[u];t.css(o.name,o.value)}}return t};var VN="3.33.2",Ri=function(e){if(e===void 0&&(e={}),yt(e))return new es(e);if(Ge(e))return Ph.apply(Ph,arguments)};Ri.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Ri),t.apply(null,e),this};Ri.warnings=function(t){return ix(t)};Ri.version=VN;Ri.stylesheet=Ri.Stylesheet=vc;const UN={source:"#f59e0b",module:"#fb7185",symbol:"#8b5cf6",rationale:"#14b8a6",concept:"#0ea5e9",entity:"#22c55e"};function jN({graph:t,edgeStatusFilter:e,communityFilter:a,sourceClassFilter:n,pathResult:l,onNodeSelect:u,cyRef:o}){const c=qe.useRef(null),v=qe.useEffectEvent(E=>{u(E)}),f=qe.useEffectEvent(E=>{o.current?.destroy(),o.current=E}),h=qe.useEffectEvent(E=>{o.current===E&&(o.current=null),E.destroy()}),g=qe.useEffectEvent(E=>{const S=o.current;if(S&&(S.elements().removeClass("path-node path-edge"),E)){for(const w of E.nodeIds)S.getElementById(w).addClass("path-node");for(const w of E.edgeIds)S.getElementById(w).addClass("path-edge")}}),m=qe.useEffectEvent(E=>{typeof window>"u"||(window.__SWARMVAULT_TEST__={getNodeIds:()=>E.nodes().map(S=>S.id()),getConnectedNodePair:()=>{const S=E.edges()[0];return!S||S.empty()?null:{from:S.source().id(),to:S.target().id()}},getRenderedNodePosition:S=>{const w=E.getElementById(S);if(!w||w.empty())return null;const T=w.renderedPosition();return{x:T.x,y:T.y}},clearSelection:()=>{E.elements(":selected").unselect()},hasClass:(S,w)=>{const T=E.getElementById(S);return!T.empty()&&T.hasClass(w)}})}),x=qe.useEffectEvent(E=>{typeof window<"u"&&window.__SWARMVAULT_TEST__&&o.current===E&&delete window.__SWARMVAULT_TEST__}),b=qe.useEffectEvent(()=>{o.current?.resize()});return qe.useEffect(()=>{if(!c.current||!t)return;const E=new Set(t.nodes.filter(w=>a==="all"||w.communityId===a).filter(w=>n==="all"||(w.sourceClass??"")===n).map(w=>w.id)),S=Ri({container:c.current,elements:[...t.nodes.filter(w=>E.has(w.id)).map(w=>({data:{...w,color:UN[w.type]??"#94a3b8"}})),...t.edges.filter(w=>E.has(w.source)&&E.has(w.target)).filter(w=>e==="all"||w.status===e).map(w=>({data:w,classes:w.relation==="semantically_similar_to"?"similarity-edge":""}))],layout:{name:"cose",animate:!1,idealEdgeLength:280,nodeRepulsion:12e4,nodeOverlap:60,gravity:.08,nestingFactor:1.2,edgeElasticity:100,numIter:3e3},style:[{selector:"node",style:{label:"data(label)","background-color":"data(color)","background-opacity":.85,color:"#f1f5f9","font-family":'"Inter", "Segoe UI", system-ui, sans-serif',"font-size":11,"font-weight":"normal","text-halign":"center","text-valign":"bottom","text-margin-y":7,"text-max-width":"100px","text-wrap":"ellipsis","min-zoomed-font-size":10,"text-background-opacity":.55,"text-background-color":"#020617","text-background-padding":"2px","text-background-shape":"roundrectangle","border-width":0,"overlay-padding":4}},{selector:"node[?isGodNode]",style:{width:56,height:56,"border-width":1.5,"border-color":"rgba(254, 240, 138, 0.35)","border-opacity":1,"background-opacity":1,"font-size":12,"font-weight":"bold","text-max-width":"140px","z-index":12}},{selector:'node[type = "module"]',style:{shape:"round-rectangle",width:44,height:28,"font-size":11,"text-max-width":"120px","background-opacity":.88,"z-index":8}},{selector:'node[type = "symbol"]',style:{shape:"diamond",width:20,height:20,"font-size":9,"text-max-width":"70px","background-opacity":.6,"z-index":3}},{selector:'node[type = "rationale"]',style:{shape:"hexagon",width:28,height:28,"background-opacity":.75,"z-index":6}},{selector:'node[type = "source"]',style:{shape:"ellipse",width:32,height:32,"background-opacity":.95,"z-index":10}},{selector:'node[type = "concept"]',style:{shape:"round-rectangle",width:34,height:22,"background-opacity":.7,"z-index":5}},{selector:'node[type = "entity"]',style:{shape:"ellipse",width:26,height:26,"background-opacity":.7,"z-index":5}},{selector:"edge",style:{width:.8,"line-color":"rgba(71, 85, 105, 0.35)","target-arrow-shape":"triangle-backcurve","target-arrow-color":"rgba(71, 85, 105, 0.35)","arrow-scale":.6,"curve-style":"bezier",label:"","font-size":8,color:"rgba(148, 163, 184, 0.8)","text-background-opacity":0,"text-background-color":"#020617","text-background-padding":"2px","text-background-shape":"roundrectangle","text-rotation":"autorotate","text-margin-y":-8}},{selector:"edge:selected",style:{label:"data(relation)",width:2,"line-color":"#94a3b8","target-arrow-color":"#94a3b8","text-background-opacity":.7}},{selector:".similarity-edge",style:{"line-style":"dashed","line-color":"rgba(249, 115, 22, 0.4)","target-arrow-color":"rgba(249, 115, 22, 0.4)","line-dash-pattern":[6,4]}},{selector:".path-node",style:{"border-width":3,"border-color":"#38bdf8","background-opacity":1,"z-index":100}},{selector:".path-edge",style:{width:2.5,"line-color":"#38bdf8","target-arrow-color":"#38bdf8",label:"data(relation)","text-background-opacity":.7,"z-index":100}},{selector:":selected",style:{"border-width":2,"border-color":"#e2e8f0"}},{selector:"node:active",style:{"overlay-color":"#38bdf8","overlay-opacity":.12}}]});return S.on("select","node",w=>{v(w.target.data())}),S.on("unselect","node",()=>{v(null)}),S.on("mouseover","edge",w=>{w.target.style("label",w.target.data("relation")??""),w.target.style("width",1.8),w.target.style("line-color","rgba(148, 163, 184, 0.7)"),w.target.style("target-arrow-color","rgba(148, 163, 184, 0.7)"),w.target.style("text-background-opacity",.7),w.target.style("z-index",999)}),S.on("mouseout","edge",w=>{!w.target.selected()&&!w.target.hasClass("path-edge")&&(w.target.removeStyle("label"),w.target.removeStyle("width"),w.target.removeStyle("line-color"),w.target.removeStyle("target-arrow-color"),w.target.removeStyle("text-background-opacity"),w.target.removeStyle("z-index"))}),S.on("mouseover","node",w=>{w.target.style("text-max-width","200px"),w.target.style("text-wrap","wrap"),w.target.style("z-index",999);const T=w.target.connectedEdges();T.style("line-color","rgba(148, 163, 184, 0.6)"),T.style("target-arrow-color","rgba(148, 163, 184, 0.6)"),T.style("width",1.3)}),S.on("mouseout","node",w=>{w.target.selected()||(w.target.removeStyle("text-max-width"),w.target.removeStyle("text-wrap"),w.target.removeStyle("z-index")),w.target.connectedEdges().forEach(C=>{!C.selected()&&!C.hasClass("path-edge")&&(C.removeStyle("line-color"),C.removeStyle("target-arrow-color"),C.removeStyle("width"))})}),f(S),m(S),()=>{x(S),h(S)}},[a,e,t,n]),qe.useEffect(()=>{g(l)},[l]),qe.useEffect(()=>{const E=c.current;if(!E)return;const S=new ResizeObserver(()=>{b()});return S.observe(E),()=>S.disconnect()},[]),M.jsx("div",{className:"canvas","data-testid":"graph-canvas",ref:c})}function PN({graphQueryInput:t,onGraphQueryInputChange:e,onRunQuery:a,graphQueryResult:n,pathFrom:l,onPathFromChange:u,pathTo:o,onPathToChange:c,onHighlightPath:v,pathResult:f,graphError:h,graph:g,onOpenPage:m,onNavigateNode:x}){return M.jsxs("section",{className:"panel","data-testid":"graph-tools",children:[M.jsx("h3",{className:"panel-heading",children:"Graph Tools"}),h?M.jsx("p",{className:"text-error",children:h}):null,M.jsxs("div",{className:"card-list",children:[M.jsxs("article",{className:"card",children:[M.jsx("span",{className:"label",children:"query"}),M.jsx("input",{type:"search",className:"input","data-testid":"graph-query-input","aria-label":"Graph query",value:t,onChange:b=>e(b.target.value),placeholder:"Ask a question about the graph\\u2026"}),M.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"graph-query-run",onClick:a,children:"Run"}),n?M.jsxs(M.Fragment,{children:[M.jsx("p",{className:"text-secondary text-sm",children:n.summary}),M.jsxs("div",{className:"chip-row",children:[n.hyperedgeIds.map(b=>g?.hyperedges?.find(E=>E.id===b)).filter(b=>!!b).slice(0,2).map(b=>M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{const E=b.nodeIds[0];E&&x(E)},children:b.label},b.id)),n.pageIds.map(b=>g?.pages?.find(E=>E.id===b)).filter(b=>!!b).slice(0,4).map(b=>M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{m(b.path,b.id)},children:b.title},b.id))]})]}):null]}),M.jsxs("article",{className:"card",children:[M.jsx("span",{className:"label",children:"path"}),M.jsx("input",{type:"text",className:"input","data-testid":"graph-path-from","aria-label":"Path from node",value:l,onChange:b=>u(b.target.value),placeholder:"From node ID or label\\u2026"}),M.jsx("input",{type:"text",className:"input","data-testid":"graph-path-to","aria-label":"Path to node",value:o,onChange:b=>c(b.target.value),placeholder:"To node ID or label\\u2026"}),M.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"graph-path-highlight",onClick:v,children:"Highlight"}),f?M.jsx("p",{className:"text-secondary text-sm","data-testid":"graph-path-summary",children:f.summary}):null]})]})]})}function q1(t){return t.dataUrl??`/api/asset?path=${encodeURIComponent(t.path)}`}function HN({activePage:t,pageError:e,backlinkPages:a,relatedPages:n,graphPageLinks:l,onOpenPage:u}){return M.jsxs("section",{className:"panel page-panel","data-testid":"page-preview",children:[M.jsx("h3",{className:"panel-heading",children:"Page Preview"}),e?M.jsx("p",{className:"text-error",children:e}):null,t?M.jsxs(M.Fragment,{children:[M.jsx("span",{className:"label",children:t.path}),M.jsx("h4",{className:"card-title",style:{margin:"4px 0 8px"},children:t.title}),M.jsxs("p",{className:"text-muted text-sm",children:[typeof t.frontmatter.kind=="string"?t.frontmatter.kind:"page"," /"," ",typeof t.frontmatter.status=="string"?t.frontmatter.status:"active"]}),typeof t.frontmatter.source_type=="string"?M.jsxs("p",{className:"text-muted text-sm",children:["Source: ",t.frontmatter.source_type]}):null,M.jsxs("p",{className:"text-muted text-sm",children:["Projects:"," ",Array.isArray(t.frontmatter.project_ids)&&t.frontmatter.project_ids.join(", ")||"Global"]}),M.jsx("p",{className:"text-secondary text-sm",children:t.content.replace(/\s+/g," ").trim().slice(0,220)}),t.assets.length?M.jsx("div",{className:"asset-preview",children:t.assets.map(o=>o.mimeType.startsWith("image/")?M.jsxs("figure",{className:"asset-card",children:[M.jsx("img",{src:q1(o),alt:t.title}),M.jsxs("figcaption",{children:[o.role," / ",o.mimeType]})]},o.id):M.jsxs("a",{className:"btn btn-ghost",href:q1(o),target:"_blank",rel:"noreferrer",children:["Open ",o.role]},o.id))}):null,a.length?M.jsxs("div",{className:"linked-section",children:[M.jsx("span",{className:"label",children:"Backlinks"}),M.jsx("div",{className:"chip-row",children:a.map(o=>M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{u(o.path,o.id)},children:o.title},o.id))})]}):null,n.length?M.jsxs("div",{className:"linked-section",children:[M.jsx("span",{className:"label",children:"Related Pages"}),M.jsx("div",{className:"chip-row",children:n.map(o=>M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{u(o.path,o.id)},children:o.title},o.id))})]}):null,l.length?M.jsxs("div",{className:"linked-section",children:[M.jsx("span",{className:"label",children:"Graph Reports"}),M.jsx("div",{className:"chip-row",children:l.slice(0,6).map(o=>M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{u(o.path,o.id)},children:o.title},o.id))})]}):null,M.jsx("pre",{className:"content-pre",children:t.content.slice(0,1200)}),t.content.length>1200?M.jsxs("span",{className:"content-truncation-note",children:["Showing first 1,200 of ",t.content.length.toLocaleString()," characters"]}):null]}):M.jsxs("div",{className:"empty-state",children:[M.jsx("span",{className:"empty-state-icon",children:"๐Ÿ“„"}),M.jsx("p",{className:"text-muted text-sm",children:"Open a search result, review entry, candidate, or graph node page."})]})]})}function GN({watchStatus:t,watchError:e}){return t?.pendingSemanticRefresh.length?M.jsxs("div",{children:[M.jsxs("p",{className:"text-muted text-sm",children:["Watched roots: ",t.watchedRepoRoots.length?t.watchedRepoRoots.join(", "):"none",t.lastRun?.finishedAt?` ยท Last run: ${new Date(t.lastRun.finishedAt).toLocaleString()}`:""]}),e?M.jsx("p",{className:"text-error",children:e}):null,M.jsx("div",{className:"card-list",children:t.pendingSemanticRefresh.slice(0,8).map(a=>M.jsxs("article",{className:"card",children:[M.jsx("span",{className:"label",children:a.changeType}),M.jsx("strong",{className:"card-title",children:a.path}),M.jsx("p",{className:"text-muted text-sm",children:a.sourceKind?`Kind: ${a.sourceKind}`:"Awaiting semantic refresh."})]},a.id))})]}):M.jsx("p",{className:"text-muted text-sm",children:"No files are pending semantic refresh."})}function Lw({tabs:t,activeTab:e,onTabChange:a,children:n}){const l=(u,o)=>{let c=o;if(u.key==="ArrowRight")c=(o+1)%t.length;else if(u.key==="ArrowLeft")c=(o-1+t.length)%t.length;else return;u.preventDefault(),a(t[c].id),u.currentTarget.parentElement?.children[c]?.focus()};return M.jsxs("div",{className:"tabs",children:[M.jsx("div",{className:"tab-bar",role:"tablist",children:t.map((u,o)=>M.jsxs("button",{id:`tab-${u.id}`,type:"button",role:"tab","aria-selected":e===u.id,"aria-controls":`tabpanel-${u.id}`,tabIndex:e===u.id?0:-1,className:`tab-btn${e===u.id?" is-active":""}`,onClick:()=>a(u.id),onKeyDown:c=>l(c,o),children:[u.label,u.count!=null&&u.count>0?M.jsx("span",{className:"tab-count",children:u.count}):null]},u.id))}),M.jsx("div",{id:`tabpanel-${e}`,className:"tab-panel",role:"tabpanel","aria-labelledby":`tab-${e}`,children:n})]})}function IN({graphReport:t,onOpenPage:e,onNavigateNode:a,onHighlightSurprise:n}){const[l,u]=qe.useState("overview");return t?M.jsx("div",{className:"report-tabs",children:M.jsxs(Lw,{tabs:[{id:"overview",label:"Overview"},{id:"surprising",label:"Surprising",count:t.surprisingConnections.length},{id:"patterns",label:"Patterns",count:t.groupPatterns.length},{id:"benchmark",label:"Benchmark"},{id:"sources",label:"Sources",count:t.recentResearchSources.length}],activeTab:l,onTabChange:u,children:[l==="overview"&&M.jsxs("div",{children:[M.jsxs("div",{className:"report-stats",children:[M.jsxs("span",{children:["Nodes ",M.jsx("strong",{children:t.overview.nodes})]}),M.jsxs("span",{children:["Edges ",M.jsx("strong",{children:t.overview.edges})]}),M.jsxs("span",{children:["Communities ",M.jsx("strong",{children:t.overview.communities})]})]}),M.jsx("div",{className:"report-stats",style:{marginTop:6},children:M.jsxs("span",{className:"text-muted",children:["1st-party: ",t.firstPartyOverview.nodes," nodes \\u00b7 ",t.firstPartyOverview.edges," edges \\u00b7"," ",t.firstPartyOverview.communities," communities"]})}),t.warnings.length?M.jsxs("div",{className:"linked-section",children:[M.jsx("span",{className:"label",children:"Warnings"}),M.jsx("div",{className:"card-list",children:t.warnings.map(o=>M.jsx("article",{className:"card card-warning",children:M.jsxs("p",{className:"text-sm",children:["โš "," ",o]})},o))})]}):null]}),l==="surprising"&&M.jsx("div",{children:t.surprisingConnections.length?M.jsx("div",{className:"card-list",children:t.surprisingConnections.map(o=>M.jsxs("article",{className:"card",children:[M.jsxs("div",{className:"surprise-row",children:[M.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:()=>n(o.sourceNodeId,o.targetNodeId),children:[o.sourceLabel," โ†’ ",o.targetLabel]}),M.jsx("span",{className:"text-mono text-sm",children:o.relation})]}),o.explanation?M.jsx("p",{className:"text-secondary text-sm",children:o.explanation}):null,o.confidence!=null?M.jsxs("span",{className:"text-muted text-sm",children:["confidence: ",o.confidence.toFixed(2)]}):null]},o.id))}):M.jsx("p",{className:"text-muted text-sm",children:"No surprising connections detected."})}),l==="patterns"&&M.jsxs("div",{children:[t.groupPatterns.length?M.jsx("div",{className:"card-list",children:t.groupPatterns.map(o=>M.jsxs("article",{className:"card",children:[M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{const c=o.nodeIds[0];c&&a(c)},children:o.label}),o.why?M.jsx("p",{className:"text-secondary text-sm",children:o.why}):null,M.jsxs("span",{className:"text-muted text-sm",children:[o.nodeIds.length," nodes \\u00b7 ",o.relation]})]},o.id))}):M.jsx("p",{className:"text-muted text-sm",children:"No group patterns detected."}),t.suggestedQuestions?.length?M.jsxs("div",{className:"linked-section",children:[M.jsx("span",{className:"label",children:"Suggested Questions"}),M.jsx("div",{className:"card-list",children:t.suggestedQuestions.map(o=>M.jsx("p",{className:"text-secondary text-sm",children:o},o))})]}):null]}),l==="benchmark"&&M.jsx("div",{children:t.benchmark?M.jsxs("div",{className:"meta-grid",children:[M.jsx("span",{className:"meta-label",children:"Status"}),M.jsx("span",{className:"meta-value",children:t.benchmark.stale?"Stale":"Fresh"}),M.jsx("span",{className:"meta-label",children:"Questions"}),M.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.questionCount}),M.jsx("span",{className:"meta-label",children:"Context tokens"}),M.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.finalContextTokens.toLocaleString()}),M.jsx("span",{className:"meta-label",children:"Naive corpus"}),M.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.naiveCorpusTokens.toLocaleString()}),M.jsx("span",{className:"meta-label",children:"Reduction"}),M.jsxs("span",{className:"meta-value mono",children:[(t.benchmark.summary.reductionRatio*100).toFixed(1),"%"]}),M.jsx("span",{className:"meta-label",children:"Unique visited"}),M.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.uniqueVisitedNodes})]}):M.jsx("p",{className:"text-muted text-sm",children:"No benchmark summary is available yet."})}),l==="sources"&&M.jsx("div",{children:t.recentResearchSources.length?M.jsx("div",{className:"card-list",children:t.recentResearchSources.map(o=>M.jsxs("article",{className:"card",children:[M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{e(o.path,o.pageId)},children:o.title}),M.jsxs("span",{className:"text-muted text-sm",children:[o.sourceType," \\u00b7 ",o.updatedAt?new Date(o.updatedAt).toLocaleDateString():""]})]},o.pageId))}):M.jsx("p",{className:"text-muted text-sm",children:"No recent research sources."})})]})}):M.jsx("div",{className:"report-tabs",children:M.jsx("div",{className:"report-tabs-empty",children:"Loading graph report..."})})}function YN(t,e){const a=e.trim();if(!a||a.length<2)return t;const n=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=new RegExp(`(${n})`,"gi"),u=t.split(l);if(u.length===1)return t;const o=a.toLowerCase();let c=0;return u.map(v=>{const f=`${c}:${v}`;return c+=v.length,v.toLowerCase()===o?M.jsx("mark",{children:v},f):M.jsx(qe.Fragment,{children:v},f)})}function FN({results:t,searchError:e,query:a,onOpenResult:n}){return M.jsxs("section",{className:"panel",children:[M.jsxs("h3",{className:"panel-heading",children:["Search Results",t.length>0?M.jsx("span",{className:"tab-count",children:t.length}):null]}),e?M.jsx("p",{className:"text-error",children:e}):null,t.length?M.jsx("div",{className:"card-list",children:t.map(l=>M.jsxs("button",{type:"button",className:"result-card",onClick:()=>{n(l)},children:[M.jsxs("span",{className:"label",children:[l.kind??"page"," / ",l.status??"active"]}),M.jsx("strong",{className:"card-title",children:l.title}),l.sourceType?M.jsxs("p",{className:"text-muted text-sm",children:["Source: ",l.sourceType]}):null,l.sourceClass?M.jsxs("p",{className:"text-muted text-sm",children:["Class: ",l.sourceClass]}):null,M.jsx("p",{className:"text-muted text-sm",children:l.projectIds.length?l.projectIds.join(", "):"global"}),M.jsx("p",{className:"text-secondary text-sm",children:YN(l.snippet,a)})]},`${l.pageId}:${l.path}`))}):M.jsx("div",{className:"empty-state",children:M.jsx("p",{className:"text-muted text-sm",children:a.trim().length>=2?"No pages matched this query.":"Search the wiki, outputs, or candidate pages."})})]})}function XN({selected:t,graphExplain:e,graphError:a,onNavigateNode:n}){if(!t)return M.jsxs("section",{className:"panel","data-selected-node-id":"","data-testid":"selection-panel",children:[M.jsx("h3",{className:"panel-heading",children:"Selection"}),M.jsxs("div",{className:"empty-state",children:[M.jsx("span",{className:"empty-state-icon",children:"โ—ˆ"}),M.jsx("p",{className:"text-muted text-sm",children:"Select a node to inspect graph metrics and linked pages."})]})]});const l=t.sourceIds.length>3?`${t.sourceIds.slice(0,3).join(", ")} +${t.sourceIds.length-3} more`:t.sourceIds.join(", ")||"None";return M.jsxs("section",{className:"panel","data-selected-node-id":t.id,"data-testid":"selection-panel",children:[M.jsx("h3",{className:"panel-heading",children:"Selection"}),a?M.jsx("p",{className:"text-error",children:a}):null,M.jsx("span",{className:"label",children:t.type}),M.jsx("h4",{className:"card-title",style:{margin:"4px 0 8px"},children:t.label}),M.jsxs("div",{className:"meta-grid",children:[M.jsx("span",{className:"meta-label",children:"ID"}),M.jsx("code",{className:"meta-value meta-value-truncate",title:t.id,children:t.id}),t.language?M.jsxs(M.Fragment,{children:[M.jsx("span",{className:"meta-label",children:"Language"}),M.jsx("span",{className:"meta-value",title:t.language,children:t.language})]}):null,t.symbolKind?M.jsxs(M.Fragment,{children:[M.jsx("span",{className:"meta-label",children:"Symbol"}),M.jsx("span",{className:"meta-value",title:t.symbolKind,children:t.symbolKind})]}):null,t.moduleId?M.jsxs(M.Fragment,{children:[M.jsx("span",{className:"meta-label",children:"Module"}),M.jsx("code",{className:"meta-value meta-value-truncate",title:t.moduleId,children:t.moduleId})]}):null,M.jsx("span",{className:"meta-label",children:"Sources"}),M.jsx("span",{className:"meta-value",title:t.sourceIds.join(", ")||"None",children:l}),M.jsx("span",{className:"meta-label",children:"Projects"}),M.jsx("span",{className:"meta-value",title:t.projectIds.join(", ")||"Global",children:t.projectIds.join(", ")||"Global"}),M.jsx("span",{className:"meta-label",children:"Community"}),M.jsx("span",{className:"meta-value",title:t.communityId??"Unassigned",children:t.communityId??"Unassigned"}),M.jsx("span",{className:"meta-label",children:"Degree"}),M.jsx("span",{className:"meta-value mono",children:t.degree??0}),M.jsx("span",{className:"meta-label",children:"Bridge"}),M.jsx("span",{className:"meta-value mono",children:t.bridgeScore??0}),M.jsx("span",{className:"meta-label",children:"God node"}),M.jsx("span",{className:"meta-value",children:t.isGodNode?"Yes":"No"})]}),e?.hyperedges.length?M.jsxs("div",{className:"linked-section",children:[M.jsx("span",{className:"label",children:"Group Patterns"}),M.jsx("div",{className:"chip-row",children:e.hyperedges.slice(0,6).map(u=>M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{const o=u.nodeIds.find(c=>c!==t.id)??u.nodeIds[0];o&&n(o)},children:u.label},u.id))}),e.hyperedges[0]?.why?M.jsx("p",{className:"text-secondary text-sm",children:e.hyperedges[0].why}):null]}):null,e?.neighbors.length?M.jsxs("div",{className:"linked-section",children:[M.jsx("span",{className:"label",children:"Neighbors"}),M.jsx("div",{className:"chip-row",children:e.neighbors.slice(0,8).map(u=>M.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>n(u.nodeId),children:u.label},`${u.direction}:${u.nodeId}:${u.relation}`))})]}):null]})}function KN({nodeCount:t,edgeCount:e,communityCount:a,approvalCount:n,candidateCount:l,pendingRefreshCount:u,benchmarkRatio:o}){const c=n+l+u;return M.jsxs("div",{className:"stats-strip",children:[M.jsxs("div",{className:"stats-group",children:[M.jsxs("div",{className:"stat",children:[M.jsx("span",{className:"stat-label",children:"Nodes"}),M.jsx("span",{className:"stat-value",children:t.toLocaleString()})]}),M.jsxs("div",{className:"stat",children:[M.jsx("span",{className:"stat-label",children:"Edges"}),M.jsx("span",{className:"stat-value",children:e.toLocaleString()})]}),M.jsxs("div",{className:"stat",children:[M.jsx("span",{className:"stat-label",children:"Communities"}),M.jsx("span",{className:"stat-value",children:a})]}),M.jsxs("div",{className:"stat",children:[M.jsx("span",{className:"stat-label",children:"Benchmark"}),M.jsx("span",{className:"stat-value",children:o!=null?`${(o*100).toFixed(1)}%`:"โ€”"})]})]}),c>0?M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"stats-divider"}),M.jsxs("div",{className:"stats-group",children:[n>0?M.jsxs("div",{className:"stat",children:[M.jsx("span",{className:"stat-label",children:"Approvals"}),M.jsx("span",{className:"stat-value",children:n})]}):null,l>0?M.jsxs("div",{className:"stat",children:[M.jsx("span",{className:"stat-label",children:"Candidates"}),M.jsx("span",{className:"stat-value",children:l})]}):null,u>0?M.jsxs("div",{className:"stat",children:[M.jsx("span",{className:"stat-label",children:"Refresh"}),M.jsx("span",{className:"stat-value",children:u})]}):null]})]}):null]})}function ir(){return typeof window<"u"?window.__SWARMVAULT_EMBEDDED_DATA__:void 0}function V1(t){return t.trim().toLowerCase()}function kw(t){return new Map(t.nodes.map(e=>[e.id,e]))}function ZN(t){return new Map((t.pages??[]).map(e=>[e.id,e]))}function Hh(t,e){const a=V1(e);return t.nodes.find(n=>n.id===e||V1(n.label)===a||n.pageId===e)??null}function _w(t){const e=new Map;for(const a of t.nodes)e.set(a.id,[]);for(const a of t.edges)e.get(a.source)?.push({nodeId:a.target,edge:a,direction:"outgoing"}),e.get(a.target)?.push({nodeId:a.source,edge:a,direction:"incoming"});return e}function QN(t,e,a){const n=Hh(t,e),l=Hh(t,a);if(!n||!l)return{from:e,to:a,resolvedFromNodeId:n?.id,resolvedToNodeId:l?.id,found:!1,nodeIds:[],edgeIds:[],pageIds:[],summary:"Could not resolve one or both graph targets."};const u=_w(t),o=[n.id],c=new Set([n.id]),v=new Map;for(;o.length;){const b=o.shift();if(b===l.id)break;for(const E of u.get(b)??[])c.has(E.nodeId)||(c.add(E.nodeId),v.set(E.nodeId,{nodeId:b,edgeId:E.edge.id}),o.push(E.nodeId))}if(!c.has(l.id))return{from:e,to:a,resolvedFromNodeId:n.id,resolvedToNodeId:l.id,found:!1,nodeIds:[],edgeIds:[],pageIds:[],summary:`No path found between ${n.label} and ${l.label}.`};const f=[],h=[];let g=l.id;for(;g!==n.id;){f.push(g);const b=v.get(g);if(!b)break;h.push(b.edgeId),g=b.nodeId}f.push(n.id),f.reverse(),h.reverse();const m=kw(t),x=[...new Set(f.flatMap(b=>{const E=m.get(b)?.pageId;return E?[E]:[]}))];return{from:e,to:a,resolvedFromNodeId:n.id,resolvedToNodeId:l.id,found:!0,nodeIds:f,edgeIds:h,pageIds:x,summary:f.map(b=>m.get(b)?.label??b).join(" -> ")}}function $N(t,e){const a=Hh(t,e);if(!a)throw new Error(`Could not resolve graph target: ${e}`);const n=ZN(t),l=a.pageId?n.get(a.pageId):void 0,u=kw(t),o=[];for(const f of _w(t).get(a.id)??[]){const h=u.get(f.nodeId);h&&o.push({nodeId:h.id,label:h.label,type:h.type,pageId:h.pageId,relation:f.edge.relation,direction:f.direction,confidence:f.edge.confidence??0,evidenceClass:f.edge.evidenceClass??"unknown"})}o.sort((f,h)=>h.confidence-f.confidence||f.label.localeCompare(h.label));const c=(t.hyperedges??[]).filter(f=>f.nodeIds.includes(a.id)),v=t.communities?.find(f=>f.id===a.communityId);return{target:e,node:a,page:l?{id:l.id,path:l.path,title:l.title}:void 0,community:v?{id:v.id,label:v.label}:void 0,neighbors:o,hyperedges:c,summary:[`Node: ${a.label}`,`Type: ${a.type}`,`Community: ${a.communityId??"none"}`,`Neighbors: ${o.length}`,`Group patterns: ${c.length}`,`Page: ${l?.path??"none"}`].join(`
330
- `)}}function El(t,e){const a=new Set,n=[];for(const l of t){const u=e(l);a.has(u)||(a.add(u),n.push(l))}return n}function xi(t,e){const a=t.trim().toLowerCase(),n=e.trim().toLowerCase();if(!a||!n)return 0;if(n===a)return 100;if(n.startsWith(a))return 80;if(n.includes(a))return 60;const l=a.split(/\s+/).filter(Boolean),u=new Set(n.split(/\s+/).filter(Boolean)),o=l.filter(c=>u.has(c)).length;return o?o*10:0}function WN(t,e,a,n){const l=n?.traversal??"bfs",u=Math.max(3,Math.min(n?.budget??12,50)),o=new Map((t.pages??[]).map(A=>[A.id,A])),v=a.map(A=>{const O=o.get(A.pageId),z=Math.max(xi(e,A.title),xi(e,A.path));return!O||z<=0?null:{type:"page",id:O.id,label:O.title,score:z}}).filter(A=>A!==null),f=t.nodes.map(A=>({type:"node",id:A.id,label:A.label,score:Math.max(xi(e,A.label),xi(e,A.id))})).filter(A=>A.score>0),h=(t.hyperedges??[]).map(A=>({type:"hyperedge",id:A.id,label:A.label,score:Math.max(xi(e,A.label),xi(e,A.why),xi(e,A.relation))})).filter(A=>A.score>0),g=El([...v,...f,...h],A=>`${A.type}:${A.id}`).sort((A,O)=>O.score-A.score||A.label.localeCompare(O.label)).slice(0,12),m=El([...a.flatMap(A=>o.get(A.pageId)?.nodeIds??[]),...g.filter(A=>A.type==="page").flatMap(A=>o.get(A.id)?.nodeIds??[]),...g.filter(A=>A.type==="node").map(A=>A.id),...g.filter(A=>A.type==="hyperedge").flatMap(A=>(t.hyperedges??[]).find(O=>O.id===A.id)?.nodeIds??[])],A=>A).filter(Boolean),x=new Map,b=(A,O)=>{x.has(A)||x.set(A,[]),x.get(A)?.push(O)};for(const A of t.edges)b(A.source,{edge:A,nodeId:A.target,direction:"outgoing"}),b(A.target,{edge:A,nodeId:A.source,direction:"incoming"});for(const[A,O]of x.entries())O.sort((z,U)=>(U.edge.confidence??0)-(z.edge.confidence??0)||z.edge.relation.localeCompare(U.edge.relation)),x.set(A,O);const E=[],S=new Set,w=new Set,T=[...m];for(;T.length&&E.length<u;){const A=l==="dfs"?T.pop():T.shift();if(!(!A||w.has(A))){w.add(A),E.push(A);for(const O of x.get(A)??[])if(S.add(O.edge.id),w.has(O.nodeId)||T.push(O.nodeId),E.length+T.length>=u*2)break}}const C=new Map(t.nodes.map(A=>[A.id,A])),B=El([...a.map(A=>A.pageId),...g.filter(A=>A.type==="page").map(A=>A.id),...E.flatMap(A=>{const O=C.get(A);return O?.pageId?[O.pageId]:[]})],A=>A),R=El(E.map(A=>C.get(A)?.communityId).filter(A=>!!A),A=>A),L=El((t.hyperedges??[]).filter(A=>A.nodeIds.some(O=>E.includes(O))).map(A=>A.id),A=>A);return{question:e,traversal:l,seedNodeIds:m,seedPageIds:El([...a.map(A=>A.pageId),...g.filter(A=>A.type==="page").map(A=>A.id)],A=>A),visitedNodeIds:E,visitedEdgeIds:[...S],hyperedgeIds:L,pageIds:B,communities:R,matches:g,summary:[`Seeds: ${m.join(", ")||"none"}`,`Visited nodes: ${E.length}`,`Visited edges: ${S.size}`,`Touched group patterns: ${L.length}`,`Communities: ${R.join(", ")||"none"}`,`Pages: ${B.join(", ")||"none"}`].join(`
331
- `)}}function JN(t,e){const a=t.replace(/\s+/g," ").trim();if(!e)return a.slice(0,160);const n=a.toLowerCase().indexOf(e.toLowerCase());if(n<0)return a.slice(0,160);const l=Math.max(0,n-50),u=Math.min(a.length,n+Math.max(e.length,40));return`${l>0?"...":""}${a.slice(l,u)}${u<a.length?"...":""}`}async function eM(t="/api/graph",e){const a=ir();if(a)return a.graph;const n=await fetch(t,e);if(!n.ok)throw new Error(`Failed to load graph artifact: ${n.status} ${n.statusText}`);return n.json()}async function qw(t,e={}){const a=ir(),n=e.limit??10,l=e.kind??"all",u=e.status??"all",o=e.project??"all",c=e.sourceType??"all",v=e.sourceClass??"all";if(a){const g=t.trim().toLowerCase();return g?a.pages.filter(m=>l==="all"?!0:m.kind===l).filter(m=>u==="all"?!0:m.status===u).filter(m=>o==="all"?!0:o==="unassigned"?m.projectIds.length===0:m.projectIds.includes(o)).filter(m=>c==="all"?!0:(m.sourceType??"")===c).filter(m=>v==="all"?!0:(m.sourceClass??"")===v).map(m=>{const x=`${m.title}
332
- ${m.content}`.toLowerCase(),b=x.includes(g)?x.indexOf(g):Number.POSITIVE_INFINITY;return{pageId:m.pageId,path:m.path,title:m.title,snippet:JN(m.content,t),rank:b,kind:m.kind,status:m.status,projectIds:m.projectIds,sourceType:m.sourceType,sourceClass:m.sourceClass}}).filter(m=>Number.isFinite(m.rank)).sort((m,x)=>m.rank-x.rank||m.title.localeCompare(x.title)).slice(0,n):[]}const f=new URLSearchParams({q:t,limit:String(n),kind:l,status:u,project:o,sourceType:c,sourceClass:v}),h=await fetch(`/api/search?${f.toString()}`);if(!h.ok)throw new Error(`Failed to search pages: ${h.status} ${h.statusText}`);return h.json()}async function U1(t){const e=ir();if(e){const n=e.pages.find(l=>l.path===t);if(!n)throw new Error(`Page not found: ${t}`);return{path:n.path,title:n.title,frontmatter:{page_id:n.pageId,kind:n.kind,status:n.status,project_ids:n.projectIds,source_type:n.sourceType,source_class:n.sourceClass},content:n.content,assets:n.assets??[]}}const a=await fetch(`/api/page?path=${encodeURIComponent(t)}`);if(!a.ok)throw new Error(`Failed to load page: ${a.status} ${a.statusText}`);return a.json()}async function tM(t,e={}){const a=ir();if(a){const u=await qw(t,{limit:10});return WN(a.graph,t,u,e)}const n=new URLSearchParams({q:t,traversal:e.traversal??"bfs",budget:String(e.budget??12)}),l=await fetch(`/api/graph/query?${n.toString()}`);if(!l.ok)throw new Error(`Failed to query graph: ${l.status} ${l.statusText}`);return l.json()}async function aM(){const t=ir();if(t)return t.report??null;const e=await fetch("/api/graph-report");if(e.status===404)return null;if(!e.ok)throw new Error(`Failed to load graph report: ${e.status} ${e.statusText}`);return e.json()}async function j1(t,e){const a=ir();if(a)return QN(a.graph,t,e);const n=new URLSearchParams({from:t,to:e}),l=await fetch(`/api/graph/path?${n.toString()}`);if(!l.ok)throw new Error(`Failed to find graph path: ${l.status} ${l.statusText}`);return l.json()}async function rM(t){const e=ir();if(e)return $N(e.graph,t);const a=await fetch(`/api/graph/explain?target=${encodeURIComponent(t)}`);if(!a.ok)throw new Error(`Failed to explain graph target: ${a.status} ${a.statusText}`);return a.json()}async function nM(){if(ir())return[];const t=await fetch("/api/reviews");if(!t.ok)throw new Error(`Failed to load approvals: ${t.status} ${t.statusText}`);return t.json()}async function P1(t){if(ir())throw new Error("Review actions are unavailable in standalone exports.");const e=await fetch(`/api/review?id=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Failed to load approval detail: ${e.status} ${e.statusText}`);return e.json()}async function iM(t,e,a=[]){if(ir())throw new Error("Review actions are unavailable in standalone exports.");const n=await fetch(`/api/review?action=${e}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({approvalId:t,targets:a})});if(!n.ok)throw new Error(`Failed to ${e} review entries: ${n.status} ${n.statusText}`);return n.json()}async function lM(){if(ir())return[];const t=await fetch("/api/candidates");if(!t.ok)throw new Error(`Failed to load candidates: ${t.status} ${t.statusText}`);return t.json()}async function uM(t,e){if(ir())throw new Error("Candidate actions are unavailable in standalone exports.");const a=await fetch(`/api/candidate?action=${e}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})});if(!a.ok)throw new Error(`Failed to ${e} candidate: ${a.status} ${a.statusText}`);return a.json()}async function sM(){if(ir())return{generatedAt:"",watchedRepoRoots:[],pendingSemanticRefresh:[]};const t=await fetch("/api/watch-status");if(!t.ok)throw new Error(`Failed to load watch status: ${t.status} ${t.statusText}`);return t.json()}function Tl(t){return[...new Set(t.filter(Boolean))]}function oM(){return{generatedAt:"",nodes:[],edges:[],hyperedges:[],communities:[],pages:[]}}function cM(){const t=qe.useRef(null),[e,a]=qe.useState(null),[n,l]=qe.useState(null),[u,o]=qe.useState("all"),[c,v]=qe.useState("all"),[f,h]=qe.useState("all"),[g,m]=qe.useState("all"),[x,b]=qe.useState("all"),[E,S]=qe.useState("all"),[w,T]=qe.useState("all"),[C,B]=qe.useState(""),[R,L]=qe.useState([]),[A,O]=qe.useState(null),[z,U]=qe.useState(""),[V,P]=qe.useState(null),[H,I]=qe.useState(""),[F,_]=qe.useState(""),[j,Y]=qe.useState(null),[Q,W]=qe.useState(null),[N,G]=qe.useState(null),[Z,$]=qe.useState(null),[ae,se]=qe.useState(null),[de,Se]=qe.useState(null),[fe,te]=qe.useState([]),[re,le]=qe.useState(null),[he,Ee]=qe.useState(""),[ke,at]=qe.useState(null),[Xe,He]=qe.useState([]),[Ue,Ae]=qe.useState(null),[Ve,Pe]=qe.useState(null),[Qe,Be]=qe.useState(null),[et,rt]=qe.useState(null),[vt,ut]=qe.useState(""),[ot,Ye]=qe.useState("approvals"),[Me,pe]=qe.useState(!0),q=qe.useDeferredValue(C),ee=N&&e?e.pages?.find(xe=>xe.path===N.path||xe.id===(typeof N.frontmatter.page_id=="string"?N.frontmatter.page_id:""))??null:null,ce=Tl(e?.pages?.flatMap(xe=>xe.projectIds??[])??[]).sort((xe,Te)=>xe.localeCompare(Te)),oe=Tl(e?.pages?.flatMap(xe=>xe.kind==="source"&&xe.sourceType?[xe.sourceType]:[]).sort((xe,Te)=>xe.localeCompare(Te))??[]),me=Tl(e?.pages?.flatMap(xe=>xe.sourceClass?[xe.sourceClass]:[]).sort((xe,Te)=>xe.localeCompare(Te))??[]),Re=Tl((e?.communities??[]).map(xe=>xe.id)).sort((xe,Te)=>xe.localeCompare(Te)),we=ee?Tl(ee.backlinks).map(xe=>e?.pages?.find(Te=>Te.id===xe)??null).filter(xe=>!!xe):[],ze=ee?Tl(ee.relatedPageIds).map(xe=>e?.pages?.find(Te=>Te.id===xe)??null).filter(xe=>!!xe):[],Ne=e?.pages?.filter(xe=>xe.kind==="graph_report"||xe.kind==="community_summary")??[],_e=e?.presentation,We=_e?.mode==="overview",$e=qe.useCallback(async()=>{let xe=null,Te=null,Ke=null,gt=null;const[da,Ot,_t,$t]=await Promise.all([eM().catch(()=>oM()),nM().catch(qt=>(xe=qt instanceof Error?qt.message:String(qt),[])),lM().catch(qt=>(Te=qt instanceof Error?qt.message:String(qt),[])),sM().catch(qt=>(Ke=qt instanceof Error?qt.message:String(qt),{generatedAt:"",watchedRepoRoots:[],pendingSemanticRefresh:[]}))]);gt=await aM().catch(()=>null),qe.startTransition(()=>{a(da),O(gt),te(Ot),He(_t),Ae($t),at(xe),Pe(Te),Be(Ke),pe(!1)})},[]);qe.useEffect(()=>{$e()},[$e]),qe.useEffect(()=>{if(!fe.length){Ee(""),le(null);return}(!he||!fe.some(xe=>xe.approvalId===he))&&Ee(fe[0]?.approvalId??"")},[fe,he]),qe.useEffect(()=>{if(!he)return;let xe=!1;return P1(he).then(Te=>{xe||(le(Te),at(null))}).catch(Te=>{xe||at(Te instanceof Error?Te.message:String(Te))}),()=>{xe=!0}},[he]),qe.useEffect(()=>{if(!n){W(null);return}let xe=!1;return rM(n.id).then(Te=>{xe||(W(Te),Se(null))}).catch(Te=>{xe||Se(Te instanceof Error?Te.message:String(Te))}),()=>{xe=!0}},[n]),qe.useEffect(()=>{const xe=q.trim();if(xe.length<2){L([]),se(null);return}let Te=!1;return qw(xe,{limit:10,kind:c,status:f,project:g,sourceType:E,sourceClass:w}).then(Ke=>{Te||qe.startTransition(()=>{L(Ke),se(null)})}).catch(Ke=>{Te||se(Ke instanceof Error?Ke.message:String(Ke))}),()=>{Te=!0}},[q,c,f,g,E,w]),qe.useEffect(()=>{if(!n?.pageId)return;const xe=e?.pages?.find(Ke=>Ke.id===n.pageId);if(!xe)return;let Te=!1;return U1(xe.path).then(Ke=>{Te||(G(Ke),$(null))}).catch(Ke=>{Te||$(Ke instanceof Error?Ke.message:String(Ke))}),()=>{Te=!0}},[e,n]);const De=async(xe,Te)=>{try{const Ke=await U1(xe);if(G(Ke),$(null),e&&t.current){const gt=e.pages?.find(Ot=>Ot.path===xe||(Te?Ot.id===Te:!1)),da=(Te?e.nodes.find(Ot=>Ot.pageId===Te):void 0)??e.nodes.find(Ot=>gt?.nodeIds?.includes(Ot.id));da&&(t.current.elements().unselect(),t.current.getElementById(da.id).select(),t.current.center(t.current.getElementById(da.id)))}}catch(Ke){$(Ke instanceof Error?Ke.message:String(Ke))}},it=async xe=>{await De(xe.path,xe.pageId)},tt=async(xe,Te)=>{if(he){ut(`${Te}:${xe}`),rt(null);try{await iM(he,Te,[xe]),await $e();const Ke=await P1(he);le(Ke)}catch(Ke){rt(Ke instanceof Error?Ke.message:String(Ke))}finally{ut("")}}},jt=async(xe,Te,Ke)=>{ut(`${Te}:${xe}`),rt(null);try{const gt=await uM(xe,Te);await $e(),Te==="promote"?await De(gt.path,gt.pageId):Ke&&G(null)}catch(gt){rt(gt instanceof Error?gt.message:String(gt))}finally{ut("")}},Et=async()=>{if(!z.trim()){P(null);return}try{const xe=await tM(z,{budget:12});P(xe),Se(null)}catch(xe){Se(xe instanceof Error?xe.message:String(xe))}},ua=async()=>{if(!H.trim()||!F.trim()){Y(null);return}try{const xe=await j1(H,F);Y(xe),Se(null)}catch(xe){Se(xe instanceof Error?xe.message:String(xe))}},zt=qe.useCallback(xe=>{const Te=t.current?.getElementById(xe);Te&&(t.current?.elements().unselect(),Te.select(),t.current?.center(Te))},[]),Ft=qe.useCallback(async(xe,Te)=>{I(xe),_(Te);try{const Ke=await j1(xe,Te);Y(Ke),Se(null)}catch(Ke){Se(Ke instanceof Error?Ke.message:String(Ke))}},[]);return M.jsxs("div",{className:"app-shell",children:[M.jsxs("header",{className:"app-bar",children:[M.jsx("span",{className:"app-bar-title",children:"SwarmVault"}),M.jsx("span",{className:"app-bar-subtitle",children:"Graph Viewer"})]}),M.jsx(sE,{edgeStatusFilter:u,onEdgeStatusChange:o,kindFilter:c,onKindChange:v,pageStatusFilter:f,onPageStatusChange:h,projectFilter:g,onProjectChange:m,projectOptions:ce,sourceTypeFilter:E,onSourceTypeChange:S,sourceTypeOptions:oe,sourceClassFilter:w,onSourceClassChange:T,sourceClassOptions:me,communityFilter:x,onCommunityChange:b,communityOptions:Re,query:C,onQueryChange:B}),M.jsxs("div",{className:"center-area",children:[M.jsx(KN,{generatedAt:e?.generatedAt??null,nodeCount:_e?.totalNodes??e?.nodes.length??0,edgeCount:_e?.totalEdges??e?.edges.length??0,communityCount:_e?.totalCommunities??e?.communities?.length??0,approvalCount:fe.reduce((xe,Te)=>xe+Te.pendingCount,0),candidateCount:Xe.length,pendingRefreshCount:Ue?.pendingSemanticRefresh.length??0,benchmarkRatio:A?.benchmark?.summary.reductionRatio??null}),We?M.jsxs("div",{className:"overview-banner","data-testid":"graph-overview-banner",children:["Overview mode: showing ",_e?.displayedNodes.toLocaleString()," of ",_e?.totalNodes.toLocaleString()," ","nodes. Use ",M.jsx("code",{children:"--full"})," to render the entire graph."]}):null,Me&&!e?M.jsx("div",{className:"canvas canvas-loading",children:M.jsx("span",{className:"loading-text",children:"Loading graph data\\u2026"})}):!Me&&e&&e.nodes.length===0?M.jsxs("div",{className:"canvas canvas-loading canvas-empty",children:[M.jsx("span",{className:"canvas-empty-icon",children:"โ—ˆ"}),M.jsx("span",{className:"text-muted",children:"No nodes in the current graph view."})]}):M.jsx(jN,{graph:e,edgeStatusFilter:u,communityFilter:x,sourceClassFilter:w,pathResult:j,onNodeSelect:l,cyRef:t}),M.jsx(IN,{graphReport:A,onOpenPage:De,onNavigateNode:zt,onHighlightSurprise:Ft})]}),M.jsxs("aside",{className:"detail-rail",children:[M.jsx(PN,{graphQueryInput:z,onGraphQueryInputChange:U,onRunQuery:()=>{Et()},graphQueryResult:V,pathFrom:H,onPathFromChange:I,pathTo:F,onPathToChange:_,onHighlightPath:()=>{ua()},pathResult:j,graphError:de,graph:e,onOpenPage:De,onNavigateNode:zt}),M.jsx(XN,{selected:n,graphExplain:Q,graphError:de,onNavigateNode:zt}),M.jsx(FN,{results:R,searchError:ae,query:C,onOpenResult:it}),M.jsxs(Lw,{tabs:[{id:"approvals",label:"Approvals",count:fe.reduce((xe,Te)=>xe+Te.pendingCount,0)},{id:"candidates",label:"Candidates",count:Xe.length},{id:"refresh",label:"Refresh",count:Ue?.pendingSemanticRefresh.length??0}],activeTab:ot,onTabChange:Ye,children:[ot==="approvals"&&M.jsx(iE,{approvals:fe,selectedApprovalId:he,onSelectApproval:Ee,approvalDetail:re,approvalError:ke,actionError:et,busyAction:vt,onReviewAction:(xe,Te)=>{tt(xe,Te)},onOpenPage:De}),ot==="candidates"&&M.jsx(uE,{candidates:Xe,candidateError:Ve,busyAction:vt,onCandidateAction:(xe,Te,Ke)=>{jt(xe,Te,Ke)},onOpenPage:De}),ot==="refresh"&&M.jsx(GN,{watchStatus:Ue,watchError:Qe})]}),M.jsx(HN,{activePage:N,pageError:Z,backlinkPages:we,relatedPages:ze,graphPageLinks:Ne,onOpenPage:De})]})]})}tE.createRoot(document.getElementById("root")).render(M.jsx(X2.StrictMode,{children:M.jsx(cM,{})}));