@swarmvaultai/viewer 0.1.18 → 0.1.21
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.
- package/dist/assets/index-DEETVhXx.js +330 -0
- package/dist/index.html +1 -1
- package/dist/lib.d.ts +94 -1
- package/dist/lib.js +48 -0
- package/package.json +1 -1
- package/dist/assets/index-sMKSYq5V.js +0 -330
|
@@ -1,330 +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 q1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qv={exports:{}},Bu={};var Zm;function kS(){if(Zm)return Bu;Zm=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 f in l)f!=="key"&&(u[f]=l[f])}else u=l;return l=u.ref,{$$typeof:t,type:n,key:o,ref:l!==void 0?l:null,props:u}}return Bu.Fragment=e,Bu.jsx=a,Bu.jsxs=a,Bu}var Qm;function _S(){return Qm||(Qm=1,qv.exports=kS()),qv.exports}var fe=_S(),Vv={exports:{}},Qe={};var Jm;function qS(){if(Jm)return Qe;Jm=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"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function E(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function S(M,G,Z){this.props=M,this.context=G,this.refs=x,this.updater=Z||b}S.prototype.isReactComponent={},S.prototype.setState=function(M,G){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,G,"setState")},S.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function T(){}T.prototype=S.prototype;function C(M,G,Z){this.props=M,this.context=G,this.refs=x,this.updater=Z||b}var D=C.prototype=new T;D.constructor=C,w(D,S.prototype),D.isPureReactComponent=!0;var R=Array.isArray;function z(){}var B={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function _(M,G,Z){var W=Z.ref;return{$$typeof:t,type:M,key:G,ref:W!==void 0?W:null,props:Z}}function U(M,G){return _(M.type,G,M.props)}function V(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function q(M){var G={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Z){return G[Z]})}var P=/\/+/g;function Y(M,G){return typeof M=="object"&&M!==null&&M.key!=null?q(""+M.key):G.toString(36)}function I(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(z,z):(M.status="pending",M.then(function(G){M.status==="pending"&&(M.status="fulfilled",M.value=G)},function(G){M.status==="pending"&&(M.status="rejected",M.reason=G)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function L(M,G,Z,W,ae){var se=typeof M;(se==="undefined"||se==="boolean")&&(M=null);var he=!1;if(M===null)he=!0;else switch(se){case"bigint":case"string":case"number":he=!0;break;case"object":switch(M.$$typeof){case t:case e:he=!0;break;case h:return he=M._init,L(he(M._payload),G,Z,W,ae)}}if(he)return ae=ae(M),he=W===""?"."+Y(M,0):W,R(ae)?(Z="",he!=null&&(Z=he.replace(P,"$&/")+"/"),L(ae,G,Z,"",function($){return $})):ae!=null&&(V(ae)&&(ae=U(ae,Z+(ae.key==null||M&&M.key===ae.key?"":(""+ae.key).replace(P,"$&/")+"/")+he)),G.push(ae)),1;he=0;var we=W===""?".":W+":";if(R(M))for(var de=0;de<M.length;de++)W=M[de],se=we+Y(W,de),he+=L(W,G,Z,se,ae);else if(de=E(M),typeof de=="function")for(M=de.call(M),de=0;!(W=M.next()).done;)W=W.value,se=we+Y(W,de++),he+=L(W,G,Z,se,ae);else if(se==="object"){if(typeof M.then=="function")return L(I(M),G,Z,W,ae);throw G=String(M),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return he}function H(M,G,Z){if(M==null)return M;var W=[],ae=0;return L(M,W,"","",function(se){return G.call(Z,se,ae++)}),W}function F(M){if(M._status===-1){var G=M._result;G=G(),G.then(function(Z){(M._status===0||M._status===-1)&&(M._status=1,M._result=Z)},function(Z){(M._status===0||M._status===-1)&&(M._status=2,M._result=Z)}),M._status===-1&&(M._status=0,M._result=G)}if(M._status===1)return M._result.default;throw M._result}var Q=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},J={map:H,forEach:function(M,G,Z){H(M,function(){G.apply(this,arguments)},Z)},count:function(M){var G=0;return H(M,function(){G++}),G},toArray:function(M){return H(M,function(G){return G})||[]},only:function(M){if(!V(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Qe.Activity=g,Qe.Children=J,Qe.Component=S,Qe.Fragment=a,Qe.Profiler=l,Qe.PureComponent=C,Qe.StrictMode=n,Qe.Suspense=d,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(M){return B.H.useMemoCache(M)}},Qe.cache=function(M){return function(){return M.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(M,G,Z){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var W=w({},M.props),ae=M.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||(W[se]=G[se]);var se=arguments.length-2;if(se===1)W.children=Z;else if(1<se){for(var he=Array(se),we=0;we<se;we++)he[we]=arguments[we+2];W.children=he}return _(M.type,ae,W)},Qe.createContext=function(M){return M={$$typeof:o,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:u,_context:M},M},Qe.createElement=function(M,G,Z){var W,ae={},se=null;if(G!=null)for(W in G.key!==void 0&&(se=""+G.key),G)O.call(G,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ae[W]=G[W]);var he=arguments.length-2;if(he===1)ae.children=Z;else if(1<he){for(var we=Array(he),de=0;de<he;de++)we[de]=arguments[de+2];ae.children=we}if(M&&M.defaultProps)for(W in he=M.defaultProps,he)ae[W]===void 0&&(ae[W]=he[W]);return _(M,se,ae)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(M){return{$$typeof:f,render:M}},Qe.isValidElement=V,Qe.lazy=function(M){return{$$typeof:h,_payload:{_status:-1,_result:M},_init:F}},Qe.memo=function(M,G){return{$$typeof:c,type:M,compare:G===void 0?null:G}},Qe.startTransition=function(M){var G=B.T,Z={};B.T=Z;try{var W=M(),ae=B.S;ae!==null&&ae(Z,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(z,Q)}catch(se){Q(se)}finally{G!==null&&Z.types!==null&&(G.types=Z.types),B.T=G}},Qe.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Qe.use=function(M){return B.H.use(M)},Qe.useActionState=function(M,G,Z){return B.H.useActionState(M,G,Z)},Qe.useCallback=function(M,G){return B.H.useCallback(M,G)},Qe.useContext=function(M){return B.H.useContext(M)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(M,G){return B.H.useDeferredValue(M,G)},Qe.useEffect=function(M,G){return B.H.useEffect(M,G)},Qe.useEffectEvent=function(M){return B.H.useEffectEvent(M)},Qe.useId=function(){return B.H.useId()},Qe.useImperativeHandle=function(M,G,Z){return B.H.useImperativeHandle(M,G,Z)},Qe.useInsertionEffect=function(M,G){return B.H.useInsertionEffect(M,G)},Qe.useLayoutEffect=function(M,G){return B.H.useLayoutEffect(M,G)},Qe.useMemo=function(M,G){return B.H.useMemo(M,G)},Qe.useOptimistic=function(M,G){return B.H.useOptimistic(M,G)},Qe.useReducer=function(M,G,Z){return B.H.useReducer(M,G,Z)},Qe.useRef=function(M){return B.H.useRef(M)},Qe.useState=function(M){return B.H.useState(M)},Qe.useSyncExternalStore=function(M,G,Z){return B.H.useSyncExternalStore(M,G,Z)},Qe.useTransition=function(){return B.H.useTransition()},Qe.version="19.2.4",Qe}var Wm;function Hh(){return Wm||(Wm=1,Vv.exports=qS()),Vv.exports}var pt=Hh();const VS=q1(pt);var Uv={exports:{}},Mu={},Hv={exports:{}},Pv={};var $m;function US(){return $m||($m=1,(function(t){function e(L,H){var F=L.length;L.push(H);e:for(;0<F;){var Q=F-1>>>1,J=L[Q];if(0<l(J,H))L[Q]=H,L[F]=J,F=Q;else break e}}function a(L){return L.length===0?null:L[0]}function n(L){if(L.length===0)return null;var H=L[0],F=L.pop();if(F!==H){L[0]=F;e:for(var Q=0,J=L.length,M=J>>>1;Q<M;){var G=2*(Q+1)-1,Z=L[G],W=G+1,ae=L[W];if(0>l(Z,F))W<J&&0>l(ae,Z)?(L[Q]=ae,L[W]=F,Q=W):(L[Q]=Z,L[G]=F,Q=G);else if(W<J&&0>l(ae,F))L[Q]=ae,L[W]=F,Q=W;else break e}}return H}function l(L,H){var F=L.sortIndex-H.sortIndex;return F!==0?F:L.id-H.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,f=o.now();t.unstable_now=function(){return o.now()-f}}var d=[],c=[],h=1,g=null,y=3,E=!1,b=!1,w=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function D(L){for(var H=a(c);H!==null;){if(H.callback===null)n(c);else if(H.startTime<=L)n(c),H.sortIndex=H.expirationTime,e(d,H);else break;H=a(c)}}function R(L){if(w=!1,D(L),!b)if(a(d)!==null)b=!0,z||(z=!0,q());else{var H=a(c);H!==null&&I(R,H.startTime-L)}}var z=!1,B=-1,O=5,_=-1;function U(){return x?!0:!(t.unstable_now()-_<O)}function V(){if(x=!1,z){var L=t.unstable_now();_=L;var H=!0;try{e:{b=!1,w&&(w=!1,T(B),B=-1),E=!0;var F=y;try{t:{for(D(L),g=a(d);g!==null&&!(g.expirationTime>L&&U());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,y=g.priorityLevel;var J=Q(g.expirationTime<=L);if(L=t.unstable_now(),typeof J=="function"){g.callback=J,D(L),H=!0;break t}g===a(d)&&n(d),D(L)}else n(d);g=a(d)}if(g!==null)H=!0;else{var M=a(c);M!==null&&I(R,M.startTime-L),H=!1}}break e}finally{g=null,y=F,E=!1}H=void 0}}finally{H?q():z=!1}}}var q;if(typeof C=="function")q=function(){C(V)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,Y=P.port2;P.port1.onmessage=V,q=function(){Y.postMessage(null)}}else q=function(){S(V,0)};function I(L,H){B=S(function(){L(t.unstable_now())},H)}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(L){L.callback=null},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(L){switch(y){case 1:case 2:case 3:var H=3;break;default:H=y}var F=y;y=H;try{return L()}finally{y=F}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(L,H){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var F=y;y=L;try{return H()}finally{y=F}},t.unstable_scheduleCallback=function(L,H,F){var Q=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?Q+F:Q):F=Q,L){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=F+J,L={id:h++,callback:H,priorityLevel:L,startTime:F,expirationTime:J,sortIndex:-1},F>Q?(L.sortIndex=F,e(c,L),a(d)===null&&L===a(c)&&(w?(T(B),B=-1):w=!0,I(R,F-Q))):(L.sortIndex=J,e(d,L),b||E||(b=!0,z||(z=!0,q()))),L},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(L){var H=y;return function(){var F=y;y=H;try{return L.apply(this,arguments)}finally{y=F}}}})(Pv)),Pv}var e0;function HS(){return e0||(e0=1,Hv.exports=US()),Hv.exports}var Gv={exports:{}},Ma={};var t0;function PS(){if(t0)return Ma;t0=1;var t=Hh();function e(d){var c="https://react.dev/errors/"+d;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+d+"; visit "+c+" 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(d,c,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:d,containerInfo:c,implementation:h}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,c){if(d==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return Ma.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Ma.createPortal=function(d,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(e(299));return u(d,c,null,h)},Ma.flushSync=function(d){var c=o.T,h=n.p;try{if(o.T=null,n.p=2,d)return d()}finally{o.T=c,n.p=h,n.d.f()}},Ma.preconnect=function(d,c){typeof d=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,n.d.C(d,c))},Ma.prefetchDNS=function(d){typeof d=="string"&&n.d.D(d)},Ma.preinit=function(d,c){if(typeof d=="string"&&c&&typeof c.as=="string"){var h=c.as,g=f(h,c.crossOrigin),y=typeof c.integrity=="string"?c.integrity:void 0,E=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;h==="style"?n.d.S(d,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:E}):h==="script"&&n.d.X(d,{crossOrigin:g,integrity:y,fetchPriority:E,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},Ma.preinitModule=function(d,c){if(typeof d=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var h=f(c.as,c.crossOrigin);n.d.M(d,{crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&n.d.M(d)},Ma.preload=function(d,c){if(typeof d=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var h=c.as,g=f(h,c.crossOrigin);n.d.L(d,h,{crossOrigin:g,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},Ma.preloadModule=function(d,c){if(typeof d=="string")if(c){var h=f(c.as,c.crossOrigin);n.d.m(d,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else n.d.m(d)},Ma.requestFormReset=function(d){n.d.r(d)},Ma.unstable_batchedUpdates=function(d,c){return d(c)},Ma.useFormState=function(d,c,h){return o.H.useFormState(d,c,h)},Ma.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ma.version="19.2.4",Ma}var a0;function GS(){if(a0)return Gv.exports;a0=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(),Gv.exports=PS(),Gv.exports}var r0;function YS(){if(r0)return Mu;r0=1;var t=HS(),e=Hh(),a=GS();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 f(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 d(r){if(u(r)!==r)throw Error(n(188))}function c(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,v=i;;){var p=s.return;if(p===null)break;var m=p.alternate;if(m===null){if(v=p.return,v!==null){s=v;continue}break}if(p.child===m.child){for(m=p.child;m;){if(m===s)return d(p),r;if(m===v)return d(p),i;m=m.sibling}throw Error(n(188))}if(s.return!==v.return)s=p,v=m;else{for(var A=!1,N=p.child;N;){if(N===s){A=!0,s=p,v=m;break}if(N===v){A=!0,v=p,s=m;break}N=N.sibling}if(!A){for(N=m.child;N;){if(N===s){A=!0,s=m,v=p;break}if(N===v){A=!0,v=m,s=p;break}N=N.sibling}if(!A)throw Error(n(189))}}if(s.alternate!==v)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,y=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),C=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function q(r){return r===null||typeof r!="object"?null:(r=V&&r[V]||r["@@iterator"],typeof r=="function"?r:null)}var P=Symbol.for("react.client.reference");function Y(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===P?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case S:return"Profiler";case x:return"StrictMode";case R:return"Suspense";case z:return"SuspenseList";case _: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 D:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case B:return i=r.displayName||null,i!==null?i:Y(r.type)||"Memo";case O:i=r._payload,r=r._init;try{return Y(r(i))}catch{}}return null}var I=Array.isArray,L=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},Q=[],J=-1;function M(r){return{current:r}}function G(r){0>J||(r.current=Q[J],Q[J]=null,J--)}function Z(r,i){J++,Q[J]=r.current,r.current=i}var W=M(null),ae=M(null),se=M(null),he=M(null);function we(r,i){switch(Z(se,i),Z(ae,r),Z(W,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?mm(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=mm(i),r=bm(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}G(W),Z(W,r)}function de(){G(W),G(ae),G(se)}function $(r){r.memoizedState!==null&&Z(he,r);var i=W.current,s=bm(i,r.type);i!==s&&(Z(ae,r),Z(W,s))}function re(r){ae.current===r&&(G(W),G(ae)),he.current===r&&(G(he),Tu._currentValue=F)}var le,pe;function j(r){if(le===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);le=i&&i[1]||"",pe=-1<s.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+le+r+pe}var xe=!1;function Be(r,i){if(!r||xe)return"";xe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(i){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(ve){var ue=ve}Reflect.construct(r,[],Ee)}else{try{Ee.call()}catch(ve){ue=ve}r.call(Ee.prototype)}}else{try{throw Error()}catch(ve){ue=ve}(Ee=r())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(ve){if(ve&&ue&&typeof ve.stack=="string")return[ve.stack,ue.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=v.DetermineComponentFrameRoot(),A=m[0],N=m[1];if(A&&N){var X=A.split(`
|
|
4
|
-
`),ie=N.split(`
|
|
5
|
-
`);for(p=v=0;v<X.length&&!X[v].includes("DetermineComponentFrameRoot");)v++;for(;p<ie.length&&!ie[p].includes("DetermineComponentFrameRoot");)p++;if(v===X.length||p===ie.length)for(v=X.length-1,p=ie.length-1;1<=v&&0<=p&&X[v]!==ie[p];)p--;for(;1<=v&&0<=p;v--,p--)if(X[v]!==ie[p]){if(v!==1||p!==1)do if(v--,p--,0>p||X[v]!==ie[p]){var ge=`
|
|
6
|
-
`+X[v].replace(" at new "," at ");return r.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",r.displayName)),ge}while(1<=v&&0<=p);break}}}finally{xe=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?j(s):""}function Ue(r,i){switch(r.tag){case 26:case 27:case 5:return j(r.type);case 16:return j("Lazy");case 13:return r.child!==i&&i!==null?j("Suspense Fallback"):j("Suspense");case 19:return j("SuspenseList");case 0:case 15:return Be(r.type,!1);case 11:return Be(r.type.render,!1);case 1:return Be(r.type,!0);case 31:return j("Activity");default:return""}}function Ve(r){try{var i="",s=null;do i+=Ue(r,s),s=r,r=r.return;while(r);return i}catch(v){return`
|
|
7
|
-
Error generating stack: `+v.message+`
|
|
8
|
-
`+v.stack}}var Ae=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,He=t.unstable_shouldYield,je=t.unstable_requestPaint,De=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,rt=t.unstable_ImmediatePriority,ft=t.unstable_UserBlockingPriority,st=t.unstable_NormalPriority,dt=t.unstable_LowPriority,Xe=t.unstable_IdlePriority,ze=t.log,ye=t.unstable_setDisableYieldValue,k=null,te=null;function ce(r){if(typeof ze=="function"&&ye(r),te&&typeof te.setStrictMode=="function")try{te.setStrictMode(k,r)}catch{}}var oe=Math.clz32?Math.clz32:Se,me=Math.log,Re=Math.LN2;function Se(r){return r>>>=0,r===0?32:31-(me(r)/Re|0)|0}var ke=256,Me=262144,Pe=4194304;function Ke(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 Ze(r,i,s){var v=r.pendingLanes;if(v===0)return 0;var p=0,m=r.suspendedLanes,A=r.pingedLanes;r=r.warmLanes;var N=v&134217727;return N!==0?(v=N&~m,v!==0?p=Ke(v):(A&=N,A!==0?p=Ke(A):s||(s=N&~r,s!==0&&(p=Ke(s))))):(N=v&~m,N!==0?p=Ke(N):A!==0?p=Ke(A):s||(s=v&~r,s!==0&&(p=Ke(s)))),p===0?0:i!==0&&i!==p&&(i&m)===0&&(m=p&-p,s=i&-i,m>=s||m===32&&(s&4194048)!==0)?i:p}function Ne(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function tt(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 $e(){var r=Pe;return Pe<<=1,(Pe&62914560)===0&&(Pe=4194304),r}function Vt(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function wt(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function ma(r,i,s,v,p,m){var A=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 N=r.entanglements,X=r.expirationTimes,ie=r.hiddenUpdates;for(s=A&~s;0<s;){var ge=31-oe(s),Ee=1<<ge;N[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&=~Ee}v!==0&&Ut(r,v,0),m!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=m&~(A&~i))}function Ut(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var v=31-oe(i);r.entangledLanes|=i,r.entanglements[v]=r.entanglements[v]|1073741824|s&261930}function Xt(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var v=31-oe(s),p=1<<v;p&i|r[v]&i&&(r[v]|=i),s&=~p}}function Gt(r,i){var s=i&-i;return s=(s&42)!==0?1:jt(s),(s&(r.suspendedLanes|i))!==0?0:s}function jt(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 rr(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Ht(){var r=H.p;return r!==0?r:(r=window.event,r===void 0?32:Gm(r.type))}function nr(r,i){var s=H.p;try{return H.p=r,i()}finally{H.p=s}}var oa=Math.random().toString(36).slice(2),kt="__reactFiber$"+oa,ra="__reactProps$"+oa,qa="__reactContainer$"+oa,fa="__reactEvents$"+oa,ca="__reactListeners$"+oa,Da="__reactHandles$"+oa,un="__reactResources$"+oa,va="__reactMarker$"+oa;function Ni(r){delete r[kt],delete r[ra],delete r[fa],delete r[ca],delete r[Da]}function sn(r){var i=r[kt];if(i)return i;for(var s=r.parentNode;s;){if(i=s[qa]||s[kt]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=Am(r);r!==null;){if(s=r[kt])return s;r=Am(r)}return i}r=s,s=r.parentNode}return null}function on(r){if(r=r[kt]||r[qa]){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[un];return i||(i=r[un]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Qt(r){r[va]=!0}var cs=new Set,vs={};function Ka(r,i){Tr(r,i),Tr(r+"Capture",i)}function Tr(r,i){for(vs[r]=i,r=0;r<i.length;r++)cs.add(i[r])}var Li=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]*$"),Ul={},Hl={};function Mf(r){return Ae.call(Hl,r)?!0:Ae.call(Ul,r)?!1:Li.test(r)?Hl[r]=!0:(Ul[r]=!0,!1)}function Ba(r,i,s){if(Mf(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var v=i.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function cn(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 ir(r,i,s,v){if(v===null)r.removeAttribute(s);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+v)}}function da(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Va(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Rf(r,i,s){var v=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var p=v.get,m=v.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(A){s=""+A,m.call(this,A)}}),Object.defineProperty(r,i,{enumerable:v.enumerable}),{getValue:function(){return s},setValue:function(A){s=""+A},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function ds(r){if(!r._valueTracker){var i=Va(r)?"checked":"value";r._valueTracker=Rf(r,i,""+r[i])}}function hs(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),v="";return r&&(v=Va(r)?r.checked?"true":"false":r.value),r=v,r!==s?(i.setValue(r),!0):!1}function gs(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 ME=/[\n"\\]/g;function lr(r){return r.replace(ME,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function zf(r,i,s,v,p,m,A,N){r.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.type=A:r.removeAttribute("type"),i!=null?A==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+da(i)):r.value!==""+da(i)&&(r.value=""+da(i)):A!=="submit"&&A!=="reset"||r.removeAttribute("value"),i!=null?Of(r,A,da(i)):s!=null?Of(r,A,da(s)):v!=null&&r.removeAttribute("value"),p==null&&m!=null&&(r.defaultChecked=!!m),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+da(N):r.removeAttribute("name")}function vg(r,i,s,v,p,m,A,N){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(r.type=m),i!=null||s!=null){if(!(m!=="submit"&&m!=="reset"||i!=null)){ds(r);return}s=s!=null?""+da(s):"",i=i!=null?""+da(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}v=v??p,v=typeof v!="function"&&typeof v!="symbol"&&!!v,r.checked=N?r.checked:!!v,r.defaultChecked=!!v,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(r.name=A),ds(r)}function Of(r,i,s){i==="number"&&gs(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function ki(r,i,s,v){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&&v&&(r[s].defaultSelected=!0)}else{for(s=""+da(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,v&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function dg(r,i,s){if(i!=null&&(i=""+da(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+da(s):""}function hg(r,i,s,v){if(i==null){if(v!=null){if(s!=null)throw Error(n(92));if(I(v)){if(1<v.length)throw Error(n(93));v=v[0]}s=v}s==null&&(s=""),i=s}s=da(i),r.defaultValue=s,v=r.textContent,v===s&&v!==""&&v!==null&&(r.value=v),ds(r)}function _i(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var RE=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 gg(r,i,s){var v=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?v?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":v?r.setProperty(i,s):typeof s!="number"||s===0||RE.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function pg(r,i,s){if(i!=null&&typeof i!="object")throw Error(n(62));if(r=r.style,s!=null){for(var v in s)!s.hasOwnProperty(v)||i!=null&&i.hasOwnProperty(v)||(v.indexOf("--")===0?r.setProperty(v,""):v==="float"?r.cssFloat="":r[v]="");for(var p in i)v=i[p],i.hasOwnProperty(p)&&s[p]!==v&&gg(r,p,v)}else for(var m in i)i.hasOwnProperty(m)&&gg(r,m,i[m])}function Nf(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 zE=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"]]),OE=/^[\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 ps(r){return OE.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function _r(){}var Lf=null;function kf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var qi=null,Vi=null;function yg(r){var i=on(r);if(i&&(r=i.stateNode)){var s=r[ra]||null;e:switch(r=i.stateNode,i.type){case"input":if(zf(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="'+lr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var v=s[i];if(v!==r&&v.form===r.form){var p=v[ra]||null;if(!p)throw Error(n(90));zf(v,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)v=s[i],v.form===r.form&&hs(v)}break e;case"textarea":dg(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&ki(r,!!s.multiple,i,!1)}}}var _f=!1;function mg(r,i,s){if(_f)return r(i,s);_f=!0;try{var v=r(i);return v}finally{if(_f=!1,(qi!==null||Vi!==null)&&(ro(),qi&&(i=qi,r=Vi,Vi=qi=null,yg(i),r)))for(i=0;i<r.length;i++)yg(r[i])}}function Pl(r,i){var s=r.stateNode;if(s===null)return null;var v=s[ra]||null;if(v===null)return null;s=v[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":(v=!v.disabled)||(r=r.type,v=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!v;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(n(231,i,typeof s));return s}var qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qf=!1;if(qr)try{var Gl={};Object.defineProperty(Gl,"passive",{get:function(){qf=!0}}),window.addEventListener("test",Gl,Gl),window.removeEventListener("test",Gl,Gl)}catch{qf=!1}var vn=null,Vf=null,ys=null;function bg(){if(ys)return ys;var r,i=Vf,s=i.length,v,p="value"in vn?vn.value:vn.textContent,m=p.length;for(r=0;r<s&&i[r]===p[r];r++);var A=s-r;for(v=1;v<=A&&i[s-v]===p[m-v];v++);return ys=p.slice(r,1<v?1-v:void 0)}function ms(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 bs(){return!0}function Eg(){return!1}function Ua(r){function i(s,v,p,m,A){this._reactName=s,this._targetInst=p,this.type=v,this.nativeEvent=m,this.target=A,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(s=r[N],this[N]=s?s(m):m[N]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?bs: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=bs)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=bs)},persist:function(){},isPersistent:bs}),i}var ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Es=Ua(ai),Yl=g({},ai,{view:0,detail:0}),NE=Ua(Yl),Uf,Hf,Fl,xs=g({},Yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gf,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!==Fl&&(Fl&&r.type==="mousemove"?(Uf=r.screenX-Fl.screenX,Hf=r.screenY-Fl.screenY):Hf=Uf=0,Fl=r),Uf)},movementY:function(r){return"movementY"in r?r.movementY:Hf}}),xg=Ua(xs),LE=g({},xs,{dataTransfer:0}),kE=Ua(LE),_E=g({},Yl,{relatedTarget:0}),Pf=Ua(_E),qE=g({},ai,{animationName:0,elapsedTime:0,pseudoElement:0}),VE=Ua(qE),UE=g({},ai,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),HE=Ua(UE),PE=g({},ai,{data:0}),Sg=Ua(PE),GE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},YE={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"},FE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IE(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=FE[r])?!!i[r]:!1}function Gf(){return IE}var XE=g({},Yl,{key:function(r){if(r.key){var i=GE[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=ms(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?YE[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gf,charCode:function(r){return r.type==="keypress"?ms(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ms(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),jE=Ua(XE),KE=g({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wg=Ua(KE),ZE=g({},Yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gf}),QE=Ua(ZE),JE=g({},ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),WE=Ua(JE),$E=g({},xs,{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}),ex=Ua($E),tx=g({},ai,{newState:0,oldState:0}),ax=Ua(tx),rx=[9,13,27,32],Yf=qr&&"CompositionEvent"in window,Il=null;qr&&"documentMode"in document&&(Il=document.documentMode);var nx=qr&&"TextEvent"in window&&!Il,Tg=qr&&(!Yf||Il&&8<Il&&11>=Il),Cg=" ",Ag=!1;function Dg(r,i){switch(r){case"keyup":return rx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bg(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ui=!1;function ix(r,i){switch(r){case"compositionend":return Bg(i);case"keypress":return i.which!==32?null:(Ag=!0,Cg);case"textInput":return r=i.data,r===Cg&&Ag?null:r;default:return null}}function lx(r,i){if(Ui)return r==="compositionend"||!Yf&&Dg(r,i)?(r=bg(),ys=Vf=vn=null,Ui=!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 Tg&&i.locale!=="ko"?null:i.data;default:return null}}var ux={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 Mg(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!ux[r.type]:i==="textarea"}function Rg(r,i,s,v){qi?Vi?Vi.push(v):Vi=[v]:qi=v,i=fo(i,"onChange"),0<i.length&&(s=new Es("onChange","change",null,s,v),r.push({event:s,listeners:i}))}var Xl=null,jl=null;function sx(r){vm(r,0)}function Ss(r){var i=ti(r);if(hs(i))return r}function zg(r,i){if(r==="change")return i}var Og=!1;if(qr){var Ff;if(qr){var If="oninput"in document;if(!If){var Ng=document.createElement("div");Ng.setAttribute("oninput","return;"),If=typeof Ng.oninput=="function"}Ff=If}else Ff=!1;Og=Ff&&(!document.documentMode||9<document.documentMode)}function Lg(){Xl&&(Xl.detachEvent("onpropertychange",kg),jl=Xl=null)}function kg(r){if(r.propertyName==="value"&&Ss(jl)){var i=[];Rg(i,jl,r,kf(r)),mg(sx,i)}}function ox(r,i,s){r==="focusin"?(Lg(),Xl=i,jl=s,Xl.attachEvent("onpropertychange",kg)):r==="focusout"&&Lg()}function fx(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Ss(jl)}function cx(r,i){if(r==="click")return Ss(i)}function vx(r,i){if(r==="input"||r==="change")return Ss(i)}function dx(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Za=typeof Object.is=="function"?Object.is:dx;function Kl(r,i){if(Za(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),v=Object.keys(i);if(s.length!==v.length)return!1;for(v=0;v<s.length;v++){var p=s[v];if(!Ae.call(i,p)||!Za(r[p],i[p]))return!1}return!0}function _g(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function qg(r,i){var s=_g(r);r=0;for(var v;s;){if(s.nodeType===3){if(v=r+s.textContent.length,r<=i&&v>=i)return{node:s,offset:i-r};r=v}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=_g(s)}}function Vg(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Vg(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Ug(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=gs(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=gs(r.document)}return i}function Xf(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 hx=qr&&"documentMode"in document&&11>=document.documentMode,Hi=null,jf=null,Zl=null,Kf=!1;function Hg(r,i,s){var v=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Kf||Hi==null||Hi!==gs(v)||(v=Hi,"selectionStart"in v&&Xf(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Zl&&Kl(Zl,v)||(Zl=v,v=fo(jf,"onSelect"),0<v.length&&(i=new Es("onSelect","select",null,i,s),r.push({event:i,listeners:v}),i.target=Hi)))}function ri(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Pi={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")},Zf={},Pg={};qr&&(Pg=document.createElement("div").style,"AnimationEvent"in window||(delete Pi.animationend.animation,delete Pi.animationiteration.animation,delete Pi.animationstart.animation),"TransitionEvent"in window||delete Pi.transitionend.transition);function ni(r){if(Zf[r])return Zf[r];if(!Pi[r])return r;var i=Pi[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Pg)return Zf[r]=i[s];return r}var Gg=ni("animationend"),Yg=ni("animationiteration"),Fg=ni("animationstart"),gx=ni("transitionrun"),px=ni("transitionstart"),yx=ni("transitioncancel"),Ig=ni("transitionend"),Xg=new Map,Qf="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(" ");Qf.push("scrollEnd");function mr(r,i){Xg.set(r,i),Ka(i,[r])}var ws=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)},ur=[],Gi=0,Jf=0;function Ts(){for(var r=Gi,i=Jf=Gi=0;i<r;){var s=ur[i];ur[i++]=null;var v=ur[i];ur[i++]=null;var p=ur[i];ur[i++]=null;var m=ur[i];if(ur[i++]=null,v!==null&&p!==null){var A=v.pending;A===null?p.next=p:(p.next=A.next,A.next=p),v.pending=p}m!==0&&jg(s,p,m)}}function Cs(r,i,s,v){ur[Gi++]=r,ur[Gi++]=i,ur[Gi++]=s,ur[Gi++]=v,Jf|=v,r.lanes|=v,r=r.alternate,r!==null&&(r.lanes|=v)}function Wf(r,i,s,v){return Cs(r,i,s,v),As(r)}function ii(r,i){return Cs(r,null,null,i),As(r)}function jg(r,i,s){r.lanes|=s;var v=r.alternate;v!==null&&(v.lanes|=s);for(var p=!1,m=r.return;m!==null;)m.childLanes|=s,v=m.alternate,v!==null&&(v.childLanes|=s),m.tag===22&&(r=m.stateNode,r===null||r._visibility&1||(p=!0)),r=m,m=m.return;return r.tag===3?(m=r.stateNode,p&&i!==null&&(p=31-oe(s),r=m.hiddenUpdates,v=r[p],v===null?r[p]=[i]:v.push(i),i.lane=s|536870912),m):null}function As(r){if(50<yu)throw yu=0,uv=null,Error(n(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Yi={};function mx(r,i,s,v){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=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qa(r,i,s,v){return new mx(r,i,s,v)}function $f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Vr(r,i){var s=r.alternate;return s===null?(s=Qa(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 Kg(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 Ds(r,i,s,v,p,m){var A=0;if(v=r,typeof r=="function")$f(r)&&(A=1);else if(typeof r=="string")A=wS(r,s,W.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case _:return r=Qa(31,s,i,p),r.elementType=_,r.lanes=m,r;case w:return li(s.children,p,m,i);case x:A=8,p|=24;break;case S:return r=Qa(12,s,i,p|2),r.elementType=S,r.lanes=m,r;case R:return r=Qa(13,s,i,p),r.elementType=R,r.lanes=m,r;case z:return r=Qa(19,s,i,p),r.elementType=z,r.lanes=m,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case C:A=10;break e;case T:A=9;break e;case D:A=11;break e;case B:A=14;break e;case O:A=16,v=null;break e}A=29,s=Error(n(130,r===null?"null":typeof r,"")),v=null}return i=Qa(A,s,i,p),i.elementType=r,i.type=v,i.lanes=m,i}function li(r,i,s,v){return r=Qa(7,r,v,i),r.lanes=s,r}function ec(r,i,s){return r=Qa(6,r,null,i),r.lanes=s,r}function Zg(r){var i=Qa(18,null,null,0);return i.stateNode=r,i}function tc(r,i,s){return i=Qa(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Qg=new WeakMap;function sr(r,i){if(typeof r=="object"&&r!==null){var s=Qg.get(r);return s!==void 0?s:(i={value:r,source:i,stack:Ve(i)},Qg.set(r,i),i)}return{value:r,source:i,stack:Ve(i)}}var Fi=[],Ii=0,Bs=null,Ql=0,or=[],fr=0,dn=null,Cr=1,Ar="";function Ur(r,i){Fi[Ii++]=Ql,Fi[Ii++]=Bs,Bs=r,Ql=i}function Jg(r,i,s){or[fr++]=Cr,or[fr++]=Ar,or[fr++]=dn,dn=r;var v=Cr;r=Ar;var p=32-oe(v)-1;v&=~(1<<p),s+=1;var m=32-oe(i)+p;if(30<m){var A=p-p%5;m=(v&(1<<A)-1).toString(32),v>>=A,p-=A,Cr=1<<32-oe(i)+p|s<<p|v,Ar=m+r}else Cr=1<<m|s<<p|v,Ar=r}function ac(r){r.return!==null&&(Ur(r,1),Jg(r,1,0))}function rc(r){for(;r===Bs;)Bs=Fi[--Ii],Fi[Ii]=null,Ql=Fi[--Ii],Fi[Ii]=null;for(;r===dn;)dn=or[--fr],or[fr]=null,Ar=or[--fr],or[fr]=null,Cr=or[--fr],or[fr]=null}function Wg(r,i){or[fr++]=Cr,or[fr++]=Ar,or[fr++]=dn,Cr=i.id,Ar=i.overflow,dn=r}var ba=null,Ot=null,ot=!1,hn=null,cr=!1,nc=Error(n(519));function gn(r){var i=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Jl(sr(i,r)),nc}function $g(r){var i=r.stateNode,s=r.type,v=r.memoizedProps;switch(i[kt]=r,i[ra]=v,s){case"dialog":it("cancel",i),it("close",i);break;case"iframe":case"object":case"embed":it("load",i);break;case"video":case"audio":for(s=0;s<bu.length;s++)it(bu[s],i);break;case"source":it("error",i);break;case"img":case"image":case"link":it("error",i),it("load",i);break;case"details":it("toggle",i);break;case"input":it("invalid",i),vg(i,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0);break;case"select":it("invalid",i);break;case"textarea":it("invalid",i),hg(i,v.value,v.defaultValue,v.children)}s=v.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||v.suppressHydrationWarning===!0||pm(i.textContent,s)?(v.popover!=null&&(it("beforetoggle",i),it("toggle",i)),v.onScroll!=null&&it("scroll",i),v.onScrollEnd!=null&&it("scrollend",i),v.onClick!=null&&(i.onclick=_r),i=!0):i=!1,i||gn(r,!0)}function ep(r){for(ba=r.return;ba;)switch(ba.tag){case 5:case 31:case 13:cr=!1;return;case 27:case 3:cr=!0;return;default:ba=ba.return}}function Xi(r){if(r!==ba)return!1;if(!ot)return ep(r),ot=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Sv(r.type,r.memoizedProps)),s=!s),s&&Ot&&gn(r),ep(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));Ot=Cm(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));Ot=Cm(r)}else i===27?(i=Ot,Mn(r.type)?(r=Dv,Dv=null,Ot=r):Ot=i):Ot=ba?dr(r.stateNode.nextSibling):null;return!0}function ui(){Ot=ba=null,ot=!1}function ic(){var r=hn;return r!==null&&(Ya===null?Ya=r:Ya.push.apply(Ya,r),hn=null),r}function Jl(r){hn===null?hn=[r]:hn.push(r)}var lc=M(null),si=null,Hr=null;function pn(r,i,s){Z(lc,i._currentValue),i._currentValue=s}function Pr(r){r._currentValue=lc.current,G(lc)}function uc(r,i,s){for(;r!==null;){var v=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,v!==null&&(v.childLanes|=i)):v!==null&&(v.childLanes&i)!==i&&(v.childLanes|=i),r===s)break;r=r.return}}function sc(r,i,s,v){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var m=p.dependencies;if(m!==null){var A=p.child;m=m.firstContext;e:for(;m!==null;){var N=m;m=p;for(var X=0;X<i.length;X++)if(N.context===i[X]){m.lanes|=s,N=m.alternate,N!==null&&(N.lanes|=s),uc(m.return,s,r),v||(A=null);break e}m=N.next}}else if(p.tag===18){if(A=p.return,A===null)throw Error(n(341));A.lanes|=s,m=A.alternate,m!==null&&(m.lanes|=s),uc(A,s,r),A=null}else A=p.child;if(A!==null)A.return=p;else for(A=p;A!==null;){if(A===r){A=null;break}if(p=A.sibling,p!==null){p.return=A.return,A=p;break}A=A.return}p=A}}function ji(r,i,s,v){r=null;for(var p=i,m=!1;p!==null;){if(!m){if((p.flags&524288)!==0)m=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var A=p.alternate;if(A===null)throw Error(n(387));if(A=A.memoizedProps,A!==null){var N=p.type;Za(p.pendingProps.value,A.value)||(r!==null?r.push(N):r=[N])}}else if(p===he.current){if(A=p.alternate,A===null)throw Error(n(387));A.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Tu):r=[Tu])}p=p.return}r!==null&&sc(i,r,s,v),i.flags|=262144}function Ms(r){for(r=r.firstContext;r!==null;){if(!Za(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function oi(r){si=r,Hr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Ea(r){return tp(si,r)}function Rs(r,i){return si===null&&oi(r),tp(r,i)}function tp(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Hr===null){if(r===null)throw Error(n(308));Hr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Hr=Hr.next=i;return s}var bx=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,v){r.push(v)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},Ex=t.unstable_scheduleCallback,xx=t.unstable_NormalPriority,Jt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oc(){return{controller:new bx,data:new Map,refCount:0}}function Wl(r){r.refCount--,r.refCount===0&&Ex(xx,function(){r.controller.abort()})}var $l=null,fc=0,Ki=0,Zi=null;function Sx(r,i){if($l===null){var s=$l=[];fc=0,Ki=dv(),Zi={status:"pending",value:void 0,then:function(v){s.push(v)}}}return fc++,i.then(ap,ap),i}function ap(){if(--fc===0&&$l!==null){Zi!==null&&(Zi.status="fulfilled");var r=$l;$l=null,Ki=0,Zi=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function wx(r,i){var s=[],v={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){v.status="fulfilled",v.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(v.status="rejected",v.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),v}var rp=L.S;L.S=function(r,i){Hy=De(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Sx(r,i),rp!==null&&rp(r,i)};var fi=M(null);function cc(){var r=fi.current;return r!==null?r:Bt.pooledCache}function zs(r,i){i===null?Z(fi,fi.current):Z(fi,i.pool)}function np(){var r=cc();return r===null?null:{parent:Jt._currentValue,pool:r}}var Qi=Error(n(460)),vc=Error(n(474)),Os=Error(n(542)),Ns={then:function(){}};function ip(r){return r=r.status,r==="fulfilled"||r==="rejected"}function lp(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(_r,_r),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,sp(r),r;default:if(typeof i.status=="string")i.then(_r,_r);else{if(r=Bt,r!==null&&100<r.shellSuspendCounter)throw Error(n(482));r=i,r.status="pending",r.then(function(v){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=v}},function(v){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=v}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,sp(r),r}throw vi=i,Qi}}function ci(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(vi=s,Qi):s}}var vi=null;function up(){if(vi===null)throw Error(n(459));var r=vi;return vi=null,r}function sp(r){if(r===Qi||r===Os)throw Error(n(483))}var Ji=null,eu=0;function Ls(r){var i=eu;return eu+=1,Ji===null&&(Ji=[]),lp(Ji,r,i)}function tu(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function ks(r,i){throw i.$$typeof===y?Error(n(525)):(r=Object.prototype.toString.call(i),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function op(r){function i(ee,K){if(r){var ne=ee.deletions;ne===null?(ee.deletions=[K],ee.flags|=16):ne.push(K)}}function s(ee,K){if(!r)return null;for(;K!==null;)i(ee,K),K=K.sibling;return null}function v(ee){for(var K=new Map;ee!==null;)ee.key!==null?K.set(ee.key,ee):K.set(ee.index,ee),ee=ee.sibling;return K}function p(ee,K){return ee=Vr(ee,K),ee.index=0,ee.sibling=null,ee}function m(ee,K,ne){return ee.index=ne,r?(ne=ee.alternate,ne!==null?(ne=ne.index,ne<K?(ee.flags|=67108866,K):ne):(ee.flags|=67108866,K)):(ee.flags|=1048576,K)}function A(ee){return r&&ee.alternate===null&&(ee.flags|=67108866),ee}function N(ee,K,ne,be){return K===null||K.tag!==6?(K=ec(ne,ee.mode,be),K.return=ee,K):(K=p(K,ne),K.return=ee,K)}function X(ee,K,ne,be){var Ye=ne.type;return Ye===w?ge(ee,K,ne.props.children,be,ne.key):K!==null&&(K.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===O&&ci(Ye)===K.type)?(K=p(K,ne.props),tu(K,ne),K.return=ee,K):(K=Ds(ne.type,ne.key,ne.props,null,ee.mode,be),tu(K,ne),K.return=ee,K)}function ie(ee,K,ne,be){return K===null||K.tag!==4||K.stateNode.containerInfo!==ne.containerInfo||K.stateNode.implementation!==ne.implementation?(K=tc(ne,ee.mode,be),K.return=ee,K):(K=p(K,ne.children||[]),K.return=ee,K)}function ge(ee,K,ne,be,Ye){return K===null||K.tag!==7?(K=li(ne,ee.mode,be,Ye),K.return=ee,K):(K=p(K,ne),K.return=ee,K)}function Ee(ee,K,ne){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=ec(""+K,ee.mode,ne),K.return=ee,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case E:return ne=Ds(K.type,K.key,K.props,null,ee.mode,ne),tu(ne,K),ne.return=ee,ne;case b:return K=tc(K,ee.mode,ne),K.return=ee,K;case O:return K=ci(K),Ee(ee,K,ne)}if(I(K)||q(K))return K=li(K,ee.mode,ne,null),K.return=ee,K;if(typeof K.then=="function")return Ee(ee,Ls(K),ne);if(K.$$typeof===C)return Ee(ee,Rs(ee,K),ne);ks(ee,K)}return null}function ue(ee,K,ne,be){var Ye=K!==null?K.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ye!==null?null:N(ee,K,""+ne,be);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case E:return ne.key===Ye?X(ee,K,ne,be):null;case b:return ne.key===Ye?ie(ee,K,ne,be):null;case O:return ne=ci(ne),ue(ee,K,ne,be)}if(I(ne)||q(ne))return Ye!==null?null:ge(ee,K,ne,be,null);if(typeof ne.then=="function")return ue(ee,K,Ls(ne),be);if(ne.$$typeof===C)return ue(ee,K,Rs(ee,ne),be);ks(ee,ne)}return null}function ve(ee,K,ne,be,Ye){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return ee=ee.get(ne)||null,N(K,ee,""+be,Ye);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case E:return ee=ee.get(be.key===null?ne:be.key)||null,X(K,ee,be,Ye);case b:return ee=ee.get(be.key===null?ne:be.key)||null,ie(K,ee,be,Ye);case O:return be=ci(be),ve(ee,K,ne,be,Ye)}if(I(be)||q(be))return ee=ee.get(ne)||null,ge(K,ee,be,Ye,null);if(typeof be.then=="function")return ve(ee,K,ne,Ls(be),Ye);if(be.$$typeof===C)return ve(ee,K,ne,Rs(K,be),Ye);ks(K,be)}return null}function Le(ee,K,ne,be){for(var Ye=null,ht=null,qe=K,et=K=0,ut=null;qe!==null&&et<ne.length;et++){qe.index>et?(ut=qe,qe=null):ut=qe.sibling;var gt=ue(ee,qe,ne[et],be);if(gt===null){qe===null&&(qe=ut);break}r&&qe&>.alternate===null&&i(ee,qe),K=m(gt,K,et),ht===null?Ye=gt:ht.sibling=gt,ht=gt,qe=ut}if(et===ne.length)return s(ee,qe),ot&&Ur(ee,et),Ye;if(qe===null){for(;et<ne.length;et++)qe=Ee(ee,ne[et],be),qe!==null&&(K=m(qe,K,et),ht===null?Ye=qe:ht.sibling=qe,ht=qe);return ot&&Ur(ee,et),Ye}for(qe=v(qe);et<ne.length;et++)ut=ve(qe,ee,et,ne[et],be),ut!==null&&(r&&ut.alternate!==null&&qe.delete(ut.key===null?et:ut.key),K=m(ut,K,et),ht===null?Ye=ut:ht.sibling=ut,ht=ut);return r&&qe.forEach(function(Ln){return i(ee,Ln)}),ot&&Ur(ee,et),Ye}function Ie(ee,K,ne,be){if(ne==null)throw Error(n(151));for(var Ye=null,ht=null,qe=K,et=K=0,ut=null,gt=ne.next();qe!==null&&!gt.done;et++,gt=ne.next()){qe.index>et?(ut=qe,qe=null):ut=qe.sibling;var Ln=ue(ee,qe,gt.value,be);if(Ln===null){qe===null&&(qe=ut);break}r&&qe&&Ln.alternate===null&&i(ee,qe),K=m(Ln,K,et),ht===null?Ye=Ln:ht.sibling=Ln,ht=Ln,qe=ut}if(gt.done)return s(ee,qe),ot&&Ur(ee,et),Ye;if(qe===null){for(;!gt.done;et++,gt=ne.next())gt=Ee(ee,gt.value,be),gt!==null&&(K=m(gt,K,et),ht===null?Ye=gt:ht.sibling=gt,ht=gt);return ot&&Ur(ee,et),Ye}for(qe=v(qe);!gt.done;et++,gt=ne.next())gt=ve(qe,ee,et,gt.value,be),gt!==null&&(r&>.alternate!==null&&qe.delete(gt.key===null?et:gt.key),K=m(gt,K,et),ht===null?Ye=gt:ht.sibling=gt,ht=gt);return r&&qe.forEach(function(LS){return i(ee,LS)}),ot&&Ur(ee,et),Ye}function At(ee,K,ne,be){if(typeof ne=="object"&&ne!==null&&ne.type===w&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case E:e:{for(var Ye=ne.key;K!==null;){if(K.key===Ye){if(Ye=ne.type,Ye===w){if(K.tag===7){s(ee,K.sibling),be=p(K,ne.props.children),be.return=ee,ee=be;break e}}else if(K.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===O&&ci(Ye)===K.type){s(ee,K.sibling),be=p(K,ne.props),tu(be,ne),be.return=ee,ee=be;break e}s(ee,K);break}else i(ee,K);K=K.sibling}ne.type===w?(be=li(ne.props.children,ee.mode,be,ne.key),be.return=ee,ee=be):(be=Ds(ne.type,ne.key,ne.props,null,ee.mode,be),tu(be,ne),be.return=ee,ee=be)}return A(ee);case b:e:{for(Ye=ne.key;K!==null;){if(K.key===Ye)if(K.tag===4&&K.stateNode.containerInfo===ne.containerInfo&&K.stateNode.implementation===ne.implementation){s(ee,K.sibling),be=p(K,ne.children||[]),be.return=ee,ee=be;break e}else{s(ee,K);break}else i(ee,K);K=K.sibling}be=tc(ne,ee.mode,be),be.return=ee,ee=be}return A(ee);case O:return ne=ci(ne),At(ee,K,ne,be)}if(I(ne))return Le(ee,K,ne,be);if(q(ne)){if(Ye=q(ne),typeof Ye!="function")throw Error(n(150));return ne=Ye.call(ne),Ie(ee,K,ne,be)}if(typeof ne.then=="function")return At(ee,K,Ls(ne),be);if(ne.$$typeof===C)return At(ee,K,Rs(ee,ne),be);ks(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,K!==null&&K.tag===6?(s(ee,K.sibling),be=p(K,ne),be.return=ee,ee=be):(s(ee,K),be=ec(ne,ee.mode,be),be.return=ee,ee=be),A(ee)):s(ee,K)}return function(ee,K,ne,be){try{eu=0;var Ye=At(ee,K,ne,be);return Ji=null,Ye}catch(qe){if(qe===Qi||qe===Os)throw qe;var ht=Qa(29,qe,null,ee.mode);return ht.lanes=be,ht.return=ee,ht}}}var di=op(!0),fp=op(!1),yn=!1;function dc(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hc(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 mn(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function bn(r,i,s){var v=r.updateQueue;if(v===null)return null;if(v=v.shared,(mt&2)!==0){var p=v.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),v.pending=i,i=As(r),jg(r,null,s),i}return Cs(r,v,i,s),As(r)}function au(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var v=i.lanes;v&=r.pendingLanes,s|=v,i.lanes=s,Xt(r,s)}}function gc(r,i){var s=r.updateQueue,v=r.alternate;if(v!==null&&(v=v.updateQueue,s===v)){var p=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var A={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};m===null?p=m=A:m=m.next=A,s=s.next}while(s!==null);m===null?p=m=i:m=m.next=i}else p=m=i;s={baseState:v.baseState,firstBaseUpdate:p,lastBaseUpdate:m,shared:v.shared,callbacks:v.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var pc=!1;function ru(){if(pc){var r=Zi;if(r!==null)throw r}}function nu(r,i,s,v){pc=!1;var p=r.updateQueue;yn=!1;var m=p.firstBaseUpdate,A=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var X=N,ie=X.next;X.next=null,A===null?m=ie:A.next=ie,A=X;var ge=r.alternate;ge!==null&&(ge=ge.updateQueue,N=ge.lastBaseUpdate,N!==A&&(N===null?ge.firstBaseUpdate=ie:N.next=ie,ge.lastBaseUpdate=X))}if(m!==null){var Ee=p.baseState;A=0,ge=ie=X=null,N=m;do{var ue=N.lane&-536870913,ve=ue!==N.lane;if(ve?(lt&ue)===ue:(v&ue)===ue){ue!==0&&ue===Ki&&(pc=!0),ge!==null&&(ge=ge.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Le=r,Ie=N;ue=i;var At=s;switch(Ie.tag){case 1:if(Le=Ie.payload,typeof Le=="function"){Ee=Le.call(At,Ee,ue);break e}Ee=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Ie.payload,ue=typeof Le=="function"?Le.call(At,Ee,ue):Le,ue==null)break e;Ee=g({},Ee,ue);break e;case 2:yn=!0}}ue=N.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:N.tag,payload:N.payload,callback:N.callback,next:null},ge===null?(ie=ge=ve,X=Ee):ge=ge.next=ve,A|=ue;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;ve=N,N=ve.next,ve.next=null,p.lastBaseUpdate=ve,p.shared.pending=null}}while(!0);ge===null&&(X=Ee),p.baseState=X,p.firstBaseUpdate=ie,p.lastBaseUpdate=ge,m===null&&(p.shared.lanes=0),Tn|=A,r.lanes=A,r.memoizedState=Ee}}function cp(r,i){if(typeof r!="function")throw Error(n(191,r));r.call(i)}function vp(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)cp(s[r],i)}var Wi=M(null),_s=M(0);function dp(r,i){r=Qr,Z(_s,r),Z(Wi,i),Qr=r|i.baseLanes}function yc(){Z(_s,Qr),Z(Wi,Wi.current)}function mc(){Qr=_s.current,G(Wi),G(_s)}var Ja=M(null),vr=null;function En(r){var i=r.alternate;Z(Kt,Kt.current&1),Z(Ja,r),vr===null&&(i===null||Wi.current!==null||i.memoizedState!==null)&&(vr=r)}function bc(r){Z(Kt,Kt.current),Z(Ja,r),vr===null&&(vr=r)}function hp(r){r.tag===22?(Z(Kt,Kt.current),Z(Ja,r),vr===null&&(vr=r)):xn()}function xn(){Z(Kt,Kt.current),Z(Ja,Ja.current)}function Wa(r){G(Ja),vr===r&&(vr=null),G(Kt)}var Kt=M(0);function qs(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Cv(s)||Av(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,Je=null,Tt=null,Wt=null,Vs=!1,$i=!1,hi=!1,Us=0,iu=0,el=null,Tx=0;function Yt(){throw Error(n(321))}function Ec(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Za(r[s],i[s]))return!1;return!0}function xc(r,i,s,v,p,m){return Gr=m,Je=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,L.H=r===null||r.memoizedState===null?Jp:_c,hi=!1,m=s(v,p),hi=!1,$i&&(m=pp(i,s,v,p)),gp(r),m}function gp(r){L.H=su;var i=Tt!==null&&Tt.next!==null;if(Gr=0,Wt=Tt=Je=null,Vs=!1,iu=0,el=null,i)throw Error(n(300));r===null||$t||(r=r.dependencies,r!==null&&Ms(r)&&($t=!0))}function pp(r,i,s,v){Je=r;var p=0;do{if($i&&(el=null),iu=0,$i=!1,25<=p)throw Error(n(301));if(p+=1,Wt=Tt=null,r.updateQueue!=null){var m=r.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}L.H=Wp,m=i(s,v)}while($i);return m}function Cx(){var r=L.H,i=r.useState()[0];return i=typeof i.then=="function"?lu(i):i,r=r.useState()[0],(Tt!==null?Tt.memoizedState:null)!==r&&(Je.flags|=1024),i}function Sc(){var r=Us!==0;return Us=0,r}function wc(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Tc(r){if(Vs){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Vs=!1}Gr=0,Wt=Tt=Je=null,$i=!1,iu=Us=0,el=null}function Na(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wt===null?Je.memoizedState=Wt=r:Wt=Wt.next=r,Wt}function Zt(){if(Tt===null){var r=Je.alternate;r=r!==null?r.memoizedState:null}else r=Tt.next;var i=Wt===null?Je.memoizedState:Wt.next;if(i!==null)Wt=i,Tt=r;else{if(r===null)throw Je.alternate===null?Error(n(467)):Error(n(310));Tt=r,r={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Wt===null?Je.memoizedState=Wt=r:Wt=Wt.next=r}return Wt}function Hs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lu(r){var i=iu;return iu+=1,el===null&&(el=[]),r=lp(el,r,i),i=Je,(Wt===null?i.memoizedState:Wt.next)===null&&(i=i.alternate,L.H=i===null||i.memoizedState===null?Jp:_c),r}function Ps(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return lu(r);if(r.$$typeof===C)return Ea(r)}throw Error(n(438,String(r)))}function Cc(r){var i=null,s=Je.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var v=Je.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(i={data:v.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Hs(),Je.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),v=0;v<r;v++)s[v]=U;return i.index++,s}function Yr(r,i){return typeof i=="function"?i(r):i}function Gs(r){var i=Zt();return Ac(i,Tt,r)}function Ac(r,i,s){var v=r.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=s;var p=r.baseQueue,m=v.pending;if(m!==null){if(p!==null){var A=p.next;p.next=m.next,m.next=A}i.baseQueue=p=m,v.pending=null}if(m=r.baseState,p===null)r.memoizedState=m;else{i=p.next;var N=A=null,X=null,ie=i,ge=!1;do{var Ee=ie.lane&-536870913;if(Ee!==ie.lane?(lt&Ee)===Ee:(Gr&Ee)===Ee){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}),Ee===Ki&&(ge=!0);else if((Gr&ue)===ue){ie=ie.next,ue===Ki&&(ge=!0);continue}else Ee={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},X===null?(N=X=Ee,A=m):X=X.next=Ee,Je.lanes|=ue,Tn|=ue;Ee=ie.action,hi&&s(m,Ee),m=ie.hasEagerState?ie.eagerState:s(m,Ee)}else ue={lane:Ee,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},X===null?(N=X=ue,A=m):X=X.next=ue,Je.lanes|=Ee,Tn|=Ee;ie=ie.next}while(ie!==null&&ie!==i);if(X===null?A=m:X.next=N,!Za(m,r.memoizedState)&&($t=!0,ge&&(s=Zi,s!==null)))throw s;r.memoizedState=m,r.baseState=A,r.baseQueue=X,v.lastRenderedState=m}return p===null&&(v.lanes=0),[r.memoizedState,v.dispatch]}function Dc(r){var i=Zt(),s=i.queue;if(s===null)throw Error(n(311));s.lastRenderedReducer=r;var v=s.dispatch,p=s.pending,m=i.memoizedState;if(p!==null){s.pending=null;var A=p=p.next;do m=r(m,A.action),A=A.next;while(A!==p);Za(m,i.memoizedState)||($t=!0),i.memoizedState=m,i.baseQueue===null&&(i.baseState=m),s.lastRenderedState=m}return[m,v]}function yp(r,i,s){var v=Je,p=Zt(),m=ot;if(m){if(s===void 0)throw Error(n(407));s=s()}else s=i();var A=!Za((Tt||p).memoizedState,s);if(A&&(p.memoizedState=s,$t=!0),p=p.queue,Rc(Ep.bind(null,v,p,r),[r]),p.getSnapshot!==i||A||Wt!==null&&Wt.memoizedState.tag&1){if(v.flags|=2048,tl(9,{destroy:void 0},bp.bind(null,v,p,s,i),null),Bt===null)throw Error(n(349));m||(Gr&127)!==0||mp(v,i,s)}return s}function mp(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=Je.updateQueue,i===null?(i=Hs(),Je.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function bp(r,i,s,v){i.value=s,i.getSnapshot=v,xp(i)&&Sp(r)}function Ep(r,i,s){return s(function(){xp(i)&&Sp(r)})}function xp(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Za(r,s)}catch{return!0}}function Sp(r){var i=ii(r,2);i!==null&&Fa(i,r,2)}function Bc(r){var i=Na();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:Yr,lastRenderedState:r},i}function wp(r,i,s,v){return r.baseState=s,Ac(r,Tt,typeof v=="function"?v:Yr)}function Ax(r,i,s,v,p){if(Is(r))throw Error(n(485));if(r=i.action,r!==null){var m={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){m.listeners.push(A)}};L.T!==null?s(!0):m.isTransition=!1,v(m),s=i.pending,s===null?(m.next=i.pending=m,Tp(i,m)):(m.next=s.next,i.pending=s.next=m)}}function Tp(r,i){var s=i.action,v=i.payload,p=r.state;if(i.isTransition){var m=L.T,A={};L.T=A;try{var N=s(p,v),X=L.S;X!==null&&X(A,N),Cp(r,i,N)}catch(ie){Mc(r,i,ie)}finally{m!==null&&A.types!==null&&(m.types=A.types),L.T=m}}else try{m=s(p,v),Cp(r,i,m)}catch(ie){Mc(r,i,ie)}}function Cp(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(v){Ap(r,i,v)},function(v){return Mc(r,i,v)}):Ap(r,i,s)}function Ap(r,i,s){i.status="fulfilled",i.value=s,Dp(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Tp(r,s)))}function Mc(r,i,s){var v=r.pending;if(r.pending=null,v!==null){v=v.next;do i.status="rejected",i.reason=s,Dp(i),i=i.next;while(i!==v)}r.action=null}function Dp(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Bp(r,i){return i}function Mp(r,i){if(ot){var s=Bt.formState;if(s!==null){e:{var v=Je;if(ot){if(Ot){t:{for(var p=Ot,m=cr;p.nodeType!==8;){if(!m){p=null;break t}if(p=dr(p.nextSibling),p===null){p=null;break t}}m=p.data,p=m==="F!"||m==="F"?p:null}if(p){Ot=dr(p.nextSibling),v=p.data==="F!";break e}}gn(v)}v=!1}v&&(i=s[0])}}return s=Na(),s.memoizedState=s.baseState=i,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bp,lastRenderedState:i},s.queue=v,s=Kp.bind(null,Je,v),v.dispatch=s,v=Bc(!1),m=kc.bind(null,Je,!1,v.queue),v=Na(),p={state:i,dispatch:null,action:r,pending:null},v.queue=p,s=Ax.bind(null,Je,p,m,s),p.dispatch=s,v.memoizedState=r,[i,s,!1]}function Rp(r){var i=Zt();return zp(i,Tt,r)}function zp(r,i,s){if(i=Ac(r,i,Bp)[0],r=Gs(Yr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var v=lu(i)}catch(A){throw A===Qi?Os:A}else v=i;i=Zt();var p=i.queue,m=p.dispatch;return s!==i.memoizedState&&(Je.flags|=2048,tl(9,{destroy:void 0},Dx.bind(null,p,s),null)),[v,m,r]}function Dx(r,i){r.action=i}function Op(r){var i=Zt(),s=Tt;if(s!==null)return zp(i,s,r);Zt(),i=i.memoizedState,s=Zt();var v=s.queue.dispatch;return s.memoizedState=r,[i,v,!1]}function tl(r,i,s,v){return r={tag:r,create:s,deps:v,inst:i,next:null},i=Je.updateQueue,i===null&&(i=Hs(),Je.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(v=s.next,s.next=r,r.next=v,i.lastEffect=r),r}function Np(){return Zt().memoizedState}function Ys(r,i,s,v){var p=Na();Je.flags|=r,p.memoizedState=tl(1|i,{destroy:void 0},s,v===void 0?null:v)}function Fs(r,i,s,v){var p=Zt();v=v===void 0?null:v;var m=p.memoizedState.inst;Tt!==null&&v!==null&&Ec(v,Tt.memoizedState.deps)?p.memoizedState=tl(i,m,s,v):(Je.flags|=r,p.memoizedState=tl(1|i,m,s,v))}function Lp(r,i){Ys(8390656,8,r,i)}function Rc(r,i){Fs(2048,8,r,i)}function Bx(r){Je.flags|=4;var i=Je.updateQueue;if(i===null)i=Hs(),Je.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function kp(r){var i=Zt().memoizedState;return Bx({ref:i,nextImpl:r}),function(){if((mt&2)!==0)throw Error(n(440));return i.impl.apply(void 0,arguments)}}function _p(r,i){return Fs(4,2,r,i)}function qp(r,i){return Fs(4,4,r,i)}function Vp(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 Up(r,i,s){s=s!=null?s.concat([r]):null,Fs(4,4,Vp.bind(null,i,r),s)}function zc(){}function Hp(r,i){var s=Zt();i=i===void 0?null:i;var v=s.memoizedState;return i!==null&&Ec(i,v[1])?v[0]:(s.memoizedState=[r,i],r)}function Pp(r,i){var s=Zt();i=i===void 0?null:i;var v=s.memoizedState;if(i!==null&&Ec(i,v[1]))return v[0];if(v=r(),hi){ce(!0);try{r()}finally{ce(!1)}}return s.memoizedState=[v,i],v}function Oc(r,i,s){return s===void 0||(Gr&1073741824)!==0&&(lt&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Gy(),Je.lanes|=r,Tn|=r,s)}function Gp(r,i,s,v){return Za(s,i)?s:Wi.current!==null?(r=Oc(r,s,v),Za(r,i)||($t=!0),r):(Gr&42)===0||(Gr&1073741824)!==0&&(lt&261930)===0?($t=!0,r.memoizedState=s):(r=Gy(),Je.lanes|=r,Tn|=r,i)}function Yp(r,i,s,v,p){var m=H.p;H.p=m!==0&&8>m?m:8;var A=L.T,N={};L.T=N,kc(r,!1,i,s);try{var X=p(),ie=L.S;if(ie!==null&&ie(N,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ge=wx(X,v);uu(r,i,ge,tr(r))}else uu(r,i,v,tr(r))}catch(Ee){uu(r,i,{then:function(){},status:"rejected",reason:Ee},tr())}finally{H.p=m,A!==null&&N.types!==null&&(A.types=N.types),L.T=A}}function Mx(){}function Nc(r,i,s,v){if(r.tag!==5)throw Error(n(476));var p=Fp(r).queue;Yp(r,p,i,F,s===null?Mx:function(){return Ip(r),s(v)})}function Fp(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:F},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Ip(r){var i=Fp(r);i.next===null&&(i=r.alternate.memoizedState),uu(r,i.next.queue,{},tr())}function Lc(){return Ea(Tu)}function Xp(){return Zt().memoizedState}function jp(){return Zt().memoizedState}function Rx(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=tr();r=mn(s);var v=bn(i,r,s);v!==null&&(Fa(v,i,s),au(v,i,s)),i={cache:oc()},r.payload=i;return}i=i.return}}function zx(r,i,s){var v=tr();s={lane:v,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Is(r)?Zp(i,s):(s=Wf(r,i,s,v),s!==null&&(Fa(s,r,v),Qp(s,i,v)))}function Kp(r,i,s){var v=tr();uu(r,i,s,v)}function uu(r,i,s,v){var p={lane:v,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Is(r))Zp(i,p);else{var m=r.alternate;if(r.lanes===0&&(m===null||m.lanes===0)&&(m=i.lastRenderedReducer,m!==null))try{var A=i.lastRenderedState,N=m(A,s);if(p.hasEagerState=!0,p.eagerState=N,Za(N,A))return Cs(r,i,p,0),Bt===null&&Ts(),!1}catch{}if(s=Wf(r,i,p,v),s!==null)return Fa(s,r,v),Qp(s,i,v),!0}return!1}function kc(r,i,s,v){if(v={lane:2,revertLane:dv(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Is(r)){if(i)throw Error(n(479))}else i=Wf(r,s,v,2),i!==null&&Fa(i,r,2)}function Is(r){var i=r.alternate;return r===Je||i!==null&&i===Je}function Zp(r,i){$i=Vs=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function Qp(r,i,s){if((s&4194048)!==0){var v=i.lanes;v&=r.pendingLanes,s|=v,i.lanes=s,Xt(r,s)}}var su={readContext:Ea,use:Ps,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt};su.useEffectEvent=Yt;var Jp={readContext:Ea,use:Ps,useCallback:function(r,i){return Na().memoizedState=[r,i===void 0?null:i],r},useContext:Ea,useEffect:Lp,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Ys(4194308,4,Vp.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Ys(4194308,4,r,i)},useInsertionEffect:function(r,i){Ys(4,2,r,i)},useMemo:function(r,i){var s=Na();i=i===void 0?null:i;var v=r();if(hi){ce(!0);try{r()}finally{ce(!1)}}return s.memoizedState=[v,i],v},useReducer:function(r,i,s){var v=Na();if(s!==void 0){var p=s(i);if(hi){ce(!0);try{s(i)}finally{ce(!1)}}}else p=i;return v.memoizedState=v.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},v.queue=r,r=r.dispatch=zx.bind(null,Je,r),[v.memoizedState,r]},useRef:function(r){var i=Na();return r={current:r},i.memoizedState=r},useState:function(r){r=Bc(r);var i=r.queue,s=Kp.bind(null,Je,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:zc,useDeferredValue:function(r,i){var s=Na();return Oc(s,r,i)},useTransition:function(){var r=Bc(!1);return r=Yp.bind(null,Je,r.queue,!0,!1),Na().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var v=Je,p=Na();if(ot){if(s===void 0)throw Error(n(407));s=s()}else{if(s=i(),Bt===null)throw Error(n(349));(lt&127)!==0||mp(v,i,s)}p.memoizedState=s;var m={value:s,getSnapshot:i};return p.queue=m,Lp(Ep.bind(null,v,m,r),[r]),v.flags|=2048,tl(9,{destroy:void 0},bp.bind(null,v,m,s,i),null),s},useId:function(){var r=Na(),i=Bt.identifierPrefix;if(ot){var s=Ar,v=Cr;s=(v&~(1<<32-oe(v)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Us++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=Tx++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Lc,useFormState:Mp,useActionState:Mp,useOptimistic:function(r){var i=Na();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=kc.bind(null,Je,!0,s),s.dispatch=i,[r,i]},useMemoCache:Cc,useCacheRefresh:function(){return Na().memoizedState=Rx.bind(null,Je)},useEffectEvent:function(r){var i=Na(),s={impl:r};return i.memoizedState=s,function(){if((mt&2)!==0)throw Error(n(440));return s.impl.apply(void 0,arguments)}}},_c={readContext:Ea,use:Ps,useCallback:Hp,useContext:Ea,useEffect:Rc,useImperativeHandle:Up,useInsertionEffect:_p,useLayoutEffect:qp,useMemo:Pp,useReducer:Gs,useRef:Np,useState:function(){return Gs(Yr)},useDebugValue:zc,useDeferredValue:function(r,i){var s=Zt();return Gp(s,Tt.memoizedState,r,i)},useTransition:function(){var r=Gs(Yr)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:lu(r),i]},useSyncExternalStore:yp,useId:Xp,useHostTransitionStatus:Lc,useFormState:Rp,useActionState:Rp,useOptimistic:function(r,i){var s=Zt();return wp(s,Tt,r,i)},useMemoCache:Cc,useCacheRefresh:jp};_c.useEffectEvent=kp;var Wp={readContext:Ea,use:Ps,useCallback:Hp,useContext:Ea,useEffect:Rc,useImperativeHandle:Up,useInsertionEffect:_p,useLayoutEffect:qp,useMemo:Pp,useReducer:Dc,useRef:Np,useState:function(){return Dc(Yr)},useDebugValue:zc,useDeferredValue:function(r,i){var s=Zt();return Tt===null?Oc(s,r,i):Gp(s,Tt.memoizedState,r,i)},useTransition:function(){var r=Dc(Yr)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:lu(r),i]},useSyncExternalStore:yp,useId:Xp,useHostTransitionStatus:Lc,useFormState:Op,useActionState:Op,useOptimistic:function(r,i){var s=Zt();return Tt!==null?wp(s,Tt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Cc,useCacheRefresh:jp};Wp.useEffectEvent=kp;function qc(r,i,s,v){i=r.memoizedState,s=s(v,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Vc={enqueueSetState:function(r,i,s){r=r._reactInternals;var v=tr(),p=mn(v);p.payload=i,s!=null&&(p.callback=s),i=bn(r,p,v),i!==null&&(Fa(i,r,v),au(i,r,v))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var v=tr(),p=mn(v);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=bn(r,p,v),i!==null&&(Fa(i,r,v),au(i,r,v))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=tr(),v=mn(s);v.tag=2,i!=null&&(v.callback=i),i=bn(r,v,s),i!==null&&(Fa(i,r,s),au(i,r,s))}};function $p(r,i,s,v,p,m,A){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(v,m,A):i.prototype&&i.prototype.isPureReactComponent?!Kl(s,v)||!Kl(p,m):!0}function ey(r,i,s,v){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,v),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,v),i.state!==r&&Vc.enqueueReplaceState(i,i.state,null)}function gi(r,i){var s=i;if("ref"in i){s={};for(var v in i)v!=="ref"&&(s[v]=i[v])}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 ty(r){ws(r)}function ay(r){console.error(r)}function ry(r){ws(r)}function Xs(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(v){setTimeout(function(){throw v})}}function ny(r,i,s){try{var v=r.onCaughtError;v(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Uc(r,i,s){return s=mn(s),s.tag=3,s.payload={element:null},s.callback=function(){Xs(r,i)},s}function iy(r){return r=mn(r),r.tag=3,r}function ly(r,i,s,v){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var m=v.value;r.payload=function(){return p(m)},r.callback=function(){ny(i,s,v)}}var A=s.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(r.callback=function(){ny(i,s,v),typeof p!="function"&&(Cn===null?Cn=new Set([this]):Cn.add(this));var N=v.stack;this.componentDidCatch(v.value,{componentStack:N!==null?N:""})})}function Ox(r,i,s,v,p){if(s.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(i=s.alternate,i!==null&&ji(i,s,p,!0),s=Ja.current,s!==null){switch(s.tag){case 31:case 13:return vr===null?no():s.alternate===null&&Ft===0&&(Ft=3),s.flags&=-257,s.flags|=65536,s.lanes=p,v===Ns?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([v]):i.add(v),fv(r,v,p)),!1;case 22:return s.flags|=65536,v===Ns?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([v])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([v]):s.add(v)),fv(r,v,p)),!1}throw Error(n(435,s.tag))}return fv(r,v,p),no(),!1}if(ot)return i=Ja.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,v!==nc&&(r=Error(n(422),{cause:v}),Jl(sr(r,s)))):(v!==nc&&(i=Error(n(423),{cause:v}),Jl(sr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,v=sr(v,s),p=Uc(r.stateNode,v,p),gc(r,p),Ft!==4&&(Ft=2)),!1;var m=Error(n(520),{cause:v});if(m=sr(m,s),pu===null?pu=[m]:pu.push(m),Ft!==4&&(Ft=2),i===null)return!0;v=sr(v,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Uc(s.stateNode,v,r),gc(s,r),!1;case 1:if(i=s.type,m=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Cn===null||!Cn.has(m))))return s.flags|=65536,p&=-p,s.lanes|=p,p=iy(p),ly(p,r,s,v),gc(s,p),!1}s=s.return}while(s!==null);return!1}var Hc=Error(n(461)),$t=!1;function xa(r,i,s,v){i.child=r===null?fp(i,null,s,v):di(i,r.child,s,v)}function uy(r,i,s,v,p){s=s.render;var m=i.ref;if("ref"in v){var A={};for(var N in v)N!=="ref"&&(A[N]=v[N])}else A=v;return oi(i),v=xc(r,i,s,A,m,p),N=Sc(),r!==null&&!$t?(wc(r,i,p),Fr(r,i,p)):(ot&&N&&ac(i),i.flags|=1,xa(r,i,v,p),i.child)}function sy(r,i,s,v,p){if(r===null){var m=s.type;return typeof m=="function"&&!$f(m)&&m.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=m,oy(r,i,m,v,p)):(r=Ds(s.type,null,v,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(m=r.child,!Kc(r,p)){var A=m.memoizedProps;if(s=s.compare,s=s!==null?s:Kl,s(A,v)&&r.ref===i.ref)return Fr(r,i,p)}return i.flags|=1,r=Vr(m,v),r.ref=i.ref,r.return=i,i.child=r}function oy(r,i,s,v,p){if(r!==null){var m=r.memoizedProps;if(Kl(m,v)&&r.ref===i.ref)if($t=!1,i.pendingProps=v=m,Kc(r,p))(r.flags&131072)!==0&&($t=!0);else return i.lanes=r.lanes,Fr(r,i,p)}return Pc(r,i,s,v,p)}function fy(r,i,s,v){var p=v.children,m=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((i.flags&128)!==0){if(m=m!==null?m.baseLanes|s:s,r!==null){for(v=i.child=r.child,p=0;v!==null;)p=p|v.lanes|v.childLanes,v=v.sibling;v=p&~m}else v=0,i.child=null;return cy(r,i,m,s,v)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&zs(i,m!==null?m.cachePool:null),m!==null?dp(i,m):yc(),hp(i);else return v=i.lanes=536870912,cy(r,i,m!==null?m.baseLanes|s:s,s,v)}else m!==null?(zs(i,m.cachePool),dp(i,m),xn(),i.memoizedState=null):(r!==null&&zs(i,null),yc(),xn());return xa(r,i,p,s),i.child}function ou(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function cy(r,i,s,v,p){var m=cc();return m=m===null?null:{parent:Jt._currentValue,pool:m},i.memoizedState={baseLanes:s,cachePool:m},r!==null&&zs(i,null),yc(),hp(i),r!==null&&ji(r,i,v,!0),i.childLanes=p,null}function js(r,i){return i=Zs({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function vy(r,i,s){return di(i,r.child,null,s),r=js(i,i.pendingProps),r.flags|=2,Wa(i),i.memoizedState=null,r}function Nx(r,i,s){var v=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(ot){if(v.mode==="hidden")return r=js(i,v),i.lanes=536870912,ou(null,r);if(bc(i),(r=Ot)?(r=Tm(r,cr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:dn!==null?{id:Cr,overflow:Ar}:null,retryLane:536870912,hydrationErrors:null},s=Zg(r),s.return=i,i.child=s,ba=i,Ot=null)):r=null,r===null)throw gn(i);return i.lanes=536870912,null}return js(i,v)}var m=r.memoizedState;if(m!==null){var A=m.dehydrated;if(bc(i),p)if(i.flags&256)i.flags&=-257,i=vy(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(n(558));else if($t||ji(r,i,s,!1),p=(s&r.childLanes)!==0,$t||p){if(v=Bt,v!==null&&(A=Gt(v,s),A!==0&&A!==m.retryLane))throw m.retryLane=A,ii(r,A),Fa(v,r,A),Hc;no(),i=vy(r,i,s)}else r=m.treeContext,Ot=dr(A.nextSibling),ba=i,ot=!0,hn=null,cr=!1,r!==null&&Wg(i,r),i=js(i,v),i.flags|=4096;return i}return r=Vr(r.child,{mode:v.mode,children:v.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Ks(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 Pc(r,i,s,v,p){return oi(i),s=xc(r,i,s,v,void 0,p),v=Sc(),r!==null&&!$t?(wc(r,i,p),Fr(r,i,p)):(ot&&v&&ac(i),i.flags|=1,xa(r,i,s,p),i.child)}function dy(r,i,s,v,p,m){return oi(i),i.updateQueue=null,s=pp(i,v,s,p),gp(r),v=Sc(),r!==null&&!$t?(wc(r,i,m),Fr(r,i,m)):(ot&&v&&ac(i),i.flags|=1,xa(r,i,s,m),i.child)}function hy(r,i,s,v,p){if(oi(i),i.stateNode===null){var m=Yi,A=s.contextType;typeof A=="object"&&A!==null&&(m=Ea(A)),m=new s(v,m),i.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Vc,i.stateNode=m,m._reactInternals=i,m=i.stateNode,m.props=v,m.state=i.memoizedState,m.refs={},dc(i),A=s.contextType,m.context=typeof A=="object"&&A!==null?Ea(A):Yi,m.state=i.memoizedState,A=s.getDerivedStateFromProps,typeof A=="function"&&(qc(i,s,A,v),m.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(A=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),A!==m.state&&Vc.enqueueReplaceState(m,m.state,null),nu(i,v,m,p),ru(),m.state=i.memoizedState),typeof m.componentDidMount=="function"&&(i.flags|=4194308),v=!0}else if(r===null){m=i.stateNode;var N=i.memoizedProps,X=gi(s,N);m.props=X;var ie=m.context,ge=s.contextType;A=Yi,typeof ge=="object"&&ge!==null&&(A=Ea(ge));var Ee=s.getDerivedStateFromProps;ge=typeof Ee=="function"||typeof m.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,ge||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(N||ie!==A)&&ey(i,m,v,A),yn=!1;var ue=i.memoizedState;m.state=ue,nu(i,v,m,p),ru(),ie=i.memoizedState,N||ue!==ie||yn?(typeof Ee=="function"&&(qc(i,s,Ee,v),ie=i.memoizedState),(X=yn||$p(i,s,X,v,ue,ie,A))?(ge||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(i.flags|=4194308)):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=v,i.memoizedState=ie),m.props=v,m.state=ie,m.context=A,v=X):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),v=!1)}else{m=i.stateNode,hc(r,i),A=i.memoizedProps,ge=gi(s,A),m.props=ge,Ee=i.pendingProps,ue=m.context,ie=s.contextType,X=Yi,typeof ie=="object"&&ie!==null&&(X=Ea(ie)),N=s.getDerivedStateFromProps,(ie=typeof N=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(A!==Ee||ue!==X)&&ey(i,m,v,X),yn=!1,ue=i.memoizedState,m.state=ue,nu(i,v,m,p),ru();var ve=i.memoizedState;A!==Ee||ue!==ve||yn||r!==null&&r.dependencies!==null&&Ms(r.dependencies)?(typeof N=="function"&&(qc(i,s,N,v),ve=i.memoizedState),(ge=yn||$p(i,s,ge,v,ue,ve,X)||r!==null&&r.dependencies!==null&&Ms(r.dependencies))?(ie||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(v,ve,X),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(v,ve,X)),typeof m.componentDidUpdate=="function"&&(i.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof m.componentDidUpdate!="function"||A===r.memoizedProps&&ue===r.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||A===r.memoizedProps&&ue===r.memoizedState||(i.flags|=1024),i.memoizedProps=v,i.memoizedState=ve),m.props=v,m.state=ve,m.context=X,v=ge):(typeof m.componentDidUpdate!="function"||A===r.memoizedProps&&ue===r.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||A===r.memoizedProps&&ue===r.memoizedState||(i.flags|=1024),v=!1)}return m=v,Ks(r,i),v=(i.flags&128)!==0,m||v?(m=i.stateNode,s=v&&typeof s.getDerivedStateFromError!="function"?null:m.render(),i.flags|=1,r!==null&&v?(i.child=di(i,r.child,null,p),i.child=di(i,null,s,p)):xa(r,i,s,p),i.memoizedState=m.state,r=i.child):r=Fr(r,i,p),r}function gy(r,i,s,v){return ui(),i.flags|=256,xa(r,i,s,v),i.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yc(r){return{baseLanes:r,cachePool:np()}}function Fc(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=er),r}function py(r,i,s){var v=i.pendingProps,p=!1,m=(i.flags&128)!==0,A;if((A=m)||(A=r!==null&&r.memoizedState===null?!1:(Kt.current&2)!==0),A&&(p=!0,i.flags&=-129),A=(i.flags&32)!==0,i.flags&=-33,r===null){if(ot){if(p?En(i):xn(),(r=Ot)?(r=Tm(r,cr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:dn!==null?{id:Cr,overflow:Ar}:null,retryLane:536870912,hydrationErrors:null},s=Zg(r),s.return=i,i.child=s,ba=i,Ot=null)):r=null,r===null)throw gn(i);return Av(r)?i.lanes=32:i.lanes=536870912,null}var N=v.children;return v=v.fallback,p?(xn(),p=i.mode,N=Zs({mode:"hidden",children:N},p),v=li(v,p,s,null),N.return=i,v.return=i,N.sibling=v,i.child=N,v=i.child,v.memoizedState=Yc(s),v.childLanes=Fc(r,A,s),i.memoizedState=Gc,ou(null,v)):(En(i),Ic(i,N))}var X=r.memoizedState;if(X!==null&&(N=X.dehydrated,N!==null)){if(m)i.flags&256?(En(i),i.flags&=-257,i=Xc(r,i,s)):i.memoizedState!==null?(xn(),i.child=r.child,i.flags|=128,i=null):(xn(),N=v.fallback,p=i.mode,v=Zs({mode:"visible",children:v.children},p),N=li(N,p,s,null),N.flags|=2,v.return=i,N.return=i,v.sibling=N,i.child=v,di(i,r.child,null,s),v=i.child,v.memoizedState=Yc(s),v.childLanes=Fc(r,A,s),i.memoizedState=Gc,i=ou(null,v));else if(En(i),Av(N)){if(A=N.nextSibling&&N.nextSibling.dataset,A)var ie=A.dgst;A=ie,v=Error(n(419)),v.stack="",v.digest=A,Jl({value:v,source:null,stack:null}),i=Xc(r,i,s)}else if($t||ji(r,i,s,!1),A=(s&r.childLanes)!==0,$t||A){if(A=Bt,A!==null&&(v=Gt(A,s),v!==0&&v!==X.retryLane))throw X.retryLane=v,ii(r,v),Fa(A,r,v),Hc;Cv(N)||no(),i=Xc(r,i,s)}else Cv(N)?(i.flags|=192,i.child=r.child,i=null):(r=X.treeContext,Ot=dr(N.nextSibling),ba=i,ot=!0,hn=null,cr=!1,r!==null&&Wg(i,r),i=Ic(i,v.children),i.flags|=4096);return i}return p?(xn(),N=v.fallback,p=i.mode,X=r.child,ie=X.sibling,v=Vr(X,{mode:"hidden",children:v.children}),v.subtreeFlags=X.subtreeFlags&65011712,ie!==null?N=Vr(ie,N):(N=li(N,p,s,null),N.flags|=2),N.return=i,v.return=i,v.sibling=N,i.child=v,ou(null,v),v=i.child,N=r.child.memoizedState,N===null?N=Yc(s):(p=N.cachePool,p!==null?(X=Jt._currentValue,p=p.parent!==X?{parent:X,pool:X}:p):p=np(),N={baseLanes:N.baseLanes|s,cachePool:p}),v.memoizedState=N,v.childLanes=Fc(r,A,s),i.memoizedState=Gc,ou(r.child,v)):(En(i),s=r.child,r=s.sibling,s=Vr(s,{mode:"visible",children:v.children}),s.return=i,s.sibling=null,r!==null&&(A=i.deletions,A===null?(i.deletions=[r],i.flags|=16):A.push(r)),i.child=s,i.memoizedState=null,s)}function Ic(r,i){return i=Zs({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Zs(r,i){return r=Qa(22,r,null,i),r.lanes=0,r}function Xc(r,i,s){return di(i,r.child,null,s),r=Ic(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function yy(r,i,s){r.lanes|=i;var v=r.alternate;v!==null&&(v.lanes|=i),uc(r.return,i,s)}function jc(r,i,s,v,p,m){var A=r.memoizedState;A===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:v,tail:s,tailMode:p,treeForkCount:m}:(A.isBackwards=i,A.rendering=null,A.renderingStartTime=0,A.last=v,A.tail=s,A.tailMode=p,A.treeForkCount=m)}function my(r,i,s){var v=i.pendingProps,p=v.revealOrder,m=v.tail;v=v.children;var A=Kt.current,N=(A&2)!==0;if(N?(A=A&1|2,i.flags|=128):A&=1,Z(Kt,A),xa(r,i,v,s),v=ot?Ql:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&yy(r,s,i);else if(r.tag===19)yy(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&&qs(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),jc(i,!1,p,s,m,v);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&qs(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}jc(i,!0,s,null,m,v);break;case"together":jc(i,!1,null,null,void 0,v);break;default:i.memoizedState=null}return i.child}function Fr(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Tn|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(ji(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=Vr(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=Vr(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Kc(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Ms(r)))}function Lx(r,i,s){switch(i.tag){case 3:we(i,i.stateNode.containerInfo),pn(i,Jt,r.memoizedState.cache),ui();break;case 27:case 5:$(i);break;case 4:we(i,i.stateNode.containerInfo);break;case 10:pn(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,bc(i),null;break;case 13:var v=i.memoizedState;if(v!==null)return v.dehydrated!==null?(En(i),i.flags|=128,null):(s&i.child.childLanes)!==0?py(r,i,s):(En(i),r=Fr(r,i,s),r!==null?r.sibling:null);En(i);break;case 19:var p=(r.flags&128)!==0;if(v=(s&i.childLanes)!==0,v||(ji(r,i,s,!1),v=(s&i.childLanes)!==0),p){if(v)return my(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Z(Kt,Kt.current),v)break;return null;case 22:return i.lanes=0,fy(r,i,s,i.pendingProps);case 24:pn(i,Jt,r.memoizedState.cache)}return Fr(r,i,s)}function by(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)$t=!0;else{if(!Kc(r,s)&&(i.flags&128)===0)return $t=!1,Lx(r,i,s);$t=(r.flags&131072)!==0}else $t=!1,ot&&(i.flags&1048576)!==0&&Jg(i,Ql,i.index);switch(i.lanes=0,i.tag){case 16:e:{var v=i.pendingProps;if(r=ci(i.elementType),i.type=r,typeof r=="function")$f(r)?(v=gi(r,v),i.tag=1,i=hy(null,i,r,v,s)):(i.tag=0,i=Pc(null,i,r,v,s));else{if(r!=null){var p=r.$$typeof;if(p===D){i.tag=11,i=uy(null,i,r,v,s);break e}else if(p===B){i.tag=14,i=sy(null,i,r,v,s);break e}}throw i=Y(r)||r,Error(n(306,i,""))}}return i;case 0:return Pc(r,i,i.type,i.pendingProps,s);case 1:return v=i.type,p=gi(v,i.pendingProps),hy(r,i,v,p,s);case 3:e:{if(we(i,i.stateNode.containerInfo),r===null)throw Error(n(387));v=i.pendingProps;var m=i.memoizedState;p=m.element,hc(r,i),nu(i,v,null,s);var A=i.memoizedState;if(v=A.cache,pn(i,Jt,v),v!==m.cache&&sc(i,[Jt],s,!0),ru(),v=A.element,m.isDehydrated)if(m={element:v,isDehydrated:!1,cache:A.cache},i.updateQueue.baseState=m,i.memoizedState=m,i.flags&256){i=gy(r,i,v,s);break e}else if(v!==p){p=sr(Error(n(424)),i),Jl(p),i=gy(r,i,v,s);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Ot=dr(r.firstChild),ba=i,ot=!0,hn=null,cr=!0,s=fp(i,null,v,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ui(),v===p){i=Fr(r,i,s);break e}xa(r,i,v,s)}i=i.child}return i;case 26:return Ks(r,i),r===null?(s=Rm(i.type,null,i.pendingProps,null))?i.memoizedState=s:ot||(s=i.type,r=i.pendingProps,v=co(se.current).createElement(s),v[kt]=i,v[ra]=r,Sa(v,s,r),Qt(v),i.stateNode=v):i.memoizedState=Rm(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return $(i),r===null&&ot&&(v=i.stateNode=Dm(i.type,i.pendingProps,se.current),ba=i,cr=!0,p=Ot,Mn(i.type)?(Dv=p,Ot=dr(v.firstChild)):Ot=p),xa(r,i,i.pendingProps.children,s),Ks(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&ot&&((p=v=Ot)&&(v=fS(v,i.type,i.pendingProps,cr),v!==null?(i.stateNode=v,ba=i,Ot=dr(v.firstChild),cr=!1,p=!0):p=!1),p||gn(i)),$(i),p=i.type,m=i.pendingProps,A=r!==null?r.memoizedProps:null,v=m.children,Sv(p,m)?v=null:A!==null&&Sv(p,A)&&(i.flags|=32),i.memoizedState!==null&&(p=xc(r,i,Cx,null,null,s),Tu._currentValue=p),Ks(r,i),xa(r,i,v,s),i.child;case 6:return r===null&&ot&&((r=s=Ot)&&(s=cS(s,i.pendingProps,cr),s!==null?(i.stateNode=s,ba=i,Ot=null,r=!0):r=!1),r||gn(i)),null;case 13:return py(r,i,s);case 4:return we(i,i.stateNode.containerInfo),v=i.pendingProps,r===null?i.child=di(i,null,v,s):xa(r,i,v,s),i.child;case 11:return uy(r,i,i.type,i.pendingProps,s);case 7:return xa(r,i,i.pendingProps,s),i.child;case 8:return xa(r,i,i.pendingProps.children,s),i.child;case 12:return xa(r,i,i.pendingProps.children,s),i.child;case 10:return v=i.pendingProps,pn(i,i.type,v.value),xa(r,i,v.children,s),i.child;case 9:return p=i.type._context,v=i.pendingProps.children,oi(i),p=Ea(p),v=v(p),i.flags|=1,xa(r,i,v,s),i.child;case 14:return sy(r,i,i.type,i.pendingProps,s);case 15:return oy(r,i,i.type,i.pendingProps,s);case 19:return my(r,i,s);case 31:return Nx(r,i,s);case 22:return fy(r,i,s,i.pendingProps);case 24:return oi(i),v=Ea(Jt),r===null?(p=cc(),p===null&&(p=Bt,m=oc(),p.pooledCache=m,m.refCount++,m!==null&&(p.pooledCacheLanes|=s),p=m),i.memoizedState={parent:v,cache:p},dc(i),pn(i,Jt,p)):((r.lanes&s)!==0&&(hc(r,i),nu(i,null,null,s),ru()),p=r.memoizedState,m=i.memoizedState,p.parent!==v?(p={parent:v,cache:v},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),pn(i,Jt,v)):(v=m.cache,pn(i,Jt,v),v!==p.cache&&sc(i,[Jt],s,!0))),xa(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(n(156,i.tag))}function Ir(r){r.flags|=4}function Zc(r,i,s,v,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(Xy())r.flags|=8192;else throw vi=Ns,vc}else r.flags&=-16777217}function Ey(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!km(i))if(Xy())r.flags|=8192;else throw vi=Ns,vc}function Qs(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?$e():536870912,r.lanes|=i,il|=i)}function fu(r,i){if(!ot)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 v=null;s!==null;)s.alternate!==null&&(v=s),s=s.sibling;v===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:v.sibling=null}}function Nt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,v=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,v|=p.subtreeFlags&65011712,v|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,v|=p.subtreeFlags,v|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=v,r.childLanes=s,i}function kx(r,i,s){var v=i.pendingProps;switch(rc(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(i),null;case 1:return Nt(i),null;case 3:return s=i.stateNode,v=null,r!==null&&(v=r.memoizedState.cache),i.memoizedState.cache!==v&&(i.flags|=2048),Pr(Jt),de(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Xi(i)?Ir(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,ic())),Nt(i),null;case 26:var p=i.type,m=i.memoizedState;return r===null?(Ir(i),m!==null?(Nt(i),Ey(i,m)):(Nt(i),Zc(i,p,null,v,s))):m?m!==r.memoizedState?(Ir(i),Nt(i),Ey(i,m)):(Nt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==v&&Ir(i),Nt(i),Zc(i,p,r,v,s)),null;case 27:if(re(i),s=se.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==v&&Ir(i);else{if(!v){if(i.stateNode===null)throw Error(n(166));return Nt(i),null}r=W.current,Xi(i)?$g(i):(r=Dm(p,v,s),i.stateNode=r,Ir(i))}return Nt(i),null;case 5:if(re(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==v&&Ir(i);else{if(!v){if(i.stateNode===null)throw Error(n(166));return Nt(i),null}if(m=W.current,Xi(i))$g(i);else{var A=co(se.current);switch(m){case 1:m=A.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:m=A.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":m=A.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":m=A.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":m=A.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof v.is=="string"?A.createElement("select",{is:v.is}):A.createElement("select"),v.multiple?m.multiple=!0:v.size&&(m.size=v.size);break;default:m=typeof v.is=="string"?A.createElement(p,{is:v.is}):A.createElement(p)}}m[kt]=i,m[ra]=v;e:for(A=i.child;A!==null;){if(A.tag===5||A.tag===6)m.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===i)break e;for(;A.sibling===null;){if(A.return===null||A.return===i)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}i.stateNode=m;e:switch(Sa(m,p,v),p){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Ir(i)}}return Nt(i),Zc(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==v&&Ir(i);else{if(typeof v!="string"&&i.stateNode===null)throw Error(n(166));if(r=se.current,Xi(i)){if(r=i.stateNode,s=i.memoizedProps,v=null,p=ba,p!==null)switch(p.tag){case 27:case 5:v=p.memoizedProps}r[kt]=i,r=!!(r.nodeValue===s||v!==null&&v.suppressHydrationWarning===!0||pm(r.nodeValue,s)),r||gn(i,!0)}else r=co(r).createTextNode(v),r[kt]=i,i.stateNode=r}return Nt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(v=Xi(i),s!==null){if(r===null){if(!v)throw Error(n(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(557));r[kt]=i}else ui(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),r=!1}else s=ic(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Wa(i),i):(Wa(i),null);if((i.flags&128)!==0)throw Error(n(558))}return Nt(i),null;case 13:if(v=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Xi(i),v!==null&&v.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[kt]=i}else ui(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),p=!1}else p=ic(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Wa(i),i):(Wa(i),null)}return Wa(i),(i.flags&128)!==0?(i.lanes=s,i):(s=v!==null,r=r!==null&&r.memoizedState!==null,s&&(v=i.child,p=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(p=v.alternate.memoizedState.cachePool.pool),m=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(m=v.memoizedState.cachePool.pool),m!==p&&(v.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Qs(i,i.updateQueue),Nt(i),null);case 4:return de(),r===null&&yv(i.stateNode.containerInfo),Nt(i),null;case 10:return Pr(i.type),Nt(i),null;case 19:if(G(Kt),v=i.memoizedState,v===null)return Nt(i),null;if(p=(i.flags&128)!==0,m=v.rendering,m===null)if(p)fu(v,!1);else{if(Ft!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(m=qs(r),m!==null){for(i.flags|=128,fu(v,!1),r=m.updateQueue,i.updateQueue=r,Qs(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Kg(s,r),s=s.sibling;return Z(Kt,Kt.current&1|2),ot&&Ur(i,v.treeForkCount),i.child}r=r.sibling}v.tail!==null&&De()>to&&(i.flags|=128,p=!0,fu(v,!1),i.lanes=4194304)}else{if(!p)if(r=qs(m),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Qs(i,r),fu(v,!0),v.tail===null&&v.tailMode==="hidden"&&!m.alternate&&!ot)return Nt(i),null}else 2*De()-v.renderingStartTime>to&&s!==536870912&&(i.flags|=128,p=!0,fu(v,!1),i.lanes=4194304);v.isBackwards?(m.sibling=i.child,i.child=m):(r=v.last,r!==null?r.sibling=m:i.child=m,v.last=m)}return v.tail!==null?(r=v.tail,v.rendering=r,v.tail=r.sibling,v.renderingStartTime=De(),r.sibling=null,s=Kt.current,Z(Kt,p?s&1|2:s&1),ot&&Ur(i,v.treeForkCount),r):(Nt(i),null);case 22:case 23:return Wa(i),mc(),v=i.memoizedState!==null,r!==null?r.memoizedState!==null!==v&&(i.flags|=8192):v&&(i.flags|=8192),v?(s&536870912)!==0&&(i.flags&128)===0&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),s=i.updateQueue,s!==null&&Qs(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),v=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(v=i.memoizedState.cachePool.pool),v!==s&&(i.flags|=2048),r!==null&&G(fi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Pr(Jt),Nt(i),null;case 25:return null;case 30:return null}throw Error(n(156,i.tag))}function _x(r,i){switch(rc(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Pr(Jt),de(),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(Wa(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(Wa(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(Kt),null;case 4:return de(),null;case 10:return Pr(i.type),null;case 22:case 23:return Wa(i),mc(),r!==null&&G(fi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Pr(Jt),null;case 25:return null;default:return null}}function xy(r,i){switch(rc(i),i.tag){case 3:Pr(Jt),de();break;case 26:case 27:case 5:re(i);break;case 4:de();break;case 31:i.memoizedState!==null&&Wa(i);break;case 13:Wa(i);break;case 19:G(Kt);break;case 10:Pr(i.type);break;case 22:case 23:Wa(i),mc(),r!==null&&G(fi);break;case 24:Pr(Jt)}}function cu(r,i){try{var s=i.updateQueue,v=s!==null?s.lastEffect:null;if(v!==null){var p=v.next;s=p;do{if((s.tag&r)===r){v=void 0;var m=s.create,A=s.inst;v=m(),A.destroy=v}s=s.next}while(s!==p)}}catch(N){St(i,i.return,N)}}function Sn(r,i,s){try{var v=i.updateQueue,p=v!==null?v.lastEffect:null;if(p!==null){var m=p.next;v=m;do{if((v.tag&r)===r){var A=v.inst,N=A.destroy;if(N!==void 0){A.destroy=void 0,p=i;var X=s,ie=N;try{ie()}catch(ge){St(p,X,ge)}}}v=v.next}while(v!==m)}}catch(ge){St(i,i.return,ge)}}function Sy(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{vp(i,s)}catch(v){St(r,r.return,v)}}}function wy(r,i,s){s.props=gi(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(v){St(r,i,v)}}function vu(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var v=r.stateNode;break;case 30:v=r.stateNode;break;default:v=r.stateNode}typeof s=="function"?r.refCleanup=s(v):s.current=v}}catch(p){St(r,i,p)}}function Dr(r,i){var s=r.ref,v=r.refCleanup;if(s!==null)if(typeof v=="function")try{v()}catch(p){St(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){St(r,i,p)}else s.current=null}function Ty(r){var i=r.type,s=r.memoizedProps,v=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&v.focus();break e;case"img":s.src?v.src=s.src:s.srcSet&&(v.srcset=s.srcSet)}}catch(p){St(r,r.return,p)}}function Qc(r,i,s){try{var v=r.stateNode;nS(v,r.type,s,i),v[ra]=i}catch(p){St(r,r.return,p)}}function Cy(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Mn(r.type)||r.tag===4}function Jc(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Cy(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 Wc(r,i,s){var v=r.tag;if(v===5||v===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=_r));else if(v!==4&&(v===27&&Mn(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Wc(r,i,s),r=r.sibling;r!==null;)Wc(r,i,s),r=r.sibling}function Js(r,i,s){var v=r.tag;if(v===5||v===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(v!==4&&(v===27&&Mn(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Js(r,i,s),r=r.sibling;r!==null;)Js(r,i,s),r=r.sibling}function Ay(r){var i=r.stateNode,s=r.memoizedProps;try{for(var v=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Sa(i,v,s),i[kt]=r,i[ra]=s}catch(m){St(r,r.return,m)}}var Xr=!1,ea=!1,$c=!1,Dy=typeof WeakSet=="function"?WeakSet:Set,ha=null;function qx(r,i){if(r=r.containerInfo,Ev=bo,r=Ug(r),Xf(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var v=s.getSelection&&s.getSelection();if(v&&v.rangeCount!==0){s=v.anchorNode;var p=v.anchorOffset,m=v.focusNode;v=v.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var A=0,N=-1,X=-1,ie=0,ge=0,Ee=r,ue=null;t:for(;;){for(var ve;Ee!==s||p!==0&&Ee.nodeType!==3||(N=A+p),Ee!==m||v!==0&&Ee.nodeType!==3||(X=A+v),Ee.nodeType===3&&(A+=Ee.nodeValue.length),(ve=Ee.firstChild)!==null;)ue=Ee,Ee=ve;for(;;){if(Ee===r)break t;if(ue===s&&++ie===p&&(N=A),ue===m&&++ge===v&&(X=A),(ve=Ee.nextSibling)!==null)break;Ee=ue,ue=Ee.parentNode}Ee=ve}s=N===-1||X===-1?null:{start:N,end:X}}else s=null}s=s||{start:0,end:0}}else s=null;for(xv={focusedElem:r,selectionRange:s},bo=!1,ha=i;ha!==null;)if(i=ha,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,ha=r;else for(;ha!==null;){switch(i=ha,m=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&&m!==null){r=void 0,s=i,p=m.memoizedProps,m=m.memoizedState,v=s.stateNode;try{var Le=gi(s.type,p);r=v.getSnapshotBeforeUpdate(Le,m),v.__reactInternalSnapshotBeforeUpdate=r}catch(Ie){St(s,s.return,Ie)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Tv(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Tv(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,ha=r;break}ha=i.return}}function By(r,i,s){var v=s.flags;switch(s.tag){case 0:case 11:case 15:Kr(r,s),v&4&&cu(5,s);break;case 1:if(Kr(r,s),v&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(A){St(s,s.return,A)}else{var p=gi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(A){St(s,s.return,A)}}v&64&&Sy(s),v&512&&vu(s,s.return);break;case 3:if(Kr(r,s),v&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{vp(r,i)}catch(A){St(s,s.return,A)}}break;case 27:i===null&&v&4&&Ay(s);case 26:case 5:Kr(r,s),i===null&&v&4&&Ty(s),v&512&&vu(s,s.return);break;case 12:Kr(r,s);break;case 31:Kr(r,s),v&4&&zy(r,s);break;case 13:Kr(r,s),v&4&&Oy(r,s),v&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=Xx.bind(null,s),vS(r,s))));break;case 22:if(v=s.memoizedState!==null||Xr,!v){i=i!==null&&i.memoizedState!==null||ea,p=Xr;var m=ea;Xr=v,(ea=i)&&!m?Zr(r,s,(s.subtreeFlags&8772)!==0):Kr(r,s),Xr=p,ea=m}break;case 30:break;default:Kr(r,s)}}function My(r){var i=r.alternate;i!==null&&(r.alternate=null,My(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Ni(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 _t=null,Ha=!1;function jr(r,i,s){for(s=s.child;s!==null;)Ry(r,i,s),s=s.sibling}function Ry(r,i,s){if(te&&typeof te.onCommitFiberUnmount=="function")try{te.onCommitFiberUnmount(k,s)}catch{}switch(s.tag){case 26:ea||Dr(s,i),jr(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:ea||Dr(s,i);var v=_t,p=Ha;Mn(s.type)&&(_t=s.stateNode,Ha=!1),jr(r,i,s),xu(s.stateNode),_t=v,Ha=p;break;case 5:ea||Dr(s,i);case 6:if(v=_t,p=Ha,_t=null,jr(r,i,s),_t=v,Ha=p,_t!==null)if(Ha)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(s.stateNode)}catch(m){St(s,i,m)}else try{_t.removeChild(s.stateNode)}catch(m){St(s,i,m)}break;case 18:_t!==null&&(Ha?(r=_t,Sm(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),dl(r)):Sm(_t,s.stateNode));break;case 4:v=_t,p=Ha,_t=s.stateNode.containerInfo,Ha=!0,jr(r,i,s),_t=v,Ha=p;break;case 0:case 11:case 14:case 15:Sn(2,s,i),ea||Sn(4,s,i),jr(r,i,s);break;case 1:ea||(Dr(s,i),v=s.stateNode,typeof v.componentWillUnmount=="function"&&wy(s,i,v)),jr(r,i,s);break;case 21:jr(r,i,s);break;case 22:ea=(v=ea)||s.memoizedState!==null,jr(r,i,s),ea=v;break;default:jr(r,i,s)}}function zy(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{dl(r)}catch(s){St(i,i.return,s)}}}function Oy(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{dl(r)}catch(s){St(i,i.return,s)}}function Vx(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Dy),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Dy),i;default:throw Error(n(435,r.tag))}}function Ws(r,i){var s=Vx(r);i.forEach(function(v){if(!s.has(v)){s.add(v);var p=jx.bind(null,r,v);v.then(p,p)}})}function Pa(r,i){var s=i.deletions;if(s!==null)for(var v=0;v<s.length;v++){var p=s[v],m=r,A=i,N=A;e:for(;N!==null;){switch(N.tag){case 27:if(Mn(N.type)){_t=N.stateNode,Ha=!1;break e}break;case 5:_t=N.stateNode,Ha=!1;break e;case 3:case 4:_t=N.stateNode.containerInfo,Ha=!0;break e}N=N.return}if(_t===null)throw Error(n(160));Ry(m,A,p),_t=null,Ha=!1,m=p.alternate,m!==null&&(m.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Ny(i,r),i=i.sibling}var br=null;function Ny(r,i){var s=r.alternate,v=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Pa(i,r),Ga(r),v&4&&(Sn(3,r,r.return),cu(3,r),Sn(5,r,r.return));break;case 1:Pa(i,r),Ga(r),v&512&&(ea||s===null||Dr(s,s.return)),v&64&&Xr&&(r=r.updateQueue,r!==null&&(v=r.callbacks,v!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?v:s.concat(v))));break;case 26:var p=br;if(Pa(i,r),Ga(r),v&512&&(ea||s===null||Dr(s,s.return)),v&4){var m=s!==null?s.memoizedState:null;if(v=r.memoizedState,s===null)if(v===null)if(r.stateNode===null){e:{v=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(v){case"title":m=p.getElementsByTagName("title")[0],(!m||m[va]||m[kt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=p.createElement(v),p.head.insertBefore(m,p.querySelector("head > title"))),Sa(m,v,s),m[kt]=r,Qt(m),v=m;break e;case"link":var A=Nm("link","href",p).get(v+(s.href||""));if(A){for(var N=0;N<A.length;N++)if(m=A[N],m.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&m.getAttribute("rel")===(s.rel==null?null:s.rel)&&m.getAttribute("title")===(s.title==null?null:s.title)&&m.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){A.splice(N,1);break t}}m=p.createElement(v),Sa(m,v,s),p.head.appendChild(m);break;case"meta":if(A=Nm("meta","content",p).get(v+(s.content||""))){for(N=0;N<A.length;N++)if(m=A[N],m.getAttribute("content")===(s.content==null?null:""+s.content)&&m.getAttribute("name")===(s.name==null?null:s.name)&&m.getAttribute("property")===(s.property==null?null:s.property)&&m.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&m.getAttribute("charset")===(s.charSet==null?null:s.charSet)){A.splice(N,1);break t}}m=p.createElement(v),Sa(m,v,s),p.head.appendChild(m);break;default:throw Error(n(468,v))}m[kt]=r,Qt(m),v=m}r.stateNode=v}else Lm(p,r.type,r.stateNode);else r.stateNode=Om(p,v,r.memoizedProps);else m!==v?(m===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):m.count--,v===null?Lm(p,r.type,r.stateNode):Om(p,v,r.memoizedProps)):v===null&&r.stateNode!==null&&Qc(r,r.memoizedProps,s.memoizedProps)}break;case 27:Pa(i,r),Ga(r),v&512&&(ea||s===null||Dr(s,s.return)),s!==null&&v&4&&Qc(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Pa(i,r),Ga(r),v&512&&(ea||s===null||Dr(s,s.return)),r.flags&32){p=r.stateNode;try{_i(p,"")}catch(Le){St(r,r.return,Le)}}v&4&&r.stateNode!=null&&(p=r.memoizedProps,Qc(r,p,s!==null?s.memoizedProps:p)),v&1024&&($c=!0);break;case 6:if(Pa(i,r),Ga(r),v&4){if(r.stateNode===null)throw Error(n(162));v=r.memoizedProps,s=r.stateNode;try{s.nodeValue=v}catch(Le){St(r,r.return,Le)}}break;case 3:if(go=null,p=br,br=vo(i.containerInfo),Pa(i,r),br=p,Ga(r),v&4&&s!==null&&s.memoizedState.isDehydrated)try{dl(i.containerInfo)}catch(Le){St(r,r.return,Le)}$c&&($c=!1,Ly(r));break;case 4:v=br,br=vo(r.stateNode.containerInfo),Pa(i,r),Ga(r),br=v;break;case 12:Pa(i,r),Ga(r);break;case 31:Pa(i,r),Ga(r),v&4&&(v=r.updateQueue,v!==null&&(r.updateQueue=null,Ws(r,v)));break;case 13:Pa(i,r),Ga(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(eo=De()),v&4&&(v=r.updateQueue,v!==null&&(r.updateQueue=null,Ws(r,v)));break;case 22:p=r.memoizedState!==null;var X=s!==null&&s.memoizedState!==null,ie=Xr,ge=ea;if(Xr=ie||p,ea=ge||X,Pa(i,r),ea=ge,Xr=ie,Ga(r),v&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||X||Xr||ea||pi(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){X=s=i;try{if(m=X.stateNode,p)A=m.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{N=X.stateNode;var Ee=X.memoizedProps.style,ue=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;N.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Le){St(X,X.return,Le)}}}else if(i.tag===6){if(s===null){X=i;try{X.stateNode.nodeValue=p?"":X.memoizedProps}catch(Le){St(X,X.return,Le)}}}else if(i.tag===18){if(s===null){X=i;try{var ve=X.stateNode;p?wm(ve,!0):wm(X.stateNode,!1)}catch(Le){St(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}v&4&&(v=r.updateQueue,v!==null&&(s=v.retryQueue,s!==null&&(v.retryQueue=null,Ws(r,s))));break;case 19:Pa(i,r),Ga(r),v&4&&(v=r.updateQueue,v!==null&&(r.updateQueue=null,Ws(r,v)));break;case 30:break;case 21:break;default:Pa(i,r),Ga(r)}}function Ga(r){var i=r.flags;if(i&2){try{for(var s,v=r.return;v!==null;){if(Cy(v)){s=v;break}v=v.return}if(s==null)throw Error(n(160));switch(s.tag){case 27:var p=s.stateNode,m=Jc(r);Js(r,m,p);break;case 5:var A=s.stateNode;s.flags&32&&(_i(A,""),s.flags&=-33);var N=Jc(r);Js(r,N,A);break;case 3:case 4:var X=s.stateNode.containerInfo,ie=Jc(r);Wc(r,ie,X);break;default:throw Error(n(161))}}catch(ge){St(r,r.return,ge)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Ly(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Ly(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Kr(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)By(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:Sn(4,i,i.return),pi(i);break;case 1:Dr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&wy(i,i.return,s),pi(i);break;case 27:xu(i.stateNode);case 26:case 5:Dr(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 Zr(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var v=i.alternate,p=r,m=i,A=m.flags;switch(m.tag){case 0:case 11:case 15:Zr(p,m,s),cu(4,m);break;case 1:if(Zr(p,m,s),v=m,p=v.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ie){St(v,v.return,ie)}if(v=m,p=v.updateQueue,p!==null){var N=v.stateNode;try{var X=p.shared.hiddenCallbacks;if(X!==null)for(p.shared.hiddenCallbacks=null,p=0;p<X.length;p++)cp(X[p],N)}catch(ie){St(v,v.return,ie)}}s&&A&64&&Sy(m),vu(m,m.return);break;case 27:Ay(m);case 26:case 5:Zr(p,m,s),s&&v===null&&A&4&&Ty(m),vu(m,m.return);break;case 12:Zr(p,m,s);break;case 31:Zr(p,m,s),s&&A&4&&zy(p,m);break;case 13:Zr(p,m,s),s&&A&4&&Oy(p,m);break;case 22:m.memoizedState===null&&Zr(p,m,s),vu(m,m.return);break;case 30:break;default:Zr(p,m,s)}i=i.sibling}}function ev(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&&Wl(s))}function tv(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Wl(r))}function Er(r,i,s,v){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ky(r,i,s,v),i=i.sibling}function ky(r,i,s,v){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Er(r,i,s,v),p&2048&&cu(9,i);break;case 1:Er(r,i,s,v);break;case 3:Er(r,i,s,v),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Wl(r)));break;case 12:if(p&2048){Er(r,i,s,v),r=i.stateNode;try{var m=i.memoizedProps,A=m.id,N=m.onPostCommit;typeof N=="function"&&N(A,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(X){St(i,i.return,X)}}else Er(r,i,s,v);break;case 31:Er(r,i,s,v);break;case 13:Er(r,i,s,v);break;case 23:break;case 22:m=i.stateNode,A=i.alternate,i.memoizedState!==null?m._visibility&2?Er(r,i,s,v):du(r,i):m._visibility&2?Er(r,i,s,v):(m._visibility|=2,al(r,i,s,v,(i.subtreeFlags&10256)!==0||!1)),p&2048&&ev(A,i);break;case 24:Er(r,i,s,v),p&2048&&tv(i.alternate,i);break;default:Er(r,i,s,v)}}function al(r,i,s,v,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var m=r,A=i,N=s,X=v,ie=A.flags;switch(A.tag){case 0:case 11:case 15:al(m,A,N,X,p),cu(8,A);break;case 23:break;case 22:var ge=A.stateNode;A.memoizedState!==null?ge._visibility&2?al(m,A,N,X,p):du(m,A):(ge._visibility|=2,al(m,A,N,X,p)),p&&ie&2048&&ev(A.alternate,A);break;case 24:al(m,A,N,X,p),p&&ie&2048&&tv(A.alternate,A);break;default:al(m,A,N,X,p)}i=i.sibling}}function du(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,v=i,p=v.flags;switch(v.tag){case 22:du(s,v),p&2048&&ev(v.alternate,v);break;case 24:du(s,v),p&2048&&tv(v.alternate,v);break;default:du(s,v)}i=i.sibling}}var hu=8192;function rl(r,i,s){if(r.subtreeFlags&hu)for(r=r.child;r!==null;)_y(r,i,s),r=r.sibling}function _y(r,i,s){switch(r.tag){case 26:rl(r,i,s),r.flags&hu&&r.memoizedState!==null&&TS(s,br,r.memoizedState,r.memoizedProps);break;case 5:rl(r,i,s);break;case 3:case 4:var v=br;br=vo(r.stateNode.containerInfo),rl(r,i,s),br=v;break;case 22:r.memoizedState===null&&(v=r.alternate,v!==null&&v.memoizedState!==null?(v=hu,hu=16777216,rl(r,i,s),hu=v):rl(r,i,s));break;default:rl(r,i,s)}}function qy(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 gu(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var v=i[s];ha=v,Uy(v,r)}qy(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Vy(r),r=r.sibling}function Vy(r){switch(r.tag){case 0:case 11:case 15:gu(r),r.flags&2048&&Sn(9,r,r.return);break;case 3:gu(r);break;case 12:gu(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,$s(r)):gu(r);break;default:gu(r)}}function $s(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var v=i[s];ha=v,Uy(v,r)}qy(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Sn(8,i,i.return),$s(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,$s(i));break;default:$s(i)}r=r.sibling}}function Uy(r,i){for(;ha!==null;){var s=ha;switch(s.tag){case 0:case 11:case 15:Sn(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var v=s.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:Wl(s.memoizedState.cache)}if(v=s.child,v!==null)v.return=s,ha=v;else e:for(s=r;ha!==null;){v=ha;var p=v.sibling,m=v.return;if(My(v),v===s){ha=null;break e}if(p!==null){p.return=m,ha=p;break e}ha=m}}}var Ux={getCacheForType:function(r){var i=Ea(Jt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return Ea(Jt).controller.signal}},Hx=typeof WeakMap=="function"?WeakMap:Map,mt=0,Bt=null,nt=null,lt=0,xt=0,$a=null,wn=!1,nl=!1,av=!1,Qr=0,Ft=0,Tn=0,yi=0,rv=0,er=0,il=0,pu=null,Ya=null,nv=!1,eo=0,Hy=0,to=1/0,ao=null,Cn=null,na=0,An=null,ll=null,Jr=0,iv=0,lv=null,Py=null,yu=0,uv=null;function tr(){return(mt&2)!==0&<!==0?lt&-lt:L.T!==null?dv():Ht()}function Gy(){if(er===0)if((lt&536870912)===0||ot){var r=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),er=r}else er=536870912;return r=Ja.current,r!==null&&(r.flags|=32),er}function Fa(r,i,s){(r===Bt&&(xt===2||xt===9)||r.cancelPendingCommit!==null)&&(ul(r,0),Dn(r,lt,er,!1)),wt(r,s),((mt&2)===0||r!==Bt)&&(r===Bt&&((mt&2)===0&&(yi|=s),Ft===4&&Dn(r,lt,er,!1)),Br(r))}function Yy(r,i,s){if((mt&6)!==0)throw Error(n(327));var v=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ne(r,i),p=v?Yx(r,i):ov(r,i,!0),m=v;do{if(p===0){nl&&!v&&Dn(r,i,0,!1);break}else{if(s=r.current.alternate,m&&!Px(s)){p=ov(r,i,!1),m=!1;continue}if(p===2){if(m=i,r.errorRecoveryDisabledLanes&m)var A=0;else A=r.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){i=A;e:{var N=r;p=pu;var X=N.current.memoizedState.isDehydrated;if(X&&(ul(N,A).flags|=256),A=ov(N,A,!1),A!==2){if(av&&!X){N.errorRecoveryDisabledLanes|=m,yi|=m,p=4;break e}m=Ya,Ya=p,m!==null&&(Ya===null?Ya=m:Ya.push.apply(Ya,m))}p=A}if(m=!1,p!==2)continue}}if(p===1){ul(r,0),Dn(r,i,0,!0);break}e:{switch(v=r,m=p,m){case 0:case 1:throw Error(n(345));case 4:if((i&4194048)!==i)break;case 6:Dn(v,i,er,!wn);break e;case 2:Ya=null;break;case 3:case 5:break;default:throw Error(n(329))}if((i&62914560)===i&&(p=eo+300-De(),10<p)){if(Dn(v,i,er,!wn),Ze(v,0,!0)!==0)break e;Jr=i,v.timeoutHandle=Em(Fy.bind(null,v,s,Ya,ao,nv,i,er,yi,il,wn,m,"Throttled",-0,0),p);break e}Fy(v,s,Ya,ao,nv,i,er,yi,il,wn,m,null,-0,0)}}break}while(!0);Br(r)}function Fy(r,i,s,v,p,m,A,N,X,ie,ge,Ee,ue,ve){if(r.timeoutHandle=-1,Ee=i.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_r},_y(i,m,Ee);var Le=(m&62914560)===m?eo-De():(m&4194048)===m?Hy-De():0;if(Le=CS(Ee,Le),Le!==null){Jr=m,r.cancelPendingCommit=Le(Wy.bind(null,r,i,m,s,v,p,A,N,X,ge,Ee,null,ue,ve)),Dn(r,m,A,!ie);return}}Wy(r,i,m,s,v,p,A,N,X)}function Px(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 v=0;v<s.length;v++){var p=s[v],m=p.getSnapshot;p=p.value;try{if(!Za(m(),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 Dn(r,i,s,v){i&=~rv,i&=~yi,r.suspendedLanes|=i,r.pingedLanes&=~i,v&&(r.warmLanes|=i),v=r.expirationTimes;for(var p=i;0<p;){var m=31-oe(p),A=1<<m;v[m]=-1,p&=~A}s!==0&&Ut(r,s,i)}function ro(){return(mt&6)===0?(mu(0),!1):!0}function sv(){if(nt!==null){if(xt===0)var r=nt.return;else r=nt,Hr=si=null,Tc(r),Ji=null,eu=0,r=nt;for(;r!==null;)xy(r.alternate,r),r=r.return;nt=null}}function ul(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,uS(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),Jr=0,sv(),Bt=r,nt=s=Vr(r.current,null),lt=i,xt=0,$a=null,wn=!1,nl=Ne(r,i),av=!1,il=er=rv=yi=Tn=Ft=0,Ya=pu=null,nv=!1,(i&8)!==0&&(i|=i&32);var v=r.entangledLanes;if(v!==0)for(r=r.entanglements,v&=i;0<v;){var p=31-oe(v),m=1<<p;i|=r[p],v&=~m}return Qr=i,Ts(),s}function Iy(r,i){Je=null,L.H=su,i===Qi||i===Os?(i=up(),xt=3):i===vc?(i=up(),xt=4):xt=i===Hc?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,$a=i,nt===null&&(Ft=1,Xs(r,sr(i,r.current)))}function Xy(){var r=Ja.current;return r===null?!0:(lt&4194048)===lt?vr===null:(lt&62914560)===lt||(lt&536870912)!==0?r===vr:!1}function jy(){var r=L.H;return L.H=su,r===null?su:r}function Ky(){var r=L.A;return L.A=Ux,r}function no(){Ft=4,wn||(lt&4194048)!==lt&&Ja.current!==null||(nl=!0),(Tn&134217727)===0&&(yi&134217727)===0||Bt===null||Dn(Bt,lt,er,!1)}function ov(r,i,s){var v=mt;mt|=2;var p=jy(),m=Ky();(Bt!==r||lt!==i)&&(ao=null,ul(r,i)),i=!1;var A=Ft;e:do try{if(xt!==0&&nt!==null){var N=nt,X=$a;switch(xt){case 8:sv(),A=6;break e;case 3:case 2:case 9:case 6:Ja.current===null&&(i=!0);var ie=xt;if(xt=0,$a=null,sl(r,N,X,ie),s&&nl){A=0;break e}break;default:ie=xt,xt=0,$a=null,sl(r,N,X,ie)}}Gx(),A=Ft;break}catch(ge){Iy(r,ge)}while(!0);return i&&r.shellSuspendCounter++,Hr=si=null,mt=v,L.H=p,L.A=m,nt===null&&(Bt=null,lt=0,Ts()),A}function Gx(){for(;nt!==null;)Zy(nt)}function Yx(r,i){var s=mt;mt|=2;var v=jy(),p=Ky();Bt!==r||lt!==i?(ao=null,to=De()+500,ul(r,i)):nl=Ne(r,i);e:do try{if(xt!==0&&nt!==null){i=nt;var m=$a;t:switch(xt){case 1:xt=0,$a=null,sl(r,i,m,1);break;case 2:case 9:if(ip(m)){xt=0,$a=null,Qy(i);break}i=function(){xt!==2&&xt!==9||Bt!==r||(xt=7),Br(r)},m.then(i,i);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:ip(m)?(xt=0,$a=null,Qy(i)):(xt=0,$a=null,sl(r,i,m,7));break;case 5:var A=null;switch(nt.tag){case 26:A=nt.memoizedState;case 5:case 27:var N=nt;if(A?km(A):N.stateNode.complete){xt=0,$a=null;var X=N.sibling;if(X!==null)nt=X;else{var ie=N.return;ie!==null?(nt=ie,io(ie)):nt=null}break t}}xt=0,$a=null,sl(r,i,m,5);break;case 6:xt=0,$a=null,sl(r,i,m,6);break;case 8:sv(),Ft=6;break e;default:throw Error(n(462))}}Fx();break}catch(ge){Iy(r,ge)}while(!0);return Hr=si=null,L.H=v,L.A=p,mt=s,nt!==null?0:(Bt=null,lt=0,Ts(),Ft)}function Fx(){for(;nt!==null&&!He();)Zy(nt)}function Zy(r){var i=by(r.alternate,r,Qr);r.memoizedProps=r.pendingProps,i===null?io(r):nt=i}function Qy(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=dy(s,i,i.pendingProps,i.type,void 0,lt);break;case 11:i=dy(s,i,i.pendingProps,i.type.render,i.ref,lt);break;case 5:Tc(i);default:xy(s,i),i=nt=Kg(i,Qr),i=by(s,i,Qr)}r.memoizedProps=r.pendingProps,i===null?io(r):nt=i}function sl(r,i,s,v){Hr=si=null,Tc(i),Ji=null,eu=0;var p=i.return;try{if(Ox(r,p,i,s,lt)){Ft=1,Xs(r,sr(s,r.current)),nt=null;return}}catch(m){if(p!==null)throw nt=p,m;Ft=1,Xs(r,sr(s,r.current)),nt=null;return}i.flags&32768?(ot||v===1?r=!0:nl||(lt&536870912)!==0?r=!1:(wn=r=!0,(v===2||v===9||v===3||v===6)&&(v=Ja.current,v!==null&&v.tag===13&&(v.flags|=16384))),Jy(i,r)):io(i)}function io(r){var i=r;do{if((i.flags&32768)!==0){Jy(i,wn);return}r=i.return;var s=kx(i.alternate,i,Qr);if(s!==null){nt=s;return}if(i=i.sibling,i!==null){nt=i;return}nt=i=r}while(i!==null);Ft===0&&(Ft=5)}function Jy(r,i){do{var s=_x(r.alternate,r);if(s!==null){s.flags&=32767,nt=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){nt=r;return}nt=r=s}while(r!==null);Ft=6,nt=null}function Wy(r,i,s,v,p,m,A,N,X){r.cancelPendingCommit=null;do lo();while(na!==0);if((mt&6)!==0)throw Error(n(327));if(i!==null){if(i===r.current)throw Error(n(177));if(m=i.lanes|i.childLanes,m|=Jf,ma(r,s,m,A,N,X),r===Bt&&(nt=Bt=null,lt=0),ll=i,An=r,Jr=s,iv=m,lv=p,Py=v,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Kx(st,function(){return rm(),null})):(r.callbackNode=null,r.callbackPriority=0),v=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||v){v=L.T,L.T=null,p=H.p,H.p=2,A=mt,mt|=4;try{qx(r,i,s)}finally{mt=A,H.p=p,L.T=v}}na=1,$y(),em(),tm()}}function $y(){if(na===1){na=0;var r=An,i=ll,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=L.T,L.T=null;var v=H.p;H.p=2;var p=mt;mt|=4;try{Ny(i,r);var m=xv,A=Ug(r.containerInfo),N=m.focusedElem,X=m.selectionRange;if(A!==N&&N&&N.ownerDocument&&Vg(N.ownerDocument.documentElement,N)){if(X!==null&&Xf(N)){var ie=X.start,ge=X.end;if(ge===void 0&&(ge=ie),"selectionStart"in N)N.selectionStart=ie,N.selectionEnd=Math.min(ge,N.value.length);else{var Ee=N.ownerDocument||document,ue=Ee&&Ee.defaultView||window;if(ue.getSelection){var ve=ue.getSelection(),Le=N.textContent.length,Ie=Math.min(X.start,Le),At=X.end===void 0?Ie:Math.min(X.end,Le);!ve.extend&&Ie>At&&(A=At,At=Ie,Ie=A);var ee=qg(N,Ie),K=qg(N,At);if(ee&&K&&(ve.rangeCount!==1||ve.anchorNode!==ee.node||ve.anchorOffset!==ee.offset||ve.focusNode!==K.node||ve.focusOffset!==K.offset)){var ne=Ee.createRange();ne.setStart(ee.node,ee.offset),ve.removeAllRanges(),Ie>At?(ve.addRange(ne),ve.extend(K.node,K.offset)):(ne.setEnd(K.node,K.offset),ve.addRange(ne))}}}}for(Ee=[],ve=N;ve=ve.parentNode;)ve.nodeType===1&&Ee.push({element:ve,left:ve.scrollLeft,top:ve.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<Ee.length;N++){var be=Ee[N];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}bo=!!Ev,xv=Ev=null}finally{mt=p,H.p=v,L.T=s}}r.current=i,na=2}}function em(){if(na===2){na=0;var r=An,i=ll,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=L.T,L.T=null;var v=H.p;H.p=2;var p=mt;mt|=4;try{By(r,i.alternate,i)}finally{mt=p,H.p=v,L.T=s}}na=3}}function tm(){if(na===4||na===3){na=0,je();var r=An,i=ll,s=Jr,v=Py;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?na=5:(na=0,ll=An=null,am(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Cn=null),rr(s),i=i.stateNode,te&&typeof te.onCommitFiberRoot=="function")try{te.onCommitFiberRoot(k,i,void 0,(i.current.flags&128)===128)}catch{}if(v!==null){i=L.T,p=H.p,H.p=2,L.T=null;try{for(var m=r.onRecoverableError,A=0;A<v.length;A++){var N=v[A];m(N.value,{componentStack:N.stack})}}finally{L.T=i,H.p=p}}(Jr&3)!==0&&lo(),Br(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===uv?yu++:(yu=0,uv=r):yu=0,mu(0)}}function am(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Wl(i)))}function lo(){return $y(),em(),tm(),rm()}function rm(){if(na!==5)return!1;var r=An,i=iv;iv=0;var s=rr(Jr),v=L.T,p=H.p;try{H.p=32>s?32:s,L.T=null,s=lv,lv=null;var m=An,A=Jr;if(na=0,ll=An=null,Jr=0,(mt&6)!==0)throw Error(n(331));var N=mt;if(mt|=4,Vy(m.current),ky(m,m.current,A,s),mt=N,mu(0,!1),te&&typeof te.onPostCommitFiberRoot=="function")try{te.onPostCommitFiberRoot(k,m)}catch{}return!0}finally{H.p=p,L.T=v,am(r,i)}}function nm(r,i,s){i=sr(s,i),i=Uc(r.stateNode,i,2),r=bn(r,i,2),r!==null&&(wt(r,2),Br(r))}function St(r,i,s){if(r.tag===3)nm(r,r,s);else for(;i!==null;){if(i.tag===3){nm(i,r,s);break}else if(i.tag===1){var v=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Cn===null||!Cn.has(v))){r=sr(s,r),s=iy(2),v=bn(i,s,2),v!==null&&(ly(s,v,i,r),wt(v,2),Br(v));break}}i=i.return}}function fv(r,i,s){var v=r.pingCache;if(v===null){v=r.pingCache=new Hx;var p=new Set;v.set(i,p)}else p=v.get(i),p===void 0&&(p=new Set,v.set(i,p));p.has(s)||(av=!0,p.add(s),r=Ix.bind(null,r,i,s),i.then(r,r))}function Ix(r,i,s){var v=r.pingCache;v!==null&&v.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,Bt===r&&(lt&s)===s&&(Ft===4||Ft===3&&(lt&62914560)===lt&&300>De()-eo?(mt&2)===0&&ul(r,0):rv|=s,il===lt&&(il=0)),Br(r)}function im(r,i){i===0&&(i=$e()),r=ii(r,i),r!==null&&(wt(r,i),Br(r))}function Xx(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),im(r,s)}function jx(r,i){var s=0;switch(r.tag){case 31:case 13:var v=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:v=r.stateNode;break;case 22:v=r.stateNode._retryCache;break;default:throw Error(n(314))}v!==null&&v.delete(i),im(r,s)}function Kx(r,i){return Ce(r,i)}var uo=null,ol=null,cv=!1,so=!1,vv=!1,Bn=0;function Br(r){r!==ol&&r.next===null&&(ol===null?uo=ol=r:ol=ol.next=r),so=!0,cv||(cv=!0,Qx())}function mu(r,i){if(!vv&&so){vv=!0;do for(var s=!1,v=uo;v!==null;){if(r!==0){var p=v.pendingLanes;if(p===0)var m=0;else{var A=v.suspendedLanes,N=v.pingedLanes;m=(1<<31-oe(42|r)+1)-1,m&=p&~(A&~N),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,om(v,m))}else m=lt,m=Ze(v,v===Bt?m:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(m&3)===0||Ne(v,m)||(s=!0,om(v,m));v=v.next}while(s);vv=!1}}function Zx(){lm()}function lm(){so=cv=!1;var r=0;Bn!==0&&lS()&&(r=Bn);for(var i=De(),s=null,v=uo;v!==null;){var p=v.next,m=um(v,i);m===0?(v.next=null,s===null?uo=p:s.next=p,p===null&&(ol=s)):(s=v,(r!==0||(m&3)!==0)&&(so=!0)),v=p}na!==0&&na!==5||mu(r),Bn!==0&&(Bn=0)}function um(r,i){for(var s=r.suspendedLanes,v=r.pingedLanes,p=r.expirationTimes,m=r.pendingLanes&-62914561;0<m;){var A=31-oe(m),N=1<<A,X=p[A];X===-1?((N&s)===0||(N&v)!==0)&&(p[A]=tt(N,i)):X<=i&&(r.expiredLanes|=N),m&=~N}if(i=Bt,s=lt,s=Ze(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),v=r.callbackNode,s===0||r===i&&(xt===2||xt===9)||r.cancelPendingCommit!==null)return v!==null&&v!==null&&_e(v),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ne(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(v!==null&&_e(v),rr(s)){case 2:case 8:s=ft;break;case 32:s=st;break;case 268435456:s=Xe;break;default:s=st}return v=sm.bind(null,r),s=Ce(s,v),r.callbackPriority=i,r.callbackNode=s,i}return v!==null&&v!==null&&_e(v),r.callbackPriority=2,r.callbackNode=null,2}function sm(r,i){if(na!==0&&na!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(lo()&&r.callbackNode!==s)return null;var v=lt;return v=Ze(r,r===Bt?v:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),v===0?null:(Yy(r,v,i),um(r,De()),r.callbackNode!=null&&r.callbackNode===s?sm.bind(null,r):null)}function om(r,i){if(lo())return null;Yy(r,i,!0)}function Qx(){sS(function(){(mt&6)!==0?Ce(rt,Zx):lm()})}function dv(){if(Bn===0){var r=Ki;r===0&&(r=ke,ke<<=1,(ke&261888)===0&&(ke=256)),Bn=r}return Bn}function fm(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ps(""+r)}function cm(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 Jx(r,i,s,v,p){if(i==="submit"&&s&&s.stateNode===p){var m=fm((p[ra]||null).action),A=v.submitter;A&&(i=(i=A[ra]||null)?fm(i.formAction):A.getAttribute("formAction"),i!==null&&(m=i,A=null));var N=new Es("action","action",null,v,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(Bn!==0){var X=A?cm(p,A):new FormData(p);Nc(s,{pending:!0,data:X,method:p.method,action:m},null,X)}}else typeof m=="function"&&(N.preventDefault(),X=A?cm(p,A):new FormData(p),Nc(s,{pending:!0,data:X,method:p.method,action:m},m,X))},currentTarget:p}]})}}for(var hv=0;hv<Qf.length;hv++){var gv=Qf[hv],Wx=gv.toLowerCase(),$x=gv[0].toUpperCase()+gv.slice(1);mr(Wx,"on"+$x)}mr(Gg,"onAnimationEnd"),mr(Yg,"onAnimationIteration"),mr(Fg,"onAnimationStart"),mr("dblclick","onDoubleClick"),mr("focusin","onFocus"),mr("focusout","onBlur"),mr(gx,"onTransitionRun"),mr(px,"onTransitionStart"),mr(yx,"onTransitionCancel"),mr(Ig,"onTransitionEnd"),Tr("onMouseEnter",["mouseout","mouseover"]),Tr("onMouseLeave",["mouseout","mouseover"]),Tr("onPointerEnter",["pointerout","pointerover"]),Tr("onPointerLeave",["pointerout","pointerover"]),Ka("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ka("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ka("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ka("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ka("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ka("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bu="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(" "),eS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bu));function vm(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var v=r[s],p=v.event;v=v.listeners;e:{var m=void 0;if(i)for(var A=v.length-1;0<=A;A--){var N=v[A],X=N.instance,ie=N.currentTarget;if(N=N.listener,X!==m&&p.isPropagationStopped())break e;m=N,p.currentTarget=ie;try{m(p)}catch(ge){ws(ge)}p.currentTarget=null,m=X}else for(A=0;A<v.length;A++){if(N=v[A],X=N.instance,ie=N.currentTarget,N=N.listener,X!==m&&p.isPropagationStopped())break e;m=N,p.currentTarget=ie;try{m(p)}catch(ge){ws(ge)}p.currentTarget=null,m=X}}}}function it(r,i){var s=i[fa];s===void 0&&(s=i[fa]=new Set);var v=r+"__bubble";s.has(v)||(dm(i,r,2,!1),s.add(v))}function pv(r,i,s){var v=0;i&&(v|=4),dm(s,r,v,i)}var oo="_reactListening"+Math.random().toString(36).slice(2);function yv(r){if(!r[oo]){r[oo]=!0,cs.forEach(function(s){s!=="selectionchange"&&(eS.has(s)||pv(s,!1,r),pv(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[oo]||(i[oo]=!0,pv("selectionchange",!1,i))}}function dm(r,i,s,v){switch(Gm(i)){case 2:var p=BS;break;case 8:p=MS;break;default:p=Ov}s=p.bind(null,i,s,r),p=void 0,!qf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),v?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 mv(r,i,s,v,p){var m=v;if((i&1)===0&&(i&2)===0&&v!==null)e:for(;;){if(v===null)return;var A=v.tag;if(A===3||A===4){var N=v.stateNode.containerInfo;if(N===p)break;if(A===4)for(A=v.return;A!==null;){var X=A.tag;if((X===3||X===4)&&A.stateNode.containerInfo===p)return;A=A.return}for(;N!==null;){if(A=sn(N),A===null)return;if(X=A.tag,X===5||X===6||X===26||X===27){v=m=A;continue e}N=N.parentNode}}v=v.return}mg(function(){var ie=m,ge=kf(s),Ee=[];e:{var ue=Xg.get(r);if(ue!==void 0){var ve=Es,Le=r;switch(r){case"keypress":if(ms(s)===0)break e;case"keydown":case"keyup":ve=jE;break;case"focusin":Le="focus",ve=Pf;break;case"focusout":Le="blur",ve=Pf;break;case"beforeblur":case"afterblur":ve=Pf;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=xg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=kE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=QE;break;case Gg:case Yg:case Fg:ve=VE;break;case Ig:ve=WE;break;case"scroll":case"scrollend":ve=NE;break;case"wheel":ve=ex;break;case"copy":case"cut":case"paste":ve=HE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=wg;break;case"toggle":case"beforetoggle":ve=ax}var Ie=(i&4)!==0,At=!Ie&&(r==="scroll"||r==="scrollend"),ee=Ie?ue!==null?ue+"Capture":null:ue;Ie=[];for(var K=ie,ne;K!==null;){var be=K;if(ne=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ne===null||ee===null||(be=Pl(K,ee),be!=null&&Ie.push(Eu(K,be,ne))),At)break;K=K.return}0<Ie.length&&(ue=new ve(ue,Le,null,s,ge),Ee.push({event:ue,listeners:Ie}))}}if((i&7)===0){e:{if(ue=r==="mouseover"||r==="pointerover",ve=r==="mouseout"||r==="pointerout",ue&&s!==Lf&&(Le=s.relatedTarget||s.fromElement)&&(sn(Le)||Le[qa]))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?sn(Le):null,Le!==null&&(At=u(Le),Ie=Le.tag,Le!==At||Ie!==5&&Ie!==27&&Ie!==6)&&(Le=null)):(ve=null,Le=ie),ve!==Le)){if(Ie=xg,be="onMouseLeave",ee="onMouseEnter",K="mouse",(r==="pointerout"||r==="pointerover")&&(Ie=wg,be="onPointerLeave",ee="onPointerEnter",K="pointer"),At=ve==null?ue:ti(ve),ne=Le==null?ue:ti(Le),ue=new Ie(be,K+"leave",ve,s,ge),ue.target=At,ue.relatedTarget=ne,be=null,sn(ge)===ie&&(Ie=new Ie(ee,K+"enter",Le,s,ge),Ie.target=ne,Ie.relatedTarget=At,be=Ie),At=be,ve&&Le)t:{for(Ie=tS,ee=ve,K=Le,ne=0,be=ee;be;be=Ie(be))ne++;be=0;for(var Ye=K;Ye;Ye=Ie(Ye))be++;for(;0<ne-be;)ee=Ie(ee),ne--;for(;0<be-ne;)K=Ie(K),be--;for(;ne--;){if(ee===K||K!==null&&ee===K.alternate){Ie=ee;break t}ee=Ie(ee),K=Ie(K)}Ie=null}else Ie=null;ve!==null&&hm(Ee,ue,ve,Ie,!1),Le!==null&&At!==null&&hm(Ee,At,Le,Ie,!0)}}e:{if(ue=ie?ti(ie):window,ve=ue.nodeName&&ue.nodeName.toLowerCase(),ve==="select"||ve==="input"&&ue.type==="file")var ht=zg;else if(Mg(ue))if(Og)ht=vx;else{ht=fx;var qe=ox}else ve=ue.nodeName,!ve||ve.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ie&&Nf(ie.elementType)&&(ht=zg):ht=cx;if(ht&&(ht=ht(r,ie))){Rg(Ee,ht,s,ge);break e}qe&&qe(r,ue,ie),r==="focusout"&&ie&&ue.type==="number"&&ie.memoizedProps.value!=null&&Of(ue,"number",ue.value)}switch(qe=ie?ti(ie):window,r){case"focusin":(Mg(qe)||qe.contentEditable==="true")&&(Hi=qe,jf=ie,Zl=null);break;case"focusout":Zl=jf=Hi=null;break;case"mousedown":Kf=!0;break;case"contextmenu":case"mouseup":case"dragend":Kf=!1,Hg(Ee,s,ge);break;case"selectionchange":if(hx)break;case"keydown":case"keyup":Hg(Ee,s,ge)}var et;if(Yf)e:{switch(r){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else Ui?Dg(r,s)&&(ut="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(ut="onCompositionStart");ut&&(Tg&&s.locale!=="ko"&&(Ui||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&Ui&&(et=bg()):(vn=ge,Vf="value"in vn?vn.value:vn.textContent,Ui=!0)),qe=fo(ie,ut),0<qe.length&&(ut=new Sg(ut,r,null,s,ge),Ee.push({event:ut,listeners:qe}),et?ut.data=et:(et=Bg(s),et!==null&&(ut.data=et)))),(et=nx?ix(r,s):lx(r,s))&&(ut=fo(ie,"onBeforeInput"),0<ut.length&&(qe=new Sg("onBeforeInput","beforeinput",null,s,ge),Ee.push({event:qe,listeners:ut}),qe.data=et)),Jx(Ee,r,ie,s,ge)}vm(Ee,i)})}function Eu(r,i,s){return{instance:r,listener:i,currentTarget:s}}function fo(r,i){for(var s=i+"Capture",v=[];r!==null;){var p=r,m=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||m===null||(p=Pl(r,s),p!=null&&v.unshift(Eu(r,p,m)),p=Pl(r,i),p!=null&&v.push(Eu(r,p,m))),r.tag===3)return v;r=r.return}return[]}function tS(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function hm(r,i,s,v,p){for(var m=i._reactName,A=[];s!==null&&s!==v;){var N=s,X=N.alternate,ie=N.stateNode;if(N=N.tag,X!==null&&X===v)break;N!==5&&N!==26&&N!==27||ie===null||(X=ie,p?(ie=Pl(s,m),ie!=null&&A.unshift(Eu(s,ie,X))):p||(ie=Pl(s,m),ie!=null&&A.push(Eu(s,ie,X)))),s=s.return}A.length!==0&&r.push({event:i,listeners:A})}var aS=/\r\n?/g,rS=/\u0000|\uFFFD/g;function gm(r){return(typeof r=="string"?r:""+r).replace(aS,`
|
|
9
|
-
`).replace(rS,"")}function pm(r,i){return i=gm(i),gm(r)===i}function Ct(r,i,s,v,p,m){switch(s){case"children":typeof v=="string"?i==="body"||i==="textarea"&&v===""||_i(r,v):(typeof v=="number"||typeof v=="bigint")&&i!=="body"&&_i(r,""+v);break;case"className":cn(r,"class",v);break;case"tabIndex":cn(r,"tabindex",v);break;case"dir":case"role":case"viewBox":case"width":case"height":cn(r,s,v);break;case"style":pg(r,v,m);break;case"data":if(i!=="object"){cn(r,"data",v);break}case"src":case"href":if(v===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(v==null||typeof v=="function"||typeof v=="symbol"||typeof v=="boolean"){r.removeAttribute(s);break}v=ps(""+v),r.setAttribute(s,v);break;case"action":case"formAction":if(typeof v=="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 m=="function"&&(s==="formAction"?(i!=="input"&&Ct(r,i,"name",p.name,p,null),Ct(r,i,"formEncType",p.formEncType,p,null),Ct(r,i,"formMethod",p.formMethod,p,null),Ct(r,i,"formTarget",p.formTarget,p,null)):(Ct(r,i,"encType",p.encType,p,null),Ct(r,i,"method",p.method,p,null),Ct(r,i,"target",p.target,p,null)));if(v==null||typeof v=="symbol"||typeof v=="boolean"){r.removeAttribute(s);break}v=ps(""+v),r.setAttribute(s,v);break;case"onClick":v!=null&&(r.onclick=_r);break;case"onScroll":v!=null&&it("scroll",r);break;case"onScrollEnd":v!=null&&it("scrollend",r);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(n(61));if(s=v.__html,s!=null){if(p.children!=null)throw Error(n(60));r.innerHTML=s}}break;case"multiple":r.multiple=v&&typeof v!="function"&&typeof v!="symbol";break;case"muted":r.muted=v&&typeof v!="function"&&typeof v!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(v==null||typeof v=="function"||typeof v=="boolean"||typeof v=="symbol"){r.removeAttribute("xlink:href");break}s=ps(""+v),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":v!=null&&typeof v!="function"&&typeof v!="symbol"?r.setAttribute(s,""+v):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":v&&typeof v!="function"&&typeof v!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":v===!0?r.setAttribute(s,""):v!==!1&&v!=null&&typeof v!="function"&&typeof v!="symbol"?r.setAttribute(s,v):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":v!=null&&typeof v!="function"&&typeof v!="symbol"&&!isNaN(v)&&1<=v?r.setAttribute(s,v):r.removeAttribute(s);break;case"rowSpan":case"start":v==null||typeof v=="function"||typeof v=="symbol"||isNaN(v)?r.removeAttribute(s):r.setAttribute(s,v);break;case"popover":it("beforetoggle",r),it("toggle",r),Ba(r,"popover",v);break;case"xlinkActuate":ir(r,"http://www.w3.org/1999/xlink","xlink:actuate",v);break;case"xlinkArcrole":ir(r,"http://www.w3.org/1999/xlink","xlink:arcrole",v);break;case"xlinkRole":ir(r,"http://www.w3.org/1999/xlink","xlink:role",v);break;case"xlinkShow":ir(r,"http://www.w3.org/1999/xlink","xlink:show",v);break;case"xlinkTitle":ir(r,"http://www.w3.org/1999/xlink","xlink:title",v);break;case"xlinkType":ir(r,"http://www.w3.org/1999/xlink","xlink:type",v);break;case"xmlBase":ir(r,"http://www.w3.org/XML/1998/namespace","xml:base",v);break;case"xmlLang":ir(r,"http://www.w3.org/XML/1998/namespace","xml:lang",v);break;case"xmlSpace":ir(r,"http://www.w3.org/XML/1998/namespace","xml:space",v);break;case"is":Ba(r,"is",v);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=zE.get(s)||s,Ba(r,s,v))}}function bv(r,i,s,v,p,m){switch(s){case"style":pg(r,v,m);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(n(61));if(s=v.__html,s!=null){if(p.children!=null)throw Error(n(60));r.innerHTML=s}}break;case"children":typeof v=="string"?_i(r,v):(typeof v=="number"||typeof v=="bigint")&&_i(r,""+v);break;case"onScroll":v!=null&&it("scroll",r);break;case"onScrollEnd":v!=null&&it("scrollend",r);break;case"onClick":v!=null&&(r.onclick=_r);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vs.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),m=r[ra]||null,m=m!=null?m[s]:null,typeof m=="function"&&r.removeEventListener(i,m,p),typeof v=="function")){typeof m!="function"&&m!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,v,p);break e}s in r?r[s]=v:v===!0?r.setAttribute(s,""):Ba(r,s,v)}}}function Sa(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",r),it("load",r);var v=!1,p=!1,m;for(m in s)if(s.hasOwnProperty(m)){var A=s[m];if(A!=null)switch(m){case"src":v=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,i));default:Ct(r,i,m,A,s,null)}}p&&Ct(r,i,"srcSet",s.srcSet,s,null),v&&Ct(r,i,"src",s.src,s,null);return;case"input":it("invalid",r);var N=m=A=p=null,X=null,ie=null;for(v in s)if(s.hasOwnProperty(v)){var ge=s[v];if(ge!=null)switch(v){case"name":p=ge;break;case"type":A=ge;break;case"checked":X=ge;break;case"defaultChecked":ie=ge;break;case"value":m=ge;break;case"defaultValue":N=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(n(137,i));break;default:Ct(r,i,v,ge,s,null)}}vg(r,m,N,X,ie,A,p,!1);return;case"select":it("invalid",r),v=A=m=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":m=N;break;case"defaultValue":A=N;break;case"multiple":v=N;default:Ct(r,i,p,N,s,null)}i=m,s=A,r.multiple=!!v,i!=null?ki(r,!!v,i,!1):s!=null&&ki(r,!!v,s,!0);return;case"textarea":it("invalid",r),m=p=v=null;for(A in s)if(s.hasOwnProperty(A)&&(N=s[A],N!=null))switch(A){case"value":v=N;break;case"defaultValue":p=N;break;case"children":m=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(n(91));break;default:Ct(r,i,A,N,s,null)}hg(r,v,p,m);return;case"option":for(X in s)s.hasOwnProperty(X)&&(v=s[X],v!=null)&&(X==="selected"?r.selected=v&&typeof v!="function"&&typeof v!="symbol":Ct(r,i,X,v,s,null));return;case"dialog":it("beforetoggle",r),it("toggle",r),it("cancel",r),it("close",r);break;case"iframe":case"object":it("load",r);break;case"video":case"audio":for(v=0;v<bu.length;v++)it(bu[v],r);break;case"image":it("error",r),it("load",r);break;case"details":it("toggle",r);break;case"embed":case"source":case"link":it("error",r),it("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)&&(v=s[ie],v!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,i));default:Ct(r,i,ie,v,s,null)}return;default:if(Nf(i)){for(ge in s)s.hasOwnProperty(ge)&&(v=s[ge],v!==void 0&&bv(r,i,ge,v,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(v=s[N],v!=null&&Ct(r,i,N,v,s,null))}function nS(r,i,s,v){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,m=null,A=null,N=null,X=null,ie=null,ge=null;for(ve in s){var Ee=s[ve];if(s.hasOwnProperty(ve)&&Ee!=null)switch(ve){case"checked":break;case"value":break;case"defaultValue":X=Ee;default:v.hasOwnProperty(ve)||Ct(r,i,ve,null,v,Ee)}}for(var ue in v){var ve=v[ue];if(Ee=s[ue],v.hasOwnProperty(ue)&&(ve!=null||Ee!=null))switch(ue){case"type":m=ve;break;case"name":p=ve;break;case"checked":ie=ve;break;case"defaultChecked":ge=ve;break;case"value":A=ve;break;case"defaultValue":N=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(n(137,i));break;default:ve!==Ee&&Ct(r,i,ue,ve,v,Ee)}}zf(r,A,N,X,ie,ge,m,p);return;case"select":ve=A=N=ue=null;for(m in s)if(X=s[m],s.hasOwnProperty(m)&&X!=null)switch(m){case"value":break;case"multiple":ve=X;default:v.hasOwnProperty(m)||Ct(r,i,m,null,v,X)}for(p in v)if(m=v[p],X=s[p],v.hasOwnProperty(p)&&(m!=null||X!=null))switch(p){case"value":ue=m;break;case"defaultValue":N=m;break;case"multiple":A=m;default:m!==X&&Ct(r,i,p,m,v,X)}i=N,s=A,v=ve,ue!=null?ki(r,!!s,ue,!1):!!v!=!!s&&(i!=null?ki(r,!!s,i,!0):ki(r,!!s,s?[]:"",!1));return;case"textarea":ve=ue=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!v.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ct(r,i,N,null,v,p)}for(A in v)if(p=v[A],m=s[A],v.hasOwnProperty(A)&&(p!=null||m!=null))switch(A){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!==m&&Ct(r,i,A,p,v,m)}dg(r,ue,ve);return;case"option":for(var Le in s)ue=s[Le],s.hasOwnProperty(Le)&&ue!=null&&!v.hasOwnProperty(Le)&&(Le==="selected"?r.selected=!1:Ct(r,i,Le,null,v,ue));for(X in v)ue=v[X],ve=s[X],v.hasOwnProperty(X)&&ue!==ve&&(ue!=null||ve!=null)&&(X==="selected"?r.selected=ue&&typeof ue!="function"&&typeof ue!="symbol":Ct(r,i,X,ue,v,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 Ie in s)ue=s[Ie],s.hasOwnProperty(Ie)&&ue!=null&&!v.hasOwnProperty(Ie)&&Ct(r,i,Ie,null,v,ue);for(ie in v)if(ue=v[ie],ve=s[ie],v.hasOwnProperty(ie)&&ue!==ve&&(ue!=null||ve!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(n(137,i));break;default:Ct(r,i,ie,ue,v,ve)}return;default:if(Nf(i)){for(var At in s)ue=s[At],s.hasOwnProperty(At)&&ue!==void 0&&!v.hasOwnProperty(At)&&bv(r,i,At,void 0,v,ue);for(ge in v)ue=v[ge],ve=s[ge],!v.hasOwnProperty(ge)||ue===ve||ue===void 0&&ve===void 0||bv(r,i,ge,ue,v,ve);return}}for(var ee in s)ue=s[ee],s.hasOwnProperty(ee)&&ue!=null&&!v.hasOwnProperty(ee)&&Ct(r,i,ee,null,v,ue);for(Ee in v)ue=v[Ee],ve=s[Ee],!v.hasOwnProperty(Ee)||ue===ve||ue==null&&ve==null||Ct(r,i,Ee,ue,v,ve)}function ym(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iS(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),v=0;v<s.length;v++){var p=s[v],m=p.transferSize,A=p.initiatorType,N=p.duration;if(m&&N&&ym(A)){for(A=0,N=p.responseEnd,v+=1;v<s.length;v++){var X=s[v],ie=X.startTime;if(ie>N)break;var ge=X.transferSize,Ee=X.initiatorType;ge&&ym(Ee)&&(X=X.responseEnd,A+=ge*(X<N?1:(N-ie)/(X-ie)))}if(--v,i+=8*(m+A)/(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,xv=null;function co(r){return r.nodeType===9?r:r.ownerDocument}function mm(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 bm(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 Sv(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 wv=null;function lS(){var r=window.event;return r&&r.type==="popstate"?r===wv?!1:(wv=r,!0):(wv=null,!1)}var Em=typeof setTimeout=="function"?setTimeout:void 0,uS=typeof clearTimeout=="function"?clearTimeout:void 0,xm=typeof Promise=="function"?Promise:void 0,sS=typeof queueMicrotask=="function"?queueMicrotask:typeof xm<"u"?function(r){return xm.resolve(null).then(r).catch(oS)}:Em;function oS(r){setTimeout(function(){throw r})}function Mn(r){return r==="head"}function Sm(r,i){var s=i,v=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(v===0){r.removeChild(p),dl(i);return}v--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")v++;else if(s==="html")xu(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,xu(s);for(var m=s.firstChild;m;){var A=m.nextSibling,N=m.nodeName;m[va]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=A}}else s==="body"&&xu(r.ownerDocument.body);s=p}while(s);dl(i)}function wm(r,i){var s=r;r=0;do{var v=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||""),v&&v.nodeType===8)if(s=v.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=v}while(s)}function Tv(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":Tv(s),Ni(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function fS(r,i,s,v){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!v&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(v){if(!r[va])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(m=r.getAttribute("rel"),m==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(m!==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(m=r.getAttribute("src"),(m!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&m&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var m=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===m)return r}else return r;if(r=dr(r.nextSibling),r===null)break}return null}function cS(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=dr(r.nextSibling),r===null))return null;return r}function Tm(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=dr(r.nextSibling),r===null))return null;return r}function Cv(r){return r.data==="$?"||r.data==="$~"}function Av(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function vS(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var v=function(){i(),s.removeEventListener("DOMContentLoaded",v)};s.addEventListener("DOMContentLoaded",v),r._reactRetry=v}}function dr(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 Dv=null;function Cm(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return dr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function Am(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 Dm(r,i,s){switch(i=co(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 xu(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Ni(r)}var hr=new Map,Bm=new Set;function vo(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Wr=H.d;H.d={f:dS,r:hS,D:gS,C:pS,L:yS,m:mS,X:ES,S:bS,M:xS};function dS(){var r=Wr.f(),i=ro();return r||i}function hS(r){var i=on(r);i!==null&&i.tag===5&&i.type==="form"?Ip(i):Wr.r(r)}var fl=typeof document>"u"?null:document;function Mm(r,i,s){var v=fl;if(v&&typeof i=="string"&&i){var p=lr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Bm.has(p)||(Bm.add(p),r={rel:r,crossOrigin:s,href:i},v.querySelector(p)===null&&(i=v.createElement("link"),Sa(i,"link",r),Qt(i),v.head.appendChild(i)))}}function gS(r){Wr.D(r),Mm("dns-prefetch",r,null)}function pS(r,i){Wr.C(r,i),Mm("preconnect",r,i)}function yS(r,i,s){Wr.L(r,i,s);var v=fl;if(v&&r&&i){var p='link[rel="preload"][as="'+lr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+lr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+lr(s.imageSizes)+'"]')):p+='[href="'+lr(r)+'"]';var m=p;switch(i){case"style":m=cl(r);break;case"script":m=vl(r)}hr.has(m)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),hr.set(m,r),v.querySelector(p)!==null||i==="style"&&v.querySelector(Su(m))||i==="script"&&v.querySelector(wu(m))||(i=v.createElement("link"),Sa(i,"link",r),Qt(i),v.head.appendChild(i)))}}function mS(r,i){Wr.m(r,i);var s=fl;if(s&&r){var v=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+lr(v)+'"][href="'+lr(r)+'"]',m=p;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=vl(r)}if(!hr.has(m)&&(r=g({rel:"modulepreload",href:r},i),hr.set(m,r),s.querySelector(p)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(wu(m)))return}v=s.createElement("link"),Sa(v,"link",r),Qt(v),s.head.appendChild(v)}}}function bS(r,i,s){Wr.S(r,i,s);var v=fl;if(v&&r){var p=fn(v).hoistableStyles,m=cl(r);i=i||"default";var A=p.get(m);if(!A){var N={loading:0,preload:null};if(A=v.querySelector(Su(m)))N.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=hr.get(m))&&Bv(r,s);var X=A=v.createElement("link");Qt(X),Sa(X,"link",r),X._p=new Promise(function(ie,ge){X.onload=ie,X.onerror=ge}),X.addEventListener("load",function(){N.loading|=1}),X.addEventListener("error",function(){N.loading|=2}),N.loading|=4,ho(A,i,v)}A={type:"stylesheet",instance:A,count:1,state:N},p.set(m,A)}}}function ES(r,i){Wr.X(r,i);var s=fl;if(s&&r){var v=fn(s).hoistableScripts,p=vl(r),m=v.get(p);m||(m=s.querySelector(wu(p)),m||(r=g({src:r,async:!0},i),(i=hr.get(p))&&Mv(r,i),m=s.createElement("script"),Qt(m),Sa(m,"link",r),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},v.set(p,m))}}function xS(r,i){Wr.M(r,i);var s=fl;if(s&&r){var v=fn(s).hoistableScripts,p=vl(r),m=v.get(p);m||(m=s.querySelector(wu(p)),m||(r=g({src:r,async:!0,type:"module"},i),(i=hr.get(p))&&Mv(r,i),m=s.createElement("script"),Qt(m),Sa(m,"link",r),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},v.set(p,m))}}function Rm(r,i,s,v){var p=(p=se.current)?vo(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=cl(s.href),s=fn(p).hoistableStyles,v=s.get(i),v||(v={type:"style",instance:null,count:0,state:null},s.set(i,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=cl(s.href);var m=fn(p).hoistableStyles,A=m.get(r);if(A||(p=p.ownerDocument||p,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(r,A),(m=p.querySelector(Su(r)))&&!m._p&&(A.instance=m,A.state.loading=5),hr.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},hr.set(r,s),m||SS(p,r,s,A.state))),i&&v===null)throw Error(n(528,""));return A}if(i&&v!==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=vl(s),s=fn(p).hoistableScripts,v=s.get(i),v||(v={type:"script",instance:null,count:0,state:null},s.set(i,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,r))}}function cl(r){return'href="'+lr(r)+'"'}function Su(r){return'link[rel="stylesheet"]['+r+"]"}function zm(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function SS(r,i,s,v){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?v.loading=1:(i=r.createElement("link"),v.preload=i,i.addEventListener("load",function(){return v.loading|=1}),i.addEventListener("error",function(){return v.loading|=2}),Sa(i,"link",s),Qt(i),r.head.appendChild(i))}function vl(r){return'[src="'+lr(r)+'"]'}function wu(r){return"script[async]"+r}function Om(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var v=r.querySelector('style[data-href~="'+lr(s.href)+'"]');if(v)return i.instance=v,Qt(v),v;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return v=(r.ownerDocument||r).createElement("style"),Qt(v),Sa(v,"style",p),ho(v,s.precedence,r),i.instance=v;case"stylesheet":p=cl(s.href);var m=r.querySelector(Su(p));if(m)return i.state.loading|=4,i.instance=m,Qt(m),m;v=zm(s),(p=hr.get(p))&&Bv(v,p),m=(r.ownerDocument||r).createElement("link"),Qt(m);var A=m;return A._p=new Promise(function(N,X){A.onload=N,A.onerror=X}),Sa(m,"link",v),i.state.loading|=4,ho(m,s.precedence,r),i.instance=m;case"script":return m=vl(s.src),(p=r.querySelector(wu(m)))?(i.instance=p,Qt(p),p):(v=s,(p=hr.get(m))&&(v=g({},s),Mv(v,p)),r=r.ownerDocument||r,p=r.createElement("script"),Qt(p),Sa(p,"link",v),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&&(v=i.instance,i.state.loading|=4,ho(v,s.precedence,r));return i.instance}function ho(r,i,s){for(var v=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=v.length?v[v.length-1]:null,m=p,A=0;A<v.length;A++){var N=v[A];if(N.dataset.precedence===i)m=N;else if(m!==p)break}m?m.parentNode.insertBefore(r,m.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function Bv(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Mv(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var go=null;function Nm(r,i,s){if(go===null){var v=new Map,p=go=new Map;p.set(s,v)}else p=go,v=p.get(s),v||(v=new Map,p.set(s,v));if(v.has(r))return v;for(v.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var m=s[p];if(!(m[va]||m[kt]||r==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var A=m.getAttribute(i)||"";A=r+A;var N=v.get(A);N?N.push(m):v.set(A,[m])}}return v}function Lm(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function wS(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 km(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function TS(r,i,s,v){if(s.type==="stylesheet"&&(typeof v.media!="string"||matchMedia(v.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=cl(v.href),m=i.querySelector(Su(p));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=po.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=m,Qt(m);return}m=i.ownerDocument||i,v=zm(v),(p=hr.get(p))&&Bv(v,p),m=m.createElement("link"),Qt(m);var A=m;A._p=new Promise(function(N,X){A.onload=N,A.onerror=X}),Sa(m,"link",v),s.instance=m}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=po.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Rv=0;function CS(r,i){return r.stylesheets&&r.count===0&&mo(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var v=setTimeout(function(){if(r.stylesheets&&mo(r,r.stylesheets),r.unsuspend){var m=r.unsuspend;r.unsuspend=null,m()}},6e4+i);0<r.imgBytes&&Rv===0&&(Rv=62500*iS());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&mo(r,r.stylesheets),r.unsuspend)){var m=r.unsuspend;r.unsuspend=null,m()}},(r.imgBytes>Rv?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(v),clearTimeout(p)}}:null}function po(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mo(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var yo=null;function mo(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,yo=new Map,i.forEach(AS,r),yo=null,po.call(r))}function AS(r,i){if(!(i.state.loading&4)){var s=yo.get(r);if(s)var v=s.get(null);else{s=new Map,yo.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<p.length;m++){var A=p[m];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(s.set(A.dataset.precedence,A),v=A)}v&&s.set(null,v)}p=i.instance,A=p.getAttribute("data-precedence"),m=s.get(A)||v,m===v&&s.set(null,p),s.set(A,p),this.count++,v=po.bind(this),p.addEventListener("load",v),p.addEventListener("error",v),m?m.parentNode.insertBefore(p,m.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Tu={$$typeof:C,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function DS(r,i,s,v,p,m,A,N,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=Vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.hiddenUpdates=Vt(null),this.identifierPrefix=v,this.onUncaughtError=p,this.onCaughtError=m,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function _m(r,i,s,v,p,m,A,N,X,ie,ge,Ee){return r=new DS(r,i,s,A,X,ie,ge,Ee,N),i=1,m===!0&&(i|=24),m=Qa(3,null,null,i),r.current=m,m.stateNode=r,i=oc(),i.refCount++,r.pooledCache=i,i.refCount++,m.memoizedState={element:v,isDehydrated:s,cache:i},dc(m),r}function qm(r){return r?(r=Yi,r):Yi}function Vm(r,i,s,v,p,m){p=qm(p),v.context===null?v.context=p:v.pendingContext=p,v=mn(i),v.payload={element:s},m=m===void 0?null:m,m!==null&&(v.callback=m),s=bn(r,v,i),s!==null&&(Fa(s,r,i),au(s,r,i))}function Um(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function zv(r,i){Um(r,i),(r=r.alternate)&&Um(r,i)}function Hm(r){if(r.tag===13||r.tag===31){var i=ii(r,67108864);i!==null&&Fa(i,r,67108864),zv(r,67108864)}}function Pm(r){if(r.tag===13||r.tag===31){var i=tr();i=jt(i);var s=ii(r,i);s!==null&&Fa(s,r,i),zv(r,i)}}var bo=!0;function BS(r,i,s,v){var p=L.T;L.T=null;var m=H.p;try{H.p=2,Ov(r,i,s,v)}finally{H.p=m,L.T=p}}function MS(r,i,s,v){var p=L.T;L.T=null;var m=H.p;try{H.p=8,Ov(r,i,s,v)}finally{H.p=m,L.T=p}}function Ov(r,i,s,v){if(bo){var p=Nv(v);if(p===null)mv(r,i,v,Eo,s),Ym(r,v);else if(zS(p,r,i,s,v))v.stopPropagation();else if(Ym(r,v),i&4&&-1<RS.indexOf(r)){for(;p!==null;){var m=on(p);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var A=Ke(m.pendingLanes);if(A!==0){var N=m;for(N.pendingLanes|=2,N.entangledLanes|=2;A;){var X=1<<31-oe(A);N.entanglements[1]|=X,A&=~X}Br(m),(mt&6)===0&&(to=De()+500,mu(0))}}break;case 31:case 13:N=ii(m,2),N!==null&&Fa(N,m,2),ro(),zv(m,2)}if(m=Nv(v),m===null&&mv(r,i,v,Eo,s),m===p)break;p=m}p!==null&&v.stopPropagation()}else mv(r,i,v,null,s)}}function Nv(r){return r=kf(r),Lv(r)}var Eo=null;function Lv(r){if(Eo=null,r=sn(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=f(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 Gm(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(We()){case rt:return 2;case ft:return 8;case st:case dt:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var kv=!1,Rn=null,zn=null,On=null,Cu=new Map,Au=new Map,Nn=[],RS="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 Ym(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":Cu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Au.delete(i.pointerId)}}function Du(r,i,s,v,p,m){return r===null||r.nativeEvent!==m?(r={blockedOn:i,domEventName:s,eventSystemFlags:v,nativeEvent:m,targetContainers:[p]},i!==null&&(i=on(i),i!==null&&Hm(i)),r):(r.eventSystemFlags|=v,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function zS(r,i,s,v,p){switch(i){case"focusin":return Rn=Du(Rn,r,i,s,v,p),!0;case"dragenter":return zn=Du(zn,r,i,s,v,p),!0;case"mouseover":return On=Du(On,r,i,s,v,p),!0;case"pointerover":var m=p.pointerId;return Cu.set(m,Du(Cu.get(m)||null,r,i,s,v,p)),!0;case"gotpointercapture":return m=p.pointerId,Au.set(m,Du(Au.get(m)||null,r,i,s,v,p)),!0}return!1}function Fm(r){var i=sn(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,nr(r.priority,function(){Pm(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,nr(r.priority,function(){Pm(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 xo(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Nv(r.nativeEvent);if(s===null){s=r.nativeEvent;var v=new s.constructor(s.type,s);Lf=v,s.target.dispatchEvent(v),Lf=null}else return i=on(s),i!==null&&Hm(i),r.blockedOn=s,!1;i.shift()}return!0}function Im(r,i,s){xo(r)&&s.delete(i)}function OS(){kv=!1,Rn!==null&&xo(Rn)&&(Rn=null),zn!==null&&xo(zn)&&(zn=null),On!==null&&xo(On)&&(On=null),Cu.forEach(Im),Au.forEach(Im)}function So(r,i){r.blockedOn===i&&(r.blockedOn=null,kv||(kv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,OS)))}var wo=null;function Xm(r){wo!==r&&(wo=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){wo===r&&(wo=null);for(var i=0;i<r.length;i+=3){var s=r[i],v=r[i+1],p=r[i+2];if(typeof v!="function"){if(Lv(v||s)===null)continue;break}var m=on(s);m!==null&&(r.splice(i,3),i-=3,Nc(m,{pending:!0,data:p,method:s.method,action:v},v,p))}}))}function dl(r){function i(X){return So(X,r)}Rn!==null&&So(Rn,r),zn!==null&&So(zn,r),On!==null&&So(On,r),Cu.forEach(i),Au.forEach(i);for(var s=0;s<Nn.length;s++){var v=Nn[s];v.blockedOn===r&&(v.blockedOn=null)}for(;0<Nn.length&&(s=Nn[0],s.blockedOn===null);)Fm(s),s.blockedOn===null&&Nn.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(v=0;v<s.length;v+=3){var p=s[v],m=s[v+1],A=p[ra]||null;if(typeof m=="function")A||Xm(s);else if(A){var N=null;if(m&&m.hasAttribute("formAction")){if(p=m,A=m[ra]||null)N=A.formAction;else if(Lv(p)!==null)continue}else N=A.action;typeof N=="function"?s[v+1]=N:(s.splice(v,3),v-=3),Xm(s)}}}function jm(){function r(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(A){return p=A})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),v||setTimeout(s,20)}function s(){if(!v&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var v=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){v=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function _v(r){this._internalRoot=r}To.prototype.render=_v.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(n(409));var s=i.current,v=tr();Vm(s,v,r,i,null,null)},To.prototype.unmount=_v.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Vm(r.current,2,null,r,null,null),ro(),i[qa]=null}};function To(r){this._internalRoot=r}To.prototype.unstable_scheduleHydration=function(r){if(r){var i=Ht();r={blockedOn:null,target:r,priority:i};for(var s=0;s<Nn.length&&i!==0&&i<Nn[s].priority;s++);Nn.splice(s,0,r),s===0&&Fm(r)}};var Km=e.version;if(Km!=="19.2.4")throw Error(n(527,Km,"19.2.4"));H.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=c(i),r=r!==null?h(r):null,r=r===null?null:r.stateNode,r};var NS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Co=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Co.isDisabled&&Co.supportsFiber)try{k=Co.inject(NS),te=Co}catch{}}return Mu.createRoot=function(r,i){if(!l(r))throw Error(n(299));var s=!1,v="",p=ty,m=ay,A=ry;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(v=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(m=i.onCaughtError),i.onRecoverableError!==void 0&&(A=i.onRecoverableError)),i=_m(r,1,!1,null,null,s,v,null,p,m,A,jm),r[qa]=i.current,yv(r),new _v(i)},Mu.hydrateRoot=function(r,i,s){if(!l(r))throw Error(n(299));var v=!1,p="",m=ty,A=ay,N=ry,X=null;return s!=null&&(s.unstable_strictMode===!0&&(v=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(A=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(X=s.formState)),i=_m(r,1,!0,i,s??null,v,p,X,m,A,N,jm),i.context=qm(null),s=i.current,v=tr(),v=jt(v),p=mn(v),p.callback=null,bn(s,p,v),s=v,i.current.lanes=s,wt(i,s),Br(i),r[qa]=i.current,yv(r),new To(i)},Mu.version="19.2.4",Mu}var n0;function FS(){if(n0)return Uv.exports;n0=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(),Uv.exports=YS(),Uv.exports}var IS=FS();const XS=q1(IS);function Eh(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 jS(t){if(Array.isArray(t))return t}function KS(t){if(Array.isArray(t))return Eh(t)}function Zn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ZS(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,U1(n.key),n)}}function Qn(t,e,a){return e&&ZS(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ja(t,e){var a=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=Ph(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(d){throw d},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,f=!1;return{s:function(){a=a.call(t)},n:function(){var d=a.next();return o=d.done,d},e:function(d){f=!0,u=d},f:function(){try{o||a.return==null||a.return()}finally{if(f)throw u}}}}function V1(t,e,a){return(e=U1(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function QS(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function JS(t,e){var a=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(a!=null){var n,l,u,o,f=[],d=!0,c=!1;try{if(u=(a=a.call(t)).next,e===0){if(Object(a)!==a)return;d=!1}else for(;!(d=(n=u.call(a)).done)&&(f.push(n.value),f.length!==e);d=!0);}catch(h){c=!0,l=h}finally{try{if(!d&&a.return!=null&&(o=a.return(),Object(o)!==o))return}finally{if(c)throw l}}return f}}function WS(){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 $S(){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 aa(t,e){return jS(t)||JS(t,e)||Ph(t,e)||WS()}function Qo(t){return KS(t)||QS(t)||Ph(t)||$S()}function ew(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 U1(t){var e=ew(t,"string");return typeof e=="symbol"?e:e+""}function ua(t){"@babel/helpers - typeof";return ua=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},ua(t)}function Ph(t,e){if(t){if(typeof t=="string")return Eh(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)?Eh(t,e):void 0}}var ia=typeof window>"u"?null:window,i0=ia?ia.navigator:null;ia&&ia.document;var tw=ua(""),H1=ua({}),aw=ua(function(){}),rw=typeof HTMLElement>"u"?"undefined":ua(HTMLElement),$u=function(e){return e&&e.instanceString&&Pt(e.instanceString)?e.instanceString():null},Ge=function(e){return e!=null&&ua(e)==tw},Pt=function(e){return e!=null&&ua(e)===aw},Mt=function(e){return!ar(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},vt=function(e){return e!=null&&ua(e)===H1&&!Mt(e)&&e.constructor===Object},nw=function(e){return e!=null&&ua(e)===H1},Te=function(e){return e!=null&&ua(e)===ua(1)&&!isNaN(e)},iw=function(e){return Te(e)&&Math.floor(e)===e},Jo=function(e){if(rw!=="undefined")return e!=null&&e instanceof HTMLElement},ar=function(e){return es(e)||P1(e)},es=function(e){return $u(e)==="collection"&&e._private.single},P1=function(e){return $u(e)==="collection"&&!e._private.single},Gh=function(e){return $u(e)==="core"},G1=function(e){return $u(e)==="stylesheet"},lw=function(e){return $u(e)==="event"},Yn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},uw=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},sw=function(e){return vt(e)&&Te(e.x1)&&Te(e.x2)&&Te(e.y1)&&Te(e.y2)},ow=function(e){return nw(e)&&Pt(e.then)},fw=function(){return i0&&i0.userAgent.match(/msie|trident|edge/i)},Rl=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,f,d=a.apply(u,o),c=n.cache;return(f=c[d])||(f=c[d]=e.apply(u,o)),f};return n.cache={},n},Yh=Rl(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),cf=Rl(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Y1=Rl(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),l0=function(e){return Yn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Vn=function(e,a){return e.slice(-1*a.length)===a},la="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",cw="rgb[a]?\\(("+la+"[%]?)\\s*,\\s*("+la+"[%]?)\\s*,\\s*("+la+"[%]?)(?:\\s*,\\s*("+la+"))?\\)",vw="rgb[a]?\\((?:"+la+"[%]?)\\s*,\\s*(?:"+la+"[%]?)\\s*,\\s*(?:"+la+"[%]?)(?:\\s*,\\s*(?:"+la+"))?\\)",dw="hsl[a]?\\(("+la+")\\s*,\\s*("+la+"[%])\\s*,\\s*("+la+"[%])(?:\\s*,\\s*("+la+"))?\\)",hw="hsl[a]?\\((?:"+la+")\\s*,\\s*(?:"+la+"[%])\\s*,\\s*(?:"+la+"[%])(?:\\s*,\\s*(?:"+la+"))?\\)",gw="\\#[0-9a-fA-F]{3}",pw="\\#[0-9a-fA-F]{6}",F1=function(e,a){return e<a?-1:e>a?1:0},yw=function(e,a){return-1*F1(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},mw=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]}},bw=function(e){var a,n,l,u,o,f,d,c;function h(b,w,x){return x<0&&(x+=1),x>1&&(x-=1),x<1/6?b+(w-b)*6*x:x<1/2?w:x<2/3?b+(w-b)*(2/3-x)*6:b}var g=new RegExp("^"+dw+"$").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)f=d=c=Math.round(u*255);else{var y=u<.5?u*(1+l):u+l-u*l,E=2*u-y;f=Math.round(255*h(E,y,n+1/3)),d=Math.round(255*h(E,y,n)),c=Math.round(255*h(E,y,n-1/3))}a=[f,d,c,o]}return a},Ew=function(e){var a,n=new RegExp("^"+cw+"$").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 f=l[1]||l[2]||l[3],d=l[1]&&l[2]&&l[3];if(f&&!d)return;var c=n[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;a.push(c)}}return a},xw=function(e){return Sw[e.toLowerCase()]},I1=function(e){return(Mt(e)?e:null)||xw(e)||mw(e)||Ew(e)||bw(e)},Sw={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]},X1=function(e){for(var a=e.map,n=e.keys,l=n.length,u=0;u<l;u++){var o=n[u];if(vt(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}},j1=function(e){for(var a=e.map,n=e.keys,l=n.length,u=0;u<l;u++){var o=n[u];if(vt(o))throw Error("Tried to get map with object key");if(a=a[o],a==null)return a}return a},Ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ts(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yv,u0;function as(){if(u0)return Yv;u0=1;function t(e){var a=typeof e;return e!=null&&(a=="object"||a=="function")}return Yv=t,Yv}var Fv,s0;function ww(){if(s0)return Fv;s0=1;var t=typeof Ao=="object"&&Ao&&Ao.Object===Object&&Ao;return Fv=t,Fv}var Iv,o0;function vf(){if(o0)return Iv;o0=1;var t=ww(),e=typeof self=="object"&&self&&self.Object===Object&&self,a=t||e||Function("return this")();return Iv=a,Iv}var Xv,f0;function Tw(){if(f0)return Xv;f0=1;var t=vf(),e=function(){return t.Date.now()};return Xv=e,Xv}var jv,c0;function Cw(){if(c0)return jv;c0=1;var t=/\s/;function e(a){for(var n=a.length;n--&&t.test(a.charAt(n)););return n}return jv=e,jv}var Kv,v0;function Aw(){if(v0)return Kv;v0=1;var t=Cw(),e=/^\s+/;function a(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Kv=a,Kv}var Zv,d0;function Fh(){if(d0)return Zv;d0=1;var t=vf(),e=t.Symbol;return Zv=e,Zv}var Qv,h0;function Dw(){if(h0)return Qv;h0=1;var t=Fh(),e=Object.prototype,a=e.hasOwnProperty,n=e.toString,l=t?t.toStringTag:void 0;function u(o){var f=a.call(o,l),d=o[l];try{o[l]=void 0;var c=!0}catch{}var h=n.call(o);return c&&(f?o[l]=d:delete o[l]),h}return Qv=u,Qv}var Jv,g0;function Bw(){if(g0)return Jv;g0=1;var t=Object.prototype,e=t.toString;function a(n){return e.call(n)}return Jv=a,Jv}var Wv,p0;function K1(){if(p0)return Wv;p0=1;var t=Fh(),e=Dw(),a=Bw(),n="[object Null]",l="[object Undefined]",u=t?t.toStringTag:void 0;function o(f){return f==null?f===void 0?l:n:u&&u in Object(f)?e(f):a(f)}return Wv=o,Wv}var $v,y0;function Mw(){if(y0)return $v;y0=1;function t(e){return e!=null&&typeof e=="object"}return $v=t,$v}var ed,m0;function rs(){if(m0)return ed;m0=1;var t=K1(),e=Mw(),a="[object Symbol]";function n(l){return typeof l=="symbol"||e(l)&&t(l)==a}return ed=n,ed}var td,b0;function Rw(){if(b0)return td;b0=1;var t=Aw(),e=as(),a=rs(),n=NaN,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,o=/^0o[0-7]+$/i,f=parseInt;function d(c){if(typeof c=="number")return c;if(a(c))return n;if(e(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=e(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=t(c);var g=u.test(c);return g||o.test(c)?f(c.slice(2),g?2:8):l.test(c)?n:+c}return td=d,td}var ad,E0;function zw(){if(E0)return ad;E0=1;var t=as(),e=Tw(),a=Rw(),n="Expected a function",l=Math.max,u=Math.min;function o(f,d,c){var h,g,y,E,b,w,x=0,S=!1,T=!1,C=!0;if(typeof f!="function")throw new TypeError(n);d=a(d)||0,t(c)&&(S=!!c.leading,T="maxWait"in c,y=T?l(a(c.maxWait)||0,d):y,C="trailing"in c?!!c.trailing:C);function D(P){var Y=h,I=g;return h=g=void 0,x=P,E=f.apply(I,Y),E}function R(P){return x=P,b=setTimeout(O,d),S?D(P):E}function z(P){var Y=P-w,I=P-x,L=d-Y;return T?u(L,y-I):L}function B(P){var Y=P-w,I=P-x;return w===void 0||Y>=d||Y<0||T&&I>=y}function O(){var P=e();if(B(P))return _(P);b=setTimeout(O,z(P))}function _(P){return b=void 0,C&&h?D(P):(h=g=void 0,E)}function U(){b!==void 0&&clearTimeout(b),x=0,h=w=g=b=void 0}function V(){return b===void 0?E:_(e())}function q(){var P=e(),Y=B(P);if(h=arguments,g=this,w=P,Y){if(b===void 0)return R(w);if(T)return clearTimeout(b),b=setTimeout(O,d),D(w)}return b===void 0&&(b=setTimeout(O,d)),E}return q.cancel=U,q.flush=V,q}return ad=o,ad}var Ow=zw(),ns=ts(Ow),rd=ia?ia.performance:null,Z1=rd&&rd.now?function(){return rd.now()}:function(){return Date.now()},Nw=(function(){if(ia){if(ia.requestAnimationFrame)return function(t){ia.requestAnimationFrame(t)};if(ia.mozRequestAnimationFrame)return function(t){ia.mozRequestAnimationFrame(t)};if(ia.webkitRequestAnimationFrame)return function(t){ia.webkitRequestAnimationFrame(t)};if(ia.msRequestAnimationFrame)return function(t){ia.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Z1())},1e3/60)}})(),Wo=function(e){return Nw(e)},an=Z1,Si=9261,Q1=65599,Sl=5381,J1=function(e){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Si,n=a,l;l=e.next(),!l.done;)n=n*Q1+l.value|0;return n},Yu=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Si;return a*Q1+e|0},Fu=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sl;return(a<<5)+a+e|0},Lw=function(e,a){return e*2097152+a},kn=function(e){return e[0]*2097152+e[1]},Do=function(e,a){return[Yu(e[0],a[0]),Fu(e[1],a[1])]},x0=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 J1(o,a)},Ci=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 J1(o,a)},W1=function(){return kw(arguments)},kw=function(e){for(var a,n=0;n<e.length;n++){var l=e[n];n===0?a=Ci(l):a=Ci(l,a)}return a};function _w(t,e,a,n,l){var u=l*Math.PI/180,o=Math.cos(u)*(t-a)-Math.sin(u)*(e-n)+a,f=Math.sin(u)*(t-a)+Math.cos(u)*(e-n)+n;return{x:o,y:f}}var qw=function(e,a,n,l,u,o){return{x:(e-n)*u+n,y:(a-l)*o+l}};function Vw(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,f=_w(t.x,t.y,n,l,a),d=qw(f.x,f.y,n,l,u,o);return{x:d.x,y:d.y}}var S0=!0,Uw=console.warn!=null,Hw=console.trace!=null,Ih=Number.MAX_SAFE_INTEGER||9007199254740991,$1=function(){return!0},$o=function(){return!1},w0=function(){return 0},Xh=function(){},qt=function(e){throw new Error(e)},e2=function(e){if(e!==void 0)S0=!!e;else return S0},Et=function(e){e2()&&(Uw?console.warn(e):(console.log(e),Hw&&console.trace()))},Pw=function(e){return Fe({},e)},Or=function(e){return e==null?e:Mt(e)?e.slice():vt(e)?Pw(e):e},Gw=function(e){return e.slice()},t2=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},Yw={},a2=function(){return Yw},Ca=function(e){var a=Object.keys(e);return function(n){for(var l={},u=0;u<a.length;u++){var o=a[u],f=n?.[o];l[o]=f===void 0?e[o]:f}return l}},Fn=function(e,a,n){for(var l=e.length-1;l>=0;l--)e[l]===a&&e.splice(l,1)},jh=function(e){e.splice(0,e.length)},Fw=function(e,a){for(var n=0;n<a.length;n++){var l=a[n];e.push(l)}},Ia=function(e,a,n){return n&&(a=Y1(n,a)),e[a]},en=function(e,a,n,l){n&&(a=Y1(n,a)),e[a]=l},Iw=(function(){function t(){Zn(this,t),this._obj={}}return Qn(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]}}])})(),tn=typeof Map<"u"?Map:Iw,Xw="undefined",jw=(function(){function t(e){if(Zn(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 Qn(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)}}])})(),Nl=(typeof Set>"u"?"undefined":ua(Set))!==Xw?Set:jw,df=function(e,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||a===void 0||!Gh(e)){qt("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"){qt("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 Nl,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,f=e.pan(),d=e.zoom();u.position={x:(o.x-f.x)/d,y:(o.y-f.y)/d}}var c=[];Mt(a.classes)?c=a.classes:Ge(a.classes)&&(c=a.classes.split(/\s+/));for(var h=0,g=c.length;h<g;h++){var y=c[h];!y||y===""||u.classes.add(y)}this.createEmitter(),(n===void 0||n)&&this.restore();var E=a.style||a.css;E&&(Et("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(E))},T0=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,l,u){var o;vt(n)&&!ar(n)&&(o=n,n=o.roots||o.root,l=o.visit,u=o.directed),u=arguments.length===2&&!Pt(l)?l:u,l=Pt(l)?l:function(){};for(var f=this._private.cy,d=n=Ge(n)?this.filter(n):n,c=[],h=[],g={},y={},E={},b=0,w,x=this.byGroup(),S=x.nodes,T=x.edges,C=0;C<d.length;C++){var D=d[C],R=D.id();D.isNode()&&(c.unshift(D),e.bfs&&(E[R]=!0,h.push(D)),y[R]=0)}for(var z=function(){var P=e.bfs?c.shift():c.pop(),Y=P.id();if(e.dfs){if(E[Y])return 0;E[Y]=!0,h.push(P)}var I=y[Y],L=g[Y],H=L!=null?L.source():null,F=L!=null?L.target():null,Q=L==null?void 0:P.same(H)?F[0]:H[0],J;if(J=l(P,L,Q,b++,I),J===!0)return w=P,1;if(J===!1)return 1;for(var M=P.connectedEdges().filter(function(se){return(!u||se.source().same(P))&&T.has(se)}),G=0;G<M.length;G++){var Z=M[G],W=Z.connectedNodes().filter(function(se){return!se.same(P)&&S.has(se)}),ae=W.id();W.length!==0&&!E[ae]&&(W=W[0],c.push(W),e.bfs&&(E[ae]=!0,h.push(W)),g[ae]=Z,y[ae]=y[Y]+1)}},B;c.length!==0&&(B=z(),!(B!==0&&B===1)););for(var O=f.collection(),_=0;_<h.length;_++){var U=h[_],V=g[U.id()];V!=null&&O.push(V),O.push(U)}return{path:f.collection(O),found:f.collection(w)}}},Iu={breadthFirstSearch:T0({bfs:!0}),depthFirstSearch:T0({dfs:!0})};Iu.bfs=Iu.breadthFirstSearch;Iu.dfs=Iu.depthFirstSearch;var Uo={exports:{}},Kw=Uo.exports,C0;function Zw(){return C0||(C0=1,(function(t,e){(function(){var a,n,l,u,o,f,d,c,h,g,y,E,b,w,x;l=Math.floor,g=Math.min,n=function(S,T){return S<T?-1:S>T?1:0},h=function(S,T,C,D,R){var z;if(C==null&&(C=0),R==null&&(R=n),C<0)throw new Error("lo must be non-negative");for(D==null&&(D=S.length);C<D;)z=l((C+D)/2),R(T,S[z])<0?D=z:C=z+1;return[].splice.apply(S,[C,C-C].concat(T)),T},f=function(S,T,C){return C==null&&(C=n),S.push(T),w(S,0,S.length-1,C)},o=function(S,T){var C,D;return T==null&&(T=n),C=S.pop(),S.length?(D=S[0],S[0]=C,x(S,0,T)):D=C,D},c=function(S,T,C){var D;return C==null&&(C=n),D=S[0],S[0]=T,x(S,0,C),D},d=function(S,T,C){var D;return C==null&&(C=n),S.length&&C(S[0],T)<0&&(D=[S[0],T],T=D[0],S[0]=D[1],x(S,0,C)),T},u=function(S,T){var C,D,R,z,B,O;for(T==null&&(T=n),z=(function(){O=[];for(var _=0,U=l(S.length/2);0<=U?_<U:_>U;0<=U?_++:_--)O.push(_);return O}).apply(this).reverse(),B=[],D=0,R=z.length;D<R;D++)C=z[D],B.push(x(S,C,T));return B},b=function(S,T,C){var D;if(C==null&&(C=n),D=S.indexOf(T),D!==-1)return w(S,0,D,C),x(S,D,C)},y=function(S,T,C){var D,R,z,B,O;if(C==null&&(C=n),R=S.slice(0,T),!R.length)return R;for(u(R,C),O=S.slice(T),z=0,B=O.length;z<B;z++)D=O[z],d(R,D,C);return R.sort(C).reverse()},E=function(S,T,C){var D,R,z,B,O,_,U,V,q;if(C==null&&(C=n),T*10<=S.length){if(z=S.slice(0,T).sort(C),!z.length)return z;for(R=z[z.length-1],U=S.slice(T),B=0,_=U.length;B<_;B++)D=U[B],C(D,R)<0&&(h(z,D,0,null,C),z.pop(),R=z[z.length-1]);return z}for(u(S,C),q=[],O=0,V=g(T,S.length);0<=V?O<V:O>V;0<=V?++O:--O)q.push(o(S,C));return q},w=function(S,T,C,D){var R,z,B;for(D==null&&(D=n),R=S[C];C>T;){if(B=C-1>>1,z=S[B],D(R,z)<0){S[C]=z,C=B;continue}break}return S[C]=R},x=function(S,T,C){var D,R,z,B,O;for(C==null&&(C=n),R=S.length,O=T,z=S[T],D=2*T+1;D<R;)B=D+1,B<R&&!(C(S[D],S[B])<0)&&(D=B),S[T]=S[D],T=D,D=2*T+1;return S[T]=z,w(S,O,T,C)},a=(function(){S.push=f,S.pop=o,S.replace=c,S.pushpop=d,S.heapify=u,S.updateItem=b,S.nlargest=y,S.nsmallest=E;function S(T){this.cmp=T??n,this.nodes=[]}return S.prototype.push=function(T){return f(this.nodes,T,this.cmp)},S.prototype.pop=function(){return o(this.nodes,this.cmp)},S.prototype.peek=function(){return this.nodes[0]},S.prototype.contains=function(T){return this.nodes.indexOf(T)!==-1},S.prototype.replace=function(T){return c(this.nodes,T,this.cmp)},S.prototype.pushpop=function(T){return d(this.nodes,T,this.cmp)},S.prototype.heapify=function(){return u(this.nodes,this.cmp)},S.prototype.updateItem=function(T){return b(this.nodes,T,this.cmp)},S.prototype.clear=function(){return this.nodes=[]},S.prototype.empty=function(){return this.nodes.length===0},S.prototype.size=function(){return this.nodes.length},S.prototype.clone=function(){var T;return T=new S,T.nodes=this.nodes.slice(0),T},S.prototype.toArray=function(){return this.nodes.slice(0)},S.prototype.insert=S.prototype.push,S.prototype.top=S.prototype.peek,S.prototype.front=S.prototype.peek,S.prototype.has=S.prototype.contains,S.prototype.copy=S.prototype.clone,S})(),(function(S,T){return t.exports=T()})(this,function(){return a})}).call(Kw)})(Uo)),Uo.exports}var nd,A0;function Qw(){return A0||(A0=1,nd=Zw()),nd}var Jw=Qw(),is=ts(Jw),Ww=Ca({root:null,weight:function(e){return 1},directed:!1}),$w={dijkstra:function(e){if(!vt(e)){var a=arguments;e={root:a[0],weight:a[1],directed:a[2]}}var n=Ww(e),l=n.root,u=n.weight,o=n.directed,f=this,d=u,c=Ge(l)?this.filter(l)[0]:l[0],h={},g={},y={},E=this.byGroup(),b=E.nodes,w=E.edges;w.unmergeBy(function(I){return I.isLoop()});for(var x=function(L){return h[L.id()]},S=function(L,H){h[L.id()]=H,T.updateItem(L)},T=new is(function(I,L){return x(I)-x(L)}),C=0;C<b.length;C++){var D=b[C];h[D.id()]=D.same(c)?0:1/0,T.push(D)}for(var R=function(L,H){for(var F=(o?L.edgesTo(H):L.edgesWith(H)).intersect(w),Q=1/0,J,M=0;M<F.length;M++){var G=F[M],Z=d(G);(Z<Q||!J)&&(Q=Z,J=G)}return{edge:J,dist:Q}};T.size()>0;){var z=T.pop(),B=x(z),O=z.id();if(y[O]=B,B!==1/0)for(var _=z.neighborhood().intersect(b),U=0;U<_.length;U++){var V=_[U],q=V.id(),P=R(z,V),Y=B+P.dist;Y<x(V)&&(S(V,Y),g[q]={node:z,edge:P.edge})}}return{distanceTo:function(L){var H=Ge(L)?b.filter(L)[0]:L[0];return y[H.id()]},pathTo:function(L){var H=Ge(L)?b.filter(L)[0]:L[0],F=[],Q=H,J=Q.id();if(H.length>0)for(F.unshift(H);g[J];){var M=g[J];F.unshift(M.edge),F.unshift(M.node),Q=M.node,J=Q.id()}return f.spawn(F)}}}},eT={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),f=n,d=function(D){for(var R=0;R<o.length;R++){var z=o[R];if(z.has(D))return R}},c=0;c<u;c++)o[c]=this.spawn(n[c]);for(var h=l.sort(function(C,D){return e(C)-e(D)}),g=0;g<h.length;g++){var y=h[g],E=y.source()[0],b=y.target()[0],w=d(E),x=d(b),S=o[w],T=o[x];w!==x&&(f.merge(y),S.merge(T),o.splice(x,1))}return f}},tT=Ca({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),aT={aStar:function(e){var a=this.cy(),n=tT(e),l=n.root,u=n.goal,o=n.heuristic,f=n.directed,d=n.weight;l=a.collection(l)[0],u=a.collection(u)[0];var c=l.id(),h=u.id(),g={},y={},E={},b=new is(function(J,M){return y[J.id()]-y[M.id()]}),w=new Nl,x={},S={},T=function(M,G){b.push(M),w.add(G)},C,D,R=function(){C=b.pop(),D=C.id(),w.delete(D)},z=function(M){return w.has(M)};T(l,c),g[c]=0,y[c]=o(l);for(var B=0;b.size()>0;){if(R(),B++,D===h){for(var O=[],_=u,U=h,V=S[U];O.unshift(_),V!=null&&O.unshift(V),_=x[U],_!=null;)U=_.id(),V=S[U];return{found:!0,distance:g[D],path:this.spawn(O),steps:B}}E[D]=!0;for(var q=C._private.edges,P=0;P<q.length;P++){var Y=q[P];if(this.hasElementWithId(Y.id())&&!(f&&Y.data("source")!==D)){var I=Y.source(),L=Y.target(),H=I.id()!==D?I:L,F=H.id();if(this.hasElementWithId(F)&&!E[F]){var Q=g[D]+d(Y);if(!z(F)){g[F]=Q,y[F]=Q+o(H),T(H,F),x[F]=C,S[F]=Y;continue}Q<g[F]&&(g[F]=Q,y[F]=Q+o(H),x[F]=C,S[F]=Y)}}}}return{found:!1,distance:void 0,path:void 0,steps:B}}},rT=Ca({weight:function(e){return 1},directed:!1}),nT={floydWarshall:function(e){for(var a=this.cy(),n=rT(e),l=n.weight,u=n.directed,o=l,f=this.byGroup(),d=f.nodes,c=f.edges,h=d.length,g=h*h,y=function(Z){return d.indexOf(Z)},E=function(Z){return d[Z]},b=new Array(g),w=0;w<g;w++){var x=w%h,S=(w-x)/h;S===x?b[w]=0:b[w]=1/0}for(var T=new Array(g),C=new Array(g),D=0;D<c.length;D++){var R=c[D],z=R.source()[0],B=R.target()[0];if(z!==B){var O=y(z),_=y(B),U=O*h+_,V=o(R);if(b[U]>V&&(b[U]=V,T[U]=_,C[U]=R),!u){var q=_*h+O;!u&&b[q]>V&&(b[q]=V,T[q]=O,C[q]=R)}}}for(var P=0;P<h;P++)for(var Y=0;Y<h;Y++)for(var I=Y*h+P,L=0;L<h;L++){var H=Y*h+L,F=P*h+L;b[I]+b[F]<b[H]&&(b[H]=b[I]+b[F],T[H]=T[I])}var Q=function(Z){return(Ge(Z)?a.filter(Z):Z)[0]},J=function(Z){return y(Q(Z))},M={distance:function(Z,W){var ae=J(Z),se=J(W);return b[ae*h+se]},path:function(Z,W){var ae=J(Z),se=J(W),he=E(ae);if(ae===se)return he.collection();if(T[ae*h+se]==null)return a.collection();var we=a.collection(),de=ae,$;for(we.merge(he);ae!==se;)de=ae,ae=T[ae*h+se],$=C[de*h+ae],we.merge($),we.merge(E(ae));return we}};return M}},iT=Ca({weight:function(e){return 1},directed:!1,root:null}),lT={bellmanFord:function(e){var a=this,n=iT(e),l=n.weight,u=n.directed,o=n.root,f=l,d=this,c=this.cy(),h=this.byGroup(),g=h.edges,y=h.nodes,E=y.length,b=new tn,w=!1,x=[];o=c.collection(o)[0],g.unmergeBy(function(Ue){return Ue.isLoop()});for(var S=g.length,T=function(Ve){var Ae=b.get(Ve.id());return Ae||(Ae={},b.set(Ve.id(),Ae)),Ae},C=function(Ve){return(Ge(Ve)?c.$(Ve):Ve)[0]},D=function(Ve){return T(C(Ve)).dist},R=function(Ve){for(var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,Ce=C(Ve),_e=[],He=Ce;;){if(He==null)return a.spawn();var je=T(He),De=je.edge,We=je.pred;if(_e.unshift(He[0]),He.same(Ae)&&_e.length>0)break;De!=null&&_e.unshift(De),He=We}return d.spawn(_e)},z=0;z<E;z++){var B=y[z],O=T(B);B.same(o)?O.dist=0:O.dist=1/0,O.pred=null,O.edge=null}for(var _=!1,U=function(Ve,Ae,Ce,_e,He,je){var De=_e.dist+je;De<He.dist&&!Ce.same(_e.edge)&&(He.dist=De,He.pred=Ve,He.edge=Ce,_=!0)},V=1;V<E;V++){_=!1;for(var q=0;q<S;q++){var P=g[q],Y=P.source(),I=P.target(),L=f(P),H=T(Y),F=T(I);U(Y,I,P,H,F,L),u||U(I,Y,P,F,H,L)}if(!_)break}if(_)for(var Q=[],J=0;J<S;J++){var M=g[J],G=M.source(),Z=M.target(),W=f(M),ae=T(G).dist,se=T(Z).dist;if(ae+W<se||!u&&se+W<ae)if(w||(Et("Graph contains a negative weight cycle for Bellman-Ford"),w=!0),e.findNegativeWeightCycles!==!1){var he=[];ae+W<se&&he.push(G),!u&&se+W<ae&&he.push(Z);for(var we=he.length,de=0;de<we;de++){var $=he[de],re=[$];re.push(T($).edge);for(var le=T($).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 pe=re[0].id(),j=0,xe=2;xe<re.length;xe+=2)re[xe].id()<pe&&(pe=re[xe].id(),j=xe);re=re.slice(j).concat(re.slice(0,j)),re.push(re[0]);var Be=re.map(function(Ue){return Ue.id()}).join(",");Q.indexOf(Be)===-1&&(x.push(d.spawn(re)),Q.push(Be))}}else break}return{distanceTo:D,pathTo:R,hasNegativeWeightCycle:w,negativeWeightCycles:x}}},uT=Math.sqrt(2),sT=function(e,a,n){n.length===0&&qt("Karger-Stein must be run on a connected (sub)graph");for(var l=n[e],u=l[1],o=l[2],f=a[u],d=a[o],c=n,h=c.length-1;h>=0;h--){var g=c[h],y=g[1],E=g[2];(a[y]===f&&a[E]===d||a[y]===d&&a[E]===f)&&c.splice(h,1)}for(var b=0;b<c.length;b++){var w=c[b];w[1]===d?(c[b]=w.slice(),c[b][1]=f):w[2]===d&&(c[b]=w.slice(),c[b][2]=f)}for(var x=0;x<a.length;x++)a[x]===d&&(a[x]=f);return c},id=function(e,a,n,l){for(;n>l;){var u=Math.floor(Math.random()*a.length);a=sT(u,e,a),n--}return a},oT={kargerStein:function(){var e=this,a=this.byGroup(),n=a.nodes,l=a.edges;l.unmergeBy(function(F){return F.isLoop()});var u=n.length,o=l.length,f=Math.ceil(Math.pow(Math.log(u)/Math.LN2,2)),d=Math.floor(u/uT);if(u<2){qt("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],h=0;h<o;h++){var g=l[h];c.push([h,n.indexOf(g.source()),n.indexOf(g.target())])}for(var y=1/0,E=[],b=new Array(u),w=new Array(u),x=new Array(u),S=function(Q,J){for(var M=0;M<u;M++)J[M]=Q[M]},T=0;T<=f;T++){for(var C=0;C<u;C++)w[C]=C;var D=id(w,c.slice(),u,d),R=D.slice();S(w,x);var z=id(w,D,d,2),B=id(x,R,d,2);z.length<=B.length&&z.length<y?(y=z.length,E=z,S(w,b)):B.length<=z.length&&B.length<y&&(y=B.length,E=B,S(x,b))}for(var O=this.spawn(E.map(function(F){return l[F[0]]})),_=this.spawn(),U=this.spawn(),V=b[0],q=0;q<b.length;q++){var P=b[q],Y=n[q];P===V?_.merge(Y):U.merge(Y)}var I=function(Q){var J=e.spawn();return Q.forEach(function(M){J.merge(M),M.connectedEdges().forEach(function(G){e.contains(G)&&!O.contains(G)&&J.merge(G)})}),J},L=[I(_),I(U)],H={cut:O,components:L,partition1:_,partition2:U};return H}},ld,fT=function(e){return{x:e.x,y:e.y}},hf=function(e,a,n){return{x:e.x*a+n.x,y:e.y*a+n.y}},r2=function(e,a,n){return{x:(e.x-n.x)/a,y:(e.y-n.y)/a}},wl=function(e){return{x:e[0],y:e[1]}},cT=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},vT=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},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=0,u=0,o=a;o<n;o++){var f=e[o];isFinite(f)&&(l+=f,u++)}return l/u},hT=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 f=0,d=e.length-1;d>=0;d--){var c=e[d];o?isFinite(c)||(e[d]=-1/0,f++):e.splice(d,1)}u&&e.sort(function(y,E){return y-E});var h=e.length,g=Math.floor(h/2);return h%2!==0?e[g+1+f]:(e[g-1+f]+e[g+f])/2},gT=function(e){return Math.PI*e/180},Bo=function(e,a){return Math.atan2(a,e)-Math.PI/2},Kh=Math.log2||function(t){return Math.log(t)/Math.log(2)},Zh=function(e){return e>0?1:e<0?-1:0},Ai=function(e,a){return Math.sqrt(Ei(e,a))},Ei=function(e,a){var n=a.x-e.x,l=a.y-e.y;return n*n+l*l},pT=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},ga=function(e,a,n,l){return(1-l)*(1-l)*e+2*(1-l)*l*a+l*l*n},Al=function(e,a,n,l){return{x:ga(e.x,a.x,n.x,l),y:ga(e.y,a.y,n.y,l)}},yT=function(e,a,n,l){var u={x:a.x-e.x,y:a.y-e.y},o=Ai(e,a),f={x:u.x/o,y:u.y/o};return n=n??0,l=l??n*o,{x:e.x+f.x*l,y:e.y+f.y*l}},Xu=function(e,a,n){return Math.max(e,Math.min(n,a))},ka=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}}},mT=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},bT=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},ET=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},n2=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},Ho=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},Po=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 f=aa(a,4);n=f[0],l=f[1],u=f[2],o=f[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},D0=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},Qh=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)},Un=function(e,a,n){return e.x1<=a&&a<=e.x2&&e.y1<=n&&n<=e.y2},B0=function(e,a){return Un(e,a.x,a.y)},i2=function(e,a){return Un(e,a.x1,a.y1)&&Un(e,a.x2,a.y2)},xT=(ld=Math.hypot)!==null&&ld!==void 0?ld:function(t,e){return Math.sqrt(t*t+e*e)};function ST(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var a=function(O,_){return{x:O.x+_.x,y:O.y+_.y}},n=function(O,_){return{x:O.x-_.x,y:O.y-_.y}},l=function(O,_){return{x:O.x*_,y:O.y*_}},u=function(O,_){return O.x*_.y-O.y*_.x},o=function(O){var _=xT(O.x,O.y);return _===0?{x:0,y:0}:{x:O.x/_,y:O.y/_}},f=function(O){for(var _=0,U=0;U<O.length;U++){var V=O[U],q=O[(U+1)%O.length];_+=V.x*q.y-q.x*V.y}return _/2},d=function(O,_,U,V){var q=n(_,O),P=n(V,U),Y=u(q,P);if(Math.abs(Y)<1e-9)return a(O,l(q,.5));var I=u(n(U,O),P)/Y;return a(O,l(q,I))},c=t.map(function(B){return{x:B.x,y:B.y}});f(c)<0&&c.reverse();for(var h=c.length,g=[],y=0;y<h;y++){var E=c[y],b=c[(y+1)%h],w=n(b,E),x=o({x:w.y,y:-w.x});g.push(x)}for(var S=g.map(function(B,O){var _=a(c[O],l(B,e)),U=a(c[(O+1)%h],l(B,e));return{p1:_,p2:U}}),T=[],C=0;C<h;C++){var D=S[(C-1+h)%h],R=S[C],z=d(D.p1,D.p2,R.p1,R.p2);T.push(z)}return T}function wT(t,e,a,n,l,u){var o=OT(t,e,a,n,l),f=ST(o,u),d=ka();return f.forEach(function(c){return n2(d,c.x,c.y)}),d}var l2=function(e,a,n,l,u,o,f){var d=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=d==="auto"?In(u,o):d,h=u/2,g=o/2;c=Math.min(c,h,g);var y=c!==h,E=c!==g,b;if(y){var w=n-h+c-f,x=l-g-f,S=n+h-c+f,T=x;if(b=Hn(e,a,n,l,w,x,S,T,!1),b.length>0)return b}if(E){var C=n+h+f,D=l-g+c-f,R=C,z=l+g-c+f;if(b=Hn(e,a,n,l,C,D,R,z,!1),b.length>0)return b}if(y){var B=n-h+c-f,O=l+g+f,_=n+h-c+f,U=O;if(b=Hn(e,a,n,l,B,O,_,U,!1),b.length>0)return b}if(E){var V=n-h-f,q=l-g+c-f,P=V,Y=l+g-c+f;if(b=Hn(e,a,n,l,V,q,P,Y,!1),b.length>0)return b}var I;{var L=n-h+c,H=l-g+c;if(I=qu(e,a,n,l,L,H,c+f),I.length>0&&I[0]<=L&&I[1]<=H)return[I[0],I[1]]}{var F=n+h-c,Q=l-g+c;if(I=qu(e,a,n,l,F,Q,c+f),I.length>0&&I[0]>=F&&I[1]<=Q)return[I[0],I[1]]}{var J=n+h-c,M=l+g-c;if(I=qu(e,a,n,l,J,M,c+f),I.length>0&&I[0]>=J&&I[1]>=M)return[I[0],I[1]]}{var G=n-h+c,Z=l+g-c;if(I=qu(e,a,n,l,G,Z,c+f),I.length>0&&I[0]<=G&&I[1]>=Z)return[I[0],I[1]]}return[]},TT=function(e,a,n,l,u,o,f){var d=f,c=Math.min(n,u),h=Math.max(n,u),g=Math.min(l,o),y=Math.max(l,o);return c-d<=e&&e<=h+d&&g-d<=a&&a<=y+d},CT=function(e,a,n,l,u,o,f,d,c){var h={x1:Math.min(n,f,u)-c,x2:Math.max(n,f,u)+c,y1:Math.min(l,d,o)-c,y2:Math.max(l,d,o)+c};return!(e<h.x1||e>h.x2||a<h.y1||a>h.y2)},AT=function(e,a,n,l){n-=l;var u=a*a-4*e*n;if(u<0)return[];var o=Math.sqrt(u),f=2*e,d=(-a+o)/f,c=(-a-o)/f;return[d,c]},DT=function(e,a,n,l,u){var o=1e-5;e===0&&(e=o),a/=e,n/=e,l/=e;var f,d,c,h,g,y,E,b;if(d=(3*n-a*a)/9,c=-(27*l)+a*(9*n-2*(a*a)),c/=54,f=d*d*d+c*c,u[1]=0,E=a/3,f>0){g=c+Math.sqrt(f),g=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),y=c-Math.sqrt(f),y=y<0?-Math.pow(-y,1/3):Math.pow(y,1/3),u[0]=-E+g+y,E+=(g+y)/2,u[4]=u[2]=-E,E=Math.sqrt(3)*(-y+g)/2,u[3]=E,u[5]=-E;return}if(u[5]=u[3]=0,f===0){b=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),u[0]=-E+2*b,u[4]=u[2]=-(b+E);return}d=-d,h=d*d*d,h=Math.acos(c/Math.sqrt(h)),b=2*Math.sqrt(d),u[0]=-E+b*Math.cos(h/3),u[2]=-E+b*Math.cos((h+2*Math.PI)/3),u[4]=-E+b*Math.cos((h+4*Math.PI)/3)},BT=function(e,a,n,l,u,o,f,d){var c=1*n*n-4*n*u+2*n*f+4*u*u-4*u*f+f*f+l*l-4*l*o+2*l*d+4*o*o-4*o*d+d*d,h=9*n*u-3*n*n-3*n*f-6*u*u+3*u*f+9*l*o-3*l*l-3*l*d-6*o*o+3*o*d,g=3*n*n-6*n*u+n*f-n*e+2*u*u+2*u*e-f*e+3*l*l-6*l*o+l*d-l*a+2*o*o+2*o*a-d*a,y=1*n*u-n*n+n*e-u*e+l*o-l*l+l*a-o*a,E=[];DT(c,h,g,y,E);for(var b=1e-7,w=[],x=0;x<6;x+=2)Math.abs(E[x+1])<b&&E[x]>=0&&E[x]<=1&&w.push(E[x]);w.push(1),w.push(0);for(var S=-1,T,C,D,R=0;R<w.length;R++)T=Math.pow(1-w[R],2)*n+2*(1-w[R])*w[R]*u+w[R]*w[R]*f,C=Math.pow(1-w[R],2)*l+2*(1-w[R])*w[R]*o+w[R]*w[R]*d,D=Math.pow(T-e,2)+Math.pow(C-a,2),S>=0?D<S&&(S=D):S=D;return S},MT=function(e,a,n,l,u,o){var f=[e-n,a-l],d=[u-n,o-l],c=d[0]*d[0]+d[1]*d[1],h=f[0]*f[0]+f[1]*f[1],g=f[0]*d[0]+f[1]*d[1],y=g*g/c;return g<0?h:y>c?(e-u)*(e-u)+(a-o)*(a-o):h-y},Xa=function(e,a,n){for(var l,u,o,f,d,c=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],f=n[(h+1)*2+1]):(o=n[(h+1-n.length/2)*2],f=n[(h+1-n.length/2)*2+1]),!(l==e&&o==e))if(l>=e&&e>=o||l<=e&&e<=o)d=(e-l)/(o-l)*(f-u)+u,d>a&&c++;else continue;return c%2!==0},rn=function(e,a,n,l,u,o,f,d,c){var h=new Array(n.length),g;d[0]!=null?(g=Math.atan(d[1]/d[0]),d[0]<0?g=g+Math.PI/2:g=-g-Math.PI/2):g=d;for(var y=Math.cos(-g),E=Math.sin(-g),b=0;b<h.length/2;b++)h[b*2]=o/2*(n[b*2]*y-n[b*2+1]*E),h[b*2+1]=f/2*(n[b*2+1]*y+n[b*2]*E),h[b*2]+=l,h[b*2+1]+=u;var w;if(c>0){var x=tf(h,-c);w=ef(x)}else w=h;return Xa(e,a,w)},RT=function(e,a,n,l,u,o,f,d){for(var c=new Array(n.length*2),h=0;h<d.length;h++){var g=d[h];c[h*4+0]=g.startX,c[h*4+1]=g.startY,c[h*4+2]=g.stopX,c[h*4+3]=g.stopY;var y=Math.pow(g.cx-e,2)+Math.pow(g.cy-a,2);if(y<=Math.pow(g.radius,2))return!0}return Xa(e,a,c)},ef=function(e){for(var a=new Array(e.length/2),n,l,u,o,f,d,c,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?(f=e[(g+1)*4],d=e[(g+1)*4+1],c=e[(g+1)*4+2],h=e[(g+1)*4+3]):(f=e[0],d=e[1],c=e[2],h=e[3]);var y=Hn(n,l,u,o,f,d,c,h,!0);a[g*2]=y[0],a[g*2+1]=y[1]}return a},tf=function(e,a){for(var n=new Array(e.length*2),l,u,o,f,d=0;d<e.length/2;d++){l=e[d*2],u=e[d*2+1],d<e.length/2-1?(o=e[(d+1)*2],f=e[(d+1)*2+1]):(o=e[0],f=e[1]);var c=f-u,h=-(o-l),g=Math.sqrt(c*c+h*h),y=c/g,E=h/g;n[d*4]=l+y*a,n[d*4+1]=u+E*a,n[d*4+2]=o+y*a,n[d*4+3]=f+E*a}return n},zT=function(e,a,n,l,u,o){var f=n-e,d=l-a;f/=u,d/=o;var c=Math.sqrt(f*f+d*d),h=c-1;if(h<0)return[];var g=h/c;return[(n-e)*g+e,(l-a)*g+a]},Ti=function(e,a,n,l,u,o,f){return e-=u,a-=o,e/=n/2+f,a/=l/2+f,e*e+a*a<=1},qu=function(e,a,n,l,u,o,f){var d=[n-e,l-a],c=[e-u,a-o],h=d[0]*d[0]+d[1]*d[1],g=2*(c[0]*d[0]+c[1]*d[1]),y=c[0]*c[0]+c[1]*c[1]-f*f,E=g*g-4*h*y;if(E<0)return[];var b=(-g+Math.sqrt(E))/(2*h),w=(-g-Math.sqrt(E))/(2*h),x=Math.min(b,w),S=Math.max(b,w),T=[];if(x>=0&&x<=1&&T.push(x),S>=0&&S<=1&&T.push(S),T.length===0)return[];var C=T[0]*d[0]+e,D=T[0]*d[1]+a;if(T.length>1){if(T[0]==T[1])return[C,D];var R=T[1]*d[0]+e,z=T[1]*d[1]+a;return[C,D,R,z]}else return[C,D]},ud=function(e,a,n){return a<=e&&e<=n||n<=e&&e<=a?e:e<=a&&a<=n||n<=a&&a<=e?a:n},Hn=function(e,a,n,l,u,o,f,d,c){var h=e-u,g=n-e,y=f-u,E=a-o,b=l-a,w=d-o,x=y*E-w*h,S=g*E-b*h,T=w*g-y*b;if(T!==0){var C=x/T,D=S/T,R=.001,z=0-R,B=1+R;return z<=C&&C<=B&&z<=D&&D<=B?[e+C*g,a+C*b]:c?[e+C*g,a+C*b]:[]}else return x===0||S===0?ud(e,n,f)===f?[f,d]:ud(e,n,u)===u?[u,o]:ud(u,f,n)===n?[n,l]:[]:[]},OT=function(e,a,n,l,u){var o=[],f=l/2,d=u/2,c=a,h=n;o.push({x:c+f*e[0],y:h+d*e[1]});for(var g=1;g<e.length/2;g++)o.push({x:c+f*e[g*2],y:h+d*e[g*2+1]});return o},ju=function(e,a,n,l,u,o,f,d){var c=[],h,g=new Array(n.length),y=!0;o==null&&(y=!1);var E;if(y){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]*f+u;if(d>0){var w=tf(g,-d);E=ef(w)}else E=g}else E=n;for(var x,S,T,C,D=0;D<E.length/2;D++)x=E[D*2],S=E[D*2+1],D<E.length/2-1?(T=E[(D+1)*2],C=E[(D+1)*2+1]):(T=E[0],C=E[1]),h=Hn(e,a,l,u,x,S,T,C),h.length!==0&&c.push(h[0],h[1]);return c},NT=function(e,a,n,l,u,o,f,d,c){var h=[],g,y=new Array(n.length*2);c.forEach(function(T,C){C===0?(y[y.length-2]=T.startX,y[y.length-1]=T.startY):(y[C*4-2]=T.startX,y[C*4-1]=T.startY),y[C*4]=T.stopX,y[C*4+1]=T.stopY,g=qu(e,a,l,u,T.cx,T.cy,T.radius),g.length!==0&&h.push(g[0],g[1])});for(var E=0;E<y.length/4;E++)g=Hn(e,a,l,u,y[E*4],y[E*4+1],y[E*4+2],y[E*4+3],!1),g.length!==0&&h.push(g[0],g[1]);if(h.length>2){for(var b=[h[0],h[1]],w=Math.pow(b[0]-e,2)+Math.pow(b[1]-a,2),x=1;x<h.length/2;x++){var S=Math.pow(h[x*2]-e,2)+Math.pow(h[x*2+1]-a,2);S<=w&&(b[0]=h[x*2],b[1]=h[x*2+1],w=S)}return b}return h},Mo=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]]},La=function(e,a){var n=xh(e,a);return n=u2(n),n},u2=function(e){for(var a,n,l=e.length/2,u=1/0,o=1/0,f=-1/0,d=-1/0,c=0;c<l;c++)a=e[2*c],n=e[2*c+1],u=Math.min(u,a),f=Math.max(f,a),o=Math.min(o,n),d=Math.max(d,n);for(var h=2/(f-u),g=2/(d-o),y=0;y<l;y++)a=e[2*y]=e[2*y]*h,n=e[2*y+1]=e[2*y+1]*g,u=Math.min(u,a),f=Math.max(f,a),o=Math.min(o,n),d=Math.max(d,n);if(o<-1)for(var E=0;E<l;E++)n=e[2*E+1]=e[2*E+1]+(-1-o);return e},xh=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,f=0;f<e;f++)o=f*n+l,u[2*f]=Math.cos(o),u[2*f+1]=Math.sin(-o);return u},In=function(e,a){return Math.min(e/4,a/4,8)},s2=function(e,a){return Math.min(e/10,a/10,8)},Jh=function(){return 8},LT=function(e,a,n){return[e-2*a+n,2*(a-e),e]},Sh=function(e,a){return{heightOffset:Math.min(15,.05*a),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function sd(t,e){function a(g){for(var y=[],E=0;E<g.length;E++){var b=g[E],w=g[(E+1)%g.length],x={x:w.x-b.x,y:w.y-b.y},S={x:-x.y,y:x.x},T=Math.sqrt(S.x*S.x+S.y*S.y);y.push({x:S.x/T,y:S.y/T})}return y}function n(g,y){var E=1/0,b=-1/0,w=ja(g),x;try{for(w.s();!(x=w.n()).done;){var S=x.value,T=S.x*y.x+S.y*y.y;E=Math.min(E,T),b=Math.max(b,T)}}catch(C){w.e(C)}finally{w.f()}return{min:E,max:b}}function l(g,y){return!(g.max<y.min||y.max<g.min)}var u=[].concat(Qo(a(t)),Qo(a(e))),o=ja(u),f;try{for(o.s();!(f=o.n()).done;){var d=f.value,c=n(t,d),h=n(e,d);if(!l(c,h))return!1}}catch(g){o.e(g)}finally{o.f()}return!0}var kT=Ca({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),_T={pageRank:function(e){for(var a=kT(e),n=a.dampingFactor,l=a.precision,u=a.iterations,o=a.weight,f=this._private.cy,d=this.byGroup(),c=d.nodes,h=d.edges,g=c.length,y=g*g,E=h.length,b=new Array(y),w=new Array(g),x=(1-n)/g,S=0;S<g;S++){for(var T=0;T<g;T++){var C=S*g+T;b[C]=0}w[S]=0}for(var D=0;D<E;D++){var R=h[D],z=R.data("source"),B=R.data("target");if(z!==B){var O=c.indexOfId(z),_=c.indexOfId(B),U=o(R),V=_*g+O;b[V]+=U,w[O]+=U}}for(var q=1/g+x,P=0;P<g;P++)if(w[P]===0)for(var Y=0;Y<g;Y++){var I=Y*g+P;b[I]=q}else for(var L=0;L<g;L++){var H=L*g+P;b[H]=b[H]/w[P]+x}for(var F=new Array(g),Q=new Array(g),J,M=0;M<g;M++)F[M]=1;for(var G=0;G<u;G++){for(var Z=0;Z<g;Z++)Q[Z]=0;for(var W=0;W<g;W++)for(var ae=0;ae<g;ae++){var se=W*g+ae;Q[W]+=b[se]*F[ae]}pT(Q),J=F,F=Q,Q=J;for(var he=0,we=0;we<g;we++){var de=J[we]-F[we];he+=de*de}if(he<l)break}var $={rank:function(le){return le=f.collection(le)[0],F[c.indexOf(le)]}};return $}},M0=Ca({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Dl={degreeCentralityNormalized:function(e){e=M0(e);var a=this.cy(),n=this.nodes(),l=n.length;if(e.directed){for(var h={},g={},y=0,E=0,b=0;b<l;b++){var w=n[b],x=w.id();e.root=w;var S=this.degreeCentrality(e);y<S.indegree&&(y=S.indegree),E<S.outdegree&&(E=S.outdegree),h[x]=S.indegree,g[x]=S.outdegree}return{indegree:function(C){return y==0?0:(Ge(C)&&(C=a.filter(C)),h[C.id()]/y)},outdegree:function(C){return E===0?0:(Ge(C)&&(C=a.filter(C)),g[C.id()]/E)}}}else{for(var u={},o=0,f=0;f<l;f++){var d=n[f];e.root=d;var c=this.degreeCentrality(e);o<c.degree&&(o=c.degree),u[d.id()]=c.degree}return{degree:function(C){return o===0?0:(Ge(C)&&(C=a.filter(C)),u[C.id()]/o)}}}},degreeCentrality:function(e){e=M0(e);var a=this.cy(),n=this,l=e,u=l.root,o=l.weight,f=l.directed,d=l.alpha;if(u=a.collection(u)[0],f){for(var E=u.connectedEdges(),b=E.filter(function(z){return z.target().same(u)&&n.has(z)}),w=E.filter(function(z){return z.source().same(u)&&n.has(z)}),x=b.length,S=w.length,T=0,C=0,D=0;D<b.length;D++)T+=o(b[D]);for(var R=0;R<w.length;R++)C+=o(w[R]);return{indegree:Math.pow(x,1-d)*Math.pow(T,d),outdegree:Math.pow(S,1-d)*Math.pow(C,d)}}else{for(var c=u.connectedEdges().intersection(n),h=c.length,g=0,y=0;y<c.length;y++)g+=o(c[y]);return{degree:Math.pow(h,1-d)*Math.pow(g,d)}}}};Dl.dc=Dl.degreeCentrality;Dl.dcn=Dl.degreeCentralityNormalised=Dl.degreeCentralityNormalized;var R0=Ca({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Bl={closenessCentralityNormalized:function(e){for(var a=R0(e),n=a.harmonic,l=a.weight,u=a.directed,o=this.cy(),f={},d=0,c=this.nodes(),h=this.floydWarshall({weight:l,directed:u}),g=0;g<c.length;g++){for(var y=0,E=c[g],b=0;b<c.length;b++)if(g!==b){var w=h.distance(E,c[b]);n?y+=1/w:y+=w}n||(y=1/y),d<y&&(d=y),f[E.id()]=y}return{closeness:function(S){return d==0?0:(Ge(S)?S=o.filter(S)[0].id():S=S.id(),f[S]/d)}}},closenessCentrality:function(e){var a=R0(e),n=a.root,l=a.weight,u=a.directed,o=a.harmonic;n=this.filter(n)[0];for(var f=this.dijkstra({root:n,weight:l,directed:u}),d=0,c=this.nodes(),h=0;h<c.length;h++){var g=c[h];if(!g.same(n)){var y=f.distanceTo(g);o?d+=1/y:d+=y}}return o?d:1/d}};Bl.cc=Bl.closenessCentrality;Bl.ccn=Bl.closenessCentralityNormalised=Bl.closenessCentralityNormalized;var qT=Ca({weight:null,directed:!1}),wh={betweennessCentrality:function(e){for(var a=qT(e),n=a.directed,l=a.weight,u=l!=null,o=this.cy(),f=this.nodes(),d={},c={},h=0,g={set:function(C,D){c[C]=D,D>h&&(h=D)},get:function(C){return c[C]}},y=0;y<f.length;y++){var E=f[y],b=E.id();n?d[b]=E.outgoers().nodes():d[b]=E.openNeighborhood().nodes(),g.set(b,0)}for(var w=function(){for(var C=f[x].id(),D=[],R={},z={},B={},O=new is(function(W,ae){return B[W]-B[ae]}),_=0;_<f.length;_++){var U=f[_].id();R[U]=[],z[U]=0,B[U]=1/0}for(z[C]=1,B[C]=0,O.push(C);!O.empty();){var V=O.pop();if(D.push(V),u)for(var q=0;q<d[V].length;q++){var P=d[V][q],Y=o.getElementById(V),I=void 0;Y.edgesTo(P).length>0?I=Y.edgesTo(P)[0]:I=P.edgesTo(Y)[0];var L=l(I);P=P.id(),B[P]>B[V]+L&&(B[P]=B[V]+L,O.nodes.indexOf(P)<0?O.push(P):O.updateItem(P),z[P]=0,R[P]=[]),B[P]==B[V]+L&&(z[P]=z[P]+z[V],R[P].push(V))}else for(var H=0;H<d[V].length;H++){var F=d[V][H].id();B[F]==1/0&&(O.push(F),B[F]=B[V]+1),B[F]==B[V]+1&&(z[F]=z[F]+z[V],R[F].push(V))}}for(var Q={},J=0;J<f.length;J++)Q[f[J].id()]=0;for(;D.length>0;){for(var M=D.pop(),G=0;G<R[M].length;G++){var Z=R[M][G];Q[Z]=Q[Z]+z[Z]/z[M]*(1+Q[M])}M!=f[x].id()&&g.set(M,g.get(M)+Q[M])}},x=0;x<f.length;x++)w();var S={betweenness:function(C){var D=o.collection(C).id();return g.get(D)},betweennessNormalized:function(C){if(h==0)return 0;var D=o.collection(C).id();return g.get(D)/h}};return S.betweennessNormalised=S.betweennessNormalized,S}};wh.bc=wh.betweennessCentrality;var VT=Ca({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),UT=function(e){return VT(e)},HT=function(e,a){for(var n=0,l=0;l<a.length;l++)n+=a[l](e);return n},PT=function(e,a,n){for(var l=0;l<a;l++)e[l*a+l]=n},o2=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}},GT=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 f=0;f<n;f++)for(var d=0;d<n;d++)l[u*n+d]+=e[u*n+f]*a[f*n+d]}return l},YT=function(e,a,n){for(var l=e.slice(0),u=1;u<n;u++)e=GT(e,l,a);return e},FT=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 o2(l,a),l},IT=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),f=Math.round(a[u]*Math.pow(10,l))/Math.pow(10,l);if(o!==f)return!1}return!0},XT=function(e,a,n,l){for(var u=[],o=0;o<a;o++){for(var f=[],d=0;d<a;d++)Math.round(e[o*a+d]*1e3)/1e3>0&&f.push(n[d]);f.length!==0&&u.push(l.collection(f))}return u},jT=function(e,a){for(var n=0;n<e.length;n++)if(!a[n]||e[n].id()!==a[n].id())return!1;return!0},KT=function(e){for(var a=0;a<e.length;a++)for(var n=0;n<e.length;n++)a!=n&&jT(e[a],e[n])&&e.splice(n,1);return e},z0=function(e){for(var a=this.nodes(),n=this.edges(),l=this.cy(),u=UT(e),o={},f=0;f<a.length;f++)o[a[f].id()]=f;for(var d=a.length,c=d*d,h=new Array(c),g,y=0;y<c;y++)h[y]=0;for(var E=0;E<n.length;E++){var b=n[E],w=o[b.source().id()],x=o[b.target().id()],S=HT(b,u.attributes);h[w*d+x]+=S,h[x*d+w]+=S}PT(h,d,u.multFactor),o2(h,d);for(var T=!0,C=0;T&&C<u.maxIterations;)T=!1,g=YT(h,d,u.expandFactor),h=FT(g,d,u.inflateFactor),IT(h,g,c,4)||(T=!0),C++;var D=XT(h,d,a,l);return D=KT(D),D},ZT={markovClustering:z0,mcl:z0},QT=function(e){return e},f2=function(e,a){return Math.abs(a-e)},O0=function(e,a,n){return e+f2(a,n)},N0=function(e,a,n){return e+Math.pow(n-a,2)},JT=function(e){return Math.sqrt(e)},WT=function(e,a,n){return Math.max(e,f2(a,n))},Ru=function(e,a,n,l,u){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:QT,f=l,d,c,h=0;h<e;h++)d=a(h),c=n(h),f=u(f,d,c);return o(f)},zl={euclidean:function(e,a,n){return e>=2?Ru(e,a,n,0,N0,JT):Ru(e,a,n,0,O0)},squaredEuclidean:function(e,a,n){return Ru(e,a,n,0,N0)},manhattan:function(e,a,n){return Ru(e,a,n,0,O0)},max:function(e,a,n){return Ru(e,a,n,-1/0,WT)}};zl["squared-euclidean"]=zl.squaredEuclidean;zl.squaredeuclidean=zl.squaredEuclidean;function gf(t,e,a,n,l,u){var o;return Pt(t)?o=t:o=zl[t]||zl.euclidean,e===0&&Pt(t)?o(l,u):o(e,a,n,l,u)}var $T=Ca({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Wh=function(e){return $T(e)},af=function(e,a,n,l,u){var o=u!=="kMedoids",f=o?function(g){return n[g]}:function(g){return l[g](n)},d=function(y){return l[y](a)},c=n,h=a;return gf(e,l.length,f,d,c,h)},od=function(e,a,n){for(var l=n.length,u=new Array(l),o=new Array(l),f=new Array(a),d=null,c=0;c<l;c++)u[c]=e.min(n[c]).value,o[c]=e.max(n[c]).value;for(var h=0;h<a;h++){d=[];for(var g=0;g<l;g++)d[g]=Math.random()*(o[g]-u[g])+u[g];f[h]=d}return f},c2=function(e,a,n,l,u){for(var o=1/0,f=0,d=0;d<a.length;d++){var c=af(n,e,a[d],l,u);c<o&&(o=c,f=d)}return f},v2=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},eC=function(e,a,n){return Math.abs(a-e)<=n},tC=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},aC=function(e,a,n){for(var l=0;l<n;l++)if(e===a[l])return!0;return!1},L0=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)];aC(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},k0=function(e,a,n){for(var l=0,u=0;u<a.length;u++)l+=af("manhattan",a[u],e,n,"kMedoids");return l},rC=function(e){var a=this.cy(),n=this.nodes(),l=null,u=Wh(e),o=new Array(u.k),f={},d;u.testMode?typeof u.testCentroids=="number"?(u.testCentroids,d=od(n,u.k,u.attributes)):ua(u.testCentroids)==="object"?d=u.testCentroids:d=od(n,u.k,u.attributes):d=od(n,u.k,u.attributes);for(var c=!0,h=0;c&&h<u.maxIterations;){for(var g=0;g<n.length;g++)l=n[g],f[l.id()]=c2(l,d,u.distance,u.attributes,"kMeans");c=!1;for(var y=0;y<u.k;y++){var E=v2(y,n,f);if(E.length!==0){for(var b=u.attributes.length,w=d[y],x=new Array(b),S=new Array(b),T=0;T<b;T++){S[T]=0;for(var C=0;C<E.length;C++)l=E[C],S[T]+=u.attributes[T](l);x[T]=S[T]/E.length,eC(x[T],w[T],u.sensitivityThreshold)||(c=!0)}d[y]=x,o[y]=a.collection(E)}}h++}return o},nC=function(e){var a=this.cy(),n=this.nodes(),l=null,u=Wh(e),o=new Array(u.k),f,d={},c,h=new Array(u.k);u.testMode?typeof u.testCentroids=="number"||(ua(u.testCentroids)==="object"?f=u.testCentroids:f=L0(n,u.k)):f=L0(n,u.k);for(var g=!0,y=0;g&&y<u.maxIterations;){for(var E=0;E<n.length;E++)l=n[E],d[l.id()]=c2(l,f,u.distance,u.attributes,"kMedoids");g=!1;for(var b=0;b<f.length;b++){var w=v2(b,n,d);if(w.length!==0){h[b]=k0(f[b],w,u.attributes);for(var x=0;x<w.length;x++)c=k0(w[x],w,u.attributes),c<h[b]&&(h[b]=c,f[b]=w[x],g=!0);o[b]=a.collection(w)}}y++}return o},iC=function(e,a,n,l,u){for(var o,f,d=0;d<a.length;d++)for(var c=0;c<e.length;c++)l[d][c]=Math.pow(n[d][c],u.m);for(var h=0;h<e.length;h++)for(var g=0;g<u.attributes.length;g++){o=0,f=0;for(var y=0;y<a.length;y++)o+=l[y][h]*u.attributes[g](a[y]),f+=l[y][h];e[h][g]=o/f}},lC=function(e,a,n,l,u){for(var o=0;o<e.length;o++)a[o]=e[o].slice();for(var f,d,c,h=2/(u.m-1),g=0;g<n.length;g++)for(var y=0;y<l.length;y++){f=0;for(var E=0;E<n.length;E++)d=af(u.distance,l[y],n[g],u.attributes,"cmeans"),c=af(u.distance,l[y],n[E],u.attributes,"cmeans"),f+=Math.pow(d/c,h);e[y][g]=1/f}},uC=function(e,a,n,l){for(var u=new Array(n.k),o=0;o<u.length;o++)u[o]=[];for(var f,d,c=0;c<a.length;c++){f=-1/0,d=-1;for(var h=0;h<a[0].length;h++)a[c][h]>f&&(f=a[c][h],d=h);u[d].push(e[c])}for(var g=0;g<u.length;g++)u[g]=l.collection(u[g]);return u},_0=function(e){var a=this.cy(),n=this.nodes(),l=Wh(e),u,o,f,d,c;d=new Array(n.length);for(var h=0;h<n.length;h++)d[h]=new Array(l.k);f=new Array(n.length);for(var g=0;g<n.length;g++)f[g]=new Array(l.k);for(var y=0;y<n.length;y++){for(var E=0,b=0;b<l.k;b++)f[y][b]=Math.random(),E+=f[y][b];for(var w=0;w<l.k;w++)f[y][w]=f[y][w]/E}o=new Array(l.k);for(var x=0;x<l.k;x++)o[x]=new Array(l.attributes.length);c=new Array(n.length);for(var S=0;S<n.length;S++)c[S]=new Array(l.k);for(var T=!0,C=0;T&&C<l.maxIterations;)T=!1,iC(o,n,f,c,l),lC(f,d,o,n,l),tC(f,d,l.sensitivityThreshold)||(T=!0),C++;return u=uC(n,f,l,a),{clusters:u,degreeOfMembership:f}},sC={kMeans:rC,kMedoids:nC,fuzzyCMeans:_0,fcm:_0},oC=Ca({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),fC={single:"min",complete:"max"},cC=function(e){var a=oC(e),n=fC[a.linkage];return n!=null&&(a.linkage=n),a},q0=function(e,a,n,l,u){for(var o=0,f=1/0,d,c=u.attributes,h=function(_,U){return gf(u.distance,c.length,function(V){return c[V](_)},function(V){return c[V](U)},_,U)},g=0;g<e.length;g++){var y=e[g].key,E=n[y][l[y]];E<f&&(o=y,f=E)}if(u.mode==="threshold"&&f>=u.threshold||u.mode==="dendrogram"&&e.length===1)return!1;var b=a[o],w=a[l[o]],x;u.mode==="dendrogram"?x={left:b,right:w,key:b.key}:x={value:b.value.concat(w.value),key:b.key},e[b.index]=x,e.splice(w.index,1),a[b.key]=x;for(var S=0;S<e.length;S++){var T=e[S];b.key===T.key?d=1/0:u.linkage==="min"?(d=n[b.key][T.key],n[b.key][T.key]>n[w.key][T.key]&&(d=n[w.key][T.key])):u.linkage==="max"?(d=n[b.key][T.key],n[b.key][T.key]<n[w.key][T.key]&&(d=n[w.key][T.key])):u.linkage==="mean"?d=(n[b.key][T.key]*b.size+n[w.key][T.key]*w.size)/(b.size+w.size):u.mode==="dendrogram"?d=h(T.value,b.value):d=h(T.value[0],b.value[0]),n[b.key][T.key]=n[T.key][b.key]=d}for(var C=0;C<e.length;C++){var D=e[C].key;if(l[D]===b.key||l[D]===w.key){for(var R=D,z=0;z<e.length;z++){var B=e[z].key;n[D][B]<n[D][R]&&(R=B)}l[D]=R}e[C].index=C}return b.key=w.key=b.index=w.index=null,!0},Tl=function(e,a,n){e&&(e.value?a.push(e.value):(e.left&&Tl(e.left,a),e.right&&Tl(e.right,a)))},Th=function(e,a){if(!e)return"";if(e.left&&e.right){var n=Th(e.left,a),l=Th(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()},Ch=function(e,a,n){if(!e)return[];var l=[],u=[],o=[];return a===0?(e.left&&Tl(e.left,l),e.right&&Tl(e.right,u),o=l.concat(u),[n.collection(o)]):a===1?e.value?[n.collection(e.value)]:(e.left&&Tl(e.left,l),e.right&&Tl(e.right,u),[n.collection(l),n.collection(u)]):e.value?[n.collection(e.value)]:(e.left&&(l=Ch(e.left,a-1,n)),e.right&&(u=Ch(e.right,a-1,n)),l.concat(u))},V0=function(e){for(var a=this.cy(),n=this.nodes(),l=cC(e),u=l.attributes,o=function(C,D){return gf(l.distance,u.length,function(R){return u[R](C)},function(R){return u[R](D)},C,D)},f=[],d=[],c=[],h=[],g=0;g<n.length;g++){var y={value:l.mode==="dendrogram"?n[g]:[n[g]],key:g,index:g};f[g]=y,h[g]=y,d[g]=[],c[g]=0}for(var E=0;E<f.length;E++)for(var b=0;b<=E;b++){var w=void 0;l.mode==="dendrogram"?w=E===b?1/0:o(f[E].value,f[b].value):w=E===b?1/0:o(f[E].value[0],f[b].value[0]),d[E][b]=w,d[b][E]=w,w<d[E][c[E]]&&(c[E]=b)}for(var x=q0(f,h,d,c,l);x;)x=q0(f,h,d,c,l);var S;return l.mode==="dendrogram"?(S=Ch(f[0],l.dendrogramDepth,a),l.addDendrogram&&Th(f[0],a)):(S=new Array(f.length),f.forEach(function(T,C){T.key=T.index=null,S[C]=a.collection(T.value)})),S},vC={hierarchicalClustering:V0,hca:V0},dC=Ca({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),hC=function(e){var a=e.damping,n=e.preference;.5<=a&&a<1||qt("Damping must range on [0.5, 1). Got: ".concat(a));var l=["median","mean","min","max"];return l.some(function(u){return u===n})||Te(n)||qt("Preference must be one of [".concat(l.map(function(u){return"'".concat(u,"'")}).join(", "),"] or a number. Got: ").concat(n)),dC(e)},gC=function(e,a,n,l){var u=function(f,d){return l[d](f)};return-gf(e,l.length,function(o){return u(a,o)},function(o){return u(n,o)},a,n)},pC=function(e,a){var n=null;return a==="median"?n=hT(e):a==="mean"?n=dT(e):a==="min"?n=cT(e):a==="max"?n=vT(e):n=a,n},yC=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},U0=function(e,a,n){for(var l=[],u=0;u<e;u++){for(var o=-1,f=-1/0,d=0;d<n.length;d++){var c=n[d];a[u*e+c]>f&&(o=c,f=a[u*e+c])}o>0&&l.push(o)}for(var h=0;h<n.length;h++)l[n[h]]=n[h];return l},mC=function(e,a,n){for(var l=U0(e,a,n),u=0;u<n.length;u++){for(var o=[],f=0;f<l.length;f++)l[f]===n[u]&&o.push(f);for(var d=-1,c=-1/0,h=0;h<o.length;h++){for(var g=0,y=0;y<o.length;y++)g+=a[o[y]*e+o[h]];g>c&&(d=h,c=g)}n[u]=o[d]}return l=U0(e,a,n),l},H0=function(e){for(var a=this.cy(),n=this.nodes(),l=hC(e),u={},o=0;o<n.length;o++)u[n[o].id()]=o;var f,d,c,h,g,y;f=n.length,d=f*f,c=new Array(d);for(var E=0;E<d;E++)c[E]=-1/0;for(var b=0;b<f;b++)for(var w=0;w<f;w++)b!==w&&(c[b*f+w]=gC(l.distance,n[b],n[w],l.attributes));h=pC(c,l.preference);for(var x=0;x<f;x++)c[x*f+x]=h;g=new Array(d);for(var S=0;S<d;S++)g[S]=0;y=new Array(d);for(var T=0;T<d;T++)y[T]=0;for(var C=new Array(f),D=new Array(f),R=new Array(f),z=0;z<f;z++)C[z]=0,D[z]=0,R[z]=0;for(var B=new Array(f*l.minIterations),O=0;O<B.length;O++)B[O]=0;var _;for(_=0;_<l.maxIterations;_++){for(var U=0;U<f;U++){for(var V=-1/0,q=-1/0,P=-1,Y=0,I=0;I<f;I++)C[I]=g[U*f+I],Y=y[U*f+I]+c[U*f+I],Y>=V?(q=V,V=Y,P=I):Y>q&&(q=Y);for(var L=0;L<f;L++)g[U*f+L]=(1-l.damping)*(c[U*f+L]-V)+l.damping*C[L];g[U*f+P]=(1-l.damping)*(c[U*f+P]-q)+l.damping*C[P]}for(var H=0;H<f;H++){for(var F=0,Q=0;Q<f;Q++)C[Q]=y[Q*f+H],D[Q]=Math.max(0,g[Q*f+H]),F+=D[Q];F-=D[H],D[H]=g[H*f+H],F+=D[H];for(var J=0;J<f;J++)y[J*f+H]=(1-l.damping)*Math.min(0,F-D[J])+l.damping*C[J];y[H*f+H]=(1-l.damping)*(F-D[H])+l.damping*C[H]}for(var M=0,G=0;G<f;G++){var Z=y[G*f+G]+g[G*f+G]>0?1:0;B[_%l.minIterations*f+G]=Z,M+=Z}if(M>0&&(_>=l.minIterations-1||_==l.maxIterations-1)){for(var W=0,ae=0;ae<f;ae++){R[ae]=0;for(var se=0;se<l.minIterations;se++)R[ae]+=B[se*f+ae];(R[ae]===0||R[ae]===l.minIterations)&&W++}if(W===f)break}}for(var he=yC(f,g,y),we=mC(f,c,he),de={},$=0;$<he.length;$++)de[he[$]]=[];for(var re=0;re<n.length;re++){var le=u[n[re].id()],pe=we[le];pe!=null&&de[pe].push(n[re])}for(var j=new Array(he.length),xe=0;xe<he.length;xe++)j[xe]=a.collection(de[he[xe]]);return j},bC={affinityPropagation:H0,ap:H0},EC=Ca({root:void 0,directed:!1}),xC={hierholzer:function(e){if(!vt(e)){var a=arguments;e={root:a[0],directed:a[1]}}var n=EC(e),l=n.root,u=n.directed,o=this,f=!1,d,c,h;l&&(h=Ge(l)?this.filter(l)[0].id():l[0].id());var g={},y={};u?o.forEach(function(T){var C=T.id();if(T.isNode()){var D=T.indegree(!0),R=T.outdegree(!0),z=D-R,B=R-D;z==1?d?f=!0:d=C:B==1?c?f=!0:c=C:(B>1||z>1)&&(f=!0),g[C]=[],T.outgoers().forEach(function(O){O.isEdge()&&g[C].push(O.id())})}else y[C]=[void 0,T.target().id()]}):o.forEach(function(T){var C=T.id();if(T.isNode()){var D=T.degree(!0);D%2&&(d?c?f=!0:c=C:d=C),g[C]=[],T.connectedEdges().forEach(function(R){return g[C].push(R.id())})}else y[C]=[T.source().id(),T.target().id()]});var E={found:!1,trail:void 0};if(f)return E;if(c&&d)if(u){if(h&&c!=h)return E;h=c}else{if(h&&c!=h&&d!=h)return E;h||(h=c)}else h||(h=o[0].id());var b=function(C){for(var D=C,R=[C],z,B,O;g[D].length;)z=g[D].shift(),B=y[z][0],O=y[z][1],D!=O?(g[O]=g[O].filter(function(_){return _!=z}),D=O):!u&&D!=B&&(g[B]=g[B].filter(function(_){return _!=z}),D=B),R.unshift(z),R.unshift(D);return R},w=[],x=[];for(x=b(h);x.length!=1;)g[x[0]].length==0?(w.unshift(o.getElementById(x.shift())),w.unshift(o.getElementById(x.shift()))):x=b(x.shift()).concat(x);w.unshift(o.getElementById(x.shift()));for(var S in g)if(g[S].length)return E;return E.found=!0,E.trail=this.spawn(w,!0),E}},Ro=function(){var e=this,a={},n=0,l=0,u=[],o=[],f={},d=function(y,E){for(var b=o.length-1,w=[],x=e.spawn();o[b].x!=y||o[b].y!=E;)w.push(o.pop().edge),b--;w.push(o.pop().edge),w.forEach(function(S){var T=S.connectedNodes().intersection(e);x.merge(S),T.forEach(function(C){var D=C.id(),R=C.connectedEdges().intersection(e);x.merge(C),a[D].cutVertex?x.merge(R.filter(function(z){return z.isLoop()})):x.merge(R)})}),u.push(x)},c=function(y,E,b){y===b&&(l+=1),a[E]={id:n,low:n++,cutVertex:!1};var w=e.getElementById(E).connectedEdges().intersection(e);if(w.size()===0)u.push(e.spawn(e.getElementById(E)));else{var x,S,T,C;w.forEach(function(D){x=D.source().id(),S=D.target().id(),T=x===E?S:x,T!==b&&(C=D.id(),f[C]||(f[C]=!0,o.push({x:E,y:T,edge:D})),T in a?a[E].low=Math.min(a[E].low,a[T].id):(c(y,T,E),a[E].low=Math.min(a[E].low,a[T].low),a[E].id<=a[T].low&&(a[E].cutVertex=!0,d(E,T))))})}};e.forEach(function(g){if(g.isNode()){var y=g.id();y in a||(l=0,c(y,y),a[y].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}},SC={hopcroftTarjanBiconnected:Ro,htbc:Ro,htb:Ro,hopcroftTarjanBiconnectedComponents:Ro},zo=function(){var e=this,a={},n=0,l=[],u=[],o=e.spawn(e),f=function(c){u.push(c),a[c]={index:n,low:n++,explored:!1};var h=e.getElementById(c).connectedEdges().intersection(e);if(h.forEach(function(w){var x=w.target().id();x!==c&&(x in a||f(x),a[x].explored||(a[c].low=Math.min(a[c].low,a[x].low)))}),a[c].index===a[c].low){for(var g=e.spawn();;){var y=u.pop();if(g.merge(e.getElementById(y)),a[y].low=a[c].index,a[y].explored=!0,y===c)break}var E=g.edgesWith(g),b=g.merge(E);l.push(b),o=o.difference(b)}};return e.forEach(function(d){if(d.isNode()){var c=d.id();c in a||f(c)}}),{cut:o,components:l}},wC={tarjanStronglyConnected:zo,tsc:zo,tscc:zo,tarjanStronglyConnectedComponents:zo},d2={};[Iu,$w,eT,aT,nT,lT,oT,_T,Dl,Bl,wh,ZT,sC,vC,bC,xC,SC,wC].forEach(function(t){Fe(d2,t)});var h2=0,g2=1,p2=2,wr=function(e){if(!(this instanceof wr))return new wr(e);this.id="Thenable/1.0.7",this.state=h2,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))};wr.prototype={fulfill:function(e){return P0(this,g2,"fulfillValue",e)},reject:function(e){return P0(this,p2,"rejectReason",e)},then:function(e,a){var n=this,l=new wr;return n.onFulfilled.push(Y0(e,l,"fulfill")),n.onRejected.push(Y0(a,l,"reject")),y2(n),l.proxy}};var P0=function(e,a,n,l){return e.state===h2&&(e.state=a,e[n]=l,y2(e)),e},y2=function(e){e.state===g2?G0(e,"onFulfilled",e.fulfillValue):e.state===p2&&G0(e,"onRejected",e.rejectReason)},G0=function(e,a,n){if(e[a].length!==0){var l=e[a];e[a]=[];var u=function(){for(var f=0;f<l.length;f++)l[f](n)};typeof setImmediate=="function"?setImmediate(u):setTimeout(u,0)}},Y0=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}m2(a,u)}}},m2=function(e,a){if(e===a||e.proxy===a){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ua(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")):m2(e,u))},function(u){l||(l=!0,e.reject(u))})}catch(u){l||e.reject(u)}return}e.fulfill(a)};wr.all=function(t){return new wr(function(e,a){for(var n=new Array(t.length),l=0,u=function(d,c){n[d]=c,l++,l===t.length&&e(n)},o=0;o<t.length;o++)(function(f){var d=t[f],c=d!=null&&d.then!=null;if(c)d.then(function(g){u(f,g)},function(g){a(g)});else{var h=d;u(f,h)}})(o)})};wr.resolve=function(t){return new wr(function(e,a){e(t)})};wr.reject=function(t){return new wr(function(e,a){a(t)})};var Ll=typeof Promise<"u"?Promise:wr,Ah=function(e,a,n){var l=Gh(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&&Pt(o.complete)&&o.completes.push(o.complete),u){var f=e.position();o.startPosition=o.startPosition||{x:f.x,y:f.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(l){var d=e.pan();o.startPan={x:d.x,y:d.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},Di=Ah.prototype;Fe(Di,{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),ar(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(c,h){var g=e[c];g!=null&&(e[c]=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,f=e.startStyle[o];e.startStyle[o]=u,e.style[l]=f}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 Ll(function(l,u){n.push(function(){l()})})}});Di.complete=Di.completed;Di.run=Di.play;Di.running=Di.playing;var TC={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 f=l[o];f._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],f=this._private.cy||this,d=!u,c=!d;if(!f.styleEnabled())return this;var h=f.style();a=Fe({},a,n);var g=Object.keys(a).length===0;if(g)return new Ah(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(c&&(a.style=h.getPropsList(a.style||a.css),a.css=void 0),c&&a.renderedPosition!=null){var y=a.renderedPosition,E=f.pan(),b=f.zoom();a.position=r2(y,b,E)}if(d&&a.panBy!=null){var w=a.panBy,x=f.pan();a.pan={x:x.x+w.x,y:x.y+w.y}}var S=a.center||a.centre;if(d&&S!=null){var T=f.getCenterPan(S.eles,a.zoom);T!=null&&(a.pan=T)}if(d&&a.fit!=null){var C=a.fit,D=f.getFitViewport(C.eles||C.boundingBox,C.padding);D!=null&&(a.pan=D.pan,a.zoom=D.zoom)}if(d&&vt(a.zoom)){var R=f.getZoomedViewport(a.zoom);R!=null?(R.zoomed&&(a.zoom=R.zoom),R.panned&&(a.pan=R.pan)):a.zoom=null}return new Ah(o[0],a)}},animate:function(){return function(a,n){var l=this,u=l.length!==void 0,o=u?l:[l],f=this._private.cy||this;if(!f.styleEnabled())return this;n&&(a=Fe({},a,n));for(var d=0;d<o.length;d++){var c=o[d],h=c.animated()&&(a.queue===void 0||a.queue),g=c.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],f=this._private.cy||this;if(!f.styleEnabled())return this;for(var d=0;d<o.length;d++){for(var c=o[d],h=c._private,g=h.animation.current,y=0;y<g.length;y++){var E=g[y],b=E._private;n&&(b.duration=0)}a&&(h.animation.queue=[]),n||(h.animation.current=[])}return f.notify("draw"),this}}},fd,F0;function pf(){if(F0)return fd;F0=1;var t=Array.isArray;return fd=t,fd}var cd,I0;function CC(){if(I0)return cd;I0=1;var t=pf(),e=rs(),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function l(u,o){if(t(u))return!1;var f=typeof u;return f=="number"||f=="symbol"||f=="boolean"||u==null||e(u)?!0:n.test(u)||!a.test(u)||o!=null&&u in Object(o)}return cd=l,cd}var vd,X0;function AC(){if(X0)return vd;X0=1;var t=K1(),e=as(),a="[object AsyncFunction]",n="[object Function]",l="[object GeneratorFunction]",u="[object Proxy]";function o(f){if(!e(f))return!1;var d=t(f);return d==n||d==l||d==a||d==u}return vd=o,vd}var dd,j0;function DC(){if(j0)return dd;j0=1;var t=vf(),e=t["__core-js_shared__"];return dd=e,dd}var hd,K0;function BC(){if(K0)return hd;K0=1;var t=DC(),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 hd=a,hd}var gd,Z0;function MC(){if(Z0)return gd;Z0=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 gd=a,gd}var pd,Q0;function RC(){if(Q0)return pd;Q0=1;var t=AC(),e=BC(),a=as(),n=MC(),l=/[\\^$.*+?()[\]{}|]/g,u=/^\[object .+?Constructor\]$/,o=Function.prototype,f=Object.prototype,d=o.toString,c=f.hasOwnProperty,h=RegExp("^"+d.call(c).replace(l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g(y){if(!a(y)||e(y))return!1;var E=t(y)?h:u;return E.test(n(y))}return pd=g,pd}var yd,J0;function zC(){if(J0)return yd;J0=1;function t(e,a){return e?.[a]}return yd=t,yd}var md,W0;function $h(){if(W0)return md;W0=1;var t=RC(),e=zC();function a(n,l){var u=e(n,l);return t(u)?u:void 0}return md=a,md}var bd,$0;function yf(){if($0)return bd;$0=1;var t=$h(),e=t(Object,"create");return bd=e,bd}var Ed,eb;function OC(){if(eb)return Ed;eb=1;var t=yf();function e(){this.__data__=t?t(null):{},this.size=0}return Ed=e,Ed}var xd,tb;function NC(){if(tb)return xd;tb=1;function t(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a}return xd=t,xd}var Sd,ab;function LC(){if(ab)return Sd;ab=1;var t=yf(),e="__lodash_hash_undefined__",a=Object.prototype,n=a.hasOwnProperty;function l(u){var o=this.__data__;if(t){var f=o[u];return f===e?void 0:f}return n.call(o,u)?o[u]:void 0}return Sd=l,Sd}var wd,rb;function kC(){if(rb)return wd;rb=1;var t=yf(),e=Object.prototype,a=e.hasOwnProperty;function n(l){var u=this.__data__;return t?u[l]!==void 0:a.call(u,l)}return wd=n,wd}var Td,nb;function _C(){if(nb)return Td;nb=1;var t=yf(),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 Td=a,Td}var Cd,ib;function qC(){if(ib)return Cd;ib=1;var t=OC(),e=NC(),a=LC(),n=kC(),l=_C();function u(o){var f=-1,d=o==null?0:o.length;for(this.clear();++f<d;){var c=o[f];this.set(c[0],c[1])}}return u.prototype.clear=t,u.prototype.delete=e,u.prototype.get=a,u.prototype.has=n,u.prototype.set=l,Cd=u,Cd}var Ad,lb;function VC(){if(lb)return Ad;lb=1;function t(){this.__data__=[],this.size=0}return Ad=t,Ad}var Dd,ub;function b2(){if(ub)return Dd;ub=1;function t(e,a){return e===a||e!==e&&a!==a}return Dd=t,Dd}var Bd,sb;function mf(){if(sb)return Bd;sb=1;var t=b2();function e(a,n){for(var l=a.length;l--;)if(t(a[l][0],n))return l;return-1}return Bd=e,Bd}var Md,ob;function UC(){if(ob)return Md;ob=1;var t=mf(),e=Array.prototype,a=e.splice;function n(l){var u=this.__data__,o=t(u,l);if(o<0)return!1;var f=u.length-1;return o==f?u.pop():a.call(u,o,1),--this.size,!0}return Md=n,Md}var Rd,fb;function HC(){if(fb)return Rd;fb=1;var t=mf();function e(a){var n=this.__data__,l=t(n,a);return l<0?void 0:n[l][1]}return Rd=e,Rd}var zd,cb;function PC(){if(cb)return zd;cb=1;var t=mf();function e(a){return t(this.__data__,a)>-1}return zd=e,zd}var Od,vb;function GC(){if(vb)return Od;vb=1;var t=mf();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 Od=e,Od}var Nd,db;function YC(){if(db)return Nd;db=1;var t=VC(),e=UC(),a=HC(),n=PC(),l=GC();function u(o){var f=-1,d=o==null?0:o.length;for(this.clear();++f<d;){var c=o[f];this.set(c[0],c[1])}}return u.prototype.clear=t,u.prototype.delete=e,u.prototype.get=a,u.prototype.has=n,u.prototype.set=l,Nd=u,Nd}var Ld,hb;function FC(){if(hb)return Ld;hb=1;var t=$h(),e=vf(),a=t(e,"Map");return Ld=a,Ld}var kd,gb;function IC(){if(gb)return kd;gb=1;var t=qC(),e=YC(),a=FC();function n(){this.size=0,this.__data__={hash:new t,map:new(a||e),string:new t}}return kd=n,kd}var _d,pb;function XC(){if(pb)return _d;pb=1;function t(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}return _d=t,_d}var qd,yb;function bf(){if(yb)return qd;yb=1;var t=XC();function e(a,n){var l=a.__data__;return t(n)?l[typeof n=="string"?"string":"hash"]:l.map}return qd=e,qd}var Vd,mb;function jC(){if(mb)return Vd;mb=1;var t=bf();function e(a){var n=t(this,a).delete(a);return this.size-=n?1:0,n}return Vd=e,Vd}var Ud,bb;function KC(){if(bb)return Ud;bb=1;var t=bf();function e(a){return t(this,a).get(a)}return Ud=e,Ud}var Hd,Eb;function ZC(){if(Eb)return Hd;Eb=1;var t=bf();function e(a){return t(this,a).has(a)}return Hd=e,Hd}var Pd,xb;function QC(){if(xb)return Pd;xb=1;var t=bf();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 Pd=e,Pd}var Gd,Sb;function JC(){if(Sb)return Gd;Sb=1;var t=IC(),e=jC(),a=KC(),n=ZC(),l=QC();function u(o){var f=-1,d=o==null?0:o.length;for(this.clear();++f<d;){var c=o[f];this.set(c[0],c[1])}}return u.prototype.clear=t,u.prototype.delete=e,u.prototype.get=a,u.prototype.has=n,u.prototype.set=l,Gd=u,Gd}var Yd,wb;function WC(){if(wb)return Yd;wb=1;var t=JC(),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,f=l?l.apply(this,o):o[0],d=u.cache;if(d.has(f))return d.get(f);var c=n.apply(this,o);return u.cache=d.set(f,c)||d,c};return u.cache=new(a.Cache||t),u}return a.Cache=t,Yd=a,Yd}var Fd,Tb;function $C(){if(Tb)return Fd;Tb=1;var t=WC(),e=500;function a(n){var l=t(n,function(o){return u.size===e&&u.clear(),o}),u=l.cache;return l}return Fd=a,Fd}var Id,Cb;function E2(){if(Cb)return Id;Cb=1;var t=$C(),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,f,d,c){u.push(d?c.replace(a,"$1"):f||o)}),u});return Id=n,Id}var Xd,Ab;function x2(){if(Ab)return Xd;Ab=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 Xd=t,Xd}var jd,Db;function eA(){if(Db)return jd;Db=1;var t=Fh(),e=x2(),a=pf(),n=rs(),l=t?t.prototype:void 0,u=l?l.toString:void 0;function o(f){if(typeof f=="string")return f;if(a(f))return e(f,o)+"";if(n(f))return u?u.call(f):"";var d=f+"";return d=="0"&&1/f==-1/0?"-0":d}return jd=o,jd}var Kd,Bb;function S2(){if(Bb)return Kd;Bb=1;var t=eA();function e(a){return a==null?"":t(a)}return Kd=e,Kd}var Zd,Mb;function w2(){if(Mb)return Zd;Mb=1;var t=pf(),e=CC(),a=E2(),n=S2();function l(u,o){return t(u)?u:e(u,o)?[u]:a(n(u))}return Zd=l,Zd}var Qd,Rb;function eg(){if(Rb)return Qd;Rb=1;var t=rs();function e(a){if(typeof a=="string"||t(a))return a;var n=a+"";return n=="0"&&1/a==-1/0?"-0":n}return Qd=e,Qd}var Jd,zb;function tA(){if(zb)return Jd;zb=1;var t=w2(),e=eg();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 Jd=a,Jd}var Wd,Ob;function aA(){if(Ob)return Wd;Ob=1;var t=tA();function e(a,n,l){var u=a==null?void 0:t(a,n);return u===void 0?l:u}return Wd=e,Wd}var rA=aA(),nA=ts(rA),$d,Nb;function iA(){if(Nb)return $d;Nb=1;var t=$h(),e=(function(){try{var a=t(Object,"defineProperty");return a({},"",{}),a}catch{}})();return $d=e,$d}var eh,Lb;function lA(){if(Lb)return eh;Lb=1;var t=iA();function e(a,n,l){n=="__proto__"&&t?t(a,n,{configurable:!0,enumerable:!0,value:l,writable:!0}):a[n]=l}return eh=e,eh}var th,kb;function uA(){if(kb)return th;kb=1;var t=lA(),e=b2(),a=Object.prototype,n=a.hasOwnProperty;function l(u,o,f){var d=u[o];(!(n.call(u,o)&&e(d,f))||f===void 0&&!(o in u))&&t(u,o,f)}return th=l,th}var ah,_b;function sA(){if(_b)return ah;_b=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 ah=a,ah}var rh,qb;function oA(){if(qb)return rh;qb=1;var t=uA(),e=w2(),a=sA(),n=as(),l=eg();function u(o,f,d,c){if(!n(o))return o;f=e(f,o);for(var h=-1,g=f.length,y=g-1,E=o;E!=null&&++h<g;){var b=l(f[h]),w=d;if(b==="__proto__"||b==="constructor"||b==="prototype")return o;if(h!=y){var x=E[b];w=c?c(x,b,E):void 0,w===void 0&&(w=n(x)?x:a(f[h+1])?[]:{})}t(E,b,w),E=E[b]}return o}return rh=u,rh}var nh,Vb;function fA(){if(Vb)return nh;Vb=1;var t=oA();function e(a,n,l){return a==null?a:t(a,n,l)}return nh=e,nh}var cA=fA(),vA=ts(cA),ih,Ub;function dA(){if(Ub)return ih;Ub=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 ih=t,ih}var lh,Hb;function hA(){if(Hb)return lh;Hb=1;var t=x2(),e=dA(),a=pf(),n=rs(),l=E2(),u=eg(),o=S2();function f(d){return a(d)?t(d,u):n(d)?[d]:e(l(o(d)))}return lh=f,lh}var gA=hA(),pA=ts(gA),yA={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,f=this,d=f.length!==void 0,c=d?f:[f],h=d?f[0]:f;if(Ge(l)){var g=l.indexOf(".")!==-1,y=g&&pA(l);if(o.allowGetting&&u===void 0){var E;return h&&(o.beforeGet(h),y&&h._private[o.field][l]===void 0?E=nA(h._private[o.field],y):E=h._private[o.field][l]),E}else if(o.allowSetting&&u!==void 0){var b=!o.immutableKeys[l];if(b){var w=V1({},l,u);o.beforeSet(f,w);for(var x=0,S=c.length;x<S;x++){var T=c[x];o.canSet(T)&&(y&&h._private[o.field][l]===void 0?vA(T._private[o.field],y,u):T._private[o.field][l]=u)}o.updateStyle&&f.updateStyle(),o.onSet(f),o.settingTriggersEvent&&f[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&vt(l)){var C=l,D,R,z=Object.keys(C);o.beforeSet(f,C);for(var B=0;B<z.length;B++){D=z[B],R=C[D];var O=!o.immutableKeys[D];if(O)for(var _=0;_<c.length;_++){var U=c[_];o.canSet(U)&&(U._private[o.field][D]=R)}}o.updateStyle&&f.updateStyle(),o.onSet(f),o.settingTriggersEvent&&f[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&Pt(l)){var V=l;f.on(o.bindingEvent,V)}else if(o.allowGetting&&l===void 0){var q;return h&&(o.beforeGet(h),q=h._private[o.field]),q}return f}},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,f=o.length!==void 0,d=f?o:[o];if(Ge(l)){for(var c=l.split(/\s+/),h=c.length,g=0;g<h;g++){var y=c[g];if(!Yn(y)){var E=!u.immutableKeys[y];if(E)for(var b=0,w=d.length;b<w;b++)d[b]._private[u.field][y]=void 0}}u.triggerEvent&&o[u.triggerFnName](u.event)}else if(l===void 0){for(var x=0,S=d.length;x<S;x++)for(var T=d[x]._private[u.field],C=Object.keys(T),D=0;D<C.length;D++){var R=C[D],z=!u.immutableKeys[R];z&&(T[R]=void 0)}u.triggerEvent&&o[u.triggerFnName](u.event)}return o}}},mA={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 Ll(function(f,d){var c=function(E){u.off.apply(u,g),f(E)},h=o.concat([c]),g=h.concat([]);u.on.apply(u,h)})}}},bt={};[TC,yA,mA].forEach(function(t){Fe(bt,t)});var bA={animate:bt.animate(),animation:bt.animation(),animated:bt.animated(),clearQueue:bt.clearQueue(),delay:bt.delay(),delayAnimation:bt.delayAnimation(),stop:bt.stop()},Go={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 Mt(e)||(e=(e||"").match(/\S+/g)||[]);for(var l=[],u=new Nl(e),o=0;o<a.length;o++){for(var f=a[o],d=f._private,c=d.classes,h=!1,g=0;g<e.length;g++){var y=e[g],E=c.has(y);if(!E){h=!0;break}}h||(h=c.size!==e.length),h&&(d.classes=u,l.push(f))}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){Mt(e)||(e=e.match(/\S+/g)||[]);for(var n=this,l=a===void 0,u=[],o=0,f=n.length;o<f;o++)for(var d=n[o],c=d._private.classes,h=!1,g=0;g<e.length;g++){var y=e[g],E=c.has(y),b=!1;a||l&&!E?(c.add(y),b=!0):(!a||l&&E)&&(c.delete(y),b=!0),!h&&b&&(u.push(d),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}};Go.className=Go.classNames=Go.classes;var ct={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:la,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};ct.variable="(?:[\\w-.]|(?:\\\\"+ct.metaChar+"))+";ct.className="(?:[\\w-]|(?:\\\\"+ct.metaChar+"))+";ct.value=ct.string+"|"+ct.number;ct.id=ct.variable;(function(){var t,e,a;for(t=ct.comparatorOp.split("|"),a=0;a<t.length;a++)e=t[a],ct.comparatorOp+="|@"+e;for(t=ct.comparatorOp.split("|"),a=0;a<t.length;a++)e=t[a],!(e.indexOf("!")>=0)&&e!=="="&&(ct.comparatorOp+="|\\!"+e)})();var Dt=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},Dh=[{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 yw(t.selector,e.selector)}),EA=(function(){for(var t={},e,a=0;a<Dh.length;a++)e=Dh[a],t[e.selector]=e.matches;return t})(),xA=function(e,a){return EA[e](a)},SA="("+Dh.map(function(t){return t.selector}).join("|")+")",hl=function(e){return e.replace(new RegExp("\\\\("+ct.metaChar+")","g"),function(a,n){return n})},_n=function(e,a,n){e[e.length-1]=n},Bh=[{name:"group",query:!0,regex:"("+ct.group+")",populate:function(e,a,n){var l=aa(n,1),u=l[0];a.checks.push({type:Oe.GROUP,value:u==="*"?u:u+"s"})}},{name:"state",query:!0,regex:SA,populate:function(e,a,n){var l=aa(n,1),u=l[0];a.checks.push({type:Oe.STATE,value:u})}},{name:"id",query:!0,regex:"\\#("+ct.id+")",populate:function(e,a,n){var l=aa(n,1),u=l[0];a.checks.push({type:Oe.ID,value:hl(u)})}},{name:"className",query:!0,regex:"\\.("+ct.className+")",populate:function(e,a,n){var l=aa(n,1),u=l[0];a.checks.push({type:Oe.CLASS,value:hl(u)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+ct.variable+")\\s*\\]",populate:function(e,a,n){var l=aa(n,1),u=l[0];a.checks.push({type:Oe.DATA_EXIST,field:hl(u)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+ct.variable+")\\s*("+ct.comparatorOp+")\\s*("+ct.value+")\\s*\\]",populate:function(e,a,n){var l=aa(n,3),u=l[0],o=l[1],f=l[2],d=new RegExp("^"+ct.string+"$").exec(f)!=null;d?f=f.substring(1,f.length-1):f=parseFloat(f),a.checks.push({type:Oe.DATA_COMPARE,field:hl(u),operator:o,value:f})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+ct.boolOp+")\\s*("+ct.variable+")\\s*\\]",populate:function(e,a,n){var l=aa(n,2),u=l[0],o=l[1];a.checks.push({type:Oe.DATA_BOOL,field:hl(o),operator:u})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+ct.meta+")\\s*("+ct.comparatorOp+")\\s*("+ct.number+")\\s*\\]\\]",populate:function(e,a,n){var l=aa(n,3),u=l[0],o=l[1],f=l[2];a.checks.push({type:Oe.META_COMPARE,field:hl(u),operator:o,value:parseFloat(f)})}},{name:"nextQuery",separator:!0,regex:ct.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 f=e[e.length++]=Dt();return f}},{name:"directedEdge",separator:!0,regex:ct.directedEdge,populate:function(e,a){if(e.currentSubject==null){var n=Dt(),l=a,u=Dt();return n.checks.push({type:Oe.DIRECTED_EDGE,source:l,target:u}),_n(e,a,n),e.edgeCount++,u}else{var o=Dt(),f=a,d=Dt();return o.checks.push({type:Oe.NODE_SOURCE,source:f,target:d}),_n(e,a,o),e.edgeCount++,d}}},{name:"undirectedEdge",separator:!0,regex:ct.undirectedEdge,populate:function(e,a){if(e.currentSubject==null){var n=Dt(),l=a,u=Dt();return n.checks.push({type:Oe.UNDIRECTED_EDGE,nodes:[l,u]}),_n(e,a,n),e.edgeCount++,u}else{var o=Dt(),f=a,d=Dt();return o.checks.push({type:Oe.NODE_NEIGHBOR,node:f,neighbor:d}),_n(e,a,o),d}}},{name:"child",separator:!0,regex:ct.child,populate:function(e,a){if(e.currentSubject==null){var n=Dt(),l=Dt(),u=e[e.length-1];return n.checks.push({type:Oe.CHILD,parent:u,child:l}),_n(e,a,n),e.compoundCount++,l}else if(e.currentSubject===a){var o=Dt(),f=e[e.length-1],d=Dt(),c=Dt(),h=Dt(),g=Dt();return o.checks.push({type:Oe.COMPOUND_SPLIT,left:f,right:d,subject:c}),c.checks=a.checks,a.checks=[{type:Oe.TRUE}],g.checks.push({type:Oe.TRUE}),d.checks.push({type:Oe.PARENT,parent:g,child:h}),_n(e,f,o),e.currentSubject=c,e.compoundCount++,h}else{var y=Dt(),E=Dt(),b=[{type:Oe.PARENT,parent:y,child:E}];return y.checks=a.checks,a.checks=b,e.compoundCount++,E}}},{name:"descendant",separator:!0,regex:ct.descendant,populate:function(e,a){if(e.currentSubject==null){var n=Dt(),l=Dt(),u=e[e.length-1];return n.checks.push({type:Oe.DESCENDANT,ancestor:u,descendant:l}),_n(e,a,n),e.compoundCount++,l}else if(e.currentSubject===a){var o=Dt(),f=e[e.length-1],d=Dt(),c=Dt(),h=Dt(),g=Dt();return o.checks.push({type:Oe.COMPOUND_SPLIT,left:f,right:d,subject:c}),c.checks=a.checks,a.checks=[{type:Oe.TRUE}],g.checks.push({type:Oe.TRUE}),d.checks.push({type:Oe.ANCESTOR,ancestor:g,descendant:h}),_n(e,f,o),e.currentSubject=c,e.compoundCount++,h}else{var y=Dt(),E=Dt(),b=[{type:Oe.ANCESTOR,ancestor:y,descendant:E}];return y.checks=a.checks,a.checks=b,e.compoundCount++,E}}},{name:"subject",modifier:!0,regex:ct.subject,populate:function(e,a){if(e.currentSubject!=null&&e.currentSubject!==a)return Et("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)}}];Bh.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var wA=function(e){for(var a,n,l,u=0;u<Bh.length;u++){var o=Bh[u],f=o.name,d=e.match(o.regexObj);if(d!=null){n=d,a=o,l=f;var c=d[0];e=e.substring(c.length);break}}return{expr:a,match:n,name:l,remaining:e}},TA=function(e){var a=e.match(/^\s+/);if(a){var n=a[0];e=e.substring(n.length)}return e},CA=function(e){var a=this,n=a.inputText=e,l=a[0]=Dt();for(a.length=1,n=TA(n);;){var u=wA(n);if(u.expr==null)return Et("The selector `"+e+"`is invalid"),!1;var o=u.match.slice(1),f=u.expr.populate(a,l,o);if(f===!1)return!1;if(f!=null&&(l=f),n=u.remaining,n.match(/^\s*$/))break}var d=a[a.length-1];a.currentSubject!=null&&(d.subject=a.currentSubject),d.edgeCount=a.edgeCount,d.compoundCount=a.compoundCount;for(var c=0;c<a.length;c++){var h=a[c];if(h.compoundCount>0&&h.edgeCount>0)return Et("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Et("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Et("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},AA=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 y=h.type,E=h.value;switch(y){case Oe.GROUP:{var b=e(E);return b.substring(0,b.length-1)}case Oe.DATA_COMPARE:{var w=h.field,x=h.operator;return"["+w+n(e(x))+a(E)+"]"}case Oe.DATA_BOOL:{var S=h.operator,T=h.field;return"["+e(S)+T+"]"}case Oe.DATA_EXIST:{var C=h.field;return"["+C+"]"}case Oe.META_COMPARE:{var D=h.operator,R=h.field;return"[["+R+n(e(D))+a(E)+"]]"}case Oe.STATE:return E;case Oe.ID:return"#"+E;case Oe.CLASS:return"."+E;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 z=u(h.left,g),B=u(h.subject,g),O=u(h.right,g);return z+(z.length>0?" ":"")+B+O}case Oe.TRUE:return""}},u=function(h,g){return h.checks.reduce(function(y,E,b){return y+(g===h&&b===0?"$":"")+l(E,g)},"")},o="",f=0;f<this.length;f++){var d=this[f];o+=u(d,d.subject),this.length>1&&f<this.length-1&&(o+=", ")}return this.toStringCache=o,o},DA={parse:CA,toString:AA},T2=function(e,a,n){var l,u=Ge(e),o=Te(e),f=Ge(n),d,c,h=!1,g=!1,y=!1;switch(a.indexOf("!")>=0&&(a=a.replace("!",""),g=!0),a.indexOf("@")>=0&&(a=a.replace("@",""),h=!0),(u||f||h)&&(d=!u&&!o?"":""+e,c=""+n),h&&(e=d=d.toLowerCase(),n=c=c.toLowerCase()),a){case"*=":l=d.indexOf(c)>=0;break;case"$=":l=d.indexOf(c,d.length-c.length)>=0;break;case"^=":l=d.indexOf(c)===0;break;case"=":l=e===n;break;case">":y=!0,l=e>n;break;case">=":y=!0,l=e>=n;break;case"<":y=!0,l=e<n;break;case"<=":y=!0,l=e<=n;break;default:l=!1;break}return g&&(e!=null||!y)&&(l=!l),l},BA=function(e,a){switch(a){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},MA=function(e){return e!==void 0},tg=function(e,a){return e.data(a)},RA=function(e,a){return e[a]()},It=[],Lt=function(e,a){return e.checks.every(function(n){return It[n.type](n,a)})};It[Oe.GROUP]=function(t,e){var a=t.value;return a==="*"||a===e.group()};It[Oe.STATE]=function(t,e){var a=t.value;return xA(a,e)};It[Oe.ID]=function(t,e){var a=t.value;return e.id()===a};It[Oe.CLASS]=function(t,e){var a=t.value;return e.hasClass(a)};It[Oe.META_COMPARE]=function(t,e){var a=t.field,n=t.operator,l=t.value;return T2(RA(e,a),n,l)};It[Oe.DATA_COMPARE]=function(t,e){var a=t.field,n=t.operator,l=t.value;return T2(tg(e,a),n,l)};It[Oe.DATA_BOOL]=function(t,e){var a=t.field,n=t.operator;return BA(tg(e,a),n)};It[Oe.DATA_EXIST]=function(t,e){var a=t.field;return t.operator,MA(tg(e,a))};It[Oe.UNDIRECTED_EDGE]=function(t,e){var a=t.nodes[0],n=t.nodes[1],l=e.source(),u=e.target();return Lt(a,l)&&Lt(n,u)||Lt(n,l)&&Lt(a,u)};It[Oe.NODE_NEIGHBOR]=function(t,e){return Lt(t.node,e)&&e.neighborhood().some(function(a){return a.isNode()&&Lt(t.neighbor,a)})};It[Oe.DIRECTED_EDGE]=function(t,e){return Lt(t.source,e.source())&&Lt(t.target,e.target())};It[Oe.NODE_SOURCE]=function(t,e){return Lt(t.source,e)&&e.outgoers().some(function(a){return a.isNode()&&Lt(t.target,a)})};It[Oe.NODE_TARGET]=function(t,e){return Lt(t.target,e)&&e.incomers().some(function(a){return a.isNode()&&Lt(t.source,a)})};It[Oe.CHILD]=function(t,e){return Lt(t.child,e)&&Lt(t.parent,e.parent())};It[Oe.PARENT]=function(t,e){return Lt(t.parent,e)&&e.children().some(function(a){return Lt(t.child,a)})};It[Oe.DESCENDANT]=function(t,e){return Lt(t.descendant,e)&&e.ancestors().some(function(a){return Lt(t.ancestor,a)})};It[Oe.ANCESTOR]=function(t,e){return Lt(t.ancestor,e)&&e.descendants().some(function(a){return Lt(t.descendant,a)})};It[Oe.COMPOUND_SPLIT]=function(t,e){return Lt(t.subject,e)&&Lt(t.left,e)&&Lt(t.right,e)};It[Oe.TRUE]=function(){return!0};It[Oe.COLLECTION]=function(t,e){var a=t.value;return a.has(e)};It[Oe.FILTER]=function(t,e){var a=t.value;return a(e)};var zA=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 f=a[o];if(Lt(f,u))return!0}return!1};return a.text()==null&&(n=function(){return!0}),e.filter(n)},OA=function(e){for(var a=this,n=0;n<a.length;n++){var l=a[n];if(Lt(l,e))return!0}return!1},NA={matches:OA,filter:zA},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*$/)||(ar(e)?this.addQuery({checks:[{type:Oe.COLLECTION,value:e.collection()}]}):Pt(e)?this.addQuery({checks:[{type:Oe.FILTER,value:e}]}):Ge(e)?this.parse(e)||(this.invalid=!0):qt("A selector must be created from a string; found "))},jn=Xn.prototype;[DA,NA].forEach(function(t){return Fe(jn,t)});jn.text=function(){return this.inputText};jn.size=function(){return this.length};jn.eq=function(t){return this[t]};jn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};jn.addQuery=function(t){this[this.length++]=t};jn.selector=jn.toString;var Pn={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())})}};Pn.allAreNeighbours=Pn.allAreNeighbors;Pn.has=Pn.contains;Pn.equal=Pn.equals=Pn.same;var yr=function(e,a){return function(l,u,o,f){var d=l,c=this,h;if(d==null?h="":ar(d)&&d.length===1&&(h=d.id()),c.length===1&&h){var g=c[0]._private,y=g.traversalCache=g.traversalCache||{},E=y[a]=y[a]||[],b=Ci(h),w=E[b];return w||(E[b]=e.call(c,l,u,o,f))}else return e.call(c,l,u,o,f)}},Ol={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 ag(t,e,a,n){for(var l=[],u=new Nl,o=t.cy(),f=o.hasCompoundNodes(),d=0;d<t.length;d++){var c=t[d];a?l.push(c):f&&n(l,u,c)}for(;l.length>0;){var h=l.shift();e(h),u.add(h.id()),f&&n(l,u,h)}return t}function C2(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)}}Ol.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ag(this,t,e,C2)};function A2(t,e,a){if(a.isChild()){var n=a._private.parent;e.has(n.id())||t.push(n)}}Ol.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ag(this,t,e,A2)};function LA(t,e,a){A2(t,e,a),C2(t,e,a)}Ol.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return ag(this,t,e,LA)};Ol.ancestors=Ol.parents;var Ku,D2;Ku=D2={data:bt.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:bt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:bt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:bt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:bt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:bt.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};Ku.attr=Ku.data;Ku.removeAttr=Ku.removeData;var kA=D2,Ef={};function uh(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 f=u[o];!e&&f.isLoop()||(n+=t(l,f))}return n}else return}}Fe(Ef,{degree:uh(function(t,e){return e.source().same(e.target())?2:1}),indegree:uh(function(t,e){return e.target().same(t)?1:0}),outdegree:uh(function(t,e){return e.source().same(t)?1:0})});function gl(t,e){return function(a){for(var n,l=this.nodes(),u=0;u<l.length;u++){var o=l[u],f=o[t](a);f!==void 0&&(n===void 0||e(f,n))&&(n=f)}return n}}Fe(Ef,{minDegree:gl("degree",function(t,e){return t<e}),maxDegree:gl("degree",function(t,e){return t>e}),minIndegree:gl("indegree",function(t,e){return t<e}),maxIndegree:gl("indegree",function(t,e){return t>e}),minOutdegree:gl("outdegree",function(t,e){return t<e}),maxOutdegree:gl("outdegree",function(t,e){return t>e})});Fe(Ef,{totalDegree:function(e){for(var a=0,n=this.nodes(),l=0;l<n.length;l++)a+=n[l].degree(e);return a}});var Sr,B2,M2=function(e,a,n){for(var l=0;l<e.length;l++){var u=e[l];if(!u.locked()){var o=u._private.position,f={x:a.x!=null?a.x-o.x:0,y:a.y!=null?a.y-o.y:0};u.isParent()&&!(f.x===0&&f.y===0)&&u.children().shift(f,n),u.dirtyBoundingBoxCache()}}},Pb={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){M2(e,a,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Sr=B2={position:bt.data(Pb),silentPosition:bt.data(Fe({},Pb,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,a){M2(e,a,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,a){if(vt(e))a?this.silentPosition(e):this.position(e);else if(Pt(e)){var n=e,l=this.cy();l.startBatch();for(var u=0;u<this.length;u++){var o=this[u],f=void 0;(f=n(o,u))&&(a?o.silentPosition(f):o.position(f))}l.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,a,n){var l;if(vt(e)?(l={x:Te(e.x)?e.x:0,y:Te(e.y)?e.y:0},n=a):Ge(e)&&Te(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 f=this[o];if(!(u.hasCompoundNodes()&&f.isChild()&&f.ancestors().anySame(this))){var d=f.position(),c={x:d.x+l.x,y:d.y+l.y};n?f.silentPosition(c):f.position(c)}}u.endBatch()}return this},silentShift:function(e,a){return vt(e)?this.shift(e,!0):Ge(e)&&Te(a)&&this.shift(e,a,!0),this},renderedPosition:function(e,a){var n=this[0],l=this.cy(),u=l.zoom(),o=l.pan(),f=vt(e)?e:void 0,d=f!==void 0||a!==void 0&&Ge(e);if(n&&n.isNode())if(d)for(var c=0;c<this.length;c++){var h=this[c];a!==void 0?h.position(e,(a-o[e])/u):f!==void 0&&h.position(r2(f,u,o))}else{var g=n.position();return f=hf(g,u,o),e===void 0?f:f[e]}else if(!d)return;return this},relativePosition:function(e,a){var n=this[0],l=this.cy(),u=vt(e)?e:void 0,o=u!==void 0||a!==void 0&&Ge(e),f=l.hasCompoundNodes();if(n&&n.isNode())if(o)for(var d=0;d<this.length;d++){var c=this[d],h=f?c.parent():null,g=h&&h.length>0,y=g;g&&(h=h[0]);var E=y?h.position():{x:0,y:0};a!==void 0?c.position(e,a+E[e]):u!==void 0&&c.position({x:u.x+E.x,y:u.y+E.y})}else{var b=n.position(),w=f?n.parent():null,x=w&&w.length>0,S=x;x&&(w=w[0]);var T=S?w.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}};Sr.modelPosition=Sr.point=Sr.position;Sr.modelPositions=Sr.points=Sr.positions;Sr.renderedPoint=Sr.renderedPosition;Sr.relativePoint=Sr.relativePosition;var _A=B2,Ml,Jn;Ml=Jn={};Jn.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,f=e.y1*n+l.y,d=e.y2*n+l.y;return{x1:u,x2:o,y1:f,y2:d,w:o-u,h:d-f}};Jn.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)};Jn.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 f=o._private,d=o.children(),c=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=d.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),y=f.position;(g.w===0||g.h===0)&&(g={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},g.x1=y.x-g.w/2,g.x2=y.x+g.w/2,g.y1=y.y-g.h/2,g.y2=y.y+g.h/2);function E(_,U,V){var q=0,P=0,Y=U+V;return _>0&&Y>0&&(q=U/Y*_,P=V/Y*_),{biasDiff:q,biasComplementDiff:P}}function b(_,U,V,q){if(V.units==="%")switch(q){case"width":return _>0?V.pfValue*_:0;case"height":return U>0?V.pfValue*U:0;case"average":return _>0&&U>0?V.pfValue*(_+U)/2:0;case"min":return _>0&&U>0?_>U?V.pfValue*U:V.pfValue*_:0;case"max":return _>0&&U>0?_>U?V.pfValue*_:V.pfValue*U:0;default:return 0}else return V.units==="px"?V.pfValue:0}var w=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(w=w*100/h.width.val);var x=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(x=x*100/h.width.val);var S=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(S=S*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=E(h.width.val-g.w,w,x),D=C.biasDiff,R=C.biasComplementDiff,z=E(h.height.val-g.h,S,T),B=z.biasDiff,O=z.biasComplementDiff;f.autoPadding=b(g.w,g.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),f.autoWidth=Math.max(g.w,h.width.val),y.x=(-D+g.x1+g.x2+R)/2,f.autoHeight=Math.max(g.h,h.height.val),y.y=(-B+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 pr=function(e){return e===1/0||e===-1/0?0:e},xr=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)},qn=function(e,a){return a==null?e:xr(e,a.x1,a.y1,a.x2,a.y2)},zu=function(e,a,n){return Ia(e,a,n)},Oo=function(e,a,n){if(!a.cy().headless()){var l=a._private,u=l.rstyle,o=u.arrowWidth/2,f=a.pstyle(n+"-arrow-shape").value,d,c;if(f!=="none"){n==="source"?(d=u.srcX,c=u.srcY):n==="target"?(d=u.tgtX,c=u.tgtY):(d=u.midX,c=u.midY);var h=l.arrowBounds=l.arrowBounds||{},g=h[n]=h[n]||{};g.x1=d-o,g.y1=c-o,g.x2=d+o,g.y2=c+o,g.w=g.x2-g.x1,g.h=g.y2-g.y1,Ho(g,1),xr(e,g.x1,g.y1,g.x2,g.y2)}}},sh=function(e,a,n){if(!a.cy().headless()){var l;n?l=n+"-":l="";var u=a._private,o=u.rstyle,f=a.pstyle(l+"label").strValue;if(f){var d=a.pstyle("text-halign"),c=a.pstyle("text-valign"),h=zu(o,"labelWidth",n),g=zu(o,"labelHeight",n),y=zu(o,"labelX",n),E=zu(o,"labelY",n),b=a.pstyle(l+"text-margin-x").pfValue,w=a.pstyle(l+"text-margin-y").pfValue,x=a.isEdge(),S=a.pstyle(l+"text-rotation"),T=a.pstyle("text-outline-width").pfValue,C=a.pstyle("text-border-width").pfValue,D=C/2,R=a.pstyle("text-background-padding").pfValue,z=2,B=g,O=h,_=O/2,U=B/2,V,q,P,Y;if(x)V=y-_,q=y+_,P=E-U,Y=E+U;else{switch(d.value){case"left":V=y-O,q=y;break;case"center":V=y-_,q=y+_;break;case"right":V=y,q=y+O;break}switch(c.value){case"top":P=E-B,Y=E;break;case"center":P=E-U,Y=E+U;break;case"bottom":P=E,Y=E+B;break}}var I=b-Math.max(T,D)-R-z,L=b+Math.max(T,D)+R+z,H=w-Math.max(T,D)-R-z,F=w+Math.max(T,D)+R+z;V+=I,q+=L,P+=H,Y+=F;var Q=n||"main",J=u.labelBounds,M=J[Q]=J[Q]||{};M.x1=V,M.y1=P,M.x2=q,M.y2=Y,M.w=q-V,M.h=Y-P,M.leftPad=I,M.rightPad=L,M.topPad=H,M.botPad=F;var G=x&&S.strValue==="autorotate",Z=S.pfValue!=null&&S.pfValue!==0;if(G||Z){var W=G?zu(u.rstyle,"labelAngle",n):S.pfValue,ae=Math.cos(W),se=Math.sin(W),he=(V+q)/2,we=(P+Y)/2;if(!x){switch(d.value){case"left":he=q;break;case"right":he=V;break}switch(c.value){case"top":we=Y;break;case"bottom":we=P;break}}var de=function(Ue,Ve){return Ue=Ue-he,Ve=Ve-we,{x:Ue*ae-Ve*se+he,y:Ue*se+Ve*ae+we}},$=de(V,P),re=de(V,Y),le=de(q,P),pe=de(q,Y);V=Math.min($.x,re.x,le.x,pe.x),q=Math.max($.x,re.x,le.x,pe.x),P=Math.min($.y,re.y,le.y,pe.y),Y=Math.max($.y,re.y,le.y,pe.y)}var j=Q+"Rot",xe=J[j]=J[j]||{};xe.x1=V,xe.y1=P,xe.x2=q,xe.y2=Y,xe.w=q-V,xe.h=Y-P,xr(e,V,P,q,Y),xr(u.labelBounds.all,V,P,q,Y)}return e}},Gb=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;R2(e,a,n,o,"outside",o/2)}},R2=function(e,a,n,l,u,o){if(!(n===0||l<=0||u==="inside")){var f=a.cy(),d=f.renderer(),c=d.nodeShapes[d.getNodeShape(a)];if(c){var h=a.position(),g=h.x,y=h.y,E=a.width(),b=a.height();if(c.hasMiterBounds){u==="center"&&(l/=2);var w=c.miterBounds(g,y,E,b,l);qn(e,w)}else o!=null&&o>0&&Po(e,[o,o,o,o])}}},qA=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;R2(e,a,n,l,u)}},VA=function(e,a){var n=e._private.cy,l=n.styleEnabled(),u=n.headless(),o=ka(),f=e._private,d=e.isNode(),c=e.isEdge(),h,g,y,E,b,w,x=f.rstyle,S=d&&l?e.pstyle("bounds-expansion").pfValue:[0],T=function(Be){return Be.pstyle("display").value!=="none"},C=!l||T(e)&&(!c||T(e.source())&&T(e.target()));if(C){var D=0,R=0;l&&a.includeOverlays&&(D=e.pstyle("overlay-opacity").value,D!==0&&(R=e.pstyle("overlay-padding").value));var z=0,B=0;l&&a.includeUnderlays&&(z=e.pstyle("underlay-opacity").value,z!==0&&(B=e.pstyle("underlay-padding").value));var O=Math.max(R,B),_=0,U=0;if(l&&(_=e.pstyle("width").pfValue,U=_/2),d&&a.includeNodes){var V=e.position();b=V.x,w=V.y;var q=e.outerWidth(),P=q/2,Y=e.outerHeight(),I=Y/2;h=b-P,g=b+P,y=w-I,E=w+I,xr(o,h,y,g,E),l&&Gb(o,e),l&&a.includeOutlines&&!u&&Gb(o,e),l&&qA(o,e)}else if(c&&a.includeEdges)if(l&&!u){var L=e.pstyle("curve-style").strValue;if(h=Math.min(x.srcX,x.midX,x.tgtX),g=Math.max(x.srcX,x.midX,x.tgtX),y=Math.min(x.srcY,x.midY,x.tgtY),E=Math.max(x.srcY,x.midY,x.tgtY),h-=U,g+=U,y-=U,E+=U,xr(o,h,y,g,E),L==="haystack"){var H=x.haystackPts;if(H&&H.length===2){if(h=H[0].x,y=H[0].y,g=H[1].x,E=H[1].y,h>g){var F=h;h=g,g=F}if(y>E){var Q=y;y=E,E=Q}xr(o,h-U,y-U,g+U,E+U)}}else if(L==="bezier"||L==="unbundled-bezier"||Vn(L,"segments")||Vn(L,"taxi")){var J;switch(L){case"bezier":case"unbundled-bezier":J=x.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":J=x.linePts;break}if(J!=null)for(var M=0;M<J.length;M++){var G=J[M];h=G.x-U,g=G.x+U,y=G.y-U,E=G.y+U,xr(o,h,y,g,E)}}}else{var Z=e.source(),W=Z.position(),ae=e.target(),se=ae.position();if(h=W.x,g=se.x,y=W.y,E=se.y,h>g){var he=h;h=g,g=he}if(y>E){var we=y;y=E,E=we}h-=U,g+=U,y-=U,E+=U,xr(o,h,y,g,E)}if(l&&a.includeEdges&&c&&(Oo(o,e,"mid-source"),Oo(o,e,"mid-target"),Oo(o,e,"source"),Oo(o,e,"target")),l){var de=e.pstyle("ghost").value==="yes";if(de){var $=e.pstyle("ghost-offset-x").pfValue,re=e.pstyle("ghost-offset-y").pfValue;xr(o,o.x1+$,o.y1+re,o.x2+$,o.y2+re)}}var le=f.bodyBounds=f.bodyBounds||{};D0(le,o),Po(le,S),Ho(le,1),l&&(h=o.x1,g=o.x2,y=o.y1,E=o.y2,xr(o,h-O,y-O,g+O,E+O));var pe=f.overlayBounds=f.overlayBounds||{};D0(pe,o),Po(pe,S),Ho(pe,1);var j=f.labelBounds=f.labelBounds||{};j.all!=null?bT(j.all):j.all=ka(),l&&a.includeLabels&&(a.includeMainLabels&&sh(o,e,null),c&&(a.includeSourceLabels&&sh(o,e,"source"),a.includeTargetLabels&&sh(o,e,"target")))}return o.x1=pr(o.x1),o.y1=pr(o.y1),o.x2=pr(o.x2),o.y2=pr(o.y2),o.w=pr(o.x2-o.x1),o.h=pr(o.y2-o.y1),o.w>0&&o.h>0&&C&&(Po(o,S),Ho(o,1)),o},z2=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},O2=function(e){var a=function(f){return Math.round(f)};if(e.isEdge()){var n=e.source().position(),l=e.target().position();return x0([a(n.x),a(n.y),a(l.x),a(l.y)])}else{var u=e.position();return x0([a(u.x),a(u.y)])}},Yb=function(e,a){var n=e._private,l,u=e.isEdge(),o=a==null?Fb:z2(a),f=o===Fb;if(n.bbCache==null?(l=VA(e,Zu),n.bbCache=l,n.bbCachePosKey=O2(e)):l=n.bbCache,!f){var d=e.isNode();l=ka(),(a.includeNodes&&d||a.includeEdges&&!d)&&(a.includeOverlays?qn(l,n.overlayBounds):qn(l,n.bodyBounds)),a.includeLabels&&(a.includeMainLabels&&(!u||a.includeSourceLabels&&a.includeTargetLabels)?qn(l,n.labelBounds.all):(a.includeMainLabels&&qn(l,n.labelBounds.mainRot),a.includeSourceLabels&&qn(l,n.labelBounds.sourceRot),a.includeTargetLabels&&qn(l,n.labelBounds.targetRot))),l.w=l.x2-l.x1,l.h=l.y2-l.y1}return l},Zu={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Fb=z2(Zu),Ib=Ca(Zu);Jn.boundingBox=function(t){var e,a=t===void 0||t.useCache===void 0||t.useCache===!0,n=Rl(function(h){var g=h._private;return g.bbCache==null||g.styleDirty||g.bbCachePosKey!==O2(h)},function(h){return h.id()});if(a&&this.length===1&&!n(this[0]))t===void 0?t=Zu:t=Ib(t),e=Yb(this[0],t);else{e=ka(),t=t||Zu;var l=Ib(t),u=this,o=u.cy(),f=o.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),f&&this.recalculateRenderedStyle(a),this.updateCompoundBounds(!a);for(var d=0;d<u.length;d++){var c=u[d];n(c)&&c.dirtyBoundingBoxCache(),qn(e,Yb(c,l))}}return e.x1=pr(e.x1),e.y1=pr(e.y1),e.x2=pr(e.x2),e.y2=pr(e.y2),e.w=pr(e.x2-e.x1),e.h=pr(e.y2-e.y1),e};Jn.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};Jn.boundingBoxAt=function(t){var e=this.nodes(),a=this.cy(),n=a.hasCompoundNodes(),l=a.collection();if(n&&(l=e.filter(function(c){return c.isParent()}),e=e.not(l)),vt(t)){var u=t;t=function(){return u}}var o=function(h,g){return h._private.bbAtOldPos=t(h,g)},f=function(h){return h._private.bbAtOldPos};a.startBatch(),e.forEach(o).silentPositions(t),n&&(l.dirtyCompoundBoundsCache(),l.dirtyBoundingBoxCache(),l.updateCompoundBounds(!0));var d=mT(this.boundingBox({useCache:!1}));return e.silentPositions(f),n&&(l.dirtyCompoundBoundsCache(),l.dirtyBoundingBoxCache(),l.updateCompoundBounds(!0)),a.endBatch(),d};Ml.boundingbox=Ml.bb=Ml.boundingBox;Ml.renderedBoundingbox=Ml.renderedBoundingBox;var UA=Jn,Vu,ls;Vu=ls={};var N2=function(e){e.uppercaseName=l0(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=l0(e.outerName),Vu[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 f=n.pstyle(e.name);return f.strValue==="label"?(n.recalculateRenderedStyle(),l.rstyle[e.labelName]||0):f.pfValue}else return 1},Vu["outer"+e.uppercaseName]=function(){var n=this[0],l=n._private,u=l.cy,o=u._private.styleEnabled;if(n)if(o){var f=n[e.name](),d=n.pstyle("border-position").value,c;d==="center"?c=n.pstyle("border-width").pfValue:d==="outside"?c=2*n.pstyle("border-width").pfValue:c=0;var h=2*n.padding();return f+c+h}else return 1},Vu["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var l=n[e.name]();return l*this.cy().zoom()}},Vu["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var l=n[e.outerName]();return l*this.cy().zoom()}}};N2({name:"width"});N2({name:"height"});ls.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};ls.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};ls.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var HA=ls,PA=function(e,a){if(e.isEdge()&&e.takesUpSpace())return a(e)},GA=function(e,a){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return hf(a(e),n.zoom(),n.pan())}},YA=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 hf(o,u,l)})}},FA=function(e){return e.renderer().getControlPoints(e)},IA=function(e){return e.renderer().getSegmentPoints(e)},XA=function(e){return e.renderer().getSourceEndpoint(e)},jA=function(e){return e.renderer().getTargetEndpoint(e)},KA=function(e){return e.renderer().getEdgeMidpoint(e)},Xb={controlPoints:{get:FA,mult:!0},segmentPoints:{get:IA,mult:!0},sourceEndpoint:{get:XA},targetEndpoint:{get:jA},midpoint:{get:KA}},ZA=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},QA=Object.keys(Xb).reduce(function(t,e){var a=Xb[e],n=ZA(e);return t[e]=function(){return PA(this,a.get)},a.mult?t[n]=function(){return YA(this,a.get)}:t[n]=function(){return GA(this,a.get)},t},{}),JA=Fe({},_A,UA,HA,QA);var L2=function(e,a){this.recycle(e,a)};function Ou(){return!1}function No(){return!0}L2.prototype={instanceString:function(){return"event"},recycle:function(e,a){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ou,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?No:Ou):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=No;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=No;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=No,this.stopPropagation()},isDefaultPrevented:Ou,isPropagationStopped:Ou,isImmediatePropagationStopped:Ou};var k2=/^([^.]+)(\.(?:[^.]+))?$/,WA=".*",_2={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},jb=Object.keys(_2),$A={};function xf(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$A,e=arguments.length>1?arguments[1]:void 0,a=0;a<jb.length;a++){var n=jb[a];this[n]=t[n]||_2[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Kn=xf.prototype,q2=function(e,a,n,l,u,o,f){Pt(l)&&(u=l,l=null),f&&(o==null?o=f:o=Fe({},o,f));for(var d=Mt(n)?n:n.split(/\s+/),c=0;c<d.length;c++){var h=d[c];if(!Yn(h)){var g=h.match(k2);if(g){var y=g[1],E=g[2]?g[2]:null,b=a(e,h,y,E,l,u,o);if(b===!1)break}}}},Kb=function(e,a){return e.addEventFields(e.context,a),new L2(a.type,a)},eD=function(e,a,n){if(lw(n)){a(e,n);return}else if(vt(n)){a(e,Kb(e,n));return}for(var l=Mt(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var o=l[u];if(!Yn(o)){var f=o.match(k2);if(f){var d=f[1],c=f[2]?f[2]:null,h=Kb(e,{type:d,namespace:c,target:e.context});a(e,h)}}}};Kn.on=Kn.addListener=function(t,e,a,n,l){return q2(this,function(u,o,f,d,c,h,g){Pt(h)&&u.listeners.push({event:o,callback:h,type:f,namespace:d,qualifier:c,conf:g})},t,e,a,n,l),this};Kn.one=function(t,e,a,n){return this.on(t,e,a,n,{one:!0})};Kn.removeListener=Kn.off=function(t,e,a,n){var l=this;this.emitting!==0&&(this.listeners=Gw(this.listeners));for(var u=this.listeners,o=function(c){var h=u[c];q2(l,function(g,y,E,b,w,x){if((h.type===E||t==="*")&&(!b&&h.namespace!==".*"||h.namespace===b)&&(!w||g.qualifierCompare(h.qualifier,w))&&(!x||h.callback===x))return u.splice(c,1),!1},t,e,a,n)},f=u.length-1;f>=0;f--)o(f);return this};Kn.removeAllListeners=function(){return this.removeListener("*")};Kn.emit=Kn.trigger=function(t,e,a){var n=this.listeners,l=n.length;return this.emitting++,Mt(e)||(e=[e]),eD(this,function(u,o){a!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:a}],l=n.length);for(var f=function(){var h=n[d];if(h.type===o.type&&(!h.namespace||h.namespace===o.namespace||h.namespace===WA)&&u.eventMatches(u.context,h,o)){var g=[o];e!=null&&Fw(g,e),u.beforeEmit(u.context,h,o),h.conf&&h.conf.one&&(u.listeners=u.listeners.filter(function(b){return b!==h}));var y=u.callbackContext(u.context,h,o),E=h.callback.apply(y,g);u.afterEmit(u.context,h,o),E===!1&&(o.stopPropagation(),o.preventDefault())}},d=0;d<l;d++)f();u.bubble(u.context)&&!o.isPropagationStopped()&&u.parent(u.context).emit(o,e)},t),this.emitting--,this};var tD={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&&es(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()}},Lo=function(e){return Ge(e)?new Xn(e):e},V2={createEmitter:function(){for(var e=0;e<this.length;e++){var a=this[e],n=a._private;n.emitter||(n.emitter=new xf(tD,a))}return this},emitter:function(){return this._private.emitter},on:function(e,a,n){for(var l=Lo(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=Lo(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=Lo(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=Lo(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}};bt.eventAliasesOn(V2);var U2={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)||ar(e))return new Xn(e).filter(this);if(Pt(e)){for(var n=this.spawn(),l=this,u=0;u<l.length;u++){var o=l[u],f=a?e.apply(a,[o,u,l]):e(o,u,l);f&&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,f=o?l:u,d=o?u:l,c=0;c<f.length;c++){var h=f[c];d.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(d,c){for(var h=0;h<d.length;h++){var g=d[h],y=g._private.data.id,E=c.hasElementWithId(y);E||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,f=e,d=function(h,g,y){for(var E=0;E<h.length;E++){var b=h[E],w=b._private.data.id,x=g.hasElementWithId(w);x?u.merge(b):y.push(b)}};return d(o,f,n),d(f,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],f=!this.has(o);f&&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 f=e[o],d=f._private.data.id,c=!u.has(d);if(c){var h=this.length++;this[h]=f,u.set(d,{ele:f,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 f=this.length-1,d=this[f],c=d._private.data.id;this[f]=void 0,this[e]=d,u.set(c,{ele:d,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],f=a?e.apply(a,[o,u,l]):e(o,u,l);n.push(f)}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 f=u[o],d=a?e.apply(a,[f,o,u]):e(f,o,u);d>n&&(n=d,l=f)}return{value:n,ele:l}},min:function(e,a){for(var n=1/0,l,u=this,o=0;o<u.length;o++){var f=u[o],d=a?e.apply(a,[f,o,u]):e(f,o,u);d<n&&(n=d,l=f)}return{value:n,ele:l}}},yt=U2;yt.u=yt["|"]=yt["+"]=yt.union=yt.or=yt.add;yt["\\"]=yt["!"]=yt["-"]=yt.difference=yt.relativeComplement=yt.subtract=yt.not;yt.n=yt["&"]=yt["."]=yt.and=yt.intersection=yt.intersect;yt["^"]=yt["(+)"]=yt["(-)"]=yt.symmetricDifference=yt.symdiff=yt.xor;yt.fnFilter=yt.filterFn=yt.stdFilter=yt.filter;yt.complement=yt.abscomp=yt.absoluteComplement;var aD={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}},H2=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"?Ih:0}var o=u(e)-u(a);if(o!==0)return o;function f(h){var g=h.pstyle("z-index-compare");return g.value==="auto"&&h.isNode()?1:0}var d=f(e)-f(a);if(d!==0)return d;var c=e.pstyle("z-index").value-a.pstyle("z-index").value;return c!==0?c:e.poolIndex()-a.poolIndex()},rf={forEach:function(e,a){if(Pt(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(!Pt(e))return this;var a=this.toArray().sort(e);return this.spawn(a)},sortByZIndex:function(){return this.sort(H2)},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:Ih-1}else{var u=a.source,o=a.target,f=u.zDepth(),d=o.zDepth();return Math.max(f,d,0)}}}};rf.each=rf.forEach;var rD=function(){var e="undefined",a=(typeof Symbol>"u"?"undefined":ua(Symbol))!=e&&ua(Symbol.iterator)!=e;a&&(rf[Symbol.iterator]=function(){var n=this,l={value:void 0,done:!1},u=0,o=this.length;return V1({next:function(){return u<o?l.value=n[u++]:(l.value=void 0,l.done=!0),l}},Symbol.iterator,function(){return this})})};rD();var nD=Ca({nodeDimensionsIncludeLabels:!1}),Yo={layoutDimensions:function(e){e=nD(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,f=function(z){return z.id()},d=Rl(n,f);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(z,B,O){var _={x:B.x1+B.w/2,y:B.y1+B.h/2},U={x:(O.x-_.x)*z,y:(O.y-_.y)*z};return{x:_.x+U.x,y:_.y+U.y}},h=a.spacingFactor&&a.spacingFactor!==1,g=function(){if(!h)return null;for(var z=ka(),B=0;B<l.length;B++){var O=l[B],_=d(O,B);n2(z,_.x,_.y)}return z},y=g(),E=Rl(function(R,z){var B=d(R,z);if(h){var O=Math.abs(a.spacingFactor);B=c(O,y,B)}return a.transform!=null&&(B=a.transform(R,B)),B},f);if(a.animate){for(var b=0;b<l.length;b++){var w=l[b],x=E(w,b),S=a.animateFilter==null||a.animateFilter(w,b);if(S){var T=w.animation({position:x,duration:a.animationDuration,easing:a.animationEasing});e.animations.push(T)}else w.position(x)}if(a.fit){var C=u.animation({fit:{boundingBox:o.boundingBoxAt(E),padding:a.padding},duration:a.animationDuration,easing:a.animationEasing});e.animations.push(C)}else if(a.zoom!==void 0&&a.pan!==void 0){var D=u.animation({zoom:a.zoom,pan:a.pan,duration:a.animationDuration,easing:a.animationEasing});e.animations.push(D)}e.animations.forEach(function(R){return R.play()}),e.one("layoutready",a.ready),e.emit({type:"layoutready",layout:e}),Ll.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(E),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}))}};Yo.createLayout=Yo.makeLayout=Yo.layout;function P2(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 Sf(t,e){return t=Ci(t),function(n){return P2(t,e,n)}}function wf(t,e){t=Ci(t);var a=function(l){return e.call(l)};return function(){var l=this[0];if(l)return P2(t,a,l)}}var wa={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(f){return f._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(vt(e)){var o=e;u.applyBypass(this,o,l),this.emitAndNotify("style")}else if(Ge(e))if(a===void 0){var f=this[0];return f?u.getStylePropertyValue(f,e):void 0}else u.applyBypass(this,e,a,l),this.emitAndNotify("style");else if(e===void 0){var d=this[0];return d?u.getRawStyle(d):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 f=u[o];l.removeAllBypasses(f,n)}else{e=e.split(/\s+/);for(var d=0;d<u.length;d++){var c=u[d];l.removeBypasses(c,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 f=0;f<o.length;f++){var d=o[f],c=d.pstyle("opacity").value;u=c*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 oh(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 rg(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 f=u._private;if(!e(u))return!1;if(u.isNode())return!o||oh(u,n);var d=f.source,c=f.target;return a(d)&&(!o||oh(d,a))&&(d===c||a(c)&&(!o||oh(c,a)))}}}var kl=Sf("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});wa.takesUpSpace=wf("takesUpSpace",rg({ok:kl}));var iD=Sf("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&kl(t)}),lD=Sf("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&kl(t)});wa.interactive=wf("interactive",rg({ok:iD,parentOk:lD,edgeOkViaNode:kl}));wa.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var uD=Sf("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&kl(t)}),sD=kl;wa.visible=wf("visible",rg({ok:uD,edgeOkViaNode:sD}));wa.hidden=function(){var t=this[0];if(t)return!t.visible()};wa.isBundledBezier=wf("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});wa.bypass=wa.css=wa.style;wa.renderedCss=wa.renderedStyle;wa.removeBypass=wa.removeCss=wa.removeStyle;wa.pstyle=wa.parsedStyle;var Gn={};function Zb(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&&Pt(e[0])){var u=e[0];this.on(t.event,u)}else if(e.length===0||e.length===1&&Mt(e[0])){for(var o=e.length===1?e[0]:null,f=0;f<this.length;f++){var d=this[f],c=!t.ableField||d._private[t.ableField],h=d._private[t.field]!=t.value;if(t.overrideAble){var g=t.overrideAble(d);if(g!==void 0&&(c=g,!g))return this}c&&(d._private[t.field]=t.value,h&&a.push(d))}var y=this.spawn(a);y.updateStyle(),y.emit(t.event),o&&y.emit(o)}return this}}function _l(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]=Zb({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Gn[t.off]=Zb({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}_l({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});_l({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});_l({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});_l({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};_l({field:"active",on:"activate",off:"unactivate"});_l({field:"pannable",on:"panify",off:"unpanify"});Gn.inactive=function(){var t=this[0];if(t)return!t._private.active};var Ra={},Qb=function(e){return function(n){for(var l=this,u=[],o=0;o<l.length;o++){var f=l[o];if(f.isNode()){for(var d=!1,c=f.connectedEdges(),h=0;h<c.length;h++){var g=c[h],y=g.source(),E=g.target();if(e.noIncomingEdges&&E===f&&y!==f||e.noOutgoingEdges&&y===f&&E!==f){d=!0;break}}d||u.push(f)}}return this.spawn(u,!0).filter(n)}},Jb=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 f=o.connectedEdges(),d=0;d<f.length;d++){var c=f[d],h=c.source(),g=c.target();e.outgoing&&h===o?(l.push(c),l.push(g)):e.incoming&&g===o&&(l.push(c),l.push(h))}}return this.spawn(l,!0).filter(a)}},Wb=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 f=!1,d=0;d<o.length;d++){var c=o[d],h=c.id();u[h]||(u[h]=!0,l.push(c),f=!0)}if(!f)break;n=o}return this.spawn(l,!0).filter(a)}};Ra.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};Fe(Ra,{roots:Qb({noIncomingEdges:!0}),leaves:Qb({noOutgoingEdges:!0}),outgoers:yr(Jb({outgoing:!0}),"outgoers"),successors:Wb({outgoing:!0}),incomers:yr(Jb({incoming:!0}),"incomers"),predecessors:Wb({})});Fe(Ra,{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 f=u[o],d=f.source(),c=f.target(),h=l===d?c:d;h.length>0&&e.push(h[0]),e.push(f[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)}});Ra.neighbourhood=Ra.neighborhood;Ra.closedNeighbourhood=Ra.closedNeighborhood;Ra.openNeighbourhood=Ra.openNeighborhood;Fe(Ra,{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:$b({attr:"source"}),targets:$b({attr:"target"})});function $b(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(Ra,{edgesWith:yr(e1(),"edgesWith"),edgesTo:yr(e1({thisIsSrc:!0}),"edgesTo")});function e1(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 f=a[o]._private.edges,d=0;d<f.length;d++){var c=f[d],h=c._private.data,g=this.hasElementWithId(h.source)&&a.hasElementWithId(h.target),y=a.hasElementWithId(h.source)&&this.hasElementWithId(h.target),E=g||y;E&&((u.thisIsSrc||u.thisIsTgt)&&(u.thisIsSrc&&!g||u.thisIsTgt&&!y)||n.push(c))}return this.spawn(n,!0)}}Fe(Ra,{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 f=u[o];e.push(f)}}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(t1(),"parallelEdges"),codirectedEdges:yr(t1({codirected:!0}),"codirectedEdges")});function t1(t){var e={codirected:!1};return t=Fe({},e,t),function(n){for(var l=[],u=this.edges(),o=t,f=0;f<u.length;f++)for(var d=u[f],c=d._private,h=c.source,g=h._private.data.id,y=c.data.target,E=h._private.edges,b=0;b<E.length;b++){var w=E[b],x=w._private.data,S=x.target,T=x.source,C=S===y&&T===g,D=g===S&&y===T;(o.codirected&&C||!o.codirected&&(C||D))&&l.push(w)}return this.spawn(l,!0).filter(n)}}Fe(Ra,{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 f=function(h,g){l.merge(h),u.unmerge(h),g.merge(h)};if(u.empty())return a.spawn();var d=function(){var h=n.collection();o.push(h);var g=u[0];f(g,h),a.bfs({directed:!1,roots:g,visit:function(E){return f(E,h)}}),h.forEach(function(y){y.connectedEdges().forEach(function(E){a.has(E)&&h.has(E.source())&&h.has(E.target())&&h.merge(E)})})};do d();while(u.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Ra.componentsOf=Ra.components;var Ta=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){qt("A collection must have a reference to the core");return}var u=new tn,o=!1;if(!a)a=[];else if(a.length>0&&vt(a[0])&&!es(a[0])){o=!0;for(var f=[],d=new Nl,c=0,h=a.length;c<h;c++){var g=a[c];g.data==null&&(g.data={});var y=g.data;if(y.id==null)y.id=t2();else if(e.hasElementWithId(y.id)||d.has(y.id))continue;var E=new df(e,g,!1);f.push(E),d.add(y.id)}a=f}this.length=0;for(var b=0,w=a.length;b<w;b++){var x=a[b][0];if(x!=null){var S=x._private.data.id;(!n||!u.has(S))&&(n&&u.set(S,{index:this.length,ele:x}),this[this.length]=x,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 tn,D=this.eles,R=0;R<D.length;R++){var z=D[R];C.set(z.id(),{index:R,ele:z})}}},n&&(this._private.map=u),o&&!l&&this.restore()},zt=df.prototype=Ta.prototype=Object.create(Array.prototype);zt.instanceString=function(){return"collection"};zt.spawn=function(t,e){return new Ta(this.cy(),t,e)};zt.spawnSelf=function(){return this.spawn(this)};zt.cy=function(){return this._private.cy};zt.renderer=function(){return this._private.cy.renderer()};zt.element=function(){return this[0]};zt.collection=function(){return P1(this)?this:new Ta(this._private.cy,[this])};zt.unique=function(){return new Ta(this._private.cy,this,!0)};zt.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};zt.getElementById=function(t){t=""+t;var e=this._private.cy,a=this._private.map.get(t);return a?a.ele:new Ta(e)};zt.$id=zt.getElementById;zt.poolIndex=function(){var t=this._private.cy,e=t._private.elements,a=this[0]._private.data.id;return e._private.map.get(a).index};zt.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};zt.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};zt.json=function(t){var e=this.element(),a=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(vt(t)){if(a.startBatch(),t.data){e.data(t.data);var l=n.data;if(e.isEdge()){var u=!1,o={},f=t.data.source,d=t.data.target;f!=null&&f!=l.source&&(o.source=""+f,u=!0),d!=null&&d!=l.target&&(o.target=""+d,u=!0),u&&(e=e.move(o))}else{var c="parent"in t.data,h=t.data.parent;c&&(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(w,x,S){var T=t[w];T!=null&&T!==n[w]&&(T?e[x]():e[S]())};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 y={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};y.classes="";var E=0;return n.classes.forEach(function(b){return y.classes+=E++===0?b:" "+b}),y}}};zt.jsons=function(){for(var t=[],e=0;e<this.length;e++){var a=this[e],n=a.json();t.push(n)}return t};zt.clone=function(){for(var t=this.cy(),e=[],a=0;a<this.length;a++){var n=this[a],l=n.json(),u=new df(t,l,!1);e.push(u)}return new Ta(t,e)};zt.copy=zt.clone;zt.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=[],f,d=0,c=a.length;d<c;d++){var h=a[d];e&&!h.removed()||(h.isNode()?u.push(h):o.push(h))}f=u.concat(o);var g,y=function(){f.splice(g,1),g--};for(g=0;g<f.length;g++){var E=f[g],b=E._private,w=b.data;if(E.clearTraversalCache(),!(!e&&!b.removed)){if(w.id===void 0)w.id=t2();else if(Te(w.id))w.id=""+w.id;else if(Yn(w.id)||!Ge(w.id)){qt("Can not create element with invalid string ID `"+w.id+"`"),y();continue}else if(n.hasElementWithId(w.id)){qt("Can not create second element with ID `"+w.id+"`"),y();continue}}var x=w.id;if(E.isNode()){var S=b.position;S.x==null&&(S.x=0),S.y==null&&(S.y=0)}if(E.isEdge()){for(var T=E,C=["source","target"],D=C.length,R=!1,z=0;z<D;z++){var B=C[z],O=w[B];Te(O)&&(O=w[B]=""+w[B]),O==null||O===""?(qt("Can not create edge `"+x+"` with unspecified "+B),R=!0):n.hasElementWithId(O)||(qt("Can not create edge `"+x+"` with nonexistent "+B+" `"+O+"`"),R=!0)}if(R){y();continue}var _=n.getElementById(w.source),U=n.getElementById(w.target);_.same(U)?_._private.edges.push(T):(_._private.edges.push(T),U._private.edges.push(T)),T._private.source=_,T._private.target=U}b.map=new tn,b.map.set(x,{ele:E,index:0}),b.removed=!1,e&&n.addToPool(E)}for(var V=0;V<u.length;V++){var q=u[V],P=q._private.data;Te(P.parent)&&(P.parent=""+P.parent);var Y=P.parent,I=Y!=null;if(I||q._private.parent){var L=q._private.parent?n.collection().merge(q._private.parent):n.getElementById(Y);if(L.empty())P.parent=void 0;else if(L[0].removed())Et("Node added with missing parent, reference to parent removed"),P.parent=void 0,q._private.parent=null;else{for(var H=!1,F=L;!F.empty();){if(q.same(F)){H=!0,P.parent=void 0;break}F=F.parent()}H||(L[0]._private.children.push(q),q._private.parent=L[0],l.hasCompoundNodes=!0)}}}if(f.length>0){for(var Q=f.length===a.length?a:new Ta(n,f),J=0;J<Q.length;J++){var M=Q[J];M.isNode()||(M.parallelEdges().clearTraversalCache(),M.source().clearTraversalCache(),M.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};zt.removed=function(){var t=this[0];return t&&t._private.removed};zt.inside=function(){var t=this[0];return t&&!t._private.removed};zt.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(Y){for(var I=Y._private.edges,L=0;L<I.length;L++)d(I[L])}function f(Y){for(var I=Y._private.children,L=0;L<I.length;L++)d(I[L])}function d(Y){var I=l[Y.id()];e&&Y.removed()||I||(l[Y.id()]=!0,Y.isNode()?(n.push(Y),o(Y),f(Y)):n.unshift(Y))}for(var c=0,h=a.length;c<h;c++){var g=a[c];d(g)}function y(Y,I){var L=Y._private.edges;Fn(L,I),Y.clearTraversalCache()}function E(Y){Y.clearTraversalCache()}var b=[];b.ids={};function w(Y,I){I=I[0],Y=Y[0];var L=Y._private.children,H=Y.id();Fn(L,I),I._private.parent=null,b.ids[H]||(b.ids[H]=!0,b.push(Y))}a.dirtyCompoundBoundsCache(),e&&u.removeFromPool(n);for(var x=0;x<n.length;x++){var S=n[x];if(S.isEdge()){var T=S.source()[0],C=S.target()[0];y(T,S),y(C,S);for(var D=S.parallelEdges(),R=0;R<D.length;R++){var z=D[R];E(z),z.isBundledBezier()&&z.dirtyBoundingBoxCache()}}else{var B=S.parent();B.length!==0&&w(B,S)}e&&(S._private.removed=!0)}var O=u._private.elements;u._private.hasCompoundNodes=!1;for(var _=0;_<O.length;_++){var U=O[_];if(U.isParent()){u._private.hasCompoundNodes=!0;break}}var V=new Ta(this.cy(),n);V.size()>0&&(t?V.emitAndNotify("remove"):e&&V.emit("remove"));for(var q=0;q<b.length;q++){var P=b[q];(!e||!P.removed())&&P.updateStyle()}return V};zt.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),f=u(t.target),d=o!=null&&e.hasElementWithId(o),c=f!=null&&e.hasElementWithId(f);(d||c)&&(e.batch(function(){a.remove(n,l),a.emitAndNotify("moveout");for(var E=0;E<a.length;E++){var b=a[E],w=b._private.data;b.isEdge()&&(d&&(w.source=o),c&&(w.target=f))}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 y=h===null?void 0:h;e.batch(function(){var E=a.remove(n,l);E.emitAndNotify("moveout");for(var b=0;b<a.length;b++){var w=a[b],x=w._private.data;w.isNode()&&(x.parent=y)}E.restore(n,l)}),a.emitAndNotify("move")}}return this};[d2,bA,Go,Pn,Ol,kA,Ef,JA,V2,U2,aD,rf,Yo,wa,Gn,Ra].forEach(function(t){Fe(zt,t)});var oD={add:function(e){var a,n=this;if(ar(e)){var l=e;if(l._private.cy===n)a=l.restore();else{for(var u=[],o=0;o<l.length;o++){var f=l[o];u.push(f.json())}a=new Ta(n,u)}}else if(Mt(e)){var d=e;a=new Ta(n,d)}else if(vt(e)&&(Mt(e.nodes)||Mt(e.edges))){for(var c=e,h=[],g=["nodes","edges"],y=0,E=g.length;y<E;y++){var b=g[y],w=c[b];if(Mt(w))for(var x=0,S=w.length;x<S;x++){var T=Fe({group:b},w[x]);h.push(T)}}a=new Ta(n,h)}else{var C=e;a=new df(n,C).collection()}return a},remove:function(e){if(!ar(e)){if(Ge(e)){var a=e;e=this.$(a)}}return e.remove()}};function fD(t,e,a,n){var l=4,u=.001,o=1e-7,f=10,d=11,c=1/(d-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 y=h?new Float32Array(d):new Array(d);function E(U,V){return 1-3*V+3*U}function b(U,V){return 3*V-6*U}function w(U){return 3*U}function x(U,V,q){return((E(V,q)*U+b(V,q))*U+w(V))*U}function S(U,V,q){return 3*E(V,q)*U*U+2*b(V,q)*U+w(V)}function T(U,V){for(var q=0;q<l;++q){var P=S(V,t,a);if(P===0)return V;var Y=x(V,t,a)-U;V-=Y/P}return V}function C(){for(var U=0;U<d;++U)y[U]=x(U*c,t,a)}function D(U,V,q){var P,Y,I=0;do Y=V+(q-V)/2,P=x(Y,t,a)-U,P>0?q=Y:V=Y;while(Math.abs(P)>o&&++I<f);return Y}function R(U){for(var V=0,q=1,P=d-1;q!==P&&y[q]<=U;++q)V+=c;--q;var Y=(U-y[q])/(y[q+1]-y[q]),I=V+Y*c,L=S(I,t,a);return L>=u?T(U,I):L===0?I:D(U,V,V+c)}var z=!1;function B(){z=!0,(t!==e||a!==n)&&C()}var O=function(V){return z||B(),t===e&&a===n?V:V===0?0:V===1?1:x(R(V),e,n)};O.getControlPoints=function(){return[{x:t,y:e},{x:a,y:n}]};var _="generateBezier("+[t,e,a,n]+")";return O.toString=function(){return _},O}var cD=(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),f=e(n,l*.5,o),d=e(n,l,f),c=1/6*(u.dx+2*(o.dx+f.dx)+d.dx),h=1/6*(u.dv+2*(o.dv+f.dv)+d.dv);return n.x=n.x+c*l,n.v=n.v+h*l,n}return function n(l,u,o){var f={x:-1,v:0,tension:null,friction:null},d=[0],c=0,h=1/1e4,g=16/1e3,y,E,b;for(l=parseFloat(l)||500,u=parseFloat(u)||20,o=o||null,f.tension=l,f.friction=u,y=o!==null,y?(c=n(l,u),E=c/o*g):E=g;b=a(b||f,E),d.push(1+b.x),c+=16,Math.abs(b.x)>h&&Math.abs(b.v)>h;);return y?function(w){return d[w*(d.length-1)|0]}:c}})(),Rt=function(e,a,n,l){var u=fD(e,a,n,l);return function(o,f,d){return o+(f-o)*u(d)}},Fo={linear:function(e,a,n){return e+(a-e)*n},ease:Rt(.25,.1,.25,1),"ease-in":Rt(.42,0,1,1),"ease-out":Rt(0,0,.58,1),"ease-in-out":Rt(.42,0,.58,1),"ease-in-sine":Rt(.47,0,.745,.715),"ease-out-sine":Rt(.39,.575,.565,1),"ease-in-out-sine":Rt(.445,.05,.55,.95),"ease-in-quad":Rt(.55,.085,.68,.53),"ease-out-quad":Rt(.25,.46,.45,.94),"ease-in-out-quad":Rt(.455,.03,.515,.955),"ease-in-cubic":Rt(.55,.055,.675,.19),"ease-out-cubic":Rt(.215,.61,.355,1),"ease-in-out-cubic":Rt(.645,.045,.355,1),"ease-in-quart":Rt(.895,.03,.685,.22),"ease-out-quart":Rt(.165,.84,.44,1),"ease-in-out-quart":Rt(.77,0,.175,1),"ease-in-quint":Rt(.755,.05,.855,.06),"ease-out-quint":Rt(.23,1,.32,1),"ease-in-out-quint":Rt(.86,0,.07,1),"ease-in-expo":Rt(.95,.05,.795,.035),"ease-out-expo":Rt(.19,1,.22,1),"ease-in-out-expo":Rt(1,0,0,1),"ease-in-circ":Rt(.6,.04,.98,.335),"ease-out-circ":Rt(.075,.82,.165,1),"ease-in-out-circ":Rt(.785,.135,.15,.86),spring:function(e,a,n){if(n===0)return Fo.linear;var l=cD(e,a,n);return function(u,o,f){return u+(o-u)*l(f)}},"cubic-bezier":Rt};function a1(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 r1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function pl(t,e,a,n,l){var u=l!=null?l.type:null;a<0?a=0:a>1&&(a=1);var o=r1(t,l),f=r1(e,l);if(Te(o)&&Te(f))return a1(u,o,f,a,n);if(Mt(o)&&Mt(f)){for(var d=[],c=0;c<f.length;c++){var h=o[c],g=f[c];if(h!=null&&g!=null){var y=a1(u,h,g,a,n);d.push(y)}else d.push(g)}return d}}function vD(t,e,a,n){var l=!n,u=t._private,o=e._private,f=o.easing,d=o.startTime,c=n?t:t.cy(),h=c.style();if(!o.easingImpl)if(f==null)o.easingImpl=Fo.linear;else{var g;if(Ge(f)){var y=h.parse("transition-timing-function",f);g=y.value}else g=f;var E,b;Ge(g)?(E=g,b=[]):(E=g[1],b=g.slice(2).map(function(Q){return+Q})),b.length>0?(E==="spring"&&b.push(o.duration),o.easingImpl=Fo[E].apply(null,b)):o.easingImpl=Fo[E]}var w=o.easingImpl,x;if(o.duration===0?x=1:x=(a-d)/o.duration,o.applying&&(x=o.progress),x<0?x=0:x>1&&(x=1),o.delay==null){var S=o.startPosition,T=o.position;if(T&&l&&!t.locked()){var C={};Nu(S.x,T.x)&&(C.x=pl(S.x,T.x,x,w)),Nu(S.y,T.y)&&(C.y=pl(S.y,T.y,x,w)),t.position(C)}var D=o.startPan,R=o.pan,z=u.pan,B=R!=null&&n;B&&(Nu(D.x,R.x)&&(z.x=pl(D.x,R.x,x,w)),Nu(D.y,R.y)&&(z.y=pl(D.y,R.y,x,w)),t.emit("pan"));var O=o.startZoom,_=o.zoom,U=_!=null&&n;U&&(Nu(O,_)&&(u.zoom=Xu(u.minZoom,pl(O,_,x,w),u.maxZoom)),t.emit("zoom")),(B||U)&&t.emit("viewport");var V=o.style;if(V&&V.length>0&&l){for(var q=0;q<V.length;q++){var P=V[q],Y=P.name,I=P,L=o.startStyle[Y],H=h.properties[L.name],F=pl(L,I,x,w,H);h.overrideBypass(t,Y,F)}t.emit("style")}}return o.progress=x,x}function Nu(t,e){return t==null||e==null?!1:Te(t)&&Te(e)?!0:!!(t&&e)}function dD(t,e,a,n){var l=e._private;l.started=!0,l.startTime=a-l.progress*l.duration}function n1(t,e){var a=e._private.aniEles,n=[];function l(h,g){var y=h._private,E=y.animation.current,b=y.animation.queue,w=!1;if(E.length===0){var x=b.shift();x&&E.push(x)}for(var S=function(z){for(var B=z.length-1;B>=0;B--){var O=z[B];O()}z.splice(0,z.length)},T=E.length-1;T>=0;T--){var C=E[T],D=C._private;if(D.stopped){E.splice(T,1),D.hooked=!1,D.playing=!1,D.started=!1,S(D.frames);continue}!D.playing&&!D.applying||(D.playing&&D.applying&&(D.applying=!1),D.started||dD(h,C,t),vD(h,C,t,g),D.applying&&(D.applying=!1),S(D.frames),D.step!=null&&D.step(t),C.completed()&&(E.splice(T,1),D.hooked=!1,D.playing=!1,D.started=!1,S(D.completes)),w=!0)}return!g&&E.length===0&&b.length===0&&n.push(h),w}for(var u=!1,o=0;o<a.length;o++){var f=a[o],d=l(f);u=u||d}var c=l(e,!0);(u||c)&&(a.length>0?e.notify("draw",a):e.notify("draw")),a.unmerge(n),e.emit("step")}var hD={animate:bt.animate(),animation:bt.animation(),animated:bt.animated(),clearQueue:bt.clearQueue(),delay:bt.delay(),delayAnimation:bt.delayAnimation(),stop:bt.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&&Wo(function(u){n1(u,e),a()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(u,o){n1(o,e)},n.beforeRenderPriorities.animations):a()}},gD={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&&es(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}},ko=function(e){return Ge(e)?new Xn(e):e},G2={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new xf(gD,this)),this},emitter:function(){return this._private.emitter},on:function(e,a,n){return this.emitter().on(e,ko(a),n),this},removeListener:function(e,a,n){return this.emitter().removeListener(e,ko(a),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,a,n){return this.emitter().one(e,ko(a),n),this},once:function(e,a,n){return this.emitter().one(e,ko(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}};bt.eventAliasesOn(G2);var Mh={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)}};Mh.jpeg=Mh.jpg;var Io={layout:function(e){var a=this;if(e==null){qt("Layout options must be specified to make a layout");return}if(e.name==null){qt("A `name` must be specified to make a layout");return}var n=e.name,l=a.extension("layout",n);if(l==null){qt("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}};Io.createLayout=Io.makeLayout=Io.layout;var pD={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],f=a.getElementById(u);f.data(o)}})}},yD=Ca({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]}),Rh={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){qt("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&&Et("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=yD(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)}};Rh.invalidateDimensions=Rh.resize;var Xo={collection:function(e,a){return Ge(e)?this.$(e):ar(e)?e.collection():Mt(e)?(a||(a={}),new Ta(this,e,a.unique,a.removed)):new Ta(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}};Xo.elements=Xo.filter=Xo.$;var ya={},Hu="t",mD="f";ya.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],f=e.getContextMeta(o);if(!f.empty){var d=e.getContextStyle(f),c=e.applyContextStyle(f,d,o);o._private.appliedInitStyle?e.updateTransitions(o,c.diffProps):o._private.appliedInitStyle=!0;var h=e.updateStyleHints(o);h&&l.push(o)}}return l};ya.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=[],f={},d=0;d<a.length;d++){var c=a[d],h=t[d]===Hu,g=e[d]===Hu,y=h!==g,E=c.mappedProperties.length>0;if(y||g&&E){var b=void 0;y&&E||y?b=c.properties:E&&(b=c.mappedProperties);for(var w=0;w<b.length;w++){for(var x=b[w],S=x.name,T=!1,C=d+1;C<a.length;C++){var D=a[C],R=e[C]===Hu;if(R&&(T=D.properties[x.name]!=null,T))break}!f[S]&&!T&&(f[S]=!0,o.push(S))}}}return n[l]=o,o};ya.getContextMeta=function(t){for(var e=this,a="",n,l=t._private.styleCxtKey||"",u=0;u<e.length;u++){var o=e[u],f=o.selector&&o.selector.matches(t);f?a+=Hu:a+=mD}return n=e.getPropertiesDiff(l,a),t._private.styleCxtKey=a,{key:a,diffPropNames:n,empty:n.length===0}};ya.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],f=e[u]===Hu;if(f)for(var d=0;d<o.properties.length;d++){var c=o.properties[d];l[c.name]=c}}return n[e]=l,l};ya.applyContextStyle=function(t,e,a){for(var n=this,l=t.diffPropNames,u={},o=n.types,f=0;f<l.length;f++){var d=l[f],c=e[d],h=a.pstyle(d);if(!c)if(h)h.bypass?c={name:d,deleteBypassed:!0}:c={name:d,delete:!0};else continue;if(h!==c){if(c.mapped===o.fn&&h!=null&&h.mapping!=null&&h.mapping.value===c.value){var g=h.mapping,y=g.fnValue=c.value(a);if(y===g.prevFnValue)continue}var E=u[d]={prev:h};n.applyParsedProperty(a,c),E.next=a.pstyle(d),E.next&&E.next.bypass&&(E.next=E.next.bypassed)}}return{diffProps:u}};ya.updateStyleHints=function(t){var e=t._private,a=this,n=a.propertyGroupNames,l=a.propertyGroupKeys,u=function(le,pe,j){return a.getPropertiesHash(le,pe,j)},o=e.styleKey;if(t.removed())return!1;var f=e.group==="nodes",d=t._private.style;n=Object.keys(d);for(var c=0;c<l.length;c++){var h=l[c];e.styleKeys[h]=[Si,Sl]}for(var g=function(le,pe){return e.styleKeys[pe][0]=Yu(le,e.styleKeys[pe][0])},y=function(le,pe){return e.styleKeys[pe][1]=Fu(le,e.styleKeys[pe][1])},E=function(le,pe){g(le,pe),y(le,pe)},b=function(le,pe){for(var j=0;j<le.length;j++){var xe=le.charCodeAt(j);g(xe,pe),y(xe,pe)}},w=2e9,x=function(le){return-128<le&&le<128&&Math.floor(le)!==le?w-(le*1024|0):le},S=0;S<n.length;S++){var T=n[S],C=d[T];if(C!=null){var D=this.properties[T],R=D.type,z=D.groupKey,B=void 0;D.hashOverride!=null?B=D.hashOverride(t,C):C.pfValue!=null&&(B=C.pfValue);var O=D.enums==null?C.value:null,_=B!=null,U=O!=null,V=_||U,q=C.units;if(R.number&&V&&!R.multiple){var P=_?B:O;E(x(P),z),!_&&q!=null&&b(q,z)}else b(C.strValue,z)}}for(var Y=[Si,Sl],I=0;I<l.length;I++){var L=l[I],H=e.styleKeys[L];Y[0]=Yu(H[0],Y[0]),Y[1]=Fu(H[1],Y[1])}e.styleKey=Lw(Y[0],Y[1]);var F=e.styleKeys;e.labelDimsKey=kn(F.labelDimensions);var Q=u(t,["label"],F.labelDimensions);if(e.labelKey=kn(Q),e.labelStyleKey=kn(Do(F.commonLabel,Q)),!f){var J=u(t,["source-label"],F.labelDimensions);e.sourceLabelKey=kn(J),e.sourceLabelStyleKey=kn(Do(F.commonLabel,J));var M=u(t,["target-label"],F.labelDimensions);e.targetLabelKey=kn(M),e.targetLabelStyleKey=kn(Do(F.commonLabel,M))}if(f){var G=e.styleKeys,Z=G.nodeBody,W=G.nodeBorder,ae=G.nodeOutline,se=G.backgroundImage,he=G.compound,we=G.pie,de=G.stripe,$=[Z,W,ae,se,he,we,de].filter(function(re){return re!=null}).reduce(Do,[Si,Sl]);e.nodeKey=kn($),e.hasPie=we!=null&&we[0]!==Si&&we[1]!==Sl,e.hasStripe=de!=null&&de[0]!==Si&&de[1]!==Sl}return o!==e.styleKey};ya.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};ya.applyParsedProperty=function(t,e){var a=this,n=e,l=t._private.style,u,o=a.types,f=a.properties[n.name].type,d=n.bypass,c=l[n.name],h=c&&c.bypass,g=t._private,y="mapping",E=function(Z){return Z==null?null:Z.pfValue!=null?Z.pfValue:Z.value},b=function(){var Z=E(c),W=E(n);a.checkTriggers(t,n.name,Z,W)};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",d)),n.delete)return l[n.name]=void 0,b(),!0;if(n.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,b(),!0):!1:(b(),!0);if(n.deleteBypass)return c?c.bypass?(l[n.name]=c.bypassed,b(),!0):!1:(b(),!0);var w=function(){Et("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 x=n.field.split("."),S=g.data,T=0;T<x.length&&S;T++){var C=x[T];S=S[C]}if(S==null)return w(),!1;var D;if(Te(S)){var R=n.fieldMax-n.fieldMin;R===0?D=0:D=(S-n.fieldMin)/R}else return Et("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+S+"` for `"+t.id()+"` is non-numeric)"),!1;if(D<0?D=0:D>1&&(D=1),f.color){var z=n.valueMin[0],B=n.valueMax[0],O=n.valueMin[1],_=n.valueMax[1],U=n.valueMin[2],V=n.valueMax[2],q=n.valueMin[3]==null?1:n.valueMin[3],P=n.valueMax[3]==null?1:n.valueMax[3],Y=[Math.round(z+(B-z)*D),Math.round(O+(_-O)*D),Math.round(U+(V-U)*D),Math.round(q+(P-q)*D)];u={bypass:n.bypass,name:n.name,value:Y,strValue:"rgb("+Y[0]+", "+Y[1]+", "+Y[2]+")"}}else if(f.number){var I=n.valueMin+(n.valueMax-n.valueMin)*D;u=this.parse(n.name,I,n.bypass,y)}else return!1;if(!u)return w(),!1;u.mapping=n,n=u;break}case o.data:{for(var L=n.field.split("."),H=g.data,F=0;F<L.length&&H;F++){var Q=L[F];H=H[Q]}if(H!=null&&(u=this.parse(n.name,H,n.bypass,y)),!u)return w(),!1;u.mapping=n,n=u;break}case o.fn:{var J=n.value,M=n.fnValue!=null?n.fnValue:J(t);if(n.prevFnValue=M,M==null)return Et("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(u=this.parse(n.name,M,n.bypass,y),!u)return Et("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 d?(h?n.bypassed=c.bypassed:n.bypassed=c,l[n.name]=n):h?c.bypassed=n:l[n.name]=n,b(),!0};ya.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 f=u[o],d=l[f];d!=null&&(d.bypass?d.bypassed=null:l[f]=null)}}};ya.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};ya.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 f={},d=!1,c=0;c<l.length;c++){var h=l[c],g=t.pstyle(h),y=e[h];if(y){var E=y.prev,b=E,w=y.next!=null?y.next:g,x=!1,S=void 0,T=1e-6;b&&(Te(b.pfValue)&&Te(w.pfValue)?(x=w.pfValue-b.pfValue,S=b.pfValue+T*x):Te(b.value)&&Te(w.value)?(x=w.value-b.value,S=b.value+T*x):Mt(b.value)&&Mt(w.value)&&(x=b.value[0]!==w.value[0]||b.value[1]!==w.value[1]||b.value[2]!==w.value[2],S=b.strValue),x&&(f[h]=w.strValue,this.applyBypass(t,h,S),d=!0))}}if(!d)return;n.transitioning=!0,new Ll(function(C){o>0?t.delayAnimation(o).play().promise().then(C):C()}).then(function(){return t.animation({style:f,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)};ya.checkTrigger=function(t,e,a,n,l,u){var o=this.properties[e],f=l(o);t.removed()||f!=null&&f(a,n,t)&&u(o)};ya.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)})};ya.checkBoundsTrigger=function(t,e,a,n){this.checkTrigger(t,e,a,n,function(l){return l.triggersBounds},function(l){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};ya.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()})})};ya.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()})})};ya.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 us={};us.applyBypass=function(t,e,a,n){var l=this,u=[],o=!0;if(e==="*"||e==="**"){if(a!==void 0)for(var f=0;f<l.properties.length;f++){var d=l.properties[f],c=d.name,h=this.parse(c,a,!0);h&&u.push(h)}}else if(Ge(e)){var g=this.parse(e,a,!0);g&&u.push(g)}else if(vt(e)){var y=e;n=a;for(var E=Object.keys(y),b=0;b<E.length;b++){var w=E[b],x=y[w];if(x===void 0&&(x=y[cf(w)]),x!==void 0){var S=this.parse(w,x,!0);S&&u.push(S)}}}else return!1;if(u.length===0)return!1;for(var T=!1,C=0;C<t.length;C++){for(var D=t[C],R={},z=void 0,B=0;B<u.length;B++){var O=u[B];if(n){var _=D.pstyle(O.name);z=R[O.name]={prev:_}}T=this.applyParsedProperty(D,Or(O))||T,n&&(z.next=D.pstyle(O.name))}T&&this.updateStyleHints(D),n&&this.updateTransitions(D,R,o)}return T};us.overrideBypass=function(t,e,a){e=Yh(e);for(var n=0;n<t.length;n++){var l=t[n],u=l._private.style[e],o=this.properties[e].type,f=o.color,d=o.mutiple,c=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),f?u.strValue="rgb("+a.join(",")+")":d?u.strValue=a.join(" "):u.strValue=""+a,this.updateStyleHints(l)),this.checkTriggers(l,e,c,a)}};us.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};us.removeBypasses=function(t,e,a){for(var n=!0,l=0;l<t.length;l++){for(var u=t[l],o={},f=0;f<e.length;f++){var d=e[f],c=this.properties[d],h=u.pstyle(c.name);if(!(!h||!h.bypass)){var g="",y=this.parse(d,g,!0),E=o[c.name]={prev:h};this.applyParsedProperty(u,y),E.next=u.pstyle(c.name)}}this.updateStyleHints(u),a&&this.updateTransitions(u,o,n)}};var ng={};ng.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};ng.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 Nr={};Nr.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};Nr.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[cf(u.name)]=o)}return n}};Nr.getIndexedStyle=function(t,e,a,n){var l=t.pstyle(e)[a][n];return l??t.cy().style().getDefaultProperty(e)[a][0]};Nr.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 f=o.value,d=o.units,c=o.strValue;if(a&&u.number&&f!=null&&Te(f)){var h=t.cy().zoom(),g=function(x){return x*h},y=function(x,S){return g(x)+S},E=Mt(f),b=E?d.every(function(w){return w!=null}):d!=null;return b?E?f.map(function(w,x){return y(w,d[x])}).join(" "):y(f,d):E?f.map(function(w){return Ge(w)?w:""+g(w)}).join(" "):""+g(f)}else if(c!=null)return c}return null}};Nr.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&&(vt(o)?o=this.parse(u,o.strValue):o=this.parse(u,o)),o&&(a[u]=o)}return a};Nr.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 f=u[o],d=n[f],c=l[f]||l[Yh(f)],h=this.parse(c.name,d);h&&a.push(h)}return a};Nr.getNonDefaultPropertiesHash=function(t,e,a){var n=a.slice(),l,u,o,f,d,c;for(d=0;d<e.length;d++)if(l=e[d],u=t.pstyle(l,!1),u!=null)if(u.pfValue!=null)n[0]=Yu(f,n[0]),n[1]=Fu(f,n[1]);else for(o=u.strValue,c=0;c<o.length;c++)f=o.charCodeAt(c),n[0]=Yu(f,n[0]),n[1]=Fu(f,n[1]);return n};Nr.getPropertiesHash=Nr.getNonDefaultPropertiesHash;var Tf={};Tf.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 f=0;f<o.length;f++){var d=o[f],c=u[d];e.css(d,c)}}return e};Tf.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};Tf.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 f=l[o];u[f.name]=f.strValue}t.push({selector:n?n.toString():"core",style:u})}return t};var ig={};ig.appendFromString=function(t){var e=this,a=this,n=""+t,l,u,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function f(){n.length>l.length?n=n.substr(l.length):n=""}function d(){u.length>o.length?u=u.substr(o.length):u=""}for(;;){var c=n.match(/^\s*$/);if(c)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Et("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 y=new Xn(g);if(y.invalid){Et("Skipping parsing of block: Invalid selector found in string stylesheet: "+g),f();continue}}var E=h[2],b=!1;u=E;for(var w=[];;){var x=u.match(/^\s*$/);if(x)break;var S=u.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!S){Et("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+E),b=!0;break}o=S[0];var T=S[1],C=S[2],D=e.properties[T];if(!D){Et("Skipping property: Invalid property name in: "+o),d();continue}var R=a.parse(T,C);if(!R){Et("Skipping property: Invalid property definition in: "+o),d();continue}w.push({name:T,val:C}),d()}if(b){f();break}a.selector(g);for(var z=0;z<w.length;z++){var B=w[z];a.css(B.name,B.val)}f()}return a};ig.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var ta={};(function(){var t=la,e=vw,a=hw,n=gw,l=pw,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+")\\)$"},f=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];ta.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:f,singleRegexMatchValue:!0},urls:{regexes:f,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 d={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 pe=Yn(re),j=Yn(le);return pe&&!j||!pe&&j}},c=ta.types,h=[{name:"label",type:c.text,triggersBounds:d.any,triggersZOrder:d.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:d.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:d.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:d.any}],g=[{name:"source-label",type:c.text,triggersBounds:d.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:d.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:d.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:d.any},{name:"source-text-offset",type:c.size,triggersBounds:d.any}],y=[{name:"target-label",type:c.text,triggersBounds:d.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:d.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:d.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:d.any},{name:"target-text-offset",type:c.size,triggersBounds:d.any}],E=[{name:"font-family",type:c.fontFamily,triggersBounds:d.any},{name:"font-style",type:c.fontStyle,triggersBounds:d.any},{name:"font-weight",type:c.fontWeight,triggersBounds:d.any},{name:"font-size",type:c.size,triggersBounds:d.any},{name:"text-transform",type:c.textTransform,triggersBounds:d.any},{name:"text-wrap",type:c.textWrap,triggersBounds:d.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:d.any},{name:"text-max-width",type:c.size,triggersBounds:d.any},{name:"text-outline-width",type:c.size,triggersBounds:d.any},{name:"line-height",type:c.positiveNumber,triggersBounds:d.any}],b=[{name:"text-valign",type:c.valign,triggersBounds:d.any},{name:"text-halign",type:c.halign,triggersBounds:d.any},{name:"color",type:c.color},{name:"text-outline-color",type:c.color},{name:"text-outline-opacity",type:c.zeroOneNumber},{name:"text-background-color",type:c.color},{name:"text-background-opacity",type:c.zeroOneNumber},{name:"text-background-padding",type:c.size,triggersBounds:d.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:d.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:d.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:d.any},{name:"text-justification",type:c.justification},{name:"box-select-labels",type:c.bool,triggersBounds:d.any}],w=[{name:"events",type:c.bool,triggersZOrder:d.any},{name:"text-events",type:c.bool,triggersZOrder:d.any},{name:"box-selection",type:c.boxSelection,triggersZOrder:d.any}],x=[{name:"display",type:c.display,triggersZOrder:d.any,triggersBounds:d.any,triggersBoundsOfConnectedEdges:d.any,triggersBoundsOfParallelEdges:function(re,le,pe){return re===le?!1:pe.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:c.visibility,triggersZOrder:d.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:d.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:d.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:d.any},{name:"z-index",type:c.number,triggersZOrder:d.any}],S=[{name:"overlay-padding",type:c.size,triggersBounds:d.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:d.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:d.any},{name:"overlay-corner-radius",type:c.cornerRadius}],T=[{name:"underlay-padding",type:c.size,triggersBounds:d.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:d.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:d.any},{name:"underlay-corner-radius",type:c.cornerRadius}],C=[{name:"transition-property",type:c.propList},{name:"transition-duration",type:c.time},{name:"transition-delay",type:c.time},{name:"transition-timing-function",type:c.easing}],D=function(re,le){return le.value==="label"?-re.poolIndex():le.pfValue},R=[{name:"height",type:c.nodeSize,triggersBounds:d.any,hashOverride:D},{name:"width",type:c.nodeSize,triggersBounds:d.any,hashOverride:D},{name:"shape",type:c.nodeShape,triggersBounds:d.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:d.any},{name:"corner-radius",type:c.cornerRadius},{name:"background-color",type:c.color},{name:"background-fill",type:c.fill},{name:"background-opacity",type:c.zeroOneNumber},{name:"background-blacken",type:c.nOneOneNumber},{name:"background-gradient-stop-colors",type:c.colors},{name:"background-gradient-stop-positions",type:c.percentages},{name:"background-gradient-direction",type:c.gradientDirection},{name:"padding",type:c.sizeMaybePercent,triggersBounds:d.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:d.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:d.any}],z=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:d.any},{name:"border-style",type:c.borderStyle},{name:"border-cap",type:c.lineCap},{name:"border-join",type:c.lineJoin},{name:"border-dash-pattern",type:c.numbers},{name:"border-dash-offset",type:c.number},{name:"border-position",type:c.linePosition}],B=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:d.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:d.any}],O=[{name:"background-image",type:c.urls},{name:"background-image-crossorigin",type:c.bgCrossOrigin},{name:"background-image-opacity",type:c.zeroOneNumbers},{name:"background-image-containment",type:c.bgContainment},{name:"background-image-smoothing",type:c.bools},{name:"background-position-x",type:c.bgPos},{name:"background-position-y",type:c.bgPos},{name:"background-width-relative-to",type:c.bgRelativeTo},{name:"background-height-relative-to",type:c.bgRelativeTo},{name:"background-repeat",type:c.bgRepeat},{name:"background-fit",type:c.bgFit},{name:"background-clip",type:c.bgClip},{name:"background-width",type:c.bgWH},{name:"background-height",type:c.bgWH},{name:"background-offset-x",type:c.bgPos},{name:"background-offset-y",type:c.bgPos}],_=[{name:"position",type:c.position,triggersBounds:d.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:d.any},{name:"min-width",type:c.size,triggersBounds:d.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:d.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:d.any},{name:"min-height",type:c.size,triggersBounds:d.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:d.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:d.any}],U=[{name:"line-style",type:c.lineStyle},{name:"line-color",type:c.color},{name:"line-fill",type:c.fill},{name:"line-cap",type:c.lineCap},{name:"line-opacity",type:c.zeroOneNumber},{name:"line-dash-pattern",type:c.numbers},{name:"line-dash-offset",type:c.number},{name:"line-outline-width",type:c.size},{name:"line-outline-color",type:c.color},{name:"line-gradient-stop-colors",type:c.colors},{name:"line-gradient-stop-positions",type:c.percentages},{name:"curve-style",type:c.curveStyle,triggersBounds:d.any,triggersBoundsOfParallelEdges:function(re,le){return re===le?!1:re==="bezier"||le==="bezier"}},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:d.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:d.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:d.any},{name:"control-point-step-size",type:c.size,triggersBounds:d.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:d.any},{name:"control-point-weights",type:c.numbers,triggersBounds:d.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:d.any},{name:"segment-weights",type:c.numbers,triggersBounds:d.any},{name:"segment-radii",type:c.numbers,triggersBounds:d.any},{name:"radius-type",type:c.radiusType,triggersBounds:d.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:d.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:d.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:d.any},{name:"taxi-radius",type:c.number,triggersBounds:d.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:d.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:d.any},{name:"loop-direction",type:c.angle,triggersBounds:d.any},{name:"loop-sweep",type:c.angle,triggersBounds:d.any},{name:"source-distance-from-node",type:c.size,triggersBounds:d.any},{name:"target-distance-from-node",type:c.size,triggersBounds:d.any}],V=[{name:"ghost",type:c.bool,triggersBounds:d.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:d.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:d.any},{name:"ghost-opacity",type:c.zeroOneNumber}],q=[{name:"selection-box-color",type:c.color},{name:"selection-box-opacity",type:c.zeroOneNumber},{name:"selection-box-border-color",type:c.color},{name:"selection-box-border-width",type:c.size},{name:"active-bg-color",type:c.color},{name:"active-bg-opacity",type:c.zeroOneNumber},{name:"active-bg-size",type:c.size},{name:"outside-texture-bg-color",type:c.color},{name:"outside-texture-bg-opacity",type:c.zeroOneNumber}],P=[];ta.pieBackgroundN=16,P.push({name:"pie-size",type:c.sizeMaybePercent}),P.push({name:"pie-hole",type:c.sizeMaybePercent}),P.push({name:"pie-start-angle",type:c.angle});for(var Y=1;Y<=ta.pieBackgroundN;Y++)P.push({name:"pie-"+Y+"-background-color",type:c.color}),P.push({name:"pie-"+Y+"-background-size",type:c.percent}),P.push({name:"pie-"+Y+"-background-opacity",type:c.zeroOneNumber});var I=[];ta.stripeBackgroundN=16,I.push({name:"stripe-size",type:c.sizeMaybePercent}),I.push({name:"stripe-direction",type:c.axisDirectionPrimary});for(var L=1;L<=ta.stripeBackgroundN;L++)I.push({name:"stripe-"+L+"-background-color",type:c.color}),I.push({name:"stripe-"+L+"-background-size",type:c.percent}),I.push({name:"stripe-"+L+"-background-opacity",type:c.zeroOneNumber});var H=[],F=ta.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:d.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function($){F.forEach(function(re){var le=re+"-"+$.name,pe=$.type,j=$.triggersBounds;H.push({name:le,type:pe,triggersBounds:j})})},{});var Q=ta.properties=[].concat(w,C,x,S,T,V,b,E,h,g,y,R,z,B,O,P,I,_,U,H,q),J=ta.propertyGroups={behavior:w,transition:C,visibility:x,overlay:S,underlay:T,ghost:V,commonLabel:b,labelDimensions:E,mainLabel:h,sourceLabel:g,targetLabel:y,nodeBody:R,nodeBorder:z,nodeOutline:B,backgroundImage:O,pie:P,stripe:I,compound:_,edgeLine:U,edgeArrow:H,core:q},M=ta.propertyGroupNames={},G=ta.propertyGroupKeys=Object.keys(J);G.forEach(function($){M[$]=J[$].map(function(re){return re.name}),J[$].forEach(function(re){return re.groupKey=$})});var Z=ta.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"}];ta.propertyNames=Q.map(function($){return $.name});for(var W=0;W<Q.length;W++){var ae=Q[W];Q[ae.name]=ae}for(var se=0;se<Z.length;se++){var he=Z[se],we=Q[he.pointsTo],de={name:he.name,alias:!0,pointsTo:we};Q.push(de),Q[he.name]=de}})();ta.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};ta.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(d,c){for(var h=1;h<=ta.pieBackgroundN;h++){var g=c.name.replace("{{i}}",h),y=c.value;d[g]=y}return d},{}),{"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(d,c){for(var h=1;h<=ta.stripeBackgroundN;h++){var g=c.name.replace("{{i}}",h),y=c.value;d[g]=y}return d},{}),{"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(d,c){return ta.arrowPrefixes.forEach(function(h){var g=h+"-"+c.name,y=c.value;d[g]=y}),d},{})),a={},n=0;n<this.properties.length;n++){var l=this.properties[n];if(!l.pointsTo){var u=l.name,o=e[u],f=this.parse(u,o);a[u]=f}}return t.defaultProperties=a,t.defaultProperties};ta.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 Cf={};Cf.parse=function(t,e,a,n){var l=this;if(Pt(e))return l.parseImplWarn(t,e,a,n);var u=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=a?"t":"f",f=""+e,d=W1(t,f,o,u),c=l.propCache=l.propCache||[],h;return(h=c[d])||(h=c[d]=l.parseImplWarn(t,e,a,n)),(a||n==="mapping")&&(h=Or(h),h&&(h.value=Or(h.value))),h};Cf.parseImplWarn=function(t,e,a,n){var l=this.parseImpl(t,e,a,n);return!l&&e!=null&&Et("The style property `".concat(t,": ").concat(e,"` is invalid")),l&&(l.name==="width"||l.name==="height")&&e==="label"&&Et("The style value of `label` is deprecated for `"+l.name+"`"),l};Cf.parseImpl=function(t,e,a,n){var l=this;t=Yh(t);var u=l.properties[t],o=e,f=l.types;if(!u||e===void 0)return null;u.alias&&(u=u.pointsTo,t=u.name);var d=Ge(e);d&&(e=e.trim());var c=u.type;if(!c)return null;if(a&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Pt(e))return{name:t,value:e,strValue:"fn",mapped:f.fn,bypass:a};var h,g;if(!(!d||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(h=new RegExp(f.data.regex).exec(e))){if(a)return!1;var y=f.data;return{name:t,value:h,strValue:""+e,mapped:y,field:h[1],bypass:a}}else if(e.length>=10&&e[0]==="m"&&(g=new RegExp(f.mapData.regex).exec(e))){if(a||c.multiple)return!1;var E=f.mapData;if(!(c.color||c.number))return!1;var b=this.parse(t,g[4]);if(!b||b.mapped)return!1;var w=this.parse(t,g[5]);if(!w||w.mapped)return!1;if(b.pfValue===w.pfValue||b.strValue===w.strValue)return Et("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+b.strValue+"`"),this.parse(t,b.strValue);if(c.color){var x=b.value,S=w.value,T=x[0]===S[0]&&x[1]===S[1]&&x[2]===S[2]&&(x[3]===S[3]||(x[3]==null||x[3]===1)&&(S[3]==null||S[3]===1));if(T)return!1}return{name:t,value:g,strValue:""+e,mapped:E,field:g[1],fieldMin:parseFloat(g[2]),fieldMax:parseFloat(g[3]),valueMin:b.value,valueMax:w.value,bypass:a}}}if(c.multiple&&n!=="multiple"){var C;if(d?C=e.split(/\s+/):Mt(e)?C=e:C=[e],c.evenMultiple&&C.length%2!==0)return null;for(var D=[],R=[],z=[],B="",O=!1,_=0;_<C.length;_++){var U=l.parse(t,C[_],a,"multiple");O=O||Ge(U.value),D.push(U.value),z.push(U.pfValue!=null?U.pfValue:U.value),R.push(U.units),B+=(_>0?" ":"")+U.strValue}return c.validate&&!c.validate(D,R)?null:c.singleEnum&&O?D.length===1&&Ge(D[0])?{name:t,value:D[0],strValue:D[0],bypass:a}:null:{name:t,value:D,pfValue:z,strValue:B,bypass:a,units:R}}var V=function(){for(var de=0;de<c.enums.length;de++){var $=c.enums[de];if($===e)return{name:t,value:e,strValue:""+e,bypass:a}}return null};if(c.number){var q,P="px";if(c.units&&(q=c.units),c.implicitUnits&&(P=c.implicitUnits),!c.unitless)if(d){var Y="px|em"+(c.allowPercent?"|\\%":"");q&&(Y=q);var I=e.match("^("+la+")("+Y+")?$");I&&(e=I[1],q=I[2]||P)}else(!q||c.implicitUnits)&&(q=P);if(e=parseFloat(e),isNaN(e)&&c.enums===void 0)return null;if(isNaN(e)&&c.enums!==void 0)return e=o,V();if(c.integer&&!iw(e)||c.min!==void 0&&(e<c.min||c.strictMin&&e===c.min)||c.max!==void 0&&(e>c.max||c.strictMax&&e===c.max))return null;var L={name:t,value:e,strValue:""+e+(q||""),units:q,bypass:a};return c.unitless||q!=="px"&&q!=="em"?L.pfValue=e:L.pfValue=q==="px"||!q?e:this.getEmSizeInPixels()*e,(q==="ms"||q==="s")&&(L.pfValue=q==="ms"?e:1e3*e),(q==="deg"||q==="rad")&&(L.pfValue=q==="rad"?e:gT(e)),q==="%"&&(L.pfValue=e/100),L}else if(c.propList){var H=[],F=""+e;if(F!=="none"){for(var Q=F.split(/\s*,\s*|\s+/),J=0;J<Q.length;J++){var M=Q[J].trim();l.properties[M]?H.push(M):Et("`"+M+"` is not a valid property name")}if(H.length===0)return null}return{name:t,value:H,strValue:H.length===0?"none":H.join(" "),bypass:a}}else if(c.color){var G=I1(e);return G?{name:t,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:a}:null}else if(c.regex||c.regexes){if(c.enums){var Z=V();if(Z)return Z}for(var W=c.regexes?c.regexes:[c.regex],ae=0;ae<W.length;ae++){var se=new RegExp(W[ae]),he=se.exec(e);if(he)return{name:t,value:c.singleRegexMatchValue?he[1]:he,strValue:""+e,bypass:a}}return null}else return c.string?{name:t,value:""+e,strValue:""+e,bypass:a}:c.enums?V():null};var pa=function(e){if(!(this instanceof pa))return new pa(e);if(!Gh(e)){qt("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},za=pa.prototype;za.instanceString=function(){return"style"};za.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};za.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};za.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};za.selector=function(t){var e=t==="core"?null:new Xn(t),a=this.length++;return this[a]={selector:e,properties:[],mappedProperties:[],index:a},this};za.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[cf(l.name)]),u!==void 0&&this.cssRule(l.name,u)}else e.length===2&&this.cssRule(e[0],e[1]);return this};za.style=za.css;za.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};za.append=function(t){return G1(t)?t.appendToStyle(this):Mt(t)?this.appendFromJson(t):Ge(t)&&this.appendFromString(t),this};pa.fromJson=function(t,e){var a=new pa(t);return a.fromJson(e),a};pa.fromString=function(t,e){return new pa(t).fromString(e)};[ya,us,ng,Nr,Tf,ig,ta,Cf].forEach(function(t){Fe(za,t)});pa.types=za.types;pa.properties=za.properties;pa.propertyGroups=za.propertyGroups;pa.propertyGroupNames=za.propertyGroupNames;pa.propertyGroupKeys=za.propertyGroupKeys;var bD={style:function(e){if(e){var a=this.setStyle(e);a.update()}return this._private.style},setStyle:function(e){var a=this._private;return G1(e)?a.style=e.generateStyle(this):Mt(e)?a.style=pa.fromJson(this,e):Ge(e)?a.style=pa.fromString(this,e):a.style=pa(this),a.style},updateStyle:function(){this.mutableElements().updateStyle()}},ED="single",Bi={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=ED),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,f;switch(e.length){case 0:return a;case 1:if(Ge(e[0]))return n=e[0],a[n];if(vt(e[0])){if(!this._private.panningEnabled)return this;u=e[0],o=u.x,f=u.y,Te(o)&&(a.x=o),Te(f)&&(a.y=f),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],l=e[1],(n==="x"||n==="y")&&Te(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,f,d,c;if(!this._private.panningEnabled)return this;switch(n.length){case 1:vt(e)&&(f=n[0],d=f.x,c=f.y,Te(d)&&(l.x+=d),Te(c)&&(l.y+=c),this.emit("pan viewport"));break;case 2:u=e,o=a,(u==="x"||u==="y")&&Te(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(Te(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(sw(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 ar(e)||(e=this.mutableElements());if(!(ar(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),f=this.height(),d;if(a=Te(a)?a:0,!isNaN(o)&&!isNaN(f)&&o>0&&f>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){d=Math.min((o-2*a)/n.w,(f-2*a)/n.h),d=d>this._private.maxZoom?this._private.maxZoom:d,d=d<this._private.minZoom?this._private.minZoom:d;var c={x:(o-d*(n.x1+n.x2))/2,y:(f-d*(n.y1+n.y2))/2};return{zoom:d,pan:c}}}}},zoomRange:function(e,a){var n=this._private;if(a==null){var l=e;e=l.min,a=l.max}return Te(e)&&Te(a)&&e<=a?(n.minZoom=e,n.maxZoom=a):Te(e)&&a===void 0&&e<=n.maxZoom?n.minZoom=e:Te(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,f=!1;if(a.zoomingEnabled||(f=!0),Te(e)?o=e:vt(e)&&(o=e.level,e.position!=null?u=hf(e.position,l,n):e.renderedPosition!=null&&(u=e.renderedPosition),u!=null&&!a.panningEnabled&&(f=!0)),o=o>a.maxZoom?a.maxZoom:o,o=o<a.minZoom?a.minZoom:o,f||!Te(o)||o===l||u!=null&&(!Te(u.x)||!Te(u.y)))return null;if(u!=null){var d=n,c=l,h=o,g={x:-h/c*(u.x-d.x)+u.x,y:-h/c*(u.y-d.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,f=!1;if(!e)return this;if(Te(e.zoom)||(n=!1),vt(e.pan)||(l=!1),!n&&!l)return this;if(n){var d=e.zoom;d<a.minZoom||d>a.maxZoom||!a.zoomingEnabled?o=!0:(a.zoom=d,u.push("zoom"))}if(l&&(!o||!e.cancelOnFailedZoom)&&a.panningEnabled){var c=e.pan;Te(c.x)&&(a.pan.x=c.x,f=!1),Te(c.y)&&(a.pan.y=c.y,f=!1),f||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 ar(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 f={x:(u-a*(l.x1+l.x2))/2,y:(o-a*(l.y1+l.y2))/2};return f}}},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(f){return parseFloat(l.getPropertyValue(f))};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}};Bi.centre=Bi.center;Bi.autolockNodes=Bi.autolock;Bi.autoungrabifyNodes=Bi.autoungrabify;var Qu={data:bt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:bt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:bt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:bt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Qu.attr=Qu.data;Qu.removeAttr=Qu.removeData;var Ju=function(e){var a=this;e=Fe({},e);var n=e.container;n&&!Jo(n)&&Jo(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=ia!==void 0&&n!==void 0&&!e.headless,f=e;f.layout=Fe({name:o?"grid":"null"},f.layout),f.renderer=Fe({name:o?"canvas":"null"},f.renderer);var d=function(b,w,x){return w!==void 0?w:x!==void 0?x:b},c=this._private={container:n,ready:!1,options:f,elements:new Ta(this),listeners:[],aniEles:new Ta(this),data:f.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:d(!0,f.zoomingEnabled),userZoomingEnabled:d(!0,f.userZoomingEnabled),panningEnabled:d(!0,f.panningEnabled),userPanningEnabled:d(!0,f.userPanningEnabled),boxSelectionEnabled:d(!0,f.boxSelectionEnabled),autolock:d(!1,f.autolock,f.autolockNodes),autoungrabify:d(!1,f.autoungrabify,f.autoungrabifyNodes),autounselectify:d(!1,f.autounselectify),styleEnabled:f.styleEnabled===void 0?o:f.styleEnabled,zoom:Te(f.zoom)?f.zoom:1,pan:{x:vt(f.pan)&&Te(f.pan.x)?f.pan.x:0,y:vt(f.pan)&&Te(f.pan.y)?f.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:d(250,f.multiClickDebounceTime)};this.createEmitter(),this.selectionType(f.selectionType),this.zoomRange({min:f.minZoom,max:f.maxZoom});var h=function(b,w){var x=b.some(ow);if(x)return Ll.all(b).then(w);w(b)};c.styleEnabled&&a.setStyle([]);var g=Fe({},f,f.renderer);a.initRenderer(g);var y=function(b,w,x){a.notifications(!1);var S=a.mutableElements();S.length>0&&S.remove(),b!=null&&(vt(b)||Mt(b))&&a.add(b),a.one("layoutready",function(C){a.notifications(!0),a.emit(C),a.one("load",w),a.emitAndNotify("load")}).one("layoutstop",function(){a.one("done",x),a.emit("done")});var T=Fe({},a._private.options.layout);T.eles=a.elements(),a.layout(T).run()};h([f.style,f.elements],function(E){var b=E[0],w=E[1];c.styleEnabled&&a.style().append(b),y(w,function(){a.startAnimationLoop(),c.ready=!0,Pt(f.ready)&&a.on("ready",f.ready);for(var x=0;x<u.length;x++){var S=u[x];a.on("ready",S)}l&&(l.readies=[]),a.emit("ready")},f.done)})},nf=Ju.prototype;Fe(nf,{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 ia;var a=this._private.container.ownerDocument;return a===void 0||a==null?ia:a.defaultView||ia},mount:function(e){if(e!=null){var a=this,n=a._private,l=n.options;return!Jo(e)&&Jo(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(D){return a.getElementById(D.id())};if(vt(e)){if(a.startBatch(),e.elements){var o={},f=function(D,R){for(var z=[],B=[],O=0;O<D.length;O++){var _=D[O];if(!_.data.id){Et("cy.json() cannot handle elements without an ID attribute");continue}var U=""+_.data.id,V=a.getElementById(U);o[U]=!0,V.length!==0?B.push({ele:V,json:_}):(R&&(_.group=R),z.push(_))}a.add(z);for(var q=0;q<B.length;q++){var P=B[q],Y=P.ele,I=P.json;Y.json(I)}};if(Mt(e.elements))f(e.elements);else for(var d=["nodes","edges"],c=0;c<d.length;c++){var h=d[c],g=e.elements[h];Mt(g)&&f(g,h)}var y=a.collection();l.filter(function(C){return!o[C.id()]}).forEach(function(C){C.isParent()?y.merge(C):C.remove()}),y.forEach(function(C){return C.children().move({parent:null})}),y.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 E=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],b=0;b<E.length;b++){var w=E[b];e[w]!=null&&a[w](e[w])}return a.endBatch(),this}else{var x=!!e,S={};x?S.elements=this.elements().map(function(C){return C.json()}):(S.elements={},l.forEach(function(C){var D=C.group();S.elements[D]||(S.elements[D]=[]),S.elements[D].push(C.json())})),this._private.styleEnabled&&(S.style=a.style().json()),S.data=Or(a.data());var T=n.options;return S.zoomingEnabled=n.zoomingEnabled,S.userZoomingEnabled=n.userZoomingEnabled,S.zoom=n.zoom,S.minZoom=n.minZoom,S.maxZoom=n.maxZoom,S.panningEnabled=n.panningEnabled,S.userPanningEnabled=n.userPanningEnabled,S.pan=Or(n.pan),S.boxSelectionEnabled=n.boxSelectionEnabled,S.renderer=Or(T.renderer),S.hideEdgesOnViewport=T.hideEdgesOnViewport,S.textureOnViewport=T.textureOnViewport,S.wheelSensitivity=T.wheelSensitivity,S.motionBlur=T.motionBlur,S.multiClickDebounceTime=T.multiClickDebounceTime,S}}});nf.$id=nf.getElementById;[oD,hD,G2,Mh,Io,pD,Rh,Xo,bD,Bi,Qu].forEach(function(t){Fe(nf,t)});var xD={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}},SD={maximal:!1,acyclic:!1},yl=function(e){return e.scratch("breadthfirst")},i1=function(e,a){return e.scratch("breadthfirst",a)};function Y2(t){this.options=Fe({},xD,SD,t)}Y2.prototype.run=function(){var t=this.options,e=t.cy,a=t.eles,n=a.nodes().filter(function(Ae){return Ae.isChildless()}),l=a,u=t.directed,o=t.acyclic||t.maximal||t.maximalAdjustments>0,f=!!t.boundingBox,d=ka(f?t.boundingBox:structuredClone(e.extent())),c;if(ar(t.roots))c=t.roots;else if(Mt(t.roots)){for(var h=[],g=0;g<t.roots.length;g++){var y=t.roots[g],E=e.getElementById(y);h.push(E)}c=e.collection(h)}else if(Ge(t.roots))c=e.$(t.roots);else if(u)c=n.roots();else{var b=a.components();c=e.collection();for(var w=function(){var Ce=b[x],_e=Ce.maxDegree(!1),He=Ce.filter(function(je){return je.degree(!1)===_e});c=c.add(He)},x=0;x<b.length;x++)w()}var S=[],T={},C=function(Ce,_e){S[_e]==null&&(S[_e]=[]);var He=S[_e].length;S[_e].push(Ce),i1(Ce,{index:He,depth:_e})},D=function(Ce,_e){var He=yl(Ce),je=He.depth,De=He.index;S[je][De]=null,Ce.isChildless()&&C(Ce,_e)};l.bfs({roots:c,directed:t.directed,visit:function(Ce,_e,He,je,De){var We=Ce[0],rt=We.id();We.isChildless()&&C(We,De),T[rt]=!0}});for(var R=[],z=0;z<n.length;z++){var B=n[z];T[B.id()]||R.push(B)}var O=function(Ce){for(var _e=S[Ce],He=0;He<_e.length;He++){var je=_e[He];if(je==null){_e.splice(He,1),He--;continue}i1(je,{depth:Ce,index:He})}},_=function(Ce,_e){for(var He=yl(Ce),je=Ce.incomers().filter(function(Xe){return Xe.isNode()&&a.has(Xe)}),De=-1,We=Ce.id(),rt=0;rt<je.length;rt++){var ft=je[rt],st=yl(ft);De=Math.max(De,st.depth)}if(He.depth<=De){if(!t.acyclic&&_e[We])return null;var dt=De+1;return D(Ce,dt),_e[We]=dt,!0}return!1};if(u&&o){var U=[],V={},q=function(Ce){return U.push(Ce)},P=function(){return U.shift()};for(n.forEach(function(Ae){return U.push(Ae)});U.length>0;){var Y=P(),I=_(Y,V);if(I)Y.outgoers().filter(function(Ae){return Ae.isNode()&&a.has(Ae)}).forEach(q);else if(I===null){Et("Detected double maximal shift for node `"+Y.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var L=0;if(t.avoidOverlap)for(var H=0;H<n.length;H++){var F=n[H],Q=F.layoutDimensions(t),J=Q.w,M=Q.h;L=Math.max(L,J,M)}var G={},Z=function(Ce){if(G[Ce.id()])return G[Ce.id()];for(var _e=yl(Ce).depth,He=Ce.neighborhood(),je=0,De=0,We=0;We<He.length;We++){var rt=He[We];if(!(rt.isEdge()||rt.isParent()||!n.has(rt))){var ft=yl(rt);if(ft!=null){var st=ft.index,dt=ft.depth;if(!(st==null||dt==null)){var Xe=S[dt].length;dt<_e&&(je+=st/Xe,De++)}}}}return De=Math.max(1,De),je=je/De,De===0&&(je=0),G[Ce.id()]=je,je},W=function(Ce,_e){var He=Z(Ce),je=Z(_e),De=He-je;return De===0?F1(Ce.id(),_e.id()):De};t.depthSort!==void 0&&(W=t.depthSort);for(var ae=S.length,se=0;se<ae;se++)S[se].sort(W),O(se);for(var he=[],we=0;we<R.length;we++)he.push(R[we]);var de=function(){for(var Ce=0;Ce<ae;Ce++)O(Ce)};he.length&&(S.unshift(he),ae=S.length,de());for(var $=0,re=0;re<ae;re++)$=Math.max(S[re].length,$);var le={x:d.x1+d.w/2,y:d.y1+d.h/2},pe=n.reduce(function(Ae,Ce){return(function(_e){return{w:Ae.w===-1?_e.w:(Ae.w+_e.w)/2,h:Ae.h===-1?_e.h:(Ae.h+_e.h)/2}})(Ce.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),j=Math.max(ae===1?0:f?(d.h-t.padding*2-pe.h)/(ae-1):(d.h-t.padding*2-pe.h)/(ae+1),L),xe=S.reduce(function(Ae,Ce){return Math.max(Ae,Ce.length)},0),Be=function(Ce){var _e=yl(Ce),He=_e.depth,je=_e.index;if(t.circle){var De=Math.min(d.w/2/ae,d.h/2/ae);De=Math.max(De,L);var We=De*He+De-(ae>0&&S[0].length<=3?De/2:0),rt=2*Math.PI/S[He].length*je;return He===0&&S[0].length===1&&(We=1),{x:le.x+We*Math.cos(rt),y:le.y+We*Math.sin(rt)}}else{var ft=S[He].length,st=Math.max(ft===1?0:f?(d.w-t.padding*2-pe.w)/((t.grid?xe:ft)-1):(d.w-t.padding*2-pe.w)/((t.grid?xe:ft)+1),L),dt={x:le.x+(je+1-(ft+1)/2)*st,y:le.y+(He+1-(ae+1)/2)*j};return dt}},Ue={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ue).indexOf(t.direction)===-1&&qt("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ue).join(", ")));var Ve=function(Ce){return Vw(Be(Ce),d,Ue[t.direction])};return a.nodes().layoutPositions(this,t,Ve),this};var wD={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 F2(t){this.options=Fe({},wD,t)}F2.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=ka(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),f={x:o.x1+o.w/2,y:o.y1+o.h/2},d=e.sweep===void 0?2*Math.PI-2*Math.PI/u.length:e.sweep,c=d/Math.max(1,u.length-1),h,g=0,y=0;y<u.length;y++){var E=u[y],b=E.layoutDimensions(e),w=b.w,x=b.h;g=Math.max(g,w,x)}if(Te(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 S=Math.cos(c)-Math.cos(0),T=Math.sin(c)-Math.sin(0),C=Math.sqrt(g*g/(S*S+T*T));h=Math.max(C,h)}var D=function(z,B){var O=e.startAngle+B*c*(l?1:-1),_=h*Math.cos(O),U=h*Math.sin(O),V={x:f.x+_,y:f.y+U};return V};return n.nodes().layoutPositions(this,e,D),this};var TD={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 I2(t){this.options=Fe({},TD,t)}I2.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=ka(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),f={x:o.x1+o.w/2,y:o.y1+o.h/2},d=[],c=0,h=0;h<u.length;h++){var g=u[h],y=void 0;y=e.concentric(g),d.push({value:y,node:g}),g._private.scratch.concentric=y}u.updateStyle();for(var E=0;E<u.length;E++){var b=u[E],w=b.layoutDimensions(e);c=Math.max(c,w.w,w.h)}d.sort(function(j,xe){return xe.value-j.value});for(var x=e.levelWidth(u),S=[[]],T=S[0],C=0;C<d.length;C++){var D=d[C];if(T.length>0){var R=Math.abs(T[0].value-D.value);R>=x&&(T=[],S.push(T))}T.push(D)}var z=c+e.minNodeSpacing;if(!e.avoidOverlap){var B=S.length>0&&S[0].length>1,O=Math.min(o.w,o.h)/2-z,_=O/(S.length+B?1:0);z=Math.min(z,_)}for(var U=0,V=0;V<S.length;V++){var q=S[V],P=e.sweep===void 0?2*Math.PI-2*Math.PI/q.length:e.sweep,Y=q.dTheta=P/Math.max(1,q.length-1);if(q.length>1&&e.avoidOverlap){var I=Math.cos(Y)-Math.cos(0),L=Math.sin(Y)-Math.sin(0),H=Math.sqrt(z*z/(I*I+L*L));U=Math.max(H,U)}q.r=U,U+=z}if(e.equidistant){for(var F=0,Q=0,J=0;J<S.length;J++){var M=S[J],G=M.r-Q;F=Math.max(F,G)}Q=0;for(var Z=0;Z<S.length;Z++){var W=S[Z];Z===0&&(Q=W.r),W.r=Q,Q+=F}}for(var ae={},se=0;se<S.length;se++)for(var he=S[se],we=he.dTheta,de=he.r,$=0;$<he.length;$++){var re=he[$],le=e.startAngle+(a?1:-1)*we*$,pe={x:f.x+de*Math.cos(le),y:f.y+de*Math.sin(le)};ae[re.node.id()]=pe}return l.nodes().layoutPositions(this,e,function(j){var xe=j.id();return ae[xe]}),this};var fh,CD={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 Af(t){this.options=Fe({},CD,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"),f=e.some(function(c){return c.data("id")===u}),d=e.some(function(c){return c.data("id")===o});return!f||!d});this.options.eles=this.options.eles.not(n)}Af.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?fh=!0:fh=!1;var n=AD(e,a,t);fh&&BD(n),t.randomize&&MD(n);var l=an(),u=function(){RD(n,e,t),t.fit===!0&&e.fit(t.padding)},o=function(y){return!(a.stopped||y>=t.numIter||(zD(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},f=function(){if(t.animate===!0||t.animate===!1)u(),a.one("layoutstop",t.stop),a.emit({type:"layoutstop",layout:a});else{var y=t.eles.nodes(),E=j2(n,t,y);y.layoutPositions(a,t,E)}},d=0,c=!0;if(t.animate===!0){var h=function(){for(var y=0;c&&y<t.refresh;)c=o(d),d++,y++;if(!c)u1(n,t),f();else{var E=an();E-l>=t.animationThreshold&&u(),Wo(h)}};h()}else{for(;c;)c=o(d),d++;u1(n,t),f()}return this};Af.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Af.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var AD=function(e,a,n){for(var l=n.eles.edges(),u=n.eles.nodes(),o=ka(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),f={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},d=n.eles.components(),c={},h=0;h<d.length;h++)for(var g=d[h],y=0;y<g.length;y++){var E=g[y];c[E.id()]=h}for(var h=0;h<f.nodeSize;h++){var b=u[h],w=b.layoutDimensions(n),x={};x.isLocked=b.locked(),x.id=b.data("id"),x.parentId=b.data("parent"),x.cmptId=c[b.id()],x.children=[],x.positionX=b.position("x"),x.positionY=b.position("y"),x.offsetX=0,x.offsetY=0,x.height=w.w,x.width=w.h,x.maxX=x.positionX+x.width/2,x.minX=x.positionX-x.width/2,x.maxY=x.positionY+x.height/2,x.minY=x.positionY-x.height/2,x.padLeft=parseFloat(b.style("padding")),x.padRight=parseFloat(b.style("padding")),x.padTop=parseFloat(b.style("padding")),x.padBottom=parseFloat(b.style("padding")),x.nodeRepulsion=Pt(n.nodeRepulsion)?n.nodeRepulsion(b):n.nodeRepulsion,f.layoutNodes.push(x),f.idToIndex[x.id]=h}for(var S=[],T=0,C=-1,D=[],h=0;h<f.nodeSize;h++){var b=f.layoutNodes[h],R=b.parentId;R!=null?f.layoutNodes[f.idToIndex[R]].children.push(b.id):(S[++C]=b.id,D.push(b.id))}for(f.graphSet.push(D);T<=C;){var z=S[T++],B=f.idToIndex[z],E=f.layoutNodes[B],O=E.children;if(O.length>0){f.graphSet.push(O);for(var h=0;h<O.length;h++)S[++C]=O[h]}}for(var h=0;h<f.graphSet.length;h++)for(var _=f.graphSet[h],y=0;y<_.length;y++){var U=f.idToIndex[_[y]];f.indexToGraph[U]=h}for(var h=0;h<f.edgeSize;h++){var V=l[h],q={};q.id=V.data("id"),q.sourceId=V.data("source"),q.targetId=V.data("target");var P=Pt(n.idealEdgeLength)?n.idealEdgeLength(V):n.idealEdgeLength,Y=Pt(n.edgeElasticity)?n.edgeElasticity(V):n.edgeElasticity,I=f.idToIndex[q.sourceId],L=f.idToIndex[q.targetId],H=f.indexToGraph[I],F=f.indexToGraph[L];if(H!=F){for(var Q=DD(q.sourceId,q.targetId,f),J=f.graphSet[Q],M=0,x=f.layoutNodes[I];J.indexOf(x.id)===-1;)x=f.layoutNodes[f.idToIndex[x.parentId]],M++;for(x=f.layoutNodes[L];J.indexOf(x.id)===-1;)x=f.layoutNodes[f.idToIndex[x.parentId]],M++;P*=M*n.nestingFactor}q.idealLength=P,q.elasticity=Y,f.layoutEdges.push(q)}return f},DD=function(e,a,n){var l=X2(e,a,0,n);return 2>l.count?0:l.graph},X2=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,f=0;f<u.length;f++){var d=u[f],c=l.idToIndex[d],h=l.layoutNodes[c].children;if(h.length!==0){var g=l.indexToGraph[l.idToIndex[h[0]]],y=X2(e,a,g,l);if(y.count!==0)if(y.count===1){if(o++,o===2)break}else return y}}return{count:o,graph:n}},BD,MD=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)}},j2=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 f=e.layoutNodes[e.idToIndex[o.data("id")]];u.x1=Math.min(u.x1,f.positionX),u.x2=Math.max(u.x2,f.positionX),u.y1=Math.min(u.y1,f.positionY),u.y2=Math.max(u.y2,f.positionY)}),u.w=u.x2-u.x1,u.h=u.y2-u.y1),function(o,f){var d=e.layoutNodes[e.idToIndex[o.data("id")]];if(a.boundingBox){var c=u.w===0?.5:(d.positionX-u.x1)/u.w,h=u.h===0?.5:(d.positionY-u.y1)/u.h;return{x:l.x1+c*l.w,y:l.y1+h*l.h}}else return{x:d.positionX,y:d.positionY}}},RD=function(e,a,n){var l=n.layout,u=n.eles.nodes(),o=j2(e,n,u);u.positions(o),e.ready!==!0&&(e.ready=!0,l.one("layoutready",n.ready),l.emit({type:"layoutready",layout:this}))},zD=function(e,a,n){OD(e,a),kD(e),_D(e,a),qD(e),VD(e)},OD=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 f=e.layoutNodes[e.idToIndex[l[o]]],d=o+1;d<u;d++){var c=e.layoutNodes[e.idToIndex[l[d]]];ND(f,c,e,a)}},l1=function(e){return-1+2*e*Math.random()},ND=function(e,a,n,l){var u=e.cmptId,o=a.cmptId;if(!(u!==o&&!n.isCompound)){var f=a.positionX-e.positionX,d=a.positionY-e.positionY,c=1;f===0&&d===0&&(f=l1(c),d=l1(c));var h=LD(e,a,f,d);if(h>0)var g=l.nodeOverlap*h,y=Math.sqrt(f*f+d*d),E=g*f/y,b=g*d/y;else var w=lf(e,f,d),x=lf(a,-1*f,-1*d),S=x.x-w.x,T=x.y-w.y,C=S*S+T*T,y=Math.sqrt(C),g=(e.nodeRepulsion+a.nodeRepulsion)/C,E=g*S/y,b=g*T/y;e.isLocked||(e.offsetX-=E,e.offsetY-=b),a.isLocked||(a.offsetX+=E,a.offsetY+=b)}},LD=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},lf=function(e,a,n){var l=e.positionX,u=e.positionY,o=e.height||1,f=e.width||1,d=n/a,c=o/f,h={};return a===0&&0<n||a===0&&0>n?(h.x=l,h.y=u+o/2,h):0<a&&-1*c<=d&&d<=c?(h.x=l+f/2,h.y=u+f*n/2/a,h):0>a&&-1*c<=d&&d<=c?(h.x=l-f/2,h.y=u-f*n/2/a,h):0<n&&(d<=-1*c||d>=c)?(h.x=l+o*a/2/n,h.y=u+o/2,h):(0>n&&(d<=-1*c||d>=c)&&(h.x=l-o*a/2/n,h.y=u-o/2),h)},kD=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],f=e.idToIndex[l.targetId],d=e.layoutNodes[f],c=d.positionX-o.positionX,h=d.positionY-o.positionY;if(!(c===0&&h===0)){var g=lf(o,c,h),y=lf(d,-1*c,-1*h),E=y.x-g.x,b=y.y-g.y,w=Math.sqrt(E*E+b*b),x=Math.pow(l.idealLength-w,2)/l.elasticity;if(w!==0)var S=x*E/w,T=x*b/w;else var S=0,T=0;o.isLocked||(o.offsetX+=S,o.offsetY+=T),d.isLocked||(d.offsetX-=S,d.offsetY-=T)}}},_D=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 f=e.clientHeight/2,d=e.clientWidth/2;else var c=e.layoutNodes[e.idToIndex[u[0]]],h=e.layoutNodes[e.idToIndex[c.parentId]],f=h.positionX,d=h.positionY;for(var g=0;g<o;g++){var y=e.layoutNodes[e.idToIndex[u[g]]];if(!y.isLocked){var E=f-y.positionX,b=d-y.positionY,w=Math.sqrt(E*E+b*b);if(w>n){var x=a.gravity*E/w,S=a.gravity*b/w;y.offsetX+=x,y.offsetY+=S}}}}},qD=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++],f=e.idToIndex[o],d=e.layoutNodes[f],c=d.children;if(0<c.length&&!d.isLocked){for(var h=d.offsetX,g=d.offsetY,y=0;y<c.length;y++){var E=e.layoutNodes[e.idToIndex[c[y]]];E.offsetX+=h,E.offsetY+=g,n[++u]=c[y]}d.offsetX=0,d.offsetY=0}}},VD=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=UD(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,K2(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)}},UD=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},K2=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 K2(l,a)}},u1=function(e,a){for(var n=e.layoutNodes,l=[],u=0;u<n.length;u++){var o=n[u],f=o.cmptId,d=l[f]=l[f]||[];d.push(o)}for(var c=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 y=h[g];h.x1=Math.min(h.x1,y.positionX-y.width/2),h.x2=Math.max(h.x2,y.positionX+y.width/2),h.y1=Math.min(h.y1,y.positionY-y.height/2),h.y2=Math.max(h.y2,y.positionY+y.height/2)}h.w=h.x2-h.x1,h.h=h.y2-h.y1,c+=h.w*h.h}}l.sort(function(T,C){return C.w*C.h-T.w*T.h});for(var E=0,b=0,w=0,x=0,S=Math.sqrt(c)*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 y=h[g];y.isLocked||(y.positionX+=E-h.x1,y.positionY+=b-h.y1)}E+=h.w+a.componentSpacing,w+=h.w+a.componentSpacing,x=Math.max(x,h.h),w>S&&(b+=x+a.componentSpacing,E=0,w=0,x=0)}}},HD={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 Z2(t){this.options=Fe({},HD,t)}Z2.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=ka(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(),f=Math.sqrt(o*u.h/u.w),d=Math.round(f),c=Math.round(u.w/u.h*f),h=function(W){if(W==null)return Math.min(d,c);var ae=Math.min(d,c);ae==d?d=W:c=W},g=function(W){if(W==null)return Math.max(d,c);var ae=Math.max(d,c);ae==d?d=W:c=W},y=e.rows,E=e.cols!=null?e.cols:e.columns;if(y!=null&&E!=null)d=y,c=E;else if(y!=null&&E==null)d=y,c=Math.ceil(o/d);else if(y==null&&E!=null)c=E,d=Math.ceil(o/c);else if(c*d>o){var b=h(),w=g();(b-1)*w>=o?h(b-1):(w-1)*b>=o&&g(w-1)}else for(;c*d<o;){var x=h(),S=g();(S+1)*x>=o?g(S+1):h(x+1)}var T=u.w/c,C=u.h/d;if(e.condense&&(T=0,C=0),e.avoidOverlap)for(var D=0;D<l.length;D++){var R=l[D],z=R._private.position;(z.x==null||z.y==null)&&(z.x=0,z.y=0);var B=R.layoutDimensions(e),O=e.avoidOverlapPadding,_=B.w+O,U=B.h+O;T=Math.max(T,_),C=Math.max(C,U)}for(var V={},q=function(W,ae){return!!V["c-"+W+"-"+ae]},P=function(W,ae){V["c-"+W+"-"+ae]=!0},Y=0,I=0,L=function(){I++,I>=c&&(I=0,Y++)},H={},F=0;F<l.length;F++){var Q=l[F],J=e.position(Q);if(J&&(J.row!==void 0||J.col!==void 0)){var M={row:J.row,col:J.col};if(M.col===void 0)for(M.col=0;q(M.row,M.col);)M.col++;else if(M.row===void 0)for(M.row=0;q(M.row,M.col);)M.row++;H[Q.id()]=M,P(M.row,M.col)}}var G=function(W,ae){var se,he;if(W.locked()||W.isParent())return!1;var we=H[W.id()];if(we)se=we.col*T+T/2+u.x1,he=we.row*C+C/2+u.y1;else{for(;q(Y,I);)L();se=I*T+T/2+u.x1,he=Y*C+C/2+u.y1,P(Y,I),L()}return{x:se,y:he}};l.layoutPositions(this,e,G)}return this};var PD={ready:function(){},stop:function(){}};function lg(t){this.options=Fe({},PD,t)}lg.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};lg.prototype.stop=function(){return this};var GD={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 Q2(t){this.options=Fe({},GD,t)}Q2.prototype.run=function(){var t=this.options,e=t.eles,a=e.nodes(),n=Pt(t.positions);function l(u){if(t.positions==null)return fT(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 f=l(u);return u.locked()||f==null?!1:f}),this};var YD={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 J2(t){this.options=Fe({},YD,t)}J2.prototype.run=function(){var t=this.options,e=t.cy,a=t.eles,n=ka(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l=function(o,f){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 FD=[{name:"breadthfirst",impl:Y2},{name:"circle",impl:F2},{name:"concentric",impl:I2},{name:"cose",impl:Af},{name:"grid",impl:Z2},{name:"null",impl:lg},{name:"preset",impl:Q2},{name:"random",impl:J2}];function W2(t){this.options=t,this.notifications=0}var s1=function(){},o1=function(){throw new Error("A headless instance can not render images")};W2.prototype={recalculateRenderedStyle:s1,notify:function(){this.notifications++},init:s1,isHeadless:function(){return!0},png:o1,jpg:o1};var ug={};ug.arrowShapeWidth=.3;ug.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,a=function(c,h,g,y,E,b,w){var x=E.x-g/2-w,S=E.x+g/2+w,T=E.y-g/2-w,C=E.y+g/2+w,D=x<=c&&c<=S&&T<=h&&h<=C;return D},n=function(c,h,g,y,E){var b=c*Math.cos(y)-h*Math.sin(y),w=c*Math.sin(y)+h*Math.cos(y),x=b*g,S=w*g,T=x+E.x,C=S+E.y;return{x:T,y:C}},l=function(c,h,g,y){for(var E=[],b=0;b<c.length;b+=2){var w=c[b],x=c[b+1];E.push(n(w,x,h,g,y))}return E},u=function(c){for(var h=[],g=0;g<c.length;g++){var y=c[g];h.push(y.x,y.y)}return h},o=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},f=function(c,h){Ge(h)&&(h=t[h]),t[c]=Fe({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(y,E,b,w,x,S){var T=u(l(this.points,b+2*S,w,x)),C=Xa(y,E,T);return C},roughCollide:a,draw:function(y,E,b,w){var x=l(this.points,E,b,w);e.arrowShapeImpl("polygon")(y,x)},spacing:function(y){return 0},gap:o},h)};f("none",{collide:$o,roughCollide:$o,draw:Xh,spacing:w0,gap:w0}),f("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),f("arrow","triangle"),f("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:a,draw:function(c,h,g,y,E){var b=l(this.points,h,g,y),w=this.controlPoint,x=n(w[0],w[1],h,g,y);e.arrowShapeImpl(this.name)(c,b,x)},gap:function(c){return o(c)*.8}}),f("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,h,g,y,E,b,w){var x=u(l(this.points,g+2*w,y,E)),S=u(l(this.pointsTee,g+2*w,y,E)),T=Xa(c,h,x)||Xa(c,h,S);return T},draw:function(c,h,g,y,E){var b=l(this.points,h,g,y),w=l(this.pointsTee,h,g,y);e.arrowShapeImpl(this.name)(c,b,w)}}),f("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,h,g,y,E,b,w){var x=E,S=Math.pow(x.x-c,2)+Math.pow(x.y-h,2)<=Math.pow((g+2*w)*this.radius,2),T=u(l(this.points,g+2*w,y,E));return Xa(c,h,T)||S},draw:function(c,h,g,y,E){var b=l(this.pointsTr,h,g,y);e.arrowShapeImpl(this.name)(c,b,y.x,y.y,this.radius*h)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),f("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(c,h){var g=this.baseCrossLinePts.slice(),y=h/c,E=3,b=5;return g[E]=g[E]-y,g[b]=g[b]-y,g},collide:function(c,h,g,y,E,b,w){var x=u(l(this.points,g+2*w,y,E)),S=u(l(this.crossLinePts(g,b),g+2*w,y,E)),T=Xa(c,h,x)||Xa(c,h,S);return T},draw:function(c,h,g,y,E){var b=l(this.points,h,g,y),w=l(this.crossLinePts(h,E),h,g,y);e.arrowShapeImpl(this.name)(c,b,w)}}),f("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return o(c)*.525}}),f("circle",{radius:.15,collide:function(c,h,g,y,E,b,w){var x=E,S=Math.pow(x.x-c,2)+Math.pow(x.y-h,2)<=Math.pow((g+2*w)*this.radius,2);return S},draw:function(c,h,g,y,E){e.arrowShapeImpl(this.name)(c,y.x,y.y,this.radius*h)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),f("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),f("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),f("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),f("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.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],f=a.pan(),d=a.zoom(),c=((t-l)/o-f.x)/d,h=((e-u)/o-f.y)/d;return[c,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(S){return parseFloat(a.getPropertyValue(S))},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,f=t.clientHeight,d=l.left+l.right,c=l.top+l.bottom,h=u.left+u.right,g=e.width/(o+h),y=o-d,E=f-c,b=e.left+l.left+u.left,w=e.top+l.top+u.top;return this.containerBB=[b,w,y,E,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(),f=[],d=u.cy.zoom(),c=u.cy.hasCompoundNodes(),h=(n?24:8)/d,g=(n?8:2)/d,y=(n?8:2)/d,E=1/0,b,w;a&&(o=o.interactive);function x(B,O){if(B.isNode()){if(w)return;w=B,f.push(B)}if(B.isEdge()&&(O==null||O<E))if(b){if(b.pstyle("z-compound-depth").value===B.pstyle("z-compound-depth").value&&b.pstyle("z-compound-depth").value===B.pstyle("z-compound-depth").value){for(var _=0;_<f.length;_++)if(f[_].isEdge()){f[_]=B,b=B,E=O??E;break}}}else f.push(B),b=B,E=O??E}function S(B){var O=B.outerWidth()+2*g,_=B.outerHeight()+2*g,U=O/2,V=_/2,q=B.position(),P=B.pstyle("corner-radius").value==="auto"?"auto":B.pstyle("corner-radius").pfValue,Y=B._private.rscratch;if(q.x-U<=t&&t<=q.x+U&&q.y-V<=e&&e<=q.y+V){var I=u.nodeShapes[l.getNodeShape(B)];if(I.checkPoint(t,e,0,O,_,q.x,q.y,P,Y))return x(B,0),!0}}function T(B){var O=B._private,_=O.rscratch,U=B.pstyle("width").pfValue,V=B.pstyle("arrow-scale").value,q=U/2+h,P=q*q,Y=q*2,F=O.source,Q=O.target,I;if(_.edgeType==="segments"||_.edgeType==="straight"||_.edgeType==="haystack"){for(var L=_.allpts,H=0;H+3<L.length;H+=2)if(TT(t,e,L[H],L[H+1],L[H+2],L[H+3],Y)&&P>(I=MT(t,e,L[H],L[H+1],L[H+2],L[H+3])))return x(B,I),!0}else if(_.edgeType==="bezier"||_.edgeType==="multibezier"||_.edgeType==="self"||_.edgeType==="compound"){for(var L=_.allpts,H=0;H+5<_.allpts.length;H+=4)if(CT(t,e,L[H],L[H+1],L[H+2],L[H+3],L[H+4],L[H+5],Y)&&P>(I=BT(t,e,L[H],L[H+1],L[H+2],L[H+3],L[H+4],L[H+5])))return x(B,I),!0}for(var F=F||O.source,Q=Q||O.target,J=l.getArrowWidth(U,V),M=[{name:"source",x:_.arrowStartX,y:_.arrowStartY,angle:_.srcArrowAngle},{name:"target",x:_.arrowEndX,y:_.arrowEndY,angle:_.tgtArrowAngle},{name:"mid-source",x:_.midX,y:_.midY,angle:_.midsrcArrowAngle},{name:"mid-target",x:_.midX,y:_.midY,angle:_.midtgtArrowAngle}],H=0;H<M.length;H++){var G=M[H],Z=u.arrowShapes[B.pstyle(G.name+"-arrow-shape").value],W=B.pstyle("width").pfValue;if(Z.roughCollide(t,e,J,G.angle,{x:G.x,y:G.y},W,h)&&Z.collide(t,e,J,G.angle,{x:G.x,y:G.y},W,h))return x(B),!0}c&&f.length>0&&(S(F),S(Q))}function C(B,O,_){return Ia(B,O,_)}function D(B,O){var _=B._private,U=y,V;O?V=O+"-":V="",B.boundingBox();var q=_.labelBounds[O||"main"],P=B.pstyle(V+"label").value,Y=B.pstyle("text-events").strValue==="yes";if(!(!Y||!P)){var I=C(_.rscratch,"labelX",O),L=C(_.rscratch,"labelY",O),H=C(_.rscratch,"labelAngle",O),F=B.pstyle(V+"text-margin-x").pfValue,Q=B.pstyle(V+"text-margin-y").pfValue,J=q.x1-U-F,M=q.x2+U-F,G=q.y1-U-Q,Z=q.y2+U-Q;if(H){var W=Math.cos(H),ae=Math.sin(H),se=function(pe,j){return pe=pe-I,j=j-L,{x:pe*W-j*ae+I,y:pe*ae+j*W+L}},he=se(J,G),we=se(J,Z),de=se(M,G),$=se(M,Z),re=[he.x+F,he.y+Q,de.x+F,de.y+Q,$.x+F,$.y+Q,we.x+F,we.y+Q];if(Xa(t,e,re))return x(B),!0}else if(Un(q,t,e))return x(B),!0}}for(var R=o.length-1;R>=0;R--){var z=o[R];z.isNode()?S(z)||D(z):T(z)||D(z)||D(z,"source")||D(z,"target")}return f};zi.getAllInBox=function(t,e,a,n){var l=this.getCachedZSortedEles().interactive,u=this.cy.zoom(),o=2/u,f=[],d=Math.min(t,a),c=Math.max(t,a),h=Math.min(e,n),g=Math.max(e,n);t=d,a=c,e=h,n=g;var y=ka({x1:t,y1:e,x2:a,y2:n}),E=[{x:y.x1,y:y.y1},{x:y.x2,y:y.y1},{x:y.x2,y:y.y2},{x:y.x1,y:y.y2}],b=[[E[0],E[1]],[E[1],E[2]],[E[2],E[3]],[E[3],E[0]]];function w(pe,j,xe){return Ia(pe,j,xe)}function x(pe,j){var xe=pe._private,Be=o,Ue="";pe.boundingBox();var Ve=xe.labelBounds.main;if(!Ve)return null;var Ae=w(xe.rscratch,"labelX",j),Ce=w(xe.rscratch,"labelY",j),_e=w(xe.rscratch,"labelAngle",j),He=pe.pstyle(Ue+"text-margin-x").pfValue,je=pe.pstyle(Ue+"text-margin-y").pfValue,De=Ve.x1-Be-He,We=Ve.x2+Be-He,rt=Ve.y1-Be-je,ft=Ve.y2+Be-je;if(_e){var st=Math.cos(_e),dt=Math.sin(_e),Xe=function(ye,k){return ye=ye-Ae,k=k-Ce,{x:ye*st-k*dt+Ae,y:ye*dt+k*st+Ce}};return[Xe(De,rt),Xe(We,rt),Xe(We,ft),Xe(De,ft)]}else return[{x:De,y:rt},{x:We,y:rt},{x:We,y:ft},{x:De,y:ft}]}function S(pe,j,xe,Be){function Ue(Ve,Ae,Ce){return(Ce.y-Ve.y)*(Ae.x-Ve.x)>(Ae.y-Ve.y)*(Ce.x-Ve.x)}return Ue(pe,xe,Be)!==Ue(j,xe,Be)&&Ue(pe,j,xe)!==Ue(pe,j,Be)}for(var T=0;T<l.length;T++){var C=l[T];if(C.isNode()){var D=C,R=D.pstyle("text-events").strValue==="yes",z=D.pstyle("box-selection").strValue,B=D.pstyle("box-select-labels").strValue==="yes";if(z==="none")continue;var O=(z==="overlap"||B)&&R,_=D.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:O});if(z==="contain"){var U=!1;if(B&&R){var V=x(D);V&&sd(V,E)&&(f.push(D),U=!0)}!U&&i2(y,_)&&f.push(D)}else if(z==="overlap"&&Qh(y,_)){var q=D.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),P=[{x:q.x1,y:q.y1},{x:q.x2,y:q.y1},{x:q.x2,y:q.y2},{x:q.x1,y:q.y2}];if(sd(P,E))f.push(D);else{var Y=x(D);Y&&sd(Y,E)&&f.push(D)}}}else{var I=C,L=I._private,H=L.rscratch,F=I.pstyle("box-selection").strValue;if(F==="none")continue;if(F==="contain"){if(H.startX!=null&&H.startY!=null&&!Un(y,H.startX,H.startY)||H.endX!=null&&H.endY!=null&&!Un(y,H.endX,H.endY))continue;if(H.edgeType==="bezier"||H.edgeType==="multibezier"||H.edgeType==="self"||H.edgeType==="compound"||H.edgeType==="segments"||H.edgeType==="haystack"){for(var Q=L.rstyle.bezierPts||L.rstyle.linePts||L.rstyle.haystackPts,J=!0,M=0;M<Q.length;M++)if(!B0(y,Q[M])){J=!1;break}J&&f.push(I)}else H.edgeType==="straight"&&f.push(I)}else if(F==="overlap"){var G=!1;if(H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(Un(y,H.startX,H.startY)||Un(y,H.endX,H.endY)))f.push(I),G=!0;else if(!G&&H.edgeType==="haystack"){for(var Z=L.rstyle.haystackPts,W=0;W<Z.length;W++)if(B0(y,Z[W])){f.push(I),G=!0;break}}if(!G){var ae=L.rstyle.bezierPts||L.rstyle.linePts||L.rstyle.haystackPts;if((!ae||ae.length<2)&&H.edgeType==="straight"&&H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(ae=[{x:H.startX,y:H.startY},{x:H.endX,y:H.endY}]),!ae||ae.length<2)continue;for(var se=0;se<ae.length-1;se++){for(var he=ae[se],we=ae[se+1],de=0;de<b.length;de++){var $=aa(b[de],2),re=$[0],le=$[1];if(S(he,we,re,le)){f.push(I),G=!0;break}}if(G)break}}}}}return f};var uf={};uf.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",f=e.edgeType==="self",d,c,h,g,y,E,S,T;if(a?(h=e.haystackPts[0],g=e.haystackPts[1],y=e.haystackPts[2],E=e.haystackPts[3]):(h=e.arrowStartX,g=e.arrowStartY,y=e.arrowEndX,E=e.arrowEndY),S=e.midX,T=e.midY,u)d=h-e.segpts[0],c=g-e.segpts[1];else if(l||o||f||n){var b=e.allpts,w=ga(b[0],b[2],b[4],.1),x=ga(b[1],b[3],b[5],.1);d=h-w,c=g-x}else d=h-S,c=g-T;e.srcArrowAngle=Bo(d,c);var S=e.midX,T=e.midY;if(a&&(S=(h+y)/2,T=(g+E)/2),d=y-h,c=E-g,u){var b=e.allpts;if(b.length/2%2===0){var C=b.length/2,D=C-2;d=b[C]-b[D],c=b[C+1]-b[D+1]}else if(e.isRound)d=e.midVector[1],c=-e.midVector[0];else{var C=b.length/2-1,D=C-2;d=b[C]-b[D],c=b[C+1]-b[D+1]}}else if(l||o||f){var b=e.allpts,R=e.ctrlpts,z,B,O,_;if(R.length/2%2===0){var U=b.length/2-1,V=U+2,q=V+2;z=ga(b[U],b[V],b[q],0),B=ga(b[U+1],b[V+1],b[q+1],0),O=ga(b[U],b[V],b[q],1e-4),_=ga(b[U+1],b[V+1],b[q+1],1e-4)}else{var V=b.length/2-1,U=V-2,q=V+2;z=ga(b[U],b[V],b[q],.4999),B=ga(b[U+1],b[V+1],b[q+1],.4999),O=ga(b[U],b[V],b[q],.5),_=ga(b[U+1],b[V+1],b[q+1],.5)}d=O-z,c=_-B}if(e.midtgtArrowAngle=Bo(d,c),e.midDispX=d,e.midDispY=c,d*=-1,c*=-1,u){var b=e.allpts;if(b.length/2%2!==0){if(!e.isRound){var C=b.length/2-1,P=C+2;d=-(b[P]-b[C]),c=-(b[P+1]-b[C+1])}}}if(e.midsrcArrowAngle=Bo(d,c),u)d=y-e.segpts[e.segpts.length-2],c=E-e.segpts[e.segpts.length-1];else if(l||o||f||n){var b=e.allpts,Y=b.length,w=ga(b[Y-6],b[Y-4],b[Y-2],.9),x=ga(b[Y-5],b[Y-3],b[Y-1],.9);d=y-w,c=E-x}else d=y-S,c=E-T;e.tgtArrowAngle=Bo(d,c)};uf.getArrowWidth=uf.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 zh,Oh,zr={},gr={},f1,c1,wi,jo,$r,mi,xi,Mr,ml,_o,$2,eE,Nh,Lh,v1,d1=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)},ID=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},XD=function(e,a,n,l,u){if(e!==v1?d1(a,e,zr):ID(gr,zr),d1(a,n,gr),f1=zr.nx*gr.ny-zr.ny*gr.nx,c1=zr.nx*gr.nx-zr.ny*-gr.ny,$r=Math.asin(Math.max(-1,Math.min(1,f1))),Math.abs($r)<1e-6){zh=a.x,Oh=a.y,xi=ml=0;return}wi=1,jo=!1,c1<0?$r<0?$r=Math.PI+$r:($r=Math.PI-$r,wi=-1,jo=!0):$r>0&&(wi=-1,jo=!0),a.radius!==void 0?ml=a.radius:ml=l,mi=$r/2,_o=Math.min(zr.len/2,gr.len/2),u?(Mr=Math.abs(Math.cos(mi)*ml/Math.sin(mi)),Mr>_o?(Mr=_o,xi=Math.abs(Mr*Math.sin(mi)/Math.cos(mi))):xi=ml):(Mr=Math.min(_o,ml),xi=Math.abs(Mr*Math.sin(mi)/Math.cos(mi))),Nh=a.x+gr.nx*Mr,Lh=a.y+gr.ny*Mr,zh=Nh-gr.ny*xi*wi,Oh=Lh+gr.nx*xi*wi,$2=a.x+zr.nx*Mr,eE=a.y+zr.ny*Mr,v1=a};function tE(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 sg(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}:(XD(t,e,a,n,l),{cx:zh,cy:Oh,radius:xi,startX:$2,startY:eE,stopX:Nh,stopY:Lh,startAngle:zr.ang+Math.PI/2*wi,endAngle:gr.ang-Math.PI/2*wi,counterClockwise:jo})}var Wu=.01,jD=Math.sqrt(2*Wu),Oa={};Oa.findMidptPtsEtc=function(t,e){var a=e.posPts,n=e.intersectionPts,l=e.vectorNormInverse,u,o=t.pstyle("source-endpoint"),f=t.pstyle("target-endpoint"),d=o.units!=null&&f.units!=null,c=function(R,z,B,O){var _=O-z,U=B-R,V=Math.sqrt(U*U+_*_);return{x:-_/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(d){var g=this.manualEndptToPx(t.source()[0],o),y=aa(g,2),E=y[0],b=y[1],w=this.manualEndptToPx(t.target()[0],f),x=aa(w,2),S=x[0],T=x[1],C={x1:E,y1:b,x2:S,y2:T};l=c(E,b,S,T),u=C}else Et("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}};Oa.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,f=n.target,d=o.position(),c=f.position(),h=o.width(),g=f.width(),y=o.height(),E=f.height(),b=a.pstyle("haystack-radius").value,w=b/2;l.haystackPts=l.allpts=[l.source.x*h*w+d.x,l.source.y*y*w+d.y,l.target.x*g*w+c.x,l.target.y*E*w+c.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)}};Oa.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"),f=Math.min(n.pfValue.length,l.pfValue.length),d=u.pfValue[u.pfValue.length-1],c=o.pfValue[o.pfValue.length-1];a.edgeType="segments",a.segpts=[],a.radii=[],a.isArcRadius=[];for(var h=0;h<f;h++){var g=n.pfValue[h],y=l.pfValue[h],E=1-g,b=g,w=this.findMidptPtsEtc(t,e),x=w.midptPts,S=w.vectorNormInverse,T={x:x.x1*E+x.x2*b,y:x.y1*E+x.y2*b};a.segpts.push(T.x+S.x*y,T.y+S.y*y),a.radii.push(u.pfValue[h]!==void 0?u.pfValue[h]:d),a.isArcRadius.push((o.pfValue[h]!==void 0?o.pfValue[h]:c)==="arc-radius")}};Oa.findLoopPoints=function(t,e,a,n){var l=t._private.rscratch,u=e.dirCounts,o=e.srcPos,f=t.pstyle("control-point-distances"),d=f?f.pfValue[0]:void 0,c=t.pstyle("loop-direction").pfValue,h=t.pstyle("loop-sweep").pfValue,g=t.pstyle("control-point-step-size").pfValue;l.edgeType="self";var y=a,E=g;n&&(y=0,E=d);var b=c-Math.PI/2,w=b-h/2,x=b+h/2,S=c+"_"+h;y=u[S]===void 0?u[S]=0:++u[S],l.ctrlpts=[o.x+Math.cos(w)*1.4*E*(y/3+1),o.y+Math.sin(w)*1.4*E*(y/3+1),o.x+Math.cos(x)*1.4*E*(y/3+1),o.y+Math.sin(x)*1.4*E*(y/3+1)]};Oa.findCompoundLoopPoints=function(t,e,a,n){var l=t._private.rscratch;l.edgeType="compound";var u=e.srcPos,o=e.tgtPos,f=e.srcW,d=e.srcH,c=e.tgtW,h=e.tgtH,g=t.pstyle("control-point-step-size").pfValue,y=t.pstyle("control-point-distances"),E=y?y.pfValue[0]:void 0,b=a,w=g;n&&(b=0,w=E);var x=50,S={x:u.x-f/2,y:u.y-d/2},T={x:o.x-c/2,y:o.y-h/2},C={x:Math.min(S.x,T.x),y:Math.min(S.y,T.y)},D=.5,R=Math.max(D,Math.log(f*Wu)),z=Math.max(D,Math.log(c*Wu));l.ctrlpts=[C.x,C.y-(1+Math.pow(x,1.12)/100)*w*(b/3+1)*R,C.x-(1+Math.pow(x,1.12)/100)*w*(b/3+1)*z,C.y]};Oa.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};Oa.findBezierPoints=function(t,e,a,n,l){var u=t._private.rscratch,o=t.pstyle("control-point-step-size").pfValue,f=t.pstyle("control-point-distances"),d=t.pstyle("control-point-weights"),c=f&&d?Math.min(f.value.length,d.value.length):1,h=f?f.pfValue[0]:void 0,g=d.value[0],y=n;u.edgeType=y?"multibezier":"bezier",u.ctrlpts=[];for(var E=0;E<c;E++){var b=(.5-e.eles.length/2+a)*o*(l?-1:1),w=void 0,x=Zh(b);y&&(h=f?f.pfValue[E]:o,g=d.value[E]),n?w=h:w=h!==void 0?x*h:void 0;var S=w!==void 0?w:b,T=1-g,C=g,D=this.findMidptPtsEtc(t,e),R=D.midptPts,z=D.vectorNormInverse,B={x:R.x1*T+R.x2*C,y:R.y1*T+R.y2*C};u.ctrlpts.push(B.x+z.x*S,B.y+z.y*S)}};Oa.findTaxiPoints=function(t,e){var a=t._private.rscratch;a.edgeType="segments";var n="vertical",l="horizontal",u="leftward",o="rightward",f="downward",d="upward",c="auto",h=e.posPts,g=e.srcW,y=e.srcH,E=e.tgtW,b=e.tgtH,w=t.pstyle("edge-distances").value,x=w!=="node-position",S=t.pstyle("taxi-direction").value,T=S,C=t.pstyle("taxi-turn"),D=C.units==="%",R=C.pfValue,z=R<0,B=t.pstyle("taxi-turn-min-distance").pfValue,O=x?(g+E)/2:0,_=x?(y+b)/2:0,U=h.x2-h.x1,V=h.y2-h.y1,q=function(k,te){return k>0?Math.max(k-te,0):Math.min(k+te,0)},P=q(U,O),Y=q(V,_),I=!1;T===c?S=Math.abs(P)>Math.abs(Y)?l:n:T===d||T===f?(S=n,I=!0):(T===u||T===o)&&(S=l,I=!0);var L=S===n,H=L?Y:P,F=L?V:U,Q=Zh(F),J=!1;!(I&&(D||z))&&(T===f&&F<0||T===d&&F>0||T===u&&F>0||T===o&&F<0)&&(Q*=-1,H=Q*Math.abs(H),J=!0);var M;if(D){var G=R<0?1+R:R;M=G*H}else{var Z=R<0?H:0;M=Z+R*Q}var W=function(k){return Math.abs(k)<B||Math.abs(k)>=Math.abs(H)},ae=W(M),se=W(Math.abs(H)-Math.abs(M)),he=ae||se;if(he&&!J)if(L){var we=Math.abs(F)<=y/2,de=Math.abs(U)<=E/2;if(we){var $=(h.x1+h.x2)/2,re=h.y1,le=h.y2;a.segpts=[$,re,$,le]}else if(de){var pe=(h.y1+h.y2)/2,j=h.x1,xe=h.x2;a.segpts=[j,pe,xe,pe]}else a.segpts=[h.x1,h.y2]}else{var Be=Math.abs(F)<=g/2,Ue=Math.abs(V)<=b/2;if(Be){var Ve=(h.y1+h.y2)/2,Ae=h.x1,Ce=h.x2;a.segpts=[Ae,Ve,Ce,Ve]}else if(Ue){var _e=(h.x1+h.x2)/2,He=h.y1,je=h.y2;a.segpts=[_e,He,_e,je]}else a.segpts=[h.x2,h.y1]}else if(L){var De=h.y1+M+(x?y/2*Q:0),We=h.x1,rt=h.x2;a.segpts=[We,De,rt,De]}else{var ft=h.x1+M+(x?g/2*Q:0),st=h.y1,dt=h.y2;a.segpts=[ft,st,ft,dt]}if(a.isRound){var Xe=t.pstyle("taxi-radius").value,ze=t.pstyle("radius-type").value[0]==="arc-radius";a.radii=new Array(a.segpts.length/2).fill(Xe),a.isArcRadius=new Array(a.segpts.length/2).fill(ze)}};Oa.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,f=e.tgtW,d=e.tgtH,c=e.srcShape,h=e.tgtShape,g=e.srcCornerRadius,y=e.tgtCornerRadius,E=e.srcRs,b=e.tgtRs,w=!Te(a.startX)||!Te(a.startY),x=!Te(a.arrowStartX)||!Te(a.arrowStartY),S=!Te(a.endX)||!Te(a.endY),T=!Te(a.arrowEndX)||!Te(a.arrowEndY),C=3,D=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,R=C*D,z=Ai({x:a.ctrlpts[0],y:a.ctrlpts[1]},{x:a.startX,y:a.startY}),B=z<R,O=Ai({x:a.ctrlpts[0],y:a.ctrlpts[1]},{x:a.endX,y:a.endY}),_=O<R,U=!1;if(w||x||B){U=!0;var V={x:a.ctrlpts[0]-n.x,y:a.ctrlpts[1]-n.y},q=Math.sqrt(V.x*V.x+V.y*V.y),P={x:V.x/q,y:V.y/q},Y=Math.max(u,o),I={x:a.ctrlpts[0]+P.x*2*Y,y:a.ctrlpts[1]+P.y*2*Y},L=c.intersectLine(n.x,n.y,u,o,I.x,I.y,0,g,E);B?(a.ctrlpts[0]=a.ctrlpts[0]+P.x*(R-z),a.ctrlpts[1]=a.ctrlpts[1]+P.y*(R-z)):(a.ctrlpts[0]=L[0]+P.x*R,a.ctrlpts[1]=L[1]+P.y*R)}if(S||T||_){U=!0;var H={x:a.ctrlpts[0]-l.x,y:a.ctrlpts[1]-l.y},F=Math.sqrt(H.x*H.x+H.y*H.y),Q={x:H.x/F,y:H.y/F},J=Math.max(u,o),M={x:a.ctrlpts[0]+Q.x*2*J,y:a.ctrlpts[1]+Q.y*2*J},G=h.intersectLine(l.x,l.y,f,d,M.x,M.y,0,y,b);_?(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)}};Oa.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=ga(e.allpts[n],e.allpts[n+2],e.allpts[n+4],l),e.midY=ga(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],f=e.isArcRadius[u/2-1];e.roundCorners.push(sg({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,f))}}if(e.segpts.length%4===0){var d=e.segpts.length/2,c=d-2;e.midX=(e.segpts[c]+e.segpts[d])/2,e.midY=(e.segpts[c+1]+e.segpts[d+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]},y=e.roundCorners[h/2];if(y.radius===0){var E={x:e.segpts[h+2],y:e.segpts[h+3]};e.midX=g.x,e.midY=g.y,e.midVector=[g.y-E.y,E.x-g.x]}else{var b=[g.x-y.cx,g.y-y.cy],w=y.radius/Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2));b=b.map(function(x){return x*w}),e.midX=y.cx+b[0],e.midY=y.cy+b[1],e.midVector=b}}}}};Oa.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||Te(e.startX)&&Te(e.startY)&&Te(e.endX)&&Te(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Et("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."))};Oa.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var a=this,n=a.cy,l=n.hasCompoundNodes(),u=new tn,o=function(_,U){return[].concat(Qo(_),[U?1:0]).join("-")},f=[],d=[],c=0;c<t.length;c++){var h=t[c],g=h._private,y=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(y==="haystack"){d.push(h);continue}var E=y==="unbundled-bezier"||Vn(y,"segments")||y==="straight"||y==="straight-triangle"||Vn(y,"taxi"),b=y==="unbundled-bezier"||y==="bezier",w=g.source,x=g.target,S=w.poolIndex(),T=x.poolIndex(),C=[S,T].sort(),D=o(C,E),R=u.get(D);R==null&&(R={eles:[]},f.push({pairId:C,edgeIsUnbundled:E}),u.set(D,R)),R.eles.push(h),E&&(R.hasUnbundled=!0),b&&(R.hasBezier=!0)}}for(var z=function(){var _=f[B],U=_.pairId,V=_.edgeIsUnbundled,q=o(U,V),P=u.get(q),Y;if(!P.hasUnbundled){var I=P.eles[0].parallelEdges().filter(function(ze){return ze.isBundledBezier()});jh(P.eles),I.forEach(function(ze){return P.eles.push(ze)}),P.eles.sort(function(ze,ye){return ze.poolIndex()-ye.poolIndex()})}var L=P.eles[0],H=L.source(),F=L.target();if(H.poolIndex()>F.poolIndex()){var Q=H;H=F,F=Q}var J=P.srcPos=H.position(),M=P.tgtPos=F.position(),G=P.srcW=H.outerWidth(),Z=P.srcH=H.outerHeight(),W=P.tgtW=F.outerWidth(),ae=P.tgtH=F.outerHeight(),se=P.srcShape=a.nodeShapes[e.getNodeShape(H)],he=P.tgtShape=a.nodeShapes[e.getNodeShape(F)],we=P.srcCornerRadius=H.pstyle("corner-radius").value==="auto"?"auto":H.pstyle("corner-radius").pfValue,de=P.tgtCornerRadius=F.pstyle("corner-radius").value==="auto"?"auto":F.pstyle("corner-radius").pfValue,$=P.tgtRs=F._private.rscratch,re=P.srcRs=H._private.rscratch;P.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var le=0;le<P.eles.length;le++){var pe=P.eles[le],j=pe[0]._private.rscratch,xe=pe.pstyle("curve-style").value,Be=xe==="unbundled-bezier"||Vn(xe,"segments")||Vn(xe,"taxi"),Ue=!H.same(pe.source());if(!P.calculatedIntersection&&H!==F&&(P.hasBezier||P.hasUnbundled)){P.calculatedIntersection=!0;var Ve=se.intersectLine(J.x,J.y,G,Z,M.x,M.y,0,we,re),Ae=P.srcIntn=Ve,Ce=he.intersectLine(M.x,M.y,W,ae,J.x,J.y,0,de,$),_e=P.tgtIntn=Ce,He=P.intersectionPts={x1:Ve[0],x2:Ce[0],y1:Ve[1],y2:Ce[1]},je=P.posPts={x1:J.x,x2:M.x,y1:J.y,y2:M.y},De=Ce[1]-Ve[1],We=Ce[0]-Ve[0],rt=Math.sqrt(We*We+De*De);Te(rt)&&rt>=jD||(rt=Math.sqrt(Math.max(We*We,Wu)+Math.max(De*De,Wu)));var ft=P.vector={x:We,y:De},st=P.vectorNorm={x:ft.x/rt,y:ft.y/rt},dt={x:-st.y,y:st.x};P.nodesOverlap=!Te(rt)||he.checkPoint(Ve[0],Ve[1],0,W,ae,M.x,M.y,de,$)||se.checkPoint(Ce[0],Ce[1],0,G,Z,J.x,J.y,we,re),P.vectorNormInverse=dt,Y={nodesOverlap:P.nodesOverlap,dirCounts:P.dirCounts,calculatedIntersection:!0,hasBezier:P.hasBezier,hasUnbundled:P.hasUnbundled,eles:P.eles,srcPos:M,srcRs:$,tgtPos:J,tgtRs:re,srcW:W,srcH:ae,tgtW:G,tgtH:Z,srcIntn:_e,tgtIntn:Ae,srcShape:he,tgtShape:se,posPts:{x1:je.x2,y1:je.y2,x2:je.x1,y2:je.y1},intersectionPts:{x1:He.x2,y1:He.y2,x2:He.x1,y2:He.y1},vector:{x:-ft.x,y:-ft.y},vectorNorm:{x:-st.x,y:-st.y},vectorNormInverse:{x:-dt.x,y:-dt.y}}}var Xe=Ue?Y:P;j.nodesOverlap=Xe.nodesOverlap,j.srcIntn=Xe.srcIntn,j.tgtIntn=Xe.tgtIntn,j.isRound=xe.startsWith("round"),l&&(H.isParent()||H.isChild()||F.isParent()||F.isChild())&&(H.parents().anySame(F)||F.parents().anySame(H)||H.same(F)&&H.isParent())?e.findCompoundLoopPoints(pe,Xe,le,Be):H===F?e.findLoopPoints(pe,Xe,le,Be):xe.endsWith("segments")?e.findSegmentsPoints(pe,Xe):xe.endsWith("taxi")?e.findTaxiPoints(pe,Xe):xe==="straight"||!Be&&P.eles.length%2===1&&le===Math.floor(P.eles.length/2)?e.findStraightEdgePoints(pe):e.findBezierPoints(pe,Xe,le,Be,Ue),e.findEndpoints(pe),e.tryToCorrectInvalidPoints(pe,Xe),e.checkForInvalidEdgeWarning(pe),e.storeAllpts(pe),e.storeEdgeProjections(pe),e.calculateArrowAngles(pe),e.recalculateEdgeLabelProjections(pe),e.calculateLabelAngles(pe)}},B=0;B<f.length;B++)z();this.findHaystackPoints(d)}};function aE(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}}Oa.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var a=e.edgeType;if(a==="segments")return aE(e.segpts)};Oa.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 aE(e.ctrlpts)};Oa.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var ss={};ss.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 f=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(f[0]=f[0]*l),e.units[1]==="%"&&(f[1]=f[1]*u),f[0]+=n.x,f[1]+=n.y,f}else{var d=e.pfValue[0];d=-Math.PI/2+d;var c=2*Math.max(l,u),h=[n.x+Math.cos(d)*c,n.y+Math.sin(d)*c];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)}};ss.findEndpoints=function(t){var e,a,n,l,u=this,o,f=t.source()[0],d=t.target()[0],c=f.position(),h=d.position(),g=t.pstyle("target-arrow-shape").value,y=t.pstyle("source-arrow-shape").value,E=t.pstyle("target-distance-from-node").pfValue,b=t.pstyle("source-distance-from-node").pfValue,w=f._private.rscratch,x=d._private.rscratch,S=t.pstyle("curve-style").value,T=t._private.rscratch,C=T.edgeType,D=Vn(S,"taxi"),R=C==="self"||C==="compound",z=C==="bezier"||C==="multibezier"||R,B=C!=="bezier",O=C==="straight"||C==="segments",_=C==="segments",U=z||B||O,V=R||D,q=t.pstyle("source-endpoint"),P=V?"outside-to-node":q.value,Y=f.pstyle("corner-radius").value==="auto"?"auto":f.pstyle("corner-radius").pfValue,I=t.pstyle("target-endpoint"),L=V?"outside-to-node":I.value,H=d.pstyle("corner-radius").value==="auto"?"auto":d.pstyle("corner-radius").pfValue;T.srcManEndpt=q,T.tgtManEndpt=I;var F,Q,J,M,G=(e=(I==null||(a=I.pfValue)===null||a===void 0?void 0:a.length)===2?I.pfValue:null)!==null&&e!==void 0?e:[0,0],Z=(n=(q==null||(l=q.pfValue)===null||l===void 0?void 0:l.length)===2?q.pfValue:null)!==null&&n!==void 0?n:[0,0];if(z){var W=[T.ctrlpts[0],T.ctrlpts[1]],ae=B?[T.ctrlpts[T.ctrlpts.length-2],T.ctrlpts[T.ctrlpts.length-1]]:W;F=ae,Q=W}else if(O){var se=_?T.segpts.slice(0,2):[h.x+G[0],h.y+G[1]],he=_?T.segpts.slice(T.segpts.length-2):[c.x+Z[0],c.y+Z[1]];F=he,Q=se}if(L==="inside-to-node")o=[h.x,h.y];else if(I.units)o=this.manualEndptToPx(d,I);else if(L==="outside-to-line")o=T.tgtIntn;else if(L==="outside-to-node"||L==="outside-to-node-or-label"?J=F:(L==="outside-to-line"||L==="outside-to-line-or-label")&&(J=[c.x,c.y]),o=u.nodeShapes[this.getNodeShape(d)].intersectLine(h.x,h.y,d.outerWidth(),d.outerHeight(),J[0],J[1],0,H,x),L==="outside-to-node-or-label"||L==="outside-to-line-or-label"){var we=d._private.rscratch,de=we.labelWidth,$=we.labelHeight,re=we.labelX,le=we.labelY,pe=de/2,j=$/2,xe=d.pstyle("text-valign").value;xe==="top"?le-=j:xe==="bottom"&&(le+=j);var Be=d.pstyle("text-halign").value;Be==="left"?re-=pe:Be==="right"&&(re+=pe);var Ue=ju(J[0],J[1],[re-pe,le-j,re+pe,le-j,re+pe,le+j,re-pe,le+j],h.x,h.y);if(Ue.length>0){var Ve=c,Ae=Ei(Ve,wl(o)),Ce=Ei(Ve,wl(Ue)),_e=Ae;if(Ce<Ae&&(o=Ue,_e=Ce),Ue.length>2){var He=Ei(Ve,{x:Ue[2],y:Ue[3]});He<_e&&(o=[Ue[2],Ue[3]])}}}var je=Mo(o,F,u.arrowShapes[g].spacing(t)+E),De=Mo(o,F,u.arrowShapes[g].gap(t)+E);if(T.endX=De[0],T.endY=De[1],T.arrowEndX=je[0],T.arrowEndY=je[1],P==="inside-to-node")o=[c.x,c.y];else if(q.units)o=this.manualEndptToPx(f,q);else if(P==="outside-to-line")o=T.srcIntn;else if(P==="outside-to-node"||P==="outside-to-node-or-label"?M=Q:(P==="outside-to-line"||P==="outside-to-line-or-label")&&(M=[h.x,h.y]),o=u.nodeShapes[this.getNodeShape(f)].intersectLine(c.x,c.y,f.outerWidth(),f.outerHeight(),M[0],M[1],0,Y,w),P==="outside-to-node-or-label"||P==="outside-to-line-or-label"){var We=f._private.rscratch,rt=We.labelWidth,ft=We.labelHeight,st=We.labelX,dt=We.labelY,Xe=rt/2,ze=ft/2,ye=f.pstyle("text-valign").value;ye==="top"?dt-=ze:ye==="bottom"&&(dt+=ze);var k=f.pstyle("text-halign").value;k==="left"?st-=Xe:k==="right"&&(st+=Xe);var te=ju(M[0],M[1],[st-Xe,dt-ze,st+Xe,dt-ze,st+Xe,dt+ze,st-Xe,dt+ze],c.x,c.y);if(te.length>0){var ce=h,oe=Ei(ce,wl(o)),me=Ei(ce,wl(te)),Re=oe;if(me<oe&&(o=[te[0],te[1]],Re=me),te.length>2){var Se=Ei(ce,{x:te[2],y:te[3]});Se<Re&&(o=[te[2],te[3]])}}}var ke=Mo(o,Q,u.arrowShapes[y].spacing(t)+b),Me=Mo(o,Q,u.arrowShapes[y].gap(t)+b);T.startX=Me[0],T.startY=Me[1],T.arrowStartX=ke[0],T.arrowStartY=ke[1],U&&(!Te(T.startX)||!Te(T.startY)||!Te(T.endX)||!Te(T.endY)?T.badLine=!0:T.badLine=!1)};ss.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}};ss.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 og={};function KD(t,e,a){for(var n=function(c,h,g,y){return ga(c,h,g,y)},l=e._private,u=l.rstyle.bezierPts,o=0;o<t.bezierProjPcts.length;o++){var f=t.bezierProjPcts[o];u.push({x:n(a[0],a[2],a[4],f),y:n(a[1],a[3],a[5],f)})}}og.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)KD(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};og.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Lr={};Lr.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!Yn(e)){var a,n,l=t._private,u=t.width(),o=t.height(),f=t.padding(),d=t.position(),c=t.pstyle("text-halign").strValue,h=t.pstyle("text-valign").strValue,g=l.rscratch,y=l.rstyle;switch(c){case"left":a=d.x-u/2-f;break;case"right":a=d.x+u/2+f;break;default:a=d.x}switch(h){case"top":n=d.y-o/2-f;break;case"bottom":n=d.y+o/2+f;break;default:n=d.y}g.labelX=a,g.labelY=n,y.labelX=a,y.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var rE=function(e,a){var n=Math.atan(a/e);return e===0&&n<0&&(n=n*-1),n},nE=function(e,a){var n=a.x-e.x,l=a.y-e.y;return rE(n,l)},ZD=function(e,a,n,l){var u=Xu(0,l-.001,1),o=Xu(0,l+.001,1),f=Al(e,a,n,u),d=Al(e,a,n,o);return nE(f,d)};Lr.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,y,E){en(a.rscratch,g,y,E),en(a.rstyle,g,y,E)};o("labelX",null,e.x),o("labelY",null,e.y);var f=rE(n.midDispX,n.midDispY);o("labelAutoAngle",null,f);var d=function(){if(d.cache)return d.cache;for(var g=[],y=0;y+5<n.allpts.length;y+=4){var E={x:n.allpts[y],y:n.allpts[y+1]},b={x:n.allpts[y+2],y:n.allpts[y+3]},w={x:n.allpts[y+4],y:n.allpts[y+5]};g.push({p0:E,p1:b,p2:w,startDist:0,length:0,segments:[]})}var x=a.rstyle.bezierPts,S=l.bezierProjPcts.length;function T(B,O,_,U,V){var q=Ai(O,_),P=B.segments[B.segments.length-1],Y={p0:O,p1:_,t0:U,t1:V,startDist:P?P.startDist+P.length:0,length:q};B.segments.push(Y),B.length+=q}for(var C=0;C<g.length;C++){var D=g[C],R=g[C-1];R&&(D.startDist=R.startDist+R.length),T(D,D.p0,x[C*S],0,l.bezierProjPcts[0]);for(var z=0;z<S-1;z++)T(D,x[C*S+z],x[C*S+z+1],l.bezierProjPcts[z],l.bezierProjPcts[z+1]);T(D,x[C*S+S-1],D.p2,l.bezierProjPcts[S-1],1)}return d.cache=g},c=function(g){var y,E=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 w=d(),x,S=0,T=0,C=0;C<w.length;C++){for(var D=w[E?C:w.length-1-C],R=0;R<D.segments.length;R++){var z=D.segments[E?R:D.segments.length-1-R],B=C===w.length-1&&R===D.segments.length-1;if(S=T,T+=z.length,T>=b||B){x={cp:D,segment:z};break}}if(x)break}var O=x.cp,_=x.segment,U=(b-S)/_.length,V=_.t1-_.t0,q=E?_.t0+V*U:_.t1-V*U;q=Xu(0,q,1),e=Al(O.p0,O.p1,O.p2,q),y=ZD(O.p0,O.p1,O.p2,q);break}case"straight":case"segments":case"haystack":{for(var P=0,Y,I,L,H,F=n.allpts.length,Q=0;Q+3<F&&(E?(L={x:n.allpts[Q],y:n.allpts[Q+1]},H={x:n.allpts[Q+2],y:n.allpts[Q+3]}):(L={x:n.allpts[F-2-Q],y:n.allpts[F-1-Q]},H={x:n.allpts[F-4-Q],y:n.allpts[F-3-Q]}),Y=Ai(L,H),I=P,P+=Y,!(P>=b));Q+=2);var J=b-I,M=J/Y;M=Xu(0,M,1),e=yT(L,H,M),y=nE(L,H);break}}o("labelX",g,e.x),o("labelY",g,e.y),o("labelAutoAngle",g,y)}};c("source"),c("target"),this.applyLabelDimensions(t)}};Lr.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Lr.applyPrefixedLabelDimensions=function(t,e){var a=t._private,n=this.getLabelText(t,e),l=Ci(n,t._private.labelDimsKey);if(Ia(a.rscratch,"prefixedLabelDimsKey",e)!==l){en(a.rscratch,"prefixedLabelDimsKey",e,l);var u=this.calculateLabelDimensions(t,n),o=t.pstyle("line-height").pfValue,f=t.pstyle("text-wrap").strValue,d=Ia(a.rscratch,"labelWrapCachedLines",e)||[],c=f!=="wrap"?1:Math.max(d.length,1),h=u.height/c,g=h*o,y=u.width,E=u.height+(c-1)*(o-1)*h;en(a.rstyle,"labelWidth",e,y),en(a.rscratch,"labelWidth",e,y),en(a.rstyle,"labelHeight",e,E),en(a.rscratch,"labelHeight",e,E),en(a.rscratch,"labelLineHeight",e,g)}};Lr.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,W){return W?(en(a.rscratch,Z,e,W),W):Ia(a.rscratch,Z,e)};if(!l)return"";u=="none"||(u=="uppercase"?l=l.toUpperCase():u=="lowercase"&&(l=l.toLowerCase()));var f=t.pstyle("text-wrap").value;if(f==="wrap"){var d=o("labelKey");if(d!=null&&o("labelWrapKey")===d)return o("labelWrapCachedText");for(var c="",h=l.split(`
|
|
13
|
-
`),g=t.pstyle("text-max-width").pfValue,y=t.pstyle("text-overflow-wrap").value,E=y==="anywhere",b=[],w=/[\s\u200b]+|$/g,x=0;x<h.length;x++){var S=h[x],T=this.calculateLabelDimensions(t,S),C=T.width;if(E){var D=S.split("").join(c);S=D}if(C>g){var R=S.matchAll(w),z="",B=0,O=ja(R),_;try{for(O.s();!(_=O.n()).done;){var U=_.value,V=U[0],q=S.substring(B,U.index);B=U.index+V.length;var P=z.length===0?q:z+q+V,Y=this.calculateLabelDimensions(t,P),I=Y.width;I<=g?z+=q+V:(z&&b.push(z),z=q+V)}}catch(G){O.e(G)}finally{O.f()}z.match(/^[\s\u200b]+$/)||b.push(z)}else b.push(S)}o("labelWrapCachedLines",b),l=o("labelWrapCachedText",b.join(`
|
|
14
|
-
`)),o("labelWrapKey",d)}else if(f==="ellipsis"){var L=t.pstyle("text-max-width").pfValue,H="",F="…",Q=!1;if(this.calculateLabelDimensions(t,l).width<L)return l;for(var J=0;J<l.length;J++){var M=this.calculateLabelDimensions(t,H+l[J]+F).width;if(M>L)break;H+=l[J],J===l.length-1&&(Q=!0)}return Q||(H+=F),H}return l};Lr.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};Lr.calculateLabelDimensions=function(t,e){var a=this,n=a.cy.window(),l=n.document,u=0,o=t.pstyle("font-style").strValue,f=t.pstyle("font-size").pfValue,d=t.pstyle("font-family").strValue,c=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 y=h.style;y.position="absolute",y.left="-9999px",y.top="-9999px",y.zIndex="-1",y.visibility="hidden",y.pointerEvents="none"}g.font="".concat(o," ").concat(c," ").concat(f,"px ").concat(d);for(var E=0,b=0,w=e.split(`
|
|
15
|
-
`),x=0;x<w.length;x++){var S=w[x],T=g.measureText(S),C=Math.ceil(T.width),D=f;E=Math.max(C,E),b+=D}return E+=u,b+=u,{width:E,height:b}};Lr.calculateLabelAngle=function(t,e){var a=t._private,n=a.rscratch,l=t.isEdge(),u=e?e+"-":"",o=t.pstyle(u+"text-rotation"),f=o.strValue;return f==="none"?0:l&&f==="autorotate"?n.labelAutoAngle:f==="autorotate"?0:o.pfValue};Lr.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 iE={},h1=28,g1=!1;iE.getNodeShape=function(t){var e=this,a=t.pstyle("shape").value;if(a==="cutrectangle"&&(t.width()<h1||t.height()<h1))return g1||(Et("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),g1=!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 Df={};Df.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),a=this,n=function(o){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),f)for(var d=0;d<o.length;d++){var c=o[d],h=c._private,g=h.rstyle;g.clean=!1,g.cleanConnected=!1}};a.binder(t).on("bounds.* dirty.*",function(o){var f=o.target;n(f)}).on("style.* background.*",function(o){var f=o.target;n(f,!1)});var l=function(o){if(o){var f=a.onUpdateEleCalcsFns;e.cleanStyle();for(var d=0;d<e.length;d++){var c=e[d],h=c._private.rstyle;c.isNode()&&!h.cleanConnected&&(n(c.connectedEdges()),h.cleanConnected=!0)}if(f)for(var g=0;g<f.length;g++){var y=f[g];y(o,e)}a.recalculateRenderedStyle(e),e=t.collection()}};a.flushRenderedStyleQueue=function(){l(!0)},a.beforeRender(l,a.beforeRenderPriorities.eleCalcs)};Df.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};Df.recalculateRenderedStyle=function(t,e){var a=function(D){return D._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],f=o._private,d=f.rstyle;o.isEdge()&&(!a(o.source())||!a(o.target()))&&(d.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(C){return!C._private.rstyle.clean&&C.isBundledBezier()})&&(d.clean=!1),!(e&&d.clean||o.removed())&&o.pstyle("display").value!=="none"&&(f.group==="nodes"?l.push(o):n.push(o),d.clean=!0)}for(var c=0;c<l.length;c++){var h=l[c],g=h._private,y=g.rstyle,E=h.position();this.recalculateNodeLabelProjection(h),y.nodeX=E.x,y.nodeY=E.y,y.nodeW=h.pstyle("width").pfValue,y.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var b=0;b<n.length;b++){var w=n[b],x=w._private,S=x.rstyle,T=x.rscratch;S.srcX=T.arrowStartX,S.srcY=T.arrowStartY,S.tgtX=T.arrowEndX,S.tgtY=T.arrowEndY,S.midX=T.midX,S.midY=T.midY,S.labelAngle=T.labelAngle,S.sourceLabelAngle=T.sourceLabelAngle,S.targetLabelAngle=T.targetLabelAngle}}}};var Bf={};Bf.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)}}};Bf.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Bf.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(H2),e.interactive=e.filter(function(a){return a.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var lE={};[zi,uf,Oa,ss,og,Lr,iE,Df,Bf].forEach(function(t){Fe(lE,t)});var uE={};uE.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 f="data:",d=t.substring(0,f.length).toLowerCase()===f;return d||(e=e==="null"?null:e,o.crossOrigin=e),o.src=t,o};var ql={};ql.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 f=t[o];if(f!==void 0){var d=this.binder(f);u.push(d.on.apply(d,l))}}return u}var d=this.binder(t);return d.on.apply(d,l)};ql.binder=function(t){var e=this,a=e.cy.window(),n=t===a||t===a.document||t===a.document.body||uw(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(d,c,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}};ql.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};ql.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};ql.load=function(){var t=this,e=t.cy.window(),a=function(k){return k.selected()},n=function(k){var te=k.getRootNode();if(te&&te.nodeType===11&&te.host!==void 0)return te},l=function(k,te,ce,oe){k==null&&(k=t.cy);for(var me=0;me<te.length;me++){var Re=te[me];k.emit({originalEvent:ce,type:Re,position:oe})}},u=function(k){return k.shiftKey||k.metaKey||k.ctrlKey},o=function(k,te){var ce=!0;if(t.cy.hasCompoundNodes()&&k&&k.pannable())for(var oe=0;te&&oe<te.length;oe++){var k=te[oe];if(k.isNode()&&k.isParent()&&!k.pannable()){ce=!1;break}}else ce=!0;return ce},f=function(k){k[0]._private.grabbed=!0},d=function(k){k[0]._private.grabbed=!1},c=function(k){k[0]._private.rscratch.inDragLayer=!0},h=function(k){k[0]._private.rscratch.inDragLayer=!1},g=function(k){k[0]._private.rscratch.isGrabTarget=!0},y=function(k){k[0]._private.rscratch.isGrabTarget=!1},E=function(k,te){var ce=te.addToList,oe=ce.has(k);!oe&&k.grabbable()&&!k.locked()&&(ce.merge(k),f(k))},b=function(k,te){if(k.cy().hasCompoundNodes()&&!(te.inDragLayer==null&&te.addToList==null)){var ce=k.descendants();te.inDragLayer&&(ce.forEach(c),ce.connectedEdges().forEach(c)),te.addToList&&E(ce,te)}},w=function(k,te){te=te||{};var ce=k.cy().hasCompoundNodes();te.inDragLayer&&(k.forEach(c),k.neighborhood().stdFilter(function(oe){return!ce||oe.isEdge()}).forEach(c)),te.addToList&&k.forEach(function(oe){E(oe,te)}),b(k,te),T(k,{inDragLayer:te.inDragLayer}),t.updateCachedGrabbedEles()},x=w,S=function(k){k&&(t.getCachedZSortedEles().forEach(function(te){d(te),h(te),y(te)}),t.updateCachedGrabbedEles())},T=function(k,te){if(!(te.inDragLayer==null&&te.addToList==null)&&k.cy().hasCompoundNodes()){var ce=k.ancestors().orphans();if(!ce.same(k)){var oe=ce.descendants().spawnSelf().merge(ce).unmerge(k).unmerge(k.descendants()),me=oe.connectedEdges();te.inDragLayer&&(me.forEach(c),oe.forEach(c)),te.addToList&&oe.forEach(function(Re){E(Re,te)})}}},C=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},D=typeof MutationObserver<"u",R=typeof ResizeObserver<"u";D?(t.removeObserver=new MutationObserver(function(ye){for(var k=0;k<ye.length;k++){var te=ye[k],ce=te.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(ye){t.destroy()});var z=ns(function(){t.cy.resize()},100);D&&(t.styleObserver=new MutationObserver(z),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",z),R&&(t.resizeObserver=new ResizeObserver(z),t.resizeObserver.observe(t.container));var B=function(k,te){for(;k!=null;)te(k),k=k.parentNode},O=function(){t.invalidateContainerClientCoordsCache()};B(t.container,function(ye){t.registerBinding(ye,"transitionend",O),t.registerBinding(ye,"animationend",O),t.registerBinding(ye,"scroll",O)}),t.registerBinding(t.container,"contextmenu",function(ye){ye.preventDefault()});var _=function(){return t.selection[4]!==0},U=function(k){for(var te=t.findContainerClientCoords(),ce=te[0],oe=te[1],me=te[2],Re=te[3],Se=k.touches?k.touches:[k],ke=!1,Me=0;Me<Se.length;Me++){var Pe=Se[Me];if(ce<=Pe.clientX&&Pe.clientX<=ce+me&&oe<=Pe.clientY&&Pe.clientY<=oe+Re){ke=!0;break}}if(!ke)return!1;for(var Ke=t.container,Ze=k.target,Ne=Ze.parentNode,tt=!1;Ne;){if(Ne===Ke){tt=!0;break}Ne=Ne.parentNode}return!!tt};t.registerBinding(t.container,"mousedown",function(k){if(U(k)&&!(t.hoverData.which===1&&k.which!==1)){k.preventDefault(),C(),t.hoverData.capture=!0,t.hoverData.which=k.which;var te=t.cy,ce=[k.clientX,k.clientY],oe=t.projectIntoViewport(ce[0],ce[1]),me=t.selection,Re=t.findNearestElements(oe[0],oe[1],!0,!1),Se=Re[0],ke=t.dragData.possibleDragElements;t.hoverData.mdownPos=oe,t.hoverData.mdownGPos=ce;var Me=function($e){return{originalEvent:k,type:$e,position:{x:oe[0],y:oe[1]}}},Pe=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var $e=t.hoverData.down;$e?$e.emit(Me("taphold")):te.emit(Me("taphold"))}},t.tapholdDuration)};if(k.which==3){t.hoverData.cxtStarted=!0;var Ke={originalEvent:k,type:"cxttapstart",position:{x:oe[0],y:oe[1]}};Se?(Se.activate(),Se.emit(Ke),t.hoverData.down=Se):te.emit(Ke),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(k.which==1){Se&&Se.activate();{if(Se!=null&&t.nodeIsGrabbable(Se)){var Ze=function($e){$e.emit(Me("grab"))};if(g(Se),!Se.selected())ke=t.dragData.possibleDragElements=te.collection(),x(Se,{addToList:ke}),Se.emit(Me("grabon")).emit(Me("grab"));else{ke=t.dragData.possibleDragElements=te.collection();var Ne=te.$(function(tt){return tt.isNode()&&tt.selected()&&t.nodeIsGrabbable(tt)});w(Ne,{addToList:ke}),Se.emit(Me("grabon")),Ne.forEach(Ze)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=Se,t.hoverData.downs=Re,t.hoverData.downTime=new Date().getTime()}l(Se,["mousedown","tapstart","vmousedown"],k,{x:oe[0],y:oe[1]}),Se==null?(me[4]=1,t.data.bgActivePosistion={x:oe[0],y:oe[1]},t.redrawHint("select",!0),t.redraw()):Se.pannable()&&(me[4]=1),Pe()}me[0]=me[2]=oe[0],me[1]=me[3]=oe[1]}},!1);var V=n(t.container);t.registerBinding([e,V],"mousemove",function(k){var te=t.hoverData.capture;if(!(!te&&!U(k))){var ce=!1,oe=t.cy,me=oe.zoom(),Re=[k.clientX,k.clientY],Se=t.projectIntoViewport(Re[0],Re[1]),ke=t.hoverData.mdownPos,Me=t.hoverData.mdownGPos,Pe=t.selection,Ke=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(Ke=t.findNearestElement(Se[0],Se[1],!0,!1));var Ze=t.hoverData.last,Ne=t.hoverData.down,tt=[Se[0]-Pe[2],Se[1]-Pe[3]],$e=t.dragData.possibleDragElements,Vt;if(Me){var wt=Re[0]-Me[0],ma=wt*wt,Ut=Re[1]-Me[1],Xt=Ut*Ut,Gt=ma+Xt;t.hoverData.isOverThresholdDrag=Vt=Gt>=t.desktopTapThreshold2}var jt=u(k);Vt&&(t.hoverData.tapholdCancelled=!0);var rr=function(){var va=t.hoverData.dragDelta=t.hoverData.dragDelta||[];va.length===0?(va.push(tt[0]),va.push(tt[1])):(va[0]+=tt[0],va[1]+=tt[1])};ce=!0,l(Ke,["mousemove","vmousemove","tapdrag"],k,{x:Se[0],y:Se[1]});var Ht=function(va){return{originalEvent:k,type:va,position:{x:Se[0],y:Se[1]}}},nr=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||oe.emit(Ht("boxstart")),Pe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Vt){var oa=Ht("cxtdrag");Ne?Ne.emit(oa):oe.emit(oa),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Ke!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(Ht("cxtdragout")),t.hoverData.cxtOver=Ke,Ke&&Ke.emit(Ht("cxtdragover")))}}else if(t.hoverData.dragging){if(ce=!0,oe.panningEnabled()&&oe.userPanningEnabled()){var kt;if(t.hoverData.justStartedPan){var ra=t.hoverData.mdownPos;kt={x:(Se[0]-ra[0])*me,y:(Se[1]-ra[1])*me},t.hoverData.justStartedPan=!1}else kt={x:tt[0]*me,y:tt[1]*me};oe.panBy(kt),oe.emit(Ht("dragpan")),t.hoverData.dragged=!0}Se=t.projectIntoViewport(k.clientX,k.clientY)}else if(Pe[4]==1&&(Ne==null||Ne.pannable())){if(Vt){if(!t.hoverData.dragging&&oe.boxSelectionEnabled()&&(jt||!oe.panningEnabled()||!oe.userPanningEnabled()))nr();else if(!t.hoverData.selecting&&oe.panningEnabled()&&oe.userPanningEnabled()){var qa=o(Ne,t.hoverData.downs);qa&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Pe[4]=0,t.data.bgActivePosistion=wl(ke),t.redrawHint("select",!0),t.redraw())}Ne&&Ne.pannable()&&Ne.active()&&Ne.unactivate()}}else{if(Ne&&Ne.pannable()&&Ne.active()&&Ne.unactivate(),(!Ne||!Ne.grabbed())&&Ke!=Ze&&(Ze&&l(Ze,["mouseout","tapdragout"],k,{x:Se[0],y:Se[1]}),Ke&&l(Ke,["mouseover","tapdragover"],k,{x:Se[0],y:Se[1]}),t.hoverData.last=Ke),Ne)if(Vt){if(oe.boxSelectionEnabled()&&jt)Ne&&Ne.grabbed()&&(S($e),Ne.emit(Ht("freeon")),$e.emit(Ht("free")),t.dragData.didDrag&&(Ne.emit(Ht("dragfreeon")),$e.emit(Ht("dragfree")))),nr();else if(Ne&&Ne.grabbed()&&t.nodeIsDraggable(Ne)){var fa=!t.dragData.didDrag;fa&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||w($e,{inDragLayer:!0});var ca={x:0,y:0};if(Te(tt[0])&&Te(tt[1])&&(ca.x+=tt[0],ca.y+=tt[1],fa)){var Da=t.hoverData.dragDelta;Da&&Te(Da[0])&&Te(Da[1])&&(ca.x+=Da[0],ca.y+=Da[1])}t.hoverData.draggingEles=!0,$e.silentShift(ca).emit(Ht("position")).emit(Ht("drag")),t.redrawHint("drag",!0),t.redraw()}}else rr();ce=!0}if(Pe[2]=Se[0],Pe[3]=Se[1],ce)return k.stopPropagation&&k.stopPropagation(),k.preventDefault&&k.preventDefault(),!1}},!1);var q,P,Y;t.registerBinding(e,"mouseup",function(k){if(!(t.hoverData.which===1&&k.which!==1&&t.hoverData.capture)){var te=t.hoverData.capture;if(te){t.hoverData.capture=!1;var ce=t.cy,oe=t.projectIntoViewport(k.clientX,k.clientY),me=t.selection,Re=t.findNearestElement(oe[0],oe[1],!0,!1),Se=t.dragData.possibleDragElements,ke=t.hoverData.down,Me=u(k);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ke&&ke.unactivate();var Pe=function(wt){return{originalEvent:k,type:wt,position:{x:oe[0],y:oe[1]}}};if(t.hoverData.which===3){var Ke=Pe("cxttapend");if(ke?ke.emit(Ke):ce.emit(Ke),!t.hoverData.cxtDragged){var Ze=Pe("cxttap");ke?ke.emit(Ze):ce.emit(Ze)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(l(Re,["mouseup","tapend","vmouseup"],k,{x:oe[0],y:oe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(l(ke,["click","tap","vclick"],k,{x:oe[0],y:oe[1]}),P=!1,k.timeStamp-Y<=ce.multiClickDebounceTime()?(q&&clearTimeout(q),P=!0,Y=null,l(ke,["dblclick","dbltap","vdblclick"],k,{x:oe[0],y:oe[1]})):(q=setTimeout(function(){P||l(ke,["oneclick","onetap","voneclick"],k,{x:oe[0],y:oe[1]})},ce.multiClickDebounceTime()),Y=k.timeStamp)),ke==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!u(k)&&(ce.$(a).unselect(["tapunselect"]),Se.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Se=ce.collection()),Re==ke&&!t.dragData.didDrag&&!t.hoverData.selecting&&Re!=null&&Re._private.selectable&&(t.hoverData.dragging||(ce.selectionType()==="additive"||Me?Re.selected()?Re.unselect(["tapunselect"]):Re.select(["tapselect"]):Me||(ce.$(a).unmerge(Re).unselect(["tapunselect"]),Re.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ne=ce.collection(t.getAllInBox(me[0],me[1],me[2],me[3]));t.redrawHint("select",!0),Ne.length>0&&t.redrawHint("eles",!0),ce.emit(Pe("boxend"));var tt=function(wt){return wt.selectable()&&!wt.selected()};ce.selectionType()==="additive"||Me||ce.$(a).unmerge(Ne).unselect(),Ne.emit(Pe("box")).stdFilter(tt).select().emit(Pe("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 $e=ke&&ke.grabbed();S(Se),$e&&(ke.emit(Pe("freeon")),Se.emit(Pe("free")),t.dragData.didDrag&&(ke.emit(Pe("dragfreeon")),Se.emit(Pe("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 I=[],L=4,H,F=1e5,Q=function(k,te){for(var ce=0;ce<k.length;ce++)if(k[ce]%te!==0)return!1;return!0},J=function(k){for(var te=Math.abs(k[0]),ce=1;ce<k.length;ce++)if(Math.abs(k[ce])!==te)return!1;return!0},M=function(k){var te=!1,ce=k.deltaY;if(ce==null&&(k.wheelDeltaY!=null?ce=k.wheelDeltaY/4:k.wheelDelta!=null&&(ce=k.wheelDelta/4)),ce!==0){if(H==null)if(I.length>=L){var oe=I;if(H=Q(oe,5),!H){var me=Math.abs(oe[0]);H=J(oe)&&me>5}if(H)for(var Re=0;Re<oe.length;Re++)F=Math.min(Math.abs(oe[Re]),F)}else I.push(ce),te=!0;else H&&(F=Math.min(Math.abs(ce),F));if(!t.scrollingPage){var Se=t.cy,ke=Se.zoom(),Me=Se.pan(),Pe=t.projectIntoViewport(k.clientX,k.clientY),Ke=[Pe[0]*ke+Me.x,Pe[1]*ke+Me.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||_()){k.preventDefault();return}if(Se.panningEnabled()&&Se.userPanningEnabled()&&Se.zoomingEnabled()&&Se.userZoomingEnabled()){k.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 Ze;te&&Math.abs(ce)>5&&(ce=Zh(ce)*5),Ze=ce/-250,H&&(Ze/=F,Ze*=3),Ze=Ze*t.wheelSensitivity;var Ne=k.deltaMode===1;Ne&&(Ze*=33);var tt=Se.zoom()*Math.pow(10,Ze);k.type==="gesturechange"&&(tt=t.gestureStartZoom*k.scale),Se.zoom({level:tt,renderedPosition:{x:Ke[0],y:Ke[1]}}),Se.emit({type:k.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:k,position:{x:Pe[0],y:Pe[1]}})}}}};t.registerBinding(t.container,"wheel",M,!0),t.registerBinding(e,"scroll",function(k){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(k){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||k.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ye){t.hasTouchStarted||M(ye)},!0),t.registerBinding(t.container,"mouseout",function(k){var te=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseout",position:{x:te[0],y:te[1]}})},!1),t.registerBinding(t.container,"mouseover",function(k){var te=t.projectIntoViewport(k.clientX,k.clientY);t.cy.emit({originalEvent:k,type:"mouseover",position:{x:te[0],y:te[1]}})},!1);var G,Z,W,ae,se,he,we,de,$,re,le,pe,j,xe=function(k,te,ce,oe){return Math.sqrt((ce-k)*(ce-k)+(oe-te)*(oe-te))},Be=function(k,te,ce,oe){return(ce-k)*(ce-k)+(oe-te)*(oe-te)},Ue;t.registerBinding(t.container,"touchstart",Ue=function(k){if(t.hasTouchStarted=!0,!!U(k)){C(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var te=t.cy,ce=t.touchData.now,oe=t.touchData.earlier;if(k.touches[0]){var me=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);ce[0]=me[0],ce[1]=me[1]}if(k.touches[1]){var me=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);ce[2]=me[0],ce[3]=me[1]}if(k.touches[2]){var me=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);ce[4]=me[0],ce[5]=me[1]}var Re=function(jt){return{originalEvent:k,type:jt,position:{x:ce[0],y:ce[1]}}};if(k.touches[1]){t.touchData.singleTouchMoved=!0,S(t.dragData.touchDragEles);var Se=t.findContainerClientCoords();$=Se[0],re=Se[1],le=Se[2],pe=Se[3],G=k.touches[0].clientX-$,Z=k.touches[0].clientY-re,W=k.touches[1].clientX-$,ae=k.touches[1].clientY-re,j=0<=G&&G<=le&&0<=W&&W<=le&&0<=Z&&Z<=pe&&0<=ae&&ae<=pe;var ke=te.pan(),Me=te.zoom();se=xe(G,Z,W,ae),he=Be(G,Z,W,ae),we=[(G+W)/2,(Z+ae)/2],de=[(we[0]-ke.x)/Me,(we[1]-ke.y)/Me];var Pe=200,Ke=Pe*Pe;if(he<Ke&&!k.touches[2]){var Ze=t.findNearestElement(ce[0],ce[1],!0,!0),Ne=t.findNearestElement(ce[2],ce[3],!0,!0);Ze&&Ze.isNode()?(Ze.activate().emit(Re("cxttapstart")),t.touchData.start=Ze):Ne&&Ne.isNode()?(Ne.activate().emit(Re("cxttapstart")),t.touchData.start=Ne):te.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(k.touches[2])te.boxSelectionEnabled()&&k.preventDefault();else if(!k.touches[1]){if(k.touches[0]){var tt=t.findNearestElements(ce[0],ce[1],!0,!0),$e=tt[0];if($e!=null&&($e.activate(),t.touchData.start=$e,t.touchData.starts=tt,t.nodeIsGrabbable($e))){var Vt=t.dragData.touchDragEles=te.collection(),wt=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),$e.selected()?(wt=te.$(function(Gt){return Gt.selected()&&t.nodeIsGrabbable(Gt)}),w(wt,{addToList:Vt})):x($e,{addToList:Vt}),g($e),$e.emit(Re("grabon")),wt?wt.forEach(function(Gt){Gt.emit(Re("grab"))}):$e.emit(Re("grab"))}l($e,["touchstart","tapstart","vmousedown"],k,{x:ce[0],y:ce[1]}),$e==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"],k,{x:ce[0],y:ce[1]})},t.tapholdDuration)}}if(k.touches.length>=1){for(var ma=t.touchData.startPosition=[null,null,null,null,null,null],Ut=0;Ut<ce.length;Ut++)ma[Ut]=oe[Ut]=ce[Ut];var Xt=k.touches[0];t.touchData.startGPosition=[Xt.clientX,Xt.clientY]}}},!1);var Ve;t.registerBinding(e,"touchmove",Ve=function(k){var te=t.touchData.capture;if(!(!te&&!U(k))){var ce=t.selection,oe=t.cy,me=t.touchData.now,Re=t.touchData.earlier,Se=oe.zoom();if(k.touches[0]){var ke=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);me[0]=ke[0],me[1]=ke[1]}if(k.touches[1]){var ke=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);me[2]=ke[0],me[3]=ke[1]}if(k.touches[2]){var ke=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);me[4]=ke[0],me[5]=ke[1]}var Me=function(hs){return{originalEvent:k,type:hs,position:{x:me[0],y:me[1]}}},Pe=t.touchData.startGPosition,Ke;if(te&&k.touches[0]&&Pe){for(var Ze=[],Ne=0;Ne<me.length;Ne++)Ze[Ne]=me[Ne]-Re[Ne];var tt=k.touches[0].clientX-Pe[0],$e=tt*tt,Vt=k.touches[0].clientY-Pe[1],wt=Vt*Vt,ma=$e+wt;Ke=ma>=t.touchTapThreshold2}if(te&&t.touchData.cxt){k.preventDefault();var Ut=k.touches[0].clientX-$,Xt=k.touches[0].clientY-re,Gt=k.touches[1].clientX-$,jt=k.touches[1].clientY-re,rr=Be(Ut,Xt,Gt,jt),Ht=rr/he,nr=150,oa=nr*nr,kt=1.5,ra=kt*kt;if(Ht>=ra||rr>=oa){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var qa=Me("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(qa),t.touchData.start=null):oe.emit(qa)}}if(te&&t.touchData.cxt){var qa=Me("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(qa):oe.emit(qa),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var fa=t.findNearestElement(me[0],me[1],!0,!0);(!t.touchData.cxtOver||fa!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Me("cxtdragout")),t.touchData.cxtOver=fa,fa&&fa.emit(Me("cxtdragover")))}else if(te&&k.touches[2]&&oe.boxSelectionEnabled())k.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||oe.emit(Me("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(te&&k.touches[1]&&!t.touchData.didSelect&&oe.zoomingEnabled()&&oe.panningEnabled()&&oe.userZoomingEnabled()&&oe.userPanningEnabled()){k.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ca=t.dragData.touchDragEles;if(ca){t.redrawHint("drag",!0);for(var Da=0;Da<ca.length;Da++){var un=ca[Da]._private;un.grabbed=!1,un.rscratch.inDragLayer=!1}}var va=t.touchData.start,Ut=k.touches[0].clientX-$,Xt=k.touches[0].clientY-re,Gt=k.touches[1].clientX-$,jt=k.touches[1].clientY-re,Ni=xe(Ut,Xt,Gt,jt),sn=Ni/se;if(j){var on=Ut-G,ti=Xt-Z,fn=Gt-W,Qt=jt-ae,cs=(on+fn)/2,vs=(ti+Qt)/2,Ka=oe.zoom(),Tr=Ka*sn,Li=oe.pan(),Ul=de[0]*Ka+Li.x,Hl=de[1]*Ka+Li.y,Mf={x:-Tr/Ka*(Ul-Li.x-cs)+Ul,y:-Tr/Ka*(Hl-Li.y-vs)+Hl};if(va&&va.active()){var ca=t.dragData.touchDragEles;S(ca),t.redrawHint("drag",!0),t.redrawHint("eles",!0),va.unactivate().emit(Me("freeon")),ca.emit(Me("free")),t.dragData.didDrag&&(va.emit(Me("dragfreeon")),ca.emit(Me("dragfree")))}oe.viewport({zoom:Tr,pan:Mf,cancelOnFailedZoom:!0}),oe.emit(Me("pinchzoom")),se=Ni,G=Ut,Z=Xt,W=Gt,ae=jt,t.pinching=!0}if(k.touches[0]){var ke=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);me[0]=ke[0],me[1]=ke[1]}if(k.touches[1]){var ke=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);me[2]=ke[0],me[3]=ke[1]}if(k.touches[2]){var ke=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);me[4]=ke[0],me[5]=ke[1]}}else if(k.touches[0]&&!t.touchData.didSelect){var Ba=t.touchData.start,cn=t.touchData.last,fa;if(!t.hoverData.draggingEles&&!t.swipePanning&&(fa=t.findNearestElement(me[0],me[1],!0,!0)),te&&Ba!=null&&k.preventDefault(),te&&Ba!=null&&t.nodeIsDraggable(Ba))if(Ke){var ca=t.dragData.touchDragEles,ir=!t.dragData.didDrag;ir&&w(ca,{inDragLayer:!0}),t.dragData.didDrag=!0;var da={x:0,y:0};if(Te(Ze[0])&&Te(Ze[1])&&(da.x+=Ze[0],da.y+=Ze[1],ir)){t.redrawHint("eles",!0);var Va=t.touchData.dragDelta;Va&&Te(Va[0])&&Te(Va[1])&&(da.x+=Va[0],da.y+=Va[1])}t.hoverData.draggingEles=!0,ca.silentShift(da).emit(Me("position")).emit(Me("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 Va=t.touchData.dragDelta=t.touchData.dragDelta||[];Va.length===0?(Va.push(Ze[0]),Va.push(Ze[1])):(Va[0]+=Ze[0],Va[1]+=Ze[1])}if(l(Ba||fa,["touchmove","tapdrag","vmousemove"],k,{x:me[0],y:me[1]}),(!Ba||!Ba.grabbed())&&fa!=cn&&(cn&&cn.emit(Me("tapdragout")),fa&&fa.emit(Me("tapdragover"))),t.touchData.last=fa,te)for(var Da=0;Da<me.length;Da++)me[Da]&&t.touchData.startPosition[Da]&&Ke&&(t.touchData.singleTouchMoved=!0);if(te&&(Ba==null||Ba.pannable())&&oe.panningEnabled()&&oe.userPanningEnabled()){var Rf=o(Ba,t.touchData.starts);Rf&&(k.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=wl(t.touchData.startPosition)),t.swipePanning?(oe.panBy({x:Ze[0]*Se,y:Ze[1]*Se}),oe.emit(Me("dragpan"))):Ke&&(t.swipePanning=!0,oe.panBy({x:tt*Se,y:Vt*Se}),oe.emit(Me("dragpan")),Ba&&(Ba.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ke=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);me[0]=ke[0],me[1]=ke[1]}}for(var Ne=0;Ne<me.length;Ne++)Re[Ne]=me[Ne];te&&k.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 Ae;t.registerBinding(e,"touchcancel",Ae=function(k){var te=t.touchData.start;t.touchData.capture=!1,te&&te.unactivate()});var Ce,_e,He,je;if(t.registerBinding(e,"touchend",Ce=function(k){var te=t.touchData.start,ce=t.touchData.capture;if(ce)k.touches.length===0&&(t.touchData.capture=!1),k.preventDefault();else return;var oe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var me=t.cy,Re=me.zoom(),Se=t.touchData.now,ke=t.touchData.earlier;if(k.touches[0]){var Me=t.projectIntoViewport(k.touches[0].clientX,k.touches[0].clientY);Se[0]=Me[0],Se[1]=Me[1]}if(k.touches[1]){var Me=t.projectIntoViewport(k.touches[1].clientX,k.touches[1].clientY);Se[2]=Me[0],Se[3]=Me[1]}if(k.touches[2]){var Me=t.projectIntoViewport(k.touches[2].clientX,k.touches[2].clientY);Se[4]=Me[0],Se[5]=Me[1]}var Pe=function(oa){return{originalEvent:k,type:oa,position:{x:Se[0],y:Se[1]}}};te&&te.unactivate();var Ke;if(t.touchData.cxt){if(Ke=Pe("cxttapend"),te?te.emit(Ke):me.emit(Ke),!t.touchData.cxtDragged){var Ze=Pe("cxttap");te?te.emit(Ze):me.emit(Ze)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!k.touches[2]&&me.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ne=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(Pe("boxend"));var tt=function(oa){return oa.selectable()&&!oa.selected()};Ne.emit(Pe("box")).stdFilter(tt).select().emit(Pe("boxselect")),Ne.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(te?.unactivate(),k.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!k.touches[1]){if(!k.touches[0]){if(!k.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var $e=t.dragData.touchDragEles;if(te!=null){var Vt=te._private.grabbed;S($e),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Vt&&(te.emit(Pe("freeon")),$e.emit(Pe("free")),t.dragData.didDrag&&(te.emit(Pe("dragfreeon")),$e.emit(Pe("dragfree")))),l(te,["touchend","tapend","vmouseup","tapdragout"],k,{x:Se[0],y:Se[1]}),te.unactivate(),t.touchData.start=null}else{var wt=t.findNearestElement(Se[0],Se[1],!0,!0);l(wt,["touchend","tapend","vmouseup","tapdragout"],k,{x:Se[0],y:Se[1]})}var ma=t.touchData.startPosition[0]-Se[0],Ut=ma*ma,Xt=t.touchData.startPosition[1]-Se[1],Gt=Xt*Xt,jt=Ut+Gt,rr=jt*Re*Re;t.touchData.singleTouchMoved||(te||me.$(":selected").unselect(["tapunselect"]),l(te,["tap","vclick"],k,{x:Se[0],y:Se[1]}),_e=!1,k.timeStamp-je<=me.multiClickDebounceTime()?(He&&clearTimeout(He),_e=!0,je=null,l(te,["dbltap","vdblclick"],k,{x:Se[0],y:Se[1]})):(He=setTimeout(function(){_e||l(te,["onetap","voneclick"],k,{x:Se[0],y:Se[1]})},me.multiClickDebounceTime()),je=k.timeStamp)),te!=null&&!t.dragData.didDrag&&te._private.selectable&&rr<t.touchTapThreshold2&&!t.pinching&&(me.selectionType()==="single"?(me.$(a).unmerge(te).unselect(["tapunselect"]),te.select(["tapselect"])):te.selected()?te.unselect(["tapunselect"]):te.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Ht=0;Ht<Se.length;Ht++)ke[Ht]=Se[Ht];t.dragData.didDrag=!1,k.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),k.touches.length<2&&(k.touches.length===1&&(t.touchData.startGPosition=[k.touches[0].clientX,k.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var De=[],We=function(k){return{clientX:k.clientX,clientY:k.clientY,force:1,identifier:k.pointerId,pageX:k.pageX,pageY:k.pageY,radiusX:k.width/2,radiusY:k.height/2,screenX:k.screenX,screenY:k.screenY,target:k.target}},rt=function(k){return{event:k,touch:We(k)}},ft=function(k){De.push(rt(k))},st=function(k){for(var te=0;te<De.length;te++){var ce=De[te];if(ce.event.pointerId===k.pointerId){De.splice(te,1);return}}},dt=function(k){var te=De.filter(function(ce){return ce.event.pointerId===k.pointerId})[0];te.event=k,te.touch=We(k)},Xe=function(k){k.touches=De.map(function(te){return te.touch})},ze=function(k){return k.pointerType==="mouse"||k.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ye){ze(ye)||(ye.preventDefault(),ft(ye),Xe(ye),Ue(ye))}),t.registerBinding(t.container,"pointerup",function(ye){ze(ye)||(st(ye),Xe(ye),Ce(ye))}),t.registerBinding(t.container,"pointercancel",function(ye){ze(ye)||(st(ye),Xe(ye),Ae(ye))}),t.registerBinding(t.container,"pointermove",function(ye){ze(ye)||(ye.preventDefault(),dt(ye),Xe(ye),Ve(ye))})}};var nn={};nn.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,l,u,o,f,d){this.renderer.nodeShapeImpl("polygon",n,l,u,o,f,this.points)},intersectLine:function(n,l,u,o,f,d,c,h){return ju(f,d,this.points,n,l,u/2,o/2,c)},checkPoint:function(n,l,u,o,f,d,c,h){return rn(n,l,this.points,d,c,o,f,[0,-1],u)},hasMiterBounds:t!=="rectangle",miterBounds:function(n,l,u,o,f,d){return wT(this.points,n,l,u,o,f)}}};nn.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,f,d){return zT(u,o,e,a,n/2+f,l/2+f)},checkPoint:function(e,a,n,l,u,o,f,d){return Ti(e,a,l,u,o,f,n)}}};nn.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,l,u,o,f,d,c){if(d[c]!==void 0&&d[c+"-cx"]===n&&d[c+"-cy"]===l)return d[c];d[c]=new Array(e.length/2),d[c+"-cx"]=n,d[c+"-cy"]=l;var h=u/2,g=o/2;f=f==="auto"?s2(u,o):f;for(var y=new Array(e.length/2),E=0;E<e.length/2;E++)y[E]={x:n+h*e[E*2],y:l+g*e[E*2+1]};var b,w,x,S,T=y.length;for(w=y[T-1],b=0;b<T;b++)x=y[b%T],S=y[(b+1)%T],d[c][b]=sg(w,x,S,f),w=x,x=S;return d[c]},draw:function(n,l,u,o,f,d,c){this.renderer.nodeShapeImpl("round-polygon",n,l,u,o,f,this.points,this.getOrCreateCorners(l,u,o,f,d,c,"drawCorners"))},intersectLine:function(n,l,u,o,f,d,c,h,g){return NT(f,d,this.points,n,l,u,o,c,this.getOrCreateCorners(n,l,u,o,h,g,"corners"))},checkPoint:function(n,l,u,o,f,d,c,h,g){return RT(n,l,this.points,d,c,o,f,this.getOrCreateCorners(d,c,o,f,h,g,"corners"))}}};nn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:La(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,f,d){return l2(u,o,e,a,n,l,f,d)},checkPoint:function(e,a,n,l,u,o,f,d){var c=l/2,h=u/2;d=d==="auto"?In(l,u):d,d=Math.min(c,h,d);var g=d*2;return!!(rn(e,a,this.points,o,f,l,u-g,[0,-1],n)||rn(e,a,this.points,o,f,l-g,u,[0,-1],n)||Ti(e,a,g,g,o-c+d,f-h+d,n)||Ti(e,a,g,g,o+c-d,f-h+d,n)||Ti(e,a,g,g,o+c-d,f+h-d,n)||Ti(e,a,g,g,o-c+d,f+h-d,n))}}};nn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Jh(),points:La(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,f=a/2,d=e/2,c=n-d,h=n+d,g=l-f,y=l+f;return{topLeft:[c,g+o,c+o,g,c+o,g+o],topRight:[h-o,g,h,g+o,h-o,g+o],bottomRight:[h,y-o,h-o,y,h-o,y-o],bottomLeft:[c+o,y,c,y-o,c+o,y-o]}},intersectLine:function(e,a,n,l,u,o,f,d){var c=this.generateCutTrianglePts(n+2*f,l+2*f,e,a,d),h=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return ju(u,o,h,e,a)},checkPoint:function(e,a,n,l,u,o,f,d){var c=d==="auto"?this.cornerLength:d;if(rn(e,a,this.points,o,f,l,u-2*c,[0,-1],n)||rn(e,a,this.points,o,f,l-2*c,u,[0,-1],n))return!0;var h=this.generateCutTrianglePts(l,u,o,f);return Xa(e,a,h.topLeft)||Xa(e,a,h.topRight)||Xa(e,a,h.bottomRight)||Xa(e,a,h.bottomLeft)}}};nn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:La(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,f,d){var c=.15,h=.5,g=.85,y=this.generateBarrelBezierPts(n+2*f,l+2*f,e,a),E=function(x){var S=Al({x:x[0],y:x[1]},{x:x[2],y:x[3]},{x:x[4],y:x[5]},c),T=Al({x:x[0],y:x[1]},{x:x[2],y:x[3]},{x:x[4],y:x[5]},h),C=Al({x:x[0],y:x[1]},{x:x[2],y:x[3]},{x:x[4],y:x[5]},g);return[x[0],x[1],S.x,S.y,T.x,T.y,C.x,C.y,x[4],x[5]]},b=[].concat(E(y.topLeft),E(y.topRight),E(y.bottomRight),E(y.bottomLeft));return ju(u,o,b,e,a)},generateBarrelBezierPts:function(e,a,n,l){var u=a/2,o=e/2,f=n-o,d=n+o,c=l-u,h=l+u,g=Sh(e,a),y=g.heightOffset,E=g.widthOffset,b=g.ctrlPtOffsetPct*e,w={topLeft:[f,c+y,f+b,c,f+E,c],topRight:[d-E,c,d-b,c,d,c+y],bottomRight:[d,h-y,d-b,h,d-E,h],bottomLeft:[f+E,h,f+b,h,f,h-y]};return w.topLeft.isTop=!0,w.topRight.isTop=!0,w.bottomLeft.isBottom=!0,w.bottomRight.isBottom=!0,w},checkPoint:function(e,a,n,l,u,o,f,d){var c=Sh(l,u),h=c.heightOffset,g=c.widthOffset;if(rn(e,a,this.points,o,f,l,u-2*h,[0,-1],n)||rn(e,a,this.points,o,f,l-2*g,u,[0,-1],n))return!0;for(var y=this.generateBarrelBezierPts(l,u,o,f),E=function(O,_,U){var V=U[4],q=U[2],P=U[0],Y=U[5],I=U[1],L=Math.min(V,P),H=Math.max(V,P),F=Math.min(Y,I),Q=Math.max(Y,I);if(L<=O&&O<=H&&F<=_&&_<=Q){var J=LT(V,q,P),M=AT(J[0],J[1],J[2],O),G=M.filter(function(Z){return 0<=Z&&Z<=1});if(G.length>0)return G[0]}return null},b=Object.keys(y),w=0;w<b.length;w++){var x=b[w],S=y[x],T=E(e,a,S);if(T!=null){var C=S[5],D=S[3],R=S[1],z=ga(C,D,R,T);if(S.isTop&&z<=a||S.isBottom&&a<=z)return!0}}return!1}}};nn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:La(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,f,d){var c=e-(n/2+f),h=a-(l/2+f),g=h,y=e+(n/2+f),E=Hn(u,o,e,a,c,h,y,g,!1);return E.length>0?E:l2(u,o,e,a,n,l,f,d)},checkPoint:function(e,a,n,l,u,o,f,d){d=d==="auto"?In(l,u):d;var c=2*d;if(rn(e,a,this.points,o,f,l,u-c,[0,-1],n)||rn(e,a,this.points,o,f,l-c,u,[0,-1],n))return!0;var h=l/2+2*n,g=u/2+2*n,y=[o-h,f-g,o-h,f,o+h,f,o+h,f-g];return!!(Xa(e,a,y)||Ti(e,a,c,c,o+l/2-d,f+u/2-d,n)||Ti(e,a,c,c,o-l/2+d,f+u/2-d,n))}}};nn.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",La(3,0)),this.generateRoundPolygon("round-triangle",La(3,0)),this.generatePolygon("rectangle",La(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",La(5,0)),this.generateRoundPolygon("round-pentagon",La(5,0)),this.generatePolygon("hexagon",La(6,0)),this.generateRoundPolygon("round-hexagon",La(6,0)),this.generatePolygon("heptagon",La(7,0)),this.generateRoundPolygon("round-heptagon",La(7,0)),this.generatePolygon("octagon",La(8,0)),this.generateRoundPolygon("round-octagon",La(8,0));var n=new Array(20);{var l=xh(5,0),u=xh(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var f=0;f<u.length/2;f++)u[f*2]*=o,u[f*2+1]*=o;for(var f=0;f<20/4;f++)n[f*4]=l[f*2],n[f*4+1]=l[f*2+1],n[f*4+2]=u[f*2],n[f*4+3]=u[f*2+1]}n=u2(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 d=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",d),this.generateRoundPolygon("round-tag",d)}t.makePolygon=function(c){var h=c.join("$"),g="polygon-"+h,y;return(y=this[g])?y:e.generatePolygon(g,c)}};var os={};os.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};os.redraw=function(t){t=t||a2();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};os.beforeRender=function(t,e){if(!this.destroyed){e==null&&qt("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 p1=function(e,a,n){for(var l=e.beforeRenderCallbacks,u=0;u<l.length;u++)l[u].fn(a,n)};os.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){p1(t,!0,l);var u=an();t.render(t.renderOptions);var o=t.lastDrawTime=an();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 f=o-u;t.redrawTotalTime+=f,t.lastRedrawTime=f,t.averageRedrawTime=t.averageRedrawTime/2+f/2,t.requestedFrame=!1}else p1(t,!1,l);t.skipFrame=!1,Wo(a)}};Wo(a)}};var QD=function(e){this.init(e)},sE=QD,Vl=sE.prototype;Vl.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Vl.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",f="__________cytoscape_container",d=l.getElementById(o)!=null;if(a.className.indexOf(f)<0&&(a.className=(a.className||"")+" "+f),!d){var c=l.createElement("style");c.id=o,c.textContent="."+f+" { position: relative; }",u.insertBefore(c,u.children[0])}var h=n.getComputedStyle(a),g=h.getPropertyValue("position");g==="static"&&Et("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=Te(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()};Vl.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()}};Vl.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{}};Vl.isHeadless=function(){return!1};[ug,lE,uE,ql,nn,os].forEach(function(t){Fe(Vl,t)});var ch=1e3/60,oE={setupDequeueing:function(e){return function(){var n=this,l=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var u=ns(function(){l.redrawHint("eles",!0),l.redrawHint("drag",!0),l.redraw()},e.deqRedrawThreshold),o=function(c,h){var g=an(),y=l.averageRedrawTime,E=l.lastRedrawTime,b=[],w=l.cy.extent(),x=l.getPixelRatio();for(c||l.flushRenderedStyleQueue();;){var S=an(),T=S-g,C=S-h;if(E<ch){var D=ch-(c?y:0);if(C>=e.deqFastCost*D)break}else if(c){if(T>=e.deqCost*E||T>=e.deqAvgCost*y)break}else if(C>=e.deqNoDrawCost*ch)break;var R=e.deq(n,x,w);if(R.length>0)for(var z=0;z<R.length;z++)b.push(R[z]);else break}b.length>0&&(e.onDeqd(n,b),!c&&e.shouldRedraw(n,b,x,w)&&u())},f=e.priority||Xh;l.beforeRender(o,f(n))}}}},JD=(function(){function t(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$o;Zn(this,t),this.idsByKey=new tn,this.keyForId=new tn,this.cachesByLvl=new tn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=a}return Qn(t,[{key:"getIdsFor",value:function(a){a==null&&qt("Can not get id list for null key");var n=this.idsByKey,l=this.idsByKey.get(a);return l||(l=new Nl,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 tn,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}}])})(),y1=25,qo=50,Ko=-4,kh=3,fE=7.99,WD=8,$D=1024,eB=1024,tB=1024,aB=.2,rB=.8,nB=10,iB=.15,lB=.1,uB=.9,sB=.9,oB=100,fB=1,Cl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},cB=Ca({getKey:null,doesEleInvalidateKey:$o,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:$1,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Uu=function(e,a){var n=this;n.renderer=e,n.onDequeues=[];var l=cB(a);Fe(n,l),n.lookup=new JD(l.getKey,l.doesEleInvalidateKey),n.setupDequeueing()},sa=Uu.prototype;sa.reasons=Cl;sa.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};sa.getRetiredTextureQueue=function(t){var e=this,a=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=a[t]=a[t]||[];return n};sa.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new is(function(a,n){return n.reqs-a.reqs});return e};sa.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};sa.getElement=function(t,e,a,n,l){var u=this,o=this.renderer,f=o.cy.zoom(),d=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(Kh(f*a))),n<Ko)n=Ko;else if(f>=fE||n>kh)return null;var c=Math.pow(2,n),h=e.h*c,g=e.w*c,y=o.eleTextBiggerThanMin(t,c);if(!this.isVisible(t,y))return null;var E=d.get(t,n);if(E&&E.invalidated&&(E.invalidated=!1,E.texture.invalidatedWidth-=E.width),E)return E;var b;if(h<=y1?b=y1:h<=qo?b=qo:b=Math.ceil(h/qo)*qo,h>tB||g>eB)return null;var w=u.getTextureQueue(b),x=w[w.length-2],S=function(){return u.recycleTexture(b,g)||u.addTexture(b,g)};x||(x=w[w.length-1]),x||(x=S()),x.width-x.usedWidth<g&&(x=S());for(var T=function(L){return L&&L.scaledLabelShown===y},C=l&&l===Cl.dequeue,D=l&&l===Cl.highQuality,R=l&&l===Cl.downscale,z,B=n+1;B<=kh;B++){var O=d.get(t,B);if(O){z=O;break}}var _=z&&z.level===n+1?z:null,U=function(){x.context.drawImage(_.texture.canvas,_.x,0,_.width,_.height,x.usedWidth,0,g,h)};if(x.context.setTransform(1,0,0,1,0,0),x.context.clearRect(x.usedWidth,0,g,b),T(_))U();else if(T(z))if(D){for(var V=z.level;V>n;V--)_=u.getElement(t,e,a,V,Cl.downscale);U()}else return u.queueElement(t,z.level-1),z;else{var q;if(!C&&!D&&!R)for(var P=n-1;P>=Ko;P--){var Y=d.get(t,P);if(Y){q=Y;break}}if(T(q))return u.queueElement(t,n),q;x.context.translate(x.usedWidth,0),x.context.scale(c,c),this.drawElement(x.context,t,e,y,!1),x.context.scale(1/c,1/c),x.context.translate(-x.usedWidth,0)}return E={x:x.usedWidth,texture:x,level:n,scale:c,width:g,height:h,scaledLabelShown:y},x.usedWidth+=Math.ceil(g+WD),x.eleCaches.push(E),d.set(t,n,E),u.checkTextureFullness(x),E};sa.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};sa.invalidateElement=function(t){var e=this,a=e.lookup,n=[],l=a.isInvalid(t);if(l){for(var u=Ko;u<=kh;u++){var o=a.getForCachedKey(t,u);o&&n.push(o)}var f=a.invalidate(t);if(f)for(var d=0;d<n.length;d++){var c=n[d],h=c.texture;h.invalidatedWidth+=c.width,c.invalidated=!0,e.checkTextureUtility(h)}e.removeFromQueue(t)}};sa.checkTextureUtility=function(t){t.invalidatedWidth>=aB*t.width&&this.retireTexture(t)};sa.checkTextureFullness=function(t){var e=this,a=e.getTextureQueue(t.height);t.usedWidth/t.width>rB&&t.fullnessChecks>=nB?Fn(a,t):t.fullnessChecks++};sa.retireTexture=function(t){var e=this,a=t.height,n=e.getTextureQueue(a),l=this.lookup;Fn(n,t),t.retired=!0;for(var u=t.eleCaches,o=0;o<u.length;o++){var f=u[o];l.deleteCache(f.key,f.level)}jh(u);var d=e.getRetiredTextureQueue(a);d.push(t)};sa.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($D,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};sa.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,jh(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Fn(l,o),n.push(o),o}};sa.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 f={eles:t.spawn().merge(t),level:e,reqs:1,key:u};n.push(f),l[u]=f}};sa.dequeue=function(t){for(var e=this,a=e.getElementQueue(),n=e.getElementKeyToQueue(),l=[],u=e.lookup,o=0;o<fB&&a.size()>0;o++){var f=a.pop(),d=f.key,c=f.eles[0],h=u.hasCache(c,f.level);if(n[d]=null,h)continue;l.push(f);var g=e.getBoundingBox(c);e.getElement(c,g,t,f.level,Cl.dequeue)}return l};sa.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=Ih,a.updateItem(u),a.pop(),n[l]=null):u.eles.unmerge(t))};sa.onDequeue=function(t){this.onDequeues.push(t)};sa.offDequeue=function(t){Fn(this.onDequeues,t)};sa.setupDequeueing=oE.setupDequeueing({deqRedrawThreshold:oB,deqCost:iB,deqAvgCost:lB,deqNoDrawCost:uB,deqFastCost:sB,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,f=0;f<o.length;f++){var d=o[f].boundingBox();if(Qh(d,l))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var vB=1,Pu=-4,sf=2,dB=3.99,hB=50,gB=50,pB=.15,yB=.1,mB=.9,bB=.9,EB=1,m1=250,xB=4e3*4e3,b1=32767,SB=!0,cE=function(e){var a=this,n=a.renderer=e,l=n.cy;a.layersByLevel={},a.firstGet=!0,a.lastInvalidationTime=an()-2*m1,a.skipping=!1,a.eleTxrDeqs=l.collection(),a.scheduleElementRefinement=ns(function(){a.refineElementTextures(a.eleTxrDeqs),a.eleTxrDeqs.unmerge(a.eleTxrDeqs)},gB),n.beforeRender(function(o,f){f-a.lastInvalidationTime<=m1?a.skipping=!0:a.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var u=function(f,d){return d.reqs-f.reqs};a.layersQueue=new is(u),a.setupDequeueing()},Aa=cE.prototype,E1=0,wB=Math.pow(2,53)-1;Aa.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:E1=++E1%wB,bb:t,level:e,width:n,height:l,canvas:u,context:u.getContext("2d"),eles:[],elesQueue:[],reqs:0},f=o.context,d=-o.bb.x1,c=-o.bb.y1;return f.scale(a,a),f.translate(d,c),o};Aa.getLayers=function(t,e,a){var n=this,l=n.renderer,u=l.cy,o=u.zoom(),f=n.firstGet;if(n.firstGet=!1,a==null){if(a=Math.ceil(Kh(o*e)),a<Pu)a=Pu;else if(o>=dB||a>sf)return null}n.validateLayersElesOrdering(a,t);var d=n.layersByLevel,c=Math.pow(2,a),h=d[a]=d[a]||[],g,y=n.levelIsComplete(a,t),E,b=function(){var U=function(I){if(n.validateLayersElesOrdering(I,t),n.levelIsComplete(I,t))return E=d[I],!0},V=function(I){if(!E)for(var L=a+I;Pu<=L&&L<=sf&&!U(L);L+=I);};V(1),V(-1);for(var q=h.length-1;q>=0;q--){var P=h[q];P.invalid&&Fn(h,P)}};if(!y)b();else return h;var w=function(){if(!g){g=ka();for(var U=0;U<t.length;U++)ET(g,t[U].boundingBox())}return g},x=function(U){U=U||{};var V=U.after;w();var q=Math.ceil(g.w*c),P=Math.ceil(g.h*c);if(q>b1||P>b1)return null;var Y=q*P;if(Y>xB)return null;var I=n.makeLayer(g,a);if(V!=null){var L=h.indexOf(V)+1;h.splice(L,0,I)}else(U.insert===void 0||U.insert)&&h.unshift(I);return I};if(n.skipping&&!f)return null;for(var S=null,T=t.length/vB,C=!f,D=0;D<t.length;D++){var R=t[D],z=R._private.rscratch,B=z.imgLayerCaches=z.imgLayerCaches||{},O=B[a];if(O){S=O;continue}if((!S||S.eles.length>=T||!i2(S.bb,R.boundingBox()))&&(S=x({insert:!0,after:S}),!S))return null;E||C?n.queueLayer(S,R):n.drawEleInLayer(S,R,a,e),S.eles.push(R),B[a]=S}return E||(C?null:h)};Aa.getEleLevelForLayerLevel=function(t,e){return t};Aa.drawEleInLayer=function(t,e,a,n){var l=this,u=this.renderer,o=t.context,f=e.boundingBox();f.w===0||f.h===0||!e.visible()||(a=l.getEleLevelForLayerLevel(a,n),u.setImgSmoothing(o,!1),u.drawCachedElement(o,e,null,null,a,SB),u.setImgSmoothing(o,!0))};Aa.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};Aa.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 f=u,o=0;o<l.eles.length;o++)if(l.eles[o]!==e[f+o]){this.invalidateLayer(l);break}}};Aa.updateElementsInLayers=function(t,e){for(var a=this,n=es(t[0]),l=0;l<t.length;l++)for(var u=n?null:t[l],o=n?t[l]:t[l].ele,f=o._private.rscratch,d=f.imgLayerCaches=f.imgLayerCaches||{},c=Pu;c<=sf;c++){var h=d[c];h&&(u&&a.getEleLevelForLayerLevel(h.level)!==u.level||e(h,o,u))}};Aa.haveLayers=function(){for(var t=this,e=!1,a=Pu;a<=sf;a++){var n=t.layersByLevel[a];if(n&&n.length>0){e=!0;break}}return e};Aa.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=an(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,l,u){e.invalidateLayer(n)}))};Aa.invalidateLayer=function(t){if(this.lastInvalidationTime=an(),!t.invalid){var e=t.level,a=t.eles,n=this.layersByLevel[e];Fn(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)}}};Aa.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 f=0;f<o.eles.length;f++)e.queueLayer(o,o.eles[f])})};Aa.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};Aa.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))}};Aa.dequeue=function(t){for(var e=this,a=e.layersQueue,n=[],l=0;l<EB&&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};Aa.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,f=o.imgLayerCaches=o.imgLayerCaches||{};f&&(f[t.level]=t)}e.requestRedraw()}};Aa.requestRedraw=ns(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);Aa.setupDequeueing=oE.setupDequeueing({deqRedrawThreshold:hB,deqCost:pB,deqAvgCost:yB,deqNoDrawCost:mB,deqFastCost:bB,deq:function(e,a){return e.dequeue(a)},onDeqd:Xh,shouldRedraw:$1,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var vE={},x1;function TB(t,e){for(var a=0;a<e.length;a++){var n=e[a];t.lineTo(n.x,n.y)}}function CB(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 S1(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,f=a[0];t.moveTo(f.x,f.y);for(var l=1;l<o.length;l++){var u=o[l];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function AB(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 f=0;f<u.length;f++){var d=u[f];t.lineTo(d.x,d.y)}t.closePath&&t.closePath()}function DB(t,e,a,n){t.arc(e,a,n,0,Math.PI*2,!1)}vE.arrowShapeImpl=function(t){return(x1||(x1={polygon:TB,"triangle-backcurve":CB,"triangle-tee":S1,"circle-triangle":AB,"triangle-cross":S1,circle:DB}))[t]};var kr={};kr.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)};kr.drawElementOverlay=function(t,e){var a=this;e.isNode()?a.drawNodeOverlay(t,e):a.drawEdgeOverlay(t,e)};kr.drawElementUnderlay=function(t,e){var a=this;e.isNode()?a.drawNodeUnderlay(t,e):a.drawEdgeUnderlay(t,e)};kr.drawCachedElementPortion=function(t,e,a,n,l,u,o,f){var d=this,c=a.getBoundingBox(e);if(!(c.w===0||c.h===0)){var h=a.getElement(e,c,n,l,u);if(h!=null){var g=f(d,e);if(g===0)return;var y=o(d,e),E=c.x1,b=c.y1,w=c.w,x=c.h,S,T,C,D,R;if(y!==0){var z=a.getRotationPoint(e);C=z.x,D=z.y,t.translate(C,D),t.rotate(y),R=d.getImgSmoothing(t),R||d.setImgSmoothing(t,!0);var B=a.getRotationOffset(e);S=B.x,T=B.y}else S=E,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,S,T,w,x),g!==1&&(t.globalAlpha=O),y!==0&&(t.rotate(-y),t.translate(-C,-D),R||d.setImgSmoothing(t,!1))}else a.drawElement(t,e)}};var BB=function(){return 0},MB=function(e,a){return e.getTextAngle(a,null)},RB=function(e,a){return e.getTextAngle(a,"source")},zB=function(e,a){return e.getTextAngle(a,"target")},OB=function(e,a){return a.effectiveOpacity()},vh=function(e,a){return a.pstyle("text-opacity").pfValue*a.effectiveOpacity()};kr.drawCachedElement=function(t,e,a,n,l,u){var o=this,f=o.data,d=f.eleTxrCache,c=f.lblTxrCache,h=f.slbTxrCache,g=f.tlbTxrCache,y=e.boundingBox(),E=u===!0?d.reasons.highQuality:null;if(!(y.w===0||y.h===0||!e.visible())&&(!n||Qh(y,n))){var b=e.isEdge(),w=e.element()._private.rscratch.badLine;o.drawElementUnderlay(t,e),o.drawCachedElementPortion(t,e,d,a,l,E,BB,OB),(!b||!w)&&o.drawCachedElementPortion(t,e,c,a,l,E,MB,vh),b&&!w&&(o.drawCachedElementPortion(t,e,h,a,l,E,RB,vh),o.drawCachedElementPortion(t,e,g,a,l,E,zB,vh)),o.drawElementOverlay(t,e)}};kr.drawElements=function(t,e){for(var a=this,n=0;n<e.length;n++){var l=e[n];a.drawElement(t,l)}};kr.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)}};kr.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)}};kr.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 f=u[o],d=f.bb;d.w===0||d.h===0||t.drawImage(f.canvas,d.x1,d.y1,d.w,d.h)}else l.drawCachedElements(t,e,a,n)};var ln={};ln.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,f=e._private.rscratch;if(!(u&&!e.visible())&&!(f.badLine||f.allpts==null||isNaN(f.allpts[0]))){var d;a&&(d=a,t.translate(-d.x1,-d.y1));var c=u?e.pstyle("opacity").value:1,h=u?e.pstyle("line-opacity").value:1,g=e.pstyle("curve-style").value,y=e.pstyle("line-style").value,E=e.pstyle("width").pfValue,b=e.pstyle("line-cap").value,w=e.pstyle("line-outline-width").value,x=e.pstyle("line-outline-color").value,S=c*h,T=c*h,C=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S;g==="straight-triangle"?(o.eleStrokeStyle(t,e,I),o.drawEdgeTrianglePath(e,t,f.allpts)):(t.lineWidth=E,t.lineCap=b,o.eleStrokeStyle(t,e,I),o.drawEdgePath(e,t,f.allpts,y),t.lineCap="butt")},D=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S;if(t.lineWidth=E+w,t.lineCap=b,w>0)o.colorStrokeStyle(t,x[0],x[1],x[2],I);else{t.lineCap="butt";return}g==="straight-triangle"?o.drawEdgeTrianglePath(e,t,f.allpts):(o.drawEdgePath(e,t,f.allpts,y),t.lineCap="butt")},R=function(){l&&o.drawEdgeOverlay(t,e)},z=function(){l&&o.drawEdgeUnderlay(t,e)},B=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;o.drawArrowheads(t,e,I)},O=function(){o.drawElementText(t,e,null,n)};t.lineJoin="round";var _=e.pstyle("ghost").value==="yes";if(_){var U=e.pstyle("ghost-offset-x").pfValue,V=e.pstyle("ghost-offset-y").pfValue,q=e.pstyle("ghost-opacity").value,P=S*q;t.translate(U,V),C(P),B(P),t.translate(-U,-V)}else D();z(),C(),B(),R(),O(),a&&t.translate(d.x1,d.y1)}};var dE=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(),f=n._private.rscratch,d=n.pstyle("".concat(e,"-padding")).pfValue,c=2*d,h=n.pstyle("".concat(e,"-color")).value;a.lineWidth=c,f.edgeType==="self"&&!o?a.lineCap="butt":a.lineCap="round",u.colorStrokeStyle(a,h[0],h[1],h[2],l),u.drawEdgePath(n,a,f.allpts,"solid")}}}};ln.drawEdgeOverlay=dE("overlay");ln.drawEdgeUnderlay=dE("underlay");ln.drawEdgePath=function(t,e,a,n){var l=t._private.rscratch,u=e,o,f=!1,d=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(d){var g=a.join("$"),y=l.pathCacheKey&&l.pathCacheKey===g;y?(o=e=l.pathCache,f=!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(c),u.lineDashOffset=h;break;case"solid":u.setLineDash([]);break}if(!f&&!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 E=2;E+3<a.length;E+=4)e.quadraticCurveTo(a[E],a[E+1],a[E+2],a[E+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 w=ja(l.roundCorners),x;try{for(w.s();!(x=w.n()).done;){var S=x.value;tE(e,S)}}catch(C){w.e(C)}finally{w.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,d?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};ln.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]),f=[u[1]/o,-u[0]/o],d=[f[0]*n/2,f[1]*n/2];e.beginPath(),e.moveTo(a[l]-d[0],a[l+1]-d[1]),e.lineTo(a[l]+d[0],a[l+1]+d[1]),e.lineTo(a[l+2],a[l+3]),e.closePath(),e.fill()}};ln.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)};ln.drawArrowhead=function(t,e,a,n,l,u,o){if(!(isNaN(n)||n==null||isNaN(l)||l==null||isNaN(u)||u==null)){var f=this,d=e.pstyle(a+"-arrow-shape").value;if(d!=="none"){var c=e.pstyle(a+"-arrow-fill").value==="hollow"?"both":"filled",h=e.pstyle(a+"-arrow-fill").value,g=e.pstyle("width").pfValue,y=e.pstyle(a+"-arrow-width"),E=y.value==="match-line"?g:y.pfValue;y.units==="%"&&(E*=g);var b=e.pstyle("opacity").value;o===void 0&&(o=b);var w=t.globalCompositeOperation;(o!==1||h==="hollow")&&(t.globalCompositeOperation="destination-out",f.colorFillStyle(t,255,255,255,1),f.colorStrokeStyle(t,255,255,255,1),f.drawArrowShape(e,t,c,g,d,E,n,l,u),t.globalCompositeOperation=w);var x=e.pstyle(a+"-arrow-color").value;f.colorFillStyle(t,x[0],x[1],x[2],o),f.colorStrokeStyle(t,x[0],x[1],x[2],o),f.drawArrowShape(e,t,h,g,d,E,n,l,u)}}};ln.drawArrowShape=function(t,e,a,n,l,u,o,f,d){var c=this,h=this.usePaths()&&l!=="triangle-cross",g=!1,y,E=e,b={x:o,y:f},w=t.pstyle("arrow-scale").value,x=this.getArrowWidth(n,w),S=c.arrowShapes[l];if(h){var T=c.arrowPathCache=c.arrowPathCache||[],C=Ci(l),D=T[C];D!=null?(y=e=D,g=!0):(y=e=new Path2D,T[C]=y)}g||(e.beginPath&&e.beginPath(),h?S.draw(e,1,0,{x:0,y:0},1):S.draw(e,x,d,b,n),e.closePath&&e.closePath()),e=E,h&&(e.translate(o,f),e.rotate(d),e.scale(x,x)),(a==="filled"||a==="both")&&(h?e.fill(y):e.fill()),(a==="hollow"||a==="both")&&(e.lineWidth=u/(h?x:1),e.lineJoin="miter",h?e.stroke(y):e.stroke()),h&&(e.scale(1/x,1/x),e.rotate(-d),e.translate(-o,-f))};var fg={};fg.safeDrawImage=function(t,e,a,n,l,u,o,f,d,c){if(!(l<=0||u<=0||d<=0||c<=0))try{t.drawImage(e,a,n,l,u,o,f,d,c)}catch(h){Et(h)}};fg.drawInscribedImage=function(t,e,a,n,l){var u=this,o=a.position(),f=o.x,d=o.y,c=a.cy().style(),h=c.getIndexedStyle.bind(c),g=h(a,"background-fit","value",n),y=h(a,"background-repeat","value",n),E=a.width(),b=a.height(),w=a.padding()*2,x=E+(h(a,"background-width-relative-to","value",n)==="inner"?0:w),S=b+(h(a,"background-height-relative-to","value",n)==="inner"?0:w),T=a._private.rscratch,C=h(a,"background-clip","value",n),D=C==="node",R=h(a,"background-image-opacity","value",n)*l,z=h(a,"background-image-smoothing","value",n),B=a.pstyle("corner-radius").value;B!=="auto"&&(B=a.pstyle("corner-radius").pfValue);var O=e.width||e.cachedW,_=e.height||e.cachedH;(O==null||_==null)&&(document.body.appendChild(e),O=e.cachedW=e.width||e.offsetWidth,_=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var U=O,V=_;if(h(a,"background-width","value",n)!=="auto"&&(h(a,"background-width","units",n)==="%"?U=h(a,"background-width","pfValue",n)*x: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)*S:V=h(a,"background-height","pfValue",n)),!(U===0||V===0)){if(g==="contain"){var q=Math.min(x/U,S/V);U*=q,V*=q}else if(g==="cover"){var q=Math.max(x/U,S/V);U*=q,V*=q}var P=f-x/2,Y=h(a,"background-position-x","units",n),I=h(a,"background-position-x","pfValue",n);Y==="%"?P+=(x-U)*I:P+=I;var L=h(a,"background-offset-x","units",n),H=h(a,"background-offset-x","pfValue",n);L==="%"?P+=(x-U)*H:P+=H;var F=d-S/2,Q=h(a,"background-position-y","units",n),J=h(a,"background-position-y","pfValue",n);Q==="%"?F+=(S-V)*J:F+=J;var M=h(a,"background-offset-y","units",n),G=h(a,"background-offset-y","pfValue",n);M==="%"?F+=(S-V)*G:F+=G,T.pathCache&&(P-=f,F-=d,f=0,d=0);var Z=t.globalAlpha;t.globalAlpha=R;var W=u.getImgSmoothing(t),ae=!1;if(z==="no"&&W?(u.setImgSmoothing(t,!1),ae=!0):z==="yes"&&!W&&(u.setImgSmoothing(t,!0),ae=!0),y==="no-repeat")D&&(t.save(),T.pathCache?t.clip(T.pathCache):(u.nodeShapes[u.getNodeShape(a)].draw(t,f,d,x,S,B,T),t.clip())),u.safeDrawImage(t,e,0,0,O,_,P,F,U,V),D&&t.restore();else{var se=t.createPattern(e,y);t.fillStyle=se,u.nodeShapes[u.getNodeShape(a)].draw(t,f,d,x,S,B,T),t.translate(P,F),t.fill(),t.translate(-P,-F)}t.globalAlpha=Z,ae&&u.setImgSmoothing(t,W)}};var Oi={};Oi.eleTextBiggerThanMin=function(t,e){if(!e){var a=t.cy().zoom(),n=this.getPixelRatio(),l=Math.ceil(Kh(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 f=e.pstyle("label");if(!f||!f.value)return;var d=o.getLabelJustification(e);t.textAlign=d,t.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,h=e.pstyle("label"),g=e.pstyle("source-label"),y=e.pstyle("target-label");if(c||(!h||!h.value)&&(!g||!g.value)&&(!y||!y.value))return;t.textAlign="center",t.textBaseline="bottom"}var E=!a,b;a&&(b=a,t.translate(-b.x1,-b.y1)),l==null?(o.drawText(t,e,null,E,u),e.isEdge()&&(o.drawText(t,e,"source",E,u),o.drawText(t,e,"target",E,u))):o.drawText(t,e,l,E,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,f=a?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,d=e.pstyle("text-outline-opacity").value*f,c=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+o+" "+l+" "+u,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],f),this.colorStrokeStyle(t,h[0],h[1],h[2],d)};function NB(t,e,a,n,l){var u=Math.min(n,l),o=u/2,f=e+n/2,d=a+l/2;t.beginPath(),t.arc(f,d,o,0,Math.PI*2),t.closePath()}function w1(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 f=Ia(l,"labelAngle",e);a=t.isEdge()?f: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,f=l?e.effectiveOpacity():1;if(!(l&&(f===0||e.pstyle("text-opacity").value===0))){a==="main"&&(a=null);var d=Ia(o,"labelX",a),c=Ia(o,"labelY",a),h,g,y=this.getLabelText(e,a);if(y!=null&&y!==""&&!isNaN(d)&&!isNaN(c)){this.setupTextStyle(t,e,l);var E=a?a+"-":"",b=Ia(o,"labelWidth",a),w=Ia(o,"labelHeight",a),x=e.pstyle(E+"text-margin-x").pfValue,S=e.pstyle(E+"text-margin-y").pfValue,T=e.isEdge(),C=e.pstyle("text-halign").value,D=e.pstyle("text-valign").value;T&&(C="center",D="center"),d+=x,c+=S;var R;switch(n?R=this.getTextAngle(e,a):R=0,R!==0&&(h=d,g=c,t.translate(h,g),t.rotate(R),d=0,c=0),D){case"top":break;case"center":c+=w/2;break;case"bottom":c+=w;break}var z=e.pstyle("text-background-opacity").value,B=e.pstyle("text-border-opacity").value,O=e.pstyle("text-border-width").pfValue,_=e.pstyle("text-background-padding").pfValue,U=e.pstyle("text-background-shape").strValue,V=U==="round-rectangle"||U==="roundrectangle",q=U==="circle",P=2;if(z>0||O>0&&B>0){var Y=t.fillStyle,I=t.strokeStyle,L=t.lineWidth,H=e.pstyle("text-background-color").value,F=e.pstyle("text-border-color").value,Q=e.pstyle("text-border-style").value,J=z>0,M=O>0&&B>0,G=d-_;switch(C){case"left":G-=b;break;case"center":G-=b/2;break}var Z=c-w-_,W=b+2*_,ae=w+2*_;if(J&&(t.fillStyle="rgba(".concat(H[0],",").concat(H[1],",").concat(H[2],",").concat(z*f,")")),M&&(t.strokeStyle="rgba(".concat(F[0],",").concat(F[1],",").concat(F[2],",").concat(B*f,")"),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(),w1(t,G,Z,W,ae,P)):q?(t.beginPath(),NB(t,G,Z,W,ae)):(t.beginPath(),t.rect(G,Z,W,ae)),J&&t.fill(),M&&t.stroke(),M&&Q==="double"){var se=O/2;t.beginPath(),V?w1(t,G+se,Z+se,W-2*se,ae-2*se,P):t.rect(G+se,Z+se,W-2*se,ae-2*se),t.stroke()}t.fillStyle=Y,t.strokeStyle=I,t.lineWidth=L,t.setLineDash&&t.setLineDash([])}var he=2*e.pstyle("text-outline-width").pfValue;if(he>0&&(t.lineWidth=he),e.pstyle("text-wrap").value==="wrap"){var we=Ia(o,"labelWrapCachedLines",a),de=Ia(o,"labelLineHeight",a),$=b/2,re=this.getLabelJustification(e);switch(re==="auto"||(C==="left"?re==="left"?d+=-b:re==="center"&&(d+=-$):C==="center"?re==="left"?d+=-$:re==="right"&&(d+=$):C==="right"&&(re==="center"?d+=$:re==="right"&&(d+=b))),D){case"top":c-=(we.length-1)*de;break;case"center":case"bottom":c-=(we.length-1)*de;break}for(var le=0;le<we.length;le++)he>0&&t.strokeText(we[le],d,c),t.fillText(we[le],d,c),c+=de}else he>0&&t.strokeText(y,d,c),t.fillText(y,d,c);R!==0&&(t.rotate(-R),t.translate(-h,-g))}}};var Wn={};Wn.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,f,d,c=e._private,h=c.rscratch,g=e.position();if(!(!Te(g.x)||!Te(g.y))&&!(u&&!e.visible())){var y=u?e.effectiveOpacity():1,E=o.usePaths(),b,w=!1,x=e.padding();f=e.width()+2*x,d=e.height()+2*x;var S;a&&(S=a,t.translate(-S.x1,-S.y1));for(var T=e.pstyle("background-image"),C=T.value,D=new Array(C.length),R=new Array(C.length),z=0,B=0;B<C.length;B++){var O=C[B],_=D[B]=O!=null&&O!=="none";if(_){var U=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",B);z++,R[B]=o.getCachedImage(O,U,function(){c.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var V=e.pstyle("background-blacken").value,q=e.pstyle("border-width").pfValue,P=e.pstyle("background-opacity").value*y,Y=e.pstyle("border-color").value,I=e.pstyle("border-style").value,L=e.pstyle("border-join").value,H=e.pstyle("border-cap").value,F=e.pstyle("border-position").value,Q=e.pstyle("border-dash-pattern").pfValue,J=e.pstyle("border-dash-offset").pfValue,M=e.pstyle("border-opacity").value*y,G=e.pstyle("outline-width").pfValue,Z=e.pstyle("outline-color").value,W=e.pstyle("outline-style").value,ae=e.pstyle("outline-opacity").value*y,se=e.pstyle("outline-offset").value,he=e.pstyle("corner-radius").value;he!=="auto"&&(he=e.pstyle("corner-radius").pfValue);var we=function(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P;o.eleFillStyle(t,e,ze)},de=function(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M;o.colorStrokeStyle(t,Y[0],Y[1],Y[2],ze)},$=function(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ae;o.colorStrokeStyle(t,Z[0],Z[1],Z[2],ze)},re=function(ze,ye,k,te){var ce=o.nodePathCache=o.nodePathCache||[],oe=W1(k==="polygon"?k+","+te.join(","):k,""+ye,""+ze,""+he),me=ce[oe],Re,Se=!1;return me!=null?(Re=me,Se=!0,h.pathCache=Re):(Re=new Path2D,ce[oe]=h.pathCache=Re),{path:Re,cacheHit:Se}},le=e.pstyle("shape").strValue,pe=e.pstyle("shape-polygon-points").pfValue;if(E){t.translate(g.x,g.y);var j=re(f,d,le,pe);b=j.path,w=j.cacheHit}var xe=function(){if(!w){var ze=g;E&&(ze={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(b||t,ze.x,ze.y,f,d,he,h)}E?t.fill(b):t.fill()},Be=function(){for(var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,k=c.backgrounding,te=0,ce=0;ce<R.length;ce++){var oe=e.cy().style().getIndexedStyle(e,"background-image-containment","value",ce);if(ye&&oe==="over"||!ye&&oe==="inside"){te++;continue}D[ce]&&R[ce].complete&&!R[ce].error&&(te++,o.drawInscribedImage(t,R[ce],e,ce,ze))}c.backgrounding=te!==z,k!==c.backgrounding&&e.updateStyle(!1)},Ue=function(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:y;o.hasPie(e)&&(o.drawPie(t,e,ye),ze&&(E||o.nodeShapes[o.getNodeShape(e)].draw(t,g.x,g.y,f,d,he,h)))},Ve=function(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:y;o.hasStripe(e)&&(t.save(),E?t.clip(h.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(t,g.x,g.y,f,d,he,h),t.clip()),o.drawStripe(t,e,ye),t.restore(),ze&&(E||o.nodeShapes[o.getNodeShape(e)].draw(t,g.x,g.y,f,d,he,h)))},Ae=function(){var ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y,ye=(V>0?V:-V)*ze,k=V>0?0:255;V!==0&&(o.colorFillStyle(t,k,k,k,ye),E?t.fill(b):t.fill())},Ce=function(){if(q>0){if(t.lineWidth=q,t.lineCap=H,t.lineJoin=L,t.setLineDash)switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(Q),t.lineDashOffset=J;break;case"solid":case"double":t.setLineDash([]);break}if(F!=="center"){if(t.save(),t.lineWidth*=2,F==="inside")E?t.clip(b):t.clip();else{var ze=new Path2D;ze.rect(-f/2-q,-d/2-q,f+2*q,d+2*q),ze.addPath(b),t.clip(ze,"evenodd")}E?t.stroke(b):t.stroke(),t.restore()}else E?t.stroke(b):t.stroke();if(I==="double"){t.lineWidth=q/3;var ye=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",E?t.stroke(b):t.stroke(),t.globalCompositeOperation=ye}t.setLineDash&&t.setLineDash([])}},_e=function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(W){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ze=g;E&&(ze={x:0,y:0});var ye=o.getNodeShape(e),k=q;F==="inside"&&(k=0),F==="outside"&&(k*=2);var te=(f+k+(G+se))/f,ce=(d+k+(G+se))/d,oe=f*te,me=d*ce,Re=o.nodeShapes[ye].points,Se;if(E){var ke=re(oe,me,ye,Re);Se=ke.path}if(ye==="ellipse")o.drawEllipsePath(Se||t,ze.x,ze.y,oe,me);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ye)){var Me=0,Pe=0,Ke=0;ye==="round-diamond"?Me=(k+se+G)*1.4:ye==="round-heptagon"?(Me=(k+se+G)*1.075,Ke=-(k/2+se+G)/35):ye==="round-hexagon"?Me=(k+se+G)*1.12:ye==="round-pentagon"?(Me=(k+se+G)*1.13,Ke=-(k/2+se+G)/15):ye==="round-tag"?(Me=(k+se+G)*1.12,Pe=(k/2+G+se)*.07):ye==="round-triangle"&&(Me=(k+se+G)*(Math.PI/2),Ke=-(k+se/2+G)/Math.PI),Me!==0&&(te=(f+Me)/f,oe=f*te,["round-hexagon","round-tag"].includes(ye)||(ce=(d+Me)/d,me=d*ce)),he=he==="auto"?s2(oe,me):he;for(var Ze=oe/2,Ne=me/2,tt=he+(k+G+se)/2,$e=new Array(Re.length/2),Vt=new Array(Re.length/2),wt=0;wt<Re.length/2;wt++)$e[wt]={x:ze.x+Pe+Ze*Re[wt*2],y:ze.y+Ke+Ne*Re[wt*2+1]};var ma,Ut,Xt,Gt,jt=$e.length;for(Ut=$e[jt-1],ma=0;ma<jt;ma++)Xt=$e[ma%jt],Gt=$e[(ma+1)%jt],Vt[ma]=sg(Ut,Xt,Gt,tt),Ut=Xt,Xt=Gt;o.drawRoundPolygonPath(Se||t,ze.x+Pe,ze.y+Ke,f*te,d*ce,Re,Vt)}else if(["roundrectangle","round-rectangle"].includes(ye))he=he==="auto"?In(oe,me):he,o.drawRoundRectanglePath(Se||t,ze.x,ze.y,oe,me,he+(k+G+se)/2);else if(["cutrectangle","cut-rectangle"].includes(ye))he=he==="auto"?Jh():he,o.drawCutRectanglePath(Se||t,ze.x,ze.y,oe,me,null,he+(k+G+se)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ye))he=he==="auto"?In(oe,me):he,o.drawBottomRoundRectanglePath(Se||t,ze.x,ze.y,oe,me,he+(k+G+se)/2);else if(ye==="barrel")o.drawBarrelPath(Se||t,ze.x,ze.y,oe,me);else if(ye.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ye)){var rr=(k+G+se)/f;Re=ef(tf(Re,rr)),o.drawPolygonPath(Se||t,ze.x,ze.y,f,d,Re)}else{var Ht=(k+G+se)/f;Re=ef(tf(Re,-Ht)),o.drawPolygonPath(Se||t,ze.x,ze.y,f,d,Re)}if(E?t.stroke(Se):t.stroke(),W==="double"){t.lineWidth=k/3;var nr=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",E?t.stroke(Se):t.stroke(),t.globalCompositeOperation=nr}t.setLineDash&&t.setLineDash([])}},He=function(){l&&o.drawNodeOverlay(t,e,g,f,d)},je=function(){l&&o.drawNodeUnderlay(t,e,g,f,d)},De=function(){o.drawElementText(t,e,null,n)},We=e.pstyle("ghost").value==="yes";if(We){var rt=e.pstyle("ghost-offset-x").pfValue,ft=e.pstyle("ghost-offset-y").pfValue,st=e.pstyle("ghost-opacity").value,dt=st*y;t.translate(rt,ft),$(),_e(),we(st*P),xe(),Be(dt,!0),de(st*M),Ce(),Ue(V!==0||q!==0),Ve(V!==0||q!==0),Be(dt,!1),Ae(dt),t.translate(-rt,-ft)}E&&t.translate(-g.x,-g.y),je(),E&&t.translate(g.x,g.y),$(),_e(),we(),xe(),Be(y,!0),de(),Ce(),Ue(V!==0||q!==0),Ve(V!==0||q!==0),Be(y,!1),Ae(),E&&t.translate(-g.x,-g.y),De(),He(),a&&t.translate(S.x1,S.y1)}};var hE=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(a,n,l,u,o){var f=this;if(n.visible()){var d=n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-opacity")).value,h=n.pstyle("".concat(e,"-color")).value,g=n.pstyle("".concat(e,"-shape")).value,y=n.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(l=l||n.position(),u==null||o==null){var E=n.padding();u=n.width()+2*E,o=n.height()+2*E}f.colorFillStyle(a,h[0],h[1],h[2],c),f.nodeShapes[g].draw(a,l.x,l.y,u+d*2,o+d*2,y),a.fill()}}}};Wn.drawNodeOverlay=hE("overlay");Wn.drawNodeUnderlay=hE("underlay");Wn.hasPie=function(t){return t=t[0],t._private.hasPie};Wn.hasStripe=function(t){return t=t[0],t._private.hasStripe};Wn.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"),f=e.pstyle("pie-start-angle").pfValue,d=n.x,c=n.y,h=e.width(),g=e.height(),y=Math.min(h,g)/2,E,b=0,w=this.usePaths();if(w&&(d=0,c=0),u.units==="%"?y=y*u.pfValue:u.pfValue!==void 0&&(y=u.pfValue/2),o.units==="%"?E=y*o.pfValue:o.pfValue!==void 0&&(E=o.pfValue/2),!(E>=y))for(var x=1;x<=l.pieBackgroundN;x++){var S=e.pstyle("pie-"+x+"-background-size").value,T=e.pstyle("pie-"+x+"-background-color").value,C=e.pstyle("pie-"+x+"-background-opacity").value*a,D=S/100;D+b>1&&(D=1-b);var R=1.5*Math.PI+2*Math.PI*b;R+=f;var z=2*Math.PI*D,B=R+z;S===0||b>=1||b+D>1||(E===0?(t.beginPath(),t.moveTo(d,c),t.arc(d,c,y,R,B),t.closePath()):(t.beginPath(),t.arc(d,c,y,R,B),t.arc(d,c,E,B,R,!0),t.closePath()),this.colorFillStyle(t,T[0],T[1],T[2],C),t.fill(),b+=D)}};Wn.drawStripe=function(t,e,a,n){e=e[0],n=n||e.position();var l=e.cy().style(),u=n.x,o=n.y,f=e.width(),d=e.height(),c=0,h=this.usePaths();t.save();var g=e.pstyle("stripe-direction").value,y=e.pstyle("stripe-size");switch(g){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var E=f,b=d;y.units==="%"?(E=E*y.pfValue,b=b*y.pfValue):y.pfValue!==void 0&&(E=y.pfValue,b=y.pfValue),h&&(u=0,o=0),o-=E/2,u-=b/2;for(var w=1;w<=l.stripeBackgroundN;w++){var x=e.pstyle("stripe-"+w+"-background-size").value,S=e.pstyle("stripe-"+w+"-background-color").value,T=e.pstyle("stripe-"+w+"-background-opacity").value*a,C=x/100;C+c>1&&(C=1-c),!(x===0||c>=1||c+C>1)&&(t.beginPath(),t.rect(u,o+b*c,E,b*C),t.closePath(),this.colorFillStyle(t,S[0],S[1],S[2],T),t.fill(),c+=C)}t.restore()};var _a={},LB=100;_a.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};_a.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};_a.createGradientStyleFor=function(t,e,a,n,l){var u,o=this.usePaths(),f=a.pstyle(e+"-gradient-stop-colors").value,d=a.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(a.isEdge()){var c=a.sourceEndpoint(),h=a.targetEndpoint(),g=a.midpoint(),y=Ai(c,g),E=Ai(h,g);u=t.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(y,E))}else{var b=o?{x:0,y:0}:a.position(),w=a.paddedWidth(),x=a.paddedHeight();u=t.createRadialGradient(b.x,b.y,0,b.x,b.y,Math.max(w,x))}else if(a.isEdge()){var S=a.sourceEndpoint(),T=a.targetEndpoint();u=t.createLinearGradient(S.x,S.y,T.x,T.y)}else{var C=o?{x:0,y:0}:a.position(),D=a.paddedWidth(),R=a.paddedHeight(),z=D/2,B=R/2,O=a.pstyle("background-gradient-direction").value;switch(O){case"to-bottom":u=t.createLinearGradient(C.x,C.y-B,C.x,C.y+B);break;case"to-top":u=t.createLinearGradient(C.x,C.y+B,C.x,C.y-B);break;case"to-left":u=t.createLinearGradient(C.x+z,C.y,C.x-z,C.y);break;case"to-right":u=t.createLinearGradient(C.x-z,C.y,C.x+z,C.y);break;case"to-bottom-right":case"to-right-bottom":u=t.createLinearGradient(C.x-z,C.y-B,C.x+z,C.y+B);break;case"to-top-right":case"to-right-top":u=t.createLinearGradient(C.x-z,C.y+B,C.x+z,C.y-B);break;case"to-bottom-left":case"to-left-bottom":u=t.createLinearGradient(C.x+z,C.y-B,C.x-z,C.y+B);break;case"to-top-left":case"to-left-top":u=t.createLinearGradient(C.x+z,C.y+B,C.x-z,C.y-B);break}}if(!u)return null;for(var _=d.length===f.length,U=f.length,V=0;V<U;V++)u.addColorStop(_?d[V]:V/(U-1),"rgba("+f[V][0]+","+f[V][1]+","+f[V][2]+","+l+")");return u};_a.gradientFillStyle=function(t,e,a,n){var l=this.createGradientStyleFor(t,"background",e,a,n);if(!l)return null;t.fillStyle=l};_a.colorFillStyle=function(t,e,a,n,l){t.fillStyle="rgba("+e+","+a+","+n+","+l+")"};_a.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)}};_a.gradientStrokeStyle=function(t,e,a,n){var l=this.createGradientStyleFor(t,"line",e,a,n);if(!l)return null;t.strokeStyle=l};_a.colorStrokeStyle=function(t,e,a,n,l){t.strokeStyle="rgba("+e+","+a+","+n+","+l+")"};_a.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)}};_a.matchCanvasSize=function(t){var e=this,a=e.data,n=e.findContainerClientCoords(),l=n[2],u=n[3],o=e.getPixelRatio(),f=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=f);var d=l*o,c=u*o,h;if(!(d===e.canvasWidth&&c===e.canvasHeight)){e.fontCaches=null;var g=a.canvasContainer;g.style.width=l+"px",g.style.height=u+"px";for(var y=0;y<e.CANVAS_LAYERS;y++)h=a.canvases[y],h.width=d,h.height=c,h.style.width=l+"px",h.style.height=u+"px";for(var y=0;y<e.BUFFER_COUNT;y++)h=a.bufferCanvases[y],h.width=d,h.height=c,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=d*e.textureMult,h.height=c*e.textureMult),e.canvasWidth=d,e.canvasHeight=c,e.pixelRatio=o}};_a.renderTo=function(t,e,a,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:a,drawAllLayers:!0,forcedPxRatio:n})};_a.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])};_a.render=function(t){var e=this;t=t||a2();var a=e.cy,n=t.forcedContext,l=t.drawAllLayers,u=t.drawOnlyNodeLayer,o=t.forcedZoom,f=t.forcedPan,d=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=e.data,h=c.canvasNeedsRedraw,g=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),y=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,E=e.motionBlurPxRatio,b=a.hasCompoundNodes(),w=e.hoverData.draggingEles,x=!!(e.hoverData.selecting||e.touchData.selecting);y=y&&!n&&e.motionBlurEnabled&&!x;var S=y;n||(e.prevPxRatio!==d&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=d),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),y&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(S=!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(),D=o!==void 0?o:C,R=a.pan(),z={x:R.x,y:R.y},B={zoom:C,pan:{x:R.x,y:R.y}},O=e.prevViewport,_=O===void 0||B.zoom!==O.zoom||B.pan.x!==O.pan.x||B.pan.y!==O.pan.y;!_&&!(w&&!b)&&(e.motionBlurPxRatio=1),f&&(z=f),D*=d,z.x*=d,z.y*=d;var U=e.getCachedZSortedEles();function V(de,$,re,le,pe){var j=de.globalCompositeOperation;de.globalCompositeOperation="destination-out",e.colorFillStyle(de,255,255,255,e.motionBlurTransparency),de.fillRect($,re,le,pe),de.globalCompositeOperation=j}function q(de,$){var re,le,pe,j;!e.clearingMotionBlur&&(de===c.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||de===c.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(re={x:R.x*E,y:R.y*E},le=C*E,pe=e.canvasWidth*E,j=e.canvasHeight*E):(re=z,le=D,pe=e.canvasWidth,j=e.canvasHeight),de.setTransform(1,0,0,1,0,0),$==="motionBlur"?V(de,0,0,pe,j):!n&&($===void 0||$)&&de.clearRect(0,0,pe,j),l||(de.translate(re.x,re.y),de.scale(le,le)),f&&de.translate(f.x,f.y),o&&de.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 P=e.data.bufferContexts[e.TEXTURE_BUFFER];P.setTransform(1,0,0,1,0,0),P.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:P,drawOnlyNodeLayer:!0,forcedPxRatio:d*e.textureMult});var B=e.textureCache.viewport={zoom:a.zoom(),pan:a.pan(),width:e.canvasWidth,height:e.canvasHeight};B.mpan={x:(0-B.pan.x)/B.zoom,y:(0-B.pan.y)/B.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var Y=c.contexts[e.NODE],I=e.textureCache.texture,B=e.textureCache.viewport;Y.setTransform(1,0,0,1,0,0),y?V(Y,0,0,B.width,B.height):Y.clearRect(0,0,B.width,B.height);var L=T.core("outside-texture-bg-color").value,H=T.core("outside-texture-bg-opacity").value;e.colorFillStyle(Y,L[0],L[1],L[2],H),Y.fillRect(0,0,B.width,B.height);var C=a.zoom();q(Y,!1),Y.clearRect(B.mpan.x,B.mpan.y,B.width/B.zoom/d,B.height/B.zoom/d),Y.drawImage(I,B.mpan.x,B.mpan.y,B.width/B.zoom/d,B.height/B.zoom/d)}else e.textureOnViewport&&!n&&(e.textureCache=null);var F=a.extent(),Q=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),J=e.hideEdgesOnViewport&&Q,M=[];if(M[e.NODE]=!h[e.NODE]&&y&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,M[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),M[e.DRAG]=!h[e.DRAG]&&y&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,M[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||l||u||M[e.NODE]){var G=y&&!M[e.NODE]&&E!==1,Y=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:c.contexts[e.NODE]),Z=y&&!G?"motionBlur":void 0;q(Y,Z),J?e.drawCachedNodes(Y,U.nondrag,d,F):e.drawLayeredElements(Y,U.nondrag,d,F),e.debug&&e.drawDebugPoints(Y,U.nondrag),!l&&!y&&(h[e.NODE]=!1)}if(!u&&(h[e.DRAG]||l||M[e.DRAG])){var G=y&&!M[e.DRAG]&&E!==1,Y=n||(G?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:c.contexts[e.DRAG]);q(Y,y&&!G?"motionBlur":void 0),J?e.drawCachedNodes(Y,U.drag,d,F):e.drawCachedElements(Y,U.drag,d,F),e.debug&&e.drawDebugPoints(Y,U.drag),!l&&!y&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,q),y&&E!==1){var W=c.contexts[e.NODE],ae=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],se=c.contexts[e.DRAG],he=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],we=function($,re,le){$.setTransform(1,0,0,1,0,0),le||!S?$.clearRect(0,0,e.canvasWidth,e.canvasHeight):V($,0,0,e.canvasWidth,e.canvasHeight);var pe=E;$.drawImage(re,0,0,e.canvasWidth*pe,e.canvasHeight*pe,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||M[e.NODE])&&(we(W,ae,M[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||M[e.DRAG])&&(we(se,he,M[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=B,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),y&&(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()},LB)),n||a.emit("render")};var Lu;_a.drawSelectionRectangle=function(t,e){var a=this,n=a.cy,l=a.data,u=n.style(),o=t.drawOnlyNodeLayer,f=t.drawAllLayers,d=l.canvasNeedsRedraw,c=t.forcedContext;if(a.showFps||!o&&d[a.SELECT_BOX]&&!f){var h=c||l.contexts[a.SELECT_BOX];if(e(h),a.selection[4]==1&&(a.hoverData.selecting||a.touchData.selecting)){var g=a.cy.zoom(),y=u.core("selection-box-border-width").value/g;h.lineWidth=y,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]),y>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(),E=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(E.x,E.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 w=Math.round(1e3/b),x="1 frame = "+b+" ms = "+w+" 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",!Lu){var S=h.measureText(x);Lu=S.actualBoundingBoxAscent}h.fillText(x,0,Lu);var T=60;h.strokeRect(0,Lu+10,250,20),h.fillRect(0,Lu+10,250*Math.min(w/T,1),20)}f||(d[a.SELECT_BOX]=!1)}};function T1(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 kB(t,e,a){var n=T1(t,t.VERTEX_SHADER,e),l=T1(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 _B(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 cg(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 qB(t){var e=t.pixelRatio,a=t.cy.zoom();return a*e}function VB(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 UB(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 HB(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,f=a||new Array(4);return f[0]=n*o,f[1]=l*o,f[2]=u*o,f[3]=o,f}function bl(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 PB(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function GB(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 gE(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 pE(t,e,a){switch(e){case t.FLOAT:return new Float32Array(a);case t.INT:return new Int32Array(a)}}function YB(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 FB(t,e,a,n){var l=gE(t,e),u=aa(l,2),o=u[0],f=u[1],d=pE(t,f,n),c=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW),f===t.FLOAT?t.vertexAttribPointer(a,o,f,!1,0,0):f===t.INT&&t.vertexAttribIPointer(a,o,f,0,0),t.enableVertexAttribArray(a),t.bindBuffer(t.ARRAY_BUFFER,null),c}function Rr(t,e,a,n){var l=gE(t,a),u=aa(l,3),o=u[0],f=u[1],d=u[2],c=pE(t,f,e*o),h=o*d,g=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,g),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),f===t.FLOAT?t.vertexAttribPointer(n,o,f,!1,h,0):f===t.INT&&t.vertexAttribIPointer(n,o,f,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var y=new Array(e),E=0;E<e;E++)y[E]=YB(t,f,c,h,o,E);return g.dataArray=c,g.stride=h,g.size=o,g.getView=function(b){return y[b]},g.setPoint=function(b,w,x){var S=y[b];S[0]=w,S[1]=x},g.bufferSubData=function(b){t.bindBuffer(t.ARRAY_BUFFER,g),b?t.bufferSubData(t.ARRAY_BUFFER,0,c,0,b*o):t.bufferSubData(t.ARRAY_BUFFER,0,c)},g}function IB(t,e,a){for(var n=9,l=new Float32Array(e*n),u=new Array(e),o=0;o<e;o++){var f=o*n*4;u[o]=new Float32Array(l.buffer,f,n)}var d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,l.byteLength,t.DYNAMIC_DRAW);for(var c=0;c<3;c++){var h=a+c;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,3,t.FLOAT,!1,36,c*12),t.vertexAttribDivisor(h,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),d.getMatrixView=function(g){return u[g]},d.setData=function(g,y){u[y].set(g,0)},d.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferSubData(t.ARRAY_BUFFER,0,l)},d}function XB(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 C1=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 dh(){var t=new C1(9);return C1!=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 A1(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 jB(t,e,a){var n=e[0],l=e[1],u=e[2],o=e[3],f=e[4],d=e[5],c=e[6],h=e[7],g=e[8],y=a[0],E=a[1],b=a[2],w=a[3],x=a[4],S=a[5],T=a[6],C=a[7],D=a[8];return t[0]=y*n+E*o+b*c,t[1]=y*l+E*f+b*h,t[2]=y*u+E*d+b*g,t[3]=w*n+x*o+S*c,t[4]=w*l+x*f+S*h,t[5]=w*u+x*d+S*g,t[6]=T*n+C*o+D*c,t[7]=T*l+C*f+D*h,t[8]=T*u+C*d+D*g,t}function Zo(t,e,a){var n=e[0],l=e[1],u=e[2],o=e[3],f=e[4],d=e[5],c=e[6],h=e[7],g=e[8],y=a[0],E=a[1];return t[0]=n,t[1]=l,t[2]=u,t[3]=o,t[4]=f,t[5]=d,t[6]=y*n+E*o+c,t[7]=y*l+E*f+h,t[8]=y*u+E*d+g,t}function D1(t,e,a){var n=e[0],l=e[1],u=e[2],o=e[3],f=e[4],d=e[5],c=e[6],h=e[7],g=e[8],y=Math.sin(a),E=Math.cos(a);return t[0]=E*n+y*o,t[1]=E*l+y*f,t[2]=E*u+y*d,t[3]=E*o-y*n,t[4]=E*f-y*l,t[5]=E*d-y*u,t[6]=c,t[7]=h,t[8]=g,t}function _h(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 KB(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 ZB=(function(){function t(e,a,n,l){Zn(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 Qn(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,f=u/l,d=n*f,c=l*f;return d>o&&(f=o/n,d=n*f,c=l*f),{scale:f,texW:d,texH:c}}},{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,f=this.texRows,d=this.texHeight,c=this.getScale(n),h=c.scale,g=c.texW,y=c.texH,E=function(C,D){if(l&&D){var R=D.context,z=C.x,B=C.row,O=z,_=d*B;R.save(),R.translate(O,_),R.scale(h,h),l(R,n),R.restore()}},b=[null,null],w=function(){E(u.freePointer,u.canvas),b[0]={x:u.freePointer.x,y:u.freePointer.row*d,w:g,h:y},b[1]={x:u.freePointer.x+g,y:u.freePointer.row*d,w:0,h:y},u.freePointer.x+=g,u.freePointer.x==o&&(u.freePointer.x=0,u.freePointer.row++)},x=function(){var C=u.scratch,D=u.canvas;C.clear(),E({x:0,row:0},C);var R=o-u.freePointer.x,z=g-R,B=d;{var O=u.freePointer.x,_=u.freePointer.row*d,U=R;D.context.drawImage(C,0,0,U,B,O,_,U,B),b[0]={x:O,y:_,w:U,h:y}}{var V=R,q=(u.freePointer.row+1)*d,P=z;D&&D.context.drawImage(C,V,0,P,B,0,q,P,B),b[1]={x:0,y:q,w:P,h:y}}u.freePointer.x=z,u.freePointer.row++},S=function(){u.freePointer.x=0,u.freePointer.row++};if(this.freePointer.x+g<=o)w();else{if(this.freePointer.row>=f-1)return!1;this.freePointer.x===o?(S(),w()):this.enableWrapping?x():(S(),w())}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=GB(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}}])})(),QB=(function(){function t(e,a,n,l){Zn(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 Qn(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 ZB(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,f=ja(this.atlases),d;try{var c=function(){var g=d.value,y=g.getKeys(),E=JB(n,y);if(E.size===0)return l.push(g),y.forEach(function(R){return u.set(R,g)}),1;o||(o=a._createAtlas(),l.push(o));var b=ja(y),w;try{for(b.s();!(w=b.n()).done;){var x=w.value;if(!E.has(x)){var S=g.getOffsets(x),T=aa(S,2),C=T[0],D=T[1];o.canFit({w:C.w+D.w,h:C.h})||(o.lock(),o=a._createAtlas(),l.push(o)),g.canvas&&(a._copyTextureToNewAtlas(x,g,o),u.set(x,o))}}}catch(R){b.e(R)}finally{b.f()}g.dispose()};for(f.s();!(d=f.n()).done;)c()}catch(h){f.e(h)}finally{f.f()}this.atlases=l,this.styleKeyToAtlas=u,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(a,n,l){var u=n.getOffsets(a),o=aa(u,2),f=o[0],d=o[1];if(d.w===0)l.draw(a,f,function(y){y.drawImage(n.canvas,f.x,f.y,f.w,f.h,0,0,f.w,f.h)});else{var c=this._getScratchCanvas();c.clear(),c.context.drawImage(n.canvas,f.x,f.y,f.w,f.h,0,0,f.w,f.h),c.context.drawImage(n.canvas,d.x,d.y,d.w,d.h,f.w,0,d.w,d.h);var h=f.w+d.w,g=f.h;l.draw(a,{w:h,h:g},function(y){y.drawImage(c,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 JB(t,e){return t.intersection?t.intersection(e):new Set(Qo(t).filter(function(a){return e.has(a)}))}var WB=(function(){function t(e,a){Zn(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 Qn(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(a,n){var l=this.globalOptions,u=l.webglTexSize,o=l.createTextureCanvas,f=n.texRows,d=this._cacheScratchCanvas(o),c=new QB(this.r,u,f,d);this.collections.set(a,c)}},{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,f,d,c){return c?((!u||f!=n||d!=l)&&(n=f,l=d,u=a(o,f,d)),u):a(o,f,d)}}},{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,f=l.filterEle,d=f===void 0?function(){return!0}:f,c=l.filterType,h=c===void 0?function(){return!0}:c,g=!1,y=!1,E=ja(a),b;try{for(E.s();!(b=E.n()).done;){var w=b.value;if(d(w)){var x=ja(this.renderTypes.values()),S;try{var T=function(){var D=S.value,R=D.type;if(h(R)){var z=n.collections.get(D.collection),B=D.getKey(w),O=Array.isArray(B)?B:[B];if(o)O.forEach(function(q){return z.markKeyForGC(q)}),y=!0;else{var _=D.getID?D.getID(w):w.id(),U=n._key(R,_),V=n.typeAndIdToKey.get(U);V!==void 0&&!HB(O,V)&&(g=!0,n.typeAndIdToKey.delete(U),V.forEach(function(q){return z.markKeyForGC(q)}))}}};for(x.s();!(S=x.n()).done;)T()}catch(C){x.e(C)}finally{x.f()}}}}catch(C){E.e(C)}finally{E.f()}return y&&(this.gc(),g=!1),g}},{key:"gc",value:function(){var a=ja(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),f=this.collections.get(o.collection),d=!1,c=f.draw(u,l,function(y){o.drawClipped?(y.save(),y.beginPath(),y.rect(0,0,l.w,l.h),y.clip(),o.drawElement(y,a,l,!0,!0),y.restore()):o.drawElement(y,a,l,!0,!0),d=!0});if(d){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 c}},{key:"getAtlasInfo",value:function(a,n){var l=this,u=this.renderTypes.get(n),o=u.getKey(a),f=Array.isArray(o)?o:[o];return f.map(function(d){var c=u.getBoundingBox(a,d),h=l.getOrCreateAtlas(a,n,c,d),g=h.getOffsets(d),y=aa(g,2),E=y[0],b=y[1];return{atlas:h,tex:E,tex1:E,tex2:b,bb:c}})}},{key:"getDebugInfo",value:function(){var a=[],n=ja(this.collections),l;try{for(n.s();!(l=n.n()).done;){var u=aa(l.value,2),o=u[0],f=u[1],d=f.getCounts(),c=d.keyCount,h=d.atlasCount;a.push({type:o,keyCount:c,atlasCount:h})}}catch(g){n.e(g)}finally{n.f()}return a}}])})(),$B=(function(){function t(e){Zn(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Qn(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}}])})(),eM=`
|
|
16
|
-
float circleSD(vec2 p, float r) {
|
|
17
|
-
return distance(vec2(0), p) - r; // signed distance
|
|
18
|
-
}
|
|
19
|
-
`,tM=`
|
|
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
|
-
`,aM=`
|
|
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
|
-
`,rM=`
|
|
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
|
-
`,Gu={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},of={IGNORE:1,USE_BB:2},hh=0,B1=1,M1=2,gh=3,El=4,Vo=5,ku=6,_u=7,nM=(function(){function t(e,a,n){Zn(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=_B,this.atlasManager=new WB(e,n),this.batchManager=new $B(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Gu.SCREEN),this.pickingProgram=this._createShaderProgram(Gu.PICKING),this.vao=this._createVAO()}return Qn(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(f){return f===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(hh,`) {
|
|
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(El," || aVertType == ").concat(_u,`
|
|
117
|
-
|| aVertType == `).concat(Vo," || aVertType == ").concat(ku,`) { // 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(B1,`) {
|
|
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(M1,`) {
|
|
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(gh,` && 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(c){return"uniform sampler2D uTexture".concat(c,";")}).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(eM,`
|
|
242
|
-
`).concat(tM,`
|
|
243
|
-
`).concat(aM,`
|
|
244
|
-
`).concat(rM,`
|
|
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(hh,`) {
|
|
261
|
-
// look up the texel from the texture unit
|
|
262
|
-
`).concat(u.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(`
|
|
263
|
-
else `),`
|
|
264
|
-
}
|
|
265
|
-
else if(vVertType == `).concat(gh,`) {
|
|
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(El,` && 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(El," || vVertType == ").concat(_u,`
|
|
274
|
-
|| vVertType == `).concat(Vo," || vVertType == ").concat(ku,`) { // 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(El,`) {
|
|
286
|
-
d = rectangleSD(p, b);
|
|
287
|
-
} else if(vVertType == `).concat(_u,` && w == h) {
|
|
288
|
-
d = circleSD(p, b.x); // faster than ellipse
|
|
289
|
-
} else if(vVertType == `).concat(_u,`) {
|
|
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
|
-
`),f=kB(n,l,o);f.aPosition=n.getAttribLocation(f,"aPosition"),f.aIndex=n.getAttribLocation(f,"aIndex"),f.aVertType=n.getAttribLocation(f,"aVertType"),f.aTransform=n.getAttribLocation(f,"aTransform"),f.aAtlasId=n.getAttribLocation(f,"aAtlasId"),f.aTex=n.getAttribLocation(f,"aTex"),f.aPointAPointB=n.getAttribLocation(f,"aPointAPointB"),f.aPointCPointD=n.getAttribLocation(f,"aPointCPointD"),f.aLineWidth=n.getAttribLocation(f,"aLineWidth"),f.aColor=n.getAttribLocation(f,"aColor"),f.aCornerRadius=n.getAttribLocation(f,"aCornerRadius"),f.aBorderColor=n.getAttribLocation(f,"aBorderColor"),f.uPanZoomMatrix=n.getUniformLocation(f,"uPanZoomMatrix"),f.uAtlasSize=n.getUniformLocation(f,"uAtlasSize"),f.uBGColor=n.getUniformLocation(f,"uBGColor"),f.uZoom=n.getUniformLocation(f,"uZoom"),f.uTextures=[];for(var d=0;d<this.batchManager.getMaxAtlasesPerBatch();d++)f.uTextures.push(n.getUniformLocation(f,"uTexture".concat(d)));return f}},{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),FB(l,"vec2",u.aPosition,a),this.transformBuffer=IB(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 Vn(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]:Gu.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,f=u.getRenderTypeOpts(l);if(this._isVisible(a,f)&&!(a.isEdge()&&!this._isValidEdge(a))){if(this.renderTarget.picking&&f.getTexPickingMode){var d=f.getTexPickingMode(a);if(d===of.IGNORE)return;if(d==of.USE_BB){this.drawPickingRectangle(a,n,l);return}}var c=u.getAtlasInfo(a,l),h=ja(c),g;try{for(h.s();!(g=h.n()).done;){var y=g.value,E=y.atlas,b=y.tex1,w=y.tex2;o.canAddToCurrentBatch(E)||this.endBatch();for(var x=o.getAtlasIndexForBatch(E),S=0,T=[[b,!0],[w,!1]];S<T.length;S++){var C=aa(T[S],2),D=C[0],R=C[1];if(D.w!=0){var z=this.instanceCount;this.vertTypeBuffer.getView(z)[0]=hh;var B=this.indexBuffer.getView(z);bl(n,B);var O=this.atlasIdBuffer.getView(z);O[0]=x;var _=this.texBuffer.getView(z);_[0]=D.x,_[1]=D.y,_[2]=D.w,_[3]=D.h;var U=this.transformBuffer.getMatrixView(z);this.setTransformMatrix(a,U,f,y,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,f=0;if(l.shapeProps&&l.shapeProps.padding&&(f=a.pstyle(l.shapeProps.padding).pfValue),u){var d=u.bb,c=u.tex1,h=u.tex2,g=c.w/(c.w+h.w);o||(g=1-g);var y=this._getAdjustedBB(d,f,o,g);this._applyTransformMatrix(n,y,l,a)}else{var E=l.getBoundingBox(a),b=this._getAdjustedBB(E,f,!0,1);this._applyTransformMatrix(n,b,l,a)}}},{key:"_applyTransformMatrix",value:function(a,n,l,u){var o,f;A1(a);var d=l.getRotation?l.getRotation(u):0;if(d!==0){var c=l.getRotationPoint(u),h=c.x,g=c.y;Zo(a,a,[h,g]),D1(a,a,d);var y=l.getRotationOffset(u);o=y.x+(n.xOffset||0),f=y.y+(n.yOffset||0)}else o=n.x1,f=n.y1;Zo(a,a,[o,f]),_h(a,a,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(a,n,l,u){var o=a.x1,f=a.y1,d=a.w,c=a.h,h=a.yOffset;n&&(o-=n,f-=n,d+=2*n,c+=2*n);var g=0,y=d*u;return l&&u<1?d=y:!l&&u<1&&(g=d-y,o+=g,d=y),{x1:o,y1:f,w:d,h:c,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]=El;var f=this.indexBuffer.getView(o);bl(n,f);var d=this.colorBuffer.getView(o);bi([0,0,0],1,d);var c=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(a,c,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,f=this._getVertTypeForShape(a,o.shape);if(f===void 0||u.isSimple&&!u.isSimple(a,this.renderTarget)){this.drawTexture(a,n,l);return}var d=this.instanceCount;if(this.vertTypeBuffer.getView(d)[0]=f,f===Vo||f===ku){var c=u.getBoundingBox(a),h=this._getCornerRadius(a,o.radius,c),g=this.cornerRadiusBuffer.getView(d);g[0]=h,g[1]=h,g[2]=h,g[3]=h,f===ku&&(g[0]=0,g[2]=0)}var y=this.indexBuffer.getView(d);bl(n,y);var E=this.renderTarget.picking?1:a.pstyle(o.opacity).value,b=a.pstyle(o.color).value,w=this.colorBuffer.getView(d);bi(b,E,w);var x=this.lineWidthBuffer.getView(d);if(x[0]=0,x[1]=0,o.border){var S=a.pstyle("border-width").value;if(S>0){var T=a.pstyle("border-color").value,C=a.pstyle("border-opacity").value,D=this.borderColorBuffer.getView(d);bi(T,C,D);var R=a.pstyle("border-position").value;if(R==="inside")x[0]=0,x[1]=-S;else if(R==="outside")x[0]=S,x[1]=0;else{var z=S/2;x[0]=z,x[1]=-z}}}var B=this.transformBuffer.getMatrixView(d);this.setTransformMatrix(a,B,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 El;case"ellipse":return _u;case"roundrectangle":case"round-rectangle":return Vo;case"bottom-round-rectangle":return ku;default:return}}},{key:"_getCornerRadius",value:function(a,n,l){var u=l.w,o=l.h;if(a.pstyle(n).value==="auto")return In(u,o);var f=a.pstyle(n).pfValue,d=u/2,c=o/2;return Math.min(f,c,d)}},{key:"drawEdgeArrow",value:function(a,n,l){if(a.visible()){var u=a._private.rscratch,o,f,d;if(l==="source"?(o=u.arrowStartX,f=u.arrowStartY,d=u.srcArrowAngle):(o=u.arrowEndX,f=u.arrowEndY,d=u.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(f)||f==null||isNaN(d)||d==null)){var c=a.pstyle(l+"-arrow-shape").value;if(c!=="none"){var h=a.pstyle(l+"-arrow-color").value,g=a.pstyle("opacity").value,y=a.pstyle("line-opacity").value,E=g*y,b=a.pstyle("width").pfValue,w=a.pstyle("arrow-scale").value,x=this.r.getArrowWidth(b,w),S=this.instanceCount,T=this.transformBuffer.getMatrixView(S);A1(T),Zo(T,T,[o,f]),_h(T,T,[x,x]),D1(T,T,d),this.vertTypeBuffer.getView(S)[0]=gh;var C=this.indexBuffer.getView(S);bl(n,C);var D=this.colorBuffer.getView(S);bi(h,E,D),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,f=a.pstyle("width").pfValue,d=a.pstyle("line-color").value,c=u*o;if(l.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),l.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=B1;var g=this.indexBuffer.getView(h);bl(n,g);var y=this.colorBuffer.getView(h);bi(d,c,y);var E=this.lineWidthBuffer.getView(h);E[0]=f;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 w=0;w<l.length-2;w+=2){var x=this.instanceCount;this.vertTypeBuffer.getView(x)[0]=M1;var S=this.indexBuffer.getView(x);bl(n,S);var T=this.colorBuffer.getView(x);bi(d,c,T);var C=this.lineWidthBuffer.getView(x);C[0]=f;var D=l[w-2],R=l[w-1],z=l[w],B=l[w+1],O=l[w+2],_=l[w+3],U=l[w+4],V=l[w+5];w==0&&(D=2*z-O+.001,R=2*B-_+.001),w==l.length-4&&(U=2*O-z+.001,V=2*_-B+.001);var q=this.pointAPointBBuffer.getView(x);q[0]=D,q[1]=R,q[2]=z,q[3]=B;var P=this.pointCPointDBuffer.getView(x);P[0]=O,P[1]=_,P[2]=U,P[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),f=0;f<o.length;f+=2){var d=(1-n)*a[f]+n*a[f+2],c=(1-n)*a[f+1]+n*a[f+3];o[f]=d,o[f+1]=c}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 f=ja(this.buffers),d;try{for(f.s();!(d=f.n()).done;){var c=d.value;c.bufferSubData(u)}}catch(b){f.e(b)}finally{f.f()}for(var h=this.batchManager.getAtlases(),g=0;g<h.length;g++)h[g].bufferIfNeeded(a);for(var y=0;y<h.length;y++)a.activeTexture(a.TEXTURE0+y),a.bindTexture(a.TEXTURE_2D,h[y].texture),a.uniform1i(o.uTextures[y],y);a.uniform1f(o.uZoom,qB(this.r)),a.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),a.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var E=bi(this.bgColor,1);a.uniform4fv(o.uBGColor,E),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,f){return o+f.atlasCount},0),l=this.batchDebugInfo,u=l.reduce(function(o,f){return o+f.count},0);return{atlasInfo:a,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:l.length,batchInfo:l,totalInstances:u}}}])})(),yE={};yE.initWebgl=function(t,e){var a=this,n=a.data.contexts[a.WEBGL];t.bgColor=iM(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=XB(n),a.pickingFrameBuffer.needsDraw=!0,a.drawing=new nM(a,n,t);var l=function(g){return function(y){return a.getTextAngle(y,g)}},u=function(g){return function(y){var E=y.pstyle(g);return E&&E.value}},o=function(g){return function(y){return y.pstyle("".concat(g,"-opacity")).value>0}},f=function(g){var y=g.pstyle("text-events").strValue==="yes";return y?of.USE_BB:of.IGNORE},d=function(g){var y=g.position(),E=y.x,b=y.y,w=g.outerWidth(),x=g.outerHeight();return{w,h:x,x1:E-w/2,y1:b-x/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:d,isSimple:UB,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),a.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:d,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:d,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:f,getKey:ph(e.getLabelKey,null),getBoundingBox:yh(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:f,getKey:ph(e.getSourceLabelKey,"source"),getBoundingBox:yh(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:f,getKey:ph(e.getTargetLabelKey,"target"),getBoundingBox:yh(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:l("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:u("target-label")});var c=ns(function(){console.log("garbage collect flag set"),a.data.gc=!0},1e4);a.onUpdateEleCalcs(function(h,g){var y=!1;g&&g.length>0&&(y|=a.drawing.invalidate(g)),y&&c()}),lM(a)};function iM(t){var e=t.cy.container(),a=e&&e.style&&e.style.backgroundColor||"white";return I1(a)}function mE(t,e){var a=t._private.rscratch;return Ia(a,"labelWrapCachedLines",e)||[]}var ph=function(e,a){return function(n){var l=e(n),u=mE(n,a);return u.length>1?u.map(function(o,f){return"".concat(l,"_").concat(f)}):l}},yh=function(e,a){return function(n,l){var u=e(n);if(typeof l=="string"){var o=l.indexOf("_");if(o>0){var f=Number(l.substring(o+1)),d=mE(n,a),c=u.h/d.length,h=c*f,g=u.y1+h;return{x1:u.x1,w:u.w,y1:g,h:c,yOffset:h}}}return u}};function lM(t){{var e=t.render;t.render=function(u){u=u||{};var o=t.cy;t.webgl&&(o.zoom()>fE?(uM(t),e.call(t,u)):(sM(t),EE(t,u,Gu.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,f,d){return hM(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 uM(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function sM(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 oM(t){var e=t.canvasWidth,a=t.canvasHeight,n=cg(t),l=n.pan,u=n.zoom,o=dh();Zo(o,o,[l.x,l.y]),_h(o,o,[u,u]);var f=dh();KB(f,e,a);var d=dh();return jB(d,f,o),d}function bE(t,e){var a=t.canvasWidth,n=t.canvasHeight,l=cg(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 fM(t,e){t.drawSelectionRectangle(e,function(a){return bE(t,a)})}function cM(t){var e=t.data.contexts[t.NODE];e.save(),bE(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 vM(t){var e=function(l,u,o){for(var f=l.atlasManager.getAtlasCollection(u),d=t.data.contexts[t.NODE],c=f.atlases,h=0;h<c.length;h++){var g=c[h],y=g.canvas;if(y){var E=y.width,b=y.height,w=E*h,x=y.height*o,S=.4;d.save(),d.scale(S,S),d.drawImage(y,w,x),d.strokeStyle="black",d.rect(w,x,E,b),d.stroke(),d.restore()}}},a=0;e(t.drawing,"node",a++),e(t.drawing,"label",a++)}function dM(t,e,a,n,l){var u,o,f,d,c=cg(t),h=c.pan,g=c.zoom;{var y=VB(t,h,g,e,a),E=aa(y,2),b=E[0],w=E[1],x=6;u=b-x/2,o=w-x/2,f=x,d=x}if(f===0||d===0)return[];var S=t.data.contexts[t.WEBGL];S.bindFramebuffer(S.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(S.viewport(0,0,S.canvas.width,S.canvas.height),EE(t,null,Gu.PICKING),t.pickingFrameBuffer.needsDraw=!1);var T=f*d,C=new Uint8Array(T*4);S.readPixels(u,o,f,d,S.RGBA,S.UNSIGNED_BYTE,C),S.bindFramebuffer(S.FRAMEBUFFER,null);for(var D=new Set,R=0;R<T;R++){var z=C.slice(R*4,R*4+4),B=PB(z)-1;B>=0&&D.add(B)}return D}function hM(t,e,a){var n=dM(t,e,a),l=t.getCachedZSortedEles(),u,o,f=ja(n),d;try{for(f.s();!(d=f.n()).done;){var c=d.value,h=l[c];if(!u&&h.isNode()&&(u=h),!o&&h.isEdge()&&(o=h),u&&o)break}}catch(g){f.e(g)}finally{f.f()}return[u,o].filter(Boolean)}function mh(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 EE(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]&&fM(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 f=oM(t),d=t.getCachedZSortedEles();if(u=d.length,l.startFrame(f,a),a.screen){for(var c=0;c<d.nondrag.length;c++)mh(t,c,d.nondrag[c]);for(var h=0;h<d.drag.length;h++)mh(t,h,d.drag[h])}else if(a.picking)for(var g=0;g<d.length;g++)mh(t,g,d[g]);l.endFrame(),a.screen&&t.webglDebugShowAtlases&&(cM(t),vM(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var y=performance.now(),E=!1,b=Math.ceil(y-n),w=l.getDebugInfo(),x=["".concat(u," elements"),"".concat(w.totalInstances," instances"),"".concat(w.batchCount," batches"),"".concat(w.totalAtlases," atlases"),"".concat(w.wrappedCount," wrapped textures"),"".concat(w.simpleCount," simple shapes")].join(", ");if(E)console.log("WebGL (".concat(a.name,") - time ").concat(b,"ms, ").concat(x));else{console.log("WebGL (".concat(a.name,") - frame time ").concat(b,"ms")),console.log("Totals:"),console.log(" ".concat(x)),console.log("Texture Atlases Used:");var S=w.atlasInfo,T=ja(S),C;try{for(T.s();!(C=T.n()).done;){var D=C.value;console.log(" ".concat(D.type,": ").concat(D.keyCount," keys, ").concat(D.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 $n={};$n.drawPolygonPath=function(t,e,a,n,l,u){var o=n/2,f=l/2;t.beginPath&&t.beginPath(),t.moveTo(e+o*u[0],a+f*u[1]);for(var d=1;d<u.length/2;d++)t.lineTo(e+o*u[d*2],a+f*u[d*2+1]);t.closePath()};$n.drawRoundPolygonPath=function(t,e,a,n,l,u,o){o.forEach(function(f){return tE(t,f)}),t.closePath()};$n.drawRoundRectanglePath=function(t,e,a,n,l,u){var o=n/2,f=l/2,d=u==="auto"?In(n,l):Math.min(u,f,o);t.beginPath&&t.beginPath(),t.moveTo(e,a-f),t.arcTo(e+o,a-f,e+o,a,d),t.arcTo(e+o,a+f,e,a+f,d),t.arcTo(e-o,a+f,e-o,a,d),t.arcTo(e-o,a-f,e,a-f,d),t.lineTo(e,a-f),t.closePath()};$n.drawBottomRoundRectanglePath=function(t,e,a,n,l,u){var o=n/2,f=l/2,d=u==="auto"?In(n,l):u;t.beginPath&&t.beginPath(),t.moveTo(e,a-f),t.lineTo(e+o,a-f),t.lineTo(e+o,a),t.arcTo(e+o,a+f,e,a+f,d),t.arcTo(e-o,a+f,e-o,a,d),t.lineTo(e-o,a-f),t.lineTo(e,a-f),t.closePath()};$n.drawCutRectanglePath=function(t,e,a,n,l,u,o){var f=n/2,d=l/2,c=o==="auto"?Jh():o;t.beginPath&&t.beginPath(),t.moveTo(e-f+c,a-d),t.lineTo(e+f-c,a-d),t.lineTo(e+f,a-d+c),t.lineTo(e+f,a+d-c),t.lineTo(e+f-c,a+d),t.lineTo(e-f+c,a+d),t.lineTo(e-f,a+d-c),t.lineTo(e-f,a-d+c),t.closePath()};$n.drawBarrelPath=function(t,e,a,n,l){var u=n/2,o=l/2,f=e-u,d=e+u,c=a-o,h=a+o,g=Sh(n,l),y=g.widthOffset,E=g.heightOffset,b=g.ctrlPtOffsetPct*y;t.beginPath&&t.beginPath(),t.moveTo(f,c+E),t.lineTo(f,h-E),t.quadraticCurveTo(f+b,h,f+y,h),t.lineTo(d-y,h),t.quadraticCurveTo(d-b,h,d,h-E),t.lineTo(d,c+E),t.quadraticCurveTo(d-b,c,d-y,c),t.lineTo(f+y,c),t.quadraticCurveTo(f+b,c,f,c+E),t.closePath()};var R1=Math.sin(0),z1=Math.cos(0),qh={},Vh={},xE=Math.PI/40;for(var xl=0*Math.PI;xl<2*Math.PI;xl+=xE)qh[xl]=Math.sin(xl),Vh[xl]=Math.cos(xl);$n.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,f=n/2,d=l/2,c=0*Math.PI;c<2*Math.PI;c+=xE)u=e-f*qh[c]*R1+f*Vh[c]*z1,o=a+d*Vh[c]*R1+d*qh[c]*z1,c===0?t.moveTo(u,o):t.lineTo(u,o);t.closePath()};var fs={};fs.createBuffer=function(t,e){var a=document.createElement("canvas");return a.width=t,a.height=e,[a,a.getContext("2d")]};fs.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],f=Te(t.maxWidth)||Te(t.maxHeight),d=this.getPixelRatio(),c=1;if(t.scale!==void 0)u*=t.scale,o*=t.scale,c=t.scale;else if(f){var h=1/0,g=1/0;Te(t.maxWidth)&&(h=c*t.maxWidth/u),Te(t.maxHeight)&&(g=c*t.maxHeight/o),c=Math.min(h,g),u*=c,o*=c}f||(u*=d,o*=d,c*=d);var y=document.createElement("canvas");y.width=u,y.height=o,y.style.width=u+"px",y.style.height=o+"px";var E=y.getContext("2d");if(u>0&&o>0){E.clearRect(0,0,u,o),E.globalCompositeOperation="source-over";var b=this.getCachedZSortedEles();if(t.full)E.translate(-n.x1*c,-n.y1*c),E.scale(c,c),this.drawElements(E,b),E.scale(1/c,1/c),E.translate(n.x1*c,n.y1*c);else{var w=e.pan(),x={x:w.x*c,y:w.y*c};c*=e.zoom(),E.translate(x.x,x.y),E.scale(c,c),this.drawElements(E,b),E.scale(1/c,1/c),E.translate(-x.x,-x.y)}t.bg&&(E.globalCompositeOperation="destination-over",E.fillStyle=t.bg,E.rect(0,0,u,o),E.fill())}return y};function gM(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 O1(t){var e=t.indexOf(",");return t.substr(e+1)}function SE(t,e,a){var n=function(){return e.toDataURL(a,t.quality)};switch(t.output){case"blob-promise":return new Ll(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 gM(O1(n()),a);case"base64":return O1(n());default:return n()}}fs.png=function(t){return SE(t,this.bufferCanvasImage(t),"image/png")};fs.jpg=function(t){return SE(t,this.bufferCanvasImage(t),"image/jpeg")};var wE={};wE.nodeShapeImpl=function(t,e,a,n,l,u,o,f){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,f);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,a,n,l,u,f);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,a,n,l,u,o,f);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,a,n,l,u,f);case"barrel":return this.drawBarrelPath(e,a,n,l,u)}};var pM=TE,at=TE.prototype;at.CANVAS_LAYERS=3;at.SELECT_BOX=0;at.DRAG=1;at.NODE=2;at.WEBGL=3;at.CANVAS_TYPES=["2d","2d","2d","webgl2"];at.BUFFER_COUNT=3;at.TEXTURE_BUFFER=0;at.MOTIONBLUR_BUFFER_NODE=1;at.MOTIONBLUR_BUFFER_DRAG=2;function TE(t){var e=this,a=e.cy.window(),n=a.document;t.webgl&&(at.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(at.CANVAS_LAYERS),contexts:new Array(at.CANVAS_LAYERS),canvasNeedsRedraw:new Array(at.CANVAS_LAYERS),bufferCanvases:new Array(at.BUFFER_COUNT),bufferContexts:new Array(at.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 f=t.cy.container();f.appendChild(e.data.canvasContainer),f.style[l]=u;var d={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};fw()&&(d["-ms-touch-action"]="none",d["touch-action"]="none");for(var c=0;c<at.CANVAS_LAYERS;c++){var h=e.data.canvases[c]=n.createElement("canvas"),g=at.CANVAS_TYPES[c];e.data.contexts[c]=h.getContext(g),e.data.contexts[c]||qt("Could not create canvas of type "+g),Object.keys(d).forEach(function(de){h.style[de]=d[de]}),h.style.position="absolute",h.setAttribute("data-id","layer"+c),h.style.zIndex=String(at.CANVAS_LAYERS-c),e.data.canvasContainer.appendChild(h),e.data.canvasNeedsRedraw[c]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[at.NODE].setAttribute("data-id","layer"+at.NODE+"-node"),e.data.canvases[at.SELECT_BOX].setAttribute("data-id","layer"+at.SELECT_BOX+"-selectbox"),e.data.canvases[at.DRAG].setAttribute("data-id","layer"+at.DRAG+"-drag"),e.data.canvases[at.WEBGL]&&e.data.canvases[at.WEBGL].setAttribute("data-id","layer"+at.WEBGL+"-webgl");for(var c=0;c<at.BUFFER_COUNT;c++)e.data.bufferCanvases[c]=n.createElement("canvas"),e.data.bufferContexts[c]=e.data.bufferCanvases[c].getContext("2d"),e.data.bufferCanvases[c].style.position="absolute",e.data.bufferCanvases[c].setAttribute("data-id","buffer"+c),e.data.bufferCanvases[c].style.zIndex=String(-c-1),e.data.bufferCanvases[c].style.visibility="hidden";e.pathsEnabled=!0;var y=ka(),E=function($){return{x:($.x1+$.x2)/2,y:($.y1+$.y2)/2}},b=function($){return{x:-$.w/2,y:-$.h/2}},w=function($){var re=$[0]._private,le=re.oldBackgroundTimestamp===re.backgroundTimestamp;return!le},x=function($){return $[0]._private.nodeKey},S=function($){return $[0]._private.labelStyleKey},T=function($){return $[0]._private.sourceLabelStyleKey},C=function($){return $[0]._private.targetLabelStyleKey},D=function($,re,le,pe,j){return e.drawElement($,re,le,!1,!1,j)},R=function($,re,le,pe,j){return e.drawElementText($,re,le,pe,"main",j)},z=function($,re,le,pe,j){return e.drawElementText($,re,le,pe,"source",j)},B=function($,re,le,pe,j){return e.drawElementText($,re,le,pe,"target",j)},O=function($){return $.boundingBox(),$[0]._private.bodyBounds},_=function($){return $.boundingBox(),$[0]._private.labelBounds.main||y},U=function($){return $.boundingBox(),$[0]._private.labelBounds.source||y},V=function($){return $.boundingBox(),$[0]._private.labelBounds.target||y},q=function($,re){return re},P=function($){return E(O($))},Y=function($,re,le){var pe=$?$+"-":"";return{x:re.x+le.pstyle(pe+"text-margin-x").pfValue,y:re.y+le.pstyle(pe+"text-margin-y").pfValue}},I=function($,re,le){var pe=$[0]._private.rscratch;return{x:pe[re],y:pe[le]}},L=function($){return Y("",I($,"labelX","labelY"),$)},H=function($){return Y("source",I($,"sourceLabelX","sourceLabelY"),$)},F=function($){return Y("target",I($,"targetLabelX","targetLabelY"),$)},Q=function($){return b(O($))},J=function($){return b(U($))},M=function($){return b(V($))},G=function($){var re=_($),le=b(_($));if($.isNode()){switch($.pstyle("text-halign").value){case"left":le.x=-re.w-(re.leftPad||0);break;case"right":le.x=-(re.rightPad||0);break}switch($.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 Uu(e,{getKey:x,doesEleInvalidateKey:w,drawElement:D,getBoundingBox:O,getRotationPoint:P,getRotationOffset:Q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),W=e.data.lblTxrCache=new Uu(e,{getKey:S,drawElement:R,getBoundingBox:_,getRotationPoint:L,getRotationOffset:G,isVisible:q}),ae=e.data.slbTxrCache=new Uu(e,{getKey:T,drawElement:z,getBoundingBox:U,getRotationPoint:H,getRotationOffset:J,isVisible:q}),se=e.data.tlbTxrCache=new Uu(e,{getKey:C,drawElement:B,getBoundingBox:V,getRotationPoint:F,getRotationOffset:M,isVisible:q}),he=e.data.lyrTxrCache=new cE(e);e.onUpdateEleCalcs(function($,re){Z.invalidateElements(re),W.invalidateElements(re),ae.invalidateElements(re),se.invalidateElements(re),he.invalidateElements(re);for(var le=0;le<re.length;le++){var pe=re[le]._private;pe.oldBackgroundTimestamp=pe.backgroundTimestamp}});var we=function($){for(var re=0;re<$.length;re++)he.enqueueElementRefinement($[re].ele)};Z.onDequeue(we),W.onDequeue(we),ae.onDequeue(we),se.onDequeue(we),t.webgl&&e.initWebgl(t,{getStyleKey:x,getLabelKey:S,getSourceLabelKey:T,getTargetLabelKey:C,drawElement:D,drawLabel:R,drawSourceLabel:z,drawTargetLabel:B,getElementBox:O,getLabelBox:_,getSourceLabelBox:U,getTargetLabelBox:V,getElementRotationPoint:P,getElementRotationOffset:Q,getLabelRotationPoint:L,getSourceLabelRotationPoint:H,getTargetLabelRotationPoint:F,getLabelRotationOffset:G,getSourceLabelRotationOffset:J,getTargetLabelRotationOffset:M})}at.redrawHint=function(t,e){var a=this;switch(t){case"eles":a.data.canvasNeedsRedraw[at.NODE]=e;break;case"drag":a.data.canvasNeedsRedraw[at.DRAG]=e;break;case"select":a.data.canvasNeedsRedraw[at.SELECT_BOX]=e;break;case"gc":a.data.gc=!0;break}};var yM=typeof Path2D<"u";at.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};at.usePaths=function(){return yM&&this.pathsEnabled};at.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};at.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};at.makeOffscreenCanvas=function(t,e){var a;if((typeof OffscreenCanvas>"u"?"undefined":ua(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};[vE,kr,ln,fg,Oi,Wn,_a,yE,$n,fs,wE].forEach(function(t){Fe(at,t)});var mM=[{name:"null",impl:W2},{name:"base",impl:sE},{name:"canvas",impl:pM}],bM=[{type:"layout",extensions:FD},{type:"renderer",extensions:mM}],CE={},AE={};function DE(t,e,a){var n=a,l=function(O){Et("Can not register `"+e+"` for `"+t+"` since `"+O+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(Ju.prototype[e])return l(e);Ju.prototype[e]=a}else if(t==="collection"){if(Ta.prototype[e])return l(e);Ta.prototype[e]=a}else if(t==="layout"){for(var u=function(O){this.options=O,a.call(this,O),vt(this._private)||(this._private={}),this._private.cy=O.cy,this._private.listeners=[],this.createEmitter()},o=u.prototype=Object.create(a.prototype),f=[],d=0;d<f.length;d++){var c=f[d];o[c]=o[c]||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 B=this.options;if(B&&B.animate){var O=this.animations;if(O)for(var _=0;_<O.length;_++)O[_].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},y={addEventFields:function(O,_){_.layout=O,_.cy=g(O),_.target=O},bubble:function(){return!0},parent:function(O){return g(O)}};Fe(o,{createEmitter:function(){return this._private.emitter=new xf(y,this),this},emitter:function(){return this._private.emitter},on:function(O,_){return this.emitter().on(O,_),this},one:function(O,_){return this.emitter().one(O,_),this},once:function(O,_){return this.emitter().one(O,_),this},removeListener:function(O,_){return this.emitter().removeListener(O,_),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(O,_){return this.emitter().emit(O,_),this}}),bt.eventAliasesOn(o),n=u}else if(t==="renderer"&&e!=="null"&&e!=="base"){var E=BE("renderer","base"),b=E.prototype,w=a,x=a.prototype,S=function(){E.apply(this,arguments),w.apply(this,arguments)},T=S.prototype;for(var C in b){var D=b[C],R=x[C]!=null;if(R)return l(C);T[C]=D}for(var z in x)T[z]=x[z];b.clientFunctions.forEach(function(B){T[B]=T[B]||function(){qt("Renderer does not implement `renderer."+B+"()` on its prototype")}}),n=S}else if(t==="__proto__"||t==="constructor"||t==="prototype")return qt(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return X1({map:CE,keys:[t,e],value:n})}function BE(t,e){return j1({map:CE,keys:[t,e]})}function EM(t,e,a,n,l){return X1({map:AE,keys:[t,e,a,n],value:l})}function xM(t,e,a,n){return j1({map:AE,keys:[t,e,a,n]})}var Uh=function(){if(arguments.length===2)return BE.apply(null,arguments);if(arguments.length===3)return DE.apply(null,arguments);if(arguments.length===4)return xM.apply(null,arguments);if(arguments.length===5)return EM.apply(null,arguments);qt("Invalid extension access syntax")};Ju.prototype.extension=Uh;bM.forEach(function(t){t.extensions.forEach(function(e){DE(t.type,e.name,e.impl)})});var ff=function(){if(!(this instanceof ff))return new ff;this.length=0},Mi=ff.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(vt(t))for(var n=t,l=Object.keys(n),u=0;u<l.length;u++){var o=l[u],f=n[o];if(f!=null){var d=pa.properties[o]||pa.properties[cf(o)];if(d!=null){var c=d.name,h=f;this[a].properties.push({name:c,value:h})}}}return this};Mi.style=Mi.css;Mi.generateStyle=function(t){var e=new pa(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 SM="3.33.2",Ri=function(e){if(e===void 0&&(e={}),vt(e))return new Ju(e);if(Ge(e))return Uh.apply(Uh,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 e2(t)};Ri.version=SM;Ri.stylesheet=Ri.Stylesheet=ff;function ei(){return typeof window<"u"?window.__SWARMVAULT_EMBEDDED_DATA__:void 0}function wM(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 TM(t="/api/graph",e){const a=ei();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 CM(t,e={}){const a=ei(),n=e.limit??10,l=e.kind??"all",u=e.status??"all",o=e.project??"all";if(a){const c=t.trim().toLowerCase();return c?a.pages.filter(h=>l==="all"?!0:h.kind===l).filter(h=>u==="all"?!0:h.status===u).filter(h=>o==="all"?!0:o==="unassigned"?h.projectIds.length===0:h.projectIds.includes(o)).map(h=>{const g=`${h.title}
|
|
330
|
-
${h.content}`.toLowerCase(),y=g.includes(c)?g.indexOf(c):Number.POSITIVE_INFINITY;return{pageId:h.pageId,path:h.path,title:h.title,snippet:wM(h.content,t),rank:y,kind:h.kind,status:h.status,projectIds:h.projectIds}}).filter(h=>Number.isFinite(h.rank)).sort((h,g)=>h.rank-g.rank||h.title.localeCompare(g.title)).slice(0,n):[]}const f=new URLSearchParams({q:t,limit:String(n),kind:l,status:u,project:o}),d=await fetch(`/api/search?${f.toString()}`);if(!d.ok)throw new Error(`Failed to search pages: ${d.status} ${d.statusText}`);return d.json()}async function N1(t){const e=ei();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},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 AM(){if(ei())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 L1(t){if(ei())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 DM(t,e,a=[]){if(ei())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 BM(){if(ei())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 MM(t,e){if(ei())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()}const RM={source:"#f59e0b",module:"#fb7185",symbol:"#8b5cf6",concept:"#0ea5e9",entity:"#22c55e"};function k1(t){return t.replace(/\s+/g," ").trim().slice(0,220)}function bh(t){return[...new Set(t.filter(Boolean))]}function zM(){return{generatedAt:"",nodes:[],edges:[],communities:[],pages:[]}}function _1(t){return t.dataUrl??`/api/asset?path=${encodeURIComponent(t.path)}`}function OM(){const t=pt.useRef(null),e=pt.useRef(null),[a,n]=pt.useState(null),[l,u]=pt.useState(null),[o,f]=pt.useState("all"),[d,c]=pt.useState("all"),[h,g]=pt.useState("all"),[y,E]=pt.useState("all"),[b,w]=pt.useState(""),[x,S]=pt.useState([]),[T,C]=pt.useState(null),[D,R]=pt.useState(null),[z,B]=pt.useState(null),[O,_]=pt.useState([]),[U,V]=pt.useState(null),[q,P]=pt.useState(""),[Y,I]=pt.useState(null),[L,H]=pt.useState([]),[F,Q]=pt.useState(null),[J,M]=pt.useState(null),[G,Z]=pt.useState(""),W=pt.useDeferredValue(b),ae=T&&a?a.pages?.find(j=>j.path===T.path||j.id===(typeof T.frontmatter.page_id=="string"?T.frontmatter.page_id:""))??null:null,se=bh(a?.pages?.flatMap(j=>j.projectIds??[])??[]).sort((j,xe)=>j.localeCompare(xe)),he=ae?bh(ae.backlinks).map(j=>a?.pages?.find(xe=>xe.id===j)??null).filter(j=>!!j):[],we=ae?bh(ae.relatedPageIds).map(j=>a?.pages?.find(xe=>xe.id===j)??null).filter(j=>!!j):[],de=pt.useCallback(async()=>{let j=null,xe=null;const[Be,Ue,Ve]=await Promise.all([TM().catch(()=>zM()),AM().catch(Ae=>(j=Ae instanceof Error?Ae.message:String(Ae),[])),BM().catch(Ae=>(xe=Ae instanceof Error?Ae.message:String(Ae),[]))]);pt.startTransition(()=>{n(Be),_(Ue),H(Ve),I(j),Q(xe)})},[]);pt.useEffect(()=>{de()},[de]),pt.useEffect(()=>{if(!O.length){P(""),V(null);return}(!q||!O.some(j=>j.approvalId===q))&&P(O[0]?.approvalId??"")},[O,q]),pt.useEffect(()=>{if(!q)return;let j=!1;return L1(q).then(xe=>{j||(V(xe),I(null))}).catch(xe=>{j||I(xe instanceof Error?xe.message:String(xe))}),()=>{j=!0}},[q]),pt.useEffect(()=>{if(!t.current||!a)return;e.current?.destroy();const j=Ri({container:t.current,elements:[...a.nodes.map(xe=>({data:{...xe,color:RM[xe.type]??"#94a3b8"}})),...a.edges.filter(xe=>o==="all"||xe.status===o).map(xe=>({data:xe}))],layout:{name:"cose",animate:!1,idealEdgeLength:120,nodeRepulsion:8e3},style:[{selector:"node",style:{label:"data(label)","background-color":"data(color)",color:"#f8fafc","text-outline-color":"#020617","text-outline-width":2,"font-family":'"Avenir Next", "Segoe UI", sans-serif',"font-size":11}},{selector:"node[?isGodNode]",style:{width:56,height:56,"border-width":3,"border-color":"#fef08a"}},{selector:'node[type = "module"]',style:{shape:"round-rectangle",width:48,height:30}},{selector:'node[type = "symbol"]',style:{shape:"diamond",width:28,height:28,"font-size":9}},{selector:"edge",style:{width:2,"line-color":"#64748b","target-arrow-shape":"triangle","target-arrow-color":"#64748b","curve-style":"bezier",label:"data(relation)","font-size":9,color:"#cbd5e1"}},{selector:":selected",style:{"border-width":3,"border-color":"#f8fafc"}}]});return j.on("select","node",xe=>{u(xe.target.data())}),j.on("unselect","node",()=>{u(null)}),e.current=j,()=>j.destroy()},[a,o]),pt.useEffect(()=>{const j=W.trim();if(j.length<2){S([]),B(null);return}let xe=!1;return CM(j,{limit:10,kind:d,status:h,project:y}).then(Be=>{xe||pt.startTransition(()=>{S(Be),B(null)})}).catch(Be=>{xe||B(Be instanceof Error?Be.message:String(Be))}),()=>{xe=!0}},[W,d,h,y]),pt.useEffect(()=>{if(!l?.pageId)return;const j=a?.pages?.find(Be=>Be.id===l.pageId);if(!j)return;let xe=!1;return N1(j.path).then(Be=>{xe||(C(Be),R(null))}).catch(Be=>{xe||R(Be instanceof Error?Be.message:String(Be))}),()=>{xe=!0}},[a,l]);const $=async(j,xe)=>{try{const Be=await N1(j);if(C(Be),R(null),a&&e.current){const Ue=a.pages?.find(Ae=>Ae.path===j||(xe?Ae.id===xe:!1)),Ve=(xe?a.nodes.find(Ae=>Ae.pageId===xe):void 0)??a.nodes.find(Ae=>Ue?.nodeIds?.includes(Ae.id));Ve&&(e.current.elements().unselect(),e.current.getElementById(Ve.id).select(),e.current.center(e.current.getElementById(Ve.id)))}}catch(Be){R(Be instanceof Error?Be.message:String(Be))}},re=async j=>{await $(j.path,j.pageId)},le=async(j,xe)=>{if(q){Z(`${xe}:${j}`),M(null);try{await DM(q,xe,[j]),await de();const Be=await L1(q);V(Be)}catch(Be){M(Be instanceof Error?Be.message:String(Be))}finally{Z("")}}},pe=async(j,xe,Be)=>{Z(`${xe}:${j}`),M(null);try{const Ue=await MM(j,xe);await de(),xe==="promote"?await $(Ue.path,Ue.pageId):Be&&C(null)}catch(Ue){M(Ue instanceof Error?Ue.message:String(Ue))}finally{Z("")}};return fe.jsxs("main",{className:"app-shell",children:[fe.jsxs("section",{className:"app-header",children:[fe.jsxs("div",{children:[fe.jsx("p",{className:"eyebrow",children:"SwarmVault Viewer"}),fe.jsx("h1",{children:"Search, review, and promote the vault locally."}),fe.jsx("p",{className:"lede",children:"The graph, candidate queue, approval queue, and page previews stay in one local workspace instead of splitting review across tools."})]}),fe.jsxs("div",{className:"header-controls",children:[fe.jsxs("label",{className:"filter",children:["Edge status",fe.jsxs("select",{value:o,onChange:j=>f(j.target.value),children:[fe.jsx("option",{value:"all",children:"All"}),fe.jsx("option",{value:"extracted",children:"Extracted"}),fe.jsx("option",{value:"conflicted",children:"Conflicted"}),fe.jsx("option",{value:"inferred",children:"Inferred"}),fe.jsx("option",{value:"stale",children:"Stale"})]})]}),fe.jsxs("label",{className:"filter",children:["Page kind",fe.jsxs("select",{value:d,onChange:j=>c(j.target.value),children:[fe.jsx("option",{value:"all",children:"All"}),fe.jsx("option",{value:"source",children:"Source"}),fe.jsx("option",{value:"module",children:"Module"}),fe.jsx("option",{value:"concept",children:"Concept"}),fe.jsx("option",{value:"entity",children:"Entity"}),fe.jsx("option",{value:"output",children:"Output"}),fe.jsx("option",{value:"insight",children:"Insight"}),fe.jsx("option",{value:"index",children:"Index"})]})]}),fe.jsxs("label",{className:"filter",children:["Page status",fe.jsxs("select",{value:h,onChange:j=>g(j.target.value),children:[fe.jsx("option",{value:"all",children:"All"}),fe.jsx("option",{value:"active",children:"Active"}),fe.jsx("option",{value:"candidate",children:"Candidate"}),fe.jsx("option",{value:"draft",children:"Draft"}),fe.jsx("option",{value:"archived",children:"Archived"})]})]}),fe.jsxs("label",{className:"filter",children:["Project",fe.jsxs("select",{value:y,onChange:j=>E(j.target.value),children:[fe.jsx("option",{value:"all",children:"All"}),fe.jsx("option",{value:"unassigned",children:"Unassigned"}),se.map(j=>fe.jsx("option",{value:j,children:j},j))]})]}),fe.jsxs("label",{className:"filter search",children:["Search pages",fe.jsx("input",{type:"search",value:b,onChange:j=>w(j.target.value),placeholder:"Search wiki pages, outputs, and candidates"})]})]})]}),fe.jsxs("section",{className:"stats",children:[fe.jsxs("article",{children:[fe.jsx("span",{children:"Generated"}),fe.jsx("strong",{children:a?.generatedAt?new Date(a.generatedAt).toLocaleString():"Not compiled"})]}),fe.jsxs("article",{children:[fe.jsx("span",{children:"Nodes"}),fe.jsx("strong",{children:a?.nodes.length??0})]}),fe.jsxs("article",{children:[fe.jsx("span",{children:"Approvals"}),fe.jsx("strong",{children:O.reduce((j,xe)=>j+xe.pendingCount,0)})]}),fe.jsxs("article",{children:[fe.jsx("span",{children:"Candidates"}),fe.jsx("strong",{children:L.length})]})]}),fe.jsxs("section",{className:"workspace",children:[fe.jsx("div",{className:"canvas",ref:t}),fe.jsxs("aside",{className:"rail",children:[fe.jsxs("section",{className:"panel",children:[fe.jsx("h2",{children:"Search Results"}),z?fe.jsx("p",{children:z}):null,x.length?fe.jsx("div",{className:"results",children:x.map(j=>fe.jsxs("button",{type:"button",className:"result-card",onClick:()=>{re(j)},children:[fe.jsxs("span",{className:"panel-label",children:[j.kind??"page"," / ",j.status??"active"]}),fe.jsx("strong",{children:j.title}),fe.jsx("p",{children:j.projectIds.length?j.projectIds.join(", "):"global / unassigned"}),fe.jsx("p",{children:j.snippet})]},`${j.pageId}:${j.path}`))}):fe.jsx("p",{children:b.trim().length>=2?"No pages matched this query.":"Search the wiki, outputs, or candidate pages."})]}),fe.jsxs("section",{className:"panel",children:[fe.jsx("h2",{children:"Approval Queue"}),Y?fe.jsx("p",{children:Y}):null,J?fe.jsx("p",{children:J}):null,O.length?fe.jsx("div",{className:"results",children:O.map(j=>fe.jsxs("button",{type:"button",className:`result-card ${q===j.approvalId?"is-active":""}`,onClick:()=>P(j.approvalId),children:[fe.jsxs("span",{className:"panel-label",children:["pending ",j.pendingCount]}),fe.jsx("strong",{children:j.approvalId}),fe.jsxs("p",{children:["accepted ",j.acceptedCount," / rejected ",j.rejectedCount]})]},j.approvalId))}):fe.jsx("p",{children:"No staged approval bundles."}),U?.entries.length?fe.jsx("div",{className:"review-list",children:U.entries.map(j=>fe.jsxs("article",{className:"review-card",children:[fe.jsxs("span",{className:"panel-label",children:[j.status," / ",j.changeType]}),fe.jsx("strong",{children:j.title}),fe.jsx("p",{children:j.nextPath??j.previousPath}),j.stagedContent?fe.jsx("button",{type:"button",className:"link-button",onClick:()=>{$(j.nextPath??j.previousPath??"",j.pageId)},children:"Open page"}):null,j.status==="pending"?fe.jsxs("div",{className:"action-row",children:[fe.jsx("button",{type:"button",className:"action-button",disabled:G===`accept:${j.pageId}`,onClick:()=>{le(j.pageId,"accept")},children:"Accept"}),fe.jsx("button",{type:"button",className:"action-button danger",disabled:G===`reject:${j.pageId}`,onClick:()=>{le(j.pageId,"reject")},children:"Reject"})]}):fe.jsx("p",{children:j.currentContent?k1(j.currentContent):"No current content on disk."})]},`${j.pageId}:${j.nextPath??j.previousPath??j.changeType}`))}):null]}),fe.jsxs("section",{className:"panel",children:[fe.jsx("h2",{children:"Candidate Queue"}),F?fe.jsx("p",{children:F}):null,L.length?fe.jsx("div",{className:"review-list",children:L.map(j=>fe.jsxs("article",{className:"review-card",children:[fe.jsx("span",{className:"panel-label",children:j.kind}),fe.jsx("strong",{children:j.title}),fe.jsx("p",{children:j.path}),fe.jsx("button",{type:"button",className:"link-button",onClick:()=>{$(j.path,j.pageId)},children:"Open candidate"}),fe.jsxs("div",{className:"action-row",children:[fe.jsx("button",{type:"button",className:"action-button",disabled:G===`promote:${j.pageId}`,onClick:()=>{pe(j.pageId,"promote",j.activePath)},children:"Promote"}),fe.jsx("button",{type:"button",className:"action-button danger",disabled:G===`archive:${j.pageId}`,onClick:()=>{pe(j.pageId,"archive",j.path)},children:"Archive"})]})]},j.pageId))}):fe.jsx("p",{children:"No candidate pages are waiting for review."})]}),fe.jsxs("section",{className:"panel",children:[fe.jsx("h2",{children:"Selection"}),l?fe.jsxs(fe.Fragment,{children:[fe.jsx("p",{className:"panel-label",children:l.type}),fe.jsx("h3",{children:l.label}),fe.jsxs("p",{children:["Node ID: ",fe.jsx("code",{children:l.id})]}),l.language?fe.jsxs("p",{children:["Language: ",l.language]}):null,l.symbolKind?fe.jsxs("p",{children:["Symbol kind: ",l.symbolKind]}):null,l.moduleId?fe.jsxs("p",{children:["Module ID: ",l.moduleId]}):null,fe.jsxs("p",{children:["Sources: ",l.sourceIds.join(", ")||"None"]}),fe.jsxs("p",{children:["Projects: ",l.projectIds.join(", ")||"Global / unassigned"]}),fe.jsxs("p",{children:["Community: ",l.communityId??"Unassigned"]}),fe.jsxs("p",{children:["Degree: ",l.degree??0]}),fe.jsxs("p",{children:["Bridge score: ",l.bridgeScore??0]}),fe.jsxs("p",{children:["God node: ",l.isGodNode?"Yes":"No"]})]}):fe.jsx("p",{children:"Select a node to inspect graph metrics and linked pages."})]}),fe.jsxs("section",{className:"panel page-panel",children:[fe.jsx("h2",{children:"Page Preview"}),D?fe.jsx("p",{children:D}):null,T?fe.jsxs(fe.Fragment,{children:[fe.jsx("span",{className:"panel-label",children:T.path}),fe.jsx("h3",{children:T.title}),fe.jsxs("p",{children:[typeof T.frontmatter.kind=="string"?T.frontmatter.kind:"page"," /"," ",typeof T.frontmatter.status=="string"?T.frontmatter.status:"active"]}),fe.jsxs("p",{children:["Projects:"," ",Array.isArray(T.frontmatter.project_ids)&&T.frontmatter.project_ids.join(", ")||"Global / unassigned"]}),fe.jsx("p",{children:k1(T.content)}),T.assets.length?fe.jsx("div",{className:"asset-preview",children:T.assets.map(j=>j.mimeType.startsWith("image/")?fe.jsxs("figure",{className:"asset-card",children:[fe.jsx("img",{src:_1(j),alt:T.title}),fe.jsxs("figcaption",{children:[j.role," / ",j.mimeType]})]},j.id):fe.jsxs("a",{className:"link-button",href:_1(j),target:"_blank",rel:"noreferrer",children:["Open ",j.role]},j.id))}):null,he.length?fe.jsxs("div",{className:"linked-pages",children:[fe.jsx("span",{className:"panel-label",children:"Backlinks"}),fe.jsx("div",{className:"action-row",children:he.map(j=>fe.jsx("button",{type:"button",className:"link-button",onClick:()=>{$(j.path,j.id)},children:j.title},j.id))})]}):null,we.length?fe.jsxs("div",{className:"linked-pages",children:[fe.jsx("span",{className:"panel-label",children:"Related Pages"}),fe.jsx("div",{className:"action-row",children:we.map(j=>fe.jsx("button",{type:"button",className:"link-button",onClick:()=>{$(j.path,j.id)},children:j.title},j.id))})]}):null,fe.jsx("pre",{children:T.content.slice(0,1200)})]}):fe.jsx("p",{children:"Open a search result, review entry, candidate, or graph node page."})]})]})]})]})}XS.createRoot(document.getElementById("root")).render(fe.jsx(VS.StrictMode,{children:fe.jsx(OM,{})}));
|