@swarmvaultai/viewer 0.7.31 β 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/assets/index-CRcCxyS8.css +1 -0
- package/dist/assets/index-QQ74kUX8.js +368 -0
- package/dist/index.html +2 -2
- package/dist/lib.d.ts +32 -1
- package/dist/lib.js +55 -0
- package/package.json +19 -11
- package/dist/assets/index-CwkhOTfH.js +0 -332
- package/dist/assets/index-DRAglPyY.css +0 -1
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function xu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wv={exports:{}},Po={};var TE;function V_(){if(TE)return Po;TE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,l){var s=null;if(l!==void 0&&(s=""+l),i.key!==void 0&&(s=""+i.key),"key"in i){l={};for(var u in i)u!=="key"&&(l[u]=i[u])}else l=i;return i=l.ref,{$$typeof:t,type:r,key:s,ref:i!==void 0?i:null,props:l}}return Po.Fragment=e,Po.jsx=n,Po.jsxs=n,Po}var DE;function $_(){return DE||(DE=1,wv.exports=V_()),wv.exports}var _=$_(),Sv={exports:{}},bt={};var AE;function K_(){if(AE)return bt;AE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),p=Symbol.iterator;function m(I){return I===null||typeof I!="object"?null:(I=p&&I[p]||I["@@iterator"],typeof I=="function"?I:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function x(I,K,F){this.props=I,this.context=K,this.refs=S,this.updater=F||y}x.prototype.isReactComponent={},x.prototype.setState=function(I,K){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,K,"setState")},x.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function C(){}C.prototype=x.prototype;function T(I,K,F){this.props=I,this.context=K,this.refs=S,this.updater=F||y}var A=T.prototype=new C;A.constructor=T,w(A,x.prototype),A.isPureReactComponent=!0;var N=Array.isArray;function k(){}var D={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function L(I,K,F){var J=F.ref;return{$$typeof:t,type:I,key:K,ref:J!==void 0?J:null,props:F}}function M(I,K){return L(I.type,K,I.props)}function z(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function B(I){var K={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(F){return K[F]})}var U=/\/+/g;function V(I,K){return typeof I=="object"&&I!==null&&I.key!=null?B(""+I.key):K.toString(36)}function $(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(k,k):(I.status="pending",I.then(function(K){I.status==="pending"&&(I.status="fulfilled",I.value=K)},function(K){I.status==="pending"&&(I.status="rejected",I.reason=K)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function q(I,K,F,J,re){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var me=!1;if(I===null)me=!0;else switch(se){case"bigint":case"string":case"number":me=!0;break;case"object":switch(I.$$typeof){case t:case e:me=!0;break;case h:return me=I._init,q(me(I._payload),K,F,J,re)}}if(me)return re=re(I),me=J===""?"."+V(I,0):J,N(re)?(F="",me!=null&&(F=me.replace(U,"$&/")+"/"),q(re,K,F,"",function(ee){return ee})):re!=null&&(z(re)&&(re=M(re,F+(re.key==null||I&&I.key===re.key?"":(""+re.key).replace(U,"$&/")+"/")+me)),K.push(re)),1;me=0;var Ne=J===""?".":J+":";if(N(I))for(var pe=0;pe<I.length;pe++)J=I[pe],se=Ne+V(J,pe),me+=q(J,K,F,se,re);else if(pe=m(I),typeof pe=="function")for(I=pe.call(I),pe=0;!(J=I.next()).done;)J=J.value,se=Ne+V(J,pe++),me+=q(J,K,F,se,re);else if(se==="object"){if(typeof I.then=="function")return q($(I),K,F,J,re);throw K=String(I),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return me}function H(I,K,F){if(I==null)return I;var J=[],re=0;return q(I,J,"","",function(se){return K.call(F,se,re++)}),J}function Y(I){if(I._status===-1){var K=I._result;K=K(),K.then(function(F){(I._status===0||I._status===-1)&&(I._status=1,I._result=F)},function(F){(I._status===0||I._status===-1)&&(I._status=2,I._result=F)}),I._status===-1&&(I._status=0,I._result=K)}if(I._status===1)return I._result.default;throw I._result}var Q=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},P={map:H,forEach:function(I,K,F){H(I,function(){K.apply(this,arguments)},F)},count:function(I){var K=0;return H(I,function(){K++}),K},toArray:function(I){return H(I,function(K){return K})||[]},only:function(I){if(!z(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return bt.Activity=v,bt.Children=P,bt.Component=x,bt.Fragment=n,bt.Profiler=i,bt.PureComponent=T,bt.StrictMode=r,bt.Suspense=f,bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,bt.__COMPILER_RUNTIME={__proto__:null,c:function(I){return D.H.useMemoCache(I)}},bt.cache=function(I){return function(){return I.apply(null,arguments)}},bt.cacheSignal=function(){return null},bt.cloneElement=function(I,K,F){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var J=w({},I.props),re=I.key;if(K!=null)for(se in K.key!==void 0&&(re=""+K.key),K)!O.call(K,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&K.ref===void 0||(J[se]=K[se]);var se=arguments.length-2;if(se===1)J.children=F;else if(1<se){for(var me=Array(se),Ne=0;Ne<se;Ne++)me[Ne]=arguments[Ne+2];J.children=me}return L(I.type,re,J)},bt.createContext=function(I){return I={$$typeof:s,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:l,_context:I},I},bt.createElement=function(I,K,F){var J,re={},se=null;if(K!=null)for(J in K.key!==void 0&&(se=""+K.key),K)O.call(K,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(re[J]=K[J]);var me=arguments.length-2;if(me===1)re.children=F;else if(1<me){for(var Ne=Array(me),pe=0;pe<me;pe++)Ne[pe]=arguments[pe+2];re.children=Ne}if(I&&I.defaultProps)for(J in me=I.defaultProps,me)re[J]===void 0&&(re[J]=me[J]);return L(I,se,re)},bt.createRef=function(){return{current:null}},bt.forwardRef=function(I){return{$$typeof:u,render:I}},bt.isValidElement=z,bt.lazy=function(I){return{$$typeof:h,_payload:{_status:-1,_result:I},_init:Y}},bt.memo=function(I,K){return{$$typeof:c,type:I,compare:K===void 0?null:K}},bt.startTransition=function(I){var K=D.T,F={};D.T=F;try{var J=I(),re=D.S;re!==null&&re(F,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(k,Q)}catch(se){Q(se)}finally{K!==null&&F.types!==null&&(K.types=F.types),D.T=K}},bt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},bt.use=function(I){return D.H.use(I)},bt.useActionState=function(I,K,F){return D.H.useActionState(I,K,F)},bt.useCallback=function(I,K){return D.H.useCallback(I,K)},bt.useContext=function(I){return D.H.useContext(I)},bt.useDebugValue=function(){},bt.useDeferredValue=function(I,K){return D.H.useDeferredValue(I,K)},bt.useEffect=function(I,K){return D.H.useEffect(I,K)},bt.useEffectEvent=function(I){return D.H.useEffectEvent(I)},bt.useId=function(){return D.H.useId()},bt.useImperativeHandle=function(I,K,F){return D.H.useImperativeHandle(I,K,F)},bt.useInsertionEffect=function(I,K){return D.H.useInsertionEffect(I,K)},bt.useLayoutEffect=function(I,K){return D.H.useLayoutEffect(I,K)},bt.useMemo=function(I,K){return D.H.useMemo(I,K)},bt.useOptimistic=function(I,K){return D.H.useOptimistic(I,K)},bt.useReducer=function(I,K,F){return D.H.useReducer(I,K,F)},bt.useRef=function(I){return D.H.useRef(I)},bt.useState=function(I){return D.H.useState(I)},bt.useSyncExternalStore=function(I,K,F){return D.H.useSyncExternalStore(I,K,F)},bt.useTransition=function(){return D.H.useTransition()},bt.version="19.2.4",bt}var _E;function am(){return _E||(_E=1,Sv.exports=K_()),Sv.exports}var Ee=am();const Y_=xu(Ee);var Cv={exports:{}},Uo={},Tv={exports:{}},Dv={};var kE;function X_(){return kE||(kE=1,(function(t){function e(q,H){var Y=q.length;q.push(H);e:for(;0<Y;){var Q=Y-1>>>1,P=q[Q];if(0<i(P,H))q[Q]=H,q[Y]=P,Y=Q;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var H=q[0],Y=q.pop();if(Y!==H){q[0]=Y;e:for(var Q=0,P=q.length,I=P>>>1;Q<I;){var K=2*(Q+1)-1,F=q[K],J=K+1,re=q[J];if(0>i(F,Y))J<P&&0>i(re,F)?(q[Q]=re,q[J]=Y,Q=J):(q[Q]=F,q[K]=Y,Q=K);else if(J<P&&0>i(re,Y))q[Q]=re,q[J]=Y,Q=J;else break e}}return H}function i(q,H){var Y=q.sortIndex-H.sortIndex;return Y!==0?Y:q.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var s=Date,u=s.now();t.unstable_now=function(){return s.now()-u}}var f=[],c=[],h=1,v=null,p=3,m=!1,y=!1,w=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(q){for(var H=n(c);H!==null;){if(H.callback===null)r(c);else if(H.startTime<=q)r(c),H.sortIndex=H.expirationTime,e(f,H);else break;H=n(c)}}function N(q){if(w=!1,A(q),!y)if(n(f)!==null)y=!0,k||(k=!0,B());else{var H=n(c);H!==null&&$(N,H.startTime-q)}}var k=!1,D=-1,O=5,L=-1;function M(){return S?!0:!(t.unstable_now()-L<O)}function z(){if(S=!1,k){var q=t.unstable_now();L=q;var H=!0;try{e:{y=!1,w&&(w=!1,C(D),D=-1),m=!0;var Y=p;try{t:{for(A(q),v=n(f);v!==null&&!(v.expirationTime>q&&M());){var Q=v.callback;if(typeof Q=="function"){v.callback=null,p=v.priorityLevel;var P=Q(v.expirationTime<=q);if(q=t.unstable_now(),typeof P=="function"){v.callback=P,A(q),H=!0;break t}v===n(f)&&r(f),A(q)}else r(f);v=n(f)}if(v!==null)H=!0;else{var I=n(c);I!==null&&$(N,I.startTime-q),H=!1}}break e}finally{v=null,p=Y,m=!1}H=void 0}}finally{H?B():k=!1}}}var B;if(typeof T=="function")B=function(){T(z)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=z,B=function(){V.postMessage(null)}}else B=function(){x(z,0)};function $(q,H){D=x(function(){q(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(q){q.callback=null},t.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<q?Math.floor(1e3/q):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_next=function(q){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var Y=p;p=H;try{return q()}finally{p=Y}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(q,H){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Y=p;p=q;try{return H()}finally{p=Y}},t.unstable_scheduleCallback=function(q,H,Y){var Q=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?Q+Y:Q):Y=Q,q){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=Y+P,q={id:h++,callback:H,priorityLevel:q,startTime:Y,expirationTime:P,sortIndex:-1},Y>Q?(q.sortIndex=Y,e(c,q),n(f)===null&&q===n(c)&&(w?(C(D),D=-1):w=!0,$(N,Y-Q))):(q.sortIndex=P,e(f,q),y||m||(y=!0,k||(k=!0,B()))),q},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(q){var H=p;return function(){var Y=p;p=H;try{return q.apply(this,arguments)}finally{p=Y}}}})(Dv)),Dv}var NE;function Z_(){return NE||(NE=1,Tv.exports=X_()),Tv.exports}var Av={exports:{}},or={};var RE;function Q_(){if(RE)return or;RE=1;var t=am();function e(f){var c="https://react.dev/errors/"+f;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 #"+f+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(f,c,h){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:f,containerInfo:c,implementation:h}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,c){if(f==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return or.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,or.createPortal=function(f,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 l(f,c,null,h)},or.flushSync=function(f){var c=s.T,h=r.p;try{if(s.T=null,r.p=2,f)return f()}finally{s.T=c,r.p=h,r.d.f()}},or.preconnect=function(f,c){typeof f=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,r.d.C(f,c))},or.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},or.preinit=function(f,c){if(typeof f=="string"&&c&&typeof c.as=="string"){var h=c.as,v=u(h,c.crossOrigin),p=typeof c.integrity=="string"?c.integrity:void 0,m=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;h==="style"?r.d.S(f,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:v,integrity:p,fetchPriority:m}):h==="script"&&r.d.X(f,{crossOrigin:v,integrity:p,fetchPriority:m,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},or.preinitModule=function(f,c){if(typeof f=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var h=u(c.as,c.crossOrigin);r.d.M(f,{crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&r.d.M(f)},or.preload=function(f,c){if(typeof f=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var h=c.as,v=u(h,c.crossOrigin);r.d.L(f,h,{crossOrigin:v,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})}},or.preloadModule=function(f,c){if(typeof f=="string")if(c){var h=u(c.as,c.crossOrigin);r.d.m(f,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else r.d.m(f)},or.requestFormReset=function(f){r.d.r(f)},or.unstable_batchedUpdates=function(f,c){return f(c)},or.useFormState=function(f,c,h){return s.H.useFormState(f,c,h)},or.useFormStatus=function(){return s.H.useHostTransitionStatus()},or.version="19.2.4",or}var ME;function W_(){if(ME)return Av.exports;ME=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(),Av.exports=Q_(),Av.exports}var OE;function J_(){if(OE)return Uo;OE=1;var t=Z_(),e=am(),n=W_();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var o=a,d=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(d=o.return),a=o.return;while(a)}return o.tag===3?d:null}function s(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function u(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function f(a){if(l(a)!==a)throw Error(r(188))}function c(a){var o=a.alternate;if(!o){if(o=l(a),o===null)throw Error(r(188));return o!==a?null:a}for(var d=a,g=o;;){var b=d.return;if(b===null)break;var E=b.alternate;if(E===null){if(g=b.return,g!==null){d=g;continue}break}if(b.child===E.child){for(E=b.child;E;){if(E===d)return f(b),a;if(E===g)return f(b),o;E=E.sibling}throw Error(r(188))}if(d.return!==g.return)d=b,g=E;else{for(var R=!1,j=b.child;j;){if(j===d){R=!0,d=b,g=E;break}if(j===g){R=!0,g=b,d=E;break}j=j.sibling}if(!R){for(j=E.child;j;){if(j===d){R=!0,d=E,g=b;break}if(j===g){R=!0,g=E,d=b;break}j=j.sibling}if(!R)throw Error(r(189))}}if(d.alternate!==g)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:o}function h(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=h(a),o!==null)return o;a=a.sibling}return null}var v=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function B(a){return a===null||typeof a!="object"?null:(a=z&&a[z]||a["@@iterator"],typeof a=="function"?a:null)}var U=Symbol.for("react.client.reference");function V(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===U?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case w:return"Fragment";case x:return"Profiler";case S:return"StrictMode";case N:return"Suspense";case k:return"SuspenseList";case L:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case y:return"Portal";case T:return a.displayName||"Context";case C:return(a._context.displayName||"Context")+".Consumer";case A:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case D:return o=a.displayName||null,o!==null?o:V(a.type)||"Memo";case O:o=a._payload,a=a._init;try{return V(a(o))}catch{}}return null}var $=Array.isArray,q=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},Q=[],P=-1;function I(a){return{current:a}}function K(a){0>P||(a.current=Q[P],Q[P]=null,P--)}function F(a,o){P++,Q[P]=a.current,a.current=o}var J=I(null),re=I(null),se=I(null),me=I(null);function Ne(a,o){switch(F(se,o),F(re,a),F(J,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?Y0(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=Y0(o),a=X0(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}K(J),F(J,a)}function pe(){K(J),K(re),K(se)}function ee(a){a.memoizedState!==null&&F(me,a);var o=J.current,d=X0(o,a.type);o!==d&&(F(re,a),F(J,d))}function le(a){re.current===a&&(K(J),K(re)),me.current===a&&(K(me),Lo._currentValue=Y)}var de,xe;function Re(a){if(de===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);de=o&&o[1]||"",xe=-1<d.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+de+a+xe}var $e=!1;function Ye(a,o){if(!a||$e)return"";$e=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(be){var ge=be}Reflect.construct(a,[],_e)}else{try{_e.call()}catch(be){ge=be}a.call(_e.prototype)}}else{try{throw Error()}catch(be){ge=be}(_e=a())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(be){if(be&&ge&&typeof be.stack=="string")return[be.stack,ge.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=g.DetermineComponentFrameRoot(),R=E[0],j=E[1];if(R&&j){var Z=R.split(`
|
|
4
|
+
`),ve=j.split(`
|
|
5
|
+
`);for(b=g=0;g<Z.length&&!Z[g].includes("DetermineComponentFrameRoot");)g++;for(;b<ve.length&&!ve[b].includes("DetermineComponentFrameRoot");)b++;if(g===Z.length||b===ve.length)for(g=Z.length-1,b=ve.length-1;1<=g&&0<=b&&Z[g]!==ve[b];)b--;for(;1<=g&&0<=b;g--,b--)if(Z[g]!==ve[b]){if(g!==1||b!==1)do if(g--,b--,0>b||Z[g]!==ve[b]){var Se=`
|
|
6
|
+
`+Z[g].replace(" at new "," at ");return a.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",a.displayName)),Se}while(1<=g&&0<=b);break}}}finally{$e=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Re(d):""}function lt(a,o){switch(a.tag){case 26:case 27:case 5:return Re(a.type);case 16:return Re("Lazy");case 13:return a.child!==o&&o!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Ye(a.type,!1);case 11:return Ye(a.type.render,!1);case 1:return Ye(a.type,!0);case 31:return Re("Activity");default:return""}}function We(a){try{var o="",d=null;do o+=lt(a,d),d=a,a=a.return;while(a);return o}catch(g){return`
|
|
7
|
+
Error generating stack: `+g.message+`
|
|
8
|
+
`+g.stack}}var et=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Ge=t.unstable_cancelCallback,tt=t.unstable_shouldYield,ot=t.unstable_requestPaint,Pe=t.unstable_now,pt=t.unstable_getCurrentPriorityLevel,ue=t.unstable_ImmediatePriority,Te=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Ue=t.log,ye=t.unstable_setDisableYieldValue,G=null,te=null;function fe(a){if(typeof Ue=="function"&&ye(a),te&&typeof te.setStrictMode=="function")try{te.setStrictMode(G,a)}catch{}}var ce=Math.clz32?Math.clz32:ke,we=Math.log,Ie=Math.LN2;function ke(a){return a>>>=0,a===0?32:31-(we(a)/Ie|0)|0}var Ve=256,Ke=262144,Qe=4194304;function ut(a){var o=a&42;if(o!==0)return o;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function X(a,o,d){var g=a.pendingLanes;if(g===0)return 0;var b=0,E=a.suspendedLanes,R=a.pingedLanes;a=a.warmLanes;var j=g&134217727;return j!==0?(g=j&~E,g!==0?b=ut(g):(R&=j,R!==0?b=ut(R):d||(d=j&~a,d!==0&&(b=ut(d))))):(j=g&~E,j!==0?b=ut(j):R!==0?b=ut(R):d||(d=g&~a,d!==0&&(b=ut(d)))),b===0?0:o!==0&&o!==b&&(o&E)===0&&(E=b&-b,d=o&-o,E>=d||E===32&&(d&4194048)!==0)?o:b}function ne(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Ce(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Fe(){var a=Qe;return Qe<<=1,(Qe&62914560)===0&&(Qe=4194304),a}function mt(a){for(var o=[],d=0;31>d;d++)o.push(a);return o}function ft(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function He(a,o,d,g,b,E){var R=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var j=a.entanglements,Z=a.expirationTimes,ve=a.hiddenUpdates;for(d=R&~d;0<d;){var Se=31-ce(d),_e=1<<Se;j[Se]=0,Z[Se]=-1;var ge=ve[Se];if(ge!==null)for(ve[Se]=null,Se=0;Se<ge.length;Se++){var be=ge[Se];be!==null&&(be.lane&=-536870913)}d&=~_e}g!==0&&Me(a,g,0),E!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=E&~(R&~o))}function Me(a,o,d){a.pendingLanes|=o,a.suspendedLanes&=~o;var g=31-ce(o);a.entangledLanes|=o,a.entanglements[g]=a.entanglements[g]|1073741824|d&261930}function Ze(a,o){var d=a.entangledLanes|=o;for(a=a.entanglements;d;){var g=31-ce(d),b=1<<g;b&o|a[g]&o&&(a[g]|=o),d&=~b}}function Et(a,o){var d=o&-o;return d=(d&42)!==0?1:yt(d),(d&(a.suspendedLanes|o))!==0?0:d}function yt(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Nn(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Bt(){var a=H.p;return a!==0?a:(a=window.event,a===void 0?32:yE(a.type))}function Gn(a,o){var d=H.p;try{return H.p=a,o()}finally{H.p=d}}var Ft=Math.random().toString(36).slice(2),Vt="__reactFiber$"+Ft,yn="__reactProps$"+Ft,Vn="__reactContainer$"+Ft,Sn="__reactEvents$"+Ft,bn="__reactListeners$"+Ft,En="__reactHandles$"+Ft,Gr="__reactResources$"+Ft,rn="__reactMarker$"+Ft;function ha(a){delete a[Vt],delete a[yn],delete a[Sn],delete a[bn],delete a[En]}function Cn(a){var o=a[Vt];if(o)return o;for(var d=a.parentNode;d;){if(o=d[Vn]||d[Vt]){if(d=o.alternate,o.child!==null||d!==null&&d.child!==null)for(a=nE(a);a!==null;){if(d=a[Vt])return d;a=nE(a)}return o}a=d,d=a.parentNode}return null}function sr(a){if(a=a[Vt]||a[Vn]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function vr(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function Vr(a){var o=a[Gr];return o||(o=a[Gr]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function fn(a){a[rn]=!0}var Ja=new Set,ia={};function oe(a,o){ie(a,o),ie(a+"Capture",o)}function ie(a,o){for(ia[a]=o,a=0;a<o.length;a++)Ja.add(o[a])}var Ae=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]*$"),Je={},Dt={};function Pt(a){return et.call(Dt,a)?!0:et.call(Je,a)?!1:Ae.test(a)?Dt[a]=!0:(Je[a]=!0,!1)}function Qt(a,o,d){if(Pt(o))if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var g=o.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+d)}}function Zn(a,o,d){if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+d)}}function Qn(a,o,d,g){if(g===null)a.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(o,d,""+g)}}function Ut(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function dn(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ol(a,o,d){var g=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var b=g.get,E=g.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(R){d=""+R,E.call(this,R)}}),Object.defineProperty(a,o,{enumerable:g.enumerable}),{getValue:function(){return d},setValue:function(R){d=""+R},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Yi(a){if(!a._valueTracker){var o=dn(a)?"checked":"value";a._valueTracker=Ol(a,o,""+a[o])}}function Xi(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var d=o.getValue(),g="";return a&&(g=dn(a)?a.checked?"true":"false":a.value),a=g,a!==d?(o.setValue(a),!0):!1}function Bl(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var xd=/[\n"\\]/g;function xr(a){return a.replace(xd,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Ys(a,o,d,g,b,E,R,j){a.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?a.type=R:a.removeAttribute("type"),o!=null?R==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+Ut(o)):a.value!==""+Ut(o)&&(a.value=""+Ut(o)):R!=="submit"&&R!=="reset"||a.removeAttribute("value"),o!=null?Ll(a,R,Ut(o)):d!=null?Ll(a,R,Ut(d)):g!=null&&a.removeAttribute("value"),b==null&&E!=null&&(a.defaultChecked=!!E),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?a.name=""+Ut(j):a.removeAttribute("name")}function Zi(a,o,d,g,b,E,R,j){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(a.type=E),o!=null||d!=null){if(!(E!=="submit"&&E!=="reset"||o!=null)){Yi(a);return}d=d!=null?""+Ut(d):"",o=o!=null?""+Ut(o):d,j||o===a.value||(a.value=o),a.defaultValue=o}g=g??b,g=typeof g!="function"&&typeof g!="symbol"&&!!g,a.checked=j?a.checked:!!g,a.defaultChecked=!!g,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(a.name=R),Yi(a)}function Ll(a,o,d){o==="number"&&Bl(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function Wn(a,o,d,g){if(a=a.options,o){o={};for(var b=0;b<d.length;b++)o["$"+d[b]]=!0;for(d=0;d<a.length;d++)b=o.hasOwnProperty("$"+a[d].value),a[d].selected!==b&&(a[d].selected=b),b&&g&&(a[d].defaultSelected=!0)}else{for(d=""+Ut(d),o=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,g&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function Pu(a,o,d){if(o!=null&&(o=""+Ut(o),o!==a.value&&(a.value=o),d==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=d!=null?""+Ut(d):""}function Fl(a,o,d,g){if(o==null){if(g!=null){if(d!=null)throw Error(r(92));if($(g)){if(1<g.length)throw Error(r(93));g=g[0]}d=g}d==null&&(d=""),o=d}d=Ut(o),a.defaultValue=d,g=a.textContent,g===d&&g!==""&&g!==null&&(a.value=g),Yi(a)}function gt(a,o){if(o){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=o;return}}a.textContent=o}var Uu=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 Rn(a,o,d){var g=o.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?g?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":g?a.setProperty(o,d):typeof d!="number"||d===0||Uu.has(o)?o==="float"?a.cssFloat=d:a[o]=(""+d).trim():a[o]=d+"px"}function Yt(a,o,d){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,d!=null){for(var g in d)!d.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?a.setProperty(g,""):g==="float"?a.cssFloat="":a[g]="");for(var b in o)g=o[b],o.hasOwnProperty(b)&&d[b]!==g&&Rn(a,b,g)}else for(var E in o)o.hasOwnProperty(E)&&Rn(a,E,o[E])}function ei(a){if(a.indexOf("-")===-1)return!1;switch(a){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 _a=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"]]),Xs=/^[\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 ti(a){return Xs.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function qe(){}var at=null;function xt(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Nt=null,xn=null;function $r(a){var o=sr(a);if(o&&(a=o.stateNode)){var d=a[yn]||null;e:switch(a=o.stateNode,o.type){case"input":if(Ys(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),o=d.name,d.type==="radio"&&o!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+xr(""+o)+'"][type="radio"]'),o=0;o<d.length;o++){var g=d[o];if(g!==a&&g.form===a.form){var b=g[yn]||null;if(!b)throw Error(r(90));Ys(g,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<d.length;o++)g=d[o],g.form===a.form&&Xi(g)}break e;case"textarea":Pu(a,d.value,d.defaultValue);break e;case"select":o=d.value,o!=null&&Wn(a,!!d.multiple,o,!1)}}}var Zs=!1;function qu(a,o,d){if(Zs)return a(o,d);Zs=!0;try{var g=a(o);return g}finally{if(Zs=!1,(Nt!==null||xn!==null)&&(_c(),Nt&&(o=Nt,a=xn,xn=Nt=null,$r(o),a)))for(o=0;o<a.length;o++)$r(a[o])}}function Qs(a,o){var d=a.stateNode;if(d===null)return null;var g=d[yn]||null;if(g===null)return null;d=g[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,o,typeof d));return d}var ka=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wd=!1;if(ka)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){wd=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{wd=!1}var ni=null,Sd=null,Hu=null;function Xm(){if(Hu)return Hu;var a,o=Sd,d=o.length,g,b="value"in ni?ni.value:ni.textContent,E=b.length;for(a=0;a<d&&o[a]===b[a];a++);var R=d-a;for(g=1;g<=R&&o[d-g]===b[E-g];g++);return Hu=b.slice(a,1<g?1-g:void 0)}function ju(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function Gu(){return!0}function Zm(){return!1}function wr(a){function o(d,g,b,E,R){this._reactName=d,this._targetInst=b,this.type=g,this.nativeEvent=E,this.target=R,this.currentTarget=null;for(var j in a)a.hasOwnProperty(j)&&(d=a[j],this[j]=d?d(E):E[j]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Gu:Zm,this.isPropagationStopped=Zm,this}return v(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Gu)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Gu)},persist:function(){},isPersistent:Gu}),o}var Qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vu=wr(Qi),Js=v({},Qi,{view:0,detail:0}),jD=wr(Js),Cd,Td,eo,$u=v({},Js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ad,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==eo&&(eo&&a.type==="mousemove"?(Cd=a.screenX-eo.screenX,Td=a.screenY-eo.screenY):Td=Cd=0,eo=a),Cd)},movementY:function(a){return"movementY"in a?a.movementY:Td}}),Qm=wr($u),GD=v({},$u,{dataTransfer:0}),VD=wr(GD),$D=v({},Js,{relatedTarget:0}),Dd=wr($D),KD=v({},Qi,{animationName:0,elapsedTime:0,pseudoElement:0}),YD=wr(KD),XD=v({},Qi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),ZD=wr(XD),QD=v({},Qi,{data:0}),Wm=wr(QD),WD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JD={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"},eA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tA(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=eA[a])?!!o[a]:!1}function Ad(){return tA}var nA=v({},Js,{key:function(a){if(a.key){var o=WD[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=ju(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?JD[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ad,charCode:function(a){return a.type==="keypress"?ju(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?ju(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),rA=wr(nA),aA=v({},$u,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jm=wr(aA),iA=v({},Js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ad}),lA=wr(iA),sA=v({},Qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),oA=wr(sA),uA=v({},$u,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),cA=wr(uA),fA=v({},Qi,{newState:0,oldState:0}),dA=wr(fA),hA=[9,13,27,32],_d=ka&&"CompositionEvent"in window,to=null;ka&&"documentMode"in document&&(to=document.documentMode);var vA=ka&&"TextEvent"in window&&!to,ey=ka&&(!_d||to&&8<to&&11>=to),ty=" ",ny=!1;function ry(a,o){switch(a){case"keyup":return hA.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ay(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Il=!1;function gA(a,o){switch(a){case"compositionend":return ay(o);case"keypress":return o.which!==32?null:(ny=!0,ty);case"textInput":return a=o.data,a===ty&&ny?null:a;default:return null}}function pA(a,o){if(Il)return a==="compositionend"||!_d&&ry(a,o)?(a=Xm(),Hu=Sd=ni=null,Il=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return ey&&o.locale!=="ko"?null:o.data;default:return null}}var mA={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 iy(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!mA[a.type]:o==="textarea"}function ly(a,o,d,g){Nt?xn?xn.push(g):xn=[g]:Nt=g,o=Lc(o,"onChange"),0<o.length&&(d=new Vu("onChange","change",null,d,g),a.push({event:d,listeners:o}))}var no=null,ro=null;function yA(a){H0(a,0)}function Ku(a){var o=vr(a);if(Xi(o))return a}function sy(a,o){if(a==="change")return o}var oy=!1;if(ka){var kd;if(ka){var Nd="oninput"in document;if(!Nd){var uy=document.createElement("div");uy.setAttribute("oninput","return;"),Nd=typeof uy.oninput=="function"}kd=Nd}else kd=!1;oy=kd&&(!document.documentMode||9<document.documentMode)}function cy(){no&&(no.detachEvent("onpropertychange",fy),ro=no=null)}function fy(a){if(a.propertyName==="value"&&Ku(ro)){var o=[];ly(o,ro,a,xt(a)),qu(yA,o)}}function bA(a,o,d){a==="focusin"?(cy(),no=o,ro=d,no.attachEvent("onpropertychange",fy)):a==="focusout"&&cy()}function EA(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Ku(ro)}function xA(a,o){if(a==="click")return Ku(o)}function wA(a,o){if(a==="input"||a==="change")return Ku(o)}function SA(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var Br=typeof Object.is=="function"?Object.is:SA;function ao(a,o){if(Br(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var d=Object.keys(a),g=Object.keys(o);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var b=d[g];if(!et.call(o,b)||!Br(a[b],o[b]))return!1}return!0}function dy(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function hy(a,o){var d=dy(a);a=0;for(var g;d;){if(d.nodeType===3){if(g=a+d.textContent.length,a<=o&&g>=o)return{node:d,offset:o-a};a=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=dy(d)}}function vy(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?vy(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function gy(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Bl(a.document);o instanceof a.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)a=o.contentWindow;else break;o=Bl(a.document)}return o}function Rd(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var CA=ka&&"documentMode"in document&&11>=document.documentMode,zl=null,Md=null,io=null,Od=!1;function py(a,o,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Od||zl==null||zl!==Bl(g)||(g=zl,"selectionStart"in g&&Rd(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),io&&ao(io,g)||(io=g,g=Lc(Md,"onSelect"),0<g.length&&(o=new Vu("onSelect","select",null,o,d),a.push({event:o,listeners:g}),o.target=zl)))}function Wi(a,o){var d={};return d[a.toLowerCase()]=o.toLowerCase(),d["Webkit"+a]="webkit"+o,d["Moz"+a]="moz"+o,d}var Pl={animationend:Wi("Animation","AnimationEnd"),animationiteration:Wi("Animation","AnimationIteration"),animationstart:Wi("Animation","AnimationStart"),transitionrun:Wi("Transition","TransitionRun"),transitionstart:Wi("Transition","TransitionStart"),transitioncancel:Wi("Transition","TransitionCancel"),transitionend:Wi("Transition","TransitionEnd")},Bd={},my={};ka&&(my=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function Ji(a){if(Bd[a])return Bd[a];if(!Pl[a])return a;var o=Pl[a],d;for(d in o)if(o.hasOwnProperty(d)&&d in my)return Bd[a]=o[d];return a}var yy=Ji("animationend"),by=Ji("animationiteration"),Ey=Ji("animationstart"),TA=Ji("transitionrun"),DA=Ji("transitionstart"),AA=Ji("transitioncancel"),xy=Ji("transitionend"),wy=new Map,Ld="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(" ");Ld.push("scrollEnd");function la(a,o){wy.set(a,o),oe(o,[a])}var Yu=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Kr=[],Ul=0,Fd=0;function Xu(){for(var a=Ul,o=Fd=Ul=0;o<a;){var d=Kr[o];Kr[o++]=null;var g=Kr[o];Kr[o++]=null;var b=Kr[o];Kr[o++]=null;var E=Kr[o];if(Kr[o++]=null,g!==null&&b!==null){var R=g.pending;R===null?b.next=b:(b.next=R.next,R.next=b),g.pending=b}E!==0&&Sy(d,b,E)}}function Zu(a,o,d,g){Kr[Ul++]=a,Kr[Ul++]=o,Kr[Ul++]=d,Kr[Ul++]=g,Fd|=g,a.lanes|=g,a=a.alternate,a!==null&&(a.lanes|=g)}function Id(a,o,d,g){return Zu(a,o,d,g),Qu(a)}function el(a,o){return Zu(a,null,null,o),Qu(a)}function Sy(a,o,d){a.lanes|=d;var g=a.alternate;g!==null&&(g.lanes|=d);for(var b=!1,E=a.return;E!==null;)E.childLanes|=d,g=E.alternate,g!==null&&(g.childLanes|=d),E.tag===22&&(a=E.stateNode,a===null||a._visibility&1||(b=!0)),a=E,E=E.return;return a.tag===3?(E=a.stateNode,b&&o!==null&&(b=31-ce(d),a=E.hiddenUpdates,g=a[b],g===null?a[b]=[o]:g.push(o),o.lane=d|536870912),E):null}function Qu(a){if(50<_o)throw _o=0,$h=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var ql={};function _A(a,o,d,g){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(a,o,d,g){return new _A(a,o,d,g)}function zd(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Na(a,o){var d=a.alternate;return d===null?(d=Lr(a.tag,o,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=o,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&65011712,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,o=a.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function Cy(a,o){a.flags&=65011714;var d=a.alternate;return d===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=d.childLanes,a.lanes=d.lanes,a.child=d.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=d.memoizedProps,a.memoizedState=d.memoizedState,a.updateQueue=d.updateQueue,a.type=d.type,o=d.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Wu(a,o,d,g,b,E){var R=0;if(g=a,typeof a=="function")zd(a)&&(R=1);else if(typeof a=="string")R=O_(a,d,J.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case L:return a=Lr(31,d,o,b),a.elementType=L,a.lanes=E,a;case w:return tl(d.children,b,E,o);case S:R=8,b|=24;break;case x:return a=Lr(12,d,o,b|2),a.elementType=x,a.lanes=E,a;case N:return a=Lr(13,d,o,b),a.elementType=N,a.lanes=E,a;case k:return a=Lr(19,d,o,b),a.elementType=k,a.lanes=E,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case T:R=10;break e;case C:R=9;break e;case A:R=11;break e;case D:R=14;break e;case O:R=16,g=null;break e}R=29,d=Error(r(130,a===null?"null":typeof a,"")),g=null}return o=Lr(R,d,o,b),o.elementType=a,o.type=g,o.lanes=E,o}function tl(a,o,d,g){return a=Lr(7,a,g,o),a.lanes=d,a}function Pd(a,o,d){return a=Lr(6,a,null,o),a.lanes=d,a}function Ty(a){var o=Lr(18,null,null,0);return o.stateNode=a,o}function Ud(a,o,d){return o=Lr(4,a.children!==null?a.children:[],a.key,o),o.lanes=d,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var Dy=new WeakMap;function Yr(a,o){if(typeof a=="object"&&a!==null){var d=Dy.get(a);return d!==void 0?d:(o={value:a,source:o,stack:We(o)},Dy.set(a,o),o)}return{value:a,source:o,stack:We(o)}}var Hl=[],jl=0,Ju=null,lo=0,Xr=[],Zr=0,ri=null,va=1,ga="";function Ra(a,o){Hl[jl++]=lo,Hl[jl++]=Ju,Ju=a,lo=o}function Ay(a,o,d){Xr[Zr++]=va,Xr[Zr++]=ga,Xr[Zr++]=ri,ri=a;var g=va;a=ga;var b=32-ce(g)-1;g&=~(1<<b),d+=1;var E=32-ce(o)+b;if(30<E){var R=b-b%5;E=(g&(1<<R)-1).toString(32),g>>=R,b-=R,va=1<<32-ce(o)+b|d<<b|g,ga=E+a}else va=1<<E|d<<b|g,ga=a}function qd(a){a.return!==null&&(Ra(a,1),Ay(a,1,0))}function Hd(a){for(;a===Ju;)Ju=Hl[--jl],Hl[jl]=null,lo=Hl[--jl],Hl[jl]=null;for(;a===ri;)ri=Xr[--Zr],Xr[Zr]=null,ga=Xr[--Zr],Xr[Zr]=null,va=Xr[--Zr],Xr[Zr]=null}function _y(a,o){Xr[Zr++]=va,Xr[Zr++]=ga,Xr[Zr++]=ri,va=o.id,ga=o.overflow,ri=a}var Jn=null,hn=null,Ot=!1,ai=null,Qr=!1,jd=Error(r(519));function ii(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw so(Yr(o,a)),jd}function ky(a){var o=a.stateNode,d=a.type,g=a.memoizedProps;switch(o[Vt]=a,o[yn]=g,d){case"dialog":_t("cancel",o),_t("close",o);break;case"iframe":case"object":case"embed":_t("load",o);break;case"video":case"audio":for(d=0;d<No.length;d++)_t(No[d],o);break;case"source":_t("error",o);break;case"img":case"image":case"link":_t("error",o),_t("load",o);break;case"details":_t("toggle",o);break;case"input":_t("invalid",o),Zi(o,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":_t("invalid",o);break;case"textarea":_t("invalid",o),Fl(o,g.value,g.defaultValue,g.children)}d=g.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||o.textContent===""+d||g.suppressHydrationWarning===!0||$0(o.textContent,d)?(g.popover!=null&&(_t("beforetoggle",o),_t("toggle",o)),g.onScroll!=null&&_t("scroll",o),g.onScrollEnd!=null&&_t("scrollend",o),g.onClick!=null&&(o.onclick=qe),o=!0):o=!1,o||ii(a,!0)}function Ny(a){for(Jn=a.return;Jn;)switch(Jn.tag){case 5:case 31:case 13:Qr=!1;return;case 27:case 3:Qr=!0;return;default:Jn=Jn.return}}function Gl(a){if(a!==Jn)return!1;if(!Ot)return Ny(a),Ot=!0,!1;var o=a.tag,d;if((d=o!==3&&o!==27)&&((d=o===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||sv(a.type,a.memoizedProps)),d=!d),d&&hn&&ii(a),Ny(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));hn=tE(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));hn=tE(a)}else o===27?(o=hn,bi(a.type)?(a=dv,dv=null,hn=a):hn=o):hn=Jn?Jr(a.stateNode.nextSibling):null;return!0}function nl(){hn=Jn=null,Ot=!1}function Gd(){var a=ai;return a!==null&&(Dr===null?Dr=a:Dr.push.apply(Dr,a),ai=null),a}function so(a){ai===null?ai=[a]:ai.push(a)}var Vd=I(null),rl=null,Ma=null;function li(a,o,d){F(Vd,o._currentValue),o._currentValue=d}function Oa(a){a._currentValue=Vd.current,K(Vd)}function $d(a,o,d){for(;a!==null;){var g=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),a===d)break;a=a.return}}function Kd(a,o,d,g){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var E=b.dependencies;if(E!==null){var R=b.child;E=E.firstContext;e:for(;E!==null;){var j=E;E=b;for(var Z=0;Z<o.length;Z++)if(j.context===o[Z]){E.lanes|=d,j=E.alternate,j!==null&&(j.lanes|=d),$d(E.return,d,a),g||(R=null);break e}E=j.next}}else if(b.tag===18){if(R=b.return,R===null)throw Error(r(341));R.lanes|=d,E=R.alternate,E!==null&&(E.lanes|=d),$d(R,d,a),R=null}else R=b.child;if(R!==null)R.return=b;else for(R=b;R!==null;){if(R===a){R=null;break}if(b=R.sibling,b!==null){b.return=R.return,R=b;break}R=R.return}b=R}}function Vl(a,o,d,g){a=null;for(var b=o,E=!1;b!==null;){if(!E){if((b.flags&524288)!==0)E=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var R=b.alternate;if(R===null)throw Error(r(387));if(R=R.memoizedProps,R!==null){var j=b.type;Br(b.pendingProps.value,R.value)||(a!==null?a.push(j):a=[j])}}else if(b===me.current){if(R=b.alternate,R===null)throw Error(r(387));R.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Lo):a=[Lo])}b=b.return}a!==null&&Kd(o,a,d,g),o.flags|=262144}function ec(a){for(a=a.firstContext;a!==null;){if(!Br(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function al(a){rl=a,Ma=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function er(a){return Ry(rl,a)}function tc(a,o){return rl===null&&al(a),Ry(a,o)}function Ry(a,o){var d=o._currentValue;if(o={context:o,memoizedValue:d,next:null},Ma===null){if(a===null)throw Error(r(308));Ma=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else Ma=Ma.next=o;return d}var kA=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(d,g){a.push(g)}};this.abort=function(){o.aborted=!0,a.forEach(function(d){return d()})}},NA=t.unstable_scheduleCallback,RA=t.unstable_NormalPriority,Mn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yd(){return{controller:new kA,data:new Map,refCount:0}}function oo(a){a.refCount--,a.refCount===0&&NA(RA,function(){a.controller.abort()})}var uo=null,Xd=0,$l=0,Kl=null;function MA(a,o){if(uo===null){var d=uo=[];Xd=0,$l=Wh(),Kl={status:"pending",value:void 0,then:function(g){d.push(g)}}}return Xd++,o.then(My,My),o}function My(){if(--Xd===0&&uo!==null){Kl!==null&&(Kl.status="fulfilled");var a=uo;uo=null,$l=0,Kl=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function OA(a,o){var d=[],g={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return a.then(function(){g.status="fulfilled",g.value=o;for(var b=0;b<d.length;b++)(0,d[b])(o)},function(b){for(g.status="rejected",g.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),g}var Oy=q.S;q.S=function(a,o){p0=Pe(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&MA(a,o),Oy!==null&&Oy(a,o)};var il=I(null);function Zd(){var a=il.current;return a!==null?a:an.pooledCache}function nc(a,o){o===null?F(il,il.current):F(il,o.pool)}function By(){var a=Zd();return a===null?null:{parent:Mn._currentValue,pool:a}}var Yl=Error(r(460)),Qd=Error(r(474)),rc=Error(r(542)),ac={then:function(){}};function Ly(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Fy(a,o,d){switch(d=a[d],d===void 0?a.push(o):d!==o&&(o.then(qe,qe),o=d),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,zy(a),a;default:if(typeof o.status=="string")o.then(qe,qe);else{if(a=an,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(g){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=g}},function(g){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,zy(a),a}throw sl=o,Yl}}function ll(a){try{var o=a._init;return o(a._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(sl=d,Yl):d}}var sl=null;function Iy(){if(sl===null)throw Error(r(459));var a=sl;return sl=null,a}function zy(a){if(a===Yl||a===rc)throw Error(r(483))}var Xl=null,co=0;function ic(a){var o=co;return co+=1,Xl===null&&(Xl=[]),Fy(Xl,a,o)}function fo(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function lc(a,o){throw o.$$typeof===p?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function Py(a){function o(ae,W){if(a){var he=ae.deletions;he===null?(ae.deletions=[W],ae.flags|=16):he.push(W)}}function d(ae,W){if(!a)return null;for(;W!==null;)o(ae,W),W=W.sibling;return null}function g(ae){for(var W=new Map;ae!==null;)ae.key!==null?W.set(ae.key,ae):W.set(ae.index,ae),ae=ae.sibling;return W}function b(ae,W){return ae=Na(ae,W),ae.index=0,ae.sibling=null,ae}function E(ae,W,he){return ae.index=he,a?(he=ae.alternate,he!==null?(he=he.index,he<W?(ae.flags|=67108866,W):he):(ae.flags|=67108866,W)):(ae.flags|=1048576,W)}function R(ae){return a&&ae.alternate===null&&(ae.flags|=67108866),ae}function j(ae,W,he,De){return W===null||W.tag!==6?(W=Pd(he,ae.mode,De),W.return=ae,W):(W=b(W,he),W.return=ae,W)}function Z(ae,W,he,De){var ct=he.type;return ct===w?Se(ae,W,he.props.children,De,he.key):W!==null&&(W.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===O&&ll(ct)===W.type)?(W=b(W,he.props),fo(W,he),W.return=ae,W):(W=Wu(he.type,he.key,he.props,null,ae.mode,De),fo(W,he),W.return=ae,W)}function ve(ae,W,he,De){return W===null||W.tag!==4||W.stateNode.containerInfo!==he.containerInfo||W.stateNode.implementation!==he.implementation?(W=Ud(he,ae.mode,De),W.return=ae,W):(W=b(W,he.children||[]),W.return=ae,W)}function Se(ae,W,he,De,ct){return W===null||W.tag!==7?(W=tl(he,ae.mode,De,ct),W.return=ae,W):(W=b(W,he),W.return=ae,W)}function _e(ae,W,he){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=Pd(""+W,ae.mode,he),W.return=ae,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case m:return he=Wu(W.type,W.key,W.props,null,ae.mode,he),fo(he,W),he.return=ae,he;case y:return W=Ud(W,ae.mode,he),W.return=ae,W;case O:return W=ll(W),_e(ae,W,he)}if($(W)||B(W))return W=tl(W,ae.mode,he,null),W.return=ae,W;if(typeof W.then=="function")return _e(ae,ic(W),he);if(W.$$typeof===T)return _e(ae,tc(ae,W),he);lc(ae,W)}return null}function ge(ae,W,he,De){var ct=W!==null?W.key:null;if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return ct!==null?null:j(ae,W,""+he,De);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case m:return he.key===ct?Z(ae,W,he,De):null;case y:return he.key===ct?ve(ae,W,he,De):null;case O:return he=ll(he),ge(ae,W,he,De)}if($(he)||B(he))return ct!==null?null:Se(ae,W,he,De,null);if(typeof he.then=="function")return ge(ae,W,ic(he),De);if(he.$$typeof===T)return ge(ae,W,tc(ae,he),De);lc(ae,he)}return null}function be(ae,W,he,De,ct){if(typeof De=="string"&&De!==""||typeof De=="number"||typeof De=="bigint")return ae=ae.get(he)||null,j(W,ae,""+De,ct);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case m:return ae=ae.get(De.key===null?he:De.key)||null,Z(W,ae,De,ct);case y:return ae=ae.get(De.key===null?he:De.key)||null,ve(W,ae,De,ct);case O:return De=ll(De),be(ae,W,he,De,ct)}if($(De)||B(De))return ae=ae.get(he)||null,Se(W,ae,De,ct,null);if(typeof De.then=="function")return be(ae,W,he,ic(De),ct);if(De.$$typeof===T)return be(ae,W,he,tc(W,De),ct);lc(W,De)}return null}function rt(ae,W,he,De){for(var ct=null,qt=null,it=W,St=W=0,Mt=null;it!==null&&St<he.length;St++){it.index>St?(Mt=it,it=null):Mt=it.sibling;var Ht=ge(ae,it,he[St],De);if(Ht===null){it===null&&(it=Mt);break}a&&it&&Ht.alternate===null&&o(ae,it),W=E(Ht,W,St),qt===null?ct=Ht:qt.sibling=Ht,qt=Ht,it=Mt}if(St===he.length)return d(ae,it),Ot&&Ra(ae,St),ct;if(it===null){for(;St<he.length;St++)it=_e(ae,he[St],De),it!==null&&(W=E(it,W,St),qt===null?ct=it:qt.sibling=it,qt=it);return Ot&&Ra(ae,St),ct}for(it=g(it);St<he.length;St++)Mt=be(it,ae,St,he[St],De),Mt!==null&&(a&&Mt.alternate!==null&&it.delete(Mt.key===null?St:Mt.key),W=E(Mt,W,St),qt===null?ct=Mt:qt.sibling=Mt,qt=Mt);return a&&it.forEach(function(Ci){return o(ae,Ci)}),Ot&&Ra(ae,St),ct}function vt(ae,W,he,De){if(he==null)throw Error(r(151));for(var ct=null,qt=null,it=W,St=W=0,Mt=null,Ht=he.next();it!==null&&!Ht.done;St++,Ht=he.next()){it.index>St?(Mt=it,it=null):Mt=it.sibling;var Ci=ge(ae,it,Ht.value,De);if(Ci===null){it===null&&(it=Mt);break}a&&it&&Ci.alternate===null&&o(ae,it),W=E(Ci,W,St),qt===null?ct=Ci:qt.sibling=Ci,qt=Ci,it=Mt}if(Ht.done)return d(ae,it),Ot&&Ra(ae,St),ct;if(it===null){for(;!Ht.done;St++,Ht=he.next())Ht=_e(ae,Ht.value,De),Ht!==null&&(W=E(Ht,W,St),qt===null?ct=Ht:qt.sibling=Ht,qt=Ht);return Ot&&Ra(ae,St),ct}for(it=g(it);!Ht.done;St++,Ht=he.next())Ht=be(it,ae,St,Ht.value,De),Ht!==null&&(a&&Ht.alternate!==null&&it.delete(Ht.key===null?St:Ht.key),W=E(Ht,W,St),qt===null?ct=Ht:qt.sibling=Ht,qt=Ht);return a&&it.forEach(function(G_){return o(ae,G_)}),Ot&&Ra(ae,St),ct}function en(ae,W,he,De){if(typeof he=="object"&&he!==null&&he.type===w&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case m:e:{for(var ct=he.key;W!==null;){if(W.key===ct){if(ct=he.type,ct===w){if(W.tag===7){d(ae,W.sibling),De=b(W,he.props.children),De.return=ae,ae=De;break e}}else if(W.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===O&&ll(ct)===W.type){d(ae,W.sibling),De=b(W,he.props),fo(De,he),De.return=ae,ae=De;break e}d(ae,W);break}else o(ae,W);W=W.sibling}he.type===w?(De=tl(he.props.children,ae.mode,De,he.key),De.return=ae,ae=De):(De=Wu(he.type,he.key,he.props,null,ae.mode,De),fo(De,he),De.return=ae,ae=De)}return R(ae);case y:e:{for(ct=he.key;W!==null;){if(W.key===ct)if(W.tag===4&&W.stateNode.containerInfo===he.containerInfo&&W.stateNode.implementation===he.implementation){d(ae,W.sibling),De=b(W,he.children||[]),De.return=ae,ae=De;break e}else{d(ae,W);break}else o(ae,W);W=W.sibling}De=Ud(he,ae.mode,De),De.return=ae,ae=De}return R(ae);case O:return he=ll(he),en(ae,W,he,De)}if($(he))return rt(ae,W,he,De);if(B(he)){if(ct=B(he),typeof ct!="function")throw Error(r(150));return he=ct.call(he),vt(ae,W,he,De)}if(typeof he.then=="function")return en(ae,W,ic(he),De);if(he.$$typeof===T)return en(ae,W,tc(ae,he),De);lc(ae,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,W!==null&&W.tag===6?(d(ae,W.sibling),De=b(W,he),De.return=ae,ae=De):(d(ae,W),De=Pd(he,ae.mode,De),De.return=ae,ae=De),R(ae)):d(ae,W)}return function(ae,W,he,De){try{co=0;var ct=en(ae,W,he,De);return Xl=null,ct}catch(it){if(it===Yl||it===rc)throw it;var qt=Lr(29,it,null,ae.mode);return qt.lanes=De,qt.return=ae,qt}}}var ol=Py(!0),Uy=Py(!1),si=!1;function Wd(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jd(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function oi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ui(a,o,d){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Gt&2)!==0){var b=g.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),g.pending=o,o=Qu(a),Sy(a,null,d),o}return Zu(a,g,o,d),Qu(a)}function ho(a,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194048)!==0)){var g=o.lanes;g&=a.pendingLanes,d|=g,o.lanes=d,Ze(a,d)}}function eh(a,o){var d=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var b=null,E=null;if(d=d.firstBaseUpdate,d!==null){do{var R={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};E===null?b=E=R:E=E.next=R,d=d.next}while(d!==null);E===null?b=E=o:E=E.next=o}else b=E=o;d={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:E,shared:g.shared,callbacks:g.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=o:a.next=o,d.lastBaseUpdate=o}var th=!1;function vo(){if(th){var a=Kl;if(a!==null)throw a}}function go(a,o,d,g){th=!1;var b=a.updateQueue;si=!1;var E=b.firstBaseUpdate,R=b.lastBaseUpdate,j=b.shared.pending;if(j!==null){b.shared.pending=null;var Z=j,ve=Z.next;Z.next=null,R===null?E=ve:R.next=ve,R=Z;var Se=a.alternate;Se!==null&&(Se=Se.updateQueue,j=Se.lastBaseUpdate,j!==R&&(j===null?Se.firstBaseUpdate=ve:j.next=ve,Se.lastBaseUpdate=Z))}if(E!==null){var _e=b.baseState;R=0,Se=ve=Z=null,j=E;do{var ge=j.lane&-536870913,be=ge!==j.lane;if(be?(Rt&ge)===ge:(g&ge)===ge){ge!==0&&ge===$l&&(th=!0),Se!==null&&(Se=Se.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var rt=a,vt=j;ge=o;var en=d;switch(vt.tag){case 1:if(rt=vt.payload,typeof rt=="function"){_e=rt.call(en,_e,ge);break e}_e=rt;break e;case 3:rt.flags=rt.flags&-65537|128;case 0:if(rt=vt.payload,ge=typeof rt=="function"?rt.call(en,_e,ge):rt,ge==null)break e;_e=v({},_e,ge);break e;case 2:si=!0}}ge=j.callback,ge!==null&&(a.flags|=64,be&&(a.flags|=8192),be=b.callbacks,be===null?b.callbacks=[ge]:be.push(ge))}else be={lane:ge,tag:j.tag,payload:j.payload,callback:j.callback,next:null},Se===null?(ve=Se=be,Z=_e):Se=Se.next=be,R|=ge;if(j=j.next,j===null){if(j=b.shared.pending,j===null)break;be=j,j=be.next,be.next=null,b.lastBaseUpdate=be,b.shared.pending=null}}while(!0);Se===null&&(Z=_e),b.baseState=Z,b.firstBaseUpdate=ve,b.lastBaseUpdate=Se,E===null&&(b.shared.lanes=0),vi|=R,a.lanes=R,a.memoizedState=_e}}function qy(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function Hy(a,o){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)qy(d[a],o)}var Zl=I(null),sc=I(0);function jy(a,o){a=Ha,F(sc,a),F(Zl,o),Ha=a|o.baseLanes}function nh(){F(sc,Ha),F(Zl,Zl.current)}function rh(){Ha=sc.current,K(Zl),K(sc)}var Fr=I(null),Wr=null;function ci(a){var o=a.alternate;F(_n,_n.current&1),F(Fr,a),Wr===null&&(o===null||Zl.current!==null||o.memoizedState!==null)&&(Wr=a)}function ah(a){F(_n,_n.current),F(Fr,a),Wr===null&&(Wr=a)}function Gy(a){a.tag===22?(F(_n,_n.current),F(Fr,a),Wr===null&&(Wr=a)):fi()}function fi(){F(_n,_n.current),F(Fr,Fr.current)}function Ir(a){K(Fr),Wr===a&&(Wr=null),K(_n)}var _n=I(0);function oc(a){for(var o=a;o!==null;){if(o.tag===13){var d=o.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||cv(d)||fv(d)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Ba=0,wt=null,Wt=null,On=null,uc=!1,Ql=!1,ul=!1,cc=0,po=0,Wl=null,BA=0;function Tn(){throw Error(r(321))}function ih(a,o){if(o===null)return!1;for(var d=0;d<o.length&&d<a.length;d++)if(!Br(a[d],o[d]))return!1;return!0}function lh(a,o,d,g,b,E){return Ba=E,wt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,q.H=a===null||a.memoizedState===null?Ab:xh,ul=!1,E=d(g,b),ul=!1,Ql&&(E=$y(o,d,g,b)),Vy(a),E}function Vy(a){q.H=bo;var o=Wt!==null&&Wt.next!==null;if(Ba=0,On=Wt=wt=null,uc=!1,po=0,Wl=null,o)throw Error(r(300));a===null||Bn||(a=a.dependencies,a!==null&&ec(a)&&(Bn=!0))}function $y(a,o,d,g){wt=a;var b=0;do{if(Ql&&(Wl=null),po=0,Ql=!1,25<=b)throw Error(r(301));if(b+=1,On=Wt=null,a.updateQueue!=null){var E=a.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}q.H=_b,E=o(d,g)}while(Ql);return E}function LA(){var a=q.H,o=a.useState()[0];return o=typeof o.then=="function"?mo(o):o,a=a.useState()[0],(Wt!==null?Wt.memoizedState:null)!==a&&(wt.flags|=1024),o}function sh(){var a=cc!==0;return cc=0,a}function oh(a,o,d){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~d}function uh(a){if(uc){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}uc=!1}Ba=0,On=Wt=wt=null,Ql=!1,po=cc=0,Wl=null}function gr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return On===null?wt.memoizedState=On=a:On=On.next=a,On}function kn(){if(Wt===null){var a=wt.alternate;a=a!==null?a.memoizedState:null}else a=Wt.next;var o=On===null?wt.memoizedState:On.next;if(o!==null)On=o,Wt=a;else{if(a===null)throw wt.alternate===null?Error(r(467)):Error(r(310));Wt=a,a={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},On===null?wt.memoizedState=On=a:On=On.next=a}return On}function fc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mo(a){var o=po;return po+=1,Wl===null&&(Wl=[]),a=Fy(Wl,a,o),o=wt,(On===null?o.memoizedState:On.next)===null&&(o=o.alternate,q.H=o===null||o.memoizedState===null?Ab:xh),a}function dc(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return mo(a);if(a.$$typeof===T)return er(a)}throw Error(r(438,String(a)))}function ch(a){var o=null,d=wt.updateQueue;if(d!==null&&(o=d.memoCache),o==null){var g=wt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(o={data:g.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),d===null&&(d=fc(),wt.updateQueue=d),d.memoCache=o,d=o.data[o.index],d===void 0)for(d=o.data[o.index]=Array(a),g=0;g<a;g++)d[g]=M;return o.index++,d}function La(a,o){return typeof o=="function"?o(a):o}function hc(a){var o=kn();return fh(o,Wt,a)}function fh(a,o,d){var g=a.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=d;var b=a.baseQueue,E=g.pending;if(E!==null){if(b!==null){var R=b.next;b.next=E.next,E.next=R}o.baseQueue=b=E,g.pending=null}if(E=a.baseState,b===null)a.memoizedState=E;else{o=b.next;var j=R=null,Z=null,ve=o,Se=!1;do{var _e=ve.lane&-536870913;if(_e!==ve.lane?(Rt&_e)===_e:(Ba&_e)===_e){var ge=ve.revertLane;if(ge===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),_e===$l&&(Se=!0);else if((Ba&ge)===ge){ve=ve.next,ge===$l&&(Se=!0);continue}else _e={lane:0,revertLane:ve.revertLane,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},Z===null?(j=Z=_e,R=E):Z=Z.next=_e,wt.lanes|=ge,vi|=ge;_e=ve.action,ul&&d(E,_e),E=ve.hasEagerState?ve.eagerState:d(E,_e)}else ge={lane:_e,revertLane:ve.revertLane,gesture:ve.gesture,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},Z===null?(j=Z=ge,R=E):Z=Z.next=ge,wt.lanes|=_e,vi|=_e;ve=ve.next}while(ve!==null&&ve!==o);if(Z===null?R=E:Z.next=j,!Br(E,a.memoizedState)&&(Bn=!0,Se&&(d=Kl,d!==null)))throw d;a.memoizedState=E,a.baseState=R,a.baseQueue=Z,g.lastRenderedState=E}return b===null&&(g.lanes=0),[a.memoizedState,g.dispatch]}function dh(a){var o=kn(),d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var g=d.dispatch,b=d.pending,E=o.memoizedState;if(b!==null){d.pending=null;var R=b=b.next;do E=a(E,R.action),R=R.next;while(R!==b);Br(E,o.memoizedState)||(Bn=!0),o.memoizedState=E,o.baseQueue===null&&(o.baseState=E),d.lastRenderedState=E}return[E,g]}function Ky(a,o,d){var g=wt,b=kn(),E=Ot;if(E){if(d===void 0)throw Error(r(407));d=d()}else d=o();var R=!Br((Wt||b).memoizedState,d);if(R&&(b.memoizedState=d,Bn=!0),b=b.queue,gh(Zy.bind(null,g,b,a),[a]),b.getSnapshot!==o||R||On!==null&&On.memoizedState.tag&1){if(g.flags|=2048,Jl(9,{destroy:void 0},Xy.bind(null,g,b,d,o),null),an===null)throw Error(r(349));E||(Ba&127)!==0||Yy(g,o,d)}return d}function Yy(a,o,d){a.flags|=16384,a={getSnapshot:o,value:d},o=wt.updateQueue,o===null?(o=fc(),wt.updateQueue=o,o.stores=[a]):(d=o.stores,d===null?o.stores=[a]:d.push(a))}function Xy(a,o,d,g){o.value=d,o.getSnapshot=g,Qy(o)&&Wy(a)}function Zy(a,o,d){return d(function(){Qy(o)&&Wy(a)})}function Qy(a){var o=a.getSnapshot;a=a.value;try{var d=o();return!Br(a,d)}catch{return!0}}function Wy(a){var o=el(a,2);o!==null&&Ar(o,a,2)}function hh(a){var o=gr();if(typeof a=="function"){var d=a;if(a=d(),ul){fe(!0);try{d()}finally{fe(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:a},o}function Jy(a,o,d,g){return a.baseState=d,fh(a,Wt,typeof g=="function"?g:La)}function FA(a,o,d,g,b){if(pc(a))throw Error(r(485));if(a=o.action,a!==null){var E={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){E.listeners.push(R)}};q.T!==null?d(!0):E.isTransition=!1,g(E),d=o.pending,d===null?(E.next=o.pending=E,eb(o,E)):(E.next=d.next,o.pending=d.next=E)}}function eb(a,o){var d=o.action,g=o.payload,b=a.state;if(o.isTransition){var E=q.T,R={};q.T=R;try{var j=d(b,g),Z=q.S;Z!==null&&Z(R,j),tb(a,o,j)}catch(ve){vh(a,o,ve)}finally{E!==null&&R.types!==null&&(E.types=R.types),q.T=E}}else try{E=d(b,g),tb(a,o,E)}catch(ve){vh(a,o,ve)}}function tb(a,o,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(g){nb(a,o,g)},function(g){return vh(a,o,g)}):nb(a,o,d)}function nb(a,o,d){o.status="fulfilled",o.value=d,rb(o),a.state=d,o=a.pending,o!==null&&(d=o.next,d===o?a.pending=null:(d=d.next,o.next=d,eb(a,d)))}function vh(a,o,d){var g=a.pending;if(a.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=d,rb(o),o=o.next;while(o!==g)}a.action=null}function rb(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function ab(a,o){return o}function ib(a,o){if(Ot){var d=an.formState;if(d!==null){e:{var g=wt;if(Ot){if(hn){t:{for(var b=hn,E=Qr;b.nodeType!==8;){if(!E){b=null;break t}if(b=Jr(b.nextSibling),b===null){b=null;break t}}E=b.data,b=E==="F!"||E==="F"?b:null}if(b){hn=Jr(b.nextSibling),g=b.data==="F!";break e}}ii(g)}g=!1}g&&(o=d[0])}}return d=gr(),d.memoizedState=d.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ab,lastRenderedState:o},d.queue=g,d=Cb.bind(null,wt,g),g.dispatch=d,g=hh(!1),E=Eh.bind(null,wt,!1,g.queue),g=gr(),b={state:o,dispatch:null,action:a,pending:null},g.queue=b,d=FA.bind(null,wt,b,E,d),b.dispatch=d,g.memoizedState=a,[o,d,!1]}function lb(a){var o=kn();return sb(o,Wt,a)}function sb(a,o,d){if(o=fh(a,o,ab)[0],a=hc(La)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=mo(o)}catch(R){throw R===Yl?rc:R}else g=o;o=kn();var b=o.queue,E=b.dispatch;return d!==o.memoizedState&&(wt.flags|=2048,Jl(9,{destroy:void 0},IA.bind(null,b,d),null)),[g,E,a]}function IA(a,o){a.action=o}function ob(a){var o=kn(),d=Wt;if(d!==null)return sb(o,d,a);kn(),o=o.memoizedState,d=kn();var g=d.queue.dispatch;return d.memoizedState=a,[o,g,!1]}function Jl(a,o,d,g){return a={tag:a,create:d,deps:g,inst:o,next:null},o=wt.updateQueue,o===null&&(o=fc(),wt.updateQueue=o),d=o.lastEffect,d===null?o.lastEffect=a.next=a:(g=d.next,d.next=a,a.next=g,o.lastEffect=a),a}function ub(){return kn().memoizedState}function vc(a,o,d,g){var b=gr();wt.flags|=a,b.memoizedState=Jl(1|o,{destroy:void 0},d,g===void 0?null:g)}function gc(a,o,d,g){var b=kn();g=g===void 0?null:g;var E=b.memoizedState.inst;Wt!==null&&g!==null&&ih(g,Wt.memoizedState.deps)?b.memoizedState=Jl(o,E,d,g):(wt.flags|=a,b.memoizedState=Jl(1|o,E,d,g))}function cb(a,o){vc(8390656,8,a,o)}function gh(a,o){gc(2048,8,a,o)}function zA(a){wt.flags|=4;var o=wt.updateQueue;if(o===null)o=fc(),wt.updateQueue=o,o.events=[a];else{var d=o.events;d===null?o.events=[a]:d.push(a)}}function fb(a){var o=kn().memoizedState;return zA({ref:o,nextImpl:a}),function(){if((Gt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function db(a,o){return gc(4,2,a,o)}function hb(a,o){return gc(4,4,a,o)}function vb(a,o){if(typeof o=="function"){a=a();var d=o(a);return function(){typeof d=="function"?d():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function gb(a,o,d){d=d!=null?d.concat([a]):null,gc(4,4,vb.bind(null,o,a),d)}function ph(){}function pb(a,o){var d=kn();o=o===void 0?null:o;var g=d.memoizedState;return o!==null&&ih(o,g[1])?g[0]:(d.memoizedState=[a,o],a)}function mb(a,o){var d=kn();o=o===void 0?null:o;var g=d.memoizedState;if(o!==null&&ih(o,g[1]))return g[0];if(g=a(),ul){fe(!0);try{a()}finally{fe(!1)}}return d.memoizedState=[g,o],g}function mh(a,o,d){return d===void 0||(Ba&1073741824)!==0&&(Rt&261930)===0?a.memoizedState=o:(a.memoizedState=d,a=y0(),wt.lanes|=a,vi|=a,d)}function yb(a,o,d,g){return Br(d,o)?d:Zl.current!==null?(a=mh(a,d,g),Br(a,o)||(Bn=!0),a):(Ba&42)===0||(Ba&1073741824)!==0&&(Rt&261930)===0?(Bn=!0,a.memoizedState=d):(a=y0(),wt.lanes|=a,vi|=a,o)}function bb(a,o,d,g,b){var E=H.p;H.p=E!==0&&8>E?E:8;var R=q.T,j={};q.T=j,Eh(a,!1,o,d);try{var Z=b(),ve=q.S;if(ve!==null&&ve(j,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var Se=OA(Z,g);yo(a,o,Se,Ur(a))}else yo(a,o,g,Ur(a))}catch(_e){yo(a,o,{then:function(){},status:"rejected",reason:_e},Ur())}finally{H.p=E,R!==null&&j.types!==null&&(R.types=j.types),q.T=R}}function PA(){}function yh(a,o,d,g){if(a.tag!==5)throw Error(r(476));var b=Eb(a).queue;bb(a,b,o,Y,d===null?PA:function(){return xb(a),d(g)})}function Eb(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:Y},next:null};var d={};return o.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:d},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function xb(a){var o=Eb(a);o.next===null&&(o=a.alternate.memoizedState),yo(a,o.next.queue,{},Ur())}function bh(){return er(Lo)}function wb(){return kn().memoizedState}function Sb(){return kn().memoizedState}function UA(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var d=Ur();a=oi(d);var g=ui(o,a,d);g!==null&&(Ar(g,o,d),ho(g,o,d)),o={cache:Yd()},a.payload=o;return}o=o.return}}function qA(a,o,d){var g=Ur();d={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},pc(a)?Tb(o,d):(d=Id(a,o,d,g),d!==null&&(Ar(d,a,g),Db(d,o,g)))}function Cb(a,o,d){var g=Ur();yo(a,o,d,g)}function yo(a,o,d,g){var b={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(pc(a))Tb(o,b);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=o.lastRenderedReducer,E!==null))try{var R=o.lastRenderedState,j=E(R,d);if(b.hasEagerState=!0,b.eagerState=j,Br(j,R))return Zu(a,o,b,0),an===null&&Xu(),!1}catch{}if(d=Id(a,o,b,g),d!==null)return Ar(d,a,g),Db(d,o,g),!0}return!1}function Eh(a,o,d,g){if(g={lane:2,revertLane:Wh(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},pc(a)){if(o)throw Error(r(479))}else o=Id(a,d,g,2),o!==null&&Ar(o,a,2)}function pc(a){var o=a.alternate;return a===wt||o!==null&&o===wt}function Tb(a,o){Ql=uc=!0;var d=a.pending;d===null?o.next=o:(o.next=d.next,d.next=o),a.pending=o}function Db(a,o,d){if((d&4194048)!==0){var g=o.lanes;g&=a.pendingLanes,d|=g,o.lanes=d,Ze(a,d)}}var bo={readContext:er,use:dc,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useLayoutEffect:Tn,useInsertionEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useSyncExternalStore:Tn,useId:Tn,useHostTransitionStatus:Tn,useFormState:Tn,useActionState:Tn,useOptimistic:Tn,useMemoCache:Tn,useCacheRefresh:Tn};bo.useEffectEvent=Tn;var Ab={readContext:er,use:dc,useCallback:function(a,o){return gr().memoizedState=[a,o===void 0?null:o],a},useContext:er,useEffect:cb,useImperativeHandle:function(a,o,d){d=d!=null?d.concat([a]):null,vc(4194308,4,vb.bind(null,o,a),d)},useLayoutEffect:function(a,o){return vc(4194308,4,a,o)},useInsertionEffect:function(a,o){vc(4,2,a,o)},useMemo:function(a,o){var d=gr();o=o===void 0?null:o;var g=a();if(ul){fe(!0);try{a()}finally{fe(!1)}}return d.memoizedState=[g,o],g},useReducer:function(a,o,d){var g=gr();if(d!==void 0){var b=d(o);if(ul){fe(!0);try{d(o)}finally{fe(!1)}}}else b=o;return g.memoizedState=g.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},g.queue=a,a=a.dispatch=qA.bind(null,wt,a),[g.memoizedState,a]},useRef:function(a){var o=gr();return a={current:a},o.memoizedState=a},useState:function(a){a=hh(a);var o=a.queue,d=Cb.bind(null,wt,o);return o.dispatch=d,[a.memoizedState,d]},useDebugValue:ph,useDeferredValue:function(a,o){var d=gr();return mh(d,a,o)},useTransition:function(){var a=hh(!1);return a=bb.bind(null,wt,a.queue,!0,!1),gr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,d){var g=wt,b=gr();if(Ot){if(d===void 0)throw Error(r(407));d=d()}else{if(d=o(),an===null)throw Error(r(349));(Rt&127)!==0||Yy(g,o,d)}b.memoizedState=d;var E={value:d,getSnapshot:o};return b.queue=E,cb(Zy.bind(null,g,E,a),[a]),g.flags|=2048,Jl(9,{destroy:void 0},Xy.bind(null,g,E,d,o),null),d},useId:function(){var a=gr(),o=an.identifierPrefix;if(Ot){var d=ga,g=va;d=(g&~(1<<32-ce(g)-1)).toString(32)+d,o="_"+o+"R_"+d,d=cc++,0<d&&(o+="H"+d.toString(32)),o+="_"}else d=BA++,o="_"+o+"r_"+d.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:bh,useFormState:ib,useActionState:ib,useOptimistic:function(a){var o=gr();o.memoizedState=o.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=d,o=Eh.bind(null,wt,!0,d),d.dispatch=o,[a,o]},useMemoCache:ch,useCacheRefresh:function(){return gr().memoizedState=UA.bind(null,wt)},useEffectEvent:function(a){var o=gr(),d={impl:a};return o.memoizedState=d,function(){if((Gt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},xh={readContext:er,use:dc,useCallback:pb,useContext:er,useEffect:gh,useImperativeHandle:gb,useInsertionEffect:db,useLayoutEffect:hb,useMemo:mb,useReducer:hc,useRef:ub,useState:function(){return hc(La)},useDebugValue:ph,useDeferredValue:function(a,o){var d=kn();return yb(d,Wt.memoizedState,a,o)},useTransition:function(){var a=hc(La)[0],o=kn().memoizedState;return[typeof a=="boolean"?a:mo(a),o]},useSyncExternalStore:Ky,useId:wb,useHostTransitionStatus:bh,useFormState:lb,useActionState:lb,useOptimistic:function(a,o){var d=kn();return Jy(d,Wt,a,o)},useMemoCache:ch,useCacheRefresh:Sb};xh.useEffectEvent=fb;var _b={readContext:er,use:dc,useCallback:pb,useContext:er,useEffect:gh,useImperativeHandle:gb,useInsertionEffect:db,useLayoutEffect:hb,useMemo:mb,useReducer:dh,useRef:ub,useState:function(){return dh(La)},useDebugValue:ph,useDeferredValue:function(a,o){var d=kn();return Wt===null?mh(d,a,o):yb(d,Wt.memoizedState,a,o)},useTransition:function(){var a=dh(La)[0],o=kn().memoizedState;return[typeof a=="boolean"?a:mo(a),o]},useSyncExternalStore:Ky,useId:wb,useHostTransitionStatus:bh,useFormState:ob,useActionState:ob,useOptimistic:function(a,o){var d=kn();return Wt!==null?Jy(d,Wt,a,o):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:ch,useCacheRefresh:Sb};_b.useEffectEvent=fb;function wh(a,o,d,g){o=a.memoizedState,d=d(g,o),d=d==null?o:v({},o,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var Sh={enqueueSetState:function(a,o,d){a=a._reactInternals;var g=Ur(),b=oi(g);b.payload=o,d!=null&&(b.callback=d),o=ui(a,b,g),o!==null&&(Ar(o,a,g),ho(o,a,g))},enqueueReplaceState:function(a,o,d){a=a._reactInternals;var g=Ur(),b=oi(g);b.tag=1,b.payload=o,d!=null&&(b.callback=d),o=ui(a,b,g),o!==null&&(Ar(o,a,g),ho(o,a,g))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var d=Ur(),g=oi(d);g.tag=2,o!=null&&(g.callback=o),o=ui(a,g,d),o!==null&&(Ar(o,a,d),ho(o,a,d))}};function kb(a,o,d,g,b,E,R){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,E,R):o.prototype&&o.prototype.isPureReactComponent?!ao(d,g)||!ao(b,E):!0}function Nb(a,o,d,g){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(d,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(d,g),o.state!==a&&Sh.enqueueReplaceState(o,o.state,null)}function cl(a,o){var d=o;if("ref"in o){d={};for(var g in o)g!=="ref"&&(d[g]=o[g])}if(a=a.defaultProps){d===o&&(d=v({},d));for(var b in a)d[b]===void 0&&(d[b]=a[b])}return d}function Rb(a){Yu(a)}function Mb(a){console.error(a)}function Ob(a){Yu(a)}function mc(a,o){try{var d=a.onUncaughtError;d(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function Bb(a,o,d){try{var g=a.onCaughtError;g(d.value,{componentStack:d.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Ch(a,o,d){return d=oi(d),d.tag=3,d.payload={element:null},d.callback=function(){mc(a,o)},d}function Lb(a){return a=oi(a),a.tag=3,a}function Fb(a,o,d,g){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var E=g.value;a.payload=function(){return b(E)},a.callback=function(){Bb(o,d,g)}}var R=d.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(a.callback=function(){Bb(o,d,g),typeof b!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var j=g.stack;this.componentDidCatch(g.value,{componentStack:j!==null?j:""})})}function HA(a,o,d,g,b){if(d.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=d.alternate,o!==null&&Vl(o,d,b,!0),d=Fr.current,d!==null){switch(d.tag){case 31:case 13:return Wr===null?kc():d.alternate===null&&Dn===0&&(Dn=3),d.flags&=-257,d.flags|=65536,d.lanes=b,g===ac?d.flags|=16384:(o=d.updateQueue,o===null?d.updateQueue=new Set([g]):o.add(g),Xh(a,g,b)),!1;case 22:return d.flags|=65536,g===ac?d.flags|=16384:(o=d.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},d.updateQueue=o):(d=o.retryQueue,d===null?o.retryQueue=new Set([g]):d.add(g)),Xh(a,g,b)),!1}throw Error(r(435,d.tag))}return Xh(a,g,b),kc(),!1}if(Ot)return o=Fr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,g!==jd&&(a=Error(r(422),{cause:g}),so(Yr(a,d)))):(g!==jd&&(o=Error(r(423),{cause:g}),so(Yr(o,d))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,g=Yr(g,d),b=Ch(a.stateNode,g,b),eh(a,b),Dn!==4&&(Dn=2)),!1;var E=Error(r(520),{cause:g});if(E=Yr(E,d),Ao===null?Ao=[E]:Ao.push(E),Dn!==4&&(Dn=2),o===null)return!0;g=Yr(g,d),d=o;do{switch(d.tag){case 3:return d.flags|=65536,a=b&-b,d.lanes|=a,a=Ch(d.stateNode,g,a),eh(d,a),!1;case 1:if(o=d.type,E=d.stateNode,(d.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(gi===null||!gi.has(E))))return d.flags|=65536,b&=-b,d.lanes|=b,b=Lb(b),Fb(b,a,d,g),eh(d,b),!1}d=d.return}while(d!==null);return!1}var Th=Error(r(461)),Bn=!1;function tr(a,o,d,g){o.child=a===null?Uy(o,null,d,g):ol(o,a.child,d,g)}function Ib(a,o,d,g,b){d=d.render;var E=o.ref;if("ref"in g){var R={};for(var j in g)j!=="ref"&&(R[j]=g[j])}else R=g;return al(o),g=lh(a,o,d,R,E,b),j=sh(),a!==null&&!Bn?(oh(a,o,b),Fa(a,o,b)):(Ot&&j&&qd(o),o.flags|=1,tr(a,o,g,b),o.child)}function zb(a,o,d,g,b){if(a===null){var E=d.type;return typeof E=="function"&&!zd(E)&&E.defaultProps===void 0&&d.compare===null?(o.tag=15,o.type=E,Pb(a,o,E,g,b)):(a=Wu(d.type,null,g,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(E=a.child,!Oh(a,b)){var R=E.memoizedProps;if(d=d.compare,d=d!==null?d:ao,d(R,g)&&a.ref===o.ref)return Fa(a,o,b)}return o.flags|=1,a=Na(E,g),a.ref=o.ref,a.return=o,o.child=a}function Pb(a,o,d,g,b){if(a!==null){var E=a.memoizedProps;if(ao(E,g)&&a.ref===o.ref)if(Bn=!1,o.pendingProps=g=E,Oh(a,b))(a.flags&131072)!==0&&(Bn=!0);else return o.lanes=a.lanes,Fa(a,o,b)}return Dh(a,o,d,g,b)}function Ub(a,o,d,g){var b=g.children,E=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((o.flags&128)!==0){if(E=E!==null?E.baseLanes|d:d,a!==null){for(g=o.child=a.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;g=b&~E}else g=0,o.child=null;return qb(a,o,E,d,g)}if((d&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&nc(o,E!==null?E.cachePool:null),E!==null?jy(o,E):nh(),Gy(o);else return g=o.lanes=536870912,qb(a,o,E!==null?E.baseLanes|d:d,d,g)}else E!==null?(nc(o,E.cachePool),jy(o,E),fi(),o.memoizedState=null):(a!==null&&nc(o,null),nh(),fi());return tr(a,o,b,d),o.child}function Eo(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function qb(a,o,d,g,b){var E=Zd();return E=E===null?null:{parent:Mn._currentValue,pool:E},o.memoizedState={baseLanes:d,cachePool:E},a!==null&&nc(o,null),nh(),Gy(o),a!==null&&Vl(a,o,g,!0),o.childLanes=b,null}function yc(a,o){return o=Ec({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function Hb(a,o,d){return ol(o,a.child,null,d),a=yc(o,o.pendingProps),a.flags|=2,Ir(o),o.memoizedState=null,a}function jA(a,o,d){var g=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(Ot){if(g.mode==="hidden")return a=yc(o,g),o.lanes=536870912,Eo(null,a);if(ah(o),(a=hn)?(a=eE(a,Qr),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ri!==null?{id:va,overflow:ga}:null,retryLane:536870912,hydrationErrors:null},d=Ty(a),d.return=o,o.child=d,Jn=o,hn=null)):a=null,a===null)throw ii(o);return o.lanes=536870912,null}return yc(o,g)}var E=a.memoizedState;if(E!==null){var R=E.dehydrated;if(ah(o),b)if(o.flags&256)o.flags&=-257,o=Hb(a,o,d);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(Bn||Vl(a,o,d,!1),b=(d&a.childLanes)!==0,Bn||b){if(g=an,g!==null&&(R=Et(g,d),R!==0&&R!==E.retryLane))throw E.retryLane=R,el(a,R),Ar(g,a,R),Th;kc(),o=Hb(a,o,d)}else a=E.treeContext,hn=Jr(R.nextSibling),Jn=o,Ot=!0,ai=null,Qr=!1,a!==null&&_y(o,a),o=yc(o,g),o.flags|=4096;return o}return a=Na(a.child,{mode:g.mode,children:g.children}),a.ref=o.ref,o.child=a,a.return=o,a}function bc(a,o){var d=o.ref;if(d===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(a===null||a.ref!==d)&&(o.flags|=4194816)}}function Dh(a,o,d,g,b){return al(o),d=lh(a,o,d,g,void 0,b),g=sh(),a!==null&&!Bn?(oh(a,o,b),Fa(a,o,b)):(Ot&&g&&qd(o),o.flags|=1,tr(a,o,d,b),o.child)}function jb(a,o,d,g,b,E){return al(o),o.updateQueue=null,d=$y(o,g,d,b),Vy(a),g=sh(),a!==null&&!Bn?(oh(a,o,E),Fa(a,o,E)):(Ot&&g&&qd(o),o.flags|=1,tr(a,o,d,E),o.child)}function Gb(a,o,d,g,b){if(al(o),o.stateNode===null){var E=ql,R=d.contextType;typeof R=="object"&&R!==null&&(E=er(R)),E=new d(g,E),o.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Sh,o.stateNode=E,E._reactInternals=o,E=o.stateNode,E.props=g,E.state=o.memoizedState,E.refs={},Wd(o),R=d.contextType,E.context=typeof R=="object"&&R!==null?er(R):ql,E.state=o.memoizedState,R=d.getDerivedStateFromProps,typeof R=="function"&&(wh(o,d,R,g),E.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(R=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),R!==E.state&&Sh.enqueueReplaceState(E,E.state,null),go(o,g,E,b),vo(),E.state=o.memoizedState),typeof E.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(a===null){E=o.stateNode;var j=o.memoizedProps,Z=cl(d,j);E.props=Z;var ve=E.context,Se=d.contextType;R=ql,typeof Se=="object"&&Se!==null&&(R=er(Se));var _e=d.getDerivedStateFromProps;Se=typeof _e=="function"||typeof E.getSnapshotBeforeUpdate=="function",j=o.pendingProps!==j,Se||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(j||ve!==R)&&Nb(o,E,g,R),si=!1;var ge=o.memoizedState;E.state=ge,go(o,g,E,b),vo(),ve=o.memoizedState,j||ge!==ve||si?(typeof _e=="function"&&(wh(o,d,_e,g),ve=o.memoizedState),(Z=si||kb(o,d,Z,g,ge,ve,R))?(Se||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(o.flags|=4194308)):(typeof E.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=ve),E.props=g,E.state=ve,E.context=R,g=Z):(typeof E.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{E=o.stateNode,Jd(a,o),R=o.memoizedProps,Se=cl(d,R),E.props=Se,_e=o.pendingProps,ge=E.context,ve=d.contextType,Z=ql,typeof ve=="object"&&ve!==null&&(Z=er(ve)),j=d.getDerivedStateFromProps,(ve=typeof j=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(R!==_e||ge!==Z)&&Nb(o,E,g,Z),si=!1,ge=o.memoizedState,E.state=ge,go(o,g,E,b),vo();var be=o.memoizedState;R!==_e||ge!==be||si||a!==null&&a.dependencies!==null&&ec(a.dependencies)?(typeof j=="function"&&(wh(o,d,j,g),be=o.memoizedState),(Se=si||kb(o,d,Se,g,ge,be,Z)||a!==null&&a.dependencies!==null&&ec(a.dependencies))?(ve||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(g,be,Z),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(g,be,Z)),typeof E.componentDidUpdate=="function"&&(o.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof E.componentDidUpdate!="function"||R===a.memoizedProps&&ge===a.memoizedState||(o.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&ge===a.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=be),E.props=g,E.state=be,E.context=Z,g=Se):(typeof E.componentDidUpdate!="function"||R===a.memoizedProps&&ge===a.memoizedState||(o.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&ge===a.memoizedState||(o.flags|=1024),g=!1)}return E=g,bc(a,o),g=(o.flags&128)!==0,E||g?(E=o.stateNode,d=g&&typeof d.getDerivedStateFromError!="function"?null:E.render(),o.flags|=1,a!==null&&g?(o.child=ol(o,a.child,null,b),o.child=ol(o,null,d,b)):tr(a,o,d,b),o.memoizedState=E.state,a=o.child):a=Fa(a,o,b),a}function Vb(a,o,d,g){return nl(),o.flags|=256,tr(a,o,d,g),o.child}var Ah={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _h(a){return{baseLanes:a,cachePool:By()}}function kh(a,o,d){return a=a!==null?a.childLanes&~d:0,o&&(a|=Pr),a}function $b(a,o,d){var g=o.pendingProps,b=!1,E=(o.flags&128)!==0,R;if((R=E)||(R=a!==null&&a.memoizedState===null?!1:(_n.current&2)!==0),R&&(b=!0,o.flags&=-129),R=(o.flags&32)!==0,o.flags&=-33,a===null){if(Ot){if(b?ci(o):fi(),(a=hn)?(a=eE(a,Qr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ri!==null?{id:va,overflow:ga}:null,retryLane:536870912,hydrationErrors:null},d=Ty(a),d.return=o,o.child=d,Jn=o,hn=null)):a=null,a===null)throw ii(o);return fv(a)?o.lanes=32:o.lanes=536870912,null}var j=g.children;return g=g.fallback,b?(fi(),b=o.mode,j=Ec({mode:"hidden",children:j},b),g=tl(g,b,d,null),j.return=o,g.return=o,j.sibling=g,o.child=j,g=o.child,g.memoizedState=_h(d),g.childLanes=kh(a,R,d),o.memoizedState=Ah,Eo(null,g)):(ci(o),Nh(o,j))}var Z=a.memoizedState;if(Z!==null&&(j=Z.dehydrated,j!==null)){if(E)o.flags&256?(ci(o),o.flags&=-257,o=Rh(a,o,d)):o.memoizedState!==null?(fi(),o.child=a.child,o.flags|=128,o=null):(fi(),j=g.fallback,b=o.mode,g=Ec({mode:"visible",children:g.children},b),j=tl(j,b,d,null),j.flags|=2,g.return=o,j.return=o,g.sibling=j,o.child=g,ol(o,a.child,null,d),g=o.child,g.memoizedState=_h(d),g.childLanes=kh(a,R,d),o.memoizedState=Ah,o=Eo(null,g));else if(ci(o),fv(j)){if(R=j.nextSibling&&j.nextSibling.dataset,R)var ve=R.dgst;R=ve,g=Error(r(419)),g.stack="",g.digest=R,so({value:g,source:null,stack:null}),o=Rh(a,o,d)}else if(Bn||Vl(a,o,d,!1),R=(d&a.childLanes)!==0,Bn||R){if(R=an,R!==null&&(g=Et(R,d),g!==0&&g!==Z.retryLane))throw Z.retryLane=g,el(a,g),Ar(R,a,g),Th;cv(j)||kc(),o=Rh(a,o,d)}else cv(j)?(o.flags|=192,o.child=a.child,o=null):(a=Z.treeContext,hn=Jr(j.nextSibling),Jn=o,Ot=!0,ai=null,Qr=!1,a!==null&&_y(o,a),o=Nh(o,g.children),o.flags|=4096);return o}return b?(fi(),j=g.fallback,b=o.mode,Z=a.child,ve=Z.sibling,g=Na(Z,{mode:"hidden",children:g.children}),g.subtreeFlags=Z.subtreeFlags&65011712,ve!==null?j=Na(ve,j):(j=tl(j,b,d,null),j.flags|=2),j.return=o,g.return=o,g.sibling=j,o.child=g,Eo(null,g),g=o.child,j=a.child.memoizedState,j===null?j=_h(d):(b=j.cachePool,b!==null?(Z=Mn._currentValue,b=b.parent!==Z?{parent:Z,pool:Z}:b):b=By(),j={baseLanes:j.baseLanes|d,cachePool:b}),g.memoizedState=j,g.childLanes=kh(a,R,d),o.memoizedState=Ah,Eo(a.child,g)):(ci(o),d=a.child,a=d.sibling,d=Na(d,{mode:"visible",children:g.children}),d.return=o,d.sibling=null,a!==null&&(R=o.deletions,R===null?(o.deletions=[a],o.flags|=16):R.push(a)),o.child=d,o.memoizedState=null,d)}function Nh(a,o){return o=Ec({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function Ec(a,o){return a=Lr(22,a,null,o),a.lanes=0,a}function Rh(a,o,d){return ol(o,a.child,null,d),a=Nh(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function Kb(a,o,d){a.lanes|=o;var g=a.alternate;g!==null&&(g.lanes|=o),$d(a.return,o,d)}function Mh(a,o,d,g,b,E){var R=a.memoizedState;R===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:b,treeForkCount:E}:(R.isBackwards=o,R.rendering=null,R.renderingStartTime=0,R.last=g,R.tail=d,R.tailMode=b,R.treeForkCount=E)}function Yb(a,o,d){var g=o.pendingProps,b=g.revealOrder,E=g.tail;g=g.children;var R=_n.current,j=(R&2)!==0;if(j?(R=R&1|2,o.flags|=128):R&=1,F(_n,R),tr(a,o,g,d),g=Ot?lo:0,!j&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Kb(a,d,o);else if(a.tag===19)Kb(a,d,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(d=o.child,b=null;d!==null;)a=d.alternate,a!==null&&oc(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=o.child,o.child=null):(b=d.sibling,d.sibling=null),Mh(o,!1,b,d,E,g);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&oc(a)===null){o.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}Mh(o,!0,d,null,E,g);break;case"together":Mh(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function Fa(a,o,d){if(a!==null&&(o.dependencies=a.dependencies),vi|=o.lanes,(d&o.childLanes)===0)if(a!==null){if(Vl(a,o,d,!1),(d&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,d=Na(a,a.pendingProps),o.child=d,d.return=o;a.sibling!==null;)a=a.sibling,d=d.sibling=Na(a,a.pendingProps),d.return=o;d.sibling=null}return o.child}function Oh(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&ec(a)))}function GA(a,o,d){switch(o.tag){case 3:Ne(o,o.stateNode.containerInfo),li(o,Mn,a.memoizedState.cache),nl();break;case 27:case 5:ee(o);break;case 4:Ne(o,o.stateNode.containerInfo);break;case 10:li(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,ah(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(ci(o),o.flags|=128,null):(d&o.child.childLanes)!==0?$b(a,o,d):(ci(o),a=Fa(a,o,d),a!==null?a.sibling:null);ci(o);break;case 19:var b=(a.flags&128)!==0;if(g=(d&o.childLanes)!==0,g||(Vl(a,o,d,!1),g=(d&o.childLanes)!==0),b){if(g)return Yb(a,o,d);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),F(_n,_n.current),g)break;return null;case 22:return o.lanes=0,Ub(a,o,d,o.pendingProps);case 24:li(o,Mn,a.memoizedState.cache)}return Fa(a,o,d)}function Xb(a,o,d){if(a!==null)if(a.memoizedProps!==o.pendingProps)Bn=!0;else{if(!Oh(a,d)&&(o.flags&128)===0)return Bn=!1,GA(a,o,d);Bn=(a.flags&131072)!==0}else Bn=!1,Ot&&(o.flags&1048576)!==0&&Ay(o,lo,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(a=ll(o.elementType),o.type=a,typeof a=="function")zd(a)?(g=cl(a,g),o.tag=1,o=Gb(null,o,a,g,d)):(o.tag=0,o=Dh(null,o,a,g,d));else{if(a!=null){var b=a.$$typeof;if(b===A){o.tag=11,o=Ib(null,o,a,g,d);break e}else if(b===D){o.tag=14,o=zb(null,o,a,g,d);break e}}throw o=V(a)||a,Error(r(306,o,""))}}return o;case 0:return Dh(a,o,o.type,o.pendingProps,d);case 1:return g=o.type,b=cl(g,o.pendingProps),Gb(a,o,g,b,d);case 3:e:{if(Ne(o,o.stateNode.containerInfo),a===null)throw Error(r(387));g=o.pendingProps;var E=o.memoizedState;b=E.element,Jd(a,o),go(o,g,null,d);var R=o.memoizedState;if(g=R.cache,li(o,Mn,g),g!==E.cache&&Kd(o,[Mn],d,!0),vo(),g=R.element,E.isDehydrated)if(E={element:g,isDehydrated:!1,cache:R.cache},o.updateQueue.baseState=E,o.memoizedState=E,o.flags&256){o=Vb(a,o,g,d);break e}else if(g!==b){b=Yr(Error(r(424)),o),so(b),o=Vb(a,o,g,d);break e}else for(a=o.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,hn=Jr(a.firstChild),Jn=o,Ot=!0,ai=null,Qr=!0,d=Uy(o,null,g,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(nl(),g===b){o=Fa(a,o,d);break e}tr(a,o,g,d)}o=o.child}return o;case 26:return bc(a,o),a===null?(d=lE(o.type,null,o.pendingProps,null))?o.memoizedState=d:Ot||(d=o.type,a=o.pendingProps,g=Fc(se.current).createElement(d),g[Vt]=o,g[yn]=a,nr(g,d,a),fn(g),o.stateNode=g):o.memoizedState=lE(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return ee(o),a===null&&Ot&&(g=o.stateNode=rE(o.type,o.pendingProps,se.current),Jn=o,Qr=!0,b=hn,bi(o.type)?(dv=b,hn=Jr(g.firstChild)):hn=b),tr(a,o,o.pendingProps.children,d),bc(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&Ot&&((b=g=hn)&&(g=E_(g,o.type,o.pendingProps,Qr),g!==null?(o.stateNode=g,Jn=o,hn=Jr(g.firstChild),Qr=!1,b=!0):b=!1),b||ii(o)),ee(o),b=o.type,E=o.pendingProps,R=a!==null?a.memoizedProps:null,g=E.children,sv(b,E)?g=null:R!==null&&sv(b,R)&&(o.flags|=32),o.memoizedState!==null&&(b=lh(a,o,LA,null,null,d),Lo._currentValue=b),bc(a,o),tr(a,o,g,d),o.child;case 6:return a===null&&Ot&&((a=d=hn)&&(d=x_(d,o.pendingProps,Qr),d!==null?(o.stateNode=d,Jn=o,hn=null,a=!0):a=!1),a||ii(o)),null;case 13:return $b(a,o,d);case 4:return Ne(o,o.stateNode.containerInfo),g=o.pendingProps,a===null?o.child=ol(o,null,g,d):tr(a,o,g,d),o.child;case 11:return Ib(a,o,o.type,o.pendingProps,d);case 7:return tr(a,o,o.pendingProps,d),o.child;case 8:return tr(a,o,o.pendingProps.children,d),o.child;case 12:return tr(a,o,o.pendingProps.children,d),o.child;case 10:return g=o.pendingProps,li(o,o.type,g.value),tr(a,o,g.children,d),o.child;case 9:return b=o.type._context,g=o.pendingProps.children,al(o),b=er(b),g=g(b),o.flags|=1,tr(a,o,g,d),o.child;case 14:return zb(a,o,o.type,o.pendingProps,d);case 15:return Pb(a,o,o.type,o.pendingProps,d);case 19:return Yb(a,o,d);case 31:return jA(a,o,d);case 22:return Ub(a,o,d,o.pendingProps);case 24:return al(o),g=er(Mn),a===null?(b=Zd(),b===null&&(b=an,E=Yd(),b.pooledCache=E,E.refCount++,E!==null&&(b.pooledCacheLanes|=d),b=E),o.memoizedState={parent:g,cache:b},Wd(o),li(o,Mn,b)):((a.lanes&d)!==0&&(Jd(a,o),go(o,null,null,d),vo()),b=a.memoizedState,E=o.memoizedState,b.parent!==g?(b={parent:g,cache:g},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),li(o,Mn,g)):(g=E.cache,li(o,Mn,g),g!==b.cache&&Kd(o,[Mn],d,!0))),tr(a,o,o.pendingProps.children,d),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Ia(a){a.flags|=4}function Bh(a,o,d,g,b){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(w0())a.flags|=8192;else throw sl=ac,Qd}else a.flags&=-16777217}function Zb(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!fE(o))if(w0())a.flags|=8192;else throw sl=ac,Qd}function xc(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?Fe():536870912,a.lanes|=o,rs|=o)}function xo(a,o){if(!Ot)switch(a.tailMode){case"hidden":o=a.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function vn(a){var o=a.alternate!==null&&a.alternate.child===a.child,d=0,g=0;if(o)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags&65011712,g|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=g,a.childLanes=d,o}function VA(a,o,d){var g=o.pendingProps;switch(Hd(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(o),null;case 1:return vn(o),null;case 3:return d=o.stateNode,g=null,a!==null&&(g=a.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),Oa(Mn),pe(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(Gl(o)?Ia(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Gd())),vn(o),null;case 26:var b=o.type,E=o.memoizedState;return a===null?(Ia(o),E!==null?(vn(o),Zb(o,E)):(vn(o),Bh(o,b,null,g,d))):E?E!==a.memoizedState?(Ia(o),vn(o),Zb(o,E)):(vn(o),o.flags&=-16777217):(a=a.memoizedProps,a!==g&&Ia(o),vn(o),Bh(o,b,a,g,d)),null;case 27:if(le(o),d=se.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==g&&Ia(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return vn(o),null}a=J.current,Gl(o)?ky(o):(a=rE(b,g,d),o.stateNode=a,Ia(o))}return vn(o),null;case 5:if(le(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==g&&Ia(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return vn(o),null}if(E=J.current,Gl(o))ky(o);else{var R=Fc(se.current);switch(E){case 1:E=R.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:E=R.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":E=R.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":E=R.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":E=R.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof g.is=="string"?R.createElement("select",{is:g.is}):R.createElement("select"),g.multiple?E.multiple=!0:g.size&&(E.size=g.size);break;default:E=typeof g.is=="string"?R.createElement(b,{is:g.is}):R.createElement(b)}}E[Vt]=o,E[yn]=g;e:for(R=o.child;R!==null;){if(R.tag===5||R.tag===6)E.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===o)break e;for(;R.sibling===null;){if(R.return===null||R.return===o)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}o.stateNode=E;e:switch(nr(E,b,g),b){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ia(o)}}return vn(o),Bh(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,d),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==g&&Ia(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(r(166));if(a=se.current,Gl(o)){if(a=o.stateNode,d=o.memoizedProps,g=null,b=Jn,b!==null)switch(b.tag){case 27:case 5:g=b.memoizedProps}a[Vt]=o,a=!!(a.nodeValue===d||g!==null&&g.suppressHydrationWarning===!0||$0(a.nodeValue,d)),a||ii(o,!0)}else a=Fc(a).createTextNode(g),a[Vt]=o,o.stateNode=a}return vn(o),null;case 31:if(d=o.memoizedState,a===null||a.memoizedState!==null){if(g=Gl(o),d!==null){if(a===null){if(!g)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Vt]=o}else nl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;vn(o),a=!1}else d=Gd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=d),a=!0;if(!a)return o.flags&256?(Ir(o),o):(Ir(o),null);if((o.flags&128)!==0)throw Error(r(558))}return vn(o),null;case 13:if(g=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Gl(o),g!==null&&g.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Vt]=o}else nl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;vn(o),b=!1}else b=Gd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(Ir(o),o):(Ir(o),null)}return Ir(o),(o.flags&128)!==0?(o.lanes=d,o):(d=g!==null,a=a!==null&&a.memoizedState!==null,d&&(g=o.child,b=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(b=g.alternate.memoizedState.cachePool.pool),E=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(E=g.memoizedState.cachePool.pool),E!==b&&(g.flags|=2048)),d!==a&&d&&(o.child.flags|=8192),xc(o,o.updateQueue),vn(o),null);case 4:return pe(),a===null&&nv(o.stateNode.containerInfo),vn(o),null;case 10:return Oa(o.type),vn(o),null;case 19:if(K(_n),g=o.memoizedState,g===null)return vn(o),null;if(b=(o.flags&128)!==0,E=g.rendering,E===null)if(b)xo(g,!1);else{if(Dn!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(E=oc(a),E!==null){for(o.flags|=128,xo(g,!1),a=E.updateQueue,o.updateQueue=a,xc(o,a),o.subtreeFlags=0,a=d,d=o.child;d!==null;)Cy(d,a),d=d.sibling;return F(_n,_n.current&1|2),Ot&&Ra(o,g.treeForkCount),o.child}a=a.sibling}g.tail!==null&&Pe()>Dc&&(o.flags|=128,b=!0,xo(g,!1),o.lanes=4194304)}else{if(!b)if(a=oc(E),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,xc(o,a),xo(g,!0),g.tail===null&&g.tailMode==="hidden"&&!E.alternate&&!Ot)return vn(o),null}else 2*Pe()-g.renderingStartTime>Dc&&d!==536870912&&(o.flags|=128,b=!0,xo(g,!1),o.lanes=4194304);g.isBackwards?(E.sibling=o.child,o.child=E):(a=g.last,a!==null?a.sibling=E:o.child=E,g.last=E)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=Pe(),a.sibling=null,d=_n.current,F(_n,b?d&1|2:d&1),Ot&&Ra(o,g.treeForkCount),a):(vn(o),null);case 22:case 23:return Ir(o),rh(),g=o.memoizedState!==null,a!==null?a.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(d&536870912)!==0&&(o.flags&128)===0&&(vn(o),o.subtreeFlags&6&&(o.flags|=8192)):vn(o),d=o.updateQueue,d!==null&&xc(o,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==d&&(o.flags|=2048),a!==null&&K(il),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),Oa(Mn),vn(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function $A(a,o){switch(Hd(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return Oa(Mn),pe(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return le(o),null;case 31:if(o.memoizedState!==null){if(Ir(o),o.alternate===null)throw Error(r(340));nl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Ir(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));nl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return K(_n),null;case 4:return pe(),null;case 10:return Oa(o.type),null;case 22:case 23:return Ir(o),rh(),a!==null&&K(il),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return Oa(Mn),null;case 25:return null;default:return null}}function Qb(a,o){switch(Hd(o),o.tag){case 3:Oa(Mn),pe();break;case 26:case 27:case 5:le(o);break;case 4:pe();break;case 31:o.memoizedState!==null&&Ir(o);break;case 13:Ir(o);break;case 19:K(_n);break;case 10:Oa(o.type);break;case 22:case 23:Ir(o),rh(),a!==null&&K(il);break;case 24:Oa(Mn)}}function wo(a,o){try{var d=o.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var b=g.next;d=b;do{if((d.tag&a)===a){g=void 0;var E=d.create,R=d.inst;g=E(),R.destroy=g}d=d.next}while(d!==b)}}catch(j){Zt(o,o.return,j)}}function di(a,o,d){try{var g=o.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var E=b.next;g=E;do{if((g.tag&a)===a){var R=g.inst,j=R.destroy;if(j!==void 0){R.destroy=void 0,b=o;var Z=d,ve=j;try{ve()}catch(Se){Zt(b,Z,Se)}}}g=g.next}while(g!==E)}}catch(Se){Zt(o,o.return,Se)}}function Wb(a){var o=a.updateQueue;if(o!==null){var d=a.stateNode;try{Hy(o,d)}catch(g){Zt(a,a.return,g)}}}function Jb(a,o,d){d.props=cl(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(g){Zt(a,o,g)}}function So(a,o){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var g=a.stateNode;break;case 30:g=a.stateNode;break;default:g=a.stateNode}typeof d=="function"?a.refCleanup=d(g):d.current=g}}catch(b){Zt(a,o,b)}}function pa(a,o){var d=a.ref,g=a.refCleanup;if(d!==null)if(typeof g=="function")try{g()}catch(b){Zt(a,o,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){Zt(a,o,b)}else d.current=null}function e0(a){var o=a.type,d=a.memoizedProps,g=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":d.autoFocus&&g.focus();break e;case"img":d.src?g.src=d.src:d.srcSet&&(g.srcset=d.srcSet)}}catch(b){Zt(a,a.return,b)}}function Lh(a,o,d){try{var g=a.stateNode;v_(g,a.type,d,o),g[yn]=o}catch(b){Zt(a,a.return,b)}}function t0(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&bi(a.type)||a.tag===4}function Fh(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||t0(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&bi(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Ih(a,o,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,o?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(a,o):(o=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,o.appendChild(a),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=qe));else if(g!==4&&(g===27&&bi(a.type)&&(d=a.stateNode,o=null),a=a.child,a!==null))for(Ih(a,o,d),a=a.sibling;a!==null;)Ih(a,o,d),a=a.sibling}function wc(a,o,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,o?d.insertBefore(a,o):d.appendChild(a);else if(g!==4&&(g===27&&bi(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(wc(a,o,d),a=a.sibling;a!==null;)wc(a,o,d),a=a.sibling}function n0(a){var o=a.stateNode,d=a.memoizedProps;try{for(var g=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);nr(o,g,d),o[Vt]=a,o[yn]=d}catch(E){Zt(a,a.return,E)}}var za=!1,Ln=!1,zh=!1,r0=typeof WeakSet=="function"?WeakSet:Set,$n=null;function KA(a,o){if(a=a.containerInfo,iv=jc,a=gy(a),Rd(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var b=g.anchorOffset,E=g.focusNode;g=g.focusOffset;try{d.nodeType,E.nodeType}catch{d=null;break e}var R=0,j=-1,Z=-1,ve=0,Se=0,_e=a,ge=null;t:for(;;){for(var be;_e!==d||b!==0&&_e.nodeType!==3||(j=R+b),_e!==E||g!==0&&_e.nodeType!==3||(Z=R+g),_e.nodeType===3&&(R+=_e.nodeValue.length),(be=_e.firstChild)!==null;)ge=_e,_e=be;for(;;){if(_e===a)break t;if(ge===d&&++ve===b&&(j=R),ge===E&&++Se===g&&(Z=R),(be=_e.nextSibling)!==null)break;_e=ge,ge=_e.parentNode}_e=be}d=j===-1||Z===-1?null:{start:j,end:Z}}else d=null}d=d||{start:0,end:0}}else d=null;for(lv={focusedElem:a,selectionRange:d},jc=!1,$n=o;$n!==null;)if(o=$n,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,$n=a;else for(;$n!==null;){switch(o=$n,E=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(d=0;d<a.length;d++)b=a[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&E!==null){a=void 0,d=o,b=E.memoizedProps,E=E.memoizedState,g=d.stateNode;try{var rt=cl(d.type,b);a=g.getSnapshotBeforeUpdate(rt,E),g.__reactInternalSnapshotBeforeUpdate=a}catch(vt){Zt(d,d.return,vt)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,d=a.nodeType,d===9)uv(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":uv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=o.sibling,a!==null){a.return=o.return,$n=a;break}$n=o.return}}function a0(a,o,d){var g=d.flags;switch(d.tag){case 0:case 11:case 15:Ua(a,d),g&4&&wo(5,d);break;case 1:if(Ua(a,d),g&4)if(a=d.stateNode,o===null)try{a.componentDidMount()}catch(R){Zt(d,d.return,R)}else{var b=cl(d.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(R){Zt(d,d.return,R)}}g&64&&Wb(d),g&512&&So(d,d.return);break;case 3:if(Ua(a,d),g&64&&(a=d.updateQueue,a!==null)){if(o=null,d.child!==null)switch(d.child.tag){case 27:case 5:o=d.child.stateNode;break;case 1:o=d.child.stateNode}try{Hy(a,o)}catch(R){Zt(d,d.return,R)}}break;case 27:o===null&&g&4&&n0(d);case 26:case 5:Ua(a,d),o===null&&g&4&&e0(d),g&512&&So(d,d.return);break;case 12:Ua(a,d);break;case 31:Ua(a,d),g&4&&s0(a,d);break;case 13:Ua(a,d),g&4&&o0(a,d),g&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=n_.bind(null,d),w_(a,d))));break;case 22:if(g=d.memoizedState!==null||za,!g){o=o!==null&&o.memoizedState!==null||Ln,b=za;var E=Ln;za=g,(Ln=o)&&!E?qa(a,d,(d.subtreeFlags&8772)!==0):Ua(a,d),za=b,Ln=E}break;case 30:break;default:Ua(a,d)}}function i0(a){var o=a.alternate;o!==null&&(a.alternate=null,i0(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&ha(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var pn=null,Sr=!1;function Pa(a,o,d){for(d=d.child;d!==null;)l0(a,o,d),d=d.sibling}function l0(a,o,d){if(te&&typeof te.onCommitFiberUnmount=="function")try{te.onCommitFiberUnmount(G,d)}catch{}switch(d.tag){case 26:Ln||pa(d,o),Pa(a,o,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Ln||pa(d,o);var g=pn,b=Sr;bi(d.type)&&(pn=d.stateNode,Sr=!1),Pa(a,o,d),Mo(d.stateNode),pn=g,Sr=b;break;case 5:Ln||pa(d,o);case 6:if(g=pn,b=Sr,pn=null,Pa(a,o,d),pn=g,Sr=b,pn!==null)if(Sr)try{(pn.nodeType===9?pn.body:pn.nodeName==="HTML"?pn.ownerDocument.body:pn).removeChild(d.stateNode)}catch(E){Zt(d,o,E)}else try{pn.removeChild(d.stateNode)}catch(E){Zt(d,o,E)}break;case 18:pn!==null&&(Sr?(a=pn,W0(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),fs(a)):W0(pn,d.stateNode));break;case 4:g=pn,b=Sr,pn=d.stateNode.containerInfo,Sr=!0,Pa(a,o,d),pn=g,Sr=b;break;case 0:case 11:case 14:case 15:di(2,d,o),Ln||di(4,d,o),Pa(a,o,d);break;case 1:Ln||(pa(d,o),g=d.stateNode,typeof g.componentWillUnmount=="function"&&Jb(d,o,g)),Pa(a,o,d);break;case 21:Pa(a,o,d);break;case 22:Ln=(g=Ln)||d.memoizedState!==null,Pa(a,o,d),Ln=g;break;default:Pa(a,o,d)}}function s0(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{fs(a)}catch(d){Zt(o,o.return,d)}}}function o0(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{fs(a)}catch(d){Zt(o,o.return,d)}}function YA(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new r0),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new r0),o;default:throw Error(r(435,a.tag))}}function Sc(a,o){var d=YA(a);o.forEach(function(g){if(!d.has(g)){d.add(g);var b=r_.bind(null,a,g);g.then(b,b)}})}function Cr(a,o){var d=o.deletions;if(d!==null)for(var g=0;g<d.length;g++){var b=d[g],E=a,R=o,j=R;e:for(;j!==null;){switch(j.tag){case 27:if(bi(j.type)){pn=j.stateNode,Sr=!1;break e}break;case 5:pn=j.stateNode,Sr=!1;break e;case 3:case 4:pn=j.stateNode.containerInfo,Sr=!0;break e}j=j.return}if(pn===null)throw Error(r(160));l0(E,R,b),pn=null,Sr=!1,E=b.alternate,E!==null&&(E.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)u0(o,a),o=o.sibling}var sa=null;function u0(a,o){var d=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Cr(o,a),Tr(a),g&4&&(di(3,a,a.return),wo(3,a),di(5,a,a.return));break;case 1:Cr(o,a),Tr(a),g&512&&(Ln||d===null||pa(d,d.return)),g&64&&za&&(a=a.updateQueue,a!==null&&(g=a.callbacks,g!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?g:d.concat(g))));break;case 26:var b=sa;if(Cr(o,a),Tr(a),g&512&&(Ln||d===null||pa(d,d.return)),g&4){var E=d!==null?d.memoizedState:null;if(g=a.memoizedState,d===null)if(g===null)if(a.stateNode===null){e:{g=a.type,d=a.memoizedProps,b=b.ownerDocument||b;t:switch(g){case"title":E=b.getElementsByTagName("title")[0],(!E||E[rn]||E[Vt]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=b.createElement(g),b.head.insertBefore(E,b.querySelector("head > title"))),nr(E,g,d),E[Vt]=a,fn(E),g=E;break e;case"link":var R=uE("link","href",b).get(g+(d.href||""));if(R){for(var j=0;j<R.length;j++)if(E=R[j],E.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&E.getAttribute("rel")===(d.rel==null?null:d.rel)&&E.getAttribute("title")===(d.title==null?null:d.title)&&E.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){R.splice(j,1);break t}}E=b.createElement(g),nr(E,g,d),b.head.appendChild(E);break;case"meta":if(R=uE("meta","content",b).get(g+(d.content||""))){for(j=0;j<R.length;j++)if(E=R[j],E.getAttribute("content")===(d.content==null?null:""+d.content)&&E.getAttribute("name")===(d.name==null?null:d.name)&&E.getAttribute("property")===(d.property==null?null:d.property)&&E.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&E.getAttribute("charset")===(d.charSet==null?null:d.charSet)){R.splice(j,1);break t}}E=b.createElement(g),nr(E,g,d),b.head.appendChild(E);break;default:throw Error(r(468,g))}E[Vt]=a,fn(E),g=E}a.stateNode=g}else cE(b,a.type,a.stateNode);else a.stateNode=oE(b,g,a.memoizedProps);else E!==g?(E===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):E.count--,g===null?cE(b,a.type,a.stateNode):oE(b,g,a.memoizedProps)):g===null&&a.stateNode!==null&&Lh(a,a.memoizedProps,d.memoizedProps)}break;case 27:Cr(o,a),Tr(a),g&512&&(Ln||d===null||pa(d,d.return)),d!==null&&g&4&&Lh(a,a.memoizedProps,d.memoizedProps);break;case 5:if(Cr(o,a),Tr(a),g&512&&(Ln||d===null||pa(d,d.return)),a.flags&32){b=a.stateNode;try{gt(b,"")}catch(rt){Zt(a,a.return,rt)}}g&4&&a.stateNode!=null&&(b=a.memoizedProps,Lh(a,b,d!==null?d.memoizedProps:b)),g&1024&&(zh=!0);break;case 6:if(Cr(o,a),Tr(a),g&4){if(a.stateNode===null)throw Error(r(162));g=a.memoizedProps,d=a.stateNode;try{d.nodeValue=g}catch(rt){Zt(a,a.return,rt)}}break;case 3:if(Pc=null,b=sa,sa=Ic(o.containerInfo),Cr(o,a),sa=b,Tr(a),g&4&&d!==null&&d.memoizedState.isDehydrated)try{fs(o.containerInfo)}catch(rt){Zt(a,a.return,rt)}zh&&(zh=!1,c0(a));break;case 4:g=sa,sa=Ic(a.stateNode.containerInfo),Cr(o,a),Tr(a),sa=g;break;case 12:Cr(o,a),Tr(a);break;case 31:Cr(o,a),Tr(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,Sc(a,g)));break;case 13:Cr(o,a),Tr(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Tc=Pe()),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,Sc(a,g)));break;case 22:b=a.memoizedState!==null;var Z=d!==null&&d.memoizedState!==null,ve=za,Se=Ln;if(za=ve||b,Ln=Se||Z,Cr(o,a),Ln=Se,za=ve,Tr(a),g&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(d===null||Z||za||Ln||fl(a)),d=null,o=a;;){if(o.tag===5||o.tag===26){if(d===null){Z=d=o;try{if(E=Z.stateNode,b)R=E.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{j=Z.stateNode;var _e=Z.memoizedProps.style,ge=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;j.style.display=ge==null||typeof ge=="boolean"?"":(""+ge).trim()}}catch(rt){Zt(Z,Z.return,rt)}}}else if(o.tag===6){if(d===null){Z=o;try{Z.stateNode.nodeValue=b?"":Z.memoizedProps}catch(rt){Zt(Z,Z.return,rt)}}}else if(o.tag===18){if(d===null){Z=o;try{var be=Z.stateNode;b?J0(be,!0):J0(Z.stateNode,!1)}catch(rt){Zt(Z,Z.return,rt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;d===o&&(d=null),o=o.return}d===o&&(d=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=a.updateQueue,g!==null&&(d=g.retryQueue,d!==null&&(g.retryQueue=null,Sc(a,d))));break;case 19:Cr(o,a),Tr(a),g&4&&(g=a.updateQueue,g!==null&&(a.updateQueue=null,Sc(a,g)));break;case 30:break;case 21:break;default:Cr(o,a),Tr(a)}}function Tr(a){var o=a.flags;if(o&2){try{for(var d,g=a.return;g!==null;){if(t0(g)){d=g;break}g=g.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,E=Fh(a);wc(a,E,b);break;case 5:var R=d.stateNode;d.flags&32&&(gt(R,""),d.flags&=-33);var j=Fh(a);wc(a,j,R);break;case 3:case 4:var Z=d.stateNode.containerInfo,ve=Fh(a);Ih(a,ve,Z);break;default:throw Error(r(161))}}catch(Se){Zt(a,a.return,Se)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function c0(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;c0(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function Ua(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)a0(a,o.alternate,o),o=o.sibling}function fl(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:di(4,o,o.return),fl(o);break;case 1:pa(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&Jb(o,o.return,d),fl(o);break;case 27:Mo(o.stateNode);case 26:case 5:pa(o,o.return),fl(o);break;case 22:o.memoizedState===null&&fl(o);break;case 30:fl(o);break;default:fl(o)}a=a.sibling}}function qa(a,o,d){for(d=d&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,b=a,E=o,R=E.flags;switch(E.tag){case 0:case 11:case 15:qa(b,E,d),wo(4,E);break;case 1:if(qa(b,E,d),g=E,b=g.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ve){Zt(g,g.return,ve)}if(g=E,b=g.updateQueue,b!==null){var j=g.stateNode;try{var Z=b.shared.hiddenCallbacks;if(Z!==null)for(b.shared.hiddenCallbacks=null,b=0;b<Z.length;b++)qy(Z[b],j)}catch(ve){Zt(g,g.return,ve)}}d&&R&64&&Wb(E),So(E,E.return);break;case 27:n0(E);case 26:case 5:qa(b,E,d),d&&g===null&&R&4&&e0(E),So(E,E.return);break;case 12:qa(b,E,d);break;case 31:qa(b,E,d),d&&R&4&&s0(b,E);break;case 13:qa(b,E,d),d&&R&4&&o0(b,E);break;case 22:E.memoizedState===null&&qa(b,E,d),So(E,E.return);break;case 30:break;default:qa(b,E,d)}o=o.sibling}}function Ph(a,o){var d=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==d&&(a!=null&&a.refCount++,d!=null&&oo(d))}function Uh(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&oo(a))}function oa(a,o,d,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)f0(a,o,d,g),o=o.sibling}function f0(a,o,d,g){var b=o.flags;switch(o.tag){case 0:case 11:case 15:oa(a,o,d,g),b&2048&&wo(9,o);break;case 1:oa(a,o,d,g);break;case 3:oa(a,o,d,g),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&oo(a)));break;case 12:if(b&2048){oa(a,o,d,g),a=o.stateNode;try{var E=o.memoizedProps,R=E.id,j=E.onPostCommit;typeof j=="function"&&j(R,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(Z){Zt(o,o.return,Z)}}else oa(a,o,d,g);break;case 31:oa(a,o,d,g);break;case 13:oa(a,o,d,g);break;case 23:break;case 22:E=o.stateNode,R=o.alternate,o.memoizedState!==null?E._visibility&2?oa(a,o,d,g):Co(a,o):E._visibility&2?oa(a,o,d,g):(E._visibility|=2,es(a,o,d,g,(o.subtreeFlags&10256)!==0||!1)),b&2048&&Ph(R,o);break;case 24:oa(a,o,d,g),b&2048&&Uh(o.alternate,o);break;default:oa(a,o,d,g)}}function es(a,o,d,g,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var E=a,R=o,j=d,Z=g,ve=R.flags;switch(R.tag){case 0:case 11:case 15:es(E,R,j,Z,b),wo(8,R);break;case 23:break;case 22:var Se=R.stateNode;R.memoizedState!==null?Se._visibility&2?es(E,R,j,Z,b):Co(E,R):(Se._visibility|=2,es(E,R,j,Z,b)),b&&ve&2048&&Ph(R.alternate,R);break;case 24:es(E,R,j,Z,b),b&&ve&2048&&Uh(R.alternate,R);break;default:es(E,R,j,Z,b)}o=o.sibling}}function Co(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var d=a,g=o,b=g.flags;switch(g.tag){case 22:Co(d,g),b&2048&&Ph(g.alternate,g);break;case 24:Co(d,g),b&2048&&Uh(g.alternate,g);break;default:Co(d,g)}o=o.sibling}}var To=8192;function ts(a,o,d){if(a.subtreeFlags&To)for(a=a.child;a!==null;)d0(a,o,d),a=a.sibling}function d0(a,o,d){switch(a.tag){case 26:ts(a,o,d),a.flags&To&&a.memoizedState!==null&&B_(d,sa,a.memoizedState,a.memoizedProps);break;case 5:ts(a,o,d);break;case 3:case 4:var g=sa;sa=Ic(a.stateNode.containerInfo),ts(a,o,d),sa=g;break;case 22:a.memoizedState===null&&(g=a.alternate,g!==null&&g.memoizedState!==null?(g=To,To=16777216,ts(a,o,d),To=g):ts(a,o,d));break;default:ts(a,o,d)}}function h0(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function Do(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var g=o[d];$n=g,g0(g,a)}h0(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)v0(a),a=a.sibling}function v0(a){switch(a.tag){case 0:case 11:case 15:Do(a),a.flags&2048&&di(9,a,a.return);break;case 3:Do(a);break;case 12:Do(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,Cc(a)):Do(a);break;default:Do(a)}}function Cc(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var g=o[d];$n=g,g0(g,a)}h0(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:di(8,o,o.return),Cc(o);break;case 22:d=o.stateNode,d._visibility&2&&(d._visibility&=-3,Cc(o));break;default:Cc(o)}a=a.sibling}}function g0(a,o){for(;$n!==null;){var d=$n;switch(d.tag){case 0:case 11:case 15:di(8,d,o);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var g=d.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:oo(d.memoizedState.cache)}if(g=d.child,g!==null)g.return=d,$n=g;else e:for(d=a;$n!==null;){g=$n;var b=g.sibling,E=g.return;if(i0(g),g===d){$n=null;break e}if(b!==null){b.return=E,$n=b;break e}$n=E}}}var XA={getCacheForType:function(a){var o=er(Mn),d=o.data.get(a);return d===void 0&&(d=a(),o.data.set(a,d)),d},cacheSignal:function(){return er(Mn).controller.signal}},ZA=typeof WeakMap=="function"?WeakMap:Map,Gt=0,an=null,At=null,Rt=0,Xt=0,zr=null,hi=!1,ns=!1,qh=!1,Ha=0,Dn=0,vi=0,dl=0,Hh=0,Pr=0,rs=0,Ao=null,Dr=null,jh=!1,Tc=0,p0=0,Dc=1/0,Ac=null,gi=null,Pn=0,pi=null,as=null,ja=0,Gh=0,Vh=null,m0=null,_o=0,$h=null;function Ur(){return(Gt&2)!==0&&Rt!==0?Rt&-Rt:q.T!==null?Wh():Bt()}function y0(){if(Pr===0)if((Rt&536870912)===0||Ot){var a=Ke;Ke<<=1,(Ke&3932160)===0&&(Ke=262144),Pr=a}else Pr=536870912;return a=Fr.current,a!==null&&(a.flags|=32),Pr}function Ar(a,o,d){(a===an&&(Xt===2||Xt===9)||a.cancelPendingCommit!==null)&&(is(a,0),mi(a,Rt,Pr,!1)),ft(a,d),((Gt&2)===0||a!==an)&&(a===an&&((Gt&2)===0&&(dl|=d),Dn===4&&mi(a,Rt,Pr,!1)),ma(a))}function b0(a,o,d){if((Gt&6)!==0)throw Error(r(327));var g=!d&&(o&127)===0&&(o&a.expiredLanes)===0||ne(a,o),b=g?JA(a,o):Yh(a,o,!0),E=g;do{if(b===0){ns&&!g&&mi(a,o,0,!1);break}else{if(d=a.current.alternate,E&&!QA(d)){b=Yh(a,o,!1),E=!1;continue}if(b===2){if(E=o,a.errorRecoveryDisabledLanes&E)var R=0;else R=a.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){o=R;e:{var j=a;b=Ao;var Z=j.current.memoizedState.isDehydrated;if(Z&&(is(j,R).flags|=256),R=Yh(j,R,!1),R!==2){if(qh&&!Z){j.errorRecoveryDisabledLanes|=E,dl|=E,b=4;break e}E=Dr,Dr=b,E!==null&&(Dr===null?Dr=E:Dr.push.apply(Dr,E))}b=R}if(E=!1,b!==2)continue}}if(b===1){is(a,0),mi(a,o,0,!0);break}e:{switch(g=a,E=b,E){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:mi(g,o,Pr,!hi);break e;case 2:Dr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=Tc+300-Pe(),10<b)){if(mi(g,o,Pr,!hi),X(g,0,!0)!==0)break e;ja=o,g.timeoutHandle=Z0(E0.bind(null,g,d,Dr,Ac,jh,o,Pr,dl,rs,hi,E,"Throttled",-0,0),b);break e}E0(g,d,Dr,Ac,jh,o,Pr,dl,rs,hi,E,null,-0,0)}}break}while(!0);ma(a)}function E0(a,o,d,g,b,E,R,j,Z,ve,Se,_e,ge,be){if(a.timeoutHandle=-1,_e=o.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qe},d0(o,E,_e);var rt=(E&62914560)===E?Tc-Pe():(E&4194048)===E?p0-Pe():0;if(rt=L_(_e,rt),rt!==null){ja=E,a.cancelPendingCommit=rt(_0.bind(null,a,o,E,d,g,b,R,j,Z,Se,_e,null,ge,be)),mi(a,E,R,!ve);return}}_0(a,o,E,d,g,b,R,j,Z)}function QA(a){for(var o=a;;){var d=o.tag;if((d===0||d===11||d===15)&&o.flags&16384&&(d=o.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var g=0;g<d.length;g++){var b=d[g],E=b.getSnapshot;b=b.value;try{if(!Br(E(),b))return!1}catch{return!1}}if(d=o.child,o.subtreeFlags&16384&&d!==null)d.return=o,o=d;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function mi(a,o,d,g){o&=~Hh,o&=~dl,a.suspendedLanes|=o,a.pingedLanes&=~o,g&&(a.warmLanes|=o),g=a.expirationTimes;for(var b=o;0<b;){var E=31-ce(b),R=1<<E;g[E]=-1,b&=~R}d!==0&&Me(a,d,o)}function _c(){return(Gt&6)===0?(ko(0),!1):!0}function Kh(){if(At!==null){if(Xt===0)var a=At.return;else a=At,Ma=rl=null,uh(a),Xl=null,co=0,a=At;for(;a!==null;)Qb(a.alternate,a),a=a.return;At=null}}function is(a,o){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,m_(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),ja=0,Kh(),an=a,At=d=Na(a.current,null),Rt=o,Xt=0,zr=null,hi=!1,ns=ne(a,o),qh=!1,rs=Pr=Hh=dl=vi=Dn=0,Dr=Ao=null,jh=!1,(o&8)!==0&&(o|=o&32);var g=a.entangledLanes;if(g!==0)for(a=a.entanglements,g&=o;0<g;){var b=31-ce(g),E=1<<b;o|=a[b],g&=~E}return Ha=o,Xu(),d}function x0(a,o){wt=null,q.H=bo,o===Yl||o===rc?(o=Iy(),Xt=3):o===Qd?(o=Iy(),Xt=4):Xt=o===Th?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,zr=o,At===null&&(Dn=1,mc(a,Yr(o,a.current)))}function w0(){var a=Fr.current;return a===null?!0:(Rt&4194048)===Rt?Wr===null:(Rt&62914560)===Rt||(Rt&536870912)!==0?a===Wr:!1}function S0(){var a=q.H;return q.H=bo,a===null?bo:a}function C0(){var a=q.A;return q.A=XA,a}function kc(){Dn=4,hi||(Rt&4194048)!==Rt&&Fr.current!==null||(ns=!0),(vi&134217727)===0&&(dl&134217727)===0||an===null||mi(an,Rt,Pr,!1)}function Yh(a,o,d){var g=Gt;Gt|=2;var b=S0(),E=C0();(an!==a||Rt!==o)&&(Ac=null,is(a,o)),o=!1;var R=Dn;e:do try{if(Xt!==0&&At!==null){var j=At,Z=zr;switch(Xt){case 8:Kh(),R=6;break e;case 3:case 2:case 9:case 6:Fr.current===null&&(o=!0);var ve=Xt;if(Xt=0,zr=null,ls(a,j,Z,ve),d&&ns){R=0;break e}break;default:ve=Xt,Xt=0,zr=null,ls(a,j,Z,ve)}}WA(),R=Dn;break}catch(Se){x0(a,Se)}while(!0);return o&&a.shellSuspendCounter++,Ma=rl=null,Gt=g,q.H=b,q.A=E,At===null&&(an=null,Rt=0,Xu()),R}function WA(){for(;At!==null;)T0(At)}function JA(a,o){var d=Gt;Gt|=2;var g=S0(),b=C0();an!==a||Rt!==o?(Ac=null,Dc=Pe()+500,is(a,o)):ns=ne(a,o);e:do try{if(Xt!==0&&At!==null){o=At;var E=zr;t:switch(Xt){case 1:Xt=0,zr=null,ls(a,o,E,1);break;case 2:case 9:if(Ly(E)){Xt=0,zr=null,D0(o);break}o=function(){Xt!==2&&Xt!==9||an!==a||(Xt=7),ma(a)},E.then(o,o);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:Ly(E)?(Xt=0,zr=null,D0(o)):(Xt=0,zr=null,ls(a,o,E,7));break;case 5:var R=null;switch(At.tag){case 26:R=At.memoizedState;case 5:case 27:var j=At;if(R?fE(R):j.stateNode.complete){Xt=0,zr=null;var Z=j.sibling;if(Z!==null)At=Z;else{var ve=j.return;ve!==null?(At=ve,Nc(ve)):At=null}break t}}Xt=0,zr=null,ls(a,o,E,5);break;case 6:Xt=0,zr=null,ls(a,o,E,6);break;case 8:Kh(),Dn=6;break e;default:throw Error(r(462))}}e_();break}catch(Se){x0(a,Se)}while(!0);return Ma=rl=null,q.H=g,q.A=b,Gt=d,At!==null?0:(an=null,Rt=0,Xu(),Dn)}function e_(){for(;At!==null&&!tt();)T0(At)}function T0(a){var o=Xb(a.alternate,a,Ha);a.memoizedProps=a.pendingProps,o===null?Nc(a):At=o}function D0(a){var o=a,d=o.alternate;switch(o.tag){case 15:case 0:o=jb(d,o,o.pendingProps,o.type,void 0,Rt);break;case 11:o=jb(d,o,o.pendingProps,o.type.render,o.ref,Rt);break;case 5:uh(o);default:Qb(d,o),o=At=Cy(o,Ha),o=Xb(d,o,Ha)}a.memoizedProps=a.pendingProps,o===null?Nc(a):At=o}function ls(a,o,d,g){Ma=rl=null,uh(o),Xl=null,co=0;var b=o.return;try{if(HA(a,b,o,d,Rt)){Dn=1,mc(a,Yr(d,a.current)),At=null;return}}catch(E){if(b!==null)throw At=b,E;Dn=1,mc(a,Yr(d,a.current)),At=null;return}o.flags&32768?(Ot||g===1?a=!0:ns||(Rt&536870912)!==0?a=!1:(hi=a=!0,(g===2||g===9||g===3||g===6)&&(g=Fr.current,g!==null&&g.tag===13&&(g.flags|=16384))),A0(o,a)):Nc(o)}function Nc(a){var o=a;do{if((o.flags&32768)!==0){A0(o,hi);return}a=o.return;var d=VA(o.alternate,o,Ha);if(d!==null){At=d;return}if(o=o.sibling,o!==null){At=o;return}At=o=a}while(o!==null);Dn===0&&(Dn=5)}function A0(a,o){do{var d=$A(a.alternate,a);if(d!==null){d.flags&=32767,At=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!o&&(a=a.sibling,a!==null)){At=a;return}At=a=d}while(a!==null);Dn=6,At=null}function _0(a,o,d,g,b,E,R,j,Z){a.cancelPendingCommit=null;do Rc();while(Pn!==0);if((Gt&6)!==0)throw Error(r(327));if(o!==null){if(o===a.current)throw Error(r(177));if(E=o.lanes|o.childLanes,E|=Fd,He(a,d,E,R,j,Z),a===an&&(At=an=null,Rt=0),as=o,pi=a,ja=d,Gh=E,Vh=b,m0=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,a_(Oe,function(){return O0(),null})):(a.callbackNode=null,a.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=q.T,q.T=null,b=H.p,H.p=2,R=Gt,Gt|=4;try{KA(a,o,d)}finally{Gt=R,H.p=b,q.T=g}}Pn=1,k0(),N0(),R0()}}function k0(){if(Pn===1){Pn=0;var a=pi,o=as,d=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||d){d=q.T,q.T=null;var g=H.p;H.p=2;var b=Gt;Gt|=4;try{u0(o,a);var E=lv,R=gy(a.containerInfo),j=E.focusedElem,Z=E.selectionRange;if(R!==j&&j&&j.ownerDocument&&vy(j.ownerDocument.documentElement,j)){if(Z!==null&&Rd(j)){var ve=Z.start,Se=Z.end;if(Se===void 0&&(Se=ve),"selectionStart"in j)j.selectionStart=ve,j.selectionEnd=Math.min(Se,j.value.length);else{var _e=j.ownerDocument||document,ge=_e&&_e.defaultView||window;if(ge.getSelection){var be=ge.getSelection(),rt=j.textContent.length,vt=Math.min(Z.start,rt),en=Z.end===void 0?vt:Math.min(Z.end,rt);!be.extend&&vt>en&&(R=en,en=vt,vt=R);var ae=hy(j,vt),W=hy(j,en);if(ae&&W&&(be.rangeCount!==1||be.anchorNode!==ae.node||be.anchorOffset!==ae.offset||be.focusNode!==W.node||be.focusOffset!==W.offset)){var he=_e.createRange();he.setStart(ae.node,ae.offset),be.removeAllRanges(),vt>en?(be.addRange(he),be.extend(W.node,W.offset)):(he.setEnd(W.node,W.offset),be.addRange(he))}}}}for(_e=[],be=j;be=be.parentNode;)be.nodeType===1&&_e.push({element:be,left:be.scrollLeft,top:be.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<_e.length;j++){var De=_e[j];De.element.scrollLeft=De.left,De.element.scrollTop=De.top}}jc=!!iv,lv=iv=null}finally{Gt=b,H.p=g,q.T=d}}a.current=o,Pn=2}}function N0(){if(Pn===2){Pn=0;var a=pi,o=as,d=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||d){d=q.T,q.T=null;var g=H.p;H.p=2;var b=Gt;Gt|=4;try{a0(a,o.alternate,o)}finally{Gt=b,H.p=g,q.T=d}}Pn=3}}function R0(){if(Pn===4||Pn===3){Pn=0,ot();var a=pi,o=as,d=ja,g=m0;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Pn=5:(Pn=0,as=pi=null,M0(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(gi=null),Nn(d),o=o.stateNode,te&&typeof te.onCommitFiberRoot=="function")try{te.onCommitFiberRoot(G,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=q.T,b=H.p,H.p=2,q.T=null;try{for(var E=a.onRecoverableError,R=0;R<g.length;R++){var j=g[R];E(j.value,{componentStack:j.stack})}}finally{q.T=o,H.p=b}}(ja&3)!==0&&Rc(),ma(a),b=a.pendingLanes,(d&261930)!==0&&(b&42)!==0?a===$h?_o++:(_o=0,$h=a):_o=0,ko(0)}}function M0(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,oo(o)))}function Rc(){return k0(),N0(),R0(),O0()}function O0(){if(Pn!==5)return!1;var a=pi,o=Gh;Gh=0;var d=Nn(ja),g=q.T,b=H.p;try{H.p=32>d?32:d,q.T=null,d=Vh,Vh=null;var E=pi,R=ja;if(Pn=0,as=pi=null,ja=0,(Gt&6)!==0)throw Error(r(331));var j=Gt;if(Gt|=4,v0(E.current),f0(E,E.current,R,d),Gt=j,ko(0,!1),te&&typeof te.onPostCommitFiberRoot=="function")try{te.onPostCommitFiberRoot(G,E)}catch{}return!0}finally{H.p=b,q.T=g,M0(a,o)}}function B0(a,o,d){o=Yr(d,o),o=Ch(a.stateNode,o,2),a=ui(a,o,2),a!==null&&(ft(a,2),ma(a))}function Zt(a,o,d){if(a.tag===3)B0(a,a,d);else for(;o!==null;){if(o.tag===3){B0(o,a,d);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(gi===null||!gi.has(g))){a=Yr(d,a),d=Lb(2),g=ui(o,d,2),g!==null&&(Fb(d,g,o,a),ft(g,2),ma(g));break}}o=o.return}}function Xh(a,o,d){var g=a.pingCache;if(g===null){g=a.pingCache=new ZA;var b=new Set;g.set(o,b)}else b=g.get(o),b===void 0&&(b=new Set,g.set(o,b));b.has(d)||(qh=!0,b.add(d),a=t_.bind(null,a,o,d),o.then(a,a))}function t_(a,o,d){var g=a.pingCache;g!==null&&g.delete(o),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,an===a&&(Rt&d)===d&&(Dn===4||Dn===3&&(Rt&62914560)===Rt&&300>Pe()-Tc?(Gt&2)===0&&is(a,0):Hh|=d,rs===Rt&&(rs=0)),ma(a)}function L0(a,o){o===0&&(o=Fe()),a=el(a,o),a!==null&&(ft(a,o),ma(a))}function n_(a){var o=a.memoizedState,d=0;o!==null&&(d=o.retryLane),L0(a,d)}function r_(a,o){var d=0;switch(a.tag){case 31:case 13:var g=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:g=a.stateNode;break;case 22:g=a.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(o),L0(a,d)}function a_(a,o){return ze(a,o)}var Mc=null,ss=null,Zh=!1,Oc=!1,Qh=!1,yi=0;function ma(a){a!==ss&&a.next===null&&(ss===null?Mc=ss=a:ss=ss.next=a),Oc=!0,Zh||(Zh=!0,l_())}function ko(a,o){if(!Qh&&Oc){Qh=!0;do for(var d=!1,g=Mc;g!==null;){if(a!==0){var b=g.pendingLanes;if(b===0)var E=0;else{var R=g.suspendedLanes,j=g.pingedLanes;E=(1<<31-ce(42|a)+1)-1,E&=b&~(R&~j),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(d=!0,P0(g,E))}else E=Rt,E=X(g,g===an?E:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(E&3)===0||ne(g,E)||(d=!0,P0(g,E));g=g.next}while(d);Qh=!1}}function i_(){F0()}function F0(){Oc=Zh=!1;var a=0;yi!==0&&p_()&&(a=yi);for(var o=Pe(),d=null,g=Mc;g!==null;){var b=g.next,E=I0(g,o);E===0?(g.next=null,d===null?Mc=b:d.next=b,b===null&&(ss=d)):(d=g,(a!==0||(E&3)!==0)&&(Oc=!0)),g=b}Pn!==0&&Pn!==5||ko(a),yi!==0&&(yi=0)}function I0(a,o){for(var d=a.suspendedLanes,g=a.pingedLanes,b=a.expirationTimes,E=a.pendingLanes&-62914561;0<E;){var R=31-ce(E),j=1<<R,Z=b[R];Z===-1?((j&d)===0||(j&g)!==0)&&(b[R]=Ce(j,o)):Z<=o&&(a.expiredLanes|=j),E&=~j}if(o=an,d=Rt,d=X(a,a===o?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g=a.callbackNode,d===0||a===o&&(Xt===2||Xt===9)||a.cancelPendingCommit!==null)return g!==null&&g!==null&&Ge(g),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||ne(a,d)){if(o=d&-d,o===a.callbackPriority)return o;switch(g!==null&&Ge(g),Nn(d)){case 2:case 8:d=Te;break;case 32:d=Oe;break;case 268435456:d=Le;break;default:d=Oe}return g=z0.bind(null,a),d=ze(d,g),a.callbackPriority=o,a.callbackNode=d,o}return g!==null&&g!==null&&Ge(g),a.callbackPriority=2,a.callbackNode=null,2}function z0(a,o){if(Pn!==0&&Pn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(Rc()&&a.callbackNode!==d)return null;var g=Rt;return g=X(a,a===an?g:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),g===0?null:(b0(a,g,o),I0(a,Pe()),a.callbackNode!=null&&a.callbackNode===d?z0.bind(null,a):null)}function P0(a,o){if(Rc())return null;b0(a,o,!0)}function l_(){y_(function(){(Gt&6)!==0?ze(ue,i_):F0()})}function Wh(){if(yi===0){var a=$l;a===0&&(a=Ve,Ve<<=1,(Ve&261888)===0&&(Ve=256)),yi=a}return yi}function U0(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:ti(""+a)}function q0(a,o){var d=o.ownerDocument.createElement("input");return d.name=o.name,d.value=o.value,a.id&&d.setAttribute("form",a.id),o.parentNode.insertBefore(d,o),a=new FormData(a),d.parentNode.removeChild(d),a}function s_(a,o,d,g,b){if(o==="submit"&&d&&d.stateNode===b){var E=U0((b[yn]||null).action),R=g.submitter;R&&(o=(o=R[yn]||null)?U0(o.formAction):R.getAttribute("formAction"),o!==null&&(E=o,R=null));var j=new Vu("action","action",null,g,b);a.push({event:j,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(yi!==0){var Z=R?q0(b,R):new FormData(b);yh(d,{pending:!0,data:Z,method:b.method,action:E},null,Z)}}else typeof E=="function"&&(j.preventDefault(),Z=R?q0(b,R):new FormData(b),yh(d,{pending:!0,data:Z,method:b.method,action:E},E,Z))},currentTarget:b}]})}}for(var Jh=0;Jh<Ld.length;Jh++){var ev=Ld[Jh],o_=ev.toLowerCase(),u_=ev[0].toUpperCase()+ev.slice(1);la(o_,"on"+u_)}la(yy,"onAnimationEnd"),la(by,"onAnimationIteration"),la(Ey,"onAnimationStart"),la("dblclick","onDoubleClick"),la("focusin","onFocus"),la("focusout","onBlur"),la(TA,"onTransitionRun"),la(DA,"onTransitionStart"),la(AA,"onTransitionCancel"),la(xy,"onTransitionEnd"),ie("onMouseEnter",["mouseout","mouseover"]),ie("onMouseLeave",["mouseout","mouseover"]),ie("onPointerEnter",["pointerout","pointerover"]),ie("onPointerLeave",["pointerout","pointerover"]),oe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oe("onBeforeInput",["compositionend","keypress","textInput","paste"]),oe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var No="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(" "),c_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(No));function H0(a,o){o=(o&4)!==0;for(var d=0;d<a.length;d++){var g=a[d],b=g.event;g=g.listeners;e:{var E=void 0;if(o)for(var R=g.length-1;0<=R;R--){var j=g[R],Z=j.instance,ve=j.currentTarget;if(j=j.listener,Z!==E&&b.isPropagationStopped())break e;E=j,b.currentTarget=ve;try{E(b)}catch(Se){Yu(Se)}b.currentTarget=null,E=Z}else for(R=0;R<g.length;R++){if(j=g[R],Z=j.instance,ve=j.currentTarget,j=j.listener,Z!==E&&b.isPropagationStopped())break e;E=j,b.currentTarget=ve;try{E(b)}catch(Se){Yu(Se)}b.currentTarget=null,E=Z}}}}function _t(a,o){var d=o[Sn];d===void 0&&(d=o[Sn]=new Set);var g=a+"__bubble";d.has(g)||(j0(o,a,2,!1),d.add(g))}function tv(a,o,d){var g=0;o&&(g|=4),j0(d,a,g,o)}var Bc="_reactListening"+Math.random().toString(36).slice(2);function nv(a){if(!a[Bc]){a[Bc]=!0,Ja.forEach(function(d){d!=="selectionchange"&&(c_.has(d)||tv(d,!1,a),tv(d,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[Bc]||(o[Bc]=!0,tv("selectionchange",!1,o))}}function j0(a,o,d,g){switch(yE(o)){case 2:var b=z_;break;case 8:b=P_;break;default:b=mv}d=b.bind(null,o,d,a),b=void 0,!wd||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),g?b!==void 0?a.addEventListener(o,d,{capture:!0,passive:b}):a.addEventListener(o,d,!0):b!==void 0?a.addEventListener(o,d,{passive:b}):a.addEventListener(o,d,!1)}function rv(a,o,d,g,b){var E=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var R=g.tag;if(R===3||R===4){var j=g.stateNode.containerInfo;if(j===b)break;if(R===4)for(R=g.return;R!==null;){var Z=R.tag;if((Z===3||Z===4)&&R.stateNode.containerInfo===b)return;R=R.return}for(;j!==null;){if(R=Cn(j),R===null)return;if(Z=R.tag,Z===5||Z===6||Z===26||Z===27){g=E=R;continue e}j=j.parentNode}}g=g.return}qu(function(){var ve=E,Se=xt(d),_e=[];e:{var ge=wy.get(a);if(ge!==void 0){var be=Vu,rt=a;switch(a){case"keypress":if(ju(d)===0)break e;case"keydown":case"keyup":be=rA;break;case"focusin":rt="focus",be=Dd;break;case"focusout":rt="blur",be=Dd;break;case"beforeblur":case"afterblur":be=Dd;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":be=Qm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":be=VD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":be=lA;break;case yy:case by:case Ey:be=YD;break;case xy:be=oA;break;case"scroll":case"scrollend":be=jD;break;case"wheel":be=cA;break;case"copy":case"cut":case"paste":be=ZD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":be=Jm;break;case"toggle":case"beforetoggle":be=dA}var vt=(o&4)!==0,en=!vt&&(a==="scroll"||a==="scrollend"),ae=vt?ge!==null?ge+"Capture":null:ge;vt=[];for(var W=ve,he;W!==null;){var De=W;if(he=De.stateNode,De=De.tag,De!==5&&De!==26&&De!==27||he===null||ae===null||(De=Qs(W,ae),De!=null&&vt.push(Ro(W,De,he))),en)break;W=W.return}0<vt.length&&(ge=new be(ge,rt,null,d,Se),_e.push({event:ge,listeners:vt}))}}if((o&7)===0){e:{if(ge=a==="mouseover"||a==="pointerover",be=a==="mouseout"||a==="pointerout",ge&&d!==at&&(rt=d.relatedTarget||d.fromElement)&&(Cn(rt)||rt[Vn]))break e;if((be||ge)&&(ge=Se.window===Se?Se:(ge=Se.ownerDocument)?ge.defaultView||ge.parentWindow:window,be?(rt=d.relatedTarget||d.toElement,be=ve,rt=rt?Cn(rt):null,rt!==null&&(en=l(rt),vt=rt.tag,rt!==en||vt!==5&&vt!==27&&vt!==6)&&(rt=null)):(be=null,rt=ve),be!==rt)){if(vt=Qm,De="onMouseLeave",ae="onMouseEnter",W="mouse",(a==="pointerout"||a==="pointerover")&&(vt=Jm,De="onPointerLeave",ae="onPointerEnter",W="pointer"),en=be==null?ge:vr(be),he=rt==null?ge:vr(rt),ge=new vt(De,W+"leave",be,d,Se),ge.target=en,ge.relatedTarget=he,De=null,Cn(Se)===ve&&(vt=new vt(ae,W+"enter",rt,d,Se),vt.target=he,vt.relatedTarget=en,De=vt),en=De,be&&rt)t:{for(vt=f_,ae=be,W=rt,he=0,De=ae;De;De=vt(De))he++;De=0;for(var ct=W;ct;ct=vt(ct))De++;for(;0<he-De;)ae=vt(ae),he--;for(;0<De-he;)W=vt(W),De--;for(;he--;){if(ae===W||W!==null&&ae===W.alternate){vt=ae;break t}ae=vt(ae),W=vt(W)}vt=null}else vt=null;be!==null&&G0(_e,ge,be,vt,!1),rt!==null&&en!==null&&G0(_e,en,rt,vt,!0)}}e:{if(ge=ve?vr(ve):window,be=ge.nodeName&&ge.nodeName.toLowerCase(),be==="select"||be==="input"&&ge.type==="file")var qt=sy;else if(iy(ge))if(oy)qt=wA;else{qt=EA;var it=bA}else be=ge.nodeName,!be||be.toLowerCase()!=="input"||ge.type!=="checkbox"&&ge.type!=="radio"?ve&&ei(ve.elementType)&&(qt=sy):qt=xA;if(qt&&(qt=qt(a,ve))){ly(_e,qt,d,Se);break e}it&&it(a,ge,ve),a==="focusout"&&ve&&ge.type==="number"&&ve.memoizedProps.value!=null&&Ll(ge,"number",ge.value)}switch(it=ve?vr(ve):window,a){case"focusin":(iy(it)||it.contentEditable==="true")&&(zl=it,Md=ve,io=null);break;case"focusout":io=Md=zl=null;break;case"mousedown":Od=!0;break;case"contextmenu":case"mouseup":case"dragend":Od=!1,py(_e,d,Se);break;case"selectionchange":if(CA)break;case"keydown":case"keyup":py(_e,d,Se)}var St;if(_d)e:{switch(a){case"compositionstart":var Mt="onCompositionStart";break e;case"compositionend":Mt="onCompositionEnd";break e;case"compositionupdate":Mt="onCompositionUpdate";break e}Mt=void 0}else Il?ry(a,d)&&(Mt="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(Mt="onCompositionStart");Mt&&(ey&&d.locale!=="ko"&&(Il||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&Il&&(St=Xm()):(ni=Se,Sd="value"in ni?ni.value:ni.textContent,Il=!0)),it=Lc(ve,Mt),0<it.length&&(Mt=new Wm(Mt,a,null,d,Se),_e.push({event:Mt,listeners:it}),St?Mt.data=St:(St=ay(d),St!==null&&(Mt.data=St)))),(St=vA?gA(a,d):pA(a,d))&&(Mt=Lc(ve,"onBeforeInput"),0<Mt.length&&(it=new Wm("onBeforeInput","beforeinput",null,d,Se),_e.push({event:it,listeners:Mt}),it.data=St)),s_(_e,a,ve,d,Se)}H0(_e,o)})}function Ro(a,o,d){return{instance:a,listener:o,currentTarget:d}}function Lc(a,o){for(var d=o+"Capture",g=[];a!==null;){var b=a,E=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||E===null||(b=Qs(a,d),b!=null&&g.unshift(Ro(a,b,E)),b=Qs(a,o),b!=null&&g.push(Ro(a,b,E))),a.tag===3)return g;a=a.return}return[]}function f_(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function G0(a,o,d,g,b){for(var E=o._reactName,R=[];d!==null&&d!==g;){var j=d,Z=j.alternate,ve=j.stateNode;if(j=j.tag,Z!==null&&Z===g)break;j!==5&&j!==26&&j!==27||ve===null||(Z=ve,b?(ve=Qs(d,E),ve!=null&&R.unshift(Ro(d,ve,Z))):b||(ve=Qs(d,E),ve!=null&&R.push(Ro(d,ve,Z)))),d=d.return}R.length!==0&&a.push({event:o,listeners:R})}var d_=/\r\n?/g,h_=/\u0000|\uFFFD/g;function V0(a){return(typeof a=="string"?a:""+a).replace(d_,`
|
|
9
|
+
`).replace(h_,"")}function $0(a,o){return o=V0(o),V0(a)===o}function Jt(a,o,d,g,b,E){switch(d){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||gt(a,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&>(a,""+g);break;case"className":Zn(a,"class",g);break;case"tabIndex":Zn(a,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Zn(a,d,g);break;case"style":Yt(a,g,E);break;case"data":if(o!=="object"){Zn(a,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||d!=="href")){a.removeAttribute(d);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(d);break}g=ti(""+g),a.setAttribute(d,g);break;case"action":case"formAction":if(typeof g=="function"){a.setAttribute(d,"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 E=="function"&&(d==="formAction"?(o!=="input"&&Jt(a,o,"name",b.name,b,null),Jt(a,o,"formEncType",b.formEncType,b,null),Jt(a,o,"formMethod",b.formMethod,b,null),Jt(a,o,"formTarget",b.formTarget,b,null)):(Jt(a,o,"encType",b.encType,b,null),Jt(a,o,"method",b.method,b,null),Jt(a,o,"target",b.target,b,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){a.removeAttribute(d);break}g=ti(""+g),a.setAttribute(d,g);break;case"onClick":g!=null&&(a.onclick=qe);break;case"onScroll":g!=null&&_t("scroll",a);break;case"onScrollEnd":g!=null&&_t("scrollend",a);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":a.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){a.removeAttribute("xlink:href");break}d=ti(""+g),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(d,""+g):a.removeAttribute(d);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":g&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":g===!0?a.setAttribute(d,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?a.setAttribute(d,g):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?a.setAttribute(d,g):a.removeAttribute(d);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?a.removeAttribute(d):a.setAttribute(d,g);break;case"popover":_t("beforetoggle",a),_t("toggle",a),Qt(a,"popover",g);break;case"xlinkActuate":Qn(a,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Qn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Qn(a,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Qn(a,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Qn(a,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Qn(a,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Qn(a,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Qn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Qn(a,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Qt(a,"is",g);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=_a.get(d)||d,Qt(a,d,g))}}function av(a,o,d,g,b,E){switch(d){case"style":Yt(a,g,E);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof g=="string"?gt(a,g):(typeof g=="number"||typeof g=="bigint")&>(a,""+g);break;case"onScroll":g!=null&&_t("scroll",a);break;case"onScrollEnd":g!=null&&_t("scrollend",a);break;case"onClick":g!=null&&(a.onclick=qe);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ia.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),o=d.slice(2,b?d.length-7:void 0),E=a[yn]||null,E=E!=null?E[d]:null,typeof E=="function"&&a.removeEventListener(o,E,b),typeof g=="function")){typeof E!="function"&&E!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(o,g,b);break e}d in a?a[d]=g:g===!0?a.setAttribute(d,""):Qt(a,d,g)}}}function nr(a,o,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_t("error",a),_t("load",a);var g=!1,b=!1,E;for(E in d)if(d.hasOwnProperty(E)){var R=d[E];if(R!=null)switch(E){case"src":g=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Jt(a,o,E,R,d,null)}}b&&Jt(a,o,"srcSet",d.srcSet,d,null),g&&Jt(a,o,"src",d.src,d,null);return;case"input":_t("invalid",a);var j=E=R=b=null,Z=null,ve=null;for(g in d)if(d.hasOwnProperty(g)){var Se=d[g];if(Se!=null)switch(g){case"name":b=Se;break;case"type":R=Se;break;case"checked":Z=Se;break;case"defaultChecked":ve=Se;break;case"value":E=Se;break;case"defaultValue":j=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(r(137,o));break;default:Jt(a,o,g,Se,d,null)}}Zi(a,E,j,Z,ve,R,b,!1);return;case"select":_t("invalid",a),g=R=E=null;for(b in d)if(d.hasOwnProperty(b)&&(j=d[b],j!=null))switch(b){case"value":E=j;break;case"defaultValue":R=j;break;case"multiple":g=j;default:Jt(a,o,b,j,d,null)}o=E,d=R,a.multiple=!!g,o!=null?Wn(a,!!g,o,!1):d!=null&&Wn(a,!!g,d,!0);return;case"textarea":_t("invalid",a),E=b=g=null;for(R in d)if(d.hasOwnProperty(R)&&(j=d[R],j!=null))switch(R){case"value":g=j;break;case"defaultValue":b=j;break;case"children":E=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(r(91));break;default:Jt(a,o,R,j,d,null)}Fl(a,g,b,E);return;case"option":for(Z in d)d.hasOwnProperty(Z)&&(g=d[Z],g!=null)&&(Z==="selected"?a.selected=g&&typeof g!="function"&&typeof g!="symbol":Jt(a,o,Z,g,d,null));return;case"dialog":_t("beforetoggle",a),_t("toggle",a),_t("cancel",a),_t("close",a);break;case"iframe":case"object":_t("load",a);break;case"video":case"audio":for(g=0;g<No.length;g++)_t(No[g],a);break;case"image":_t("error",a),_t("load",a);break;case"details":_t("toggle",a);break;case"embed":case"source":case"link":_t("error",a),_t("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ve in d)if(d.hasOwnProperty(ve)&&(g=d[ve],g!=null))switch(ve){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Jt(a,o,ve,g,d,null)}return;default:if(ei(o)){for(Se in d)d.hasOwnProperty(Se)&&(g=d[Se],g!==void 0&&av(a,o,Se,g,d,void 0));return}}for(j in d)d.hasOwnProperty(j)&&(g=d[j],g!=null&&Jt(a,o,j,g,d,null))}function v_(a,o,d,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,E=null,R=null,j=null,Z=null,ve=null,Se=null;for(be in d){var _e=d[be];if(d.hasOwnProperty(be)&&_e!=null)switch(be){case"checked":break;case"value":break;case"defaultValue":Z=_e;default:g.hasOwnProperty(be)||Jt(a,o,be,null,g,_e)}}for(var ge in g){var be=g[ge];if(_e=d[ge],g.hasOwnProperty(ge)&&(be!=null||_e!=null))switch(ge){case"type":E=be;break;case"name":b=be;break;case"checked":ve=be;break;case"defaultChecked":Se=be;break;case"value":R=be;break;case"defaultValue":j=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,o));break;default:be!==_e&&Jt(a,o,ge,be,g,_e)}}Ys(a,R,j,Z,ve,Se,E,b);return;case"select":be=R=j=ge=null;for(E in d)if(Z=d[E],d.hasOwnProperty(E)&&Z!=null)switch(E){case"value":break;case"multiple":be=Z;default:g.hasOwnProperty(E)||Jt(a,o,E,null,g,Z)}for(b in g)if(E=g[b],Z=d[b],g.hasOwnProperty(b)&&(E!=null||Z!=null))switch(b){case"value":ge=E;break;case"defaultValue":j=E;break;case"multiple":R=E;default:E!==Z&&Jt(a,o,b,E,g,Z)}o=j,d=R,g=be,ge!=null?Wn(a,!!d,ge,!1):!!g!=!!d&&(o!=null?Wn(a,!!d,o,!0):Wn(a,!!d,d?[]:"",!1));return;case"textarea":be=ge=null;for(j in d)if(b=d[j],d.hasOwnProperty(j)&&b!=null&&!g.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Jt(a,o,j,null,g,b)}for(R in g)if(b=g[R],E=d[R],g.hasOwnProperty(R)&&(b!=null||E!=null))switch(R){case"value":ge=b;break;case"defaultValue":be=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==E&&Jt(a,o,R,b,g,E)}Pu(a,ge,be);return;case"option":for(var rt in d)ge=d[rt],d.hasOwnProperty(rt)&&ge!=null&&!g.hasOwnProperty(rt)&&(rt==="selected"?a.selected=!1:Jt(a,o,rt,null,g,ge));for(Z in g)ge=g[Z],be=d[Z],g.hasOwnProperty(Z)&&ge!==be&&(ge!=null||be!=null)&&(Z==="selected"?a.selected=ge&&typeof ge!="function"&&typeof ge!="symbol":Jt(a,o,Z,ge,g,be));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 vt in d)ge=d[vt],d.hasOwnProperty(vt)&&ge!=null&&!g.hasOwnProperty(vt)&&Jt(a,o,vt,null,g,ge);for(ve in g)if(ge=g[ve],be=d[ve],g.hasOwnProperty(ve)&&ge!==be&&(ge!=null||be!=null))switch(ve){case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,o));break;default:Jt(a,o,ve,ge,g,be)}return;default:if(ei(o)){for(var en in d)ge=d[en],d.hasOwnProperty(en)&&ge!==void 0&&!g.hasOwnProperty(en)&&av(a,o,en,void 0,g,ge);for(Se in g)ge=g[Se],be=d[Se],!g.hasOwnProperty(Se)||ge===be||ge===void 0&&be===void 0||av(a,o,Se,ge,g,be);return}}for(var ae in d)ge=d[ae],d.hasOwnProperty(ae)&&ge!=null&&!g.hasOwnProperty(ae)&&Jt(a,o,ae,null,g,ge);for(_e in g)ge=g[_e],be=d[_e],!g.hasOwnProperty(_e)||ge===be||ge==null&&be==null||Jt(a,o,_e,ge,g,be)}function K0(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function g_(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,d=performance.getEntriesByType("resource"),g=0;g<d.length;g++){var b=d[g],E=b.transferSize,R=b.initiatorType,j=b.duration;if(E&&j&&K0(R)){for(R=0,j=b.responseEnd,g+=1;g<d.length;g++){var Z=d[g],ve=Z.startTime;if(ve>j)break;var Se=Z.transferSize,_e=Z.initiatorType;Se&&K0(_e)&&(Z=Z.responseEnd,R+=Se*(Z<j?1:(j-ve)/(Z-ve)))}if(--g,o+=8*(E+R)/(b.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var iv=null,lv=null;function Fc(a){return a.nodeType===9?a:a.ownerDocument}function Y0(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function X0(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function sv(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var ov=null;function p_(){var a=window.event;return a&&a.type==="popstate"?a===ov?!1:(ov=a,!0):(ov=null,!1)}var Z0=typeof setTimeout=="function"?setTimeout:void 0,m_=typeof clearTimeout=="function"?clearTimeout:void 0,Q0=typeof Promise=="function"?Promise:void 0,y_=typeof queueMicrotask=="function"?queueMicrotask:typeof Q0<"u"?function(a){return Q0.resolve(null).then(a).catch(b_)}:Z0;function b_(a){setTimeout(function(){throw a})}function bi(a){return a==="head"}function W0(a,o){var d=o,g=0;do{var b=d.nextSibling;if(a.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(g===0){a.removeChild(b),fs(o);return}g--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")g++;else if(d==="html")Mo(a.ownerDocument.documentElement);else if(d==="head"){d=a.ownerDocument.head,Mo(d);for(var E=d.firstChild;E;){var R=E.nextSibling,j=E.nodeName;E[rn]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&E.rel.toLowerCase()==="stylesheet"||d.removeChild(E),E=R}}else d==="body"&&Mo(a.ownerDocument.body);d=b}while(d);fs(o)}function J0(a,o){var d=a;a=0;do{var g=d.nextSibling;if(d.nodeType===1?o?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(o?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),g&&g.nodeType===8)if(d=g.data,d==="/$"){if(a===0)break;a--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||a++;d=g}while(d)}function uv(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var d=o;switch(o=o.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":uv(d),ha(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function E_(a,o,d,g){for(;a.nodeType===1;){var b=d;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(g){if(!a[rn])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(E=a.getAttribute("rel"),E==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(E!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(E=a.getAttribute("src"),(E!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&E&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var E=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===E)return a}else return a;if(a=Jr(a.nextSibling),a===null)break}return null}function x_(a,o,d){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=Jr(a.nextSibling),a===null))return null;return a}function eE(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Jr(a.nextSibling),a===null))return null;return a}function cv(a){return a.data==="$?"||a.data==="$~"}function fv(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function w_(a,o){var d=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||d.readyState!=="loading")o();else{var g=function(){o(),d.removeEventListener("DOMContentLoaded",g)};d.addEventListener("DOMContentLoaded",g),a._reactRetry=g}}function Jr(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var dv=null;function tE(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="/$"||d==="/&"){if(o===0)return Jr(a.nextSibling);o--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||o++}a=a.nextSibling}return null}function nE(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(o===0)return a;o--}else d!=="/$"&&d!=="/&"||o++}a=a.previousSibling}return null}function rE(a,o,d){switch(o=Fc(d),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Mo(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);ha(a)}var ea=new Map,aE=new Set;function Ic(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Ga=H.d;H.d={f:S_,r:C_,D:T_,C:D_,L:A_,m:__,X:N_,S:k_,M:R_};function S_(){var a=Ga.f(),o=_c();return a||o}function C_(a){var o=sr(a);o!==null&&o.tag===5&&o.type==="form"?xb(o):Ga.r(a)}var os=typeof document>"u"?null:document;function iE(a,o,d){var g=os;if(g&&typeof o=="string"&&o){var b=xr(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),aE.has(b)||(aE.add(b),a={rel:a,crossOrigin:d,href:o},g.querySelector(b)===null&&(o=g.createElement("link"),nr(o,"link",a),fn(o),g.head.appendChild(o)))}}function T_(a){Ga.D(a),iE("dns-prefetch",a,null)}function D_(a,o){Ga.C(a,o),iE("preconnect",a,o)}function A_(a,o,d){Ga.L(a,o,d);var g=os;if(g&&a&&o){var b='link[rel="preload"][as="'+xr(o)+'"]';o==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+xr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+xr(d.imageSizes)+'"]')):b+='[href="'+xr(a)+'"]';var E=b;switch(o){case"style":E=us(a);break;case"script":E=cs(a)}ea.has(E)||(a=v({rel:"preload",href:o==="image"&&d&&d.imageSrcSet?void 0:a,as:o},d),ea.set(E,a),g.querySelector(b)!==null||o==="style"&&g.querySelector(Oo(E))||o==="script"&&g.querySelector(Bo(E))||(o=g.createElement("link"),nr(o,"link",a),fn(o),g.head.appendChild(o)))}}function __(a,o){Ga.m(a,o);var d=os;if(d&&a){var g=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+xr(g)+'"][href="'+xr(a)+'"]',E=b;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=cs(a)}if(!ea.has(E)&&(a=v({rel:"modulepreload",href:a},o),ea.set(E,a),d.querySelector(b)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Bo(E)))return}g=d.createElement("link"),nr(g,"link",a),fn(g),d.head.appendChild(g)}}}function k_(a,o,d){Ga.S(a,o,d);var g=os;if(g&&a){var b=Vr(g).hoistableStyles,E=us(a);o=o||"default";var R=b.get(E);if(!R){var j={loading:0,preload:null};if(R=g.querySelector(Oo(E)))j.loading=5;else{a=v({rel:"stylesheet",href:a,"data-precedence":o},d),(d=ea.get(E))&&hv(a,d);var Z=R=g.createElement("link");fn(Z),nr(Z,"link",a),Z._p=new Promise(function(ve,Se){Z.onload=ve,Z.onerror=Se}),Z.addEventListener("load",function(){j.loading|=1}),Z.addEventListener("error",function(){j.loading|=2}),j.loading|=4,zc(R,o,g)}R={type:"stylesheet",instance:R,count:1,state:j},b.set(E,R)}}}function N_(a,o){Ga.X(a,o);var d=os;if(d&&a){var g=Vr(d).hoistableScripts,b=cs(a),E=g.get(b);E||(E=d.querySelector(Bo(b)),E||(a=v({src:a,async:!0},o),(o=ea.get(b))&&vv(a,o),E=d.createElement("script"),fn(E),nr(E,"link",a),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},g.set(b,E))}}function R_(a,o){Ga.M(a,o);var d=os;if(d&&a){var g=Vr(d).hoistableScripts,b=cs(a),E=g.get(b);E||(E=d.querySelector(Bo(b)),E||(a=v({src:a,async:!0,type:"module"},o),(o=ea.get(b))&&vv(a,o),E=d.createElement("script"),fn(E),nr(E,"link",a),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},g.set(b,E))}}function lE(a,o,d,g){var b=(b=se.current)?Ic(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(o=us(d.href),d=Vr(b).hoistableStyles,g=d.get(o),g||(g={type:"style",instance:null,count:0,state:null},d.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=us(d.href);var E=Vr(b).hoistableStyles,R=E.get(a);if(R||(b=b.ownerDocument||b,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(a,R),(E=b.querySelector(Oo(a)))&&!E._p&&(R.instance=E,R.state.loading=5),ea.has(a)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},ea.set(a,d),E||M_(b,a,d,R.state))),o&&g===null)throw Error(r(528,""));return R}if(o&&g!==null)throw Error(r(529,""));return null;case"script":return o=d.async,d=d.src,typeof d=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=cs(d),d=Vr(b).hoistableScripts,g=d.get(o),g||(g={type:"script",instance:null,count:0,state:null},d.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function us(a){return'href="'+xr(a)+'"'}function Oo(a){return'link[rel="stylesheet"]['+a+"]"}function sE(a){return v({},a,{"data-precedence":a.precedence,precedence:null})}function M_(a,o,d,g){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?g.loading=1:(o=a.createElement("link"),g.preload=o,o.addEventListener("load",function(){return g.loading|=1}),o.addEventListener("error",function(){return g.loading|=2}),nr(o,"link",d),fn(o),a.head.appendChild(o))}function cs(a){return'[src="'+xr(a)+'"]'}function Bo(a){return"script[async]"+a}function oE(a,o,d){if(o.count++,o.instance===null)switch(o.type){case"style":var g=a.querySelector('style[data-href~="'+xr(d.href)+'"]');if(g)return o.instance=g,fn(g),g;var b=v({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return g=(a.ownerDocument||a).createElement("style"),fn(g),nr(g,"style",b),zc(g,d.precedence,a),o.instance=g;case"stylesheet":b=us(d.href);var E=a.querySelector(Oo(b));if(E)return o.state.loading|=4,o.instance=E,fn(E),E;g=sE(d),(b=ea.get(b))&&hv(g,b),E=(a.ownerDocument||a).createElement("link"),fn(E);var R=E;return R._p=new Promise(function(j,Z){R.onload=j,R.onerror=Z}),nr(E,"link",g),o.state.loading|=4,zc(E,d.precedence,a),o.instance=E;case"script":return E=cs(d.src),(b=a.querySelector(Bo(E)))?(o.instance=b,fn(b),b):(g=d,(b=ea.get(E))&&(g=v({},d),vv(g,b)),a=a.ownerDocument||a,b=a.createElement("script"),fn(b),nr(b,"link",g),a.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(g=o.instance,o.state.loading|=4,zc(g,d.precedence,a));return o.instance}function zc(a,o,d){for(var g=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=g.length?g[g.length-1]:null,E=b,R=0;R<g.length;R++){var j=g[R];if(j.dataset.precedence===o)E=j;else if(E!==b)break}E?E.parentNode.insertBefore(a,E.nextSibling):(o=d.nodeType===9?d.head:d,o.insertBefore(a,o.firstChild))}function hv(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function vv(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var Pc=null;function uE(a,o,d){if(Pc===null){var g=new Map,b=Pc=new Map;b.set(d,g)}else b=Pc,g=b.get(d),g||(g=new Map,b.set(d,g));if(g.has(a))return g;for(g.set(a,null),d=d.getElementsByTagName(a),b=0;b<d.length;b++){var E=d[b];if(!(E[rn]||E[Vt]||a==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var R=E.getAttribute(o)||"";R=a+R;var j=g.get(R);j?j.push(E):g.set(R,[E])}}return g}function cE(a,o,d){a=a.ownerDocument||a,a.head.insertBefore(d,o==="title"?a.querySelector("head > title"):null)}function O_(a,o,d){if(d===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(a=o.disabled,typeof o.precedence=="string"&&a==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function fE(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function B_(a,o,d,g){if(d.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=us(g.href),E=o.querySelector(Oo(b));if(E){o=E._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Uc.bind(a),o.then(a,a)),d.state.loading|=4,d.instance=E,fn(E);return}E=o.ownerDocument||o,g=sE(g),(b=ea.get(b))&&hv(g,b),E=E.createElement("link"),fn(E);var R=E;R._p=new Promise(function(j,Z){R.onload=j,R.onerror=Z}),nr(E,"link",g),d.instance=E}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(d,o),(o=d.state.preload)&&(d.state.loading&3)===0&&(a.count++,d=Uc.bind(a),o.addEventListener("load",d),o.addEventListener("error",d))}}var gv=0;function L_(a,o){return a.stylesheets&&a.count===0&&Hc(a,a.stylesheets),0<a.count||0<a.imgCount?function(d){var g=setTimeout(function(){if(a.stylesheets&&Hc(a,a.stylesheets),a.unsuspend){var E=a.unsuspend;a.unsuspend=null,E()}},6e4+o);0<a.imgBytes&&gv===0&&(gv=62500*g_());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Hc(a,a.stylesheets),a.unsuspend)){var E=a.unsuspend;a.unsuspend=null,E()}},(a.imgBytes>gv?50:800)+o);return a.unsuspend=d,function(){a.unsuspend=null,clearTimeout(g),clearTimeout(b)}}:null}function Uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hc(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var qc=null;function Hc(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,qc=new Map,o.forEach(F_,a),qc=null,Uc.call(a))}function F_(a,o){if(!(o.state.loading&4)){var d=qc.get(a);if(d)var g=d.get(null);else{d=new Map,qc.set(a,d);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<b.length;E++){var R=b[E];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(d.set(R.dataset.precedence,R),g=R)}g&&d.set(null,g)}b=o.instance,R=b.getAttribute("data-precedence"),E=d.get(R)||g,E===g&&d.set(null,b),d.set(R,b),this.count++,g=Uc.bind(this),b.addEventListener("load",g),b.addEventListener("error",g),E?E.parentNode.insertBefore(b,E.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var Lo={$$typeof:T,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function I_(a,o,d,g,b,E,R,j,Z){this.tag=1,this.containerInfo=a,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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(null),this.identifierPrefix=g,this.onUncaughtError=b,this.onCaughtError=E,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function dE(a,o,d,g,b,E,R,j,Z,ve,Se,_e){return a=new I_(a,o,d,R,Z,ve,Se,_e,j),o=1,E===!0&&(o|=24),E=Lr(3,null,null,o),a.current=E,E.stateNode=a,o=Yd(),o.refCount++,a.pooledCache=o,o.refCount++,E.memoizedState={element:g,isDehydrated:d,cache:o},Wd(E),a}function hE(a){return a?(a=ql,a):ql}function vE(a,o,d,g,b,E){b=hE(b),g.context===null?g.context=b:g.pendingContext=b,g=oi(o),g.payload={element:d},E=E===void 0?null:E,E!==null&&(g.callback=E),d=ui(a,g,o),d!==null&&(Ar(d,a,o),ho(d,a,o))}function gE(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<o?d:o}}function pv(a,o){gE(a,o),(a=a.alternate)&&gE(a,o)}function pE(a){if(a.tag===13||a.tag===31){var o=el(a,67108864);o!==null&&Ar(o,a,67108864),pv(a,67108864)}}function mE(a){if(a.tag===13||a.tag===31){var o=Ur();o=yt(o);var d=el(a,o);d!==null&&Ar(d,a,o),pv(a,o)}}var jc=!0;function z_(a,o,d,g){var b=q.T;q.T=null;var E=H.p;try{H.p=2,mv(a,o,d,g)}finally{H.p=E,q.T=b}}function P_(a,o,d,g){var b=q.T;q.T=null;var E=H.p;try{H.p=8,mv(a,o,d,g)}finally{H.p=E,q.T=b}}function mv(a,o,d,g){if(jc){var b=yv(g);if(b===null)rv(a,o,g,Gc,d),bE(a,g);else if(q_(b,a,o,d,g))g.stopPropagation();else if(bE(a,g),o&4&&-1<U_.indexOf(a)){for(;b!==null;){var E=sr(b);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var R=ut(E.pendingLanes);if(R!==0){var j=E;for(j.pendingLanes|=2,j.entangledLanes|=2;R;){var Z=1<<31-ce(R);j.entanglements[1]|=Z,R&=~Z}ma(E),(Gt&6)===0&&(Dc=Pe()+500,ko(0))}}break;case 31:case 13:j=el(E,2),j!==null&&Ar(j,E,2),_c(),pv(E,2)}if(E=yv(g),E===null&&rv(a,o,g,Gc,d),E===b)break;b=E}b!==null&&g.stopPropagation()}else rv(a,o,g,null,d)}}function yv(a){return a=xt(a),bv(a)}var Gc=null;function bv(a){if(Gc=null,a=Cn(a),a!==null){var o=l(a);if(o===null)a=null;else{var d=o.tag;if(d===13){if(a=s(o),a!==null)return a;a=null}else if(d===31){if(a=u(o),a!==null)return a;a=null}else if(d===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Gc=a,null}function yE(a){switch(a){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(pt()){case ue:return 2;case Te:return 8;case Oe:case Xe:return 32;case Le:return 268435456;default:return 32}default:return 32}}var Ev=!1,Ei=null,xi=null,wi=null,Fo=new Map,Io=new Map,Si=[],U_="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 bE(a,o){switch(a){case"focusin":case"focusout":Ei=null;break;case"dragenter":case"dragleave":xi=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":Fo.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(o.pointerId)}}function zo(a,o,d,g,b,E){return a===null||a.nativeEvent!==E?(a={blockedOn:o,domEventName:d,eventSystemFlags:g,nativeEvent:E,targetContainers:[b]},o!==null&&(o=sr(o),o!==null&&pE(o)),a):(a.eventSystemFlags|=g,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function q_(a,o,d,g,b){switch(o){case"focusin":return Ei=zo(Ei,a,o,d,g,b),!0;case"dragenter":return xi=zo(xi,a,o,d,g,b),!0;case"mouseover":return wi=zo(wi,a,o,d,g,b),!0;case"pointerover":var E=b.pointerId;return Fo.set(E,zo(Fo.get(E)||null,a,o,d,g,b)),!0;case"gotpointercapture":return E=b.pointerId,Io.set(E,zo(Io.get(E)||null,a,o,d,g,b)),!0}return!1}function EE(a){var o=Cn(a.target);if(o!==null){var d=l(o);if(d!==null){if(o=d.tag,o===13){if(o=s(d),o!==null){a.blockedOn=o,Gn(a.priority,function(){mE(d)});return}}else if(o===31){if(o=u(d),o!==null){a.blockedOn=o,Gn(a.priority,function(){mE(d)});return}}else if(o===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Vc(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var d=yv(a.nativeEvent);if(d===null){d=a.nativeEvent;var g=new d.constructor(d.type,d);at=g,d.target.dispatchEvent(g),at=null}else return o=sr(d),o!==null&&pE(o),a.blockedOn=d,!1;o.shift()}return!0}function xE(a,o,d){Vc(a)&&d.delete(o)}function H_(){Ev=!1,Ei!==null&&Vc(Ei)&&(Ei=null),xi!==null&&Vc(xi)&&(xi=null),wi!==null&&Vc(wi)&&(wi=null),Fo.forEach(xE),Io.forEach(xE)}function $c(a,o){a.blockedOn===o&&(a.blockedOn=null,Ev||(Ev=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,H_)))}var Kc=null;function wE(a){Kc!==a&&(Kc=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kc===a&&(Kc=null);for(var o=0;o<a.length;o+=3){var d=a[o],g=a[o+1],b=a[o+2];if(typeof g!="function"){if(bv(g||d)===null)continue;break}var E=sr(d);E!==null&&(a.splice(o,3),o-=3,yh(E,{pending:!0,data:b,method:d.method,action:g},g,b))}}))}function fs(a){function o(Z){return $c(Z,a)}Ei!==null&&$c(Ei,a),xi!==null&&$c(xi,a),wi!==null&&$c(wi,a),Fo.forEach(o),Io.forEach(o);for(var d=0;d<Si.length;d++){var g=Si[d];g.blockedOn===a&&(g.blockedOn=null)}for(;0<Si.length&&(d=Si[0],d.blockedOn===null);)EE(d),d.blockedOn===null&&Si.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(g=0;g<d.length;g+=3){var b=d[g],E=d[g+1],R=b[yn]||null;if(typeof E=="function")R||wE(d);else if(R){var j=null;if(E&&E.hasAttribute("formAction")){if(b=E,R=E[yn]||null)j=R.formAction;else if(bv(b)!==null)continue}else j=R.action;typeof j=="function"?d[g+1]=j:(d.splice(g,3),g-=3),wE(d)}}}function SE(){function a(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(R){return b=R})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),g||setTimeout(d,20)}function d(){if(!g&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(d,100),function(){g=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function xv(a){this._internalRoot=a}Yc.prototype.render=xv.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var d=o.current,g=Ur();vE(d,g,a,o,null,null)},Yc.prototype.unmount=xv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;vE(a.current,2,null,a,null,null),_c(),o[Vn]=null}};function Yc(a){this._internalRoot=a}Yc.prototype.unstable_scheduleHydration=function(a){if(a){var o=Bt();a={blockedOn:null,target:a,priority:o};for(var d=0;d<Si.length&&o!==0&&o<Si[d].priority;d++);Si.splice(d,0,a),d===0&&EE(a)}};var CE=e.version;if(CE!=="19.2.4")throw Error(r(527,CE,"19.2.4"));H.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=c(o),a=a!==null?h(a):null,a=a===null?null:a.stateNode,a};var j_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xc.isDisabled&&Xc.supportsFiber)try{G=Xc.inject(j_),te=Xc}catch{}}return Uo.createRoot=function(a,o){if(!i(a))throw Error(r(299));var d=!1,g="",b=Rb,E=Mb,R=Ob;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(E=o.onCaughtError),o.onRecoverableError!==void 0&&(R=o.onRecoverableError)),o=dE(a,1,!1,null,null,d,g,null,b,E,R,SE),a[Vn]=o.current,nv(a),new xv(o)},Uo.hydrateRoot=function(a,o,d){if(!i(a))throw Error(r(299));var g=!1,b="",E=Rb,R=Mb,j=Ob,Z=null;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(E=d.onUncaughtError),d.onCaughtError!==void 0&&(R=d.onCaughtError),d.onRecoverableError!==void 0&&(j=d.onRecoverableError),d.formState!==void 0&&(Z=d.formState)),o=dE(a,1,!0,o,d??null,g,b,Z,E,R,j,SE),o.context=hE(null),d=o.current,g=Ur(),g=yt(g),b=oi(g),b.callback=null,ui(d,b,g),d=g,o.current.lanes=d,ft(o,d),ma(o),a[Vn]=o.current,nv(a),new Yc(o)},Uo.version="19.2.4",Uo}var BE;function ek(){if(BE)return Cv.exports;BE=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(),Cv.exports=J_(),Cv.exports}var tk=ek();const nk=xu(tk);function rk(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleTimeString()}function ak({events:t,connected:e,error:n}){return _.jsxs("section",{className:"panel","aria-label":"Activity feed",children:[_.jsxs("h3",{className:"panel-heading",children:["Activity",_.jsx("span",{className:`activity-status-pill ${e?"is-live":"is-offline"}`,children:e?"live":"offline"})]}),n?_.jsx("p",{className:"text-error",children:n}):null,t.length===0?_.jsx("p",{className:"text-muted text-sm",children:e?"Waiting for ingest, compile, lint, or watch events.":"No activity stream available. Run `swarmvault watch` to see live events."}):_.jsx("div",{className:"activity-feed",role:"log","aria-live":"polite",children:t.map(r=>_.jsxs("article",{className:`activity-item activity-${r.level}`,children:[_.jsx("span",{className:"activity-time",children:rk(r.timestamp)}),_.jsxs("div",{children:[_.jsx("p",{className:"activity-message",children:r.message}),_.jsxs("p",{className:"activity-meta",children:[r.type,r.meta?.duration_ms?` Β· ${r.meta.duration_ms}ms`:null]})]})]},r.id))})]})}function LE(t){if(t===void 0)return"β";if(t===null)return"null";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function ik({changes:t}){return t.length?_.jsxs("table",{className:"diff-frontmatter",children:[_.jsx("thead",{children:_.jsxs("tr",{children:[_.jsx("th",{children:"Field"}),_.jsx("th",{children:"Before"}),_.jsx("th",{children:"After"})]})}),_.jsx("tbody",{children:t.map(e=>_.jsxs("tr",{className:e.protected?"is-protected":void 0,children:[_.jsxs("td",{className:"text-mono",children:[e.key,e.protected?_.jsx("span",{className:"label label-danger",children:" protected"}):null]}),_.jsx("td",{className:"text-mono text-sm",children:LE(e.before)}),_.jsx("td",{className:"text-mono text-sm",children:LE(e.after)})]},e.key))})]}):null}function lk({diff:t,warnings:e}){const[n,r]=Ee.useState("unified"),i=t.frontmatterChanges.filter(u=>u.protected),l=Ee.useRef(null),s=Ee.useRef(null);return Ee.useEffect(()=>{if(n!=="split")return;const u=l.current,f=s.current;if(!u||!f)return;let c=!1;const h=(m,y)=>{c||(c=!0,y.scrollTop=m.scrollTop,y.scrollLeft=m.scrollLeft,requestAnimationFrame(()=>{c=!1}))},v=()=>h(u,f),p=()=>h(f,u);return u.addEventListener("scroll",v),f.addEventListener("scroll",p),()=>{u.removeEventListener("scroll",v),f.removeEventListener("scroll",p)}},[n]),_.jsxs("div",{className:"diff-view",children:[e?.length?_.jsx("p",{className:"text-error text-sm",children:e.includes("protected_frontmatter_changed")?"Warning: protected frontmatter fields changed. Verify before accepting.":e.join(", ")}):null,_.jsx(ik,{changes:t.frontmatterChanges}),(i.length===0&&t.frontmatterChanges.length===0,null),_.jsxs("div",{className:"diff-toolbar",children:[_.jsxs("span",{className:"text-muted text-sm",children:["+",t.addedLines," / -",t.removedLines]}),_.jsxs("div",{className:"action-row",children:[_.jsx("button",{type:"button",className:`btn btn-ghost${n==="unified"?" is-active":""}`,onClick:()=>r("unified"),children:"Unified"}),_.jsx("button",{type:"button",className:`btn btn-ghost${n==="split"?" is-active":""}`,onClick:()=>r("split"),children:"Split"})]})]}),t.hunks.map(u=>_.jsxs("div",{className:"diff-hunk",children:[_.jsxs("div",{className:"diff-hunk-header text-mono text-sm",children:["@@ -",u.oldStart,",",u.oldLines," +",u.newStart,",",u.newLines," @@"]}),n==="unified"?_.jsx("pre",{className:"diff-unified",children:u.lines.map((f,c)=>_.jsxs("div",{className:`diff-line diff-${f.type}`,children:[_.jsx("span",{className:"diff-marker",children:f.type==="add"?"+":f.type==="remove"?"-":" "}),_.jsx("span",{className:"diff-text",children:f.value})]},`u-${c}`))}):_.jsxs("div",{className:"diff-split",children:[_.jsx("pre",{ref:l,className:"diff-column diff-column-before",children:u.lines.filter(f=>f.type!=="add").map((f,c)=>_.jsx("div",{className:`diff-line diff-${f.type}`,children:_.jsx("span",{className:"diff-text",children:f.value})},`b-${c}`))}),_.jsx("pre",{ref:s,className:"diff-column diff-column-after",children:u.lines.filter(f=>f.type!=="remove").map((f,c)=>_.jsx("div",{className:`diff-line diff-${f.type}`,children:_.jsx("span",{className:"diff-text",children:f.value})},`a-${c}`))})]})]},`hunk-${u.oldStart}-${u.newStart}`))]})}function sk(t){return t.replace(/\s+/g," ").trim().slice(0,220)}function ok({approvals:t,selectedApprovalId:e,onSelectApproval:n,approvalDetail:r,approvalError:i,actionError:l,busyAction:s,onReviewAction:u,onBulkReview:f,onOpenPage:c}){const[h,v]=Ee.useState("pending"),[p,m]=Ee.useState(""),[y,w]=Ee.useState(()=>new Set),S=Ee.useMemo(()=>{if(!r)return[];const k=p.trim().toLowerCase();return r.entries.filter(D=>!(h!=="all"&&D.status!==h||k&&!`${D.title} ${D.kind} ${D.changeType} ${D.nextPath??D.previousPath??""}`.toLowerCase().includes(k)))},[r,h,p]),x=S.filter(k=>k.status==="pending").map(k=>k.pageId),C=x.length>0&&x.every(k=>y.has(k)),T=k=>{w(D=>{const O=new Set(D);return O.has(k)?O.delete(k):O.add(k),O})},A=()=>{w(C?new Set:new Set(x))},N=k=>{!y.size||!f||(f([...y],k),w(new Set))};return _.jsxs("div",{children:[i?_.jsx("p",{className:"text-error",children:i}):null,l?_.jsx("p",{className:"text-error",children:l}):null,t.length?_.jsx("div",{className:"card-list",children:t.map(k=>_.jsxs("button",{type:"button",className:`result-card${e===k.approvalId?" is-active":""}`,onClick:()=>n(k.approvalId),children:[_.jsxs("span",{className:"label",children:["pending ",k.pendingCount]}),_.jsx("strong",{className:"card-title",children:k.approvalId}),_.jsxs("p",{className:"text-muted text-sm",children:["accepted ",k.acceptedCount," / rejected ",k.rejectedCount]})]},k.approvalId))}):_.jsx("p",{className:"text-muted text-sm",children:"No staged approval bundles."}),r?.entries.length?_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"list-filter-bar",style:{marginTop:8},children:[_.jsx("input",{type:"search",className:"input",placeholder:"Filter entriesβ¦",value:p,onChange:k=>m(k.target.value),"aria-label":"Filter approval entries"}),_.jsxs("select",{className:"input",value:h,onChange:k=>v(k.target.value),"aria-label":"Filter by status",style:{width:"auto"},children:[_.jsx("option",{value:"all",children:"All"}),_.jsx("option",{value:"pending",children:"Pending"}),_.jsx("option",{value:"accepted",children:"Accepted"}),_.jsx("option",{value:"rejected",children:"Rejected"})]})]}),y.size>0&&f?_.jsxs("div",{className:"bulk-toolbar",role:"toolbar","aria-label":"Bulk approval actions",children:[_.jsx("span",{className:"bulk-toolbar-count",children:y.size}),_.jsx("span",{className:"text-muted",children:"selected"}),_.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>N("accept"),children:"Accept all"}),_.jsx("button",{type:"button",className:"btn btn-danger",onClick:()=>N("reject"),children:"Reject all"}),_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>w(new Set),children:"Clear"})]}):null,x.length>0&&f?_.jsxs("label",{className:"checkbox-cell",style:{marginBottom:8},children:[_.jsx("input",{type:"checkbox",checked:C,onChange:A}),_.jsx("span",{className:"text-muted text-xs",children:"Select all pending"})]}):null,_.jsx("div",{className:"card-list",children:S.map(k=>_.jsx(uk,{entry:k,busyAction:s,onReviewAction:u,onOpenPage:c,selected:y.has(k.pageId),onToggleSelected:f?T:void 0},`${k.pageId}:${k.nextPath??k.previousPath??k.changeType}`))})]}):null]})}function uk({entry:t,busyAction:e,onReviewAction:n,onOpenPage:r,selected:i,onToggleSelected:l}){const[s,u]=Ee.useState(!1),f=!!t.structuredDiff?.hunks.length,c=t.warnings?.includes("protected_frontmatter_changed")??!1;return _.jsxs("article",{className:`card${i?" is-selected":""}`,children:[_.jsxs("div",{className:"card-row",children:[l&&t.status==="pending"?_.jsx("label",{className:"checkbox-cell",children:_.jsx("input",{type:"checkbox",checked:i,onChange:()=>l(t.pageId),"aria-label":`Select ${t.title}`})}):null,_.jsxs("span",{className:"label",children:[t.status," / ",t.changeType]})]}),_.jsx("strong",{className:"card-title",children:t.title}),_.jsx("p",{className:"text-mono text-sm",children:t.nextPath??t.previousPath}),c?_.jsx("p",{className:"text-error text-sm",children:"Warning: protected frontmatter fields changed."}):null,_.jsxs("div",{className:"action-row",children:[t.stagedContent?_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{r(t.nextPath??t.previousPath??"",t.pageId)},children:"Open page"}):null,f?_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>u(h=>!h),children:s?"Hide diff":"View diff"}):null]}),s&&t.structuredDiff?_.jsx(lk,{diff:t.structuredDiff,warnings:t.warnings}):null,t.status==="pending"?_.jsxs("div",{className:"action-row",children:[_.jsx("button",{type:"button",className:"btn btn-primary",disabled:e===`accept:${t.pageId}`,onClick:()=>n(t.pageId,"accept"),children:"Accept"}),_.jsx("button",{type:"button",className:"btn btn-danger",disabled:e===`reject:${t.pageId}`,onClick:()=>n(t.pageId,"reject"),children:"Reject"})]}):_.jsx("p",{className:"text-secondary text-sm",children:t.currentContent?sk(t.currentContent):"No current content on disk."})]})}function ck({candidates:t,candidateError:e,busyAction:n,onCandidateAction:r,onBulkCandidateAction:i,onOpenPage:l}){const[s,u]=Ee.useState(""),[f,c]=Ee.useState("all"),[h,v]=Ee.useState("score"),[p,m]=Ee.useState(()=>new Set),y=Ee.useMemo(()=>{const A=s.trim().toLowerCase();return t.filter(N=>f==="all"?!0:N.kind===f).filter(N=>A?`${N.title} ${N.path}`.toLowerCase().includes(A):!0)},[t,s,f]),w=Ee.useMemo(()=>{const A=[...y];return h==="title"?A.sort((N,k)=>N.title.localeCompare(k.title)):h==="updated"?A.sort((N,k)=>(k.updatedAt??"").localeCompare(N.updatedAt??"")):A.sort((N,k)=>(k.score??0)-(N.score??0))},[y,h]),S=w.length>0&&w.every(A=>p.has(A.pageId)),x=A=>{m(N=>{const k=new Set(N);return k.has(A)?k.delete(A):k.add(A),k})},C=()=>{m(S?new Set:new Set(w.map(A=>A.pageId)))},T=A=>{!p.size||!i||(i([...p],A),m(new Set))};return _.jsxs("div",{children:[e?_.jsx("p",{className:"text-error",children:e}):null,t.length?_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"list-filter-bar",children:[_.jsx("input",{type:"search",className:"input",placeholder:"Filter candidatesβ¦",value:s,onChange:A=>u(A.target.value),"aria-label":"Filter candidates"}),_.jsxs("select",{className:"input",value:f,onChange:A=>c(A.target.value),"aria-label":"Filter by kind",style:{width:"auto"},children:[_.jsx("option",{value:"all",children:"All kinds"}),_.jsx("option",{value:"concept",children:"Concepts"}),_.jsx("option",{value:"entity",children:"Entities"})]}),_.jsxs("select",{className:"input",value:h,onChange:A=>v(A.target.value),"aria-label":"Sort",style:{width:"auto"},children:[_.jsx("option",{value:"score",children:"Score"}),_.jsx("option",{value:"title",children:"Title"}),_.jsx("option",{value:"updated",children:"Recent"})]})]}),p.size>0&&i?_.jsxs("div",{className:"bulk-toolbar",role:"toolbar","aria-label":"Bulk candidate actions",children:[_.jsx("span",{className:"bulk-toolbar-count",children:p.size}),_.jsx("span",{className:"text-muted",children:"selected"}),_.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>T("promote"),children:"Promote all"}),_.jsx("button",{type:"button",className:"btn btn-danger",onClick:()=>T("archive"),children:"Archive all"}),_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>m(new Set),children:"Clear"})]}):null,i?_.jsxs("label",{className:"checkbox-cell",style:{marginBottom:8},children:[_.jsx("input",{type:"checkbox",checked:S,onChange:C}),_.jsx("span",{className:"text-muted text-xs",children:"Select all visible"})]}):null,_.jsxs("div",{className:"card-list",children:[w.map(A=>_.jsxs("article",{className:`card${p.has(A.pageId)?" is-selected":""}`,children:[_.jsxs("div",{className:"card-row",children:[i?_.jsx("label",{className:"checkbox-cell",children:_.jsx("input",{type:"checkbox",checked:p.has(A.pageId),onChange:()=>x(A.pageId),"aria-label":`Select ${A.title}`})}):null,_.jsx("span",{className:"label",children:A.kind}),A.score!=null?_.jsxs("span",{className:"chip",title:"Promotion score",children:["score ",A.score.toFixed(2)]}):null]}),_.jsx("strong",{className:"card-title",children:A.title}),_.jsx("p",{className:"text-mono text-sm",children:A.path}),_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{l(A.path,A.pageId)},children:"Open candidate"}),_.jsxs("div",{className:"action-row",children:[_.jsx("button",{type:"button",className:"btn btn-primary",disabled:n===`promote:${A.pageId}`,onClick:()=>r(A.pageId,"promote",A.activePath),children:"Promote"}),_.jsx("button",{type:"button",className:"btn btn-danger",disabled:n===`archive:${A.pageId}`,onClick:()=>r(A.pageId,"archive",A.path),children:"Archive"})]})]},A.pageId)),w.length===0?_.jsx("p",{className:"text-muted text-sm",children:"No candidates match the current filter."}):null]})]}):_.jsx("p",{className:"text-muted text-sm",children:"No candidate pages are waiting for review."})]})}function fk(t,e){const n=`${t.label} ${t.section??""} ${(t.keywords??[]).join(" ")}`.toLowerCase(),r=e.trim().toLowerCase();return r?t.label.toLowerCase().startsWith(r)?100:n.includes(r)?50:r.split(/\s+/).filter(Boolean).every(l=>n.includes(l))?25:0:1}function dk({open:t,onClose:e,commands:n}){const[r,i]=Ee.useState(""),[l,s]=Ee.useState(0),u=Ee.useRef(null),f=Ee.useMemo(()=>n.map(h=>({command:h,weight:fk(h,r)})).filter(h=>h.weight>0).sort((h,v)=>v.weight-h.weight||h.command.label.localeCompare(v.command.label)).map(h=>h.command),[n,r]);if(Ee.useEffect(()=>{if(t){i(""),s(0);const h=window.setTimeout(()=>u.current?.focus(),30);return()=>window.clearTimeout(h)}},[t]),Ee.useEffect(()=>{s(0)},[]),!t)return null;const c=h=>{if(h.key==="ArrowDown")h.preventDefault(),s(v=>Math.min(v+1,f.length-1));else if(h.key==="ArrowUp")h.preventDefault(),s(v=>Math.max(v-1,0));else if(h.key==="Enter"){h.preventDefault();const v=f[l];v&&(v.run(),e())}else h.key==="Escape"&&(h.preventDefault(),e())};return _.jsx("div",{className:"palette-overlay",role:"dialog","aria-modal":"true","aria-label":"Command palette",onClick:h=>{h.target===h.currentTarget&&e()},onKeyDown:h=>{h.key==="Escape"&&e()},children:_.jsxs("div",{className:"palette",children:[_.jsx("input",{ref:u,type:"search",className:"palette-input",placeholder:"Type a commandβ¦",value:r,onChange:h=>i(h.target.value),onKeyDown:c,"aria-label":"Command palette search"}),_.jsx("div",{className:"palette-list",children:f.length===0?_.jsx("div",{className:"palette-empty",children:"No matching commands."}):f.map((h,v)=>_.jsxs("button",{type:"button",className:`palette-item${v===l?" is-active":""}`,onMouseEnter:()=>s(v),onClick:()=>{h.run(),e()},children:[_.jsxs("span",{children:[h.section?_.jsxs("span",{className:"text-muted text-xs",children:[h.section," Β· "]}):null,h.label]}),h.shortcut?_.jsx("span",{className:"palette-item-shortcut",children:h.shortcut}):null]},h.id))})]})})}function Mr(){return typeof window<"u"?window.__SWARMVAULT_EMBEDDED_DATA__:void 0}function FE(t){return t.trim().toLowerCase()}function bS(t){return new Map(t.nodes.map(e=>[e.id,e]))}function hk(t){return new Map((t.pages??[]).map(e=>[e.id,e]))}function Tp(t,e){const n=FE(e);return t.nodes.find(r=>r.id===e||FE(r.label)===n||r.pageId===e)??null}function ES(t){const e=new Map;for(const n of t.nodes)e.set(n.id,[]);for(const n of t.edges)e.get(n.source)?.push({nodeId:n.target,edge:n,direction:"outgoing"}),e.get(n.target)?.push({nodeId:n.source,edge:n,direction:"incoming"});return e}function vk(t,e,n){const r=Tp(t,e),i=Tp(t,n);if(!r||!i)return{from:e,to:n,resolvedFromNodeId:r?.id,resolvedToNodeId:i?.id,found:!1,nodeIds:[],edgeIds:[],pageIds:[],summary:"Could not resolve one or both graph targets."};const l=ES(t),s=[r.id],u=new Set([r.id]),f=new Map;for(;s.length;){const y=s.shift();if(y===i.id)break;for(const w of l.get(y)??[])u.has(w.nodeId)||(u.add(w.nodeId),f.set(w.nodeId,{nodeId:y,edgeId:w.edge.id}),s.push(w.nodeId))}if(!u.has(i.id))return{from:e,to:n,resolvedFromNodeId:r.id,resolvedToNodeId:i.id,found:!1,nodeIds:[],edgeIds:[],pageIds:[],summary:`No path found between ${r.label} and ${i.label}.`};const c=[],h=[];let v=i.id;for(;v!==r.id;){c.push(v);const y=f.get(v);if(!y)break;h.push(y.edgeId),v=y.nodeId}c.push(r.id),c.reverse(),h.reverse();const p=bS(t),m=[...new Set(c.flatMap(y=>{const w=p.get(y)?.pageId;return w?[w]:[]}))];return{from:e,to:n,resolvedFromNodeId:r.id,resolvedToNodeId:i.id,found:!0,nodeIds:c,edgeIds:h,pageIds:m,summary:c.map(y=>p.get(y)?.label??y).join(" -> ")}}function gk(t,e){const n=Tp(t,e);if(!n)throw new Error(`Could not resolve graph target: ${e}`);const r=hk(t),i=n.pageId?r.get(n.pageId):void 0,l=bS(t),s=[];for(const c of ES(t).get(n.id)??[]){const h=l.get(c.nodeId);h&&s.push({nodeId:h.id,label:h.label,type:h.type,pageId:h.pageId,relation:c.edge.relation,direction:c.direction,confidence:c.edge.confidence??0,evidenceClass:c.edge.evidenceClass??"unknown"})}s.sort((c,h)=>h.confidence-c.confidence||c.label.localeCompare(h.label));const u=(t.hyperedges??[]).filter(c=>c.nodeIds.includes(n.id)),f=t.communities?.find(c=>c.id===n.communityId);return{target:e,node:n,page:i?{id:i.id,path:i.path,title:i.title}:void 0,community:f?{id:f.id,label:f.label}:void 0,neighbors:s,hyperedges:u,summary:[`Node: ${n.label}`,`Type: ${n.type}`,`Community: ${n.communityId??"none"}`,`Neighbors: ${s.length}`,`Group patterns: ${u.length}`,`Page: ${i?.path??"none"}`].join(`
|
|
10
|
+
`)}}function ds(t,e){const n=new Set,r=[];for(const i of t){const l=e(i);n.has(l)||(n.add(l),r.push(i))}return r}function hl(t,e){const n=t.trim().toLowerCase(),r=e.trim().toLowerCase();if(!n||!r)return 0;if(r===n)return 100;if(r.startsWith(n))return 80;if(r.includes(n))return 60;const i=n.split(/\s+/).filter(Boolean),l=new Set(r.split(/\s+/).filter(Boolean)),s=i.filter(u=>l.has(u)).length;return s?s*10:0}function pk(t,e,n,r){const i=r?.traversal??"bfs",l=Math.max(3,Math.min(r?.budget??12,50)),s=new Map((t.pages??[]).map(D=>[D.id,D])),f=n.map(D=>{const O=s.get(D.pageId),L=Math.max(hl(e,D.title),hl(e,D.path));return!O||L<=0?null:{type:"page",id:O.id,label:O.title,score:L}}).filter(D=>D!==null),c=t.nodes.map(D=>({type:"node",id:D.id,label:D.label,score:Math.max(hl(e,D.label),hl(e,D.id))})).filter(D=>D.score>0),h=(t.hyperedges??[]).map(D=>({type:"hyperedge",id:D.id,label:D.label,score:Math.max(hl(e,D.label),hl(e,D.why),hl(e,D.relation))})).filter(D=>D.score>0),v=ds([...f,...c,...h],D=>`${D.type}:${D.id}`).sort((D,O)=>O.score-D.score||D.label.localeCompare(O.label)).slice(0,12),p=ds([...n.flatMap(D=>s.get(D.pageId)?.nodeIds??[]),...v.filter(D=>D.type==="page").flatMap(D=>s.get(D.id)?.nodeIds??[]),...v.filter(D=>D.type==="node").map(D=>D.id),...v.filter(D=>D.type==="hyperedge").flatMap(D=>(t.hyperedges??[]).find(O=>O.id===D.id)?.nodeIds??[])],D=>D).filter(Boolean),m=new Map,y=(D,O)=>{m.has(D)||m.set(D,[]),m.get(D)?.push(O)};for(const D of t.edges)y(D.source,{edge:D,nodeId:D.target,direction:"outgoing"}),y(D.target,{edge:D,nodeId:D.source,direction:"incoming"});for(const[D,O]of m.entries())O.sort((L,M)=>(M.edge.confidence??0)-(L.edge.confidence??0)||L.edge.relation.localeCompare(M.edge.relation)),m.set(D,O);const w=[],S=new Set,x=new Set,C=[...p];for(;C.length&&w.length<l;){const D=i==="dfs"?C.pop():C.shift();if(!(!D||x.has(D))){x.add(D),w.push(D);for(const O of m.get(D)??[])if(S.add(O.edge.id),x.has(O.nodeId)||C.push(O.nodeId),w.length+C.length>=l*2)break}}const T=new Map(t.nodes.map(D=>[D.id,D])),A=ds([...n.map(D=>D.pageId),...v.filter(D=>D.type==="page").map(D=>D.id),...w.flatMap(D=>{const O=T.get(D);return O?.pageId?[O.pageId]:[]})],D=>D),N=ds(w.map(D=>T.get(D)?.communityId).filter(D=>!!D),D=>D),k=ds((t.hyperedges??[]).filter(D=>D.nodeIds.some(O=>w.includes(O))).map(D=>D.id),D=>D);return{question:e,traversal:i,seedNodeIds:p,seedPageIds:ds([...n.map(D=>D.pageId),...v.filter(D=>D.type==="page").map(D=>D.id)],D=>D),visitedNodeIds:w,visitedEdgeIds:[...S],hyperedgeIds:k,pageIds:A,communities:N,matches:v,summary:[`Seeds: ${p.join(", ")||"none"}`,`Visited nodes: ${w.length}`,`Visited edges: ${S.size}`,`Touched group patterns: ${k.length}`,`Communities: ${N.join(", ")||"none"}`,`Pages: ${A.join(", ")||"none"}`].join(`
|
|
11
|
+
`)}}function mk(t,e){const n=t.replace(/\s+/g," ").trim();if(!e)return n.slice(0,160);const r=n.toLowerCase().indexOf(e.toLowerCase());if(r<0)return n.slice(0,160);const i=Math.max(0,r-50),l=Math.min(n.length,r+Math.max(e.length,40));return`${i>0?"...":""}${n.slice(i,l)}${l<n.length?"...":""}`}async function yk(t="/api/graph",e){const n=Mr();if(n)return n.graph;const r=await fetch(t,e);if(!r.ok)throw new Error(`Failed to load graph artifact: ${r.status} ${r.statusText}`);return r.json()}async function xS(t,e={}){const n=Mr(),r=e.limit??10,i=e.kind??"all",l=e.status??"all",s=e.project??"all",u=e.sourceType??"all",f=e.sourceClass??"all";if(n){const v=t.trim().toLowerCase();return v?n.pages.filter(p=>i==="all"?!0:p.kind===i).filter(p=>l==="all"?!0:p.status===l).filter(p=>s==="all"?!0:s==="unassigned"?p.projectIds.length===0:p.projectIds.includes(s)).filter(p=>u==="all"?!0:(p.sourceType??"")===u).filter(p=>f==="all"?!0:(p.sourceClass??"")===f).map(p=>{const m=`${p.title}
|
|
12
|
+
${p.content}`.toLowerCase(),y=m.includes(v)?m.indexOf(v):Number.POSITIVE_INFINITY;return{pageId:p.pageId,path:p.path,title:p.title,snippet:mk(p.content,t),rank:y,kind:p.kind,status:p.status,projectIds:p.projectIds,sourceType:p.sourceType,sourceClass:p.sourceClass}}).filter(p=>Number.isFinite(p.rank)).sort((p,m)=>p.rank-m.rank||p.title.localeCompare(m.title)).slice(0,r):[]}const c=new URLSearchParams({q:t,limit:String(r),kind:i,status:l,project:s,sourceType:u,sourceClass:f}),h=await fetch(`/api/search?${c.toString()}`);if(!h.ok)throw new Error(`Failed to search pages: ${h.status} ${h.statusText}`);return h.json()}async function IE(t){const e=Mr();if(e){const r=e.pages.find(i=>i.path===t);if(!r)throw new Error(`Page not found: ${t}`);return{path:r.path,title:r.title,frontmatter:{page_id:r.pageId,kind:r.kind,status:r.status,project_ids:r.projectIds,source_type:r.sourceType,source_class:r.sourceClass},content:r.content,assets:r.assets??[]}}const n=await fetch(`/api/page?path=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`Failed to load page: ${n.status} ${n.statusText}`);return n.json()}async function bk(t,e={}){const n=Mr();if(n){const l=await xS(t,{limit:10});return pk(n.graph,t,l,e)}const r=new URLSearchParams({q:t,traversal:e.traversal??"bfs",budget:String(e.budget??12)}),i=await fetch(`/api/graph/query?${r.toString()}`);if(!i.ok)throw new Error(`Failed to query graph: ${i.status} ${i.statusText}`);return i.json()}async function Ek(){const t=Mr();if(t)return t.report??null;const e=await fetch("/api/graph-report");if(e.status===404)return null;if(!e.ok)throw new Error(`Failed to load graph report: ${e.status} ${e.statusText}`);return e.json()}async function zE(t,e){const n=Mr();if(n)return vk(n.graph,t,e);const r=new URLSearchParams({from:t,to:e}),i=await fetch(`/api/graph/path?${r.toString()}`);if(!i.ok)throw new Error(`Failed to find graph path: ${i.status} ${i.statusText}`);return i.json()}async function xk(t){const e=Mr();if(e)return gk(e.graph,t);const n=await fetch(`/api/graph/explain?target=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`Failed to explain graph target: ${n.status} ${n.statusText}`);return n.json()}async function wk(){if(Mr())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 Sk(t){if(Mr())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 Zc(t,e,n=[]){if(Mr())throw new Error("Review actions are unavailable in standalone exports.");const r=await fetch(`/api/review?action=${e}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({approvalId:t,targets:n})});if(!r.ok)throw new Error(`Failed to ${e} review entries: ${r.status} ${r.statusText}`);return r.json()}async function Ck(){if(Mr())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 PE(t,e){if(Mr())throw new Error("Candidate actions are unavailable in standalone exports.");const n=await fetch(`/api/candidate?action=${e}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})});if(!n.ok)throw new Error(`Failed to ${e} candidate: ${n.status} ${n.statusText}`);return n.json()}async function Tk(){if(Mr())return{generatedAt:"",watchedRepoRoots:[],pendingSemanticRefresh:[]};const t=await fetch("/api/watch-status");if(!t.ok)throw new Error(`Failed to load watch status: ${t.status} ${t.statusText}`);return t.json()}async function Dk(){if(Mr())return[];const t=await fetch("/api/lint");if(t.status===404)return[];if(!t.ok)throw new Error(`Failed to load lint findings: ${t.status} ${t.statusText}`);return t.json()}function Ak(t,e){const n=new Set(e),r=t.nodes.filter(l=>n.has(l.id)),i=t.edges.filter(l=>n.has(l.source)&&n.has(l.target));return{generatedAt:new Date().toISOString(),rootNodeId:e[0],nodes:r,edges:i}}function wS(t,e){if(typeof document>"u")return;const n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function _v(t,e,n="text/plain"){const r=new Blob([e],{type:n}),i=URL.createObjectURL(r);wS(t,i),setTimeout(()=>URL.revokeObjectURL(i),1500)}function _k(t,e){return!t||!t.png?null:t.png({full:!0,bg:"transparent",output:"base64uri"})}function kk(t){const e=t;return typeof e.svg=="function"?e.svg({full:!0,scale:1}):null}function Nk({cyRef:t,graph:e,selectedNodeIds:n,pageMarkdown:r}){const[i,l]=Ee.useState(!1),s=()=>{const h=t.current;if(!h)return;const v=_k(h);v&&wS(`swarmvault-graph-${Date.now()}.png`,v),l(!1)},u=()=>{const h=t.current;if(!h)return;const v=kk(h);v&&_v(`swarmvault-graph-${Date.now()}.svg`,v,"image/svg+xml"),l(!1)},f=()=>{if(!e)return;const h=n.length?n:e.nodes.map(p=>p.id),v=Ak(e,h);_v(`swarmvault-subgraph-${Date.now()}.json`,JSON.stringify(v,null,2),"application/json"),l(!1)},c=async()=>{if(!r)return;const h=`# ${r.title}
|
|
13
|
+
|
|
14
|
+
${r.content}`;try{await navigator.clipboard.writeText(h)}catch{_v(`${r.title.replace(/[^a-z0-9-_.]+/gi,"-")||"page"}.md`,h,"text/markdown")}l(!1)};return _.jsxs("div",{style:{position:"relative"},children:[_.jsx("button",{type:"button",className:"btn",onClick:()=>l(h=>!h),"aria-expanded":i,"aria-haspopup":"menu",children:"Export βΎ"}),i?_.jsxs("div",{role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",background:"var(--c-bg-elevated)",border:"1px solid var(--c-border)",borderRadius:"var(--radius-md)",padding:"var(--sp-1)",zIndex:20,boxShadow:"var(--c-shadow-elevated)",display:"flex",flexDirection:"column",minWidth:200},children:[_.jsx("button",{type:"button",role:"menuitem",className:"palette-item",onClick:s,children:"Canvas as PNG"}),_.jsx("button",{type:"button",role:"menuitem",className:"palette-item",onClick:u,children:"Canvas as SVG"}),_.jsxs("button",{type:"button",role:"menuitem",className:"palette-item",onClick:f,children:["Subgraph as JSON (",n.length||(e?.nodes.length??0)," nodes)"]}),_.jsx("button",{type:"button",role:"menuitem",className:"palette-item",onClick:c,disabled:!r,children:"Copy page as markdown"})]}):null]})}function Rk({edgeStatusFilter:t,onEdgeStatusChange:e,kindFilter:n,onKindChange:r,pageStatusFilter:i,onPageStatusChange:l,projectFilter:s,onProjectChange:u,projectOptions:f,sourceTypeFilter:c,onSourceTypeChange:h,sourceTypeOptions:v,sourceClassFilter:p,onSourceClassChange:m,sourceClassOptions:y,communityFilter:w,onCommunityChange:S,communityOptions:x,tagFilter:C,onTagChange:T,tagOptions:A,query:N,onQueryChange:k}){const[D,O]=Ee.useState(()=>new Set(["graph","tags"])),L=U=>{O(V=>{const $=new Set(V);return $.has(U)?$.delete(U):$.add(U),$})},M=[t,w,p].filter(U=>U!=="all").length,z=[n,i,s,c].filter(U=>U!=="all").length,B=C!=="all"?1:0;return _.jsxs("div",{className:"sidebar","data-drawer":"sidebar",children:[_.jsx("div",{className:"sidebar-section",children:_.jsxs("label",{className:"filter-group",children:[_.jsx("span",{className:"filter-label",children:"Search"}),_.jsx("input",{type:"search",className:"input",value:N,onChange:U=>k(U.target.value),placeholder:"Pages, outputs, candidatesβ¦","aria-label":"Search pages"})]})}),_.jsxs("div",{className:"sidebar-section",children:[_.jsxs("button",{type:"button",className:`sidebar-section-toggle ${D.has("graph")?"is-expanded":""}`,onClick:()=>L("graph"),children:["Graph",M>0?_.jsx("span",{className:"filter-badge",children:M}):null]}),_.jsxs("div",{className:`sidebar-section-body ${D.has("graph")?"is-expanded":""}`,children:[_.jsxs("label",{className:"filter-group",children:[_.jsx("span",{className:"filter-label",children:"Edge status"}),_.jsxs("select",{className:"input",value:t,onChange:U=>e(U.target.value),children:[_.jsx("option",{value:"all",children:"All"}),_.jsx("option",{value:"extracted",children:"Extracted"}),_.jsx("option",{value:"conflicted",children:"Conflicted"}),_.jsx("option",{value:"inferred",children:"Inferred"}),_.jsx("option",{value:"stale",children:"Stale"})]})]}),_.jsxs("label",{className:"filter-group",children:[_.jsx("span",{className:"filter-label",children:"Source class"}),_.jsxs("select",{className:"input",value:p,onChange:U=>m(U.target.value),children:[_.jsx("option",{value:"all",children:"All"}),y.map(U=>_.jsx("option",{value:U,children:U},U))]})]}),_.jsxs("label",{className:"filter-group",children:[_.jsx("span",{className:"filter-label",children:"Community"}),_.jsxs("select",{className:"input",value:w,onChange:U=>S(U.target.value),children:[_.jsx("option",{value:"all",children:"All"}),x.map(U=>_.jsx("option",{value:U,children:U},U))]})]})]})]}),_.jsxs("div",{className:"sidebar-section",children:[_.jsxs("button",{type:"button",className:`sidebar-section-toggle ${D.has("tags")?"is-expanded":""}`,onClick:()=>L("tags"),children:["Tags",B>0?_.jsx("span",{className:"filter-badge",children:B}):null]}),_.jsx("div",{className:`sidebar-section-body ${D.has("tags")?"is-expanded":""}`,children:A.length===0?_.jsx("p",{className:"text-muted text-sm",children:"No tags in this vault yet."}):_.jsxs("div",{className:"chip-row",children:[_.jsx("button",{type:"button",className:`chip chip-tag${C==="all"?" is-active":""}`,onClick:()=>T("all"),children:"all"}),A.slice(0,40).map(({tag:U,count:V})=>_.jsxs("button",{type:"button",className:`chip chip-tag${C===U?" is-active":""}`,onClick:()=>T(U===C?"all":U),title:`${V} pages`,children:["#",U," ",_.jsx("span",{className:"text-muted text-xs",children:V})]},U))]})})]}),_.jsxs("div",{className:"sidebar-section",children:[_.jsxs("button",{type:"button",className:`sidebar-section-toggle ${D.has("pages")?"is-expanded":""}`,onClick:()=>L("pages"),children:["Pages",z>0?_.jsx("span",{className:"filter-badge",children:z}):null]}),_.jsxs("div",{className:`sidebar-section-body ${D.has("pages")?"is-expanded":""}`,children:[_.jsxs("label",{className:"filter-group",children:[_.jsx("span",{className:"filter-label",children:"Page kind"}),_.jsxs("select",{className:"input",value:n,onChange:U=>r(U.target.value),children:[_.jsx("option",{value:"all",children:"All"}),_.jsx("option",{value:"source",children:"Source"}),_.jsx("option",{value:"module",children:"Module"}),_.jsx("option",{value:"concept",children:"Concept"}),_.jsx("option",{value:"entity",children:"Entity"}),_.jsx("option",{value:"output",children:"Output"}),_.jsx("option",{value:"insight",children:"Insight"}),_.jsx("option",{value:"graph_report",children:"Graph report"}),_.jsx("option",{value:"community_summary",children:"Community summary"}),_.jsx("option",{value:"index",children:"Index"})]})]}),_.jsxs("label",{className:"filter-group",children:[_.jsx("span",{className:"filter-label",children:"Status"}),_.jsxs("select",{className:"input",value:i,onChange:U=>l(U.target.value),children:[_.jsx("option",{value:"all",children:"All"}),_.jsx("option",{value:"active",children:"Active"}),_.jsx("option",{value:"candidate",children:"Candidate"}),_.jsx("option",{value:"draft",children:"Draft"}),_.jsx("option",{value:"archived",children:"Archived"})]})]}),_.jsxs("label",{className:"filter-group",children:[_.jsx("span",{className:"filter-label",children:"Project"}),_.jsxs("select",{className:"input",value:s,onChange:U=>u(U.target.value),children:[_.jsx("option",{value:"all",children:"All"}),_.jsx("option",{value:"unassigned",children:"Unassigned"}),f.map(U=>_.jsx("option",{value:U,children:U},U))]})]}),_.jsxs("label",{className:"filter-group",children:[_.jsx("span",{className:"filter-label",children:"Source type"}),_.jsxs("select",{className:"input",value:c,onChange:U=>h(U.target.value),children:[_.jsx("option",{value:"all",children:"All"}),v.map(U=>_.jsx("option",{value:U,children:U},U))]})]})]})]})]})}function Dp(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Mk(t){if(Array.isArray(t))return t}function Ok(t){if(Array.isArray(t))return Dp(t)}function Hi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bk(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,CS(r.key),r)}}function ji(t,e,n){return e&&Bk(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rr(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=im(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(f){throw f},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
15
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var f=n.next();return s=f.done,f},e:function(f){u=!0,l=f},f:function(){try{s||n.return==null||n.return()}finally{if(u)throw l}}}}function SS(t,e,n){return(e=CS(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lk(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Fk(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,l,s,u=[],f=!0,c=!1;try{if(l=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=l.call(n)).done)&&(u.push(r.value),u.length!==e);f=!0);}catch(h){c=!0,i=h}finally{try{if(!f&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}function Ik(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
16
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zk(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
17
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zn(t,e){return Mk(t)||Fk(t,e)||im(t,e)||Ik()}function Of(t){return Ok(t)||Lk(t)||im(t)||zk()}function Pk(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function CS(t){var e=Pk(t,"string");return typeof e=="symbol"?e:e+""}function Hn(t){"@babel/helpers - typeof";return Hn=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},Hn(t)}function im(t,e){if(t){if(typeof t=="string")return Dp(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dp(t,e):void 0}}var Un=typeof window>"u"?null:window,UE=Un?Un.navigator:null;Un&&Un.document;var Uk=Hn(""),TS=Hn({}),qk=Hn(function(){}),Hk=typeof HTMLElement>"u"?"undefined":Hn(HTMLElement),wu=function(e){return e&&e.instanceString&&wn(e.instanceString)?e.instanceString():null},st=function(e){return e!=null&&Hn(e)==Uk},wn=function(e){return e!=null&&Hn(e)===qk},ln=function(e){return!Hr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},zt=function(e){return e!=null&&Hn(e)===TS&&!ln(e)&&e.constructor===Object},jk=function(e){return e!=null&&Hn(e)===TS},je=function(e){return e!=null&&Hn(e)===Hn(1)&&!isNaN(e)},Gk=function(e){return je(e)&&Math.floor(e)===e},Bf=function(e){if(Hk!=="undefined")return e!=null&&e instanceof HTMLElement},Hr=function(e){return Su(e)||DS(e)},Su=function(e){return wu(e)==="collection"&&e._private.single},DS=function(e){return wu(e)==="collection"&&!e._private.single},lm=function(e){return wu(e)==="core"},AS=function(e){return wu(e)==="stylesheet"},Vk=function(e){return wu(e)==="event"},Fi=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},$k=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Kk=function(e){return zt(e)&&je(e.x1)&&je(e.x2)&&je(e.y1)&&je(e.y2)},Yk=function(e){return jk(e)&&wn(e.then)},Xk=function(){return UE&&UE.userAgent.match(/msie|trident|edge/i)},Fs=function(e,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var l=[],s=0;s<arguments.length;s++)l.push(arguments[s]);return l.join("$")});var r=function(){var l=this,s=arguments,u,f=n.apply(l,s),c=r.cache;return(u=c[f])||(u=c[f]=e.apply(l,s)),u};return r.cache={},r},sm=Fs(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Jf=Fs(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),_S=Fs(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),qE=function(e){return Fi(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Ri=function(e,n){return e.slice(-1*n.length)===n},qn="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Zk="rgb[a]?\\(("+qn+"[%]?)\\s*,\\s*("+qn+"[%]?)\\s*,\\s*("+qn+"[%]?)(?:\\s*,\\s*("+qn+"))?\\)",Qk="rgb[a]?\\((?:"+qn+"[%]?)\\s*,\\s*(?:"+qn+"[%]?)\\s*,\\s*(?:"+qn+"[%]?)(?:\\s*,\\s*(?:"+qn+"))?\\)",Wk="hsl[a]?\\(("+qn+")\\s*,\\s*("+qn+"[%])\\s*,\\s*("+qn+"[%])(?:\\s*,\\s*("+qn+"))?\\)",Jk="hsl[a]?\\((?:"+qn+")\\s*,\\s*(?:"+qn+"[%])\\s*,\\s*(?:"+qn+"[%])(?:\\s*,\\s*(?:"+qn+"))?\\)",eN="\\#[0-9a-fA-F]{3}",tN="\\#[0-9a-fA-F]{6}",kS=function(e,n){return e<n?-1:e>n?1:0},nN=function(e,n){return-1*kS(e,n)},ht=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,n=1;n<e.length;n++){var r=e[n];if(r!=null)for(var i=Object.keys(r),l=0;l<i.length;l++){var s=i[l];t[s]=r[s]}}return t},rN=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var n=e.length===4,r,i,l,s=16;return n?(r=parseInt(e[1]+e[1],s),i=parseInt(e[2]+e[2],s),l=parseInt(e[3]+e[3],s)):(r=parseInt(e[1]+e[2],s),i=parseInt(e[3]+e[4],s),l=parseInt(e[5]+e[6],s)),[r,i,l]}},aN=function(e){var n,r,i,l,s,u,f,c;function h(y,w,S){return S<0&&(S+=1),S>1&&(S-=1),S<1/6?y+(w-y)*6*S:S<1/2?w:S<2/3?y+(w-y)*(2/3-S)*6:y}var v=new RegExp("^"+Wk+"$").exec(e);if(v){if(r=parseInt(v[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,i=parseFloat(v[2]),i<0||i>100||(i=i/100,l=parseFloat(v[3]),l<0||l>100)||(l=l/100,s=v[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)u=f=c=Math.round(l*255);else{var p=l<.5?l*(1+i):l+i-l*i,m=2*l-p;u=Math.round(255*h(m,p,r+1/3)),f=Math.round(255*h(m,p,r)),c=Math.round(255*h(m,p,r-1/3))}n=[u,f,c,s]}return n},iN=function(e){var n,r=new RegExp("^"+Zk+"$").exec(e);if(r){n=[];for(var i=[],l=1;l<=3;l++){var s=r[l];if(s[s.length-1]==="%"&&(i[l]=!0),s=parseFloat(s),i[l]&&(s=s/100*255),s<0||s>255)return;n.push(Math.floor(s))}var u=i[1]||i[2]||i[3],f=i[1]&&i[2]&&i[3];if(u&&!f)return;var c=r[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;n.push(c)}}return n},lN=function(e){return sN[e.toLowerCase()]},NS=function(e){return(ln(e)?e:null)||lN(e)||rN(e)||iN(e)||aN(e)},sN={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]},RS=function(e){for(var n=e.map,r=e.keys,i=r.length,l=0;l<i;l++){var s=r[l];if(zt(s))throw Error("Tried to set map with object key");l<r.length-1?(n[s]==null&&(n[s]={}),n=n[s]):n[s]=e.value}},MS=function(e){for(var n=e.map,r=e.keys,i=r.length,l=0;l<i;l++){var s=r[l];if(zt(s))throw Error("Tried to get map with object key");if(n=n[s],n==null)return n}return n},Qc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kv,HE;function Tu(){if(HE)return kv;HE=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return kv=t,kv}var Nv,jE;function oN(){if(jE)return Nv;jE=1;var t=typeof Qc=="object"&&Qc&&Qc.Object===Object&&Qc;return Nv=t,Nv}var Rv,GE;function ed(){if(GE)return Rv;GE=1;var t=oN(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return Rv=n,Rv}var Mv,VE;function uN(){if(VE)return Mv;VE=1;var t=ed(),e=function(){return t.Date.now()};return Mv=e,Mv}var Ov,$E;function cN(){if($E)return Ov;$E=1;var t=/\s/;function e(n){for(var r=n.length;r--&&t.test(n.charAt(r)););return r}return Ov=e,Ov}var Bv,KE;function fN(){if(KE)return Bv;KE=1;var t=cN(),e=/^\s+/;function n(r){return r&&r.slice(0,t(r)+1).replace(e,"")}return Bv=n,Bv}var Lv,YE;function om(){if(YE)return Lv;YE=1;var t=ed(),e=t.Symbol;return Lv=e,Lv}var Fv,XE;function dN(){if(XE)return Fv;XE=1;var t=om(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;function l(s){var u=n.call(s,i),f=s[i];try{s[i]=void 0;var c=!0}catch{}var h=r.call(s);return c&&(u?s[i]=f:delete s[i]),h}return Fv=l,Fv}var Iv,ZE;function hN(){if(ZE)return Iv;ZE=1;var t=Object.prototype,e=t.toString;function n(r){return e.call(r)}return Iv=n,Iv}var zv,QE;function OS(){if(QE)return zv;QE=1;var t=om(),e=dN(),n=hN(),r="[object Null]",i="[object Undefined]",l=t?t.toStringTag:void 0;function s(u){return u==null?u===void 0?i:r:l&&l in Object(u)?e(u):n(u)}return zv=s,zv}var Pv,WE;function vN(){if(WE)return Pv;WE=1;function t(e){return e!=null&&typeof e=="object"}return Pv=t,Pv}var Uv,JE;function Du(){if(JE)return Uv;JE=1;var t=OS(),e=vN(),n="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&t(i)==n}return Uv=r,Uv}var qv,ex;function gN(){if(ex)return qv;ex=1;var t=fN(),e=Tu(),n=Du(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;function f(c){if(typeof c=="number")return c;if(n(c))return r;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 v=l.test(c);return v||s.test(c)?u(c.slice(2),v?2:8):i.test(c)?r:+c}return qv=f,qv}var Hv,tx;function pN(){if(tx)return Hv;tx=1;var t=Tu(),e=uN(),n=gN(),r="Expected a function",i=Math.max,l=Math.min;function s(u,f,c){var h,v,p,m,y,w,S=0,x=!1,C=!1,T=!0;if(typeof u!="function")throw new TypeError(r);f=n(f)||0,t(c)&&(x=!!c.leading,C="maxWait"in c,p=C?i(n(c.maxWait)||0,f):p,T="trailing"in c?!!c.trailing:T);function A(U){var V=h,$=v;return h=v=void 0,S=U,m=u.apply($,V),m}function N(U){return S=U,y=setTimeout(O,f),x?A(U):m}function k(U){var V=U-w,$=U-S,q=f-V;return C?l(q,p-$):q}function D(U){var V=U-w,$=U-S;return w===void 0||V>=f||V<0||C&&$>=p}function O(){var U=e();if(D(U))return L(U);y=setTimeout(O,k(U))}function L(U){return y=void 0,T&&h?A(U):(h=v=void 0,m)}function M(){y!==void 0&&clearTimeout(y),S=0,h=w=v=y=void 0}function z(){return y===void 0?m:L(e())}function B(){var U=e(),V=D(U);if(h=arguments,v=this,w=U,V){if(y===void 0)return N(w);if(C)return clearTimeout(y),y=setTimeout(O,f),A(w)}return y===void 0&&(y=setTimeout(O,f)),m}return B.cancel=M,B.flush=z,B}return Hv=s,Hv}var mN=pN(),Au=Cu(mN),jv=Un?Un.performance:null,BS=jv&&jv.now?function(){return jv.now()}:function(){return Date.now()},yN=(function(){if(Un){if(Un.requestAnimationFrame)return function(t){Un.requestAnimationFrame(t)};if(Un.mozRequestAnimationFrame)return function(t){Un.mozRequestAnimationFrame(t)};if(Un.webkitRequestAnimationFrame)return function(t){Un.webkitRequestAnimationFrame(t)};if(Un.msRequestAnimationFrame)return function(t){Un.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(BS())},1e3/60)}})(),Lf=function(e){return yN(e)},Ya=BS,bl=9261,LS=65599,Cs=5381,FS=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bl,r=n,i;i=e.next(),!i.done;)r=r*LS+i.value|0;return r},uu=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bl;return n*LS+e|0},cu=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cs;return(n<<5)+n+e|0},bN=function(e,n){return e*2097152+n},Ti=function(e){return e[0]*2097152+e[1]},Wc=function(e,n){return[uu(e[0],n[0]),cu(e[1],n[1])]},nx=function(e,n){var r={value:0,done:!1},i=0,l=e.length,s={next:function(){return i<l?r.value=e[i++]:r.done=!0,r}};return FS(s,n)},wl=function(e,n){var r={value:0,done:!1},i=0,l=e.length,s={next:function(){return i<l?r.value=e.charCodeAt(i++):r.done=!0,r}};return FS(s,n)},IS=function(){return EN(arguments)},EN=function(e){for(var n,r=0;r<e.length;r++){var i=e[r];r===0?n=wl(i):n=wl(i,n)}return n};function xN(t,e,n,r,i){var l=i*Math.PI/180,s=Math.cos(l)*(t-n)-Math.sin(l)*(e-r)+n,u=Math.sin(l)*(t-n)+Math.cos(l)*(e-r)+r;return{x:s,y:u}}var wN=function(e,n,r,i,l,s){return{x:(e-r)*l+r,y:(n-i)*s+i}};function SN(t,e,n){if(n===0)return t;var r=(e.x1+e.x2)/2,i=(e.y1+e.y2)/2,l=e.w/e.h,s=1/l,u=xN(t.x,t.y,r,i,n),f=wN(u.x,u.y,r,i,l,s);return{x:f.x,y:f.y}}var rx=!0,CN=console.warn!=null,TN=console.trace!=null,um=Number.MAX_SAFE_INTEGER||9007199254740991,zS=function(){return!0},Ff=function(){return!1},ax=function(){return 0},cm=function(){},mn=function(e){throw new Error(e)},PS=function(e){if(e!==void 0)rx=!!e;else return rx},Kt=function(e){PS()&&(CN?console.warn(e):(console.log(e),TN&&console.trace()))},DN=function(e){return ht({},e)},Sa=function(e){return e==null?e:ln(e)?e.slice():zt(e)?DN(e):e},AN=function(e){return e.slice()},US=function(e,n){for(n=e="";e++<36;n+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return n},_N={},qS=function(){return _N},ir=function(e){var n=Object.keys(e);return function(r){for(var i={},l=0;l<n.length;l++){var s=n[l],u=r?.[s];i[s]=u===void 0?e[s]:u}return i}},Ii=function(e,n,r){for(var i=e.length-1;i>=0;i--)e[i]===n&&e.splice(i,1)},fm=function(e){e.splice(0,e.length)},kN=function(e,n){for(var r=0;r<n.length;r++){var i=n[r];e.push(i)}},kr=function(e,n,r){return r&&(n=_S(r,n)),e[n]},$a=function(e,n,r,i){r&&(n=_S(r,n)),e[n]=i},NN=(function(){function t(){Hi(this,t),this._obj={}}return ji(t,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}])})(),Ka=typeof Map<"u"?Map:NN,RN="undefined",MN=(function(){function t(e){if(Hi(this,t),this._obj=Object.create(null),this.size=0,e!=null){var n;e.instanceString!=null&&e.instanceString()===this.instanceString()?n=e.toArray():n=e;for(var r=0;r<n.length;r++)this.add(n[r])}}return ji(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}])})(),Us=(typeof Set>"u"?"undefined":Hn(Set))!==RN?Set:MN,td=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||n===void 0||!lm(e)){mn("An element must have a core reference and parameters set");return}var i=n.group;if(i==null&&(n.data&&n.data.source!=null&&n.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){mn("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var l=this._private={cy:e,single:!0,data:n.data||{},position:n.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?i==="edges":!!n.pannable,active:!1,classes:new Us,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.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(l.position.x==null&&(l.position.x=0),l.position.y==null&&(l.position.y=0),n.renderedPosition){var s=n.renderedPosition,u=e.pan(),f=e.zoom();l.position={x:(s.x-u.x)/f,y:(s.y-u.y)/f}}var c=[];ln(n.classes)?c=n.classes:st(n.classes)&&(c=n.classes.split(/\s+/));for(var h=0,v=c.length;h<v;h++){var p=c[h];!p||p===""||l.classes.add(p)}this.createEmitter(),(r===void 0||r)&&this.restore();var m=n.style||n.css;m&&(Kt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(m))},ix=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(r,i,l){var s;zt(r)&&!Hr(r)&&(s=r,r=s.roots||s.root,i=s.visit,l=s.directed),l=arguments.length===2&&!wn(i)?i:l,i=wn(i)?i:function(){};for(var u=this._private.cy,f=r=st(r)?this.filter(r):r,c=[],h=[],v={},p={},m={},y=0,w,S=this.byGroup(),x=S.nodes,C=S.edges,T=0;T<f.length;T++){var A=f[T],N=A.id();A.isNode()&&(c.unshift(A),e.bfs&&(m[N]=!0,h.push(A)),p[N]=0)}for(var k=function(){var U=e.bfs?c.shift():c.pop(),V=U.id();if(e.dfs){if(m[V])return 0;m[V]=!0,h.push(U)}var $=p[V],q=v[V],H=q!=null?q.source():null,Y=q!=null?q.target():null,Q=q==null?void 0:U.same(H)?Y[0]:H[0],P;if(P=i(U,q,Q,y++,$),P===!0)return w=U,1;if(P===!1)return 1;for(var I=U.connectedEdges().filter(function(se){return(!l||se.source().same(U))&&C.has(se)}),K=0;K<I.length;K++){var F=I[K],J=F.connectedNodes().filter(function(se){return!se.same(U)&&x.has(se)}),re=J.id();J.length!==0&&!m[re]&&(J=J[0],c.push(J),e.bfs&&(m[re]=!0,h.push(J)),v[re]=F,p[re]=p[V]+1)}},D;c.length!==0&&(D=k(),!(D!==0&&D===1)););for(var O=u.collection(),L=0;L<h.length;L++){var M=h[L],z=v[M.id()];z!=null&&O.push(z),O.push(M)}return{path:u.collection(O),found:u.collection(w)}}},fu={breadthFirstSearch:ix({bfs:!0}),depthFirstSearch:ix({dfs:!0})};fu.bfs=fu.breadthFirstSearch;fu.dfs=fu.depthFirstSearch;var xf={exports:{}},ON=xf.exports,lx;function BN(){return lx||(lx=1,(function(t,e){(function(){var n,r,i,l,s,u,f,c,h,v,p,m,y,w,S;i=Math.floor,v=Math.min,r=function(x,C){return x<C?-1:x>C?1:0},h=function(x,C,T,A,N){var k;if(T==null&&(T=0),N==null&&(N=r),T<0)throw new Error("lo must be non-negative");for(A==null&&(A=x.length);T<A;)k=i((T+A)/2),N(C,x[k])<0?A=k:T=k+1;return[].splice.apply(x,[T,T-T].concat(C)),C},u=function(x,C,T){return T==null&&(T=r),x.push(C),w(x,0,x.length-1,T)},s=function(x,C){var T,A;return C==null&&(C=r),T=x.pop(),x.length?(A=x[0],x[0]=T,S(x,0,C)):A=T,A},c=function(x,C,T){var A;return T==null&&(T=r),A=x[0],x[0]=C,S(x,0,T),A},f=function(x,C,T){var A;return T==null&&(T=r),x.length&&T(x[0],C)<0&&(A=[x[0],C],C=A[0],x[0]=A[1],S(x,0,T)),C},l=function(x,C){var T,A,N,k,D,O;for(C==null&&(C=r),k=(function(){O=[];for(var L=0,M=i(x.length/2);0<=M?L<M:L>M;0<=M?L++:L--)O.push(L);return O}).apply(this).reverse(),D=[],A=0,N=k.length;A<N;A++)T=k[A],D.push(S(x,T,C));return D},y=function(x,C,T){var A;if(T==null&&(T=r),A=x.indexOf(C),A!==-1)return w(x,0,A,T),S(x,A,T)},p=function(x,C,T){var A,N,k,D,O;if(T==null&&(T=r),N=x.slice(0,C),!N.length)return N;for(l(N,T),O=x.slice(C),k=0,D=O.length;k<D;k++)A=O[k],f(N,A,T);return N.sort(T).reverse()},m=function(x,C,T){var A,N,k,D,O,L,M,z,B;if(T==null&&(T=r),C*10<=x.length){if(k=x.slice(0,C).sort(T),!k.length)return k;for(N=k[k.length-1],M=x.slice(C),D=0,L=M.length;D<L;D++)A=M[D],T(A,N)<0&&(h(k,A,0,null,T),k.pop(),N=k[k.length-1]);return k}for(l(x,T),B=[],O=0,z=v(C,x.length);0<=z?O<z:O>z;0<=z?++O:--O)B.push(s(x,T));return B},w=function(x,C,T,A){var N,k,D;for(A==null&&(A=r),N=x[T];T>C;){if(D=T-1>>1,k=x[D],A(N,k)<0){x[T]=k,T=D;continue}break}return x[T]=N},S=function(x,C,T){var A,N,k,D,O;for(T==null&&(T=r),N=x.length,O=C,k=x[C],A=2*C+1;A<N;)D=A+1,D<N&&!(T(x[A],x[D])<0)&&(A=D),x[C]=x[A],C=A,A=2*C+1;return x[C]=k,w(x,O,C,T)},n=(function(){x.push=u,x.pop=s,x.replace=c,x.pushpop=f,x.heapify=l,x.updateItem=y,x.nlargest=p,x.nsmallest=m;function x(C){this.cmp=C??r,this.nodes=[]}return x.prototype.push=function(C){return u(this.nodes,C,this.cmp)},x.prototype.pop=function(){return s(this.nodes,this.cmp)},x.prototype.peek=function(){return this.nodes[0]},x.prototype.contains=function(C){return this.nodes.indexOf(C)!==-1},x.prototype.replace=function(C){return c(this.nodes,C,this.cmp)},x.prototype.pushpop=function(C){return f(this.nodes,C,this.cmp)},x.prototype.heapify=function(){return l(this.nodes,this.cmp)},x.prototype.updateItem=function(C){return y(this.nodes,C,this.cmp)},x.prototype.clear=function(){return this.nodes=[]},x.prototype.empty=function(){return this.nodes.length===0},x.prototype.size=function(){return this.nodes.length},x.prototype.clone=function(){var C;return C=new x,C.nodes=this.nodes.slice(0),C},x.prototype.toArray=function(){return this.nodes.slice(0)},x.prototype.insert=x.prototype.push,x.prototype.top=x.prototype.peek,x.prototype.front=x.prototype.peek,x.prototype.has=x.prototype.contains,x.prototype.copy=x.prototype.clone,x})(),(function(x,C){return t.exports=C()})(this,function(){return n})}).call(ON)})(xf)),xf.exports}var Gv,sx;function LN(){return sx||(sx=1,Gv=BN()),Gv}var FN=LN(),_u=Cu(FN),IN=ir({root:null,weight:function(e){return 1},directed:!1}),zN={dijkstra:function(e){if(!zt(e)){var n=arguments;e={root:n[0],weight:n[1],directed:n[2]}}var r=IN(e),i=r.root,l=r.weight,s=r.directed,u=this,f=l,c=st(i)?this.filter(i)[0]:i[0],h={},v={},p={},m=this.byGroup(),y=m.nodes,w=m.edges;w.unmergeBy(function($){return $.isLoop()});for(var S=function(q){return h[q.id()]},x=function(q,H){h[q.id()]=H,C.updateItem(q)},C=new _u(function($,q){return S($)-S(q)}),T=0;T<y.length;T++){var A=y[T];h[A.id()]=A.same(c)?0:1/0,C.push(A)}for(var N=function(q,H){for(var Y=(s?q.edgesTo(H):q.edgesWith(H)).intersect(w),Q=1/0,P,I=0;I<Y.length;I++){var K=Y[I],F=f(K);(F<Q||!P)&&(Q=F,P=K)}return{edge:P,dist:Q}};C.size()>0;){var k=C.pop(),D=S(k),O=k.id();if(p[O]=D,D!==1/0)for(var L=k.neighborhood().intersect(y),M=0;M<L.length;M++){var z=L[M],B=z.id(),U=N(k,z),V=D+U.dist;V<S(z)&&(x(z,V),v[B]={node:k,edge:U.edge})}}return{distanceTo:function(q){var H=st(q)?y.filter(q)[0]:q[0];return p[H.id()]},pathTo:function(q){var H=st(q)?y.filter(q)[0]:q[0],Y=[],Q=H,P=Q.id();if(H.length>0)for(Y.unshift(H);v[P];){var I=v[P];Y.unshift(I.edge),Y.unshift(I.node),Q=I.node,P=Q.id()}return u.spawn(Y)}}}},PN={kruskal:function(e){e=e||function(T){return 1};for(var n=this.byGroup(),r=n.nodes,i=n.edges,l=r.length,s=new Array(l),u=r,f=function(A){for(var N=0;N<s.length;N++){var k=s[N];if(k.has(A))return N}},c=0;c<l;c++)s[c]=this.spawn(r[c]);for(var h=i.sort(function(T,A){return e(T)-e(A)}),v=0;v<h.length;v++){var p=h[v],m=p.source()[0],y=p.target()[0],w=f(m),S=f(y),x=s[w],C=s[S];w!==S&&(u.merge(p),x.merge(C),s.splice(S,1))}return u}},UN=ir({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),qN={aStar:function(e){var n=this.cy(),r=UN(e),i=r.root,l=r.goal,s=r.heuristic,u=r.directed,f=r.weight;i=n.collection(i)[0],l=n.collection(l)[0];var c=i.id(),h=l.id(),v={},p={},m={},y=new _u(function(P,I){return p[P.id()]-p[I.id()]}),w=new Us,S={},x={},C=function(I,K){y.push(I),w.add(K)},T,A,N=function(){T=y.pop(),A=T.id(),w.delete(A)},k=function(I){return w.has(I)};C(i,c),v[c]=0,p[c]=s(i);for(var D=0;y.size()>0;){if(N(),D++,A===h){for(var O=[],L=l,M=h,z=x[M];O.unshift(L),z!=null&&O.unshift(z),L=S[M],L!=null;)M=L.id(),z=x[M];return{found:!0,distance:v[A],path:this.spawn(O),steps:D}}m[A]=!0;for(var B=T._private.edges,U=0;U<B.length;U++){var V=B[U];if(this.hasElementWithId(V.id())&&!(u&&V.data("source")!==A)){var $=V.source(),q=V.target(),H=$.id()!==A?$:q,Y=H.id();if(this.hasElementWithId(Y)&&!m[Y]){var Q=v[A]+f(V);if(!k(Y)){v[Y]=Q,p[Y]=Q+s(H),C(H,Y),S[Y]=T,x[Y]=V;continue}Q<v[Y]&&(v[Y]=Q,p[Y]=Q+s(H),S[Y]=T,x[Y]=V)}}}}return{found:!1,distance:void 0,path:void 0,steps:D}}},HN=ir({weight:function(e){return 1},directed:!1}),jN={floydWarshall:function(e){for(var n=this.cy(),r=HN(e),i=r.weight,l=r.directed,s=i,u=this.byGroup(),f=u.nodes,c=u.edges,h=f.length,v=h*h,p=function(F){return f.indexOf(F)},m=function(F){return f[F]},y=new Array(v),w=0;w<v;w++){var S=w%h,x=(w-S)/h;x===S?y[w]=0:y[w]=1/0}for(var C=new Array(v),T=new Array(v),A=0;A<c.length;A++){var N=c[A],k=N.source()[0],D=N.target()[0];if(k!==D){var O=p(k),L=p(D),M=O*h+L,z=s(N);if(y[M]>z&&(y[M]=z,C[M]=L,T[M]=N),!l){var B=L*h+O;!l&&y[B]>z&&(y[B]=z,C[B]=O,T[B]=N)}}}for(var U=0;U<h;U++)for(var V=0;V<h;V++)for(var $=V*h+U,q=0;q<h;q++){var H=V*h+q,Y=U*h+q;y[$]+y[Y]<y[H]&&(y[H]=y[$]+y[Y],C[H]=C[$])}var Q=function(F){return(st(F)?n.filter(F):F)[0]},P=function(F){return p(Q(F))},I={distance:function(F,J){var re=P(F),se=P(J);return y[re*h+se]},path:function(F,J){var re=P(F),se=P(J),me=m(re);if(re===se)return me.collection();if(C[re*h+se]==null)return n.collection();var Ne=n.collection(),pe=re,ee;for(Ne.merge(me);re!==se;)pe=re,re=C[re*h+se],ee=T[pe*h+re],Ne.merge(ee),Ne.merge(m(re));return Ne}};return I}},GN=ir({weight:function(e){return 1},directed:!1,root:null}),VN={bellmanFord:function(e){var n=this,r=GN(e),i=r.weight,l=r.directed,s=r.root,u=i,f=this,c=this.cy(),h=this.byGroup(),v=h.edges,p=h.nodes,m=p.length,y=new Ka,w=!1,S=[];s=c.collection(s)[0],v.unmergeBy(function(lt){return lt.isLoop()});for(var x=v.length,C=function(We){var et=y.get(We.id());return et||(et={},y.set(We.id(),et)),et},T=function(We){return(st(We)?c.$(We):We)[0]},A=function(We){return C(T(We)).dist},N=function(We){for(var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,ze=T(We),Ge=[],tt=ze;;){if(tt==null)return n.spawn();var ot=C(tt),Pe=ot.edge,pt=ot.pred;if(Ge.unshift(tt[0]),tt.same(et)&&Ge.length>0)break;Pe!=null&&Ge.unshift(Pe),tt=pt}return f.spawn(Ge)},k=0;k<m;k++){var D=p[k],O=C(D);D.same(s)?O.dist=0:O.dist=1/0,O.pred=null,O.edge=null}for(var L=!1,M=function(We,et,ze,Ge,tt,ot){var Pe=Ge.dist+ot;Pe<tt.dist&&!ze.same(Ge.edge)&&(tt.dist=Pe,tt.pred=We,tt.edge=ze,L=!0)},z=1;z<m;z++){L=!1;for(var B=0;B<x;B++){var U=v[B],V=U.source(),$=U.target(),q=u(U),H=C(V),Y=C($);M(V,$,U,H,Y,q),l||M($,V,U,Y,H,q)}if(!L)break}if(L)for(var Q=[],P=0;P<x;P++){var I=v[P],K=I.source(),F=I.target(),J=u(I),re=C(K).dist,se=C(F).dist;if(re+J<se||!l&&se+J<re)if(w||(Kt("Graph contains a negative weight cycle for Bellman-Ford"),w=!0),e.findNegativeWeightCycles!==!1){var me=[];re+J<se&&me.push(K),!l&&se+J<re&&me.push(F);for(var Ne=me.length,pe=0;pe<Ne;pe++){var ee=me[pe],le=[ee];le.push(C(ee).edge);for(var de=C(ee).pred;le.indexOf(de)===-1;)le.push(de),le.push(C(de).edge),de=C(de).pred;le=le.slice(le.indexOf(de));for(var xe=le[0].id(),Re=0,$e=2;$e<le.length;$e+=2)le[$e].id()<xe&&(xe=le[$e].id(),Re=$e);le=le.slice(Re).concat(le.slice(0,Re)),le.push(le[0]);var Ye=le.map(function(lt){return lt.id()}).join(",");Q.indexOf(Ye)===-1&&(S.push(f.spawn(le)),Q.push(Ye))}}else break}return{distanceTo:A,pathTo:N,hasNegativeWeightCycle:w,negativeWeightCycles:S}}},$N=Math.sqrt(2),KN=function(e,n,r){r.length===0&&mn("Karger-Stein must be run on a connected (sub)graph");for(var i=r[e],l=i[1],s=i[2],u=n[l],f=n[s],c=r,h=c.length-1;h>=0;h--){var v=c[h],p=v[1],m=v[2];(n[p]===u&&n[m]===f||n[p]===f&&n[m]===u)&&c.splice(h,1)}for(var y=0;y<c.length;y++){var w=c[y];w[1]===f?(c[y]=w.slice(),c[y][1]=u):w[2]===f&&(c[y]=w.slice(),c[y][2]=u)}for(var S=0;S<n.length;S++)n[S]===f&&(n[S]=u);return c},Vv=function(e,n,r,i){for(;r>i;){var l=Math.floor(Math.random()*n.length);n=KN(l,e,n),r--}return n},YN={kargerStein:function(){var e=this,n=this.byGroup(),r=n.nodes,i=n.edges;i.unmergeBy(function(Y){return Y.isLoop()});var l=r.length,s=i.length,u=Math.ceil(Math.pow(Math.log(l)/Math.LN2,2)),f=Math.floor(l/$N);if(l<2){mn("At least 2 nodes are required for Karger-Stein algorithm");return}for(var c=[],h=0;h<s;h++){var v=i[h];c.push([h,r.indexOf(v.source()),r.indexOf(v.target())])}for(var p=1/0,m=[],y=new Array(l),w=new Array(l),S=new Array(l),x=function(Q,P){for(var I=0;I<l;I++)P[I]=Q[I]},C=0;C<=u;C++){for(var T=0;T<l;T++)w[T]=T;var A=Vv(w,c.slice(),l,f),N=A.slice();x(w,S);var k=Vv(w,A,f,2),D=Vv(S,N,f,2);k.length<=D.length&&k.length<p?(p=k.length,m=k,x(w,y)):D.length<=k.length&&D.length<p&&(p=D.length,m=D,x(S,y))}for(var O=this.spawn(m.map(function(Y){return i[Y[0]]})),L=this.spawn(),M=this.spawn(),z=y[0],B=0;B<y.length;B++){var U=y[B],V=r[B];U===z?L.merge(V):M.merge(V)}var $=function(Q){var P=e.spawn();return Q.forEach(function(I){P.merge(I),I.connectedEdges().forEach(function(K){e.contains(K)&&!O.contains(K)&&P.merge(K)})}),P},q=[$(L),$(M)],H={cut:O,components:q,partition1:L,partition2:M};return H}},$v,XN=function(e){return{x:e.x,y:e.y}},nd=function(e,n,r){return{x:e.x*n+r.x,y:e.y*n+r.y}},HS=function(e,n,r){return{x:(e.x-r.x)/n,y:(e.y-r.y)/n}},_s=function(e){return{x:e[0],y:e[1]}},ZN=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,l=n;l<r;l++){var s=e[l];isFinite(s)&&(i=Math.min(s,i))}return i},QN=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,l=n;l<r;l++){var s=e[l];isFinite(s)&&(i=Math.max(s,i))}return i},WN=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,l=0,s=n;s<r;s++){var u=e[s];isFinite(u)&&(i+=u,l++)}return i/l},JN=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(n,r):(r<e.length&&e.splice(r,e.length-r),n>0&&e.splice(0,n));for(var u=0,f=e.length-1;f>=0;f--){var c=e[f];s?isFinite(c)||(e[f]=-1/0,u++):e.splice(f,1)}l&&e.sort(function(p,m){return p-m});var h=e.length,v=Math.floor(h/2);return h%2!==0?e[v+1+u]:(e[v-1+u]+e[v+u])/2},e2=function(e){return Math.PI*e/180},Jc=function(e,n){return Math.atan2(n,e)-Math.PI/2},dm=Math.log2||function(t){return Math.log(t)/Math.log(2)},hm=function(e){return e>0?1:e<0?-1:0},Sl=function(e,n){return Math.sqrt(ml(e,n))},ml=function(e,n){var r=n.x-e.x,i=n.y-e.y;return r*r+i*i},t2=function(e){for(var n=e.length,r=0,i=0;i<n;i++)r+=e[i];for(var l=0;l<n;l++)e[l]=e[l]/r;return e},Kn=function(e,n,r,i){return(1-i)*(1-i)*e+2*(1-i)*i*n+i*i*r},Rs=function(e,n,r,i){return{x:Kn(e.x,n.x,r.x,i),y:Kn(e.y,n.y,r.y,i)}},n2=function(e,n,r,i){var l={x:n.x-e.x,y:n.y-e.y},s=Sl(e,n),u={x:l.x/s,y:l.y/s};return r=r??0,i=i??r*s,{x:e.x+u.x*i,y:e.y+u.y*i}},du=function(e,n,r){return Math.max(e,Math.min(r,n))},br=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}}},r2=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},a2=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},i2=function(e,n){e.x1=Math.min(e.x1,n.x1),e.x2=Math.max(e.x2,n.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n.y1),e.y2=Math.max(e.y2,n.y2),e.h=e.y2-e.y1},jS=function(e,n,r){e.x1=Math.min(e.x1,n),e.x2=Math.max(e.x2,n),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r),e.y2=Math.max(e.y2,r),e.h=e.y2-e.y1},wf=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=n,e.x2+=n,e.y1-=n,e.y2+=n,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Sf=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,i,l,s;if(n.length===1)r=i=l=s=n[0];else if(n.length===2)r=l=n[0],s=i=n[1];else if(n.length===4){var u=zn(n,4);r=u[0],i=u[1],l=u[2],s=u[3]}return e.x1-=s,e.x2+=i,e.y1-=r,e.y2+=l,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ox=function(e,n){e.x1=n.x1,e.y1=n.y1,e.x2=n.x2,e.y2=n.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},vm=function(e,n){return!(e.x1>n.x2||n.x1>e.x2||e.x2<n.x1||n.x2<e.x1||e.y2<n.y1||n.y2<e.y1||e.y1>n.y2||n.y1>e.y2)},Mi=function(e,n,r){return e.x1<=n&&n<=e.x2&&e.y1<=r&&r<=e.y2},ux=function(e,n){return Mi(e,n.x,n.y)},GS=function(e,n){return Mi(e,n.x1,n.y1)&&Mi(e,n.x2,n.y2)},l2=($v=Math.hypot)!==null&&$v!==void 0?$v:function(t,e){return Math.sqrt(t*t+e*e)};function s2(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var n=function(O,L){return{x:O.x+L.x,y:O.y+L.y}},r=function(O,L){return{x:O.x-L.x,y:O.y-L.y}},i=function(O,L){return{x:O.x*L,y:O.y*L}},l=function(O,L){return O.x*L.y-O.y*L.x},s=function(O){var L=l2(O.x,O.y);return L===0?{x:0,y:0}:{x:O.x/L,y:O.y/L}},u=function(O){for(var L=0,M=0;M<O.length;M++){var z=O[M],B=O[(M+1)%O.length];L+=z.x*B.y-B.x*z.y}return L/2},f=function(O,L,M,z){var B=r(L,O),U=r(z,M),V=l(B,U);if(Math.abs(V)<1e-9)return n(O,i(B,.5));var $=l(r(M,O),U)/V;return n(O,i(B,$))},c=t.map(function(D){return{x:D.x,y:D.y}});u(c)<0&&c.reverse();for(var h=c.length,v=[],p=0;p<h;p++){var m=c[p],y=c[(p+1)%h],w=r(y,m),S=s({x:w.y,y:-w.x});v.push(S)}for(var x=v.map(function(D,O){var L=n(c[O],i(D,e)),M=n(c[(O+1)%h],i(D,e));return{p1:L,p2:M}}),C=[],T=0;T<h;T++){var A=x[(T-1+h)%h],N=x[T],k=f(A.p1,A.p2,N.p1,N.p2);C.push(k)}return C}function o2(t,e,n,r,i,l){var s=m2(t,e,n,r,i),u=s2(s,l),f=br();return u.forEach(function(c){return jS(f,c.x,c.y)}),f}var VS=function(e,n,r,i,l,s,u){var f=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=f==="auto"?zi(l,s):f,h=l/2,v=s/2;c=Math.min(c,h,v);var p=c!==h,m=c!==v,y;if(p){var w=r-h+c-u,S=i-v-u,x=r+h-c+u,C=S;if(y=Oi(e,n,r,i,w,S,x,C,!1),y.length>0)return y}if(m){var T=r+h+u,A=i-v+c-u,N=T,k=i+v-c+u;if(y=Oi(e,n,r,i,T,A,N,k,!1),y.length>0)return y}if(p){var D=r-h+c-u,O=i+v+u,L=r+h-c+u,M=O;if(y=Oi(e,n,r,i,D,O,L,M,!1),y.length>0)return y}if(m){var z=r-h-u,B=i-v+c-u,U=z,V=i+v-c+u;if(y=Oi(e,n,r,i,z,B,U,V,!1),y.length>0)return y}var $;{var q=r-h+c,H=i-v+c;if($=eu(e,n,r,i,q,H,c+u),$.length>0&&$[0]<=q&&$[1]<=H)return[$[0],$[1]]}{var Y=r+h-c,Q=i-v+c;if($=eu(e,n,r,i,Y,Q,c+u),$.length>0&&$[0]>=Y&&$[1]<=Q)return[$[0],$[1]]}{var P=r+h-c,I=i+v-c;if($=eu(e,n,r,i,P,I,c+u),$.length>0&&$[0]>=P&&$[1]>=I)return[$[0],$[1]]}{var K=r-h+c,F=i+v-c;if($=eu(e,n,r,i,K,F,c+u),$.length>0&&$[0]<=K&&$[1]>=F)return[$[0],$[1]]}return[]},u2=function(e,n,r,i,l,s,u){var f=u,c=Math.min(r,l),h=Math.max(r,l),v=Math.min(i,s),p=Math.max(i,s);return c-f<=e&&e<=h+f&&v-f<=n&&n<=p+f},c2=function(e,n,r,i,l,s,u,f,c){var h={x1:Math.min(r,u,l)-c,x2:Math.max(r,u,l)+c,y1:Math.min(i,f,s)-c,y2:Math.max(i,f,s)+c};return!(e<h.x1||e>h.x2||n<h.y1||n>h.y2)},f2=function(e,n,r,i){r-=i;var l=n*n-4*e*r;if(l<0)return[];var s=Math.sqrt(l),u=2*e,f=(-n+s)/u,c=(-n-s)/u;return[f,c]},d2=function(e,n,r,i,l){var s=1e-5;e===0&&(e=s),n/=e,r/=e,i/=e;var u,f,c,h,v,p,m,y;if(f=(3*r-n*n)/9,c=-(27*i)+n*(9*r-2*(n*n)),c/=54,u=f*f*f+c*c,l[1]=0,m=n/3,u>0){v=c+Math.sqrt(u),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),p=c-Math.sqrt(u),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),l[0]=-m+v+p,m+=(v+p)/2,l[4]=l[2]=-m,m=Math.sqrt(3)*(-p+v)/2,l[3]=m,l[5]=-m;return}if(l[5]=l[3]=0,u===0){y=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),l[0]=-m+2*y,l[4]=l[2]=-(y+m);return}f=-f,h=f*f*f,h=Math.acos(c/Math.sqrt(h)),y=2*Math.sqrt(f),l[0]=-m+y*Math.cos(h/3),l[2]=-m+y*Math.cos((h+2*Math.PI)/3),l[4]=-m+y*Math.cos((h+4*Math.PI)/3)},h2=function(e,n,r,i,l,s,u,f){var c=1*r*r-4*r*l+2*r*u+4*l*l-4*l*u+u*u+i*i-4*i*s+2*i*f+4*s*s-4*s*f+f*f,h=9*r*l-3*r*r-3*r*u-6*l*l+3*l*u+9*i*s-3*i*i-3*i*f-6*s*s+3*s*f,v=3*r*r-6*r*l+r*u-r*e+2*l*l+2*l*e-u*e+3*i*i-6*i*s+i*f-i*n+2*s*s+2*s*n-f*n,p=1*r*l-r*r+r*e-l*e+i*s-i*i+i*n-s*n,m=[];d2(c,h,v,p,m);for(var y=1e-7,w=[],S=0;S<6;S+=2)Math.abs(m[S+1])<y&&m[S]>=0&&m[S]<=1&&w.push(m[S]);w.push(1),w.push(0);for(var x=-1,C,T,A,N=0;N<w.length;N++)C=Math.pow(1-w[N],2)*r+2*(1-w[N])*w[N]*l+w[N]*w[N]*u,T=Math.pow(1-w[N],2)*i+2*(1-w[N])*w[N]*s+w[N]*w[N]*f,A=Math.pow(C-e,2)+Math.pow(T-n,2),x>=0?A<x&&(x=A):x=A;return x},v2=function(e,n,r,i,l,s){var u=[e-r,n-i],f=[l-r,s-i],c=f[0]*f[0]+f[1]*f[1],h=u[0]*u[0]+u[1]*u[1],v=u[0]*f[0]+u[1]*f[1],p=v*v/c;return v<0?h:p>c?(e-l)*(e-l)+(n-s)*(n-s):h-p},Nr=function(e,n,r){for(var i,l,s,u,f,c=0,h=0;h<r.length/2;h++)if(i=r[h*2],l=r[h*2+1],h+1<r.length/2?(s=r[(h+1)*2],u=r[(h+1)*2+1]):(s=r[(h+1-r.length/2)*2],u=r[(h+1-r.length/2)*2+1]),!(i==e&&s==e))if(i>=e&&e>=s||i<=e&&e<=s)f=(e-i)/(s-i)*(u-l)+l,f>n&&c++;else continue;return c%2!==0},Xa=function(e,n,r,i,l,s,u,f,c){var h=new Array(r.length),v;f[0]!=null?(v=Math.atan(f[1]/f[0]),f[0]<0?v=v+Math.PI/2:v=-v-Math.PI/2):v=f;for(var p=Math.cos(-v),m=Math.sin(-v),y=0;y<h.length/2;y++)h[y*2]=s/2*(r[y*2]*p-r[y*2+1]*m),h[y*2+1]=u/2*(r[y*2+1]*p+r[y*2]*m),h[y*2]+=i,h[y*2+1]+=l;var w;if(c>0){var S=zf(h,-c);w=If(S)}else w=h;return Nr(e,n,w)},g2=function(e,n,r,i,l,s,u,f){for(var c=new Array(r.length*2),h=0;h<f.length;h++){var v=f[h];c[h*4+0]=v.startX,c[h*4+1]=v.startY,c[h*4+2]=v.stopX,c[h*4+3]=v.stopY;var p=Math.pow(v.cx-e,2)+Math.pow(v.cy-n,2);if(p<=Math.pow(v.radius,2))return!0}return Nr(e,n,c)},If=function(e){for(var n=new Array(e.length/2),r,i,l,s,u,f,c,h,v=0;v<e.length/4;v++){r=e[v*4],i=e[v*4+1],l=e[v*4+2],s=e[v*4+3],v<e.length/4-1?(u=e[(v+1)*4],f=e[(v+1)*4+1],c=e[(v+1)*4+2],h=e[(v+1)*4+3]):(u=e[0],f=e[1],c=e[2],h=e[3]);var p=Oi(r,i,l,s,u,f,c,h,!0);n[v*2]=p[0],n[v*2+1]=p[1]}return n},zf=function(e,n){for(var r=new Array(e.length*2),i,l,s,u,f=0;f<e.length/2;f++){i=e[f*2],l=e[f*2+1],f<e.length/2-1?(s=e[(f+1)*2],u=e[(f+1)*2+1]):(s=e[0],u=e[1]);var c=u-l,h=-(s-i),v=Math.sqrt(c*c+h*h),p=c/v,m=h/v;r[f*4]=i+p*n,r[f*4+1]=l+m*n,r[f*4+2]=s+p*n,r[f*4+3]=u+m*n}return r},p2=function(e,n,r,i,l,s){var u=r-e,f=i-n;u/=l,f/=s;var c=Math.sqrt(u*u+f*f),h=c-1;if(h<0)return[];var v=h/c;return[(r-e)*v+e,(i-n)*v+n]},xl=function(e,n,r,i,l,s,u){return e-=l,n-=s,e/=r/2+u,n/=i/2+u,e*e+n*n<=1},eu=function(e,n,r,i,l,s,u){var f=[r-e,i-n],c=[e-l,n-s],h=f[0]*f[0]+f[1]*f[1],v=2*(c[0]*f[0]+c[1]*f[1]),p=c[0]*c[0]+c[1]*c[1]-u*u,m=v*v-4*h*p;if(m<0)return[];var y=(-v+Math.sqrt(m))/(2*h),w=(-v-Math.sqrt(m))/(2*h),S=Math.min(y,w),x=Math.max(y,w),C=[];if(S>=0&&S<=1&&C.push(S),x>=0&&x<=1&&C.push(x),C.length===0)return[];var T=C[0]*f[0]+e,A=C[0]*f[1]+n;if(C.length>1){if(C[0]==C[1])return[T,A];var N=C[1]*f[0]+e,k=C[1]*f[1]+n;return[T,A,N,k]}else return[T,A]},Kv=function(e,n,r){return n<=e&&e<=r||r<=e&&e<=n?e:e<=n&&n<=r||r<=n&&n<=e?n:r},Oi=function(e,n,r,i,l,s,u,f,c){var h=e-l,v=r-e,p=u-l,m=n-s,y=i-n,w=f-s,S=p*m-w*h,x=v*m-y*h,C=w*v-p*y;if(C!==0){var T=S/C,A=x/C,N=.001,k=0-N,D=1+N;return k<=T&&T<=D&&k<=A&&A<=D?[e+T*v,n+T*y]:c?[e+T*v,n+T*y]:[]}else return S===0||x===0?Kv(e,r,u)===u?[u,f]:Kv(e,r,l)===l?[l,s]:Kv(l,u,r)===r?[r,i]:[]:[]},m2=function(e,n,r,i,l){var s=[],u=i/2,f=l/2,c=n,h=r;s.push({x:c+u*e[0],y:h+f*e[1]});for(var v=1;v<e.length/2;v++)s.push({x:c+u*e[v*2],y:h+f*e[v*2+1]});return s},hu=function(e,n,r,i,l,s,u,f){var c=[],h,v=new Array(r.length),p=!0;s==null&&(p=!1);var m;if(p){for(var y=0;y<v.length/2;y++)v[y*2]=r[y*2]*s+i,v[y*2+1]=r[y*2+1]*u+l;if(f>0){var w=zf(v,-f);m=If(w)}else m=v}else m=r;for(var S,x,C,T,A=0;A<m.length/2;A++)S=m[A*2],x=m[A*2+1],A<m.length/2-1?(C=m[(A+1)*2],T=m[(A+1)*2+1]):(C=m[0],T=m[1]),h=Oi(e,n,i,l,S,x,C,T),h.length!==0&&c.push(h[0],h[1]);return c},y2=function(e,n,r,i,l,s,u,f,c){var h=[],v,p=new Array(r.length*2);c.forEach(function(C,T){T===0?(p[p.length-2]=C.startX,p[p.length-1]=C.startY):(p[T*4-2]=C.startX,p[T*4-1]=C.startY),p[T*4]=C.stopX,p[T*4+1]=C.stopY,v=eu(e,n,i,l,C.cx,C.cy,C.radius),v.length!==0&&h.push(v[0],v[1])});for(var m=0;m<p.length/4;m++)v=Oi(e,n,i,l,p[m*4],p[m*4+1],p[m*4+2],p[m*4+3],!1),v.length!==0&&h.push(v[0],v[1]);if(h.length>2){for(var y=[h[0],h[1]],w=Math.pow(y[0]-e,2)+Math.pow(y[1]-n,2),S=1;S<h.length/2;S++){var x=Math.pow(h[S*2]-e,2)+Math.pow(h[S*2+1]-n,2);x<=w&&(y[0]=h[S*2],y[1]=h[S*2+1],w=x)}return y}return h},ef=function(e,n,r){var i=[e[0]-n[0],e[1]-n[1]],l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=(l-r)/l;return s<0&&(s=1e-5),[n[0]+s*i[0],n[1]+s*i[1]]},pr=function(e,n){var r=Ap(e,n);return r=$S(r),r},$S=function(e){for(var n,r,i=e.length/2,l=1/0,s=1/0,u=-1/0,f=-1/0,c=0;c<i;c++)n=e[2*c],r=e[2*c+1],l=Math.min(l,n),u=Math.max(u,n),s=Math.min(s,r),f=Math.max(f,r);for(var h=2/(u-l),v=2/(f-s),p=0;p<i;p++)n=e[2*p]=e[2*p]*h,r=e[2*p+1]=e[2*p+1]*v,l=Math.min(l,n),u=Math.max(u,n),s=Math.min(s,r),f=Math.max(f,r);if(s<-1)for(var m=0;m<i;m++)r=e[2*m+1]=e[2*m+1]+(-1-s);return e},Ap=function(e,n){var r=1/e*2*Math.PI,i=e%2===0?Math.PI/2+r/2:Math.PI/2;i+=n;for(var l=new Array(e*2),s,u=0;u<e;u++)s=u*r+i,l[2*u]=Math.cos(s),l[2*u+1]=Math.sin(-s);return l},zi=function(e,n){return Math.min(e/4,n/4,8)},KS=function(e,n){return Math.min(e/10,n/10,8)},gm=function(){return 8},b2=function(e,n,r){return[e-2*n+r,2*(n-e),e]},_p=function(e,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Yv(t,e){function n(v){for(var p=[],m=0;m<v.length;m++){var y=v[m],w=v[(m+1)%v.length],S={x:w.x-y.x,y:w.y-y.y},x={x:-S.y,y:S.x},C=Math.sqrt(x.x*x.x+x.y*x.y);p.push({x:x.x/C,y:x.y/C})}return p}function r(v,p){var m=1/0,y=-1/0,w=Rr(v),S;try{for(w.s();!(S=w.n()).done;){var x=S.value,C=x.x*p.x+x.y*p.y;m=Math.min(m,C),y=Math.max(y,C)}}catch(T){w.e(T)}finally{w.f()}return{min:m,max:y}}function i(v,p){return!(v.max<p.min||p.max<v.min)}var l=[].concat(Of(n(t)),Of(n(e))),s=Rr(l),u;try{for(s.s();!(u=s.n()).done;){var f=u.value,c=r(t,f),h=r(e,f);if(!i(c,h))return!1}}catch(v){s.e(v)}finally{s.f()}return!0}var E2=ir({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),x2={pageRank:function(e){for(var n=E2(e),r=n.dampingFactor,i=n.precision,l=n.iterations,s=n.weight,u=this._private.cy,f=this.byGroup(),c=f.nodes,h=f.edges,v=c.length,p=v*v,m=h.length,y=new Array(p),w=new Array(v),S=(1-r)/v,x=0;x<v;x++){for(var C=0;C<v;C++){var T=x*v+C;y[T]=0}w[x]=0}for(var A=0;A<m;A++){var N=h[A],k=N.data("source"),D=N.data("target");if(k!==D){var O=c.indexOfId(k),L=c.indexOfId(D),M=s(N),z=L*v+O;y[z]+=M,w[O]+=M}}for(var B=1/v+S,U=0;U<v;U++)if(w[U]===0)for(var V=0;V<v;V++){var $=V*v+U;y[$]=B}else for(var q=0;q<v;q++){var H=q*v+U;y[H]=y[H]/w[U]+S}for(var Y=new Array(v),Q=new Array(v),P,I=0;I<v;I++)Y[I]=1;for(var K=0;K<l;K++){for(var F=0;F<v;F++)Q[F]=0;for(var J=0;J<v;J++)for(var re=0;re<v;re++){var se=J*v+re;Q[J]+=y[se]*Y[re]}t2(Q),P=Y,Y=Q,Q=P;for(var me=0,Ne=0;Ne<v;Ne++){var pe=P[Ne]-Y[Ne];me+=pe*pe}if(me<i)break}var ee={rank:function(de){return de=u.collection(de)[0],Y[c.indexOf(de)]}};return ee}},cx=ir({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ms={degreeCentralityNormalized:function(e){e=cx(e);var n=this.cy(),r=this.nodes(),i=r.length;if(e.directed){for(var h={},v={},p=0,m=0,y=0;y<i;y++){var w=r[y],S=w.id();e.root=w;var x=this.degreeCentrality(e);p<x.indegree&&(p=x.indegree),m<x.outdegree&&(m=x.outdegree),h[S]=x.indegree,v[S]=x.outdegree}return{indegree:function(T){return p==0?0:(st(T)&&(T=n.filter(T)),h[T.id()]/p)},outdegree:function(T){return m===0?0:(st(T)&&(T=n.filter(T)),v[T.id()]/m)}}}else{for(var l={},s=0,u=0;u<i;u++){var f=r[u];e.root=f;var c=this.degreeCentrality(e);s<c.degree&&(s=c.degree),l[f.id()]=c.degree}return{degree:function(T){return s===0?0:(st(T)&&(T=n.filter(T)),l[T.id()]/s)}}}},degreeCentrality:function(e){e=cx(e);var n=this.cy(),r=this,i=e,l=i.root,s=i.weight,u=i.directed,f=i.alpha;if(l=n.collection(l)[0],u){for(var m=l.connectedEdges(),y=m.filter(function(k){return k.target().same(l)&&r.has(k)}),w=m.filter(function(k){return k.source().same(l)&&r.has(k)}),S=y.length,x=w.length,C=0,T=0,A=0;A<y.length;A++)C+=s(y[A]);for(var N=0;N<w.length;N++)T+=s(w[N]);return{indegree:Math.pow(S,1-f)*Math.pow(C,f),outdegree:Math.pow(x,1-f)*Math.pow(T,f)}}else{for(var c=l.connectedEdges().intersection(r),h=c.length,v=0,p=0;p<c.length;p++)v+=s(c[p]);return{degree:Math.pow(h,1-f)*Math.pow(v,f)}}}};Ms.dc=Ms.degreeCentrality;Ms.dcn=Ms.degreeCentralityNormalised=Ms.degreeCentralityNormalized;var fx=ir({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Os={closenessCentralityNormalized:function(e){for(var n=fx(e),r=n.harmonic,i=n.weight,l=n.directed,s=this.cy(),u={},f=0,c=this.nodes(),h=this.floydWarshall({weight:i,directed:l}),v=0;v<c.length;v++){for(var p=0,m=c[v],y=0;y<c.length;y++)if(v!==y){var w=h.distance(m,c[y]);r?p+=1/w:p+=w}r||(p=1/p),f<p&&(f=p),u[m.id()]=p}return{closeness:function(x){return f==0?0:(st(x)?x=s.filter(x)[0].id():x=x.id(),u[x]/f)}}},closenessCentrality:function(e){var n=fx(e),r=n.root,i=n.weight,l=n.directed,s=n.harmonic;r=this.filter(r)[0];for(var u=this.dijkstra({root:r,weight:i,directed:l}),f=0,c=this.nodes(),h=0;h<c.length;h++){var v=c[h];if(!v.same(r)){var p=u.distanceTo(v);s?f+=1/p:f+=p}}return s?f:1/f}};Os.cc=Os.closenessCentrality;Os.ccn=Os.closenessCentralityNormalised=Os.closenessCentralityNormalized;var w2=ir({weight:null,directed:!1}),kp={betweennessCentrality:function(e){for(var n=w2(e),r=n.directed,i=n.weight,l=i!=null,s=this.cy(),u=this.nodes(),f={},c={},h=0,v={set:function(T,A){c[T]=A,A>h&&(h=A)},get:function(T){return c[T]}},p=0;p<u.length;p++){var m=u[p],y=m.id();r?f[y]=m.outgoers().nodes():f[y]=m.openNeighborhood().nodes(),v.set(y,0)}for(var w=function(){for(var T=u[S].id(),A=[],N={},k={},D={},O=new _u(function(J,re){return D[J]-D[re]}),L=0;L<u.length;L++){var M=u[L].id();N[M]=[],k[M]=0,D[M]=1/0}for(k[T]=1,D[T]=0,O.push(T);!O.empty();){var z=O.pop();if(A.push(z),l)for(var B=0;B<f[z].length;B++){var U=f[z][B],V=s.getElementById(z),$=void 0;V.edgesTo(U).length>0?$=V.edgesTo(U)[0]:$=U.edgesTo(V)[0];var q=i($);U=U.id(),D[U]>D[z]+q&&(D[U]=D[z]+q,O.nodes.indexOf(U)<0?O.push(U):O.updateItem(U),k[U]=0,N[U]=[]),D[U]==D[z]+q&&(k[U]=k[U]+k[z],N[U].push(z))}else for(var H=0;H<f[z].length;H++){var Y=f[z][H].id();D[Y]==1/0&&(O.push(Y),D[Y]=D[z]+1),D[Y]==D[z]+1&&(k[Y]=k[Y]+k[z],N[Y].push(z))}}for(var Q={},P=0;P<u.length;P++)Q[u[P].id()]=0;for(;A.length>0;){for(var I=A.pop(),K=0;K<N[I].length;K++){var F=N[I][K];Q[F]=Q[F]+k[F]/k[I]*(1+Q[I])}I!=u[S].id()&&v.set(I,v.get(I)+Q[I])}},S=0;S<u.length;S++)w();var x={betweenness:function(T){var A=s.collection(T).id();return v.get(A)},betweennessNormalized:function(T){if(h==0)return 0;var A=s.collection(T).id();return v.get(A)/h}};return x.betweennessNormalised=x.betweennessNormalized,x}};kp.bc=kp.betweennessCentrality;var S2=ir({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),C2=function(e){return S2(e)},T2=function(e,n){for(var r=0,i=0;i<n.length;i++)r+=n[i](e);return r},D2=function(e,n,r){for(var i=0;i<n;i++)e[i*n+i]=r},YS=function(e,n){for(var r,i=0;i<n;i++){r=0;for(var l=0;l<n;l++)r+=e[l*n+i];for(var s=0;s<n;s++)e[s*n+i]=e[s*n+i]/r}},A2=function(e,n,r){for(var i=new Array(r*r),l=0;l<r;l++){for(var s=0;s<r;s++)i[l*r+s]=0;for(var u=0;u<r;u++)for(var f=0;f<r;f++)i[l*r+f]+=e[l*r+u]*n[u*r+f]}return i},_2=function(e,n,r){for(var i=e.slice(0),l=1;l<r;l++)e=A2(e,i,n);return e},k2=function(e,n,r){for(var i=new Array(n*n),l=0;l<n*n;l++)i[l]=Math.pow(e[l],r);return YS(i,n),i},N2=function(e,n,r,i){for(var l=0;l<r;l++){var s=Math.round(e[l]*Math.pow(10,i))/Math.pow(10,i),u=Math.round(n[l]*Math.pow(10,i))/Math.pow(10,i);if(s!==u)return!1}return!0},R2=function(e,n,r,i){for(var l=[],s=0;s<n;s++){for(var u=[],f=0;f<n;f++)Math.round(e[s*n+f]*1e3)/1e3>0&&u.push(r[f]);u.length!==0&&l.push(i.collection(u))}return l},M2=function(e,n){for(var r=0;r<e.length;r++)if(!n[r]||e[r].id()!==n[r].id())return!1;return!0},O2=function(e){for(var n=0;n<e.length;n++)for(var r=0;r<e.length;r++)n!=r&&M2(e[n],e[r])&&e.splice(r,1);return e},dx=function(e){for(var n=this.nodes(),r=this.edges(),i=this.cy(),l=C2(e),s={},u=0;u<n.length;u++)s[n[u].id()]=u;for(var f=n.length,c=f*f,h=new Array(c),v,p=0;p<c;p++)h[p]=0;for(var m=0;m<r.length;m++){var y=r[m],w=s[y.source().id()],S=s[y.target().id()],x=T2(y,l.attributes);h[w*f+S]+=x,h[S*f+w]+=x}D2(h,f,l.multFactor),YS(h,f);for(var C=!0,T=0;C&&T<l.maxIterations;)C=!1,v=_2(h,f,l.expandFactor),h=k2(v,f,l.inflateFactor),N2(h,v,c,4)||(C=!0),T++;var A=R2(h,f,n,i);return A=O2(A),A},B2={markovClustering:dx,mcl:dx},L2=function(e){return e},XS=function(e,n){return Math.abs(n-e)},hx=function(e,n,r){return e+XS(n,r)},vx=function(e,n,r){return e+Math.pow(r-n,2)},F2=function(e){return Math.sqrt(e)},I2=function(e,n,r){return Math.max(e,XS(n,r))},qo=function(e,n,r,i,l){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:L2,u=i,f,c,h=0;h<e;h++)f=n(h),c=r(h),u=l(u,f,c);return s(u)},Is={euclidean:function(e,n,r){return e>=2?qo(e,n,r,0,vx,F2):qo(e,n,r,0,hx)},squaredEuclidean:function(e,n,r){return qo(e,n,r,0,vx)},manhattan:function(e,n,r){return qo(e,n,r,0,hx)},max:function(e,n,r){return qo(e,n,r,-1/0,I2)}};Is["squared-euclidean"]=Is.squaredEuclidean;Is.squaredeuclidean=Is.squaredEuclidean;function rd(t,e,n,r,i,l){var s;return wn(t)?s=t:s=Is[t]||Is.euclidean,e===0&&wn(t)?s(i,l):s(e,n,r,i,l)}var z2=ir({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),pm=function(e){return z2(e)},Pf=function(e,n,r,i,l){var s=l!=="kMedoids",u=s?function(v){return r[v]}:function(v){return i[v](r)},f=function(p){return i[p](n)},c=r,h=n;return rd(e,i.length,u,f,c,h)},Xv=function(e,n,r){for(var i=r.length,l=new Array(i),s=new Array(i),u=new Array(n),f=null,c=0;c<i;c++)l[c]=e.min(r[c]).value,s[c]=e.max(r[c]).value;for(var h=0;h<n;h++){f=[];for(var v=0;v<i;v++)f[v]=Math.random()*(s[v]-l[v])+l[v];u[h]=f}return u},ZS=function(e,n,r,i,l){for(var s=1/0,u=0,f=0;f<n.length;f++){var c=Pf(r,e,n[f],i,l);c<s&&(s=c,u=f)}return u},QS=function(e,n,r){for(var i=[],l=null,s=0;s<n.length;s++)l=n[s],r[l.id()]===e&&i.push(l);return i},P2=function(e,n,r){return Math.abs(n-e)<=r},U2=function(e,n,r){for(var i=0;i<e.length;i++)for(var l=0;l<e[i].length;l++){var s=Math.abs(e[i][l]-n[i][l]);if(s>r)return!1}return!0},q2=function(e,n,r){for(var i=0;i<r;i++)if(e===n[i])return!0;return!1},gx=function(e,n){var r=new Array(n);if(e.length<50)for(var i=0;i<n;i++){for(var l=e[Math.floor(Math.random()*e.length)];q2(l,r,i);)l=e[Math.floor(Math.random()*e.length)];r[i]=l}else for(var s=0;s<n;s++)r[s]=e[Math.floor(Math.random()*e.length)];return r},px=function(e,n,r){for(var i=0,l=0;l<n.length;l++)i+=Pf("manhattan",n[l],e,r,"kMedoids");return i},H2=function(e){var n=this.cy(),r=this.nodes(),i=null,l=pm(e),s=new Array(l.k),u={},f;l.testMode?typeof l.testCentroids=="number"?(l.testCentroids,f=Xv(r,l.k,l.attributes)):Hn(l.testCentroids)==="object"?f=l.testCentroids:f=Xv(r,l.k,l.attributes):f=Xv(r,l.k,l.attributes);for(var c=!0,h=0;c&&h<l.maxIterations;){for(var v=0;v<r.length;v++)i=r[v],u[i.id()]=ZS(i,f,l.distance,l.attributes,"kMeans");c=!1;for(var p=0;p<l.k;p++){var m=QS(p,r,u);if(m.length!==0){for(var y=l.attributes.length,w=f[p],S=new Array(y),x=new Array(y),C=0;C<y;C++){x[C]=0;for(var T=0;T<m.length;T++)i=m[T],x[C]+=l.attributes[C](i);S[C]=x[C]/m.length,P2(S[C],w[C],l.sensitivityThreshold)||(c=!0)}f[p]=S,s[p]=n.collection(m)}}h++}return s},j2=function(e){var n=this.cy(),r=this.nodes(),i=null,l=pm(e),s=new Array(l.k),u,f={},c,h=new Array(l.k);l.testMode?typeof l.testCentroids=="number"||(Hn(l.testCentroids)==="object"?u=l.testCentroids:u=gx(r,l.k)):u=gx(r,l.k);for(var v=!0,p=0;v&&p<l.maxIterations;){for(var m=0;m<r.length;m++)i=r[m],f[i.id()]=ZS(i,u,l.distance,l.attributes,"kMedoids");v=!1;for(var y=0;y<u.length;y++){var w=QS(y,r,f);if(w.length!==0){h[y]=px(u[y],w,l.attributes);for(var S=0;S<w.length;S++)c=px(w[S],w,l.attributes),c<h[y]&&(h[y]=c,u[y]=w[S],v=!0);s[y]=n.collection(w)}}p++}return s},G2=function(e,n,r,i,l){for(var s,u,f=0;f<n.length;f++)for(var c=0;c<e.length;c++)i[f][c]=Math.pow(r[f][c],l.m);for(var h=0;h<e.length;h++)for(var v=0;v<l.attributes.length;v++){s=0,u=0;for(var p=0;p<n.length;p++)s+=i[p][h]*l.attributes[v](n[p]),u+=i[p][h];e[h][v]=s/u}},V2=function(e,n,r,i,l){for(var s=0;s<e.length;s++)n[s]=e[s].slice();for(var u,f,c,h=2/(l.m-1),v=0;v<r.length;v++)for(var p=0;p<i.length;p++){u=0;for(var m=0;m<r.length;m++)f=Pf(l.distance,i[p],r[v],l.attributes,"cmeans"),c=Pf(l.distance,i[p],r[m],l.attributes,"cmeans"),u+=Math.pow(f/c,h);e[p][v]=1/u}},$2=function(e,n,r,i){for(var l=new Array(r.k),s=0;s<l.length;s++)l[s]=[];for(var u,f,c=0;c<n.length;c++){u=-1/0,f=-1;for(var h=0;h<n[0].length;h++)n[c][h]>u&&(u=n[c][h],f=h);l[f].push(e[c])}for(var v=0;v<l.length;v++)l[v]=i.collection(l[v]);return l},mx=function(e){var n=this.cy(),r=this.nodes(),i=pm(e),l,s,u,f,c;f=new Array(r.length);for(var h=0;h<r.length;h++)f[h]=new Array(i.k);u=new Array(r.length);for(var v=0;v<r.length;v++)u[v]=new Array(i.k);for(var p=0;p<r.length;p++){for(var m=0,y=0;y<i.k;y++)u[p][y]=Math.random(),m+=u[p][y];for(var w=0;w<i.k;w++)u[p][w]=u[p][w]/m}s=new Array(i.k);for(var S=0;S<i.k;S++)s[S]=new Array(i.attributes.length);c=new Array(r.length);for(var x=0;x<r.length;x++)c[x]=new Array(i.k);for(var C=!0,T=0;C&&T<i.maxIterations;)C=!1,G2(s,r,u,c,i),V2(u,f,s,r,i),U2(u,f,i.sensitivityThreshold)||(C=!0),T++;return l=$2(r,u,i,n),{clusters:l,degreeOfMembership:u}},K2={kMeans:H2,kMedoids:j2,fuzzyCMeans:mx,fcm:mx},Y2=ir({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),X2={single:"min",complete:"max"},Z2=function(e){var n=Y2(e),r=X2[n.linkage];return r!=null&&(n.linkage=r),n},yx=function(e,n,r,i,l){for(var s=0,u=1/0,f,c=l.attributes,h=function(L,M){return rd(l.distance,c.length,function(z){return c[z](L)},function(z){return c[z](M)},L,M)},v=0;v<e.length;v++){var p=e[v].key,m=r[p][i[p]];m<u&&(s=p,u=m)}if(l.mode==="threshold"&&u>=l.threshold||l.mode==="dendrogram"&&e.length===1)return!1;var y=n[s],w=n[i[s]],S;l.mode==="dendrogram"?S={left:y,right:w,key:y.key}:S={value:y.value.concat(w.value),key:y.key},e[y.index]=S,e.splice(w.index,1),n[y.key]=S;for(var x=0;x<e.length;x++){var C=e[x];y.key===C.key?f=1/0:l.linkage==="min"?(f=r[y.key][C.key],r[y.key][C.key]>r[w.key][C.key]&&(f=r[w.key][C.key])):l.linkage==="max"?(f=r[y.key][C.key],r[y.key][C.key]<r[w.key][C.key]&&(f=r[w.key][C.key])):l.linkage==="mean"?f=(r[y.key][C.key]*y.size+r[w.key][C.key]*w.size)/(y.size+w.size):l.mode==="dendrogram"?f=h(C.value,y.value):f=h(C.value[0],y.value[0]),r[y.key][C.key]=r[C.key][y.key]=f}for(var T=0;T<e.length;T++){var A=e[T].key;if(i[A]===y.key||i[A]===w.key){for(var N=A,k=0;k<e.length;k++){var D=e[k].key;r[A][D]<r[A][N]&&(N=D)}i[A]=N}e[T].index=T}return y.key=w.key=y.index=w.index=null,!0},ks=function(e,n,r){e&&(e.value?n.push(e.value):(e.left&&ks(e.left,n),e.right&&ks(e.right,n)))},Np=function(e,n){if(!e)return"";if(e.left&&e.right){var r=Np(e.left,n),i=Np(e.right,n),l=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:l.id()}}),n.add({group:"edges",data:{source:i,target:l.id()}}),l.id()}else if(e.value)return e.value.id()},Rp=function(e,n,r){if(!e)return[];var i=[],l=[],s=[];return n===0?(e.left&&ks(e.left,i),e.right&&ks(e.right,l),s=i.concat(l),[r.collection(s)]):n===1?e.value?[r.collection(e.value)]:(e.left&&ks(e.left,i),e.right&&ks(e.right,l),[r.collection(i),r.collection(l)]):e.value?[r.collection(e.value)]:(e.left&&(i=Rp(e.left,n-1,r)),e.right&&(l=Rp(e.right,n-1,r)),i.concat(l))},bx=function(e){for(var n=this.cy(),r=this.nodes(),i=Z2(e),l=i.attributes,s=function(T,A){return rd(i.distance,l.length,function(N){return l[N](T)},function(N){return l[N](A)},T,A)},u=[],f=[],c=[],h=[],v=0;v<r.length;v++){var p={value:i.mode==="dendrogram"?r[v]:[r[v]],key:v,index:v};u[v]=p,h[v]=p,f[v]=[],c[v]=0}for(var m=0;m<u.length;m++)for(var y=0;y<=m;y++){var w=void 0;i.mode==="dendrogram"?w=m===y?1/0:s(u[m].value,u[y].value):w=m===y?1/0:s(u[m].value[0],u[y].value[0]),f[m][y]=w,f[y][m]=w,w<f[m][c[m]]&&(c[m]=y)}for(var S=yx(u,h,f,c,i);S;)S=yx(u,h,f,c,i);var x;return i.mode==="dendrogram"?(x=Rp(u[0],i.dendrogramDepth,n),i.addDendrogram&&Np(u[0],n)):(x=new Array(u.length),u.forEach(function(C,T){C.key=C.index=null,x[T]=n.collection(C.value)})),x},Q2={hierarchicalClustering:bx,hca:bx},W2=ir({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),J2=function(e){var n=e.damping,r=e.preference;.5<=n&&n<1||mn("Damping must range on [0.5, 1). Got: ".concat(n));var i=["median","mean","min","max"];return i.some(function(l){return l===r})||je(r)||mn("Preference must be one of [".concat(i.map(function(l){return"'".concat(l,"'")}).join(", "),"] or a number. Got: ").concat(r)),W2(e)},eR=function(e,n,r,i){var l=function(u,f){return i[f](u)};return-rd(e,i.length,function(s){return l(n,s)},function(s){return l(r,s)},n,r)},tR=function(e,n){var r=null;return n==="median"?r=JN(e):n==="mean"?r=WN(e):n==="min"?r=ZN(e):n==="max"?r=QN(e):r=n,r},nR=function(e,n,r){for(var i=[],l=0;l<e;l++)n[l*e+l]+r[l*e+l]>0&&i.push(l);return i},Ex=function(e,n,r){for(var i=[],l=0;l<e;l++){for(var s=-1,u=-1/0,f=0;f<r.length;f++){var c=r[f];n[l*e+c]>u&&(s=c,u=n[l*e+c])}s>0&&i.push(s)}for(var h=0;h<r.length;h++)i[r[h]]=r[h];return i},rR=function(e,n,r){for(var i=Ex(e,n,r),l=0;l<r.length;l++){for(var s=[],u=0;u<i.length;u++)i[u]===r[l]&&s.push(u);for(var f=-1,c=-1/0,h=0;h<s.length;h++){for(var v=0,p=0;p<s.length;p++)v+=n[s[p]*e+s[h]];v>c&&(f=h,c=v)}r[l]=s[f]}return i=Ex(e,n,r),i},xx=function(e){for(var n=this.cy(),r=this.nodes(),i=J2(e),l={},s=0;s<r.length;s++)l[r[s].id()]=s;var u,f,c,h,v,p;u=r.length,f=u*u,c=new Array(f);for(var m=0;m<f;m++)c[m]=-1/0;for(var y=0;y<u;y++)for(var w=0;w<u;w++)y!==w&&(c[y*u+w]=eR(i.distance,r[y],r[w],i.attributes));h=tR(c,i.preference);for(var S=0;S<u;S++)c[S*u+S]=h;v=new Array(f);for(var x=0;x<f;x++)v[x]=0;p=new Array(f);for(var C=0;C<f;C++)p[C]=0;for(var T=new Array(u),A=new Array(u),N=new Array(u),k=0;k<u;k++)T[k]=0,A[k]=0,N[k]=0;for(var D=new Array(u*i.minIterations),O=0;O<D.length;O++)D[O]=0;var L;for(L=0;L<i.maxIterations;L++){for(var M=0;M<u;M++){for(var z=-1/0,B=-1/0,U=-1,V=0,$=0;$<u;$++)T[$]=v[M*u+$],V=p[M*u+$]+c[M*u+$],V>=z?(B=z,z=V,U=$):V>B&&(B=V);for(var q=0;q<u;q++)v[M*u+q]=(1-i.damping)*(c[M*u+q]-z)+i.damping*T[q];v[M*u+U]=(1-i.damping)*(c[M*u+U]-B)+i.damping*T[U]}for(var H=0;H<u;H++){for(var Y=0,Q=0;Q<u;Q++)T[Q]=p[Q*u+H],A[Q]=Math.max(0,v[Q*u+H]),Y+=A[Q];Y-=A[H],A[H]=v[H*u+H],Y+=A[H];for(var P=0;P<u;P++)p[P*u+H]=(1-i.damping)*Math.min(0,Y-A[P])+i.damping*T[P];p[H*u+H]=(1-i.damping)*(Y-A[H])+i.damping*T[H]}for(var I=0,K=0;K<u;K++){var F=p[K*u+K]+v[K*u+K]>0?1:0;D[L%i.minIterations*u+K]=F,I+=F}if(I>0&&(L>=i.minIterations-1||L==i.maxIterations-1)){for(var J=0,re=0;re<u;re++){N[re]=0;for(var se=0;se<i.minIterations;se++)N[re]+=D[se*u+re];(N[re]===0||N[re]===i.minIterations)&&J++}if(J===u)break}}for(var me=nR(u,v,p),Ne=rR(u,c,me),pe={},ee=0;ee<me.length;ee++)pe[me[ee]]=[];for(var le=0;le<r.length;le++){var de=l[r[le].id()],xe=Ne[de];xe!=null&&pe[xe].push(r[le])}for(var Re=new Array(me.length),$e=0;$e<me.length;$e++)Re[$e]=n.collection(pe[me[$e]]);return Re},aR={affinityPropagation:xx,ap:xx},iR=ir({root:void 0,directed:!1}),lR={hierholzer:function(e){if(!zt(e)){var n=arguments;e={root:n[0],directed:n[1]}}var r=iR(e),i=r.root,l=r.directed,s=this,u=!1,f,c,h;i&&(h=st(i)?this.filter(i)[0].id():i[0].id());var v={},p={};l?s.forEach(function(C){var T=C.id();if(C.isNode()){var A=C.indegree(!0),N=C.outdegree(!0),k=A-N,D=N-A;k==1?f?u=!0:f=T:D==1?c?u=!0:c=T:(D>1||k>1)&&(u=!0),v[T]=[],C.outgoers().forEach(function(O){O.isEdge()&&v[T].push(O.id())})}else p[T]=[void 0,C.target().id()]}):s.forEach(function(C){var T=C.id();if(C.isNode()){var A=C.degree(!0);A%2&&(f?c?u=!0:c=T:f=T),v[T]=[],C.connectedEdges().forEach(function(N){return v[T].push(N.id())})}else p[T]=[C.source().id(),C.target().id()]});var m={found:!1,trail:void 0};if(u)return m;if(c&&f)if(l){if(h&&c!=h)return m;h=c}else{if(h&&c!=h&&f!=h)return m;h||(h=c)}else h||(h=s[0].id());var y=function(T){for(var A=T,N=[T],k,D,O;v[A].length;)k=v[A].shift(),D=p[k][0],O=p[k][1],A!=O?(v[O]=v[O].filter(function(L){return L!=k}),A=O):!l&&A!=D&&(v[D]=v[D].filter(function(L){return L!=k}),A=D),N.unshift(k),N.unshift(A);return N},w=[],S=[];for(S=y(h);S.length!=1;)v[S[0]].length==0?(w.unshift(s.getElementById(S.shift())),w.unshift(s.getElementById(S.shift()))):S=y(S.shift()).concat(S);w.unshift(s.getElementById(S.shift()));for(var x in v)if(v[x].length)return m;return m.found=!0,m.trail=this.spawn(w,!0),m}},tf=function(){var e=this,n={},r=0,i=0,l=[],s=[],u={},f=function(p,m){for(var y=s.length-1,w=[],S=e.spawn();s[y].x!=p||s[y].y!=m;)w.push(s.pop().edge),y--;w.push(s.pop().edge),w.forEach(function(x){var C=x.connectedNodes().intersection(e);S.merge(x),C.forEach(function(T){var A=T.id(),N=T.connectedEdges().intersection(e);S.merge(T),n[A].cutVertex?S.merge(N.filter(function(k){return k.isLoop()})):S.merge(N)})}),l.push(S)},c=function(p,m,y){p===y&&(i+=1),n[m]={id:r,low:r++,cutVertex:!1};var w=e.getElementById(m).connectedEdges().intersection(e);if(w.size()===0)l.push(e.spawn(e.getElementById(m)));else{var S,x,C,T;w.forEach(function(A){S=A.source().id(),x=A.target().id(),C=S===m?x:S,C!==y&&(T=A.id(),u[T]||(u[T]=!0,s.push({x:m,y:C,edge:A})),C in n?n[m].low=Math.min(n[m].low,n[C].id):(c(p,C,m),n[m].low=Math.min(n[m].low,n[C].low),n[m].id<=n[C].low&&(n[m].cutVertex=!0,f(m,C))))})}};e.forEach(function(v){if(v.isNode()){var p=v.id();p in n||(i=0,c(p,p),n[p].cutVertex=i>1)}});var h=Object.keys(n).filter(function(v){return n[v].cutVertex}).map(function(v){return e.getElementById(v)});return{cut:e.spawn(h),components:l}},sR={hopcroftTarjanBiconnected:tf,htbc:tf,htb:tf,hopcroftTarjanBiconnectedComponents:tf},nf=function(){var e=this,n={},r=0,i=[],l=[],s=e.spawn(e),u=function(c){l.push(c),n[c]={index:r,low:r++,explored:!1};var h=e.getElementById(c).connectedEdges().intersection(e);if(h.forEach(function(w){var S=w.target().id();S!==c&&(S in n||u(S),n[S].explored||(n[c].low=Math.min(n[c].low,n[S].low)))}),n[c].index===n[c].low){for(var v=e.spawn();;){var p=l.pop();if(v.merge(e.getElementById(p)),n[p].low=n[c].index,n[p].explored=!0,p===c)break}var m=v.edgesWith(v),y=v.merge(m);i.push(y),s=s.difference(y)}};return e.forEach(function(f){if(f.isNode()){var c=f.id();c in n||u(c)}}),{cut:s,components:i}},oR={tarjanStronglyConnected:nf,tsc:nf,tscc:nf,tarjanStronglyConnectedComponents:nf},WS={};[fu,zN,PN,qN,jN,VN,YN,x2,Ms,Os,kp,B2,K2,Q2,aR,lR,sR,oR].forEach(function(t){ht(WS,t)});var JS=0,eC=1,tC=2,da=function(e){if(!(this instanceof da))return new da(e);this.id="Thenable/1.0.7",this.state=JS,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))};da.prototype={fulfill:function(e){return wx(this,eC,"fulfillValue",e)},reject:function(e){return wx(this,tC,"rejectReason",e)},then:function(e,n){var r=this,i=new da;return r.onFulfilled.push(Cx(e,i,"fulfill")),r.onRejected.push(Cx(n,i,"reject")),nC(r),i.proxy}};var wx=function(e,n,r,i){return e.state===JS&&(e.state=n,e[r]=i,nC(e)),e},nC=function(e){e.state===eC?Sx(e,"onFulfilled",e.fulfillValue):e.state===tC&&Sx(e,"onRejected",e.rejectReason)},Sx=function(e,n,r){if(e[n].length!==0){var i=e[n];e[n]=[];var l=function(){for(var u=0;u<i.length;u++)i[u](r)};typeof setImmediate=="function"?setImmediate(l):setTimeout(l,0)}},Cx=function(e,n,r){return function(i){if(typeof e!="function")n[r].call(n,i);else{var l;try{l=e(i)}catch(s){n.reject(s);return}rC(n,l)}}},rC=function(e,n){if(e===n||e.proxy===n){e.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(Hn(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(l){e.reject(l);return}if(typeof r=="function"){var i=!1;try{r.call(n,function(l){i||(i=!0,l===n?e.reject(new TypeError("circular thenable chain")):rC(e,l))},function(l){i||(i=!0,e.reject(l))})}catch(l){i||e.reject(l)}return}e.fulfill(n)};da.all=function(t){return new da(function(e,n){for(var r=new Array(t.length),i=0,l=function(f,c){r[f]=c,i++,i===t.length&&e(r)},s=0;s<t.length;s++)(function(u){var f=t[u],c=f!=null&&f.then!=null;if(c)f.then(function(v){l(u,v)},function(v){n(v)});else{var h=f;l(u,h)}})(s)})};da.resolve=function(t){return new da(function(e,n){e(t)})};da.reject=function(t){return new da(function(e,n){n(t)})};var qs=typeof Promise<"u"?Promise:da,Mp=function(e,n,r){var i=lm(e),l=!i,s=this._private=ht({duration:1e3},n,r);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&wn(s.complete)&&s.completes.push(s.complete),l){var u=e.position();s.startPosition=s.startPosition||{x:u.x,y:u.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(i){var f=e.pan();s.startPan={x:f.x,y:f.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},Cl=Mp.prototype;ht(Cl,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var n,r=e.target._private.animation;e.queue?n=r.queue:n=r.current,n.push(this),Hr(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 n=this._private;return e===void 0?n.progress*n.duration:this.progress(e/n.duration)},progress:function(e){var n=this._private,r=n.playing;return e===void 0?n.progress:(r&&this.pause(),n.progress=e,n.started=!1,r&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,n=e.playing;n&&this.pause(),e.progress=1-e.progress,e.started=!1;var r=function(c,h){var v=e[c];v!=null&&(e[c]=e[h],e[h]=v)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),e.style)for(var i=0;i<e.style.length;i++){var l=e.style[i],s=l.name,u=e.startStyle[s];e.startStyle[s]=l,e.style[i]=u}return n&&this.play(),this},promise:function(e){var n=this._private,r;switch(e){case"frame":r=n.frames;break;default:case"complete":case"completed":r=n.completes}return new qs(function(i,l){r.push(function(){i()})})}});Cl.complete=Cl.completed;Cl.run=Cl.play;Cl.running=Cl.playing;var uR={animated:function(){return function(){var n=this,r=n.length!==void 0,i=r?n:[n],l=this._private.cy||this;if(!l.styleEnabled())return!1;var s=i[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var n=this,r=n.length!==void 0,i=r?n:[n],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var s=0;s<i.length;s++){var u=i[s];u._private.animation.queue=[]}return this}},delay:function(){return function(n,r){var i=this._private.cy||this;return i.styleEnabled()?this.animate({delay:n,duration:n,complete:r}):this}},delayAnimation:function(){return function(n,r){var i=this._private.cy||this;return i.styleEnabled()?this.animation({delay:n,duration:n,complete:r}):this}},animation:function(){return function(n,r){var i=this,l=i.length!==void 0,s=l?i:[i],u=this._private.cy||this,f=!l,c=!f;if(!u.styleEnabled())return this;var h=u.style();n=ht({},n,r);var v=Object.keys(n).length===0;if(v)return new Mp(s[0],n);switch(n.duration===void 0&&(n.duration=400),n.duration){case"slow":n.duration=600;break;case"fast":n.duration=200;break}if(c&&(n.style=h.getPropsList(n.style||n.css),n.css=void 0),c&&n.renderedPosition!=null){var p=n.renderedPosition,m=u.pan(),y=u.zoom();n.position=HS(p,y,m)}if(f&&n.panBy!=null){var w=n.panBy,S=u.pan();n.pan={x:S.x+w.x,y:S.y+w.y}}var x=n.center||n.centre;if(f&&x!=null){var C=u.getCenterPan(x.eles,n.zoom);C!=null&&(n.pan=C)}if(f&&n.fit!=null){var T=n.fit,A=u.getFitViewport(T.eles||T.boundingBox,T.padding);A!=null&&(n.pan=A.pan,n.zoom=A.zoom)}if(f&&zt(n.zoom)){var N=u.getZoomedViewport(n.zoom);N!=null?(N.zoomed&&(n.zoom=N.zoom),N.panned&&(n.pan=N.pan)):n.zoom=null}return new Mp(s[0],n)}},animate:function(){return function(n,r){var i=this,l=i.length!==void 0,s=l?i:[i],u=this._private.cy||this;if(!u.styleEnabled())return this;r&&(n=ht({},n,r));for(var f=0;f<s.length;f++){var c=s[f],h=c.animated()&&(n.queue===void 0||n.queue),v=c.animation(n,h?{queue:!0}:void 0);v.play()}return this}},stop:function(){return function(n,r){var i=this,l=i.length!==void 0,s=l?i:[i],u=this._private.cy||this;if(!u.styleEnabled())return this;for(var f=0;f<s.length;f++){for(var c=s[f],h=c._private,v=h.animation.current,p=0;p<v.length;p++){var m=v[p],y=m._private;r&&(y.duration=0)}n&&(h.animation.queue=[]),r||(h.animation.current=[])}return u.notify("draw"),this}}},Zv,Tx;function ad(){if(Tx)return Zv;Tx=1;var t=Array.isArray;return Zv=t,Zv}var Qv,Dx;function cR(){if(Dx)return Qv;Dx=1;var t=ad(),e=Du(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(l,s){if(t(l))return!1;var u=typeof l;return u=="number"||u=="symbol"||u=="boolean"||l==null||e(l)?!0:r.test(l)||!n.test(l)||s!=null&&l in Object(s)}return Qv=i,Qv}var Wv,Ax;function fR(){if(Ax)return Wv;Ax=1;var t=OS(),e=Tu(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",l="[object Proxy]";function s(u){if(!e(u))return!1;var f=t(u);return f==r||f==i||f==n||f==l}return Wv=s,Wv}var Jv,_x;function dR(){if(_x)return Jv;_x=1;var t=ed(),e=t["__core-js_shared__"];return Jv=e,Jv}var eg,kx;function hR(){if(kx)return eg;kx=1;var t=dR(),e=(function(){var r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!e&&e in r}return eg=n,eg}var tg,Nx;function vR(){if(Nx)return tg;Nx=1;var t=Function.prototype,e=t.toString;function n(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return tg=n,tg}var ng,Rx;function gR(){if(Rx)return ng;Rx=1;var t=fR(),e=hR(),n=Tu(),r=vR(),i=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,f=s.toString,c=u.hasOwnProperty,h=RegExp("^"+f.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(p){if(!n(p)||e(p))return!1;var m=t(p)?h:l;return m.test(r(p))}return ng=v,ng}var rg,Mx;function pR(){if(Mx)return rg;Mx=1;function t(e,n){return e?.[n]}return rg=t,rg}var ag,Ox;function mm(){if(Ox)return ag;Ox=1;var t=gR(),e=pR();function n(r,i){var l=e(r,i);return t(l)?l:void 0}return ag=n,ag}var ig,Bx;function id(){if(Bx)return ig;Bx=1;var t=mm(),e=t(Object,"create");return ig=e,ig}var lg,Lx;function mR(){if(Lx)return lg;Lx=1;var t=id();function e(){this.__data__=t?t(null):{},this.size=0}return lg=e,lg}var sg,Fx;function yR(){if(Fx)return sg;Fx=1;function t(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}return sg=t,sg}var og,Ix;function bR(){if(Ix)return og;Ix=1;var t=id(),e="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(l){var s=this.__data__;if(t){var u=s[l];return u===e?void 0:u}return r.call(s,l)?s[l]:void 0}return og=i,og}var ug,zx;function ER(){if(zx)return ug;zx=1;var t=id(),e=Object.prototype,n=e.hasOwnProperty;function r(i){var l=this.__data__;return t?l[i]!==void 0:n.call(l,i)}return ug=r,ug}var cg,Px;function xR(){if(Px)return cg;Px=1;var t=id(),e="__lodash_hash_undefined__";function n(r,i){var l=this.__data__;return this.size+=this.has(r)?0:1,l[r]=t&&i===void 0?e:i,this}return cg=n,cg}var fg,Ux;function wR(){if(Ux)return fg;Ux=1;var t=mR(),e=yR(),n=bR(),r=ER(),i=xR();function l(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var c=s[u];this.set(c[0],c[1])}}return l.prototype.clear=t,l.prototype.delete=e,l.prototype.get=n,l.prototype.has=r,l.prototype.set=i,fg=l,fg}var dg,qx;function SR(){if(qx)return dg;qx=1;function t(){this.__data__=[],this.size=0}return dg=t,dg}var hg,Hx;function aC(){if(Hx)return hg;Hx=1;function t(e,n){return e===n||e!==e&&n!==n}return hg=t,hg}var vg,jx;function ld(){if(jx)return vg;jx=1;var t=aC();function e(n,r){for(var i=n.length;i--;)if(t(n[i][0],r))return i;return-1}return vg=e,vg}var gg,Gx;function CR(){if(Gx)return gg;Gx=1;var t=ld(),e=Array.prototype,n=e.splice;function r(i){var l=this.__data__,s=t(l,i);if(s<0)return!1;var u=l.length-1;return s==u?l.pop():n.call(l,s,1),--this.size,!0}return gg=r,gg}var pg,Vx;function TR(){if(Vx)return pg;Vx=1;var t=ld();function e(n){var r=this.__data__,i=t(r,n);return i<0?void 0:r[i][1]}return pg=e,pg}var mg,$x;function DR(){if($x)return mg;$x=1;var t=ld();function e(n){return t(this.__data__,n)>-1}return mg=e,mg}var yg,Kx;function AR(){if(Kx)return yg;Kx=1;var t=ld();function e(n,r){var i=this.__data__,l=t(i,n);return l<0?(++this.size,i.push([n,r])):i[l][1]=r,this}return yg=e,yg}var bg,Yx;function _R(){if(Yx)return bg;Yx=1;var t=SR(),e=CR(),n=TR(),r=DR(),i=AR();function l(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var c=s[u];this.set(c[0],c[1])}}return l.prototype.clear=t,l.prototype.delete=e,l.prototype.get=n,l.prototype.has=r,l.prototype.set=i,bg=l,bg}var Eg,Xx;function kR(){if(Xx)return Eg;Xx=1;var t=mm(),e=ed(),n=t(e,"Map");return Eg=n,Eg}var xg,Zx;function NR(){if(Zx)return xg;Zx=1;var t=wR(),e=_R(),n=kR();function r(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}return xg=r,xg}var wg,Qx;function RR(){if(Qx)return wg;Qx=1;function t(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}return wg=t,wg}var Sg,Wx;function sd(){if(Wx)return Sg;Wx=1;var t=RR();function e(n,r){var i=n.__data__;return t(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Sg=e,Sg}var Cg,Jx;function MR(){if(Jx)return Cg;Jx=1;var t=sd();function e(n){var r=t(this,n).delete(n);return this.size-=r?1:0,r}return Cg=e,Cg}var Tg,e1;function OR(){if(e1)return Tg;e1=1;var t=sd();function e(n){return t(this,n).get(n)}return Tg=e,Tg}var Dg,t1;function BR(){if(t1)return Dg;t1=1;var t=sd();function e(n){return t(this,n).has(n)}return Dg=e,Dg}var Ag,n1;function LR(){if(n1)return Ag;n1=1;var t=sd();function e(n,r){var i=t(this,n),l=i.size;return i.set(n,r),this.size+=i.size==l?0:1,this}return Ag=e,Ag}var _g,r1;function FR(){if(r1)return _g;r1=1;var t=NR(),e=MR(),n=OR(),r=BR(),i=LR();function l(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var c=s[u];this.set(c[0],c[1])}}return l.prototype.clear=t,l.prototype.delete=e,l.prototype.get=n,l.prototype.has=r,l.prototype.set=i,_g=l,_g}var kg,a1;function IR(){if(a1)return kg;a1=1;var t=FR(),e="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var l=function(){var s=arguments,u=i?i.apply(this,s):s[0],f=l.cache;if(f.has(u))return f.get(u);var c=r.apply(this,s);return l.cache=f.set(u,c)||f,c};return l.cache=new(n.Cache||t),l}return n.Cache=t,kg=n,kg}var Ng,i1;function zR(){if(i1)return Ng;i1=1;var t=IR(),e=500;function n(r){var i=t(r,function(s){return l.size===e&&l.clear(),s}),l=i.cache;return i}return Ng=n,Ng}var Rg,l1;function iC(){if(l1)return Rg;l1=1;var t=zR(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=t(function(i){var l=[];return i.charCodeAt(0)===46&&l.push(""),i.replace(e,function(s,u,f,c){l.push(f?c.replace(n,"$1"):u||s)}),l});return Rg=r,Rg}var Mg,s1;function lC(){if(s1)return Mg;s1=1;function t(e,n){for(var r=-1,i=e==null?0:e.length,l=Array(i);++r<i;)l[r]=n(e[r],r,e);return l}return Mg=t,Mg}var Og,o1;function PR(){if(o1)return Og;o1=1;var t=om(),e=lC(),n=ad(),r=Du(),i=t?t.prototype:void 0,l=i?i.toString:void 0;function s(u){if(typeof u=="string")return u;if(n(u))return e(u,s)+"";if(r(u))return l?l.call(u):"";var f=u+"";return f=="0"&&1/u==-1/0?"-0":f}return Og=s,Og}var Bg,u1;function sC(){if(u1)return Bg;u1=1;var t=PR();function e(n){return n==null?"":t(n)}return Bg=e,Bg}var Lg,c1;function oC(){if(c1)return Lg;c1=1;var t=ad(),e=cR(),n=iC(),r=sC();function i(l,s){return t(l)?l:e(l,s)?[l]:n(r(l))}return Lg=i,Lg}var Fg,f1;function ym(){if(f1)return Fg;f1=1;var t=Du();function e(n){if(typeof n=="string"||t(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Fg=e,Fg}var Ig,d1;function UR(){if(d1)return Ig;d1=1;var t=oC(),e=ym();function n(r,i){i=t(i,r);for(var l=0,s=i.length;r!=null&&l<s;)r=r[e(i[l++])];return l&&l==s?r:void 0}return Ig=n,Ig}var zg,h1;function qR(){if(h1)return zg;h1=1;var t=UR();function e(n,r,i){var l=n==null?void 0:t(n,r);return l===void 0?i:l}return zg=e,zg}var HR=qR(),jR=Cu(HR),Pg,v1;function GR(){if(v1)return Pg;v1=1;var t=mm(),e=(function(){try{var n=t(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Pg=e,Pg}var Ug,g1;function VR(){if(g1)return Ug;g1=1;var t=GR();function e(n,r,i){r=="__proto__"&&t?t(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return Ug=e,Ug}var qg,p1;function $R(){if(p1)return qg;p1=1;var t=VR(),e=aC(),n=Object.prototype,r=n.hasOwnProperty;function i(l,s,u){var f=l[s];(!(r.call(l,s)&&e(f,u))||u===void 0&&!(s in l))&&t(l,s,u)}return qg=i,qg}var Hg,m1;function KR(){if(m1)return Hg;m1=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function n(r,i){var l=typeof r;return i=i??t,!!i&&(l=="number"||l!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return Hg=n,Hg}var jg,y1;function YR(){if(y1)return jg;y1=1;var t=$R(),e=oC(),n=KR(),r=Tu(),i=ym();function l(s,u,f,c){if(!r(s))return s;u=e(u,s);for(var h=-1,v=u.length,p=v-1,m=s;m!=null&&++h<v;){var y=i(u[h]),w=f;if(y==="__proto__"||y==="constructor"||y==="prototype")return s;if(h!=p){var S=m[y];w=c?c(S,y,m):void 0,w===void 0&&(w=r(S)?S:n(u[h+1])?[]:{})}t(m,y,w),m=m[y]}return s}return jg=l,jg}var Gg,b1;function XR(){if(b1)return Gg;b1=1;var t=YR();function e(n,r,i){return n==null?n:t(n,r,i)}return Gg=e,Gg}var ZR=XR(),QR=Cu(ZR),Vg,E1;function WR(){if(E1)return Vg;E1=1;function t(e,n){var r=-1,i=e.length;for(n||(n=Array(i));++r<i;)n[r]=e[r];return n}return Vg=t,Vg}var $g,x1;function JR(){if(x1)return $g;x1=1;var t=lC(),e=WR(),n=ad(),r=Du(),i=iC(),l=ym(),s=sC();function u(f){return n(f)?t(f,l):r(f)?[f]:e(i(s(f)))}return $g=u,$g}var eM=JR(),tM=Cu(eM),nM={data:function(e){var n={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(i){},beforeSet:function(i,l){},onSet:function(i){},canSet:function(i){return!0}};return e=ht({},n,e),function(i,l){var s=e,u=this,f=u.length!==void 0,c=f?u:[u],h=f?u[0]:u;if(st(i)){var v=i.indexOf(".")!==-1,p=v&&tM(i);if(s.allowGetting&&l===void 0){var m;return h&&(s.beforeGet(h),p&&h._private[s.field][i]===void 0?m=jR(h._private[s.field],p):m=h._private[s.field][i]),m}else if(s.allowSetting&&l!==void 0){var y=!s.immutableKeys[i];if(y){var w=SS({},i,l);s.beforeSet(u,w);for(var S=0,x=c.length;S<x;S++){var C=c[S];s.canSet(C)&&(p&&h._private[s.field][i]===void 0?QR(C._private[s.field],p,l):C._private[s.field][i]=l)}s.updateStyle&&u.updateStyle(),s.onSet(u),s.settingTriggersEvent&&u[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&zt(i)){var T=i,A,N,k=Object.keys(T);s.beforeSet(u,T);for(var D=0;D<k.length;D++){A=k[D],N=T[A];var O=!s.immutableKeys[A];if(O)for(var L=0;L<c.length;L++){var M=c[L];s.canSet(M)&&(M._private[s.field][A]=N)}}s.updateStyle&&u.updateStyle(),s.onSet(u),s.settingTriggersEvent&&u[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&wn(i)){var z=i;u.on(s.bindingEvent,z)}else if(s.allowGetting&&i===void 0){var B;return h&&(s.beforeGet(h),B=h._private[s.field]),B}return u}},removeData:function(e){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=ht({},n,e),function(i){var l=e,s=this,u=s.length!==void 0,f=u?s:[s];if(st(i)){for(var c=i.split(/\s+/),h=c.length,v=0;v<h;v++){var p=c[v];if(!Fi(p)){var m=!l.immutableKeys[p];if(m)for(var y=0,w=f.length;y<w;y++)f[y]._private[l.field][p]=void 0}}l.triggerEvent&&s[l.triggerFnName](l.event)}else if(i===void 0){for(var S=0,x=f.length;S<x;S++)for(var C=f[S]._private[l.field],T=Object.keys(C),A=0;A<T.length;A++){var N=T[A],k=!l.immutableKeys[N];k&&(C[N]=void 0)}l.triggerEvent&&s[l.triggerFnName](l.event)}return s}}},rM={eventAliasesOn:function(e){var n=e;n.addListener=n.listen=n.bind=n.on,n.unlisten=n.unbind=n.off=n.removeListener,n.trigger=n.emit,n.pon=n.promiseOn=function(r,i){var l=this,s=Array.prototype.slice.call(arguments,0);return new qs(function(u,f){var c=function(m){l.off.apply(l,v),u(m)},h=s.concat([c]),v=h.concat([]);l.on.apply(l,h)})}}},$t={};[uR,nM,rM].forEach(function(t){ht($t,t)});var aM={animate:$t.animate(),animation:$t.animation(),animated:$t.animated(),clearQueue:$t.clearQueue(),delay:$t.delay(),delayAnimation:$t.delayAnimation(),stop:$t.stop()},Cf={classes:function(e){var n=this;if(e===void 0){var r=[];return n[0]._private.classes.forEach(function(y){return r.push(y)}),r}else ln(e)||(e=(e||"").match(/\S+/g)||[]);for(var i=[],l=new Us(e),s=0;s<n.length;s++){for(var u=n[s],f=u._private,c=f.classes,h=!1,v=0;v<e.length;v++){var p=e[v],m=c.has(p);if(!m){h=!0;break}}h||(h=c.size!==e.length),h&&(f.classes=l,i.push(u))}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var n=this[0];return n!=null&&n._private.classes.has(e)},toggleClass:function(e,n){ln(e)||(e=e.match(/\S+/g)||[]);for(var r=this,i=n===void 0,l=[],s=0,u=r.length;s<u;s++)for(var f=r[s],c=f._private.classes,h=!1,v=0;v<e.length;v++){var p=e[v],m=c.has(p),y=!1;n||i&&!m?(c.add(p),y=!0):(!n||i&&m)&&(c.delete(p),y=!0),!h&&y&&(l.push(f),h=!0)}return l.length>0&&this.spawn(l).updateStyle().emit("class"),r},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,n){var r=this;if(n==null)n=250;else if(n===0)return r;return r.addClass(e),setTimeout(function(){r.removeClass(e)},n),r}};Cf.className=Cf.classNames=Cf.classes;var It={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:qn,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};It.variable="(?:[\\w-.]|(?:\\\\"+It.metaChar+"))+";It.className="(?:[\\w-]|(?:\\\\"+It.metaChar+"))+";It.value=It.string+"|"+It.number;It.id=It.variable;(function(){var t,e,n;for(t=It.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],It.comparatorOp+="|@"+e;for(t=It.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],!(e.indexOf("!")>=0)&&e!=="="&&(It.comparatorOp+="|\\!"+e)})();var tn=function(){return{checks:[]}},nt={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},Op=[{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 nN(t.selector,e.selector)}),iM=(function(){for(var t={},e,n=0;n<Op.length;n++)e=Op[n],t[e.selector]=e.matches;return t})(),lM=function(e,n){return iM[e](n)},sM="("+Op.map(function(t){return t.selector}).join("|")+")",hs=function(e){return e.replace(new RegExp("\\\\("+It.metaChar+")","g"),function(n,r){return r})},Di=function(e,n,r){e[e.length-1]=r},Bp=[{name:"group",query:!0,regex:"("+It.group+")",populate:function(e,n,r){var i=zn(r,1),l=i[0];n.checks.push({type:nt.GROUP,value:l==="*"?l:l+"s"})}},{name:"state",query:!0,regex:sM,populate:function(e,n,r){var i=zn(r,1),l=i[0];n.checks.push({type:nt.STATE,value:l})}},{name:"id",query:!0,regex:"\\#("+It.id+")",populate:function(e,n,r){var i=zn(r,1),l=i[0];n.checks.push({type:nt.ID,value:hs(l)})}},{name:"className",query:!0,regex:"\\.("+It.className+")",populate:function(e,n,r){var i=zn(r,1),l=i[0];n.checks.push({type:nt.CLASS,value:hs(l)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+It.variable+")\\s*\\]",populate:function(e,n,r){var i=zn(r,1),l=i[0];n.checks.push({type:nt.DATA_EXIST,field:hs(l)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+It.variable+")\\s*("+It.comparatorOp+")\\s*("+It.value+")\\s*\\]",populate:function(e,n,r){var i=zn(r,3),l=i[0],s=i[1],u=i[2],f=new RegExp("^"+It.string+"$").exec(u)!=null;f?u=u.substring(1,u.length-1):u=parseFloat(u),n.checks.push({type:nt.DATA_COMPARE,field:hs(l),operator:s,value:u})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+It.boolOp+")\\s*("+It.variable+")\\s*\\]",populate:function(e,n,r){var i=zn(r,2),l=i[0],s=i[1];n.checks.push({type:nt.DATA_BOOL,field:hs(s),operator:l})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+It.meta+")\\s*("+It.comparatorOp+")\\s*("+It.number+")\\s*\\]\\]",populate:function(e,n,r){var i=zn(r,3),l=i[0],s=i[1],u=i[2];n.checks.push({type:nt.META_COMPARE,field:hs(l),operator:s,value:parseFloat(u)})}},{name:"nextQuery",separator:!0,regex:It.separator,populate:function(e,n){var r=e.currentSubject,i=e.edgeCount,l=e.compoundCount,s=e[e.length-1];r!=null&&(s.subject=r,e.currentSubject=null),s.edgeCount=i,s.compoundCount=l,e.edgeCount=0,e.compoundCount=0;var u=e[e.length++]=tn();return u}},{name:"directedEdge",separator:!0,regex:It.directedEdge,populate:function(e,n){if(e.currentSubject==null){var r=tn(),i=n,l=tn();return r.checks.push({type:nt.DIRECTED_EDGE,source:i,target:l}),Di(e,n,r),e.edgeCount++,l}else{var s=tn(),u=n,f=tn();return s.checks.push({type:nt.NODE_SOURCE,source:u,target:f}),Di(e,n,s),e.edgeCount++,f}}},{name:"undirectedEdge",separator:!0,regex:It.undirectedEdge,populate:function(e,n){if(e.currentSubject==null){var r=tn(),i=n,l=tn();return r.checks.push({type:nt.UNDIRECTED_EDGE,nodes:[i,l]}),Di(e,n,r),e.edgeCount++,l}else{var s=tn(),u=n,f=tn();return s.checks.push({type:nt.NODE_NEIGHBOR,node:u,neighbor:f}),Di(e,n,s),f}}},{name:"child",separator:!0,regex:It.child,populate:function(e,n){if(e.currentSubject==null){var r=tn(),i=tn(),l=e[e.length-1];return r.checks.push({type:nt.CHILD,parent:l,child:i}),Di(e,n,r),e.compoundCount++,i}else if(e.currentSubject===n){var s=tn(),u=e[e.length-1],f=tn(),c=tn(),h=tn(),v=tn();return s.checks.push({type:nt.COMPOUND_SPLIT,left:u,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:nt.TRUE}],v.checks.push({type:nt.TRUE}),f.checks.push({type:nt.PARENT,parent:v,child:h}),Di(e,u,s),e.currentSubject=c,e.compoundCount++,h}else{var p=tn(),m=tn(),y=[{type:nt.PARENT,parent:p,child:m}];return p.checks=n.checks,n.checks=y,e.compoundCount++,m}}},{name:"descendant",separator:!0,regex:It.descendant,populate:function(e,n){if(e.currentSubject==null){var r=tn(),i=tn(),l=e[e.length-1];return r.checks.push({type:nt.DESCENDANT,ancestor:l,descendant:i}),Di(e,n,r),e.compoundCount++,i}else if(e.currentSubject===n){var s=tn(),u=e[e.length-1],f=tn(),c=tn(),h=tn(),v=tn();return s.checks.push({type:nt.COMPOUND_SPLIT,left:u,right:f,subject:c}),c.checks=n.checks,n.checks=[{type:nt.TRUE}],v.checks.push({type:nt.TRUE}),f.checks.push({type:nt.ANCESTOR,ancestor:v,descendant:h}),Di(e,u,s),e.currentSubject=c,e.compoundCount++,h}else{var p=tn(),m=tn(),y=[{type:nt.ANCESTOR,ancestor:p,descendant:m}];return p.checks=n.checks,n.checks=y,e.compoundCount++,m}}},{name:"subject",modifier:!0,regex:It.subject,populate:function(e,n){if(e.currentSubject!=null&&e.currentSubject!==n)return Kt("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=n;var r=e[e.length-1],i=r.checks[0],l=i==null?null:i.type;l===nt.DIRECTED_EDGE?i.type=nt.NODE_TARGET:l===nt.UNDIRECTED_EDGE&&(i.type=nt.NODE_NEIGHBOR,i.node=i.nodes[1],i.neighbor=i.nodes[0],i.nodes=null)}}];Bp.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var oM=function(e){for(var n,r,i,l=0;l<Bp.length;l++){var s=Bp[l],u=s.name,f=e.match(s.regexObj);if(f!=null){r=f,n=s,i=u;var c=f[0];e=e.substring(c.length);break}}return{expr:n,match:r,name:i,remaining:e}},uM=function(e){var n=e.match(/^\s+/);if(n){var r=n[0];e=e.substring(r.length)}return e},cM=function(e){var n=this,r=n.inputText=e,i=n[0]=tn();for(n.length=1,r=uM(r);;){var l=oM(r);if(l.expr==null)return Kt("The selector `"+e+"`is invalid"),!1;var s=l.match.slice(1),u=l.expr.populate(n,i,s);if(u===!1)return!1;if(u!=null&&(i=u),r=l.remaining,r.match(/^\s*$/))break}var f=n[n.length-1];n.currentSubject!=null&&(f.subject=n.currentSubject),f.edgeCount=n.edgeCount,f.compoundCount=n.compoundCount;for(var c=0;c<n.length;c++){var h=n[c];if(h.compoundCount>0&&h.edgeCount>0)return Kt("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Kt("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Kt("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},fM=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},n=function(h){return st(h)?'"'+h+'"':e(h)},r=function(h){return" "+h+" "},i=function(h,v){var p=h.type,m=h.value;switch(p){case nt.GROUP:{var y=e(m);return y.substring(0,y.length-1)}case nt.DATA_COMPARE:{var w=h.field,S=h.operator;return"["+w+r(e(S))+n(m)+"]"}case nt.DATA_BOOL:{var x=h.operator,C=h.field;return"["+e(x)+C+"]"}case nt.DATA_EXIST:{var T=h.field;return"["+T+"]"}case nt.META_COMPARE:{var A=h.operator,N=h.field;return"[["+N+r(e(A))+n(m)+"]]"}case nt.STATE:return m;case nt.ID:return"#"+m;case nt.CLASS:return"."+m;case nt.PARENT:case nt.CHILD:return l(h.parent,v)+r(">")+l(h.child,v);case nt.ANCESTOR:case nt.DESCENDANT:return l(h.ancestor,v)+" "+l(h.descendant,v);case nt.COMPOUND_SPLIT:{var k=l(h.left,v),D=l(h.subject,v),O=l(h.right,v);return k+(k.length>0?" ":"")+D+O}case nt.TRUE:return""}},l=function(h,v){return h.checks.reduce(function(p,m,y){return p+(v===h&&y===0?"$":"")+i(m,v)},"")},s="",u=0;u<this.length;u++){var f=this[u];s+=l(f,f.subject),this.length>1&&u<this.length-1&&(s+=", ")}return this.toStringCache=s,s},dM={parse:cM,toString:fM},uC=function(e,n,r){var i,l=st(e),s=je(e),u=st(r),f,c,h=!1,v=!1,p=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),v=!0),n.indexOf("@")>=0&&(n=n.replace("@",""),h=!0),(l||u||h)&&(f=!l&&!s?"":""+e,c=""+r),h&&(e=f=f.toLowerCase(),r=c=c.toLowerCase()),n){case"*=":i=f.indexOf(c)>=0;break;case"$=":i=f.indexOf(c,f.length-c.length)>=0;break;case"^=":i=f.indexOf(c)===0;break;case"=":i=e===r;break;case">":p=!0,i=e>r;break;case">=":p=!0,i=e>=r;break;case"<":p=!0,i=e<r;break;case"<=":p=!0,i=e<=r;break;default:i=!1;break}return v&&(e!=null||!p)&&(i=!i),i},hM=function(e,n){switch(n){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},vM=function(e){return e!==void 0},bm=function(e,n){return e.data(n)},gM=function(e,n){return e[n]()},An=[],gn=function(e,n){return e.checks.every(function(r){return An[r.type](r,n)})};An[nt.GROUP]=function(t,e){var n=t.value;return n==="*"||n===e.group()};An[nt.STATE]=function(t,e){var n=t.value;return lM(n,e)};An[nt.ID]=function(t,e){var n=t.value;return e.id()===n};An[nt.CLASS]=function(t,e){var n=t.value;return e.hasClass(n)};An[nt.META_COMPARE]=function(t,e){var n=t.field,r=t.operator,i=t.value;return uC(gM(e,n),r,i)};An[nt.DATA_COMPARE]=function(t,e){var n=t.field,r=t.operator,i=t.value;return uC(bm(e,n),r,i)};An[nt.DATA_BOOL]=function(t,e){var n=t.field,r=t.operator;return hM(bm(e,n),r)};An[nt.DATA_EXIST]=function(t,e){var n=t.field;return t.operator,vM(bm(e,n))};An[nt.UNDIRECTED_EDGE]=function(t,e){var n=t.nodes[0],r=t.nodes[1],i=e.source(),l=e.target();return gn(n,i)&&gn(r,l)||gn(r,i)&&gn(n,l)};An[nt.NODE_NEIGHBOR]=function(t,e){return gn(t.node,e)&&e.neighborhood().some(function(n){return n.isNode()&&gn(t.neighbor,n)})};An[nt.DIRECTED_EDGE]=function(t,e){return gn(t.source,e.source())&&gn(t.target,e.target())};An[nt.NODE_SOURCE]=function(t,e){return gn(t.source,e)&&e.outgoers().some(function(n){return n.isNode()&&gn(t.target,n)})};An[nt.NODE_TARGET]=function(t,e){return gn(t.target,e)&&e.incomers().some(function(n){return n.isNode()&&gn(t.source,n)})};An[nt.CHILD]=function(t,e){return gn(t.child,e)&&gn(t.parent,e.parent())};An[nt.PARENT]=function(t,e){return gn(t.parent,e)&&e.children().some(function(n){return gn(t.child,n)})};An[nt.DESCENDANT]=function(t,e){return gn(t.descendant,e)&&e.ancestors().some(function(n){return gn(t.ancestor,n)})};An[nt.ANCESTOR]=function(t,e){return gn(t.ancestor,e)&&e.descendants().some(function(n){return gn(t.descendant,n)})};An[nt.COMPOUND_SPLIT]=function(t,e){return gn(t.subject,e)&&gn(t.left,e)&&gn(t.right,e)};An[nt.TRUE]=function(){return!0};An[nt.COLLECTION]=function(t,e){var n=t.value;return n.has(e)};An[nt.FILTER]=function(t,e){var n=t.value;return n(e)};var pM=function(e){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===nt.ID)return e.getElementById(n[0].checks[0].value).collection();var r=function(l){for(var s=0;s<n.length;s++){var u=n[s];if(gn(u,l))return!0}return!1};return n.text()==null&&(r=function(){return!0}),e.filter(r)},mM=function(e){for(var n=this,r=0;r<n.length;r++){var i=n[r];if(gn(i,e))return!0}return!1},yM={matches:mM,filter:pM},Pi=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||st(e)&&e.match(/^\s*$/)||(Hr(e)?this.addQuery({checks:[{type:nt.COLLECTION,value:e.collection()}]}):wn(e)?this.addQuery({checks:[{type:nt.FILTER,value:e}]}):st(e)?this.parse(e)||(this.invalid=!0):mn("A selector must be created from a string; found "))},Ui=Pi.prototype;[dM,yM].forEach(function(t){return ht(Ui,t)});Ui.text=function(){return this.inputText};Ui.size=function(){return this.length};Ui.eq=function(t){return this[t]};Ui.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};Ui.addQuery=function(t){this[this.length++]=t};Ui.selector=Ui.toString;var Bi={allAre:function(e){var n=new Pi(e);return this.every(function(r){return n.matches(r)})},is:function(e){var n=new Pi(e);return this.some(function(r){return n.matches(r)})},some:function(e,n){for(var r=0;r<this.length;r++){var i=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(i)return!0}return!1},every:function(e,n){for(var r=0;r<this.length;r++){var i=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(!i)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var n=this.length,r=e.length;return n!==r?!1:n===1?this[0]===e[0]:this.every(function(i){return e.hasElementWithId(i.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(n){return e.hasElementWithId(n.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var n=this.neighborhood();return e.every(function(r){return n.hasElementWithId(r.id())})},contains:function(e){e=this.cy().collection(e);var n=this;return e.every(function(r){return n.hasElementWithId(r.id())})}};Bi.allAreNeighbours=Bi.allAreNeighbors;Bi.has=Bi.contains;Bi.equal=Bi.equals=Bi.same;var aa=function(e,n){return function(i,l,s,u){var f=i,c=this,h;if(f==null?h="":Hr(f)&&f.length===1&&(h=f.id()),c.length===1&&h){var v=c[0]._private,p=v.traversalCache=v.traversalCache||{},m=p[n]=p[n]||[],y=wl(h),w=m[y];return w||(m[y]=e.call(c,i,l,s,u))}else return e.call(c,i,l,s,u)}},zs={parent:function(e){var n=[];if(this.length===1){var r=this[0]._private.parent;if(r)return r}for(var i=0;i<this.length;i++){var l=this[i],s=l._private.parent;s&&n.push(s)}return this.spawn(n,!0).filter(e)},parents:function(e){for(var n=[],r=this.parent();r.nonempty();){for(var i=0;i<r.length;i++){var l=r[i];n.push(l)}r=r.parent()}return this.spawn(n,!0).filter(e)},commonAncestors:function(e){for(var n,r=0;r<this.length;r++){var i=this[r],l=i.parents();n=n||l,n=n.intersect(l)}return n.filter(e)},orphans:function(e){return this.stdFilter(function(n){return n.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(n){return n.isChild()}).filter(e)},children:aa(function(t){for(var e=[],n=0;n<this.length;n++)for(var r=this[n],i=r._private.children,l=0;l<i.length;l++)e.push(i[l]);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 n=[];function r(i){for(var l=0;l<i.length;l++){var s=i[l];n.push(s),s.children().nonempty()&&r(s.children())}}return r(this.children()),this.spawn(n,!0).filter(e)}};function Em(t,e,n,r){for(var i=[],l=new Us,s=t.cy(),u=s.hasCompoundNodes(),f=0;f<t.length;f++){var c=t[f];n?i.push(c):u&&r(i,l,c)}for(;i.length>0;){var h=i.shift();e(h),l.add(h.id()),u&&r(i,l,h)}return t}function cC(t,e,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var l=r[i];e.has(l.id())||t.push(l)}}zs.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Em(this,t,e,cC)};function fC(t,e,n){if(n.isChild()){var r=n._private.parent;e.has(r.id())||t.push(r)}}zs.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Em(this,t,e,fC)};function bM(t,e,n){fC(t,e,n),cC(t,e,n)}zs.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Em(this,t,e,bM)};zs.ancestors=zs.parents;var vu,dC;vu=dC={data:$t.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:$t.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:$t.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:$t.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:$t.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:$t.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};vu.attr=vu.data;vu.removeAttr=vu.removeData;var EM=dC,od={};function Kg(t){return function(e){var n=this;if(e===void 0&&(e=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,i=n[0],l=i._private.edges,s=0;s<l.length;s++){var u=l[s];!e&&u.isLoop()||(r+=t(i,u))}return r}else return}}ht(od,{degree:Kg(function(t,e){return e.source().same(e.target())?2:1}),indegree:Kg(function(t,e){return e.target().same(t)?1:0}),outdegree:Kg(function(t,e){return e.source().same(t)?1:0})});function vs(t,e){return function(n){for(var r,i=this.nodes(),l=0;l<i.length;l++){var s=i[l],u=s[t](n);u!==void 0&&(r===void 0||e(u,r))&&(r=u)}return r}}ht(od,{minDegree:vs("degree",function(t,e){return t<e}),maxDegree:vs("degree",function(t,e){return t>e}),minIndegree:vs("indegree",function(t,e){return t<e}),maxIndegree:vs("indegree",function(t,e){return t>e}),minOutdegree:vs("outdegree",function(t,e){return t<e}),maxOutdegree:vs("outdegree",function(t,e){return t>e})});ht(od,{totalDegree:function(e){for(var n=0,r=this.nodes(),i=0;i<r.length;i++)n+=r[i].degree(e);return n}});var ca,hC,vC=function(e,n,r){for(var i=0;i<e.length;i++){var l=e[i];if(!l.locked()){var s=l._private.position,u={x:n.x!=null?n.x-s.x:0,y:n.y!=null?n.y-s.y:0};l.isParent()&&!(u.x===0&&u.y===0)&&l.children().shift(u,r),l.dirtyBoundingBoxCache()}}},w1={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,n){vC(e,n,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};ca=hC={position:$t.data(w1),silentPosition:$t.data(ht({},w1,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,n){vC(e,n,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,n){if(zt(e))n?this.silentPosition(e):this.position(e);else if(wn(e)){var r=e,i=this.cy();i.startBatch();for(var l=0;l<this.length;l++){var s=this[l],u=void 0;(u=r(s,l))&&(n?s.silentPosition(u):s.position(u))}i.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,n,r){var i;if(zt(e)?(i={x:je(e.x)?e.x:0,y:je(e.y)?e.y:0},r=n):st(e)&&je(n)&&(i={x:0,y:0},i[e]=n),i!=null){var l=this.cy();l.startBatch();for(var s=0;s<this.length;s++){var u=this[s];if(!(l.hasCompoundNodes()&&u.isChild()&&u.ancestors().anySame(this))){var f=u.position(),c={x:f.x+i.x,y:f.y+i.y};r?u.silentPosition(c):u.position(c)}}l.endBatch()}return this},silentShift:function(e,n){return zt(e)?this.shift(e,!0):st(e)&&je(n)&&this.shift(e,n,!0),this},renderedPosition:function(e,n){var r=this[0],i=this.cy(),l=i.zoom(),s=i.pan(),u=zt(e)?e:void 0,f=u!==void 0||n!==void 0&&st(e);if(r&&r.isNode())if(f)for(var c=0;c<this.length;c++){var h=this[c];n!==void 0?h.position(e,(n-s[e])/l):u!==void 0&&h.position(HS(u,l,s))}else{var v=r.position();return u=nd(v,l,s),e===void 0?u:u[e]}else if(!f)return;return this},relativePosition:function(e,n){var r=this[0],i=this.cy(),l=zt(e)?e:void 0,s=l!==void 0||n!==void 0&&st(e),u=i.hasCompoundNodes();if(r&&r.isNode())if(s)for(var f=0;f<this.length;f++){var c=this[f],h=u?c.parent():null,v=h&&h.length>0,p=v;v&&(h=h[0]);var m=p?h.position():{x:0,y:0};n!==void 0?c.position(e,n+m[e]):l!==void 0&&c.position({x:l.x+m.x,y:l.y+m.y})}else{var y=r.position(),w=u?r.parent():null,S=w&&w.length>0,x=S;S&&(w=w[0]);var C=x?w.position():{x:0,y:0};return l={x:y.x-C.x,y:y.y-C.y},e===void 0?l:l[e]}else if(!s)return;return this}};ca.modelPosition=ca.point=ca.position;ca.modelPositions=ca.points=ca.positions;ca.renderedPoint=ca.renderedPosition;ca.relativePoint=ca.relativePosition;var xM=hC,Bs,Gi;Bs=Gi={};Gi.renderedBoundingBox=function(t){var e=this.boundingBox(t),n=this.cy(),r=n.zoom(),i=n.pan(),l=e.x1*r+i.x,s=e.x2*r+i.x,u=e.y1*r+i.y,f=e.y2*r+i.y;return{x1:l,x2:s,y1:u,y2:f,w:s-l,h:f-u}};Gi.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(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,t||n.emitAndNotify("bounds")}}),this)};Gi.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 n(s){if(!s.isParent())return;var u=s._private,f=s.children(),c=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},v=f.boundingBox({includeLabels:c,includeOverlays:!1,useCache:!1}),p=u.position;(v.w===0||v.h===0)&&(v={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},v.x1=p.x-v.w/2,v.x2=p.x+v.w/2,v.y1=p.y-v.h/2,v.y2=p.y+v.h/2);function m(L,M,z){var B=0,U=0,V=M+z;return L>0&&V>0&&(B=M/V*L,U=z/V*L),{biasDiff:B,biasComplementDiff:U}}function y(L,M,z,B){if(z.units==="%")switch(B){case"width":return L>0?z.pfValue*L:0;case"height":return M>0?z.pfValue*M:0;case"average":return L>0&&M>0?z.pfValue*(L+M)/2:0;case"min":return L>0&&M>0?L>M?z.pfValue*M:z.pfValue*L:0;case"max":return L>0&&M>0?L>M?z.pfValue*L:z.pfValue*M:0;default:return 0}else return z.units==="px"?z.pfValue:0}var w=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(w=w*100/h.width.val);var S=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(S=S*100/h.width.val);var x=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(x=x*100/h.height.val);var C=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(C=C*100/h.height.val);var T=m(h.width.val-v.w,w,S),A=T.biasDiff,N=T.biasComplementDiff,k=m(h.height.val-v.h,x,C),D=k.biasDiff,O=k.biasComplementDiff;u.autoPadding=y(v.w,v.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),u.autoWidth=Math.max(v.w,h.width.val),p.x=(-A+v.x1+v.x2+N)/2,u.autoHeight=Math.max(v.h,h.height.val),p.y=(-D+v.y1+v.y2+O)/2}for(var r=0;r<this.length;r++){var i=this[r],l=i._private;(!l.compoundBoundsClean||t)&&(n(i),e.batching()||(l.compoundBoundsClean=!0))}return this};var na=function(e){return e===1/0||e===-1/0?0:e},ua=function(e,n,r,i,l){i-n===0||l-r===0||n==null||r==null||i==null||l==null||(e.x1=n<e.x1?n:e.x1,e.x2=i>e.x2?i:e.x2,e.y1=r<e.y1?r:e.y1,e.y2=l>e.y2?l:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Ni=function(e,n){return n==null?e:ua(e,n.x1,n.y1,n.x2,n.y2)},Ho=function(e,n,r){return kr(e,n,r)},rf=function(e,n,r){if(!n.cy().headless()){var i=n._private,l=i.rstyle,s=l.arrowWidth/2,u=n.pstyle(r+"-arrow-shape").value,f,c;if(u!=="none"){r==="source"?(f=l.srcX,c=l.srcY):r==="target"?(f=l.tgtX,c=l.tgtY):(f=l.midX,c=l.midY);var h=i.arrowBounds=i.arrowBounds||{},v=h[r]=h[r]||{};v.x1=f-s,v.y1=c-s,v.x2=f+s,v.y2=c+s,v.w=v.x2-v.x1,v.h=v.y2-v.y1,wf(v,1),ua(e,v.x1,v.y1,v.x2,v.y2)}}},Yg=function(e,n,r){if(!n.cy().headless()){var i;r?i=r+"-":i="";var l=n._private,s=l.rstyle,u=n.pstyle(i+"label").strValue;if(u){var f=n.pstyle("text-halign"),c=n.pstyle("text-valign"),h=Ho(s,"labelWidth",r),v=Ho(s,"labelHeight",r),p=Ho(s,"labelX",r),m=Ho(s,"labelY",r),y=n.pstyle(i+"text-margin-x").pfValue,w=n.pstyle(i+"text-margin-y").pfValue,S=n.isEdge(),x=n.pstyle(i+"text-rotation"),C=n.pstyle("text-outline-width").pfValue,T=n.pstyle("text-border-width").pfValue,A=T/2,N=n.pstyle("text-background-padding").pfValue,k=2,D=v,O=h,L=O/2,M=D/2,z,B,U,V;if(S)z=p-L,B=p+L,U=m-M,V=m+M;else{switch(f.value){case"left":z=p-O,B=p;break;case"center":z=p-L,B=p+L;break;case"right":z=p,B=p+O;break}switch(c.value){case"top":U=m-D,V=m;break;case"center":U=m-M,V=m+M;break;case"bottom":U=m,V=m+D;break}}var $=y-Math.max(C,A)-N-k,q=y+Math.max(C,A)+N+k,H=w-Math.max(C,A)-N-k,Y=w+Math.max(C,A)+N+k;z+=$,B+=q,U+=H,V+=Y;var Q=r||"main",P=l.labelBounds,I=P[Q]=P[Q]||{};I.x1=z,I.y1=U,I.x2=B,I.y2=V,I.w=B-z,I.h=V-U,I.leftPad=$,I.rightPad=q,I.topPad=H,I.botPad=Y;var K=S&&x.strValue==="autorotate",F=x.pfValue!=null&&x.pfValue!==0;if(K||F){var J=K?Ho(l.rstyle,"labelAngle",r):x.pfValue,re=Math.cos(J),se=Math.sin(J),me=(z+B)/2,Ne=(U+V)/2;if(!S){switch(f.value){case"left":me=B;break;case"right":me=z;break}switch(c.value){case"top":Ne=V;break;case"bottom":Ne=U;break}}var pe=function(lt,We){return lt=lt-me,We=We-Ne,{x:lt*re-We*se+me,y:lt*se+We*re+Ne}},ee=pe(z,U),le=pe(z,V),de=pe(B,U),xe=pe(B,V);z=Math.min(ee.x,le.x,de.x,xe.x),B=Math.max(ee.x,le.x,de.x,xe.x),U=Math.min(ee.y,le.y,de.y,xe.y),V=Math.max(ee.y,le.y,de.y,xe.y)}var Re=Q+"Rot",$e=P[Re]=P[Re]||{};$e.x1=z,$e.y1=U,$e.x2=B,$e.y2=V,$e.w=B-z,$e.h=V-U,ua(e,z,U,B,V),ua(l.labelBounds.all,z,U,B,V)}return e}},S1=function(e,n){if(!n.cy().headless()){var r=n.pstyle("outline-opacity").value,i=n.pstyle("outline-width").value,l=n.pstyle("outline-offset").value,s=i+l;gC(e,n,r,s,"outside",s/2)}},gC=function(e,n,r,i,l,s){if(!(r===0||i<=0||l==="inside")){var u=n.cy(),f=u.renderer(),c=f.nodeShapes[f.getNodeShape(n)];if(c){var h=n.position(),v=h.x,p=h.y,m=n.width(),y=n.height();if(c.hasMiterBounds){l==="center"&&(i/=2);var w=c.miterBounds(v,p,m,y,i);Ni(e,w)}else s!=null&&s>0&&Sf(e,[s,s,s,s])}}},wM=function(e,n){if(!n.cy().headless()){var r=n.pstyle("border-opacity").value,i=n.pstyle("border-width").pfValue,l=n.pstyle("border-position").value;gC(e,n,r,i,l)}},SM=function(e,n){var r=e._private.cy,i=r.styleEnabled(),l=r.headless(),s=br(),u=e._private,f=e.isNode(),c=e.isEdge(),h,v,p,m,y,w,S=u.rstyle,x=f&&i?e.pstyle("bounds-expansion").pfValue:[0],C=function(Ye){return Ye.pstyle("display").value!=="none"},T=!i||C(e)&&(!c||C(e.source())&&C(e.target()));if(T){var A=0,N=0;i&&n.includeOverlays&&(A=e.pstyle("overlay-opacity").value,A!==0&&(N=e.pstyle("overlay-padding").value));var k=0,D=0;i&&n.includeUnderlays&&(k=e.pstyle("underlay-opacity").value,k!==0&&(D=e.pstyle("underlay-padding").value));var O=Math.max(N,D),L=0,M=0;if(i&&(L=e.pstyle("width").pfValue,M=L/2),f&&n.includeNodes){var z=e.position();y=z.x,w=z.y;var B=e.outerWidth(),U=B/2,V=e.outerHeight(),$=V/2;h=y-U,v=y+U,p=w-$,m=w+$,ua(s,h,p,v,m),i&&S1(s,e),i&&n.includeOutlines&&!l&&S1(s,e),i&&wM(s,e)}else if(c&&n.includeEdges)if(i&&!l){var q=e.pstyle("curve-style").strValue;if(h=Math.min(S.srcX,S.midX,S.tgtX),v=Math.max(S.srcX,S.midX,S.tgtX),p=Math.min(S.srcY,S.midY,S.tgtY),m=Math.max(S.srcY,S.midY,S.tgtY),h-=M,v+=M,p-=M,m+=M,ua(s,h,p,v,m),q==="haystack"){var H=S.haystackPts;if(H&&H.length===2){if(h=H[0].x,p=H[0].y,v=H[1].x,m=H[1].y,h>v){var Y=h;h=v,v=Y}if(p>m){var Q=p;p=m,m=Q}ua(s,h-M,p-M,v+M,m+M)}}else if(q==="bezier"||q==="unbundled-bezier"||Ri(q,"segments")||Ri(q,"taxi")){var P;switch(q){case"bezier":case"unbundled-bezier":P=S.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":P=S.linePts;break}if(P!=null)for(var I=0;I<P.length;I++){var K=P[I];h=K.x-M,v=K.x+M,p=K.y-M,m=K.y+M,ua(s,h,p,v,m)}}}else{var F=e.source(),J=F.position(),re=e.target(),se=re.position();if(h=J.x,v=se.x,p=J.y,m=se.y,h>v){var me=h;h=v,v=me}if(p>m){var Ne=p;p=m,m=Ne}h-=M,v+=M,p-=M,m+=M,ua(s,h,p,v,m)}if(i&&n.includeEdges&&c&&(rf(s,e,"mid-source"),rf(s,e,"mid-target"),rf(s,e,"source"),rf(s,e,"target")),i){var pe=e.pstyle("ghost").value==="yes";if(pe){var ee=e.pstyle("ghost-offset-x").pfValue,le=e.pstyle("ghost-offset-y").pfValue;ua(s,s.x1+ee,s.y1+le,s.x2+ee,s.y2+le)}}var de=u.bodyBounds=u.bodyBounds||{};ox(de,s),Sf(de,x),wf(de,1),i&&(h=s.x1,v=s.x2,p=s.y1,m=s.y2,ua(s,h-O,p-O,v+O,m+O));var xe=u.overlayBounds=u.overlayBounds||{};ox(xe,s),Sf(xe,x),wf(xe,1);var Re=u.labelBounds=u.labelBounds||{};Re.all!=null?a2(Re.all):Re.all=br(),i&&n.includeLabels&&(n.includeMainLabels&&Yg(s,e,null),c&&(n.includeSourceLabels&&Yg(s,e,"source"),n.includeTargetLabels&&Yg(s,e,"target")))}return s.x1=na(s.x1),s.y1=na(s.y1),s.x2=na(s.x2),s.y2=na(s.y2),s.w=na(s.x2-s.x1),s.h=na(s.y2-s.y1),s.w>0&&s.h>0&&T&&(Sf(s,x),wf(s,1)),s},pC=function(e){var n=0,r=function(s){return(s?1:0)<<n++},i=0;return i+=r(e.incudeNodes),i+=r(e.includeEdges),i+=r(e.includeLabels),i+=r(e.includeMainLabels),i+=r(e.includeSourceLabels),i+=r(e.includeTargetLabels),i+=r(e.includeOverlays),i+=r(e.includeOutlines),i},mC=function(e){var n=function(u){return Math.round(u)};if(e.isEdge()){var r=e.source().position(),i=e.target().position();return nx([n(r.x),n(r.y),n(i.x),n(i.y)])}else{var l=e.position();return nx([n(l.x),n(l.y)])}},C1=function(e,n){var r=e._private,i,l=e.isEdge(),s=n==null?T1:pC(n),u=s===T1;if(r.bbCache==null?(i=SM(e,gu),r.bbCache=i,r.bbCachePosKey=mC(e)):i=r.bbCache,!u){var f=e.isNode();i=br(),(n.includeNodes&&f||n.includeEdges&&!f)&&(n.includeOverlays?Ni(i,r.overlayBounds):Ni(i,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!l||n.includeSourceLabels&&n.includeTargetLabels)?Ni(i,r.labelBounds.all):(n.includeMainLabels&&Ni(i,r.labelBounds.mainRot),n.includeSourceLabels&&Ni(i,r.labelBounds.sourceRot),n.includeTargetLabels&&Ni(i,r.labelBounds.targetRot))),i.w=i.x2-i.x1,i.h=i.y2-i.y1}return i},gu={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},T1=pC(gu),D1=ir(gu);Gi.boundingBox=function(t){var e,n=t===void 0||t.useCache===void 0||t.useCache===!0,r=Fs(function(h){var v=h._private;return v.bbCache==null||v.styleDirty||v.bbCachePosKey!==mC(h)},function(h){return h.id()});if(n&&this.length===1&&!r(this[0]))t===void 0?t=gu:t=D1(t),e=C1(this[0],t);else{e=br(),t=t||gu;var i=D1(t),l=this,s=l.cy(),u=s.styleEnabled();this.edges().forEach(r),this.nodes().forEach(r),u&&this.recalculateRenderedStyle(n),this.updateCompoundBounds(!n);for(var f=0;f<l.length;f++){var c=l[f];r(c)&&c.dirtyBoundingBoxCache(),Ni(e,C1(c,i))}}return e.x1=na(e.x1),e.y1=na(e.y1),e.x2=na(e.x2),e.y2=na(e.y2),e.w=na(e.x2-e.x1),e.h=na(e.y2-e.y1),e};Gi.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};Gi.boundingBoxAt=function(t){var e=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=e.filter(function(c){return c.isParent()}),e=e.not(i)),zt(t)){var l=t;t=function(){return l}}var s=function(h,v){return h._private.bbAtOldPos=t(h,v)},u=function(h){return h._private.bbAtOldPos};n.startBatch(),e.forEach(s).silentPositions(t),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var f=r2(this.boundingBox({useCache:!1}));return e.silentPositions(u),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),f};Bs.boundingbox=Bs.bb=Bs.boundingBox;Bs.renderedBoundingbox=Bs.renderedBoundingBox;var CM=Gi,tu,ku;tu=ku={};var yC=function(e){e.uppercaseName=qE(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=qE(e.outerName),tu[e.name]=function(){var r=this[0],i=r._private,l=i.cy,s=l._private.styleEnabled;if(r)if(s){if(r.isParent())return r.updateCompoundBounds(),i[e.autoName]||0;var u=r.pstyle(e.name);return u.strValue==="label"?(r.recalculateRenderedStyle(),i.rstyle[e.labelName]||0):u.pfValue}else return 1},tu["outer"+e.uppercaseName]=function(){var r=this[0],i=r._private,l=i.cy,s=l._private.styleEnabled;if(r)if(s){var u=r[e.name](),f=r.pstyle("border-position").value,c;f==="center"?c=r.pstyle("border-width").pfValue:f==="outside"?c=2*r.pstyle("border-width").pfValue:c=0;var h=2*r.padding();return u+c+h}else return 1},tu["rendered"+e.uppercaseName]=function(){var r=this[0];if(r){var i=r[e.name]();return i*this.cy().zoom()}},tu["rendered"+e.uppercaseOuterName]=function(){var r=this[0];if(r){var i=r[e.outerName]();return i*this.cy().zoom()}}};yC({name:"width"});yC({name:"height"});ku.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};ku.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};ku.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var TM=ku,DM=function(e,n){if(e.isEdge()&&e.takesUpSpace())return n(e)},AM=function(e,n){if(e.isEdge()&&e.takesUpSpace()){var r=e.cy();return nd(n(e),r.zoom(),r.pan())}},_M=function(e,n){if(e.isEdge()&&e.takesUpSpace()){var r=e.cy(),i=r.pan(),l=r.zoom();return n(e).map(function(s){return nd(s,l,i)})}},kM=function(e){return e.renderer().getControlPoints(e)},NM=function(e){return e.renderer().getSegmentPoints(e)},RM=function(e){return e.renderer().getSourceEndpoint(e)},MM=function(e){return e.renderer().getTargetEndpoint(e)},OM=function(e){return e.renderer().getEdgeMidpoint(e)},A1={controlPoints:{get:kM,mult:!0},segmentPoints:{get:NM,mult:!0},sourceEndpoint:{get:RM},targetEndpoint:{get:MM},midpoint:{get:OM}},BM=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},LM=Object.keys(A1).reduce(function(t,e){var n=A1[e],r=BM(e);return t[e]=function(){return DM(this,n.get)},n.mult?t[r]=function(){return _M(this,n.get)}:t[r]=function(){return AM(this,n.get)},t},{}),FM=ht({},xM,CM,TM,LM);var bC=function(e,n){this.recycle(e,n)};function jo(){return!1}function af(){return!0}bC.prototype={instanceString:function(){return"event"},recycle:function(e,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=jo,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?af:jo):e!=null&&e.type?n=e:this.type=e,n!=null&&(this.originalEvent=n.originalEvent,this.type=n.type!=null?n.type:this.type,this.cy=n.cy,this.target=n.target,this.position=n.position,this.renderedPosition=n.renderedPosition,this.namespace=n.namespace,this.layout=n.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var r=this.position,i=this.cy.zoom(),l=this.cy.pan();this.renderedPosition={x:r.x*i+l.x,y:r.y*i+l.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=af;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=af;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=af,this.stopPropagation()},isDefaultPrevented:jo,isPropagationStopped:jo,isImmediatePropagationStopped:jo};var EC=/^([^.]+)(\.(?:[^.]+))?$/,IM=".*",xC={qualifierCompare:function(e,n){return e===n},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},_1=Object.keys(xC),zM={};function ud(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zM,e=arguments.length>1?arguments[1]:void 0,n=0;n<_1.length;n++){var r=_1[n];this[r]=t[r]||xC[r]}this.context=e||this.context,this.listeners=[],this.emitting=0}var qi=ud.prototype,wC=function(e,n,r,i,l,s,u){wn(i)&&(l=i,i=null),u&&(s==null?s=u:s=ht({},s,u));for(var f=ln(r)?r:r.split(/\s+/),c=0;c<f.length;c++){var h=f[c];if(!Fi(h)){var v=h.match(EC);if(v){var p=v[1],m=v[2]?v[2]:null,y=n(e,h,p,m,i,l,s);if(y===!1)break}}}},k1=function(e,n){return e.addEventFields(e.context,n),new bC(n.type,n)},PM=function(e,n,r){if(Vk(r)){n(e,r);return}else if(zt(r)){n(e,k1(e,r));return}for(var i=ln(r)?r:r.split(/\s+/),l=0;l<i.length;l++){var s=i[l];if(!Fi(s)){var u=s.match(EC);if(u){var f=u[1],c=u[2]?u[2]:null,h=k1(e,{type:f,namespace:c,target:e.context});n(e,h)}}}};qi.on=qi.addListener=function(t,e,n,r,i){return wC(this,function(l,s,u,f,c,h,v){wn(h)&&l.listeners.push({event:s,callback:h,type:u,namespace:f,qualifier:c,conf:v})},t,e,n,r,i),this};qi.one=function(t,e,n,r){return this.on(t,e,n,r,{one:!0})};qi.removeListener=qi.off=function(t,e,n,r){var i=this;this.emitting!==0&&(this.listeners=AN(this.listeners));for(var l=this.listeners,s=function(c){var h=l[c];wC(i,function(v,p,m,y,w,S){if((h.type===m||t==="*")&&(!y&&h.namespace!==".*"||h.namespace===y)&&(!w||v.qualifierCompare(h.qualifier,w))&&(!S||h.callback===S))return l.splice(c,1),!1},t,e,n,r)},u=l.length-1;u>=0;u--)s(u);return this};qi.removeAllListeners=function(){return this.removeListener("*")};qi.emit=qi.trigger=function(t,e,n){var r=this.listeners,i=r.length;return this.emitting++,ln(e)||(e=[e]),PM(this,function(l,s){n!=null&&(r=[{event:s.event,type:s.type,namespace:s.namespace,callback:n}],i=r.length);for(var u=function(){var h=r[f];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===IM)&&l.eventMatches(l.context,h,s)){var v=[s];e!=null&&kN(v,e),l.beforeEmit(l.context,h,s),h.conf&&h.conf.one&&(l.listeners=l.listeners.filter(function(y){return y!==h}));var p=l.callbackContext(l.context,h,s),m=h.callback.apply(p,v);l.afterEmit(l.context,h,s),m===!1&&(s.stopPropagation(),s.preventDefault())}},f=0;f<i;f++)u();l.bubble(l.context)&&!s.isPropagationStopped()&&l.parent(l.context).emit(s,e)},t),this.emitting--,this};var UM={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var i=n.qualifier;return i!=null?e!==r.target&&Su(r.target)&&i.matches(r.target):!0},addEventFields:function(e,n){n.cy=e.cy(),n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e},beforeEmit:function(e,n){n.conf&&n.conf.once&&n.conf.onceCollection.removeListener(n.event,n.qualifier,n.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},lf=function(e){return st(e)?new Pi(e):e},SC={createEmitter:function(){for(var e=0;e<this.length;e++){var n=this[e],r=n._private;r.emitter||(r.emitter=new ud(UM,n))}return this},emitter:function(){return this._private.emitter},on:function(e,n,r){for(var i=lf(n),l=0;l<this.length;l++){var s=this[l];s.emitter().on(e,i,r)}return this},removeListener:function(e,n,r){for(var i=lf(n),l=0;l<this.length;l++){var s=this[l];s.emitter().removeListener(e,i,r)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var n=this[e];n.emitter().removeAllListeners()}return this},one:function(e,n,r){for(var i=lf(n),l=0;l<this.length;l++){var s=this[l];s.emitter().one(e,i,r)}return this},once:function(e,n,r){for(var i=lf(n),l=0;l<this.length;l++){var s=this[l];s.emitter().on(e,i,r,{once:!0,onceCollection:this})}},emit:function(e,n){for(var r=0;r<this.length;r++){var i=this[r];i.emitter().emit(e,n)}return this},emitAndNotify:function(e,n){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,n),this}};$t.eventAliasesOn(SC);var CC={nodes:function(e){return this.filter(function(n){return n.isNode()}).filter(e)},edges:function(e){return this.filter(function(n){return n.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),n=this.spawn(),r=0;r<this.length;r++){var i=this[r];i.isNode()?e.push(i):n.push(i)}return{nodes:e,edges:n}},filter:function(e,n){if(e===void 0)return this;if(st(e)||Hr(e))return new Pi(e).filter(this);if(wn(e)){for(var r=this.spawn(),i=this,l=0;l<i.length;l++){var s=i[l],u=n?e.apply(n,[s,l,i]):e(s,l,i);u&&r.push(s)}return r}return this.spawn()},not:function(e){if(e){st(e)&&(e=this.filter(e));for(var n=this.spawn(),r=0;r<this.length;r++){var i=this[r],l=e.has(i);l||n.push(i)}return n}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(st(e)){var n=e;return this.filter(n)}for(var r=this.spawn(),i=this,l=e,s=this.length<e.length,u=s?i:l,f=s?l:i,c=0;c<u.length;c++){var h=u[c];f.has(h)&&r.push(h)}return r},xor:function(e){var n=this._private.cy;st(e)&&(e=n.$(e));var r=this.spawn(),i=this,l=e,s=function(f,c){for(var h=0;h<f.length;h++){var v=f[h],p=v._private.data.id,m=c.hasElementWithId(p);m||r.push(v)}};return s(i,l),s(l,i),r},diff:function(e){var n=this._private.cy;st(e)&&(e=n.$(e));var r=this.spawn(),i=this.spawn(),l=this.spawn(),s=this,u=e,f=function(h,v,p){for(var m=0;m<h.length;m++){var y=h[m],w=y._private.data.id,S=v.hasElementWithId(w);S?l.merge(y):p.push(y)}};return f(s,u,r),f(u,s,i),{left:r,right:i,both:l}},add:function(e){var n=this._private.cy;if(!e)return this;if(st(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=this.spawnSelf(),l=0;l<e.length;l++){var s=e[l],u=!this.has(s);u&&i.push(s)}return i},merge:function(e){var n=this._private,r=n.cy;if(!e)return this;if(e&&st(e)){var i=e;e=r.mutableElements().filter(i)}for(var l=n.map,s=0;s<e.length;s++){var u=e[s],f=u._private.data.id,c=!l.has(f);if(c){var h=this.length++;this[h]=u,l.set(f,{ele:u,index:h})}}return this},unmergeAt:function(e){var n=this[e],r=n.id(),i=this._private,l=i.map;this[e]=void 0,l.delete(r);var s=e===this.length-1;if(this.length>1&&!s){var u=this.length-1,f=this[u],c=f._private.data.id;this[u]=void 0,this[e]=f,l.set(c,{ele:f,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var n=this._private,r=e._private.data.id,i=n.map,l=i.get(r);if(!l)return this;var s=l.index;return this.unmergeAt(s),this},unmerge:function(e){var n=this._private.cy;if(!e)return this;if(e&&st(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=0;i<e.length;i++)this.unmergeOne(e[i]);return this},unmergeBy:function(e){for(var n=this.length-1;n>=0;n--){var r=this[n];e(r)&&this.unmergeAt(n)}return this},map:function(e,n){for(var r=[],i=this,l=0;l<i.length;l++){var s=i[l],u=n?e.apply(n,[s,l,i]):e(s,l,i);r.push(u)}return r},reduce:function(e,n){for(var r=n,i=this,l=0;l<i.length;l++)r=e(r,i[l],l,i);return r},max:function(e,n){for(var r=-1/0,i,l=this,s=0;s<l.length;s++){var u=l[s],f=n?e.apply(n,[u,s,l]):e(u,s,l);f>r&&(r=f,i=u)}return{value:r,ele:i}},min:function(e,n){for(var r=1/0,i,l=this,s=0;s<l.length;s++){var u=l[s],f=n?e.apply(n,[u,s,l]):e(u,s,l);f<r&&(r=f,i=u)}return{value:r,ele:i}}},jt=CC;jt.u=jt["|"]=jt["+"]=jt.union=jt.or=jt.add;jt["\\"]=jt["!"]=jt["-"]=jt.difference=jt.relativeComplement=jt.subtract=jt.not;jt.n=jt["&"]=jt["."]=jt.and=jt.intersection=jt.intersect;jt["^"]=jt["(+)"]=jt["(-)"]=jt.symmetricDifference=jt.symdiff=jt.xor;jt.fnFilter=jt.filterFn=jt.stdFilter=jt.filter;jt.complement=jt.abscomp=jt.absoluteComplement;var qM={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}},TC=function(e,n){var r=e.cy(),i=r.hasCompoundNodes();function l(h){var v=h.pstyle("z-compound-depth");return v.value==="auto"?i?h.zDepth():0:v.value==="bottom"?-1:v.value==="top"?um:0}var s=l(e)-l(n);if(s!==0)return s;function u(h){var v=h.pstyle("z-index-compare");return v.value==="auto"&&h.isNode()?1:0}var f=u(e)-u(n);if(f!==0)return f;var c=e.pstyle("z-index").value-n.pstyle("z-index").value;return c!==0?c:e.poolIndex()-n.poolIndex()},Uf={forEach:function(e,n){if(wn(e))for(var r=this.length,i=0;i<r;i++){var l=this[i],s=n?e.apply(n,[l,i,this]):e(l,i,this);if(s===!1)break}return this},toArray:function(){for(var e=[],n=0;n<this.length;n++)e.push(this[n]);return e},slice:function(e,n){var r=[],i=this.length;n==null&&(n=i),e==null&&(e=0),e<0&&(e=i+e),n<0&&(n=i+n);for(var l=e;l>=0&&l<n&&l<i;l++)r.push(this[l]);return this.spawn(r)},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(!wn(e))return this;var n=this.toArray().sort(e);return this.spawn(n)},sortByZIndex:function(){return this.sort(TC)},zDepth:function(){var e=this[0];if(e){var n=e._private,r=n.group;if(r==="nodes"){var i=n.data.parent?e.parents().size():0;return e.isParent()?i:um-1}else{var l=n.source,s=n.target,u=l.zDepth(),f=s.zDepth();return Math.max(u,f,0)}}}};Uf.each=Uf.forEach;var HM=function(){var e="undefined",n=(typeof Symbol>"u"?"undefined":Hn(Symbol))!=e&&Hn(Symbol.iterator)!=e;n&&(Uf[Symbol.iterator]=function(){var r=this,i={value:void 0,done:!1},l=0,s=this.length;return SS({next:function(){return l<s?i.value=r[l++]:(i.value=void 0,i.done=!0),i}},Symbol.iterator,function(){return this})})};HM();var jM=ir({nodeDimensionsIncludeLabels:!1}),Tf={layoutDimensions:function(e){e=jM(e);var n;if(!this.takesUpSpace())n={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var r=this.boundingBox();n={w:r.w,h:r.h}}else n={w:this.outerWidth(),h:this.outerHeight()};return(n.w===0||n.h===0)&&(n.w=n.h=1),n},layoutPositions:function(e,n,r){var i=this.nodes().filter(function(N){return!N.isParent()}),l=this.cy(),s=n.eles,u=function(k){return k.id()},f=Fs(r,u);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(k,D,O){var L={x:D.x1+D.w/2,y:D.y1+D.h/2},M={x:(O.x-L.x)*k,y:(O.y-L.y)*k};return{x:L.x+M.x,y:L.y+M.y}},h=n.spacingFactor&&n.spacingFactor!==1,v=function(){if(!h)return null;for(var k=br(),D=0;D<i.length;D++){var O=i[D],L=f(O,D);jS(k,L.x,L.y)}return k},p=v(),m=Fs(function(N,k){var D=f(N,k);if(h){var O=Math.abs(n.spacingFactor);D=c(O,p,D)}return n.transform!=null&&(D=n.transform(N,D)),D},u);if(n.animate){for(var y=0;y<i.length;y++){var w=i[y],S=m(w,y),x=n.animateFilter==null||n.animateFilter(w,y);if(x){var C=w.animation({position:S,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(C)}else w.position(S)}if(n.fit){var T=l.animation({fit:{boundingBox:s.boundingBoxAt(m),padding:n.padding},duration:n.animationDuration,easing:n.animationEasing});e.animations.push(T)}else if(n.zoom!==void 0&&n.pan!==void 0){var A=l.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(A)}e.animations.forEach(function(N){return N.play()}),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),qs.all(e.animations.map(function(N){return N.promise()})).then(function(){e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e})})}else i.positions(m),n.fit&&l.fit(n.eles,n.padding),n.zoom!=null&&l.zoom(n.zoom),n.pan&&l.pan(n.pan),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var n=this.cy();return n.makeLayout(ht({},e,{eles:this}))}};Tf.createLayout=Tf.makeLayout=Tf.layout;function DC(t,e,n){var r=n._private,i=r.styleCache=r.styleCache||[],l;return(l=i[t])!=null||(l=i[t]=e(n)),l}function cd(t,e){return t=wl(t),function(r){return DC(t,e,r)}}function fd(t,e){t=wl(t);var n=function(i){return e.call(i)};return function(){var i=this[0];if(i)return DC(t,n,i)}}var rr={recalculateRenderedStyle:function(e){var n=this.cy(),r=n.renderer(),i=n.styleEnabled();return r&&i&&r.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),n=function(l){return l._private.styleCache=null};if(e.hasCompoundNodes()){var r;r=this.spawnSelf().merge(this.descendants()).merge(this.parents()),r.merge(r.connectedEdges()),r.forEach(n)}else this.forEach(function(i){n(i),i.connectedEdges().forEach(n)});return this},updateStyle:function(e){var n=this._private.cy;if(!n.styleEnabled())return this;if(n.batching()){var r=n._private.batchStyleEles;return r.merge(this),this}var i=n.hasCompoundNodes(),l=this;e=!!(e||e===void 0),i&&(l=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=l;return e?s.emitAndNotify("style"):s.emit("style"),l.forEach(function(u){return u._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var n=0;n<this.length;n++){var r=this[n];r._private.styleDirty&&(r._private.styleDirty=!1,e.style().apply(r))}},parsedStyle:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this[0],i=r.cy();if(i.styleEnabled()&&r){r._private.styleDirty&&(r._private.styleDirty=!1,i.style().apply(r));var l=r._private.style[e];return l??(n?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var n=this[0];if(n.cy().styleEnabled()&&n){var r=n.pstyle(e);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function(e){var n=this[0];if(n.cy().styleEnabled()&&n)return n.pstyle(e).units},renderedStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=this[0];if(r)return n.style().getRenderedStyle(r,e)},style:function(e,n){var r=this.cy();if(!r.styleEnabled())return this;var i=!1,l=r.style();if(zt(e)){var s=e;l.applyBypass(this,s,i),this.emitAndNotify("style")}else if(st(e))if(n===void 0){var u=this[0];return u?l.getStylePropertyValue(u,e):void 0}else l.applyBypass(this,e,n,i),this.emitAndNotify("style");else if(e===void 0){var f=this[0];return f?l.getRawStyle(f):void 0}return this},removeStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style(),l=this;if(e===void 0)for(var s=0;s<l.length;s++){var u=l[s];i.removeAllBypasses(u,r)}else{e=e.split(/\s+/);for(var f=0;f<l.length;f++){var c=l[f];i.removeBypasses(c,e,r)}}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 n=e.hasCompoundNodes(),r=this[0];if(r){var i=r._private,l=r.pstyle("opacity").value;if(!n)return l;var s=i.data.parent?r.parents():null;if(s)for(var u=0;u<s.length;u++){var f=s[u],c=f.pstyle("opacity").value;l=c*l}return l}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0],r=n.cy().hasCompoundNodes();if(n)return r?n.effectiveOpacity()===0:n.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0];return!!n._private.backgrounding}};function Xg(t,e){var n=t._private,r=n.data.parent?t.parents():null;if(r)for(var i=0;i<r.length;i++){var l=r[i];if(!e(l))return!1}return!0}function xm(t){var e=t.ok,n=t.edgeOkViaNode||t.ok,r=t.parentOk||t.ok;return function(){var i=this.cy();if(!i.styleEnabled())return!0;var l=this[0],s=i.hasCompoundNodes();if(l){var u=l._private;if(!e(l))return!1;if(l.isNode())return!s||Xg(l,r);var f=u.source,c=u.target;return n(f)&&(!s||Xg(f,n))&&(f===c||n(c)&&(!s||Xg(c,n)))}}}var Hs=cd("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});rr.takesUpSpace=fd("takesUpSpace",xm({ok:Hs}));var GM=cd("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Hs(t)}),VM=cd("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Hs(t)});rr.interactive=fd("interactive",xm({ok:GM,parentOk:VM,edgeOkViaNode:Hs}));rr.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var $M=cd("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Hs(t)}),KM=Hs;rr.visible=fd("visible",xm({ok:$M,edgeOkViaNode:KM}));rr.hidden=function(){var t=this[0];if(t)return!t.visible()};rr.isBundledBezier=fd("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});rr.bypass=rr.css=rr.style;rr.renderedCss=rr.renderedStyle;rr.removeBypass=rr.removeCss=rr.removeStyle;rr.pstyle=rr.parsedStyle;var Li={};function N1(t){return function(){var e=arguments,n=[];if(e.length===2){var r=e[0],i=e[1];this.on(t.event,r,i)}else if(e.length===1&&wn(e[0])){var l=e[0];this.on(t.event,l)}else if(e.length===0||e.length===1&&ln(e[0])){for(var s=e.length===1?e[0]:null,u=0;u<this.length;u++){var f=this[u],c=!t.ableField||f._private[t.ableField],h=f._private[t.field]!=t.value;if(t.overrideAble){var v=t.overrideAble(f);if(v!==void 0&&(c=v,!v))return this}c&&(f._private[t.field]=t.value,h&&n.push(f))}var p=this.spawn(n);p.updateStyle(),p.emit(t.event),s&&p.emit(s)}return this}}function js(t){Li[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var n=t.overrideField(e);if(n!==void 0)return n}return e._private[t.field]}},Li[t.on]=N1({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),Li[t.off]=N1({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}js({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});js({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});js({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});js({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Li.deselect=Li.unselect;Li.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};js({field:"active",on:"activate",off:"unactivate"});js({field:"pannable",on:"panify",off:"unpanify"});Li.inactive=function(){var t=this[0];if(t)return!t._private.active};var cr={},R1=function(e){return function(r){for(var i=this,l=[],s=0;s<i.length;s++){var u=i[s];if(u.isNode()){for(var f=!1,c=u.connectedEdges(),h=0;h<c.length;h++){var v=c[h],p=v.source(),m=v.target();if(e.noIncomingEdges&&m===u&&p!==u||e.noOutgoingEdges&&p===u&&m!==u){f=!0;break}}f||l.push(u)}}return this.spawn(l,!0).filter(r)}},M1=function(e){return function(n){for(var r=this,i=[],l=0;l<r.length;l++){var s=r[l];if(s.isNode())for(var u=s.connectedEdges(),f=0;f<u.length;f++){var c=u[f],h=c.source(),v=c.target();e.outgoing&&h===s?(i.push(c),i.push(v)):e.incoming&&v===s&&(i.push(c),i.push(h))}}return this.spawn(i,!0).filter(n)}},O1=function(e){return function(n){for(var r=this,i=[],l={};;){var s=e.outgoing?r.outgoers():r.incomers();if(s.length===0)break;for(var u=!1,f=0;f<s.length;f++){var c=s[f],h=c.id();l[h]||(l[h]=!0,i.push(c),u=!0)}if(!u)break;r=s}return this.spawn(i,!0).filter(n)}};cr.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};ht(cr,{roots:R1({noIncomingEdges:!0}),leaves:R1({noOutgoingEdges:!0}),outgoers:aa(M1({outgoing:!0}),"outgoers"),successors:O1({outgoing:!0}),incomers:aa(M1({incoming:!0}),"incomers"),predecessors:O1({})});ht(cr,{neighborhood:aa(function(t){for(var e=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],l=i.connectedEdges(),s=0;s<l.length;s++){var u=l[s],f=u.source(),c=u.target(),h=i===f?c:f;h.length>0&&e.push(h[0]),e.push(u[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)}});cr.neighbourhood=cr.neighborhood;cr.closedNeighbourhood=cr.closedNeighborhood;cr.openNeighbourhood=cr.openNeighborhood;ht(cr,{source:aa(function(e){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&e?r.filter(e):r},"source"),target:aa(function(e){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&e?r.filter(e):r},"target"),sources:B1({attr:"source"}),targets:B1({attr:"target"})});function B1(t){return function(n){for(var r=[],i=0;i<this.length;i++){var l=this[i],s=l._private[t.attr];s&&r.push(s)}return this.spawn(r,!0).filter(n)}}ht(cr,{edgesWith:aa(L1(),"edgesWith"),edgesTo:aa(L1({thisIsSrc:!0}),"edgesTo")});function L1(t){return function(n){var r=[],i=this._private.cy,l=t||{};st(n)&&(n=i.$(n));for(var s=0;s<n.length;s++)for(var u=n[s]._private.edges,f=0;f<u.length;f++){var c=u[f],h=c._private.data,v=this.hasElementWithId(h.source)&&n.hasElementWithId(h.target),p=n.hasElementWithId(h.source)&&this.hasElementWithId(h.target),m=v||p;m&&((l.thisIsSrc||l.thisIsTgt)&&(l.thisIsSrc&&!v||l.thisIsTgt&&!p)||r.push(c))}return this.spawn(r,!0)}}ht(cr,{connectedEdges:aa(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var i=n[r];if(i.isNode())for(var l=i._private.edges,s=0;s<l.length;s++){var u=l[s];e.push(u)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:aa(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var i=n[r];i.isEdge()&&(e.push(i.source()[0]),e.push(i.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:aa(F1(),"parallelEdges"),codirectedEdges:aa(F1({codirected:!0}),"codirectedEdges")});function F1(t){var e={codirected:!1};return t=ht({},e,t),function(r){for(var i=[],l=this.edges(),s=t,u=0;u<l.length;u++)for(var f=l[u],c=f._private,h=c.source,v=h._private.data.id,p=c.data.target,m=h._private.edges,y=0;y<m.length;y++){var w=m[y],S=w._private.data,x=S.target,C=S.source,T=x===p&&C===v,A=v===x&&p===C;(s.codirected&&T||!s.codirected&&(T||A))&&i.push(w)}return this.spawn(i,!0).filter(r)}}ht(cr,{components:function(e){var n=this,r=n.cy(),i=r.collection(),l=e==null?n.nodes():e.nodes(),s=[];e!=null&&l.empty()&&(l=e.sources());var u=function(h,v){i.merge(h),l.unmerge(h),v.merge(h)};if(l.empty())return n.spawn();var f=function(){var h=r.collection();s.push(h);var v=l[0];u(v,h),n.bfs({directed:!1,roots:v,visit:function(m){return u(m,h)}}),h.forEach(function(p){p.connectedEdges().forEach(function(m){n.has(m)&&h.has(m.source())&&h.has(m.target())&&h.merge(m)})})};do f();while(l.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});cr.componentsOf=cr.components;var ar=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){mn("A collection must have a reference to the core");return}var l=new Ka,s=!1;if(!n)n=[];else if(n.length>0&&zt(n[0])&&!Su(n[0])){s=!0;for(var u=[],f=new Us,c=0,h=n.length;c<h;c++){var v=n[c];v.data==null&&(v.data={});var p=v.data;if(p.id==null)p.id=US();else if(e.hasElementWithId(p.id)||f.has(p.id))continue;var m=new td(e,v,!1);u.push(m),f.add(p.id)}n=u}this.length=0;for(var y=0,w=n.length;y<w;y++){var S=n[y][0];if(S!=null){var x=S._private.data.id;(!r||!l.has(x))&&(r&&l.set(x,{index:this.length,ele:S}),this[this.length]=S,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(C){this.lazyMap=C},rebuildMap:function(){for(var T=this.lazyMap=new Ka,A=this.eles,N=0;N<A.length;N++){var k=A[N];T.set(k.id(),{index:N,ele:k})}}},r&&(this._private.map=l),s&&!i&&this.restore()},cn=td.prototype=ar.prototype=Object.create(Array.prototype);cn.instanceString=function(){return"collection"};cn.spawn=function(t,e){return new ar(this.cy(),t,e)};cn.spawnSelf=function(){return this.spawn(this)};cn.cy=function(){return this._private.cy};cn.renderer=function(){return this._private.cy.renderer()};cn.element=function(){return this[0]};cn.collection=function(){return DS(this)?this:new ar(this._private.cy,[this])};cn.unique=function(){return new ar(this._private.cy,this,!0)};cn.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};cn.getElementById=function(t){t=""+t;var e=this._private.cy,n=this._private.map.get(t);return n?n.ele:new ar(e)};cn.$id=cn.getElementById;cn.poolIndex=function(){var t=this._private.cy,e=t._private.elements,n=this[0]._private.data.id;return e._private.map.get(n).index};cn.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};cn.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};cn.json=function(t){var e=this.element(),n=this.cy();if(e==null&&t)return this;if(e!=null){var r=e._private;if(zt(t)){if(n.startBatch(),t.data){e.data(t.data);var i=r.data;if(e.isEdge()){var l=!1,s={},u=t.data.source,f=t.data.target;u!=null&&u!=i.source&&(s.source=""+u,l=!0),f!=null&&f!=i.target&&(s.target=""+f,l=!0),l&&(e=e.move(s))}else{var c="parent"in t.data,h=t.data.parent;c&&(h!=null||i.parent!=null)&&h!=i.parent&&(h===void 0&&(h=null),h!=null&&(h=""+h),e=e.move({parent:h}))}}t.position&&e.position(t.position);var v=function(w,S,x){var C=t[w];C!=null&&C!==r[w]&&(C?e[S]():e[x]())};return v("removed","remove","restore"),v("selected","select","unselect"),v("selectable","selectify","unselectify"),v("locked","lock","unlock"),v("grabbable","grabify","ungrabify"),v("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),n.endBatch(),this}else if(t===void 0){var p={data:Sa(r.data),position:Sa(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};p.classes="";var m=0;return r.classes.forEach(function(y){return p.classes+=m++===0?y:" "+y}),p}}};cn.jsons=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e],r=n.json();t.push(r)}return t};cn.clone=function(){for(var t=this.cy(),e=[],n=0;n<this.length;n++){var r=this[n],i=r.json(),l=new td(t,i,!1);e.push(l)}return new ar(t,e)};cn.copy=cn.clone;cn.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,n=this,r=n.cy(),i=r._private,l=[],s=[],u,f=0,c=n.length;f<c;f++){var h=n[f];e&&!h.removed()||(h.isNode()?l.push(h):s.push(h))}u=l.concat(s);var v,p=function(){u.splice(v,1),v--};for(v=0;v<u.length;v++){var m=u[v],y=m._private,w=y.data;if(m.clearTraversalCache(),!(!e&&!y.removed)){if(w.id===void 0)w.id=US();else if(je(w.id))w.id=""+w.id;else if(Fi(w.id)||!st(w.id)){mn("Can not create element with invalid string ID `"+w.id+"`"),p();continue}else if(r.hasElementWithId(w.id)){mn("Can not create second element with ID `"+w.id+"`"),p();continue}}var S=w.id;if(m.isNode()){var x=y.position;x.x==null&&(x.x=0),x.y==null&&(x.y=0)}if(m.isEdge()){for(var C=m,T=["source","target"],A=T.length,N=!1,k=0;k<A;k++){var D=T[k],O=w[D];je(O)&&(O=w[D]=""+w[D]),O==null||O===""?(mn("Can not create edge `"+S+"` with unspecified "+D),N=!0):r.hasElementWithId(O)||(mn("Can not create edge `"+S+"` with nonexistent "+D+" `"+O+"`"),N=!0)}if(N){p();continue}var L=r.getElementById(w.source),M=r.getElementById(w.target);L.same(M)?L._private.edges.push(C):(L._private.edges.push(C),M._private.edges.push(C)),C._private.source=L,C._private.target=M}y.map=new Ka,y.map.set(S,{ele:m,index:0}),y.removed=!1,e&&r.addToPool(m)}for(var z=0;z<l.length;z++){var B=l[z],U=B._private.data;je(U.parent)&&(U.parent=""+U.parent);var V=U.parent,$=V!=null;if($||B._private.parent){var q=B._private.parent?r.collection().merge(B._private.parent):r.getElementById(V);if(q.empty())U.parent=void 0;else if(q[0].removed())Kt("Node added with missing parent, reference to parent removed"),U.parent=void 0,B._private.parent=null;else{for(var H=!1,Y=q;!Y.empty();){if(B.same(Y)){H=!0,U.parent=void 0;break}Y=Y.parent()}H||(q[0]._private.children.push(B),B._private.parent=q[0],i.hasCompoundNodes=!0)}}}if(u.length>0){for(var Q=u.length===n.length?n:new ar(r,u),P=0;P<Q.length;P++){var I=Q[P];I.isNode()||(I.parallelEdges().clearTraversalCache(),I.source().clearTraversalCache(),I.target().clearTraversalCache())}var K;i.hasCompoundNodes?K=r.collection().merge(Q).merge(Q.connectedNodes()).merge(Q.parent()):K=Q,K.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?Q.emitAndNotify("add"):e&&Q.emit("add")}return n};cn.removed=function(){var t=this[0];return t&&t._private.removed};cn.inside=function(){var t=this[0];return t&&!t._private.removed};cn.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,n=this,r=[],i={},l=n._private.cy;function s(V){for(var $=V._private.edges,q=0;q<$.length;q++)f($[q])}function u(V){for(var $=V._private.children,q=0;q<$.length;q++)f($[q])}function f(V){var $=i[V.id()];e&&V.removed()||$||(i[V.id()]=!0,V.isNode()?(r.push(V),s(V),u(V)):r.unshift(V))}for(var c=0,h=n.length;c<h;c++){var v=n[c];f(v)}function p(V,$){var q=V._private.edges;Ii(q,$),V.clearTraversalCache()}function m(V){V.clearTraversalCache()}var y=[];y.ids={};function w(V,$){$=$[0],V=V[0];var q=V._private.children,H=V.id();Ii(q,$),$._private.parent=null,y.ids[H]||(y.ids[H]=!0,y.push(V))}n.dirtyCompoundBoundsCache(),e&&l.removeFromPool(r);for(var S=0;S<r.length;S++){var x=r[S];if(x.isEdge()){var C=x.source()[0],T=x.target()[0];p(C,x),p(T,x);for(var A=x.parallelEdges(),N=0;N<A.length;N++){var k=A[N];m(k),k.isBundledBezier()&&k.dirtyBoundingBoxCache()}}else{var D=x.parent();D.length!==0&&w(D,x)}e&&(x._private.removed=!0)}var O=l._private.elements;l._private.hasCompoundNodes=!1;for(var L=0;L<O.length;L++){var M=O[L];if(M.isParent()){l._private.hasCompoundNodes=!0;break}}var z=new ar(this.cy(),r);z.size()>0&&(t?z.emitAndNotify("remove"):e&&z.emit("remove"));for(var B=0;B<y.length;B++){var U=y[B];(!e||!U.removed())&&U.updateStyle()}return z};cn.move=function(t){var e=this._private.cy,n=this,r=!1,i=!1,l=function(y){return y==null?y:""+y};if(t.source!==void 0||t.target!==void 0){var s=l(t.source),u=l(t.target),f=s!=null&&e.hasElementWithId(s),c=u!=null&&e.hasElementWithId(u);(f||c)&&(e.batch(function(){n.remove(r,i),n.emitAndNotify("moveout");for(var m=0;m<n.length;m++){var y=n[m],w=y._private.data;y.isEdge()&&(f&&(w.source=s),c&&(w.target=u))}n.restore(r,i)}),n.emitAndNotify("move"))}else if(t.parent!==void 0){var h=l(t.parent),v=h===null||e.hasElementWithId(h);if(v){var p=h===null?void 0:h;e.batch(function(){var m=n.remove(r,i);m.emitAndNotify("moveout");for(var y=0;y<n.length;y++){var w=n[y],S=w._private.data;w.isNode()&&(S.parent=p)}m.restore(r,i)}),n.emitAndNotify("move")}}return this};[WS,aM,Cf,Bi,zs,EM,od,FM,SC,CC,qM,Uf,Tf,rr,Li,cr].forEach(function(t){ht(cn,t)});var YM={add:function(e){var n,r=this;if(Hr(e)){var i=e;if(i._private.cy===r)n=i.restore();else{for(var l=[],s=0;s<i.length;s++){var u=i[s];l.push(u.json())}n=new ar(r,l)}}else if(ln(e)){var f=e;n=new ar(r,f)}else if(zt(e)&&(ln(e.nodes)||ln(e.edges))){for(var c=e,h=[],v=["nodes","edges"],p=0,m=v.length;p<m;p++){var y=v[p],w=c[y];if(ln(w))for(var S=0,x=w.length;S<x;S++){var C=ht({group:y},w[S]);h.push(C)}}n=new ar(r,h)}else{var T=e;n=new td(r,T).collection()}return n},remove:function(e){if(!Hr(e)){if(st(e)){var n=e;e=this.$(n)}}return e.remove()}};function XM(t,e,n,r){var i=4,l=.001,s=1e-7,u=10,f=11,c=1/(f-1),h=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var v=0;v<4;++v)if(typeof arguments[v]!="number"||isNaN(arguments[v])||!isFinite(arguments[v]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var p=h?new Float32Array(f):new Array(f);function m(M,z){return 1-3*z+3*M}function y(M,z){return 3*z-6*M}function w(M){return 3*M}function S(M,z,B){return((m(z,B)*M+y(z,B))*M+w(z))*M}function x(M,z,B){return 3*m(z,B)*M*M+2*y(z,B)*M+w(z)}function C(M,z){for(var B=0;B<i;++B){var U=x(z,t,n);if(U===0)return z;var V=S(z,t,n)-M;z-=V/U}return z}function T(){for(var M=0;M<f;++M)p[M]=S(M*c,t,n)}function A(M,z,B){var U,V,$=0;do V=z+(B-z)/2,U=S(V,t,n)-M,U>0?B=V:z=V;while(Math.abs(U)>s&&++$<u);return V}function N(M){for(var z=0,B=1,U=f-1;B!==U&&p[B]<=M;++B)z+=c;--B;var V=(M-p[B])/(p[B+1]-p[B]),$=z+V*c,q=x($,t,n);return q>=l?C(M,$):q===0?$:A(M,z,z+c)}var k=!1;function D(){k=!0,(t!==e||n!==r)&&T()}var O=function(z){return k||D(),t===e&&n===r?z:z===0?0:z===1?1:S(N(z),e,r)};O.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var L="generateBezier("+[t,e,n,r]+")";return O.toString=function(){return L},O}var ZM=(function(){function t(r){return-r.tension*r.x-r.friction*r.v}function e(r,i,l){var s={x:r.x+l.dx*i,v:r.v+l.dv*i,tension:r.tension,friction:r.friction};return{dx:s.v,dv:t(s)}}function n(r,i){var l={dx:r.v,dv:t(r)},s=e(r,i*.5,l),u=e(r,i*.5,s),f=e(r,i,u),c=1/6*(l.dx+2*(s.dx+u.dx)+f.dx),h=1/6*(l.dv+2*(s.dv+u.dv)+f.dv);return r.x=r.x+c*i,r.v=r.v+h*i,r}return function r(i,l,s){var u={x:-1,v:0,tension:null,friction:null},f=[0],c=0,h=1/1e4,v=16/1e3,p,m,y;for(i=parseFloat(i)||500,l=parseFloat(l)||20,s=s||null,u.tension=i,u.friction=l,p=s!==null,p?(c=r(i,l),m=c/s*v):m=v;y=n(y||u,m),f.push(1+y.x),c+=16,Math.abs(y.x)>h&&Math.abs(y.v)>h;);return p?function(w){return f[w*(f.length-1)|0]}:c}})(),on=function(e,n,r,i){var l=XM(e,n,r,i);return function(s,u,f){return s+(u-s)*l(f)}},Df={linear:function(e,n,r){return e+(n-e)*r},ease:on(.25,.1,.25,1),"ease-in":on(.42,0,1,1),"ease-out":on(0,0,.58,1),"ease-in-out":on(.42,0,.58,1),"ease-in-sine":on(.47,0,.745,.715),"ease-out-sine":on(.39,.575,.565,1),"ease-in-out-sine":on(.445,.05,.55,.95),"ease-in-quad":on(.55,.085,.68,.53),"ease-out-quad":on(.25,.46,.45,.94),"ease-in-out-quad":on(.455,.03,.515,.955),"ease-in-cubic":on(.55,.055,.675,.19),"ease-out-cubic":on(.215,.61,.355,1),"ease-in-out-cubic":on(.645,.045,.355,1),"ease-in-quart":on(.895,.03,.685,.22),"ease-out-quart":on(.165,.84,.44,1),"ease-in-out-quart":on(.77,0,.175,1),"ease-in-quint":on(.755,.05,.855,.06),"ease-out-quint":on(.23,1,.32,1),"ease-in-out-quint":on(.86,0,.07,1),"ease-in-expo":on(.95,.05,.795,.035),"ease-out-expo":on(.19,1,.22,1),"ease-in-out-expo":on(1,0,0,1),"ease-in-circ":on(.6,.04,.98,.335),"ease-out-circ":on(.075,.82,.165,1),"ease-in-out-circ":on(.785,.135,.15,.86),spring:function(e,n,r){if(r===0)return Df.linear;var i=ZM(e,n,r);return function(l,s,u){return l+(s-l)*i(u)}},"cubic-bezier":on};function I1(t,e,n,r,i){if(r===1||e===n)return n;var l=i(e,n,r);return t==null||((t.roundValue||t.color)&&(l=Math.round(l)),t.min!==void 0&&(l=Math.max(l,t.min)),t.max!==void 0&&(l=Math.min(l,t.max))),l}function z1(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function gs(t,e,n,r,i){var l=i!=null?i.type:null;n<0?n=0:n>1&&(n=1);var s=z1(t,i),u=z1(e,i);if(je(s)&&je(u))return I1(l,s,u,n,r);if(ln(s)&&ln(u)){for(var f=[],c=0;c<u.length;c++){var h=s[c],v=u[c];if(h!=null&&v!=null){var p=I1(l,h,v,n,r);f.push(p)}else f.push(v)}return f}}function QM(t,e,n,r){var i=!r,l=t._private,s=e._private,u=s.easing,f=s.startTime,c=r?t:t.cy(),h=c.style();if(!s.easingImpl)if(u==null)s.easingImpl=Df.linear;else{var v;if(st(u)){var p=h.parse("transition-timing-function",u);v=p.value}else v=u;var m,y;st(v)?(m=v,y=[]):(m=v[1],y=v.slice(2).map(function(Q){return+Q})),y.length>0?(m==="spring"&&y.push(s.duration),s.easingImpl=Df[m].apply(null,y)):s.easingImpl=Df[m]}var w=s.easingImpl,S;if(s.duration===0?S=1:S=(n-f)/s.duration,s.applying&&(S=s.progress),S<0?S=0:S>1&&(S=1),s.delay==null){var x=s.startPosition,C=s.position;if(C&&i&&!t.locked()){var T={};Go(x.x,C.x)&&(T.x=gs(x.x,C.x,S,w)),Go(x.y,C.y)&&(T.y=gs(x.y,C.y,S,w)),t.position(T)}var A=s.startPan,N=s.pan,k=l.pan,D=N!=null&&r;D&&(Go(A.x,N.x)&&(k.x=gs(A.x,N.x,S,w)),Go(A.y,N.y)&&(k.y=gs(A.y,N.y,S,w)),t.emit("pan"));var O=s.startZoom,L=s.zoom,M=L!=null&&r;M&&(Go(O,L)&&(l.zoom=du(l.minZoom,gs(O,L,S,w),l.maxZoom)),t.emit("zoom")),(D||M)&&t.emit("viewport");var z=s.style;if(z&&z.length>0&&i){for(var B=0;B<z.length;B++){var U=z[B],V=U.name,$=U,q=s.startStyle[V],H=h.properties[q.name],Y=gs(q,$,S,w,H);h.overrideBypass(t,V,Y)}t.emit("style")}}return s.progress=S,S}function Go(t,e){return t==null||e==null?!1:je(t)&&je(e)?!0:!!(t&&e)}function WM(t,e,n,r){var i=e._private;i.started=!0,i.startTime=n-i.progress*i.duration}function P1(t,e){var n=e._private.aniEles,r=[];function i(h,v){var p=h._private,m=p.animation.current,y=p.animation.queue,w=!1;if(m.length===0){var S=y.shift();S&&m.push(S)}for(var x=function(k){for(var D=k.length-1;D>=0;D--){var O=k[D];O()}k.splice(0,k.length)},C=m.length-1;C>=0;C--){var T=m[C],A=T._private;if(A.stopped){m.splice(C,1),A.hooked=!1,A.playing=!1,A.started=!1,x(A.frames);continue}!A.playing&&!A.applying||(A.playing&&A.applying&&(A.applying=!1),A.started||WM(h,T,t),QM(h,T,t,v),A.applying&&(A.applying=!1),x(A.frames),A.step!=null&&A.step(t),T.completed()&&(m.splice(C,1),A.hooked=!1,A.playing=!1,A.started=!1,x(A.completes)),w=!0)}return!v&&m.length===0&&y.length===0&&r.push(h),w}for(var l=!1,s=0;s<n.length;s++){var u=n[s],f=i(u);l=l||f}var c=i(e,!0);(l||c)&&(n.length>0?e.notify("draw",n):e.notify("draw")),n.unmerge(r),e.emit("step")}var JM={animate:$t.animate(),animation:$t.animation(),animated:$t.animated(),clearQueue:$t.clearQueue(),delay:$t.delay(),delayAnimation:$t.delayAnimation(),stop:$t.stop(),addToAnimationPool:function(e){var n=this;n.styleEnabled()&&n._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function n(){e._private.animationsRunning&&Lf(function(l){P1(l,e),n()})}var r=e.renderer();r&&r.beforeRender?r.beforeRender(function(l,s){P1(s,e)},r.beforeRenderPriorities.animations):n()}},eO={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var i=n.qualifier;return i!=null?e!==r.target&&Su(r.target)&&i.matches(r.target):!0},addEventFields:function(e,n){n.cy=e,n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e}},sf=function(e){return st(e)?new Pi(e):e},AC={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new ud(eO,this)),this},emitter:function(){return this._private.emitter},on:function(e,n,r){return this.emitter().on(e,sf(n),r),this},removeListener:function(e,n,r){return this.emitter().removeListener(e,sf(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,n,r){return this.emitter().one(e,sf(n),r),this},once:function(e,n,r){return this.emitter().one(e,sf(n),r),this},emit:function(e,n){return this.emitter().emit(e,n),this},emitAndNotify:function(e,n){return this.emit(e),this.notify(e,n),this}};$t.eventAliasesOn(AC);var Lp={png:function(e){var n=this._private.renderer;return e=e||{},n.png(e)},jpg:function(e){var n=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",n.jpg(e)}};Lp.jpeg=Lp.jpg;var Af={layout:function(e){var n=this;if(e==null){mn("Layout options must be specified to make a layout");return}if(e.name==null){mn("A `name` must be specified to make a layout");return}var r=e.name,i=n.extension("layout",r);if(i==null){mn("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var l;st(e.eles)?l=n.$(e.eles):l=e.eles!=null?e.eles:n.$();var s=new i(ht({},e,{cy:n,eles:l}));return s}};Af.createLayout=Af.makeLayout=Af.layout;var tO={notify:function(e,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var i=r.batchNotifications[e]=r.batchNotifications[e]||this.collection();n!=null&&i.merge(n);return}if(r.notificationsEnabled){var l=this.renderer();this.destroyed()||!l||l.notify(e,n)}},notifications:function(e){var n=this._private;return e===void 0?n.notificationsEnabled:(n.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 n=this.renderer();Object.keys(e.batchNotifications).forEach(function(r){var i=e.batchNotifications[r];i.empty()?n.notify(r):n.notify(r,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var n=this;return this.batch(function(){for(var r=Object.keys(e),i=0;i<r.length;i++){var l=r[i],s=e[l],u=n.getElementById(l);u.data(s)}})}},nO=ir({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]}),Fp={renderTo:function(e,n,r,i){var l=this._private.renderer;return l.renderTo(e,n,r,i),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 n=this,r=n.extension("renderer",e.name);if(r==null){mn("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&&Kt("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 i=nO(e);i.cy=n,n._private.renderer=new r(i),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var n=e.container();if(n)for(n._cyreg=null;n.childNodes.length>0;)n.removeChild(n.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(r){var i=r._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Fp.invalidateDimensions=Fp.resize;var _f={collection:function(e,n){return st(e)?this.$(e):Hr(e)?e.collection():ln(e)?(n||(n={}),new ar(this,e,n.unique,n.removed)):new ar(this)},nodes:function(e){var n=this.$(function(r){return r.isNode()});return e?n.filter(e):n},edges:function(e){var n=this.$(function(r){return r.isEdge()});return e?n.filter(e):n},$:function(e){var n=this._private.elements;return e?n.filter(e):n.spawnSelf()},mutableElements:function(){return this._private.elements}};_f.elements=_f.filter=_f.$;var Xn={},ru="t",rO="f";Xn.apply=function(t){for(var e=this,n=e._private,r=n.cy,i=r.collection(),l=0;l<t.length;l++){var s=t[l],u=e.getContextMeta(s);if(!u.empty){var f=e.getContextStyle(u),c=e.applyContextStyle(u,f,s);s._private.appliedInitStyle?e.updateTransitions(s,c.diffProps):s._private.appliedInitStyle=!0;var h=e.updateStyleHints(s);h&&i.push(s)}}return i};Xn.getPropertiesDiff=function(t,e){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=t+"-"+e,l=r[i];if(l)return l;for(var s=[],u={},f=0;f<n.length;f++){var c=n[f],h=t[f]===ru,v=e[f]===ru,p=h!==v,m=c.mappedProperties.length>0;if(p||v&&m){var y=void 0;p&&m||p?y=c.properties:m&&(y=c.mappedProperties);for(var w=0;w<y.length;w++){for(var S=y[w],x=S.name,C=!1,T=f+1;T<n.length;T++){var A=n[T],N=e[T]===ru;if(N&&(C=A.properties[S.name]!=null,C))break}!u[x]&&!C&&(u[x]=!0,s.push(x))}}}return r[i]=s,s};Xn.getContextMeta=function(t){for(var e=this,n="",r,i=t._private.styleCxtKey||"",l=0;l<e.length;l++){var s=e[l],u=s.selector&&s.selector.matches(t);u?n+=ru:n+=rO}return r=e.getPropertiesDiff(i,n),t._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}};Xn.getContextStyle=function(t){var e=t.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[e])return r[e];for(var i={_private:{key:e}},l=0;l<n.length;l++){var s=n[l],u=e[l]===ru;if(u)for(var f=0;f<s.properties.length;f++){var c=s.properties[f];i[c.name]=c}}return r[e]=i,i};Xn.applyContextStyle=function(t,e,n){for(var r=this,i=t.diffPropNames,l={},s=r.types,u=0;u<i.length;u++){var f=i[u],c=e[f],h=n.pstyle(f);if(!c)if(h)h.bypass?c={name:f,deleteBypassed:!0}:c={name:f,delete:!0};else continue;if(h!==c){if(c.mapped===s.fn&&h!=null&&h.mapping!=null&&h.mapping.value===c.value){var v=h.mapping,p=v.fnValue=c.value(n);if(p===v.prevFnValue)continue}var m=l[f]={prev:h};r.applyParsedProperty(n,c),m.next=n.pstyle(f),m.next&&m.next.bypass&&(m.next=m.next.bypassed)}}return{diffProps:l}};Xn.updateStyleHints=function(t){var e=t._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,l=function(de,xe,Re){return n.getPropertiesHash(de,xe,Re)},s=e.styleKey;if(t.removed())return!1;var u=e.group==="nodes",f=t._private.style;r=Object.keys(f);for(var c=0;c<i.length;c++){var h=i[c];e.styleKeys[h]=[bl,Cs]}for(var v=function(de,xe){return e.styleKeys[xe][0]=uu(de,e.styleKeys[xe][0])},p=function(de,xe){return e.styleKeys[xe][1]=cu(de,e.styleKeys[xe][1])},m=function(de,xe){v(de,xe),p(de,xe)},y=function(de,xe){for(var Re=0;Re<de.length;Re++){var $e=de.charCodeAt(Re);v($e,xe),p($e,xe)}},w=2e9,S=function(de){return-128<de&&de<128&&Math.floor(de)!==de?w-(de*1024|0):de},x=0;x<r.length;x++){var C=r[x],T=f[C];if(T!=null){var A=this.properties[C],N=A.type,k=A.groupKey,D=void 0;A.hashOverride!=null?D=A.hashOverride(t,T):T.pfValue!=null&&(D=T.pfValue);var O=A.enums==null?T.value:null,L=D!=null,M=O!=null,z=L||M,B=T.units;if(N.number&&z&&!N.multiple){var U=L?D:O;m(S(U),k),!L&&B!=null&&y(B,k)}else y(T.strValue,k)}}for(var V=[bl,Cs],$=0;$<i.length;$++){var q=i[$],H=e.styleKeys[q];V[0]=uu(H[0],V[0]),V[1]=cu(H[1],V[1])}e.styleKey=bN(V[0],V[1]);var Y=e.styleKeys;e.labelDimsKey=Ti(Y.labelDimensions);var Q=l(t,["label"],Y.labelDimensions);if(e.labelKey=Ti(Q),e.labelStyleKey=Ti(Wc(Y.commonLabel,Q)),!u){var P=l(t,["source-label"],Y.labelDimensions);e.sourceLabelKey=Ti(P),e.sourceLabelStyleKey=Ti(Wc(Y.commonLabel,P));var I=l(t,["target-label"],Y.labelDimensions);e.targetLabelKey=Ti(I),e.targetLabelStyleKey=Ti(Wc(Y.commonLabel,I))}if(u){var K=e.styleKeys,F=K.nodeBody,J=K.nodeBorder,re=K.nodeOutline,se=K.backgroundImage,me=K.compound,Ne=K.pie,pe=K.stripe,ee=[F,J,re,se,me,Ne,pe].filter(function(le){return le!=null}).reduce(Wc,[bl,Cs]);e.nodeKey=Ti(ee),e.hasPie=Ne!=null&&Ne[0]!==bl&&Ne[1]!==Cs,e.hasStripe=pe!=null&&pe[0]!==bl&&pe[1]!==Cs}return s!==e.styleKey};Xn.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};Xn.applyParsedProperty=function(t,e){var n=this,r=e,i=t._private.style,l,s=n.types,u=n.properties[r.name].type,f=r.bypass,c=i[r.name],h=c&&c.bypass,v=t._private,p="mapping",m=function(F){return F==null?null:F.pfValue!=null?F.pfValue:F.value},y=function(){var F=m(c),J=m(r);n.checkTriggers(t,r.name,F,J)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(r=e=this.parse(e.name,"bezier",f)),r.delete)return i[r.name]=void 0,y(),!0;if(r.deleteBypassed)return c?c.bypass?(c.bypassed=void 0,y(),!0):!1:(y(),!0);if(r.deleteBypass)return c?c.bypass?(i[r.name]=c.bypassed,y(),!0):!1:(y(),!0);var w=function(){Kt("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case s.mapData:{for(var S=r.field.split("."),x=v.data,C=0;C<S.length&&x;C++){var T=S[C];x=x[T]}if(x==null)return w(),!1;var A;if(je(x)){var N=r.fieldMax-r.fieldMin;N===0?A=0:A=(x-r.fieldMin)/N}else return Kt("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+x+"` for `"+t.id()+"` is non-numeric)"),!1;if(A<0?A=0:A>1&&(A=1),u.color){var k=r.valueMin[0],D=r.valueMax[0],O=r.valueMin[1],L=r.valueMax[1],M=r.valueMin[2],z=r.valueMax[2],B=r.valueMin[3]==null?1:r.valueMin[3],U=r.valueMax[3]==null?1:r.valueMax[3],V=[Math.round(k+(D-k)*A),Math.round(O+(L-O)*A),Math.round(M+(z-M)*A),Math.round(B+(U-B)*A)];l={bypass:r.bypass,name:r.name,value:V,strValue:"rgb("+V[0]+", "+V[1]+", "+V[2]+")"}}else if(u.number){var $=r.valueMin+(r.valueMax-r.valueMin)*A;l=this.parse(r.name,$,r.bypass,p)}else return!1;if(!l)return w(),!1;l.mapping=r,r=l;break}case s.data:{for(var q=r.field.split("."),H=v.data,Y=0;Y<q.length&&H;Y++){var Q=q[Y];H=H[Q]}if(H!=null&&(l=this.parse(r.name,H,r.bypass,p)),!l)return w(),!1;l.mapping=r,r=l;break}case s.fn:{var P=r.value,I=r.fnValue!=null?r.fnValue:P(t);if(r.prevFnValue=I,I==null)return Kt("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+t.id()+"` is null)"),!1;if(l=this.parse(r.name,I,r.bypass,p),!l)return Kt("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+t.id()+"` is invalid)"),!1;l.mapping=Sa(r),r=l;break}case void 0:break;default:return!1}return f?(h?r.bypassed=c.bypassed:r.bypassed=c,i[r.name]=r):h?c.bypassed=r:i[r.name]=r,y(),!0};Xn.cleanElements=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!e)r._private.style={};else for(var i=r._private.style,l=Object.keys(i),s=0;s<l.length;s++){var u=l[s],f=i[u];f!=null&&(f.bypass?f.bypassed=null:i[u]=null)}}};Xn.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};Xn.updateTransitions=function(t,e){var n=this,r=t._private,i=t.pstyle("transition-property").value,l=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(i.length>0&&l>0){for(var u={},f=!1,c=0;c<i.length;c++){var h=i[c],v=t.pstyle(h),p=e[h];if(p){var m=p.prev,y=m,w=p.next!=null?p.next:v,S=!1,x=void 0,C=1e-6;y&&(je(y.pfValue)&&je(w.pfValue)?(S=w.pfValue-y.pfValue,x=y.pfValue+C*S):je(y.value)&&je(w.value)?(S=w.value-y.value,x=y.value+C*S):ln(y.value)&&ln(w.value)&&(S=y.value[0]!==w.value[0]||y.value[1]!==w.value[1]||y.value[2]!==w.value[2],x=y.strValue),S&&(u[h]=w.strValue,this.applyBypass(t,h,x),f=!0))}}if(!f)return;r.transitioning=!0,new qs(function(T){s>0?t.delayAnimation(s).play().promise().then(T):T()}).then(function(){return t.animation({style:u,duration:l,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(t,i),t.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),r.transitioning=!1)};Xn.checkTrigger=function(t,e,n,r,i,l){var s=this.properties[e],u=i(s);t.removed()||u!=null&&u(n,r,t)&&l(s)};Xn.checkZOrderTrigger=function(t,e,n,r){var i=this;this.checkTrigger(t,e,n,r,function(l){return l.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};Xn.checkBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Xn.checkConnectedEdgesBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(l){l.dirtyBoundingBoxCache()})})};Xn.checkParallelEdgesBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(l){l.dirtyBoundingBoxCache()})})};Xn.checkTriggers=function(t,e,n,r){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,n,r),this.checkBoundsTrigger(t,e,n,r),this.checkConnectedEdgesBoundsTrigger(t,e,n,r),this.checkParallelEdgesBoundsTrigger(t,e,n,r)};var Nu={};Nu.applyBypass=function(t,e,n,r){var i=this,l=[],s=!0;if(e==="*"||e==="**"){if(n!==void 0)for(var u=0;u<i.properties.length;u++){var f=i.properties[u],c=f.name,h=this.parse(c,n,!0);h&&l.push(h)}}else if(st(e)){var v=this.parse(e,n,!0);v&&l.push(v)}else if(zt(e)){var p=e;r=n;for(var m=Object.keys(p),y=0;y<m.length;y++){var w=m[y],S=p[w];if(S===void 0&&(S=p[Jf(w)]),S!==void 0){var x=this.parse(w,S,!0);x&&l.push(x)}}}else return!1;if(l.length===0)return!1;for(var C=!1,T=0;T<t.length;T++){for(var A=t[T],N={},k=void 0,D=0;D<l.length;D++){var O=l[D];if(r){var L=A.pstyle(O.name);k=N[O.name]={prev:L}}C=this.applyParsedProperty(A,Sa(O))||C,r&&(k.next=A.pstyle(O.name))}C&&this.updateStyleHints(A),r&&this.updateTransitions(A,N,s)}return C};Nu.overrideBypass=function(t,e,n){e=sm(e);for(var r=0;r<t.length;r++){var i=t[r],l=i._private.style[e],s=this.properties[e].type,u=s.color,f=s.mutiple,c=l?l.pfValue!=null?l.pfValue:l.value:null;!l||!l.bypass?this.applyBypass(i,e,n):(l.value=n,l.pfValue!=null&&(l.pfValue=n),u?l.strValue="rgb("+n.join(",")+")":f?l.strValue=n.join(" "):l.strValue=""+n,this.updateStyleHints(i)),this.checkTriggers(i,e,c,n)}};Nu.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};Nu.removeBypasses=function(t,e,n){for(var r=!0,i=0;i<t.length;i++){for(var l=t[i],s={},u=0;u<e.length;u++){var f=e[u],c=this.properties[f],h=l.pstyle(c.name);if(!(!h||!h.bypass)){var v="",p=this.parse(f,v,!0),m=s[c.name]={prev:h};this.applyParsedProperty(l,p),m.next=l.pstyle(c.name)}}this.updateStyleHints(l),n&&this.updateTransitions(l,s,r)}};var wm={};wm.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};wm.containerCss=function(t){var e=this._private.cy,n=e.container(),r=e.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(t)};var Ca={};Ca.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};Ca.getRawStyle=function(t,e){var n=this;if(t=t[0],t){for(var r={},i=0;i<n.properties.length;i++){var l=n.properties[i],s=n.getStylePropertyValue(t,l.name,e);s!=null&&(r[l.name]=s,r[Jf(l.name)]=s)}return r}};Ca.getIndexedStyle=function(t,e,n,r){var i=t.pstyle(e)[n][r];return i??t.cy().style().getDefaultProperty(e)[n][0]};Ca.getStylePropertyValue=function(t,e,n){var r=this;if(t=t[0],t){var i=r.properties[e];i.alias&&(i=i.pointsTo);var l=i.type,s=t.pstyle(i.name);if(s){var u=s.value,f=s.units,c=s.strValue;if(n&&l.number&&u!=null&&je(u)){var h=t.cy().zoom(),v=function(S){return S*h},p=function(S,x){return v(S)+x},m=ln(u),y=m?f.every(function(w){return w!=null}):f!=null;return y?m?u.map(function(w,S){return p(w,f[S])}).join(" "):p(u,f):m?u.map(function(w){return st(w)?w:""+v(w)}).join(" "):""+v(u)}else if(c!=null)return c}return null}};Ca.getAnimationStartStyle=function(t,e){for(var n={},r=0;r<e.length;r++){var i=e[r],l=i.name,s=t.pstyle(l);s!==void 0&&(zt(s)?s=this.parse(l,s.strValue):s=this.parse(l,s)),s&&(n[l]=s)}return n};Ca.getPropsList=function(t){var e=this,n=[],r=t,i=e.properties;if(r)for(var l=Object.keys(r),s=0;s<l.length;s++){var u=l[s],f=r[u],c=i[u]||i[sm(u)],h=this.parse(c.name,f);h&&n.push(h)}return n};Ca.getNonDefaultPropertiesHash=function(t,e,n){var r=n.slice(),i,l,s,u,f,c;for(f=0;f<e.length;f++)if(i=e[f],l=t.pstyle(i,!1),l!=null)if(l.pfValue!=null)r[0]=uu(u,r[0]),r[1]=cu(u,r[1]);else for(s=l.strValue,c=0;c<s.length;c++)u=s.charCodeAt(c),r[0]=uu(u,r[0]),r[1]=cu(u,r[1]);return r};Ca.getPropertiesHash=Ca.getNonDefaultPropertiesHash;var dd={};dd.appendFromJson=function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n],i=r.selector,l=r.style||r.css,s=Object.keys(l);e.selector(i);for(var u=0;u<s.length;u++){var f=s[u],c=l[f];e.css(f,c)}}return e};dd.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};dd.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var n=this[e],r=n.selector,i=n.properties,l={},s=0;s<i.length;s++){var u=i[s];l[u.name]=u.strValue}t.push({selector:r?r.toString():"core",style:l})}return t};var Sm={};Sm.appendFromString=function(t){var e=this,n=this,r=""+t,i,l,s;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function u(){r.length>i.length?r=r.substr(i.length):r=""}function f(){l.length>s.length?l=l.substr(s.length):l=""}for(;;){var c=r.match(/^\s*$/);if(c)break;var h=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Kt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}i=h[0];var v=h[1];if(v!=="core"){var p=new Pi(v);if(p.invalid){Kt("Skipping parsing of block: Invalid selector found in string stylesheet: "+v),u();continue}}var m=h[2],y=!1;l=m;for(var w=[];;){var S=l.match(/^\s*$/);if(S)break;var x=l.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!x){Kt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),y=!0;break}s=x[0];var C=x[1],T=x[2],A=e.properties[C];if(!A){Kt("Skipping property: Invalid property name in: "+s),f();continue}var N=n.parse(C,T);if(!N){Kt("Skipping property: Invalid property definition in: "+s),f();continue}w.push({name:C,val:T}),f()}if(y){u();break}n.selector(v);for(var k=0;k<w.length;k++){var D=w[k];n.css(D.name,D.val)}u()}return n};Sm.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var In={};(function(){var t=qn,e=Qk,n=Jk,r=eN,i=tN,l=function(le){return"^"+le+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(le){var de=t+"|\\w+|"+e+"|"+n+"|"+r+"|"+i;return"^"+le+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+de+")\\s*\\,\\s*("+de+")\\)$"},u=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];In.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:l("data")},layoutData:{mapping:!0,regex:l("layoutData")},scratch:{mapping:!0,regex:l("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:u,singleRegexMatchValue:!0},urls:{regexes:u,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(le,de){switch(le.length){case 2:return de[0]!=="deg"&&de[0]!=="rad"&&de[1]!=="deg"&&de[1]!=="rad";case 1:return st(le[0])||de[0]==="deg"||de[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(le){var de=le.length;return de===1||de===2||de===4}}};var f={zeroNonZero:function(le,de){return(le==null||de==null)&&le!==de||le==0&&de!=0?!0:le!=0&&de==0},any:function(le,de){return le!=de},emptyNonEmpty:function(le,de){var xe=Fi(le),Re=Fi(de);return xe&&!Re||!xe&&Re}},c=In.types,h=[{name:"label",type:c.text,triggersBounds:f.any,triggersZOrder:f.emptyNonEmpty},{name:"text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any}],v=[{name:"source-label",type:c.text,triggersBounds:f.any},{name:"source-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"source-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"source-text-offset",type:c.size,triggersBounds:f.any}],p=[{name:"target-label",type:c.text,triggersBounds:f.any},{name:"target-text-rotation",type:c.textRotation,triggersBounds:f.any},{name:"target-text-margin-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-margin-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"target-text-offset",type:c.size,triggersBounds:f.any}],m=[{name:"font-family",type:c.fontFamily,triggersBounds:f.any},{name:"font-style",type:c.fontStyle,triggersBounds:f.any},{name:"font-weight",type:c.fontWeight,triggersBounds:f.any},{name:"font-size",type:c.size,triggersBounds:f.any},{name:"text-transform",type:c.textTransform,triggersBounds:f.any},{name:"text-wrap",type:c.textWrap,triggersBounds:f.any},{name:"text-overflow-wrap",type:c.textOverflowWrap,triggersBounds:f.any},{name:"text-max-width",type:c.size,triggersBounds:f.any},{name:"text-outline-width",type:c.size,triggersBounds:f.any},{name:"line-height",type:c.positiveNumber,triggersBounds:f.any}],y=[{name:"text-valign",type:c.valign,triggersBounds:f.any},{name:"text-halign",type:c.halign,triggersBounds:f.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:f.any},{name:"text-border-opacity",type:c.zeroOneNumber},{name:"text-border-color",type:c.color},{name:"text-border-width",type:c.size,triggersBounds:f.any},{name:"text-border-style",type:c.borderStyle,triggersBounds:f.any},{name:"text-background-shape",type:c.textBackgroundShape,triggersBounds:f.any},{name:"text-justification",type:c.justification},{name:"box-select-labels",type:c.bool,triggersBounds:f.any}],w=[{name:"events",type:c.bool,triggersZOrder:f.any},{name:"text-events",type:c.bool,triggersZOrder:f.any},{name:"box-selection",type:c.boxSelection,triggersZOrder:f.any}],S=[{name:"display",type:c.display,triggersZOrder:f.any,triggersBounds:f.any,triggersBoundsOfConnectedEdges:f.any,triggersBoundsOfParallelEdges:function(le,de,xe){return le===de?!1:xe.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:c.visibility,triggersZOrder:f.any},{name:"opacity",type:c.zeroOneNumber,triggersZOrder:f.zeroNonZero},{name:"text-opacity",type:c.zeroOneNumber},{name:"min-zoomed-font-size",type:c.size},{name:"z-compound-depth",type:c.zCompoundDepth,triggersZOrder:f.any},{name:"z-index-compare",type:c.zIndexCompare,triggersZOrder:f.any},{name:"z-index",type:c.number,triggersZOrder:f.any}],x=[{name:"overlay-padding",type:c.size,triggersBounds:f.any},{name:"overlay-color",type:c.color},{name:"overlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"overlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"overlay-corner-radius",type:c.cornerRadius}],C=[{name:"underlay-padding",type:c.size,triggersBounds:f.any},{name:"underlay-color",type:c.color},{name:"underlay-opacity",type:c.zeroOneNumber,triggersBounds:f.zeroNonZero},{name:"underlay-shape",type:c.overlayShape,triggersBounds:f.any},{name:"underlay-corner-radius",type:c.cornerRadius}],T=[{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}],A=function(le,de){return de.value==="label"?-le.poolIndex():de.pfValue},N=[{name:"height",type:c.nodeSize,triggersBounds:f.any,hashOverride:A},{name:"width",type:c.nodeSize,triggersBounds:f.any,hashOverride:A},{name:"shape",type:c.nodeShape,triggersBounds:f.any},{name:"shape-polygon-points",type:c.polygonPointList,triggersBounds:f.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:f.any},{name:"padding-relative-to",type:c.paddingRelativeTo,triggersBounds:f.any},{name:"bounds-expansion",type:c.boundsExpansion,triggersBounds:f.any}],k=[{name:"border-color",type:c.color},{name:"border-opacity",type:c.zeroOneNumber},{name:"border-width",type:c.size,triggersBounds:f.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}],D=[{name:"outline-color",type:c.color},{name:"outline-opacity",type:c.zeroOneNumber},{name:"outline-width",type:c.size,triggersBounds:f.any},{name:"outline-style",type:c.borderStyle},{name:"outline-offset",type:c.size,triggersBounds:f.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}],L=[{name:"position",type:c.position,triggersBounds:f.any},{name:"compound-sizing-wrt-labels",type:c.compoundIncludeLabels,triggersBounds:f.any},{name:"min-width",type:c.size,triggersBounds:f.any},{name:"min-width-bias-left",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-width-bias-right",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height",type:c.size,triggersBounds:f.any},{name:"min-height-bias-top",type:c.sizeMaybePercent,triggersBounds:f.any},{name:"min-height-bias-bottom",type:c.sizeMaybePercent,triggersBounds:f.any}],M=[{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:f.any,triggersBoundsOfParallelEdges:function(le,de){return le===de?!1:le==="bezier"||de==="bezier"}},{name:"haystack-radius",type:c.zeroOneNumber,triggersBounds:f.any},{name:"source-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"target-endpoint",type:c.edgeEndpoint,triggersBounds:f.any},{name:"control-point-step-size",type:c.size,triggersBounds:f.any},{name:"control-point-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"control-point-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-distances",type:c.bidirectionalSizes,triggersBounds:f.any},{name:"segment-weights",type:c.numbers,triggersBounds:f.any},{name:"segment-radii",type:c.numbers,triggersBounds:f.any},{name:"radius-type",type:c.radiusType,triggersBounds:f.any},{name:"taxi-turn",type:c.bidirectionalSizeMaybePercent,triggersBounds:f.any},{name:"taxi-turn-min-distance",type:c.size,triggersBounds:f.any},{name:"taxi-direction",type:c.axisDirection,triggersBounds:f.any},{name:"taxi-radius",type:c.number,triggersBounds:f.any},{name:"edge-distances",type:c.edgeDistances,triggersBounds:f.any},{name:"arrow-scale",type:c.positiveNumber,triggersBounds:f.any},{name:"loop-direction",type:c.angle,triggersBounds:f.any},{name:"loop-sweep",type:c.angle,triggersBounds:f.any},{name:"source-distance-from-node",type:c.size,triggersBounds:f.any},{name:"target-distance-from-node",type:c.size,triggersBounds:f.any}],z=[{name:"ghost",type:c.bool,triggersBounds:f.any},{name:"ghost-offset-x",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-offset-y",type:c.bidirectionalSize,triggersBounds:f.any},{name:"ghost-opacity",type:c.zeroOneNumber}],B=[{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}],U=[];In.pieBackgroundN=16,U.push({name:"pie-size",type:c.sizeMaybePercent}),U.push({name:"pie-hole",type:c.sizeMaybePercent}),U.push({name:"pie-start-angle",type:c.angle});for(var V=1;V<=In.pieBackgroundN;V++)U.push({name:"pie-"+V+"-background-color",type:c.color}),U.push({name:"pie-"+V+"-background-size",type:c.percent}),U.push({name:"pie-"+V+"-background-opacity",type:c.zeroOneNumber});var $=[];In.stripeBackgroundN=16,$.push({name:"stripe-size",type:c.sizeMaybePercent}),$.push({name:"stripe-direction",type:c.axisDirectionPrimary});for(var q=1;q<=In.stripeBackgroundN;q++)$.push({name:"stripe-"+q+"-background-color",type:c.color}),$.push({name:"stripe-"+q+"-background-size",type:c.percent}),$.push({name:"stripe-"+q+"-background-opacity",type:c.zeroOneNumber});var H=[],Y=In.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:c.arrowShape,triggersBounds:f.any},{name:"arrow-color",type:c.color},{name:"arrow-fill",type:c.arrowFill},{name:"arrow-width",type:c.arrowWidth}].forEach(function(ee){Y.forEach(function(le){var de=le+"-"+ee.name,xe=ee.type,Re=ee.triggersBounds;H.push({name:de,type:xe,triggersBounds:Re})})},{});var Q=In.properties=[].concat(w,T,S,x,C,z,y,m,h,v,p,N,k,D,O,U,$,L,M,H,B),P=In.propertyGroups={behavior:w,transition:T,visibility:S,overlay:x,underlay:C,ghost:z,commonLabel:y,labelDimensions:m,mainLabel:h,sourceLabel:v,targetLabel:p,nodeBody:N,nodeBorder:k,nodeOutline:D,backgroundImage:O,pie:U,stripe:$,compound:L,edgeLine:M,edgeArrow:H,core:B},I=In.propertyGroupNames={},K=In.propertyGroupKeys=Object.keys(P);K.forEach(function(ee){I[ee]=P[ee].map(function(le){return le.name}),P[ee].forEach(function(le){return le.groupKey=ee})});var F=In.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"}];In.propertyNames=Q.map(function(ee){return ee.name});for(var J=0;J<Q.length;J++){var re=Q[J];Q[re.name]=re}for(var se=0;se<F.length;se++){var me=F[se],Ne=Q[me.pointsTo],pe={name:me.name,alias:!0,pointsTo:Ne};Q.push(pe),Q[me.name]=pe}})();In.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};In.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=ht({"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(f,c){for(var h=1;h<=In.pieBackgroundN;h++){var v=c.name.replace("{{i}}",h),p=c.value;f[v]=p}return f},{}),{"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(f,c){for(var h=1;h<=In.stripeBackgroundN;h++){var v=c.name.replace("{{i}}",h),p=c.value;f[v]=p}return f},{}),{"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(f,c){return In.arrowPrefixes.forEach(function(h){var v=h+"-"+c.name,p=c.value;f[v]=p}),f},{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var l=i.name,s=e[l],u=this.parse(l,s);n[l]=u}}return t.defaultProperties=n,t.defaultProperties};In.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 hd={};hd.parse=function(t,e,n,r){var i=this;if(wn(e))return i.parseImplWarn(t,e,n,r);var l=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,s=n?"t":"f",u=""+e,f=IS(t,u,s,l),c=i.propCache=i.propCache||[],h;return(h=c[f])||(h=c[f]=i.parseImplWarn(t,e,n,r)),(n||r==="mapping")&&(h=Sa(h),h&&(h.value=Sa(h.value))),h};hd.parseImplWarn=function(t,e,n,r){var i=this.parseImpl(t,e,n,r);return!i&&e!=null&&Kt("The style property `".concat(t,": ").concat(e,"` is invalid")),i&&(i.name==="width"||i.name==="height")&&e==="label"&&Kt("The style value of `label` is deprecated for `"+i.name+"`"),i};hd.parseImpl=function(t,e,n,r){var i=this;t=sm(t);var l=i.properties[t],s=e,u=i.types;if(!l||e===void 0)return null;l.alias&&(l=l.pointsTo,t=l.name);var f=st(e);f&&(e=e.trim());var c=l.type;if(!c)return null;if(n&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(wn(e))return{name:t,value:e,strValue:"fn",mapped:u.fn,bypass:n};var h,v;if(!(!f||r||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(h=new RegExp(u.data.regex).exec(e))){if(n)return!1;var p=u.data;return{name:t,value:h,strValue:""+e,mapped:p,field:h[1],bypass:n}}else if(e.length>=10&&e[0]==="m"&&(v=new RegExp(u.mapData.regex).exec(e))){if(n||c.multiple)return!1;var m=u.mapData;if(!(c.color||c.number))return!1;var y=this.parse(t,v[4]);if(!y||y.mapped)return!1;var w=this.parse(t,v[5]);if(!w||w.mapped)return!1;if(y.pfValue===w.pfValue||y.strValue===w.strValue)return Kt("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+y.strValue+"`"),this.parse(t,y.strValue);if(c.color){var S=y.value,x=w.value,C=S[0]===x[0]&&S[1]===x[1]&&S[2]===x[2]&&(S[3]===x[3]||(S[3]==null||S[3]===1)&&(x[3]==null||x[3]===1));if(C)return!1}return{name:t,value:v,strValue:""+e,mapped:m,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:y.value,valueMax:w.value,bypass:n}}}if(c.multiple&&r!=="multiple"){var T;if(f?T=e.split(/\s+/):ln(e)?T=e:T=[e],c.evenMultiple&&T.length%2!==0)return null;for(var A=[],N=[],k=[],D="",O=!1,L=0;L<T.length;L++){var M=i.parse(t,T[L],n,"multiple");O=O||st(M.value),A.push(M.value),k.push(M.pfValue!=null?M.pfValue:M.value),N.push(M.units),D+=(L>0?" ":"")+M.strValue}return c.validate&&!c.validate(A,N)?null:c.singleEnum&&O?A.length===1&&st(A[0])?{name:t,value:A[0],strValue:A[0],bypass:n}:null:{name:t,value:A,pfValue:k,strValue:D,bypass:n,units:N}}var z=function(){for(var pe=0;pe<c.enums.length;pe++){var ee=c.enums[pe];if(ee===e)return{name:t,value:e,strValue:""+e,bypass:n}}return null};if(c.number){var B,U="px";if(c.units&&(B=c.units),c.implicitUnits&&(U=c.implicitUnits),!c.unitless)if(f){var V="px|em"+(c.allowPercent?"|\\%":"");B&&(V=B);var $=e.match("^("+qn+")("+V+")?$");$&&(e=$[1],B=$[2]||U)}else(!B||c.implicitUnits)&&(B=U);if(e=parseFloat(e),isNaN(e)&&c.enums===void 0)return null;if(isNaN(e)&&c.enums!==void 0)return e=s,z();if(c.integer&&!Gk(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 q={name:t,value:e,strValue:""+e+(B||""),units:B,bypass:n};return c.unitless||B!=="px"&&B!=="em"?q.pfValue=e:q.pfValue=B==="px"||!B?e:this.getEmSizeInPixels()*e,(B==="ms"||B==="s")&&(q.pfValue=B==="ms"?e:1e3*e),(B==="deg"||B==="rad")&&(q.pfValue=B==="rad"?e:e2(e)),B==="%"&&(q.pfValue=e/100),q}else if(c.propList){var H=[],Y=""+e;if(Y!=="none"){for(var Q=Y.split(/\s*,\s*|\s+/),P=0;P<Q.length;P++){var I=Q[P].trim();i.properties[I]?H.push(I):Kt("`"+I+"` 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:n}}else if(c.color){var K=NS(e);return K?{name:t,value:K,pfValue:K,strValue:"rgb("+K[0]+","+K[1]+","+K[2]+")",bypass:n}:null}else if(c.regex||c.regexes){if(c.enums){var F=z();if(F)return F}for(var J=c.regexes?c.regexes:[c.regex],re=0;re<J.length;re++){var se=new RegExp(J[re]),me=se.exec(e);if(me)return{name:t,value:c.singleRegexMatchValue?me[1]:me,strValue:""+e,bypass:n}}return null}else return c.string?{name:t,value:""+e,strValue:""+e,bypass:n}:c.enums?z():null};var Yn=function(e){if(!(this instanceof Yn))return new Yn(e);if(!lm(e)){mn("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},fr=Yn.prototype;fr.instanceString=function(){return"style"};fr.clear=function(){for(var t=this._private,e=t.cy,n=e.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(n,!0),n.forEach(function(i){var l=i[0]._private;l.styleDirty=!0,l.appliedInitStyle=!1}),this};fr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};fr.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};fr.selector=function(t){var e=t==="core"?null:new Pi(t),n=this.length++;return this[n]={selector:e,properties:[],mappedProperties:[],index:n},this};fr.css=function(){var t=this,e=arguments;if(e.length===1)for(var n=e[0],r=0;r<t.properties.length;r++){var i=t.properties[r],l=n[i.name];l===void 0&&(l=n[Jf(i.name)]),l!==void 0&&this.cssRule(i.name,l)}else e.length===2&&this.cssRule(e[0],e[1]);return this};fr.style=fr.css;fr.cssRule=function(t,e){var n=this.parse(t,e);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.name.match(/stripe-(\d+)-background-size/)&&n.value&&(this._private.hasStripe=!0),n.mapped&&this[r].mappedProperties.push(n);var i=!this[r].selector;i&&(this._private.coreStyle[n.name]=n)}return this};fr.append=function(t){return AS(t)?t.appendToStyle(this):ln(t)?this.appendFromJson(t):st(t)&&this.appendFromString(t),this};Yn.fromJson=function(t,e){var n=new Yn(t);return n.fromJson(e),n};Yn.fromString=function(t,e){return new Yn(t).fromString(e)};[Xn,Nu,wm,Ca,dd,Sm,In,hd].forEach(function(t){ht(fr,t)});Yn.types=fr.types;Yn.properties=fr.properties;Yn.propertyGroups=fr.propertyGroups;Yn.propertyGroupNames=fr.propertyGroupNames;Yn.propertyGroupKeys=fr.propertyGroupKeys;var aO={style:function(e){if(e){var n=this.setStyle(e);n.update()}return this._private.style},setStyle:function(e){var n=this._private;return AS(e)?n.style=e.generateStyle(this):ln(e)?n.style=Yn.fromJson(this,e):st(e)?n.style=Yn.fromString(this,e):n.style=Yn(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},iO="single",Tl={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 n=this._private;if(n.selectionType==null&&(n.selectionType=iO),e!==void 0)(e==="additive"||e==="single")&&(n.selectionType=e);else return n.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,n=this._private.pan,r,i,l,s,u;switch(e.length){case 0:return n;case 1:if(st(e[0]))return r=e[0],n[r];if(zt(e[0])){if(!this._private.panningEnabled)return this;l=e[0],s=l.x,u=l.y,je(s)&&(n.x=s),je(u)&&(n.y=u),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;r=e[0],i=e[1],(r==="x"||r==="y")&&je(i)&&(n[r]=i),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,n){var r=arguments,i=this._private.pan,l,s,u,f,c;if(!this._private.panningEnabled)return this;switch(r.length){case 1:zt(e)&&(u=r[0],f=u.x,c=u.y,je(f)&&(i.x+=f),je(c)&&(i.y+=c),this.emit("pan viewport"));break;case 2:l=e,s=n,(l==="x"||l==="y")&&je(s)&&(i[l]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,n){var r=this.getFitViewport(e,n);if(r){var i=this._private;i.zoom=r.zoom,i.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,n){if(je(e)&&n===void 0&&(n=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(st(e)){var i=e;e=this.$(i)}else if(Kk(e)){var l=e;r={x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else Hr(e)||(e=this.mutableElements());if(!(Hr(e)&&e.empty())){r=r||e.boundingBox();var s=this.width(),u=this.height(),f;if(n=je(n)?n:0,!isNaN(s)&&!isNaN(u)&&s>0&&u>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){f=Math.min((s-2*n)/r.w,(u-2*n)/r.h),f=f>this._private.maxZoom?this._private.maxZoom:f,f=f<this._private.minZoom?this._private.minZoom:f;var c={x:(s-f*(r.x1+r.x2))/2,y:(u-f*(r.y1+r.y2))/2};return{zoom:f,pan:c}}}}},zoomRange:function(e,n){var r=this._private;if(n==null){var i=e;e=i.min,n=i.max}return je(e)&&je(n)&&e<=n?(r.minZoom=e,r.maxZoom=n):je(e)&&n===void 0&&e<=r.maxZoom?r.minZoom=e:je(n)&&e===void 0&&n>=r.minZoom&&(r.maxZoom=n),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 n=this._private,r=n.pan,i=n.zoom,l,s,u=!1;if(n.zoomingEnabled||(u=!0),je(e)?s=e:zt(e)&&(s=e.level,e.position!=null?l=nd(e.position,i,r):e.renderedPosition!=null&&(l=e.renderedPosition),l!=null&&!n.panningEnabled&&(u=!0)),s=s>n.maxZoom?n.maxZoom:s,s=s<n.minZoom?n.minZoom:s,u||!je(s)||s===i||l!=null&&(!je(l.x)||!je(l.y)))return null;if(l!=null){var f=r,c=i,h=s,v={x:-h/c*(l.x-f.x)+l.x,y:-h/c*(l.y-f.y)+l.y};return{zoomed:!0,panned:!0,zoom:h,pan:v}}else return{zoomed:!0,panned:!1,zoom:s,pan:r}},zoom:function(e){if(e===void 0)return this._private.zoom;var n=this.getZoomedViewport(e),r=this._private;return n==null||!n.zoomed?this:(r.zoom=n.zoom,n.panned&&(r.pan.x=n.pan.x,r.pan.y=n.pan.y),this.emit("zoom"+(n.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var n=this._private,r=!0,i=!0,l=[],s=!1,u=!1;if(!e)return this;if(je(e.zoom)||(r=!1),zt(e.pan)||(i=!1),!r&&!i)return this;if(r){var f=e.zoom;f<n.minZoom||f>n.maxZoom||!n.zoomingEnabled?s=!0:(n.zoom=f,l.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&n.panningEnabled){var c=e.pan;je(c.x)&&(n.pan.x=c.x,u=!1),je(c.y)&&(n.pan.y=c.y,u=!1),u||l.push("pan")}return l.length>0&&(l.push("viewport"),this.emit(l.join(" ")),this.notify("viewport")),this},center:function(e){var n=this.getCenterPan(e);return n&&(this._private.pan=n,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,n){if(this._private.panningEnabled){if(st(e)){var r=e;e=this.mutableElements().filter(r)}else Hr(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),l=this.width(),s=this.height();n=n===void 0?this._private.zoom:n;var u={x:(l-n*(i.x1+i.x2))/2,y:(s-n*(i.y1+i.y2))/2};return u}}},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,n=e.container,r=this;return e.sizeCache=e.sizeCache||(n?(function(){var i=r.window().getComputedStyle(n),l=function(u){return parseFloat(i.getPropertyValue(u))};return{width:n.clientWidth-l("padding-left")-l("padding-right"),height:n.clientHeight-l("padding-top")-l("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,n=this._private.zoom,r=this.renderedExtent(),i={x1:(r.x1-e.x)/n,x2:(r.x2-e.x)/n,y1:(r.y1-e.y)/n,y2:(r.y2-e.y)/n};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),n=this.height();return{x1:0,y1:0,x2:e,y2:n,w:e,h:n}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Tl.centre=Tl.center;Tl.autolockNodes=Tl.autolock;Tl.autoungrabifyNodes=Tl.autoungrabify;var pu={data:$t.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:$t.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:$t.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:$t.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};pu.attr=pu.data;pu.removeAttr=pu.removeData;var mu=function(e){var n=this;e=ht({},e);var r=e.container;r&&!Bf(r)&&Bf(r[0])&&(r=r[0]);var i=r?r._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var l=i.readies=i.readies||[];r&&(r._cyreg=i),i.cy=n;var s=Un!==void 0&&r!==void 0&&!e.headless,u=e;u.layout=ht({name:s?"grid":"null"},u.layout),u.renderer=ht({name:s?"canvas":"null"},u.renderer);var f=function(y,w,S){return w!==void 0?w:S!==void 0?S:y},c=this._private={container:r,ready:!1,options:u,elements:new ar(this),listeners:[],aniEles:new ar(this),data:u.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:f(!0,u.zoomingEnabled),userZoomingEnabled:f(!0,u.userZoomingEnabled),panningEnabled:f(!0,u.panningEnabled),userPanningEnabled:f(!0,u.userPanningEnabled),boxSelectionEnabled:f(!0,u.boxSelectionEnabled),autolock:f(!1,u.autolock,u.autolockNodes),autoungrabify:f(!1,u.autoungrabify,u.autoungrabifyNodes),autounselectify:f(!1,u.autounselectify),styleEnabled:u.styleEnabled===void 0?s:u.styleEnabled,zoom:je(u.zoom)?u.zoom:1,pan:{x:zt(u.pan)&&je(u.pan.x)?u.pan.x:0,y:zt(u.pan)&&je(u.pan.y)?u.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:f(250,u.multiClickDebounceTime)};this.createEmitter(),this.selectionType(u.selectionType),this.zoomRange({min:u.minZoom,max:u.maxZoom});var h=function(y,w){var S=y.some(Yk);if(S)return qs.all(y).then(w);w(y)};c.styleEnabled&&n.setStyle([]);var v=ht({},u,u.renderer);n.initRenderer(v);var p=function(y,w,S){n.notifications(!1);var x=n.mutableElements();x.length>0&&x.remove(),y!=null&&(zt(y)||ln(y))&&n.add(y),n.one("layoutready",function(T){n.notifications(!0),n.emit(T),n.one("load",w),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",S),n.emit("done")});var C=ht({},n._private.options.layout);C.eles=n.elements(),n.layout(C).run()};h([u.style,u.elements],function(m){var y=m[0],w=m[1];c.styleEnabled&&n.style().append(y),p(w,function(){n.startAnimationLoop(),c.ready=!0,wn(u.ready)&&n.on("ready",u.ready);for(var S=0;S<l.length;S++){var x=l[S];n.on("ready",x)}i&&(i.readies=[]),n.emit("ready")},u.done)})},qf=mu.prototype;ht(qf,{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 Un;var n=this._private.container.ownerDocument;return n===void 0||n==null?Un:n.defaultView||Un},mount:function(e){if(e!=null){var n=this,r=n._private,i=r.options;return!Bf(e)&&Bf(e[0])&&(e=e[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=e,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(ht({},i,i.renderer,{name:i.renderer.name==="null"?"canvas":i.renderer.name})),n.startAnimationLoop(),n.style(i.style),n.emit("mount"),n}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Sa(this._private.options)},json:function(e){var n=this,r=n._private,i=n.mutableElements(),l=function(A){return n.getElementById(A.id())};if(zt(e)){if(n.startBatch(),e.elements){var s={},u=function(A,N){for(var k=[],D=[],O=0;O<A.length;O++){var L=A[O];if(!L.data.id){Kt("cy.json() cannot handle elements without an ID attribute");continue}var M=""+L.data.id,z=n.getElementById(M);s[M]=!0,z.length!==0?D.push({ele:z,json:L}):(N&&(L.group=N),k.push(L))}n.add(k);for(var B=0;B<D.length;B++){var U=D[B],V=U.ele,$=U.json;V.json($)}};if(ln(e.elements))u(e.elements);else for(var f=["nodes","edges"],c=0;c<f.length;c++){var h=f[c],v=e.elements[h];ln(v)&&u(v,h)}var p=n.collection();i.filter(function(T){return!s[T.id()]}).forEach(function(T){T.isParent()?p.merge(T):T.remove()}),p.forEach(function(T){return T.children().move({parent:null})}),p.forEach(function(T){return l(T).remove()})}e.style&&n.style(e.style),e.zoom!=null&&e.zoom!==r.zoom&&n.zoom(e.zoom),e.pan&&(e.pan.x!==r.pan.x||e.pan.y!==r.pan.y)&&n.pan(e.pan),e.data&&n.data(e.data);for(var m=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],y=0;y<m.length;y++){var w=m[y];e[w]!=null&&n[w](e[w])}return n.endBatch(),this}else{var S=!!e,x={};S?x.elements=this.elements().map(function(T){return T.json()}):(x.elements={},i.forEach(function(T){var A=T.group();x.elements[A]||(x.elements[A]=[]),x.elements[A].push(T.json())})),this._private.styleEnabled&&(x.style=n.style().json()),x.data=Sa(n.data());var C=r.options;return x.zoomingEnabled=r.zoomingEnabled,x.userZoomingEnabled=r.userZoomingEnabled,x.zoom=r.zoom,x.minZoom=r.minZoom,x.maxZoom=r.maxZoom,x.panningEnabled=r.panningEnabled,x.userPanningEnabled=r.userPanningEnabled,x.pan=Sa(r.pan),x.boxSelectionEnabled=r.boxSelectionEnabled,x.renderer=Sa(C.renderer),x.hideEdgesOnViewport=C.hideEdgesOnViewport,x.textureOnViewport=C.textureOnViewport,x.wheelSensitivity=C.wheelSensitivity,x.motionBlur=C.motionBlur,x.multiClickDebounceTime=C.multiClickDebounceTime,x}}});qf.$id=qf.getElementById;[YM,JM,AC,Lp,Af,tO,Fp,_f,aO,Tl,pu].forEach(function(t){ht(qf,t)});var lO={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}},sO={maximal:!1,acyclic:!1},ps=function(e){return e.scratch("breadthfirst")},U1=function(e,n){return e.scratch("breadthfirst",n)};function _C(t){this.options=ht({},lO,sO,t)}_C.prototype.run=function(){var t=this.options,e=t.cy,n=t.eles,r=n.nodes().filter(function(et){return et.isChildless()}),i=n,l=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,u=!!t.boundingBox,f=br(u?t.boundingBox:structuredClone(e.extent())),c;if(Hr(t.roots))c=t.roots;else if(ln(t.roots)){for(var h=[],v=0;v<t.roots.length;v++){var p=t.roots[v],m=e.getElementById(p);h.push(m)}c=e.collection(h)}else if(st(t.roots))c=e.$(t.roots);else if(l)c=r.roots();else{var y=n.components();c=e.collection();for(var w=function(){var ze=y[S],Ge=ze.maxDegree(!1),tt=ze.filter(function(ot){return ot.degree(!1)===Ge});c=c.add(tt)},S=0;S<y.length;S++)w()}var x=[],C={},T=function(ze,Ge){x[Ge]==null&&(x[Ge]=[]);var tt=x[Ge].length;x[Ge].push(ze),U1(ze,{index:tt,depth:Ge})},A=function(ze,Ge){var tt=ps(ze),ot=tt.depth,Pe=tt.index;x[ot][Pe]=null,ze.isChildless()&&T(ze,Ge)};i.bfs({roots:c,directed:t.directed,visit:function(ze,Ge,tt,ot,Pe){var pt=ze[0],ue=pt.id();pt.isChildless()&&T(pt,Pe),C[ue]=!0}});for(var N=[],k=0;k<r.length;k++){var D=r[k];C[D.id()]||N.push(D)}var O=function(ze){for(var Ge=x[ze],tt=0;tt<Ge.length;tt++){var ot=Ge[tt];if(ot==null){Ge.splice(tt,1),tt--;continue}U1(ot,{depth:ze,index:tt})}},L=function(ze,Ge){for(var tt=ps(ze),ot=ze.incomers().filter(function(Le){return Le.isNode()&&n.has(Le)}),Pe=-1,pt=ze.id(),ue=0;ue<ot.length;ue++){var Te=ot[ue],Oe=ps(Te);Pe=Math.max(Pe,Oe.depth)}if(tt.depth<=Pe){if(!t.acyclic&&Ge[pt])return null;var Xe=Pe+1;return A(ze,Xe),Ge[pt]=Xe,!0}return!1};if(l&&s){var M=[],z={},B=function(ze){return M.push(ze)},U=function(){return M.shift()};for(r.forEach(function(et){return M.push(et)});M.length>0;){var V=U(),$=L(V,z);if($)V.outgoers().filter(function(et){return et.isNode()&&n.has(et)}).forEach(B);else if($===null){Kt("Detected double maximal shift for node `"+V.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var q=0;if(t.avoidOverlap)for(var H=0;H<r.length;H++){var Y=r[H],Q=Y.layoutDimensions(t),P=Q.w,I=Q.h;q=Math.max(q,P,I)}var K={},F=function(ze){if(K[ze.id()])return K[ze.id()];for(var Ge=ps(ze).depth,tt=ze.neighborhood(),ot=0,Pe=0,pt=0;pt<tt.length;pt++){var ue=tt[pt];if(!(ue.isEdge()||ue.isParent()||!r.has(ue))){var Te=ps(ue);if(Te!=null){var Oe=Te.index,Xe=Te.depth;if(!(Oe==null||Xe==null)){var Le=x[Xe].length;Xe<Ge&&(ot+=Oe/Le,Pe++)}}}}return Pe=Math.max(1,Pe),ot=ot/Pe,Pe===0&&(ot=0),K[ze.id()]=ot,ot},J=function(ze,Ge){var tt=F(ze),ot=F(Ge),Pe=tt-ot;return Pe===0?kS(ze.id(),Ge.id()):Pe};t.depthSort!==void 0&&(J=t.depthSort);for(var re=x.length,se=0;se<re;se++)x[se].sort(J),O(se);for(var me=[],Ne=0;Ne<N.length;Ne++)me.push(N[Ne]);var pe=function(){for(var ze=0;ze<re;ze++)O(ze)};me.length&&(x.unshift(me),re=x.length,pe());for(var ee=0,le=0;le<re;le++)ee=Math.max(x[le].length,ee);var de={x:f.x1+f.w/2,y:f.y1+f.h/2},xe=r.reduce(function(et,ze){return(function(Ge){return{w:et.w===-1?Ge.w:(et.w+Ge.w)/2,h:et.h===-1?Ge.h:(et.h+Ge.h)/2}})(ze.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),Re=Math.max(re===1?0:u?(f.h-t.padding*2-xe.h)/(re-1):(f.h-t.padding*2-xe.h)/(re+1),q),$e=x.reduce(function(et,ze){return Math.max(et,ze.length)},0),Ye=function(ze){var Ge=ps(ze),tt=Ge.depth,ot=Ge.index;if(t.circle){var Pe=Math.min(f.w/2/re,f.h/2/re);Pe=Math.max(Pe,q);var pt=Pe*tt+Pe-(re>0&&x[0].length<=3?Pe/2:0),ue=2*Math.PI/x[tt].length*ot;return tt===0&&x[0].length===1&&(pt=1),{x:de.x+pt*Math.cos(ue),y:de.y+pt*Math.sin(ue)}}else{var Te=x[tt].length,Oe=Math.max(Te===1?0:u?(f.w-t.padding*2-xe.w)/((t.grid?$e:Te)-1):(f.w-t.padding*2-xe.w)/((t.grid?$e:Te)+1),q),Xe={x:de.x+(ot+1-(Te+1)/2)*Oe,y:de.y+(tt+1-(re+1)/2)*Re};return Xe}},lt={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(lt).indexOf(t.direction)===-1&&mn("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(lt).join(", ")));var We=function(ze){return SN(Ye(ze),f,lt[t.direction])};return n.nodes().layoutPositions(this,t,We),this};var oO={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function kC(t){this.options=ht({},oO,t)}kC.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,l=r.nodes().not(":parent");e.sort&&(l=l.sort(e.sort));for(var s=br(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u={x:s.x1+s.w/2,y:s.y1+s.h/2},f=e.sweep===void 0?2*Math.PI-2*Math.PI/l.length:e.sweep,c=f/Math.max(1,l.length-1),h,v=0,p=0;p<l.length;p++){var m=l[p],y=m.layoutDimensions(e),w=y.w,S=y.h;v=Math.max(v,w,S)}if(je(e.radius)?h=e.radius:l.length<=1?h=0:h=Math.min(s.h,s.w)/2-v,l.length>1&&e.avoidOverlap){v*=1.75;var x=Math.cos(c)-Math.cos(0),C=Math.sin(c)-Math.sin(0),T=Math.sqrt(v*v/(x*x+C*C));h=Math.max(T,h)}var A=function(k,D){var O=e.startAngle+D*c*(i?1:-1),L=h*Math.cos(O),M=h*Math.sin(O),z={x:u.x+L,y:u.y+M};return z};return r.nodes().layoutPositions(this,e,A),this};var uO={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function NC(t){this.options=ht({},uO,t)}NC.prototype.run=function(){for(var t=this.options,e=t,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,r=t.cy,i=e.eles,l=i.nodes().not(":parent"),s=br(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u={x:s.x1+s.w/2,y:s.y1+s.h/2},f=[],c=0,h=0;h<l.length;h++){var v=l[h],p=void 0;p=e.concentric(v),f.push({value:p,node:v}),v._private.scratch.concentric=p}l.updateStyle();for(var m=0;m<l.length;m++){var y=l[m],w=y.layoutDimensions(e);c=Math.max(c,w.w,w.h)}f.sort(function(Re,$e){return $e.value-Re.value});for(var S=e.levelWidth(l),x=[[]],C=x[0],T=0;T<f.length;T++){var A=f[T];if(C.length>0){var N=Math.abs(C[0].value-A.value);N>=S&&(C=[],x.push(C))}C.push(A)}var k=c+e.minNodeSpacing;if(!e.avoidOverlap){var D=x.length>0&&x[0].length>1,O=Math.min(s.w,s.h)/2-k,L=O/(x.length+D?1:0);k=Math.min(k,L)}for(var M=0,z=0;z<x.length;z++){var B=x[z],U=e.sweep===void 0?2*Math.PI-2*Math.PI/B.length:e.sweep,V=B.dTheta=U/Math.max(1,B.length-1);if(B.length>1&&e.avoidOverlap){var $=Math.cos(V)-Math.cos(0),q=Math.sin(V)-Math.sin(0),H=Math.sqrt(k*k/($*$+q*q));M=Math.max(H,M)}B.r=M,M+=k}if(e.equidistant){for(var Y=0,Q=0,P=0;P<x.length;P++){var I=x[P],K=I.r-Q;Y=Math.max(Y,K)}Q=0;for(var F=0;F<x.length;F++){var J=x[F];F===0&&(Q=J.r),J.r=Q,Q+=Y}}for(var re={},se=0;se<x.length;se++)for(var me=x[se],Ne=me.dTheta,pe=me.r,ee=0;ee<me.length;ee++){var le=me[ee],de=e.startAngle+(n?1:-1)*Ne*ee,xe={x:u.x+pe*Math.cos(de),y:u.y+pe*Math.sin(de)};re[le.node.id()]=xe}return i.nodes().layoutPositions(this,e,function(Re){var $e=Re.id();return re[$e]}),this};var Zg,cO={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,n){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 vd(t){this.options=ht({},cO,t),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(i){var l=i.source().data("id"),s=i.target().data("id"),u=e.some(function(c){return c.data("id")===l}),f=e.some(function(c){return c.data("id")===s});return!u||!f});this.options.eles=this.options.eles.not(r)}vd.prototype.run=function(){var t=this.options,e=t.cy,n=this;n.stopped=!1,(t.animate===!0||t.animate===!1)&&n.emit({type:"layoutstart",layout:n}),t.debug===!0?Zg=!0:Zg=!1;var r=fO(e,n,t);Zg&&hO(r),t.randomize&&vO(r);var i=Ya(),l=function(){gO(r,e,t),t.fit===!0&&e.fit(t.padding)},s=function(p){return!(n.stopped||p>=t.numIter||(pO(r,t),r.temperature=r.temperature*t.coolingFactor,r.temperature<t.minTemp))},u=function(){if(t.animate===!0||t.animate===!1)l(),n.one("layoutstop",t.stop),n.emit({type:"layoutstop",layout:n});else{var p=t.eles.nodes(),m=MC(r,t,p);p.layoutPositions(n,t,m)}},f=0,c=!0;if(t.animate===!0){var h=function(){for(var p=0;c&&p<t.refresh;)c=s(f),f++,p++;if(!c)H1(r,t),u();else{var m=Ya();m-i>=t.animationThreshold&&l(),Lf(h)}};h()}else{for(;c;)c=s(f),f++;H1(r,t),u()}return this};vd.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};vd.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var fO=function(e,n,r){for(var i=r.eles.edges(),l=r.eles.nodes(),s=br(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),u={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:l.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:r.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},f=r.eles.components(),c={},h=0;h<f.length;h++)for(var v=f[h],p=0;p<v.length;p++){var m=v[p];c[m.id()]=h}for(var h=0;h<u.nodeSize;h++){var y=l[h],w=y.layoutDimensions(r),S={};S.isLocked=y.locked(),S.id=y.data("id"),S.parentId=y.data("parent"),S.cmptId=c[y.id()],S.children=[],S.positionX=y.position("x"),S.positionY=y.position("y"),S.offsetX=0,S.offsetY=0,S.height=w.w,S.width=w.h,S.maxX=S.positionX+S.width/2,S.minX=S.positionX-S.width/2,S.maxY=S.positionY+S.height/2,S.minY=S.positionY-S.height/2,S.padLeft=parseFloat(y.style("padding")),S.padRight=parseFloat(y.style("padding")),S.padTop=parseFloat(y.style("padding")),S.padBottom=parseFloat(y.style("padding")),S.nodeRepulsion=wn(r.nodeRepulsion)?r.nodeRepulsion(y):r.nodeRepulsion,u.layoutNodes.push(S),u.idToIndex[S.id]=h}for(var x=[],C=0,T=-1,A=[],h=0;h<u.nodeSize;h++){var y=u.layoutNodes[h],N=y.parentId;N!=null?u.layoutNodes[u.idToIndex[N]].children.push(y.id):(x[++T]=y.id,A.push(y.id))}for(u.graphSet.push(A);C<=T;){var k=x[C++],D=u.idToIndex[k],m=u.layoutNodes[D],O=m.children;if(O.length>0){u.graphSet.push(O);for(var h=0;h<O.length;h++)x[++T]=O[h]}}for(var h=0;h<u.graphSet.length;h++)for(var L=u.graphSet[h],p=0;p<L.length;p++){var M=u.idToIndex[L[p]];u.indexToGraph[M]=h}for(var h=0;h<u.edgeSize;h++){var z=i[h],B={};B.id=z.data("id"),B.sourceId=z.data("source"),B.targetId=z.data("target");var U=wn(r.idealEdgeLength)?r.idealEdgeLength(z):r.idealEdgeLength,V=wn(r.edgeElasticity)?r.edgeElasticity(z):r.edgeElasticity,$=u.idToIndex[B.sourceId],q=u.idToIndex[B.targetId],H=u.indexToGraph[$],Y=u.indexToGraph[q];if(H!=Y){for(var Q=dO(B.sourceId,B.targetId,u),P=u.graphSet[Q],I=0,S=u.layoutNodes[$];P.indexOf(S.id)===-1;)S=u.layoutNodes[u.idToIndex[S.parentId]],I++;for(S=u.layoutNodes[q];P.indexOf(S.id)===-1;)S=u.layoutNodes[u.idToIndex[S.parentId]],I++;U*=I*r.nestingFactor}B.idealLength=U,B.elasticity=V,u.layoutEdges.push(B)}return u},dO=function(e,n,r){var i=RC(e,n,0,r);return 2>i.count?0:i.graph},RC=function(e,n,r,i){var l=i.graphSet[r];if(-1<l.indexOf(e)&&-1<l.indexOf(n))return{count:2,graph:r};for(var s=0,u=0;u<l.length;u++){var f=l[u],c=i.idToIndex[f],h=i.layoutNodes[c].children;if(h.length!==0){var v=i.indexToGraph[i.idToIndex[h[0]]],p=RC(e,n,v,i);if(p.count!==0)if(p.count===1){if(s++,s===2)break}else return p}}return{count:s,graph:r}},hO,vO=function(e,n){for(var r=e.clientWidth,i=e.clientHeight,l=0;l<e.nodeSize;l++){var s=e.layoutNodes[l];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*r,s.positionY=Math.random()*i)}},MC=function(e,n,r){var i=e.boundingBox,l={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return n.boundingBox&&(r.forEach(function(s){var u=e.layoutNodes[e.idToIndex[s.data("id")]];l.x1=Math.min(l.x1,u.positionX),l.x2=Math.max(l.x2,u.positionX),l.y1=Math.min(l.y1,u.positionY),l.y2=Math.max(l.y2,u.positionY)}),l.w=l.x2-l.x1,l.h=l.y2-l.y1),function(s,u){var f=e.layoutNodes[e.idToIndex[s.data("id")]];if(n.boundingBox){var c=l.w===0?.5:(f.positionX-l.x1)/l.w,h=l.h===0?.5:(f.positionY-l.y1)/l.h;return{x:i.x1+c*i.w,y:i.y1+h*i.h}}else return{x:f.positionX,y:f.positionY}}},gO=function(e,n,r){var i=r.layout,l=r.eles.nodes(),s=MC(e,r,l);l.positions(s),e.ready!==!0&&(e.ready=!0,i.one("layoutready",r.ready),i.emit({type:"layoutready",layout:this}))},pO=function(e,n,r){mO(e,n),EO(e),xO(e,n),wO(e),SO(e)},mO=function(e,n){for(var r=0;r<e.graphSet.length;r++)for(var i=e.graphSet[r],l=i.length,s=0;s<l;s++)for(var u=e.layoutNodes[e.idToIndex[i[s]]],f=s+1;f<l;f++){var c=e.layoutNodes[e.idToIndex[i[f]]];yO(u,c,e,n)}},q1=function(e){return-1+2*e*Math.random()},yO=function(e,n,r,i){var l=e.cmptId,s=n.cmptId;if(!(l!==s&&!r.isCompound)){var u=n.positionX-e.positionX,f=n.positionY-e.positionY,c=1;u===0&&f===0&&(u=q1(c),f=q1(c));var h=bO(e,n,u,f);if(h>0)var v=i.nodeOverlap*h,p=Math.sqrt(u*u+f*f),m=v*u/p,y=v*f/p;else var w=Hf(e,u,f),S=Hf(n,-1*u,-1*f),x=S.x-w.x,C=S.y-w.y,T=x*x+C*C,p=Math.sqrt(T),v=(e.nodeRepulsion+n.nodeRepulsion)/T,m=v*x/p,y=v*C/p;e.isLocked||(e.offsetX-=m,e.offsetY-=y),n.isLocked||(n.offsetX+=m,n.offsetY+=y)}},bO=function(e,n,r,i){if(r>0)var l=e.maxX-n.minX;else var l=n.maxX-e.minX;if(i>0)var s=e.maxY-n.minY;else var s=n.maxY-e.minY;return l>=0&&s>=0?Math.sqrt(l*l+s*s):0},Hf=function(e,n,r){var i=e.positionX,l=e.positionY,s=e.height||1,u=e.width||1,f=r/n,c=s/u,h={};return n===0&&0<r||n===0&&0>r?(h.x=i,h.y=l+s/2,h):0<n&&-1*c<=f&&f<=c?(h.x=i+u/2,h.y=l+u*r/2/n,h):0>n&&-1*c<=f&&f<=c?(h.x=i-u/2,h.y=l-u*r/2/n,h):0<r&&(f<=-1*c||f>=c)?(h.x=i+s*n/2/r,h.y=l+s/2,h):(0>r&&(f<=-1*c||f>=c)&&(h.x=i-s*n/2/r,h.y=l-s/2),h)},EO=function(e,n){for(var r=0;r<e.edgeSize;r++){var i=e.layoutEdges[r],l=e.idToIndex[i.sourceId],s=e.layoutNodes[l],u=e.idToIndex[i.targetId],f=e.layoutNodes[u],c=f.positionX-s.positionX,h=f.positionY-s.positionY;if(!(c===0&&h===0)){var v=Hf(s,c,h),p=Hf(f,-1*c,-1*h),m=p.x-v.x,y=p.y-v.y,w=Math.sqrt(m*m+y*y),S=Math.pow(i.idealLength-w,2)/i.elasticity;if(w!==0)var x=S*m/w,C=S*y/w;else var x=0,C=0;s.isLocked||(s.offsetX+=x,s.offsetY+=C),f.isLocked||(f.offsetX-=x,f.offsetY-=C)}}},xO=function(e,n){if(n.gravity!==0)for(var r=1,i=0;i<e.graphSet.length;i++){var l=e.graphSet[i],s=l.length;if(i===0)var u=e.clientHeight/2,f=e.clientWidth/2;else var c=e.layoutNodes[e.idToIndex[l[0]]],h=e.layoutNodes[e.idToIndex[c.parentId]],u=h.positionX,f=h.positionY;for(var v=0;v<s;v++){var p=e.layoutNodes[e.idToIndex[l[v]]];if(!p.isLocked){var m=u-p.positionX,y=f-p.positionY,w=Math.sqrt(m*m+y*y);if(w>r){var S=n.gravity*m/w,x=n.gravity*y/w;p.offsetX+=S,p.offsetY+=x}}}}},wO=function(e,n){var r=[],i=0,l=-1;for(r.push.apply(r,e.graphSet[0]),l+=e.graphSet[0].length;i<=l;){var s=r[i++],u=e.idToIndex[s],f=e.layoutNodes[u],c=f.children;if(0<c.length&&!f.isLocked){for(var h=f.offsetX,v=f.offsetY,p=0;p<c.length;p++){var m=e.layoutNodes[e.idToIndex[c[p]]];m.offsetX+=h,m.offsetY+=v,r[++l]=c[p]}f.offsetX=0,f.offsetY=0}}},SO=function(e,n){for(var r=0;r<e.nodeSize;r++){var i=e.layoutNodes[r];0<i.children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(var r=0;r<e.nodeSize;r++){var i=e.layoutNodes[r];if(!(0<i.children.length||i.isLocked)){var l=CO(i.offsetX,i.offsetY,e.temperature);i.positionX+=l.x,i.positionY+=l.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,OC(i,e)}}for(var r=0;r<e.nodeSize;r++){var i=e.layoutNodes[r];0<i.children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},CO=function(e,n,r){var i=Math.sqrt(e*e+n*n);if(i>r)var l={x:r*e/i,y:r*n/i};else var l={x:e,y:n};return l},OC=function(e,n){var r=e.parentId;if(r!=null){var i=n.layoutNodes[n.idToIndex[r]],l=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,l=!0),(i.minX==null||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,l=!0),(i.maxY==null||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,l=!0),(i.minY==null||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,l=!0),l)return OC(i,n)}},H1=function(e,n){for(var r=e.layoutNodes,i=[],l=0;l<r.length;l++){var s=r[l],u=s.cmptId,f=i[u]=i[u]||[];f.push(s)}for(var c=0,l=0;l<i.length;l++){var h=i[l];if(h){h.x1=1/0,h.x2=-1/0,h.y1=1/0,h.y2=-1/0;for(var v=0;v<h.length;v++){var p=h[v];h.x1=Math.min(h.x1,p.positionX-p.width/2),h.x2=Math.max(h.x2,p.positionX+p.width/2),h.y1=Math.min(h.y1,p.positionY-p.height/2),h.y2=Math.max(h.y2,p.positionY+p.height/2)}h.w=h.x2-h.x1,h.h=h.y2-h.y1,c+=h.w*h.h}}i.sort(function(C,T){return T.w*T.h-C.w*C.h});for(var m=0,y=0,w=0,S=0,x=Math.sqrt(c)*e.clientWidth/e.clientHeight,l=0;l<i.length;l++){var h=i[l];if(h){for(var v=0;v<h.length;v++){var p=h[v];p.isLocked||(p.positionX+=m-h.x1,p.positionY+=y-h.y1)}m+=h.w+n.componentSpacing,w+=h.w+n.componentSpacing,S=Math.max(S,h.h),w>x&&(y+=S+n.componentSpacing,m=0,w=0,S=0)}}},TO={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function BC(t){this.options=ht({},TO,t)}BC.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,i=r.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var l=br(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(l.h===0||l.w===0)r.nodes().layoutPositions(this,e,function(F){return{x:l.x1,y:l.y1}});else{var s=i.size(),u=Math.sqrt(s*l.h/l.w),f=Math.round(u),c=Math.round(l.w/l.h*u),h=function(J){if(J==null)return Math.min(f,c);var re=Math.min(f,c);re==f?f=J:c=J},v=function(J){if(J==null)return Math.max(f,c);var re=Math.max(f,c);re==f?f=J:c=J},p=e.rows,m=e.cols!=null?e.cols:e.columns;if(p!=null&&m!=null)f=p,c=m;else if(p!=null&&m==null)f=p,c=Math.ceil(s/f);else if(p==null&&m!=null)c=m,f=Math.ceil(s/c);else if(c*f>s){var y=h(),w=v();(y-1)*w>=s?h(y-1):(w-1)*y>=s&&v(w-1)}else for(;c*f<s;){var S=h(),x=v();(x+1)*S>=s?v(x+1):h(S+1)}var C=l.w/c,T=l.h/f;if(e.condense&&(C=0,T=0),e.avoidOverlap)for(var A=0;A<i.length;A++){var N=i[A],k=N._private.position;(k.x==null||k.y==null)&&(k.x=0,k.y=0);var D=N.layoutDimensions(e),O=e.avoidOverlapPadding,L=D.w+O,M=D.h+O;C=Math.max(C,L),T=Math.max(T,M)}for(var z={},B=function(J,re){return!!z["c-"+J+"-"+re]},U=function(J,re){z["c-"+J+"-"+re]=!0},V=0,$=0,q=function(){$++,$>=c&&($=0,V++)},H={},Y=0;Y<i.length;Y++){var Q=i[Y],P=e.position(Q);if(P&&(P.row!==void 0||P.col!==void 0)){var I={row:P.row,col:P.col};if(I.col===void 0)for(I.col=0;B(I.row,I.col);)I.col++;else if(I.row===void 0)for(I.row=0;B(I.row,I.col);)I.row++;H[Q.id()]=I,U(I.row,I.col)}}var K=function(J,re){var se,me;if(J.locked()||J.isParent())return!1;var Ne=H[J.id()];if(Ne)se=Ne.col*C+C/2+l.x1,me=Ne.row*T+T/2+l.y1;else{for(;B(V,$);)q();se=$*C+C/2+l.x1,me=V*T+T/2+l.y1,U(V,$),q()}return{x:se,y:me}};i.layoutPositions(this,e,K)}return this};var DO={ready:function(){},stop:function(){}};function Cm(t){this.options=ht({},DO,t)}Cm.prototype.run=function(){var t=this.options,e=t.eles,n=this;return t.cy,n.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",t.ready),n.emit("layoutready"),n.one("layoutstop",t.stop),n.emit("layoutstop"),this};Cm.prototype.stop=function(){return this};var AO={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function LC(t){this.options=ht({},AO,t)}LC.prototype.run=function(){var t=this.options,e=t.eles,n=e.nodes(),r=wn(t.positions);function i(l){if(t.positions==null)return XN(l.position());if(r)return t.positions(l);var s=t.positions[l._private.data.id];return s??null}return n.layoutPositions(this,t,function(l,s){var u=i(l);return l.locked()||u==null?!1:u}),this};var _O={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function FC(t){this.options=ht({},_O,t)}FC.prototype.run=function(){var t=this.options,e=t.cy,n=t.eles,r=br(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i=function(s,u){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,t,i),this};var kO=[{name:"breadthfirst",impl:_C},{name:"circle",impl:kC},{name:"concentric",impl:NC},{name:"cose",impl:vd},{name:"grid",impl:BC},{name:"null",impl:Cm},{name:"preset",impl:LC},{name:"random",impl:FC}];function IC(t){this.options=t,this.notifications=0}var j1=function(){},G1=function(){throw new Error("A headless instance can not render images")};IC.prototype={recalculateRenderedStyle:j1,notify:function(){this.notifications++},init:j1,isHeadless:function(){return!0},png:G1,jpg:G1};var Tm={};Tm.arrowShapeWidth=.3;Tm.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,n=function(c,h,v,p,m,y,w){var S=m.x-v/2-w,x=m.x+v/2+w,C=m.y-v/2-w,T=m.y+v/2+w,A=S<=c&&c<=x&&C<=h&&h<=T;return A},r=function(c,h,v,p,m){var y=c*Math.cos(p)-h*Math.sin(p),w=c*Math.sin(p)+h*Math.cos(p),S=y*v,x=w*v,C=S+m.x,T=x+m.y;return{x:C,y:T}},i=function(c,h,v,p){for(var m=[],y=0;y<c.length;y+=2){var w=c[y],S=c[y+1];m.push(r(w,S,h,v,p))}return m},l=function(c){for(var h=[],v=0;v<c.length;v++){var p=c[v];h.push(p.x,p.y)}return h},s=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},u=function(c,h){st(h)&&(h=t[h]),t[c]=ht({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(p,m,y,w,S,x){var C=l(i(this.points,y+2*x,w,S)),T=Nr(p,m,C);return T},roughCollide:n,draw:function(p,m,y,w){var S=i(this.points,m,y,w);e.arrowShapeImpl("polygon")(p,S)},spacing:function(p){return 0},gap:s},h)};u("none",{collide:Ff,roughCollide:Ff,draw:cm,spacing:ax,gap:ax}),u("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),u("arrow","triangle"),u("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(c,h,v,p,m){var y=i(this.points,h,v,p),w=this.controlPoint,S=r(w[0],w[1],h,v,p);e.arrowShapeImpl(this.name)(c,y,S)},gap:function(c){return s(c)*.8}}),u("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,h,v,p,m,y,w){var S=l(i(this.points,v+2*w,p,m)),x=l(i(this.pointsTee,v+2*w,p,m)),C=Nr(c,h,S)||Nr(c,h,x);return C},draw:function(c,h,v,p,m){var y=i(this.points,h,v,p),w=i(this.pointsTee,h,v,p);e.arrowShapeImpl(this.name)(c,y,w)}}),u("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,h,v,p,m,y,w){var S=m,x=Math.pow(S.x-c,2)+Math.pow(S.y-h,2)<=Math.pow((v+2*w)*this.radius,2),C=l(i(this.points,v+2*w,p,m));return Nr(c,h,C)||x},draw:function(c,h,v,p,m){var y=i(this.pointsTr,h,v,p);e.arrowShapeImpl(this.name)(c,y,p.x,p.y,this.radius*h)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),u("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 v=this.baseCrossLinePts.slice(),p=h/c,m=3,y=5;return v[m]=v[m]-p,v[y]=v[y]-p,v},collide:function(c,h,v,p,m,y,w){var S=l(i(this.points,v+2*w,p,m)),x=l(i(this.crossLinePts(v,y),v+2*w,p,m)),C=Nr(c,h,S)||Nr(c,h,x);return C},draw:function(c,h,v,p,m){var y=i(this.points,h,v,p),w=i(this.crossLinePts(h,m),h,v,p);e.arrowShapeImpl(this.name)(c,y,w)}}),u("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return s(c)*.525}}),u("circle",{radius:.15,collide:function(c,h,v,p,m,y,w){var S=m,x=Math.pow(S.x-c,2)+Math.pow(S.y-h,2)<=Math.pow((v+2*w)*this.radius,2);return x},draw:function(c,h,v,p,m){e.arrowShapeImpl(this.name)(c,p.x,p.y,this.radius*h)},spacing:function(c){return e.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),u("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){return 1}}),u("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),u("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),u("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 kl={};kl.projectIntoViewport=function(t,e){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],l=r[1],s=r[4],u=n.pan(),f=n.zoom(),c=((t-i)/s-u.x)/f,h=((e-l)/s-u.y)/f;return[c,h]};kl.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),n=this.cy.window().getComputedStyle(t),r=function(x){return parseFloat(n.getPropertyValue(x))},i={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},l={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},s=t.clientWidth,u=t.clientHeight,f=i.left+i.right,c=i.top+i.bottom,h=l.left+l.right,v=e.width/(s+h),p=s-f,m=u-c,y=e.left+i.left+l.left,w=e.top+i.top+l.top;return this.containerBB=[y,w,p,m,v]};kl.invalidateContainerClientCoordsCache=function(){this.containerBB=null};kl.findNearestElement=function(t,e,n,r){return this.findNearestElements(t,e,n,r)[0]};kl.findNearestElements=function(t,e,n,r){var i=this,l=this,s=l.getCachedZSortedEles(),u=[],f=l.cy.zoom(),c=l.cy.hasCompoundNodes(),h=(r?24:8)/f,v=(r?8:2)/f,p=(r?8:2)/f,m=1/0,y,w;n&&(s=s.interactive);function S(D,O){if(D.isNode()){if(w)return;w=D,u.push(D)}if(D.isEdge()&&(O==null||O<m))if(y){if(y.pstyle("z-compound-depth").value===D.pstyle("z-compound-depth").value&&y.pstyle("z-compound-depth").value===D.pstyle("z-compound-depth").value){for(var L=0;L<u.length;L++)if(u[L].isEdge()){u[L]=D,y=D,m=O??m;break}}}else u.push(D),y=D,m=O??m}function x(D){var O=D.outerWidth()+2*v,L=D.outerHeight()+2*v,M=O/2,z=L/2,B=D.position(),U=D.pstyle("corner-radius").value==="auto"?"auto":D.pstyle("corner-radius").pfValue,V=D._private.rscratch;if(B.x-M<=t&&t<=B.x+M&&B.y-z<=e&&e<=B.y+z){var $=l.nodeShapes[i.getNodeShape(D)];if($.checkPoint(t,e,0,O,L,B.x,B.y,U,V))return S(D,0),!0}}function C(D){var O=D._private,L=O.rscratch,M=D.pstyle("width").pfValue,z=D.pstyle("arrow-scale").value,B=M/2+h,U=B*B,V=B*2,Y=O.source,Q=O.target,$;if(L.edgeType==="segments"||L.edgeType==="straight"||L.edgeType==="haystack"){for(var q=L.allpts,H=0;H+3<q.length;H+=2)if(u2(t,e,q[H],q[H+1],q[H+2],q[H+3],V)&&U>($=v2(t,e,q[H],q[H+1],q[H+2],q[H+3])))return S(D,$),!0}else if(L.edgeType==="bezier"||L.edgeType==="multibezier"||L.edgeType==="self"||L.edgeType==="compound"){for(var q=L.allpts,H=0;H+5<L.allpts.length;H+=4)if(c2(t,e,q[H],q[H+1],q[H+2],q[H+3],q[H+4],q[H+5],V)&&U>($=h2(t,e,q[H],q[H+1],q[H+2],q[H+3],q[H+4],q[H+5])))return S(D,$),!0}for(var Y=Y||O.source,Q=Q||O.target,P=i.getArrowWidth(M,z),I=[{name:"source",x:L.arrowStartX,y:L.arrowStartY,angle:L.srcArrowAngle},{name:"target",x:L.arrowEndX,y:L.arrowEndY,angle:L.tgtArrowAngle},{name:"mid-source",x:L.midX,y:L.midY,angle:L.midsrcArrowAngle},{name:"mid-target",x:L.midX,y:L.midY,angle:L.midtgtArrowAngle}],H=0;H<I.length;H++){var K=I[H],F=l.arrowShapes[D.pstyle(K.name+"-arrow-shape").value],J=D.pstyle("width").pfValue;if(F.roughCollide(t,e,P,K.angle,{x:K.x,y:K.y},J,h)&&F.collide(t,e,P,K.angle,{x:K.x,y:K.y},J,h))return S(D),!0}c&&u.length>0&&(x(Y),x(Q))}function T(D,O,L){return kr(D,O,L)}function A(D,O){var L=D._private,M=p,z;O?z=O+"-":z="",D.boundingBox();var B=L.labelBounds[O||"main"],U=D.pstyle(z+"label").value,V=D.pstyle("text-events").strValue==="yes";if(!(!V||!U)){var $=T(L.rscratch,"labelX",O),q=T(L.rscratch,"labelY",O),H=T(L.rscratch,"labelAngle",O),Y=D.pstyle(z+"text-margin-x").pfValue,Q=D.pstyle(z+"text-margin-y").pfValue,P=B.x1-M-Y,I=B.x2+M-Y,K=B.y1-M-Q,F=B.y2+M-Q;if(H){var J=Math.cos(H),re=Math.sin(H),se=function(xe,Re){return xe=xe-$,Re=Re-q,{x:xe*J-Re*re+$,y:xe*re+Re*J+q}},me=se(P,K),Ne=se(P,F),pe=se(I,K),ee=se(I,F),le=[me.x+Y,me.y+Q,pe.x+Y,pe.y+Q,ee.x+Y,ee.y+Q,Ne.x+Y,Ne.y+Q];if(Nr(t,e,le))return S(D),!0}else if(Mi(B,t,e))return S(D),!0}}for(var N=s.length-1;N>=0;N--){var k=s[N];k.isNode()?x(k)||A(k):C(k)||A(k)||A(k,"source")||A(k,"target")}return u};kl.getAllInBox=function(t,e,n,r){var i=this.getCachedZSortedEles().interactive,l=this.cy.zoom(),s=2/l,u=[],f=Math.min(t,n),c=Math.max(t,n),h=Math.min(e,r),v=Math.max(e,r);t=f,n=c,e=h,r=v;var p=br({x1:t,y1:e,x2:n,y2:r}),m=[{x:p.x1,y:p.y1},{x:p.x2,y:p.y1},{x:p.x2,y:p.y2},{x:p.x1,y:p.y2}],y=[[m[0],m[1]],[m[1],m[2]],[m[2],m[3]],[m[3],m[0]]];function w(xe,Re,$e){return kr(xe,Re,$e)}function S(xe,Re){var $e=xe._private,Ye=s,lt="";xe.boundingBox();var We=$e.labelBounds.main;if(!We)return null;var et=w($e.rscratch,"labelX",Re),ze=w($e.rscratch,"labelY",Re),Ge=w($e.rscratch,"labelAngle",Re),tt=xe.pstyle(lt+"text-margin-x").pfValue,ot=xe.pstyle(lt+"text-margin-y").pfValue,Pe=We.x1-Ye-tt,pt=We.x2+Ye-tt,ue=We.y1-Ye-ot,Te=We.y2+Ye-ot;if(Ge){var Oe=Math.cos(Ge),Xe=Math.sin(Ge),Le=function(ye,G){return ye=ye-et,G=G-ze,{x:ye*Oe-G*Xe+et,y:ye*Xe+G*Oe+ze}};return[Le(Pe,ue),Le(pt,ue),Le(pt,Te),Le(Pe,Te)]}else return[{x:Pe,y:ue},{x:pt,y:ue},{x:pt,y:Te},{x:Pe,y:Te}]}function x(xe,Re,$e,Ye){function lt(We,et,ze){return(ze.y-We.y)*(et.x-We.x)>(et.y-We.y)*(ze.x-We.x)}return lt(xe,$e,Ye)!==lt(Re,$e,Ye)&<(xe,Re,$e)!==lt(xe,Re,Ye)}for(var C=0;C<i.length;C++){var T=i[C];if(T.isNode()){var A=T,N=A.pstyle("text-events").strValue==="yes",k=A.pstyle("box-selection").strValue,D=A.pstyle("box-select-labels").strValue==="yes";if(k==="none")continue;var O=(k==="overlap"||D)&&N,L=A.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:O});if(k==="contain"){var M=!1;if(D&&N){var z=S(A);z&&Yv(z,m)&&(u.push(A),M=!0)}!M&&GS(p,L)&&u.push(A)}else if(k==="overlap"&&vm(p,L)){var B=A.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),U=[{x:B.x1,y:B.y1},{x:B.x2,y:B.y1},{x:B.x2,y:B.y2},{x:B.x1,y:B.y2}];if(Yv(U,m))u.push(A);else{var V=S(A);V&&Yv(V,m)&&u.push(A)}}}else{var $=T,q=$._private,H=q.rscratch,Y=$.pstyle("box-selection").strValue;if(Y==="none")continue;if(Y==="contain"){if(H.startX!=null&&H.startY!=null&&!Mi(p,H.startX,H.startY)||H.endX!=null&&H.endY!=null&&!Mi(p,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=q.rstyle.bezierPts||q.rstyle.linePts||q.rstyle.haystackPts,P=!0,I=0;I<Q.length;I++)if(!ux(p,Q[I])){P=!1;break}P&&u.push($)}else H.edgeType==="straight"&&u.push($)}else if(Y==="overlap"){var K=!1;if(H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(Mi(p,H.startX,H.startY)||Mi(p,H.endX,H.endY)))u.push($),K=!0;else if(!K&&H.edgeType==="haystack"){for(var F=q.rstyle.haystackPts,J=0;J<F.length;J++)if(ux(p,F[J])){u.push($),K=!0;break}}if(!K){var re=q.rstyle.bezierPts||q.rstyle.linePts||q.rstyle.haystackPts;if((!re||re.length<2)&&H.edgeType==="straight"&&H.startX!=null&&H.startY!=null&&H.endX!=null&&H.endY!=null&&(re=[{x:H.startX,y:H.startY},{x:H.endX,y:H.endY}]),!re||re.length<2)continue;for(var se=0;se<re.length-1;se++){for(var me=re[se],Ne=re[se+1],pe=0;pe<y.length;pe++){var ee=zn(y[pe],2),le=ee[0],de=ee[1];if(x(me,Ne,le,de)){u.push($),K=!0;break}}if(K)break}}}}}return u};var jf={};jf.calculateArrowAngles=function(t){var e=t._private.rscratch,n=e.edgeType==="haystack",r=e.edgeType==="bezier",i=e.edgeType==="multibezier",l=e.edgeType==="segments",s=e.edgeType==="compound",u=e.edgeType==="self",f,c,h,v,p,m,x,C;if(n?(h=e.haystackPts[0],v=e.haystackPts[1],p=e.haystackPts[2],m=e.haystackPts[3]):(h=e.arrowStartX,v=e.arrowStartY,p=e.arrowEndX,m=e.arrowEndY),x=e.midX,C=e.midY,l)f=h-e.segpts[0],c=v-e.segpts[1];else if(i||s||u||r){var y=e.allpts,w=Kn(y[0],y[2],y[4],.1),S=Kn(y[1],y[3],y[5],.1);f=h-w,c=v-S}else f=h-x,c=v-C;e.srcArrowAngle=Jc(f,c);var x=e.midX,C=e.midY;if(n&&(x=(h+p)/2,C=(v+m)/2),f=p-h,c=m-v,l){var y=e.allpts;if(y.length/2%2===0){var T=y.length/2,A=T-2;f=y[T]-y[A],c=y[T+1]-y[A+1]}else if(e.isRound)f=e.midVector[1],c=-e.midVector[0];else{var T=y.length/2-1,A=T-2;f=y[T]-y[A],c=y[T+1]-y[A+1]}}else if(i||s||u){var y=e.allpts,N=e.ctrlpts,k,D,O,L;if(N.length/2%2===0){var M=y.length/2-1,z=M+2,B=z+2;k=Kn(y[M],y[z],y[B],0),D=Kn(y[M+1],y[z+1],y[B+1],0),O=Kn(y[M],y[z],y[B],1e-4),L=Kn(y[M+1],y[z+1],y[B+1],1e-4)}else{var z=y.length/2-1,M=z-2,B=z+2;k=Kn(y[M],y[z],y[B],.4999),D=Kn(y[M+1],y[z+1],y[B+1],.4999),O=Kn(y[M],y[z],y[B],.5),L=Kn(y[M+1],y[z+1],y[B+1],.5)}f=O-k,c=L-D}if(e.midtgtArrowAngle=Jc(f,c),e.midDispX=f,e.midDispY=c,f*=-1,c*=-1,l){var y=e.allpts;if(y.length/2%2!==0){if(!e.isRound){var T=y.length/2-1,U=T+2;f=-(y[U]-y[T]),c=-(y[U+1]-y[T+1])}}}if(e.midsrcArrowAngle=Jc(f,c),l)f=p-e.segpts[e.segpts.length-2],c=m-e.segpts[e.segpts.length-1];else if(i||s||u||r){var y=e.allpts,V=y.length,w=Kn(y[V-6],y[V-4],y[V-2],.9),S=Kn(y[V-5],y[V-3],y[V-1],.9);f=p-w,c=m-S}else f=p-x,c=m-C;e.tgtArrowAngle=Jc(f,c)};jf.getArrowWidth=jf.getArrowHeight=function(t,e){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[t+", "+e];return r||(r=Math.max(Math.pow(t*13.37,.9),29)*e,n[t+", "+e]=r,r)};var Ip,zp,Ea={},ta={},V1,$1,El,kf,Va,vl,yl,ya,ms,of,zC,PC,Pp,Up,K1,Y1=function(e,n,r){r.x=n.x-e.x,r.y=n.y-e.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)},NO=function(e,n){n.x=e.x*-1,n.y=e.y*-1,n.nx=e.nx*-1,n.ny=e.ny*-1,n.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},RO=function(e,n,r,i,l){if(e!==K1?Y1(n,e,Ea):NO(ta,Ea),Y1(n,r,ta),V1=Ea.nx*ta.ny-Ea.ny*ta.nx,$1=Ea.nx*ta.nx-Ea.ny*-ta.ny,Va=Math.asin(Math.max(-1,Math.min(1,V1))),Math.abs(Va)<1e-6){Ip=n.x,zp=n.y,yl=ms=0;return}El=1,kf=!1,$1<0?Va<0?Va=Math.PI+Va:(Va=Math.PI-Va,El=-1,kf=!0):Va>0&&(El=-1,kf=!0),n.radius!==void 0?ms=n.radius:ms=i,vl=Va/2,of=Math.min(Ea.len/2,ta.len/2),l?(ya=Math.abs(Math.cos(vl)*ms/Math.sin(vl)),ya>of?(ya=of,yl=Math.abs(ya*Math.sin(vl)/Math.cos(vl))):yl=ms):(ya=Math.min(of,ms),yl=Math.abs(ya*Math.sin(vl)/Math.cos(vl))),Pp=n.x+ta.nx*ya,Up=n.y+ta.ny*ya,Ip=Pp-ta.ny*yl*El,zp=Up+ta.nx*yl*El,zC=n.x+Ea.nx*ya,PC=n.y+Ea.ny*ya,K1=n};function UC(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 Dm(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===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}:(RO(t,e,n,r,i),{cx:Ip,cy:zp,radius:yl,startX:zC,startY:PC,stopX:Pp,stopY:Up,startAngle:Ea.ang+Math.PI/2*El,endAngle:ta.ang-Math.PI/2*El,counterClockwise:kf})}var yu=.01,MO=Math.sqrt(2*yu),dr={};dr.findMidptPtsEtc=function(t,e){var n=e.posPts,r=e.intersectionPts,i=e.vectorNormInverse,l,s=t.pstyle("source-endpoint"),u=t.pstyle("target-endpoint"),f=s.units!=null&&u.units!=null,c=function(N,k,D,O){var L=O-k,M=D-N,z=Math.sqrt(M*M+L*L);return{x:-L/z,y:M/z}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":l=n;break;case"intersection":l=r;break;case"endpoints":{if(f){var v=this.manualEndptToPx(t.source()[0],s),p=zn(v,2),m=p[0],y=p[1],w=this.manualEndptToPx(t.target()[0],u),S=zn(w,2),x=S[0],C=S[1],T={x1:m,y1:y,x2:x,y2:C};i=c(m,y,x,C),l=T}else Kt("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).")),l=r;break}}return{midptPts:l,vectorNormInverse:i}};dr.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n._private,i=r.rscratch;if(!i.haystack){var l=Math.random()*2*Math.PI;i.source={x:Math.cos(l),y:Math.sin(l)},l=Math.random()*2*Math.PI,i.target={x:Math.cos(l),y:Math.sin(l)}}var s=r.source,u=r.target,f=s.position(),c=u.position(),h=s.width(),v=u.width(),p=s.height(),m=u.height(),y=n.pstyle("haystack-radius").value,w=y/2;i.haystackPts=i.allpts=[i.source.x*h*w+f.x,i.source.y*p*w+f.y,i.target.x*v*w+c.x,i.target.y*m*w+c.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}};dr.findSegmentsPoints=function(t,e){var n=t._private.rscratch,r=t.pstyle("segment-weights"),i=t.pstyle("segment-distances"),l=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),u=Math.min(r.pfValue.length,i.pfValue.length),f=l.pfValue[l.pfValue.length-1],c=s.pfValue[s.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var h=0;h<u;h++){var v=r.pfValue[h],p=i.pfValue[h],m=1-v,y=v,w=this.findMidptPtsEtc(t,e),S=w.midptPts,x=w.vectorNormInverse,C={x:S.x1*m+S.x2*y,y:S.y1*m+S.y2*y};n.segpts.push(C.x+x.x*p,C.y+x.y*p),n.radii.push(l.pfValue[h]!==void 0?l.pfValue[h]:f),n.isArcRadius.push((s.pfValue[h]!==void 0?s.pfValue[h]:c)==="arc-radius")}};dr.findLoopPoints=function(t,e,n,r){var i=t._private.rscratch,l=e.dirCounts,s=e.srcPos,u=t.pstyle("control-point-distances"),f=u?u.pfValue[0]:void 0,c=t.pstyle("loop-direction").pfValue,h=t.pstyle("loop-sweep").pfValue,v=t.pstyle("control-point-step-size").pfValue;i.edgeType="self";var p=n,m=v;r&&(p=0,m=f);var y=c-Math.PI/2,w=y-h/2,S=y+h/2,x=c+"_"+h;p=l[x]===void 0?l[x]=0:++l[x],i.ctrlpts=[s.x+Math.cos(w)*1.4*m*(p/3+1),s.y+Math.sin(w)*1.4*m*(p/3+1),s.x+Math.cos(S)*1.4*m*(p/3+1),s.y+Math.sin(S)*1.4*m*(p/3+1)]};dr.findCompoundLoopPoints=function(t,e,n,r){var i=t._private.rscratch;i.edgeType="compound";var l=e.srcPos,s=e.tgtPos,u=e.srcW,f=e.srcH,c=e.tgtW,h=e.tgtH,v=t.pstyle("control-point-step-size").pfValue,p=t.pstyle("control-point-distances"),m=p?p.pfValue[0]:void 0,y=n,w=v;r&&(y=0,w=m);var S=50,x={x:l.x-u/2,y:l.y-f/2},C={x:s.x-c/2,y:s.y-h/2},T={x:Math.min(x.x,C.x),y:Math.min(x.y,C.y)},A=.5,N=Math.max(A,Math.log(u*yu)),k=Math.max(A,Math.log(c*yu));i.ctrlpts=[T.x,T.y-(1+Math.pow(S,1.12)/100)*w*(y/3+1)*N,T.x-(1+Math.pow(S,1.12)/100)*w*(y/3+1)*k,T.y]};dr.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};dr.findBezierPoints=function(t,e,n,r,i){var l=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,u=t.pstyle("control-point-distances"),f=t.pstyle("control-point-weights"),c=u&&f?Math.min(u.value.length,f.value.length):1,h=u?u.pfValue[0]:void 0,v=f.value[0],p=r;l.edgeType=p?"multibezier":"bezier",l.ctrlpts=[];for(var m=0;m<c;m++){var y=(.5-e.eles.length/2+n)*s*(i?-1:1),w=void 0,S=hm(y);p&&(h=u?u.pfValue[m]:s,v=f.value[m]),r?w=h:w=h!==void 0?S*h:void 0;var x=w!==void 0?w:y,C=1-v,T=v,A=this.findMidptPtsEtc(t,e),N=A.midptPts,k=A.vectorNormInverse,D={x:N.x1*C+N.x2*T,y:N.y1*C+N.y2*T};l.ctrlpts.push(D.x+k.x*x,D.y+k.y*x)}};dr.findTaxiPoints=function(t,e){var n=t._private.rscratch;n.edgeType="segments";var r="vertical",i="horizontal",l="leftward",s="rightward",u="downward",f="upward",c="auto",h=e.posPts,v=e.srcW,p=e.srcH,m=e.tgtW,y=e.tgtH,w=t.pstyle("edge-distances").value,S=w!=="node-position",x=t.pstyle("taxi-direction").value,C=x,T=t.pstyle("taxi-turn"),A=T.units==="%",N=T.pfValue,k=N<0,D=t.pstyle("taxi-turn-min-distance").pfValue,O=S?(v+m)/2:0,L=S?(p+y)/2:0,M=h.x2-h.x1,z=h.y2-h.y1,B=function(G,te){return G>0?Math.max(G-te,0):Math.min(G+te,0)},U=B(M,O),V=B(z,L),$=!1;C===c?x=Math.abs(U)>Math.abs(V)?i:r:C===f||C===u?(x=r,$=!0):(C===l||C===s)&&(x=i,$=!0);var q=x===r,H=q?V:U,Y=q?z:M,Q=hm(Y),P=!1;!($&&(A||k))&&(C===u&&Y<0||C===f&&Y>0||C===l&&Y>0||C===s&&Y<0)&&(Q*=-1,H=Q*Math.abs(H),P=!0);var I;if(A){var K=N<0?1+N:N;I=K*H}else{var F=N<0?H:0;I=F+N*Q}var J=function(G){return Math.abs(G)<D||Math.abs(G)>=Math.abs(H)},re=J(I),se=J(Math.abs(H)-Math.abs(I)),me=re||se;if(me&&!P)if(q){var Ne=Math.abs(Y)<=p/2,pe=Math.abs(M)<=m/2;if(Ne){var ee=(h.x1+h.x2)/2,le=h.y1,de=h.y2;n.segpts=[ee,le,ee,de]}else if(pe){var xe=(h.y1+h.y2)/2,Re=h.x1,$e=h.x2;n.segpts=[Re,xe,$e,xe]}else n.segpts=[h.x1,h.y2]}else{var Ye=Math.abs(Y)<=v/2,lt=Math.abs(z)<=y/2;if(Ye){var We=(h.y1+h.y2)/2,et=h.x1,ze=h.x2;n.segpts=[et,We,ze,We]}else if(lt){var Ge=(h.x1+h.x2)/2,tt=h.y1,ot=h.y2;n.segpts=[Ge,tt,Ge,ot]}else n.segpts=[h.x2,h.y1]}else if(q){var Pe=h.y1+I+(S?p/2*Q:0),pt=h.x1,ue=h.x2;n.segpts=[pt,Pe,ue,Pe]}else{var Te=h.x1+I+(S?v/2*Q:0),Oe=h.y1,Xe=h.y2;n.segpts=[Te,Oe,Te,Xe]}if(n.isRound){var Le=t.pstyle("taxi-radius").value,Ue=t.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(Le),n.isArcRadius=new Array(n.segpts.length/2).fill(Ue)}};dr.tryToCorrectInvalidPoints=function(t,e){var n=t._private.rscratch;if(n.edgeType==="bezier"){var r=e.srcPos,i=e.tgtPos,l=e.srcW,s=e.srcH,u=e.tgtW,f=e.tgtH,c=e.srcShape,h=e.tgtShape,v=e.srcCornerRadius,p=e.tgtCornerRadius,m=e.srcRs,y=e.tgtRs,w=!je(n.startX)||!je(n.startY),S=!je(n.arrowStartX)||!je(n.arrowStartY),x=!je(n.endX)||!je(n.endY),C=!je(n.arrowEndX)||!je(n.arrowEndY),T=3,A=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,N=T*A,k=Sl({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),D=k<N,O=Sl({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),L=O<N,M=!1;if(w||S||D){M=!0;var z={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},B=Math.sqrt(z.x*z.x+z.y*z.y),U={x:z.x/B,y:z.y/B},V=Math.max(l,s),$={x:n.ctrlpts[0]+U.x*2*V,y:n.ctrlpts[1]+U.y*2*V},q=c.intersectLine(r.x,r.y,l,s,$.x,$.y,0,v,m);D?(n.ctrlpts[0]=n.ctrlpts[0]+U.x*(N-k),n.ctrlpts[1]=n.ctrlpts[1]+U.y*(N-k)):(n.ctrlpts[0]=q[0]+U.x*N,n.ctrlpts[1]=q[1]+U.y*N)}if(x||C||L){M=!0;var H={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},Y=Math.sqrt(H.x*H.x+H.y*H.y),Q={x:H.x/Y,y:H.y/Y},P=Math.max(l,s),I={x:n.ctrlpts[0]+Q.x*2*P,y:n.ctrlpts[1]+Q.y*2*P},K=h.intersectLine(i.x,i.y,u,f,I.x,I.y,0,p,y);L?(n.ctrlpts[0]=n.ctrlpts[0]+Q.x*(N-O),n.ctrlpts[1]=n.ctrlpts[1]+Q.y*(N-O)):(n.ctrlpts[0]=K[0]+Q.x*N,n.ctrlpts[1]=K[1]+Q.y*N)}M&&this.findEndpoints(t)}};dr.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 n=0;n+1<e.ctrlpts.length;n+=2)e.allpts.push(e.ctrlpts[n],e.ctrlpts[n+1]),n+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[n]+e.ctrlpts[n+2])/2,(e.ctrlpts[n+1]+e.ctrlpts[n+3])/2);e.allpts.push(e.endX,e.endY);var r,i;e.ctrlpts.length/2%2===0?(r=e.allpts.length/2-1,e.midX=e.allpts[r],e.midY=e.allpts[r+1]):(r=e.allpts.length/2-3,i=.5,e.midX=Kn(e.allpts[r],e.allpts[r+2],e.allpts[r+4],i),e.midY=Kn(e.allpts[r+1],e.allpts[r+3],e.allpts[r+5],i))}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 l=2;l+3<e.allpts.length;l+=2){var s=e.radii[l/2-1],u=e.isArcRadius[l/2-1];e.roundCorners.push(Dm({x:e.allpts[l-2],y:e.allpts[l-1]},{x:e.allpts[l],y:e.allpts[l+1],radius:s},{x:e.allpts[l+2],y:e.allpts[l+3]},s,u))}}if(e.segpts.length%4===0){var f=e.segpts.length/2,c=f-2;e.midX=(e.segpts[c]+e.segpts[f])/2,e.midY=(e.segpts[c+1]+e.segpts[f+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 v={x:e.segpts[h],y:e.segpts[h+1]},p=e.roundCorners[h/2];if(p.radius===0){var m={x:e.segpts[h+2],y:e.segpts[h+3]};e.midX=v.x,e.midY=v.y,e.midVector=[v.y-m.y,m.x-v.x]}else{var y=[v.x-p.cx,v.y-p.cy],w=p.radius/Math.sqrt(Math.pow(y[0],2)+Math.pow(y[1],2));y=y.map(function(S){return S*w}),e.midX=p.cx+y[0],e.midY=p.cy+y[1],e.midVector=y}}}}};dr.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||je(e.startX)&&je(e.startY)&&je(e.endX)&&je(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Kt("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."))};dr.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var n=this,r=n.cy,i=r.hasCompoundNodes(),l=new Ka,s=function(L,M){return[].concat(Of(L),[M?1:0]).join("-")},u=[],f=[],c=0;c<t.length;c++){var h=t[c],v=h._private,p=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(p==="haystack"){f.push(h);continue}var m=p==="unbundled-bezier"||Ri(p,"segments")||p==="straight"||p==="straight-triangle"||Ri(p,"taxi"),y=p==="unbundled-bezier"||p==="bezier",w=v.source,S=v.target,x=w.poolIndex(),C=S.poolIndex(),T=[x,C].sort(),A=s(T,m),N=l.get(A);N==null&&(N={eles:[]},u.push({pairId:T,edgeIsUnbundled:m}),l.set(A,N)),N.eles.push(h),m&&(N.hasUnbundled=!0),y&&(N.hasBezier=!0)}}for(var k=function(){var L=u[D],M=L.pairId,z=L.edgeIsUnbundled,B=s(M,z),U=l.get(B),V;if(!U.hasUnbundled){var $=U.eles[0].parallelEdges().filter(function(Ue){return Ue.isBundledBezier()});fm(U.eles),$.forEach(function(Ue){return U.eles.push(Ue)}),U.eles.sort(function(Ue,ye){return Ue.poolIndex()-ye.poolIndex()})}var q=U.eles[0],H=q.source(),Y=q.target();if(H.poolIndex()>Y.poolIndex()){var Q=H;H=Y,Y=Q}var P=U.srcPos=H.position(),I=U.tgtPos=Y.position(),K=U.srcW=H.outerWidth(),F=U.srcH=H.outerHeight(),J=U.tgtW=Y.outerWidth(),re=U.tgtH=Y.outerHeight(),se=U.srcShape=n.nodeShapes[e.getNodeShape(H)],me=U.tgtShape=n.nodeShapes[e.getNodeShape(Y)],Ne=U.srcCornerRadius=H.pstyle("corner-radius").value==="auto"?"auto":H.pstyle("corner-radius").pfValue,pe=U.tgtCornerRadius=Y.pstyle("corner-radius").value==="auto"?"auto":Y.pstyle("corner-radius").pfValue,ee=U.tgtRs=Y._private.rscratch,le=U.srcRs=H._private.rscratch;U.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var de=0;de<U.eles.length;de++){var xe=U.eles[de],Re=xe[0]._private.rscratch,$e=xe.pstyle("curve-style").value,Ye=$e==="unbundled-bezier"||Ri($e,"segments")||Ri($e,"taxi"),lt=!H.same(xe.source());if(!U.calculatedIntersection&&H!==Y&&(U.hasBezier||U.hasUnbundled)){U.calculatedIntersection=!0;var We=se.intersectLine(P.x,P.y,K,F,I.x,I.y,0,Ne,le),et=U.srcIntn=We,ze=me.intersectLine(I.x,I.y,J,re,P.x,P.y,0,pe,ee),Ge=U.tgtIntn=ze,tt=U.intersectionPts={x1:We[0],x2:ze[0],y1:We[1],y2:ze[1]},ot=U.posPts={x1:P.x,x2:I.x,y1:P.y,y2:I.y},Pe=ze[1]-We[1],pt=ze[0]-We[0],ue=Math.sqrt(pt*pt+Pe*Pe);je(ue)&&ue>=MO||(ue=Math.sqrt(Math.max(pt*pt,yu)+Math.max(Pe*Pe,yu)));var Te=U.vector={x:pt,y:Pe},Oe=U.vectorNorm={x:Te.x/ue,y:Te.y/ue},Xe={x:-Oe.y,y:Oe.x};U.nodesOverlap=!je(ue)||me.checkPoint(We[0],We[1],0,J,re,I.x,I.y,pe,ee)||se.checkPoint(ze[0],ze[1],0,K,F,P.x,P.y,Ne,le),U.vectorNormInverse=Xe,V={nodesOverlap:U.nodesOverlap,dirCounts:U.dirCounts,calculatedIntersection:!0,hasBezier:U.hasBezier,hasUnbundled:U.hasUnbundled,eles:U.eles,srcPos:I,srcRs:ee,tgtPos:P,tgtRs:le,srcW:J,srcH:re,tgtW:K,tgtH:F,srcIntn:Ge,tgtIntn:et,srcShape:me,tgtShape:se,posPts:{x1:ot.x2,y1:ot.y2,x2:ot.x1,y2:ot.y1},intersectionPts:{x1:tt.x2,y1:tt.y2,x2:tt.x1,y2:tt.y1},vector:{x:-Te.x,y:-Te.y},vectorNorm:{x:-Oe.x,y:-Oe.y},vectorNormInverse:{x:-Xe.x,y:-Xe.y}}}var Le=lt?V:U;Re.nodesOverlap=Le.nodesOverlap,Re.srcIntn=Le.srcIntn,Re.tgtIntn=Le.tgtIntn,Re.isRound=$e.startsWith("round"),i&&(H.isParent()||H.isChild()||Y.isParent()||Y.isChild())&&(H.parents().anySame(Y)||Y.parents().anySame(H)||H.same(Y)&&H.isParent())?e.findCompoundLoopPoints(xe,Le,de,Ye):H===Y?e.findLoopPoints(xe,Le,de,Ye):$e.endsWith("segments")?e.findSegmentsPoints(xe,Le):$e.endsWith("taxi")?e.findTaxiPoints(xe,Le):$e==="straight"||!Ye&&U.eles.length%2===1&&de===Math.floor(U.eles.length/2)?e.findStraightEdgePoints(xe):e.findBezierPoints(xe,Le,de,Ye,lt),e.findEndpoints(xe),e.tryToCorrectInvalidPoints(xe,Le),e.checkForInvalidEdgeWarning(xe),e.storeAllpts(xe),e.storeEdgeProjections(xe),e.calculateArrowAngles(xe),e.recalculateEdgeLabelProjections(xe),e.calculateLabelAngles(xe)}},D=0;D<u.length;D++)k();this.findHaystackPoints(f)}};function qC(t){var e=[];if(t!=null){for(var n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e.push({x:r,y:i})}return e}}dr.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var n=e.edgeType;if(n==="segments")return qC(e.segpts)};dr.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var n=e.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return qC(e.ctrlpts)};dr.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Ru={};Ru.manualEndptToPx=function(t,e){var n=this,r=t.position(),i=t.outerWidth(),l=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var u=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(u[0]=u[0]*i),e.units[1]==="%"&&(u[1]=u[1]*l),u[0]+=r.x,u[1]+=r.y,u}else{var f=e.pfValue[0];f=-Math.PI/2+f;var c=2*Math.max(i,l),h=[r.x+Math.cos(f)*c,r.y+Math.sin(f)*c];return n.nodeShapes[this.getNodeShape(t)].intersectLine(r.x,r.y,i,l,h[0],h[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};Ru.findEndpoints=function(t){var e,n,r,i,l=this,s,u=t.source()[0],f=t.target()[0],c=u.position(),h=f.position(),v=t.pstyle("target-arrow-shape").value,p=t.pstyle("source-arrow-shape").value,m=t.pstyle("target-distance-from-node").pfValue,y=t.pstyle("source-distance-from-node").pfValue,w=u._private.rscratch,S=f._private.rscratch,x=t.pstyle("curve-style").value,C=t._private.rscratch,T=C.edgeType,A=Ri(x,"taxi"),N=T==="self"||T==="compound",k=T==="bezier"||T==="multibezier"||N,D=T!=="bezier",O=T==="straight"||T==="segments",L=T==="segments",M=k||D||O,z=N||A,B=t.pstyle("source-endpoint"),U=z?"outside-to-node":B.value,V=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue,$=t.pstyle("target-endpoint"),q=z?"outside-to-node":$.value,H=f.pstyle("corner-radius").value==="auto"?"auto":f.pstyle("corner-radius").pfValue;C.srcManEndpt=B,C.tgtManEndpt=$;var Y,Q,P,I,K=(e=($==null||(n=$.pfValue)===null||n===void 0?void 0:n.length)===2?$.pfValue:null)!==null&&e!==void 0?e:[0,0],F=(r=(B==null||(i=B.pfValue)===null||i===void 0?void 0:i.length)===2?B.pfValue:null)!==null&&r!==void 0?r:[0,0];if(k){var J=[C.ctrlpts[0],C.ctrlpts[1]],re=D?[C.ctrlpts[C.ctrlpts.length-2],C.ctrlpts[C.ctrlpts.length-1]]:J;Y=re,Q=J}else if(O){var se=L?C.segpts.slice(0,2):[h.x+K[0],h.y+K[1]],me=L?C.segpts.slice(C.segpts.length-2):[c.x+F[0],c.y+F[1]];Y=me,Q=se}if(q==="inside-to-node")s=[h.x,h.y];else if($.units)s=this.manualEndptToPx(f,$);else if(q==="outside-to-line")s=C.tgtIntn;else if(q==="outside-to-node"||q==="outside-to-node-or-label"?P=Y:(q==="outside-to-line"||q==="outside-to-line-or-label")&&(P=[c.x,c.y]),s=l.nodeShapes[this.getNodeShape(f)].intersectLine(h.x,h.y,f.outerWidth(),f.outerHeight(),P[0],P[1],0,H,S),q==="outside-to-node-or-label"||q==="outside-to-line-or-label"){var Ne=f._private.rscratch,pe=Ne.labelWidth,ee=Ne.labelHeight,le=Ne.labelX,de=Ne.labelY,xe=pe/2,Re=ee/2,$e=f.pstyle("text-valign").value;$e==="top"?de-=Re:$e==="bottom"&&(de+=Re);var Ye=f.pstyle("text-halign").value;Ye==="left"?le-=xe:Ye==="right"&&(le+=xe);var lt=hu(P[0],P[1],[le-xe,de-Re,le+xe,de-Re,le+xe,de+Re,le-xe,de+Re],h.x,h.y);if(lt.length>0){var We=c,et=ml(We,_s(s)),ze=ml(We,_s(lt)),Ge=et;if(ze<et&&(s=lt,Ge=ze),lt.length>2){var tt=ml(We,{x:lt[2],y:lt[3]});tt<Ge&&(s=[lt[2],lt[3]])}}}var ot=ef(s,Y,l.arrowShapes[v].spacing(t)+m),Pe=ef(s,Y,l.arrowShapes[v].gap(t)+m);if(C.endX=Pe[0],C.endY=Pe[1],C.arrowEndX=ot[0],C.arrowEndY=ot[1],U==="inside-to-node")s=[c.x,c.y];else if(B.units)s=this.manualEndptToPx(u,B);else if(U==="outside-to-line")s=C.srcIntn;else if(U==="outside-to-node"||U==="outside-to-node-or-label"?I=Q:(U==="outside-to-line"||U==="outside-to-line-or-label")&&(I=[h.x,h.y]),s=l.nodeShapes[this.getNodeShape(u)].intersectLine(c.x,c.y,u.outerWidth(),u.outerHeight(),I[0],I[1],0,V,w),U==="outside-to-node-or-label"||U==="outside-to-line-or-label"){var pt=u._private.rscratch,ue=pt.labelWidth,Te=pt.labelHeight,Oe=pt.labelX,Xe=pt.labelY,Le=ue/2,Ue=Te/2,ye=u.pstyle("text-valign").value;ye==="top"?Xe-=Ue:ye==="bottom"&&(Xe+=Ue);var G=u.pstyle("text-halign").value;G==="left"?Oe-=Le:G==="right"&&(Oe+=Le);var te=hu(I[0],I[1],[Oe-Le,Xe-Ue,Oe+Le,Xe-Ue,Oe+Le,Xe+Ue,Oe-Le,Xe+Ue],c.x,c.y);if(te.length>0){var fe=h,ce=ml(fe,_s(s)),we=ml(fe,_s(te)),Ie=ce;if(we<ce&&(s=[te[0],te[1]],Ie=we),te.length>2){var ke=ml(fe,{x:te[2],y:te[3]});ke<Ie&&(s=[te[2],te[3]])}}}var Ve=ef(s,Q,l.arrowShapes[p].spacing(t)+y),Ke=ef(s,Q,l.arrowShapes[p].gap(t)+y);C.startX=Ke[0],C.startY=Ke[1],C.arrowStartX=Ve[0],C.arrowStartY=Ve[1],M&&(!je(C.startX)||!je(C.startY)||!je(C.endX)||!je(C.endY)?C.badLine=!0:C.badLine=!1)};Ru.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}};Ru.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 Am={};function OO(t,e,n){for(var r=function(c,h,v,p){return Kn(c,h,v,p)},i=e._private,l=i.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var u=t.bezierProjPcts[s];l.push({x:r(n[0],n[2],n[4],u),y:r(n[1],n[3],n[5],u)})}}Am.storeEdgeProjections=function(t){var e=t._private,n=e.rscratch,r=n.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){e.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)OO(this,t,n.allpts.slice(i,i+6))}else if(r==="segments")for(var l=e.rstyle.linePts=[],i=0;i+1<n.allpts.length;i+=2)l.push({x:n.allpts[i],y:n.allpts[i+1]});else if(r==="haystack"){var s=n.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};Am.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Ta={};Ta.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!Fi(e)){var n,r,i=t._private,l=t.width(),s=t.height(),u=t.padding(),f=t.position(),c=t.pstyle("text-halign").strValue,h=t.pstyle("text-valign").strValue,v=i.rscratch,p=i.rstyle;switch(c){case"left":n=f.x-l/2-u;break;case"right":n=f.x+l/2+u;break;default:n=f.x}switch(h){case"top":r=f.y-s/2-u;break;case"bottom":r=f.y+s/2+u;break;default:r=f.y}v.labelX=n,v.labelY=r,p.labelX=n,p.labelY=r,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var HC=function(e,n){var r=Math.atan(n/e);return e===0&&r<0&&(r=r*-1),r},jC=function(e,n){var r=n.x-e.x,i=n.y-e.y;return HC(r,i)},BO=function(e,n,r,i){var l=du(0,i-.001,1),s=du(0,i+.001,1),u=Rs(e,n,r,l),f=Rs(e,n,r,s);return jC(u,f)};Ta.recalculateEdgeLabelProjections=function(t){var e,n=t._private,r=n.rscratch,i=this,l={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(l.mid||l.source||l.target){e={x:r.midX,y:r.midY};var s=function(v,p,m){$a(n.rscratch,v,p,m),$a(n.rstyle,v,p,m)};s("labelX",null,e.x),s("labelY",null,e.y);var u=HC(r.midDispX,r.midDispY);s("labelAutoAngle",null,u);var f=function(){if(f.cache)return f.cache;for(var v=[],p=0;p+5<r.allpts.length;p+=4){var m={x:r.allpts[p],y:r.allpts[p+1]},y={x:r.allpts[p+2],y:r.allpts[p+3]},w={x:r.allpts[p+4],y:r.allpts[p+5]};v.push({p0:m,p1:y,p2:w,startDist:0,length:0,segments:[]})}var S=n.rstyle.bezierPts,x=i.bezierProjPcts.length;function C(D,O,L,M,z){var B=Sl(O,L),U=D.segments[D.segments.length-1],V={p0:O,p1:L,t0:M,t1:z,startDist:U?U.startDist+U.length:0,length:B};D.segments.push(V),D.length+=B}for(var T=0;T<v.length;T++){var A=v[T],N=v[T-1];N&&(A.startDist=N.startDist+N.length),C(A,A.p0,S[T*x],0,i.bezierProjPcts[0]);for(var k=0;k<x-1;k++)C(A,S[T*x+k],S[T*x+k+1],i.bezierProjPcts[k],i.bezierProjPcts[k+1]);C(A,S[T*x+x-1],A.p2,i.bezierProjPcts[x-1],1)}return f.cache=v},c=function(v){var p,m=v==="source";if(l[v]){var y=t.pstyle(v+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var w=f(),S,x=0,C=0,T=0;T<w.length;T++){for(var A=w[m?T:w.length-1-T],N=0;N<A.segments.length;N++){var k=A.segments[m?N:A.segments.length-1-N],D=T===w.length-1&&N===A.segments.length-1;if(x=C,C+=k.length,C>=y||D){S={cp:A,segment:k};break}}if(S)break}var O=S.cp,L=S.segment,M=(y-x)/L.length,z=L.t1-L.t0,B=m?L.t0+z*M:L.t1-z*M;B=du(0,B,1),e=Rs(O.p0,O.p1,O.p2,B),p=BO(O.p0,O.p1,O.p2,B);break}case"straight":case"segments":case"haystack":{for(var U=0,V,$,q,H,Y=r.allpts.length,Q=0;Q+3<Y&&(m?(q={x:r.allpts[Q],y:r.allpts[Q+1]},H={x:r.allpts[Q+2],y:r.allpts[Q+3]}):(q={x:r.allpts[Y-2-Q],y:r.allpts[Y-1-Q]},H={x:r.allpts[Y-4-Q],y:r.allpts[Y-3-Q]}),V=Sl(q,H),$=U,U+=V,!(U>=y));Q+=2);var P=y-$,I=P/V;I=du(0,I,1),e=n2(q,H,I),p=jC(q,H);break}}s("labelX",v,e.x),s("labelY",v,e.y),s("labelAutoAngle",v,p)}};c("source"),c("target"),this.applyLabelDimensions(t)}};Ta.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};Ta.applyPrefixedLabelDimensions=function(t,e){var n=t._private,r=this.getLabelText(t,e),i=wl(r,t._private.labelDimsKey);if(kr(n.rscratch,"prefixedLabelDimsKey",e)!==i){$a(n.rscratch,"prefixedLabelDimsKey",e,i);var l=this.calculateLabelDimensions(t,r),s=t.pstyle("line-height").pfValue,u=t.pstyle("text-wrap").strValue,f=kr(n.rscratch,"labelWrapCachedLines",e)||[],c=u!=="wrap"?1:Math.max(f.length,1),h=l.height/c,v=h*s,p=l.width,m=l.height+(c-1)*(s-1)*h;$a(n.rstyle,"labelWidth",e,p),$a(n.rscratch,"labelWidth",e,p),$a(n.rstyle,"labelHeight",e,m),$a(n.rscratch,"labelHeight",e,m),$a(n.rscratch,"labelLineHeight",e,v)}};Ta.getLabelText=function(t,e){var n=t._private,r=e?e+"-":"",i=t.pstyle(r+"label").strValue,l=t.pstyle("text-transform").value,s=function(F,J){return J?($a(n.rscratch,F,e,J),J):kr(n.rscratch,F,e)};if(!i)return"";l=="none"||(l=="uppercase"?i=i.toUpperCase():l=="lowercase"&&(i=i.toLowerCase()));var u=t.pstyle("text-wrap").value;if(u==="wrap"){var f=s("labelKey");if(f!=null&&s("labelWrapKey")===f)return s("labelWrapCachedText");for(var c="β",h=i.split(`
|
|
18
|
+
`),v=t.pstyle("text-max-width").pfValue,p=t.pstyle("text-overflow-wrap").value,m=p==="anywhere",y=[],w=/[\s\u200b]+|$/g,S=0;S<h.length;S++){var x=h[S],C=this.calculateLabelDimensions(t,x),T=C.width;if(m){var A=x.split("").join(c);x=A}if(T>v){var N=x.matchAll(w),k="",D=0,O=Rr(N),L;try{for(O.s();!(L=O.n()).done;){var M=L.value,z=M[0],B=x.substring(D,M.index);D=M.index+z.length;var U=k.length===0?B:k+B+z,V=this.calculateLabelDimensions(t,U),$=V.width;$<=v?k+=B+z:(k&&y.push(k),k=B+z)}}catch(K){O.e(K)}finally{O.f()}k.match(/^[\s\u200b]+$/)||y.push(k)}else y.push(x)}s("labelWrapCachedLines",y),i=s("labelWrapCachedText",y.join(`
|
|
19
|
+
`)),s("labelWrapKey",f)}else if(u==="ellipsis"){var q=t.pstyle("text-max-width").pfValue,H="",Y="β¦",Q=!1;if(this.calculateLabelDimensions(t,i).width<q)return i;for(var P=0;P<i.length;P++){var I=this.calculateLabelDimensions(t,H+i[P]+Y).width;if(I>q)break;H+=i[P],P===i.length-1&&(Q=!0)}return Q||(H+=Y),H}return i};Ta.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,n=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(n){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};Ta.calculateLabelDimensions=function(t,e){var n=this,r=n.cy.window(),i=r.document,l=0,s=t.pstyle("font-style").strValue,u=t.pstyle("font-size").pfValue,f=t.pstyle("font-family").strValue,c=t.pstyle("font-weight").strValue,h=this.labelCalcCanvas,v=this.labelCalcCanvasContext;if(!h){h=this.labelCalcCanvas=i.createElement("canvas"),v=this.labelCalcCanvasContext=h.getContext("2d");var p=h.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}v.font="".concat(s," ").concat(c," ").concat(u,"px ").concat(f);for(var m=0,y=0,w=e.split(`
|
|
20
|
+
`),S=0;S<w.length;S++){var x=w[S],C=v.measureText(x),T=Math.ceil(C.width),A=u;m=Math.max(T,m),y+=A}return m+=l,y+=l,{width:m,height:y}};Ta.calculateLabelAngle=function(t,e){var n=t._private,r=n.rscratch,i=t.isEdge(),l=e?e+"-":"",s=t.pstyle(l+"text-rotation"),u=s.strValue;return u==="none"?0:i&&u==="autorotate"?r.labelAutoAngle:u==="autorotate"?0:s.pfValue};Ta.calculateLabelAngles=function(t){var e=this,n=t.isEdge(),r=t._private,i=r.rscratch;i.labelAngle=e.calculateLabelAngle(t),n&&(i.sourceLabelAngle=e.calculateLabelAngle(t,"source"),i.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var GC={},X1=28,Z1=!1;GC.getNodeShape=function(t){var e=this,n=t.pstyle("shape").value;if(n==="cutrectangle"&&(t.width()<X1||t.height()<X1))return Z1||(Kt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Z1=!0),"rectangle";if(t.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(r).name}return n};var gd={};gd.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),n=this,r=function(s){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),u)for(var f=0;f<s.length;f++){var c=s[f],h=c._private,v=h.rstyle;v.clean=!1,v.cleanConnected=!1}};n.binder(t).on("bounds.* dirty.*",function(s){var u=s.target;r(u)}).on("style.* background.*",function(s){var u=s.target;r(u,!1)});var i=function(s){if(s){var u=n.onUpdateEleCalcsFns;e.cleanStyle();for(var f=0;f<e.length;f++){var c=e[f],h=c._private.rstyle;c.isNode()&&!h.cleanConnected&&(r(c.connectedEdges()),h.cleanConnected=!0)}if(u)for(var v=0;v<u.length;v++){var p=u[v];p(s,e)}n.recalculateRenderedStyle(e),e=t.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)};gd.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};gd.recalculateRenderedStyle=function(t,e){var n=function(A){return A._private.rstyle.cleanConnected};if(t.length!==0){var r=[],i=[];if(!this.destroyed){e===void 0&&(e=!0);for(var l=0;l<t.length;l++){var s=t[l],u=s._private,f=u.rstyle;s.isEdge()&&(!n(s.source())||!n(s.target()))&&(f.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(T){return!T._private.rstyle.clean&&T.isBundledBezier()})&&(f.clean=!1),!(e&&f.clean||s.removed())&&s.pstyle("display").value!=="none"&&(u.group==="nodes"?i.push(s):r.push(s),f.clean=!0)}for(var c=0;c<i.length;c++){var h=i[c],v=h._private,p=v.rstyle,m=h.position();this.recalculateNodeLabelProjection(h),p.nodeX=m.x,p.nodeY=m.y,p.nodeW=h.pstyle("width").pfValue,p.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var y=0;y<r.length;y++){var w=r[y],S=w._private,x=S.rstyle,C=S.rscratch;x.srcX=C.arrowStartX,x.srcY=C.arrowStartY,x.tgtX=C.arrowEndX,x.tgtY=C.arrowEndY,x.midX=C.midX,x.midY=C.midY,x.labelAngle=C.labelAngle,x.sourceLabelAngle=C.sourceLabelAngle,x.targetLabelAngle=C.targetLabelAngle}}}};var pd={};pd.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],n=0;n<t.length;n++){var r=t[n],i=r._private.rscratch;r.grabbed()&&!r.isParent()?e.push(r):i.inDragLayer?t.drag.push(r):t.nondrag.push(r)}for(var n=0;n<e.length;n++){var r=e[n];t.drag.push(r)}}};pd.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};pd.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(TC),e.interactive=e.filter(function(n){return n.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var VC={};[kl,jf,dr,Ru,Am,Ta,GC,gd,pd].forEach(function(t){ht(VC,t)});var $C={};$C.getCachedImage=function(t,e,n){var r=this,i=r.imageCache=r.imageCache||{},l=i[t];if(l)return l.image.complete||l.image.addEventListener("load",n),l.image;l=i[t]=i[t]||{};var s=l.image=new Image;s.addEventListener("load",n),s.addEventListener("error",function(){s.error=!0});var u="data:",f=t.substring(0,u.length).toLowerCase()===u;return f||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Gs={};Gs.registerBinding=function(t,e,n,r){var i=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var l=[],s=0;s<t.length;s++){var u=t[s];if(u!==void 0){var f=this.binder(u);l.push(f.on.apply(f,i))}}return l}var f=this.binder(t);return f.on.apply(f,i)};Gs.binder=function(t){var e=this,n=e.cy.window(),r=t===n||t===n.document||t===n.document.body||$k(t);if(e.supportsPassiveEvents==null){var i=!1;try{var l=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});n.addEventListener("test",null,l)}catch{}e.supportsPassiveEvents=i}var s=function(f,c,h){var v=Array.prototype.slice.call(arguments);return r&&e.supportsPassiveEvents&&(v[2]={capture:h??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:v}),(t.addEventListener||t.on).apply(t,v),this};return{on:s,addEventListener:s,addListener:s,bind:s}};Gs.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Gs.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Gs.load=function(){var t=this,e=t.cy.window(),n=function(G){return G.selected()},r=function(G){var te=G.getRootNode();if(te&&te.nodeType===11&&te.host!==void 0)return te},i=function(G,te,fe,ce){G==null&&(G=t.cy);for(var we=0;we<te.length;we++){var Ie=te[we];G.emit({originalEvent:fe,type:Ie,position:ce})}},l=function(G){return G.shiftKey||G.metaKey||G.ctrlKey},s=function(G,te){var fe=!0;if(t.cy.hasCompoundNodes()&&G&&G.pannable())for(var ce=0;te&&ce<te.length;ce++){var G=te[ce];if(G.isNode()&&G.isParent()&&!G.pannable()){fe=!1;break}}else fe=!0;return fe},u=function(G){G[0]._private.grabbed=!0},f=function(G){G[0]._private.grabbed=!1},c=function(G){G[0]._private.rscratch.inDragLayer=!0},h=function(G){G[0]._private.rscratch.inDragLayer=!1},v=function(G){G[0]._private.rscratch.isGrabTarget=!0},p=function(G){G[0]._private.rscratch.isGrabTarget=!1},m=function(G,te){var fe=te.addToList,ce=fe.has(G);!ce&&G.grabbable()&&!G.locked()&&(fe.merge(G),u(G))},y=function(G,te){if(G.cy().hasCompoundNodes()&&!(te.inDragLayer==null&&te.addToList==null)){var fe=G.descendants();te.inDragLayer&&(fe.forEach(c),fe.connectedEdges().forEach(c)),te.addToList&&m(fe,te)}},w=function(G,te){te=te||{};var fe=G.cy().hasCompoundNodes();te.inDragLayer&&(G.forEach(c),G.neighborhood().stdFilter(function(ce){return!fe||ce.isEdge()}).forEach(c)),te.addToList&&G.forEach(function(ce){m(ce,te)}),y(G,te),C(G,{inDragLayer:te.inDragLayer}),t.updateCachedGrabbedEles()},S=w,x=function(G){G&&(t.getCachedZSortedEles().forEach(function(te){f(te),h(te),p(te)}),t.updateCachedGrabbedEles())},C=function(G,te){if(!(te.inDragLayer==null&&te.addToList==null)&&G.cy().hasCompoundNodes()){var fe=G.ancestors().orphans();if(!fe.same(G)){var ce=fe.descendants().spawnSelf().merge(fe).unmerge(G).unmerge(G.descendants()),we=ce.connectedEdges();te.inDragLayer&&(we.forEach(c),ce.forEach(c)),te.addToList&&ce.forEach(function(Ie){m(Ie,te)})}}},T=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},A=typeof MutationObserver<"u",N=typeof ResizeObserver<"u";A?(t.removeObserver=new MutationObserver(function(ye){for(var G=0;G<ye.length;G++){var te=ye[G],fe=te.removedNodes;if(fe)for(var ce=0;ce<fe.length;ce++){var we=fe[ce];if(we===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 k=Au(function(){t.cy.resize()},100);A&&(t.styleObserver=new MutationObserver(k),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",k),N&&(t.resizeObserver=new ResizeObserver(k),t.resizeObserver.observe(t.container));var D=function(G,te){for(;G!=null;)te(G),G=G.parentNode},O=function(){t.invalidateContainerClientCoordsCache()};D(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 L=function(){return t.selection[4]!==0},M=function(G){for(var te=t.findContainerClientCoords(),fe=te[0],ce=te[1],we=te[2],Ie=te[3],ke=G.touches?G.touches:[G],Ve=!1,Ke=0;Ke<ke.length;Ke++){var Qe=ke[Ke];if(fe<=Qe.clientX&&Qe.clientX<=fe+we&&ce<=Qe.clientY&&Qe.clientY<=ce+Ie){Ve=!0;break}}if(!Ve)return!1;for(var ut=t.container,X=G.target,ne=X.parentNode,Ce=!1;ne;){if(ne===ut){Ce=!0;break}ne=ne.parentNode}return!!Ce};t.registerBinding(t.container,"mousedown",function(G){if(M(G)&&!(t.hoverData.which===1&&G.which!==1)){G.preventDefault(),T(),t.hoverData.capture=!0,t.hoverData.which=G.which;var te=t.cy,fe=[G.clientX,G.clientY],ce=t.projectIntoViewport(fe[0],fe[1]),we=t.selection,Ie=t.findNearestElements(ce[0],ce[1],!0,!1),ke=Ie[0],Ve=t.dragData.possibleDragElements;t.hoverData.mdownPos=ce,t.hoverData.mdownGPos=fe;var Ke=function(Fe){return{originalEvent:G,type:Fe,position:{x:ce[0],y:ce[1]}}},Qe=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Fe=t.hoverData.down;Fe?Fe.emit(Ke("taphold")):te.emit(Ke("taphold"))}},t.tapholdDuration)};if(G.which==3){t.hoverData.cxtStarted=!0;var ut={originalEvent:G,type:"cxttapstart",position:{x:ce[0],y:ce[1]}};ke?(ke.activate(),ke.emit(ut),t.hoverData.down=ke):te.emit(ut),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(G.which==1){ke&&ke.activate();{if(ke!=null&&t.nodeIsGrabbable(ke)){var X=function(Fe){Fe.emit(Ke("grab"))};if(v(ke),!ke.selected())Ve=t.dragData.possibleDragElements=te.collection(),S(ke,{addToList:Ve}),ke.emit(Ke("grabon")).emit(Ke("grab"));else{Ve=t.dragData.possibleDragElements=te.collection();var ne=te.$(function(Ce){return Ce.isNode()&&Ce.selected()&&t.nodeIsGrabbable(Ce)});w(ne,{addToList:Ve}),ke.emit(Ke("grabon")),ne.forEach(X)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=ke,t.hoverData.downs=Ie,t.hoverData.downTime=new Date().getTime()}i(ke,["mousedown","tapstart","vmousedown"],G,{x:ce[0],y:ce[1]}),ke==null?(we[4]=1,t.data.bgActivePosistion={x:ce[0],y:ce[1]},t.redrawHint("select",!0),t.redraw()):ke.pannable()&&(we[4]=1),Qe()}we[0]=we[2]=ce[0],we[1]=we[3]=ce[1]}},!1);var z=r(t.container);t.registerBinding([e,z],"mousemove",function(G){var te=t.hoverData.capture;if(!(!te&&!M(G))){var fe=!1,ce=t.cy,we=ce.zoom(),Ie=[G.clientX,G.clientY],ke=t.projectIntoViewport(Ie[0],Ie[1]),Ve=t.hoverData.mdownPos,Ke=t.hoverData.mdownGPos,Qe=t.selection,ut=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ut=t.findNearestElement(ke[0],ke[1],!0,!1));var X=t.hoverData.last,ne=t.hoverData.down,Ce=[ke[0]-Qe[2],ke[1]-Qe[3]],Fe=t.dragData.possibleDragElements,mt;if(Ke){var ft=Ie[0]-Ke[0],He=ft*ft,Me=Ie[1]-Ke[1],Ze=Me*Me,Et=He+Ze;t.hoverData.isOverThresholdDrag=mt=Et>=t.desktopTapThreshold2}var yt=l(G);mt&&(t.hoverData.tapholdCancelled=!0);var Nn=function(){var rn=t.hoverData.dragDelta=t.hoverData.dragDelta||[];rn.length===0?(rn.push(Ce[0]),rn.push(Ce[1])):(rn[0]+=Ce[0],rn[1]+=Ce[1])};fe=!0,i(ut,["mousemove","vmousemove","tapdrag"],G,{x:ke[0],y:ke[1]});var Bt=function(rn){return{originalEvent:G,type:rn,position:{x:ke[0],y:ke[1]}}},Gn=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||ce.emit(Bt("boxstart")),Qe[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(mt){var Ft=Bt("cxtdrag");ne?ne.emit(Ft):ce.emit(Ft),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ut!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(Bt("cxtdragout")),t.hoverData.cxtOver=ut,ut&&ut.emit(Bt("cxtdragover")))}}else if(t.hoverData.dragging){if(fe=!0,ce.panningEnabled()&&ce.userPanningEnabled()){var Vt;if(t.hoverData.justStartedPan){var yn=t.hoverData.mdownPos;Vt={x:(ke[0]-yn[0])*we,y:(ke[1]-yn[1])*we},t.hoverData.justStartedPan=!1}else Vt={x:Ce[0]*we,y:Ce[1]*we};ce.panBy(Vt),ce.emit(Bt("dragpan")),t.hoverData.dragged=!0}ke=t.projectIntoViewport(G.clientX,G.clientY)}else if(Qe[4]==1&&(ne==null||ne.pannable())){if(mt){if(!t.hoverData.dragging&&ce.boxSelectionEnabled()&&(yt||!ce.panningEnabled()||!ce.userPanningEnabled()))Gn();else if(!t.hoverData.selecting&&ce.panningEnabled()&&ce.userPanningEnabled()){var Vn=s(ne,t.hoverData.downs);Vn&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Qe[4]=0,t.data.bgActivePosistion=_s(Ve),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())&&ut!=X&&(X&&i(X,["mouseout","tapdragout"],G,{x:ke[0],y:ke[1]}),ut&&i(ut,["mouseover","tapdragover"],G,{x:ke[0],y:ke[1]}),t.hoverData.last=ut),ne)if(mt){if(ce.boxSelectionEnabled()&&yt)ne&&ne.grabbed()&&(x(Fe),ne.emit(Bt("freeon")),Fe.emit(Bt("free")),t.dragData.didDrag&&(ne.emit(Bt("dragfreeon")),Fe.emit(Bt("dragfree")))),Gn();else if(ne&&ne.grabbed()&&t.nodeIsDraggable(ne)){var Sn=!t.dragData.didDrag;Sn&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||w(Fe,{inDragLayer:!0});var bn={x:0,y:0};if(je(Ce[0])&&je(Ce[1])&&(bn.x+=Ce[0],bn.y+=Ce[1],Sn)){var En=t.hoverData.dragDelta;En&&je(En[0])&&je(En[1])&&(bn.x+=En[0],bn.y+=En[1])}t.hoverData.draggingEles=!0,Fe.silentShift(bn).emit(Bt("position")).emit(Bt("drag")),t.redrawHint("drag",!0),t.redraw()}}else Nn();fe=!0}if(Qe[2]=ke[0],Qe[3]=ke[1],fe)return G.stopPropagation&&G.stopPropagation(),G.preventDefault&&G.preventDefault(),!1}},!1);var B,U,V;t.registerBinding(e,"mouseup",function(G){if(!(t.hoverData.which===1&&G.which!==1&&t.hoverData.capture)){var te=t.hoverData.capture;if(te){t.hoverData.capture=!1;var fe=t.cy,ce=t.projectIntoViewport(G.clientX,G.clientY),we=t.selection,Ie=t.findNearestElement(ce[0],ce[1],!0,!1),ke=t.dragData.possibleDragElements,Ve=t.hoverData.down,Ke=l(G);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ve&&Ve.unactivate();var Qe=function(ft){return{originalEvent:G,type:ft,position:{x:ce[0],y:ce[1]}}};if(t.hoverData.which===3){var ut=Qe("cxttapend");if(Ve?Ve.emit(ut):fe.emit(ut),!t.hoverData.cxtDragged){var X=Qe("cxttap");Ve?Ve.emit(X):fe.emit(X)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Ie,["mouseup","tapend","vmouseup"],G,{x:ce[0],y:ce[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ve,["click","tap","vclick"],G,{x:ce[0],y:ce[1]}),U=!1,G.timeStamp-V<=fe.multiClickDebounceTime()?(B&&clearTimeout(B),U=!0,V=null,i(Ve,["dblclick","dbltap","vdblclick"],G,{x:ce[0],y:ce[1]})):(B=setTimeout(function(){U||i(Ve,["oneclick","onetap","voneclick"],G,{x:ce[0],y:ce[1]})},fe.multiClickDebounceTime()),V=G.timeStamp)),Ve==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!l(G)&&(fe.$(n).unselect(["tapunselect"]),ke.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=ke=fe.collection()),Ie==Ve&&!t.dragData.didDrag&&!t.hoverData.selecting&&Ie!=null&&Ie._private.selectable&&(t.hoverData.dragging||(fe.selectionType()==="additive"||Ke?Ie.selected()?Ie.unselect(["tapunselect"]):Ie.select(["tapselect"]):Ke||(fe.$(n).unmerge(Ie).unselect(["tapunselect"]),Ie.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var ne=fe.collection(t.getAllInBox(we[0],we[1],we[2],we[3]));t.redrawHint("select",!0),ne.length>0&&t.redrawHint("eles",!0),fe.emit(Qe("boxend"));var Ce=function(ft){return ft.selectable()&&!ft.selected()};fe.selectionType()==="additive"||Ke||fe.$(n).unmerge(ne).unselect(),ne.emit(Qe("box")).stdFilter(Ce).select().emit(Qe("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!we[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Fe=Ve&&Ve.grabbed();x(ke),Fe&&(Ve.emit(Qe("freeon")),ke.emit(Qe("free")),t.dragData.didDrag&&(Ve.emit(Qe("dragfreeon")),ke.emit(Qe("dragfree"))))}}we[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 $=[],q=4,H,Y=1e5,Q=function(G,te){for(var fe=0;fe<G.length;fe++)if(G[fe]%te!==0)return!1;return!0},P=function(G){for(var te=Math.abs(G[0]),fe=1;fe<G.length;fe++)if(Math.abs(G[fe])!==te)return!1;return!0},I=function(G){var te=!1,fe=G.deltaY;if(fe==null&&(G.wheelDeltaY!=null?fe=G.wheelDeltaY/4:G.wheelDelta!=null&&(fe=G.wheelDelta/4)),fe!==0){if(H==null)if($.length>=q){var ce=$;if(H=Q(ce,5),!H){var we=Math.abs(ce[0]);H=P(ce)&&we>5}if(H)for(var Ie=0;Ie<ce.length;Ie++)Y=Math.min(Math.abs(ce[Ie]),Y)}else $.push(fe),te=!0;else H&&(Y=Math.min(Math.abs(fe),Y));if(!t.scrollingPage){var ke=t.cy,Ve=ke.zoom(),Ke=ke.pan(),Qe=t.projectIntoViewport(G.clientX,G.clientY),ut=[Qe[0]*Ve+Ke.x,Qe[1]*Ve+Ke.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||L()){G.preventDefault();return}if(ke.panningEnabled()&&ke.userPanningEnabled()&&ke.zoomingEnabled()&&ke.userZoomingEnabled()){G.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 X;te&&Math.abs(fe)>5&&(fe=hm(fe)*5),X=fe/-250,H&&(X/=Y,X*=3),X=X*t.wheelSensitivity;var ne=G.deltaMode===1;ne&&(X*=33);var Ce=ke.zoom()*Math.pow(10,X);G.type==="gesturechange"&&(Ce=t.gestureStartZoom*G.scale),ke.zoom({level:Ce,renderedPosition:{x:ut[0],y:ut[1]}}),ke.emit({type:G.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:G,position:{x:Qe[0],y:Qe[1]}})}}}};t.registerBinding(t.container,"wheel",I,!0),t.registerBinding(e,"scroll",function(G){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(G){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||G.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ye){t.hasTouchStarted||I(ye)},!0),t.registerBinding(t.container,"mouseout",function(G){var te=t.projectIntoViewport(G.clientX,G.clientY);t.cy.emit({originalEvent:G,type:"mouseout",position:{x:te[0],y:te[1]}})},!1),t.registerBinding(t.container,"mouseover",function(G){var te=t.projectIntoViewport(G.clientX,G.clientY);t.cy.emit({originalEvent:G,type:"mouseover",position:{x:te[0],y:te[1]}})},!1);var K,F,J,re,se,me,Ne,pe,ee,le,de,xe,Re,$e=function(G,te,fe,ce){return Math.sqrt((fe-G)*(fe-G)+(ce-te)*(ce-te))},Ye=function(G,te,fe,ce){return(fe-G)*(fe-G)+(ce-te)*(ce-te)},lt;t.registerBinding(t.container,"touchstart",lt=function(G){if(t.hasTouchStarted=!0,!!M(G)){T(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var te=t.cy,fe=t.touchData.now,ce=t.touchData.earlier;if(G.touches[0]){var we=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);fe[0]=we[0],fe[1]=we[1]}if(G.touches[1]){var we=t.projectIntoViewport(G.touches[1].clientX,G.touches[1].clientY);fe[2]=we[0],fe[3]=we[1]}if(G.touches[2]){var we=t.projectIntoViewport(G.touches[2].clientX,G.touches[2].clientY);fe[4]=we[0],fe[5]=we[1]}var Ie=function(yt){return{originalEvent:G,type:yt,position:{x:fe[0],y:fe[1]}}};if(G.touches[1]){t.touchData.singleTouchMoved=!0,x(t.dragData.touchDragEles);var ke=t.findContainerClientCoords();ee=ke[0],le=ke[1],de=ke[2],xe=ke[3],K=G.touches[0].clientX-ee,F=G.touches[0].clientY-le,J=G.touches[1].clientX-ee,re=G.touches[1].clientY-le,Re=0<=K&&K<=de&&0<=J&&J<=de&&0<=F&&F<=xe&&0<=re&&re<=xe;var Ve=te.pan(),Ke=te.zoom();se=$e(K,F,J,re),me=Ye(K,F,J,re),Ne=[(K+J)/2,(F+re)/2],pe=[(Ne[0]-Ve.x)/Ke,(Ne[1]-Ve.y)/Ke];var Qe=200,ut=Qe*Qe;if(me<ut&&!G.touches[2]){var X=t.findNearestElement(fe[0],fe[1],!0,!0),ne=t.findNearestElement(fe[2],fe[3],!0,!0);X&&X.isNode()?(X.activate().emit(Ie("cxttapstart")),t.touchData.start=X):ne&&ne.isNode()?(ne.activate().emit(Ie("cxttapstart")),t.touchData.start=ne):te.emit(Ie("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(G.touches[2])te.boxSelectionEnabled()&&G.preventDefault();else if(!G.touches[1]){if(G.touches[0]){var Ce=t.findNearestElements(fe[0],fe[1],!0,!0),Fe=Ce[0];if(Fe!=null&&(Fe.activate(),t.touchData.start=Fe,t.touchData.starts=Ce,t.nodeIsGrabbable(Fe))){var mt=t.dragData.touchDragEles=te.collection(),ft=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Fe.selected()?(ft=te.$(function(Et){return Et.selected()&&t.nodeIsGrabbable(Et)}),w(ft,{addToList:mt})):S(Fe,{addToList:mt}),v(Fe),Fe.emit(Ie("grabon")),ft?ft.forEach(function(Et){Et.emit(Ie("grab"))}):Fe.emit(Ie("grab"))}i(Fe,["touchstart","tapstart","vmousedown"],G,{x:fe[0],y:fe[1]}),Fe==null&&(t.data.bgActivePosistion={x:we[0],y:we[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&&i(t.touchData.start,["taphold"],G,{x:fe[0],y:fe[1]})},t.tapholdDuration)}}if(G.touches.length>=1){for(var He=t.touchData.startPosition=[null,null,null,null,null,null],Me=0;Me<fe.length;Me++)He[Me]=ce[Me]=fe[Me];var Ze=G.touches[0];t.touchData.startGPosition=[Ze.clientX,Ze.clientY]}}},!1);var We;t.registerBinding(e,"touchmove",We=function(G){var te=t.touchData.capture;if(!(!te&&!M(G))){var fe=t.selection,ce=t.cy,we=t.touchData.now,Ie=t.touchData.earlier,ke=ce.zoom();if(G.touches[0]){var Ve=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);we[0]=Ve[0],we[1]=Ve[1]}if(G.touches[1]){var Ve=t.projectIntoViewport(G.touches[1].clientX,G.touches[1].clientY);we[2]=Ve[0],we[3]=Ve[1]}if(G.touches[2]){var Ve=t.projectIntoViewport(G.touches[2].clientX,G.touches[2].clientY);we[4]=Ve[0],we[5]=Ve[1]}var Ke=function(Xi){return{originalEvent:G,type:Xi,position:{x:we[0],y:we[1]}}},Qe=t.touchData.startGPosition,ut;if(te&&G.touches[0]&&Qe){for(var X=[],ne=0;ne<we.length;ne++)X[ne]=we[ne]-Ie[ne];var Ce=G.touches[0].clientX-Qe[0],Fe=Ce*Ce,mt=G.touches[0].clientY-Qe[1],ft=mt*mt,He=Fe+ft;ut=He>=t.touchTapThreshold2}if(te&&t.touchData.cxt){G.preventDefault();var Me=G.touches[0].clientX-ee,Ze=G.touches[0].clientY-le,Et=G.touches[1].clientX-ee,yt=G.touches[1].clientY-le,Nn=Ye(Me,Ze,Et,yt),Bt=Nn/me,Gn=150,Ft=Gn*Gn,Vt=1.5,yn=Vt*Vt;if(Bt>=yn||Nn>=Ft){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Vn=Ke("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Vn),t.touchData.start=null):ce.emit(Vn)}}if(te&&t.touchData.cxt){var Vn=Ke("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Vn):ce.emit(Vn),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Sn=t.findNearestElement(we[0],we[1],!0,!0);(!t.touchData.cxtOver||Sn!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(Ke("cxtdragout")),t.touchData.cxtOver=Sn,Sn&&Sn.emit(Ke("cxtdragover")))}else if(te&&G.touches[2]&&ce.boxSelectionEnabled())G.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||ce.emit(Ke("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,fe[4]=1,!fe||fe.length===0||fe[0]===void 0?(fe[0]=(we[0]+we[2]+we[4])/3,fe[1]=(we[1]+we[3]+we[5])/3,fe[2]=(we[0]+we[2]+we[4])/3+1,fe[3]=(we[1]+we[3]+we[5])/3+1):(fe[2]=(we[0]+we[2]+we[4])/3,fe[3]=(we[1]+we[3]+we[5])/3),t.redrawHint("select",!0),t.redraw();else if(te&&G.touches[1]&&!t.touchData.didSelect&&ce.zoomingEnabled()&&ce.panningEnabled()&&ce.userZoomingEnabled()&&ce.userPanningEnabled()){G.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var bn=t.dragData.touchDragEles;if(bn){t.redrawHint("drag",!0);for(var En=0;En<bn.length;En++){var Gr=bn[En]._private;Gr.grabbed=!1,Gr.rscratch.inDragLayer=!1}}var rn=t.touchData.start,Me=G.touches[0].clientX-ee,Ze=G.touches[0].clientY-le,Et=G.touches[1].clientX-ee,yt=G.touches[1].clientY-le,ha=$e(Me,Ze,Et,yt),Cn=ha/se;if(Re){var sr=Me-K,vr=Ze-F,Vr=Et-J,fn=yt-re,Ja=(sr+Vr)/2,ia=(vr+fn)/2,oe=ce.zoom(),ie=oe*Cn,Ae=ce.pan(),Je=pe[0]*oe+Ae.x,Dt=pe[1]*oe+Ae.y,Pt={x:-ie/oe*(Je-Ae.x-Ja)+Je,y:-ie/oe*(Dt-Ae.y-ia)+Dt};if(rn&&rn.active()){var bn=t.dragData.touchDragEles;x(bn),t.redrawHint("drag",!0),t.redrawHint("eles",!0),rn.unactivate().emit(Ke("freeon")),bn.emit(Ke("free")),t.dragData.didDrag&&(rn.emit(Ke("dragfreeon")),bn.emit(Ke("dragfree")))}ce.viewport({zoom:ie,pan:Pt,cancelOnFailedZoom:!0}),ce.emit(Ke("pinchzoom")),se=ha,K=Me,F=Ze,J=Et,re=yt,t.pinching=!0}if(G.touches[0]){var Ve=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);we[0]=Ve[0],we[1]=Ve[1]}if(G.touches[1]){var Ve=t.projectIntoViewport(G.touches[1].clientX,G.touches[1].clientY);we[2]=Ve[0],we[3]=Ve[1]}if(G.touches[2]){var Ve=t.projectIntoViewport(G.touches[2].clientX,G.touches[2].clientY);we[4]=Ve[0],we[5]=Ve[1]}}else if(G.touches[0]&&!t.touchData.didSelect){var Qt=t.touchData.start,Zn=t.touchData.last,Sn;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Sn=t.findNearestElement(we[0],we[1],!0,!0)),te&&Qt!=null&&G.preventDefault(),te&&Qt!=null&&t.nodeIsDraggable(Qt))if(ut){var bn=t.dragData.touchDragEles,Qn=!t.dragData.didDrag;Qn&&w(bn,{inDragLayer:!0}),t.dragData.didDrag=!0;var Ut={x:0,y:0};if(je(X[0])&&je(X[1])&&(Ut.x+=X[0],Ut.y+=X[1],Qn)){t.redrawHint("eles",!0);var dn=t.touchData.dragDelta;dn&&je(dn[0])&&je(dn[1])&&(Ut.x+=dn[0],Ut.y+=dn[1])}t.hoverData.draggingEles=!0,bn.silentShift(Ut).emit(Ke("position")).emit(Ke("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==Ie[0]&&t.touchData.startPosition[1]==Ie[1]&&t.redrawHint("eles",!0),t.redraw()}else{var dn=t.touchData.dragDelta=t.touchData.dragDelta||[];dn.length===0?(dn.push(X[0]),dn.push(X[1])):(dn[0]+=X[0],dn[1]+=X[1])}if(i(Qt||Sn,["touchmove","tapdrag","vmousemove"],G,{x:we[0],y:we[1]}),(!Qt||!Qt.grabbed())&&Sn!=Zn&&(Zn&&Zn.emit(Ke("tapdragout")),Sn&&Sn.emit(Ke("tapdragover"))),t.touchData.last=Sn,te)for(var En=0;En<we.length;En++)we[En]&&t.touchData.startPosition[En]&&ut&&(t.touchData.singleTouchMoved=!0);if(te&&(Qt==null||Qt.pannable())&&ce.panningEnabled()&&ce.userPanningEnabled()){var Ol=s(Qt,t.touchData.starts);Ol&&(G.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=_s(t.touchData.startPosition)),t.swipePanning?(ce.panBy({x:X[0]*ke,y:X[1]*ke}),ce.emit(Ke("dragpan"))):ut&&(t.swipePanning=!0,ce.panBy({x:Ce*ke,y:mt*ke}),ce.emit(Ke("dragpan")),Qt&&(Qt.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var Ve=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);we[0]=Ve[0],we[1]=Ve[1]}}for(var ne=0;ne<we.length;ne++)Ie[ne]=we[ne];te&&G.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 et;t.registerBinding(e,"touchcancel",et=function(G){var te=t.touchData.start;t.touchData.capture=!1,te&&te.unactivate()});var ze,Ge,tt,ot;if(t.registerBinding(e,"touchend",ze=function(G){var te=t.touchData.start,fe=t.touchData.capture;if(fe)G.touches.length===0&&(t.touchData.capture=!1),G.preventDefault();else return;var ce=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var we=t.cy,Ie=we.zoom(),ke=t.touchData.now,Ve=t.touchData.earlier;if(G.touches[0]){var Ke=t.projectIntoViewport(G.touches[0].clientX,G.touches[0].clientY);ke[0]=Ke[0],ke[1]=Ke[1]}if(G.touches[1]){var Ke=t.projectIntoViewport(G.touches[1].clientX,G.touches[1].clientY);ke[2]=Ke[0],ke[3]=Ke[1]}if(G.touches[2]){var Ke=t.projectIntoViewport(G.touches[2].clientX,G.touches[2].clientY);ke[4]=Ke[0],ke[5]=Ke[1]}var Qe=function(Ft){return{originalEvent:G,type:Ft,position:{x:ke[0],y:ke[1]}}};te&&te.unactivate();var ut;if(t.touchData.cxt){if(ut=Qe("cxttapend"),te?te.emit(ut):we.emit(ut),!t.touchData.cxtDragged){var X=Qe("cxttap");te?te.emit(X):we.emit(X)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!G.touches[2]&&we.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var ne=we.collection(t.getAllInBox(ce[0],ce[1],ce[2],ce[3]));ce[0]=void 0,ce[1]=void 0,ce[2]=void 0,ce[3]=void 0,ce[4]=0,t.redrawHint("select",!0),we.emit(Qe("boxend"));var Ce=function(Ft){return Ft.selectable()&&!Ft.selected()};ne.emit(Qe("box")).stdFilter(Ce).select().emit(Qe("boxselect")),ne.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(te?.unactivate(),G.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!G.touches[1]){if(!G.touches[0]){if(!G.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Fe=t.dragData.touchDragEles;if(te!=null){var mt=te._private.grabbed;x(Fe),t.redrawHint("drag",!0),t.redrawHint("eles",!0),mt&&(te.emit(Qe("freeon")),Fe.emit(Qe("free")),t.dragData.didDrag&&(te.emit(Qe("dragfreeon")),Fe.emit(Qe("dragfree")))),i(te,["touchend","tapend","vmouseup","tapdragout"],G,{x:ke[0],y:ke[1]}),te.unactivate(),t.touchData.start=null}else{var ft=t.findNearestElement(ke[0],ke[1],!0,!0);i(ft,["touchend","tapend","vmouseup","tapdragout"],G,{x:ke[0],y:ke[1]})}var He=t.touchData.startPosition[0]-ke[0],Me=He*He,Ze=t.touchData.startPosition[1]-ke[1],Et=Ze*Ze,yt=Me+Et,Nn=yt*Ie*Ie;t.touchData.singleTouchMoved||(te||we.$(":selected").unselect(["tapunselect"]),i(te,["tap","vclick"],G,{x:ke[0],y:ke[1]}),Ge=!1,G.timeStamp-ot<=we.multiClickDebounceTime()?(tt&&clearTimeout(tt),Ge=!0,ot=null,i(te,["dbltap","vdblclick"],G,{x:ke[0],y:ke[1]})):(tt=setTimeout(function(){Ge||i(te,["onetap","voneclick"],G,{x:ke[0],y:ke[1]})},we.multiClickDebounceTime()),ot=G.timeStamp)),te!=null&&!t.dragData.didDrag&&te._private.selectable&&Nn<t.touchTapThreshold2&&!t.pinching&&(we.selectionType()==="single"?(we.$(n).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 Bt=0;Bt<ke.length;Bt++)Ve[Bt]=ke[Bt];t.dragData.didDrag=!1,G.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),G.touches.length<2&&(G.touches.length===1&&(t.touchData.startGPosition=[G.touches[0].clientX,G.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var Pe=[],pt=function(G){return{clientX:G.clientX,clientY:G.clientY,force:1,identifier:G.pointerId,pageX:G.pageX,pageY:G.pageY,radiusX:G.width/2,radiusY:G.height/2,screenX:G.screenX,screenY:G.screenY,target:G.target}},ue=function(G){return{event:G,touch:pt(G)}},Te=function(G){Pe.push(ue(G))},Oe=function(G){for(var te=0;te<Pe.length;te++){var fe=Pe[te];if(fe.event.pointerId===G.pointerId){Pe.splice(te,1);return}}},Xe=function(G){var te=Pe.filter(function(fe){return fe.event.pointerId===G.pointerId})[0];te.event=G,te.touch=pt(G)},Le=function(G){G.touches=Pe.map(function(te){return te.touch})},Ue=function(G){return G.pointerType==="mouse"||G.pointerType===4};t.registerBinding(t.container,"pointerdown",function(ye){Ue(ye)||(ye.preventDefault(),Te(ye),Le(ye),lt(ye))}),t.registerBinding(t.container,"pointerup",function(ye){Ue(ye)||(Oe(ye),Le(ye),ze(ye))}),t.registerBinding(t.container,"pointercancel",function(ye){Ue(ye)||(Oe(ye),Le(ye),et(ye))}),t.registerBinding(t.container,"pointermove",function(ye){Ue(ye)||(ye.preventDefault(),Xe(ye),Le(ye),We(ye))})}};var Za={};Za.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(r,i,l,s,u,f){this.renderer.nodeShapeImpl("polygon",r,i,l,s,u,this.points)},intersectLine:function(r,i,l,s,u,f,c,h){return hu(u,f,this.points,r,i,l/2,s/2,c)},checkPoint:function(r,i,l,s,u,f,c,h){return Xa(r,i,this.points,f,c,s,u,[0,-1],l)},hasMiterBounds:t!=="rectangle",miterBounds:function(r,i,l,s,u,f){return o2(this.points,r,i,l,s,u)}}};Za.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l)},intersectLine:function(e,n,r,i,l,s,u,f){return p2(l,s,e,n,r/2+u,i/2+u)},checkPoint:function(e,n,r,i,l,s,u,f){return xl(e,n,i,l,s,u,r)}}};Za.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(r,i,l,s,u,f,c){if(f[c]!==void 0&&f[c+"-cx"]===r&&f[c+"-cy"]===i)return f[c];f[c]=new Array(e.length/2),f[c+"-cx"]=r,f[c+"-cy"]=i;var h=l/2,v=s/2;u=u==="auto"?KS(l,s):u;for(var p=new Array(e.length/2),m=0;m<e.length/2;m++)p[m]={x:r+h*e[m*2],y:i+v*e[m*2+1]};var y,w,S,x,C=p.length;for(w=p[C-1],y=0;y<C;y++)S=p[y%C],x=p[(y+1)%C],f[c][y]=Dm(w,S,x,u),w=S,S=x;return f[c]},draw:function(r,i,l,s,u,f,c){this.renderer.nodeShapeImpl("round-polygon",r,i,l,s,u,this.points,this.getOrCreateCorners(i,l,s,u,f,c,"drawCorners"))},intersectLine:function(r,i,l,s,u,f,c,h,v){return y2(u,f,this.points,r,i,l,s,c,this.getOrCreateCorners(r,i,l,s,h,v,"corners"))},checkPoint:function(r,i,l,s,u,f,c,h,v){return g2(r,i,this.points,f,c,s,u,this.getOrCreateCorners(f,c,s,u,h,v,"corners"))}}};Za.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:pr(4,0),draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l,this.points,s)},intersectLine:function(e,n,r,i,l,s,u,f){return VS(l,s,e,n,r,i,u,f)},checkPoint:function(e,n,r,i,l,s,u,f){var c=i/2,h=l/2;f=f==="auto"?zi(i,l):f,f=Math.min(c,h,f);var v=f*2;return!!(Xa(e,n,this.points,s,u,i,l-v,[0,-1],r)||Xa(e,n,this.points,s,u,i-v,l,[0,-1],r)||xl(e,n,v,v,s-c+f,u-h+f,r)||xl(e,n,v,v,s+c-f,u-h+f,r)||xl(e,n,v,v,s+c-f,u+h-f,r)||xl(e,n,v,v,s-c+f,u+h-f,r))}}};Za.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:gm(),points:pr(4,0),draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l,null,s)},generateCutTrianglePts:function(e,n,r,i,l){var s=l==="auto"?this.cornerLength:l,u=n/2,f=e/2,c=r-f,h=r+f,v=i-u,p=i+u;return{topLeft:[c,v+s,c+s,v,c+s,v+s],topRight:[h-s,v,h,v+s,h-s,v+s],bottomRight:[h,p-s,h-s,p,h-s,p-s],bottomLeft:[c+s,p,c,p-s,c+s,p-s]}},intersectLine:function(e,n,r,i,l,s,u,f){var c=this.generateCutTrianglePts(r+2*u,i+2*u,e,n,f),h=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return hu(l,s,h,e,n)},checkPoint:function(e,n,r,i,l,s,u,f){var c=f==="auto"?this.cornerLength:f;if(Xa(e,n,this.points,s,u,i,l-2*c,[0,-1],r)||Xa(e,n,this.points,s,u,i-2*c,l,[0,-1],r))return!0;var h=this.generateCutTrianglePts(i,l,s,u);return Nr(e,n,h.topLeft)||Nr(e,n,h.topRight)||Nr(e,n,h.bottomRight)||Nr(e,n,h.bottomLeft)}}};Za.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:pr(4,0),draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l)},intersectLine:function(e,n,r,i,l,s,u,f){var c=.15,h=.5,v=.85,p=this.generateBarrelBezierPts(r+2*u,i+2*u,e,n),m=function(S){var x=Rs({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},c),C=Rs({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},h),T=Rs({x:S[0],y:S[1]},{x:S[2],y:S[3]},{x:S[4],y:S[5]},v);return[S[0],S[1],x.x,x.y,C.x,C.y,T.x,T.y,S[4],S[5]]},y=[].concat(m(p.topLeft),m(p.topRight),m(p.bottomRight),m(p.bottomLeft));return hu(l,s,y,e,n)},generateBarrelBezierPts:function(e,n,r,i){var l=n/2,s=e/2,u=r-s,f=r+s,c=i-l,h=i+l,v=_p(e,n),p=v.heightOffset,m=v.widthOffset,y=v.ctrlPtOffsetPct*e,w={topLeft:[u,c+p,u+y,c,u+m,c],topRight:[f-m,c,f-y,c,f,c+p],bottomRight:[f,h-p,f-y,h,f-m,h],bottomLeft:[u+m,h,u+y,h,u,h-p]};return w.topLeft.isTop=!0,w.topRight.isTop=!0,w.bottomLeft.isBottom=!0,w.bottomRight.isBottom=!0,w},checkPoint:function(e,n,r,i,l,s,u,f){var c=_p(i,l),h=c.heightOffset,v=c.widthOffset;if(Xa(e,n,this.points,s,u,i,l-2*h,[0,-1],r)||Xa(e,n,this.points,s,u,i-2*v,l,[0,-1],r))return!0;for(var p=this.generateBarrelBezierPts(i,l,s,u),m=function(O,L,M){var z=M[4],B=M[2],U=M[0],V=M[5],$=M[1],q=Math.min(z,U),H=Math.max(z,U),Y=Math.min(V,$),Q=Math.max(V,$);if(q<=O&&O<=H&&Y<=L&&L<=Q){var P=b2(z,B,U),I=f2(P[0],P[1],P[2],O),K=I.filter(function(F){return 0<=F&&F<=1});if(K.length>0)return K[0]}return null},y=Object.keys(p),w=0;w<y.length;w++){var S=y[w],x=p[S],C=m(e,n,x);if(C!=null){var T=x[5],A=x[3],N=x[1],k=Kn(T,A,N,C);if(x.isTop&&k<=n||x.isBottom&&n<=k)return!0}}return!1}}};Za.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:pr(4,0),draw:function(e,n,r,i,l,s){this.renderer.nodeShapeImpl(this.name,e,n,r,i,l,this.points,s)},intersectLine:function(e,n,r,i,l,s,u,f){var c=e-(r/2+u),h=n-(i/2+u),v=h,p=e+(r/2+u),m=Oi(l,s,e,n,c,h,p,v,!1);return m.length>0?m:VS(l,s,e,n,r,i,u,f)},checkPoint:function(e,n,r,i,l,s,u,f){f=f==="auto"?zi(i,l):f;var c=2*f;if(Xa(e,n,this.points,s,u,i,l-c,[0,-1],r)||Xa(e,n,this.points,s,u,i-c,l,[0,-1],r))return!0;var h=i/2+2*r,v=l/2+2*r,p=[s-h,u-v,s-h,u,s+h,u,s+h,u-v];return!!(Nr(e,n,p)||xl(e,n,c,c,s+i/2-f,u+l/2-f,r)||xl(e,n,c,c,s-i/2+f,u+l/2-f,r))}}};Za.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",pr(3,0)),this.generateRoundPolygon("round-triangle",pr(3,0)),this.generatePolygon("rectangle",pr(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",pr(5,0)),this.generateRoundPolygon("round-pentagon",pr(5,0)),this.generatePolygon("hexagon",pr(6,0)),this.generateRoundPolygon("round-hexagon",pr(6,0)),this.generatePolygon("heptagon",pr(7,0)),this.generateRoundPolygon("round-heptagon",pr(7,0)),this.generatePolygon("octagon",pr(8,0)),this.generateRoundPolygon("round-octagon",pr(8,0));var r=new Array(20);{var i=Ap(5,0),l=Ap(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var u=0;u<l.length/2;u++)l[u*2]*=s,l[u*2+1]*=s;for(var u=0;u<20/4;u++)r[u*4]=i[u*2],r[u*4+1]=i[u*2+1],r[u*4+2]=l[u*2],r[u*4+3]=l[u*2+1]}r=$S(r),this.generatePolygon("star",r),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 f=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",f),this.generateRoundPolygon("round-tag",f)}t.makePolygon=function(c){var h=c.join("$"),v="polygon-"+h,p;return(p=this[v])?p:e.generatePolygon(v,c)}};var Mu={};Mu.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Mu.redraw=function(t){t=t||qS();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};Mu.beforeRender=function(t,e){if(!this.destroyed){e==null&&mn("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:t,priority:e}),n.sort(function(r,i){return i.priority-r.priority})}};var Q1=function(e,n,r){for(var i=e.beforeRenderCallbacks,l=0;l<i.length;l++)i[l].fn(n,r)};Mu.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var n=function(i){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){Q1(t,!0,i);var l=Ya();t.render(t.renderOptions);var s=t.lastDrawTime=Ya();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-l),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var u=s-l;t.redrawTotalTime+=u,t.lastRedrawTime=u,t.averageRedrawTime=t.averageRedrawTime/2+u/2,t.requestedFrame=!1}else Q1(t,!1,i);t.skipFrame=!1,Lf(n)}};Lf(n)}};var LO=function(e){this.init(e)},KC=LO,Vs=KC.prototype;Vs.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Vs.init=function(t){var e=this;e.options=t,e.cy=t.cy;var n=e.container=t.cy.container(),r=e.cy.window();if(r){var i=r.document,l=i.head,s="__________cytoscape_stylesheet",u="__________cytoscape_container",f=i.getElementById(s)!=null;if(n.className.indexOf(u)<0&&(n.className=(n.className||"")+" "+u),!f){var c=i.createElement("style");c.id=s,c.textContent="."+u+" { position: relative; }",l.insertBefore(c,l.children[0])}var h=r.getComputedStyle(n),v=h.getPropertyValue("position");v==="static"&&Kt("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=je(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()};Vs.notify=function(t,e){var n=this,r=n.cy;if(!this.destroyed){if(t==="init"){n.load();return}if(t==="destroy"){n.destroy();return}(t==="add"||t==="remove"||t==="move"&&r.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&n.invalidateCachedZSortedEles(),t==="viewport"&&n.redrawHint("select",!0),t==="gc"&&n.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Vs.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var n=t.bindings[e],r=n,i=r.target;(i.off||i.removeEventListener).apply(i,r.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{}};Vs.isHeadless=function(){return!1};[Tm,VC,$C,Gs,Za,Mu].forEach(function(t){ht(Vs,t)});var Qg=1e3/60,YC={setupDequeueing:function(e){return function(){var r=this,i=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var l=Au(function(){i.redrawHint("eles",!0),i.redrawHint("drag",!0),i.redraw()},e.deqRedrawThreshold),s=function(c,h){var v=Ya(),p=i.averageRedrawTime,m=i.lastRedrawTime,y=[],w=i.cy.extent(),S=i.getPixelRatio();for(c||i.flushRenderedStyleQueue();;){var x=Ya(),C=x-v,T=x-h;if(m<Qg){var A=Qg-(c?p:0);if(T>=e.deqFastCost*A)break}else if(c){if(C>=e.deqCost*m||C>=e.deqAvgCost*p)break}else if(T>=e.deqNoDrawCost*Qg)break;var N=e.deq(r,S,w);if(N.length>0)for(var k=0;k<N.length;k++)y.push(N[k]);else break}y.length>0&&(e.onDeqd(r,y),!c&&e.shouldRedraw(r,y,S,w)&&l())},u=e.priority||cm;i.beforeRender(s,u(r))}}}},FO=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ff;Hi(this,t),this.idsByKey=new Ka,this.keyForId=new Ka,this.cachesByLvl=new Ka,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=n}return ji(t,[{key:"getIdsFor",value:function(n){n==null&&mn("Can not get id list for null key");var r=this.idsByKey,i=this.idsByKey.get(n);return i||(i=new Us,r.set(n,i)),i}},{key:"addIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).add(r)}},{key:"deleteIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).delete(r)}},{key:"getNumberOfIdsForKey",value:function(n){return n==null?0:this.getIdsFor(n).size}},{key:"updateKeyMappingFor",value:function(n){var r=n.id(),i=this.keyForId.get(r),l=this.getKey(n);this.deleteIdForKey(i,r),this.addIdForKey(l,r),this.keyForId.set(r,l)}},{key:"deleteKeyMappingFor",value:function(n){var r=n.id(),i=this.keyForId.get(r);this.deleteIdForKey(i,r),this.keyForId.delete(r)}},{key:"keyHasChangedFor",value:function(n){var r=n.id(),i=this.keyForId.get(r),l=this.getKey(n);return i!==l}},{key:"isInvalid",value:function(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function(n){var r=this.cachesByLvl,i=this.lvls,l=r.get(n);return l||(l=new Ka,r.set(n,l),i.push(n)),l}},{key:"getCache",value:function(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function(n,r){var i=this.getKey(n),l=this.getCache(i,r);return l!=null&&this.updateKeyMappingFor(n),l}},{key:"getForCachedKey",value:function(n,r){var i=this.keyForId.get(n.id()),l=this.getCache(i,r);return l}},{key:"hasCache",value:function(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function(n,r){var i=this.getKey(n);return this.hasCache(i,r)}},{key:"setCache",value:function(n,r,i){i.key=n,this.getCachesAt(r).set(n,i)}},{key:"set",value:function(n,r,i){var l=this.getKey(n);this.setCache(l,r,i),this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function(n,r){this.getCachesAt(r).delete(n)}},{key:"delete",value:function(n,r){var i=this.getKey(n);this.deleteCache(i,r)}},{key:"invalidateKey",value:function(n){var r=this;this.lvls.forEach(function(i){return r.deleteCache(n,i)})}},{key:"invalidate",value:function(n){var r=n.id(),i=this.keyForId.get(r);this.deleteKeyMappingFor(n);var l=this.doesEleInvalidateKey(n);return l&&this.invalidateKey(i),l||this.getNumberOfIdsForKey(i)===0}}])})(),W1=25,uf=50,Nf=-4,qp=3,XC=7.99,IO=8,zO=1024,PO=1024,UO=1024,qO=.2,HO=.8,jO=10,GO=.15,VO=.1,$O=.9,KO=.9,YO=100,XO=1,Ns={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ZO=ir({getKey:null,doesEleInvalidateKey:Ff,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:zS,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),nu=function(e,n){var r=this;r.renderer=e,r.onDequeues=[];var i=ZO(n);ht(r,i),r.lookup=new FO(i.getKey,i.doesEleInvalidateKey),r.setupDequeueing()},jn=nu.prototype;jn.reasons=Ns;jn.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};jn.getRetiredTextureQueue=function(t){var e=this,n=e.eleImgCaches.retired=e.eleImgCaches.retired||{},r=n[t]=n[t]||[];return r};jn.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new _u(function(n,r){return r.reqs-n.reqs});return e};jn.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};jn.getElement=function(t,e,n,r,i){var l=this,s=this.renderer,u=s.cy.zoom(),f=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!l.allowEdgeTxrCaching&&t.isEdge()||!l.allowParentTxrCaching&&t.isParent())return null;if(r==null&&(r=Math.ceil(dm(u*n))),r<Nf)r=Nf;else if(u>=XC||r>qp)return null;var c=Math.pow(2,r),h=e.h*c,v=e.w*c,p=s.eleTextBiggerThanMin(t,c);if(!this.isVisible(t,p))return null;var m=f.get(t,r);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var y;if(h<=W1?y=W1:h<=uf?y=uf:y=Math.ceil(h/uf)*uf,h>UO||v>PO)return null;var w=l.getTextureQueue(y),S=w[w.length-2],x=function(){return l.recycleTexture(y,v)||l.addTexture(y,v)};S||(S=w[w.length-1]),S||(S=x()),S.width-S.usedWidth<v&&(S=x());for(var C=function(q){return q&&q.scaledLabelShown===p},T=i&&i===Ns.dequeue,A=i&&i===Ns.highQuality,N=i&&i===Ns.downscale,k,D=r+1;D<=qp;D++){var O=f.get(t,D);if(O){k=O;break}}var L=k&&k.level===r+1?k:null,M=function(){S.context.drawImage(L.texture.canvas,L.x,0,L.width,L.height,S.usedWidth,0,v,h)};if(S.context.setTransform(1,0,0,1,0,0),S.context.clearRect(S.usedWidth,0,v,y),C(L))M();else if(C(k))if(A){for(var z=k.level;z>r;z--)L=l.getElement(t,e,n,z,Ns.downscale);M()}else return l.queueElement(t,k.level-1),k;else{var B;if(!T&&!A&&!N)for(var U=r-1;U>=Nf;U--){var V=f.get(t,U);if(V){B=V;break}}if(C(B))return l.queueElement(t,r),B;S.context.translate(S.usedWidth,0),S.context.scale(c,c),this.drawElement(S.context,t,e,p,!1),S.context.scale(1/c,1/c),S.context.translate(-S.usedWidth,0)}return m={x:S.usedWidth,texture:S,level:r,scale:c,width:v,height:h,scaledLabelShown:p},S.usedWidth+=Math.ceil(v+IO),S.eleCaches.push(m),f.set(t,r,m),l.checkTextureFullness(S),m};jn.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};jn.invalidateElement=function(t){var e=this,n=e.lookup,r=[],i=n.isInvalid(t);if(i){for(var l=Nf;l<=qp;l++){var s=n.getForCachedKey(t,l);s&&r.push(s)}var u=n.invalidate(t);if(u)for(var f=0;f<r.length;f++){var c=r[f],h=c.texture;h.invalidatedWidth+=c.width,c.invalidated=!0,e.checkTextureUtility(h)}e.removeFromQueue(t)}};jn.checkTextureUtility=function(t){t.invalidatedWidth>=qO*t.width&&this.retireTexture(t)};jn.checkTextureFullness=function(t){var e=this,n=e.getTextureQueue(t.height);t.usedWidth/t.width>HO&&t.fullnessChecks>=jO?Ii(n,t):t.fullnessChecks++};jn.retireTexture=function(t){var e=this,n=t.height,r=e.getTextureQueue(n),i=this.lookup;Ii(r,t),t.retired=!0;for(var l=t.eleCaches,s=0;s<l.length;s++){var u=l[s];i.deleteCache(u.key,u.level)}fm(l);var f=e.getRetiredTextureQueue(n);f.push(t)};jn.addTexture=function(t,e){var n=this,r=n.getTextureQueue(t),i={};return r.push(i),i.eleCaches=[],i.height=t,i.width=Math.max(zO,e),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=n.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext("2d"),i};jn.recycleTexture=function(t,e){for(var n=this,r=n.getTextureQueue(t),i=n.getRetiredTextureQueue(t),l=0;l<i.length;l++){var s=i[l];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,fm(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Ii(i,s),r.push(s),s}};jn.queueElement=function(t,e){var n=this,r=n.getElementQueue(),i=n.getElementKeyToQueue(),l=this.getKey(t),s=i[l];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,r.updateItem(s);else{var u={eles:t.spawn().merge(t),level:e,reqs:1,key:l};r.push(u),i[l]=u}};jn.dequeue=function(t){for(var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),i=[],l=e.lookup,s=0;s<XO&&n.size()>0;s++){var u=n.pop(),f=u.key,c=u.eles[0],h=l.hasCache(c,u.level);if(r[f]=null,h)continue;i.push(u);var v=e.getBoundingBox(c);e.getElement(c,v,t,u.level,Ns.dequeue)}return i};jn.removeFromQueue=function(t){var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),i=this.getKey(t),l=r[i];l!=null&&(l.eles.length===1?(l.reqs=um,n.updateItem(l),n.pop(),r[i]=null):l.eles.unmerge(t))};jn.onDequeue=function(t){this.onDequeues.push(t)};jn.offDequeue=function(t){Ii(this.onDequeues,t)};jn.setupDequeueing=YC.setupDequeueing({deqRedrawThreshold:YO,deqCost:GO,deqAvgCost:VO,deqNoDrawCost:$O,deqFastCost:KO,deq:function(e,n,r){return e.dequeue(n,r)},onDeqd:function(e,n){for(var r=0;r<e.onDequeues.length;r++){var i=e.onDequeues[r];i(n)}},shouldRedraw:function(e,n,r,i){for(var l=0;l<n.length;l++)for(var s=n[l].eles,u=0;u<s.length;u++){var f=s[u].boundingBox();if(vm(f,i))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var QO=1,au=-4,Gf=2,WO=3.99,JO=50,eB=50,tB=.15,nB=.1,rB=.9,aB=.9,iB=1,J1=250,lB=4e3*4e3,ew=32767,sB=!0,ZC=function(e){var n=this,r=n.renderer=e,i=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=Ya()-2*J1,n.skipping=!1,n.eleTxrDeqs=i.collection(),n.scheduleElementRefinement=Au(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},eB),r.beforeRender(function(s,u){u-n.lastInvalidationTime<=J1?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var l=function(u,f){return f.reqs-u.reqs};n.layersQueue=new _u(l),n.setupDequeueing()},lr=ZC.prototype,tw=0,oB=Math.pow(2,53)-1;lr.makeLayer=function(t,e){var n=Math.pow(2,e),r=Math.ceil(t.w*n),i=Math.ceil(t.h*n),l=this.renderer.makeOffscreenCanvas(r,i),s={id:tw=++tw%oB,bb:t,level:e,width:r,height:i,canvas:l,context:l.getContext("2d"),eles:[],elesQueue:[],reqs:0},u=s.context,f=-s.bb.x1,c=-s.bb.y1;return u.scale(n,n),u.translate(f,c),s};lr.getLayers=function(t,e,n){var r=this,i=r.renderer,l=i.cy,s=l.zoom(),u=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(dm(s*e)),n<au)n=au;else if(s>=WO||n>Gf)return null}r.validateLayersElesOrdering(n,t);var f=r.layersByLevel,c=Math.pow(2,n),h=f[n]=f[n]||[],v,p=r.levelIsComplete(n,t),m,y=function(){var M=function($){if(r.validateLayersElesOrdering($,t),r.levelIsComplete($,t))return m=f[$],!0},z=function($){if(!m)for(var q=n+$;au<=q&&q<=Gf&&!M(q);q+=$);};z(1),z(-1);for(var B=h.length-1;B>=0;B--){var U=h[B];U.invalid&&Ii(h,U)}};if(!p)y();else return h;var w=function(){if(!v){v=br();for(var M=0;M<t.length;M++)i2(v,t[M].boundingBox())}return v},S=function(M){M=M||{};var z=M.after;w();var B=Math.ceil(v.w*c),U=Math.ceil(v.h*c);if(B>ew||U>ew)return null;var V=B*U;if(V>lB)return null;var $=r.makeLayer(v,n);if(z!=null){var q=h.indexOf(z)+1;h.splice(q,0,$)}else(M.insert===void 0||M.insert)&&h.unshift($);return $};if(r.skipping&&!u)return null;for(var x=null,C=t.length/QO,T=!u,A=0;A<t.length;A++){var N=t[A],k=N._private.rscratch,D=k.imgLayerCaches=k.imgLayerCaches||{},O=D[n];if(O){x=O;continue}if((!x||x.eles.length>=C||!GS(x.bb,N.boundingBox()))&&(x=S({insert:!0,after:x}),!x))return null;m||T?r.queueLayer(x,N):r.drawEleInLayer(x,N,n,e),x.eles.push(N),D[n]=x}return m||(T?null:h)};lr.getEleLevelForLayerLevel=function(t,e){return t};lr.drawEleInLayer=function(t,e,n,r){var i=this,l=this.renderer,s=t.context,u=e.boundingBox();u.w===0||u.h===0||!e.visible()||(n=i.getEleLevelForLayerLevel(n,r),l.setImgSmoothing(s,!1),l.drawCachedElement(s,e,null,null,n,sB),l.setImgSmoothing(s,!0))};lr.levelIsComplete=function(t,e){var n=this,r=n.layersByLevel[t];if(!r||r.length===0)return!1;for(var i=0,l=0;l<r.length;l++){var s=r[l];if(s.reqs>0||s.invalid)return!1;i+=s.eles.length}return i===e.length};lr.validateLayersElesOrdering=function(t,e){var n=this.layersByLevel[t];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],l=-1,s=0;s<e.length;s++)if(i.eles[0]===e[s]){l=s;break}if(l<0){this.invalidateLayer(i);continue}for(var u=l,s=0;s<i.eles.length;s++)if(i.eles[s]!==e[u+s]){this.invalidateLayer(i);break}}};lr.updateElementsInLayers=function(t,e){for(var n=this,r=Su(t[0]),i=0;i<t.length;i++)for(var l=r?null:t[i],s=r?t[i]:t[i].ele,u=s._private.rscratch,f=u.imgLayerCaches=u.imgLayerCaches||{},c=au;c<=Gf;c++){var h=f[c];h&&(l&&n.getEleLevelForLayerLevel(h.level)!==l.level||e(h,s,l))}};lr.haveLayers=function(){for(var t=this,e=!1,n=au;n<=Gf;n++){var r=t.layersByLevel[n];if(r&&r.length>0){e=!0;break}}return e};lr.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Ya(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(r,i,l){e.invalidateLayer(r)}))};lr.invalidateLayer=function(t){if(this.lastInvalidationTime=Ya(),!t.invalid){var e=t.level,n=t.eles,r=this.layersByLevel[e];Ii(r,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i<n.length;i++){var l=n[i]._private.rscratch.imgLayerCaches;l&&(l[e]=null)}}};lr.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(r,i,l){var s=r.replacement;if(s||(s=r.replacement=e.makeLayer(r.bb,r.level),s.replaces=r,s.eles=r.eles),!s.reqs)for(var u=0;u<s.eles.length;u++)e.queueLayer(s,s.eles[u])})};lr.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};lr.queueLayer=function(t,e){var n=this,r=n.layersQueue,i=t.elesQueue,l=i.hasId=i.hasId||{};if(!t.replacement){if(e){if(l[e.id()])return;i.push(e),l[e.id()]=!0}t.reqs?(t.reqs++,r.updateItem(t)):(t.reqs=1,r.push(t))}};lr.dequeue=function(t){for(var e=this,n=e.layersQueue,r=[],i=0;i<iB&&n.size()!==0;){var l=n.peek();if(l.replacement){n.pop();continue}if(l.replaces&&l!==l.replaces.replacement){n.pop();continue}if(l.invalid){n.pop();continue}var s=l.elesQueue.shift();s&&(e.drawEleInLayer(l,s,l.level,t),i++),r.length===0&&r.push(!0),l.elesQueue.length===0&&(n.pop(),l.reqs=0,l.replaces&&e.applyLayerReplacement(l),e.requestRedraw())}return r};lr.applyLayerReplacement=function(t){var e=this,n=e.layersByLevel[t.level],r=t.replaces,i=n.indexOf(r);if(!(i<0||r.invalid)){n[i]=t;for(var l=0;l<t.eles.length;l++){var s=t.eles[l]._private,u=s.imgLayerCaches=s.imgLayerCaches||{};u&&(u[t.level]=t)}e.requestRedraw()}};lr.requestRedraw=Au(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);lr.setupDequeueing=YC.setupDequeueing({deqRedrawThreshold:JO,deqCost:tB,deqAvgCost:nB,deqNoDrawCost:rB,deqFastCost:aB,deq:function(e,n){return e.dequeue(n)},onDeqd:cm,shouldRedraw:zS,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var QC={},nw;function uB(t,e){for(var n=0;n<e.length;n++){var r=e[n];t.lineTo(r.x,r.y)}}function cB(t,e,n){for(var r,i=0;i<e.length;i++){var l=e[i];i===0&&(r=l),t.lineTo(l.x,l.y)}t.quadraticCurveTo(n.x,n.y,r.x,r.y)}function rw(t,e,n){t.beginPath&&t.beginPath();for(var r=e,i=0;i<r.length;i++){var l=r[i];t.lineTo(l.x,l.y)}var s=n,u=n[0];t.moveTo(u.x,u.y);for(var i=1;i<s.length;i++){var l=s[i];t.lineTo(l.x,l.y)}t.closePath&&t.closePath()}function fB(t,e,n,r,i){t.beginPath&&t.beginPath(),t.arc(n,r,i,0,Math.PI*2,!1);var l=e,s=l[0];t.moveTo(s.x,s.y);for(var u=0;u<l.length;u++){var f=l[u];t.lineTo(f.x,f.y)}t.closePath&&t.closePath()}function dB(t,e,n,r){t.arc(e,n,r,0,Math.PI*2,!1)}QC.arrowShapeImpl=function(t){return(nw||(nw={polygon:uB,"triangle-backcurve":cB,"triangle-tee":rw,"circle-triangle":fB,"triangle-cross":rw,circle:dB}))[t]};var Da={};Da.drawElement=function(t,e,n,r,i,l){var s=this;e.isNode()?s.drawNode(t,e,n,r,i,l):s.drawEdge(t,e,n,r,i,l)};Da.drawElementOverlay=function(t,e){var n=this;e.isNode()?n.drawNodeOverlay(t,e):n.drawEdgeOverlay(t,e)};Da.drawElementUnderlay=function(t,e){var n=this;e.isNode()?n.drawNodeUnderlay(t,e):n.drawEdgeUnderlay(t,e)};Da.drawCachedElementPortion=function(t,e,n,r,i,l,s,u){var f=this,c=n.getBoundingBox(e);if(!(c.w===0||c.h===0)){var h=n.getElement(e,c,r,i,l);if(h!=null){var v=u(f,e);if(v===0)return;var p=s(f,e),m=c.x1,y=c.y1,w=c.w,S=c.h,x,C,T,A,N;if(p!==0){var k=n.getRotationPoint(e);T=k.x,A=k.y,t.translate(T,A),t.rotate(p),N=f.getImgSmoothing(t),N||f.setImgSmoothing(t,!0);var D=n.getRotationOffset(e);x=D.x,C=D.y}else x=m,C=y;var O;v!==1&&(O=t.globalAlpha,t.globalAlpha=O*v),t.drawImage(h.texture.canvas,h.x,0,h.width,h.height,x,C,w,S),v!==1&&(t.globalAlpha=O),p!==0&&(t.rotate(-p),t.translate(-T,-A),N||f.setImgSmoothing(t,!1))}else n.drawElement(t,e)}};var hB=function(){return 0},vB=function(e,n){return e.getTextAngle(n,null)},gB=function(e,n){return e.getTextAngle(n,"source")},pB=function(e,n){return e.getTextAngle(n,"target")},mB=function(e,n){return n.effectiveOpacity()},Wg=function(e,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};Da.drawCachedElement=function(t,e,n,r,i,l){var s=this,u=s.data,f=u.eleTxrCache,c=u.lblTxrCache,h=u.slbTxrCache,v=u.tlbTxrCache,p=e.boundingBox(),m=l===!0?f.reasons.highQuality:null;if(!(p.w===0||p.h===0||!e.visible())&&(!r||vm(p,r))){var y=e.isEdge(),w=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,f,n,i,m,hB,mB),(!y||!w)&&s.drawCachedElementPortion(t,e,c,n,i,m,vB,Wg),y&&!w&&(s.drawCachedElementPortion(t,e,h,n,i,m,gB,Wg),s.drawCachedElementPortion(t,e,v,n,i,m,pB,Wg)),s.drawElementOverlay(t,e)}};Da.drawElements=function(t,e){for(var n=this,r=0;r<e.length;r++){var i=e[r];n.drawElement(t,i)}};Da.drawCachedElements=function(t,e,n,r){for(var i=this,l=0;l<e.length;l++){var s=e[l];i.drawCachedElement(t,s,n,r)}};Da.drawCachedNodes=function(t,e,n,r){for(var i=this,l=0;l<e.length;l++){var s=e[l];s.isNode()&&i.drawCachedElement(t,s,n,r)}};Da.drawLayeredElements=function(t,e,n,r){var i=this,l=i.data.lyrTxrCache.getLayers(e,n);if(l)for(var s=0;s<l.length;s++){var u=l[s],f=u.bb;f.w===0||f.h===0||t.drawImage(u.canvas,f.x1,f.y1,f.w,f.h)}else i.drawCachedElements(t,e,n,r)};var Qa={};Qa.drawEdge=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,u=e._private.rscratch;if(!(l&&!e.visible())&&!(u.badLine||u.allpts==null||isNaN(u.allpts[0]))){var f;n&&(f=n,t.translate(-f.x1,-f.y1));var c=l?e.pstyle("opacity").value:1,h=l?e.pstyle("line-opacity").value:1,v=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,m=e.pstyle("width").pfValue,y=e.pstyle("line-cap").value,w=e.pstyle("line-outline-width").value,S=e.pstyle("line-outline-color").value,x=c*h,C=c*h,T=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;v==="straight-triangle"?(s.eleStrokeStyle(t,e,$),s.drawEdgeTrianglePath(e,t,u.allpts)):(t.lineWidth=m,t.lineCap=y,s.eleStrokeStyle(t,e,$),s.drawEdgePath(e,t,u.allpts,p),t.lineCap="butt")},A=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x;if(t.lineWidth=m+w,t.lineCap=y,w>0)s.colorStrokeStyle(t,S[0],S[1],S[2],$);else{t.lineCap="butt";return}v==="straight-triangle"?s.drawEdgeTrianglePath(e,t,u.allpts):(s.drawEdgePath(e,t,u.allpts,p),t.lineCap="butt")},N=function(){i&&s.drawEdgeOverlay(t,e)},k=function(){i&&s.drawEdgeUnderlay(t,e)},D=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C;s.drawArrowheads(t,e,$)},O=function(){s.drawElementText(t,e,null,r)};t.lineJoin="round";var L=e.pstyle("ghost").value==="yes";if(L){var M=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue,B=e.pstyle("ghost-opacity").value,U=x*B;t.translate(M,z),T(U),D(U),t.translate(-M,-z)}else A();k(),T(),D(),N(),O(),n&&t.translate(f.x1,f.y1)}};var WC=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r){if(r.visible()){var i=r.pstyle("".concat(e,"-opacity")).value;if(i!==0){var l=this,s=l.usePaths(),u=r._private.rscratch,f=r.pstyle("".concat(e,"-padding")).pfValue,c=2*f,h=r.pstyle("".concat(e,"-color")).value;n.lineWidth=c,u.edgeType==="self"&&!s?n.lineCap="butt":n.lineCap="round",l.colorStrokeStyle(n,h[0],h[1],h[2],i),l.drawEdgePath(r,n,u.allpts,"solid")}}}};Qa.drawEdgeOverlay=WC("overlay");Qa.drawEdgeUnderlay=WC("underlay");Qa.drawEdgePath=function(t,e,n,r){var i=t._private.rscratch,l=e,s,u=!1,f=this.usePaths(),c=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(f){var v=n.join("$"),p=i.pathCacheKey&&i.pathCacheKey===v;p?(s=e=i.pathCache,u=!0):(s=e=new Path2D,i.pathCacheKey=v,i.pathCache=s)}if(l.setLineDash)switch(r){case"dotted":l.setLineDash([1,1]);break;case"dashed":l.setLineDash(c),l.lineDashOffset=h;break;case"solid":l.setLineDash([]);break}if(!u&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(n[0],n[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+3<n.length;m+=4)e.quadraticCurveTo(n[m],n[m+1],n[m+2],n[m+3]);break;case"straight":case"haystack":for(var y=2;y+1<n.length;y+=2)e.lineTo(n[y],n[y+1]);break;case"segments":if(i.isRound){var w=Rr(i.roundCorners),S;try{for(w.s();!(S=w.n()).done;){var x=S.value;UC(e,x)}}catch(T){w.e(T)}finally{w.f()}e.lineTo(n[n.length-2],n[n.length-1])}else for(var C=2;C+1<n.length;C+=2)e.lineTo(n[C],n[C+1]);break}e=l,f?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};Qa.drawEdgeTrianglePath=function(t,e,n){e.fillStyle=e.strokeStyle;for(var r=t.pstyle("width").pfValue,i=0;i+1<n.length;i+=2){var l=[n[i+2]-n[i],n[i+3]-n[i+1]],s=Math.sqrt(l[0]*l[0]+l[1]*l[1]),u=[l[1]/s,-l[0]/s],f=[u[0]*r/2,u[1]*r/2];e.beginPath(),e.moveTo(n[i]-f[0],n[i+1]-f[1]),e.lineTo(n[i]+f[0],n[i+1]+f[1]),e.lineTo(n[i+2],n[i+3]),e.closePath(),e.fill()}};Qa.drawArrowheads=function(t,e,n){var r=e._private.rscratch,i=r.edgeType==="haystack";i||this.drawArrowhead(t,e,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(t,e,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(t,e,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(t,e,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)};Qa.drawArrowhead=function(t,e,n,r,i,l,s){if(!(isNaN(r)||r==null||isNaN(i)||i==null||isNaN(l)||l==null)){var u=this,f=e.pstyle(n+"-arrow-shape").value;if(f!=="none"){var c=e.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",h=e.pstyle(n+"-arrow-fill").value,v=e.pstyle("width").pfValue,p=e.pstyle(n+"-arrow-width"),m=p.value==="match-line"?v:p.pfValue;p.units==="%"&&(m*=v);var y=e.pstyle("opacity").value;s===void 0&&(s=y);var w=t.globalCompositeOperation;(s!==1||h==="hollow")&&(t.globalCompositeOperation="destination-out",u.colorFillStyle(t,255,255,255,1),u.colorStrokeStyle(t,255,255,255,1),u.drawArrowShape(e,t,c,v,f,m,r,i,l),t.globalCompositeOperation=w);var S=e.pstyle(n+"-arrow-color").value;u.colorFillStyle(t,S[0],S[1],S[2],s),u.colorStrokeStyle(t,S[0],S[1],S[2],s),u.drawArrowShape(e,t,h,v,f,m,r,i,l)}}};Qa.drawArrowShape=function(t,e,n,r,i,l,s,u,f){var c=this,h=this.usePaths()&&i!=="triangle-cross",v=!1,p,m=e,y={x:s,y:u},w=t.pstyle("arrow-scale").value,S=this.getArrowWidth(r,w),x=c.arrowShapes[i];if(h){var C=c.arrowPathCache=c.arrowPathCache||[],T=wl(i),A=C[T];A!=null?(p=e=A,v=!0):(p=e=new Path2D,C[T]=p)}v||(e.beginPath&&e.beginPath(),h?x.draw(e,1,0,{x:0,y:0},1):x.draw(e,S,f,y,r),e.closePath&&e.closePath()),e=m,h&&(e.translate(s,u),e.rotate(f),e.scale(S,S)),(n==="filled"||n==="both")&&(h?e.fill(p):e.fill()),(n==="hollow"||n==="both")&&(e.lineWidth=l/(h?S:1),e.lineJoin="miter",h?e.stroke(p):e.stroke()),h&&(e.scale(1/S,1/S),e.rotate(-f),e.translate(-s,-u))};var _m={};_m.safeDrawImage=function(t,e,n,r,i,l,s,u,f,c){if(!(i<=0||l<=0||f<=0||c<=0))try{t.drawImage(e,n,r,i,l,s,u,f,c)}catch(h){Kt(h)}};_m.drawInscribedImage=function(t,e,n,r,i){var l=this,s=n.position(),u=s.x,f=s.y,c=n.cy().style(),h=c.getIndexedStyle.bind(c),v=h(n,"background-fit","value",r),p=h(n,"background-repeat","value",r),m=n.width(),y=n.height(),w=n.padding()*2,S=m+(h(n,"background-width-relative-to","value",r)==="inner"?0:w),x=y+(h(n,"background-height-relative-to","value",r)==="inner"?0:w),C=n._private.rscratch,T=h(n,"background-clip","value",r),A=T==="node",N=h(n,"background-image-opacity","value",r)*i,k=h(n,"background-image-smoothing","value",r),D=n.pstyle("corner-radius").value;D!=="auto"&&(D=n.pstyle("corner-radius").pfValue);var O=e.width||e.cachedW,L=e.height||e.cachedH;(O==null||L==null)&&(document.body.appendChild(e),O=e.cachedW=e.width||e.offsetWidth,L=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var M=O,z=L;if(h(n,"background-width","value",r)!=="auto"&&(h(n,"background-width","units",r)==="%"?M=h(n,"background-width","pfValue",r)*S:M=h(n,"background-width","pfValue",r)),h(n,"background-height","value",r)!=="auto"&&(h(n,"background-height","units",r)==="%"?z=h(n,"background-height","pfValue",r)*x:z=h(n,"background-height","pfValue",r)),!(M===0||z===0)){if(v==="contain"){var B=Math.min(S/M,x/z);M*=B,z*=B}else if(v==="cover"){var B=Math.max(S/M,x/z);M*=B,z*=B}var U=u-S/2,V=h(n,"background-position-x","units",r),$=h(n,"background-position-x","pfValue",r);V==="%"?U+=(S-M)*$:U+=$;var q=h(n,"background-offset-x","units",r),H=h(n,"background-offset-x","pfValue",r);q==="%"?U+=(S-M)*H:U+=H;var Y=f-x/2,Q=h(n,"background-position-y","units",r),P=h(n,"background-position-y","pfValue",r);Q==="%"?Y+=(x-z)*P:Y+=P;var I=h(n,"background-offset-y","units",r),K=h(n,"background-offset-y","pfValue",r);I==="%"?Y+=(x-z)*K:Y+=K,C.pathCache&&(U-=u,Y-=f,u=0,f=0);var F=t.globalAlpha;t.globalAlpha=N;var J=l.getImgSmoothing(t),re=!1;if(k==="no"&&J?(l.setImgSmoothing(t,!1),re=!0):k==="yes"&&!J&&(l.setImgSmoothing(t,!0),re=!0),p==="no-repeat")A&&(t.save(),C.pathCache?t.clip(C.pathCache):(l.nodeShapes[l.getNodeShape(n)].draw(t,u,f,S,x,D,C),t.clip())),l.safeDrawImage(t,e,0,0,O,L,U,Y,M,z),A&&t.restore();else{var se=t.createPattern(e,p);t.fillStyle=se,l.nodeShapes[l.getNodeShape(n)].draw(t,u,f,S,x,D,C),t.translate(U,Y),t.fill(),t.translate(-U,-Y)}t.globalAlpha=F,re&&l.setImgSmoothing(t,J)}};var Nl={};Nl.eleTextBiggerThanMin=function(t,e){if(!e){var n=t.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(dm(n*r));e=Math.pow(2,i)}var l=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(l<s)};Nl.drawElementText=function(t,e,n,r,i){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(r==null){if(l&&!s.eleTextBiggerThanMin(e))return}else if(r===!1)return;if(e.isNode()){var u=e.pstyle("label");if(!u||!u.value)return;var f=s.getLabelJustification(e);t.textAlign=f,t.textBaseline="bottom"}else{var c=e.element()._private.rscratch.badLine,h=e.pstyle("label"),v=e.pstyle("source-label"),p=e.pstyle("target-label");if(c||(!h||!h.value)&&(!v||!v.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var m=!n,y;n&&(y=n,t.translate(-y.x1,-y.y1)),i==null?(s.drawText(t,e,null,m,l),e.isEdge()&&(s.drawText(t,e,"source",m,l),s.drawText(t,e,"target",m,l))):s.drawText(t,e,i,m,l),n&&t.translate(y.x1,y.y1)};Nl.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(e=this.fontCaches[n],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};Nl.setupTextStyle=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",l=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,u=n?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,f=e.pstyle("text-outline-opacity").value*u,c=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=r+" "+s+" "+i+" "+l,t.lineJoin="round",this.colorFillStyle(t,c[0],c[1],c[2],u),this.colorStrokeStyle(t,h[0],h[1],h[2],f)};function yB(t,e,n,r,i){var l=Math.min(r,i),s=l/2,u=e+r/2,f=n+i/2;t.beginPath(),t.arc(u,f,s,0,Math.PI*2),t.closePath()}function aw(t,e,n,r,i){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(l,r/2,i/2);t.beginPath(),t.moveTo(e+s,n),t.lineTo(e+r-s,n),t.quadraticCurveTo(e+r,n,e+r,n+s),t.lineTo(e+r,n+i-s),t.quadraticCurveTo(e+r,n+i,e+r-s,n+i),t.lineTo(e+s,n+i),t.quadraticCurveTo(e,n+i,e,n+i-s),t.lineTo(e,n+s),t.quadraticCurveTo(e,n,e+s,n),t.closePath()}Nl.getTextAngle=function(t,e){var n,r=t._private,i=r.rscratch,l=e?e+"-":"",s=t.pstyle(l+"text-rotation");if(s.strValue==="autorotate"){var u=kr(i,"labelAngle",e);n=t.isEdge()?u:0}else s.strValue==="none"?n=0:n=s.pfValue;return n};Nl.drawText=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=e._private,s=l.rscratch,u=i?e.effectiveOpacity():1;if(!(i&&(u===0||e.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var f=kr(s,"labelX",n),c=kr(s,"labelY",n),h,v,p=this.getLabelText(e,n);if(p!=null&&p!==""&&!isNaN(f)&&!isNaN(c)){this.setupTextStyle(t,e,i);var m=n?n+"-":"",y=kr(s,"labelWidth",n),w=kr(s,"labelHeight",n),S=e.pstyle(m+"text-margin-x").pfValue,x=e.pstyle(m+"text-margin-y").pfValue,C=e.isEdge(),T=e.pstyle("text-halign").value,A=e.pstyle("text-valign").value;C&&(T="center",A="center"),f+=S,c+=x;var N;switch(r?N=this.getTextAngle(e,n):N=0,N!==0&&(h=f,v=c,t.translate(h,v),t.rotate(N),f=0,c=0),A){case"top":break;case"center":c+=w/2;break;case"bottom":c+=w;break}var k=e.pstyle("text-background-opacity").value,D=e.pstyle("text-border-opacity").value,O=e.pstyle("text-border-width").pfValue,L=e.pstyle("text-background-padding").pfValue,M=e.pstyle("text-background-shape").strValue,z=M==="round-rectangle"||M==="roundrectangle",B=M==="circle",U=2;if(k>0||O>0&&D>0){var V=t.fillStyle,$=t.strokeStyle,q=t.lineWidth,H=e.pstyle("text-background-color").value,Y=e.pstyle("text-border-color").value,Q=e.pstyle("text-border-style").value,P=k>0,I=O>0&&D>0,K=f-L;switch(T){case"left":K-=y;break;case"center":K-=y/2;break}var F=c-w-L,J=y+2*L,re=w+2*L;if(P&&(t.fillStyle="rgba(".concat(H[0],",").concat(H[1],",").concat(H[2],",").concat(k*u,")")),I&&(t.strokeStyle="rgba(".concat(Y[0],",").concat(Y[1],",").concat(Y[2],",").concat(D*u,")"),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(z?(t.beginPath(),aw(t,K,F,J,re,U)):B?(t.beginPath(),yB(t,K,F,J,re)):(t.beginPath(),t.rect(K,F,J,re)),P&&t.fill(),I&&t.stroke(),I&&Q==="double"){var se=O/2;t.beginPath(),z?aw(t,K+se,F+se,J-2*se,re-2*se,U):t.rect(K+se,F+se,J-2*se,re-2*se),t.stroke()}t.fillStyle=V,t.strokeStyle=$,t.lineWidth=q,t.setLineDash&&t.setLineDash([])}var me=2*e.pstyle("text-outline-width").pfValue;if(me>0&&(t.lineWidth=me),e.pstyle("text-wrap").value==="wrap"){var Ne=kr(s,"labelWrapCachedLines",n),pe=kr(s,"labelLineHeight",n),ee=y/2,le=this.getLabelJustification(e);switch(le==="auto"||(T==="left"?le==="left"?f+=-y:le==="center"&&(f+=-ee):T==="center"?le==="left"?f+=-ee:le==="right"&&(f+=ee):T==="right"&&(le==="center"?f+=ee:le==="right"&&(f+=y))),A){case"top":c-=(Ne.length-1)*pe;break;case"center":case"bottom":c-=(Ne.length-1)*pe;break}for(var de=0;de<Ne.length;de++)me>0&&t.strokeText(Ne[de],f,c),t.fillText(Ne[de],f,c),c+=pe}else me>0&&t.strokeText(p,f,c),t.fillText(p,f,c);N!==0&&(t.rotate(-N),t.translate(-h,-v))}}};var Vi={};Vi.drawNode=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,u,f,c=e._private,h=c.rscratch,v=e.position();if(!(!je(v.x)||!je(v.y))&&!(l&&!e.visible())){var p=l?e.effectiveOpacity():1,m=s.usePaths(),y,w=!1,S=e.padding();u=e.width()+2*S,f=e.height()+2*S;var x;n&&(x=n,t.translate(-x.x1,-x.y1));for(var C=e.pstyle("background-image"),T=C.value,A=new Array(T.length),N=new Array(T.length),k=0,D=0;D<T.length;D++){var O=T[D],L=A[D]=O!=null&&O!=="none";if(L){var M=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",D);k++,N[D]=s.getCachedImage(O,M,function(){c.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var z=e.pstyle("background-blacken").value,B=e.pstyle("border-width").pfValue,U=e.pstyle("background-opacity").value*p,V=e.pstyle("border-color").value,$=e.pstyle("border-style").value,q=e.pstyle("border-join").value,H=e.pstyle("border-cap").value,Y=e.pstyle("border-position").value,Q=e.pstyle("border-dash-pattern").pfValue,P=e.pstyle("border-dash-offset").pfValue,I=e.pstyle("border-opacity").value*p,K=e.pstyle("outline-width").pfValue,F=e.pstyle("outline-color").value,J=e.pstyle("outline-style").value,re=e.pstyle("outline-opacity").value*p,se=e.pstyle("outline-offset").value,me=e.pstyle("corner-radius").value;me!=="auto"&&(me=e.pstyle("corner-radius").pfValue);var Ne=function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U;s.eleFillStyle(t,e,Ue)},pe=function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I;s.colorStrokeStyle(t,V[0],V[1],V[2],Ue)},ee=function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:re;s.colorStrokeStyle(t,F[0],F[1],F[2],Ue)},le=function(Ue,ye,G,te){var fe=s.nodePathCache=s.nodePathCache||[],ce=IS(G==="polygon"?G+","+te.join(","):G,""+ye,""+Ue,""+me),we=fe[ce],Ie,ke=!1;return we!=null?(Ie=we,ke=!0,h.pathCache=Ie):(Ie=new Path2D,fe[ce]=h.pathCache=Ie),{path:Ie,cacheHit:ke}},de=e.pstyle("shape").strValue,xe=e.pstyle("shape-polygon-points").pfValue;if(m){t.translate(v.x,v.y);var Re=le(u,f,de,xe);y=Re.path,w=Re.cacheHit}var $e=function(){if(!w){var Ue=v;m&&(Ue={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(y||t,Ue.x,Ue.y,u,f,me,h)}m?t.fill(y):t.fill()},Ye=function(){for(var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,G=c.backgrounding,te=0,fe=0;fe<N.length;fe++){var ce=e.cy().style().getIndexedStyle(e,"background-image-containment","value",fe);if(ye&&ce==="over"||!ye&&ce==="inside"){te++;continue}A[fe]&&N[fe].complete&&!N[fe].error&&(te++,s.drawInscribedImage(t,N[fe],e,fe,Ue))}c.backgrounding=te!==k,G!==c.backgrounding&&e.updateStyle(!1)},lt=function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;s.hasPie(e)&&(s.drawPie(t,e,ye),Ue&&(m||s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,u,f,me,h)))},We=function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;s.hasStripe(e)&&(t.save(),m?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,u,f,me,h),t.clip()),s.drawStripe(t,e,ye),t.restore(),Ue&&(m||s.nodeShapes[s.getNodeShape(e)].draw(t,v.x,v.y,u,f,me,h)))},et=function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,ye=(z>0?z:-z)*Ue,G=z>0?0:255;z!==0&&(s.colorFillStyle(t,G,G,G,ye),m?t.fill(y):t.fill())},ze=function(){if(B>0){if(t.lineWidth=B,t.lineCap=H,t.lineJoin=q,t.setLineDash)switch($){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(Q),t.lineDashOffset=P;break;case"solid":case"double":t.setLineDash([]);break}if(Y!=="center"){if(t.save(),t.lineWidth*=2,Y==="inside")m?t.clip(y):t.clip();else{var Ue=new Path2D;Ue.rect(-u/2-B,-f/2-B,u+2*B,f+2*B),Ue.addPath(y),t.clip(Ue,"evenodd")}m?t.stroke(y):t.stroke(),t.restore()}else m?t.stroke(y):t.stroke();if($==="double"){t.lineWidth=B/3;var ye=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(y):t.stroke(),t.globalCompositeOperation=ye}t.setLineDash&&t.setLineDash([])}},Ge=function(){if(K>0){if(t.lineWidth=K,t.lineCap="butt",t.setLineDash)switch(J){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var Ue=v;m&&(Ue={x:0,y:0});var ye=s.getNodeShape(e),G=B;Y==="inside"&&(G=0),Y==="outside"&&(G*=2);var te=(u+G+(K+se))/u,fe=(f+G+(K+se))/f,ce=u*te,we=f*fe,Ie=s.nodeShapes[ye].points,ke;if(m){var Ve=le(ce,we,ye,Ie);ke=Ve.path}if(ye==="ellipse")s.drawEllipsePath(ke||t,Ue.x,Ue.y,ce,we);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ye)){var Ke=0,Qe=0,ut=0;ye==="round-diamond"?Ke=(G+se+K)*1.4:ye==="round-heptagon"?(Ke=(G+se+K)*1.075,ut=-(G/2+se+K)/35):ye==="round-hexagon"?Ke=(G+se+K)*1.12:ye==="round-pentagon"?(Ke=(G+se+K)*1.13,ut=-(G/2+se+K)/15):ye==="round-tag"?(Ke=(G+se+K)*1.12,Qe=(G/2+K+se)*.07):ye==="round-triangle"&&(Ke=(G+se+K)*(Math.PI/2),ut=-(G+se/2+K)/Math.PI),Ke!==0&&(te=(u+Ke)/u,ce=u*te,["round-hexagon","round-tag"].includes(ye)||(fe=(f+Ke)/f,we=f*fe)),me=me==="auto"?KS(ce,we):me;for(var X=ce/2,ne=we/2,Ce=me+(G+K+se)/2,Fe=new Array(Ie.length/2),mt=new Array(Ie.length/2),ft=0;ft<Ie.length/2;ft++)Fe[ft]={x:Ue.x+Qe+X*Ie[ft*2],y:Ue.y+ut+ne*Ie[ft*2+1]};var He,Me,Ze,Et,yt=Fe.length;for(Me=Fe[yt-1],He=0;He<yt;He++)Ze=Fe[He%yt],Et=Fe[(He+1)%yt],mt[He]=Dm(Me,Ze,Et,Ce),Me=Ze,Ze=Et;s.drawRoundPolygonPath(ke||t,Ue.x+Qe,Ue.y+ut,u*te,f*fe,Ie,mt)}else if(["roundrectangle","round-rectangle"].includes(ye))me=me==="auto"?zi(ce,we):me,s.drawRoundRectanglePath(ke||t,Ue.x,Ue.y,ce,we,me+(G+K+se)/2);else if(["cutrectangle","cut-rectangle"].includes(ye))me=me==="auto"?gm():me,s.drawCutRectanglePath(ke||t,Ue.x,Ue.y,ce,we,null,me+(G+K+se)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ye))me=me==="auto"?zi(ce,we):me,s.drawBottomRoundRectanglePath(ke||t,Ue.x,Ue.y,ce,we,me+(G+K+se)/2);else if(ye==="barrel")s.drawBarrelPath(ke||t,Ue.x,Ue.y,ce,we);else if(ye.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ye)){var Nn=(G+K+se)/u;Ie=If(zf(Ie,Nn)),s.drawPolygonPath(ke||t,Ue.x,Ue.y,u,f,Ie)}else{var Bt=(G+K+se)/u;Ie=If(zf(Ie,-Bt)),s.drawPolygonPath(ke||t,Ue.x,Ue.y,u,f,Ie)}if(m?t.stroke(ke):t.stroke(),J==="double"){t.lineWidth=G/3;var Gn=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(ke):t.stroke(),t.globalCompositeOperation=Gn}t.setLineDash&&t.setLineDash([])}},tt=function(){i&&s.drawNodeOverlay(t,e,v,u,f)},ot=function(){i&&s.drawNodeUnderlay(t,e,v,u,f)},Pe=function(){s.drawElementText(t,e,null,r)},pt=e.pstyle("ghost").value==="yes";if(pt){var ue=e.pstyle("ghost-offset-x").pfValue,Te=e.pstyle("ghost-offset-y").pfValue,Oe=e.pstyle("ghost-opacity").value,Xe=Oe*p;t.translate(ue,Te),ee(),Ge(),Ne(Oe*U),$e(),Ye(Xe,!0),pe(Oe*I),ze(),lt(z!==0||B!==0),We(z!==0||B!==0),Ye(Xe,!1),et(Xe),t.translate(-ue,-Te)}m&&t.translate(-v.x,-v.y),ot(),m&&t.translate(v.x,v.y),ee(),Ge(),Ne(),$e(),Ye(p,!0),pe(),ze(),lt(z!==0||B!==0),We(z!==0||B!==0),Ye(p,!1),et(),m&&t.translate(-v.x,-v.y),Pe(),tt(),n&&t.translate(x.x1,x.y1)}};var JC=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r,i,l,s){var u=this;if(r.visible()){var f=r.pstyle("".concat(e,"-padding")).pfValue,c=r.pstyle("".concat(e,"-opacity")).value,h=r.pstyle("".concat(e,"-color")).value,v=r.pstyle("".concat(e,"-shape")).value,p=r.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(i=i||r.position(),l==null||s==null){var m=r.padding();l=r.width()+2*m,s=r.height()+2*m}u.colorFillStyle(n,h[0],h[1],h[2],c),u.nodeShapes[v].draw(n,i.x,i.y,l+f*2,s+f*2,p),n.fill()}}}};Vi.drawNodeOverlay=JC("overlay");Vi.drawNodeUnderlay=JC("underlay");Vi.hasPie=function(t){return t=t[0],t._private.hasPie};Vi.hasStripe=function(t){return t=t[0],t._private.hasStripe};Vi.drawPie=function(t,e,n,r){e=e[0],r=r||e.position();var i=e.cy().style(),l=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),u=e.pstyle("pie-start-angle").pfValue,f=r.x,c=r.y,h=e.width(),v=e.height(),p=Math.min(h,v)/2,m,y=0,w=this.usePaths();if(w&&(f=0,c=0),l.units==="%"?p=p*l.pfValue:l.pfValue!==void 0&&(p=l.pfValue/2),s.units==="%"?m=p*s.pfValue:s.pfValue!==void 0&&(m=s.pfValue/2),!(m>=p))for(var S=1;S<=i.pieBackgroundN;S++){var x=e.pstyle("pie-"+S+"-background-size").value,C=e.pstyle("pie-"+S+"-background-color").value,T=e.pstyle("pie-"+S+"-background-opacity").value*n,A=x/100;A+y>1&&(A=1-y);var N=1.5*Math.PI+2*Math.PI*y;N+=u;var k=2*Math.PI*A,D=N+k;x===0||y>=1||y+A>1||(m===0?(t.beginPath(),t.moveTo(f,c),t.arc(f,c,p,N,D),t.closePath()):(t.beginPath(),t.arc(f,c,p,N,D),t.arc(f,c,m,D,N,!0),t.closePath()),this.colorFillStyle(t,C[0],C[1],C[2],T),t.fill(),y+=A)}};Vi.drawStripe=function(t,e,n,r){e=e[0],r=r||e.position();var i=e.cy().style(),l=r.x,s=r.y,u=e.width(),f=e.height(),c=0,h=this.usePaths();t.save();var v=e.pstyle("stripe-direction").value,p=e.pstyle("stripe-size");switch(v){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var m=u,y=f;p.units==="%"?(m=m*p.pfValue,y=y*p.pfValue):p.pfValue!==void 0&&(m=p.pfValue,y=p.pfValue),h&&(l=0,s=0),s-=m/2,l-=y/2;for(var w=1;w<=i.stripeBackgroundN;w++){var S=e.pstyle("stripe-"+w+"-background-size").value,x=e.pstyle("stripe-"+w+"-background-color").value,C=e.pstyle("stripe-"+w+"-background-opacity").value*n,T=S/100;T+c>1&&(T=1-c),!(S===0||c>=1||c+T>1)&&(t.beginPath(),t.rect(l,s+y*c,m,y*T),t.closePath(),this.colorFillStyle(t,x[0],x[1],x[2],C),t.fill(),c+=T)}t.restore()};var Er={},bB=100;Er.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),n=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/n};Er.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],n=!0,r,i=0;i<e.length;i++)if(r=e[i],r.context===t){n=!1;break}return n&&(r={context:t},e.push(r)),r};Er.createGradientStyleFor=function(t,e,n,r,i){var l,s=this.usePaths(),u=n.pstyle(e+"-gradient-stop-colors").value,f=n.pstyle(e+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var c=n.sourceEndpoint(),h=n.targetEndpoint(),v=n.midpoint(),p=Sl(c,v),m=Sl(h,v);l=t.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(p,m))}else{var y=s?{x:0,y:0}:n.position(),w=n.paddedWidth(),S=n.paddedHeight();l=t.createRadialGradient(y.x,y.y,0,y.x,y.y,Math.max(w,S))}else if(n.isEdge()){var x=n.sourceEndpoint(),C=n.targetEndpoint();l=t.createLinearGradient(x.x,x.y,C.x,C.y)}else{var T=s?{x:0,y:0}:n.position(),A=n.paddedWidth(),N=n.paddedHeight(),k=A/2,D=N/2,O=n.pstyle("background-gradient-direction").value;switch(O){case"to-bottom":l=t.createLinearGradient(T.x,T.y-D,T.x,T.y+D);break;case"to-top":l=t.createLinearGradient(T.x,T.y+D,T.x,T.y-D);break;case"to-left":l=t.createLinearGradient(T.x+k,T.y,T.x-k,T.y);break;case"to-right":l=t.createLinearGradient(T.x-k,T.y,T.x+k,T.y);break;case"to-bottom-right":case"to-right-bottom":l=t.createLinearGradient(T.x-k,T.y-D,T.x+k,T.y+D);break;case"to-top-right":case"to-right-top":l=t.createLinearGradient(T.x-k,T.y+D,T.x+k,T.y-D);break;case"to-bottom-left":case"to-left-bottom":l=t.createLinearGradient(T.x+k,T.y-D,T.x-k,T.y+D);break;case"to-top-left":case"to-left-top":l=t.createLinearGradient(T.x+k,T.y+D,T.x-k,T.y-D);break}}if(!l)return null;for(var L=f.length===u.length,M=u.length,z=0;z<M;z++)l.addColorStop(L?f[z]:z/(M-1),"rgba("+u[z][0]+","+u[z][1]+","+u[z][2]+","+i+")");return l};Er.gradientFillStyle=function(t,e,n,r){var i=this.createGradientStyleFor(t,"background",e,n,r);if(!i)return null;t.fillStyle=i};Er.colorFillStyle=function(t,e,n,r,i){t.fillStyle="rgba("+e+","+n+","+r+","+i+")"};Er.eleFillStyle=function(t,e,n){var r=e.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(t,e,r,n);else{var i=e.pstyle("background-color").value;this.colorFillStyle(t,i[0],i[1],i[2],n)}};Er.gradientStrokeStyle=function(t,e,n,r){var i=this.createGradientStyleFor(t,"line",e,n,r);if(!i)return null;t.strokeStyle=i};Er.colorStrokeStyle=function(t,e,n,r,i){t.strokeStyle="rgba("+e+","+n+","+r+","+i+")"};Er.eleStrokeStyle=function(t,e,n){var r=e.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(t,e,r,n);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(t,i[0],i[1],i[2],n)}};Er.matchCanvasSize=function(t){var e=this,n=e.data,r=e.findContainerClientCoords(),i=r[2],l=r[3],s=e.getPixelRatio(),u=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=u);var f=i*s,c=l*s,h;if(!(f===e.canvasWidth&&c===e.canvasHeight)){e.fontCaches=null;var v=n.canvasContainer;v.style.width=i+"px",v.style.height=l+"px";for(var p=0;p<e.CANVAS_LAYERS;p++)h=n.canvases[p],h.width=f,h.height=c,h.style.width=i+"px",h.style.height=l+"px";for(var p=0;p<e.BUFFER_COUNT;p++)h=n.bufferCanvases[p],h.width=f,h.height=c,h.style.width=i+"px",h.style.height=l+"px";e.textureMult=1,s<=1&&(h=n.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,h.width=f*e.textureMult,h.height=c*e.textureMult),e.canvasWidth=f,e.canvasHeight=c,e.pixelRatio=s}};Er.renderTo=function(t,e,n,r){this.render({forcedContext:t,forcedZoom:e,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})};Er.clearCanvas=function(){var t=this,e=t.data;function n(r){r.clearRect(0,0,t.canvasWidth,t.canvasHeight)}n(e.contexts[t.NODE]),n(e.contexts[t.DRAG])};Er.render=function(t){var e=this;t=t||qS();var n=e.cy,r=t.forcedContext,i=t.drawAllLayers,l=t.drawOnlyNodeLayer,s=t.forcedZoom,u=t.forcedPan,f=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=e.data,h=c.canvasNeedsRedraw,v=e.textureOnViewport&&!r&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),p=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,m=e.motionBlurPxRatio,y=n.hasCompoundNodes(),w=e.hoverData.draggingEles,S=!!(e.hoverData.selecting||e.touchData.selecting);p=p&&!r&&e.motionBlurEnabled&&!S;var x=p;r||(e.prevPxRatio!==f&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=f),!r&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),p&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(x=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!v&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var C=n.style(),T=n.zoom(),A=s!==void 0?s:T,N=n.pan(),k={x:N.x,y:N.y},D={zoom:T,pan:{x:N.x,y:N.y}},O=e.prevViewport,L=O===void 0||D.zoom!==O.zoom||D.pan.x!==O.pan.x||D.pan.y!==O.pan.y;!L&&!(w&&!y)&&(e.motionBlurPxRatio=1),u&&(k=u),A*=f,k.x*=f,k.y*=f;var M=e.getCachedZSortedEles();function z(pe,ee,le,de,xe){var Re=pe.globalCompositeOperation;pe.globalCompositeOperation="destination-out",e.colorFillStyle(pe,255,255,255,e.motionBlurTransparency),pe.fillRect(ee,le,de,xe),pe.globalCompositeOperation=Re}function B(pe,ee){var le,de,xe,Re;!e.clearingMotionBlur&&(pe===c.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||pe===c.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(le={x:N.x*m,y:N.y*m},de=T*m,xe=e.canvasWidth*m,Re=e.canvasHeight*m):(le=k,de=A,xe=e.canvasWidth,Re=e.canvasHeight),pe.setTransform(1,0,0,1,0,0),ee==="motionBlur"?z(pe,0,0,xe,Re):!r&&(ee===void 0||ee)&&pe.clearRect(0,0,xe,Re),i||(pe.translate(le.x,le.y),pe.scale(de,de)),u&&pe.translate(u.x,u.y),s&&pe.scale(s,s)}if(v||(e.textureDrawLastFrame=!1),v){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=n.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var U=e.data.bufferContexts[e.TEXTURE_BUFFER];U.setTransform(1,0,0,1,0,0),U.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:U,drawOnlyNodeLayer:!0,forcedPxRatio:f*e.textureMult});var D=e.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:e.canvasWidth,height:e.canvasHeight};D.mpan={x:(0-D.pan.x)/D.zoom,y:(0-D.pan.y)/D.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var V=c.contexts[e.NODE],$=e.textureCache.texture,D=e.textureCache.viewport;V.setTransform(1,0,0,1,0,0),p?z(V,0,0,D.width,D.height):V.clearRect(0,0,D.width,D.height);var q=C.core("outside-texture-bg-color").value,H=C.core("outside-texture-bg-opacity").value;e.colorFillStyle(V,q[0],q[1],q[2],H),V.fillRect(0,0,D.width,D.height);var T=n.zoom();B(V,!1),V.clearRect(D.mpan.x,D.mpan.y,D.width/D.zoom/f,D.height/D.zoom/f),V.drawImage($,D.mpan.x,D.mpan.y,D.width/D.zoom/f,D.height/D.zoom/f)}else e.textureOnViewport&&!r&&(e.textureCache=null);var Y=n.extent(),Q=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),P=e.hideEdgesOnViewport&&Q,I=[];if(I[e.NODE]=!h[e.NODE]&&p&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,I[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),I[e.DRAG]=!h[e.DRAG]&&p&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,I[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||l||I[e.NODE]){var K=p&&!I[e.NODE]&&m!==1,V=r||(K?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:c.contexts[e.NODE]),F=p&&!K?"motionBlur":void 0;B(V,F),P?e.drawCachedNodes(V,M.nondrag,f,Y):e.drawLayeredElements(V,M.nondrag,f,Y),e.debug&&e.drawDebugPoints(V,M.nondrag),!i&&!p&&(h[e.NODE]=!1)}if(!l&&(h[e.DRAG]||i||I[e.DRAG])){var K=p&&!I[e.DRAG]&&m!==1,V=r||(K?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:c.contexts[e.DRAG]);B(V,p&&!K?"motionBlur":void 0),P?e.drawCachedNodes(V,M.drag,f,Y):e.drawCachedElements(V,M.drag,f,Y),e.debug&&e.drawDebugPoints(V,M.drag),!i&&!p&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,B),p&&m!==1){var J=c.contexts[e.NODE],re=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],se=c.contexts[e.DRAG],me=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],Ne=function(ee,le,de){ee.setTransform(1,0,0,1,0,0),de||!x?ee.clearRect(0,0,e.canvasWidth,e.canvasHeight):z(ee,0,0,e.canvasWidth,e.canvasHeight);var xe=m;ee.drawImage(le,0,0,e.canvasWidth*xe,e.canvasHeight*xe,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||I[e.NODE])&&(Ne(J,re,I[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||I[e.DRAG])&&(Ne(se,me,I[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=D,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),p&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!v,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},bB)),r||n.emit("render")};var Vo;Er.drawSelectionRectangle=function(t,e){var n=this,r=n.cy,i=n.data,l=r.style(),s=t.drawOnlyNodeLayer,u=t.drawAllLayers,f=i.canvasNeedsRedraw,c=t.forcedContext;if(n.showFps||!s&&f[n.SELECT_BOX]&&!u){var h=c||i.contexts[n.SELECT_BOX];if(e(h),n.selection[4]==1&&(n.hoverData.selecting||n.touchData.selecting)){var v=n.cy.zoom(),p=l.core("selection-box-border-width").value/v;h.lineWidth=p,h.fillStyle="rgba("+l.core("selection-box-color").value[0]+","+l.core("selection-box-color").value[1]+","+l.core("selection-box-color").value[2]+","+l.core("selection-box-opacity").value+")",h.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]),p>0&&(h.strokeStyle="rgba("+l.core("selection-box-border-color").value[0]+","+l.core("selection-box-border-color").value[1]+","+l.core("selection-box-border-color").value[2]+","+l.core("selection-box-opacity").value+")",h.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]))}if(i.bgActivePosistion&&!n.hoverData.selecting){var v=n.cy.zoom(),m=i.bgActivePosistion;h.fillStyle="rgba("+l.core("active-bg-color").value[0]+","+l.core("active-bg-color").value[1]+","+l.core("active-bg-color").value[2]+","+l.core("active-bg-opacity").value+")",h.beginPath(),h.arc(m.x,m.y,l.core("active-bg-size").pfValue/v,0,2*Math.PI),h.fill()}var y=n.lastRedrawTime;if(n.showFps&&y){y=Math.round(y);var w=Math.round(1e3/y),S="1 frame = "+y+" 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",!Vo){var x=h.measureText(S);Vo=x.actualBoundingBoxAscent}h.fillText(S,0,Vo);var C=60;h.strokeRect(0,Vo+10,250,20),h.fillRect(0,Vo+10,250*Math.min(w/C,1),20)}u||(f[n.SELECT_BOX]=!1)}};function iw(t,e,n){var r=t.createShader(e);if(t.shaderSource(r,n),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(r));return r}function EB(t,e,n){var r=iw(t,t.VERTEX_SHADER,e),i=iw(t,t.FRAGMENT_SHADER,n),l=t.createProgram();if(t.attachShader(l,r),t.attachShader(l,i),t.linkProgram(l),!t.getProgramParameter(l,t.LINK_STATUS))throw new Error("Could not initialize shaders");return l}function xB(t,e,n){n===void 0&&(n=e);var r=t.makeOffscreenCanvas(e,n),i=r.context=r.getContext("2d");return r.clear=function(){return i.clearRect(0,0,r.width,r.height)},r.clear(),r}function km(t){var e=t.pixelRatio,n=t.cy.zoom(),r=t.cy.pan();return{zoom:n*e,pan:{x:r.x*e,y:r.y*e}}}function wB(t){var e=t.pixelRatio,n=t.cy.zoom();return n*e}function SB(t,e,n,r,i){var l=r*n+e.x,s=i*n+e.y;return s=Math.round(t.canvasHeight-s),[l,s]}function CB(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 TB(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function gl(t,e,n){var r=t[0]/255,i=t[1]/255,l=t[2]/255,s=e,u=n||new Array(4);return u[0]=r*s,u[1]=i*s,u[2]=l*s,u[3]=s,u}function ys(t,e){var n=e||new Array(4);return n[0]=(t>>0&255)/255,n[1]=(t>>8&255)/255,n[2]=(t>>16&255)/255,n[3]=(t>>24&255)/255,n}function DB(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function AB(t,e){var n=t.createTexture();return n.buffer=function(r){t.bindTexture(t.TEXTURE_2D,n),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,r),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},n.deleteTexture=function(){t.deleteTexture(n)},n}function eT(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 tT(t,e,n){switch(e){case t.FLOAT:return new Float32Array(n);case t.INT:return new Int32Array(n)}}function _B(t,e,n,r,i,l){switch(e){case t.FLOAT:return new Float32Array(n.buffer,l*r,i);case t.INT:return new Int32Array(n.buffer,l*r,i)}}function kB(t,e,n,r){var i=eT(t,e),l=zn(i,2),s=l[0],u=l[1],f=tT(t,u,r),c=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,f,t.STATIC_DRAW),u===t.FLOAT?t.vertexAttribPointer(n,s,u,!1,0,0):u===t.INT&&t.vertexAttribIPointer(n,s,u,0,0),t.enableVertexAttribArray(n),t.bindBuffer(t.ARRAY_BUFFER,null),c}function ba(t,e,n,r){var i=eT(t,n),l=zn(i,3),s=l[0],u=l[1],f=l[2],c=tT(t,u,e*s),h=s*f,v=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(r),u===t.FLOAT?t.vertexAttribPointer(r,s,u,!1,h,0):u===t.INT&&t.vertexAttribIPointer(r,s,u,h,0),t.vertexAttribDivisor(r,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var p=new Array(e),m=0;m<e;m++)p[m]=_B(t,u,c,h,s,m);return v.dataArray=c,v.stride=h,v.size=s,v.getView=function(y){return p[y]},v.setPoint=function(y,w,S){var x=p[y];x[0]=w,x[1]=S},v.bufferSubData=function(y){t.bindBuffer(t.ARRAY_BUFFER,v),y?t.bufferSubData(t.ARRAY_BUFFER,0,c,0,y*s):t.bufferSubData(t.ARRAY_BUFFER,0,c)},v}function NB(t,e,n){for(var r=9,i=new Float32Array(e*r),l=new Array(e),s=0;s<e;s++){var u=s*r*4;l[s]=new Float32Array(i.buffer,u,r)}var f=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,f),t.bufferData(t.ARRAY_BUFFER,i.byteLength,t.DYNAMIC_DRAW);for(var c=0;c<3;c++){var h=n+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),f.getMatrixView=function(v){return l[v]},f.setData=function(v,p){l[p].set(v,0)},f.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,f),t.bufferSubData(t.ARRAY_BUFFER,0,i)},f}function RB(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var n=t.createTexture();return t.bindTexture(t.TEXTURE_2D,n),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,n,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(r,i){t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,r,i,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var lw=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 Jg(){var t=new lw(9);return lw!=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 sw(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 MB(t,e,n){var r=e[0],i=e[1],l=e[2],s=e[3],u=e[4],f=e[5],c=e[6],h=e[7],v=e[8],p=n[0],m=n[1],y=n[2],w=n[3],S=n[4],x=n[5],C=n[6],T=n[7],A=n[8];return t[0]=p*r+m*s+y*c,t[1]=p*i+m*u+y*h,t[2]=p*l+m*f+y*v,t[3]=w*r+S*s+x*c,t[4]=w*i+S*u+x*h,t[5]=w*l+S*f+x*v,t[6]=C*r+T*s+A*c,t[7]=C*i+T*u+A*h,t[8]=C*l+T*f+A*v,t}function Rf(t,e,n){var r=e[0],i=e[1],l=e[2],s=e[3],u=e[4],f=e[5],c=e[6],h=e[7],v=e[8],p=n[0],m=n[1];return t[0]=r,t[1]=i,t[2]=l,t[3]=s,t[4]=u,t[5]=f,t[6]=p*r+m*s+c,t[7]=p*i+m*u+h,t[8]=p*l+m*f+v,t}function ow(t,e,n){var r=e[0],i=e[1],l=e[2],s=e[3],u=e[4],f=e[5],c=e[6],h=e[7],v=e[8],p=Math.sin(n),m=Math.cos(n);return t[0]=m*r+p*s,t[1]=m*i+p*u,t[2]=m*l+p*f,t[3]=m*s-p*r,t[4]=m*u-p*i,t[5]=m*f-p*l,t[6]=c,t[7]=h,t[8]=v,t}function Hp(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function OB(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var BB=(function(){function t(e,n,r,i){Hi(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(e,n,n),this.scratch=i(e,n,this.texHeight,"scratch")}return ji(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(n){var r=n.w,i=n.h,l=this.texHeight,s=this.texSize,u=l/i,f=r*u,c=i*u;return f>s&&(u=s/r,f=r*u,c=i*u),{scale:u,texW:f,texH:c}}},{key:"draw",value:function(n,r,i){var l=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,u=this.texRows,f=this.texHeight,c=this.getScale(r),h=c.scale,v=c.texW,p=c.texH,m=function(T,A){if(i&&A){var N=A.context,k=T.x,D=T.row,O=k,L=f*D;N.save(),N.translate(O,L),N.scale(h,h),i(N,r),N.restore()}},y=[null,null],w=function(){m(l.freePointer,l.canvas),y[0]={x:l.freePointer.x,y:l.freePointer.row*f,w:v,h:p},y[1]={x:l.freePointer.x+v,y:l.freePointer.row*f,w:0,h:p},l.freePointer.x+=v,l.freePointer.x==s&&(l.freePointer.x=0,l.freePointer.row++)},S=function(){var T=l.scratch,A=l.canvas;T.clear(),m({x:0,row:0},T);var N=s-l.freePointer.x,k=v-N,D=f;{var O=l.freePointer.x,L=l.freePointer.row*f,M=N;A.context.drawImage(T,0,0,M,D,O,L,M,D),y[0]={x:O,y:L,w:M,h:p}}{var z=N,B=(l.freePointer.row+1)*f,U=k;A&&A.context.drawImage(T,z,0,U,D,0,B,U,D),y[1]={x:0,y:B,w:U,h:p}}l.freePointer.x=k,l.freePointer.row++},x=function(){l.freePointer.x=0,l.freePointer.row++};if(this.freePointer.x+v<=s)w();else{if(this.freePointer.row>=u-1)return!1;this.freePointer.x===s?(x(),w()):this.enableWrapping?S():(x(),w())}return this.keyToLocation.set(n,y),this.needsBuffer=!0,y}},{key:"getOffsets",value:function(n){return this.keyToLocation.get(n)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(n){if(this.locked)return!1;var r=this.texSize,i=this.texRows,l=this.getScale(n),s=l.texW;return this.freePointer.x+s>r?this.freePointer.row<i-1:!0}},{key:"bufferIfNeeded",value:function(n){this.texture||(this.texture=AB(n,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}}])})(),LB=(function(){function t(e,n,r,i){Hi(this,t),this.r=e,this.texSize=n,this.texRows=r,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return ji(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var n=this.r,r=this.texSize,i=this.texRows,l=this.createTextureCanvas;return new BB(n,r,i,l)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var n=this.r,r=this.texSize,i=this.texRows,l=this.createTextureCanvas,s=Math.floor(r/i);this.scratch=l(n,r,s,"scratch")}return this.scratch}},{key:"draw",value:function(n,r,i){var l=this.styleKeyToAtlas.get(n);return l||(l=this.atlases[this.atlases.length-1],(!l||!l.canFit(r))&&(l&&l.lock(),l=this._createAtlas(),this.atlases.push(l)),l.draw(n,r,i),this.styleKeyToAtlas.set(n,l)),l}},{key:"getAtlas",value:function(n){return this.styleKeyToAtlas.get(n)}},{key:"hasAtlas",value:function(n){return this.styleKeyToAtlas.has(n)}},{key:"markKeyForGC",value:function(n){this.markedKeys.add(n)}},{key:"gc",value:function(){var n=this,r=this.markedKeys;if(r.size===0){console.log("nothing to garbage collect");return}var i=[],l=new Map,s=null,u=Rr(this.atlases),f;try{var c=function(){var v=f.value,p=v.getKeys(),m=FB(r,p);if(m.size===0)return i.push(v),p.forEach(function(N){return l.set(N,v)}),1;s||(s=n._createAtlas(),i.push(s));var y=Rr(p),w;try{for(y.s();!(w=y.n()).done;){var S=w.value;if(!m.has(S)){var x=v.getOffsets(S),C=zn(x,2),T=C[0],A=C[1];s.canFit({w:T.w+A.w,h:T.h})||(s.lock(),s=n._createAtlas(),i.push(s)),v.canvas&&(n._copyTextureToNewAtlas(S,v,s),l.set(S,s))}}}catch(N){y.e(N)}finally{y.f()}v.dispose()};for(u.s();!(f=u.n()).done;)c()}catch(h){u.e(h)}finally{u.f()}this.atlases=i,this.styleKeyToAtlas=l,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(n,r,i){var l=r.getOffsets(n),s=zn(l,2),u=s[0],f=s[1];if(f.w===0)i.draw(n,u,function(p){p.drawImage(r.canvas,u.x,u.y,u.w,u.h,0,0,u.w,u.h)});else{var c=this._getScratchCanvas();c.clear(),c.context.drawImage(r.canvas,u.x,u.y,u.w,u.h,0,0,u.w,u.h),c.context.drawImage(r.canvas,f.x,f.y,f.w,f.h,u.w,0,f.w,f.h);var h=u.w+f.w,v=u.h;i.draw(n,{w:h,h:v},function(p){p.drawImage(c,0,0,h,v,0,0,h,v)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function FB(t,e){return t.intersection?t.intersection(e):new Set(Of(t).filter(function(n){return e.has(n)}))}var IB=(function(){function t(e,n){Hi(this,t),this.r=e,this.globalOptions=n,this.atlasSize=n.webglTexSize,this.maxAtlasesPerBatch=n.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return ji(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(n,r){var i=this.globalOptions,l=i.webglTexSize,s=i.createTextureCanvas,u=r.texRows,f=this._cacheScratchCanvas(s),c=new LB(this.r,l,u,f);this.collections.set(n,c)}},{key:"addRenderType",value:function(n,r){var i=r.collection;if(!this.collections.has(i))throw new Error("invalid atlas collection name '".concat(i,"'"));var l=this.collections.get(i),s=ht({type:n,atlasCollection:l},r);this.renderTypes.set(n,s)}},{key:"getRenderTypeOpts",value:function(n){return this.renderTypes.get(n)}},{key:"getAtlasCollection",value:function(n){return this.collections.get(n)}},{key:"_cacheScratchCanvas",value:function(n){var r=-1,i=-1,l=null;return function(s,u,f,c){return c?((!l||u!=r||f!=i)&&(r=u,i=f,l=n(s,u,f)),l):n(s,u,f)}}},{key:"_key",value:function(n,r){return"".concat(n,"-").concat(r)}},{key:"invalidate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=i.forceRedraw,s=l===void 0?!1:l,u=i.filterEle,f=u===void 0?function(){return!0}:u,c=i.filterType,h=c===void 0?function(){return!0}:c,v=!1,p=!1,m=Rr(n),y;try{for(m.s();!(y=m.n()).done;){var w=y.value;if(f(w)){var S=Rr(this.renderTypes.values()),x;try{var C=function(){var A=x.value,N=A.type;if(h(N)){var k=r.collections.get(A.collection),D=A.getKey(w),O=Array.isArray(D)?D:[D];if(s)O.forEach(function(B){return k.markKeyForGC(B)}),p=!0;else{var L=A.getID?A.getID(w):w.id(),M=r._key(N,L),z=r.typeAndIdToKey.get(M);z!==void 0&&!TB(O,z)&&(v=!0,r.typeAndIdToKey.delete(M),z.forEach(function(B){return k.markKeyForGC(B)}))}}};for(S.s();!(x=S.n()).done;)C()}catch(T){S.e(T)}finally{S.f()}}}}catch(T){m.e(T)}finally{m.f()}return p&&(this.gc(),v=!1),v}},{key:"gc",value:function(){var n=Rr(this.collections.values()),r;try{for(n.s();!(r=n.n()).done;){var i=r.value;i.gc()}}catch(l){n.e(l)}finally{n.f()}}},{key:"getOrCreateAtlas",value:function(n,r,i,l){var s=this.renderTypes.get(r),u=this.collections.get(s.collection),f=!1,c=u.draw(l,i,function(p){s.drawClipped?(p.save(),p.beginPath(),p.rect(0,0,i.w,i.h),p.clip(),s.drawElement(p,n,i,!0,!0),p.restore()):s.drawElement(p,n,i,!0,!0),f=!0});if(f){var h=s.getID?s.getID(n):n.id(),v=this._key(r,h);this.typeAndIdToKey.has(v)?this.typeAndIdToKey.get(v).push(l):this.typeAndIdToKey.set(v,[l])}return c}},{key:"getAtlasInfo",value:function(n,r){var i=this,l=this.renderTypes.get(r),s=l.getKey(n),u=Array.isArray(s)?s:[s];return u.map(function(f){var c=l.getBoundingBox(n,f),h=i.getOrCreateAtlas(n,r,c,f),v=h.getOffsets(f),p=zn(v,2),m=p[0],y=p[1];return{atlas:h,tex:m,tex1:m,tex2:y,bb:c}})}},{key:"getDebugInfo",value:function(){var n=[],r=Rr(this.collections),i;try{for(r.s();!(i=r.n()).done;){var l=zn(i.value,2),s=l[0],u=l[1],f=u.getCounts(),c=f.keyCount,h=f.atlasCount;n.push({type:s,keyCount:c,atlasCount:h})}}catch(v){r.e(v)}finally{r.f()}return n}}])})(),zB=(function(){function t(e){Hi(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return ji(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(n,r){return r})}},{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(n){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(n):!0}},{key:"getAtlasIndexForBatch",value:function(n){var r=this.batchAtlases.indexOf(n);if(r<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(n),r=this.batchAtlases.length-1}return r}}])})(),PB=`
|
|
21
|
+
float circleSD(vec2 p, float r) {
|
|
22
|
+
return distance(vec2(0), p) - r; // signed distance
|
|
23
|
+
}
|
|
24
|
+
`,UB=`
|
|
25
|
+
float rectangleSD(vec2 p, vec2 b) {
|
|
26
|
+
vec2 d = abs(p)-b;
|
|
27
|
+
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
28
|
+
}
|
|
29
|
+
`,qB=`
|
|
30
|
+
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
31
|
+
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
32
|
+
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
33
|
+
vec2 q = abs(p) - b + cr.x;
|
|
34
|
+
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
35
|
+
}
|
|
36
|
+
`,HB=`
|
|
37
|
+
float ellipseSD(vec2 p, vec2 ab) {
|
|
38
|
+
p = abs( p ); // symmetry
|
|
39
|
+
|
|
40
|
+
// find root with Newton solver
|
|
41
|
+
vec2 q = ab*(p-ab);
|
|
42
|
+
float w = (q.x<q.y)? 1.570796327 : 0.0;
|
|
43
|
+
for( int i=0; i<5; i++ ) {
|
|
44
|
+
vec2 cs = vec2(cos(w),sin(w));
|
|
45
|
+
vec2 u = ab*vec2( cs.x,cs.y);
|
|
46
|
+
vec2 v = ab*vec2(-cs.y,cs.x);
|
|
47
|
+
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// compute final point and distance
|
|
51
|
+
float d = length(p-ab*vec2(cos(w),sin(w)));
|
|
52
|
+
|
|
53
|
+
// return signed distance
|
|
54
|
+
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
55
|
+
}
|
|
56
|
+
`,iu={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Vf={IGNORE:1,USE_BB:2},ep=0,uw=1,cw=2,tp=3,bs=4,cf=5,$o=6,Ko=7,jB=(function(){function t(e,n,r){Hi(this,t),this.r=e,this.gl=n,this.maxInstances=r.webglBatchSize,this.atlasSize=r.webglTexSize,this.bgColor=r.bgColor,this.debug=r.webglDebug,this.batchDebugInfo=[],r.enableWrapping=!0,r.createTextureCanvas=xB,this.atlasManager=new IB(e,r),this.batchManager=new zB(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(iu.SCREEN),this.pickingProgram=this._createShaderProgram(iu.PICKING),this.vao=this._createVAO()}return ji(t,[{key:"addAtlasCollection",value:function(n,r){this.atlasManager.addAtlasCollection(n,r)}},{key:"addTextureAtlasRenderType",value:function(n,r){this.atlasManager.addRenderType(n,r)}},{key:"addSimpleShapeRenderType",value:function(n,r){this.simpleShapeOptions.set(n,r)}},{key:"invalidate",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.type,l=this.atlasManager;return i?l.invalidate(n,{filterType:function(u){return u===i},forceRedraw:!0}):l.invalidate(n)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(n){var r=this.gl,i=`#version 300 es
|
|
57
|
+
precision highp float;
|
|
58
|
+
|
|
59
|
+
uniform mat3 uPanZoomMatrix;
|
|
60
|
+
uniform int uAtlasSize;
|
|
61
|
+
|
|
62
|
+
// instanced
|
|
63
|
+
in vec2 aPosition; // a vertex from the unit square
|
|
64
|
+
|
|
65
|
+
in mat3 aTransform; // used to transform verticies, eg into a bounding box
|
|
66
|
+
in int aVertType; // the type of thing we are rendering
|
|
67
|
+
|
|
68
|
+
// the z-index that is output when using picking mode
|
|
69
|
+
in vec4 aIndex;
|
|
70
|
+
|
|
71
|
+
// For textures
|
|
72
|
+
in int aAtlasId; // which shader unit/atlas to use
|
|
73
|
+
in vec4 aTex; // x/y/w/h of texture in atlas
|
|
74
|
+
|
|
75
|
+
// for edges
|
|
76
|
+
in vec4 aPointAPointB;
|
|
77
|
+
in vec4 aPointCPointD;
|
|
78
|
+
in vec2 aLineWidth; // also used for node border width
|
|
79
|
+
|
|
80
|
+
// simple shapes
|
|
81
|
+
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
|
|
82
|
+
in vec4 aColor; // also used for edges
|
|
83
|
+
in vec4 aBorderColor; // aLineWidth is used for border width
|
|
84
|
+
|
|
85
|
+
// output values passed to the fragment shader
|
|
86
|
+
out vec2 vTexCoord;
|
|
87
|
+
out vec4 vColor;
|
|
88
|
+
out vec2 vPosition;
|
|
89
|
+
// flat values are not interpolated
|
|
90
|
+
flat out int vAtlasId;
|
|
91
|
+
flat out int vVertType;
|
|
92
|
+
flat out vec2 vTopRight;
|
|
93
|
+
flat out vec2 vBotLeft;
|
|
94
|
+
flat out vec4 vCornerRadius;
|
|
95
|
+
flat out vec4 vBorderColor;
|
|
96
|
+
flat out vec2 vBorderWidth;
|
|
97
|
+
flat out vec4 vIndex;
|
|
98
|
+
|
|
99
|
+
void main(void) {
|
|
100
|
+
int vid = gl_VertexID;
|
|
101
|
+
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
102
|
+
|
|
103
|
+
if(aVertType == `.concat(ep,`) {
|
|
104
|
+
float texX = aTex.x; // texture coordinates
|
|
105
|
+
float texY = aTex.y;
|
|
106
|
+
float texW = aTex.z;
|
|
107
|
+
float texH = aTex.w;
|
|
108
|
+
|
|
109
|
+
if(vid == 1 || vid == 2 || vid == 4) {
|
|
110
|
+
texX += texW;
|
|
111
|
+
}
|
|
112
|
+
if(vid == 2 || vid == 4 || vid == 5) {
|
|
113
|
+
texY += texH;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
float d = float(uAtlasSize);
|
|
117
|
+
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
|
|
118
|
+
|
|
119
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
120
|
+
}
|
|
121
|
+
else if(aVertType == `).concat(bs," || aVertType == ").concat(Ko,`
|
|
122
|
+
|| aVertType == `).concat(cf," || aVertType == ").concat($o,`) { // simple shapes
|
|
123
|
+
|
|
124
|
+
// the bounding box is needed by the fragment shader
|
|
125
|
+
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
126
|
+
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
|
|
127
|
+
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
|
|
128
|
+
|
|
129
|
+
// calculations are done in the fragment shader, just pass these along
|
|
130
|
+
vColor = aColor;
|
|
131
|
+
vCornerRadius = aCornerRadius;
|
|
132
|
+
vBorderColor = aBorderColor;
|
|
133
|
+
vBorderWidth = aLineWidth;
|
|
134
|
+
|
|
135
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
136
|
+
}
|
|
137
|
+
else if(aVertType == `).concat(uw,`) {
|
|
138
|
+
vec2 source = aPointAPointB.xy;
|
|
139
|
+
vec2 target = aPointAPointB.zw;
|
|
140
|
+
|
|
141
|
+
// adjust the geometry so that the line is centered on the edge
|
|
142
|
+
position.y = position.y - 0.5;
|
|
143
|
+
|
|
144
|
+
// stretch the unit square into a long skinny rectangle
|
|
145
|
+
vec2 xBasis = target - source;
|
|
146
|
+
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
|
|
147
|
+
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
|
|
148
|
+
|
|
149
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
150
|
+
vColor = aColor;
|
|
151
|
+
}
|
|
152
|
+
else if(aVertType == `).concat(cw,`) {
|
|
153
|
+
vec2 pointA = aPointAPointB.xy;
|
|
154
|
+
vec2 pointB = aPointAPointB.zw;
|
|
155
|
+
vec2 pointC = aPointCPointD.xy;
|
|
156
|
+
vec2 pointD = aPointCPointD.zw;
|
|
157
|
+
|
|
158
|
+
// adjust the geometry so that the line is centered on the edge
|
|
159
|
+
position.y = position.y - 0.5;
|
|
160
|
+
|
|
161
|
+
vec2 p0, p1, p2, pos;
|
|
162
|
+
if(position.x == 0.0) { // The left side of the unit square
|
|
163
|
+
p0 = pointA;
|
|
164
|
+
p1 = pointB;
|
|
165
|
+
p2 = pointC;
|
|
166
|
+
pos = position;
|
|
167
|
+
} else { // The right side of the unit square, use same approach but flip the geometry upside down
|
|
168
|
+
p0 = pointD;
|
|
169
|
+
p1 = pointC;
|
|
170
|
+
p2 = pointB;
|
|
171
|
+
pos = vec2(0.0, -position.y);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
vec2 p01 = p1 - p0;
|
|
175
|
+
vec2 p12 = p2 - p1;
|
|
176
|
+
vec2 p21 = p1 - p2;
|
|
177
|
+
|
|
178
|
+
// Find the normal vector.
|
|
179
|
+
vec2 tangent = normalize(normalize(p12) + normalize(p01));
|
|
180
|
+
vec2 normal = vec2(-tangent.y, tangent.x);
|
|
181
|
+
|
|
182
|
+
// Find the vector perpendicular to p0 -> p1.
|
|
183
|
+
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
|
|
184
|
+
|
|
185
|
+
// Determine the bend direction.
|
|
186
|
+
float sigma = sign(dot(p01 + p21, normal));
|
|
187
|
+
float width = aLineWidth[0];
|
|
188
|
+
|
|
189
|
+
if(sign(pos.y) == -sigma) {
|
|
190
|
+
// This is an intersecting vertex. Adjust the position so that there's no overlap.
|
|
191
|
+
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
|
|
192
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
193
|
+
} else {
|
|
194
|
+
// This is a non-intersecting vertex. Treat it like a mitre join.
|
|
195
|
+
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
|
|
196
|
+
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
vColor = aColor;
|
|
200
|
+
}
|
|
201
|
+
else if(aVertType == `).concat(tp,` && vid < 3) {
|
|
202
|
+
// massage the first triangle into an edge arrow
|
|
203
|
+
if(vid == 0)
|
|
204
|
+
position = vec2(-0.15, -0.3);
|
|
205
|
+
if(vid == 1)
|
|
206
|
+
position = vec2( 0.0, 0.0);
|
|
207
|
+
if(vid == 2)
|
|
208
|
+
position = vec2( 0.15, -0.3);
|
|
209
|
+
|
|
210
|
+
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
211
|
+
vColor = aColor;
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
vAtlasId = aAtlasId;
|
|
218
|
+
vVertType = aVertType;
|
|
219
|
+
vIndex = aIndex;
|
|
220
|
+
}
|
|
221
|
+
`),l=this.batchManager.getIndexArray(),s=`#version 300 es
|
|
222
|
+
precision highp float;
|
|
223
|
+
|
|
224
|
+
// declare texture unit for each texture atlas in the batch
|
|
225
|
+
`.concat(l.map(function(c){return"uniform sampler2D uTexture".concat(c,";")}).join(`
|
|
226
|
+
`),`
|
|
227
|
+
|
|
228
|
+
uniform vec4 uBGColor;
|
|
229
|
+
uniform float uZoom;
|
|
230
|
+
|
|
231
|
+
in vec2 vTexCoord;
|
|
232
|
+
in vec4 vColor;
|
|
233
|
+
in vec2 vPosition; // model coordinates
|
|
234
|
+
|
|
235
|
+
flat in int vAtlasId;
|
|
236
|
+
flat in vec4 vIndex;
|
|
237
|
+
flat in int vVertType;
|
|
238
|
+
flat in vec2 vTopRight;
|
|
239
|
+
flat in vec2 vBotLeft;
|
|
240
|
+
flat in vec4 vCornerRadius;
|
|
241
|
+
flat in vec4 vBorderColor;
|
|
242
|
+
flat in vec2 vBorderWidth;
|
|
243
|
+
|
|
244
|
+
out vec4 outColor;
|
|
245
|
+
|
|
246
|
+
`).concat(PB,`
|
|
247
|
+
`).concat(UB,`
|
|
248
|
+
`).concat(qB,`
|
|
249
|
+
`).concat(HB,`
|
|
250
|
+
|
|
251
|
+
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
252
|
+
return vec4(
|
|
253
|
+
top.rgb + (bot.rgb * (1.0 - top.a)),
|
|
254
|
+
top.a + (bot.a * (1.0 - top.a))
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
|
|
259
|
+
// scale to the zoom level so that borders don't look blurry when zoomed in
|
|
260
|
+
// note 1.5 is an aribitrary value chosen because it looks good
|
|
261
|
+
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
void main(void) {
|
|
265
|
+
if(vVertType == `).concat(ep,`) {
|
|
266
|
+
// look up the texel from the texture unit
|
|
267
|
+
`).concat(l.map(function(c){return"if(vAtlasId == ".concat(c,") outColor = texture(uTexture").concat(c,", vTexCoord);")}).join(`
|
|
268
|
+
else `),`
|
|
269
|
+
}
|
|
270
|
+
else if(vVertType == `).concat(tp,`) {
|
|
271
|
+
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
272
|
+
outColor = blend(vColor, uBGColor);
|
|
273
|
+
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
274
|
+
}
|
|
275
|
+
else if(vVertType == `).concat(bs,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
276
|
+
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
277
|
+
}
|
|
278
|
+
else if(vVertType == `).concat(bs," || vVertType == ").concat(Ko,`
|
|
279
|
+
|| vVertType == `).concat(cf," || vVertType == ").concat($o,`) { // use SDF
|
|
280
|
+
|
|
281
|
+
float outerBorder = vBorderWidth[0];
|
|
282
|
+
float innerBorder = vBorderWidth[1];
|
|
283
|
+
float borderPadding = outerBorder * 2.0;
|
|
284
|
+
float w = vTopRight.x - vBotLeft.x - borderPadding;
|
|
285
|
+
float h = vTopRight.y - vBotLeft.y - borderPadding;
|
|
286
|
+
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
|
|
287
|
+
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
288
|
+
|
|
289
|
+
float d; // signed distance
|
|
290
|
+
if(vVertType == `).concat(bs,`) {
|
|
291
|
+
d = rectangleSD(p, b);
|
|
292
|
+
} else if(vVertType == `).concat(Ko,` && w == h) {
|
|
293
|
+
d = circleSD(p, b.x); // faster than ellipse
|
|
294
|
+
} else if(vVertType == `).concat(Ko,`) {
|
|
295
|
+
d = ellipseSD(p, b);
|
|
296
|
+
} else {
|
|
297
|
+
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
|
|
301
|
+
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
|
|
302
|
+
if(d > 0.0) {
|
|
303
|
+
if(d > outerBorder) {
|
|
304
|
+
discard;
|
|
305
|
+
} else {
|
|
306
|
+
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
|
|
307
|
+
}
|
|
308
|
+
} else {
|
|
309
|
+
if(d > innerBorder) {
|
|
310
|
+
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
|
|
311
|
+
vec4 innerBorderColor = blend(vBorderColor, vColor);
|
|
312
|
+
outColor = distInterp(innerBorderColor, outerColor, d);
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
vec4 outerColor;
|
|
316
|
+
if(innerBorder == 0.0 && outerBorder == 0.0) {
|
|
317
|
+
outerColor = vec4(0);
|
|
318
|
+
} else if(innerBorder == 0.0) {
|
|
319
|
+
outerColor = vBorderColor;
|
|
320
|
+
} else {
|
|
321
|
+
outerColor = blend(vBorderColor, vColor);
|
|
322
|
+
}
|
|
323
|
+
outColor = distInterp(vColor, outerColor, d - innerBorder);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
outColor = vColor;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
`).concat(n.picking?`if(outColor.a == 0.0) discard;
|
|
332
|
+
else outColor = vIndex;`:"",`
|
|
333
|
+
}
|
|
334
|
+
`),u=EB(r,i,s);u.aPosition=r.getAttribLocation(u,"aPosition"),u.aIndex=r.getAttribLocation(u,"aIndex"),u.aVertType=r.getAttribLocation(u,"aVertType"),u.aTransform=r.getAttribLocation(u,"aTransform"),u.aAtlasId=r.getAttribLocation(u,"aAtlasId"),u.aTex=r.getAttribLocation(u,"aTex"),u.aPointAPointB=r.getAttribLocation(u,"aPointAPointB"),u.aPointCPointD=r.getAttribLocation(u,"aPointCPointD"),u.aLineWidth=r.getAttribLocation(u,"aLineWidth"),u.aColor=r.getAttribLocation(u,"aColor"),u.aCornerRadius=r.getAttribLocation(u,"aCornerRadius"),u.aBorderColor=r.getAttribLocation(u,"aBorderColor"),u.uPanZoomMatrix=r.getUniformLocation(u,"uPanZoomMatrix"),u.uAtlasSize=r.getUniformLocation(u,"uAtlasSize"),u.uBGColor=r.getUniformLocation(u,"uBGColor"),u.uZoom=r.getUniformLocation(u,"uZoom"),u.uTextures=[];for(var f=0;f<this.batchManager.getMaxAtlasesPerBatch();f++)u.uTextures.push(r.getUniformLocation(u,"uTexture".concat(f)));return u}},{key:"_createVAO",value:function(){var n=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=n.length/2;var r=this.maxInstances,i=this.gl,l=this.program,s=i.createVertexArray();return i.bindVertexArray(s),kB(i,"vec2",l.aPosition,n),this.transformBuffer=NB(i,r,l.aTransform),this.indexBuffer=ba(i,r,"vec4",l.aIndex),this.vertTypeBuffer=ba(i,r,"int",l.aVertType),this.atlasIdBuffer=ba(i,r,"int",l.aAtlasId),this.texBuffer=ba(i,r,"vec4",l.aTex),this.pointAPointBBuffer=ba(i,r,"vec4",l.aPointAPointB),this.pointCPointDBuffer=ba(i,r,"vec4",l.aPointCPointD),this.lineWidthBuffer=ba(i,r,"vec2",l.aLineWidth),this.colorBuffer=ba(i,r,"vec4",l.aColor),this.cornerRadiusBuffer=ba(i,r,"vec4",l.aCornerRadius),this.borderColorBuffer=ba(i,r,"vec4",l.aBorderColor),i.bindVertexArray(null),s}},{key:"buffers",get:function(){var n=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(r){return Ri(r,"Buffer")}).map(function(r){return n[r]})),this._buffers}},{key:"startFrame",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:iu.SCREEN;this.panZoomMatrix=n,this.renderTarget=r,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(n,r){return n.visible()?r&&r.isVisible?r.isVisible(n):!0:!1}},{key:"drawTexture",value:function(n,r,i){var l=this.atlasManager,s=this.batchManager,u=l.getRenderTypeOpts(i);if(this._isVisible(n,u)&&!(n.isEdge()&&!this._isValidEdge(n))){if(this.renderTarget.picking&&u.getTexPickingMode){var f=u.getTexPickingMode(n);if(f===Vf.IGNORE)return;if(f==Vf.USE_BB){this.drawPickingRectangle(n,r,i);return}}var c=l.getAtlasInfo(n,i),h=Rr(c),v;try{for(h.s();!(v=h.n()).done;){var p=v.value,m=p.atlas,y=p.tex1,w=p.tex2;s.canAddToCurrentBatch(m)||this.endBatch();for(var S=s.getAtlasIndexForBatch(m),x=0,C=[[y,!0],[w,!1]];x<C.length;x++){var T=zn(C[x],2),A=T[0],N=T[1];if(A.w!=0){var k=this.instanceCount;this.vertTypeBuffer.getView(k)[0]=ep;var D=this.indexBuffer.getView(k);ys(r,D);var O=this.atlasIdBuffer.getView(k);O[0]=S;var L=this.texBuffer.getView(k);L[0]=A.x,L[1]=A.y,L[2]=A.w,L[3]=A.h;var M=this.transformBuffer.getMatrixView(k);this.setTransformMatrix(n,M,u,p,N),this.instanceCount++,N||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(z){h.e(z)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(n,r,i,l){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,u=0;if(i.shapeProps&&i.shapeProps.padding&&(u=n.pstyle(i.shapeProps.padding).pfValue),l){var f=l.bb,c=l.tex1,h=l.tex2,v=c.w/(c.w+h.w);s||(v=1-v);var p=this._getAdjustedBB(f,u,s,v);this._applyTransformMatrix(r,p,i,n)}else{var m=i.getBoundingBox(n),y=this._getAdjustedBB(m,u,!0,1);this._applyTransformMatrix(r,y,i,n)}}},{key:"_applyTransformMatrix",value:function(n,r,i,l){var s,u;sw(n);var f=i.getRotation?i.getRotation(l):0;if(f!==0){var c=i.getRotationPoint(l),h=c.x,v=c.y;Rf(n,n,[h,v]),ow(n,n,f);var p=i.getRotationOffset(l);s=p.x+(r.xOffset||0),u=p.y+(r.yOffset||0)}else s=r.x1,u=r.y1;Rf(n,n,[s,u]),Hp(n,n,[r.w,r.h])}},{key:"_getAdjustedBB",value:function(n,r,i,l){var s=n.x1,u=n.y1,f=n.w,c=n.h,h=n.yOffset;r&&(s-=r,u-=r,f+=2*r,c+=2*r);var v=0,p=f*l;return i&&l<1?f=p:!i&&l<1&&(v=f-p,s+=v,f=p),{x1:s,y1:u,w:f,h:c,xOffset:v,yOffset:h}}},{key:"drawPickingRectangle",value:function(n,r,i){var l=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=bs;var u=this.indexBuffer.getView(s);ys(r,u);var f=this.colorBuffer.getView(s);gl([0,0,0],1,f);var c=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(n,c,l),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(n,r,i){var l=this.simpleShapeOptions.get(i);if(this._isVisible(n,l)){var s=l.shapeProps,u=this._getVertTypeForShape(n,s.shape);if(u===void 0||l.isSimple&&!l.isSimple(n,this.renderTarget)){this.drawTexture(n,r,i);return}var f=this.instanceCount;if(this.vertTypeBuffer.getView(f)[0]=u,u===cf||u===$o){var c=l.getBoundingBox(n),h=this._getCornerRadius(n,s.radius,c),v=this.cornerRadiusBuffer.getView(f);v[0]=h,v[1]=h,v[2]=h,v[3]=h,u===$o&&(v[0]=0,v[2]=0)}var p=this.indexBuffer.getView(f);ys(r,p);var m=this.renderTarget.picking?1:n.pstyle(s.opacity).value,y=n.pstyle(s.color).value,w=this.colorBuffer.getView(f);gl(y,m,w);var S=this.lineWidthBuffer.getView(f);if(S[0]=0,S[1]=0,s.border){var x=n.pstyle("border-width").value;if(x>0){var C=n.pstyle("border-color").value,T=n.pstyle("border-opacity").value,A=this.borderColorBuffer.getView(f);gl(C,T,A);var N=n.pstyle("border-position").value;if(N==="inside")S[0]=0,S[1]=-x;else if(N==="outside")S[0]=x,S[1]=0;else{var k=x/2;S[0]=k,S[1]=-k}}}var D=this.transformBuffer.getMatrixView(f);this.setTransformMatrix(n,D,l),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(n,r){var i=n.pstyle(r).value;switch(i){case"rectangle":return bs;case"ellipse":return Ko;case"roundrectangle":case"round-rectangle":return cf;case"bottom-round-rectangle":return $o;default:return}}},{key:"_getCornerRadius",value:function(n,r,i){var l=i.w,s=i.h;if(n.pstyle(r).value==="auto")return zi(l,s);var u=n.pstyle(r).pfValue,f=l/2,c=s/2;return Math.min(u,c,f)}},{key:"drawEdgeArrow",value:function(n,r,i){if(n.visible()){var l=n._private.rscratch,s,u,f;if(i==="source"?(s=l.arrowStartX,u=l.arrowStartY,f=l.srcArrowAngle):(s=l.arrowEndX,u=l.arrowEndY,f=l.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(u)||u==null||isNaN(f)||f==null)){var c=n.pstyle(i+"-arrow-shape").value;if(c!=="none"){var h=n.pstyle(i+"-arrow-color").value,v=n.pstyle("opacity").value,p=n.pstyle("line-opacity").value,m=v*p,y=n.pstyle("width").pfValue,w=n.pstyle("arrow-scale").value,S=this.r.getArrowWidth(y,w),x=this.instanceCount,C=this.transformBuffer.getMatrixView(x);sw(C),Rf(C,C,[s,u]),Hp(C,C,[S,S]),ow(C,C,f),this.vertTypeBuffer.getView(x)[0]=tp;var T=this.indexBuffer.getView(x);ys(r,T);var A=this.colorBuffer.getView(x);gl(h,m,A),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(n,r){if(n.visible()){var i=this._getEdgePoints(n);if(i){var l=n.pstyle("opacity").value,s=n.pstyle("line-opacity").value,u=n.pstyle("width").pfValue,f=n.pstyle("line-color").value,c=l*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=uw;var v=this.indexBuffer.getView(h);ys(r,v);var p=this.colorBuffer.getView(h);gl(f,c,p);var m=this.lineWidthBuffer.getView(h);m[0]=u;var y=this.pointAPointBBuffer.getView(h);y[0]=i[0],y[1]=i[1],y[2]=i[2],y[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var w=0;w<i.length-2;w+=2){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=cw;var x=this.indexBuffer.getView(S);ys(r,x);var C=this.colorBuffer.getView(S);gl(f,c,C);var T=this.lineWidthBuffer.getView(S);T[0]=u;var A=i[w-2],N=i[w-1],k=i[w],D=i[w+1],O=i[w+2],L=i[w+3],M=i[w+4],z=i[w+5];w==0&&(A=2*k-O+.001,N=2*D-L+.001),w==i.length-4&&(M=2*O-k+.001,z=2*L-D+.001);var B=this.pointAPointBBuffer.getView(S);B[0]=A,B[1]=N,B[2]=k,B[3]=D;var U=this.pointCPointDBuffer.getView(S);U[0]=O,U[1]=L,U[2]=M,U[3]=z,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(n){var r=n._private.rscratch;return!(r.badLine||r.allpts==null||isNaN(r.allpts[0]))}},{key:"_getEdgePoints",value:function(n){var r=n._private.rscratch;if(this._isValidEdge(n)){var i=r.allpts;if(i.length==4)return i;var l=this._getNumSegments(n);return this._getCurveSegmentPoints(i,l)}}},{key:"_getNumSegments",value:function(n){var r=15;return Math.min(Math.max(r,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(n,r){if(n.length==4)return n;for(var i=Array((r+1)*2),l=0;l<=r;l++)if(l==0)i[0]=n[0],i[1]=n[1];else if(l==r)i[l*2]=n[n.length-2],i[l*2+1]=n[n.length-1];else{var s=l/r;this._setCurvePoint(n,s,i,l*2)}return i}},{key:"_setCurvePoint",value:function(n,r,i,l){if(n.length<=2)i[l]=n[0],i[l+1]=n[1];else{for(var s=Array(n.length-2),u=0;u<s.length;u+=2){var f=(1-r)*n[u]+r*n[u+2],c=(1-r)*n[u+1]+r*n[u+3];s[u]=f,s[u+1]=c}return this._setCurvePoint(s,r,i,l)}}},{key:"endBatch",value:function(){var n=this.gl,r=this.vao,i=this.vertexCount,l=this.instanceCount;if(l!==0){var s=this.renderTarget.picking?this.pickingProgram:this.program;n.useProgram(s),n.bindVertexArray(r);var u=Rr(this.buffers),f;try{for(u.s();!(f=u.n()).done;){var c=f.value;c.bufferSubData(l)}}catch(y){u.e(y)}finally{u.f()}for(var h=this.batchManager.getAtlases(),v=0;v<h.length;v++)h[v].bufferIfNeeded(n);for(var p=0;p<h.length;p++)n.activeTexture(n.TEXTURE0+p),n.bindTexture(n.TEXTURE_2D,h[p].texture),n.uniform1i(s.uTextures[p],p);n.uniform1f(s.uZoom,wB(this.r)),n.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),n.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var m=gl(this.bgColor,1);n.uniform4fv(s.uBGColor,m),n.drawArraysInstanced(n.TRIANGLES,0,i,l),n.bindVertexArray(null),n.bindTexture(n.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:l,atlasCount:h.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var n=this.atlasManager.getDebugInfo(),r=n.reduce(function(s,u){return s+u.atlasCount},0),i=this.batchDebugInfo,l=i.reduce(function(s,u){return s+u.count},0);return{atlasInfo:n,totalAtlases:r,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:i.length,batchInfo:i,totalInstances:l}}}])})(),nT={};nT.initWebgl=function(t,e){var n=this,r=n.data.contexts[n.WEBGL];t.bgColor=GB(n),t.webglTexSize=Math.min(t.webglTexSize,r.getParameter(r.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,r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)),n.webglDebug=t.webglDebug,n.webglDebugShowAtlases=t.webglDebugShowAtlases,n.pickingFrameBuffer=RB(r),n.pickingFrameBuffer.needsDraw=!0,n.drawing=new jB(n,r,t);var i=function(v){return function(p){return n.getTextAngle(p,v)}},l=function(v){return function(p){var m=p.pstyle(v);return m&&m.value}},s=function(v){return function(p){return p.pstyle("".concat(v,"-opacity")).value>0}},u=function(v){var p=v.pstyle("text-events").strValue==="yes";return p?Vf.USE_BB:Vf.IGNORE},f=function(v){var p=v.position(),m=p.x,y=p.y,w=v.outerWidth(),S=v.outerHeight();return{w,h:S,x1:m-w/2,y1:y-S/2}};n.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),n.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),n.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),n.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:f,isSimple:CB,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),n.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:f,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),n.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:f,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),n.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:u,getKey:np(e.getLabelKey,null),getBoundingBox:rp(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:l("label")}),n.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:u,getKey:np(e.getSourceLabelKey,"source"),getBoundingBox:rp(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:l("source-label")}),n.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:u,getKey:np(e.getTargetLabelKey,"target"),getBoundingBox:rp(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:l("target-label")});var c=Au(function(){console.log("garbage collect flag set"),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(h,v){var p=!1;v&&v.length>0&&(p|=n.drawing.invalidate(v)),p&&c()}),VB(n)};function GB(t){var e=t.cy.container(),n=e&&e.style&&e.style.backgroundColor||"white";return NS(n)}function rT(t,e){var n=t._private.rscratch;return kr(n,"labelWrapCachedLines",e)||[]}var np=function(e,n){return function(r){var i=e(r),l=rT(r,n);return l.length>1?l.map(function(s,u){return"".concat(i,"_").concat(u)}):i}},rp=function(e,n){return function(r,i){var l=e(r);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var u=Number(i.substring(s+1)),f=rT(r,n),c=l.h/f.length,h=c*u,v=l.y1+h;return{x1:l.x1,w:l.w,y1:v,h:c,yOffset:h}}}return l}};function VB(t){{var e=t.render;t.render=function(l){l=l||{};var s=t.cy;t.webgl&&(s.zoom()>XC?($B(t),e.call(t,l)):(KB(t),iT(t,l,iu.SCREEN)))}}{var n=t.matchCanvasSize;t.matchCanvasSize=function(l){n.call(t,l),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(l,s,u,f){return JB(t,l,s)};{var r=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){r.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(l,s){i.call(t,l,s),l==="viewport"||l==="bounds"?t.pickingFrameBuffer.needsDraw=!0:l==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function $B(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function KB(t){var e=function(r){r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,t.canvasWidth,t.canvasHeight),r.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function YB(t){var e=t.canvasWidth,n=t.canvasHeight,r=km(t),i=r.pan,l=r.zoom,s=Jg();Rf(s,s,[i.x,i.y]),Hp(s,s,[l,l]);var u=Jg();OB(u,e,n);var f=Jg();return MB(f,u,s),f}function aT(t,e){var n=t.canvasWidth,r=t.canvasHeight,i=km(t),l=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,n,r),e.translate(l.x,l.y),e.scale(s,s)}function XB(t,e){t.drawSelectionRectangle(e,function(n){return aT(t,n)})}function ZB(t){var e=t.data.contexts[t.NODE];e.save(),aT(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 QB(t){var e=function(i,l,s){for(var u=i.atlasManager.getAtlasCollection(l),f=t.data.contexts[t.NODE],c=u.atlases,h=0;h<c.length;h++){var v=c[h],p=v.canvas;if(p){var m=p.width,y=p.height,w=m*h,S=p.height*s,x=.4;f.save(),f.scale(x,x),f.drawImage(p,w,S),f.strokeStyle="black",f.rect(w,S,m,y),f.stroke(),f.restore()}}},n=0;e(t.drawing,"node",n++),e(t.drawing,"label",n++)}function WB(t,e,n,r,i){var l,s,u,f,c=km(t),h=c.pan,v=c.zoom;{var p=SB(t,h,v,e,n),m=zn(p,2),y=m[0],w=m[1],S=6;l=y-S/2,s=w-S/2,u=S,f=S}if(u===0||f===0)return[];var x=t.data.contexts[t.WEBGL];x.bindFramebuffer(x.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(x.viewport(0,0,x.canvas.width,x.canvas.height),iT(t,null,iu.PICKING),t.pickingFrameBuffer.needsDraw=!1);var C=u*f,T=new Uint8Array(C*4);x.readPixels(l,s,u,f,x.RGBA,x.UNSIGNED_BYTE,T),x.bindFramebuffer(x.FRAMEBUFFER,null);for(var A=new Set,N=0;N<C;N++){var k=T.slice(N*4,N*4+4),D=DB(k)-1;D>=0&&A.add(D)}return A}function JB(t,e,n){var r=WB(t,e,n),i=t.getCachedZSortedEles(),l,s,u=Rr(r),f;try{for(u.s();!(f=u.n()).done;){var c=f.value,h=i[c];if(!l&&h.isNode()&&(l=h),!s&&h.isEdge()&&(s=h),l&&s)break}}catch(v){u.e(v)}finally{u.f()}return[l,s].filter(Boolean)}function ap(t,e,n){var r=t.drawing;e+=1,n.isNode()?(r.drawNode(n,e,"node-underlay"),r.drawNode(n,e,"node-body"),r.drawTexture(n,e,"label"),r.drawNode(n,e,"node-overlay")):(r.drawEdgeLine(n,e),r.drawEdgeArrow(n,e,"source"),r.drawEdgeArrow(n,e,"target"),r.drawTexture(n,e,"label"),r.drawTexture(n,e,"edge-source-label"),r.drawTexture(n,e,"edge-target-label"))}function iT(t,e,n){var r;t.webglDebug&&(r=performance.now());var i=t.drawing,l=0;if(n.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&XB(t,e),t.data.canvasNeedsRedraw[t.NODE]||n.picking){var s=t.data.contexts[t.WEBGL];n.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var u=YB(t),f=t.getCachedZSortedEles();if(l=f.length,i.startFrame(u,n),n.screen){for(var c=0;c<f.nondrag.length;c++)ap(t,c,f.nondrag[c]);for(var h=0;h<f.drag.length;h++)ap(t,h,f.drag[h])}else if(n.picking)for(var v=0;v<f.length;v++)ap(t,v,f[v]);i.endFrame(),n.screen&&t.webglDebugShowAtlases&&(ZB(t),QB(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var p=performance.now(),m=!1,y=Math.ceil(p-r),w=i.getDebugInfo(),S=["".concat(l," 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(m)console.log("WebGL (".concat(n.name,") - time ").concat(y,"ms, ").concat(S));else{console.log("WebGL (".concat(n.name,") - frame time ").concat(y,"ms")),console.log("Totals:"),console.log(" ".concat(S)),console.log("Texture Atlases Used:");var x=w.atlasInfo,C=Rr(x),T;try{for(C.s();!(T=C.n()).done;){var A=T.value;console.log(" ".concat(A.type,": ").concat(A.keyCount," keys, ").concat(A.atlasCount," atlases"))}}catch(N){C.e(N)}finally{C.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,i.gc())}var $i={};$i.drawPolygonPath=function(t,e,n,r,i,l){var s=r/2,u=i/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*l[0],n+u*l[1]);for(var f=1;f<l.length/2;f++)t.lineTo(e+s*l[f*2],n+u*l[f*2+1]);t.closePath()};$i.drawRoundPolygonPath=function(t,e,n,r,i,l,s){s.forEach(function(u){return UC(t,u)}),t.closePath()};$i.drawRoundRectanglePath=function(t,e,n,r,i,l){var s=r/2,u=i/2,f=l==="auto"?zi(r,i):Math.min(l,u,s);t.beginPath&&t.beginPath(),t.moveTo(e,n-u),t.arcTo(e+s,n-u,e+s,n,f),t.arcTo(e+s,n+u,e,n+u,f),t.arcTo(e-s,n+u,e-s,n,f),t.arcTo(e-s,n-u,e,n-u,f),t.lineTo(e,n-u),t.closePath()};$i.drawBottomRoundRectanglePath=function(t,e,n,r,i,l){var s=r/2,u=i/2,f=l==="auto"?zi(r,i):l;t.beginPath&&t.beginPath(),t.moveTo(e,n-u),t.lineTo(e+s,n-u),t.lineTo(e+s,n),t.arcTo(e+s,n+u,e,n+u,f),t.arcTo(e-s,n+u,e-s,n,f),t.lineTo(e-s,n-u),t.lineTo(e,n-u),t.closePath()};$i.drawCutRectanglePath=function(t,e,n,r,i,l,s){var u=r/2,f=i/2,c=s==="auto"?gm():s;t.beginPath&&t.beginPath(),t.moveTo(e-u+c,n-f),t.lineTo(e+u-c,n-f),t.lineTo(e+u,n-f+c),t.lineTo(e+u,n+f-c),t.lineTo(e+u-c,n+f),t.lineTo(e-u+c,n+f),t.lineTo(e-u,n+f-c),t.lineTo(e-u,n-f+c),t.closePath()};$i.drawBarrelPath=function(t,e,n,r,i){var l=r/2,s=i/2,u=e-l,f=e+l,c=n-s,h=n+s,v=_p(r,i),p=v.widthOffset,m=v.heightOffset,y=v.ctrlPtOffsetPct*p;t.beginPath&&t.beginPath(),t.moveTo(u,c+m),t.lineTo(u,h-m),t.quadraticCurveTo(u+y,h,u+p,h),t.lineTo(f-p,h),t.quadraticCurveTo(f-y,h,f,h-m),t.lineTo(f,c+m),t.quadraticCurveTo(f-y,c,f-p,c),t.lineTo(u+p,c),t.quadraticCurveTo(u+y,c,u,c+m),t.closePath()};var fw=Math.sin(0),dw=Math.cos(0),jp={},Gp={},lT=Math.PI/40;for(var Es=0*Math.PI;Es<2*Math.PI;Es+=lT)jp[Es]=Math.sin(Es),Gp[Es]=Math.cos(Es);$i.drawEllipsePath=function(t,e,n,r,i){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,n,r/2,i/2,0,0,2*Math.PI);else for(var l,s,u=r/2,f=i/2,c=0*Math.PI;c<2*Math.PI;c+=lT)l=e-u*jp[c]*fw+u*Gp[c]*dw,s=n+f*Gp[c]*fw+f*jp[c]*dw,c===0?t.moveTo(l,s):t.lineTo(l,s);t.closePath()};var Ou={};Ou.createBuffer=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,[n,n.getContext("2d")]};Ou.bufferCanvasImage=function(t){var e=this.cy,n=e.mutableElements(),r=n.boundingBox(),i=this.findContainerClientCoords(),l=t.full?Math.ceil(r.w):i[2],s=t.full?Math.ceil(r.h):i[3],u=je(t.maxWidth)||je(t.maxHeight),f=this.getPixelRatio(),c=1;if(t.scale!==void 0)l*=t.scale,s*=t.scale,c=t.scale;else if(u){var h=1/0,v=1/0;je(t.maxWidth)&&(h=c*t.maxWidth/l),je(t.maxHeight)&&(v=c*t.maxHeight/s),c=Math.min(h,v),l*=c,s*=c}u||(l*=f,s*=f,c*=f);var p=document.createElement("canvas");p.width=l,p.height=s,p.style.width=l+"px",p.style.height=s+"px";var m=p.getContext("2d");if(l>0&&s>0){m.clearRect(0,0,l,s),m.globalCompositeOperation="source-over";var y=this.getCachedZSortedEles();if(t.full)m.translate(-r.x1*c,-r.y1*c),m.scale(c,c),this.drawElements(m,y),m.scale(1/c,1/c),m.translate(r.x1*c,r.y1*c);else{var w=e.pan(),S={x:w.x*c,y:w.y*c};c*=e.zoom(),m.translate(S.x,S.y),m.scale(c,c),this.drawElements(m,y),m.scale(1/c,1/c),m.translate(-S.x,-S.y)}t.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=t.bg,m.rect(0,0,l,s),m.fill())}return p};function eL(t,e){for(var n=atob(t),r=new ArrayBuffer(n.length),i=new Uint8Array(r),l=0;l<n.length;l++)i[l]=n.charCodeAt(l);return new Blob([r],{type:e})}function hw(t){var e=t.indexOf(",");return t.substr(e+1)}function sT(t,e,n){var r=function(){return e.toDataURL(n,t.quality)};switch(t.output){case"blob-promise":return new qs(function(i,l){try{e.toBlob(function(s){s!=null?i(s):l(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,t.quality)}catch(s){l(s)}});case"blob":return eL(hw(r()),n);case"base64":return hw(r());default:return r()}}Ou.png=function(t){return sT(t,this.bufferCanvasImage(t),"image/png")};Ou.jpg=function(t){return sT(t,this.bufferCanvasImage(t),"image/jpeg")};var oT={};oT.nodeShapeImpl=function(t,e,n,r,i,l,s,u){switch(t){case"ellipse":return this.drawEllipsePath(e,n,r,i,l);case"polygon":return this.drawPolygonPath(e,n,r,i,l,s);case"round-polygon":return this.drawRoundPolygonPath(e,n,r,i,l,s,u);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,n,r,i,l,u);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,n,r,i,l,s,u);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,n,r,i,l,u);case"barrel":return this.drawBarrelPath(e,n,r,i,l)}};var tL=uT,Tt=uT.prototype;Tt.CANVAS_LAYERS=3;Tt.SELECT_BOX=0;Tt.DRAG=1;Tt.NODE=2;Tt.WEBGL=3;Tt.CANVAS_TYPES=["2d","2d","2d","webgl2"];Tt.BUFFER_COUNT=3;Tt.TEXTURE_BUFFER=0;Tt.MOTIONBLUR_BUFFER_NODE=1;Tt.MOTIONBLUR_BUFFER_DRAG=2;function uT(t){var e=this,n=e.cy.window(),r=n.document;t.webgl&&(Tt.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Tt.CANVAS_LAYERS),contexts:new Array(Tt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Tt.CANVAS_LAYERS),bufferCanvases:new Array(Tt.BUFFER_COUNT),bufferContexts:new Array(Tt.CANVAS_LAYERS)};var i="-webkit-tap-highlight-color",l="rgba(0,0,0,0)";e.data.canvasContainer=r.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[i]=l,s.position="relative",s.zIndex="0",s.overflow="hidden";var u=t.cy.container();u.appendChild(e.data.canvasContainer),u.style[i]=l;var f={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Xk()&&(f["-ms-touch-action"]="none",f["touch-action"]="none");for(var c=0;c<Tt.CANVAS_LAYERS;c++){var h=e.data.canvases[c]=r.createElement("canvas"),v=Tt.CANVAS_TYPES[c];e.data.contexts[c]=h.getContext(v),e.data.contexts[c]||mn("Could not create canvas of type "+v),Object.keys(f).forEach(function(pe){h.style[pe]=f[pe]}),h.style.position="absolute",h.setAttribute("data-id","layer"+c),h.style.zIndex=String(Tt.CANVAS_LAYERS-c),e.data.canvasContainer.appendChild(h),e.data.canvasNeedsRedraw[c]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Tt.NODE].setAttribute("data-id","layer"+Tt.NODE+"-node"),e.data.canvases[Tt.SELECT_BOX].setAttribute("data-id","layer"+Tt.SELECT_BOX+"-selectbox"),e.data.canvases[Tt.DRAG].setAttribute("data-id","layer"+Tt.DRAG+"-drag"),e.data.canvases[Tt.WEBGL]&&e.data.canvases[Tt.WEBGL].setAttribute("data-id","layer"+Tt.WEBGL+"-webgl");for(var c=0;c<Tt.BUFFER_COUNT;c++)e.data.bufferCanvases[c]=r.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 p=br(),m=function(ee){return{x:(ee.x1+ee.x2)/2,y:(ee.y1+ee.y2)/2}},y=function(ee){return{x:-ee.w/2,y:-ee.h/2}},w=function(ee){var le=ee[0]._private,de=le.oldBackgroundTimestamp===le.backgroundTimestamp;return!de},S=function(ee){return ee[0]._private.nodeKey},x=function(ee){return ee[0]._private.labelStyleKey},C=function(ee){return ee[0]._private.sourceLabelStyleKey},T=function(ee){return ee[0]._private.targetLabelStyleKey},A=function(ee,le,de,xe,Re){return e.drawElement(ee,le,de,!1,!1,Re)},N=function(ee,le,de,xe,Re){return e.drawElementText(ee,le,de,xe,"main",Re)},k=function(ee,le,de,xe,Re){return e.drawElementText(ee,le,de,xe,"source",Re)},D=function(ee,le,de,xe,Re){return e.drawElementText(ee,le,de,xe,"target",Re)},O=function(ee){return ee.boundingBox(),ee[0]._private.bodyBounds},L=function(ee){return ee.boundingBox(),ee[0]._private.labelBounds.main||p},M=function(ee){return ee.boundingBox(),ee[0]._private.labelBounds.source||p},z=function(ee){return ee.boundingBox(),ee[0]._private.labelBounds.target||p},B=function(ee,le){return le},U=function(ee){return m(O(ee))},V=function(ee,le,de){var xe=ee?ee+"-":"";return{x:le.x+de.pstyle(xe+"text-margin-x").pfValue,y:le.y+de.pstyle(xe+"text-margin-y").pfValue}},$=function(ee,le,de){var xe=ee[0]._private.rscratch;return{x:xe[le],y:xe[de]}},q=function(ee){return V("",$(ee,"labelX","labelY"),ee)},H=function(ee){return V("source",$(ee,"sourceLabelX","sourceLabelY"),ee)},Y=function(ee){return V("target",$(ee,"targetLabelX","targetLabelY"),ee)},Q=function(ee){return y(O(ee))},P=function(ee){return y(M(ee))},I=function(ee){return y(z(ee))},K=function(ee){var le=L(ee),de=y(L(ee));if(ee.isNode()){switch(ee.pstyle("text-halign").value){case"left":de.x=-le.w-(le.leftPad||0);break;case"right":de.x=-(le.rightPad||0);break}switch(ee.pstyle("text-valign").value){case"top":de.y=-le.h-(le.topPad||0);break;case"bottom":de.y=-(le.botPad||0);break}}return de},F=e.data.eleTxrCache=new nu(e,{getKey:S,doesEleInvalidateKey:w,drawElement:A,getBoundingBox:O,getRotationPoint:U,getRotationOffset:Q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),J=e.data.lblTxrCache=new nu(e,{getKey:x,drawElement:N,getBoundingBox:L,getRotationPoint:q,getRotationOffset:K,isVisible:B}),re=e.data.slbTxrCache=new nu(e,{getKey:C,drawElement:k,getBoundingBox:M,getRotationPoint:H,getRotationOffset:P,isVisible:B}),se=e.data.tlbTxrCache=new nu(e,{getKey:T,drawElement:D,getBoundingBox:z,getRotationPoint:Y,getRotationOffset:I,isVisible:B}),me=e.data.lyrTxrCache=new ZC(e);e.onUpdateEleCalcs(function(ee,le){F.invalidateElements(le),J.invalidateElements(le),re.invalidateElements(le),se.invalidateElements(le),me.invalidateElements(le);for(var de=0;de<le.length;de++){var xe=le[de]._private;xe.oldBackgroundTimestamp=xe.backgroundTimestamp}});var Ne=function(ee){for(var le=0;le<ee.length;le++)me.enqueueElementRefinement(ee[le].ele)};F.onDequeue(Ne),J.onDequeue(Ne),re.onDequeue(Ne),se.onDequeue(Ne),t.webgl&&e.initWebgl(t,{getStyleKey:S,getLabelKey:x,getSourceLabelKey:C,getTargetLabelKey:T,drawElement:A,drawLabel:N,drawSourceLabel:k,drawTargetLabel:D,getElementBox:O,getLabelBox:L,getSourceLabelBox:M,getTargetLabelBox:z,getElementRotationPoint:U,getElementRotationOffset:Q,getLabelRotationPoint:q,getSourceLabelRotationPoint:H,getTargetLabelRotationPoint:Y,getLabelRotationOffset:K,getSourceLabelRotationOffset:P,getTargetLabelRotationOffset:I})}Tt.redrawHint=function(t,e){var n=this;switch(t){case"eles":n.data.canvasNeedsRedraw[Tt.NODE]=e;break;case"drag":n.data.canvasNeedsRedraw[Tt.DRAG]=e;break;case"select":n.data.canvasNeedsRedraw[Tt.SELECT_BOX]=e;break;case"gc":n.data.gc=!0;break}};var nL=typeof Path2D<"u";Tt.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};Tt.usePaths=function(){return nL&&this.pathsEnabled};Tt.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};Tt.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};Tt.makeOffscreenCanvas=function(t,e){var n;if((typeof OffscreenCanvas>"u"?"undefined":Hn(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(t,e);else{var r=this.cy.window(),i=r.document;n=i.createElement("canvas"),n.width=t,n.height=e}return n};[QC,Da,Qa,_m,Nl,Vi,Er,nT,$i,Ou,oT].forEach(function(t){ht(Tt,t)});var rL=[{name:"null",impl:IC},{name:"base",impl:KC},{name:"canvas",impl:tL}],aL=[{type:"layout",extensions:kO},{type:"renderer",extensions:rL}],cT={},fT={};function dT(t,e,n){var r=n,i=function(O){Kt("Can not register `"+e+"` for `"+t+"` since `"+O+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(mu.prototype[e])return i(e);mu.prototype[e]=n}else if(t==="collection"){if(ar.prototype[e])return i(e);ar.prototype[e]=n}else if(t==="layout"){for(var l=function(O){this.options=O,n.call(this,O),zt(this._private)||(this._private={}),this._private.cy=O.cy,this._private.listeners=[],this.createEmitter()},s=l.prototype=Object.create(n.prototype),u=[],f=0;f<u.length;f++){var c=u[f];s[c]=s[c]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var h=n.prototype.stop;s.stop=function(){var D=this.options;if(D&&D.animate){var O=this.animations;if(O)for(var L=0;L<O.length;L++)O[L].stop()}return h?h.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var v=function(O){return O._private.cy},p={addEventFields:function(O,L){L.layout=O,L.cy=v(O),L.target=O},bubble:function(){return!0},parent:function(O){return v(O)}};ht(s,{createEmitter:function(){return this._private.emitter=new ud(p,this),this},emitter:function(){return this._private.emitter},on:function(O,L){return this.emitter().on(O,L),this},one:function(O,L){return this.emitter().one(O,L),this},once:function(O,L){return this.emitter().one(O,L),this},removeListener:function(O,L){return this.emitter().removeListener(O,L),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(O,L){return this.emitter().emit(O,L),this}}),$t.eventAliasesOn(s),r=l}else if(t==="renderer"&&e!=="null"&&e!=="base"){var m=hT("renderer","base"),y=m.prototype,w=n,S=n.prototype,x=function(){m.apply(this,arguments),w.apply(this,arguments)},C=x.prototype;for(var T in y){var A=y[T],N=S[T]!=null;if(N)return i(T);C[T]=A}for(var k in S)C[k]=S[k];y.clientFunctions.forEach(function(D){C[D]=C[D]||function(){mn("Renderer does not implement `renderer."+D+"()` on its prototype")}}),r=x}else if(t==="__proto__"||t==="constructor"||t==="prototype")return mn(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return RS({map:cT,keys:[t,e],value:r})}function hT(t,e){return MS({map:cT,keys:[t,e]})}function iL(t,e,n,r,i){return RS({map:fT,keys:[t,e,n,r],value:i})}function lL(t,e,n,r){return MS({map:fT,keys:[t,e,n,r]})}var Vp=function(){if(arguments.length===2)return hT.apply(null,arguments);if(arguments.length===3)return dT.apply(null,arguments);if(arguments.length===4)return lL.apply(null,arguments);if(arguments.length===5)return iL.apply(null,arguments);mn("Invalid extension access syntax")};mu.prototype.extension=Vp;aL.forEach(function(t){t.extensions.forEach(function(e){dT(t.type,e.name,e.impl)})});var $f=function(){if(!(this instanceof $f))return new $f;this.length=0},Dl=$f.prototype;Dl.instanceString=function(){return"stylesheet"};Dl.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};Dl.css=function(t,e){var n=this.length-1;if(st(t))this[n].properties.push({name:t,value:e});else if(zt(t))for(var r=t,i=Object.keys(r),l=0;l<i.length;l++){var s=i[l],u=r[s];if(u!=null){var f=Yn.properties[s]||Yn.properties[Jf(s)];if(f!=null){var c=f.name,h=u;this[n].properties.push({name:c,value:h})}}}return this};Dl.style=Dl.css;Dl.generateStyle=function(t){var e=new Yn(t);return this.appendToStyle(e)};Dl.appendToStyle=function(t){for(var e=0;e<this.length;e++){var n=this[e],r=n.selector,i=n.properties;t.selector(r);for(var l=0;l<i.length;l++){var s=i[l];t.css(s.name,s.value)}}return t};var sL="3.33.2",Al=function(e){if(e===void 0&&(e={}),zt(e))return new mu(e);if(st(e))return Vp.apply(Vp,arguments)};Al.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Al),t.apply(null,e),this};Al.warnings=function(t){return PS(t)};Al.version=sL;Al.stylesheet=Al.Stylesheet=$f;const oL=[{id:"source",label:"Source",color:"#f59e0b",shape:"shape-round"},{id:"module",label:"Module",color:"#fb7185",shape:""},{id:"symbol",label:"Symbol",color:"#8b5cf6",shape:"shape-diamond"},{id:"rationale",label:"Rationale",color:"#14b8a6",shape:"shape-hex"},{id:"concept",label:"Concept",color:"#0ea5e9",shape:""},{id:"entity",label:"Entity",color:"#22c55e",shape:"shape-round"}],uL=[{label:"Structural (extracted)",color:"rgba(148, 163, 184, 0.7)",style:"line-solid"},{label:"Inferred",color:"rgba(56, 189, 248, 0.7)",style:"line-solid"},{label:"Conflicted",color:"var(--c-text-error)",style:"line-solid"},{label:"Similarity",color:"rgba(249, 115, 22, 0.7)",style:"line-dashed"}];function cL(){const[t,e]=Ee.useState(!0);return t?_.jsxs("aside",{className:"canvas-legend","aria-label":"Graph legend",children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[_.jsx("span",{className:"canvas-legend-heading",children:"Legend"}),_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>e(!1),"aria-label":"Hide legend",title:"Hide legend",children:"Γ"})]}),_.jsxs("div",{className:"canvas-legend-group",children:[_.jsx("span",{className:"label",children:"Nodes"}),oL.map(n=>_.jsxs("div",{className:"legend-row",children:[_.jsx("span",{className:`legend-swatch ${n.shape}`,style:{background:n.color},"aria-hidden":"true"}),_.jsx("span",{children:n.label})]},n.id))]}),_.jsxs("div",{className:"canvas-legend-group",style:{marginTop:"var(--sp-2)"},children:[_.jsx("span",{className:"label",children:"Edges"}),uL.map(n=>_.jsxs("div",{className:"legend-row",children:[_.jsx("span",{className:`legend-swatch ${n.style}`,style:{color:n.color},"aria-hidden":"true"}),_.jsx("span",{children:n.label})]},n.label))]})]}):_.jsx("button",{type:"button",className:"btn legend-toggle",onClick:()=>e(!0),title:"Show legend","aria-label":"Show legend",children:"Legend"})}const Ai=180,_i=120;function fL({cyRef:t}){const e=Ee.useRef(null),n=Ee.useRef(null),[r,i]=Ee.useState(null);Ee.useEffect(()=>{const s=t.current;if(!s)return;const u=()=>{const c=n.current?.getContext("2d");if(!c)return;c.clearRect(0,0,Ai,_i);const h=s.nodes();if(h.empty())return;const v=h.boundingBox({includeNodes:!0,includeEdges:!1}),p=v.w===0?1:v.w,m=v.h===0?1:v.h,y=Math.min((Ai-8)/p,(_i-8)/m),w=(Ai-p*y)/2,S=(_i-m*y)/2;c.fillStyle="rgba(125, 211, 252, 0.7)",h.forEach(k=>{const D=k.position(),O=(D.x-v.x1)*y+w,L=(D.y-v.y1)*y+S;c.beginPath(),c.arc(O,L,1.4,0,Math.PI*2),c.fill()});const x=s.extent(),C=(x.x1-v.x1)*y+w,T=(x.y1-v.y1)*y+S,A=(x.x2-x.x1)*y,N=(x.y2-x.y1)*y;i({x:Math.max(0,Math.min(Ai,C)),y:Math.max(0,Math.min(_i,T)),w:Math.max(2,Math.min(Ai,A)),h:Math.max(2,Math.min(_i,N))})};u();const f=()=>requestAnimationFrame(u);return s.on("pan zoom add remove position layoutstop",f),()=>{s.off("pan zoom add remove position layoutstop",f)}},[t]);const l=s=>{const u=t.current;if(!u||!e.current)return;const f=e.current.getBoundingClientRect(),c=s.clientX-f.left,h=s.clientY-f.top,v=u.nodes();if(v.empty())return;const p=v.boundingBox({includeNodes:!0,includeEdges:!1}),m=Math.min((Ai-8)/Math.max(1,p.w),(_i-8)/Math.max(1,p.h)),y=(Ai-p.w*m)/2,w=(_i-p.h*m)/2,S=(c-y)/m+p.x1,x=(h-w)/m+p.y1;u.center({position:()=>({x:S,y:x})})};return _.jsxs("div",{ref:e,className:"canvas-minimap",role:"presentation",onClick:l,"aria-hidden":"true",children:[_.jsx("canvas",{ref:n,width:Ai,height:_i,style:{width:"100%",height:"100%"}}),r?_.jsx("div",{className:"canvas-minimap-viewport",style:{left:r.x,top:r.y,width:r.w,height:r.h}}):null]})}function dL(t){typeof window>"u"||(window.__SWARMVAULT_TEST__={getNodeIds:()=>t.nodes().map(e=>e.id()),getConnectedNodePair:()=>{const e=t.edges()[0];return!e||e.empty()?null:{from:e.source().id(),to:e.target().id()}},getRenderedNodePosition:e=>{const n=t.getElementById(e);if(!n||n.empty())return null;const r=n.renderedPosition();return{x:r.x,y:r.y}},clearSelection:()=>{t.elements(":selected").unselect()},hasClass:(e,n)=>{const r=t.getElementById(e);return!r.empty()&&r.hasClass(n)}})}function hL(t,e){typeof window>"u"||!window.__SWARMVAULT_TEST__||e===t&&delete window.__SWARMVAULT_TEST__}const vL={source:"#f59e0b",module:"#fb7185",symbol:"#8b5cf6",rationale:"#14b8a6",concept:"#0ea5e9",entity:"#22c55e"},gL={cose:"Force (cose)",concentric:"Concentric",circle:"Circle",breadthfirst:"Hierarchy",grid:"Grid"},pL={cose:{name:"cose",animate:!1,idealEdgeLength:280,nodeRepulsion:12e4,nodeOverlap:60,gravity:.08,nestingFactor:1.2,edgeElasticity:100,numIter:3e3},concentric:{name:"concentric",animate:!1,minNodeSpacing:30,levelWidth:()=>1},circle:{name:"circle",animate:!1,radius:320},breadthfirst:{name:"breadthfirst",animate:!1,spacingFactor:1.4,directed:!0},grid:{name:"grid",animate:!1,padding:40}};function mL({graph:t,edgeStatusFilter:e,communityFilter:n,sourceClassFilter:r,tagFilter:i="all",pathResult:l,onNodeSelect:s,cyRef:u,fitTrigger:f,pageTags:c,onLayoutChange:h}){const v=Ee.useRef(null),[p,m]=Ee.useState("cose"),[y,w]=Ee.useState("auto"),S=Ee.useEffectEvent(O=>{s(O)}),x=Ee.useEffectEvent(O=>{u.current?.destroy(),u.current=O}),C=Ee.useEffectEvent(O=>{u.current===O&&(u.current=null),O.destroy()}),T=Ee.useEffectEvent(O=>{const L=u.current;if(L&&(L.elements().removeClass("path-node path-edge"),O)){for(const M of O.nodeIds)L.getElementById(M).addClass("path-node");for(const M of O.edgeIds)L.getElementById(M).addClass("path-edge")}}),A=Ee.useEffectEvent(()=>{u.current?.resize()}),N=(()=>{if(!t||i==="all"||!c)return null;const O=new Set;for(const L of t.nodes){if(!L.pageId)continue;c[L.pageId]?.includes(i)&&O.add(L.id)}return O})();Ee.useEffect(()=>{if(!v.current||!t)return;const O=new Set(t.nodes.filter(B=>n==="all"||B.communityId===n).filter(B=>r==="all"||(B.sourceClass??"")===r).filter(B=>!N||N.has(B.id)).map(B=>B.id)),L=y==="always"?"data(label)":y==="never"?"":"data(label)",M=y==="always"?0:y==="never"?999:.5,z=Al({container:v.current,elements:[...t.nodes.filter(B=>O.has(B.id)).map(B=>({data:{...B,color:vL[B.type]??"#94a3b8"}})),...t.edges.filter(B=>O.has(B.source)&&O.has(B.target)).filter(B=>e==="all"||B.status===e).map(B=>({data:B,classes:[B.relation==="semantically_similar_to"?"similarity-edge":"",B.status==="conflicted"?"conflicted-edge":"",B.status==="inferred"?"inferred-edge":""].filter(Boolean).join(" ")}))],layout:pL[p],style:[{selector:"node",style:{label:L,"background-color":"data(color)","background-opacity":.85,color:"var(--c-text-primary)","font-family":'"Inter", "Segoe UI", system-ui, sans-serif',"font-size":11,"font-weight":"normal","text-halign":"center","text-valign":"bottom","text-margin-y":7,"text-max-width":"100px","text-wrap":"ellipsis","min-zoomed-font-size":M,"text-background-opacity":.55,"text-background-color":"var(--c-bg-base)","text-background-padding":"2px","text-background-shape":"roundrectangle","border-width":0,"overlay-padding":4}},{selector:"node[?isGodNode]",style:{width:56,height:56,"border-width":1.5,"border-color":"rgba(254, 240, 138, 0.65)","border-opacity":1,"background-opacity":1,"font-size":12,"font-weight":"bold","text-max-width":"140px","z-index":12}},{selector:'node[type = "module"]',style:{shape:"round-rectangle",width:44,height:28,"z-index":8}},{selector:'node[type = "symbol"]',style:{shape:"diamond",width:20,height:20,"background-opacity":.6}},{selector:'node[type = "rationale"]',style:{shape:"hexagon",width:28,height:28,"background-opacity":.75}},{selector:'node[type = "source"]',style:{shape:"ellipse",width:32,height:32,"background-opacity":.95,"z-index":10}},{selector:'node[type = "concept"]',style:{shape:"round-rectangle",width:34,height:22,"background-opacity":.7}},{selector:'node[type = "entity"]',style:{shape:"ellipse",width:26,height:26,"background-opacity":.7}},{selector:"edge",style:{width:.8,"line-color":"rgba(71, 85, 105, 0.45)","target-arrow-shape":"triangle-backcurve","target-arrow-color":"rgba(71, 85, 105, 0.45)","arrow-scale":.6,"curve-style":"bezier","font-size":8,"text-background-opacity":0,"text-background-color":"var(--c-bg-base)","text-background-padding":"2px","text-background-shape":"roundrectangle","text-rotation":"autorotate","text-margin-y":-8}},{selector:"edge:selected",style:{label:"data(relation)",width:2,"text-background-opacity":.7}},{selector:".similarity-edge",style:{"line-style":"dashed","line-color":"rgba(249, 115, 22, 0.5)","target-arrow-color":"rgba(249, 115, 22, 0.5)","line-dash-pattern":[6,4]}},{selector:".inferred-edge",style:{"line-color":"rgba(56, 189, 248, 0.6)","target-arrow-color":"rgba(56, 189, 248, 0.6)"}},{selector:".conflicted-edge",style:{"line-color":"rgba(248, 113, 113, 0.7)","target-arrow-color":"rgba(248, 113, 113, 0.7)",width:1.5}},{selector:".path-node",style:{"border-width":3,"border-color":"#38bdf8","background-opacity":1,"z-index":100}},{selector:".path-edge",style:{width:2.5,"line-color":"#38bdf8","target-arrow-color":"#38bdf8",label:"data(relation)","text-background-opacity":.7,"z-index":100}},{selector:":selected",style:{"border-width":2,"border-color":"#e2e8f0"}},{selector:"node:active",style:{"overlay-color":"#38bdf8","overlay-opacity":.12}}]});return z.on("select","node",B=>S(B.target.data())),z.on("unselect","node",()=>S(null)),z.on("mouseover","edge",B=>{B.target.style("label",B.target.data("relation")??""),B.target.style("width",1.8),B.target.style("z-index",999)}),z.on("mouseout","edge",B=>{!B.target.selected()&&!B.target.hasClass("path-edge")&&(B.target.removeStyle("label"),B.target.removeStyle("width"),B.target.removeStyle("z-index"))}),z.on("mouseover","node",B=>{B.target.style("text-max-width","200px"),B.target.style("text-wrap","wrap"),B.target.style("z-index",999)}),z.on("mouseout","node",B=>{B.target.selected()||(B.target.removeStyle("text-max-width"),B.target.removeStyle("text-wrap"),B.target.removeStyle("z-index"))}),x(z),dL(z),()=>{hL(z,u.current),C(z)}},[n,e,t,r,p,y,N,u]),Ee.useEffect(()=>{T(l)},[l]),Ee.useEffect(()=>{const O=v.current;if(!O)return;const L=new ResizeObserver(()=>A());return L.observe(O),()=>L.disconnect()},[]),Ee.useEffect(()=>{f!=null&&u.current?.fit(void 0,30)},[f,u.current?.fit]);const k=()=>u.current?.fit(void 0,30),D=()=>u.current?.reset();return _.jsxs("div",{className:"canvas-wrap",children:[_.jsxs("div",{className:"canvas-toolbar",role:"toolbar","aria-label":"Graph view controls",children:[_.jsxs("div",{className:"canvas-toolbar-group",children:[_.jsx("label",{htmlFor:"layout-select",className:"label",children:"Layout"}),_.jsx("select",{id:"layout-select",className:"input",value:p,onChange:O=>{const L=O.target.value;m(L),h?.(L)},children:Object.entries(gL).map(([O,L])=>_.jsx("option",{value:O,children:L},O))})]}),_.jsxs("div",{className:"canvas-toolbar-group",children:[_.jsx("label",{htmlFor:"label-mode",className:"label",children:"Labels"}),_.jsxs("select",{id:"label-mode",className:"input",value:y,onChange:O=>w(O.target.value),children:[_.jsx("option",{value:"auto",children:"Auto"}),_.jsx("option",{value:"always",children:"Always"}),_.jsx("option",{value:"never",children:"Never"})]})]}),_.jsxs("div",{className:"canvas-toolbar-group",children:[_.jsx("button",{type:"button",className:"btn",onClick:k,title:"Fit to viewport (F)",children:"Fit"}),_.jsx("button",{type:"button",className:"btn",onClick:D,title:"Reset zoom",children:"Reset"})]})]}),_.jsx("div",{className:"canvas","data-testid":"graph-canvas",ref:v}),_.jsx(cL,{}),_.jsx(fL,{cyRef:u})]})}function yL({graphQueryInput:t,onGraphQueryInputChange:e,onRunQuery:n,graphQueryResult:r,pathFrom:i,onPathFromChange:l,pathTo:s,onPathToChange:u,onHighlightPath:f,pathResult:c,graphError:h,graph:v,onOpenPage:p,onNavigateNode:m}){return _.jsxs("section",{className:"panel","data-testid":"graph-tools",children:[_.jsx("h3",{className:"panel-heading",children:"Graph Tools"}),h?_.jsx("p",{className:"text-error",children:h}):null,_.jsxs("div",{className:"card-list",children:[_.jsxs("article",{className:"card",children:[_.jsx("span",{className:"label",children:"query"}),_.jsx("input",{type:"search",className:"input","data-testid":"graph-query-input","aria-label":"Graph query",value:t,onChange:y=>e(y.target.value),placeholder:"Ask a question about the graph\\u2026"}),_.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"graph-query-run",onClick:n,children:"Run"}),r?_.jsxs(_.Fragment,{children:[_.jsx("p",{className:"text-secondary text-sm",children:r.summary}),_.jsxs("div",{className:"chip-row",children:[r.hyperedgeIds.map(y=>v?.hyperedges?.find(w=>w.id===y)).filter(y=>!!y).slice(0,2).map(y=>_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{const w=y.nodeIds[0];w&&m(w)},children:y.label},y.id)),r.pageIds.map(y=>v?.pages?.find(w=>w.id===y)).filter(y=>!!y).slice(0,4).map(y=>_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{p(y.path,y.id)},children:y.title},y.id))]})]}):null]}),_.jsxs("article",{className:"card",children:[_.jsx("span",{className:"label",children:"path"}),_.jsx("input",{type:"text",className:"input","data-testid":"graph-path-from","aria-label":"Path from node",value:i,onChange:y=>l(y.target.value),placeholder:"From node ID or label\\u2026"}),_.jsx("input",{type:"text",className:"input","data-testid":"graph-path-to","aria-label":"Path to node",value:s,onChange:y=>u(y.target.value),placeholder:"To node ID or label\\u2026"}),_.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"graph-path-highlight",onClick:f,children:"Highlight"}),c?_.jsx("p",{className:"text-secondary text-sm","data-testid":"graph-path-summary",children:c.summary}):null]})]})]})}const bL={error:"is-error",warning:"is-warning",info:"is-info"};function EL({findings:t,error:e,onOpenPage:n}){if(e)return _.jsxs("section",{className:"panel","aria-label":"Lint findings",children:[_.jsx("h3",{className:"panel-heading",children:"Lint Findings"}),_.jsx("p",{className:"text-error",children:e})]});if(!t.length)return _.jsxs("section",{className:"panel","aria-label":"Lint findings",children:[_.jsx("h3",{className:"panel-heading",children:"Lint Findings"}),_.jsxs("p",{className:"text-muted text-sm",children:["No lint findings. Run ",_.jsx("code",{children:"swarmvault lint --deep"})," for a fresh sweep."]})]});const r=t.reduce((i,l)=>{const s=i[l.category]??[];return s.push(l),i[l.category]=s,i},{});return _.jsxs("section",{className:"panel","aria-label":"Lint findings",children:[_.jsxs("h3",{className:"panel-heading",children:["Lint Findings ",_.jsxs("span",{className:"panel-meta",children:[t.length," total"]})]}),_.jsx("div",{className:"card-list",children:Object.entries(r).map(([i,l])=>_.jsxs("div",{children:[_.jsxs("p",{className:"label",style:{marginBottom:4},children:[i," Β· ",l.length]}),_.jsxs("div",{className:"card-list",children:[l.slice(0,12).map(s=>_.jsxs("article",{className:`lint-finding ${bL[s.severity]}`,children:[_.jsx("strong",{className:"text-sm",children:s.message}),s.pagePath?_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{n(s.pagePath??"",s.pageId)},children:"Open page"}):null]},s.id)),l.length>12?_.jsxs("p",{className:"text-muted text-sm",children:["+",l.length-12," more"]}):null]})]},i))})]})}function xL(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const wL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CL={};function vw(t,e){return(CL.jsx?SL:wL).test(t)}const TL=/[ \t\n\f\r]/g;function DL(t){return typeof t=="object"?t.type==="text"?gw(t.value):!1:gw(t)}function gw(t){return t.replace(TL,"")===""}class Bu{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Bu.prototype.normal={};Bu.prototype.property={};Bu.prototype.space=void 0;function vT(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Bu(n,r,e)}function $p(t){return t.toLowerCase()}class Or{constructor(e,n){this.attribute=n,this.property=e}}Or.prototype.attribute="";Or.prototype.booleanish=!1;Or.prototype.boolean=!1;Or.prototype.commaOrSpaceSeparated=!1;Or.prototype.commaSeparated=!1;Or.prototype.defined=!1;Or.prototype.mustUseProperty=!1;Or.prototype.number=!1;Or.prototype.overloadedBoolean=!1;Or.prototype.property="";Or.prototype.spaceSeparated=!1;Or.prototype.space=void 0;let AL=0;const Ct=Rl(),Fn=Rl(),Kp=Rl(),Be=Rl(),un=Rl(),Ls=Rl(),qr=Rl();function Rl(){return 2**++AL}const Yp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ct,booleanish:Fn,commaOrSpaceSeparated:qr,commaSeparated:Ls,number:Be,overloadedBoolean:Kp,spaceSeparated:un},Symbol.toStringTag,{value:"Module"})),ip=Object.keys(Yp);class Nm extends Or{constructor(e,n,r,i){let l=-1;if(super(e,n),pw(this,"space",i),typeof r=="number")for(;++l<ip.length;){const s=ip[l];pw(this,ip[l],(r&Yp[s])===Yp[s])}}}Nm.prototype.defined=!0;function pw(t,e,n){n&&(t[e]=n)}function $s(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const l=new Nm(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),e[r]=l,n[$p(r)]=r,n[$p(l.attribute)]=r}return new Bu(e,n,t.space)}const gT=$s({properties:{ariaActiveDescendant:null,ariaAtomic:Fn,ariaAutoComplete:null,ariaBusy:Fn,ariaChecked:Fn,ariaColCount:Be,ariaColIndex:Be,ariaColSpan:Be,ariaControls:un,ariaCurrent:null,ariaDescribedBy:un,ariaDetails:null,ariaDisabled:Fn,ariaDropEffect:un,ariaErrorMessage:null,ariaExpanded:Fn,ariaFlowTo:un,ariaGrabbed:Fn,ariaHasPopup:null,ariaHidden:Fn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:un,ariaLevel:Be,ariaLive:null,ariaModal:Fn,ariaMultiLine:Fn,ariaMultiSelectable:Fn,ariaOrientation:null,ariaOwns:un,ariaPlaceholder:null,ariaPosInSet:Be,ariaPressed:Fn,ariaReadOnly:Fn,ariaRelevant:null,ariaRequired:Fn,ariaRoleDescription:un,ariaRowCount:Be,ariaRowIndex:Be,ariaRowSpan:Be,ariaSelected:Fn,ariaSetSize:Be,ariaSort:null,ariaValueMax:Be,ariaValueMin:Be,ariaValueNow:Be,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function pT(t,e){return e in t?t[e]:e}function mT(t,e){return pT(t,e.toLowerCase())}const _L=$s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ls,acceptCharset:un,accessKey:un,action:null,allow:null,allowFullScreen:Ct,allowPaymentRequest:Ct,allowUserMedia:Ct,alt:null,as:null,async:Ct,autoCapitalize:null,autoComplete:un,autoFocus:Ct,autoPlay:Ct,blocking:un,capture:null,charSet:null,checked:Ct,cite:null,className:un,cols:Be,colSpan:null,content:null,contentEditable:Fn,controls:Ct,controlsList:un,coords:Be|Ls,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ct,defer:Ct,dir:null,dirName:null,disabled:Ct,download:Kp,draggable:Fn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ct,formTarget:null,headers:un,height:Be,hidden:Kp,high:Be,href:null,hrefLang:null,htmlFor:un,httpEquiv:un,id:null,imageSizes:null,imageSrcSet:null,inert:Ct,inputMode:null,integrity:null,is:null,isMap:Ct,itemId:null,itemProp:un,itemRef:un,itemScope:Ct,itemType:un,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ct,low:Be,manifest:null,max:null,maxLength:Be,media:null,method:null,min:null,minLength:Be,multiple:Ct,muted:Ct,name:null,nonce:null,noModule:Ct,noValidate:Ct,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ct,optimum:Be,pattern:null,ping:un,placeholder:null,playsInline:Ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ct,referrerPolicy:null,rel:un,required:Ct,reversed:Ct,rows:Be,rowSpan:Be,sandbox:un,scope:null,scoped:Ct,seamless:Ct,selected:Ct,shadowRootClonable:Ct,shadowRootDelegatesFocus:Ct,shadowRootMode:null,shape:null,size:Be,sizes:null,slot:null,span:Be,spellCheck:Fn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Be,step:null,style:null,tabIndex:Be,target:null,title:null,translate:null,type:null,typeMustMatch:Ct,useMap:null,value:Fn,width:Be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:un,axis:null,background:null,bgColor:null,border:Be,borderColor:null,bottomMargin:Be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ct,declare:Ct,event:null,face:null,frame:null,frameBorder:null,hSpace:Be,leftMargin:Be,link:null,longDesc:null,lowSrc:null,marginHeight:Be,marginWidth:Be,noResize:Ct,noHref:Ct,noShade:Ct,noWrap:Ct,object:null,profile:null,prompt:null,rev:null,rightMargin:Be,rules:null,scheme:null,scrolling:Fn,standby:null,summary:null,text:null,topMargin:Be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ct,disableRemotePlayback:Ct,prefix:null,property:null,results:Be,security:null,unselectable:null},space:"html",transform:mT}),kL=$s({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:qr,accentHeight:Be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Be,amplitude:Be,arabicForm:null,ascent:Be,attributeName:null,attributeType:null,azimuth:Be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Be,by:null,calcMode:null,capHeight:Be,className:un,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Be,diffuseConstant:Be,direction:null,display:null,dur:null,divisor:Be,dominantBaseline:null,download:Ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:Be,enableBackground:null,end:null,event:null,exponent:Be,externalResourcesRequired:null,fill:null,fillOpacity:Be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ls,g2:Ls,glyphName:Ls,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Be,horizOriginX:Be,horizOriginY:Be,id:null,ideographic:Be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Be,k:Be,k1:Be,k2:Be,k3:Be,k4:Be,kernelMatrix:qr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Be,overlineThickness:Be,paintOrder:null,panose1:null,path:null,pathLength:Be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:un,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Be,pointsAtY:Be,pointsAtZ:Be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:qr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:qr,rev:qr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:qr,requiredFeatures:qr,requiredFonts:qr,requiredFormats:qr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Be,specularExponent:Be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Be,strikethroughThickness:Be,string:null,stroke:null,strokeDashArray:qr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Be,strokeOpacity:Be,strokeWidth:null,style:null,surfaceScale:Be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:qr,tabIndex:Be,tableValues:null,target:null,targetX:Be,targetY:Be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:qr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Be,underlineThickness:Be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Be,values:null,vAlphabetic:Be,vMathematical:Be,vectorEffect:null,vHanging:Be,vIdeographic:Be,version:null,vertAdvY:Be,vertOriginX:Be,vertOriginY:Be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pT}),yT=$s({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),bT=$s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mT}),ET=$s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),NL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},RL=/[A-Z]/g,mw=/-[a-z]/g,ML=/^data[-\w.:]+$/i;function OL(t,e){const n=$p(e);let r=e,i=Or;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ML.test(e)){if(e.charAt(4)==="-"){const l=e.slice(5).replace(mw,LL);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=e.slice(4);if(!mw.test(l)){let s=l.replace(RL,BL);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=Nm}return new i(r,e)}function BL(t){return"-"+t.toLowerCase()}function LL(t){return t.charAt(1).toUpperCase()}const FL=vT([gT,_L,yT,bT,ET],"html"),Rm=vT([gT,kL,yT,bT,ET],"svg");function IL(t){return t.join(" ").trim()}var xs={},lp,yw;function zL(){if(yw)return lp;yw=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,f=`
|
|
335
|
+
`,c="/",h="*",v="",p="comment",m="declaration";function y(S,x){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];x=x||{};var C=1,T=1;function A(V){var $=V.match(e);$&&(C+=$.length);var q=V.lastIndexOf(f);T=~q?V.length-q:T+V.length}function N(){var V={line:C,column:T};return function($){return $.position=new k(V),L(),$}}function k(V){this.start=V,this.end={line:C,column:T},this.source=x.source}k.prototype.content=S;function D(V){var $=new Error(x.source+":"+C+":"+T+": "+V);if($.reason=V,$.filename=x.source,$.line=C,$.column=T,$.source=S,!x.silent)throw $}function O(V){var $=V.exec(S);if($){var q=$[0];return A(q),S=S.slice(q.length),$}}function L(){O(n)}function M(V){var $;for(V=V||[];$=z();)$!==!1&&V.push($);return V}function z(){var V=N();if(!(c!=S.charAt(0)||h!=S.charAt(1))){for(var $=2;v!=S.charAt($)&&(h!=S.charAt($)||c!=S.charAt($+1));)++$;if($+=2,v===S.charAt($-1))return D("End of comment missing");var q=S.slice(2,$-2);return T+=2,A(q),S=S.slice($),T+=2,V({type:p,comment:q})}}function B(){var V=N(),$=O(r);if($){if(z(),!O(i))return D("property missing ':'");var q=O(l),H=V({type:m,property:w($[0].replace(t,v)),value:q?w(q[0].replace(t,v)):v});return O(s),H}}function U(){var V=[];M(V);for(var $;$=B();)$!==!1&&(V.push($),M(V));return V}return L(),U()}function w(S){return S?S.replace(u,v):v}return lp=y,lp}var bw;function PL(){if(bw)return xs;bw=1;var t=xs&&xs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xs,"__esModule",{value:!0}),xs.default=n;const e=t(zL());function n(r,i){let l=null;if(!r||typeof r!="string")return l;const s=(0,e.default)(r),u=typeof i=="function";return s.forEach(f=>{if(f.type!=="declaration")return;const{property:c,value:h}=f;u?i(c,h,f):h&&(l=l||{},l[c]=h)}),l}return xs}var Yo={},Ew;function UL(){if(Ew)return Yo;Ew=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(c){return!c||n.test(c)||t.test(c)},s=function(c,h){return h.toUpperCase()},u=function(c,h){return"".concat(h,"-")},f=function(c,h){return h===void 0&&(h={}),l(c)?c:(c=c.toLowerCase(),h.reactCompat?c=c.replace(i,u):c=c.replace(r,u),c.replace(e,s))};return Yo.camelCase=f,Yo}var Xo,xw;function qL(){if(xw)return Xo;xw=1;var t=Xo&&Xo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(PL()),n=UL();function r(i,l){var s={};return!i||typeof i!="string"||(0,e.default)(i,function(u,f){u&&f&&(s[(0,n.camelCase)(u,l)]=f)}),s}return r.default=r,Xo=r,Xo}var HL=qL();const jL=xu(HL),xT=wT("end"),Mm=wT("start");function wT(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function GL(t){const e=Mm(t),n=xT(t);if(e&&n)return{start:e,end:n}}function lu(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?ww(t.position):"start"in t||"end"in t?ww(t):"line"in t||"column"in t?Xp(t):""}function Xp(t){return Sw(t&&t.line)+":"+Sw(t&&t.column)}function ww(t){return Xp(t&&t.start)+"-"+Xp(t&&t.end)}function Sw(t){return t&&typeof t=="number"?t:1}class hr extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},s=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof e=="string"?i=e:!l.cause&&e&&(s=!0,i=e.message,l.cause=e),!l.ruleId&&!l.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?l.ruleId=r:(l.source=r.slice(0,f),l.ruleId=r.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const u=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=lu(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=s&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}hr.prototype.file="";hr.prototype.name="";hr.prototype.reason="";hr.prototype.message="";hr.prototype.stack="";hr.prototype.column=void 0;hr.prototype.line=void 0;hr.prototype.ancestors=void 0;hr.prototype.cause=void 0;hr.prototype.fatal=void 0;hr.prototype.place=void 0;hr.prototype.ruleId=void 0;hr.prototype.source=void 0;const Om={}.hasOwnProperty,VL=new Map,$L=/[A-Z]/g,KL=new Set(["table","tbody","thead","tfoot","tr"]),YL=new Set(["td","th"]),ST="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function XL(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=rF(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=nF(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Rm:FL,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},l=CT(i,t,void 0);return l&&typeof l!="string"?l:i.create(t,i.Fragment,{children:l||void 0},void 0)}function CT(t,e,n){if(e.type==="element")return ZL(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return QL(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return JL(t,e,n);if(e.type==="mdxjsEsm")return WL(t,e);if(e.type==="root")return eF(t,e,n);if(e.type==="text")return tF(t,e)}function ZL(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Rm,t.schema=i),t.ancestors.push(e);const l=DT(t,e.tagName,!1),s=aF(t,e);let u=Lm(t,e);return KL.has(e.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!DL(f):!0})),TT(t,s,l,e),Bm(s,u),t.ancestors.pop(),t.schema=r,t.create(e,l,s,n)}function QL(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}bu(t,e.position)}function WL(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);bu(t,e.position)}function JL(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Rm,t.schema=i),t.ancestors.push(e);const l=e.name===null?t.Fragment:DT(t,e.name,!0),s=iF(t,e),u=Lm(t,e);return TT(t,s,l,e),Bm(s,u),t.ancestors.pop(),t.schema=r,t.create(e,l,s,n)}function eF(t,e,n){const r={};return Bm(r,Lm(t,e)),t.create(e,t.Fragment,r,n)}function tF(t,e){return e.value}function TT(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Bm(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function nF(t,e,n){return r;function r(i,l,s,u){const c=Array.isArray(s.children)?n:e;return u?c(l,s,u):c(l,s)}}function rF(t,e){return n;function n(r,i,l,s){const u=Array.isArray(l.children),f=Mm(r);return e(i,l,s,u,{columnNumber:f?f.column-1:void 0,fileName:t,lineNumber:f?f.line:void 0},void 0)}}function aF(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&Om.call(e.properties,i)){const l=lF(t,i,e.properties[i]);if(l){const[s,u]=l;t.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&YL.has(e.tagName)?r=u:n[s]=u}}if(r){const l=n.style||(n.style={});l[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function iF(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];l.type;const s=l.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else bu(t,e.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const u=r.value.data.estree.body[0];u.type,l=t.evaluater.evaluateExpression(u.expression)}else bu(t,e.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Lm(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:VL;for(;++r<e.children.length;){const l=e.children[r];let s;if(t.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const c=i.get(f)||0;s=f+"-"+c,i.set(f,c+1)}}const u=CT(t,l,s);u!==void 0&&n.push(u)}return n}function lF(t,e,n){const r=OL(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?xL(n):IL(n)),r.property==="style"){let i=typeof n=="object"?n:sF(t,String(n));return t.stylePropertyNameCase==="css"&&(i=oF(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?NL[r.property]||r.property:r.attribute,n]}}function sF(t,e){try{return jL(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new hr("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=ST+"#cannot-parse-style-attribute",i}}function DT(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let l=-1,s;for(;++l<i.length;){const u=vw(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};s=s?{type:"MemberExpression",object:s,property:u,computed:!!(l&&u.type==="Literal"),optional:!1}:u}r=s}else r=vw(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return Om.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);bu(t)}function bu(t,e){const n=new hr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=ST+"#cannot-handle-mdx-estrees-without-createevaluater",n}function oF(t){const e={};let n;for(n in t)Om.call(t,n)&&(e[uF(n)]=t[n]);return e}function uF(t){let e=t.replace($L,cF);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function cF(t){return"-"+t.toLowerCase()}const sp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fF={};function Fm(t,e){const n=fF,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return AT(t,r,i)}function AT(t,e,n){if(dF(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Cw(t.children,e,n)}return Array.isArray(t)?Cw(t,e,n):""}function Cw(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=AT(t[i],e,n);return r.join("")}function dF(t){return!!(t&&typeof t=="object")}const Tw=document.createElement("i");function Im(t){const e="&"+t+";";Tw.innerHTML=e;const n=Tw.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function jr(t,e,n,r){const i=t.length;let l=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);l<r.length;)s=r.slice(l,l+1e4),s.unshift(e,0),t.splice(...s),l+=1e4,e+=1e4}function ra(t,e){return t.length>0?(jr(t,t.length,0,e),t):e}const Dw={}.hasOwnProperty;function _T(t){const e={};let n=-1;for(;++n<t.length;)hF(e,t[n]);return e}function hF(t,e){let n;for(n in e){const i=(Dw.call(t,n)?t[n]:void 0)||(t[n]={}),l=e[n];let s;if(l)for(s in l){Dw.call(i,s)||(i[s]=[]);const u=l[s];vF(i[s],Array.isArray(u)?u:u?[u]:[])}}}function vF(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);jr(t,0,0,r)}function kT(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"οΏ½":String.fromCodePoint(n)}function fa(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yr=Ki(/[A-Za-z]/),ur=Ki(/[\dA-Za-z]/),gF=Ki(/[#-'*+\--9=?A-Z^-~]/);function Kf(t){return t!==null&&(t<32||t===127)}const Zp=Ki(/\d/),pF=Ki(/[\dA-Fa-f]/),mF=Ki(/[!-/:-@[-`{-~]/);function dt(t){return t!==null&&t<-2}function sn(t){return t!==null&&(t<0||t===32)}function kt(t){return t===-2||t===-1||t===32}const md=Ki(new RegExp("\\p{P}|\\p{S}","u")),_l=Ki(/\s/);function Ki(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Ks(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const l=t.charCodeAt(n);let s="";if(l===37&&ur(t.charCodeAt(n+1))&&ur(t.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(s=String.fromCharCode(l));else if(l>55295&&l<57344){const u=t.charCodeAt(n+1);l<56320&&u>56319&&u<57344?(s=String.fromCharCode(l,u),i=1):s="οΏ½"}else s=String.fromCharCode(l);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Lt(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return s;function s(f){return kt(f)?(t.enter(n),u(f)):e(f)}function u(f){return kt(f)&&l++<i?(t.consume(f),u):(t.exit(n),e(f))}}const yF={tokenize:bF};function bF(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),Lt(t,e,"linePrefix")}function i(u){return t.enter("paragraph"),l(u)}function l(u){const f=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,s(u)}function s(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return dt(u)?(t.consume(u),t.exit("chunkText"),l):(t.consume(u),s)}}const EF={tokenize:xF},Aw={tokenize:wF};function xF(t){const e=this,n=[];let r=0,i,l,s;return u;function u(T){if(r<n.length){const A=n[r];return e.containerState=A[1],t.attempt(A[0].continuation,f,c)(T)}return c(T)}function f(T){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&C();const A=e.events.length;let N=A,k;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){k=e.events[N][1].end;break}x(r);let D=A;for(;D<e.events.length;)e.events[D][1].end={...k},D++;return jr(e.events,N+1,0,e.events.slice(A)),e.events.length=D,c(T)}return u(T)}function c(T){if(r===n.length){if(!i)return p(T);if(i.currentConstruct&&i.currentConstruct.concrete)return y(T);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Aw,h,v)(T)}function h(T){return i&&C(),x(r),p(T)}function v(T){return e.parser.lazy[e.now().line]=r!==n.length,s=e.now().offset,y(T)}function p(T){return e.containerState={},t.attempt(Aw,m,y)(T)}function m(T){return r++,n.push([e.currentConstruct,e.containerState]),p(T)}function y(T){if(T===null){i&&C(),x(0),t.consume(T);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),w(T)}function w(T){if(T===null){S(t.exit("chunkFlow"),!0),x(0),t.consume(T);return}return dt(T)?(t.consume(T),S(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(T),w)}function S(T,A){const N=e.sliceStream(T);if(A&&N.push(null),T.previous=l,l&&(l.next=T),l=T,i.defineSkip(T.start),i.write(N),e.parser.lazy[T.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const D=e.events.length;let O=D,L,M;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(L){M=e.events[O][1].end;break}L=!0}for(x(r),k=D;k<e.events.length;)e.events[k][1].end={...M},k++;jr(e.events,O+1,0,e.events.slice(D)),e.events.length=k}}function x(T){let A=n.length;for(;A-- >T;){const N=n[A];e.containerState=N[1],N[0].exit.call(e,t)}n.length=T}function C(){i.write([null]),l=void 0,i=void 0,e.containerState._closeFlow=void 0}}function wF(t,e,n){return Lt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ps(t){if(t===null||sn(t)||_l(t))return 1;if(md(t))return 2}function yd(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const l=t[i].resolveAll;l&&!r.includes(l)&&(e=l(e,n),r.push(l))}return e}const Qp={name:"attention",resolveAll:SF,tokenize:CF};function SF(t,e){let n=-1,r,i,l,s,u,f,c,h;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;f=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const v={...t[r][1].end},p={...t[n][1].start};_w(v,-f),_w(p,f),s={type:f>1?"strongSequence":"emphasisSequence",start:v,end:{...t[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},l={type:f>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},t[r][1].end={...s.start},t[n][1].start={...u.end},c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=ra(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=ra(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",l,e]]),c=ra(c,yd(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=ra(c,[["exit",l,e],["enter",u,e],["exit",u,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(h=2,c=ra(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):h=0,jr(t,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function CF(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ps(r);let l;return s;function s(f){return l=f,t.enter("attentionSequence"),u(f)}function u(f){if(f===l)return t.consume(f),u;const c=t.exit("attentionSequence"),h=Ps(f),v=!h||h===2&&i||n.includes(f),p=!i||i===2&&h||n.includes(r);return c._open=!!(l===42?v:v&&(i||!p)),c._close=!!(l===42?p:p&&(h||!v)),e(f)}}function _w(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const TF={name:"autolink",tokenize:DF};function DF(t,e,n){let r=0;return i;function i(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),l}function l(m){return yr(m)?(t.consume(m),s):m===64?n(m):c(m)}function s(m){return m===43||m===45||m===46||ur(m)?(r=1,u(m)):c(m)}function u(m){return m===58?(t.consume(m),r=0,f):(m===43||m===45||m===46||ur(m))&&r++<32?(t.consume(m),u):(r=0,c(m))}function f(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):m===null||m===32||m===60||Kf(m)?n(m):(t.consume(m),f)}function c(m){return m===64?(t.consume(m),h):gF(m)?(t.consume(m),c):n(m)}function h(m){return ur(m)?v(m):n(m)}function v(m){return m===46?(t.consume(m),r=0,h):m===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):p(m)}function p(m){if((m===45||ur(m))&&r++<63){const y=m===45?p:v;return t.consume(m),y}return n(m)}}const Lu={partial:!0,tokenize:AF};function AF(t,e,n){return r;function r(l){return kt(l)?Lt(t,i,"linePrefix")(l):i(l)}function i(l){return l===null||dt(l)?e(l):n(l)}}const NT={continuation:{tokenize:kF},exit:NF,name:"blockQuote",tokenize:_F};function _F(t,e,n){const r=this;return i;function i(s){if(s===62){const u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),l}return n(s)}function l(s){return kt(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function kF(t,e,n){const r=this;return i;function i(s){return kt(s)?Lt(t,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):l(s)}function l(s){return t.attempt(NT,e,n)(s)}}function NF(t){t.exit("blockQuote")}const RT={name:"characterEscape",tokenize:RF};function RF(t,e,n){return r;function r(l){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(l),t.exit("escapeMarker"),i}function i(l){return mF(l)?(t.enter("characterEscapeValue"),t.consume(l),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(l)}}const MT={name:"characterReference",tokenize:MF};function MF(t,e,n){const r=this;let i=0,l,s;return u;function u(v){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(v),t.exit("characterReferenceMarker"),f}function f(v){return v===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(v),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),l=31,s=ur,h(v))}function c(v){return v===88||v===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(v),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),l=6,s=pF,h):(t.enter("characterReferenceValue"),l=7,s=Zp,h(v))}function h(v){if(v===59&&i){const p=t.exit("characterReferenceValue");return s===ur&&!Im(r.sliceSerialize(p))?n(v):(t.enter("characterReferenceMarker"),t.consume(v),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(v)&&i++<l?(t.consume(v),h):n(v)}}const kw={partial:!0,tokenize:BF},Nw={concrete:!0,name:"codeFenced",tokenize:OF};function OF(t,e,n){const r=this,i={partial:!0,tokenize:N};let l=0,s=0,u;return f;function f(k){return c(k)}function c(k){const D=r.events[r.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,u=k,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),h(k)}function h(k){return k===u?(s++,t.consume(k),h):s<3?n(k):(t.exit("codeFencedFenceSequence"),kt(k)?Lt(t,v,"whitespace")(k):v(k))}function v(k){return k===null||dt(k)?(t.exit("codeFencedFence"),r.interrupt?e(k):t.check(kw,w,A)(k)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||dt(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),v(k)):kt(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Lt(t,m,"whitespace")(k)):k===96&&k===u?n(k):(t.consume(k),p)}function m(k){return k===null||dt(k)?v(k):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===null||dt(k)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),v(k)):k===96&&k===u?n(k):(t.consume(k),y)}function w(k){return t.attempt(i,A,S)(k)}function S(k){return t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),x}function x(k){return l>0&&kt(k)?Lt(t,C,"linePrefix",l+1)(k):C(k)}function C(k){return k===null||dt(k)?t.check(kw,w,A)(k):(t.enter("codeFlowValue"),T(k))}function T(k){return k===null||dt(k)?(t.exit("codeFlowValue"),C(k)):(t.consume(k),T)}function A(k){return t.exit("codeFenced"),e(k)}function N(k,D,O){let L=0;return M;function M($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),z}function z($){return k.enter("codeFencedFence"),kt($)?Lt(k,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):B($)}function B($){return $===u?(k.enter("codeFencedFenceSequence"),U($)):O($)}function U($){return $===u?(L++,k.consume($),U):L>=s?(k.exit("codeFencedFenceSequence"),kt($)?Lt(k,V,"whitespace")($):V($)):O($)}function V($){return $===null||dt($)?(k.exit("codeFencedFence"),D($)):O($)}}}function BF(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),l)}function l(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const op={name:"codeIndented",tokenize:FF},LF={partial:!0,tokenize:IF};function FF(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Lt(t,l,"linePrefix",5)(c)}function l(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?f(c):dt(c)?t.attempt(LF,s,f)(c):(t.enter("codeFlowValue"),u(c))}function u(c){return c===null||dt(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),u)}function f(c){return t.exit("codeIndented"),e(c)}}function IF(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):dt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Lt(t,l,"linePrefix",5)(s)}function l(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):dt(s)?i(s):n(s)}}const zF={name:"codeText",previous:UF,resolve:PF,tokenize:qF};function PF(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function UF(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qF(t,e,n){let r=0,i,l;return s;function s(v){return t.enter("codeText"),t.enter("codeTextSequence"),u(v)}function u(v){return v===96?(t.consume(v),r++,u):(t.exit("codeTextSequence"),f(v))}function f(v){return v===null?n(v):v===32?(t.enter("space"),t.consume(v),t.exit("space"),f):v===96?(l=t.enter("codeTextSequence"),i=0,h(v)):dt(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),f):(t.enter("codeTextData"),c(v))}function c(v){return v===null||v===32||v===96||dt(v)?(t.exit("codeTextData"),f(v)):(t.consume(v),c)}function h(v){return v===96?(t.consume(v),i++,h):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(v)):(l.type="codeTextData",c(v))}}class HF{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Zo(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Zo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Zo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Zo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Zo(this.left,n.reverse())}}}function Zo(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function OT(t){const e={};let n=-1,r,i,l,s,u,f,c;const h=new HF(t);for(;++n<h.length;){for(;n in e;)n=e[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,jF(h,n)),n=e[n],c=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(s=h.get(l),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=l);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},u=h.slice(i,n),u.unshift(r),h.splice(i,n-i+1,u))}}return jr(t,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function jF(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const l=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const u=s.events,f=[],c={};let h,v,p=-1,m=n,y=0,w=0;const S=[w];for(;m;){for(;t.get(++i)[1]!==m;);l.push(i),m._tokenizer||(h=r.sliceStream(m),m.next||h.push(null),v&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(h),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),v=m,m=m.next}for(m=n;++p<u.length;)u[p][0]==="exit"&&u[p-1][0]==="enter"&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(w=p+1,S.push(w),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):S.pop(),p=S.length;p--;){const x=u.slice(S[p],S[p+1]),C=l.pop();f.push([C,C+x.length-1]),t.splice(C,2,x)}for(f.reverse(),p=-1;++p<f.length;)c[y+f[p][0]]=y+f[p][1],y+=f[p][1]-f[p][0]-1;return c}const GF={resolve:$F,tokenize:KF},VF={partial:!0,tokenize:YF};function $F(t){return OT(t),t}function KF(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?l(u):dt(u)?t.check(VF,s,l)(u):(t.consume(u),i)}function l(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function s(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function YF(t,e,n){const r=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Lt(t,l,"linePrefix")}function l(s){if(s===null||dt(s))return n(s);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function BT(t,e,n,r,i,l,s,u,f){const c=f||Number.POSITIVE_INFINITY;let h=0;return v;function v(x){return x===60?(t.enter(r),t.enter(i),t.enter(l),t.consume(x),t.exit(l),p):x===null||x===32||x===41||Kf(x)?n(x):(t.enter(r),t.enter(s),t.enter(u),t.enter("chunkString",{contentType:"string"}),w(x))}function p(x){return x===62?(t.enter(l),t.consume(x),t.exit(l),t.exit(i),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(t.exit("chunkString"),t.exit(u),p(x)):x===null||x===60||dt(x)?n(x):(t.consume(x),x===92?y:m)}function y(x){return x===60||x===62||x===92?(t.consume(x),m):m(x)}function w(x){return!h&&(x===null||x===41||sn(x))?(t.exit("chunkString"),t.exit(u),t.exit(s),t.exit(r),e(x)):h<c&&x===40?(t.consume(x),h++,w):x===41?(t.consume(x),h--,w):x===null||x===32||x===40||Kf(x)?n(x):(t.consume(x),x===92?S:w)}function S(x){return x===40||x===41||x===92?(t.consume(x),w):w(x)}}function LT(t,e,n,r,i,l){const s=this;let u=0,f;return c;function c(m){return t.enter(r),t.enter(i),t.consume(m),t.exit(i),t.enter(l),h}function h(m){return u>999||m===null||m===91||m===93&&!f||m===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(t.exit(l),t.enter(i),t.consume(m),t.exit(i),t.exit(r),e):dt(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),v(m))}function v(m){return m===null||m===91||m===93||dt(m)||u++>999?(t.exit("chunkString"),h(m)):(t.consume(m),f||(f=!kt(m)),m===92?p:v)}function p(m){return m===91||m===92||m===93?(t.consume(m),u++,v):v(m)}}function FT(t,e,n,r,i,l){let s;return u;function u(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,f):n(p)}function f(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(l),c(p))}function c(p){return p===s?(t.exit(l),f(s)):p===null?n(p):dt(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Lt(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===s||p===null||dt(p)?(t.exit("chunkString"),c(p)):(t.consume(p),p===92?v:h)}function v(p){return p===s||p===92?(t.consume(p),h):h(p)}}function su(t,e){let n;return r;function r(i){return dt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):kt(i)?Lt(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const XF={name:"definition",tokenize:QF},ZF={partial:!0,tokenize:WF};function QF(t,e,n){const r=this;let i;return l;function l(m){return t.enter("definition"),s(m)}function s(m){return LT.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function u(m){return i=fa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),f):n(m)}function f(m){return sn(m)?su(t,c)(m):c(m)}function c(m){return BT(t,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return t.attempt(ZF,v,v)(m)}function v(m){return kt(m)?Lt(t,p,"whitespace")(m):p(m)}function p(m){return m===null||dt(m)?(t.exit("definition"),r.parser.defined.push(i),e(m)):n(m)}}function WF(t,e,n){return r;function r(u){return sn(u)?su(t,i)(u):n(u)}function i(u){return FT(t,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function l(u){return kt(u)?Lt(t,s,"whitespace")(u):s(u)}function s(u){return u===null||dt(u)?e(u):n(u)}}const JF={name:"hardBreakEscape",tokenize:eI};function eI(t,e,n){return r;function r(l){return t.enter("hardBreakEscape"),t.consume(l),i}function i(l){return dt(l)?(t.exit("hardBreakEscape"),e(l)):n(l)}}const tI={name:"headingAtx",resolve:nI,tokenize:rI};function nI(t,e){let n=t.length-2,r=3,i,l;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},l={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},jr(t,r,n-r+1,[["enter",i,e],["enter",l,e],["exit",l,e],["exit",i,e]])),t}function rI(t,e,n){let r=0;return i;function i(h){return t.enter("atxHeading"),l(h)}function l(h){return t.enter("atxHeadingSequence"),s(h)}function s(h){return h===35&&r++<6?(t.consume(h),s):h===null||sn(h)?(t.exit("atxHeadingSequence"),u(h)):n(h)}function u(h){return h===35?(t.enter("atxHeadingSequence"),f(h)):h===null||dt(h)?(t.exit("atxHeading"),e(h)):kt(h)?Lt(t,u,"whitespace")(h):(t.enter("atxHeadingText"),c(h))}function f(h){return h===35?(t.consume(h),f):(t.exit("atxHeadingSequence"),u(h))}function c(h){return h===null||h===35||sn(h)?(t.exit("atxHeadingText"),u(h)):(t.consume(h),c)}}const aI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Rw=["pre","script","style","textarea"],iI={concrete:!0,name:"htmlFlow",resolveTo:oI,tokenize:uI},lI={partial:!0,tokenize:fI},sI={partial:!0,tokenize:cI};function oI(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function uI(t,e,n){const r=this;let i,l,s,u,f;return c;function c(F){return h(F)}function h(F){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(F),v}function v(F){return F===33?(t.consume(F),p):F===47?(t.consume(F),l=!0,w):F===63?(t.consume(F),i=3,r.interrupt?e:P):yr(F)?(t.consume(F),s=String.fromCharCode(F),S):n(F)}function p(F){return F===45?(t.consume(F),i=2,m):F===91?(t.consume(F),i=5,u=0,y):yr(F)?(t.consume(F),i=4,r.interrupt?e:P):n(F)}function m(F){return F===45?(t.consume(F),r.interrupt?e:P):n(F)}function y(F){const J="CDATA[";return F===J.charCodeAt(u++)?(t.consume(F),u===J.length?r.interrupt?e:B:y):n(F)}function w(F){return yr(F)?(t.consume(F),s=String.fromCharCode(F),S):n(F)}function S(F){if(F===null||F===47||F===62||sn(F)){const J=F===47,re=s.toLowerCase();return!J&&!l&&Rw.includes(re)?(i=1,r.interrupt?e(F):B(F)):aI.includes(s.toLowerCase())?(i=6,J?(t.consume(F),x):r.interrupt?e(F):B(F)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):l?C(F):T(F))}return F===45||ur(F)?(t.consume(F),s+=String.fromCharCode(F),S):n(F)}function x(F){return F===62?(t.consume(F),r.interrupt?e:B):n(F)}function C(F){return kt(F)?(t.consume(F),C):M(F)}function T(F){return F===47?(t.consume(F),M):F===58||F===95||yr(F)?(t.consume(F),A):kt(F)?(t.consume(F),T):M(F)}function A(F){return F===45||F===46||F===58||F===95||ur(F)?(t.consume(F),A):N(F)}function N(F){return F===61?(t.consume(F),k):kt(F)?(t.consume(F),N):T(F)}function k(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(t.consume(F),f=F,D):kt(F)?(t.consume(F),k):O(F)}function D(F){return F===f?(t.consume(F),f=null,L):F===null||dt(F)?n(F):(t.consume(F),D)}function O(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||sn(F)?N(F):(t.consume(F),O)}function L(F){return F===47||F===62||kt(F)?T(F):n(F)}function M(F){return F===62?(t.consume(F),z):n(F)}function z(F){return F===null||dt(F)?B(F):kt(F)?(t.consume(F),z):n(F)}function B(F){return F===45&&i===2?(t.consume(F),q):F===60&&i===1?(t.consume(F),H):F===62&&i===4?(t.consume(F),I):F===63&&i===3?(t.consume(F),P):F===93&&i===5?(t.consume(F),Q):dt(F)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(lI,K,U)(F)):F===null||dt(F)?(t.exit("htmlFlowData"),U(F)):(t.consume(F),B)}function U(F){return t.check(sI,V,K)(F)}function V(F){return t.enter("lineEnding"),t.consume(F),t.exit("lineEnding"),$}function $(F){return F===null||dt(F)?U(F):(t.enter("htmlFlowData"),B(F))}function q(F){return F===45?(t.consume(F),P):B(F)}function H(F){return F===47?(t.consume(F),s="",Y):B(F)}function Y(F){if(F===62){const J=s.toLowerCase();return Rw.includes(J)?(t.consume(F),I):B(F)}return yr(F)&&s.length<8?(t.consume(F),s+=String.fromCharCode(F),Y):B(F)}function Q(F){return F===93?(t.consume(F),P):B(F)}function P(F){return F===62?(t.consume(F),I):F===45&&i===2?(t.consume(F),P):B(F)}function I(F){return F===null||dt(F)?(t.exit("htmlFlowData"),K(F)):(t.consume(F),I)}function K(F){return t.exit("htmlFlow"),e(F)}}function cI(t,e,n){const r=this;return i;function i(s){return dt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),l):n(s)}function l(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function fI(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Lu,e,n)}}const dI={name:"htmlText",tokenize:hI};function hI(t,e,n){const r=this;let i,l,s;return u;function u(P){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(P),f}function f(P){return P===33?(t.consume(P),c):P===47?(t.consume(P),N):P===63?(t.consume(P),T):yr(P)?(t.consume(P),O):n(P)}function c(P){return P===45?(t.consume(P),h):P===91?(t.consume(P),l=0,y):yr(P)?(t.consume(P),C):n(P)}function h(P){return P===45?(t.consume(P),m):n(P)}function v(P){return P===null?n(P):P===45?(t.consume(P),p):dt(P)?(s=v,H(P)):(t.consume(P),v)}function p(P){return P===45?(t.consume(P),m):v(P)}function m(P){return P===62?q(P):P===45?p(P):v(P)}function y(P){const I="CDATA[";return P===I.charCodeAt(l++)?(t.consume(P),l===I.length?w:y):n(P)}function w(P){return P===null?n(P):P===93?(t.consume(P),S):dt(P)?(s=w,H(P)):(t.consume(P),w)}function S(P){return P===93?(t.consume(P),x):w(P)}function x(P){return P===62?q(P):P===93?(t.consume(P),x):w(P)}function C(P){return P===null||P===62?q(P):dt(P)?(s=C,H(P)):(t.consume(P),C)}function T(P){return P===null?n(P):P===63?(t.consume(P),A):dt(P)?(s=T,H(P)):(t.consume(P),T)}function A(P){return P===62?q(P):T(P)}function N(P){return yr(P)?(t.consume(P),k):n(P)}function k(P){return P===45||ur(P)?(t.consume(P),k):D(P)}function D(P){return dt(P)?(s=D,H(P)):kt(P)?(t.consume(P),D):q(P)}function O(P){return P===45||ur(P)?(t.consume(P),O):P===47||P===62||sn(P)?L(P):n(P)}function L(P){return P===47?(t.consume(P),q):P===58||P===95||yr(P)?(t.consume(P),M):dt(P)?(s=L,H(P)):kt(P)?(t.consume(P),L):q(P)}function M(P){return P===45||P===46||P===58||P===95||ur(P)?(t.consume(P),M):z(P)}function z(P){return P===61?(t.consume(P),B):dt(P)?(s=z,H(P)):kt(P)?(t.consume(P),z):L(P)}function B(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(t.consume(P),i=P,U):dt(P)?(s=B,H(P)):kt(P)?(t.consume(P),B):(t.consume(P),V)}function U(P){return P===i?(t.consume(P),i=void 0,$):P===null?n(P):dt(P)?(s=U,H(P)):(t.consume(P),U)}function V(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||sn(P)?L(P):(t.consume(P),V)}function $(P){return P===47||P===62||sn(P)?L(P):n(P)}function q(P){return P===62?(t.consume(P),t.exit("htmlTextData"),t.exit("htmlText"),e):n(P)}function H(P){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(P),t.exit("lineEnding"),Y}function Y(P){return kt(P)?Lt(t,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):Q(P)}function Q(P){return t.enter("htmlTextData"),s(P)}}const zm={name:"labelEnd",resolveAll:mI,resolveTo:yI,tokenize:bI},vI={tokenize:EI},gI={tokenize:xI},pI={tokenize:wI};function mI(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&jr(t,0,t.length,n),t}function yI(t,e){let n=t.length,r=0,i,l,s,u;for(;n--;)if(i=t[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const f={type:t[l][1].type==="labelLink"?"link":"image",start:{...t[l][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[l][1].start},end:{...t[s][1].end}},h={type:"labelText",start:{...t[l+r+2][1].end},end:{...t[s-2][1].start}};return u=[["enter",f,e],["enter",c,e]],u=ra(u,t.slice(l+1,l+r+3)),u=ra(u,[["enter",h,e]]),u=ra(u,yd(e.parser.constructs.insideSpan.null,t.slice(l+r+4,s-3),e)),u=ra(u,[["exit",h,e],t[s-2],t[s-1],["exit",c,e]]),u=ra(u,t.slice(s+1)),u=ra(u,[["exit",f,e]]),jr(t,l,t.length,u),t}function bI(t,e,n){const r=this;let i=r.events.length,l,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return u;function u(p){return l?l._inactive?v(p):(s=r.parser.defined.includes(fa(r.sliceSerialize({start:l.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),f):n(p)}function f(p){return p===40?t.attempt(vI,h,s?h:v)(p):p===91?t.attempt(gI,h,s?c:v)(p):s?h(p):v(p)}function c(p){return t.attempt(pI,h,v)(p)}function h(p){return e(p)}function v(p){return l._balanced=!0,n(p)}}function EI(t,e,n){return r;function r(v){return t.enter("resource"),t.enter("resourceMarker"),t.consume(v),t.exit("resourceMarker"),i}function i(v){return sn(v)?su(t,l)(v):l(v)}function l(v){return v===41?h(v):BT(t,s,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(v)}function s(v){return sn(v)?su(t,f)(v):h(v)}function u(v){return n(v)}function f(v){return v===34||v===39||v===40?FT(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(v):h(v)}function c(v){return sn(v)?su(t,h)(v):h(v)}function h(v){return v===41?(t.enter("resourceMarker"),t.consume(v),t.exit("resourceMarker"),t.exit("resource"),e):n(v)}}function xI(t,e,n){const r=this;return i;function i(u){return LT.call(r,t,l,s,"reference","referenceMarker","referenceString")(u)}function l(u){return r.parser.defined.includes(fa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function s(u){return n(u)}}function wI(t,e,n){return r;function r(l){return t.enter("reference"),t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),i}function i(l){return l===93?(t.enter("referenceMarker"),t.consume(l),t.exit("referenceMarker"),t.exit("reference"),e):n(l)}}const SI={name:"labelStartImage",resolveAll:zm.resolveAll,tokenize:CI};function CI(t,e,n){const r=this;return i;function i(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),l}function l(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),s):n(u)}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}const TI={name:"labelStartLink",resolveAll:zm.resolveAll,tokenize:DI};function DI(t,e,n){const r=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),l}function l(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const up={name:"lineEnding",tokenize:AI};function AI(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Lt(t,e,"linePrefix")}}const Mf={name:"thematicBreak",tokenize:_I};function _I(t,e,n){let r=0,i;return l;function l(c){return t.enter("thematicBreak"),s(c)}function s(c){return i=c,u(c)}function u(c){return c===i?(t.enter("thematicBreakSequence"),f(c)):r>=3&&(c===null||dt(c))?(t.exit("thematicBreak"),e(c)):n(c)}function f(c){return c===i?(t.consume(c),r++,f):(t.exit("thematicBreakSequence"),kt(c)?Lt(t,u,"whitespace")(c):u(c))}}const _r={continuation:{tokenize:MI},exit:BI,name:"list",tokenize:RI},kI={partial:!0,tokenize:LI},NI={partial:!0,tokenize:OI};function RI(t,e,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(m){const y=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Zp(m)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(Mf,n,c)(m):c(m);if(!r.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),f(m)}return n(m)}function f(m){return Zp(m)&&++s<10?(t.consume(m),f):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),c(m)):n(m)}function c(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,t.check(Lu,r.interrupt?n:h,t.attempt(kI,p,v))}function h(m){return r.containerState.initialBlankLine=!0,l++,p(m)}function v(m){return kt(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=l+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function MI(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Lu,i,l);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Lt(t,e,"listItemIndent",r.containerState.size+1)(u)}function l(u){return r.containerState.furtherBlankLines||!kt(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(NI,e,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Lt(t,t.attempt(_r,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function OI(t,e,n){const r=this;return Lt(t,i,"listItemIndent",r.containerState.size+1);function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(l):n(l)}}function BI(t){t.exit(this.containerState.type)}function LI(t,e,n){const r=this;return Lt(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const s=r.events[r.events.length-1];return!kt(l)&&s&&s[1].type==="listItemPrefixWhitespace"?e(l):n(l)}}const Mw={name:"setextUnderline",resolveTo:FI,tokenize:II};function FI(t,e){let n=t.length,r,i,l;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!l&&t[n][1].type==="definition"&&(l=n);const s={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",l?(t.splice(i,0,["enter",s,e]),t.splice(l+1,0,["exit",t[r][1],e]),t[r][1].end={...t[l][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function II(t,e,n){const r=this;let i;return l;function l(c){let h=r.events.length,v;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){v=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||v)?(t.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),u(c)}function u(c){return c===i?(t.consume(c),u):(t.exit("setextHeadingLineSequence"),kt(c)?Lt(t,f,"lineSuffix")(c):f(c))}function f(c){return c===null||dt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const zI={tokenize:PI};function PI(t){const e=this,n=t.attempt(Lu,r,t.attempt(this.parser.constructs.flowInitial,i,Lt(t,t.attempt(this.parser.constructs.flow,i,t.attempt(GF,i)),"linePrefix")));return n;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEndingBlank"),t.consume(l),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const UI={resolveAll:zT()},qI=IT("string"),HI=IT("text");function IT(t){return{resolveAll:zT(t==="text"?jI:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],l=n.attempt(i,s,u);return s;function s(h){return c(h)?l(h):u(h)}function u(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),f}function f(h){return c(h)?(n.exit("data"),l(h)):(n.consume(h),f)}function c(h){if(h===null)return!0;const v=i[h];let p=-1;if(v)for(;++p<v.length;){const m=v[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function zT(t){return e;function e(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return t?t(n,r):n}}function jI(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let l=i.length,s=-1,u=0,f;for(;l--;){const c=i[l];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)u++,s--;if(s)break;s=-1}else if(c===-2)f=!0,u++;else if(c!==-1){l++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const c={type:n===t.length||f||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:r.start._bufferIndex+s,_index:r.start._index+l,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}const GI={42:_r,43:_r,45:_r,48:_r,49:_r,50:_r,51:_r,52:_r,53:_r,54:_r,55:_r,56:_r,57:_r,62:NT},VI={91:XF},$I={[-2]:op,[-1]:op,32:op},KI={35:tI,42:Mf,45:[Mw,Mf],60:iI,61:Mw,95:Mf,96:Nw,126:Nw},YI={38:MT,92:RT},XI={[-5]:up,[-4]:up,[-3]:up,33:SI,38:MT,42:Qp,60:[TF,dI],91:TI,92:[JF,RT],93:zm,95:Qp,96:zF},ZI={null:[Qp,UI]},QI={null:[42,95]},WI={null:[]},JI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:QI,contentInitial:VI,disable:WI,document:GI,flow:KI,flowInitial:$I,insideSpan:ZI,string:YI,text:XI},Symbol.toStringTag,{value:"Module"}));function ez(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let s=[],u=[];const f={attempt:D(N),check:D(k),consume:C,enter:T,exit:A,interrupt:D(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:y,parser:t,previous:null,sliceSerialize:p,sliceStream:m,write:v};let h=e.tokenize.call(c,f);return e.resolveAll&&l.push(e),c;function v(z){return s=ra(s,z),S(),s[s.length-1]!==null?[]:(O(e,0),c.events=yd(l,c.events,c),c.events)}function p(z,B){return nz(m(z),B)}function m(z){return tz(s,z)}function y(){const{_bufferIndex:z,_index:B,line:U,column:V,offset:$}=r;return{_bufferIndex:z,_index:B,line:U,column:V,offset:$}}function w(z){i[z.line]=z.column,M()}function S(){let z;for(;r._index<s.length;){const B=s[r._index];if(typeof B=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<B.length;)x(B.charCodeAt(r._bufferIndex));else x(B)}}function x(z){h=h(z)}function C(z){dt(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,M()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=z}function T(z,B){const U=B||{};return U.type=z,U.start=y(),c.events.push(["enter",U,c]),u.push(U),U}function A(z){const B=u.pop();return B.end=y(),c.events.push(["exit",B,c]),B}function N(z,B){O(z,B.from)}function k(z,B){B.restore()}function D(z,B){return U;function U(V,$,q){let H,Y,Q,P;return Array.isArray(V)?K(V):"tokenize"in V?K([V]):I(V);function I(se){return me;function me(Ne){const pe=Ne!==null&&se[Ne],ee=Ne!==null&&se.null,le=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return K(le)(Ne)}}function K(se){return H=se,Y=0,se.length===0?q:F(se[Y])}function F(se){return me;function me(Ne){return P=L(),Q=se,se.partial||(c.currentConstruct=se),se.name&&c.parser.constructs.disable.null.includes(se.name)?re():se.tokenize.call(B?Object.assign(Object.create(c),B):c,f,J,re)(Ne)}}function J(se){return z(Q,P),$}function re(se){return P.restore(),++Y<H.length?F(H[Y]):q}}}function O(z,B){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&jr(c.events,B,c.events.length-B,z.resolve(c.events.slice(B),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function L(){const z=y(),B=c.previous,U=c.currentConstruct,V=c.events.length,$=Array.from(u);return{from:V,restore:q};function q(){r=z,c.previous=B,c.currentConstruct=U,c.events.length=V,u=$,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function tz(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,l=e.end._bufferIndex;let s;if(n===i)s=[t[n].slice(r,l)];else{if(s=t.slice(n,i),r>-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}l>0&&s.push(t[i].slice(0,l))}return s}function nz(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const l=t[n];let s;if(typeof l=="string")s=l;else switch(l){case-5:{s="\r";break}case-4:{s=`
|
|
336
|
+
`;break}case-3:{s=`\r
|
|
337
|
+
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(l)}i=l===-2,r.push(s)}return r.join("")}function rz(t){const r={constructs:_T([JI,...(t||{}).extensions||[]]),content:i(yF),defined:[],document:i(EF),flow:i(zI),lazy:{},string:i(qI),text:i(HI)};return r;function i(l){return s;function s(u){return ez(r,l,u)}}}function az(t){for(;!OT(t););return t}const Ow=/[\0\t\n\r]/g;function iz(){let t=1,e="",n=!0,r;return i;function i(l,s,u){const f=[];let c,h,v,p,m;for(l=e+(typeof l=="string"?l.toString():new TextDecoder(s||void 0).decode(l)),v=0,e="",n&&(l.charCodeAt(0)===65279&&v++,n=void 0);v<l.length;){if(Ow.lastIndex=v,c=Ow.exec(l),p=c&&c.index!==void 0?c.index:l.length,m=l.charCodeAt(p),!c){e=l.slice(v);break}if(m===10&&v===p&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),v<p&&(f.push(l.slice(v,p)),t+=p-v),m){case 0:{f.push(65533),t++;break}case 9:{for(h=Math.ceil(t/4)*4,f.push(-2);t++<h;)f.push(-1);break}case 10:{f.push(-4),t=1;break}default:r=!0,t=1}v=p+1}return u&&(r&&f.push(-5),e&&f.push(e),f.push(null)),f}}const lz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sz(t){return t.replace(lz,oz)}function oz(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return kT(n.slice(l?2:1),l?16:10)}return Im(n)||t}const PT={}.hasOwnProperty;function uz(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),cz(n)(az(rz(n).document().write(iz()(t,e,!0))))}function cz(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(et),autolinkProtocol:L,autolinkEmail:L,atxHeading:l($e),blockQuote:l(ee),characterEscape:L,characterReference:L,codeFenced:l(le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:l(le,s),codeText:l(de,s),codeTextData:L,data:L,codeFlowValue:L,definition:l(xe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:l(Re),hardBreakEscape:l(Ye),hardBreakTrailing:l(Ye),htmlFlow:l(lt,s),htmlFlowData:L,htmlText:l(lt,s),htmlTextData:L,image:l(We),label:s,link:l(et),listItem:l(Ge),listItemValue:p,listOrdered:l(ze,v),listUnordered:l(ze),paragraph:l(tt),reference:F,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:l($e),strong:l(ot),thematicBreak:l(pt)},exit:{atxHeading:f(),atxHeadingSequence:N,autolink:f(),autolinkEmail:pe,autolinkProtocol:Ne,blockQuote:f(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:se,characterReference:me,codeFenced:f(S),codeFencedFence:w,codeFencedFenceInfo:m,codeFencedFenceMeta:y,codeFlowValue:M,codeIndented:f(x),codeText:f($),codeTextData:M,data:M,definition:f(),definitionDestinationString:A,definitionLabelString:C,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(B),hardBreakTrailing:f(B),htmlFlow:f(U),htmlFlowData:M,htmlText:f(V),htmlTextData:M,image:f(H),label:Q,labelText:Y,lineEnding:z,link:f(q),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:J,resourceDestinationString:P,resourceTitleString:I,resource:K,setextHeading:f(O),setextHeadingLineSequence:D,setextHeadingText:k,strong:f(),thematicBreak:f()}};UT(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ue){let Te={type:"root",children:[]};const Oe={stack:[Te],tokenStack:[],config:e,enter:u,exit:c,buffer:s,resume:h,data:n},Xe=[];let Le=-1;for(;++Le<ue.length;)if(ue[Le][1].type==="listOrdered"||ue[Le][1].type==="listUnordered")if(ue[Le][0]==="enter")Xe.push(Le);else{const Ue=Xe.pop();Le=i(ue,Ue,Le)}for(Le=-1;++Le<ue.length;){const Ue=e[ue[Le][0]];PT.call(Ue,ue[Le][1].type)&&Ue[ue[Le][1].type].call(Object.assign({sliceSerialize:ue[Le][2].sliceSerialize},Oe),ue[Le][1])}if(Oe.tokenStack.length>0){const Ue=Oe.tokenStack[Oe.tokenStack.length-1];(Ue[1]||Bw).call(Oe,void 0,Ue[0])}for(Te.position={start:ki(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:ki(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Le=-1;++Le<e.transforms.length;)Te=e.transforms[Le](Te)||Te;return Te}function i(ue,Te,Oe){let Xe=Te-1,Le=-1,Ue=!1,ye,G,te,fe;for(;++Xe<=Oe;){const ce=ue[Xe];switch(ce[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ce[0]==="enter"?Le++:Le--,fe=void 0;break}case"lineEndingBlank":{ce[0]==="enter"&&(ye&&!fe&&!Le&&!te&&(te=Xe),fe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fe=void 0}if(!Le&&ce[0]==="enter"&&ce[1].type==="listItemPrefix"||Le===-1&&ce[0]==="exit"&&(ce[1].type==="listUnordered"||ce[1].type==="listOrdered")){if(ye){let we=Xe;for(G=void 0;we--;){const Ie=ue[we];if(Ie[1].type==="lineEnding"||Ie[1].type==="lineEndingBlank"){if(Ie[0]==="exit")continue;G&&(ue[G][1].type="lineEndingBlank",Ue=!0),Ie[1].type="lineEnding",G=we}else if(!(Ie[1].type==="linePrefix"||Ie[1].type==="blockQuotePrefix"||Ie[1].type==="blockQuotePrefixWhitespace"||Ie[1].type==="blockQuoteMarker"||Ie[1].type==="listItemIndent"))break}te&&(!G||te<G)&&(ye._spread=!0),ye.end=Object.assign({},G?ue[G][1].start:ce[1].end),ue.splice(G||Xe,0,["exit",ye,ce[2]]),Xe++,Oe++}if(ce[1].type==="listItemPrefix"){const we={type:"listItem",_spread:!1,start:Object.assign({},ce[1].start),end:void 0};ye=we,ue.splice(Xe,0,["enter",we,ce[2]]),Xe++,Oe++,te=void 0,fe=!0}}}return ue[Te][1]._spread=Ue,Oe}function l(ue,Te){return Oe;function Oe(Xe){u.call(this,ue(Xe),Xe),Te&&Te.call(this,Xe)}}function s(){this.stack.push({type:"fragment",children:[]})}function u(ue,Te,Oe){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Te,Oe||void 0]),ue.position={start:ki(Te.start),end:void 0}}function f(ue){return Te;function Te(Oe){ue&&ue.call(this,Oe),c.call(this,Oe)}}function c(ue,Te){const Oe=this.stack.pop(),Xe=this.tokenStack.pop();if(Xe)Xe[0].type!==ue.type&&(Te?Te.call(this,ue,Xe[0]):(Xe[1]||Bw).call(this,ue,Xe[0]));else throw new Error("Cannot close `"+ue.type+"` ("+lu({start:ue.start,end:ue.end})+"): itβs not open");Oe.position.end=ki(ue.end)}function h(){return Fm(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function p(ue){if(this.data.expectingFirstListItemValue){const Te=this.stack[this.stack.length-2];Te.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function m(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.lang=ue}function y(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.meta=ue}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue.replace(/(\r?\n|\r)$/g,"")}function C(ue){const Te=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=Te,Oe.identifier=fa(this.sliceSerialize(ue)).toLowerCase()}function T(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.title=ue}function A(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.url=ue}function N(ue){const Te=this.stack[this.stack.length-1];if(!Te.depth){const Oe=this.sliceSerialize(ue).length;Te.depth=Oe}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function D(ue){const Te=this.stack[this.stack.length-1];Te.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function L(ue){const Oe=this.stack[this.stack.length-1].children;let Xe=Oe[Oe.length-1];(!Xe||Xe.type!=="text")&&(Xe=Pe(),Xe.position={start:ki(ue.start),end:void 0},Oe.push(Xe)),this.stack.push(Xe)}function M(ue){const Te=this.stack.pop();Te.value+=this.sliceSerialize(ue),Te.position.end=ki(ue.end)}function z(ue){const Te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=Te.children[Te.children.length-1];Oe.position.end=ki(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Te.type)&&(L.call(this,ue),M.call(this,ue))}function B(){this.data.atHardBreak=!0}function U(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue}function V(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue}function $(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue}function q(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Te,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function H(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Te,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function Y(ue){const Te=this.sliceSerialize(ue),Oe=this.stack[this.stack.length-2];Oe.label=sz(Te),Oe.identifier=fa(Te).toLowerCase()}function Q(){const ue=this.stack[this.stack.length-1],Te=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const Xe=ue.children;Oe.children=Xe}else Oe.alt=Te}function P(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.url=ue}function I(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.title=ue}function K(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function J(ue){const Te=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=Te,Oe.identifier=fa(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function re(ue){this.data.characterReferenceType=ue.type}function se(ue){const Te=this.sliceSerialize(ue),Oe=this.data.characterReferenceType;let Xe;Oe?(Xe=kT(Te,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Xe=Im(Te);const Le=this.stack[this.stack.length-1];Le.value+=Xe}function me(ue){const Te=this.stack.pop();Te.position.end=ki(ue.end)}function Ne(ue){M.call(this,ue);const Te=this.stack[this.stack.length-1];Te.url=this.sliceSerialize(ue)}function pe(ue){M.call(this,ue);const Te=this.stack[this.stack.length-1];Te.url="mailto:"+this.sliceSerialize(ue)}function ee(){return{type:"blockquote",children:[]}}function le(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function $e(){return{type:"heading",depth:0,children:[]}}function Ye(){return{type:"break"}}function lt(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function et(){return{type:"link",title:null,url:"",children:[]}}function ze(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function Ge(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function tt(){return{type:"paragraph",children:[]}}function ot(){return{type:"strong",children:[]}}function Pe(){return{type:"text",value:""}}function pt(){return{type:"thematicBreak"}}}function ki(t){return{line:t.line,column:t.column,offset:t.offset}}function UT(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?UT(t,r):fz(t,r)}}function fz(t,e){let n;for(n in e)if(PT.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function Bw(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+lu({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+lu({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+lu({start:e.start,end:e.end})+") is still open")}function dz(t){const e=this;e.parser=n;function n(r){return uz(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function hz(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function vz(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
338
|
+
`}]}function gz(t,e){const n=e.value?e.value+`
|
|
339
|
+
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(l.data={meta:e.meta}),t.patch(e,l),l=t.applyData(e,l),l={type:"element",tagName:"pre",properties:{},children:[l]},t.patch(e,l),l}function pz(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function mz(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function yz(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Ks(r.toLowerCase()),l=t.footnoteOrder.indexOf(r);let s,u=t.footnoteCounts.get(r);u===void 0?(u=0,t.footnoteOrder.push(r),s=t.footnoteOrder.length):s=l+1,u+=1,t.footnoteCounts.set(r,u);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,f);const c={type:"element",tagName:"sup",properties:{},children:[f]};return t.patch(e,c),t.applyData(e,c)}function bz(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Ez(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function qT(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function xz(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return qT(t,e);const i={src:Ks(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,l),t.applyData(e,l)}function wz(t,e){const n={src:Ks(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Sz(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Cz(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return qT(t,e);const i={href:Ks(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,l),t.applyData(e,l)}function Tz(t,e){const n={href:Ks(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Dz(t,e,n){const r=t.all(e),i=n?Az(n):HT(e),l={},s=[];if(typeof e.checked=="boolean"){const h=r[0];let v;h&&h.type==="element"&&h.tagName==="p"?v=h:(v={type:"element",tagName:"p",properties:{},children:[]},r.unshift(v)),v.children.length>0&&v.children.unshift({type:"text",value:" "}),v.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const h=r[u];(i||u!==0||h.type!=="element"||h.tagName!=="p")&&s.push({type:"text",value:`
|
|
340
|
+
`}),h.type==="element"&&h.tagName==="p"&&!i?s.push(...h.children):s.push(h)}const f=r[r.length-1];f&&(i||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
|
|
341
|
+
`});const c={type:"element",tagName:"li",properties:l,children:s};return t.patch(e,c),t.applyData(e,c)}function Az(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=HT(n[r])}return e}function HT(t){const e=t.spread;return e??t.children.length>1}function _z(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,l),t.applyData(e,l)}function kz(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Nz(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Rz(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Mz(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},u=Mm(e.children[1]),f=xT(e.children[e.children.length-1]);u&&f&&(s.position={start:u,end:f}),i.push(s)}const l={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,l),t.applyData(e,l)}function Oz(t,e,n){const r=n?n.children:void 0,l=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:e.children.length;let f=-1;const c=[];for(;++f<u;){const v=e.children[f],p={},m=s?s[f]:void 0;m&&(p.align=m);let y={type:"element",tagName:l,properties:p,children:[]};v&&(y.children=t.all(v),t.patch(v,y),y=t.applyData(v,y)),c.push(y)}const h={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,h),t.applyData(e,h)}function Bz(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Lw=9,Fw=32;function Lz(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const l=[];for(;r;)l.push(Iw(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return l.push(Iw(e.slice(i),i>0,!1)),l.join("")}function Iw(t,e,n){let r=0,i=t.length;if(e){let l=t.codePointAt(r);for(;l===Lw||l===Fw;)r++,l=t.codePointAt(r)}if(n){let l=t.codePointAt(i-1);for(;l===Lw||l===Fw;)i--,l=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Fz(t,e){const n={type:"text",value:Lz(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Iz(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const zz={blockquote:hz,break:vz,code:gz,delete:pz,emphasis:mz,footnoteReference:yz,heading:bz,html:Ez,imageReference:xz,image:wz,inlineCode:Sz,linkReference:Cz,link:Tz,listItem:Dz,list:_z,paragraph:kz,root:Nz,strong:Rz,table:Mz,tableCell:Bz,tableRow:Oz,text:Fz,thematicBreak:Iz,toml:ff,yaml:ff,definition:ff,footnoteDefinition:ff};function ff(){}const jT=-1,bd=0,ou=1,Yf=2,Pm=3,Um=4,qm=5,Hm=6,GT=7,VT=8,zw=typeof self=="object"?self:globalThis,Pz=(t,e)=>{const n=(i,l)=>(t.set(l,i),i),r=i=>{if(t.has(i))return t.get(i);const[l,s]=e[i];switch(l){case bd:case jT:return n(s,i);case ou:{const u=n([],i);for(const f of s)u.push(r(f));return u}case Yf:{const u=n({},i);for(const[f,c]of s)u[r(f)]=r(c);return u}case Pm:return n(new Date(s),i);case Um:{const{source:u,flags:f}=s;return n(new RegExp(u,f),i)}case qm:{const u=n(new Map,i);for(const[f,c]of s)u.set(r(f),r(c));return u}case Hm:{const u=n(new Set,i);for(const f of s)u.add(r(f));return u}case GT:{const{name:u,message:f}=s;return n(new zw[u](f),i)}case VT:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new zw[l](s),i)};return r},Pw=t=>Pz(new Map,t)(0),ws="",{toString:Uz}={},{keys:qz}=Object,Qo=t=>{const e=typeof t;if(e!=="object"||!t)return[bd,e];const n=Uz.call(t).slice(8,-1);switch(n){case"Array":return[ou,ws];case"Object":return[Yf,ws];case"Date":return[Pm,ws];case"RegExp":return[Um,ws];case"Map":return[qm,ws];case"Set":return[Hm,ws];case"DataView":return[ou,n]}return n.includes("Array")?[ou,n]:n.includes("Error")?[GT,n]:[Yf,n]},df=([t,e])=>t===bd&&(e==="function"||e==="symbol"),Hz=(t,e,n,r)=>{const i=(s,u)=>{const f=r.push(s)-1;return n.set(u,f),f},l=s=>{if(n.has(s))return n.get(s);let[u,f]=Qo(s);switch(u){case bd:{let h=s;switch(f){case"bigint":u=VT,h=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+f);h=null;break;case"undefined":return i([jT],s)}return i([u,h],s)}case ou:{if(f){let p=s;return f==="DataView"?p=new Uint8Array(s.buffer):f==="ArrayBuffer"&&(p=new Uint8Array(s)),i([f,[...p]],s)}const h=[],v=i([u,h],s);for(const p of s)h.push(l(p));return v}case Yf:{if(f)switch(f){case"BigInt":return i([f,s.toString()],s);case"Boolean":case"Number":case"String":return i([f,s.valueOf()],s)}if(e&&"toJSON"in s)return l(s.toJSON());const h=[],v=i([u,h],s);for(const p of qz(s))(t||!df(Qo(s[p])))&&h.push([l(p),l(s[p])]);return v}case Pm:return i([u,s.toISOString()],s);case Um:{const{source:h,flags:v}=s;return i([u,{source:h,flags:v}],s)}case qm:{const h=[],v=i([u,h],s);for(const[p,m]of s)(t||!(df(Qo(p))||df(Qo(m))))&&h.push([l(p),l(m)]);return v}case Hm:{const h=[],v=i([u,h],s);for(const p of s)(t||!df(Qo(p)))&&h.push(l(p));return v}}const{message:c}=s;return i([u,{name:f,message:c}],s)};return l},Uw=(t,{json:e,lossy:n}={})=>{const r=[];return Hz(!(e||n),!!e,new Map,r)(t),r},Xf=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Pw(Uw(t,e)):structuredClone(t):(t,e)=>Pw(Uw(t,e));function jz(t,e){const n=[{type:"text",value:"β©"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function Gz(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Vz(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||jz,r=t.options.footnoteBackLabel||Gz,i=t.options.footnoteLabel||"Footnotes",l=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f<t.footnoteOrder.length;){const c=t.footnoteById.get(t.footnoteOrder[f]);if(!c)continue;const h=t.all(c),v=String(c.identifier).toUpperCase(),p=Ks(v.toLowerCase());let m=0;const y=[],w=t.footnoteCounts.get(v);for(;w!==void 0&&++m<=w;){y.length>0&&y.push({type:"text",value:" "});let C=typeof n=="string"?n:n(f,m);typeof C=="string"&&(C={type:"text",value:C}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,m),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const C=S.children[S.children.length-1];C&&C.type==="text"?C.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...y)}else h.push(...y);const x={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(h,!0)};t.patch(c,x),u.push(x)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Xf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
342
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(u,!0)},{type:"text",value:`
|
|
343
|
+
`}]}}const Fu=(function(t){if(t==null)return Xz;if(typeof t=="function")return Ed(t);if(typeof t=="object")return Array.isArray(t)?$z(t):Kz(t);if(typeof t=="string")return Yz(t);throw new Error("Expected function, string, or object as test")});function $z(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Fu(t[n]);return Ed(r);function r(...i){let l=-1;for(;++l<e.length;)if(e[l].apply(this,i))return!0;return!1}}function Kz(t){const e=t;return Ed(n);function n(r){const i=r;let l;for(l in t)if(i[l]!==e[l])return!1;return!0}}function Yz(t){return Ed(e);function e(n){return n&&n.type===t}}function Ed(t){return e;function e(n,r,i){return!!(Zz(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Xz(){return!0}function Zz(t){return t!==null&&typeof t=="object"&&"type"in t}const $T=[],Qz=!0,Wp=!1,Wz="skip";function KT(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const l=Fu(i),s=r?-1:1;u(t,void 0,[])();function u(f,c,h){const v=f&&typeof f=="object"?f:{};if(typeof v.type=="string"){const m=typeof v.tagName=="string"?v.tagName:typeof v.name=="string"?v.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(f.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=$T,y,w,S;if((!e||l(f,c,h[h.length-1]||void 0))&&(m=Jz(n(f,h)),m[0]===Wp))return m;if("children"in f&&f.children){const x=f;if(x.children&&m[0]!==Wz)for(w=(r?x.children.length:-1)+s,S=h.concat(x);w>-1&&w<x.children.length;){const C=x.children[w];if(y=u(C,w,S)(),y[0]===Wp)return y;w=typeof y[1]=="number"?y[1]:w+s}}return m}}}function Jz(t){return Array.isArray(t)?t:typeof t=="number"?[Qz,t]:t==null?$T:[t]}function Iu(t,e,n,r){let i,l,s;typeof e=="function"&&typeof n!="function"?(l=void 0,s=e,i=n):(l=e,s=n,i=r),KT(t,l,u,i);function u(f,c){const h=c[c.length-1],v=h?h.children.indexOf(f):void 0;return s(f,v,h)}}const Jp={}.hasOwnProperty,e3={};function t3(t,e){const n=e||e3,r=new Map,i=new Map,l=new Map,s={...zz,...n.handlers},u={all:c,applyData:r3,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:s,one:f,options:n,patch:n3,wrap:i3};return Iu(t,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const v=h.type==="definition"?r:i,p=String(h.identifier).toUpperCase();v.has(p)||v.set(p,h)}}),u;function f(h,v){const p=h.type,m=u.handlers[p];if(Jp.call(u.handlers,p)&&m)return m(u,h,v);if(u.options.passThrough&&u.options.passThrough.includes(p)){if("children"in h){const{children:w,...S}=h,x=Xf(S);return x.children=u.all(h),x}return Xf(h)}return(u.options.unknownHandler||a3)(u,h,v)}function c(h){const v=[];if("children"in h){const p=h.children;let m=-1;for(;++m<p.length;){const y=u.one(p[m],h);if(y){if(m&&p[m-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=qw(y.value)),!Array.isArray(y)&&y.type==="element")){const w=y.children[0];w&&w.type==="text"&&(w.value=qw(w.value))}Array.isArray(y)?v.push(...y):v.push(y)}}}return v}}function n3(t,e){t.position&&(e.position=GL(t))}function r3(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,l=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&l&&Object.assign(n.properties,Xf(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function a3(t,e){const n=e.data||{},r="value"in e&&!(Jp.call(n,"hProperties")||Jp.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function i3(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
344
|
+
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
345
|
+
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
346
|
+
`}),n}function qw(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Hw(t,e){const n=t3(t,e),r=n.one(t,void 0),i=Vz(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
347
|
+
`},i),l}function l3(t,e){return t&&"run"in t?async function(n,r){const i=Hw(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Hw(n,{file:r,...t||e})}}function jw(t){if(t)throw t}var cp,Gw;function s3(){if(Gw)return cp;Gw=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):e.call(c)==="[object Array]"},l=function(c){if(!c||e.call(c)!=="[object Object]")return!1;var h=t.call(c,"constructor"),v=c.constructor&&c.constructor.prototype&&t.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!v)return!1;var p;for(p in c);return typeof p>"u"||t.call(c,p)},s=function(c,h){n&&h.name==="__proto__"?n(c,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):c[h.name]=h.newValue},u=function(c,h){if(h==="__proto__")if(t.call(c,h)){if(r)return r(c,h).value}else return;return c[h]};return cp=function f(){var c,h,v,p,m,y,w=arguments[0],S=1,x=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});S<x;++S)if(c=arguments[S],c!=null)for(h in c)v=u(w,h),p=u(c,h),w!==p&&(C&&p&&(l(p)||(m=i(p)))?(m?(m=!1,y=v&&i(v)?v:[]):y=v&&l(v)?v:{},s(w,{name:h,newValue:f(C,y,p)})):typeof p<"u"&&s(w,{name:h,newValue:p}));return w},cp}var o3=s3();const fp=xu(o3);function em(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function u3(){const t=[],e={run:n,use:r};return e;function n(...i){let l=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);u(null,...i);function u(f,...c){const h=t[++l];let v=-1;if(f){s(f);return}for(;++v<i.length;)(c[v]===null||c[v]===void 0)&&(c[v]=i[v]);i=c,h?c3(h,u)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function c3(t,e){let n;return r;function r(...s){const u=t.length>s.length;let f;u&&s.push(i);try{f=t.apply(this,s)}catch(c){const h=c;if(u&&n)throw h;return i(h)}u||(f&&f.then&&typeof f.then=="function"?f.then(l,i):f instanceof Error?i(f):l(f))}function i(s,...u){n||(n=!0,e(s,...u))}function l(s){i(null,s)}}const wa={basename:f3,dirname:d3,extname:h3,join:v3,sep:"/"};function f3(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');zu(t);let n=0,r=-1,i=t.length,l;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,u=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(l){n=i+1;break}}else s<0&&(l=!0,s=i+1),u>-1&&(t.codePointAt(i)===e.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function d3(t){if(zu(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function h3(t){zu(t);let e=t.length,n=-1,r=0,i=-1,l=0,s;for(;e--;){const u=t.codePointAt(e);if(u===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),u===46?i<0?i=e:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function v3(...t){let e=-1,n;for(;++e<t.length;)zu(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":g3(n)}function g3(t){zu(t);const e=t.codePointAt(0)===47;let n=p3(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function p3(t,e){let n="",r=0,i=-1,l=0,s=-1,u,f;for(;++s<=t.length;){if(s<t.length)u=t.codePointAt(s);else{if(u===47)break;u=47}if(u===47){if(!(i===s-1||l===1))if(i!==s-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=s,l=0;continue}}else if(n.length>0){n="",r=0,i=s,l=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,l=0}else u===46&&l>-1?l++:l=-1}return n}function zu(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const m3={cwd:y3};function y3(){return"/"}function tm(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function b3(t){if(typeof t=="string")t=new URL(t);else if(!tm(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return E3(t)}function E3(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const dp=["history","path","basename","stem","extname","dirname"];class YT{constructor(e){let n;e?tm(e)?n={path:e}:typeof e=="string"||x3(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":m3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<dp.length;){const l=dp[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)dp.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?wa.basename(this.path):void 0}set basename(e){vp(e,"basename"),hp(e,"basename"),this.path=wa.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?wa.dirname(this.path):void 0}set dirname(e){Vw(this.basename,"dirname"),this.path=wa.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?wa.extname(this.path):void 0}set extname(e){if(hp(e,"extname"),Vw(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wa.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){tm(e)&&(e=b3(e)),vp(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?wa.basename(this.path,this.extname):void 0}set stem(e){vp(e,"stem"),hp(e,"stem"),this.path=wa.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new hr(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function hp(t,e){if(t&&t.includes(wa.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+wa.sep+"`")}function vp(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Vw(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function x3(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const w3=(function(t){const r=this.constructor.prototype,i=r[t],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),S3={}.hasOwnProperty;class jm extends w3{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=u3()}copy(){const e=new jm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(fp(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(mp("data",this.frozen),this.namespace[e]=n,this):S3.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mp("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=hf(e),r=this.parser||this.Parser;return gp("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),gp("process",this.parser||this.Parser),pp("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,s){const u=hf(e),f=r.parse(u);r.run(f,u,function(h,v,p){if(h||!v||!p)return c(h);const m=v,y=r.stringify(m,p);D3(y)?p.value=y:p.result=y,c(h,p)});function c(h,v){h||!v?s(h):l?l(v):n(void 0,v)}}}processSync(e){let n=!1,r;return this.freeze(),gp("processSync",this.parser||this.Parser),pp("processSync",this.compiler||this.Compiler),this.process(e,i),Kw("processSync","process",n),r;function i(l,s){n=!0,jw(l),r=s}}run(e,n,r){$w(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(s,u){const f=hf(n);i.run(e,f,c);function c(h,v,p){const m=v||e;h?u(h):s?s(m):r(void 0,m,p)}}}runSync(e,n){let r=!1,i;return this.run(e,n,l),Kw("runSync","run",r),i;function l(s,u){jw(s),i=u,r=!0}}stringify(e,n){this.freeze();const r=hf(n),i=this.compiler||this.Compiler;return pp("stringify",i),$w(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(mp("use",this.frozen),e!=null)if(typeof e=="function")f(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function l(c){if(typeof c=="function")f(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...v]=c;f(h,v)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(c.plugins),c.settings&&(i.settings=fp(!0,i.settings,c.settings))}function u(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const v=c[h];l(v)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function f(c,h){let v=-1,p=-1;for(;++v<r.length;)if(r[v][0]===c){p=v;break}if(p===-1)r.push([c,...h]);else if(h.length>0){let[m,...y]=h;const w=r[p][1];em(w)&&em(m)&&(m=fp(!0,w,m)),r[p]=[c,m,...y]}}}}const C3=new jm().freeze();function gp(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function pp(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function mp(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function $w(t){if(!em(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Kw(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function hf(t){return T3(t)?t:new YT(t)}function T3(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function D3(t){return typeof t=="string"||A3(t)}function A3(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const _3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Yw=[],Xw={allowDangerousHtml:!0},k3=/^(https?|ircs?|mailto|xmpp)$/i,N3=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function R3(t){const e=M3(t),n=O3(t);return B3(e.runSync(e.parse(n),n),t)}function M3(t){const e=t.rehypePlugins||Yw,n=t.remarkPlugins||Yw,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Xw}:Xw;return C3().use(dz).use(n).use(l3,r).use(e)}function O3(t){const e=t.children||"",n=new YT;return typeof e=="string"&&(n.value=e),n}function B3(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,l=e.disallowedElements,s=e.skipHtml,u=e.unwrapDisallowed,f=e.urlTransform||L3;for(const h of N3)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+_3+h.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),Iu(t,c),XL(t,{Fragment:_.Fragment,components:i,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function c(h,v,p){if(h.type==="raw"&&p&&typeof v=="number")return s?p.children.splice(v,1):p.children[v]={type:"text",value:h.value},v;if(h.type==="element"){let m;for(m in sp)if(Object.hasOwn(sp,m)&&Object.hasOwn(h.properties,m)){const y=h.properties[m],w=sp[m];(w===null||w.includes(h.tagName))&&(h.properties[m]=f(String(y||""),m,h))}}if(h.type==="element"){let m=n?!n.includes(h.tagName):l?l.includes(h.tagName):!1;if(!m&&r&&typeof v=="number"&&(m=!r(h,v,p)),m&&p&&typeof v=="number")return u&&h.children?p.children.splice(v,1,...h.children):p.children.splice(v,1),v}}}function L3(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||k3.test(t.slice(0,e))?t:""}const Zw=(function(t,e,n){const r=Fu(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(r(t.children[e],e,t))return t.children[e]}),Ml=(function(t){if(t==null)return z3;if(typeof t=="string")return I3(t);if(typeof t=="object")return F3(t);if(typeof t=="function")return Gm(t);throw new Error("Expected function, string, or array as `test`")});function F3(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Ml(t[n]);return Gm(r);function r(...i){let l=-1;for(;++l<e.length;)if(e[l].apply(this,i))return!0;return!1}}function I3(t){return Gm(e);function e(n){return n.tagName===t}}function Gm(t){return e;function e(n,r,i){return!!(P3(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function z3(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function P3(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const Qw=/\n/g,Ww=/[\t ]+/g,nm=Ml("br"),Jw=Ml(K3),U3=Ml("p"),eS=Ml("tr"),q3=Ml(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",$3,Y3]),XT=Ml(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function H3(t,e){const n=e||{},r="children"in t?t.children:[],i=XT(t),l=WT(t,{whitespace:n.whitespace||"normal"}),s=[];(t.type==="text"||t.type==="comment")&&s.push(...QT(t,{breakBefore:!0,breakAfter:!0}));let u=-1;for(;++u<r.length;)s.push(...ZT(r[u],t,{whitespace:l,breakBefore:u?void 0:i,breakAfter:u<r.length-1?nm(r[u+1]):i}));const f=[];let c;for(u=-1;++u<s.length;){const h=s[u];typeof h=="number"?c!==void 0&&h>c&&(c=h):h&&(c!==void 0&&c>-1&&f.push(`
|
|
348
|
+
`.repeat(c)||" "),c=-1,f.push(h))}return f.join("")}function ZT(t,e,n){return t.type==="element"?j3(t,e,n):t.type==="text"?n.whitespace==="normal"?QT(t,n):G3(t):[]}function j3(t,e,n){const r=WT(t,n),i=t.children||[];let l=-1,s=[];if(q3(t))return s;let u,f;for(nm(t)||eS(t)&&Zw(e,t,eS)?f=`
|
|
349
|
+
`:U3(t)?(u=2,f=2):XT(t)&&(u=1,f=1);++l<i.length;)s=s.concat(ZT(i[l],t,{whitespace:r,breakBefore:l?void 0:u,breakAfter:l<i.length-1?nm(i[l+1]):f}));return Jw(t)&&Zw(e,t,Jw)&&s.push(" "),u&&s.unshift(u),f&&s.push(f),s}function QT(t,e){const n=String(t.value),r=[],i=[];let l=0;for(;l<=n.length;){Qw.lastIndex=l;const f=Qw.exec(n),c=f&&"index"in f?f.index:n.length;r.push(V3(n.slice(l,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),l===0?e.breakBefore:!0,c===n.length?e.breakAfter:!0)),l=c+1}let s=-1,u;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(i.push(r[s]),u=void 0):r[s]?(typeof u=="number"&&i.push(u),i.push(r[s]),u=0):(s===0||s===r.length-1)&&i.push(0);return i}function G3(t){return[String(t.value)]}function V3(t,e,n){const r=[];let i=0,l;for(;i<t.length;){Ww.lastIndex=i;const s=Ww.exec(t);l=s?s.index:t.length,!i&&!l&&s&&!e&&r.push(""),i!==l&&r.push(t.slice(i,l)),i=s?l+s[0].length:l}return i!==l&&!n&&r.push(""),r.join(" ")}function WT(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function $3(t){return!!(t.properties||{}).hidden}function K3(t){return t.tagName==="td"||t.tagName==="th"}function Y3(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function X3(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},m=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],x=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:w,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},N={className:"function.dispatch",relevance:0,keywords:{_hint:x},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},k=[N,v,u,n,t.C_BLOCK_COMMENT_MODE,h,c],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:k.concat([{begin:/\(/,end:/\)/,keywords:A,contains:k.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:A,relevance:0},{begin:m,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,h,u,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,h,u]}]},u,n,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,O,N,k,[v,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",u]},{begin:t.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Z3(t){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=X3(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Q3(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},l=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(u);const f={match:/\\"/},c={className:"string",begin:/'/,end:/'/},h={match:/\\'/},v={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=t.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],S=["true","false"],x={match:/(\/[a-z._-]+)+/},C=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],N=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:w,literal:S,built_in:[...C,...T,"set","shopt",...A,...N]},contains:[m,t.SHEBANG(),y,v,l,s,x,u,f,c,h,n]}}function W3(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",u={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},m=e.optional(i)+t.IDENT_RE+"\\s*\\(",S={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},x=[v,u,n,t.C_BLOCK_COMMENT_MODE,h,c],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:x.concat([{begin:/\(/,end:/\)/,keywords:S,contains:x.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:m,returnBegin:!0,contains:[t.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,h,u,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,h,u]}]},u,n,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C",aliases:["h"],keywords:S,disableAutodetect:!0,illegal:"</",contains:[].concat(C,T,x,[v,{begin:t.IDENT_RE+"::",keywords:S},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:v,strings:c,keywords:S}}}function J3(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},v={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},m=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],S=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],x=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:w,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:S},N={className:"function.dispatch",relevance:0,keywords:{_hint:x},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},k=[N,v,u,n,t.C_BLOCK_COMMENT_MODE,h,c],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:k.concat([{begin:/\(/,end:/\)/,keywords:A,contains:k.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:A,relevance:0},{begin:m,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,h,u,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,h,u]}]},u,n,t.C_BLOCK_COMMENT_MODE,v]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,O,N,k,[v,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",u]},{begin:t.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function e5(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],l=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(l),built_in:e,literal:r},u=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},h={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},v=t.inherit(h,{illegal:/\n/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:s},m=t.inherit(p,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},w={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},S=t.inherit(w,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});p.contains=[w,y,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.C_BLOCK_COMMENT_MODE],m.contains=[S,y,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const x={variants:[c,w,y,h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C={begin:"<",end:">",contains:[{beginKeywords:"in out"},u]},T=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},x,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},u,C,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,C,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+T+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,C],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[x,f,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},A]}}const t5=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),n5=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r5=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a5=[...n5,...r5],i5=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l5=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),s5=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),o5=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function u5(t){const e=t.regex,n=t5(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",l=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+l5.join("|")+")"},{begin:":(:)?("+s5.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+o5.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:l},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:i5.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+a5.join("|")+")\\b"}]}}function c5(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function f5(t){const l={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:l,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:l,illegal:/["']/}]}]}}function d5(t){const e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function h5(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},l={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},u={begin:/\[/,end:/\]/,contains:[r,l,i,s,n,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,h=/'[^']*'/,v=e.either(f,c,h),p=e.concat(v,"(\\s*\\.\\s*",v,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:p,className:"attr",starts:{end:/$/,contains:[r,u,l,i,s,n]}}]}}var Ts="[0-9](_*[0-9])*",vf=`\\.(${Ts})`,gf="[0-9a-fA-F](_*[0-9a-fA-F])*",tS={className:"number",variants:[{begin:`(\\b(${Ts})((${vf})|\\.)?|(${vf}))[eE][+-]?(${Ts})[fFdD]?\\b`},{begin:`\\b(${Ts})((${vf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${vf})[fFdD]?\\b`},{begin:`\\b(${Ts})[fFdD]\\b`},{begin:`\\b0[xX]((${gf})\\.?|(${gf})?\\.(${gf}))[pP][+-]?(${Ts})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${gf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function JT(t,e,n){return n===-1?"":t.replace(e,r=>JT(t,e,n-1))}function v5(t){const e=t.regex,n="[Γ-ΚΈa-zA-Z_$][Γ-ΚΈa-zA-Z_$0-9]*",r=n+JT("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),f={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:f,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:f,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,tS,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},tS,c]}}const nS="[A-Za-z$_][0-9A-Za-z$_]*",g5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],p5=["true","false","null","undefined","NaN","Infinity"],eD=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],tD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],m5=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],y5=[].concat(nD,eD,tD);function b5(t){const e=t.regex,n=(Y,{after:Q})=>{const P="</"+Y[0].slice(1);return Y.input.indexOf(P,Q)!==-1},r=nS,i={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,Q)=>{const P=Y[0].length+Y.index,I=Y.input[P];if(I==="<"||I===","){Q.ignoreMatch();return}I===">"&&(n(Y,{after:P})||Q.ignoreMatch());let K;const F=Y.input.substring(P);if(K=F.match(/^\s*=/)){Q.ignoreMatch();return}if((K=F.match(/^\s+extends\s+/))&&K.index===0){Q.ignoreMatch();return}}},u={$pattern:nS,keyword:g5,literal:p5,built_in:y5,"variable.language":m5},f="[0-9](_?[0-9])*",c=`\\.(${f})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",v={className:"number",variants:[{begin:`(\\b(${h})((${c})|\\.)?|(${c}))[eE][+-]?(${f})\\b`},{begin:`\\b(${h})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},C={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},T=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,y,w,S,{match:/\$\d+/},v];p.contains=T.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(T)});const A=[].concat(C,p.contains),N=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:N},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...eD,...tD]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},z={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(Y){return e.concat("(?!",Y.join("|"),")")}const U={match:e.concat(/\b/,B([...nD,"super","import"].map(Y=>`${Y}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,y,w,S,C,{match:/\$\d+/},v,O,{scope:"attr",match:r+e.lookahead(":"),relevance:0},H,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,t.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:l},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},U,z,D,$,{match:/\$[(.]/}]}}function E5(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ds="[0-9](_*[0-9])*",pf=`\\.(${Ds})`,mf="[0-9a-fA-F](_*[0-9a-fA-F])*",x5={className:"number",variants:[{begin:`(\\b(${Ds})((${pf})|\\.)?|(${pf}))[eE][+-]?(${Ds})[fFdD]?\\b`},{begin:`\\b(${Ds})((${pf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${pf})[fFdD]?\\b`},{begin:`\\b(${Ds})[fFdD]\\b`},{begin:`\\b0[xX]((${mf})\\.?|(${mf})?\\.(${mf}))[pP][+-]?(${Ds})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${mf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function w5(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},l={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[l,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,l,i]}]};i.contains.push(s);const u={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},f={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},c=x5,h=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),v={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=v;return p.variants[1].contains=[v],v.variants[1].contains=[p],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,h,n,r,u,f,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[v,t.C_LINE_COMMENT_MODE,h],relevance:0},t.C_LINE_COMMENT_MODE,h,u,f,s,t.C_NUMBER_MODE]},h]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},u,f]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
350
|
+
`},c]}}const S5=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),C5=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],T5=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],D5=[...C5,...T5],A5=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),rD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),aD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),_5=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),k5=rD.concat(aD).sort().reverse();function N5(t){const e=S5(t),n=k5,r="and or not only",i="[\\w-]+",l="("+i+"|@\\{"+i+"\\})",s=[],u=[],f=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},c=function(T,A,N){return{className:T,begin:A,relevance:N}},h={$pattern:/[a-z-]+/,keyword:r,attribute:A5.join(" ")},v={begin:"\\(",end:"\\)",contains:u,keywords:h,relevance:0};u.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,f("'"),f('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,v,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const p=u.concat({begin:/\{/,end:/\}/,contains:s}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(u)},y={begin:l+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+_5.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:u}}]},w={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:h,returnEnd:!0,contains:u,relevance:0}},S={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:p}},x={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:l,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+D5.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",l,0),c("selector-id","#"+l),c("selector-class","\\."+l,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+rD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+aD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},e.FUNCTION_DISPATCH]},C={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[x]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,w,S,C,y,x,m,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function R5(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function M5(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},l={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,l,s]}}function O5(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},l={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},v=t.inherit(c,{contains:[]}),p=t.inherit(h,{contains:[]});c.contains.push(p),h.contains.push(v);let m=[n,f];return[c,h,v,p].forEach(x=>{x.contains=x.contains.concat(m)}),m=m.concat(c,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,l,c,h,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},i,r,f,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function B5(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,u={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},f={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:u,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+f.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:f,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function L5(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},l={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},u={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},f={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[u]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},h=[t.BACKSLASH_ESCAPE,l,f],v=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],p=(w,S,x="\\1")=>{const C=x==="\\1"?x:e.concat(x,S);return e.concat(e.concat("(?:",w,")"),S,/(?:\\.|[^\\\/])*?/,C,/(?:\\.|[^\\\/])*?/,x,r)},m=(w,S,x)=>e.concat(e.concat("(?:",w,")"),S,/(?:\\.|[^\\\/])*?/,x,r),y=[f,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:h,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:p("s|tr|y",e.either(...v,{capture:!0}))},{begin:p("s|tr|y","\\(","\\)")},{begin:p("s|tr|y","\\[","\\]")},{begin:p("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",e.either(...v,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,u]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,u,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return l.contains=y,s.contains=y,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:y}}function F5(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),l=e.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},u={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},f={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=t.inherit(t.APOS_STRING_MODE,{illegal:null}),h=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(f)}),v={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(V,$)=>{$.data._beginMatch=V[1]||V[2]},"on:end":(V,$)=>{$.data._beginMatch!==V[1]&&$.ignoreMatch()}},p=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[
|
|
351
|
+
]`,y={scope:"string",variants:[h,c,v,p]},w={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},S=["false","null","true"],x=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],C=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],A={keyword:x,literal:(V=>{const $=[];return V.forEach(q=>{$.push(q),q.toLowerCase()===q?$.push(q.toUpperCase()):$.push(q.toLowerCase())}),$})(S),built_in:C},N=V=>V.map($=>$.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",N(C).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},D=e.concat(r,"\\b(?!\\()"),O={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},L={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},M={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[L,s,O,t.C_BLOCK_COMMENT_MODE,y,w,k]},z={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",N(x).join("\\b|"),"|",N(C).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[M]};M.contains.push(z);const B=[L,O,t.C_BLOCK_COMMENT_MODE,y,w,k],U={begin:e.concat(/#\[\s*\\?/,e.either(i,l)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:S,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:S,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:i},{match:l}]}]};return{case_insensitive:!1,keywords:A,contains:[U,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},u,{scope:"variable.language",match:/\$this\b/},s,z,O,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},k,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:A,contains:["self",U,s,O,t.C_BLOCK_COMMENT_MODE,y,w]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},y,w]}}function I5(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function z5(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function P5(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},v={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f,h,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f,h,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",m=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,y=`\\b|${r.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${m}))[eE][+-]?(${p})[jJ]?(?=${y})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${p})[jJ](?=${y})`}]},S={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",f,w,v,t.HASH_COMMENT_MODE]}]};return c.contains=[v,w,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[f,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},v,S,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,x,v]}]}}function U5(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function q5(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,l=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[l,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:l},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function H5(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},u={className:"doctag",begin:"@[A-Za-z]+"},f={begin:"#<",end:">"},c=[t.COMMENT("#","$",{contains:[u]}),t.COMMENT("^=begin","^=end",{contains:[u],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],h={className:"subst",begin:/#\{/,end:/\}/,keywords:s},v={className:"string",contains:[t.BACKSLASH_ESCAPE,h],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,h]})]}]},p="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${p})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},w={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},k=[v,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[v,{begin:n}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,h],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(f,c),relevance:0}].concat(f,c);h.contains=k,w.contains=k;const M=[{begin:/^\s*=>/,starts:{end:"$",contains:k}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:k}}];return c.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(M).concat(c).concat(k)}}function j5(t){const e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),i=e.concat(n,t.IDENT_RE),l={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],f=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:u,literal:f,built_in:c},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:h}},{className:"punctuation",begin:"->"},l]}}const G5=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),V5=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],$5=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],K5=[...V5,...$5],Y5=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),X5=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Z5=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Q5=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function W5(t){const e=G5(t),n=Z5,r=X5,i="@[a-z-]+",l="and or not only",u={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+K5.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},u,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Q5.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,u,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:Y5.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},u,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function J5(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function e4(t){const e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},l=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],f=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],v=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=h,y=[...c,...f].filter(N=>!h.includes(N)),w={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},S={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:e.concat(/\b/,e.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function C(N){return e.concat(/\b/,e.either(...N.map(k=>k.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:C(p),relevance:0};function A(N,{exceptions:k,when:D}={}){const O=D;return k=k||[],N.map(L=>L.match(/\|\d+$/)||k.includes(L)?L:O(L)?`${L}|0`:L)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(y,{when:N=>N.length<3}),literal:l,type:u,built_in:v},contains:[{scope:"type",match:C(s)},T,x,w,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,S]}}function iD(t){return t?typeof t=="string"?t:t.source:null}function Wo(t){return nn("(?=",t,")")}function nn(...t){return t.map(n=>iD(n)).join("")}function t4(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function mr(...t){return"("+(t4(t).capture?"":"?:")+t.map(r=>iD(r)).join("|")+")"}const Vm=t=>nn(/\b/,t,/\w$/.test(t)?/\b/:/\B/),n4=["Protocol","Type"].map(Vm),rS=["init","self"].map(Vm),r4=["Any","Self"],yp=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],aS=["false","nil","true"],a4=["assignment","associativity","higherThan","left","lowerThan","none","right"],i4=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],iS=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],lD=mr(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),sD=mr(lD,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),bp=nn(lD,sD,"*"),oD=mr(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Zf=mr(oD,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),xa=nn(oD,Zf,"*"),yf=nn(/[A-Z]/,Zf,"*"),l4=["attached","autoclosure",nn(/convention\(/,mr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nn(/objc\(/,xa,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],s4=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function o4(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,mr(...n4,...rS)],className:{2:"keyword"}},l={match:nn(/\./,mr(...yp)),relevance:0},s=yp.filter(Ye=>typeof Ye=="string").concat(["_|0"]),u=yp.filter(Ye=>typeof Ye!="string").concat(r4).map(Vm),f={variants:[{className:"keyword",match:mr(...u,...rS)}]},c={$pattern:mr(/\b\w+/,/#\w+/),keyword:s.concat(i4),literal:aS},h=[i,l,f],v={match:nn(/\./,mr(...iS)),relevance:0},p={className:"built_in",match:nn(/\b/,mr(...iS),/(?=\()/)},m=[v,p],y={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:bp},{match:`\\.(\\.|${sD})+`}]},S=[y,w],x="([0-9]_*)+",C="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${x})(\\.(${x}))?([eE][+-]?(${x}))?\\b`},{match:`\\b0x(${C})(\\.(${C}))?([pP][+-]?(${x}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(Ye="")=>({className:"subst",variants:[{match:nn(/\\/,Ye,/[0\\tnr"']/)},{match:nn(/\\/,Ye,/u\{[0-9a-fA-F]{1,8}\}/)}]}),N=(Ye="")=>({className:"subst",match:nn(/\\/,Ye,/[\t ]*(?:[\r\n]|\r\n)/)}),k=(Ye="")=>({className:"subst",label:"interpol",begin:nn(/\\/,Ye,/\(/),end:/\)/}),D=(Ye="")=>({begin:nn(Ye,/"""/),end:nn(/"""/,Ye),contains:[A(Ye),N(Ye),k(Ye)]}),O=(Ye="")=>({begin:nn(Ye,/"/),end:nn(/"/,Ye),contains:[A(Ye),k(Ye)]}),L={className:"string",variants:[D(),D("#"),D("##"),D("###"),O(),O("#"),O("##"),O("###")]},M=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],z={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:M},B=Ye=>{const lt=nn(Ye,/\//),We=nn(/\//,Ye);return{begin:lt,end:We,contains:[...M,{scope:"comment",begin:`#(?!.*${We})`,end:/$/}]}},U={scope:"regexp",variants:[B("###"),B("##"),B("#"),z]},V={match:nn(/`/,xa,/`/)},$={className:"variable",match:/\$\d+/},q={className:"variable",match:`\\$${Zf}+`},H=[V,$,q],Y={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:s4,contains:[...S,T,L]}]}},Q={scope:"keyword",match:nn(/@/,mr(...l4),Wo(mr(/\(/,/\s+/)))},P={scope:"meta",match:nn(/@/,xa)},I=[Y,Q,P],K={match:Wo(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:nn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Zf,"+")},{className:"type",match:yf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nn(/\s+&\s+/,Wo(yf)),relevance:0}]},F={begin:/</,end:/>/,keywords:c,contains:[...r,...h,...I,y,K]};K.contains.push(F);const J={match:nn(xa,/\s*:/),keywords:"_|0",relevance:0},re={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",J,...r,U,...h,...m,...S,T,L,...H,...I,K]},se={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,K]},me={begin:mr(Wo(nn(xa,/\s*:/)),Wo(nn(xa,/\s+/,xa,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:xa}]},Ne={begin:/\(/,end:/\)/,keywords:c,contains:[me,...r,...h,...S,T,L,...I,K,re],endsParent:!0,illegal:/["']/},pe={match:[/(func|macro)/,/\s+/,mr(V.match,xa,bp)],className:{1:"keyword",3:"title.function"},contains:[se,Ne,e],illegal:[/\[/,/%/]},ee={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[se,Ne,e],illegal:/\[|%/},le={match:[/operator/,/\s+/,bp],className:{1:"keyword",3:"title"}},de={begin:[/precedencegroup/,/\s+/,yf],className:{1:"keyword",3:"title"},contains:[K],keywords:[...a4,...aS],end:/}/},xe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Re={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},$e={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,xa,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[se,...h,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:yf},...h],relevance:0}]};for(const Ye of L.variants){const lt=Ye.contains.find(et=>et.label==="interpol");lt.keywords=c;const We=[...h,...m,...S,T,L,...H];lt.contains=[...We,{begin:/\(/,end:/\)/,contains:["self",...We]}]}return{name:"Swift",keywords:c,contains:[...r,pe,ee,xe,Re,$e,le,de,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},U,...h,...m,...S,T,L,...H,...I,K,re]}}const Qf="[A-Za-z$_][0-9A-Za-z$_]*",uD=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],cD=["true","false","null","undefined","NaN","Infinity"],fD=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],dD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vD=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],gD=[].concat(hD,fD,dD);function u4(t){const e=t.regex,n=(Y,{after:Q})=>{const P="</"+Y[0].slice(1);return Y.input.indexOf(P,Q)!==-1},r=Qf,i={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,Q)=>{const P=Y[0].length+Y.index,I=Y.input[P];if(I==="<"||I===","){Q.ignoreMatch();return}I===">"&&(n(Y,{after:P})||Q.ignoreMatch());let K;const F=Y.input.substring(P);if(K=F.match(/^\s*=/)){Q.ignoreMatch();return}if((K=F.match(/^\s+extends\s+/))&&K.index===0){Q.ignoreMatch();return}}},u={$pattern:Qf,keyword:uD,literal:cD,built_in:gD,"variable.language":vD},f="[0-9](_?[0-9])*",c=`\\.(${f})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",v={className:"number",variants:[{begin:`(\\b(${h})((${c})|\\.)?|(${c}))[eE][+-]?(${f})\\b`},{begin:`\\b(${h})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},S={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},C={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},T=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,y,w,S,{match:/\$\d+/},v];p.contains=T.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(T)});const A=[].concat(C,p.contains),N=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:N},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...fD,...dD]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},z={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(Y){return e.concat("(?!",Y.join("|"),")")}const U={match:e.concat(/\b/,B([...hD,"super","import"].map(Y=>`${Y}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,y,w,S,C,{match:/\$\d+/},v,O,{scope:"attr",match:r+e.lookahead(":"),relevance:0},H,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,t.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:l},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},U,z,D,$,{match:/\$[(.]/}]}}function c4(t){const e=t.regex,n=u4(t),r=Qf,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],l={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},f=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Qf,keyword:uD.concat(f),literal:cD,built_in:gD.concat(i),"variable.language":vD},h={className:"meta",begin:"@"+r},v=(w,S,x)=>{const C=w.contains.findIndex(T=>T.label===S);if(C===-1)throw new Error("can not find mode to replace");w.contains.splice(C,1,x)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(h);const p=n.contains.find(w=>w.scope==="attr"),m=Object.assign({},p,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,p,m]),n.contains=n.contains.concat([h,l,s,m]),v(n,"shebang",t.SHEBANG()),v(n,"use_strict",u);const y=n.contains.find(w=>w.label==="func.def");return y.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function f4(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,l=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,u=/\d{1,2}(:\d{1,2}){1,2}/,f={className:"literal",variants:[{begin:e.concat(/# */,e.either(l,i),/ *#/)},{begin:e.concat(/# */,u,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(l,i),/ +/,e.either(s,u),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},h={className:"label",begin:/^\w+:/},v=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),p=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,f,c,h,v,p,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[p]}]}}function d4(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},l={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},u={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},f={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},l,s,i,t.QUOTE_STRING_MODE,f,c,u]}}function h4(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},l={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(l,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),f=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[l,f,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[l,s,f,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[f]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function v4(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},l={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},y={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},S=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},p,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},y,w,l,s],x=[...S];return x.pop(),x.push(u),m.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:S}}const g4={arduino:Z3,bash:Q3,c:W3,cpp:J3,csharp:e5,css:u5,diff:c5,go:f5,graphql:d5,ini:h5,java:v5,javascript:b5,json:E5,kotlin:w5,less:N5,lua:R5,makefile:M5,markdown:O5,objectivec:B5,perl:L5,php:F5,"php-template":I5,plaintext:z5,python:P5,"python-repl":U5,r:q5,ruby:H5,rust:j5,scss:W5,shell:J5,sql:e4,swift:o4,typescript:c4,vbnet:f4,wasm:d4,xml:h4,yaml:v4};var Ep,lS;function p4(){if(lS)return Ep;lS=1;function t(X){return X instanceof Map?X.clear=X.delete=X.set=function(){throw new Error("map is read-only")}:X instanceof Set&&(X.add=X.clear=X.delete=function(){throw new Error("set is read-only")}),Object.freeze(X),Object.getOwnPropertyNames(X).forEach(ne=>{const Ce=X[ne],Fe=typeof Ce;(Fe==="object"||Fe==="function")&&!Object.isFrozen(Ce)&&t(Ce)}),X}class e{constructor(ne){ne.data===void 0&&(ne.data={}),this.data=ne.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(X){return X.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(X,...ne){const Ce=Object.create(null);for(const Fe in X)Ce[Fe]=X[Fe];return ne.forEach(function(Fe){for(const mt in Fe)Ce[mt]=Fe[mt]}),Ce}const i="</span>",l=X=>!!X.scope,s=(X,{prefix:ne})=>{if(X.startsWith("language:"))return X.replace("language:","language-");if(X.includes(".")){const Ce=X.split(".");return[`${ne}${Ce.shift()}`,...Ce.map((Fe,mt)=>`${Fe}${"_".repeat(mt+1)}`)].join(" ")}return`${ne}${X}`};class u{constructor(ne,Ce){this.buffer="",this.classPrefix=Ce.classPrefix,ne.walk(this)}addText(ne){this.buffer+=n(ne)}openNode(ne){if(!l(ne))return;const Ce=s(ne.scope,{prefix:this.classPrefix});this.span(Ce)}closeNode(ne){l(ne)&&(this.buffer+=i)}value(){return this.buffer}span(ne){this.buffer+=`<span class="${ne}">`}}const f=(X={})=>{const ne={children:[]};return Object.assign(ne,X),ne};class c{constructor(){this.rootNode=f(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ne){this.top.children.push(ne)}openNode(ne){const Ce=f({scope:ne});this.add(Ce),this.stack.push(Ce)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ne){return this.constructor._walk(ne,this.rootNode)}static _walk(ne,Ce){return typeof Ce=="string"?ne.addText(Ce):Ce.children&&(ne.openNode(Ce),Ce.children.forEach(Fe=>this._walk(ne,Fe)),ne.closeNode(Ce)),ne}static _collapse(ne){typeof ne!="string"&&ne.children&&(ne.children.every(Ce=>typeof Ce=="string")?ne.children=[ne.children.join("")]:ne.children.forEach(Ce=>{c._collapse(Ce)}))}}class h extends c{constructor(ne){super(),this.options=ne}addText(ne){ne!==""&&this.add(ne)}startScope(ne){this.openNode(ne)}endScope(){this.closeNode()}__addSublanguage(ne,Ce){const Fe=ne.root;Ce&&(Fe.scope=`language:${Ce}`),this.add(Fe)}toHTML(){return new u(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function v(X){return X?typeof X=="string"?X:X.source:null}function p(X){return w("(?=",X,")")}function m(X){return w("(?:",X,")*")}function y(X){return w("(?:",X,")?")}function w(...X){return X.map(Ce=>v(Ce)).join("")}function S(X){const ne=X[X.length-1];return typeof ne=="object"&&ne.constructor===Object?(X.splice(X.length-1,1),ne):{}}function x(...X){return"("+(S(X).capture?"":"?:")+X.map(Fe=>v(Fe)).join("|")+")"}function C(X){return new RegExp(X.toString()+"|").exec("").length-1}function T(X,ne){const Ce=X&&X.exec(ne);return Ce&&Ce.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function N(X,{joinWith:ne}){let Ce=0;return X.map(Fe=>{Ce+=1;const mt=Ce;let ft=v(Fe),He="";for(;ft.length>0;){const Me=A.exec(ft);if(!Me){He+=ft;break}He+=ft.substring(0,Me.index),ft=ft.substring(Me.index+Me[0].length),Me[0][0]==="\\"&&Me[1]?He+="\\"+String(Number(Me[1])+mt):(He+=Me[0],Me[0]==="("&&Ce++)}return He}).map(Fe=>`(${Fe})`).join(ne)}const k=/\b\B/,D="[a-zA-Z]\\w*",O="[a-zA-Z_]\\w*",L="\\b\\d+(\\.\\d+)?",M="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",z="\\b(0b[01]+)",B="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",U=(X={})=>{const ne=/^#![ ]*\//;return X.binary&&(X.begin=w(ne,/.*\b/,X.binary,/\b.*/)),r({scope:"meta",begin:ne,end:/$/,relevance:0,"on:begin":(Ce,Fe)=>{Ce.index!==0&&Fe.ignoreMatch()}},X)},V={begin:"\\\\[\\s\\S]",relevance:0},$={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[V]},q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[V]},H={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Y=function(X,ne,Ce={}){const Fe=r({scope:"comment",begin:X,end:ne,contains:[]},Ce);Fe.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const mt=x("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Fe.contains.push({begin:w(/[ ]+/,"(",mt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Fe},Q=Y("//","$"),P=Y("/\\*","\\*/"),I=Y("#","$"),K={scope:"number",begin:L,relevance:0},F={scope:"number",begin:M,relevance:0},J={scope:"number",begin:z,relevance:0},re={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[V,{begin:/\[/,end:/\]/,relevance:0,contains:[V]}]},se={scope:"title",begin:D,relevance:0},me={scope:"title",begin:O,relevance:0},Ne={begin:"\\.\\s*"+O,relevance:0};var ee=Object.freeze({__proto__:null,APOS_STRING_MODE:$,BACKSLASH_ESCAPE:V,BINARY_NUMBER_MODE:J,BINARY_NUMBER_RE:z,COMMENT:Y,C_BLOCK_COMMENT_MODE:P,C_LINE_COMMENT_MODE:Q,C_NUMBER_MODE:F,C_NUMBER_RE:M,END_SAME_AS_BEGIN:function(X){return Object.assign(X,{"on:begin":(ne,Ce)=>{Ce.data._beginMatch=ne[1]},"on:end":(ne,Ce)=>{Ce.data._beginMatch!==ne[1]&&Ce.ignoreMatch()}})},HASH_COMMENT_MODE:I,IDENT_RE:D,MATCH_NOTHING_RE:k,METHOD_GUARD:Ne,NUMBER_MODE:K,NUMBER_RE:L,PHRASAL_WORDS_MODE:H,QUOTE_STRING_MODE:q,REGEXP_MODE:re,RE_STARTERS_RE:B,SHEBANG:U,TITLE_MODE:se,UNDERSCORE_IDENT_RE:O,UNDERSCORE_TITLE_MODE:me});function le(X,ne){X.input[X.index-1]==="."&&ne.ignoreMatch()}function de(X,ne){X.className!==void 0&&(X.scope=X.className,delete X.className)}function xe(X,ne){ne&&X.beginKeywords&&(X.begin="\\b("+X.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",X.__beforeBegin=le,X.keywords=X.keywords||X.beginKeywords,delete X.beginKeywords,X.relevance===void 0&&(X.relevance=0))}function Re(X,ne){Array.isArray(X.illegal)&&(X.illegal=x(...X.illegal))}function $e(X,ne){if(X.match){if(X.begin||X.end)throw new Error("begin & end are not supported with match");X.begin=X.match,delete X.match}}function Ye(X,ne){X.relevance===void 0&&(X.relevance=1)}const lt=(X,ne)=>{if(!X.beforeMatch)return;if(X.starts)throw new Error("beforeMatch cannot be used with starts");const Ce=Object.assign({},X);Object.keys(X).forEach(Fe=>{delete X[Fe]}),X.keywords=Ce.keywords,X.begin=w(Ce.beforeMatch,p(Ce.begin)),X.starts={relevance:0,contains:[Object.assign(Ce,{endsParent:!0})]},X.relevance=0,delete Ce.beforeMatch},We=["of","and","for","in","not","or","if","then","parent","list","value"],et="keyword";function ze(X,ne,Ce=et){const Fe=Object.create(null);return typeof X=="string"?mt(Ce,X.split(" ")):Array.isArray(X)?mt(Ce,X):Object.keys(X).forEach(function(ft){Object.assign(Fe,ze(X[ft],ne,ft))}),Fe;function mt(ft,He){ne&&(He=He.map(Me=>Me.toLowerCase())),He.forEach(function(Me){const Ze=Me.split("|");Fe[Ze[0]]=[ft,Ge(Ze[0],Ze[1])]})}}function Ge(X,ne){return ne?Number(ne):tt(X)?0:1}function tt(X){return We.includes(X.toLowerCase())}const ot={},Pe=X=>{console.error(X)},pt=(X,...ne)=>{console.log(`WARN: ${X}`,...ne)},ue=(X,ne)=>{ot[`${X}/${ne}`]||(console.log(`Deprecated as of ${X}. ${ne}`),ot[`${X}/${ne}`]=!0)},Te=new Error;function Oe(X,ne,{key:Ce}){let Fe=0;const mt=X[Ce],ft={},He={};for(let Me=1;Me<=ne.length;Me++)He[Me+Fe]=mt[Me],ft[Me+Fe]=!0,Fe+=C(ne[Me-1]);X[Ce]=He,X[Ce]._emit=ft,X[Ce]._multi=!0}function Xe(X){if(Array.isArray(X.begin)){if(X.skip||X.excludeBegin||X.returnBegin)throw Pe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Te;if(typeof X.beginScope!="object"||X.beginScope===null)throw Pe("beginScope must be object"),Te;Oe(X,X.begin,{key:"beginScope"}),X.begin=N(X.begin,{joinWith:""})}}function Le(X){if(Array.isArray(X.end)){if(X.skip||X.excludeEnd||X.returnEnd)throw Pe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Te;if(typeof X.endScope!="object"||X.endScope===null)throw Pe("endScope must be object"),Te;Oe(X,X.end,{key:"endScope"}),X.end=N(X.end,{joinWith:""})}}function Ue(X){X.scope&&typeof X.scope=="object"&&X.scope!==null&&(X.beginScope=X.scope,delete X.scope)}function ye(X){Ue(X),typeof X.beginScope=="string"&&(X.beginScope={_wrap:X.beginScope}),typeof X.endScope=="string"&&(X.endScope={_wrap:X.endScope}),Xe(X),Le(X)}function G(X){function ne(He,Me){return new RegExp(v(He),"m"+(X.case_insensitive?"i":"")+(X.unicodeRegex?"u":"")+(Me?"g":""))}class Ce{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Me,Ze){Ze.position=this.position++,this.matchIndexes[this.matchAt]=Ze,this.regexes.push([Ze,Me]),this.matchAt+=C(Me)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Me=this.regexes.map(Ze=>Ze[1]);this.matcherRe=ne(N(Me,{joinWith:"|"}),!0),this.lastIndex=0}exec(Me){this.matcherRe.lastIndex=this.lastIndex;const Ze=this.matcherRe.exec(Me);if(!Ze)return null;const Et=Ze.findIndex((Nn,Bt)=>Bt>0&&Nn!==void 0),yt=this.matchIndexes[Et];return Ze.splice(0,Et),Object.assign(Ze,yt)}}class Fe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Me){if(this.multiRegexes[Me])return this.multiRegexes[Me];const Ze=new Ce;return this.rules.slice(Me).forEach(([Et,yt])=>Ze.addRule(Et,yt)),Ze.compile(),this.multiRegexes[Me]=Ze,Ze}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Me,Ze){this.rules.push([Me,Ze]),Ze.type==="begin"&&this.count++}exec(Me){const Ze=this.getMatcher(this.regexIndex);Ze.lastIndex=this.lastIndex;let Et=Ze.exec(Me);if(this.resumingScanAtSamePosition()&&!(Et&&Et.index===this.lastIndex)){const yt=this.getMatcher(0);yt.lastIndex=this.lastIndex+1,Et=yt.exec(Me)}return Et&&(this.regexIndex+=Et.position+1,this.regexIndex===this.count&&this.considerAll()),Et}}function mt(He){const Me=new Fe;return He.contains.forEach(Ze=>Me.addRule(Ze.begin,{rule:Ze,type:"begin"})),He.terminatorEnd&&Me.addRule(He.terminatorEnd,{type:"end"}),He.illegal&&Me.addRule(He.illegal,{type:"illegal"}),Me}function ft(He,Me){const Ze=He;if(He.isCompiled)return Ze;[de,$e,ye,lt].forEach(yt=>yt(He,Me)),X.compilerExtensions.forEach(yt=>yt(He,Me)),He.__beforeBegin=null,[xe,Re,Ye].forEach(yt=>yt(He,Me)),He.isCompiled=!0;let Et=null;return typeof He.keywords=="object"&&He.keywords.$pattern&&(He.keywords=Object.assign({},He.keywords),Et=He.keywords.$pattern,delete He.keywords.$pattern),Et=Et||/\w+/,He.keywords&&(He.keywords=ze(He.keywords,X.case_insensitive)),Ze.keywordPatternRe=ne(Et,!0),Me&&(He.begin||(He.begin=/\B|\b/),Ze.beginRe=ne(Ze.begin),!He.end&&!He.endsWithParent&&(He.end=/\B|\b/),He.end&&(Ze.endRe=ne(Ze.end)),Ze.terminatorEnd=v(Ze.end)||"",He.endsWithParent&&Me.terminatorEnd&&(Ze.terminatorEnd+=(He.end?"|":"")+Me.terminatorEnd)),He.illegal&&(Ze.illegalRe=ne(He.illegal)),He.contains||(He.contains=[]),He.contains=[].concat(...He.contains.map(function(yt){return fe(yt==="self"?He:yt)})),He.contains.forEach(function(yt){ft(yt,Ze)}),He.starts&&ft(He.starts,Me),Ze.matcher=mt(Ze),Ze}if(X.compilerExtensions||(X.compilerExtensions=[]),X.contains&&X.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return X.classNameAliases=r(X.classNameAliases||{}),ft(X)}function te(X){return X?X.endsWithParent||te(X.starts):!1}function fe(X){return X.variants&&!X.cachedVariants&&(X.cachedVariants=X.variants.map(function(ne){return r(X,{variants:null},ne)})),X.cachedVariants?X.cachedVariants:te(X)?r(X,{starts:X.starts?r(X.starts):null}):Object.isFrozen(X)?r(X):X}var ce="11.11.1";class we extends Error{constructor(ne,Ce){super(ne),this.name="HTMLInjectionError",this.html=Ce}}const Ie=n,ke=r,Ve=Symbol("nomatch"),Ke=7,Qe=function(X){const ne=Object.create(null),Ce=Object.create(null),Fe=[];let mt=!0;const ft="Could not find the language '{}', did you forget to load/include a language module?",He={disableAutodetect:!0,name:"Plain text",contains:[]};let Me={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h};function Ze(ie){return Me.noHighlightRe.test(ie)}function Et(ie){let Ae=ie.className+" ";Ae+=ie.parentNode?ie.parentNode.className:"";const Je=Me.languageDetectRe.exec(Ae);if(Je){const Dt=Cn(Je[1]);return Dt||(pt(ft.replace("{}",Je[1])),pt("Falling back to no-highlight mode for this block.",ie)),Dt?Je[1]:"no-highlight"}return Ae.split(/\s+/).find(Dt=>Ze(Dt)||Cn(Dt))}function yt(ie,Ae,Je){let Dt="",Pt="";typeof Ae=="object"?(Dt=ie,Je=Ae.ignoreIllegals,Pt=Ae.language):(ue("10.7.0","highlight(lang, code, ...args) has been deprecated."),ue("10.7.0",`Please use highlight(code, options) instead.
|
|
352
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Pt=ie,Dt=Ae),Je===void 0&&(Je=!0);const Qt={code:Dt,language:Pt};ia("before:highlight",Qt);const Zn=Qt.result?Qt.result:Nn(Qt.language,Qt.code,Je);return Zn.code=Qt.code,ia("after:highlight",Zn),Zn}function Nn(ie,Ae,Je,Dt){const Pt=Object.create(null);function Qt(qe,at){return qe.keywords[at]}function Zn(){if(!gt.keywords){Rn.addText(Yt);return}let qe=0;gt.keywordPatternRe.lastIndex=0;let at=gt.keywordPatternRe.exec(Yt),xt="";for(;at;){xt+=Yt.substring(qe,at.index);const Nt=Wn.case_insensitive?at[0].toLowerCase():at[0],xn=Qt(gt,Nt);if(xn){const[$r,Zs]=xn;if(Rn.addText(xt),xt="",Pt[Nt]=(Pt[Nt]||0)+1,Pt[Nt]<=Ke&&(ei+=Zs),$r.startsWith("_"))xt+=at[0];else{const qu=Wn.classNameAliases[$r]||$r;dn(at[0],qu)}}else xt+=at[0];qe=gt.keywordPatternRe.lastIndex,at=gt.keywordPatternRe.exec(Yt)}xt+=Yt.substring(qe),Rn.addText(xt)}function Qn(){if(Yt==="")return;let qe=null;if(typeof gt.subLanguage=="string"){if(!ne[gt.subLanguage]){Rn.addText(Yt);return}qe=Nn(gt.subLanguage,Yt,!0,Uu[gt.subLanguage]),Uu[gt.subLanguage]=qe._top}else qe=Gn(Yt,gt.subLanguage.length?gt.subLanguage:null);gt.relevance>0&&(ei+=qe.relevance),Rn.__addSublanguage(qe._emitter,qe.language)}function Ut(){gt.subLanguage!=null?Qn():Zn(),Yt=""}function dn(qe,at){qe!==""&&(Rn.startScope(at),Rn.addText(qe),Rn.endScope())}function Ol(qe,at){let xt=1;const Nt=at.length-1;for(;xt<=Nt;){if(!qe._emit[xt]){xt++;continue}const xn=Wn.classNameAliases[qe[xt]]||qe[xt],$r=at[xt];xn?dn($r,xn):(Yt=$r,Zn(),Yt=""),xt++}}function Yi(qe,at){return qe.scope&&typeof qe.scope=="string"&&Rn.openNode(Wn.classNameAliases[qe.scope]||qe.scope),qe.beginScope&&(qe.beginScope._wrap?(dn(Yt,Wn.classNameAliases[qe.beginScope._wrap]||qe.beginScope._wrap),Yt=""):qe.beginScope._multi&&(Ol(qe.beginScope,at),Yt="")),gt=Object.create(qe,{parent:{value:gt}}),gt}function Xi(qe,at,xt){let Nt=T(qe.endRe,xt);if(Nt){if(qe["on:end"]){const xn=new e(qe);qe["on:end"](at,xn),xn.isMatchIgnored&&(Nt=!1)}if(Nt){for(;qe.endsParent&&qe.parent;)qe=qe.parent;return qe}}if(qe.endsWithParent)return Xi(qe.parent,at,xt)}function Bl(qe){return gt.matcher.regexIndex===0?(Yt+=qe[0],1):(ti=!0,0)}function xd(qe){const at=qe[0],xt=qe.rule,Nt=new e(xt),xn=[xt.__beforeBegin,xt["on:begin"]];for(const $r of xn)if($r&&($r(qe,Nt),Nt.isMatchIgnored))return Bl(at);return xt.skip?Yt+=at:(xt.excludeBegin&&(Yt+=at),Ut(),!xt.returnBegin&&!xt.excludeBegin&&(Yt=at)),Yi(xt,qe),xt.returnBegin?0:at.length}function xr(qe){const at=qe[0],xt=Ae.substring(qe.index),Nt=Xi(gt,qe,xt);if(!Nt)return Ve;const xn=gt;gt.endScope&>.endScope._wrap?(Ut(),dn(at,gt.endScope._wrap)):gt.endScope&>.endScope._multi?(Ut(),Ol(gt.endScope,qe)):xn.skip?Yt+=at:(xn.returnEnd||xn.excludeEnd||(Yt+=at),Ut(),xn.excludeEnd&&(Yt=at));do gt.scope&&Rn.closeNode(),!gt.skip&&!gt.subLanguage&&(ei+=gt.relevance),gt=gt.parent;while(gt!==Nt.parent);return Nt.starts&&Yi(Nt.starts,qe),xn.returnEnd?0:at.length}function Ys(){const qe=[];for(let at=gt;at!==Wn;at=at.parent)at.scope&&qe.unshift(at.scope);qe.forEach(at=>Rn.openNode(at))}let Zi={};function Ll(qe,at){const xt=at&&at[0];if(Yt+=qe,xt==null)return Ut(),0;if(Zi.type==="begin"&&at.type==="end"&&Zi.index===at.index&&xt===""){if(Yt+=Ae.slice(at.index,at.index+1),!mt){const Nt=new Error(`0 width match regex (${ie})`);throw Nt.languageName=ie,Nt.badRule=Zi.rule,Nt}return 1}if(Zi=at,at.type==="begin")return xd(at);if(at.type==="illegal"&&!Je){const Nt=new Error('Illegal lexeme "'+xt+'" for mode "'+(gt.scope||"<unnamed>")+'"');throw Nt.mode=gt,Nt}else if(at.type==="end"){const Nt=xr(at);if(Nt!==Ve)return Nt}if(at.type==="illegal"&&xt==="")return Yt+=`
|
|
353
|
+
`,1;if(Xs>1e5&&Xs>at.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Yt+=xt,xt.length}const Wn=Cn(ie);if(!Wn)throw Pe(ft.replace("{}",ie)),new Error('Unknown language: "'+ie+'"');const Pu=G(Wn);let Fl="",gt=Dt||Pu;const Uu={},Rn=new Me.__emitter(Me);Ys();let Yt="",ei=0,_a=0,Xs=0,ti=!1;try{if(Wn.__emitTokens)Wn.__emitTokens(Ae,Rn);else{for(gt.matcher.considerAll();;){Xs++,ti?ti=!1:gt.matcher.considerAll(),gt.matcher.lastIndex=_a;const qe=gt.matcher.exec(Ae);if(!qe)break;const at=Ae.substring(_a,qe.index),xt=Ll(at,qe);_a=qe.index+xt}Ll(Ae.substring(_a))}return Rn.finalize(),Fl=Rn.toHTML(),{language:ie,value:Fl,relevance:ei,illegal:!1,_emitter:Rn,_top:gt}}catch(qe){if(qe.message&&qe.message.includes("Illegal"))return{language:ie,value:Ie(Ae),illegal:!0,relevance:0,_illegalBy:{message:qe.message,index:_a,context:Ae.slice(_a-100,_a+100),mode:qe.mode,resultSoFar:Fl},_emitter:Rn};if(mt)return{language:ie,value:Ie(Ae),illegal:!1,relevance:0,errorRaised:qe,_emitter:Rn,_top:gt};throw qe}}function Bt(ie){const Ae={value:Ie(ie),illegal:!1,relevance:0,_top:He,_emitter:new Me.__emitter(Me)};return Ae._emitter.addText(ie),Ae}function Gn(ie,Ae){Ae=Ae||Me.languages||Object.keys(ne);const Je=Bt(ie),Dt=Ae.filter(Cn).filter(vr).map(Ut=>Nn(Ut,ie,!1));Dt.unshift(Je);const Pt=Dt.sort((Ut,dn)=>{if(Ut.relevance!==dn.relevance)return dn.relevance-Ut.relevance;if(Ut.language&&dn.language){if(Cn(Ut.language).supersetOf===dn.language)return 1;if(Cn(dn.language).supersetOf===Ut.language)return-1}return 0}),[Qt,Zn]=Pt,Qn=Qt;return Qn.secondBest=Zn,Qn}function Ft(ie,Ae,Je){const Dt=Ae&&Ce[Ae]||Je;ie.classList.add("hljs"),ie.classList.add(`language-${Dt}`)}function Vt(ie){let Ae=null;const Je=Et(ie);if(Ze(Je))return;if(ia("before:highlightElement",{el:ie,language:Je}),ie.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ie);return}if(ie.children.length>0&&(Me.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ie)),Me.throwUnescapedHTML))throw new we("One of your code blocks includes unescaped HTML.",ie.innerHTML);Ae=ie;const Dt=Ae.textContent,Pt=Je?yt(Dt,{language:Je,ignoreIllegals:!0}):Gn(Dt);ie.innerHTML=Pt.value,ie.dataset.highlighted="yes",Ft(ie,Je,Pt.language),ie.result={language:Pt.language,re:Pt.relevance,relevance:Pt.relevance},Pt.secondBest&&(ie.secondBest={language:Pt.secondBest.language,relevance:Pt.secondBest.relevance}),ia("after:highlightElement",{el:ie,result:Pt,text:Dt})}function yn(ie){Me=ke(Me,ie)}const Vn=()=>{En(),ue("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Sn(){En(),ue("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let bn=!1;function En(){function ie(){En()}if(document.readyState==="loading"){bn||window.addEventListener("DOMContentLoaded",ie,!1),bn=!0;return}document.querySelectorAll(Me.cssSelector).forEach(Vt)}function Gr(ie,Ae){let Je=null;try{Je=Ae(X)}catch(Dt){if(Pe("Language definition for '{}' could not be registered.".replace("{}",ie)),mt)Pe(Dt);else throw Dt;Je=He}Je.name||(Je.name=ie),ne[ie]=Je,Je.rawDefinition=Ae.bind(null,X),Je.aliases&&sr(Je.aliases,{languageName:ie})}function rn(ie){delete ne[ie];for(const Ae of Object.keys(Ce))Ce[Ae]===ie&&delete Ce[Ae]}function ha(){return Object.keys(ne)}function Cn(ie){return ie=(ie||"").toLowerCase(),ne[ie]||ne[Ce[ie]]}function sr(ie,{languageName:Ae}){typeof ie=="string"&&(ie=[ie]),ie.forEach(Je=>{Ce[Je.toLowerCase()]=Ae})}function vr(ie){const Ae=Cn(ie);return Ae&&!Ae.disableAutodetect}function Vr(ie){ie["before:highlightBlock"]&&!ie["before:highlightElement"]&&(ie["before:highlightElement"]=Ae=>{ie["before:highlightBlock"](Object.assign({block:Ae.el},Ae))}),ie["after:highlightBlock"]&&!ie["after:highlightElement"]&&(ie["after:highlightElement"]=Ae=>{ie["after:highlightBlock"](Object.assign({block:Ae.el},Ae))})}function fn(ie){Vr(ie),Fe.push(ie)}function Ja(ie){const Ae=Fe.indexOf(ie);Ae!==-1&&Fe.splice(Ae,1)}function ia(ie,Ae){const Je=ie;Fe.forEach(function(Dt){Dt[Je]&&Dt[Je](Ae)})}function oe(ie){return ue("10.7.0","highlightBlock will be removed entirely in v12.0"),ue("10.7.0","Please use highlightElement now."),Vt(ie)}Object.assign(X,{highlight:yt,highlightAuto:Gn,highlightAll:En,highlightElement:Vt,highlightBlock:oe,configure:yn,initHighlighting:Vn,initHighlightingOnLoad:Sn,registerLanguage:Gr,unregisterLanguage:rn,listLanguages:ha,getLanguage:Cn,registerAliases:sr,autoDetection:vr,inherit:ke,addPlugin:fn,removePlugin:Ja}),X.debugMode=function(){mt=!1},X.safeMode=function(){mt=!0},X.versionString=ce,X.regex={concat:w,lookahead:p,either:x,optional:y,anyNumberOfTimes:m};for(const ie in ee)typeof ee[ie]=="object"&&t(ee[ie]);return Object.assign(X,ee),X},ut=Qe({});return ut.newInstance=()=>Qe({}),Ep=ut,ut.HighlightJS=ut,ut.default=ut,Ep}var m4=p4();const y4=xu(m4),sS={},b4="hljs-";function E4(t){const e=y4.newInstance();return t&&l(t),{highlight:n,highlightAuto:r,listLanguages:i,register:l,registerAlias:s,registered:u};function n(f,c,h){const v=h||sS,p=typeof v.prefix=="string"?v.prefix:b4;if(!e.getLanguage(f))throw new Error("Unknown language: `"+f+"` is not registered");e.configure({__emitter:x4,classPrefix:p});const m=e.highlight(c,{ignoreIllegals:!0,language:f});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const y=m._emitter.root,w=y.data;return w.language=m.language,w.relevance=m.relevance,y}function r(f,c){const v=(c||sS).subset||i();let p=-1,m=0,y;for(;++p<v.length;){const w=v[p];if(!e.getLanguage(w))continue;const S=n(w,f,c);S.data&&S.data.relevance!==void 0&&S.data.relevance>m&&(m=S.data.relevance,y=S)}return y||{type:"root",children:[],data:{language:void 0,relevance:m}}}function i(){return e.listLanguages()}function l(f,c){if(typeof f=="string")e.registerLanguage(f,c);else{let h;for(h in f)Object.hasOwn(f,h)&&e.registerLanguage(h,f[h])}}function s(f,c){if(typeof f=="string")e.registerAliases(typeof c=="string"?c:[...c],{languageName:f});else{let h;for(h in f)if(Object.hasOwn(f,h)){const v=f[h];e.registerAliases(typeof v=="string"?v:[...v],{languageName:h})}}}function u(f){return!!e.getLanguage(f)}}class x4{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(s,u){return u?s+"_".repeat(u):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],l={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(l),this.stack.push(l)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const w4={};function S4(t){const e=t||w4,n=e.aliases,r=e.detect||!1,i=e.languages||g4,l=e.plainText,s=e.prefix,u=e.subset;let f="hljs";const c=E4(i);if(n&&c.registerAlias(n),s){const h=s.indexOf("-");f=h===-1?s:s.slice(0,h)}return function(h,v){Iu(h,"element",function(p,m,y){if(p.tagName!=="code"||!y||y.type!=="element"||y.tagName!=="pre")return;const w=C4(p);if(w===!1||!w&&!r||w&&l&&l.includes(w))return;Array.isArray(p.properties.className)||(p.properties.className=[]),p.properties.className.includes(f)||p.properties.className.unshift(f);const S=H3(p,{whitespace:"pre"});let x;try{x=w?c.highlight(w,S,{prefix:s}):c.highlightAuto(S,{prefix:s,subset:u})}catch(C){const T=C;if(w&&/Unknown language/.test(T.message)){v.message("Cannot highlight as `"+w+"`, itβs not registered",{ancestors:[y,p],cause:T,place:p.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!w&&x.data&&x.data.language&&p.properties.className.push("language-"+x.data.language),x.children.length>0&&(p.children=x.children)})}}function C4(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let r;for(;++n<e.length;){const i=String(e[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}const T4=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,D4=Object.hasOwnProperty;class A4{constructor(){this.occurrences,this.reset()}slug(e,n){const r=this;let i=_4(e,n===!0);const l=i;for(;D4.call(r.occurrences,i);)r.occurrences[l]++,i=l+"-"+r.occurrences[l];return r.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}}function _4(t,e){return typeof t!="string"?"":(e||(t=t.toLowerCase()),t.replace(T4,"").replace(/ /g,"-"))}function k4(t){const e=t.type==="element"?t.tagName.toLowerCase():"",n=e.length===2&&e.charCodeAt(0)===104?e.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}function N4(t){return"children"in t?pD(t):"value"in t?t.value:""}function R4(t){return t.type==="text"?t.value:"children"in t?pD(t):""}function pD(t){let e=-1;const n=[];for(;++e<t.children.length;)n[e]=R4(t.children[e]);return n.join("")}const M4={},oS=new A4;function O4(t){const n=(t||M4).prefix||"";return function(r){oS.reset(),Iu(r,"element",function(i){k4(i)&&!i.properties.id&&(i.properties.id=n+oS.slug(N4(i)))})}}function uS(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function B4(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function L4(t,e,n){const i=Fu((n||{}).ignore||[]),l=F4(e);let s=-1;for(;++s<l.length;)KT(t,"text",u);function u(c,h){let v=-1,p;for(;++v<h.length;){const m=h[v],y=p?p.children:void 0;if(i(m,y?y.indexOf(m):void 0,p))return;p=m}if(p)return f(c,h)}function f(c,h){const v=h[h.length-1],p=l[s][0],m=l[s][1];let y=0;const S=v.children.indexOf(c);let x=!1,C=[];p.lastIndex=0;let T=p.exec(c.value);for(;T;){const A=T.index,N={index:T.index,input:T.input,stack:[...h,c]};let k=m(...T,N);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?p.lastIndex=A+1:(y!==A&&C.push({type:"text",value:c.value.slice(y,A)}),Array.isArray(k)?C.push(...k):k&&C.push(k),y=A+T[0].length,x=!0),!p.global)break;T=p.exec(c.value)}return x?(y<c.value.length&&C.push({type:"text",value:c.value.slice(y)}),v.children.splice(S,1,...C)):C=[c],S+C.length}}function F4(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([I4(i[0]),z4(i[1])])}return e}function I4(t){return typeof t=="string"?new RegExp(B4(t),"g"):t}function z4(t){return typeof t=="function"?t:function(){return t}}const xp="phrasing",wp=["autolink","link","image","label"];function P4(){return{transforms:[$4],enter:{literalAutolink:q4,literalAutolinkEmail:Sp,literalAutolinkHttp:Sp,literalAutolinkWww:Sp},exit:{literalAutolink:V4,literalAutolinkEmail:G4,literalAutolinkHttp:H4,literalAutolinkWww:j4}}}function U4(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xp,notInConstruct:wp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xp,notInConstruct:wp},{character:":",before:"[ps]",after:"\\/",inConstruct:xp,notInConstruct:wp}]}}function q4(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Sp(t){this.config.enter.autolinkProtocol.call(this,t)}function H4(t){this.config.exit.autolinkProtocol.call(this,t)}function j4(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function G4(t){this.config.exit.autolinkEmail.call(this,t)}function V4(t){this.exit(t)}function $4(t){L4(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,K4],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Y4]],{ignore:["link","linkReference"]})}function K4(t,e,n,r,i){let l="";if(!mD(i)||(/^w/i.test(e)&&(n=e+n,e="",l="http://"),!X4(n)))return!1;const s=Z4(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:l+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function Y4(t,e,n,r){return!mD(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function X4(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function Z4(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=uS(t,"(");let l=uS(t,")");for(;r!==-1&&i>l;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[t,n]}function mD(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||_l(n)||md(n))&&(!e||n!==47)}yD.peek=iP;function Q4(){this.buffer()}function W4(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function J4(){this.buffer()}function eP(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function tP(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fa(this.sliceSerialize(t)).toLowerCase(),n.label=e}function nP(t){this.exit(t)}function rP(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fa(this.sliceSerialize(t)).toLowerCase(),n.label=e}function aP(t){this.exit(t)}function iP(){return"["}function yD(t,e,n,r){const i=n.createTracker(r);let l=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return l+=i.move(n.safe(n.associationId(t),{after:"]",before:l})),u(),s(),l+=i.move("]"),l}function lP(){return{enter:{gfmFootnoteCallString:Q4,gfmFootnoteCall:W4,gfmFootnoteDefinitionLabelString:J4,gfmFootnoteDefinition:eP},exit:{gfmFootnoteCallString:tP,gfmFootnoteCall:nP,gfmFootnoteDefinitionLabelString:rP,gfmFootnoteDefinition:aP}}}function sP(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:yD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,s){const u=l.createTracker(s);let f=u.move("[^");const c=l.enter("footnoteDefinition"),h=l.enter("label");return f+=u.move(l.safe(l.associationId(r),{before:f,after:"]"})),h(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((e?`
|
|
354
|
+
`:" ")+l.indentLines(l.containerFlow(r,u.current()),e?bD:oP))),c(),f}}function oP(t,e,n){return e===0?t:bD(t,e,n)}function bD(t,e,n){return(n?"":" ")+t}const uP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ED.peek=vP;function cP(){return{canContainEols:["delete"],enter:{strikethrough:dP},exit:{strikethrough:hP}}}function fP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:uP}],handlers:{delete:ED}}}function dP(t){this.enter({type:"delete",children:[]},t)}function hP(t){this.exit(t)}function ED(t,e,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),l(),s}function vP(){return"~"}function gP(t){return t.length}function pP(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||gP,l=[],s=[],u=[],f=[];let c=0,h=-1;for(;++h<t.length;){const w=[],S=[];let x=-1;for(t[h].length>c&&(c=t[h].length);++x<t[h].length;){const C=mP(t[h][x]);if(n.alignDelimiters!==!1){const T=i(C);S[x]=T,(f[x]===void 0||T>f[x])&&(f[x]=T)}w.push(C)}s[h]=w,u[h]=S}let v=-1;if(typeof r=="object"&&"length"in r)for(;++v<c;)l[v]=cS(r[v]);else{const w=cS(r);for(;++v<c;)l[v]=w}v=-1;const p=[],m=[];for(;++v<c;){const w=l[v];let S="",x="";w===99?(S=":",x=":"):w===108?S=":":w===114&&(x=":");let C=n.alignDelimiters===!1?1:Math.max(1,f[v]-S.length-x.length);const T=S+"-".repeat(C)+x;n.alignDelimiters!==!1&&(C=S.length+C+x.length,C>f[v]&&(f[v]=C),m[v]=C),p[v]=T}s.splice(1,0,p),u.splice(1,0,m),h=-1;const y=[];for(;++h<s.length;){const w=s[h],S=u[h];v=-1;const x=[];for(;++v<c;){const C=w[v]||"";let T="",A="";if(n.alignDelimiters!==!1){const N=f[v]-(S[v]||0),k=l[v];k===114?T=" ".repeat(N):k===99?N%2?(T=" ".repeat(N/2+.5),A=" ".repeat(N/2-.5)):(T=" ".repeat(N/2),A=T):A=" ".repeat(N)}n.delimiterStart!==!1&&!v&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||v)&&x.push(" "),n.alignDelimiters!==!1&&x.push(T),x.push(C),n.alignDelimiters!==!1&&x.push(A),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||v!==c-1)&&x.push("|")}y.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return y.join(`
|
|
355
|
+
`)}function mP(t){return t==null?"":String(t)}function cS(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function yP(t,e,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const s=n.indentLines(n.containerFlow(t,l.current()),bP);return i(),s}function bP(t,e,n){return">"+(n?"":" ")+t}function EP(t,e){return fS(t,e.inConstruct,!0)&&!fS(t,e.notInConstruct,!1)}function fS(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function dS(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
356
|
+
`&&EP(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
357
|
+
`}function xP(t,e){const n=String(t);let r=n.indexOf(e),i=r,l=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>s&&(s=l):l=1,i=r+e.length,r=n.indexOf(e,i);return s}function wP(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function SP(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function CP(t,e,n,r){const i=SP(n),l=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(wP(t,n)){const v=n.enter("codeIndented"),p=n.indentLines(l,TP);return v(),p}const u=n.createTracker(r),f=i.repeat(Math.max(xP(l,i)+1,3)),c=n.enter("codeFenced");let h=u.move(f);if(t.lang){const v=n.enter(`codeFencedLang${s}`);h+=u.move(n.safe(t.lang,{before:h,after:" ",encode:["`"],...u.current()})),v()}if(t.lang&&t.meta){const v=n.enter(`codeFencedMeta${s}`);h+=u.move(" "),h+=u.move(n.safe(t.meta,{before:h,after:`
|
|
358
|
+
`,encode:["`"],...u.current()})),v()}return h+=u.move(`
|
|
359
|
+
`),l&&(h+=u.move(l+`
|
|
360
|
+
`)),h+=u.move(f),c(),h}function TP(t,e,n){return(n?"":" ")+t}function $m(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function DP(t,e,n,r){const i=$m(n),l=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let c=f.move("[");return c+=f.move(n.safe(n.associationId(t),{before:c,after:"]",...f.current()})),c+=f.move("]: "),u(),!t.url||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(t.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(u=n.enter("destinationRaw"),c+=f.move(n.safe(t.url,{before:c,after:t.title?" ":`
|
|
361
|
+
`,...f.current()}))),u(),t.title&&(u=n.enter(`title${l}`),c+=f.move(" "+i),c+=f.move(n.safe(t.title,{before:c,after:i,...f.current()})),c+=f.move(i),u()),s(),c}function AP(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Eu(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Wf(t,e,n){const r=Ps(t),i=Ps(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}xD.peek=_P;function xD(t,e,n,r){const i=AP(n),l=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let f=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const c=f.charCodeAt(0),h=Wf(r.before.charCodeAt(r.before.length-1),c,i);h.inside&&(f=Eu(c)+f.slice(1));const v=f.charCodeAt(f.length-1),p=Wf(r.after.charCodeAt(0),v,i);p.inside&&(f=f.slice(0,-1)+Eu(v));const m=s.move(i);return l(),n.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},u+f+m}function _P(t,e,n){return n.options.emphasis||"*"}function kP(t,e){let n=!1;return Iu(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Wp}),!!((!t.depth||t.depth<3)&&Fm(t)&&(e.options.setext||n))}function NP(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),l=n.createTracker(r);if(kP(t,n)){const h=n.enter("headingSetext"),v=n.enter("phrasing"),p=n.containerPhrasing(t,{...l.current(),before:`
|
|
362
|
+
`,after:`
|
|
363
|
+
`});return v(),h(),p+`
|
|
364
|
+
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
365
|
+
`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");l.move(s+" ");let c=n.containerPhrasing(t,{before:"# ",after:`
|
|
366
|
+
`,...l.current()});return/^[\t ]/.test(c)&&(c=Eu(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),f(),u(),c}wD.peek=RP;function wD(t){return t.value||""}function RP(){return"<"}SD.peek=MP;function SD(t,e,n,r){const i=$m(n),l=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let c=f.move("![");return c+=f.move(n.safe(t.alt,{before:c,after:"]",...f.current()})),c+=f.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),c+=f.move("<"),c+=f.move(n.safe(t.url,{before:c,after:">",...f.current()})),c+=f.move(">")):(u=n.enter("destinationRaw"),c+=f.move(n.safe(t.url,{before:c,after:t.title?" ":")",...f.current()}))),u(),t.title&&(u=n.enter(`title${l}`),c+=f.move(" "+i),c+=f.move(n.safe(t.title,{before:c,after:i,...f.current()})),c+=f.move(i),u()),c+=f.move(")"),s(),c}function MP(){return"!"}CD.peek=OP;function CD(t,e,n,r){const i=t.referenceType,l=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const c=n.safe(t.alt,{before:f,after:"]",...u.current()});f+=u.move(c+"]["),s();const h=n.stack;n.stack=[],s=n.enter("reference");const v=n.safe(n.associationId(t),{before:f,after:"]",...u.current()});return s(),n.stack=h,l(),i==="full"||!c||c!==v?f+=u.move(v+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function OP(){return"!"}TD.peek=BP;function TD(t,e,n){let r=t.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const s=n.unsafe[l],u=n.compilePattern(s);let f;if(s.atBreak)for(;f=u.exec(r);){let c=f.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(f.index+1)}}return i+r+i}function BP(){return"`"}function DD(t,e){const n=Fm(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}AD.peek=LP;function AD(t,e,n,r){const i=$m(n),l=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,f;if(DD(t,n)){const h=n.stack;n.stack=[],u=n.enter("autolink");let v=s.move("<");return v+=s.move(n.containerPhrasing(t,{before:v,after:">",...s.current()})),v+=s.move(">"),u(),n.stack=h,v}u=n.enter("link"),f=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(t,{before:c,after:"](",...s.current()})),c+=s.move("]("),f(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(f=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(t.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(f=n.enter("destinationRaw"),c+=s.move(n.safe(t.url,{before:c,after:t.title?" ":")",...s.current()}))),f(),t.title&&(f=n.enter(`title${l}`),c+=s.move(" "+i),c+=s.move(n.safe(t.title,{before:c,after:i,...s.current()})),c+=s.move(i),f()),c+=s.move(")"),u(),c}function LP(t,e,n){return DD(t,n)?"<":"["}_D.peek=FP;function _D(t,e,n,r){const i=t.referenceType,l=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const c=n.containerPhrasing(t,{before:f,after:"]",...u.current()});f+=u.move(c+"]["),s();const h=n.stack;n.stack=[],s=n.enter("reference");const v=n.safe(n.associationId(t),{before:f,after:"]",...u.current()});return s(),n.stack=h,l(),i==="full"||!c||c!==v?f+=u.move(v+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function FP(){return"["}function Km(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function IP(t){const e=Km(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function zP(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function kD(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function PP(t,e,n,r){const i=n.enter("list"),l=n.bulletCurrent;let s=t.ordered?zP(n):Km(n);const u=t.ordered?s==="."?")":".":IP(n);let f=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),kD(n)===s&&h){let v=-1;for(;++v<t.children.length;){const p=t.children[v];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(s=u),n.bulletCurrent=s;const c=n.containerFlow(t,r);return n.bulletLastUsed=s,n.bulletCurrent=l,i(),c}function UP(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function qP(t,e,n,r){const i=UP(n);let l=n.bulletCurrent||Km(n);e&&e.type==="list"&&e.ordered&&(l=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+l);let s=l.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(l+" ".repeat(s-l.length)),u.shift(s);const f=n.enter("listItem"),c=n.indentLines(n.containerFlow(t,u.current()),h);return f(),c;function h(v,p,m){return p?(m?"":" ".repeat(s))+v:(m?l:l+" ".repeat(s-l.length))+v}}function HP(t,e,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),s=n.containerPhrasing(t,r);return l(),i(),s}const jP=Fu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function GP(t,e,n,r){return(t.children.some(function(s){return jP(s)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function VP(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}ND.peek=$P;function ND(t,e,n,r){const i=VP(n),l=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let f=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const c=f.charCodeAt(0),h=Wf(r.before.charCodeAt(r.before.length-1),c,i);h.inside&&(f=Eu(c)+f.slice(1));const v=f.charCodeAt(f.length-1),p=Wf(r.after.charCodeAt(0),v,i);p.inside&&(f=f.slice(0,-1)+Eu(v));const m=s.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},u+f+m}function $P(t,e,n){return n.options.strong||"*"}function KP(t,e,n,r){return n.safe(t.value,r)}function YP(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function XP(t,e,n){const r=(kD(n)+(n.options.ruleSpaces?" ":"")).repeat(YP(n));return n.options.ruleSpaces?r.slice(0,-1):r}const RD={blockquote:yP,break:dS,code:CP,definition:DP,emphasis:xD,hardBreak:dS,heading:NP,html:wD,image:SD,imageReference:CD,inlineCode:TD,link:AD,linkReference:_D,list:PP,listItem:qP,paragraph:HP,root:GP,strong:ND,text:KP,thematicBreak:XP};function ZP(){return{enter:{table:QP,tableData:hS,tableHeader:hS,tableRow:JP},exit:{codeText:eU,table:WP,tableData:Cp,tableHeader:Cp,tableRow:Cp}}}function QP(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function WP(t){this.exit(t),this.data.inTable=void 0}function JP(t){this.enter({type:"tableRow",children:[]},t)}function Cp(t){this.exit(t)}function hS(t){this.enter({type:"tableCell",children:[]},t)}function eU(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,tU));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function tU(t,e){return e==="|"?e:t}function nU(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
367
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:f,tableRow:u}};function s(m,y,w,S){return c(h(m,w,S),m.align)}function u(m,y,w,S){const x=v(m,w,S),C=c([x]);return C.slice(0,C.indexOf(`
|
|
368
|
+
`))}function f(m,y,w,S){const x=w.enter("tableCell"),C=w.enter("phrasing"),T=w.containerPhrasing(m,{...S,before:l,after:l});return C(),x(),T}function c(m,y){return pP(m,{align:y,alignDelimiters:r,padding:n,stringLength:i})}function h(m,y,w){const S=m.children;let x=-1;const C=[],T=y.enter("table");for(;++x<S.length;)C[x]=v(S[x],y,w);return T(),C}function v(m,y,w){const S=m.children;let x=-1;const C=[],T=y.enter("tableRow");for(;++x<S.length;)C[x]=f(S[x],m,y,w);return T(),C}function p(m,y,w){let S=RD.inlineCode(m,y,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function rU(){return{exit:{taskListCheckValueChecked:vS,taskListCheckValueUnchecked:vS,paragraph:iU}}}function aU(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lU}}}function vS(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function iU(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let l=-1,s;for(;++l<i.length;){const u=i[l];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function lU(t,e,n,r){const i=t.children[0],l=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);l&&u.move(s);let f=RD.listItem(t,e,n,{...r,...u.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),f;function c(h){return h+s}}function sU(){return[P4(),lP(),cP(),ZP(),rU()]}function oU(t){return{extensions:[U4(),sP(t),fP(),nU(t),aU()]}}const uU={tokenize:gU,partial:!0},MD={tokenize:pU,partial:!0},OD={tokenize:mU,partial:!0},BD={tokenize:yU,partial:!0},cU={tokenize:bU,partial:!0},LD={name:"wwwAutolink",tokenize:hU,previous:ID},FD={name:"protocolAutolink",tokenize:vU,previous:zD},Wa={name:"emailAutolink",tokenize:dU,previous:PD},Aa={};function fU(){return{text:Aa}}let pl=48;for(;pl<123;)Aa[pl]=Wa,pl++,pl===58?pl=65:pl===91&&(pl=97);Aa[43]=Wa;Aa[45]=Wa;Aa[46]=Wa;Aa[95]=Wa;Aa[72]=[Wa,FD];Aa[104]=[Wa,FD];Aa[87]=[Wa,LD];Aa[119]=[Wa,LD];function dU(t,e,n){const r=this;let i,l;return s;function s(v){return!rm(v)||!PD.call(r,r.previous)||Ym(r.events)?n(v):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(v))}function u(v){return rm(v)?(t.consume(v),u):v===64?(t.consume(v),f):n(v)}function f(v){return v===46?t.check(cU,h,c)(v):v===45||v===95||ur(v)?(l=!0,t.consume(v),f):h(v)}function c(v){return t.consume(v),i=!0,f}function h(v){return l&&i&&yr(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(v)):n(v)}}function hU(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!ID.call(r,r.previous)||Ym(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(uU,t.attempt(MD,t.attempt(OD,l),n),n)(s))}function l(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function vU(t,e,n){const r=this;let i="",l=!1;return s;function s(v){return(v===72||v===104)&&zD.call(r,r.previous)&&!Ym(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(v),t.consume(v),u):n(v)}function u(v){if(yr(v)&&i.length<5)return i+=String.fromCodePoint(v),t.consume(v),u;if(v===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(v),f}return n(v)}function f(v){return v===47?(t.consume(v),l?c:(l=!0,f)):n(v)}function c(v){return v===null||Kf(v)||sn(v)||_l(v)||md(v)?n(v):t.attempt(MD,t.attempt(OD,h),n)(v)}function h(v){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(v)}}function gU(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),l):n(s)}function l(s){return s===null?n(s):e(s)}}function pU(t,e,n){let r,i,l;return s;function s(c){return c===46||c===95?t.check(BD,f,u)(c):c===null||sn(c)||_l(c)||c!==45&&md(c)?f(c):(l=!0,t.consume(c),s)}function u(c){return c===95?r=!0:(i=r,r=void 0),t.consume(c),s}function f(c){return i||r||!l?n(c):e(c)}}function mU(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?l(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(BD,e,l)(s):s===null||sn(s)||_l(s)?e(s):(t.consume(s),i)}function l(s){return s===41&&r++,t.consume(s),i}}function yU(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),l):u===93?(t.consume(u),i):u===60||u===null||sn(u)||_l(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||sn(u)||_l(u)?e(u):r(u)}function l(u){return yr(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):yr(u)?(t.consume(u),s):n(u)}}function bU(t,e,n){return r;function r(l){return t.consume(l),i}function i(l){return ur(l)?n(l):e(l)}}function ID(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||sn(t)}function zD(t){return!yr(t)}function PD(t){return!(t===47||rm(t))}function rm(t){return t===43||t===45||t===46||t===95||ur(t)}function Ym(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const EU={tokenize:_U,partial:!0};function xU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:TU,continuation:{tokenize:DU},exit:AU}},text:{91:{name:"gfmFootnoteCall",tokenize:CU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:wU,resolveTo:SU}}}}function wU(t,e,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){s=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!s||!s._balanced)return n(f);const c=fa(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!l.includes(c.slice(1))?n(f):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),e(f))}}function SU(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",l,e],["enter",s,e],["exit",s,e],["exit",l,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function CU(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,s;return u;function u(v){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(v),t.exit("gfmFootnoteCallLabelMarker"),f}function f(v){return v!==94?n(v):(t.enter("gfmFootnoteCallMarker"),t.consume(v),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(v){if(l>999||v===93&&!s||v===null||v===91||sn(v))return n(v);if(v===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(fa(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(v),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(v)}return sn(v)||(s=!0),l++,t.consume(v),v===92?h:c}function h(v){return v===91||v===92||v===93?(t.consume(v),l++,c):c(v)}}function TU(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,s=0,u;return f;function f(y){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(y){return y===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):n(y)}function h(y){if(s>999||y===93&&!u||y===null||y===91||sn(y))return n(y);if(y===93){t.exit("chunkString");const w=t.exit("gfmFootnoteDefinitionLabelString");return l=fa(r.sliceSerialize(w)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return sn(y)||(u=!0),s++,t.consume(y),y===92?v:h}function v(y){return y===91||y===92||y===93?(t.consume(y),s++,h):h(y)}function p(y){return y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),i.includes(l)||i.push(l),Lt(t,m,"gfmFootnoteDefinitionWhitespace")):n(y)}function m(y){return e(y)}}function DU(t,e,n){return t.check(Lu,e,t.attempt(EU,e,n))}function AU(t){t.exit("gfmFootnoteDefinition")}function _U(t,e,n){const r=this;return Lt(t,i,"gfmFootnoteDefinitionIndent",5);function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(l):n(l)}}function kU(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let f=-1;for(;++f<s.length;)if(s[f][0]==="enter"&&s[f][1].type==="strikethroughSequenceTemporary"&&s[f][1]._close){let c=f;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[f][1].end.offset-s[f][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[f][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[f][1].end)},v={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[f][1].start)},p=[["enter",h,u],["enter",s[c][1],u],["exit",s[c][1],u],["enter",v,u]],m=u.parser.constructs.insideSpan.null;m&&jr(p,p.length,0,yd(m,s.slice(c+1,f),u)),jr(p,p.length,0,[["exit",v,u],["enter",s[f][1],u],["exit",s[f][1],u],["exit",h,u]]),jr(s,c-1,f-c+3,p),f=c+p.length-2;break}}for(f=-1;++f<s.length;)s[f][1].type==="strikethroughSequenceTemporary"&&(s[f][1].type="data");return s}function l(s,u,f){const c=this.previous,h=this.events;let v=0;return p;function p(y){return c===126&&h[h.length-1][1].type!=="characterEscape"?f(y):(s.enter("strikethroughSequenceTemporary"),m(y))}function m(y){const w=Ps(c);if(y===126)return v>1?f(y):(s.consume(y),v++,m);if(v<2&&!n)return f(y);const S=s.exit("strikethroughSequenceTemporary"),x=Ps(y);return S._open=!x||x===2&&!!w,S._close=!w||w===2&&!!x,u(y)}}}class NU{constructor(){this.map=[]}add(e,n,r){RU(this,e,n,r)}consume(e){if(this.map.sort(function(l,s){return l[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const l of i)e.push(l);i=r.pop()}this.map.length=0}}function RU(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function MU(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function OU(){return{flow:{null:{name:"table",tokenize:BU,resolveAll:LU}}}}function BU(t,e,n){const r=this;let i=0,l=0,s;return u;function u(M){let z=r.events.length-1;for(;z>-1;){const V=r.events[z][1].type;if(V==="lineEnding"||V==="linePrefix")z--;else break}const B=z>-1?r.events[z][1].type:null,U=B==="tableHead"||B==="tableRow"?k:f;return U===k&&r.parser.lazy[r.now().line]?n(M):U(M)}function f(M){return t.enter("tableHead"),t.enter("tableRow"),c(M)}function c(M){return M===124||(s=!0,l+=1),h(M)}function h(M){return M===null?n(M):dt(M)?l>1?(l=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),m):n(M):kt(M)?Lt(t,h,"whitespace")(M):(l+=1,s&&(s=!1,i+=1),M===124?(t.enter("tableCellDivider"),t.consume(M),t.exit("tableCellDivider"),s=!0,h):(t.enter("data"),v(M)))}function v(M){return M===null||M===124||sn(M)?(t.exit("data"),h(M)):(t.consume(M),M===92?p:v)}function p(M){return M===92||M===124?(t.consume(M),v):v(M)}function m(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(t.enter("tableDelimiterRow"),s=!1,kt(M)?Lt(t,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):y(M))}function y(M){return M===45||M===58?S(M):M===124?(s=!0,t.enter("tableCellDivider"),t.consume(M),t.exit("tableCellDivider"),w):N(M)}function w(M){return kt(M)?Lt(t,S,"whitespace")(M):S(M)}function S(M){return M===58?(l+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(M),t.exit("tableDelimiterMarker"),x):M===45?(l+=1,x(M)):M===null||dt(M)?A(M):N(M)}function x(M){return M===45?(t.enter("tableDelimiterFiller"),C(M)):N(M)}function C(M){return M===45?(t.consume(M),C):M===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(M),t.exit("tableDelimiterMarker"),T):(t.exit("tableDelimiterFiller"),T(M))}function T(M){return kt(M)?Lt(t,A,"whitespace")(M):A(M)}function A(M){return M===124?y(M):M===null||dt(M)?!s||i!==l?N(M):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(M)):N(M)}function N(M){return n(M)}function k(M){return t.enter("tableRow"),D(M)}function D(M){return M===124?(t.enter("tableCellDivider"),t.consume(M),t.exit("tableCellDivider"),D):M===null||dt(M)?(t.exit("tableRow"),e(M)):kt(M)?Lt(t,D,"whitespace")(M):(t.enter("data"),O(M))}function O(M){return M===null||M===124||sn(M)?(t.exit("data"),D(M)):(t.consume(M),M===92?L:O)}function L(M){return M===92||M===124?(t.consume(M),O):O(M)}}function LU(t,e){let n=-1,r=!0,i=0,l=[0,0,0,0],s=[0,0,0,0],u=!1,f=0,c,h,v;const p=new NU;for(;++n<t.length;){const m=t[n],y=m[1];m[0]==="enter"?y.type==="tableHead"?(u=!1,f!==0&&(gS(p,e,f,c,h),h=void 0,f=0),c={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",c,e]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,v=void 0,l=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,h={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",h,e]])),i=y.type==="tableDelimiterRow"?2:h?3:1):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(l[1]!==0&&(s[0]=s[1],v=bf(p,e,l,i,void 0,v),l=[0,0,0,0]),s[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(s[0]=s[1],v=bf(p,e,l,i,void 0,v)),l=s,s=[l[1],n,0,0])):y.type==="tableHead"?(u=!0,f=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(f=n,l[1]!==0?(s[0]=s[1],v=bf(p,e,l,i,n,v)):s[1]!==0&&(v=bf(p,e,s,i,n,v)),i=0):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(f!==0&&gS(p,e,f,c,h),p.consume(e.events),n=-1;++n<e.events.length;){const m=e.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=MU(e.events,n))}return t}function bf(t,e,n,r,i,l){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(l.end=Object.assign({},As(e.events,n[0])),t.add(n[0],0,[["exit",l,e]]));const f=As(e.events,n[1]);if(l={type:s,start:Object.assign({},f),end:Object.assign({},f)},t.add(n[1],0,[["enter",l,e]]),n[2]!==0){const c=As(e.events,n[2]),h=As(e.events,n[3]),v={type:u,start:Object.assign({},c),end:Object.assign({},h)};if(t.add(n[2],0,[["enter",v,e]]),r!==2){const p=e.events[n[2]],m=e.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,w=n[3]-n[2]-1;t.add(y,w,[])}}t.add(n[3]+1,0,[["exit",v,e]])}return i!==void 0&&(l.end=Object.assign({},As(e.events,i)),t.add(i,0,[["exit",l,e]]),l=void 0),l}function gS(t,e,n,r,i){const l=[],s=As(e.events,n);i&&(i.end=Object.assign({},s),l.push(["exit",i,e])),r.end=Object.assign({},s),l.push(["exit",r,e]),t.add(n+1,0,l)}function As(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const FU={name:"tasklistCheck",tokenize:zU};function IU(){return{text:{91:FU}}}function zU(t,e,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(f),t.exit("taskListCheckMarker"),l)}function l(f){return sn(f)?(t.enter("taskListCheckValueUnchecked"),t.consume(f),t.exit("taskListCheckValueUnchecked"),s):f===88||f===120?(t.enter("taskListCheckValueChecked"),t.consume(f),t.exit("taskListCheckValueChecked"),s):n(f)}function s(f){return f===93?(t.enter("taskListCheckMarker"),t.consume(f),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(f)}function u(f){return dt(f)?e(f):kt(f)?t.check({tokenize:PU},e,n)(f):n(f)}}function PU(t,e,n){return Lt(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function UU(t){return _T([fU(),xU(),kU(t),OU(),IU()])}const qU={};function HU(t){const e=this,n=t||qU,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(UU(n)),l.push(sU()),s.push(oU(n))}function pS(t){return t.dataUrl??`/api/asset?path=${encodeURIComponent(t.path)}`}const mS=1200;function Ef(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Jo(t){return typeof t=="string"&&t.length?t:null}function jU(t){return Array.isArray(t)?t.filter(e=>typeof e=="string").join(", "):""}function GU({activePage:t,pageError:e,backlinkPages:n,relatedPages:r,graphPageLinks:i,onOpenPage:l,onNavigateNode:s}){const[u,f]=Ee.useState(!1),c=t?.frontmatter??{},h=Ef(c.source_ids),v=Ef(c.node_ids),p=[...Ef(c.tags),...Ef(c.semantic_tags)],m=Jo(c.kind)??"page",y=Jo(c.status)??"active",w=Jo(c.source_type),S=jU(c.project_ids)||"Global",x=Jo(c.page_id),C=Jo(c.freshness),T=t?t.content.length>mS:!1,A=Ee.useMemo(()=>t?u||!T?t.content:`${t.content.slice(0,mS)}β¦`:"",[t,u,T]);return _.jsxs("section",{className:"panel page-panel","data-testid":"page-preview",children:[_.jsx("h3",{className:"panel-heading",children:"Page Preview"}),e?_.jsx("p",{className:"text-error",children:e}):null,t?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"label",children:t.path}),_.jsx("h4",{className:"card-title",style:{margin:"4px 0 8px"},children:t.title}),_.jsxs("div",{className:"meta-grid",children:[_.jsx("span",{className:"meta-label",children:"Kind"}),_.jsxs("span",{className:"meta-value",children:[m," / ",y]}),w?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"meta-label",children:"Source"}),_.jsx("span",{className:"meta-value",children:w})]}):null,_.jsx("span",{className:"meta-label",children:"Projects"}),_.jsx("span",{className:"meta-value",children:S}),x?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"meta-label",children:"Page ID"}),_.jsx("code",{className:"meta-value mono meta-value-truncate",title:x,children:x})]}):null,C?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"meta-label",children:"Freshness"}),_.jsx("span",{className:"meta-value mono",children:C})]}):null]}),h.length?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Sources"}),_.jsxs("div",{className:"chip-row",children:[h.slice(0,8).map(N=>_.jsx("code",{className:"chip chip-static",title:N,children:N},N)),h.length>8?_.jsxs("span",{className:"text-muted text-sm",children:["+",h.length-8," more"]}):null]})]}):null,v.length&&s?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Graph Nodes"}),_.jsxs("div",{className:"chip-row",children:[v.slice(0,8).map(N=>_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>s(N),title:`Select ${N}`,children:N},N)),v.length>8?_.jsxs("span",{className:"text-muted text-sm",children:["+",v.length-8," more"]}):null]})]}):null,p.length?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Tags"}),_.jsx("div",{className:"chip-row",children:p.map(N=>_.jsx("span",{className:"chip chip-tag",children:N},N))})]}):null,t.assets.length?_.jsx("div",{className:"asset-preview",children:t.assets.map(N=>N.mimeType.startsWith("image/")?_.jsxs("figure",{className:"asset-card",children:[_.jsx("img",{src:pS(N),alt:t.title}),_.jsxs("figcaption",{children:[N.role," / ",N.mimeType]})]},N.id):_.jsxs("a",{className:"btn btn-ghost",href:pS(N),target:"_blank",rel:"noreferrer",children:["Open ",N.role]},N.id))}):null,n.length?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Backlinks"}),_.jsx("div",{className:"chip-row",children:n.map(N=>_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{l(N.path,N.id)},children:N.title},N.id))})]}):null,r.length?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Related Pages"}),_.jsx("div",{className:"chip-row",children:r.map(N=>_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{l(N.path,N.id)},children:N.title},N.id))})]}):null,i.length?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Graph Reports"}),_.jsx("div",{className:"chip-row",children:i.slice(0,6).map(N=>_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{l(N.path,N.id)},children:N.title},N.id))})]}):null,_.jsx("article",{className:"markdown-content",children:_.jsx(R3,{remarkPlugins:[HU],rehypePlugins:[O4,[S4,{detect:!0,ignoreMissing:!0}]],children:A})}),T?_.jsx("div",{className:"action-row",children:_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>f(N=>!N),children:u?"Collapse":`Show all ${t.content.length.toLocaleString()} characters`})}):null]}):_.jsxs("div",{className:"empty-state",children:[_.jsx("span",{className:"empty-state-icon",children:"π"}),_.jsx("p",{className:"text-muted text-sm",children:"Open a search result, review entry, candidate, or graph node page."})]})]})}function VU({watchStatus:t,watchError:e}){return t?.pendingSemanticRefresh.length?_.jsxs("div",{children:[_.jsxs("p",{className:"text-muted text-sm",children:["Watched roots: ",t.watchedRepoRoots.length?t.watchedRepoRoots.join(", "):"none",t.lastRun?.finishedAt?` Β· Last run: ${new Date(t.lastRun.finishedAt).toLocaleString()}`:""]}),e?_.jsx("p",{className:"text-error",children:e}):null,_.jsx("div",{className:"card-list",children:t.pendingSemanticRefresh.slice(0,8).map(n=>_.jsxs("article",{className:"card",children:[_.jsx("span",{className:"label",children:n.changeType}),_.jsx("strong",{className:"card-title",children:n.path}),_.jsx("p",{className:"text-muted text-sm",children:n.sourceKind?`Kind: ${n.sourceKind}`:"Awaiting semantic refresh."})]},n.id))})]}):_.jsx("p",{className:"text-muted text-sm",children:"No files are pending semantic refresh."})}function UD({tabs:t,activeTab:e,onTabChange:n,children:r}){const i=(l,s)=>{let u=s;if(l.key==="ArrowRight")u=(s+1)%t.length;else if(l.key==="ArrowLeft")u=(s-1+t.length)%t.length;else return;l.preventDefault(),n(t[u].id),l.currentTarget.parentElement?.children[u]?.focus()};return _.jsxs("div",{className:"tabs",children:[_.jsx("div",{className:"tab-bar",role:"tablist",children:t.map((l,s)=>_.jsxs("button",{id:`tab-${l.id}`,type:"button",role:"tab","aria-selected":e===l.id,"aria-controls":`tabpanel-${l.id}`,tabIndex:e===l.id?0:-1,className:`tab-btn${e===l.id?" is-active":""}`,onClick:()=>n(l.id),onKeyDown:u=>i(u,s),children:[l.label,l.count!=null&&l.count>0?_.jsx("span",{className:"tab-count",children:l.count}):null]},l.id))}),_.jsx("div",{id:`tabpanel-${e}`,className:"tab-panel",role:"tabpanel","aria-labelledby":`tab-${e}`,children:r})]})}function $U({graphReport:t,onOpenPage:e,onNavigateNode:n,onHighlightSurprise:r}){const[i,l]=Ee.useState("overview");return t?_.jsx("div",{className:"report-tabs",children:_.jsxs(UD,{tabs:[{id:"overview",label:"Overview"},{id:"surprising",label:"Surprising",count:t.surprisingConnections.length},{id:"patterns",label:"Patterns",count:t.groupPatterns.length},{id:"benchmark",label:"Benchmark"},{id:"sources",label:"Sources",count:t.recentResearchSources.length}],activeTab:i,onTabChange:l,children:[i==="overview"&&_.jsxs("div",{children:[_.jsxs("div",{className:"report-stats",children:[_.jsxs("span",{children:["Nodes ",_.jsx("strong",{children:t.overview.nodes})]}),_.jsxs("span",{children:["Edges ",_.jsx("strong",{children:t.overview.edges})]}),_.jsxs("span",{children:["Communities ",_.jsx("strong",{children:t.overview.communities})]})]}),_.jsx("div",{className:"report-stats",style:{marginTop:6},children:_.jsxs("span",{className:"text-muted",children:["1st-party: ",t.firstPartyOverview.nodes," nodes \\u00b7 ",t.firstPartyOverview.edges," edges \\u00b7"," ",t.firstPartyOverview.communities," communities"]})}),t.warnings.length?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Warnings"}),_.jsx("div",{className:"card-list",children:t.warnings.map(s=>_.jsx("article",{className:"card card-warning",children:_.jsxs("p",{className:"text-sm",children:["β "," ",s]})},s))})]}):null]}),i==="surprising"&&_.jsx("div",{children:t.surprisingConnections.length?_.jsx("div",{className:"card-list",children:t.surprisingConnections.map(s=>_.jsxs("article",{className:"card",children:[_.jsxs("div",{className:"surprise-row",children:[_.jsxs("button",{type:"button",className:"btn btn-ghost",onClick:()=>r(s.sourceNodeId,s.targetNodeId),children:[s.sourceLabel," β ",s.targetLabel]}),_.jsx("span",{className:"text-mono text-sm",children:s.relation})]}),s.explanation?_.jsx("p",{className:"text-secondary text-sm",children:s.explanation}):null,s.confidence!=null?_.jsxs("span",{className:"text-muted text-sm",children:["confidence: ",s.confidence.toFixed(2)]}):null]},s.id))}):_.jsx("p",{className:"text-muted text-sm",children:"No surprising connections detected."})}),i==="patterns"&&_.jsxs("div",{children:[t.groupPatterns.length?_.jsx("div",{className:"card-list",children:t.groupPatterns.map(s=>_.jsxs("article",{className:"card",children:[_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{const u=s.nodeIds[0];u&&n(u)},children:s.label}),s.why?_.jsx("p",{className:"text-secondary text-sm",children:s.why}):null,_.jsxs("span",{className:"text-muted text-sm",children:[s.nodeIds.length," nodes \\u00b7 ",s.relation]})]},s.id))}):_.jsx("p",{className:"text-muted text-sm",children:"No group patterns detected."}),t.suggestedQuestions?.length?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Suggested Questions"}),_.jsx("div",{className:"card-list",children:t.suggestedQuestions.map(s=>_.jsx("p",{className:"text-secondary text-sm",children:s},s))})]}):null]}),i==="benchmark"&&_.jsx("div",{children:t.benchmark?_.jsxs("div",{className:"meta-grid",children:[_.jsx("span",{className:"meta-label",children:"Status"}),_.jsx("span",{className:"meta-value",children:t.benchmark.stale?"Stale":"Fresh"}),_.jsx("span",{className:"meta-label",children:"Questions"}),_.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.questionCount}),_.jsx("span",{className:"meta-label",children:"Context tokens"}),_.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.finalContextTokens.toLocaleString()}),_.jsx("span",{className:"meta-label",children:"Naive corpus"}),_.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.naiveCorpusTokens.toLocaleString()}),_.jsx("span",{className:"meta-label",children:"Reduction"}),_.jsxs("span",{className:"meta-value mono",children:[(t.benchmark.summary.reductionRatio*100).toFixed(1),"%"]}),_.jsx("span",{className:"meta-label",children:"Unique visited"}),_.jsx("span",{className:"meta-value mono",children:t.benchmark.summary.uniqueVisitedNodes})]}):_.jsx("p",{className:"text-muted text-sm",children:"No benchmark summary is available yet."})}),i==="sources"&&_.jsx("div",{children:t.recentResearchSources.length?_.jsx("div",{className:"card-list",children:t.recentResearchSources.map(s=>_.jsxs("article",{className:"card",children:[_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{e(s.path,s.pageId)},children:s.title}),_.jsxs("span",{className:"text-muted text-sm",children:[s.sourceType," \\u00b7 ",s.updatedAt?new Date(s.updatedAt).toLocaleDateString():""]})]},s.pageId))}):_.jsx("p",{className:"text-muted text-sm",children:"No recent research sources."})})]})}):_.jsx("div",{className:"report-tabs",children:_.jsx("div",{className:"report-tabs-empty",children:"Loading graph report..."})})}function KU(t,e){const n=e.trim();if(!n||n.length<2)return t;const r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(${r})`,"gi"),l=t.split(i);if(l.length===1)return t;const s=n.toLowerCase();let u=0;return l.map(f=>{const c=`${u}:${f}`;return u+=f.length,f.toLowerCase()===s?_.jsx("mark",{children:f},c):_.jsx(Ee.Fragment,{children:f},c)})}function YU({results:t,searchError:e,query:n,onOpenResult:r,recentQueries:i=[],onSelectRecent:l,sort:s="relevance",onSortChange:u,pageSize:f=10}){const[c,h]=Ee.useState(f),[v,p]=Ee.useState(!1),m=[...t].sort((y,w)=>s==="title"?y.title.localeCompare(w.title):s==="updated"?(w.pageId??"").localeCompare(y.pageId??""):0);return _.jsxs("section",{className:"panel","aria-label":"Search results",children:[_.jsxs("h3",{className:"panel-heading",children:["Search Results",t.length>0?_.jsxs("span",{className:"panel-meta",children:[t.length," match",t.length===1?"":"es"]}):null]}),_.jsxs("div",{className:"search-controls",children:[_.jsxs("label",{className:"filter-group",style:{flex:1,minWidth:120},children:[_.jsx("span",{className:"filter-label",children:"Sort"}),_.jsxs("select",{className:"input",value:s,onChange:y=>u?.(y.target.value),"aria-label":"Sort search results",children:[_.jsx("option",{value:"relevance",children:"Relevance"}),_.jsx("option",{value:"title",children:"Title"}),_.jsx("option",{value:"updated",children:"Recent"})]})]}),_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>p(y=>!y),"aria-expanded":v,children:v?"Hide help":"Search help"})]}),v?_.jsx("div",{className:"search-syntax-help",children:_.jsxs("p",{children:["Use ",_.jsx("code",{children:"kind:source"}),", ",_.jsx("code",{children:"status:active"}),", or ",_.jsx("code",{children:"project:foo"})," filters in the sidebar to scope. Type at least ",_.jsx("code",{children:"2"})," characters; matches are highlighted in snippets. Combine with the tag filter for domain-scoped results."]})}):null,e?_.jsx("p",{className:"text-error",children:e}):null,m.length?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"card-list",children:m.slice(0,c).map(y=>_.jsxs("button",{type:"button",className:"result-card",onClick:()=>{r(y)},children:[_.jsxs("span",{className:"label",children:[y.kind??"page"," / ",y.status??"active"]}),_.jsx("strong",{className:"card-title",children:y.title}),y.sourceType?_.jsxs("p",{className:"text-muted text-sm",children:["Source: ",y.sourceType]}):null,y.sourceClass?_.jsxs("p",{className:"text-muted text-sm",children:["Class: ",y.sourceClass]}):null,_.jsx("p",{className:"text-muted text-sm",children:y.projectIds.length?y.projectIds.join(", "):"global"}),_.jsx("p",{className:"text-secondary text-sm",children:KU(y.snippet,n)})]},`${y.pageId}:${y.path}`))}),m.length>c?_.jsxs("div",{className:"action-row",children:[_.jsxs("button",{type:"button",className:"btn",onClick:()=>h(y=>y+f),children:["Show ",Math.min(f,m.length-c)," more"]}),_.jsxs("span",{className:"text-muted text-sm action-row-end",children:["Showing ",Math.min(c,m.length)," of ",m.length]})]}):null]}):_.jsx("div",{className:"empty-state",children:_.jsx("p",{className:"text-muted text-sm",children:n.trim().length>=2?"No pages matched this query.":"Search the wiki, outputs, or candidate pages."})}),i.length&&l?_.jsxs("div",{className:"recent-searches",children:[_.jsx("span",{className:"label",children:"Recent"}),i.slice(0,6).map(y=>_.jsx("button",{type:"button",className:"chip chip-tag",onClick:()=>l(y),children:y},y))]}):null]})}function XU({selected:t,graphExplain:e,graphError:n,onNavigateNode:r}){if(!t)return _.jsxs("section",{className:"panel","data-selected-node-id":"","data-testid":"selection-panel",children:[_.jsx("h3",{className:"panel-heading",children:"Selection"}),_.jsxs("div",{className:"empty-state",children:[_.jsx("span",{className:"empty-state-icon",children:"β"}),_.jsx("p",{className:"text-muted text-sm",children:"Select a node to inspect graph metrics and linked pages."})]})]});const i=t.sourceIds.length>3?`${t.sourceIds.slice(0,3).join(", ")} +${t.sourceIds.length-3} more`:t.sourceIds.join(", ")||"None";return _.jsxs("section",{className:"panel","data-selected-node-id":t.id,"data-testid":"selection-panel",children:[_.jsx("h3",{className:"panel-heading",children:"Selection"}),n?_.jsx("p",{className:"text-error",children:n}):null,_.jsx("span",{className:"label",children:t.type}),_.jsx("h4",{className:"card-title",style:{margin:"4px 0 8px"},children:t.label}),_.jsxs("div",{className:"meta-grid",children:[_.jsx("span",{className:"meta-label",children:"ID"}),_.jsx("code",{className:"meta-value meta-value-truncate",title:t.id,children:t.id}),t.language?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"meta-label",children:"Language"}),_.jsx("span",{className:"meta-value",title:t.language,children:t.language})]}):null,t.symbolKind?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"meta-label",children:"Symbol"}),_.jsx("span",{className:"meta-value",title:t.symbolKind,children:t.symbolKind})]}):null,t.moduleId?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"meta-label",children:"Module"}),_.jsx("code",{className:"meta-value meta-value-truncate",title:t.moduleId,children:t.moduleId})]}):null,_.jsx("span",{className:"meta-label",children:"Sources"}),_.jsx("span",{className:"meta-value",title:t.sourceIds.join(", ")||"None",children:i}),_.jsx("span",{className:"meta-label",children:"Projects"}),_.jsx("span",{className:"meta-value",title:t.projectIds.join(", ")||"Global",children:t.projectIds.join(", ")||"Global"}),_.jsx("span",{className:"meta-label",children:"Community"}),_.jsx("span",{className:"meta-value",title:t.communityId??"Unassigned",children:t.communityId??"Unassigned"}),_.jsx("span",{className:"meta-label",children:"Degree"}),_.jsx("span",{className:"meta-value mono",children:t.degree??0}),_.jsx("span",{className:"meta-label",children:"Bridge"}),_.jsx("span",{className:"meta-value mono",children:t.bridgeScore??0}),_.jsx("span",{className:"meta-label",children:"God node"}),_.jsx("span",{className:"meta-value",children:t.isGodNode?"Yes":"No"})]}),e?.hyperedges.length?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Group Patterns"}),_.jsx("div",{className:"chip-row",children:e.hyperedges.slice(0,6).map(l=>_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{const s=l.nodeIds.find(u=>u!==t.id)??l.nodeIds[0];s&&r(s)},children:l.label},l.id))}),e.hyperedges[0]?.why?_.jsx("p",{className:"text-secondary text-sm",children:e.hyperedges[0].why}):null]}):null,e?.neighbors.length?_.jsxs("div",{className:"linked-section",children:[_.jsx("span",{className:"label",children:"Neighbors"}),_.jsx("div",{className:"chip-row",children:e.neighbors.slice(0,8).map(l=>_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>r(l.nodeId),children:l.label},`${l.direction}:${l.nodeId}:${l.relation}`))})]}):null]})}function ZU({nodeCount:t,edgeCount:e,communityCount:n,approvalCount:r,candidateCount:i,pendingRefreshCount:l,benchmarkRatio:s}){const u=r+i+l;return _.jsxs("div",{className:"stats-strip",children:[_.jsxs("div",{className:"stats-group",children:[_.jsxs("div",{className:"stat",children:[_.jsx("span",{className:"stat-label",children:"Nodes"}),_.jsx("span",{className:"stat-value",children:t.toLocaleString()})]}),_.jsxs("div",{className:"stat",children:[_.jsx("span",{className:"stat-label",children:"Edges"}),_.jsx("span",{className:"stat-value",children:e.toLocaleString()})]}),_.jsxs("div",{className:"stat",children:[_.jsx("span",{className:"stat-label",children:"Communities"}),_.jsx("span",{className:"stat-value",children:n})]}),_.jsxs("div",{className:"stat",children:[_.jsx("span",{className:"stat-label",children:"Benchmark"}),_.jsx("span",{className:"stat-value",children:s!=null?`${(s*100).toFixed(1)}%`:"β"})]})]}),u>0?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"stats-divider"}),_.jsxs("div",{className:"stats-group",children:[r>0?_.jsxs("div",{className:"stat",children:[_.jsx("span",{className:"stat-label",children:"Approvals"}),_.jsx("span",{className:"stat-value",children:r})]}):null,i>0?_.jsxs("div",{className:"stat",children:[_.jsx("span",{className:"stat-label",children:"Candidates"}),_.jsx("span",{className:"stat-value",children:i})]}):null,l>0?_.jsxs("div",{className:"stat",children:[_.jsx("span",{className:"stat-label",children:"Refresh"}),_.jsx("span",{className:"stat-value",children:l})]}):null]})]}):null]})}const QU=[{value:"light",label:"L",aria:"Use light theme"},{value:"system",label:"A",aria:"Match system theme"},{value:"dark",label:"D",aria:"Use dark theme"}];function WU({theme:t,onChange:e}){return _.jsx("fieldset",{className:"theme-toggle-options","aria-label":"Theme selector",children:QU.map(n=>_.jsx("button",{type:"button","aria-label":n.aria,"aria-pressed":t===n.value,className:t===n.value?"is-active":"",onClick:()=>e(n.value),title:n.aria,children:n.label},n.value))})}function JU({entry:t,onUndo:e,onDismiss:n}){return t?_.jsxs("div",{className:"undo-toast",role:"status","aria-live":"polite",children:[_.jsx("span",{children:t.label}),_.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>{e()},children:"Undo"}),_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:n,"aria-label":"Dismiss",children:"Γ"})]}):null}const e9=50;function t9(t="/api/events"){const[e,n]=Ee.useState({events:[],connected:!1,error:null});return Ee.useEffect(()=>{if(typeof window>"u"||typeof EventSource>"u")return;let r=!1,i=null,l=null,s=0;const u=()=>{try{i=new EventSource(t)}catch(f){if(r)return;n(c=>({...c,error:f instanceof Error?f.message:String(f),connected:!1}));return}i.onopen=()=>{r||(s=0,n(f=>({...f,connected:!0,error:null})))},i.onerror=()=>{if(r)return;n(c=>({...c,connected:!1})),i?.close(),s+=1;const f=Math.min(15e3,500*2**Math.min(s,5));l=setTimeout(u,f)},i.onmessage=f=>{if(!r)try{const c=JSON.parse(f.data);n(h=>({...h,events:[c,...h.events].slice(0,e9)}))}catch{}}};return u(),()=>{r=!0,l&&clearTimeout(l),i?.close()}},[t]),e}function yS(t){const e=t.startsWith("#")?t.slice(1):t;if(!e)return{view:"",params:{}};const[n,r=""]=e.split("?"),i={};if(r)for(const l of r.split("&")){const[s,u]=l.split("=");s&&(i[decodeURIComponent(s)]=u?decodeURIComponent(u):"")}return{view:decodeURIComponent(n??""),params:i}}function n9(t){const e=t.view?encodeURIComponent(t.view):"",n=Object.entries(t.params).filter(([,i])=>i!=null&&i!=="");if(!n.length)return e?`#${e}`:"";const r=n.map(([i,l])=>`${encodeURIComponent(i)}=${encodeURIComponent(l)}`).join("&");return`#${e}?${r}`}function r9(){const[t,e]=Ee.useState(()=>typeof window>"u"?{view:"",params:{}}:yS(window.location.hash));Ee.useEffect(()=>{if(typeof window>"u")return;const r=()=>e(yS(window.location.hash));return window.addEventListener("hashchange",r),()=>window.removeEventListener("hashchange",r)},[]);const n=Ee.useCallback(r=>{if(typeof window>"u")return;const i=n9(r);i!==window.location.hash&&(window.location.hash=i),e(r)},[]);return{route:t,navigate:n}}function a9(t){if(!(t instanceof HTMLElement))return!1;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"||t.isContentEditable}function i9(t,e){if(t.key.toLowerCase()!==e.key.toLowerCase())return!1;const n=t.metaKey||t.ctrlKey;return!(!!e.meta!==n||!!e.shift!==t.shiftKey||!!e.alt!==t.altKey)}function l9(t){Ee.useEffect(()=>{if(typeof window>"u")return;const e=n=>{const r=a9(n.target);for(const i of t)if(i9(n,i)&&!(r&&!i.allowInInput)){n.preventDefault(),i.handler(n);return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t])}const qD="swarmvault.viewer.theme";function s9(){if(typeof window>"u")return"system";try{const t=window.localStorage.getItem(qD);if(t==="light"||t==="dark"||t==="system")return t}catch{}return"system"}function o9(t){if(typeof document>"u")return;const e=document.documentElement;t==="system"?e.removeAttribute("data-theme"):e.setAttribute("data-theme",t)}function u9(){const[t,e]=Ee.useState(()=>s9());Ee.useEffect(()=>{o9(t)},[t]);const n=Ee.useCallback(r=>{e(r);try{window.localStorage.setItem(qD,r)}catch{}},[]);return{theme:t,setTheme:n}}const c9=6e3;function f9(t=c9){const[e,n]=Ee.useState(null),r=Ee.useRef(null),i=Ee.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),n(null)},[]),l=Ee.useCallback((u,f)=>{r.current&&clearTimeout(r.current);const c=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,h=Date.now()+t;n({id:c,label:u,expiresAt:h,undo:f}),r.current=setTimeout(()=>{n(v=>v?.id===c?null:v)},t)},[t]),s=Ee.useCallback(async()=>{e&&(await e.undo(),i())},[i,e]);return Ee.useEffect(()=>()=>i(),[i]),{entry:e,push:l,performUndo:s,dismiss:i}}const d9=()=>({generatedAt:"",nodes:[],edges:[],hyperedges:[],communities:[],pages:[]}),h9={graph:null,graphReport:null,approvals:[],approvalDetail:null,candidates:[],watchStatus:null,lintFindings:[],loading:!0,errors:{}};function v9(t,e){switch(e.type){case"snapshot":return{...t,...e.payload,errors:{...t.errors,...e.payload.errors??{}},loading:!1};case"approvalDetail":return{...t,approvalDetail:e.payload.detail,errors:{...t.errors,approval:e.payload.error}};case"error":return{...t,errors:{...t.errors,[e.key]:e.message}};case"loading":return{...t,loading:e.value};default:return t}}function g9(){const[t,e]=Ee.useReducer(v9,h9),n=Ee.useRef(!1),r=Ee.useCallback(async()=>{if(!n.current){n.current=!0;try{const l={},[s,u,f,c,h]=await Promise.all([yk().catch(()=>d9()),wk().catch(p=>(l.approval=p instanceof Error?p.message:String(p),[])),Ck().catch(p=>(l.candidate=p instanceof Error?p.message:String(p),[])),Tk().catch(p=>(l.watch=p instanceof Error?p.message:String(p),{generatedAt:"",watchedRepoRoots:[],pendingSemanticRefresh:[]})),Dk().catch(p=>(l.lint=p instanceof Error?p.message:String(p),[]))]),v=await Ek().catch(()=>null);Ee.startTransition(()=>{e({type:"snapshot",payload:{graph:s,graphReport:v,approvals:u,candidates:f,watchStatus:c,lintFindings:h,errors:l}})})}finally{n.current=!1}}},[]);Ee.useEffect(()=>{r()},[r]);const i=Ee.useCallback(async l=>{if(!l){e({type:"approvalDetail",payload:{detail:null}});return}try{const s=await Sk(l);e({type:"approvalDetail",payload:{detail:s}})}catch(s){e({type:"approvalDetail",payload:{detail:null,error:s instanceof Error?s.message:String(s)}})}},[]);return{state:t,refresh:r,loadApprovalDetail:i,dispatch:e}}const HD="swarmvault.viewer.recentSearches",p9=6;function Ss(t){return[...new Set(t.filter(Boolean))]}function m9(){if(typeof window>"u")return[];try{const t=window.localStorage.getItem(HD);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(n=>typeof n=="string"):[]}catch{return[]}}function y9(t){if(!(typeof window>"u"))try{window.localStorage.setItem(HD,JSON.stringify(t))}catch{}}function b9(){const t=Ee.useRef(null),{state:e,refresh:n,loadApprovalDetail:r}=g9(),{graph:i,graphReport:l,approvals:s,approvalDetail:u,candidates:f,watchStatus:c,lintFindings:h,loading:v,errors:p}=e,{theme:m,setTheme:y}=u9(),{route:w,navigate:S}=r9(),x=f9(),C=t9(),[T,A]=Ee.useState(null),[N,k]=Ee.useState("all"),[D,O]=Ee.useState("all"),[L,M]=Ee.useState("all"),[z,B]=Ee.useState("all"),[U,V]=Ee.useState("all"),[$,q]=Ee.useState("all"),[H,Y]=Ee.useState("all"),[Q,P]=Ee.useState("all"),[I,K]=Ee.useState(""),[F,J]=Ee.useState([]),[re,se]=Ee.useState("relevance"),[me,Ne]=Ee.useState(()=>m9()),[pe,ee]=Ee.useState(""),[le,de]=Ee.useState(null),[xe,Re]=Ee.useState(""),[$e,Ye]=Ee.useState(""),[lt,We]=Ee.useState(null),[et,ze]=Ee.useState(null),[Ge,tt]=Ee.useState(null),[ot,Pe]=Ee.useState(null),[pt,ue]=Ee.useState(null),[Te,Oe]=Ee.useState(null),[Xe,Le]=Ee.useState(null),[Ue,ye]=Ee.useState(""),[G,te]=Ee.useState("approvals"),[fe,ce]=Ee.useState(""),[we,Ie]=Ee.useState(!1),[ke,Ve]=Ee.useState(!1),[Ke,Qe]=Ee.useState("none"),[ut,X]=Ee.useState(0),ne=Ee.useDeferredValue(I),Ce=Ee.useMemo(()=>!Ge||!i?null:i.pages?.find(oe=>oe.path===Ge.path||oe.id===(typeof Ge.frontmatter.page_id=="string"?Ge.frontmatter.page_id:""))??null,[Ge,i]),Fe=Ee.useMemo(()=>Ss(i?.pages?.flatMap(oe=>oe.projectIds??[])??[]).sort((oe,ie)=>oe.localeCompare(ie)),[i]),mt=Ee.useMemo(()=>Ss(i?.pages?.flatMap(oe=>oe.kind==="source"&&oe.sourceType?[oe.sourceType]:[]).sort((oe,ie)=>oe.localeCompare(ie))??[]),[i]),ft=Ee.useMemo(()=>Ss(i?.pages?.flatMap(oe=>oe.sourceClass?[oe.sourceClass]:[]).sort((oe,ie)=>oe.localeCompare(ie))??[]),[i]),He=Ee.useMemo(()=>Ss((i?.communities??[]).map(oe=>oe.id)).sort((oe,ie)=>oe.localeCompare(ie)),[i]),Me=Ee.useMemo(()=>{const oe={};for(const ie of i?.pages??[]){const Ae=ie.tags??ie.semantic_tags;Array.isArray(Ae)&&(oe[ie.id]=Ae.filter(Je=>typeof Je=="string"))}return oe},[i]),Ze=Ee.useMemo(()=>{const oe=new Map;for(const ie of i?.pages??[]){const Ae=Me[ie.id]??[];for(const Je of Ae)oe.set(Je,(oe.get(Je)??0)+1)}return[...oe.entries()].map(([ie,Ae])=>({tag:ie,count:Ae})).sort((ie,Ae)=>Ae.count-ie.count||ie.tag.localeCompare(Ae.tag))},[i,Me]),Et=Ee.useMemo(()=>Ce?Ss(Ce.backlinks).map(oe=>i?.pages?.find(ie=>ie.id===oe)??null).filter(oe=>!!oe):[],[Ce,i]),yt=Ee.useMemo(()=>Ce?Ss(Ce.relatedPageIds).map(oe=>i?.pages?.find(ie=>ie.id===oe)??null).filter(oe=>!!oe):[],[Ce,i]),Nn=Ee.useMemo(()=>i?.pages?.filter(oe=>oe.kind==="graph_report"||oe.kind==="community_summary")??[],[i]),Bt=i?.presentation,Gn=Bt?.mode==="overview";Ee.useEffect(()=>{y9(me)},[me]),Ee.useEffect(()=>{if(!s.length){ce("");return}(!fe||!s.some(oe=>oe.approvalId===fe))&&ce(s[0]?.approvalId??"")},[s,fe]),Ee.useEffect(()=>{r(fe||void 0)},[fe,r]),Ee.useEffect(()=>{if(!C.events.length)return;const oe=C.events[0];oe&&["compile","ingest","watch","approval","candidate","lint"].includes(oe.type)&&n()},[C.events,n]),Ee.useEffect(()=>{if(!T){ze(null);return}let oe=!1;return xk(T.id).then(ie=>{oe||(ze(ie),Oe(null))}).catch(ie=>{oe||Oe(ie instanceof Error?ie.message:String(ie))}),()=>{oe=!0}},[T]),Ee.useEffect(()=>{const oe=ne.trim();if(oe.length<2){J([]),ue(null);return}let ie=!1;return xS(oe,{limit:50,kind:D,status:L,project:z,sourceType:$,sourceClass:H}).then(Ae=>{ie||Ee.startTransition(()=>{J(Ae),ue(null),Ne(Je=>oe?[oe,...Je.filter(Pt=>Pt!==oe)].slice(0,p9):Je)})}).catch(Ae=>{ie||ue(Ae instanceof Error?Ae.message:String(Ae))}),()=>{ie=!0}},[ne,D,L,z,$,H]),Ee.useEffect(()=>{if(!T?.pageId)return;const oe=i?.pages?.find(Ae=>Ae.id===T.pageId);if(!oe)return;let ie=!1;return IE(oe.path).then(Ae=>{ie||(tt(Ae),Pe(null))}).catch(Ae=>{ie||Pe(Ae instanceof Error?Ae.message:String(Ae))}),()=>{ie=!0}},[i,T]);const Ft=Ee.useCallback(async(oe,ie)=>{try{const Ae=await IE(oe);if(tt(Ae),Pe(null),S({view:"page",params:{path:oe,id:ie??""}}),i&&t.current){const Je=i.pages?.find(Pt=>Pt.path===oe||(ie?Pt.id===ie:!1)),Dt=(ie?i.nodes.find(Pt=>Pt.pageId===ie):void 0)??i.nodes.find(Pt=>Je?.nodeIds?.includes(Pt.id));Dt&&(t.current.elements().unselect(),t.current.getElementById(Dt.id).select(),t.current.center(t.current.getElementById(Dt.id)))}}catch(Ae){Pe(Ae instanceof Error?Ae.message:String(Ae))}},[i,S]),Vt=Ee.useCallback(async oe=>{await Ft(oe.path,oe.pageId)},[Ft]),yn=Ee.useCallback(async(oe,ie)=>{if(!fe)return;const Ae=fe;ye(`${ie}:${oe}`),Le(null);try{await Zc(Ae,ie,[oe]),await n(),await r(Ae),x.push(`${ie==="accept"?"Accepted":"Rejected"} 1 entry`,async()=>{await Zc(Ae,ie==="accept"?"reject":"accept",[oe]),await n(),await r(Ae)})}catch(Je){Le(Je instanceof Error?Je.message:String(Je))}finally{ye("")}},[r,n,fe,x]),Vn=Ee.useCallback(async(oe,ie)=>{if(!fe||!oe.length)return;const Ae=fe;ye(`bulk:${ie}`),Le(null);try{await Zc(Ae,ie,oe),await n(),await r(Ae),x.push(`${ie==="accept"?"Accepted":"Rejected"} ${oe.length} entries`,async()=>{await Zc(Ae,ie==="accept"?"reject":"accept",oe),await n(),await r(Ae)})}catch(Je){Le(Je instanceof Error?Je.message:String(Je))}finally{ye("")}},[r,n,fe,x]),Sn=Ee.useCallback(async(oe,ie,Ae)=>{ye(`${ie}:${oe}`),Le(null);try{const Je=await PE(oe,ie);await n(),ie==="promote"?await Ft(Je.path,Je.pageId):Ae&&tt(null)}catch(Je){Le(Je instanceof Error?Je.message:String(Je))}finally{ye("")}},[Ft,n]),bn=Ee.useCallback(async(oe,ie)=>{if(oe.length){ye(`bulk-candidate:${ie}`),Le(null);try{for(const Ae of oe)await PE(Ae,ie);await n()}catch(Ae){Le(Ae instanceof Error?Ae.message:String(Ae))}finally{ye("")}}},[n]),En=Ee.useCallback(async()=>{if(!pe.trim()){de(null);return}try{const oe=await bk(pe,{budget:12});de(oe),Oe(null)}catch(oe){Oe(oe instanceof Error?oe.message:String(oe))}},[pe]),Gr=Ee.useCallback(async()=>{if(!xe.trim()||!$e.trim()){We(null);return}try{const oe=await zE(xe,$e);We(oe),Oe(null)}catch(oe){Oe(oe instanceof Error?oe.message:String(oe))}},[xe,$e]),rn=Ee.useCallback(oe=>{const ie=t.current?.getElementById(oe);ie&&(t.current?.elements().unselect(),ie.select(),t.current?.center(ie)),S({view:"node",params:{id:oe}})},[S]);Ee.useEffect(()=>{w.view==="page"&&w.params.path&&w.params.path!==Ge?.path&&Ft(w.params.path,w.params.id),w.view==="node"&&w.params.id&&rn(w.params.id),w.view==="tag"&&w.params.tag&&P(w.params.tag),w.view==="approval"&&w.params.id&&(te("approvals"),ce(w.params.id))},[w,Ft,rn,Ge?.path]);const ha=Ee.useCallback(async(oe,ie)=>{Re(oe),Ye(ie);try{const Ae=await zE(oe,ie);We(Ae),Oe(null)}catch(Ae){Oe(Ae instanceof Error?Ae.message:String(Ae))}},[]),Cn=Ee.useCallback(()=>{document.querySelector('input[aria-label="Search pages"]')?.focus()},[]),sr=Ee.useCallback(()=>{document.querySelector('[data-testid="graph-query-input"]')?.focus()},[]),vr=Ee.useCallback(()=>{document.querySelector('[data-testid="graph-path-from"]')?.focus()},[]),Vr=Ee.useMemo(()=>[{id:"refresh",label:"Refresh workspace",section:"View",shortcut:"R",run:()=>{n()}},{id:"fit",label:"Fit graph to viewport",section:"Graph",shortcut:"F",run:()=>X(oe=>oe+1)},{id:"search",label:"Focus search",section:"Search",shortcut:"/",run:Cn},{id:"graph-query",label:"Focus graph query",section:"Graph",shortcut:"Q",run:sr},{id:"graph-path",label:"Focus graph path",section:"Graph",shortcut:"P",run:vr},{id:"open-approvals",label:"Open approvals tab",section:"Workflow",run:()=>te("approvals")},{id:"open-candidates",label:"Open candidates tab",section:"Workflow",run:()=>te("candidates")},{id:"open-refresh",label:"Open refresh tab",section:"Workflow",run:()=>te("refresh")},{id:"open-activity",label:"Open activity tab",section:"Workflow",run:()=>te("activity")},{id:"open-lint",label:"Open lint tab",section:"Workflow",run:()=>te("lint")},{id:"theme-light",label:"Theme: light",section:"Theme",run:()=>y("light")},{id:"theme-dark",label:"Theme: dark",section:"Theme",run:()=>y("dark")},{id:"theme-system",label:"Theme: system",section:"Theme",run:()=>y("system")},{id:"drawer-sidebar",label:"Toggle filter sidebar",section:"Layout",run:()=>Qe(oe=>oe==="sidebar"?"none":"sidebar")},{id:"drawer-rail",label:"Toggle detail rail",section:"Layout",run:()=>Qe(oe=>oe==="rail"?"none":"rail")},{id:"help",label:"Show keyboard shortcuts",section:"Help",shortcut:"?",run:()=>Ve(!0)},...Ze.slice(0,12).map(oe=>({id:`tag-${oe.tag}`,label:`Filter by tag: ${oe.tag}`,section:"Tags",keywords:["tag",oe.tag],run:()=>{P(oe.tag),S({view:"tag",params:{tag:oe.tag}})}}))],[Cn,sr,vr,S,n,y,Ze]),fn=Ee.useMemo(()=>[{key:"k",meta:!0,description:"Open command palette",handler:()=>Ie(!0),allowInInput:!0},{key:"?",shift:!0,description:"Show shortcut help",handler:()=>Ve(!0)},{key:"/",description:"Focus search",handler:Cn},{key:"f",description:"Fit graph",handler:()=>X(oe=>oe+1)},{key:"q",description:"Focus graph query",handler:sr},{key:"p",description:"Focus path-from",handler:vr},{key:"r",description:"Refresh workspace",handler:()=>{n()}},{key:"Escape",description:"Close overlays",handler:()=>{Ie(!1),Ve(!1),Qe("none")},allowInInput:!0},{key:"[",description:"Toggle sidebar drawer",handler:()=>Qe(oe=>oe==="sidebar"?"none":"sidebar")},{key:"]",description:"Toggle rail drawer",handler:()=>Qe(oe=>oe==="rail"?"none":"rail")}],[Cn,sr,vr,n]);l9(fn);const Ja=Ee.useMemo(()=>Ge?{title:Ge.title,content:Ge.content}:null,[Ge]),ia=T?[T.id]:[];return _.jsxs("div",{className:"app-shell",children:[_.jsxs("header",{className:"app-bar",children:[_.jsx("button",{type:"button",className:"app-bar-icon-btn drawer-trigger","aria-label":"Toggle filter sidebar",onClick:()=>Qe(oe=>oe==="sidebar"?"none":"sidebar"),children:"β°"}),_.jsx("span",{className:"app-bar-title",children:"SwarmVault"}),_.jsx("span",{className:"app-bar-subtitle",children:"Graph Viewer"}),_.jsx("span",{className:"app-bar-spacer"}),_.jsxs("div",{className:"app-bar-actions",children:[_.jsx(Nk,{cyRef:t,graph:i,selectedNodeIds:ia,pageMarkdown:Ja}),_.jsx("button",{type:"button",className:"app-bar-icon-btn",onClick:()=>Ie(!0),title:"Command palette (βK)","aria-label":"Open command palette",children:"βK"}),_.jsx("button",{type:"button",className:"app-bar-icon-btn",onClick:()=>Ve(!0),title:"Keyboard shortcuts (?)","aria-label":"Show keyboard shortcuts",children:"?"}),_.jsx(WU,{theme:m,onChange:y}),_.jsx("button",{type:"button",className:"app-bar-icon-btn drawer-trigger","aria-label":"Toggle detail rail",onClick:()=>Qe(oe=>oe==="rail"?"none":"rail"),children:"β§"})]})]}),_.jsx("div",{className:`drawer-backdrop${Ke!=="none"?" is-open":""}`,onClick:()=>Qe("none"),"aria-hidden":"true"}),_.jsx("div",{className:`sidebar${Ke==="sidebar"?" is-open":""}`,children:_.jsx(Rk,{edgeStatusFilter:N,onEdgeStatusChange:k,kindFilter:D,onKindChange:O,pageStatusFilter:L,onPageStatusChange:M,projectFilter:z,onProjectChange:B,projectOptions:Fe,sourceTypeFilter:$,onSourceTypeChange:q,sourceTypeOptions:mt,sourceClassFilter:H,onSourceClassChange:Y,sourceClassOptions:ft,communityFilter:U,onCommunityChange:V,communityOptions:He,tagFilter:Q,onTagChange:oe=>{P(oe),S({view:"tag",params:{tag:oe==="all"?"":oe}})},tagOptions:Ze,query:I,onQueryChange:K})}),_.jsxs("div",{className:"center-area",children:[_.jsx(ZU,{generatedAt:i?.generatedAt??null,nodeCount:Bt?.totalNodes??i?.nodes.length??0,edgeCount:Bt?.totalEdges??i?.edges.length??0,communityCount:Bt?.totalCommunities??i?.communities?.length??0,approvalCount:s.reduce((oe,ie)=>oe+ie.pendingCount,0),candidateCount:f.length,pendingRefreshCount:c?.pendingSemanticRefresh.length??0,benchmarkRatio:l?.benchmark?.summary.reductionRatio??null}),Gn?_.jsxs("div",{className:"overview-banner","data-testid":"graph-overview-banner",children:["Overview mode: showing ",Bt?.displayedNodes.toLocaleString()," of ",Bt?.totalNodes.toLocaleString()," ","nodes. Use ",_.jsx("code",{children:"--full"})," to render the entire graph."]}):null,v&&!i?_.jsx("div",{className:"canvas canvas-loading",children:_.jsx("span",{className:"loading-text",children:"Loading graph dataβ¦"})}):!v&&i&&i.nodes.length===0?_.jsxs("div",{className:"canvas canvas-loading canvas-empty",children:[_.jsx("span",{className:"canvas-empty-icon",children:"β"}),_.jsx("span",{className:"text-muted",children:"No nodes in the current graph view."})]}):_.jsx(mL,{graph:i,edgeStatusFilter:N,communityFilter:U,sourceClassFilter:H,tagFilter:Q,pageTags:Me,pathResult:lt,onNodeSelect:A,cyRef:t,fitTrigger:ut}),_.jsx($U,{graphReport:l,onOpenPage:Ft,onNavigateNode:rn,onHighlightSurprise:ha})]}),_.jsxs("aside",{className:`detail-rail${Ke==="rail"?" is-open":""}`,children:[_.jsx(yL,{graphQueryInput:pe,onGraphQueryInputChange:ee,onRunQuery:()=>{En()},graphQueryResult:le,pathFrom:xe,onPathFromChange:Re,pathTo:$e,onPathToChange:Ye,onHighlightPath:()=>{Gr()},pathResult:lt,graphError:Te,graph:i,onOpenPage:Ft,onNavigateNode:rn}),_.jsx(XU,{selected:T,graphExplain:et,graphError:Te,onNavigateNode:rn}),_.jsx(YU,{results:F,searchError:pt,query:I,onOpenResult:Vt,recentQueries:me,onSelectRecent:oe=>K(oe),sort:re,onSortChange:se}),_.jsxs(UD,{tabs:[{id:"approvals",label:"Approvals",count:s.reduce((oe,ie)=>oe+ie.pendingCount,0)},{id:"candidates",label:"Candidates",count:f.length},{id:"refresh",label:"Refresh",count:c?.pendingSemanticRefresh.length??0},{id:"activity",label:"Activity",count:C.events.length},{id:"lint",label:"Lint",count:h.length}],activeTab:G,onTabChange:te,children:[G==="approvals"&&_.jsx(ok,{approvals:s,selectedApprovalId:fe,onSelectApproval:oe=>{ce(oe),S({view:"approval",params:{id:oe}})},approvalDetail:u,approvalError:p.approval??null,actionError:Xe,busyAction:Ue,onReviewAction:(oe,ie)=>{yn(oe,ie)},onBulkReview:(oe,ie)=>{Vn(oe,ie)},onOpenPage:Ft}),G==="candidates"&&_.jsx(ck,{candidates:f,candidateError:p.candidate??null,busyAction:Ue,onCandidateAction:(oe,ie,Ae)=>{Sn(oe,ie,Ae)},onBulkCandidateAction:(oe,ie)=>{bn(oe,ie)},onOpenPage:Ft}),G==="refresh"&&_.jsx(VU,{watchStatus:c,watchError:p.watch??null}),G==="activity"&&_.jsx(ak,{events:C.events,connected:C.connected,error:C.error}),G==="lint"&&_.jsx(EL,{findings:h,error:p.lint,onOpenPage:Ft})]}),_.jsx(GU,{activePage:Ge,pageError:ot,backlinkPages:Et,relatedPages:yt,graphPageLinks:Nn,onOpenPage:Ft,onNavigateNode:rn})]}),_.jsx(dk,{open:we,onClose:()=>Ie(!1),commands:Vr}),ke?_.jsx("div",{className:"palette-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",onClick:oe=>{oe.target===oe.currentTarget&&Ve(!1)},onKeyDown:oe=>{oe.key==="Escape"&&Ve(!1)},children:_.jsxs("div",{className:"help-modal",children:[_.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[_.jsx("h3",{className:"panel-heading",children:"Keyboard Shortcuts"}),_.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>Ve(!1),children:"Γ"})]}),_.jsx("div",{className:"shortcut-grid",children:fn.map(oe=>_.jsxs("div",{className:"shortcut-row",children:[_.jsx("span",{children:oe.description}),_.jsxs("span",{className:"kbd",children:[oe.meta?"β":"",oe.shift?"β§":"",oe.alt?"β₯":"",oe.key.toUpperCase()]})]},oe.description))})]})}):null,_.jsx(JU,{entry:x.entry,onUndo:x.performUndo,onDismiss:x.dismiss})]})}nk.createRoot(document.getElementById("root")).render(_.jsx(Y_.StrictMode,{children:_.jsx(b9,{})}));
|